Просмотр исходного кода

[统计][修改][完善欠缴商户]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
da64c9deb6
5 измененных файлов: 57 добавлений и 142 удалений
  1. +0
    -22
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java
  2. +0
    -5
      mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java
  3. +0
    -6
      mallinkService/src/main/java/com/iformall/service/WxBillAllService.java
  4. +0
    -17
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  5. +57
    -92
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml

+ 0
- 22
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java Просмотреть файл

@@ -97,28 +97,6 @@ public class WxBillAllController extends BaseController {
return new ResultData(result);
}

/**
* 代缴商户列表
* @param wxBillAll
* @param pageNum
* @param pageSize
* @return
*/
@GetMapping("waitMerchantlist")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
@SystemControllerLog(description = "费用收缴数据-代缴商户列表")
public ResultData waitMerchantlist(@ModelAttribute WxBillAll wxBillAll, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxBillAllController::waitMerchantlist");
if (null == wxBillAll) {
wxBillAll = new WxBillAll();
}
wxBillAll.setTenantId(getTenantId());
Map<String, Object> result = wxBillAllService.getWaitBillAsPage(wxBillAll, pageNum, pageSize);
return new ResultData(result);
}


@ApiOperation("导出欠缴商户列表")
@GetMapping("/exportOweMerchantlist")


+ 0
- 5
mallinkService/src/main/java/com/iformall/mapper/WxBillAllMapper.java Просмотреть файл

@@ -42,9 +42,4 @@ public interface WxBillAllMapper {
*/
List<Map<String, Object>> getOweBillAsPage(WxBillAll record);

/**
* 代缴商户分页列表
* @return
*/
List<Map<String, Object>> getWaitBillAsPage(WxBillAll record);
}

+ 0
- 6
mallinkService/src/main/java/com/iformall/service/WxBillAllService.java Просмотреть файл

@@ -43,12 +43,6 @@ public interface WxBillAllService {
*/
Map<String, Object> getOweBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize);

/**
* 代缴商户分页列表
* @return
*/
Map<String, Object> getWaitBillAsPage(WxBillAll record,Integer pageNum, Integer pageSize);

void exportOweMerchant(WxBillAll record, HttpServletRequest request, HttpServletResponse response);

void updateBillStatus(WxBillAll record);


+ 0
- 17
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Просмотреть файл

@@ -755,23 +755,6 @@ public class WxBillAllServiceImpl implements WxBillAllService {
return result;
}

@Override
public Map<String, Object> getWaitBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize) {
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxBillAllMapper.getWaitBillAsPage(record));
List<Map<String, Object>> list = pageInfo.getList();
for (Map<String, Object> map:list) {
map.put("rentOwe",subZeroAndDot(map.get("rentOwe").toString()));
map.put("propertyOwe",subZeroAndDot(map.get("propertyOwe").toString()));
map.put("depositOwe",subZeroAndDot(map.get("depositOwe").toString()));
map.put("otherOwe",subZeroAndDot(map.get("otherOwe").toString()));
map.put("totalOwe",subZeroAndDot(map.get("totalOwe").toString()));
}
pageInfo.setList(list);
Map<String, Object> result = new HashMap<>();
result.put("pageInfo", pageInfo);
return result;
}

