From 0bbee774bf898d595cbc58af49086038ef9e1b38 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 3 Sep 2019 14:10:52 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E7=BB=93=E7=AE=97=E5=8D=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/service/test/Test.java | 18 +++++++++++------- .../com/iformall/domain/vo/WxBillAll.java | 6 +++++- .../service/impl/WxBillSettleServiceImpl.java | 5 +++++ .../service/impl/WxFlowServiceImpl.java | 10 +++++++++- .../main/resources/mapper/WxBillAllMapper.xml | 19 ++++++++++--------- 5 files changed, 40 insertions(+), 18 deletions(-) diff --git a/mallinkAdmin/src/test/java/com/iformall/service/test/Test.java b/mallinkAdmin/src/test/java/com/iformall/service/test/Test.java index 19cb3c5de..8ec94d871 100644 --- a/mallinkAdmin/src/test/java/com/iformall/service/test/Test.java +++ b/mallinkAdmin/src/test/java/com/iformall/service/test/Test.java @@ -2,10 +2,8 @@ package com.iformall.service.test; import com.alibaba.fastjson.JSON; import com.iformall.domain.po.*; -import com.iformall.service.WxBillSettleService; -import com.iformall.service.WxCouponSendService; -import com.iformall.service.WxLevelConfigService; -import com.iformall.service.WxScoreRulesService; +import com.iformall.domain.vo.WxBillAll; +import com.iformall.service.*; import lombok.extern.slf4j.Slf4j; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.UsernamePasswordToken; @@ -61,7 +59,8 @@ public class Test { @Autowired private WxBillSettleService wxBillSettleService; - + @Autowired + private WxBillAllService wxBillAllService; @Before public void setUp() { @@ -86,8 +85,13 @@ public class Test { @org.junit.Test public void levelList() { - WxBillSettle settle = wxBillSettleService.getById(328411851323572224l); - log.debug("data:{}", JSON.toJSONString(settle)); +// WxBillSettle settle = wxBillSettleService.getById(328411851323572224l); +// log.debug("data:{}", JSON.toJSONString(settle)); + WxBillAll wxBillAll = new WxBillAll(); + wxBillAll.setMerchantId(326957139157024768l); + wxBillAll.setTenantId("456"); + wxBillAll.setBillTypeValue(10); + log.debug("data:{}", JSON.toJSONString( wxBillAllService.listBill(wxBillAll))); } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java index 7cd3707f8..4f543c6ea 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java @@ -122,7 +122,6 @@ public class WxBillAll extends BaseEntity { private String payDate; - @Transient @io.swagger.annotations.ApiModelProperty(value = "过滤已收金额1过滤", name = "filterHasPay") private Integer filterHasPay; @@ -146,6 +145,11 @@ public class WxBillAll extends BaseEntity { @Transient private Integer balance; + + @Transient + @io.swagger.annotations.ApiModelProperty(value = "冻结状态0正常1冻结", name = "freeze") + private Integer freeze; + @io.swagger.annotations.ApiModelProperty(value = "多个类型", name = "typeStr") private String typeStr; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java index dbde10048..5689cb824 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java @@ -12,6 +12,7 @@ import com.iformall.service.ExcelService; import com.iformall.service.WxBillSettleService; import com.iformall.service.WxFlowService; import com.iformall.utils.DateUtils; +import org.apache.commons.collections.CollectionUtils; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -152,6 +153,10 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { @Transactional public ResultData saveOrUpdate(WxBillSettle record, MallUserInfo userInfo) { final IdWorker idWorker = IdWorker.get(); + + if (record.getFlowParams() == null || record.getFlowParams().size() == 0) { + record.setStatus(EnumSettleStatus.NOT_FINISH.getCode()); + } if (record.getId() == null) { record.setId(idWorker.nextId()); wxBillSettleMapper.insertSelective(record); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index bf0b130f4..d87f2b377 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -203,9 +203,9 @@ public class WxFlowServiceImpl implements WxFlowService { wxPropertyContractMapper.updateApplyStatus(wxPropertyContract); } } else if (EnumFlowKey.BILL.getCode().equals(flowType) || EnumFlowKey.NEW_BILL_CHANGE.getCode().equals(flowType)) { + Integer billType = getIngeter(getVariableByKey(variables, "billType")); if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { //账单审批 - Integer billType = getIngeter(getVariableByKey(variables, "billType")); MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); Integer billUpdateType = getIngeter(getVariableByKey(variables, "billUpdateType")); Long oldPrice = Long.parseLong(getVariableByKey(variables, "oldPrice").toString()); @@ -221,6 +221,14 @@ public class WxFlowServiceImpl implements WxFlowService { wxBillAll.setNewPrice(newPrice); } wxBillAllService.updateReceivePay(wxBillAll, user); + }else{ + //账单修改金额,冻结 + List billList = new ArrayList<>(); + WxBillSettleBill settleBill = new WxBillSettleBill(); + settleBill.setBillType(billType); + settleBill.setBillId(businessId); + billList.add(settleBill); + wxBillSettleService.updateFreeze(billList,EnumFreezeType.YES.getCode()); } } else if (EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType) diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index a8feded4b..4bbb3b381 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -53,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,updatetime + shopInfo,bill.comments,bill.price_detail,updatetime,bill.freeze 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,updatetime + price_detail,updatetime,freeze 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,updatetime from wx_bill_rent_deposit where + endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime,freeze 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,updatetime + price_detail,updatetime,freeze 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,updatetime from wx_bill_property_deposit where + endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime,freeze 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,updatetime + rent_shop_type,'[]' shop_info, NULL comments,price_detail,updatetime,freeze 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,updatetime + rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime,freeze 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,updatetime + rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime,freeze from wx_bill_other_deposit where tenant_id=#{tenantId} ) bill left join wx_merchant m on bill.merchant_id=m.id @@ -127,7 +127,8 @@ #{type} - + and bill.freeze = #{freeze} + order by ${sortColumns} order by bill.receive_date,bill.id desc,bill.merchant_id,bill.status