From ff0a54fa4c07c7c19d9c8067492d2c925ab30702 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 28 Aug 2019 10:30:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E6=B7=BB=E5=8A=A0user=5Fid=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E7=B4=A2=E5=BC=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V201908281030__G_USER_DATA_RULE.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201908281030__G_USER_DATA_RULE.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201908281030__G_USER_DATA_RULE.sql b/mallinkAdmin/src/main/resources/db/migration/V201908281030__G_USER_DATA_RULE.sql new file mode 100644 index 000000000..6a36ccb01 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201908281030__G_USER_DATA_RULE.sql @@ -0,0 +1 @@ +alter table wx_user_data_rule add unique uni_user(user_id); \ No newline at end of file From bec8db7c6e93e36b7091d8a96459c1badddcadee Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 28 Aug 2019 11:33:38 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=B4=A6=E5=8D=95=E7=BB=93=E7=AE=97]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/iformall/domain/vo/RatioVo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/RatioVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/RatioVo.java index b328b7811..a0e73aba7 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/RatioVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/RatioVo.java @@ -7,5 +7,5 @@ public class RatioVo { //扣点率 private Integer ratio = 0; //金额 - private Long price; + private Long price = 0l; } From a710f9846fd52e6b5e1cd8e11181ac5564993c8c Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 28 Aug 2019 13:57:35 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=B4=A6=E5=8D=95=E7=BB=93=E7=AE=97]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxBillRentServiceImpl.java | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java index 42400b591..87d1f2d8b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java @@ -9,6 +9,7 @@ import com.iformall.common.IdWorker; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.*; +import com.iformall.domain.vo.RatioVo; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.*; @@ -291,6 +292,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { wxBillRent.setRevenue(record.getRevenue()); Integer ratio = 0; + RatioVo ratioVo = null; if(wxRentContract.getPayRatio() != null && wxRentContract.getPayRatio().intValue() > 0){ ratio = wxRentContract.getPayRatio(); }else{ @@ -299,28 +301,34 @@ public class WxBillRentServiceImpl implements WxBillRentService { if(EnumBusRatioTime.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())){ if(startInt == endInt && months == 12){ //刚好1年 - ratio = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0).getRatio(); + ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0); }else{ - ratio = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.YEAR.getCode(),dayCount,0).getRatio(); + ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.YEAR.getCode(),dayCount,0); } }else if(EnumBusRatioTime.MONTH.getCode().equals(wxRentContract.getBusDiscountTime())){ if(startInt == endInt && months == 1){ //刚好1个月 - ratio = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0).getRatio(); + ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.OTHER.getCode(),dayCount,0); }else{ - ratio = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.MONTH.getCode(),dayCount,0).getRatio(); + ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.MONTH.getCode(),dayCount,0); } }else if(EnumBusRatioTime.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())){ - ratio = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.PERIOD.getCode(),dayCount,wxRentContract.getReceivePeriod()).getRatio(); + ratioVo = WxRentContractServiceImpl.getPayRatio(EnumGetRatioFrom.BILL.getCode(),wxBillRent.getRevenue(),wxRentContract.getBusDiscountRatio(),EnumMissTimeType.PERIOD.getCode(),dayCount,wxRentContract.getReceivePeriod()); } } } - BigDecimal hundred = new BigDecimal(100); - BigDecimal revenue = new BigDecimal(record.getRevenue() == null ? 0 : record.getRevenue()).divide(hundred); - BigDecimal payRatio = new BigDecimal(ratio).divide(new BigDecimal(10000)); - BigDecimal price = revenue.multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN); - long newReceivePay = price.multiply(hundred).longValue(); + long newReceivePay; + if(ratioVo != null){ + newReceivePay = ratioVo.getPrice(); + }else{ + BigDecimal hundred = new BigDecimal(100); + BigDecimal revenue = new BigDecimal(record.getRevenue() == null ? 0 : record.getRevenue()).divide(hundred); + BigDecimal payRatio = new BigDecimal(ratio).divide(new BigDecimal(10000)); + BigDecimal price = revenue.multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN); + newReceivePay = price.multiply(hundred).longValue(); + } + if(newReceivePay > wxBillRent.getReceivePay()){ wxBillRent.setReceivePay(newReceivePay); } From dace43d84ce1d40a2035ace2a32850b3c5dcead2 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 28 Aug 2019 14:17:04 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[=E5=95=86=E6=88=B7=E8=B4=A6=E5=8D=95][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E5=B1=95=E7=A4=BA=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=B6=E9=97=B4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/domain/vo/WxBillAllVo.java | 3 +++ .../main/resources/mapper/WxBillAllMapper.xml | 17 +++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAllVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAllVo.java index 382164387..632b71865 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAllVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAllVo.java @@ -71,6 +71,9 @@ public class WxBillAllVo { @io.swagger.annotations.ApiModelProperty(value = "明细", name = "priceDetail") private String priceDetail; + @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updatetime") + private Date updatetime; + public String getReceivePayStr() { if(getReceivePay()!=null) { receivePayStr = new BigDecimal(getReceivePay()).divide(new BigDecimal(100)).toString(); diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index ab2e2383f..8baca7a54 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -37,6 +37,7 @@ + @@ -52,46 +53,46 @@ bill.pay_date payDate,expired_day expiredDay,bill.status,bill.starttime, bill.endtime,bill.name,bill.rent_shop_type rentShopType,m.name merchantName, s.shop_number shopNumber, s.manager, s.manager_phone managerPhone,bill.shop_info - shopInfo,bill.comments,bill.price_detail + shopInfo,bill.comments,bill.price_detail,updatetime from ( select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments,'' - price_detail + price_detail,updatetime from wx_bill_rent where tenant_id=#{tenantId} and is_preview = 0 union all select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' - endtime,rent_shop_type,shop_info,NULL comments,'' price_detail from wx_bill_rent_deposit where + endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime from wx_bill_rent_deposit where tenant_id=#{tenantId} union all select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments,'' - price_detail + price_detail,updatetime from wx_bill_property where tenant_id=#{tenantId} and is_preview = 0 union all select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' - endtime,rent_shop_type,shop_info,NULL comments,'' price_detail from wx_bill_property_deposit where + endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime from wx_bill_property_deposit where tenant_id=#{tenantId} union all select id,merchant_id,shop_id,tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name, case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value, case when type=1 then '水费' when type=2 then '电费' else '空调费' end bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime, - rent_shop_type,'[]' shop_info, NULL comments,price_detail + rent_shop_type,'[]' shop_info, NULL comments,price_detail,updatetime from wx_bill_daily where tenant_id=#{tenantId} union all select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,concat('其他费用-',name) as bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, - rent_shop_type,'[]' shop_info,comments,'' price_detail + rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime from wx_bill_other where tenant_id=#{tenantId} union all select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,concat('其他押金-',comments) as bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, - rent_shop_type,'[]' shop_info,comments,'' price_detail + rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime from wx_bill_other_deposit where tenant_id=#{tenantId} ) bill left join wx_merchant m on bill.merchant_id=m.id