/**
* 使用java正则表达式去掉多余的.与0
* @param s


+ 57
- 92
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml Просмотреть файл

@@ -496,116 +496,82 @@
select bill.tenant_id tenantId,bill.merchant_id merchantId,m.name merchantName,bill.bill_type billType,
m.link_phone managerPhone,m.`link_person` manager,m.email,
bill.receive_date receiveDate,DATEDIFF(now(),bill.receive_date) expiredDay,ws.building,ws.floor,
round(bill.rentOwe/100,2) rentOwe,round(bill.propertyOwe/100,2) propertyOwe,
round(bill.depositOwe/100,2) depositOwe,round(bill.otherOwe/100,2) otherOwe,
round((bill.rentOwe+bill.propertyOwe+bill.depositOwe+bill.otherOwe)/100,2) totalOwe
round(bill.rentOwe/100,2) rentOwe,
round(bill.propertyOwe/100,2) propertyOwe,
round(bill.depositOwe/100,2) depositOwe,
round(bill.otherOwe/100,2) otherOwe,
round((bill.rentOwe+bill.propertyOwe+bill.depositOwe+bill.otherOwe)/100,2) totalOwe,

<choose>
<when test="1==filterHasPay">
round((bill.rentReceivePay-bill.rentPay)/100,2) rentReceivePay,
round((bill.propertyReceivePay-bill.propertyPay)/100,2) propertyReceivePay,
round((bill.depositReceivePay-bill.depositPay)/100,2) depositReceivePay,
round((bill.otherReceivePay-bill.otherPay)/100,2) otherReceivePay,
round((bill.rentReceivePay+bill.propertyReceivePay+bill.depositReceivePay+bill.otherReceivePay
-bill.rentPay-bill.propertyPay-bill.depositPay-bill.otherPay)/100,2) totalReceivePay
</when>
<otherwise>
round(bill.rentReceivePay/100,2) rentReceivePay,
round(bill.propertyReceivePay/100,2) propertyReceivePay,
round(bill.depositReceivePay/100,2) depositReceivePay,
round(bill.otherReceivePay/100,2) otherReceivePay,
round((bill.rentOwe+bill.propertyOwe+bill.depositOwe+bill.otherOwe)/100,2) totalReceivePay
</otherwise>
</choose>

from (

select oweList.*,
max(case oweList.bill_type when '租金' then oweList.owe else 0 end) rentOwe,
max(case oweList.bill_type when '物业费' then oweList.owe else 0 end) propertyOwe,
max(case oweList.bill_type when '欠缴押金' then oweList.owe else 0 end) depositOwe,
max(case oweList.bill_type when '其他费用' then oweList.owe else 0 end) otherOwe
max(case oweList.bill_type when '其他费用' then oweList.owe else 0 end) otherOwe,

max(case oweList.bill_type when '租金' then oweList.receive_pay else 0 end) rentReceivePay,
max(case oweList.bill_type when '物业费' then oweList.receive_pay else 0 end) propertyReceivePay,
max(case oweList.bill_type when '欠缴押金' then oweList.receive_pay else 0 end) depositReceivePay,
max(case oweList.bill_type when '其他费用' then oweList.receive_pay else 0 end) otherReceivePay,

max(case oweList.bill_type when '租金' then oweList.pay else 0 end) rentPay,
max(case oweList.bill_type when '物业费' then oweList.pay else 0 end) propertyPay,
max(case oweList.bill_type when '欠缴押金' then oweList.pay else 0 end) depositPay,
max(case oweList.bill_type when '其他费用' then oweList.pay else 0 end) otherPay
from(
select bill.tenant_id,bill.merchant_id,bill.bill_type,sum(owe) owe,bill.receive_date,bill.expired_day from (
select bill.tenant_id,bill.merchant_id,bill.bill_type,sum(owe) owe,bill.receive_date,bill.expired_day,bill.receive_pay,bill.pay from (

select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,
<choose>
<when test="1==filterHasPay">
(receive_pay-pay) owe
</when>
<otherwise>
owe
</otherwise>
</choose>
,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent where is_preview = 0 and status = #{status} and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,
<choose>
<when test="1==filterHasPay">
(receive_pay-pay) owe
</when>
<otherwise>
owe
</otherwise>
</choose>
,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
bill_type,need_pay,receive_pay,pay,(need_pay-pay),DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property where is_preview = 0 and status = #{status} and tenant_id = #{tenantId}
union
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from(
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,
<choose>
<when test="1==filterHasPay">
(receive_pay-pay) owe
</when>
<otherwise>
owe
</otherwise>
</choose>
,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit where status = #{status} and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,
<choose>
<when test="1==filterHasPay">
(receive_pay-pay) owe
</when>
<otherwise>
owe
</otherwise>
</choose>
,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit where status = #{status} and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as
need_pay,receive_pay,pay,
<choose>
<when test="1==filterHasPay">
(receive_pay-pay) owe
</when>
<otherwise>
owe
</otherwise>
</choose>
,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit where status = #{status} and tenant_id = #{tenantId}
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,2 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_rent_deposit where status = #{status} and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,4 bill_type_value,'欠缴押金'
bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type from wx_bill_property_deposit where status = #{status} and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'欠缴押金' name,8 bill_type_value,'欠缴押金' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit where status = #{status} and tenant_id = #{tenantId}
) res
union
select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay,
res.receive_pay,res.pay,
owe
,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from(
select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,
<choose>
<when test="1==filterHasPay">
(receive_pay-pay) owe
</when>
<otherwise>
owe
</otherwise>
</choose>
,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type in(1,2) and status = #{status} and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,
<choose>
<when test="1==filterHasPay">
(receive_pay-pay) owe
</when>
<otherwise>
owe
</otherwise>
</choose>
,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other where status = #{status} and tenant_id = #{tenantId}
res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from(
select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type in(1,2) and status = #{status} and tenant_id = #{tenantId}
union
select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other where status = #{status} and tenant_id = #{tenantId}
) res

) bill
@@ -622,7 +588,6 @@
<if test=" null != month and ''!=month">
and date_format(bill.receive_date,'%Y-%m')=#{month}
</if>

<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns"> order by totalOwe desc </if>
</select>


Загрузка…
Отмена
Сохранить