| @@ -8,6 +8,8 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.controller.base.BillBaseController; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.SysConfig; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxUserDataRule; | |||
| @@ -488,6 +490,22 @@ public class WxBillAllController extends BillBaseController { | |||
| billAllHelper.exportOneBillOweWord(false,bill, request, response); | |||
| } | |||
| @PostMapping("updateReceivePay") | |||
| public ResultData updateReceivePay(@RequestBody WxBillReceiveUpdateDTO dto) { | |||
| dto.updateTenantInfo(getTenantInfo()); | |||
| billAllHelper.updateReceivePay(dto, getUser(), false); | |||
| return new ResultData(); | |||
| //return wxBillAllService.updateReceivePay(wxBillAll, getUser(),false); | |||
| } | |||
| @PostMapping("pay") | |||
| public ResultData pay(@RequestBody WxBillPayDTO dto) { | |||
| dto.updateTenantInfo(getTenantInfo()); | |||
| billAllHelper.updatePay(dto, getUser()); | |||
| return new ResultData(); | |||
| //return wxBillAllService.updateReceivePay(wxBillAll, getUser(),false); | |||
| } | |||
| //###################################### 老代码 ###################################### | |||
| @GetMapping("exportOweBill") | |||
| @@ -686,17 +704,6 @@ public class WxBillAllController extends BillBaseController { | |||
| wxBillAllService.exportWaitMerchant(wxBillAll, request, response); | |||
| } | |||
| @PostMapping("updateReceivePay") | |||
| @SystemControllerLog(description = "账单-更新") | |||
| public ResultData updateReceivePay(@RequestBody WxBillAll wxBillAll) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillRentController::add"); | |||
| wxBillAll.updateTenantInfo(getTenantInfo()); | |||
| return wxBillAllService.updateReceivePay(wxBillAll, getUser(),false); | |||
| } | |||
| @GetMapping("exportTemplate") | |||
| @SystemControllerLog(description = "账单-导出模板") | |||
| public void exportTemplate(@ModelAttribute WxBillExcelTemplate wxBillExcelTemplate, HttpServletRequest request, HttpServletResponse response) { | |||
| @@ -7,4 +7,10 @@ ALTER TABLE wx_bill_daily DROP COLUMN owe; | |||
| ALTER TABLE wx_bill_other DROP COLUMN owe; | |||
| ALTER TABLE wx_bill_other_deposit DROP COLUMN owe; | |||
| ALTER TABLE wx_bill_rent_deposit ADD COLUMN contract_depoist_detail VARCHAR(1000) COMMENT '合同押金详细'; | |||
| ALTER TABLE wx_bill_rent_deposit ADD COLUMN contract_depoist_detail VARCHAR(1000) COMMENT '合同押金详细'; | |||
| ALTER TABLE wx_bill_action ADD COLUMN `bill_type` INT(3) NOT NULL DEFAULT 0 COMMENT '账单类型' AFTER `bill_id`; | |||
| ALTER TABLE wx_bill_action ADD COLUMN `old_money` VARCHAR(30) COMMENT '原有金额' AFTER `bill_id`; | |||
| ALTER TABLE wx_bill_action ADD COLUMN `new_money` VARCHAR(30) COMMENT '变更后金额' AFTER `bill_id`; | |||
| ALTER TABLE wx_bill_action ADD COLUMN `remark` VARCHAR(1000) COMMENT '备注'; | |||
| @@ -0,0 +1,19 @@ | |||
| package com.iformall.domain.dto; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| /** | |||
| * 更改应收金额 | |||
| * @author xmzhao71 | |||
| * @date 2023-08-31 | |||
| */ | |||
| @Data | |||
| public class WxBillPayDTO extends TenantEntity{ | |||
| private Long id; | |||
| private Integer billTypeValue;// EnumBillAllType | |||
| private String addpay;//支付金额 | |||
| private Integer payWay;//支付方式 EnumBillPayWay | |||
| private String remark; | |||
| } | |||
| @@ -0,0 +1,25 @@ | |||
| package com.iformall.domain.dto; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| /** | |||
| * 更改应收金额 | |||
| * @author xmzhao71 | |||
| * @date 2023-08-31 | |||
| */ | |||
| @Data | |||
| public class WxBillReceiveUpdateDTO extends TenantEntity{ | |||
| private Long id; | |||
| private Integer billTypeValue; | |||
| private String oldPrice;//原应付金额 | |||
| private String newPrice;//调整后应付金额 | |||
| private String pay;//缴费金额 | |||
| private String oldLatePrice;//原应付滞纳金 | |||
| private String newLatePrice;//调整后应付滞纳金 | |||
| private String remark; | |||
| } | |||
| @@ -18,8 +18,17 @@ public class WxBillAction extends TenantEntity { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单类型EnumBillAllType", name = "billType") | |||
| private Integer billType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单ID", name = "billId") | |||
| private Long billId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "原有金额", name = "oldMoney") | |||
| private String oldMoney; | |||
| @io.swagger.annotations.ApiModelProperty(value = "变更后金额", name = "newMoney") | |||
| private String newMoney; | |||
| @io.swagger.annotations.ApiModelProperty(value = "用户ID", name = "userId") | |||
| private Long userId; | |||
| @@ -44,6 +53,9 @@ public class WxBillAction extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "付款时间", name = "payDate") | |||
| private Date payDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "备注", name = "remark") | |||
| private String remark; | |||
| @TableField(exist = false) | |||
| private Long oldPrice; | |||
| @@ -29,7 +29,7 @@ public class WxBillDaily extends WxBillBaseEntity { | |||
| private static final long serialVersionUID = 5004263718907992977L; | |||
| @Excel(name = "费用类型*", replace = {"水费_1", "电费_2"}, width = 20, orderNum = "2") | |||
| @Excel(name = "费用类型*", replace = {"水费_1", "电费_2" , "空调费_3"}, width = 20, orderNum = "2") | |||
| @NotNull | |||
| @io.swagger.annotations.ApiModelProperty(value="账单类型EnumBillDailyType",name="type") | |||
| private Integer type; | |||
| @@ -39,9 +39,11 @@ public class WxBillDaily extends WxBillBaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="截止收款日期",name="receiveDate") | |||
| private Date receiveDate; | |||
| @Excel(name = "收款日期", format = "yyyy-MM-dd", width = 20, orderNum = "12") | |||
| @io.swagger.annotations.ApiModelProperty(value="到账日期",name="payDate") | |||
| private Date payDate; | |||
| @Excel(name = "创建日期", orderNum = "12", width = 20, format = "yyyy-MM-dd HH:mm:ss") | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||
| private Date createtime; | |||
| @@ -285,9 +285,11 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "租期(月)", name = "lease") | |||
| private Integer lease; | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型", name = "type") | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumRentContractType", name = "type") | |||
| private Integer type; | |||
| @TableField(exist = false) | |||
| private String typeName; | |||
| @TableField(exist = false) | |||
| private List<Integer> typeList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "调整比例", name = "adjustRatio") | |||
| @@ -41,4 +41,30 @@ public enum EnumBillAction { | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| public String getDescription(String oldMoney,String newMoney) { | |||
| StringBuffer sb = new StringBuffer("[").append(this.message).append("]"); | |||
| if (code.intValue() == SELF_SERVICE_PAY.code.intValue()) { | |||
| sb.append(newMoney).append("元"); | |||
| }else if (code.intValue() == UPDATE_BILL.code.intValue()) { | |||
| sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | |||
| }else if (code.intValue() == OFFLINE_PAY.code.intValue()) { | |||
| sb.append(newMoney).append("元"); | |||
| }else if (code.intValue() == DEPOSIT_PAY.code.intValue()) { | |||
| sb.append(newMoney).append("元"); | |||
| }else if (code.intValue() == DEPOSIT_RETURN.code.intValue()) { | |||
| sb.append(newMoney).append("元"); | |||
| }else if (code.intValue() == DEPOSIT_MODIFY.code.intValue()) { | |||
| sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | |||
| }else if (code.intValue() == UPDATE_LATE_PAY_MONEY.code.intValue()) { | |||
| sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | |||
| }else if (code.intValue() == UPDATE_SETTLE_MONEY.code.intValue()) { | |||
| sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | |||
| }else if (code.intValue() == UPDATE_SERVICE_MONEY.code.intValue()) { | |||
| sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | |||
| }else { | |||
| sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | |||
| } | |||
| return sb.toString(); | |||
| } | |||
| } | |||
| @@ -2,6 +2,8 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillDaily; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| @@ -69,5 +71,9 @@ public interface WxBillDailyService { | |||
| List<Long> getMerchantIds(WxBillDaily wxBillDaily); | |||
| WxBillHotNotify getBillHotNotify(WxBillDaily wxBillDaily); | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid); | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user); | |||
| } | |||
| @@ -7,6 +7,8 @@ import javax.servlet.http.HttpServletResponse; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| @@ -67,5 +69,9 @@ public interface WxBillDepositService { | |||
| WxBillHotNotify getBillHotNotify(WxBillDeposit wxBillDeposit); | |||
| void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillDeposit wxBillDeposit); | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid); | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user); | |||
| } | |||
| @@ -2,6 +2,8 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillOtherDeposit; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| @@ -68,5 +70,9 @@ public interface WxBillOtherDepositService { | |||
| List<Long> getMerchantIds(WxBillOtherDeposit wxBillDeposit); | |||
| WxBillHotNotify getBillHotNotify(WxBillOtherDeposit wxBillDeposit); | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid); | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user); | |||
| } | |||
| @@ -2,6 +2,8 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillOther; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| @@ -64,5 +66,9 @@ public interface WxBillOtherService { | |||
| List<Long> getMerchantIds(WxBillOther wxBillOther); | |||
| WxBillHotNotify getBillHotNotify(WxBillOther wxBillOther); | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) ; | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user); | |||
| } | |||
| @@ -7,6 +7,8 @@ import javax.servlet.http.HttpServletResponse; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillPropertyDeposit; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| @@ -70,4 +72,8 @@ public interface WxBillPropertyDepositService { | |||
| WxBillHotNotify getBillHotNotify(WxBillPropertyDeposit deposit); | |||
| public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillPropertyDeposit deposit) ; | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid); | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user); | |||
| } | |||
| @@ -2,6 +2,8 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| @@ -79,4 +81,8 @@ public interface WxBillPropertyService { | |||
| List<Long> getMerchantIds(WxBillProperty wxBillProperty); | |||
| WxBillHotNotify getBillHotNotify(WxBillProperty wxBillProperty); | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid); | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user); | |||
| } | |||
| @@ -2,6 +2,8 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.WxBillRentManage; | |||
| @@ -76,4 +78,8 @@ public interface WxBillRentManageService { | |||
| List<Long> getMerchantIds(WxBillRentManage wxBillRentManage); | |||
| WxBillHotNotify getBillHotNotify(WxBillRentManage wxBillRentManage); | |||
| void updateReceivePay(WxBillReceiveUpdateDTO dto,MallUserInfo user,boolean forcePaid); | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user); | |||
| } | |||
| @@ -2,11 +2,14 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillHotNotify; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import com.iformall.enums.EnumBillAction; | |||
| import java.util.List; | |||
| @@ -80,5 +83,9 @@ public interface WxBillRentService { | |||
| WxBillHotNotify getBillHotNotify(WxBillRent wxBillRent); | |||
| void updateReceivePay(WxBillReceiveUpdateDTO dto,MallUserInfo user,boolean forcePaid); | |||
| void updatePay(WxBillPayDTO dto,MallUserInfo user); | |||
| } | |||
| @@ -19,6 +19,10 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillDaily; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillOther; | |||
| @@ -33,11 +37,13 @@ import com.iformall.domain.po.base.WxBillBaseEntity; | |||
| import com.iformall.domain.vo.WxBillHotNotify; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import com.iformall.domain.vo.WxShopVo; | |||
| import com.iformall.enums.EnumBillAction; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillDailyType; | |||
| import com.iformall.enums.EnumBillType; | |||
| import com.iformall.enums.EnumRentContractManageFeeType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.WxBillActionService; | |||
| import com.iformall.service.WxBillDailyService; | |||
| import com.iformall.service.WxBillDepositService; | |||
| import com.iformall.service.WxBillOtherDepositService; | |||
| @@ -615,7 +621,50 @@ public class WxBillAllHelper { | |||
| if (null != otherDepositNotify) { | |||
| retList.add(otherDepositNotify); | |||
| } | |||
| return retList; | |||
| } | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto,MallUserInfo user,boolean forcePaid) { | |||
| if (dto.getBillTypeValue().intValue() == EnumBillAllType.RENT.getCode().intValue()) { | |||
| wxBillRentService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode().intValue()) { | |||
| wxBillRentManageService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.RENT_OPERATION_MANAGE.getCode().intValue()) { | |||
| wxBillRentManageService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.RENT_DEPOSIT.getCode().intValue()) { | |||
| wxBillRentDepositService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.PROPERTY.getCode().intValue()) { | |||
| wxBillPropertyService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.PROPERTY_DEPOSIT.getCode().intValue()) { | |||
| wxBillPropertyDepositService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.DAILY.getCode().intValue()) { | |||
| wxBillDailyService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.OTHER.getCode().intValue()) { | |||
| wxBillOtherService.updateReceivePay(dto, user, forcePaid); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.OTHER_DEPOSIT.getCode().intValue()) { | |||
| wxBillOtherDepositService.updateReceivePay(dto, user, forcePaid); | |||
| } | |||
| } | |||
| public void updatePay(WxBillPayDTO dto,MallUserInfo user) { | |||
| if (dto.getBillTypeValue().intValue() == EnumBillAllType.RENT.getCode().intValue()) { | |||
| wxBillRentService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode().intValue()) { | |||
| wxBillRentManageService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.RENT_OPERATION_MANAGE.getCode().intValue()) { | |||
| wxBillRentManageService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.RENT_DEPOSIT.getCode().intValue()) { | |||
| wxBillRentDepositService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.PROPERTY.getCode().intValue()) { | |||
| wxBillPropertyService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.PROPERTY_DEPOSIT.getCode().intValue()) { | |||
| wxBillPropertyDepositService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.DAILY.getCode().intValue()) { | |||
| wxBillDailyService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.OTHER.getCode().intValue()) { | |||
| wxBillOtherService.updatePay(dto, user); | |||
| }else if (dto.getBillTypeValue().intValue() == EnumBillAllType.OTHER_DEPOSIT.getCode().intValue()) { | |||
| wxBillOtherDepositService.updatePay(dto, user); | |||
| } | |||
| } | |||
| } | |||
| @@ -53,6 +53,9 @@ public class WxBillActionServiceImpl implements WxBillActionService { | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setId(idWorker.nextId()); | |||
| wxBillAction.setBillId(action.getBillId()); | |||
| wxBillAction.setBillType(action.getBillType()); | |||
| wxBillAction.setOldMoney(action.getOldMoney()); | |||
| wxBillAction.setNewMoney(action.getNewMoney()); | |||
| wxBillAction.setDetails(action.getDetails()); | |||
| wxBillAction.setAction(action.getAction()); | |||
| wxBillAction.setUserId(user.getId()); | |||
| @@ -60,6 +63,7 @@ public class WxBillActionServiceImpl implements WxBillActionService { | |||
| wxBillAction.setPhone(user.getPhone()); | |||
| wxBillAction.updateTenantInfo(user); | |||
| wxBillAction.setPayDate(action.getPayDate()); | |||
| wxBillAction.setRemark(action.getRemark()); | |||
| Date date = new Date(); | |||
| wxBillAction.setCreatetime(date); | |||
| wxBillAction.setUpdatetime(date); | |||
| @@ -0,0 +1,37 @@ | |||
| package com.iformall.service.impl; | |||
| import java.util.Date; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.enums.EnumBillAction; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.service.WxBillActionService; | |||
| @Service | |||
| public class WxBillBaseService{ | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxBillActionService wxBillActionService; | |||
| protected void addBillAction(EnumBillAction billAction, Integer billType,Long billId, String oldMoney, String newMoney,Date payDate,String remark, MallUserInfo mallUserInfo) { | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(billId); | |||
| wxBillAction.setBillType(billType); | |||
| wxBillAction.setOldMoney(oldMoney); | |||
| wxBillAction.setNewMoney(newMoney); | |||
| wxBillAction.setDetails(billAction.getDescription(oldMoney, newMoney)); | |||
| wxBillAction.setAction(billAction.getCode()); | |||
| wxBillAction.setPayDate(payDate); | |||
| wxBillAction.setRemark(remark); | |||
| wxBillActionService.modifyBill(wxBillAction, mallUserInfo); | |||
| } | |||
| } | |||
| @@ -8,6 +8,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillDailyExportVo; | |||
| @@ -48,7 +50,7 @@ import java.util.concurrent.TimeUnit; | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| public class WxBillDailyServiceImpl extends WxBillBaseService implements WxBillDailyService { | |||
| private Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| @@ -483,5 +485,62 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| updateQueryParam(record); | |||
| return wxBillDailyMapper.getBillHotNotify(record); | |||
| } | |||
| @Override | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) { | |||
| WxBillDaily dbBill = wxBillDailyMapper.selectById(dto.getId()); | |||
| WxBillDaily wxBillDaily = new WxBillDaily(); | |||
| wxBillDaily.setId(dto.getId()); | |||
| wxBillDaily.updateTenantInfo(dto); | |||
| wxBillDaily.setUpdatetime(new Date()); | |||
| if (forcePaid) { | |||
| wxBillDaily.setReceivePay(dbBill.getPay()); | |||
| wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), dbBill.getPay(), | |||
| dbBill.getPay(),null, dto.getRemark(), user); | |||
| }else { | |||
| if (StringUtils.isNotBlank(dto.getOldLatePrice()) && StringUtils.isNotBlank(dto.getNewLatePrice())) { | |||
| wxBillDaily.setLatePayPrice(dto.getNewLatePrice()); | |||
| wxBillDailyMapper.updateById(wxBillDaily); | |||
| this.addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, dto.getBillTypeValue(), dto.getId(), | |||
| dto.getOldLatePrice(), dto.getNewLatePrice(),null,dto.getRemark(), user); | |||
| } else { | |||
| //租赁账单更新 | |||
| wxBillDaily.setReceivePay(dto.getNewPrice()); | |||
| Date payDate = null; | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) >= 0) { | |||
| wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); | |||
| payDate = new Date(); | |||
| } | |||
| wxBillDailyMapper.updateById(wxBillDaily); | |||
| //账单日志 | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getOldPrice(), dto.getNewPrice(),payDate, dto.getRemark(), user); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillDaily dbBill = wxBillDailyMapper.selectById(dto.getId()); | |||
| WxBillDaily wxBillRent = new WxBillDaily(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| BigDecimal opay = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(dbBill.getPay())) { | |||
| opay = new BigDecimal(dbBill.getPay()); | |||
| } | |||
| opay = opay.add(new BigDecimal(dto.getAddpay())); | |||
| wxBillRent.setPay(opay.toPlainString()); | |||
| if (opay.compareTo(new BigDecimal(dbBill.getReceivePay())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| wxBillRent.setPayDate(new Date()); | |||
| wxBillRent.setPayWay(dto.getPayWay()); | |||
| wxBillDailyMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.OFFLINE_PAY, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(), dto.getRemark(), user); | |||
| } | |||
| } | |||
| @@ -8,6 +8,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| @@ -60,7 +62,7 @@ import javax.servlet.http.HttpServletResponse; | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillDepositServiceImpl implements WxBillDepositService { | |||
| public class WxBillDepositServiceImpl extends WxBillBaseService implements WxBillDepositService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| @@ -422,6 +424,56 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||
| excelService.exportExcel(billRentList.getList(),null, billName, WxBillDeposit.class, billName + ".xlsx", response, false); | |||
| } | |||
| @Override | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) { | |||
| WxBillDeposit dbBill = wxBillDepositMapper.selectById(dto.getId()); | |||
| WxBillDeposit wxBillDeposit = new WxBillDeposit(); | |||
| wxBillDeposit.setId(dto.getId()); | |||
| wxBillDeposit.updateTenantInfo(dto); | |||
| wxBillDeposit.setUpdatetime(new Date()); | |||
| String billDepositOldPrce = dto.getOldPrice(); | |||
| String billDepositNewPrce = dto.getNewPrice(); | |||
| Date payDate = null; | |||
| if (forcePaid) { | |||
| wxBillDeposit.setReceivePay(dbBill.getPay()); | |||
| wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||
| billDepositOldPrce = dbBill.getPay(); | |||
| billDepositNewPrce = dbBill.getPay(); | |||
| }else { | |||
| wxBillDeposit.setReceivePay(dto.getNewPrice()); | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) >= 0) { | |||
| wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| wxBillDeposit.setUpdatetime(new Date()); | |||
| payDate = new Date(); | |||
| } | |||
| this.addBillAction(EnumBillAction.DEPOSIT_MODIFY, dto.getBillTypeValue(),dto.getId(), billDepositOldPrce, | |||
| billDepositNewPrce,payDate, dto.getRemark(), user); | |||
| } | |||
| @Override | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillDeposit dbBill = wxBillDepositMapper.selectById(dto.getId()); | |||
| WxBillDeposit wxBillRent = new WxBillDeposit(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| BigDecimal opay = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(dbBill.getPay())) { | |||
| opay = new BigDecimal(dbBill.getPay()); | |||
| } | |||
| opay = opay.add(new BigDecimal(dto.getAddpay())); | |||
| wxBillRent.setPay(opay.toPlainString()); | |||
| if (opay.compareTo(new BigDecimal(dbBill.getReceivePay())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| wxBillRent.setPayDate(new Date()); | |||
| wxBillRent.setPayWay(dto.getPayWay()); | |||
| wxBillDepositMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.OFFLINE_PAY, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(), dto.getRemark(), user); | |||
| } | |||
| } | |||
| @@ -7,6 +7,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillDaily; | |||
| @@ -51,7 +53,7 @@ import java.util.Map; | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService { | |||
| public class WxBillOtherDepositServiceImpl extends WxBillBaseService implements WxBillOtherDepositService { | |||
| private Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| @@ -448,5 +450,51 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||
| updateQueryParam(wxBillDeposit); | |||
| return wxBillOtherDepositMapper.getBillHotNotify(wxBillDeposit); | |||
| } | |||
| @Override | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) { | |||
| WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(dto.getId()); | |||
| WxBillOtherDeposit wxBillOtherDeposit = new WxBillOtherDeposit(); | |||
| wxBillOtherDeposit.setId(dto.getId()); | |||
| wxBillOtherDeposit.updateTenantInfo(dto); | |||
| wxBillOtherDeposit.setUpdatetime(new Date()); | |||
| if (forcePaid) { | |||
| wxBillOtherDeposit.setReceivePay(dbBill.getPay()); | |||
| wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||
| }else { | |||
| wxBillOtherDeposit.setReceivePay(dto.getNewPrice()); | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) >= 0) { | |||
| wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| } | |||
| wxBillOtherDepositMapper.updateById(wxBillOtherDeposit); | |||
| //账单日志 | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getOldPrice(), dto.getNewPrice(),null, dto.getRemark(), user); | |||
| } | |||
| @Override | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(dto.getId()); | |||
| WxBillOtherDeposit wxBillRent = new WxBillOtherDeposit(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| BigDecimal opay = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(dbBill.getPay())) { | |||
| opay = new BigDecimal(dbBill.getPay()); | |||
| } | |||
| opay = opay.add(new BigDecimal(dto.getAddpay())); | |||
| wxBillRent.setPay(opay.toPlainString()); | |||
| if (opay.compareTo(new BigDecimal(dbBill.getReceivePay())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| wxBillRent.setPayDate(new Date()); | |||
| wxBillRent.setPayWay(dto.getPayWay()); | |||
| wxBillOtherDepositMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.OFFLINE_PAY, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(), dto.getRemark(), user); | |||
| } | |||
| } | |||
| @@ -7,6 +7,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillDaily; | |||
| @@ -51,7 +53,7 @@ import java.util.Map; | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| public class WxBillOtherServiceImpl extends WxBillBaseService implements WxBillOtherService { | |||
| private Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| @@ -392,4 +394,49 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| updateQueryParam(wxBillOther); | |||
| return wxBillOtherMapper.getBillHotNotify(wxBillOther); | |||
| } | |||
| @Override | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) { | |||
| WxBillOther dbBill = wxBillOtherMapper.selectById(dto.getId()); | |||
| WxBillOther wxBillOther = new WxBillOther(); | |||
| wxBillOther.setId(dto.getId()); | |||
| wxBillOther.updateTenantInfo(dto); | |||
| wxBillOther.setUpdatetime(new Date()); | |||
| if (forcePaid) { | |||
| wxBillOther.setReceivePay(dbBill.getPay()); | |||
| wxBillOther.setStatus(EnumBillStatus.PAID.getCode()); | |||
| }else { | |||
| wxBillOther.setReceivePay(dto.getNewPrice()); | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) >= 0) { | |||
| wxBillOther.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| } | |||
| wxBillOtherMapper.updateById(wxBillOther); | |||
| //账单日志 | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getOldPrice(), dto.getNewPrice(),null, dto.getRemark(), user); | |||
| } | |||
| @Override | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillOther dbBill = wxBillOtherMapper.selectById(dto.getId()); | |||
| WxBillOther wxBillRent = new WxBillOther(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| BigDecimal opay = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(dbBill.getPay())) { | |||
| opay = new BigDecimal(dbBill.getPay()); | |||
| } | |||
| opay = opay.add(new BigDecimal(dto.getAddpay())); | |||
| wxBillRent.setPay(opay.toPlainString()); | |||
| if (opay.compareTo(new BigDecimal(dbBill.getReceivePay())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| wxBillRent.setPayDate(new Date()); | |||
| wxBillRent.setPayWay(dto.getPayWay()); | |||
| wxBillOtherMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.OFFLINE_PAY, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(), dto.getRemark(), user); | |||
| } | |||
| } | |||
| @@ -7,6 +7,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| @@ -54,7 +56,7 @@ import javax.servlet.http.HttpServletResponse; | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositService { | |||
| public class WxBillPropertyDepositServiceImpl extends WxBillBaseService implements WxBillPropertyDepositService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| @@ -400,4 +402,54 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||
| excelService.exportExcel(billRentList.getList(),null, billName, WxBillPropertyDeposit.class, billName + ".xlsx", response, false); | |||
| } | |||
| @Override | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) { | |||
| WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(dto.getId()); | |||
| WxBillPropertyDeposit wxBillPropertyDeposit = new WxBillPropertyDeposit(); | |||
| wxBillPropertyDeposit.setId(dto.getId()); | |||
| wxBillPropertyDeposit.updateTenantInfo(dto); | |||
| wxBillPropertyDeposit.setUpdatetime(new Date()); | |||
| String billPropertyDepositOldPrce = dto.getOldPrice(); | |||
| String billPropertyDepositNewPrce = dto.getNewPrice(); | |||
| if (forcePaid) { | |||
| wxBillPropertyDeposit.setReceivePay(dbBill.getPay()); | |||
| wxBillPropertyDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||
| billPropertyDepositOldPrce = dbBill.getPay(); | |||
| billPropertyDepositNewPrce = dbBill.getPay(); | |||
| }else { | |||
| wxBillPropertyDeposit.setReceivePay(dto.getNewPrice()); | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) >= 0) { | |||
| wxBillPropertyDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| } | |||
| wxBillPropertyDeposit.setUpdatetime(new Date()); | |||
| wxBillPropertyDepositMapper.updateById(wxBillPropertyDeposit); | |||
| //账单日志 | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), | |||
| billPropertyDepositOldPrce, billPropertyDepositNewPrce,null, dto.getRemark(), user); | |||
| } | |||
| @Override | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(dto.getId()); | |||
| WxBillPropertyDeposit wxBillRent = new WxBillPropertyDeposit(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| BigDecimal opay = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(dbBill.getPay())) { | |||
| opay = new BigDecimal(dbBill.getPay()); | |||
| } | |||
| opay = opay.add(new BigDecimal(dto.getAddpay())); | |||
| wxBillRent.setPay(opay.toPlainString()); | |||
| if (opay.compareTo(new BigDecimal(dbBill.getReceivePay())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| wxBillRent.setPayDate(new Date()); | |||
| wxBillRent.setPayWay(dto.getPayWay()); | |||
| wxBillPropertyDepositMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.OFFLINE_PAY, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(), dto.getRemark(), user); | |||
| } | |||
| } | |||
| @@ -7,6 +7,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| @@ -40,7 +42,7 @@ import java.util.stream.Collectors; | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| public class WxBillPropertyServiceImpl extends WxBillBaseService implements WxBillPropertyService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| @@ -536,4 +538,61 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| updateQueryParam(wxBillProperty); | |||
| return wxBillPropertyMapper.getBillHotNotify(wxBillProperty); | |||
| } | |||
| @Override | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) { | |||
| WxBillProperty dbBill = wxBillPropertyMapper.selectById(dto.getId()); | |||
| WxBillProperty wxBillProperty = new WxBillProperty(); | |||
| wxBillProperty.setId(dto.getId()); | |||
| wxBillProperty.updateTenantInfo(dto); | |||
| wxBillProperty.setUpdatetime(new Date()); | |||
| if (forcePaid) { | |||
| wxBillProperty.setReceivePay(dbBill.getPay()); | |||
| wxBillProperty.setStatus(EnumBillStatus.PAID.getCode()); | |||
| wxBillPropertyMapper.updateById(wxBillProperty); | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), | |||
| dbBill.getPay(), dbBill.getPay(),null,dto.getRemark(), user); | |||
| }else { | |||
| if (StringUtils.isNotBlank(dto.getOldLatePrice()) && StringUtils.isNotBlank(dto.getNewLatePrice())) { | |||
| wxBillProperty.setLatePayPrice(dto.getNewLatePrice()); | |||
| wxBillPropertyMapper.updateById(wxBillProperty); | |||
| this.addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, dto.getBillTypeValue(), dto.getId(), | |||
| dto.getOldLatePrice(), dto.getNewLatePrice(),null,dto.getRemark(), user); | |||
| } else { | |||
| Date payDate = null; | |||
| wxBillProperty.setReceivePay(dto.getNewPrice()); | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) >= 0) { | |||
| wxBillProperty.setStatus(EnumBillStatus.PAID.getCode()); | |||
| payDate = new Date(); | |||
| } | |||
| wxBillPropertyMapper.updateById(wxBillProperty); | |||
| //账单日志 | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getOldPrice(), dto.getNewPrice(),payDate,dto.getRemark(), user); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillProperty dbBill = wxBillPropertyMapper.selectById(dto.getId()); | |||
| WxBillProperty wxBillRent = new WxBillProperty(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| BigDecimal opay = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(dbBill.getPay())) { | |||
| opay = new BigDecimal(dbBill.getPay()); | |||
| } | |||
| opay = opay.add(new BigDecimal(dto.getAddpay())); | |||
| wxBillRent.setPay(opay.toPlainString()); | |||
| if (opay.compareTo(new BigDecimal(dbBill.getReceivePay())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| wxBillRent.setPayDate(new Date()); | |||
| wxBillRent.setPayWay(dto.getPayWay()); | |||
| wxBillPropertyMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.OFFLINE_PAY, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getRemark(), user); | |||
| } | |||
| } | |||
| @@ -7,6 +7,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| @@ -50,7 +52,7 @@ import java.util.stream.Collectors; | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||
| public class WxBillRentManageServiceImpl extends WxBillBaseService implements WxBillRentManageService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| @@ -451,5 +453,62 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||
| updateQueryParam(wxBillRentManage); | |||
| return wxBillRentManageMapper.getBillHotNotify(wxBillRentManage); | |||
| } | |||
| @Override | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) { | |||
| WxBillRentManage dbBill = wxBillRentManageMapper.selectById(dto.getId()); | |||
| WxBillRentManage wxBillRent = new WxBillRentManage(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| if (forcePaid) { | |||
| wxBillRent.setReceivePay(dbBill.getPay()); | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| wxBillRentManageMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), dbBill.getPay(), dbBill.getPay(),null,dto.getRemark(), user); | |||
| }else { | |||
| if (StringUtils.isNotBlank(dto.getOldLatePrice()) && StringUtils.isNotBlank(dto.getNewLatePrice())) { | |||
| wxBillRent.setLatePayPrice(dto.getNewLatePrice()); | |||
| wxBillRentManageMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getOldLatePrice(), dto.getNewLatePrice(),null,dto.getRemark(), user); | |||
| } else { | |||
| //租赁账单更新 | |||
| wxBillRent.setReceivePay(dto.getNewPrice()); | |||
| Date payDate = null; | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) >= 0) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| payDate = new Date(); | |||
| } | |||
| wxBillRentManageMapper.updateById(wxBillRent); | |||
| //账单日志 | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getOldPrice(), dto.getNewPrice(),payDate,dto.getRemark(), user); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillRentManage dbBill = wxBillRentManageMapper.selectById(dto.getId()); | |||
| WxBillRentManage wxBillRent = new WxBillRentManage(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| BigDecimal opay = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(dbBill.getPay())) { | |||
| opay = new BigDecimal(dbBill.getPay()); | |||
| } | |||
| opay = opay.add(new BigDecimal(dto.getAddpay())); | |||
| wxBillRent.setPay(opay.toPlainString()); | |||
| if (opay.compareTo(new BigDecimal(dbBill.getReceivePay())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| wxBillRent.setPayDate(new Date()); | |||
| wxBillRent.setPayWay(dto.getPayWay()); | |||
| wxBillRentManageMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.OFFLINE_PAY, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getRemark(), user); | |||
| } | |||
| } | |||
| @@ -7,6 +7,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.RatioVo; | |||
| @@ -44,7 +46,7 @@ import java.util.stream.Collectors; | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillRentServiceImpl implements WxBillRentService { | |||
| public class WxBillRentServiceImpl extends WxBillBaseService implements WxBillRentService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| @@ -181,75 +183,76 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| } | |||
| return new ResultData(Result.SUCCESS, "保存租赁账单成功"); | |||
| } else { | |||
| logger.info("更新租赁账单"); | |||
| WxBillRent wxBillRent = wxBillRentMapper.selectById(record.getId()); | |||
| if(wxBillRent==null){ | |||
| return new ResultData(ErrorCode.BILL_RENT_IS_NOT_FOUND); | |||
| } | |||
| String price = ""; | |||
| String message =""; | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillRent.setServiceChargePay(record.getServiceChargePayUpdate()); | |||
| String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | |||
| //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(latePayPrice)) | |||
| // .add(new BigDecimal(wxBillRent.getServiceChargePay())).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||
| //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||
| }else{ | |||
| String addpay = wxBillRent.getPay(); | |||
| wxBillRent.setRevenue(record.getRevenue()); | |||
| wxBillRent.setLatePayRatio(record.getLatePayRatio()); | |||
| wxBillRent.setLatePayTime(record.getLatePayTime()); | |||
| wxBillRent.setLatePayStatus(record.getLatePayStatus()); | |||
| wxBillRent.setPay(record.getPay()); | |||
| wxBillRent.setReceivePay(record.getReceivePay()); | |||
| //wxBillRent.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||
| //wxBillRent.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||
| if (record.getPay().equals(record.getRealReceivePay())) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = wxBillRent.getReceiveDate(); | |||
| wxBillRent.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| wxBillRent.setExpiredDay((long) expiredDay); | |||
| } | |||
| } | |||
| wxBillRent.setPayDate(record.getPayDate()); | |||
| wxBillRent.setUpdatetime(date); | |||
| wxBillRent.setPayWay(record.getPayWay()); | |||
| price = new BigDecimal(record.getPay()).subtract(new BigDecimal(addpay)).toPlainString(); | |||
| } | |||
| try { | |||
| wxBillRentMapper.updateById(wxBillRent); | |||
| } catch (Exception e) { | |||
| logger.error("更新租赁账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| //日志 | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(wxBillRent.getId()); | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillAction.setDetails(record.getServiceChargePayBefore()+"元变更为" +record.getServiceChargePayUpdate()+"元"); | |||
| wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); | |||
| }else{ | |||
| wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| wxBillAction.setDetails(message + price + "元"); | |||
| } | |||
| wxBillAction.setUserId(user.getId()); | |||
| wxBillAction.setUserName(user.getName()); | |||
| wxBillAction.setPhone(user.getPhone()); | |||
| wxBillAction.updateTenantInfo(wxBillRent); | |||
| wxBillAction.setPayDate(wxBillRent.getPayDate()); | |||
| try { | |||
| wxBillActionService.save(wxBillAction); | |||
| } catch (Exception e) { | |||
| logger.error("添加租赁账单行为日志,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "更新租赁账单成功", wxBillRent); | |||
| // logger.info("更新租赁账单"); | |||
| // WxBillRent wxBillRent = wxBillRentMapper.selectById(record.getId()); | |||
| // if(wxBillRent==null){ | |||
| // return new ResultData(ErrorCode.BILL_RENT_IS_NOT_FOUND); | |||
| // } | |||
| // | |||
| // String price = ""; | |||
| // String message =""; | |||
| // if(record.getServiceChargePayUpdate() != null){ | |||
| // wxBillRent.setServiceChargePay(record.getServiceChargePayUpdate()); | |||
| // String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | |||
| // //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(latePayPrice)) | |||
| // // .add(new BigDecimal(wxBillRent.getServiceChargePay())).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||
| // //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||
| // }else{ | |||
| // String addpay = wxBillRent.getPay(); | |||
| // wxBillRent.setRevenue(record.getRevenue()); | |||
| // wxBillRent.setLatePayRatio(record.getLatePayRatio()); | |||
| // wxBillRent.setLatePayTime(record.getLatePayTime()); | |||
| // wxBillRent.setLatePayStatus(record.getLatePayStatus()); | |||
| // wxBillRent.setPay(record.getPay()); | |||
| // wxBillRent.setReceivePay(record.getReceivePay()); | |||
| // //wxBillRent.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||
| // //wxBillRent.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||
| // if (record.getPay().equals(record.getRealReceivePay())) { | |||
| // wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| // Date payDate = record.getPayDate(); | |||
| // Date receiveDate = wxBillRent.getReceiveDate(); | |||
| // wxBillRent.setExpiredDay(0L); | |||
| // if (payDate.after(receiveDate)) { | |||
| // int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| // wxBillRent.setExpiredDay((long) expiredDay); | |||
| // } | |||
| // } | |||
| // wxBillRent.setPayDate(record.getPayDate()); | |||
| // wxBillRent.setUpdatetime(date); | |||
| // wxBillRent.setPayWay(record.getPayWay()); | |||
| // price = new BigDecimal(record.getPay()).subtract(new BigDecimal(addpay)).toPlainString(); | |||
| // } | |||
| // | |||
| // try { | |||
| // wxBillRentMapper.updateById(wxBillRent); | |||
| // } catch (Exception e) { | |||
| // logger.error("更新租赁账单失败,e:" + e.getMessage()); | |||
| // throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| // } | |||
| // //日志 | |||
| // WxBillAction wxBillAction = new WxBillAction(); | |||
| // wxBillAction.setBillId(wxBillRent.getId()); | |||
| // if(record.getServiceChargePayUpdate() != null){ | |||
| // wxBillAction.setDetails(record.getServiceChargePayBefore()+"元变更为" +record.getServiceChargePayUpdate()+"元"); | |||
| // wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); | |||
| // }else{ | |||
| // wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| // message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| // wxBillAction.setDetails(message + price + "元"); | |||
| // } | |||
| // wxBillAction.setUserId(user.getId()); | |||
| // wxBillAction.setUserName(user.getName()); | |||
| // wxBillAction.setPhone(user.getPhone()); | |||
| // wxBillAction.updateTenantInfo(wxBillRent); | |||
| // wxBillAction.setPayDate(wxBillRent.getPayDate()); | |||
| // try { | |||
| // wxBillActionService.save(wxBillAction); | |||
| // } catch (Exception e) { | |||
| // logger.error("添加租赁账单行为日志,e:" + e.getMessage()); | |||
| // throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| // } | |||
| // return new ResultData(Result.SUCCESS, "更新租赁账单成功", wxBillRent); | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -304,8 +307,12 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| //周期 | |||
| Map<String, Object> result = new HashMap<>(3); | |||
| result.put("rent", rent); | |||
| if (null != wxRentContract) { | |||
| wxRentContract.setTypeName(EnumRentContractType.getEnum(wxRentContract.getType()).getMessage()); | |||
| } | |||
| result.put("wxRentContract", wxRentContract); | |||
| result.put("deposit", deposit); | |||
| //解单金额 | |||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |||
| @@ -566,6 +573,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| // e.setLatePayRatio(Integer.parseInt(rent.getLatePayRatio())); | |||
| // } | |||
| e.setLatePayDay(rent.getLatePayDay()); | |||
| e.setShopNumber(rent.getRentInfoShopNumber()); | |||
| e.setRentShopType(rent.getRentShopType()); | |||
| } | |||
| //手续费 = 合同应收+手续费+滞纳金 | |||
| @@ -577,6 +586,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| e.setDepositStatus(bd.getStatus()); | |||
| } | |||
| } | |||
| } | |||
| @@ -622,4 +633,61 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| updateQueryParam(wxBillRent); | |||
| return wxBillRentMapper.getBillHotNotify(wxBillRent); | |||
| } | |||
| @Override | |||
| public void updateReceivePay(WxBillReceiveUpdateDTO dto, MallUserInfo user, boolean forcePaid) { | |||
| WxBillRent dbBill = wxBillRentMapper.selectById(dto.getId()); | |||
| WxBillRent wxBillRent = new WxBillRent(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| if (forcePaid) { | |||
| wxBillRent.setReceivePay(dbBill.getPay()); | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| wxBillRentMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), dbBill.getPay(), dbBill.getPay(),null,dto.getRemark(), user); | |||
| }else { | |||
| if (StringUtils.isNotBlank(dto.getOldLatePrice()) && StringUtils.isNotBlank(dto.getNewLatePrice())) { | |||
| wxBillRent.setLatePayPrice(dto.getNewLatePrice()); | |||
| wxBillRentMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, dto.getBillTypeValue(), dto.getId(), | |||
| dto.getOldLatePrice(), dto.getNewLatePrice(),null,dto.getRemark(), user); | |||
| } else { | |||
| //租赁账单更新 | |||
| wxBillRent.setReceivePay(dto.getNewPrice()); | |||
| Date payDate = null; | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) >= 0) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| payDate = new Date(); | |||
| } | |||
| wxBillRentMapper.updateById(wxBillRent); | |||
| //账单日志 | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getOldPrice(), dto.getNewPrice(),payDate,dto.getRemark(), user); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public void updatePay(WxBillPayDTO dto, MallUserInfo user) { | |||
| WxBillRent dbBill = wxBillRentMapper.selectById(dto.getId()); | |||
| WxBillRent wxBillRent = new WxBillRent(); | |||
| wxBillRent.setId(dto.getId()); | |||
| wxBillRent.updateTenantInfo(dto); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| BigDecimal opay = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(dbBill.getPay())) { | |||
| opay = new BigDecimal(dbBill.getPay()); | |||
| } | |||
| opay = opay.add(new BigDecimal(dto.getAddpay())); | |||
| wxBillRent.setPay(opay.toPlainString()); | |||
| if (opay.compareTo(new BigDecimal(dbBill.getReceivePay())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| wxBillRent.setPayDate(new Date()); | |||
| wxBillRent.setPayWay(dto.getPayWay()); | |||
| wxBillRentMapper.updateById(wxBillRent); | |||
| this.addBillAction(EnumBillAction.OFFLINE_PAY, dto.getBillTypeValue(),dto.getId(), | |||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getRemark(), user); | |||
| } | |||
| } | |||
| @@ -5,7 +5,10 @@ | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="bill_type" jdbcType="INTEGER" property="billType"/> | |||
| <result column="bill_id" jdbcType="BIGINT" property="billId"/> | |||
| <result column="old_money" jdbcType="VARCHAR" property="oldMoney"/> | |||
| <result column="new_money" jdbcType="VARCHAR" property="newMoney"/> | |||
| <result column="user_id" jdbcType="BIGINT" property="userId"/> | |||
| <result column="user_name" jdbcType="VARCHAR" property="userName"/> | |||
| <result column="phone" jdbcType="VARCHAR" property="phone"/> | |||
| @@ -14,10 +17,11 @@ | |||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | |||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`bill_id`,`user_id`,`user_name`,`phone`,`action`,`details`,`createtime`,`updatetime`,`pay_date` | |||
| `id`,`tenant_id`,`parent_tenant_id`,`bill_type`,`bill_id`,`old_money`,`new_money`,`user_id`,`user_name`,`phone`,`action`,`details`,`createtime`,`updatetime`,`pay_date`,`remark` | |||
| </sql> | |||
| @@ -35,6 +39,10 @@ | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != billType "> | |||
| and `bill_type` = #{billType} | |||
| </if> | |||
| <if test=" null != action "> | |||
| and `action` = #{action} | |||
| </if> | |||