From 30d7e5d4a3b14578313e04d01a285ed5694a1a7c Mon Sep 17 00:00:00 2001 From: Burce Date: Mon, 9 Sep 2019 19:09:41 +0800 Subject: [PATCH 01/10] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E6=8E=A5=E5=8F=A3=E6=8E=88=E6=9D=83=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/service/impl/WxCreditHistoryServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java index e0136d4c8..27284bbdc 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java @@ -199,10 +199,13 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { public WxCreditHistory saveOrUpdate(WxCreditHistory record) { WxCUser wxCUser = wxCUserMapper.selectByPrimaryKey(record.getCUserId()); WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectByPrimaryKey(record.getCUserId()); - if (wxCUser == null && wxCUserBasicInfo == null) { + if (wxCUser == null) { //验证此用户是否存在 throw new MallinkException(ErrorCode.USER_IS_EMPTY); } + if(wxCUserBasicInfo == null) { + throw new MallinkException(ErrorCode.USER_NOT_AUTH_PHONE); + } if (StringUtils.isNotEmpty(record.getSpendStr())) { record.setSpend(new BigDecimal(record.getSpendStr()).multiply(new BigDecimal(100)).intValue()); } From 65324de93daca1a81618d67badac4042695b2b17 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 10 Sep 2019 07:22:59 +0800 Subject: [PATCH 02/10] =?UTF-8?q?[/api/wxCoupon/detail][=E4=BF=AE=E6=94=B9?= =?UTF-8?q?]:=E4=BC=98=E5=8C=96detail=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/config/RedisConfig.java | 18 ++++++++ .../controller/WxCouponController.java | 42 +++++++++++++++++-- .../mapper/WxCouponChannelMapper.java | 2 + .../service/WxCouponChannelService.java | 2 + .../impl/WxCouponChannelServiceImpl.java | 5 +++ .../mapper/WxCouponChannelMapper.xml | 11 +++++ 6 files changed, 76 insertions(+), 4 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/config/RedisConfig.java b/mallinkCApi/src/main/java/com/iformall/config/RedisConfig.java index 7e167a93e..39666265b 100644 --- a/mallinkCApi/src/main/java/com/iformall/config/RedisConfig.java +++ b/mallinkCApi/src/main/java/com/iformall/config/RedisConfig.java @@ -4,6 +4,7 @@ import com.iformall.domain.po.PushLimit; import com.iformall.domain.po.WxCUser; import com.iformall.domain.po.WxMall; import com.iformall.domain.po.WxScoreRules; +import com.iformall.domain.vo.WxCouponCVo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cache.CacheManager; @@ -122,4 +123,21 @@ public class RedisConfig extends CachingConfigurerSupport { return template; } + @Bean("couponDetailRedisTemplate") + public RedisTemplate getCouponDetailRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(WxCouponCVo.class); + // value值的序列化 + template.setValueSerializer(j); + template.setHashKeySerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + + template.setConnectionFactory(connectionFactory); + return template; + } + } diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java index 9dd32a89b..502710f08 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java @@ -17,9 +17,13 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; import org.springframework.web.bind.annotation.*; import java.util.Date; +import java.util.concurrent.TimeUnit; @RestController @RequestMapping("/api/wxCoupon") @@ -29,8 +33,10 @@ public class WxCouponController extends BaseController { @Autowired private WxCouponChannelService wxCouponChannelService; + @Autowired - private WxCouponService wxCouponService; + @Qualifier("couponDetailRedisTemplate") + RedisTemplate cdRedisTemplate; @ApiOperation("根据id(couponChannel)查询接口") @@ -49,10 +55,40 @@ public class WxCouponController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId转换失败" + couponChannelId); } + String key = "cc:" + couponChannelId; + + ValueOperations operations = cdRedisTemplate.opsForValue(); + // 缓存 + boolean hasKey = cdRedisTemplate.hasKey(key); + if(hasKey) { + // 从缓存获取用户信息 + WxCouponCVo wxCouponCVo = operations.get(key); + // 更新状态 + WxCouponCVo couponCVo = wxCouponChannelService.findVoStatusDetail(couponChannelIdL); + if (wxCouponCVo == null) { + return new ResultData(ErrorCode.COUPON_IS_EMPTY); + } + wxCouponCVo.setRemainInventory(couponCVo.getRemainInventory()); + wxCouponCVo.setStatus(couponCVo.getStatus()); + // end of 更新状态 + updateActivityStatus(wxCouponCVo); + return new ResultData(wxCouponCVo); + } + WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(couponChannelIdL); - if (wxCouponCVo == null) + if (wxCouponCVo == null) { return new ResultData(ErrorCode.COUPON_IS_EMPTY); + } + + // 插入缓存 + operations.set(key, wxCouponCVo, 3600, TimeUnit.SECONDS); + updateActivityStatus(wxCouponCVo); + + return new ResultData(wxCouponCVo); + } + + private void updateActivityStatus(WxCouponCVo wxCouponCVo) { if (wxCouponCVo.getTargetAd()!= null && wxCouponCVo.getTargetAd().equals(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode())) { Date now = new Date(); @@ -65,8 +101,6 @@ public class WxCouponController extends BaseController { wxCouponCVo.setActivityStatus(EnumCouponChannelActivityStatus.STARTED.getCode()); } } - - return new ResultData(wxCouponCVo); } } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java index eae1b6590..332e4a631 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java @@ -23,6 +23,8 @@ public interface WxCouponChannelMapper extends CommonMapper listVo(WxCouponChannel record) { return wxCouponChannelMapper.findVoList(record); diff --git a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml index 7959979ff..282ec1180 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml @@ -218,6 +218,10 @@ cc.qr_code + + cc.id,cc.coupon_id,c.remain_inventory,c.status + + @@ -273,6 +277,13 @@ where cc.id = #{id} + + + update wx_coupon SET remain_inventory = remain_inventory - #{number} where id = #{id} and remain_inventory= #{remainInventory} From eace924f1203f23851009a59f3dca21a8347d8b9 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 10 Sep 2019 10:28:20 +0800 Subject: [PATCH 06/10] =?UTF-8?q?[C][=E4=BF=AE=E6=94=B9]:coupon/detail?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V201909101027__CHANGE_COUPON_CHANNEL.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201909101027__CHANGE_COUPON_CHANNEL.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201909101027__CHANGE_COUPON_CHANNEL.sql b/mallinkAdmin/src/main/resources/db/migration/V201909101027__CHANGE_COUPON_CHANNEL.sql new file mode 100644 index 000000000..86b72b0fc --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201909101027__CHANGE_COUPON_CHANNEL.sql @@ -0,0 +1,2 @@ +ALTER TABLE `wx_coupon_channel` +ADD INDEX `coupon_index` (`coupon_id`) comment ''; From 7f2e09add2dbadf0b68cc2cff0cf4b8af297498e Mon Sep 17 00:00:00 2001 From: gongbiao Date: Tue, 10 Sep 2019 10:47:42 +0800 Subject: [PATCH 07/10] =?UTF-8?q?[BUG][=E4=BF=AE=E6=94=B9][ID1002333=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83=EF=BC=9A=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8D=95=E7=AE=A1=E7=90=86=E5=88=9B=E5=BB=BA-=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mallinkService/src/main/resources/mapper/WxBillAllMapper.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index f81b49ec3..e39f08bc7 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -47,9 +47,7 @@ select bill.id,bill.tenant_id tenantId,bill.merchant_id merchantId,bill.shop_id shopId, bill.bill_type_value billTypeValue,bill.bill_type billType,bill.need_pay needPay, - bill.receive_pay receivePay,bill.pay, - case when bill.status=1 then bill.owe else 0 end owe - ,bill.receive_date receiveDate, + bill.receive_pay receivePay,bill.pay,bill.owe,bill.receive_date receiveDate, 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 From 60b06519deba41ea982b221f847143c0a2ffcef2 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Tue, 10 Sep 2019 12:01:06 +0800 Subject: [PATCH 08/10] =?UTF-8?q?[=E8=B4=A6=E5=8D=95][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=85=B6=E4=BB=96=E6=8A=BC=E9=87=91=E6=97=B6?= =?UTF-8?q?=E6=AC=A0=E7=BC=B4=E9=87=91=E9=A2=9D]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/impl/WxBillAllServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 69f23e55b..a3c3dd23c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -1184,7 +1184,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { Date date = new Date(); daily.setCreatetime(date); daily.setUpdatetime(date); - daily.setOwe(receivePay - pay); + daily.setOwe(receivePay); daily.setIsDel(EnumDelStatus.NOT_DEL.getCode()); daily.setStarttime(bill.getStarttime()); daily.setEndtime(bill.getEndtime()); @@ -1249,7 +1249,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { Date date = new Date(); other.setCreatetime(date); other.setUpdatetime(date); - other.setOwe(receivePay - pay); + other.setOwe(receivePay); other.setIsDel(EnumDelStatus.NOT_DEL.getCode()); other.setStarttime(bill.getStarttime()); other.setEndtime(bill.getEndtime()); @@ -1316,7 +1316,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { otherDeposit.setCreatetime(date); otherDeposit.setUpdatetime(date); otherDeposit.setExpiredDay(0L); - otherDeposit.setOwe(0L); + otherDeposit.setOwe(receivePay); otherDeposit.setIsDel(EnumDelStatus.NOT_DEL.getCode()); otherDeposit.setStarttime(bill.getStarttime()); otherDeposit.setEndtime(bill.getEndtime()); From 70a2b8359f237ac9e2c7ed5c881bc140c8b8acb2 Mon Sep 17 00:00:00 2001 From: Burce Date: Tue, 10 Sep 2019 12:05:43 +0800 Subject: [PATCH 09/10] =?UTF-8?q?[=E8=B0=83=E6=95=B4]=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C=E5=92=8C=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/controller/WxCreditHistoryController.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java index b00c9aeff..607638fa8 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java @@ -20,10 +20,12 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Objects; @RestController @RequestMapping("/api/credit") @@ -44,9 +46,9 @@ public class WxCreditHistoryController extends BaseController { @GetMapping("/findByMerchantIdAndSpend") @ApiImplicitParams({ @ApiImplicitParam(name="merchantId",value="商户ID",dataType="long", paramType = "query",required=true), - @ApiImplicitParam(name="spend",value="消费金额",dataType="int", paramType = "query",required=true), + @ApiImplicitParam(name="spendStr",value="消费金额",dataType="int", paramType = "query",required=true), @ApiImplicitParam(name = "userId", value = "会员Id", dataType = "long", paramType = "query", required = true)}) - public ResultData findByMerchantIdAndSpend(@RequestParam Long merchantId, @RequestParam String spendStr,@RequestParam Long userId) { + public ResultData findByMerchantIdAndSpend(Long merchantId, String spendStr,Long userId) { log.debug("[" + getIpAddr() + "] WxCreditHistoryController::findByMerchantIdAndSpend"); WxMerchant wxMerchant = new WxMerchant(); wxMerchant.setStatus(EnumYesOrNo.YES.getCode()); @@ -56,6 +58,9 @@ public class WxCreditHistoryController extends BaseController { if (wxMerchant.getIsAdmin() != EnumYesOrNo.YES.getCode() && merchantId.longValue() != getUser().getMerchantId().longValue()) { return new ResultData(ErrorCode.USER_NO_PERMISSION); } + if(Objects.isNull(merchantId)|| StringUtils.isEmpty(spendStr)||Objects.isNull(userId)) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL) ; + } return new ResultData(wxCreditHistoryService.findByMerchantIdAndSpend(merchantId,spendStr,userId,getTenantId())); } From f518a74c25aa662d087bf883a997622e3f538b36 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 10 Sep 2019 12:38:52 +0800 Subject: [PATCH 10/10] =?UTF-8?q?[=E4=BF=AE=E6=94=B9][=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8D=95][=E4=BF=AE=E6=94=B9=E4=B8=9A=E6=80=81=E5=88=86?= =?UTF-8?q?=E6=9E=90]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/enums/EnumBillAction.java | 3 +- .../service/impl/WxBillSettleServiceImpl.java | 98 +++++++++++++++++++ .../service/impl/WxFlowServiceImpl.java | 8 ++ 3 files changed, 108 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumBillAction.java b/mallinkService/src/main/java/com/iformall/enums/EnumBillAction.java index 9fc0f2520..1b6e74503 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumBillAction.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumBillAction.java @@ -13,7 +13,8 @@ public enum EnumBillAction { DEPOSIT_RETURN(5, "押金退款"), DEPOSIT_MODIFY(6, "押金变更"), IMPORT_PAY(6, "导入缴费"), - UPDATE_LATE_PAY_MONEY(7, "滞纳金变更"); + UPDATE_LATE_PAY_MONEY(7, "滞纳金变更"), + UPDATE_SETTLE_MONEY(8, "结算单清算"); public static EnumBillAction getEnum(Integer code) { for (EnumBillAction value : values()) { 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 1688d1ef9..ac271cc96 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java @@ -58,6 +58,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { private WxMerchantSubsidyMapper wxMerchantSubsidyMapper; @Autowired private ExcelService excelService; + @Autowired + private WxBillActionMapper wxBillActionMapper; + @Override public PageInfo listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) { @@ -136,6 +139,21 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { return billSettle; } + public void addBillAction(Long billId,Long money){ + final IdWorker idWorker = IdWorker.get(); + WxBillAction billAction = new WxBillAction(); + billAction.setId(idWorker.nextId()); + billAction.setCreatetime(new Date()); + billAction.setUserName("系统端"); + billAction.setAction(EnumBillAction.UPDATE_SETTLE_MONEY.getCode()); + billAction.setBillId(billId); + BigDecimal newmoney = new BigDecimal(money).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP); + billAction.setDetails("通过结算单清算"+newmoney.toString()+"元"); + billAction.setUpdatetime(new Date()); + billAction.setPayDate(new Date()); + wxBillActionMapper.insertSelective(billAction); + } + @Override public void updateFreezeOrStatus(List billList,Integer freezeStatus,Integer status){ //1租金2押金3物业4日常费用6其他8补贴 @@ -148,6 +166,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillRent.setStatus(status); wxBillRent.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillRent dbBill = wxBillRentMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent); }else if(EnumBillType.DEPOSIT.getCode().equals(bill.getBillType())) { WxBillDeposit wxBillRent = new WxBillDeposit(); @@ -157,6 +183,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillRent.setStatus(status); wxBillRent.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillDeposit dbBill = wxBillDepositMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillDepositMapper.updateByPrimaryKeySelective(wxBillRent); WxBillOtherDeposit wxBillOtherDeposit = new WxBillOtherDeposit(); @@ -166,6 +200,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillOtherDeposit.setStatus(status); wxBillOtherDeposit.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + wxBillOtherDeposit.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillOtherDeposit); WxBillPropertyDeposit propertyDeposit = new WxBillPropertyDeposit(); @@ -175,6 +217,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillRent.setStatus(status); wxBillRent.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + propertyDeposit.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillPropertyDepositMapper.updateByPrimaryKeySelective(propertyDeposit); }else if(EnumBillType.PROPERTY.getCode().equals(bill.getBillType())) { @@ -185,6 +235,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillRent.setStatus(status); wxBillRent.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillProperty dbBill = wxBillPropertyMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillPropertyMapper.updateByPrimaryKeySelective(wxBillRent); WxBillPropertyDeposit propertyDeposit = new WxBillPropertyDeposit(); @@ -194,6 +252,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillRent.setStatus(status); wxBillRent.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + propertyDeposit.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillPropertyDepositMapper.updateByPrimaryKeySelective(propertyDeposit); }else if(EnumBillType.ROUTINE.getCode().equals(bill.getBillType())) { WxBillOther wxBillRent = new WxBillOther(); @@ -203,6 +269,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillRent.setStatus(status); wxBillRent.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillOther dbBill = wxBillOtherMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillOtherMapper.updateByPrimaryKeySelective(wxBillRent); }else if(EnumBillType.OTHER_DEPOSIT.getCode().equals(bill.getBillType())) { WxBillOtherDeposit wxBillRent = new WxBillOtherDeposit(); @@ -212,6 +286,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillRent.setStatus(status); wxBillRent.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillRent); WxMerchantSubsidy wxMerchantSubsidy = new WxMerchantSubsidy(); @@ -229,6 +311,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillRent.setStatus(status); wxBillRent.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillRent); }else{ WxBillDaily wxBillRent = new WxBillDaily(); @@ -238,6 +328,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { wxBillRent.setStatus(status); wxBillRent.setPayDate(new Date()); } + if(EnumBillRentStatus.PAID.getCode().equals(status)){ + WxBillDaily dbBill = wxBillDailyMapper.selectByPrimaryKey(wxBillRent.getId()); + if(dbBill!=null) { + wxBillRent.setPay(dbBill.getOwe()); + wxBillRent.setPayDate(new Date()); + addBillAction(bill.getBillId(), dbBill.getOwe()); + } + } wxBillDailyMapper.updateByPrimaryKeySelective(wxBillRent); } } 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 e43a66fca..65e4aa9ab 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -221,6 +221,14 @@ public class WxFlowServiceImpl implements WxFlowService { wxBillAll.setNewPrice(newPrice); } wxBillAllService.updateReceivePay(wxBillAll, user); + + //账单修改金额,解冻 + List billList = new ArrayList<>(); + WxBillSettleBill settleBill = new WxBillSettleBill(); + settleBill.setBillType(billType); + settleBill.setBillId(businessId); + billList.add(settleBill); + wxBillSettleService.updateFreezeOrStatus(billList,EnumFreezeType.DEF.getCode(),null); }else if(EnumRentContractAppStatus.APPLYING.getCode().intValue() == applyStatus.intValue()) { //账单修改金额,冻结 List billList = new ArrayList<>();