| @@ -6,7 +6,9 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.common.SysConfigConstant; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.SysConfig; | |||||
| import com.iformall.domain.po.WxBillDaily; | import com.iformall.domain.po.WxBillDaily; | ||||
| import com.iformall.domain.po.WxBillDeposit; | import com.iformall.domain.po.WxBillDeposit; | ||||
| import com.iformall.domain.po.WxBillOther; | import com.iformall.domain.po.WxBillOther; | ||||
| @@ -23,6 +25,7 @@ import com.iformall.domain.po.base.WxBillBaseEntity; | |||||
| import com.iformall.domain.vo.WxBillAll; | import com.iformall.domain.vo.WxBillAll; | ||||
| import com.iformall.domain.vo.WxBillAllVo; | import com.iformall.domain.vo.WxBillAllVo; | ||||
| import com.iformall.domain.vo.WxBillExcelTemplate; | import com.iformall.domain.vo.WxBillExcelTemplate; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.domain.vo.WxMerchantBillVo; | import com.iformall.domain.vo.WxMerchantBillVo; | ||||
| import com.iformall.domain.vo.WxMerchantMicroPayVo; | import com.iformall.domain.vo.WxMerchantMicroPayVo; | ||||
| @@ -32,6 +35,7 @@ import com.iformall.enums.EnumBillType; | |||||
| import com.iformall.enums.EnumRentContractManageFeeType; | import com.iformall.enums.EnumRentContractManageFeeType; | ||||
| import com.iformall.enums.EnumYesOrNo; | import com.iformall.enums.EnumYesOrNo; | ||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.SysConfigService; | |||||
| import com.iformall.service.WxBillAllService; | import com.iformall.service.WxBillAllService; | ||||
| import com.iformall.service.WxBillDailyService; | import com.iformall.service.WxBillDailyService; | ||||
| import com.iformall.service.WxBillDepositService; | import com.iformall.service.WxBillDepositService; | ||||
| @@ -45,6 +49,7 @@ import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxPayAccountBillService; | import com.iformall.service.WxPayAccountBillService; | ||||
| import com.iformall.service.WxShopService; | import com.iformall.service.WxShopService; | ||||
| import com.iformall.service.helper.WxBillAllHelper; | import com.iformall.service.helper.WxBillAllHelper; | ||||
| import com.iformall.utils.Constant; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -89,6 +94,9 @@ public class WxBillAllController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| ExcelService excelService; | ExcelService excelService; | ||||
| @Autowired | |||||
| SysConfigService sysConfigService; | |||||
| /** | /** | ||||
| * 商户账单汇总计费列表 | * 商户账单汇总计费列表 | ||||
| * @param wxMerchant | * @param wxMerchant | ||||
| @@ -116,6 +124,12 @@ public class WxBillAllController extends BaseController { | |||||
| wxMerchant.setStarttime(null); | wxMerchant.setStarttime(null); | ||||
| wxMerchant.setEndtime(null); | wxMerchant.setEndtime(null); | ||||
| if (null != wxMerchant.getOnlyOwe() && EnumYesOrNo.YES.getCode().intValue() == wxMerchant.getOnlyOwe().intValue()) { | if (null != wxMerchant.getOnlyOwe() && EnumYesOrNo.YES.getCode().intValue() == wxMerchant.getOnlyOwe().intValue()) { | ||||
| SysConfig config = sysConfigService.getByKey(SysConfigConstant.bill_before_days, getTenantInfo()); | |||||
| Integer oweBillBeforeDays = 0 ; | |||||
| if (null != config) { | |||||
| oweBillBeforeDays = Integer.parseInt(config.getConfigItemValue()); | |||||
| } | |||||
| wxMerchant.setOweBillBeforeDays(oweBillBeforeDays); | |||||
| List<Long> mids = billAllHelper.getOwdMerchantIds(wxMerchant, starttime, enttime); | List<Long> mids = billAllHelper.getOwdMerchantIds(wxMerchant, starttime, enttime); | ||||
| if (null != mids && mids.size() > 0 ) { | if (null != mids && mids.size() > 0 ) { | ||||
| wxMerchant.setIds(mids);; | wxMerchant.setIds(mids);; | ||||
| @@ -254,23 +268,39 @@ public class WxBillAllController extends BaseController { | |||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| // @GetMapping("oweBillHot") | |||||
| // public ResultData oweBillHot() { | |||||
| // wxMerchant.updateTenantInfo(getTenantInfo()); | |||||
| // WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| // if (null != dataRule) { | |||||
| // wxMerchant.setFloorForRule(dataRule.getFloorIds()); | |||||
| // wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| // } | |||||
| // wxMerchant.setOnlyOwe(EnumYesOrNo.YES.getCode()); | |||||
| // EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| // if (null == btype) { | |||||
| // return new ResultData(Result.ERROR,"分类非法"); | |||||
| // } | |||||
| // Date starttime = wxMerchant.getStarttime(); | |||||
| // Date enttime = wxMerchant.getEndtime(); | |||||
| // return new ResultData(billAllHelper.getBillSum(btype, wxMerchant,starttime,enttime)); | |||||
| // } | |||||
| @GetMapping("oweBillHot") | |||||
| public ResultData oweBillHot() { | |||||
| return new ResultData(getHots(null)); | |||||
| } | |||||
| //临期 | |||||
| @GetMapping("nearBillHot") | |||||
| public ResultData nearBillHot() { | |||||
| SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo()); | |||||
| Integer nearBillBeforeDays = Constant.bill_near_default_days ; | |||||
| if (null != lqconfig) { | |||||
| nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue()); | |||||
| } | |||||
| return new ResultData(getHots(nearBillBeforeDays)); | |||||
| } | |||||
| private List<WxBillHotNotify> getHots(Integer nearBillBeforeDays) { | |||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | |||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxMerchant.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| SysConfig config = sysConfigService.getByKey(SysConfigConstant.bill_before_days, getTenantInfo()); | |||||
| Integer oweBillBeforeDays = 0 ; | |||||
| if (null != config) { | |||||
| oweBillBeforeDays = Integer.parseInt(config.getConfigItemValue()); | |||||
| } | |||||
| wxMerchant.setOweBillBeforeDays(oweBillBeforeDays); | |||||
| wxMerchant.setNearBillBeforeDays(nearBillBeforeDays); | |||||
| return billAllHelper.getHotNotify(wxMerchant); | |||||
| } | |||||
| /** | /** | ||||
| * 欠缴账单统计 | * 欠缴账单统计 | ||||
| @@ -284,20 +314,48 @@ public class WxBillAllController extends BaseController { | |||||
| if (null == billType) { | if (null == billType) { | ||||
| return new ResultData(Result.ERROR,"请选择分类"); | return new ResultData(Result.ERROR,"请选择分类"); | ||||
| } | } | ||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| if (null == btype) { | |||||
| return new ResultData(Result.ERROR,"分类非法"); | |||||
| } | |||||
| return new ResultData(getBillSum(wxMerchant, btype, null)); | |||||
| } | |||||
| //临期账单金额 | |||||
| @GetMapping("nearBillSum") | |||||
| public ResultData nearBillSum(@ModelAttribute WxMerchant wxMerchant,Integer billType) { | |||||
| if (null == billType) { | |||||
| return new ResultData(Result.ERROR,"请选择分类"); | |||||
| } | |||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| if (null == btype) { | |||||
| return new ResultData(Result.ERROR,"分类非法"); | |||||
| } | |||||
| SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo()); | |||||
| Integer nearBillBeforeDays = Constant.bill_near_default_days ; | |||||
| if (null != lqconfig) { | |||||
| nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue()); | |||||
| } | |||||
| return new ResultData(getBillSum(wxMerchant, btype, nearBillBeforeDays)); | |||||
| } | |||||
| private WxBillSum getBillSum(WxMerchant wxMerchant,EnumBillAllType btype,Integer nearBillBeforeDays) { | |||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | wxMerchant.updateTenantInfo(getTenantInfo()); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | WxUserDataRule dataRule = this.getCurrentDataFloors(); | ||||
| if (null != dataRule) { | if (null != dataRule) { | ||||
| wxMerchant.setFloorForRule(dataRule.getFloorIds()); | wxMerchant.setFloorForRule(dataRule.getFloorIds()); | ||||
| wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | ||||
| } | } | ||||
| wxMerchant.setOnlyOwe(EnumYesOrNo.YES.getCode()); | |||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| if (null == btype) { | |||||
| return new ResultData(Result.ERROR,"分类非法"); | |||||
| SysConfig config = sysConfigService.getByKey(SysConfigConstant.bill_before_days, getTenantInfo()); | |||||
| Integer oweBillBeforeDays = 0 ; | |||||
| if (null != config) { | |||||
| oweBillBeforeDays = Integer.parseInt(config.getConfigItemValue()); | |||||
| } | } | ||||
| wxMerchant.setOweBillBeforeDays(oweBillBeforeDays); | |||||
| wxMerchant.setNearBillBeforeDays(nearBillBeforeDays); | |||||
| Date starttime = wxMerchant.getStarttime(); | Date starttime = wxMerchant.getStarttime(); | ||||
| Date enttime = wxMerchant.getEndtime(); | Date enttime = wxMerchant.getEndtime(); | ||||
| return new ResultData(billAllHelper.getBillSum(btype, wxMerchant,starttime,enttime)); | |||||
| return billAllHelper.getBillSum(btype, wxMerchant,starttime,enttime); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -315,18 +373,49 @@ public class WxBillAllController extends BaseController { | |||||
| if (null == billType) { | if (null == billType) { | ||||
| return new ResultData(Result.ERROR,"请选择分类"); | return new ResultData(Result.ERROR,"请选择分类"); | ||||
| } | } | ||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| if (null == btype) { | |||||
| return new ResultData(Result.ERROR,"分类非法"); | |||||
| } | |||||
| return new ResultData(getBillList(wxMerchant, btype, null, pageNum, pageSize)); | |||||
| } | |||||
| @GetMapping("nearBillList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData nearBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, Integer pageNum, Integer pageSize) { | |||||
| if (null == billType) { | |||||
| return new ResultData(Result.ERROR,"请选择分类"); | |||||
| } | |||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| if (null == btype) { | |||||
| return new ResultData(Result.ERROR,"分类非法"); | |||||
| } | |||||
| SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo()); | |||||
| Integer nearBillBeforeDays = Constant.bill_near_default_days ; | |||||
| if (null != lqconfig) { | |||||
| nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue()); | |||||
| } | |||||
| return new ResultData(getBillList(wxMerchant, btype, nearBillBeforeDays, pageNum, pageSize)); | |||||
| } | |||||
| private PageInfo getBillList(WxMerchant wxMerchant,EnumBillAllType btype,Integer nearBillBeforeDays, Integer pageNum, Integer pageSize) { | |||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | wxMerchant.updateTenantInfo(getTenantInfo()); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | WxUserDataRule dataRule = this.getCurrentDataFloors(); | ||||
| if (null != dataRule) { | if (null != dataRule) { | ||||
| wxMerchant.setFloorForRule(dataRule.getFloorIds()); | wxMerchant.setFloorForRule(dataRule.getFloorIds()); | ||||
| wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | ||||
| } | } | ||||
| wxMerchant.setOnlyOwe(EnumYesOrNo.YES.getCode()); | |||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| if (null == btype) { | |||||
| return new ResultData(Result.ERROR,"分类非法"); | |||||
| SysConfig config = sysConfigService.getByKey(SysConfigConstant.bill_before_days, getTenantInfo()); | |||||
| Integer oweBillBeforeDays = 0 ; | |||||
| if (null != config) { | |||||
| oweBillBeforeDays = Integer.parseInt(config.getConfigItemValue()); | |||||
| } | } | ||||
| return new ResultData(billAllHelper.getBillList(btype, wxMerchant,pageNum,pageSize)); | |||||
| wxMerchant.setOweBillBeforeDays(oweBillBeforeDays); | |||||
| wxMerchant.setNearBillBeforeDays(nearBillBeforeDays); | |||||
| return billAllHelper.getBillList(btype, wxMerchant,pageNum,pageSize); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -341,19 +430,37 @@ public class WxBillAllController extends BaseController { | |||||
| if (null == billType) { | if (null == billType) { | ||||
| return ; | return ; | ||||
| } | } | ||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | |||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxMerchant.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| wxMerchant.setOnlyOwe(EnumYesOrNo.YES.getCode()); | |||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | EnumBillAllType btype = EnumBillAllType.getEnum(billType); | ||||
| if (null == btype) { | if (null == btype) { | ||||
| return ; | return ; | ||||
| } | } | ||||
| PageInfo page = billAllHelper.getBillList(btype, wxMerchant,1,10000); | |||||
| excelService.exportExcel(page.getList(), null, "商户账单总览数据", WxBillBaseEntity.class, "商户欠缴账单_"+btype.getMessage()+".xlsx", response, false); | |||||
| PageInfo page = getBillList(wxMerchant, btype, null, 1, 10000); | |||||
| if (null == page) { | |||||
| return; | |||||
| } | |||||
| excelService.exportExcel(page.getList(), null, "逾期账单列表", WxBillBaseEntity.class, "商户欠缴账单_"+btype.getMessage()+".xlsx", response, false); | |||||
| } | |||||
| //临期 | |||||
| @GetMapping("exportNearBillList") | |||||
| public void exportNearBillList(@ModelAttribute WxMerchant wxMerchant,Integer billType, HttpServletRequest request, HttpServletResponse response) { | |||||
| if (null == billType) { | |||||
| return ; | |||||
| } | |||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| if (null == btype) { | |||||
| return ; | |||||
| } | |||||
| SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo()); | |||||
| Integer nearBillBeforeDays = Constant.bill_near_default_days ; | |||||
| if (null != lqconfig) { | |||||
| nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue()); | |||||
| } | |||||
| PageInfo page = getBillList(wxMerchant, btype, nearBillBeforeDays, 1, 10000); | |||||
| if (null == page) { | |||||
| return; | |||||
| } | |||||
| excelService.exportExcel(page.getList(), null, "临期账单列表", WxBillBaseEntity.class, "商户临期账单_"+btype.getMessage()+".xlsx", response, false); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -376,7 +483,24 @@ public class WxBillAllController extends BaseController { | |||||
| if (null == bill) { | if (null == bill) { | ||||
| return; | return; | ||||
| } | } | ||||
| billAllHelper.exportOneBillOweWord(bill, request, response); | |||||
| billAllHelper.exportOneBillOweWord(true,bill, request, response); | |||||
| } | |||||
| //临期 | |||||
| @GetMapping("exportOneNearBill") | |||||
| public void exportOneNearBill(Long id,Integer billType, HttpServletRequest request, HttpServletResponse response) { | |||||
| if (null == billType) { | |||||
| return ; | |||||
| } | |||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| if (null == btype) { | |||||
| return ; | |||||
| } | |||||
| WxBillBaseEntity bill = billAllHelper.getOneBill(getTenantInfo(), btype, id); | |||||
| if (null == bill) { | |||||
| return; | |||||
| } | |||||
| billAllHelper.exportOneBillOweWord(false,bill, request, response); | |||||
| } | } | ||||
| //###################################### 老代码 ###################################### | //###################################### 老代码 ###################################### | ||||
| @@ -34,8 +34,8 @@ public class LatePayBillActionSchedule { | |||||
| wxBillPropertyMapper.autoAddLatePayPrice(); | wxBillPropertyMapper.autoAddLatePayPrice(); | ||||
| //修改欠缴 | //修改欠缴 | ||||
| wxBillRentMapper.updateOwe(); | |||||
| wxBillPropertyMapper.updateOwe(); | |||||
| //wxBillRentMapper.updateOwe(); | |||||
| //wxBillPropertyMapper.updateOwe(); | |||||
| logger.info("账单滞纳金更新结束"); | logger.info("账单滞纳金更新结束"); | ||||
| }catch (Exception e){ | }catch (Exception e){ | ||||
| @@ -10,5 +10,6 @@ public class SysConfigConstant { | |||||
| public static final String member_seconds_key="memberSeconds"; | public static final String member_seconds_key="memberSeconds"; | ||||
| public static final String merchant_credit_locked="merchantCreditLocked"; | public static final String merchant_credit_locked="merchantCreditLocked"; | ||||
| public static final String merchant_Login_CheckPhone = "merchantLoginCheckPhone"; | public static final String merchant_Login_CheckPhone = "merchantLoginCheckPhone"; | ||||
| public static final String bill_before_days = "billBeforeDays"; | |||||
| public static final String bill_near_days = "billNearDays"; | |||||
| } | } | ||||
| @@ -48,8 +48,6 @@ public class WxBillDaily extends WxBillBaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | ||||
| private Long expiredDay; | private Long expiredDay; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | ||||
| private Integer applyStatus; | private Integer applyStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | ||||
| @@ -34,9 +34,6 @@ public class WxBillDeposit extends WxBillBaseEntity { | |||||
| private Date createtime; | private Date createtime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | ||||
| private Long expiredDay; | private Long expiredDay; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期5已退还", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | ||||
| private Integer applyStatus; | private Integer applyStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | ||||
| @@ -52,9 +52,6 @@ public class WxBillOther extends WxBillBaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | ||||
| private Long expiredDay; | private Long expiredDay; | ||||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "9") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | ||||
| private Integer applyStatus; | private Integer applyStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | ||||
| @@ -45,9 +45,6 @@ public class WxBillOtherDeposit extends WxBillBaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "逾期天数", name = "expiredDay") | @io.swagger.annotations.ApiModelProperty(value = "逾期天数", name = "expiredDay") | ||||
| private Long expiredDay; | private Long expiredDay; | ||||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "8") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期5已退还", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | ||||
| private Integer applyStatus; | private Integer applyStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | ||||
| @@ -48,10 +48,6 @@ public class WxBillProperty extends WxBillBaseEntity { | |||||
| @Excel(name = "逾期(天) ", width = 20, orderNum = "13") | @Excel(name = "逾期(天) ", width = 20, orderNum = "13") | ||||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | ||||
| private Long expiredDay; | private Long expiredDay; | ||||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "8") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | ||||
| private Integer applyStatus; | private Integer applyStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | ||||
| @@ -34,8 +34,6 @@ public class WxBillPropertyDeposit extends WxBillBaseEntity { | |||||
| private Date createtime; | private Date createtime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | ||||
| private Long expiredDay; | private Long expiredDay; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期5已退还", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | ||||
| private Integer applyStatus; | private Integer applyStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | ||||
| @@ -48,10 +48,6 @@ public class WxBillRent extends WxBillBaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | ||||
| private Long expiredDay; | private Long expiredDay; | ||||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "10") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期EnumBillRentStatus", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | ||||
| private Integer applyStatus; | private Integer applyStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | ||||
| @@ -49,10 +49,6 @@ public class WxBillRentManage extends WxBillBaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | ||||
| private Long expiredDay; | private Long expiredDay; | ||||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "10") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status") | |||||
| private Integer status; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") | ||||
| private Integer applyStatus; | private Integer applyStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | @io.swagger.annotations.ApiModelProperty(value = "付款截图", name = "applyPayImg") | ||||
| @@ -444,8 +444,17 @@ public class WxMerchant extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String initLog; | private String initLog; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer onlyOwe; | private Integer onlyOwe; | ||||
| //账单逾期计算提前天数 | |||||
| @TableField(exist = false) | |||||
| private Integer oweBillBeforeDays; | |||||
| //临期计算提前天数 | |||||
| @TableField(exist = false) | |||||
| private Integer nearBillBeforeDays; | |||||
| } | } | ||||
| @@ -57,8 +57,16 @@ public class WxBillBaseEntity extends TenantEntity { | |||||
| protected Date endtimeEnd; | protected Date endtimeEnd; | ||||
| @Excel(name = "欠缴金额(元)", width = 20, orderNum = "11") | @Excel(name = "欠缴金额(元)", width = 20, orderNum = "11") | ||||
| @io.swagger.annotations.ApiModelProperty(value="欠缴",name="owe") | |||||
| @TableField(exist = false) | |||||
| protected String owe; | protected String owe; | ||||
| public String getOwe() { | |||||
| return new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString(); | |||||
| } | |||||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "10") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") | |||||
| protected Integer status; | |||||
| //@Excel(name = "实际应收总金额(元)", width = 20, orderNum = "8") | //@Excel(name = "实际应收总金额(元)", width = 20, orderNum = "8") | ||||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额(加上了滞纳金服务费等费用)",name="realReceivePay") | @io.swagger.annotations.ApiModelProperty(value="实际应收金额(加上了滞纳金服务费等费用)",name="realReceivePay") | ||||
| @@ -87,7 +95,15 @@ public class WxBillBaseEntity extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected String month; | protected String month; | ||||
| // @TableField(exist = false) | |||||
| // protected Integer onlyOwe; | |||||
| //账单逾期计算提前天数 | |||||
| @TableField(exist = false) | |||||
| private Integer oweBillBeforeDays; | |||||
| //临期计算提前天数 | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected Integer onlyOwe; | |||||
| private Integer nearBillBeforeDays; | |||||
| } | } | ||||
| @@ -13,8 +13,6 @@ public class WxBillHotNotify implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| //EnumBillAllType; | |||||
| private Integer billType; | |||||
| private String billTypeName; | private String billTypeName; | ||||
| private Integer totalCount = 0; | private Integer totalCount = 0; | ||||
| private String totalMoney = "0"; | private String totalMoney = "0"; | ||||
| @@ -22,6 +22,7 @@ public class WxBillSum implements Serializable { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private BigDecimal paidNumber; | private BigDecimal paidNumber; | ||||
| //欠款 | //欠款 | ||||
| @TableField(exist = false) | |||||
| private String owe = "0"; | private String owe = "0"; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private BigDecimal oweNumber; | private BigDecimal oweNumber; | ||||
| @@ -44,7 +45,11 @@ public class WxBillSum implements Serializable { | |||||
| return paidNumber; | return paidNumber; | ||||
| } | } | ||||
| public String getOwe() { | |||||
| return new BigDecimal(needPay).subtract(new BigDecimal(paid)).toPlainString(); | |||||
| } | |||||
| public BigDecimal getOweNumber() { | public BigDecimal getOweNumber() { | ||||
| this.owe = getOwe(); | |||||
| if (StringUtils.isNotBlank(owe)) { | if (StringUtils.isNotBlank(owe)) { | ||||
| this.oweNumber = new BigDecimal(owe).setScale(2, RoundingMode.HALF_UP); | this.oweNumber = new BigDecimal(owe).setScale(2, RoundingMode.HALF_UP); | ||||
| }else { | }else { | ||||
| @@ -1,41 +0,0 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public enum EnumBillDailyStatus { | |||||
| NOT_PAID(1, "欠缴"), | |||||
| WAIT_PAY(2,"待缴"), | |||||
| PAID(3, "已结清"), | |||||
| NOT_EXPIRED(4,"未到期"), | |||||
| RETURN(5, "退还"), | |||||
| ; | |||||
| public static EnumBillDailyStatus getEnum(Integer code) { | |||||
| for (EnumBillDailyStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumBillDailyStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -5,7 +5,7 @@ package com.iformall.enums; | |||||
| * @author gongbiao | * @author gongbiao | ||||
| */ | */ | ||||
| public enum EnumBillRentStatus { | |||||
| public enum EnumBillStatus { | |||||
| NOT_PAID(1, "欠缴"), | NOT_PAID(1, "欠缴"), | ||||
| WAIT_PAY(2,"待缴"), | WAIT_PAY(2,"待缴"), | ||||
| PAID(3, "已结清"), | PAID(3, "已结清"), | ||||
| @@ -14,8 +14,8 @@ public enum EnumBillRentStatus { | |||||
| INVALID(6, "失效"), | INVALID(6, "失效"), | ||||
| ; | ; | ||||
| public static EnumBillRentStatus getEnum(Integer code) { | |||||
| for (EnumBillRentStatus value : values()) { | |||||
| public static EnumBillStatus getEnum(Integer code) { | |||||
| for (EnumBillStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | if (value.getCode().equals(code)) { | ||||
| return value; | return value; | ||||
| } | } | ||||
| @@ -26,7 +26,7 @@ public enum EnumBillRentStatus { | |||||
| private Integer code; | private Integer code; | ||||
| private String message; | private String message; | ||||
| EnumBillRentStatus(Integer code, String message) { | |||||
| EnumBillStatus(Integer code, String message) { | |||||
| this.code = code; | this.code = code; | ||||
| this.message = message; | this.message = message; | ||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxBillDaily; | import com.iformall.domain.po.WxBillDaily; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -24,5 +25,7 @@ public interface WxBillDailyMapper extends CommonMapper<WxBillDaily, Long> { | |||||
| WxBillSum getBillMonthSum(WxBillDaily record); | WxBillSum getBillMonthSum(WxBillDaily record); | ||||
| List<Long> getMerchantIdList(WxBillDaily record); | List<Long> getMerchantIdList(WxBillDaily record); | ||||
| WxBillHotNotify getBillHotNotify(WxBillDaily record); | |||||
| } | } | ||||
| @@ -5,6 +5,7 @@ import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxBillDeposit; | import com.iformall.domain.po.WxBillDeposit; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -36,4 +37,6 @@ public interface WxBillDepositMapper extends CommonMapper<WxBillDeposit, Long> { | |||||
| List<Long> getMerchantIdList(WxBillDeposit wxBillDeposit); | List<Long> getMerchantIdList(WxBillDeposit wxBillDeposit); | ||||
| WxBillHotNotify getBillHotNotify(WxBillDeposit wxBillDeposit); | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxBillOtherDeposit; | import com.iformall.domain.po.WxBillOtherDeposit; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -24,5 +25,7 @@ public interface WxBillOtherDepositMapper extends CommonMapper<WxBillOtherDeposi | |||||
| WxBillSum getBillMonthSum(WxBillOtherDeposit record); | WxBillSum getBillMonthSum(WxBillOtherDeposit record); | ||||
| List<Long> getMerchantIdList(WxBillOtherDeposit record); | List<Long> getMerchantIdList(WxBillOtherDeposit record); | ||||
| WxBillHotNotify getBillHotNotify(WxBillOtherDeposit record); | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxBillOther; | import com.iformall.domain.po.WxBillOther; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -28,4 +29,6 @@ public interface WxBillOtherMapper extends CommonMapper<WxBillOther, Long> { | |||||
| WxBillSum getBillMonthSum(WxBillOther record); | WxBillSum getBillMonthSum(WxBillOther record); | ||||
| List<Long> getMerchantIdList(WxBillOther record); | List<Long> getMerchantIdList(WxBillOther record); | ||||
| WxBillHotNotify getBillHotNotify(WxBillOther record); | |||||
| } | } | ||||
| @@ -4,6 +4,7 @@ import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxBillPropertyDeposit; | import com.iformall.domain.po.WxBillPropertyDeposit; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -31,4 +32,6 @@ public interface WxBillPropertyDepositMapper extends CommonMapper<WxBillProperty | |||||
| WxBillSum getBillMonthSum(WxBillPropertyDeposit wxBillPropertyDeposit); | WxBillSum getBillMonthSum(WxBillPropertyDeposit wxBillPropertyDeposit); | ||||
| List<Long> getMerchantIdList(WxBillPropertyDeposit wxBillPropertyDeposit); | List<Long> getMerchantIdList(WxBillPropertyDeposit wxBillPropertyDeposit); | ||||
| WxBillHotNotify getBillHotNotify(WxBillPropertyDeposit wxBillPropertyDeposit); | |||||
| } | } | ||||
| @@ -6,6 +6,7 @@ import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -62,11 +63,13 @@ public interface WxBillPropertyMapper extends CommonMapper<WxBillProperty, Long> | |||||
| void updateServiceCharge(WxPayAccountBill tenantId); | void updateServiceCharge(WxPayAccountBill tenantId); | ||||
| void updateOwe(); | |||||
| //void updateOwe(); | |||||
| WxBillSum getBillMonthSum(WxBillProperty propertyQuery); | WxBillSum getBillMonthSum(WxBillProperty propertyQuery); | ||||
| List<Long> getMerchantIdList(WxBillProperty propertyQuery); | List<Long> getMerchantIdList(WxBillProperty propertyQuery); | ||||
| WxBillHotNotify getBillHotNotify(WxBillProperty propertyQuery); | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxBillRentManage; | import com.iformall.domain.po.WxBillRentManage; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| @@ -35,5 +36,7 @@ public interface WxBillRentManageMapper extends CommonMapper<WxBillRentManage, L | |||||
| WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage); | WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage); | ||||
| List<Long> getMerchantIdList(WxBillRentManage wxBillRentManage); | List<Long> getMerchantIdList(WxBillRentManage wxBillRentManage); | ||||
| WxBillHotNotify getBillHotNotify(WxBillRentManage wxBillRentManage); | |||||
| } | } | ||||
| @@ -4,6 +4,7 @@ import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| @@ -59,10 +60,12 @@ public interface WxBillRentMapper extends CommonMapper<WxBillRent, Long> { | |||||
| void updateServiceCharge(WxPayAccountBill record); | void updateServiceCharge(WxPayAccountBill record); | ||||
| void updateOwe(); | |||||
| //void updateOwe(); | |||||
| WxBillSum getBillMonthSum(WxBillRent wxBillRent); | WxBillSum getBillMonthSum(WxBillRent wxBillRent); | ||||
| List<Long> getMerchantIdList(WxBillRent wxBillRent); | List<Long> getMerchantIdList(WxBillRent wxBillRent); | ||||
| WxBillHotNotify getBillHotNotify(WxBillRent wxBillRent); | |||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.WxBillDaily; | |||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillDailyVo; | import com.iformall.domain.vo.WxBillDailyVo; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -66,5 +67,7 @@ public interface WxBillDailyService { | |||||
| WxBillSum getBillMonthSum(WxBillDaily wxBillDaily); | WxBillSum getBillMonthSum(WxBillDaily wxBillDaily); | ||||
| List<Long> getMerchantIds(WxBillDaily wxBillDaily); | List<Long> getMerchantIds(WxBillDaily wxBillDaily); | ||||
| WxBillHotNotify getBillHotNotify(WxBillDaily wxBillDaily); | |||||
| } | } | ||||
| @@ -8,6 +8,7 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxBillDeposit; | import com.iformall.domain.po.WxBillDeposit; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| public interface WxBillDepositService { | public interface WxBillDepositService { | ||||
| @@ -59,5 +60,7 @@ public interface WxBillDepositService { | |||||
| WxBillSum getBillMonthSum(WxBillDeposit wxBillDeposit); | WxBillSum getBillMonthSum(WxBillDeposit wxBillDeposit); | ||||
| List<Long> getMerchantIds(WxBillDeposit wxBillDeposit); | List<Long> getMerchantIds(WxBillDeposit wxBillDeposit); | ||||
| WxBillHotNotify getBillHotNotify(WxBillDeposit wxBillDeposit); | |||||
| } | } | ||||
| @@ -6,6 +6,7 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxBillOtherDeposit; | import com.iformall.domain.po.WxBillOtherDeposit; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -65,5 +66,7 @@ public interface WxBillOtherDepositService { | |||||
| WxBillSum getBillMonthSum(WxBillOtherDeposit wxBillDeposit); | WxBillSum getBillMonthSum(WxBillOtherDeposit wxBillDeposit); | ||||
| List<Long> getMerchantIds(WxBillOtherDeposit wxBillDeposit); | List<Long> getMerchantIds(WxBillOtherDeposit wxBillDeposit); | ||||
| WxBillHotNotify getBillHotNotify(WxBillOtherDeposit wxBillDeposit); | |||||
| } | } | ||||
| @@ -6,6 +6,7 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxBillOther; | import com.iformall.domain.po.WxBillOther; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -61,5 +62,7 @@ public interface WxBillOtherService { | |||||
| WxBillSum getBillMonthSum(WxBillOther wxBillOther); | WxBillSum getBillMonthSum(WxBillOther wxBillOther); | ||||
| List<Long> getMerchantIds(WxBillOther wxBillOther); | List<Long> getMerchantIds(WxBillOther wxBillOther); | ||||
| WxBillHotNotify getBillHotNotify(WxBillOther wxBillOther); | |||||
| } | } | ||||
| @@ -8,6 +8,7 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxBillPropertyDeposit; | import com.iformall.domain.po.WxBillPropertyDeposit; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| /** | /** | ||||
| @@ -62,4 +63,6 @@ public interface WxBillPropertyDepositService { | |||||
| WxBillSum getBillMonthSum(WxBillPropertyDeposit deposit); | WxBillSum getBillMonthSum(WxBillPropertyDeposit deposit); | ||||
| List<Long> getMerchantIds(WxBillPropertyDeposit deposit); | List<Long> getMerchantIds(WxBillPropertyDeposit deposit); | ||||
| WxBillHotNotify getBillHotNotify(WxBillPropertyDeposit deposit); | |||||
| } | } | ||||
| @@ -6,6 +6,7 @@ import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxBillProperty; | import com.iformall.domain.po.WxBillProperty; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -76,4 +77,6 @@ public interface WxBillPropertyService { | |||||
| WxBillSum getBillMonthSum(WxBillProperty wxBillProperty); | WxBillSum getBillMonthSum(WxBillProperty wxBillProperty); | ||||
| List<Long> getMerchantIds(WxBillProperty wxBillProperty); | List<Long> getMerchantIds(WxBillProperty wxBillProperty); | ||||
| WxBillHotNotify getBillHotNotify(WxBillProperty wxBillProperty); | |||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxBillRentManage; | import com.iformall.domain.po.WxBillRentManage; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -73,4 +74,6 @@ public interface WxBillRentManageService { | |||||
| WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage); | WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage); | ||||
| List<Long> getMerchantIds(WxBillRentManage wxBillRentManage); | List<Long> getMerchantIds(WxBillRentManage wxBillRentManage); | ||||
| WxBillHotNotify getBillHotNotify(WxBillRentManage wxBillRentManage); | |||||
| } | } | ||||
| @@ -5,6 +5,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -77,5 +78,7 @@ public interface WxBillRentService { | |||||
| List<Long> getMerchantIds(WxBillRent wxBillRent); | List<Long> getMerchantIds(WxBillRent wxBillRent); | ||||
| WxBillHotNotify getBillHotNotify(WxBillRent wxBillRent); | |||||
| } | } | ||||
| @@ -101,10 +101,11 @@ public class WxBillAllHelper { | |||||
| bill.setFloor(wxMerchant.getFloor()); | bill.setFloor(wxMerchant.getFloor()); | ||||
| bill.setMerchantName(wxMerchant.getName()); | bill.setMerchantName(wxMerchant.getName()); | ||||
| bill.setMerchantId(wxMerchant.getId()); | bill.setMerchantId(wxMerchant.getId()); | ||||
| bill.setOnlyOwe(wxMerchant.getOnlyOwe()); | |||||
| bill.setStarttime(starttime); | bill.setStarttime(starttime); | ||||
| bill.setEndtime(enttime); | bill.setEndtime(enttime); | ||||
| bill.setRentShopType(wxMerchant.getType()); | bill.setRentShopType(wxMerchant.getType()); | ||||
| bill.setOweBillBeforeDays(wxMerchant.getOweBillBeforeDays()); | |||||
| bill.setNearBillBeforeDays(wxMerchant.getNearBillBeforeDays()); | |||||
| } | } | ||||
| public WxBillSum getBillRentSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | public WxBillSum getBillRentSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | ||||
| @@ -124,10 +125,16 @@ public class WxBillAllHelper { | |||||
| return wxBillRentService.getMerchantIds(br); | return wxBillRentService.getMerchantIds(br); | ||||
| } | } | ||||
| // public WxBillHotNotify getBillRentHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||||
| // WxBillRent br = new WxBillRent(); | |||||
| // updateQueryParm(wxMerchant, br,starttime,enttime); | |||||
| // } | |||||
| public WxBillHotNotify getBillRentHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||||
| WxBillRent br = new WxBillRent(); | |||||
| updateQueryParm(wxMerchant, br,starttime,enttime); | |||||
| WxBillHotNotify notify = wxBillRentService.getBillHotNotify(br); | |||||
| if (null == notify) { | |||||
| notify = new WxBillHotNotify(); | |||||
| } | |||||
| notify.setBillTypeName(EnumBillAllType.RENT.getMessage()); | |||||
| return notify; | |||||
| } | |||||
| public WxBillSum getBillRentManageSum(WxMerchant wxMerchant,Date starttime, Date enttime,EnumRentContractManageFeeType manageFeeType) { | public WxBillSum getBillRentManageSum(WxMerchant wxMerchant,Date starttime, Date enttime,EnumRentContractManageFeeType manageFeeType) { | ||||
| WxBillRentManage brm = new WxBillRentManage(); | WxBillRentManage brm = new WxBillRentManage(); | ||||
| @@ -156,6 +163,21 @@ public class WxBillAllHelper { | |||||
| return wxBillRentManageService.getMerchantIds(brm); | return wxBillRentManageService.getMerchantIds(brm); | ||||
| } | } | ||||
| public WxBillHotNotify getBillRentManageHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime,EnumRentContractManageFeeType manageFeeType) { | |||||
| WxBillRentManage brm = new WxBillRentManage(); | |||||
| updateQueryParm(wxMerchant, brm,starttime,enttime); | |||||
| WxBillHotNotify notify = wxBillRentManageService.getBillHotNotify(brm); | |||||
| if (null == notify) { | |||||
| notify = new WxBillHotNotify(); | |||||
| } | |||||
| if (null != manageFeeType) { | |||||
| notify.setBillTypeName(manageFeeType.getMessage()); | |||||
| }else { | |||||
| notify.setBillTypeName("商业&运营管理费"); | |||||
| } | |||||
| return notify; | |||||
| } | |||||
| public WxBillSum getBillDepositSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | public WxBillSum getBillDepositSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | ||||
| WxBillDeposit bd = new WxBillDeposit(); | WxBillDeposit bd = new WxBillDeposit(); | ||||
| updateQueryParm(wxMerchant, bd,starttime,enttime); | updateQueryParm(wxMerchant, bd,starttime,enttime); | ||||
| @@ -173,6 +195,17 @@ public class WxBillAllHelper { | |||||
| return wxBillRentDepositService.getMerchantIds(bd); | return wxBillRentDepositService.getMerchantIds(bd); | ||||
| } | } | ||||
| public WxBillHotNotify getBillDepositHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||||
| WxBillDeposit bd = new WxBillDeposit(); | |||||
| updateQueryParm(wxMerchant, bd,starttime,enttime); | |||||
| WxBillHotNotify notify = wxBillRentDepositService.getBillHotNotify(bd); | |||||
| if (null == notify) { | |||||
| notify = new WxBillHotNotify(); | |||||
| } | |||||
| notify.setBillTypeName(EnumBillAllType.RENT_DEPOSIT.getMessage()); | |||||
| return notify; | |||||
| } | |||||
| public WxBillSum getBillPropertySum(WxMerchant wxMerchant,Date starttime, Date enttime) { | public WxBillSum getBillPropertySum(WxMerchant wxMerchant,Date starttime, Date enttime) { | ||||
| WxBillProperty bp = new WxBillProperty(); | WxBillProperty bp = new WxBillProperty(); | ||||
| updateQueryParm(wxMerchant, bp,starttime,enttime); | updateQueryParm(wxMerchant, bp,starttime,enttime); | ||||
| @@ -190,6 +223,17 @@ public class WxBillAllHelper { | |||||
| return wxBillPropertyService.getMerchantIds(bp); | return wxBillPropertyService.getMerchantIds(bp); | ||||
| } | } | ||||
| public WxBillHotNotify getBillPropertyHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||||
| WxBillProperty bp = new WxBillProperty(); | |||||
| updateQueryParm(wxMerchant, bp,starttime,enttime); | |||||
| WxBillHotNotify notify = wxBillPropertyService.getBillHotNotify(bp); | |||||
| if (null == notify) { | |||||
| notify = new WxBillHotNotify(); | |||||
| } | |||||
| notify.setBillTypeName(EnumBillAllType.PROPERTY.getMessage()); | |||||
| return notify; | |||||
| } | |||||
| public WxBillSum getBillPropertyDepositSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | public WxBillSum getBillPropertyDepositSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | ||||
| WxBillPropertyDeposit pd = new WxBillPropertyDeposit(); | WxBillPropertyDeposit pd = new WxBillPropertyDeposit(); | ||||
| updateQueryParm(wxMerchant, pd,starttime,enttime); | updateQueryParm(wxMerchant, pd,starttime,enttime); | ||||
| @@ -207,6 +251,17 @@ public class WxBillAllHelper { | |||||
| return wxBillPropertyDepositService.getMerchantIds(pd); | return wxBillPropertyDepositService.getMerchantIds(pd); | ||||
| } | } | ||||
| public WxBillHotNotify getBillPropertyDepositHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||||
| WxBillPropertyDeposit pd = new WxBillPropertyDeposit(); | |||||
| updateQueryParm(wxMerchant, pd,starttime,enttime); | |||||
| WxBillHotNotify notify = wxBillPropertyDepositService.getBillHotNotify(pd); | |||||
| if (null == notify) { | |||||
| notify = new WxBillHotNotify(); | |||||
| } | |||||
| notify.setBillTypeName(EnumBillAllType.PROPERTY_DEPOSIT.getMessage()); | |||||
| return notify; | |||||
| } | |||||
| public WxBillSum getBillDailySum(WxMerchant wxMerchant,Date starttime, Date enttime,EnumBillDailyType dailyType) { | public WxBillSum getBillDailySum(WxMerchant wxMerchant,Date starttime, Date enttime,EnumBillDailyType dailyType) { | ||||
| WxBillDaily bdd = new WxBillDaily(); | WxBillDaily bdd = new WxBillDaily(); | ||||
| if (null != dailyType) { | if (null != dailyType) { | ||||
| @@ -234,6 +289,17 @@ public class WxBillAllHelper { | |||||
| return wxBillDailyService.getMerchantIds(bdd); | return wxBillDailyService.getMerchantIds(bdd); | ||||
| } | } | ||||
| public WxBillHotNotify getBillDailyHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||||
| WxBillDaily bdd = new WxBillDaily(); | |||||
| updateQueryParm(wxMerchant, bdd,starttime,enttime); | |||||
| WxBillHotNotify notify = wxBillDailyService.getBillHotNotify(bdd); | |||||
| if (null == notify) { | |||||
| notify = new WxBillHotNotify(); | |||||
| } | |||||
| notify.setBillTypeName(EnumBillAllType.DAILY.getMessage()); | |||||
| return notify; | |||||
| } | |||||
| public WxBillSum getBillOtherSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | public WxBillSum getBillOtherSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | ||||
| WxBillOther bo = new WxBillOther(); | WxBillOther bo = new WxBillOther(); | ||||
| updateQueryParm(wxMerchant, bo,starttime,enttime); | updateQueryParm(wxMerchant, bo,starttime,enttime); | ||||
| @@ -251,6 +317,17 @@ public class WxBillAllHelper { | |||||
| return wxBillOtherService.getMerchantIds(bo); | return wxBillOtherService.getMerchantIds(bo); | ||||
| } | } | ||||
| public WxBillHotNotify getBillOtherHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||||
| WxBillOther bo = new WxBillOther(); | |||||
| updateQueryParm(wxMerchant, bo,starttime,enttime); | |||||
| WxBillHotNotify notify = wxBillOtherService.getBillHotNotify(bo); | |||||
| if (null == notify) { | |||||
| notify = new WxBillHotNotify(); | |||||
| } | |||||
| notify.setBillTypeName(EnumBillAllType.OTHER.getMessage()); | |||||
| return notify; | |||||
| } | |||||
| public WxBillSum getBillOtherDepositSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | public WxBillSum getBillOtherDepositSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | ||||
| WxBillOtherDeposit bod = new WxBillOtherDeposit(); | WxBillOtherDeposit bod = new WxBillOtherDeposit(); | ||||
| updateQueryParm(wxMerchant, bod,starttime,enttime); | updateQueryParm(wxMerchant, bod,starttime,enttime); | ||||
| @@ -268,6 +345,17 @@ public class WxBillAllHelper { | |||||
| return wxBillOtherDepositService.getMerchantIds(bod); | return wxBillOtherDepositService.getMerchantIds(bod); | ||||
| } | } | ||||
| public WxBillHotNotify getBillOtherDepositHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||||
| WxBillOtherDeposit bod = new WxBillOtherDeposit(); | |||||
| updateQueryParm(wxMerchant, bod,starttime,enttime); | |||||
| WxBillHotNotify notify = wxBillOtherDepositService.getBillHotNotify(bod); | |||||
| if (null == notify) { | |||||
| notify = new WxBillHotNotify(); | |||||
| } | |||||
| notify.setBillTypeName(EnumBillAllType.OTHER_DEPOSIT.getMessage()); | |||||
| return notify; | |||||
| } | |||||
| public String calcuteSum(String... money) { | public String calcuteSum(String... money) { | ||||
| if (null != money) { | if (null != money) { | ||||
| BigDecimal total = new BigDecimal(0); | BigDecimal total = new BigDecimal(0); | ||||
| @@ -412,8 +500,11 @@ public class WxBillAllHelper { | |||||
| return null; | return null; | ||||
| } | } | ||||
| public void exportOneBillOweWord(WxBillBaseEntity bill,HttpServletRequest request, HttpServletResponse response) { | |||||
| public void exportOneBillOweWord(boolean isOwe,WxBillBaseEntity bill,HttpServletRequest request, HttpServletResponse response) { | |||||
| String templatePath = "contract-word-template/bill_owe_one.docx"; | String templatePath = "contract-word-template/bill_owe_one.docx"; | ||||
| if (!isOwe) { | |||||
| templatePath = "contract-word-template/bill_near_one.docx"; | |||||
| } | |||||
| String filepath = fmUploadDir; | String filepath = fmUploadDir; | ||||
| String filename = UUID.randomUUID() + ".docx"; | String filename = UUID.randomUUID() + ".docx"; | ||||
| String exportFileName = "催缴单"; | String exportFileName = "催缴单"; | ||||
| @@ -442,7 +533,53 @@ public class WxBillAllHelper { | |||||
| WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response, null); | WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response, null); | ||||
| } | } | ||||
| // public WxBillHotNotify getHotNotify() { | |||||
| // | |||||
| // } | |||||
| public List<WxBillHotNotify> getHotNotify(WxMerchant wxMerchant) { | |||||
| List<WxBillHotNotify> retList = new ArrayList<WxBillHotNotify>(); | |||||
| WxBillHotNotify rentNotify = this.getBillRentHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime()); | |||||
| if (null != rentNotify) { | |||||
| retList.add(rentNotify); | |||||
| } | |||||
| WxBillHotNotify rentBussinessManageNotify = this.getBillRentManageHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime(),EnumRentContractManageFeeType.RENT_BUSSINESS_MANAGE_FEE); | |||||
| if (null != rentBussinessManageNotify) { | |||||
| retList.add(rentBussinessManageNotify); | |||||
| } | |||||
| WxBillHotNotify rentOperationManageNotify = this.getBillRentManageHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime(),EnumRentContractManageFeeType.RENT_OPERATING_MANAGE_FEE); | |||||
| if (null != rentOperationManageNotify) { | |||||
| retList.add(rentOperationManageNotify); | |||||
| } | |||||
| WxBillHotNotify rentDepositNotify = this.getBillDepositHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime()); | |||||
| if (null != rentDepositNotify) { | |||||
| retList.add(rentDepositNotify); | |||||
| } | |||||
| WxBillHotNotify propertyNotify = this.getBillPropertyHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime()); | |||||
| if (null != propertyNotify) { | |||||
| retList.add(propertyNotify); | |||||
| } | |||||
| WxBillHotNotify propertyDepositNotify = this.getBillPropertyDepositHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime()); | |||||
| if (null != propertyDepositNotify) { | |||||
| retList.add(propertyDepositNotify); | |||||
| } | |||||
| WxBillHotNotify dailyNotify = this.getBillDailyHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime()); | |||||
| if (null != dailyNotify) { | |||||
| retList.add(dailyNotify); | |||||
| } | |||||
| WxBillHotNotify otherNotify = this.getBillOtherHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime()); | |||||
| if (null != otherNotify) { | |||||
| retList.add(otherNotify); | |||||
| } | |||||
| WxBillHotNotify otherDepositNotify = this.getBillOtherDepositHotNotify(wxMerchant, wxMerchant.getStarttime(), wxMerchant.getEndtime()); | |||||
| if (null != otherDepositNotify) { | |||||
| retList.add(otherDepositNotify); | |||||
| } | |||||
| return retList; | |||||
| } | |||||
| } | } | ||||
| @@ -324,9 +324,9 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| String enddate = DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss"); | String enddate = DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss"); | ||||
| record.setStarttime(startdate); | record.setStarttime(startdate); | ||||
| record.setEndtime(enddate); | record.setEndtime(enddate); | ||||
| record.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| record.setStatus(EnumBillStatus.NOT_PAID.getCode()); | |||||
| Map<String, Object> oweInfo = wxBillAllMapper.queryOweInfo(record); | Map<String, Object> oweInfo = wxBillAllMapper.queryOweInfo(record); | ||||
| record.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| record.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Map<String, Object> paidInfo = wxBillAllMapper.queryPaidInfo(record); | Map<String, Object> paidInfo = wxBillAllMapper.queryPaidInfo(record); | ||||
| billMap.putAll(oweInfo); | billMap.putAll(oweInfo); | ||||
| @@ -277,8 +277,8 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay(); | Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay(); | ||||
| e.setRealReceivePay(realReceivePay); | e.setRealReceivePay(realReceivePay); | ||||
| e.setServiceChargePay(servicePay.intValue()); | e.setServiceChargePay(servicePay.intValue()); | ||||
| if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode()) && | |||||
| !e.getStatus().equals(EnumBillRentStatus.WAIT_PAY.getCode())) { | |||||
| if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode()) && | |||||
| !e.getStatus().equals(EnumBillStatus.WAIT_PAY.getCode())) { | |||||
| e.setOwe(0L); | e.setOwe(0L); | ||||
| } else { | } else { | ||||
| e.setOwe(realReceivePay - e.getPay()); | e.setOwe(realReceivePay - e.getPay()); | ||||
| @@ -421,55 +421,55 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| if (billTypeValue == EnumBillTypeParam.RENT.getCode().intValue()) { | if (billTypeValue == EnumBillTypeParam.RENT.getCode().intValue()) { | ||||
| logger.info("更新租金账单"); | logger.info("更新租金账单"); | ||||
| WxBillRent billRent = wxBillRentMapper.selectById((Long) bill.get("id")); | WxBillRent billRent = wxBillRentMapper.selectById((Long) bill.get("id")); | ||||
| if (billRent != null && !billRent.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||||
| if (billRent != null && !billRent.getStatus().equals(EnumBillStatus.PAID.getCode())) { | |||||
| updateBillRent(bill); | updateBillRent(bill); | ||||
| } | } | ||||
| } else if (billTypeValue == EnumBillTypeParam.RENT_DEPOSIT.getCode().intValue()) { | } else if (billTypeValue == EnumBillTypeParam.RENT_DEPOSIT.getCode().intValue()) { | ||||
| logger.info("更新租金押金账单"); | logger.info("更新租金押金账单"); | ||||
| WxBillDeposit billDeposit = wxBillDepositMapper.selectById((Long) bill.get("id")); | WxBillDeposit billDeposit = wxBillDepositMapper.selectById((Long) bill.get("id")); | ||||
| if (billDeposit != null && !billDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||||
| if (billDeposit != null && !billDeposit.getStatus().equals(EnumBillStatus.PAID.getCode())) { | |||||
| updateBillRentDeposit(bill); | updateBillRentDeposit(bill); | ||||
| } | } | ||||
| } else if (billTypeValue == EnumBillTypeParam.PROPERTY.getCode().intValue()) { | } else if (billTypeValue == EnumBillTypeParam.PROPERTY.getCode().intValue()) { | ||||
| logger.info("更新物业账单"); | logger.info("更新物业账单"); | ||||
| WxBillProperty property = wxBillPropertyMapper.selectById((Long) bill.get("id")); | WxBillProperty property = wxBillPropertyMapper.selectById((Long) bill.get("id")); | ||||
| if (property != null && !property.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||||
| if (property != null && !property.getStatus().equals(EnumBillStatus.PAID.getCode())) { | |||||
| updateBillProperty(bill); | updateBillProperty(bill); | ||||
| } | } | ||||
| } else if (billTypeValue == EnumBillTypeParam.PROPERTY_DEPOSIT.getCode().intValue()) { | } else if (billTypeValue == EnumBillTypeParam.PROPERTY_DEPOSIT.getCode().intValue()) { | ||||
| logger.info("更新物业押金账单"); | logger.info("更新物业押金账单"); | ||||
| WxBillPropertyDeposit wxBillPropertyDeposit = wxBillPropertyDepositMapper.selectById((Long) bill.get("id")); | WxBillPropertyDeposit wxBillPropertyDeposit = wxBillPropertyDepositMapper.selectById((Long) bill.get("id")); | ||||
| if (wxBillPropertyDeposit != null && !wxBillPropertyDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||||
| if (wxBillPropertyDeposit != null && !wxBillPropertyDeposit.getStatus().equals(EnumBillStatus.PAID.getCode())) { | |||||
| updateBillPropertyDeposit(bill); | updateBillPropertyDeposit(bill); | ||||
| } | } | ||||
| } else if (billTypeValue == EnumBillTypeParam.WATER.getCode().intValue()) { | } else if (billTypeValue == EnumBillTypeParam.WATER.getCode().intValue()) { | ||||
| logger.info("更新水费账单"); | logger.info("更新水费账单"); | ||||
| WxBillDaily wxBillDaily = wxBillDailyMapper.selectById((Long) bill.get("id")); | WxBillDaily wxBillDaily = wxBillDailyMapper.selectById((Long) bill.get("id")); | ||||
| if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||||
| if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillStatus.PAID.getCode())) { | |||||
| updateBillDaily(bill); | updateBillDaily(bill); | ||||
| } | } | ||||
| } else if (billTypeValue == EnumBillTypeParam.POWER.getCode().intValue()) { | } else if (billTypeValue == EnumBillTypeParam.POWER.getCode().intValue()) { | ||||
| logger.info("更新电费账单"); | logger.info("更新电费账单"); | ||||
| WxBillDaily wxBillDaily = wxBillDailyMapper.selectById((Long) bill.get("id")); | WxBillDaily wxBillDaily = wxBillDailyMapper.selectById((Long) bill.get("id")); | ||||
| if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||||
| if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillStatus.PAID.getCode())) { | |||||
| updateBillDaily(bill); | updateBillDaily(bill); | ||||
| } | } | ||||
| } else if (billTypeValue == EnumBillTypeParam.AIR_CONDITIONING.getCode().intValue()) { | } else if (billTypeValue == EnumBillTypeParam.AIR_CONDITIONING.getCode().intValue()) { | ||||
| logger.info("更新空调费账单"); | logger.info("更新空调费账单"); | ||||
| WxBillDaily wxBillDaily = wxBillDailyMapper.selectById((Long) bill.get("id")); | WxBillDaily wxBillDaily = wxBillDailyMapper.selectById((Long) bill.get("id")); | ||||
| if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||||
| if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillStatus.PAID.getCode())) { | |||||
| updateBillDaily(bill); | updateBillDaily(bill); | ||||
| } | } | ||||
| } else if (billTypeValue == EnumBillTypeParam.ROUTINE.getCode().intValue()) { | } else if (billTypeValue == EnumBillTypeParam.ROUTINE.getCode().intValue()) { | ||||
| logger.info("更新其他账单"); | logger.info("更新其他账单"); | ||||
| WxBillOther wxBillOther = wxBillOtherMapper.selectById((Long) bill.get("id")); | WxBillOther wxBillOther = wxBillOtherMapper.selectById((Long) bill.get("id")); | ||||
| if (wxBillOther != null && !wxBillOther.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||||
| if (wxBillOther != null && !wxBillOther.getStatus().equals(EnumBillStatus.PAID.getCode())) { | |||||
| updateBillOther(bill); | updateBillOther(bill); | ||||
| } | } | ||||
| } else if (billTypeValue == EnumBillTypeParam.ATHER_DEPOSIT.getCode().intValue()) { | } else if (billTypeValue == EnumBillTypeParam.ATHER_DEPOSIT.getCode().intValue()) { | ||||
| logger.info("更新其他押金账单"); | logger.info("更新其他押金账单"); | ||||
| WxBillOtherDeposit wxBillOtherDeposit = wxBillOtherDepositMapper.selectById((Long) bill.get("id")); | WxBillOtherDeposit wxBillOtherDeposit = wxBillOtherDepositMapper.selectById((Long) bill.get("id")); | ||||
| if (wxBillOtherDeposit != null && !wxBillOtherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||||
| if (wxBillOtherDeposit != null && !wxBillOtherDeposit.getStatus().equals(EnumBillStatus.PAID.getCode())) { | |||||
| updateBillOtherDeposit(bill); | updateBillOtherDeposit(bill); | ||||
| } | } | ||||
| } else if (billTypeValue == EnumBillTypeParam.SETTLE.getCode().intValue()) { | } else if (billTypeValue == EnumBillTypeParam.SETTLE.getCode().intValue()) { | ||||
| @@ -532,7 +532,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| wxBillAllVo.setRentEndTime(DateUtils.format(wxBillAllVo.getEndtime())); | wxBillAllVo.setRentEndTime(DateUtils.format(wxBillAllVo.getEndtime())); | ||||
| //status不是欠缴,都展示0,与前端保持一致 | //status不是欠缴,都展示0,与前端保持一致 | ||||
| if (!EnumBillRentStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())) { | |||||
| if (!EnumBillStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())) { | |||||
| wxBillAllVo.setOwe(0L); | wxBillAllVo.setOwe(0L); | ||||
| wxBillAllVo.setOweStr("0"); | wxBillAllVo.setOweStr("0"); | ||||
| } | } | ||||
| @@ -558,8 +558,8 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| wxBillOtherDeposit.setPayDate(date); | wxBillOtherDeposit.setPayDate(date); | ||||
| Long owe = (Long) bill.get("owe"); | Long owe = (Long) bill.get("owe"); | ||||
| wxBillOtherDeposit.setPay(wxBillOtherDeposit.getPay() + owe); | wxBillOtherDeposit.setPay(wxBillOtherDeposit.getPay() + owe); | ||||
| wxBillOtherDeposit.setOwe("0"); | |||||
| wxBillOtherDeposit.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| //wxBillOtherDeposit.setOwe("0"); | |||||
| wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| wxBillOtherDeposit.setPayDate(date); | wxBillOtherDeposit.setPayDate(date); | ||||
| wxBillOtherDeposit.setUpdatetime(date); | wxBillOtherDeposit.setUpdatetime(date); | ||||
| wxBillOtherDeposit.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | wxBillOtherDeposit.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | ||||
| @@ -602,8 +602,8 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| wxBillOther.setPayDate(date); | wxBillOther.setPayDate(date); | ||||
| Long owe = (Long) bill.get("owe"); | Long owe = (Long) bill.get("owe"); | ||||
| wxBillOther.setPay(wxBillOther.getPay() + owe); | wxBillOther.setPay(wxBillOther.getPay() + owe); | ||||
| wxBillOther.setOwe("0"); | |||||
| wxBillOther.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| //wxBillOther.setOwe("0"); | |||||
| wxBillOther.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| wxBillOther.setPayDate(date); | wxBillOther.setPayDate(date); | ||||
| wxBillOther.setUpdatetime(date); | wxBillOther.setUpdatetime(date); | ||||
| wxBillOther.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | wxBillOther.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | ||||
| @@ -646,8 +646,8 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| wxBillDaily.setPayDate(date); | wxBillDaily.setPayDate(date); | ||||
| Long owe = (Long) bill.get("owe"); | Long owe = (Long) bill.get("owe"); | ||||
| wxBillDaily.setPay(wxBillDaily.getPay() + owe); | wxBillDaily.setPay(wxBillDaily.getPay() + owe); | ||||
| wxBillDaily.setOwe("0"); | |||||
| wxBillDaily.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| //wxBillDaily.setOwe("0"); | |||||
| wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| wxBillDaily.setPayDate(date); | wxBillDaily.setPayDate(date); | ||||
| wxBillDaily.setUpdatetime(date); | wxBillDaily.setUpdatetime(date); | ||||
| wxBillDaily.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | wxBillDaily.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | ||||
| @@ -691,8 +691,8 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| wxBillPropertyDeposit.setPayDate(date); | wxBillPropertyDeposit.setPayDate(date); | ||||
| String owe = (String) bill.get("owe"); | String owe = (String) bill.get("owe"); | ||||
| wxBillPropertyDeposit.setPay(new BigDecimal(wxBillPropertyDeposit.getPay()).add(new BigDecimal(owe)).toPlainString()); | wxBillPropertyDeposit.setPay(new BigDecimal(wxBillPropertyDeposit.getPay()).add(new BigDecimal(owe)).toPlainString()); | ||||
| wxBillPropertyDeposit.setOwe("0"); | |||||
| wxBillPropertyDeposit.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| //wxBillPropertyDeposit.setOwe("0"); | |||||
| wxBillPropertyDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| wxBillPropertyDeposit.setPayDate(date); | wxBillPropertyDeposit.setPayDate(date); | ||||
| wxBillPropertyDeposit.setUpdatetime(date); | wxBillPropertyDeposit.setUpdatetime(date); | ||||
| wxBillPropertyDeposit.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | wxBillPropertyDeposit.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | ||||
| @@ -736,8 +736,8 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| property.setPayDate(date); | property.setPayDate(date); | ||||
| String owe = (String) bill.get("owe"); | String owe = (String) bill.get("owe"); | ||||
| property.setPay(new BigDecimal(property.getPay()).add(new BigDecimal(owe)).toPlainString()); | property.setPay(new BigDecimal(property.getPay()).add(new BigDecimal(owe)).toPlainString()); | ||||
| property.setOwe("0"); | |||||
| property.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| //property.setOwe("0"); | |||||
| property.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| property.setPayDate(date); | property.setPayDate(date); | ||||
| property.setUpdatetime(date); | property.setUpdatetime(date); | ||||
| property.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | property.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | ||||
| @@ -781,8 +781,8 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| wxBillDeposit.setPayDate(date); | wxBillDeposit.setPayDate(date); | ||||
| Long owe = (Long) bill.get("owe"); | Long owe = (Long) bill.get("owe"); | ||||
| wxBillDeposit.setPay(wxBillDeposit.getPay() + owe); | wxBillDeposit.setPay(wxBillDeposit.getPay() + owe); | ||||
| wxBillDeposit.setOwe("0"); | |||||
| wxBillDeposit.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| //wxBillDeposit.setOwe("0"); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| wxBillDeposit.setPayDate(date); | wxBillDeposit.setPayDate(date); | ||||
| wxBillDeposit.setUpdatetime(date); | wxBillDeposit.setUpdatetime(date); | ||||
| wxBillDeposit.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | wxBillDeposit.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | ||||
| @@ -826,8 +826,8 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| wxBillRent.setPayDate(date); | wxBillRent.setPayDate(date); | ||||
| Long owe = (Long) bill.get("owe"); | Long owe = (Long) bill.get("owe"); | ||||
| wxBillRent.setPay(wxBillRent.getPay() + owe); | wxBillRent.setPay(wxBillRent.getPay() + owe); | ||||
| wxBillRent.setOwe("0"); | |||||
| wxBillRent.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| //wxBillRent.setOwe("0"); | |||||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| wxBillRent.setPayDate(date); | wxBillRent.setPayDate(date); | ||||
| wxBillRent.setUpdatetime(date); | wxBillRent.setUpdatetime(date); | ||||
| wxBillRent.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | wxBillRent.setPayWay(EnumBillPayWay.WECHAT_PAY.getCode()); | ||||
| @@ -930,9 +930,9 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| Integer status = wxBillAll.getStatus(); | Integer status = wxBillAll.getStatus(); | ||||
| if (status == null) { | if (status == null) { | ||||
| List<Integer> statusList = new ArrayList<>(); | List<Integer> statusList = new ArrayList<>(); | ||||
| statusList.add(EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| statusList.add(EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| statusList.add(EnumBillRentStatus.NOT_EXPIRED.getCode()); | |||||
| statusList.add(EnumBillStatus.NOT_PAID.getCode()); | |||||
| statusList.add(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| statusList.add(EnumBillStatus.NOT_EXPIRED.getCode()); | |||||
| wxBillAll.setStatusList(statusList); | wxBillAll.setStatusList(statusList); | ||||
| //账单时间段 | //账单时间段 | ||||
| result.put("starttime", wxBillAll.getStarttime()); | result.put("starttime", wxBillAll.getStarttime()); | ||||
| @@ -1744,7 +1744,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| WxBillRent rent = new WxBillRent(); | WxBillRent rent = new WxBillRent(); | ||||
| rent.setExpiredDay(0L); | rent.setExpiredDay(0L); | ||||
| if (owe <= pay) { | if (owe <= pay) { | ||||
| rent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| rent.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| int expiredDay = DateUtils.daysBetween(startDate, endDate); | int expiredDay = DateUtils.daysBetween(startDate, endDate); | ||||
| int timePeriod = 0; | int timePeriod = 0; | ||||
| if (expiredDay > timePeriod) { | if (expiredDay > timePeriod) { | ||||
| @@ -1756,7 +1756,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| int day = DateUtils.daysBetween(startDate, now); | int day = DateUtils.daysBetween(startDate, now); | ||||
| int timePeriod = 0; | int timePeriod = 0; | ||||
| if (day > timePeriod) { | if (day > timePeriod) { | ||||
| rent.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| rent.setStatus(EnumBillStatus.NOT_PAID.getCode()); | |||||
| rent.setExpiredDay((long) day); | rent.setExpiredDay((long) day); | ||||
| return rent; | return rent; | ||||
| } | } | ||||
| @@ -1764,12 +1764,12 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| timePeriod = 30; | timePeriod = 30; | ||||
| long expiredDay = Long.valueOf(Math.abs(day)); | long expiredDay = Long.valueOf(Math.abs(day)); | ||||
| if (expiredDay > timePeriod) { | if (expiredDay > timePeriod) { | ||||
| rent.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode()); | |||||
| rent.setStatus(EnumBillStatus.NOT_EXPIRED.getCode()); | |||||
| } else { | } else { | ||||
| rent.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| rent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| } | } | ||||
| } else { | } else { | ||||
| rent.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| rent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| } | } | ||||
| return rent; | return rent; | ||||
| } | } | ||||
| @@ -1856,14 +1856,14 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| wxBillDaily.setId(businessId); | wxBillDaily.setId(businessId); | ||||
| if (forcePaid) { | if (forcePaid) { | ||||
| wxBillDaily.setReceivePay(dbBill.getPay()); | wxBillDaily.setReceivePay(dbBill.getPay()); | ||||
| wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillDaily.setOwe("0"); | |||||
| wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| //wxBillDaily.setOwe("0"); | |||||
| }else { | }else { | ||||
| wxBillDaily.setReceivePay(newPrice); | wxBillDaily.setReceivePay(newPrice); | ||||
| //wxBillDaily.setOwe(new BigDecimal(newPrice).add(new BigDecimal(dbBill.getServiceChargePay())).subtract(new BigDecimal(dbBill.getPay())).toPlainString()); | //wxBillDaily.setOwe(new BigDecimal(newPrice).add(new BigDecimal(dbBill.getServiceChargePay())).subtract(new BigDecimal(dbBill.getPay())).toPlainString()); | ||||
| wxBillDaily.setOwe(new BigDecimal(newPrice).subtract(new BigDecimal(dbBill.getPay())).toPlainString()); | |||||
| //wxBillDaily.setOwe(new BigDecimal(newPrice).subtract(new BigDecimal(dbBill.getPay())).toPlainString()); | |||||
| if (newPrice.equals(dbBill.getPay())) { | if (newPrice.equals(dbBill.getPay())) { | ||||
| wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| } | } | ||||
| } | } | ||||
| wxBillDaily.setUpdatetime(updateDate); | wxBillDaily.setUpdatetime(updateDate); | ||||
| @@ -12,6 +12,7 @@ import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillDailyExportVo; | import com.iformall.domain.vo.WxBillDailyExportVo; | ||||
| import com.iformall.domain.vo.WxBillDailyVo; | import com.iformall.domain.vo.WxBillDailyVo; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -150,11 +151,11 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| BigDecimal realReceivePay = servicePay.add(new BigDecimal(e.getReceivePay())); | BigDecimal realReceivePay = servicePay.add(new BigDecimal(e.getReceivePay())); | ||||
| e.setRealReceivePay(realReceivePay.toPlainString()); | e.setRealReceivePay(realReceivePay.toPlainString()); | ||||
| e.setServiceChargePay(servicePay.toPlainString()); | e.setServiceChargePay(servicePay.toPlainString()); | ||||
| if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) { | |||||
| e.setOwe("0"); | |||||
| if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { | |||||
| //e.setOwe("0"); | |||||
| } else { | } else { | ||||
| //e.setOwe(realReceivePay.subtract(new BigDecimal(e.getPay())).toPlainString()); | //e.setOwe(realReceivePay.subtract(new BigDecimal(e.getPay())).toPlainString()); | ||||
| e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); | |||||
| //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -176,8 +177,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| if (StringUtils.isNotBlank(record.getParentTenantId())) { | if (StringUtils.isNotBlank(record.getParentTenantId())) { | ||||
| params.put("parentTenantId", record.getParentTenantId()); | params.put("parentTenantId", record.getParentTenantId()); | ||||
| } | } | ||||
| params.put("waitPay", EnumBillDailyStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillDailyMapper.updateWaitPayStatus(params); | wxBillDailyMapper.updateWaitPayStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -194,8 +195,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| if (StringUtils.isNotBlank(record.getParentTenantId())) { | if (StringUtils.isNotBlank(record.getParentTenantId())) { | ||||
| params.put("parentTenantId", record.getParentTenantId()); | params.put("parentTenantId", record.getParentTenantId()); | ||||
| } | } | ||||
| params.put("notPaid", EnumBillDailyStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillDailyMapper.updateNotPaidStatus(params); | wxBillDailyMapper.updateNotPaidStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -212,7 +213,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| record.updateTenantInfo(tenantEntity); | record.updateTenantInfo(tenantEntity); | ||||
| WxBillDaily wxBillDaily = getBillRentPropertyList(1, 1, record, wxPayAccountBill).getList().get(0); | WxBillDaily wxBillDaily = getBillRentPropertyList(1, 1, record, wxPayAccountBill).getList().get(0); | ||||
| //wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getRealReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString()); | //wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getRealReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString()); | ||||
| wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString()); | |||||
| //wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString()); | |||||
| wxBillDaily.setMerchant(wxMerchantMapper.selectById(wxBillDaily.getMerchantId())); | wxBillDaily.setMerchant(wxMerchantMapper.selectById(wxBillDaily.getMerchantId())); | ||||
| // if (wxBillDaily.getShopId() != null) { | // if (wxBillDaily.getShopId() != null) { | ||||
| // WxShop shop = new WxShop(); | // WxShop shop = new WxShop(); | ||||
| @@ -248,12 +249,12 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| } | } | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setStatus(record.getReceiveDate().after(date)?EnumBillDailyStatus.WAIT_PAY.getCode():EnumBillDailyStatus.NOT_PAID.getCode()); | |||||
| record.setStatus(record.getReceiveDate().after(date)?EnumBillStatus.WAIT_PAY.getCode():EnumBillStatus.NOT_PAID.getCode()); | |||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setExpiredDay(0L); | record.setExpiredDay(0L); | ||||
| //record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | //record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | ||||
| record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillDailyMapper.insert(record); | wxBillDailyMapper.insert(record); | ||||
| @@ -275,16 +276,16 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| wxBillDaily.setServiceChargePay(record.getServiceChargePayUpdate()); | wxBillDaily.setServiceChargePay(record.getServiceChargePayUpdate()); | ||||
| //wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).add(new BigDecimal(wxBillDaily.getServiceChargePay())) | //wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).add(new BigDecimal(wxBillDaily.getServiceChargePay())) | ||||
| // .subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString()); | // .subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString()); | ||||
| wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString()); | |||||
| //wxBillDaily.setOwe(new BigDecimal(wxBillDaily.getReceivePay()).subtract(new BigDecimal(wxBillDaily.getPay())).toPlainString()); | |||||
| }else{ | }else{ | ||||
| String addpay = wxBillDaily.getPay(); | String addpay = wxBillDaily.getPay(); | ||||
| wxBillDaily.setPayDate(record.getPayDate()); | wxBillDaily.setPayDate(record.getPayDate()); | ||||
| wxBillDaily.setPay(record.getPay()); | wxBillDaily.setPay(record.getPay()); | ||||
| wxBillDaily.setReceivePay(record.getReceivePay()); | wxBillDaily.setReceivePay(record.getReceivePay()); | ||||
| //wxBillDaily.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | //wxBillDaily.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | ||||
| wxBillDaily.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //wxBillDaily.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | if (record.getPay().equals(record.getRealReceivePay())) { | ||||
| wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = wxBillDaily.getReceiveDate(); | Date receiveDate = wxBillDaily.getReceiveDate(); | ||||
| wxBillDaily.setExpiredDay(0L); | wxBillDaily.setExpiredDay(0L); | ||||
| @@ -343,7 +344,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| if(wxBillDaily==null){ | if(wxBillDaily==null){ | ||||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillDaily.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date d =new Date(); | Date d =new Date(); | ||||
| wxBillDaily.setPayDate(d); | wxBillDaily.setPayDate(d); | ||||
| wxBillDaily.setUpdatetime(d); | wxBillDaily.setUpdatetime(d); | ||||
| @@ -393,7 +394,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| wxBillDaily.setReceivePay(receivePay); | wxBillDaily.setReceivePay(receivePay); | ||||
| String pay = billDaily.getPay(); | String pay = billDaily.getPay(); | ||||
| wxBillDaily.setPay(pay); | wxBillDaily.setPay(pay); | ||||
| wxBillDaily.setOwe(new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| //wxBillDaily.setOwe(new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| wxBillDaily.setType(type); | wxBillDaily.setType(type); | ||||
| Date receiveDate = billDaily.getReceiveDate(); | Date receiveDate = billDaily.getReceiveDate(); | ||||
| wxBillDaily.setReceiveDate(receiveDate); | wxBillDaily.setReceiveDate(receiveDate); | ||||
| @@ -404,13 +405,13 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| int expiredDay = DateUtils.daysBetween(receiveDate, date); | int expiredDay = DateUtils.daysBetween(receiveDate, date); | ||||
| wxBillDaily.setExpiredDay(0L); | wxBillDaily.setExpiredDay(0L); | ||||
| if (expiredDay > 0) { | if (expiredDay > 0) { | ||||
| wxBillDaily.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| wxBillDaily.setStatus(EnumBillStatus.NOT_PAID.getCode()); | |||||
| wxBillDaily.setExpiredDay((long) expiredDay); | wxBillDaily.setExpiredDay((long) expiredDay); | ||||
| } else { | } else { | ||||
| wxBillDaily.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| wxBillDaily.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| } | } | ||||
| if (receivePay.equals(pay)) { | if (receivePay.equals(pay)) { | ||||
| wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillDaily.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| } | } | ||||
| wxBillDaily.setUserId(user.getId()); | wxBillDaily.setUserId(user.getId()); | ||||
| @@ -451,7 +452,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| wxBillDailyExportVo.setMerchantName(b.getMerchantName()); | wxBillDailyExportVo.setMerchantName(b.getMerchantName()); | ||||
| wxBillDailyExportVo.setReceivePay(b.getRealReceivePay()); | wxBillDailyExportVo.setReceivePay(b.getRealReceivePay()); | ||||
| wxBillDailyExportVo.setPay(b.getPay()); | wxBillDailyExportVo.setPay(b.getPay()); | ||||
| wxBillDailyExportVo.setOwe(b.getOwe()); | |||||
| //wxBillDailyExportVo.setOwe(b.getOwe()); | |||||
| wxBillDailyExportVo.setReceiveDate(b.getReceiveDate()); | wxBillDailyExportVo.setReceiveDate(b.getReceiveDate()); | ||||
| wxBillDailyExportVo.setPayDate(b.getPayDate()); | wxBillDailyExportVo.setPayDate(b.getPayDate()); | ||||
| wxBillDailyExportVo.setExpiredDay(b.getExpiredDay()); | wxBillDailyExportVo.setExpiredDay(b.getExpiredDay()); | ||||
| @@ -475,5 +476,11 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| updateQueryParam(record); | updateQueryParam(record); | ||||
| return wxBillDailyMapper.getMerchantIdList(record); | return wxBillDailyMapper.getMerchantIdList(record); | ||||
| } | } | ||||
| @Override | |||||
| public WxBillHotNotify getBillHotNotify(WxBillDaily record) { | |||||
| updateQueryParam(record); | |||||
| return wxBillDailyMapper.getBillHotNotify(record); | |||||
| } | |||||
| } | } | ||||
| @@ -15,10 +15,11 @@ import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.enums.EnumBillAction; | import com.iformall.enums.EnumBillAction; | ||||
| import com.iformall.enums.EnumBillPayWay; | import com.iformall.enums.EnumBillPayWay; | ||||
| import com.iformall.enums.EnumBillRentStatus; | |||||
| import com.iformall.enums.EnumBillStatus; | |||||
| import com.iformall.enums.EnumDelStatus; | import com.iformall.enums.EnumDelStatus; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBillDepositMapper; | import com.iformall.mapper.WxBillDepositMapper; | ||||
| @@ -176,8 +177,8 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| public void updateWaidPayStatus(WxBillDeposit record) { | public void updateWaidPayStatus(WxBillDeposit record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillDepositMapper.updateWaitPayStatus(params); | wxBillDepositMapper.updateWaitPayStatus(params); | ||||
| @@ -192,8 +193,8 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| public void updateNotPaidStatus(WxBillDeposit record) { | public void updateNotPaidStatus(WxBillDeposit record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillDepositMapper.updateNotPaidStatus(params); | wxBillDepositMapper.updateNotPaidStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -223,7 +224,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| //record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillDepositMapper.insert(record); | wxBillDepositMapper.insert(record); | ||||
| @@ -241,9 +242,9 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| String addpay = wxBillDeposit.getPay(); | String addpay = wxBillDeposit.getPay(); | ||||
| wxBillDeposit.setPay(record.getPay()); | wxBillDeposit.setPay(record.getPay()); | ||||
| wxBillDeposit.setReceivePay(record.getReceivePay()); | wxBillDeposit.setReceivePay(record.getReceivePay()); | ||||
| wxBillDeposit.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| //wxBillDeposit.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| if (record.getPay().equals(record.getReceivePay())) { | if (record.getPay().equals(record.getReceivePay())) { | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date receiveDate = wxBillDeposit.getReceiveDate(); | Date receiveDate = wxBillDeposit.getReceiveDate(); | ||||
| wxBillDeposit.setExpiredDay(0L); | wxBillDeposit.setExpiredDay(0L); | ||||
| if (date.after(receiveDate)) { | if (date.after(receiveDate)) { | ||||
| @@ -294,7 +295,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| if(wxBillDeposit==null){ | if(wxBillDeposit==null){ | ||||
| return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date d =new Date(); | Date d =new Date(); | ||||
| wxBillDeposit.setPayDate(d); | wxBillDeposit.setPayDate(d); | ||||
| wxBillDeposit.setUpdatetime(d); | wxBillDeposit.setUpdatetime(d); | ||||
| @@ -317,7 +318,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| } | } | ||||
| wxBillDeposit.setPayWay(record.getPayWay()); | wxBillDeposit.setPayWay(record.getPayWay()); | ||||
| wxBillDeposit.setReturnPrice(record.getReturnPrice()); | wxBillDeposit.setReturnPrice(record.getReturnPrice()); | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| wxBillDeposit.setUpdatetime(new Date()); | wxBillDeposit.setUpdatetime(new Date()); | ||||
| try { | try { | ||||
| wxBillDepositMapper.updateById(wxBillDeposit); | wxBillDepositMapper.updateById(wxBillDeposit); | ||||
| @@ -353,7 +354,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillDeposit.setReceivePay(record.getReceivePay()); | wxBillDeposit.setReceivePay(record.getReceivePay()); | ||||
| wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| wxBillDeposit.setUpdatetime(new Date()); | wxBillDeposit.setUpdatetime(new Date()); | ||||
| try { | try { | ||||
| wxBillDepositMapper.updateById(wxBillDeposit); | wxBillDepositMapper.updateById(wxBillDeposit); | ||||
| @@ -375,6 +376,12 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| setQueryParam(wxBillDeposit); | setQueryParam(wxBillDeposit); | ||||
| return wxBillDepositMapper.getMerchantIdList(wxBillDeposit); | return wxBillDepositMapper.getMerchantIdList(wxBillDeposit); | ||||
| } | } | ||||
| @Override | |||||
| public WxBillHotNotify getBillHotNotify(WxBillDeposit wxBillDeposit) { | |||||
| setQueryParam(wxBillDeposit); | |||||
| return wxBillDepositMapper.getBillHotNotify(wxBillDeposit); | |||||
| } | |||||
| } | } | ||||
| @@ -15,6 +15,7 @@ import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -153,11 +154,11 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| } | } | ||||
| e.setRealReceivePay(servicePay.add(new BigDecimal(e.getReceivePay())).toPlainString()); | e.setRealReceivePay(servicePay.add(new BigDecimal(e.getReceivePay())).toPlainString()); | ||||
| e.setServiceChargePay(servicePay.toPlainString()); | e.setServiceChargePay(servicePay.toPlainString()); | ||||
| if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) { | |||||
| e.setOwe("0"); | |||||
| if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { | |||||
| //e.setOwe("0"); | |||||
| } else { | } else { | ||||
| //e.setOwe(servicePay.add(new BigDecimal(e.getReceivePay())).subtract(new BigDecimal(e.getPay())).toPlainString()); | //e.setOwe(servicePay.add(new BigDecimal(e.getReceivePay())).subtract(new BigDecimal(e.getPay())).toPlainString()); | ||||
| e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); | |||||
| //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -176,8 +177,8 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| public void updateWaidPayStatus(WxBillOtherDeposit record) { | public void updateWaidPayStatus(WxBillOtherDeposit record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("waitPay", EnumBillDailyStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillOtherDepositMapper.updateWaitPayStatus(params); | wxBillOtherDepositMapper.updateWaitPayStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -191,8 +192,8 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| public void updateNotPaidStatus(WxBillOtherDeposit record) { | public void updateNotPaidStatus(WxBillOtherDeposit record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("notPaid", EnumBillDailyStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillOtherDepositMapper.updateNotPaidStatus(params); | wxBillOtherDepositMapper.updateNotPaidStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -209,7 +210,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| record.updateTenantInfo(tenantEntity); | record.updateTenantInfo(tenantEntity); | ||||
| WxBillOtherDeposit wxBillOther = getBillRentPropertyList(1, 10000, record, wxPayAccountBill).getList().get(0); | WxBillOtherDeposit wxBillOther = getBillRentPropertyList(1, 10000, record, wxPayAccountBill).getList().get(0); | ||||
| //wxBillOther.setOwe(new BigDecimal(wxBillOther.getRealReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | //wxBillOther.setOwe(new BigDecimal(wxBillOther.getRealReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | ||||
| wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | |||||
| //wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | |||||
| wxBillOther.setMerchant(wxMerchantMapper.selectById(wxBillOther.getMerchantId())); | wxBillOther.setMerchant(wxMerchantMapper.selectById(wxBillOther.getMerchantId())); | ||||
| // if (wxBillOther.getShopId() != null) { | // if (wxBillOther.getShopId() != null) { | ||||
| // WxShop shop = new WxShop(); | // WxShop shop = new WxShop(); | ||||
| @@ -252,12 +253,12 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setStatus(EnumBillDailyStatus.WAIT_PAY.getCode()); | |||||
| record.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setExpiredDay(0L); | record.setExpiredDay(0L); | ||||
| //record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | //record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | ||||
| record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillOtherDepositMapper.insert(record); | wxBillOtherDepositMapper.insert(record); | ||||
| @@ -277,16 +278,16 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| if(record.getServiceChargePayUpdate() != null){ | if(record.getServiceChargePayUpdate() != null){ | ||||
| wxBillOtherDeposit.setServiceChargePay(record.getServiceChargePayUpdate()); | wxBillOtherDeposit.setServiceChargePay(record.getServiceChargePayUpdate()); | ||||
| //wxBillOtherDeposit.setOwe(new BigDecimal(wxBillOtherDeposit.getReceivePay()).add(new BigDecimal(wxBillOtherDeposit.getServiceChargePay())).subtract(new BigDecimal(wxBillOtherDeposit.getPay())).toPlainString()); | //wxBillOtherDeposit.setOwe(new BigDecimal(wxBillOtherDeposit.getReceivePay()).add(new BigDecimal(wxBillOtherDeposit.getServiceChargePay())).subtract(new BigDecimal(wxBillOtherDeposit.getPay())).toPlainString()); | ||||
| wxBillOtherDeposit.setOwe(new BigDecimal(wxBillOtherDeposit.getReceivePay()).subtract(new BigDecimal(wxBillOtherDeposit.getPay())).toPlainString()); | |||||
| //wxBillOtherDeposit.setOwe(new BigDecimal(wxBillOtherDeposit.getReceivePay()).subtract(new BigDecimal(wxBillOtherDeposit.getPay())).toPlainString()); | |||||
| }else{ | }else{ | ||||
| String addpay = wxBillOtherDeposit.getPay(); | String addpay = wxBillOtherDeposit.getPay(); | ||||
| wxBillOtherDeposit.setPayDate(record.getPayDate()); | wxBillOtherDeposit.setPayDate(record.getPayDate()); | ||||
| wxBillOtherDeposit.setPay(record.getPay()); | wxBillOtherDeposit.setPay(record.getPay()); | ||||
| wxBillOtherDeposit.setReceivePay(record.getReceivePay()); | wxBillOtherDeposit.setReceivePay(record.getReceivePay()); | ||||
| //wxBillOtherDeposit.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | //wxBillOtherDeposit.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | ||||
| wxBillOtherDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //wxBillOtherDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | if (record.getPay().equals(record.getRealReceivePay())) { | ||||
| wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = wxBillOtherDeposit.getReceiveDate(); | Date receiveDate = wxBillOtherDeposit.getReceiveDate(); | ||||
| wxBillOtherDeposit.setExpiredDay(0L); | wxBillOtherDeposit.setExpiredDay(0L); | ||||
| @@ -347,7 +348,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| if (wxBillOtherDeposit == null) { | if (wxBillOtherDeposit == null) { | ||||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillOtherDeposit.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date d = new Date(); | Date d = new Date(); | ||||
| wxBillOtherDeposit.setPayDate(d); | wxBillOtherDeposit.setPayDate(d); | ||||
| wxBillOtherDeposit.setUpdatetime(d); | wxBillOtherDeposit.setUpdatetime(d); | ||||
| @@ -368,7 +369,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillDeposit.setReturnPrice(record.getReturnPrice()); | wxBillDeposit.setReturnPrice(record.getReturnPrice()); | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| wxBillDeposit.setUpdatetime(new Date()); | wxBillDeposit.setUpdatetime(new Date()); | ||||
| try { | try { | ||||
| wxBillOtherDepositMapper.updateById(wxBillDeposit); | wxBillOtherDepositMapper.updateById(wxBillDeposit); | ||||
| @@ -406,7 +407,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillDeposit.setReceivePay(record.getReceivePay()); | wxBillDeposit.setReceivePay(record.getReceivePay()); | ||||
| wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| wxBillDeposit.setUpdatetime(new Date()); | wxBillDeposit.setUpdatetime(new Date()); | ||||
| try { | try { | ||||
| wxBillOtherDepositMapper.updateById(wxBillDeposit); | wxBillOtherDepositMapper.updateById(wxBillDeposit); | ||||
| @@ -441,5 +442,11 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| updateQueryParam(wxBillDeposit); | updateQueryParam(wxBillDeposit); | ||||
| return wxBillOtherDepositMapper.getMerchantIdList(wxBillDeposit); | return wxBillOtherDepositMapper.getMerchantIdList(wxBillDeposit); | ||||
| } | } | ||||
| @Override | |||||
| public WxBillHotNotify getBillHotNotify(WxBillOtherDeposit wxBillDeposit) { | |||||
| updateQueryParam(wxBillDeposit); | |||||
| return wxBillOtherDepositMapper.getBillHotNotify(wxBillDeposit); | |||||
| } | |||||
| } | } | ||||
| @@ -15,6 +15,7 @@ import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -153,11 +154,11 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| } | } | ||||
| e.setRealReceivePay(servicePay.add(new BigDecimal(e.getReceivePay())).toPlainString()); | e.setRealReceivePay(servicePay.add(new BigDecimal(e.getReceivePay())).toPlainString()); | ||||
| e.setServiceChargePay(servicePay.toPlainString()); | e.setServiceChargePay(servicePay.toPlainString()); | ||||
| if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) { | |||||
| e.setOwe("0"); | |||||
| if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { | |||||
| //e.setOwe("0"); | |||||
| } else { | } else { | ||||
| //e.setOwe(servicePay.add(new BigDecimal(e.getReceivePay())).subtract(new BigDecimal(e.getPay())).toPlainString()); | //e.setOwe(servicePay.add(new BigDecimal(e.getReceivePay())).subtract(new BigDecimal(e.getPay())).toPlainString()); | ||||
| e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); | |||||
| //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -176,8 +177,8 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| public void updateWaidPayStatus(WxBillOther record) { | public void updateWaidPayStatus(WxBillOther record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("waitPay", EnumBillDailyStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillOtherMapper.updateWaitPayStatus(params); | wxBillOtherMapper.updateWaitPayStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -191,8 +192,8 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| public void updateNotPaidStatus(WxBillOther record) { | public void updateNotPaidStatus(WxBillOther record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("notPaid", EnumBillDailyStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillOtherMapper.updateNotPaidStatus(params); | wxBillOtherMapper.updateNotPaidStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -209,7 +210,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| record.updateTenantInfo(tenantEntity); | record.updateTenantInfo(tenantEntity); | ||||
| WxBillOther wxBillOther = getBillOtherPropertyList(1, 1, record, wxPayAccountBill).getList().get(0); | WxBillOther wxBillOther = getBillOtherPropertyList(1, 1, record, wxPayAccountBill).getList().get(0); | ||||
| //wxBillOther.setOwe(new BigDecimal(wxBillOther.getRealReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | //wxBillOther.setOwe(new BigDecimal(wxBillOther.getRealReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | ||||
| wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | |||||
| //wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | |||||
| wxBillOther.setMerchant(wxMerchantMapper.selectById(wxBillOther.getMerchantId())); | wxBillOther.setMerchant(wxMerchantMapper.selectById(wxBillOther.getMerchantId())); | ||||
| // if (wxBillOther.getShopId() != null) { | // if (wxBillOther.getShopId() != null) { | ||||
| // WxShop shop = new WxShop(); | // WxShop shop = new WxShop(); | ||||
| @@ -251,12 +252,12 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| } | } | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setStatus(record.getReceiveDate().after(date)?EnumBillDailyStatus.WAIT_PAY.getCode():EnumBillDailyStatus.NOT_PAID.getCode()); | |||||
| record.setStatus(record.getReceiveDate().after(date)?EnumBillStatus.WAIT_PAY.getCode():EnumBillStatus.NOT_PAID.getCode()); | |||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setExpiredDay(0L); | record.setExpiredDay(0L); | ||||
| //record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | //record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | ||||
| record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillOtherMapper.insert(record); | wxBillOtherMapper.insert(record); | ||||
| @@ -277,16 +278,16 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| if(record.getServiceChargePayUpdate() != null){ | if(record.getServiceChargePayUpdate() != null){ | ||||
| wxBillOther.setServiceChargePay(record.getServiceChargePayUpdate()); | wxBillOther.setServiceChargePay(record.getServiceChargePayUpdate()); | ||||
| //wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).add(new BigDecimal(wxBillOther.getServiceChargePay())).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | //wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).add(new BigDecimal(wxBillOther.getServiceChargePay())).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | ||||
| wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | |||||
| //wxBillOther.setOwe(new BigDecimal(wxBillOther.getReceivePay()).subtract(new BigDecimal(wxBillOther.getPay())).toPlainString()); | |||||
| }else{ | }else{ | ||||
| String addpay = wxBillOther.getPay(); | String addpay = wxBillOther.getPay(); | ||||
| wxBillOther.setPayDate(record.getPayDate()); | wxBillOther.setPayDate(record.getPayDate()); | ||||
| wxBillOther.setPay(record.getPay()); | wxBillOther.setPay(record.getPay()); | ||||
| wxBillOther.setReceivePay(record.getReceivePay()); | wxBillOther.setReceivePay(record.getReceivePay()); | ||||
| //wxBillOther.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | //wxBillOther.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | ||||
| wxBillOther.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //wxBillOther.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | if (record.getPay().equals(record.getRealReceivePay())) { | ||||
| wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillOther.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = wxBillOther.getReceiveDate(); | Date receiveDate = wxBillOther.getReceiveDate(); | ||||
| wxBillOther.setExpiredDay(0L); | wxBillOther.setExpiredDay(0L); | ||||
| @@ -348,7 +349,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| if(wxBillOther==null){ | if(wxBillOther==null){ | ||||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillOther.setStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| wxBillOther.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date d =new Date(); | Date d =new Date(); | ||||
| wxBillOther.setPayDate(d); | wxBillOther.setPayDate(d); | ||||
| wxBillOther.setUpdatetime(d); | wxBillOther.setUpdatetime(d); | ||||
| @@ -385,4 +386,10 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| updateQueryParam(wxBillOther); | updateQueryParam(wxBillOther); | ||||
| return wxBillOtherMapper.getMerchantIdList(wxBillOther); | return wxBillOtherMapper.getMerchantIdList(wxBillOther); | ||||
| } | } | ||||
| @Override | |||||
| public WxBillHotNotify getBillHotNotify(WxBillOther wxBillOther) { | |||||
| updateQueryParam(wxBillOther); | |||||
| return wxBillOtherMapper.getBillHotNotify(wxBillOther); | |||||
| } | |||||
| } | } | ||||
| @@ -15,10 +15,11 @@ import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.enums.EnumBillAction; | import com.iformall.enums.EnumBillAction; | ||||
| import com.iformall.enums.EnumBillPayWay; | import com.iformall.enums.EnumBillPayWay; | ||||
| import com.iformall.enums.EnumBillRentStatus; | |||||
| import com.iformall.enums.EnumBillStatus; | |||||
| import com.iformall.enums.EnumDelStatus; | import com.iformall.enums.EnumDelStatus; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBillPropertyDepositMapper; | import com.iformall.mapper.WxBillPropertyDepositMapper; | ||||
| @@ -174,8 +175,8 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| public void updateWaidPayStatus(WxBillPropertyDeposit record) { | public void updateWaidPayStatus(WxBillPropertyDeposit record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillPropertyDepositMapper.updateWaitPayStatus(params); | wxBillPropertyDepositMapper.updateWaitPayStatus(params); | ||||
| @@ -190,8 +191,8 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| public void updateNotPaidStatus(WxBillPropertyDeposit record) { | public void updateNotPaidStatus(WxBillPropertyDeposit record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillPropertyDepositMapper.updateNotPaidStatus(params); | wxBillPropertyDepositMapper.updateNotPaidStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -221,7 +222,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| //record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillPropertyDepositMapper.insert(record); | wxBillPropertyDepositMapper.insert(record); | ||||
| @@ -239,9 +240,9 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| String addpay = wxBillDeposit.getPay(); | String addpay = wxBillDeposit.getPay(); | ||||
| wxBillDeposit.setPay(record.getPay()); | wxBillDeposit.setPay(record.getPay()); | ||||
| wxBillDeposit.setReceivePay(record.getReceivePay()); | wxBillDeposit.setReceivePay(record.getReceivePay()); | ||||
| wxBillDeposit.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| //wxBillDeposit.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| if (record.getPay().equals(record.getReceivePay())) { | if (record.getPay().equals(record.getReceivePay())) { | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date receiveDate = wxBillDeposit.getReceiveDate(); | Date receiveDate = wxBillDeposit.getReceiveDate(); | ||||
| wxBillDeposit.setExpiredDay(0L); | wxBillDeposit.setExpiredDay(0L); | ||||
| if (date.after(receiveDate)) { | if (date.after(receiveDate)) { | ||||
| @@ -292,7 +293,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| if(wxBillDeposit==null){ | if(wxBillDeposit==null){ | ||||
| return new ResultData(ErrorCode.BILL_PROPERTY_DEPOSIT_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_PROPERTY_DEPOSIT_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date d =new Date(); | Date d =new Date(); | ||||
| wxBillDeposit.setPayDate(d); | wxBillDeposit.setPayDate(d); | ||||
| wxBillDeposit.setUpdatetime(d); | wxBillDeposit.setUpdatetime(d); | ||||
| @@ -314,7 +315,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| } | } | ||||
| wxBillDeposit.setPayWay(record.getPayWay()); | wxBillDeposit.setPayWay(record.getPayWay()); | ||||
| wxBillDeposit.setReturnPrice(record.getReturnPrice()); | wxBillDeposit.setReturnPrice(record.getReturnPrice()); | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| wxBillDeposit.setUpdatetime(new Date()); | wxBillDeposit.setUpdatetime(new Date()); | ||||
| try { | try { | ||||
| wxBillPropertyDepositMapper.updateById(wxBillDeposit); | wxBillPropertyDepositMapper.updateById(wxBillDeposit); | ||||
| @@ -351,7 +352,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_OTHER_DEPOSIT_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillDeposit.setReceivePay(record.getReceivePay()); | wxBillDeposit.setReceivePay(record.getReceivePay()); | ||||
| wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //wxBillDeposit.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| wxBillDeposit.setUpdatetime(new Date()); | wxBillDeposit.setUpdatetime(new Date()); | ||||
| try { | try { | ||||
| wxBillPropertyDepositMapper.updateById(wxBillDeposit); | wxBillPropertyDepositMapper.updateById(wxBillDeposit); | ||||
| @@ -374,5 +375,9 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| return wxBillPropertyDepositMapper.getMerchantIdList(deposit); | return wxBillPropertyDepositMapper.getMerchantIdList(deposit); | ||||
| } | } | ||||
| @Override | |||||
| public WxBillHotNotify getBillHotNotify(WxBillPropertyDeposit deposit) { | |||||
| updateQueryParam(deposit); | |||||
| return wxBillPropertyDepositMapper.getBillHotNotify(deposit); | |||||
| } | |||||
| } | } | ||||
| @@ -10,6 +10,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -221,11 +222,11 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| BigDecimal realReceivePay = servicePay.add(new BigDecimal(e.getLatePayPrice())).add(new BigDecimal(e.getReceivePay())); | BigDecimal realReceivePay = servicePay.add(new BigDecimal(e.getLatePayPrice())).add(new BigDecimal(e.getReceivePay())); | ||||
| e.setRealReceivePay(realReceivePay.toPlainString()); | e.setRealReceivePay(realReceivePay.toPlainString()); | ||||
| e.setServiceChargePay(servicePay.toPlainString()); | e.setServiceChargePay(servicePay.toPlainString()); | ||||
| if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) { | |||||
| e.setOwe("0"); | |||||
| if (!e.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { | |||||
| //e.setOwe("0"); | |||||
| } else { | } else { | ||||
| //e.setOwe(realReceivePay.subtract(new BigDecimal(e.getPay())).toPlainString()); | //e.setOwe(realReceivePay.subtract(new BigDecimal(e.getPay())).toPlainString()); | ||||
| e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); | |||||
| //e.setOwe(new BigDecimal(e.getReceivePay()).subtract(new BigDecimal(e.getPay())).toPlainString()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -244,8 +245,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| public void updateWaidPayStatus(WxBillProperty record) { | public void updateWaidPayStatus(WxBillProperty record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillPropertyMapper.updateWaitPayStatus(params); | wxBillPropertyMapper.updateWaitPayStatus(params); | ||||
| @@ -260,8 +261,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| public void updateNotPaidStatus(WxBillProperty record) { | public void updateNotPaidStatus(WxBillProperty record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillPropertyMapper.updateNotPaidStatus(params); | wxBillPropertyMapper.updateNotPaidStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -280,7 +281,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| PageInfo<WxBillProperty> page = getBillPropertyList(1, 10000, wxPayAccountBill, record); | PageInfo<WxBillProperty> page = getBillPropertyList(1, 10000, wxPayAccountBill, record); | ||||
| WxBillProperty property = page.getList().get(0); | WxBillProperty property = page.getList().get(0); | ||||
| //property.setOwe(new BigDecimal(property.getRealReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString()); | //property.setOwe(new BigDecimal(property.getRealReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString()); | ||||
| property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString()); | |||||
| //property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString()); | |||||
| return property; | return property; | ||||
| } | } | ||||
| @@ -300,7 +301,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| //record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | //record.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | ||||
| record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //record.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillPropertyMapper.insert(record); | wxBillPropertyMapper.insert(record); | ||||
| @@ -323,7 +324,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| String latePayPrice = StringUtils.isBlank(property.getLatePayPrice()) ? "0" : property.getLatePayPrice(); | String latePayPrice = StringUtils.isBlank(property.getLatePayPrice()) ? "0" : property.getLatePayPrice(); | ||||
| //property.setOwe(new BigDecimal(property.getReceivePay()).add(new BigDecimal(latePayPrice)) | //property.setOwe(new BigDecimal(property.getReceivePay()).add(new BigDecimal(latePayPrice)) | ||||
| // .add(new BigDecimal(property.getServiceChargePay())).subtract(new BigDecimal(property.getPay())).toPlainString()); | // .add(new BigDecimal(property.getServiceChargePay())).subtract(new BigDecimal(property.getPay())).toPlainString()); | ||||
| property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString()); | |||||
| //property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString()); | |||||
| } else { | } else { | ||||
| String addpay = property.getPay(); | String addpay = property.getPay(); | ||||
| property.setRevenue(record.getRevenue()); | property.setRevenue(record.getRevenue()); | ||||
| @@ -334,9 +335,9 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| property.setPay(record.getPay()); | property.setPay(record.getPay()); | ||||
| property.setReceivePay(record.getReceivePay()); | property.setReceivePay(record.getReceivePay()); | ||||
| //property.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | //property.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | ||||
| property.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //property.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | if (record.getPay().equals(record.getRealReceivePay())) { | ||||
| property.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| property.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = property.getReceiveDate(); | Date receiveDate = property.getReceiveDate(); | ||||
| property.setExpiredDay(0L); | property.setExpiredDay(0L); | ||||
| @@ -410,7 +411,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| if (record == null) { | if (record == null) { | ||||
| return new ResultData(ErrorCode.BILL_PROPERTY_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_PROPERTY_IS_NOT_FOUND); | ||||
| } | } | ||||
| record.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| record.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date d = new Date(); | Date d = new Date(); | ||||
| record.setPayDate(d); | record.setPayDate(d); | ||||
| record.setUpdatetime(d); | record.setUpdatetime(d); | ||||
| @@ -446,7 +447,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| @Override | @Override | ||||
| public ResultData updateLatePayStatus(WxBillProperty record) { | public ResultData updateLatePayStatus(WxBillProperty record) { | ||||
| record.setLatePayStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| record.setLatePayStatus(EnumBillStatus.PAID.getCode()); | |||||
| record.setUpdatetime(new Date()); | record.setUpdatetime(new Date()); | ||||
| try { | try { | ||||
| wxBillPropertyMapper.updateById(record); | wxBillPropertyMapper.updateById(record); | ||||
| @@ -502,7 +503,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| property.setLatePayPrice(record.getLatePayMoneyUpdate()); | property.setLatePayPrice(record.getLatePayMoneyUpdate()); | ||||
| //property.setOwe(new BigDecimal(property.getReceivePay()).add(new BigDecimal(property.getLatePayPrice())) | //property.setOwe(new BigDecimal(property.getReceivePay()).add(new BigDecimal(property.getLatePayPrice())) | ||||
| // .add(new BigDecimal(property.getServiceChargePay())).subtract(new BigDecimal(property.getPay())).toPlainString()); | // .add(new BigDecimal(property.getServiceChargePay())).subtract(new BigDecimal(property.getPay())).toPlainString()); | ||||
| property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString()); | |||||
| //property.setOwe(new BigDecimal(property.getReceivePay()).subtract(new BigDecimal(property.getPay())).toPlainString()); | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| WxBillAction billAction = new WxBillAction(); | WxBillAction billAction = new WxBillAction(); | ||||
| billAction.setId(idWorker.nextId()); | billAction.setId(idWorker.nextId()); | ||||
| @@ -529,4 +530,10 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| updateQueryParam(wxBillProperty); | updateQueryParam(wxBillProperty); | ||||
| return wxBillPropertyMapper.getMerchantIdList(wxBillProperty); | return wxBillPropertyMapper.getMerchantIdList(wxBillProperty); | ||||
| } | } | ||||
| @Override | |||||
| public WxBillHotNotify getBillHotNotify(WxBillProperty wxBillProperty) { | |||||
| updateQueryParam(wxBillProperty); | |||||
| return wxBillPropertyMapper.getBillHotNotify(wxBillProperty); | |||||
| } | |||||
| } | } | ||||
| @@ -16,6 +16,7 @@ import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -174,7 +175,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| //record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillRentManageMapper.insert(record); | wxBillRentManageMapper.insert(record); | ||||
| @@ -197,7 +198,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | ||||
| //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(latePayPrice)).add(new BigDecimal(wxBillRent.getServiceChargePay())) | //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(latePayPrice)).add(new BigDecimal(wxBillRent.getServiceChargePay())) | ||||
| // .subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | // .subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | ||||
| wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||||
| //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||||
| }else{ | }else{ | ||||
| String addpay = wxBillRent.getPay(); | String addpay = wxBillRent.getPay(); | ||||
| wxBillRent.setLatePayRatio(record.getLatePayRatio()); | wxBillRent.setLatePayRatio(record.getLatePayRatio()); | ||||
| @@ -205,9 +206,9 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| wxBillRent.setLatePayStatus(record.getLatePayStatus()); | wxBillRent.setLatePayStatus(record.getLatePayStatus()); | ||||
| wxBillRent.setPay(record.getPay()); | wxBillRent.setPay(record.getPay()); | ||||
| wxBillRent.setReceivePay(record.getReceivePay()); | wxBillRent.setReceivePay(record.getReceivePay()); | ||||
| wxBillRent.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| //wxBillRent.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | if (record.getPay().equals(record.getRealReceivePay())) { | ||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = wxBillRent.getReceiveDate(); | Date receiveDate = wxBillRent.getReceiveDate(); | ||||
| wxBillRent.setExpiredDay(0L); | wxBillRent.setExpiredDay(0L); | ||||
| @@ -263,7 +264,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| PageInfo<WxBillRentManage> page = getBillRentManageList(1, 1, record, wxPayAccountBill); | PageInfo<WxBillRentManage> page = getBillRentManageList(1, 1, record, wxPayAccountBill); | ||||
| WxBillRentManage rentManage = page.getList().get(0); | WxBillRentManage rentManage = page.getList().get(0); | ||||
| //rentManage.setOwe(new BigDecimal(rentManage.getRealReceivePay()).subtract(new BigDecimal(rentManage.getPay())).toPlainString()); | //rentManage.setOwe(new BigDecimal(rentManage.getRealReceivePay()).subtract(new BigDecimal(rentManage.getPay())).toPlainString()); | ||||
| rentManage.setOwe(new BigDecimal(rentManage.getReceivePay()).subtract(new BigDecimal(rentManage.getPay())).toPlainString()); | |||||
| //rentManage.setOwe(new BigDecimal(rentManage.getReceivePay()).subtract(new BigDecimal(rentManage.getPay())).toPlainString()); | |||||
| return rentManage; | return rentManage; | ||||
| } | } | ||||
| @@ -288,11 +289,11 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| BigDecimal realReceivePay = servicePay.add(new BigDecimal(rent.getLatePayPrice()).add(new BigDecimal(rent.getReceivePay()))); | BigDecimal realReceivePay = servicePay.add(new BigDecimal(rent.getLatePayPrice()).add(new BigDecimal(rent.getReceivePay()))); | ||||
| rent.setRealReceivePay(realReceivePay.toPlainString()); | rent.setRealReceivePay(realReceivePay.toPlainString()); | ||||
| rent.setServiceChargePay(servicePay.toPlainString()); | rent.setServiceChargePay(servicePay.toPlainString()); | ||||
| if (!rent.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) { | |||||
| rent.setOwe("0"); | |||||
| if (!rent.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { | |||||
| //rent.setOwe("0"); | |||||
| } else { | } else { | ||||
| //rent.setOwe(realReceivePay.subtract(new BigDecimal(rent.getPay())).toPlainString()); | //rent.setOwe(realReceivePay.subtract(new BigDecimal(rent.getPay())).toPlainString()); | ||||
| rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| //rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -303,7 +304,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| if(record.getLatePayMoneyUpdate() != null) { | if(record.getLatePayMoneyUpdate() != null) { | ||||
| rent.setLatePayPrice(record.getLatePayMoneyUpdate()); | rent.setLatePayPrice(record.getLatePayMoneyUpdate()); | ||||
| //rent.setOwe(new BigDecimal(rent.getReceivePay()).add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getServiceChargePay())).subtract(new BigDecimal(rent.getPay())).toPlainString()); | //rent.setOwe(new BigDecimal(rent.getReceivePay()).add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getServiceChargePay())).subtract(new BigDecimal(rent.getPay())).toPlainString()); | ||||
| rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| //rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| WxBillAction billAction = new WxBillAction(); | WxBillAction billAction = new WxBillAction(); | ||||
| billAction.setId(idWorker.nextId()); | billAction.setId(idWorker.nextId()); | ||||
| @@ -333,8 +334,8 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| public void updateWaidPayStatus(WxBillRentManage record) { | public void updateWaidPayStatus(WxBillRentManage record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillRentManageMapper.updateWaitPayStatus(params); | wxBillRentManageMapper.updateWaitPayStatus(params); | ||||
| @@ -349,8 +350,8 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| public void updateNotPaidStatus(WxBillRentManage record) { | public void updateNotPaidStatus(WxBillRentManage record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillRentManageMapper.updateNotPaidStatus(params); | wxBillRentManageMapper.updateNotPaidStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -371,7 +372,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| if(wxBillDeposit==null){ | if(wxBillDeposit==null){ | ||||
| return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date d =new Date(); | Date d =new Date(); | ||||
| wxBillDeposit.setPayDate(d); | wxBillDeposit.setPayDate(d); | ||||
| wxBillDeposit.setUpdatetime(d); | wxBillDeposit.setUpdatetime(d); | ||||
| @@ -386,7 +387,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| @Override | @Override | ||||
| public ResultData updateLatePayStatus(WxBillRentManage record) { | public ResultData updateLatePayStatus(WxBillRentManage record) { | ||||
| record.setLatePayStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| record.setLatePayStatus(EnumBillStatus.PAID.getCode()); | |||||
| record.setUpdatetime(new Date()); | record.setUpdatetime(new Date()); | ||||
| try { | try { | ||||
| wxBillRentManageMapper.updateById(record); | wxBillRentManageMapper.updateById(record); | ||||
| @@ -444,5 +445,11 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||||
| updateQueryParam(wxBillRentManage); | updateQueryParam(wxBillRentManage); | ||||
| return wxBillRentManageMapper.getMerchantIdList(wxBillRentManage); | return wxBillRentManageMapper.getMerchantIdList(wxBillRentManage); | ||||
| } | } | ||||
| @Override | |||||
| public WxBillHotNotify getBillHotNotify(WxBillRentManage wxBillRentManage) { | |||||
| updateQueryParam(wxBillRentManage); | |||||
| return wxBillRentManageMapper.getBillHotNotify(wxBillRentManage); | |||||
| } | |||||
| } | } | ||||
| @@ -10,6 +10,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.RatioVo; | import com.iformall.domain.vo.RatioVo; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -91,11 +92,11 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| BigDecimal realReceivePay = servicePay.add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getReceivePay())); | BigDecimal realReceivePay = servicePay.add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getReceivePay())); | ||||
| rent.setRealReceivePay(realReceivePay.toPlainString()); | rent.setRealReceivePay(realReceivePay.toPlainString()); | ||||
| rent.setServiceChargePay(servicePay.toPlainString()); | rent.setServiceChargePay(servicePay.toPlainString()); | ||||
| if (!rent.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode())) { | |||||
| rent.setOwe("0"); | |||||
| if (!rent.getStatus().equals(EnumBillStatus.NOT_PAID.getCode())) { | |||||
| //rent.setOwe("0"); | |||||
| } else { | } else { | ||||
| //rent.setOwe(realReceivePay.subtract(new BigDecimal(rent.getPay())).toPlainString()); | //rent.setOwe(realReceivePay.subtract(new BigDecimal(rent.getPay())).toPlainString()); | ||||
| rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| //rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -114,8 +115,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| public void updateWaidPayStatus(WxBillRent record) { | public void updateWaidPayStatus(WxBillRent record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("waitPay", EnumBillStatus.WAIT_PAY.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillRentMapper.updateWaitPayStatus(params); | wxBillRentMapper.updateWaitPayStatus(params); | ||||
| @@ -130,8 +131,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| public void updateNotPaidStatus(WxBillRent record) { | public void updateNotPaidStatus(WxBillRent record) { | ||||
| Map<String, Object> params = new HashMap<>(); | Map<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", record.getTenantId()); | params.put("tenantId", record.getTenantId()); | ||||
| params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||||
| params.put("notPaid", EnumBillStatus.NOT_PAID.getCode()); | |||||
| params.put("paid", EnumBillStatus.PAID.getCode()); | |||||
| try { | try { | ||||
| wxBillRentMapper.updateNotPaidStatus(params); | wxBillRentMapper.updateNotPaidStatus(params); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -151,7 +152,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| //手续费 = 合同应收+手续费+滞纳金 | //手续费 = 合同应收+手续费+滞纳金 | ||||
| //computeTotalMoney(wxPayAccountBill, rent); | //computeTotalMoney(wxPayAccountBill, rent); | ||||
| //rent.setOwe(new BigDecimal(rent.getRealReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | //rent.setOwe(new BigDecimal(rent.getRealReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | ||||
| rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| //rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| return rent; | return rent; | ||||
| } | } | ||||
| @@ -170,7 +171,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| //record.setOwe(new BigDecimal(receivepay).subtract(new BigDecimal(pay)).toPlainString()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillRentMapper.insert(record); | wxBillRentMapper.insert(record); | ||||
| @@ -193,7 +194,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | ||||
| //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(latePayPrice)) | //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(latePayPrice)) | ||||
| // .add(new BigDecimal(wxBillRent.getServiceChargePay())).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | // .add(new BigDecimal(wxBillRent.getServiceChargePay())).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | ||||
| wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||||
| //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||||
| }else{ | }else{ | ||||
| String addpay = wxBillRent.getPay(); | String addpay = wxBillRent.getPay(); | ||||
| wxBillRent.setRevenue(record.getRevenue()); | wxBillRent.setRevenue(record.getRevenue()); | ||||
| @@ -203,9 +204,9 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| wxBillRent.setPay(record.getPay()); | wxBillRent.setPay(record.getPay()); | ||||
| wxBillRent.setReceivePay(record.getReceivePay()); | wxBillRent.setReceivePay(record.getReceivePay()); | ||||
| //wxBillRent.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | //wxBillRent.setOwe(new BigDecimal(record.getRealReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | ||||
| wxBillRent.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| //wxBillRent.setOwe(new BigDecimal(record.getReceivePay()).subtract(new BigDecimal(record.getPay())).toPlainString()); | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | if (record.getPay().equals(record.getRealReceivePay())) { | ||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = wxBillRent.getReceiveDate(); | Date receiveDate = wxBillRent.getReceiveDate(); | ||||
| wxBillRent.setExpiredDay(0L); | wxBillRent.setExpiredDay(0L); | ||||
| @@ -270,7 +271,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| if(wxBillRent==null){ | if(wxBillRent==null){ | ||||
| return new ResultData(ErrorCode.BILL_RENT_IS_NOT_FOUND); | return new ResultData(ErrorCode.BILL_RENT_IS_NOT_FOUND); | ||||
| } | } | ||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| Date d =new Date(); | Date d =new Date(); | ||||
| wxBillRent.setPayDate(d); | wxBillRent.setPayDate(d); | ||||
| wxBillRent.setUpdatetime(d); | wxBillRent.setUpdatetime(d); | ||||
| @@ -395,7 +396,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| wxBillRent.setUpdatetime(new Date()); | wxBillRent.setUpdatetime(new Date()); | ||||
| String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | String latePayPrice = StringUtils.isBlank(wxBillRent.getLatePayPrice()) ? "0" : wxBillRent.getLatePayPrice(); | ||||
| //wxBillRent.setOwe(new BigDecimal(newPrice).add(new BigDecimal(wxBillRent.getServiceChargePay())).add(new BigDecimal(latePayPrice)).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | //wxBillRent.setOwe(new BigDecimal(newPrice).add(new BigDecimal(wxBillRent.getServiceChargePay())).add(new BigDecimal(latePayPrice)).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | ||||
| wxBillRent.setOwe(new BigDecimal(newPrice).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||||
| //wxBillRent.setOwe(new BigDecimal(newPrice).subtract(new BigDecimal(wxBillRent.getPay())).toPlainString()); | |||||
| wxBillRentMapper.updateById(wxBillRent); | wxBillRentMapper.updateById(wxBillRent); | ||||
| if (!oldPrice.equals(newPrice)) { | if (!oldPrice.equals(newPrice)) { | ||||
| @@ -422,7 +423,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| @Override | @Override | ||||
| public ResultData updateLatePayStatus(WxBillRent record) { | public ResultData updateLatePayStatus(WxBillRent record) { | ||||
| record.setLatePayStatus(EnumBillDailyStatus.PAID.getCode()); | |||||
| record.setLatePayStatus(EnumBillStatus.PAID.getCode()); | |||||
| record.setUpdatetime(new Date()); | record.setUpdatetime(new Date()); | ||||
| try { | try { | ||||
| wxBillRentMapper.updateById(record); | wxBillRentMapper.updateById(record); | ||||
| @@ -588,7 +589,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| if(record.getLatePayMoneyUpdate() != null) { | if(record.getLatePayMoneyUpdate() != null) { | ||||
| rent.setLatePayPrice(record.getLatePayMoneyUpdate()); | rent.setLatePayPrice(record.getLatePayMoneyUpdate()); | ||||
| //rent.setOwe(new BigDecimal(rent.getReceivePay()).add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getServiceChargePay())).subtract(new BigDecimal(rent.getPay())).toPlainString()); | //rent.setOwe(new BigDecimal(rent.getReceivePay()).add(new BigDecimal(rent.getLatePayPrice())).add(new BigDecimal(rent.getServiceChargePay())).subtract(new BigDecimal(rent.getPay())).toPlainString()); | ||||
| rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| //rent.setOwe(new BigDecimal(rent.getReceivePay()).subtract(new BigDecimal(rent.getPay())).toPlainString()); | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| WxBillAction billAction = new WxBillAction(); | WxBillAction billAction = new WxBillAction(); | ||||
| billAction.setId(idWorker.nextId()); | billAction.setId(idWorker.nextId()); | ||||
| @@ -615,4 +616,10 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| updateQueryParam(wxBillRent); | updateQueryParam(wxBillRent); | ||||
| return wxBillRentMapper.getMerchantIdList(wxBillRent); | return wxBillRentMapper.getMerchantIdList(wxBillRent); | ||||
| } | } | ||||
| @Override | |||||
| public WxBillHotNotify getBillHotNotify(WxBillRent wxBillRent) { | |||||
| updateQueryParam(wxBillRent); | |||||
| return wxBillRentMapper.getBillHotNotify(wxBillRent); | |||||
| } | |||||
| } | } | ||||
| @@ -181,15 +181,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| wxBillRent.setStatus(status); | wxBillRent.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| WxBillRent dbBill = wxBillRentMapper.selectById(wxBillRent.getId()); | WxBillRent dbBill = wxBillRentMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | ||||
| if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| //if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| //wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).toPlainString()); | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| //addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| } | } | ||||
| } | } | ||||
| wxBillRentMapper.updateById(wxBillRent); | wxBillRentMapper.updateById(wxBillRent); | ||||
| @@ -207,7 +208,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| wxBillRent.setStatus(status); | wxBillRent.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| WxBillDeposit dbBill = wxBillDepositMapper.selectById(wxBillRent.getId()); | WxBillDeposit dbBill = wxBillDepositMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| @@ -216,11 +217,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); //押金是ReceivePay | wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); //押金是ReceivePay | ||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | ||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| }else{ | }else{ | ||||
| wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| } | } | ||||
| addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| //addBillAction(bill.getBillId(), dbBill.getOwe()); | |||||
| } | } | ||||
| } | } | ||||
| wxBillDepositMapper.updateById(wxBillRent); | wxBillDepositMapper.updateById(wxBillRent); | ||||
| @@ -238,7 +239,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| wxBillOtherDeposit.setStatus(status); | wxBillOtherDeposit.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| wxBillOtherDeposit.setPayDate(new Date()); | wxBillOtherDeposit.setPayDate(new Date()); | ||||
| WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(wxBillRent.getId()); | WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| @@ -247,11 +248,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| wxBillOtherDeposit.setPay(dbBill.getPay()+ dbBill.getReceivePay()); | wxBillOtherDeposit.setPay(dbBill.getPay()+ dbBill.getReceivePay()); | ||||
| wxBillOtherDeposit.setPayDate(new Date()); | wxBillOtherDeposit.setPayDate(new Date()); | ||||
| if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | ||||
| wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillOtherDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| }else{ | }else{ | ||||
| wxBillOtherDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| wxBillOtherDeposit.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| } | } | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherDepositMapper.updateById(wxBillOtherDeposit); | wxBillOtherDepositMapper.updateById(wxBillOtherDeposit); | ||||
| @@ -269,7 +270,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| propertyDeposit.setStatus(status); | propertyDeposit.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| propertyDeposit.setPayDate(new Date()); | propertyDeposit.setPayDate(new Date()); | ||||
| WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(wxBillRent.getId()); | WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| @@ -278,11 +279,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| propertyDeposit.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); | propertyDeposit.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); | ||||
| propertyDeposit.setPayDate(new Date()); | propertyDeposit.setPayDate(new Date()); | ||||
| if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | ||||
| propertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| propertyDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| }else{ | }else{ | ||||
| propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| propertyDeposit.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| } | } | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillPropertyDepositMapper.updateById(propertyDeposit); | wxBillPropertyDepositMapper.updateById(propertyDeposit); | ||||
| @@ -301,15 +302,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| wxBillRent.setStatus(status); | wxBillRent.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| WxBillProperty dbBill = wxBillPropertyMapper.selectById(wxBillRent.getId()); | WxBillProperty dbBill = wxBillPropertyMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | ||||
| if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| //if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| //wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).toPlainString()); | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillPropertyMapper.updateById(wxBillRent); | wxBillPropertyMapper.updateById(wxBillRent); | ||||
| @@ -327,7 +329,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| propertyDeposit.setStatus(status); | propertyDeposit.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| propertyDeposit.setPayDate(new Date()); | propertyDeposit.setPayDate(new Date()); | ||||
| WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(wxBillRent.getId()); | WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| @@ -336,11 +338,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| propertyDeposit.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); | propertyDeposit.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); | ||||
| propertyDeposit.setPayDate(new Date()); | propertyDeposit.setPayDate(new Date()); | ||||
| if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | ||||
| propertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| propertyDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| }else{ | }else{ | ||||
| propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| propertyDeposit.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| } | } | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillPropertyDepositMapper.updateById(propertyDeposit); | wxBillPropertyDepositMapper.updateById(propertyDeposit); | ||||
| @@ -358,15 +360,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| wxBillRent.setStatus(status); | wxBillRent.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| WxBillOther dbBill = wxBillOtherMapper.selectById(wxBillRent.getId()); | WxBillOther dbBill = wxBillOtherMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | ||||
| if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| //if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| //wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).toPlainString()); | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherMapper.updateById(wxBillRent); | wxBillOtherMapper.updateById(wxBillRent); | ||||
| @@ -384,7 +387,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| wxBillRent.setStatus(status); | wxBillRent.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(wxBillRent.getId()); | WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| @@ -393,11 +396,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); | wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); | ||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | ||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| }else{ | }else{ | ||||
| wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| } | } | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherDepositMapper.updateById(wxBillRent); | wxBillOtherDepositMapper.updateById(wxBillRent); | ||||
| @@ -423,7 +426,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| wxBillRent.setStatus(status); | wxBillRent.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(wxBillRent.getId()); | WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| @@ -432,11 +435,11 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); | wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getReceivePay())).toPlainString()); | ||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | ||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| }else{ | }else{ | ||||
| wxBillRent.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| } | } | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherDepositMapper.updateById(wxBillRent); | wxBillOtherDepositMapper.updateById(wxBillRent); | ||||
| @@ -454,15 +457,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| wxBillDaily.setStatus(status); | wxBillDaily.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| wxBillDaily.setPayDate(new Date()); | wxBillDaily.setPayDate(new Date()); | ||||
| WxBillDaily dbBill = wxBillDailyMapper.selectById(wxBillDaily.getId()); | WxBillDaily dbBill = wxBillDailyMapper.selectById(wxBillDaily.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | ||||
| if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| wxBillDaily.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| //if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| //wxBillDaily.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| wxBillDaily.setPay(new BigDecimal(dbBill.getPay()).toPlainString()); | |||||
| wxBillDaily.setPayDate(new Date()); | wxBillDaily.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillDailyMapper.updateById(wxBillDaily); | wxBillDailyMapper.updateById(wxBillDaily); | ||||
| @@ -480,15 +484,16 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| wxBillRent.setStatus(status); | wxBillRent.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| WxBillOther dbBill = wxBillOtherMapper.selectById(wxBillRent.getId()); | WxBillOther dbBill = wxBillOtherMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | if(StringUtils.isBlank(dbBill.getPay())) dbBill.setPay("0"); | ||||
| if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| //if(StringUtils.isBlank(dbBill.getOwe())) dbBill.setOwe("0"); | |||||
| //wxBillRent.setPay(new BigDecimal(dbBill.getPay()).add(new BigDecimal(dbBill.getOwe())).toPlainString()); | |||||
| wxBillRent.setPay(new BigDecimal(dbBill.getPay()).toPlainString()); | |||||
| wxBillRent.setPayDate(new Date()); | wxBillRent.setPayDate(new Date()); | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillOtherMapper.updateById(wxBillRent); | wxBillOtherMapper.updateById(wxBillRent); | ||||
| @@ -506,18 +511,18 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if(status != null){ | if(status != null){ | ||||
| propertyDeposit.setStatus(status); | propertyDeposit.setStatus(status); | ||||
| } | } | ||||
| if(EnumBillRentStatus.PAID.getCode().equals(status)){ | |||||
| if(EnumBillStatus.PAID.getCode().equals(status)){ | |||||
| propertyDeposit.setPayDate(new Date()); | propertyDeposit.setPayDate(new Date()); | ||||
| WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(wxBillRent.getId()); | WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(wxBillRent.getId()); | ||||
| if(dbBill!=null) { | if(dbBill!=null) { | ||||
| propertyDeposit.setPay(dbBill.getPay()+dbBill.getReceivePay()); | propertyDeposit.setPay(dbBill.getPay()+dbBill.getReceivePay()); | ||||
| propertyDeposit.setPayDate(new Date()); | propertyDeposit.setPayDate(new Date()); | ||||
| if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | if(EnumSettleBillType.R.getCode().equals(bill.getType())){ | ||||
| propertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| propertyDeposit.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| }else{ | }else{ | ||||
| propertyDeposit.setStatus(EnumBillRentStatus.RETURN.getCode()); | |||||
| propertyDeposit.setStatus(EnumBillStatus.RETURN.getCode()); | |||||
| } | } | ||||
| addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| //addBillAction(bill.getBillId(), String.valueOf(dbBill.getOwe())); | |||||
| } | } | ||||
| } | } | ||||
| wxBillPropertyDepositMapper.updateById(propertyDeposit); | wxBillPropertyDepositMapper.updateById(propertyDeposit); | ||||
| @@ -568,8 +573,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| if (record.getFlowParams() == null || record.getFlowParams().size() == 0) { | if (record.getFlowParams() == null || record.getFlowParams().size() == 0) { | ||||
| record.setStatus(EnumSettleStatus.NOT_FINISH.getCode()); | record.setStatus(EnumSettleStatus.NOT_FINISH.getCode()); | ||||
| //选择的账单改为已结清 | //选择的账单改为已结清 | ||||
| updateFreezeOrStatus(record.getReceiveBillIds(), null,EnumBillRentStatus.PAID.getCode(),null); | |||||
| updateFreezeOrStatus(record.getPayBillIds(), null,EnumBillRentStatus.PAID.getCode(),null); | |||||
| updateFreezeOrStatus(record.getReceiveBillIds(), null,EnumBillStatus.PAID.getCode(),null); | |||||
| updateFreezeOrStatus(record.getPayBillIds(), null,EnumBillStatus.PAID.getCode(),null); | |||||
| //刚好结清 | //刚好结清 | ||||
| if(record.getReceiveMoney().equals(record.getPayMoney())){ | if(record.getReceiveMoney().equals(record.getPayMoney())){ | ||||
| @@ -3057,7 +3057,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| WxBillAll wxBillAll = new WxBillAll(); | WxBillAll wxBillAll = new WxBillAll(); | ||||
| wxBillAll.updateTenantInfo(tenantEntity); | wxBillAll.updateTenantInfo(tenantEntity); | ||||
| wxBillAll.setMonth(new SimpleDateFormat("yyyy-MM").format(startDate)); | wxBillAll.setMonth(new SimpleDateFormat("yyyy-MM").format(startDate)); | ||||
| wxBillAll.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| wxBillAll.setStatus(EnumBillStatus.NOT_PAID.getCode()); | |||||
| List<Integer> billTypeList = new ArrayList<>(); | List<Integer> billTypeList = new ArrayList<>(); | ||||
| billTypeList.add(EnumBillTypeStr.RENT.getCode()); | billTypeList.add(EnumBillTypeStr.RENT.getCode()); | ||||
| wxBillAll.setBillTypeList(billTypeList); | wxBillAll.setBillTypeList(billTypeList); | ||||
| @@ -454,8 +454,8 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| WxBillSettle settle = wxBillSettleService.getById(Long.parseLong(businessId), EnumFilterSettle.NO.getCode()); | WxBillSettle settle = wxBillSettleService.getById(Long.parseLong(businessId), EnumFilterSettle.NO.getCode()); | ||||
| if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | ||||
| wxBillSettle.setStatus(EnumSettleStatus.NOT_FINISH.getCode()); | wxBillSettle.setStatus(EnumSettleStatus.NOT_FINISH.getCode()); | ||||
| wxBillSettleService.updateFreezeOrStatus(settle.getReceiveBillIds(), EnumFreezeType.DEF.getCode(),EnumBillRentStatus.PAID.getCode(),null); | |||||
| wxBillSettleService.updateFreezeOrStatus(settle.getPayBillIds(),EnumFreezeType.DEF.getCode(),EnumBillRentStatus.PAID.getCode(),null); | |||||
| wxBillSettleService.updateFreezeOrStatus(settle.getReceiveBillIds(), EnumFreezeType.DEF.getCode(),EnumBillStatus.PAID.getCode(),null); | |||||
| wxBillSettleService.updateFreezeOrStatus(settle.getPayBillIds(),EnumFreezeType.DEF.getCode(),EnumBillStatus.PAID.getCode(),null); | |||||
| //刚好结清 | //刚好结清 | ||||
| if(settle.getReceiveMoney().equals(settle.getPayMoney())){ | if(settle.getReceiveMoney().equals(settle.getPayMoney())){ | ||||
| @@ -255,7 +255,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| bill.setPropertyContractId(record.getId()); | bill.setPropertyContractId(record.getId()); | ||||
| bill.setCreatetime(date); | bill.setCreatetime(date); | ||||
| bill.updateTenantInfo(wxPayAccountBill); | bill.updateTenantInfo(wxPayAccountBill); | ||||
| bill.setOwe(bill.getReceivePay()); | |||||
| //bill.setOwe(bill.getReceivePay()); | |||||
| bill.setNeedPay(bill.getNeedPay()); | bill.setNeedPay(bill.getNeedPay()); | ||||
| bill.setUpdatetime(date); | bill.setUpdatetime(date); | ||||
| bill.setRentShopType(record.getRentShopType()); | bill.setRentShopType(record.getRentShopType()); | ||||
| @@ -269,14 +269,14 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| //bill.setShopId(record.getShopId()); | //bill.setShopId(record.getShopId()); | ||||
| bill.setExpiredDay(0L); | bill.setExpiredDay(0L); | ||||
| setExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod()); | setExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod()); | ||||
| if (bill.getReceivePay().equals(0L)) { | |||||
| bill.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| if (bill.getReceivePay().equals("0")) { | |||||
| bill.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| bill.setPayDate(date); | bill.setPayDate(date); | ||||
| } | } | ||||
| BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(100), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(100), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | ||||
| bill.setServiceChargePay(servicePay.toPlainString()); | bill.setServiceChargePay(servicePay.toPlainString()); | ||||
| //bill.setOwe(new BigDecimal(bill.getReceivePay()).add(new BigDecimal(bill.getServiceChargePay())).toPlainString()); | //bill.setOwe(new BigDecimal(bill.getReceivePay()).add(new BigDecimal(bill.getServiceChargePay())).toPlainString()); | ||||
| bill.setOwe(new BigDecimal(bill.getReceivePay()).toPlainString()); | |||||
| //bill.setOwe(new BigDecimal(bill.getReceivePay()).toPlainString()); | |||||
| count++; | count++; | ||||
| } | } | ||||
| wxBillPropertyMapper.insertBills(record.getPreviewBillRentList()); | wxBillPropertyMapper.insertBills(record.getPreviewBillRentList()); | ||||
| @@ -499,7 +499,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| String needpay = wxPropertyContract.getDeposit(); | String needpay = wxPropertyContract.getDeposit(); | ||||
| wxBillDeposit.setNeedPay(needpay); | wxBillDeposit.setNeedPay(needpay); | ||||
| wxBillDeposit.setReceivePay(needpay); | wxBillDeposit.setReceivePay(needpay); | ||||
| wxBillDeposit.setOwe(needpay); | |||||
| //wxBillDeposit.setOwe(needpay); | |||||
| Date date = new Date(); | Date date = new Date(); | ||||
| Calendar instance = Calendar.getInstance(); | Calendar instance = Calendar.getInstance(); | ||||
| instance.setTime(wxPropertyContract.getRentalStartDate()); | instance.setTime(wxPropertyContract.getRentalStartDate()); | ||||
| @@ -516,7 +516,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| instance.setTime(wxBillDeposit.getReceiveDate()); | instance.setTime(wxBillDeposit.getReceiveDate()); | ||||
| instance.add(dayType, wxPropertyContract.getLease()); | instance.add(dayType, wxPropertyContract.getLease()); | ||||
| wxBillDeposit.setEndtime(instance.getTime()); | wxBillDeposit.setEndtime(instance.getTime()); | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| wxBillDeposit.setExpiredDay(0L); | wxBillDeposit.setExpiredDay(0L); | ||||
| wxBillDeposit.updateTenantInfo(wxPropertyContract); | wxBillDeposit.updateTenantInfo(wxPropertyContract); | ||||
| wxBillDeposit.setIsDel(0); | wxBillDeposit.setIsDel(0); | ||||
| @@ -710,7 +710,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| wxBillProperty.setReceiveDate(billTimeVo.getReceiveDate()); | wxBillProperty.setReceiveDate(billTimeVo.getReceiveDate()); | ||||
| wxBillProperty.setNeedPay(needpay); | wxBillProperty.setNeedPay(needpay); | ||||
| wxBillProperty.setOwe(needpay); | |||||
| //wxBillProperty.setOwe(needpay); | |||||
| wxBillProperty.setReceivePay(needpay); | wxBillProperty.setReceivePay(needpay); | ||||
| //截止收租日在当前时间之前 | //截止收租日在当前时间之前 | ||||
| @@ -735,7 +735,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| BigDecimal servicePay = new BigDecimal(wxBillProperty.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(100), wxPropertyContract.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | BigDecimal servicePay = new BigDecimal(wxBillProperty.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(100), wxPropertyContract.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | ||||
| wxBillProperty.setServiceChargePay(servicePay.toPlainString()); | wxBillProperty.setServiceChargePay(servicePay.toPlainString()); | ||||
| //wxBillProperty.setOwe(new BigDecimal(wxBillProperty.getReceivePay()).add(new BigDecimal(wxBillProperty.getServiceChargePay())).toPlainString()); | //wxBillProperty.setOwe(new BigDecimal(wxBillProperty.getReceivePay()).add(new BigDecimal(wxBillProperty.getServiceChargePay())).toPlainString()); | ||||
| wxBillProperty.setOwe(new BigDecimal(wxBillProperty.getReceivePay()).toPlainString()); | |||||
| //wxBillProperty.setOwe(new BigDecimal(wxBillProperty.getReceivePay()).toPlainString()); | |||||
| resultList.add(wxBillProperty); | resultList.add(wxBillProperty); | ||||
| } | } | ||||
| //批量生成预账单 | //批量生成预账单 | ||||
| @@ -819,7 +819,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| wxBillProperty.setExpiredDay(0L); | wxBillProperty.setExpiredDay(0L); | ||||
| if (wxBillProperty.getReceiveDate().before(date)) { | if (wxBillProperty.getReceiveDate().before(date)) { | ||||
| long day = (date.getTime() - wxBillProperty.getReceiveDate().getTime()) / (24 * 60 * 60 * 1000); | long day = (date.getTime() - wxBillProperty.getReceiveDate().getTime()) / (24 * 60 * 60 * 1000); | ||||
| wxBillProperty.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| wxBillProperty.setStatus(EnumBillStatus.NOT_PAID.getCode()); | |||||
| if (day > 0) { | if (day > 0) { | ||||
| wxBillProperty.setExpiredDay(day); | wxBillProperty.setExpiredDay(day); | ||||
| } | } | ||||
| @@ -829,9 +829,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| Date currenttime = now.getTime(); | Date currenttime = now.getTime(); | ||||
| //当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴 | //当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴 | ||||
| if (currenttime.before(wxBillProperty.getReceiveDate())) { | if (currenttime.before(wxBillProperty.getReceiveDate())) { | ||||
| wxBillProperty.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode()); | |||||
| wxBillProperty.setStatus(EnumBillStatus.NOT_EXPIRED.getCode()); | |||||
| } else { | } else { | ||||
| wxBillProperty.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| wxBillProperty.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -676,14 +676,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| setExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod()); | setExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod()); | ||||
| if (bill.getReceivePay().equals("0")) { | if (bill.getReceivePay().equals("0")) { | ||||
| bill.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| bill.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| bill.setPayDate(date); | bill.setPayDate(date); | ||||
| } | } | ||||
| //计算手续费 | //计算手续费 | ||||
| BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | ||||
| bill.setServiceChargePay(servicePay.toPlainString()); | bill.setServiceChargePay(servicePay.toPlainString()); | ||||
| //bill.setOwe(bill.getReceivePay() + bill.getServiceChargePay()); | //bill.setOwe(bill.getReceivePay() + bill.getServiceChargePay()); | ||||
| bill.setOwe(bill.getReceivePay()); | |||||
| //bill.setOwe(bill.getReceivePay()); | |||||
| count++; | count++; | ||||
| } | } | ||||
| wxBillRentMapper.insertBills(record.getPreviewBillRentList()); | wxBillRentMapper.insertBills(record.getPreviewBillRentList()); | ||||
| @@ -742,14 +742,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| setManageExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod()); | setManageExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod()); | ||||
| if (bill.getReceivePay().equals("0")) { | if (bill.getReceivePay().equals("0")) { | ||||
| bill.setStatus(EnumBillRentStatus.PAID.getCode()); | |||||
| bill.setStatus(EnumBillStatus.PAID.getCode()); | |||||
| bill.setPayDate(date); | bill.setPayDate(date); | ||||
| } | } | ||||
| //计算手续费 | //计算手续费 | ||||
| BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | ||||
| bill.setServiceChargePay(servicePay.toPlainString()); | bill.setServiceChargePay(servicePay.toPlainString()); | ||||
| //bill.setOwe(bill.getReceivePay() + bill.getServiceChargePay()); | //bill.setOwe(bill.getReceivePay() + bill.getServiceChargePay()); | ||||
| bill.setOwe(bill.getReceivePay()); | |||||
| //bill.setOwe(bill.getReceivePay()); | |||||
| count++; | count++; | ||||
| billList.add(bill); | billList.add(bill); | ||||
| } | } | ||||
| @@ -906,7 +906,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| String needpay = wxRentContract.getDeposit(); | String needpay = wxRentContract.getDeposit(); | ||||
| wxBillDeposit.setReceivePay(needpay); | wxBillDeposit.setReceivePay(needpay); | ||||
| wxBillDeposit.setNeedPay(needpay); | wxBillDeposit.setNeedPay(needpay); | ||||
| wxBillDeposit.setOwe(needpay); | |||||
| //wxBillDeposit.setOwe(needpay); | |||||
| //找到计租方式 | //找到计租方式 | ||||
| int dayType = wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; | int dayType = wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; | ||||
| @@ -927,7 +927,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| instance.setTime(wxBillDeposit.getReceiveDate()); | instance.setTime(wxBillDeposit.getReceiveDate()); | ||||
| instance.add(dayType, wxRentContract.getLease()); | instance.add(dayType, wxRentContract.getLease()); | ||||
| wxBillDeposit.setEndtime(instance.getTime()); | wxBillDeposit.setEndtime(instance.getTime()); | ||||
| wxBillDeposit.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| wxBillDeposit.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| wxBillDeposit.setExpiredDay(0L); | wxBillDeposit.setExpiredDay(0L); | ||||
| wxBillDeposit.setReceiveDate(time); | wxBillDeposit.setReceiveDate(time); | ||||
| wxBillDeposit.updateTenantInfo(wxRentContract); | wxBillDeposit.updateTenantInfo(wxRentContract); | ||||
| @@ -1579,7 +1579,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| wxBillRent.setContractNeedPay(needpay); | wxBillRent.setContractNeedPay(needpay); | ||||
| wxBillRent.setRentPriceInfo(getRentPriceInfo(wxRentContract,new BigDecimal(needpay))); | wxBillRent.setRentPriceInfo(getRentPriceInfo(wxRentContract,new BigDecimal(needpay))); | ||||
| wxBillRent.setNeedPay(needpay); | wxBillRent.setNeedPay(needpay); | ||||
| wxBillRent.setOwe(needpay); | |||||
| //wxBillRent.setOwe(needpay); | |||||
| wxBillRent.setReceivePay(needpay); | wxBillRent.setReceivePay(needpay); | ||||
| //商业管理费 | //商业管理费 | ||||
| wxBillRent.setBussinessManageFeeNeedPay(bussinessManageFeeNeedpay); | wxBillRent.setBussinessManageFeeNeedPay(bussinessManageFeeNeedpay); | ||||
| @@ -1608,7 +1608,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| .divide(new BigDecimal(10000), wxRentContract.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | .divide(new BigDecimal(10000), wxRentContract.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | ||||
| wxBillRent.setServiceChargePay(servicePay.toPlainString()); | wxBillRent.setServiceChargePay(servicePay.toPlainString()); | ||||
| //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(wxBillRent.getServiceChargePay())).toPlainString()); | //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).add(new BigDecimal(wxBillRent.getServiceChargePay())).toPlainString()); | ||||
| wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).toPlainString()); | |||||
| //wxBillRent.setOwe(new BigDecimal(wxBillRent.getReceivePay()).toPlainString()); | |||||
| resultList.add(wxBillRent); | resultList.add(wxBillRent); | ||||
| @@ -1643,13 +1643,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| manage.setManageFeeType(feeType.getCode()); | manage.setManageFeeType(feeType.getCode()); | ||||
| manage.setNeedPay(needPay); | manage.setNeedPay(needPay); | ||||
| manage.setReceivePay(needPay); | manage.setReceivePay(needPay); | ||||
| manage.setOwe(needPay); | |||||
| //manage.setOwe(needPay); | |||||
| setManageExpiredDay(manage,dayType,receivePeriod); | setManageExpiredDay(manage,dayType,receivePeriod); | ||||
| //计算手续费 | //计算手续费 | ||||
| BigDecimal servicePay = new BigDecimal(needPay).multiply(new BigDecimal(serviceChargeRate)).divide(new BigDecimal(10000), decimalSize, BigDecimal.ROUND_HALF_UP); | BigDecimal servicePay = new BigDecimal(needPay).multiply(new BigDecimal(serviceChargeRate)).divide(new BigDecimal(10000), decimalSize, BigDecimal.ROUND_HALF_UP); | ||||
| manage.setServiceChargePay(servicePay.toPlainString()); | manage.setServiceChargePay(servicePay.toPlainString()); | ||||
| //manage.setOwe(new BigDecimal(needPay).add(new BigDecimal(manage.getServiceChargePay())).toPlainString()); | //manage.setOwe(new BigDecimal(needPay).add(new BigDecimal(manage.getServiceChargePay())).toPlainString()); | ||||
| manage.setOwe(new BigDecimal(needPay).toPlainString()); | |||||
| //manage.setOwe(new BigDecimal(needPay).toPlainString()); | |||||
| return manage; | return manage; | ||||
| } | } | ||||
| @@ -1659,7 +1659,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| wxBillRent.setExpiredDay(0L); | wxBillRent.setExpiredDay(0L); | ||||
| if (wxBillRent.getReceiveDate().before(date)) { | if (wxBillRent.getReceiveDate().before(date)) { | ||||
| long day = (date.getTime() - wxBillRent.getReceiveDate().getTime()) / (24 * 60 * 60 * 1000); | long day = (date.getTime() - wxBillRent.getReceiveDate().getTime()) / (24 * 60 * 60 * 1000); | ||||
| wxBillRent.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.NOT_PAID.getCode()); | |||||
| if (day > 0) { | if (day > 0) { | ||||
| wxBillRent.setExpiredDay(day); | wxBillRent.setExpiredDay(day); | ||||
| } | } | ||||
| @@ -1669,9 +1669,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| Date currenttime = now.getTime(); | Date currenttime = now.getTime(); | ||||
| //当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴 | //当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴 | ||||
| if (currenttime.before(wxBillRent.getReceiveDate())) { | if (currenttime.before(wxBillRent.getReceiveDate())) { | ||||
| wxBillRent.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.NOT_EXPIRED.getCode()); | |||||
| } else { | } else { | ||||
| wxBillRent.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| wxBillRent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -1682,7 +1682,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| wxBillRentManage.setExpiredDay(0L); | wxBillRentManage.setExpiredDay(0L); | ||||
| if (wxBillRentManage.getReceiveDate().before(date)) { | if (wxBillRentManage.getReceiveDate().before(date)) { | ||||
| long day = (date.getTime() - wxBillRentManage.getReceiveDate().getTime()) / (24 * 60 * 60 * 1000); | long day = (date.getTime() - wxBillRentManage.getReceiveDate().getTime()) / (24 * 60 * 60 * 1000); | ||||
| wxBillRentManage.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||||
| wxBillRentManage.setStatus(EnumBillStatus.NOT_PAID.getCode()); | |||||
| if (day > 0) { | if (day > 0) { | ||||
| wxBillRentManage.setExpiredDay(day); | wxBillRentManage.setExpiredDay(day); | ||||
| } | } | ||||
| @@ -1692,9 +1692,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| Date currenttime = now.getTime(); | Date currenttime = now.getTime(); | ||||
| //当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴 | //当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴 | ||||
| if (currenttime.before(wxBillRentManage.getReceiveDate())) { | if (currenttime.before(wxBillRentManage.getReceiveDate())) { | ||||
| wxBillRentManage.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode()); | |||||
| wxBillRentManage.setStatus(EnumBillStatus.NOT_EXPIRED.getCode()); | |||||
| } else { | } else { | ||||
| wxBillRentManage.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||||
| wxBillRentManage.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -3307,13 +3307,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| String oldNeedPay = br.getNeedPay(); | String oldNeedPay = br.getNeedPay(); | ||||
| if (needPay.compareTo(new BigDecimal(br.getNeedPay())) > 0) { | if (needPay.compareTo(new BigDecimal(br.getNeedPay())) > 0) { | ||||
| br.setNeedPay(needPay.toPlainString()); | br.setNeedPay(needPay.toPlainString()); | ||||
| br.setOwe(needPay.toPlainString()); | |||||
| //br.setOwe(needPay.toPlainString()); | |||||
| br.setReceivePay(needPay.toPlainString()); | br.setReceivePay(needPay.toPlainString()); | ||||
| br.setUpdatetime(new Date()); | br.setUpdatetime(new Date()); | ||||
| BigDecimal servicePay = new BigDecimal(br.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), wxRentContract.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | BigDecimal servicePay = new BigDecimal(br.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), wxRentContract.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | ||||
| br.setServiceChargePay(servicePay.toPlainString()); | br.setServiceChargePay(servicePay.toPlainString()); | ||||
| //br.setOwe(new BigDecimal(br.getReceivePay()).add(new BigDecimal(br.getServiceChargePay())).toPlainString()); | //br.setOwe(new BigDecimal(br.getReceivePay()).add(new BigDecimal(br.getServiceChargePay())).toPlainString()); | ||||
| br.setOwe(new BigDecimal(br.getReceivePay()).toPlainString()); | |||||
| //br.setOwe(new BigDecimal(br.getReceivePay()).toPlainString()); | |||||
| br.setComments("原金额["+oldNeedPay+"(分)]小于解单金额["+needPay+"(分)],系统自动更新"); | br.setComments("原金额["+oldNeedPay+"(分)]小于解单金额["+needPay+"(分)],系统自动更新"); | ||||
| wxBillRentMapper.updateById(br); | wxBillRentMapper.updateById(br); | ||||
| } | } | ||||
| @@ -136,5 +136,6 @@ public class Constant { | |||||
| public static final String cache_aliyun_msg ="aliyunMsg:"; | public static final String cache_aliyun_msg ="aliyunMsg:"; | ||||
| public static final Integer default_long_decimal_size = 10; | public static final Integer default_long_decimal_size = 10; | ||||
| public static final Integer bill_near_default_days = 5; | |||||
| } | } | ||||
| @@ -11,7 +11,6 @@ | |||||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> | <result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | ||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | ||||
| <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | ||||
| @@ -38,7 +37,7 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`apply_status`,`apply_pay_img`,`apply_update_time`, | `id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`apply_status`,`apply_pay_img`,`apply_update_time`, | ||||
| `tenant_id`,`parent_tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`type`, | |||||
| `tenant_id`,`parent_tenant_id`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`type`, | |||||
| `rent_shop_type`,`pay_way`,`price_detail`,`starttime`,`endtime`,freeze,build_way,service_charge_pay,`bill_remark`, | `rent_shop_type`,`pay_way`,`price_detail`,`starttime`,`endtime`,freeze,build_way,service_charge_pay,`bill_remark`, | ||||
| case type when 1 then '水费' when 2 then '电费' when 3 then '空调费' else '日常费用' end bill_type_name | case type when 1 then '水费' when 2 then '电费' when 3 then '空调费' else '日常费用' end bill_type_name | ||||
| </sql> | </sql> | ||||
| @@ -58,7 +57,6 @@ | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | <if test=" null != parentTenantId and '' != parentTenantId"> | ||||
| and `parent_tenant_id` = #{parentTenantId} | and `parent_tenant_id` = #{parentTenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||||
| <if test=" null != status "> and `status` = #{status} </if> | <if test=" null != status "> and `status` = #{status} </if> | ||||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | <if test=" null != isDel "> and `is_del` = #{isDel} </if> | ||||
| @@ -104,7 +102,17 @@ | |||||
| <if test=" null != month and '' != month"> | <if test=" null != month and '' != month"> | ||||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||||
| <if test=" null == nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY) | |||||
| and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != buildWay ">and br.`build_way` = #{buildWay}</if> | <if test=" null != buildWay ">and br.`build_way` = #{buildWay}</if> | ||||
| <if test=" null != merchantIds "> | <if test=" null != merchantIds "> | ||||
| and br.`merchant_id` in | and br.`merchant_id` in | ||||
| @@ -118,7 +126,7 @@ | |||||
| <select id="queryBillDailyList" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="BaseResultMap"> | <select id="queryBillDailyList" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day` , | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day` , | ||||
| case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`updatetime`,br.`merchant_id`,br.shop_id, | |||||
| br.`status`,br.`updatetime`,br.`merchant_id`,br.shop_id, | |||||
| br.shop_name,br.type,br.`rent_shop_type`,br.pay_way,br.price_detail,br.`starttime`,br.`endtime`,br.`build_way`, | br.shop_name,br.type,br.`rent_shop_type`,br.pay_way,br.price_detail,br.`starttime`,br.`endtime`,br.`build_way`, | ||||
| br.freeze,br.service_charge_pay,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,br.`bill_remark`, | br.freeze,br.service_charge_pay,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,br.`bill_remark`, | ||||
| case type when 1 then '水费' when 2 then '电费' when 3 then '空调费' else '日常费用' end bill_type_name | case type when 1 then '水费' when 2 then '电费' when 3 then '空调费' else '日常费用' end bill_type_name | ||||
| @@ -131,10 +139,9 @@ | |||||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | ||||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | ||||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | <result column="paid" jdbcType="VARCHAR" property="paid" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="SumBaseResultMap"> | <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="SumBaseResultMap"> | ||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_daily br | |||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_daily br | |||||
| <include refid="queryBillDailyListConditions"/> | <include refid="queryBillDailyListConditions"/> | ||||
| </select> | </select> | ||||
| @@ -143,6 +150,16 @@ | |||||
| <include refid="queryBillDailyListConditions"/> | <include refid="queryBillDailyListConditions"/> | ||||
| </select> | </select> | ||||
| <resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify"> | |||||
| <result column="total_count" jdbcType="INTEGER" property="totalCount"/> | |||||
| <result column="total_money" jdbcType="VARCHAR" property="totalMoney" /> | |||||
| <result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/> | |||||
| </resultMap> | |||||
| <select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillDaily" resultMap="HotNotifyBaseResultMap"> | |||||
| select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_daily br | |||||
| <include refid="queryBillDailyListConditions"/> | |||||
| </select> | |||||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | <update id="updateNotPaidStatus" parameterType="hashmap"> | ||||
| update wx_bill_daily set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | update wx_bill_daily set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | ||||
| where status!=#{paid} | where status!=#{paid} | ||||
| @@ -12,7 +12,6 @@ | |||||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> | <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> | ||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | ||||
| <result column="expired_day" jdbcType="BIGINT" property="expiredDay" /> | <result column="expired_day" jdbcType="BIGINT" property="expiredDay" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | ||||
| <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | ||||
| @@ -37,7 +36,7 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`, | `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`, | ||||
| `expired_day`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`apply_status`,`apply_pay_img`,`apply_update_time`, | |||||
| `expired_day`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`apply_status`,`apply_pay_img`,`apply_update_time`, | |||||
| `rent_shop_type`,`return_price`,`pay_way`,service_charge_pay,'租赁押金' bill_type_name,'' bill_remark | `rent_shop_type`,`return_price`,`pay_way`,service_charge_pay,'租赁押金' bill_type_name,'' bill_remark | ||||
| </sql> | </sql> | ||||
| @@ -57,7 +56,6 @@ | |||||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | ||||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | <if test=" null != createtime "> and `createtime` = #{createtime} </if> | ||||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | ||||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||||
| <if test=" null != status "> and `status` = #{status} </if> | <if test=" null != status "> and `status` = #{status} </if> | ||||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | <if test=" null != isDel "> and `is_del` = #{isDel} </if> | ||||
| @@ -96,7 +94,7 @@ | |||||
| <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="BaseResultMap"> | <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | ||||
| br.`owe`,br.`status`,br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`, | |||||
| br.`status`,br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`, | |||||
| br.`rent_shop_type`,br.`return_price`, br.pay_way,br.shop_info ,br.freeze,br.service_charge_pay,'租赁押金' bill_type_name,'' bill_remark | br.`rent_shop_type`,br.`return_price`, br.pay_way,br.shop_info ,br.freeze,br.service_charge_pay,'租赁押金' bill_type_name,'' bill_remark | ||||
| from wx_bill_rent_deposit br | from wx_bill_rent_deposit br | ||||
| <include refid="queryBillRentListCondition"/> | <include refid="queryBillRentListCondition"/> | ||||
| @@ -125,7 +123,17 @@ | |||||
| <if test=" null != month and '' != month"> | <if test=" null != month and '' != month"> | ||||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||||
| <if test=" null == nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY) | |||||
| and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != merchantIds "> | <if test=" null != merchantIds "> | ||||
| and br.`merchant_id` in | and br.`merchant_id` in | ||||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | ||||
| @@ -139,10 +147,9 @@ | |||||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | ||||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | ||||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | <result column="paid" jdbcType="VARCHAR" property="paid" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="SumBaseResultMap"> | <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="SumBaseResultMap"> | ||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_rent_deposit br | |||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_rent_deposit br | |||||
| <include refid="queryBillRentListCondition"/> | <include refid="queryBillRentListCondition"/> | ||||
| </select> | </select> | ||||
| @@ -150,6 +157,16 @@ | |||||
| select distinct merchant_id from wx_bill_rent_deposit br | select distinct merchant_id from wx_bill_rent_deposit br | ||||
| <include refid="queryBillRentListCondition"/> | <include refid="queryBillRentListCondition"/> | ||||
| </select> | </select> | ||||
| <resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify"> | |||||
| <result column="total_count" jdbcType="INTEGER" property="totalCount"/> | |||||
| <result column="total_money" jdbcType="VARCHAR" property="totalMoney" /> | |||||
| <result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/> | |||||
| </resultMap> | |||||
| <select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="HotNotifyBaseResultMap"> | |||||
| select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_rent_deposit br | |||||
| <include refid="queryBillRentListCondition"/> | |||||
| </select> | |||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id,parent_tenant_id from wx_bill_rent_deposit | select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id,parent_tenant_id from wx_bill_rent_deposit | ||||
| @@ -202,7 +219,7 @@ | |||||
| <select id="queryOweInfoAll" resultType="hashmap" parameterType="hashmap"> | <select id="queryOweInfoAll" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from | select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from | ||||
| ( | ( | ||||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent_deposit | |||||
| select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_rent_deposit | |||||
| where status = 1 | where status = 1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| @@ -212,7 +229,7 @@ | |||||
| </if> | </if> | ||||
| and receive_date between #{startdate} and #{enddate} | and receive_date between #{startdate} and #{enddate} | ||||
| union all | union all | ||||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property_deposit | |||||
| select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_property_deposit | |||||
| where status = 1 | where status = 1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| @@ -222,7 +239,7 @@ | |||||
| </if> | </if> | ||||
| and receive_date between #{startdate} and #{enddate} | and receive_date between #{startdate} and #{enddate} | ||||
| union all | union all | ||||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_other_deposit | |||||
| select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_other_deposit | |||||
| where status = 1 | where status = 1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| @@ -11,7 +11,6 @@ | |||||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | ||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | ||||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay"/> | <result column="expired_day" jdbcType="INTEGER" property="expiredDay"/> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | <result column="status" jdbcType="INTEGER" property="status"/> | ||||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | ||||
| <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | ||||
| @@ -40,7 +39,7 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | `id`,`tenant_id`,`parent_tenant_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | ||||
| `owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`name`,`comments`,`apply_status`,`apply_pay_img`,`apply_update_time`, | |||||
| `status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`name`,`comments`,`apply_status`,`apply_pay_img`,`apply_update_time`, | |||||
| `rent_shop_type`,`return_price`,`pay_way`,`starttime`,`endtime`,freeze,service_charge_pay,'其他押金' bill_type_name,CONCAT(`name`,',',`comments`) bill_remark | `rent_shop_type`,`return_price`,`pay_way`,`starttime`,`endtime`,freeze,service_charge_pay,'其他押金' bill_type_name,CONCAT(`name`,',',`comments`) bill_remark | ||||
| </sql> | </sql> | ||||
| @@ -59,7 +58,6 @@ | |||||
| <if test=" null != payDate ">and `pay_date` = #{payDate}</if> | <if test=" null != payDate ">and `pay_date` = #{payDate}</if> | ||||
| <if test=" null != createtime ">and `createtime` = #{createtime}</if> | <if test=" null != createtime ">and `createtime` = #{createtime}</if> | ||||
| <if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if> | <if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if> | ||||
| <if test=" null != owe ">and `owe` = #{owe}</if> | |||||
| <if test=" null != status ">and `status` = #{status}</if> | <if test=" null != status ">and `status` = #{status}</if> | ||||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != isDel ">and `is_del` = #{isDel}</if> | <if test=" null != isDel ">and `is_del` = #{isDel}</if> | ||||
| @@ -109,7 +107,17 @@ | |||||
| <if test=" null != month and '' != month"> | <if test=" null != month and '' != month"> | ||||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||||
| <if test=" null == nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY) | |||||
| and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != merchantIds "> | <if test=" null != merchantIds "> | ||||
| and br.`merchant_id` in | and br.`merchant_id` in | ||||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | ||||
| @@ -122,7 +130,7 @@ | |||||
| <select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="BaseResultMap"> | <select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | ||||
| br.`owe`,br.`status`,br.shop_name,br.`updatetime`,br.`return_price`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`, | |||||
| br.`status`,br.shop_name,br.`updatetime`,br.`return_price`,br.`merchant_id`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`, | |||||
| br.shop_id,br.name,br.comments,br.`rent_shop_type`,br.pay_way,br.`starttime`,br.`endtime`,br.freeze,br.service_charge_pay,'其他押金' bill_type_name,CONCAT(`name`,',',`comments`) bill_remark | br.shop_id,br.name,br.comments,br.`rent_shop_type`,br.pay_way,br.`starttime`,br.`endtime`,br.freeze,br.service_charge_pay,'其他押金' bill_type_name,CONCAT(`name`,',',`comments`) bill_remark | ||||
| from wx_bill_other_deposit br | from wx_bill_other_deposit br | ||||
| <include refid="queryBillListConditions"/> | <include refid="queryBillListConditions"/> | ||||
| @@ -133,10 +141,9 @@ | |||||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | ||||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | ||||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | <result column="paid" jdbcType="VARCHAR" property="paid" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="SumBaseResultMap"> | <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="SumBaseResultMap"> | ||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_other_deposit br | |||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_other_deposit br | |||||
| <include refid="queryBillListConditions"/> | <include refid="queryBillListConditions"/> | ||||
| </select> | </select> | ||||
| @@ -145,6 +152,17 @@ | |||||
| <include refid="queryBillListConditions"/> | <include refid="queryBillListConditions"/> | ||||
| </select> | </select> | ||||
| <resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify"> | |||||
| <result column="total_count" jdbcType="INTEGER" property="totalCount"/> | |||||
| <result column="total_money" jdbcType="VARCHAR" property="totalMoney" /> | |||||
| <result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/> | |||||
| </resultMap> | |||||
| <select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultMap="HotNotifyBaseResultMap"> | |||||
| select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_other_deposit br | |||||
| <include refid="queryBillListConditions"/> | |||||
| </select> | |||||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | <update id="updateNotPaidStatus" parameterType="hashmap"> | ||||
| update wx_bill_other_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | update wx_bill_other_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | ||||
| where status!=#{paid} | where status!=#{paid} | ||||
| @@ -11,7 +11,6 @@ | |||||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> | <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> | ||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | ||||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> | <result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | ||||
| <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | ||||
| @@ -40,7 +39,7 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | `id`,`tenant_id`,`parent_tenant_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`, | ||||
| `owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`name`,`comments`, | |||||
| `status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`shop_name`,`updatetime`,`name`,`comments`, | |||||
| `rent_shop_type`,`pay_way`,`starttime`,`endtime`,endtime,service_charge_pay,`apply_status`,`apply_pay_img`,`apply_update_time`, | `rent_shop_type`,`pay_way`,`starttime`,`endtime`,endtime,service_charge_pay,`apply_status`,`apply_pay_img`,`apply_update_time`, | ||||
| '其他费用' bill_type_name, CONCAT(`name`,',',`comments`) bill_remark | '其他费用' bill_type_name, CONCAT(`name`,',',`comments`) bill_remark | ||||
| </sql> | </sql> | ||||
| @@ -60,7 +59,6 @@ | |||||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | ||||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | <if test=" null != createtime "> and `createtime` = #{createtime} </if> | ||||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | ||||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||||
| <if test=" null != status "> and `status` = #{status} </if> | <if test=" null != status "> and `status` = #{status} </if> | ||||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | <if test=" null != isDel "> and `is_del` = #{isDel} </if> | ||||
| @@ -105,7 +103,17 @@ | |||||
| <if test=" null != month and '' != month"> | <if test=" null != month and '' != month"> | ||||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||||
| <if test=" null == nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY) | |||||
| and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != merchantIds "> | <if test=" null != merchantIds "> | ||||
| and br.`merchant_id` in | and br.`merchant_id` in | ||||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | ||||
| @@ -118,7 +126,7 @@ | |||||
| <select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOther" resultMap="BaseResultMap"> | <select id="queryBillList" parameterType="com.iformall.domain.po.WxBillOther" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`, br.`pay_date`,br.`createtime`,br.`expired_day`, | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`, br.`pay_date`,br.`createtime`,br.`expired_day`, | ||||
| case when br.status=1 then br.owe else 0 end owe,br.`status`,br.shop_name,br.`updatetime`,br.`apply_status`, | |||||
| br.`status`,br.shop_name,br.`updatetime`,br.`apply_status`, | |||||
| br.`apply_pay_img`,br.`apply_update_time`,br.`merchant_id`,br.shop_id,br.name,br.comments,br.`rent_shop_type`, | br.`apply_pay_img`,br.`apply_update_time`,br.`merchant_id`,br.shop_id,br.name,br.comments,br.`rent_shop_type`, | ||||
| br.pay_way,br.`starttime`,br.`endtime`,br.freeze,br.service_charge_pay,'其他费用' bill_type_name, CONCAT(br.`name`,',',br.`comments`) bill_remark | br.pay_way,br.`starttime`,br.`endtime`,br.freeze,br.service_charge_pay,'其他费用' bill_type_name, CONCAT(br.`name`,',',br.`comments`) bill_remark | ||||
| from wx_bill_other br | from wx_bill_other br | ||||
| @@ -130,10 +138,9 @@ | |||||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | ||||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | ||||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | <result column="paid" jdbcType="VARCHAR" property="paid" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillOther" resultMap="SumBaseResultMap"> | <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillOther" resultMap="SumBaseResultMap"> | ||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_other br | |||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_other br | |||||
| <include refid="queryBillListConditions"/> | <include refid="queryBillListConditions"/> | ||||
| </select> | </select> | ||||
| @@ -141,6 +148,16 @@ | |||||
| select distinct merchant_id from wx_bill_other br | select distinct merchant_id from wx_bill_other br | ||||
| <include refid="queryBillListConditions"/> | <include refid="queryBillListConditions"/> | ||||
| </select> | </select> | ||||
| <resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify"> | |||||
| <result column="total_count" jdbcType="INTEGER" property="totalCount"/> | |||||
| <result column="total_money" jdbcType="VARCHAR" property="totalMoney" /> | |||||
| <result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/> | |||||
| </resultMap> | |||||
| <select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillOther" resultMap="HotNotifyBaseResultMap"> | |||||
| select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_other br | |||||
| <include refid="queryBillListConditions"/> | |||||
| </select> | |||||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | <update id="updateNotPaidStatus" parameterType="hashmap"> | ||||
| update wx_bill_other set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | update wx_bill_other set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | ||||
| @@ -195,7 +212,7 @@ | |||||
| <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from | select IFNULL(round(sum(res.owe)/100,2),0) owe,res.tenant_id from | ||||
| ( | ( | ||||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_daily | |||||
| select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_daily | |||||
| where status = 1 | where status = 1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| @@ -205,7 +222,7 @@ | |||||
| </if> | </if> | ||||
| and receive_date between #{startdate} and #{enddate} | and receive_date between #{startdate} and #{enddate} | ||||
| union all | union all | ||||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_daily | |||||
| select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_daily | |||||
| where status = 1 | where status = 1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| @@ -12,7 +12,6 @@ | |||||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> | <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> | ||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | ||||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> | <result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | ||||
| <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | ||||
| @@ -37,7 +36,7 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`, | `id`,`tenant_id`,`parent_tenant_id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`, | ||||
| `pay_date`,`createtime`,`expired_day`,`owe`,`status`,`is_del`,`need_pay`,`apply_status`,`apply_pay_img`,`apply_update_time`, | |||||
| `pay_date`,`createtime`,`expired_day`,`status`,`is_del`,`need_pay`,`apply_status`,`apply_pay_img`,`apply_update_time`, | |||||
| `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`return_price`,`shop_info`,`pay_way`,freeze,service_charge_pay, | `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`return_price`,`shop_info`,`pay_way`,freeze,service_charge_pay, | ||||
| '物业押金' bill_type_name,'' bill_remark | '物业押金' bill_type_name,'' bill_remark | ||||
| </sql> | </sql> | ||||
| @@ -58,7 +57,6 @@ | |||||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | ||||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | <if test=" null != createtime "> and `createtime` = #{createtime} </if> | ||||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | ||||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||||
| <if test=" null != status "> and `status` = #{status} </if> | <if test=" null != status "> and `status` = #{status} </if> | ||||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | <if test=" null != isDel "> and `is_del` = #{isDel} </if> | ||||
| @@ -116,7 +114,17 @@ | |||||
| <if test=" null != month and '' != month"> | <if test=" null != month and '' != month"> | ||||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||||
| <if test=" null == nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY) | |||||
| and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != merchantIds "> | <if test=" null != merchantIds "> | ||||
| and br.`merchant_id` in | and br.`merchant_id` in | ||||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | ||||
| @@ -127,7 +135,7 @@ | |||||
| </sql> | </sql> | ||||
| <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="BaseResultMap"> | <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,br.`owe`,br.`status`, | |||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`,br.`status`, | |||||
| br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`return_price`,br.`shop_info`,br.pay_way, | br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`return_price`,br.`shop_info`,br.pay_way, | ||||
| br.freeze,br.service_charge_pay,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,'物业押金' bill_type_name,'' bill_remark | br.freeze,br.service_charge_pay,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,'物业押金' bill_type_name,'' bill_remark | ||||
| from wx_bill_property_deposit br | from wx_bill_property_deposit br | ||||
| @@ -138,10 +146,9 @@ | |||||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | ||||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | ||||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | <result column="paid" jdbcType="VARCHAR" property="paid" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="SumBaseResultMap"> | <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="SumBaseResultMap"> | ||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_property_deposit br | |||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_property_deposit br | |||||
| <include refid="queryBillDepositListConditions"/> | <include refid="queryBillDepositListConditions"/> | ||||
| </select> | </select> | ||||
| @@ -150,6 +157,16 @@ | |||||
| <include refid="queryBillDepositListConditions"/> | <include refid="queryBillDepositListConditions"/> | ||||
| </select> | </select> | ||||
| <resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify"> | |||||
| <result column="total_count" jdbcType="INTEGER" property="totalCount"/> | |||||
| <result column="total_money" jdbcType="VARCHAR" property="totalMoney" /> | |||||
| <result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/> | |||||
| </resultMap> | |||||
| <select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="HotNotifyBaseResultMap"> | |||||
| select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_property_deposit br | |||||
| <include refid="queryBillDepositListConditions"/> | |||||
| </select> | |||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL((sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property_deposit | select IFNULL((sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property_deposit | ||||
| where date_format(receive_date,'%Y-%m')=#{receiveDate} | where date_format(receive_date,'%Y-%m')=#{receiveDate} | ||||
| @@ -12,7 +12,6 @@ | |||||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | ||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | ||||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay"/> | <result column="expired_day" jdbcType="INTEGER" property="expiredDay"/> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | <result column="status" jdbcType="INTEGER" property="status"/> | ||||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | ||||
| <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | ||||
| @@ -52,7 +51,7 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | `id`,`tenant_id`,`parent_tenant_id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | ||||
| `createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`, | |||||
| `createtime`,`expired_day`,`tenant_id`,`status`,`is_del`,`need_pay`, | |||||
| `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`apply_status`,`apply_pay_img`,`apply_update_time`, | `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`apply_status`,`apply_pay_img`,`apply_update_time`, | ||||
| `revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`, | `revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`, | ||||
| `pay_way`,`late_pay_status`,`comments`,starttime,endtime,freeze,service_charge_pay,'物业费' bill_type_name,'' bill_remark | `pay_way`,`late_pay_status`,`comments`,starttime,endtime,freeze,service_charge_pay,'物业费' bill_type_name,'' bill_remark | ||||
| @@ -74,7 +73,6 @@ | |||||
| <if test=" null != payDate ">and `pay_date` = #{payDate}</if> | <if test=" null != payDate ">and `pay_date` = #{payDate}</if> | ||||
| <if test=" null != createtime ">and `createtime` = #{createtime}</if> | <if test=" null != createtime ">and `createtime` = #{createtime}</if> | ||||
| <if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if> | <if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if> | ||||
| <if test=" null != owe ">and `owe` = #{owe}</if> | |||||
| <if test=" null != status ">and `status` = #{status}</if> | <if test=" null != status ">and `status` = #{status}</if> | ||||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != isDel ">and `is_del` = #{isDel}</if> | <if test=" null != isDel ">and `is_del` = #{isDel}</if> | ||||
| @@ -136,7 +134,17 @@ | |||||
| <if test=" null != month and '' != month"> | <if test=" null != month and '' != month"> | ||||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||||
| <if test=" null == nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY) | |||||
| and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | ||||
| <if test=" null != propertyContractId ">and br.`property_contract_id` = #{propertyContractId}</if> | <if test=" null != propertyContractId ">and br.`property_contract_id` = #{propertyContractId}</if> | ||||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | ||||
| @@ -161,7 +169,7 @@ | |||||
| <select id="queryBillPropertyList" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="BaseResultMap"> | <select id="queryBillPropertyList" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | ||||
| case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`period`, | |||||
| br.`status`,br.`need_pay`,br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`period`, | |||||
| br.`revenue`,br.`late_pay_time`,br.`property_contract_id`,br.late_pay_price,br.`shop_info`,br.pay_way,br.late_pay_status, | br.`revenue`,br.`late_pay_time`,br.`property_contract_id`,br.late_pay_price,br.`shop_info`,br.pay_way,br.late_pay_status, | ||||
| br.`comments`,br.starttime,br.endtime,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,br.freeze,br.service_charge_pay, | br.`comments`,br.starttime,br.endtime,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,br.freeze,br.service_charge_pay, | ||||
| br.`late_pay_ratio`,'物业费' bill_type_name,'' bill_remark | br.`late_pay_ratio`,'物业费' bill_type_name,'' bill_remark | ||||
| @@ -179,10 +187,9 @@ | |||||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | ||||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | ||||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | <result column="paid" jdbcType="VARCHAR" property="paid" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="SumBaseResultMap"> | <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="SumBaseResultMap"> | ||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_property br | |||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_property br | |||||
| <include refid="queryBillPropertyListConditions"/> | <include refid="queryBillPropertyListConditions"/> | ||||
| </select> | </select> | ||||
| @@ -190,6 +197,16 @@ | |||||
| select distinct merchant_id from wx_bill_property br | select distinct merchant_id from wx_bill_property br | ||||
| <include refid="queryBillPropertyListConditions"/> | <include refid="queryBillPropertyListConditions"/> | ||||
| </select> | </select> | ||||
| <resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify"> | |||||
| <result column="total_count" jdbcType="INTEGER" property="totalCount"/> | |||||
| <result column="total_money" jdbcType="VARCHAR" property="totalMoney" /> | |||||
| <result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/> | |||||
| </resultMap> | |||||
| <select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="HotNotifyBaseResultMap"> | |||||
| select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_property br | |||||
| <include refid="queryBillPropertyListConditions"/> | |||||
| </select> | |||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property | select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property | ||||
| @@ -219,7 +236,7 @@ | |||||
| <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_property | |||||
| select IFNULL(sum(receive_pay - pay),0) owe,tenant_id from wx_bill_property | |||||
| where status = 1 | where status = 1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| @@ -279,7 +296,7 @@ | |||||
| <update id="updateForReceivePay" parameterType="com.iformall.domain.po.WxBillProperty"> | <update id="updateForReceivePay" parameterType="com.iformall.domain.po.WxBillProperty"> | ||||
| update wx_bill_property set updatetime = now() | update wx_bill_property set updatetime = now() | ||||
| <if test=" null != receivePay ">,receive_pay = #{receivePay},owe=#{receivePay}</if> | |||||
| <if test=" null != receivePay ">,receive_pay = #{receivePay}</if> | |||||
| <if test=" null != comments ">,comments = #{comments}</if> | <if test=" null != comments ">,comments = #{comments}</if> | ||||
| <if test=" null != receiveDate ">,receive_date = #{receiveDate}</if> | <if test=" null != receiveDate ">,receive_date = #{receiveDate}</if> | ||||
| <if test="0 == receivePay or 0l == receivePay">,status = 3,pay_date=now()</if> | <if test="0 == receivePay or 0l == receivePay">,status = 3,pay_date=now()</if> | ||||
| @@ -287,8 +304,7 @@ | |||||
| </update> | </update> | ||||
| <update id="updatePreviewStatus" parameterType="com.iformall.domain.po.WxBillProperty"> | <update id="updatePreviewStatus" parameterType="com.iformall.domain.po.WxBillProperty"> | ||||
| update wx_bill_property set is_preview = #{isPreview},merchant_id = #{merchantId},need_pay = receive_pay, | |||||
| owe=receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay | |||||
| update wx_bill_property set is_preview = #{isPreview},merchant_id = #{merchantId},need_pay = receive_pay | |||||
| where property_contract_id = #{propertyContractId} | where property_contract_id = #{propertyContractId} | ||||
| </update> | </update> | ||||
| @@ -301,7 +317,7 @@ | |||||
| <insert id="insertBills" parameterType="java.util.List"> | <insert id="insertBills" parameterType="java.util.List"> | ||||
| INSERT INTO wx_bill_property (id,property_contract_id, receive_pay, pay, receive_date, pay_date, createtime, | INSERT INTO wx_bill_property (id,property_contract_id, receive_pay, pay, receive_date, pay_date, createtime, | ||||
| expired_day, | expired_day, | ||||
| tenant_id, parent_tenant_id, owe, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, | |||||
| tenant_id, parent_tenant_id, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, | |||||
| endtime, | endtime, | ||||
| rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info, | rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info, | ||||
| pay_way, late_pay_status, comments,service_charge_pay) | pay_way, late_pay_status, comments,service_charge_pay) | ||||
| @@ -310,7 +326,7 @@ | |||||
| ( | ( | ||||
| #{item.id},#{item.propertyContractId},#{item.receivePay},#{item.pay},#{item.receiveDate},#{item.payDate},#{item.createtime}, | #{item.id},#{item.propertyContractId},#{item.receivePay},#{item.pay},#{item.receiveDate},#{item.payDate},#{item.createtime}, | ||||
| #{item.expiredDay},#{item.tenantId},#{item.parentTenantId}, | #{item.expiredDay},#{item.tenantId},#{item.parentTenantId}, | ||||
| #{item.owe},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId}, | |||||
| #{item.status},#{item.isDel},#{item.needPay},#{item.merchantId}, | |||||
| #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue}, | #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue}, | ||||
| #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo}, | #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo}, | ||||
| #{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay} | #{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay} | ||||
| @@ -346,11 +362,11 @@ | |||||
| CONCAT('系统计入', | CONCAT('系统计入', | ||||
| if(b.late_pay_price is null, | if(b.late_pay_price is null, | ||||
| round( | round( | ||||
| b.owe * c.late_pay_ratio * DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) /10000 | |||||
| c.late_pay_ratio * DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) /10000 | |||||
| ,2) | ,2) | ||||
| , | , | ||||
| round( | round( | ||||
| b.owe * (c.late_pay_ratio) /10000 | |||||
| (c.late_pay_ratio) /10000 | |||||
| ,2) | ,2) | ||||
| ) | ) | ||||
| ,'元') details,b.tenant_id,b.parent_tenant_id | ,'元') details,b.tenant_id,b.parent_tenant_id | ||||
| @@ -364,13 +380,13 @@ | |||||
| update wx_bill_property b set b.late_pay_price = | update wx_bill_property b set b.late_pay_price = | ||||
| if(b.late_pay_price is null, | if(b.late_pay_price is null, | ||||
| round( | round( | ||||
| b.owe * (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) | |||||
| (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) | |||||
| * DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_property_contract where id = b.`property_contract_id`) day)) /100 | * DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_property_contract where id = b.`property_contract_id`) day)) /100 | ||||
| ,2) | ,2) | ||||
| , | , | ||||
| b.late_pay_price + | b.late_pay_price + | ||||
| round( | round( | ||||
| b.owe * (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) /100 | |||||
| (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) /100 | |||||
| ,2) | ,2) | ||||
| ) | ) | ||||
| where b.status!=3 and b.status!=6 | where b.status!=3 and b.status!=6 | ||||
| @@ -380,7 +396,7 @@ | |||||
| <update id="updateServiceCharge" parameterType="com.iformall.domain.po.WxPayAccountBill"> | <update id="updateServiceCharge" parameterType="com.iformall.domain.po.WxPayAccountBill"> | ||||
| update wx_bill_property | update wx_bill_property | ||||
| set service_charge_pay=round(receive_pay*#{serviceChargeRate}/10000),owe=receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay | |||||
| set service_charge_pay=round(receive_pay*#{serviceChargeRate}/10000) | |||||
| where service_charge_pay=0 and status in(1,2,4) | where service_charge_pay=0 and status in(1,2,4) | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| @@ -390,11 +406,11 @@ | |||||
| </if> | </if> | ||||
| </update> | </update> | ||||
| <update id="updateOwe"> | |||||
| <!-- <update id="updateOwe"> | |||||
| update wx_bill_property | update wx_bill_property | ||||
| set owe = receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay | set owe = receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay | ||||
| where status in (1,2,4) | where status in (1,2,4) | ||||
| </update> | |||||
| </update> --> | |||||
| </mapper> | </mapper> | ||||
| @@ -12,7 +12,6 @@ | |||||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | ||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | ||||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay"/> | <result column="expired_day" jdbcType="INTEGER" property="expiredDay"/> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | <result column="status" jdbcType="INTEGER" property="status"/> | ||||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | ||||
| <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | ||||
| @@ -45,7 +44,7 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | ||||
| `createtime`,`expired_day`,`owe`,`status`,`apply_status`,`apply_pay_img`,`apply_update_time`,`is_del`,`need_pay`, | |||||
| `createtime`,`expired_day`,`status`,`apply_status`,`apply_pay_img`,`apply_update_time`,`is_del`,`need_pay`, | |||||
| `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`, | `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`, | ||||
| `period`,`shop_info`,`pay_way`,`late_pay_status`,starttime,endtime,freeze,service_charge_pay,manage_fee_type, | `period`,`shop_info`,`pay_way`,`late_pay_status`,starttime,endtime,freeze,service_charge_pay,manage_fee_type, | ||||
| case manage_fee_type when 1 then '商业管理费' when 2 then '运营管理费' else '管理费' end bill_type_name,'' bill_remark | case manage_fee_type when 1 then '商业管理费' when 2 then '运营管理费' else '管理费' end bill_type_name,'' bill_remark | ||||
| @@ -67,7 +66,6 @@ | |||||
| <if test=" null != payDate ">and `pay_date` = #{payDate}</if> | <if test=" null != payDate ">and `pay_date` = #{payDate}</if> | ||||
| <if test=" null != createtime ">and `createtime` = #{createtime}</if> | <if test=" null != createtime ">and `createtime` = #{createtime}</if> | ||||
| <if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if> | <if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if> | ||||
| <if test=" null != owe ">and `owe` = #{owe}</if> | |||||
| <if test=" null != status ">and `status` = #{status}</if> | <if test=" null != status ">and `status` = #{status}</if> | ||||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != isDel ">and `is_del` = #{isDel}</if> | <if test=" null != isDel ">and `is_del` = #{isDel}</if> | ||||
| @@ -124,7 +122,17 @@ | |||||
| <if test=" null != month and '' != month"> | <if test=" null != month and '' != month"> | ||||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||||
| <if test=" null == nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY) | |||||
| and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != manageFeeType ">and br.`manage_fee_type` = #{manageFeeType}</if> | <if test=" null != manageFeeType ">and br.`manage_fee_type` = #{manageFeeType}</if> | ||||
| <if test=" null != hasMerchant ">and br.`merchant_id` is not null</if> | <if test=" null != hasMerchant ">and br.`merchant_id` is not null</if> | ||||
| @@ -139,7 +147,7 @@ | |||||
| <select id="queryBillManageList" parameterType="com.iformall.domain.po.WxBillRentManage" resultMap="BaseResultMap"> | <select id="queryBillManageList" parameterType="com.iformall.domain.po.WxBillRentManage" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | ||||
| case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`need_pay`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`, | |||||
| br.`status`,br.`need_pay`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`, | |||||
| br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`, | br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`, | ||||
| br.late_pay_price,br.shop_info,br.pay_way,br.late_pay_status,br.starttime,br.endtime, | br.late_pay_price,br.shop_info,br.pay_way,br.late_pay_status,br.starttime,br.endtime, | ||||
| br.freeze,br.service_charge_pay,br.manage_fee_type,br.`late_pay_ratio`, | br.freeze,br.service_charge_pay,br.manage_fee_type,br.`late_pay_ratio`, | ||||
| @@ -155,10 +163,9 @@ | |||||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | ||||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | ||||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | <result column="paid" jdbcType="VARCHAR" property="paid" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillRentManage" resultMap="SumBaseResultMap"> | <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillRentManage" resultMap="SumBaseResultMap"> | ||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_rent_manage br | |||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_rent_manage br | |||||
| <include refid="queryBillManageListConditions"/> | <include refid="queryBillManageListConditions"/> | ||||
| </select> | </select> | ||||
| @@ -171,6 +178,16 @@ | |||||
| select distinct br.`rent_contract_id` from wx_bill_rent_manage br | select distinct br.`rent_contract_id` from wx_bill_rent_manage br | ||||
| <include refid="queryBillManageListConditions"/> | <include refid="queryBillManageListConditions"/> | ||||
| </select> | </select> | ||||
| <resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify"> | |||||
| <result column="total_count" jdbcType="INTEGER" property="totalCount"/> | |||||
| <result column="total_money" jdbcType="VARCHAR" property="totalMoney" /> | |||||
| <result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/> | |||||
| </resultMap> | |||||
| <select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillRentManage" resultMap="HotNotifyBaseResultMap"> | |||||
| select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_rent_manage br | |||||
| <include refid="queryBillManageListConditions"/> | |||||
| </select> | |||||
| <select id="queryPayInfoTotal" resultType="hashmap" parameterType="hashmap"> | <select id="queryPayInfoTotal" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent_manage | select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent_manage | ||||
| @@ -229,7 +246,7 @@ | |||||
| <insert id="insertBills" parameterType="java.util.List"> | <insert id="insertBills" parameterType="java.util.List"> | ||||
| INSERT INTO wx_bill_rent_manage (id,tenant_id,parent_tenant_id, | INSERT INTO wx_bill_rent_manage (id,tenant_id,parent_tenant_id, | ||||
| rent_contract_id, receive_pay, pay, receive_date, pay_date, createtime, expired_day, | rent_contract_id, receive_pay, pay, receive_date, pay_date, createtime, expired_day, | ||||
| owe, status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime, | |||||
| status, is_del, need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime, | |||||
| rent_shop_type, late_pay_ratio, late_pay_time, late_pay_price, period, shop_info, | rent_shop_type, late_pay_ratio, late_pay_time, late_pay_price, period, shop_info, | ||||
| pay_way, late_pay_status, service_charge_pay,manage_fee_type) | pay_way, late_pay_status, service_charge_pay,manage_fee_type) | ||||
| VALUES | VALUES | ||||
| @@ -237,7 +254,7 @@ | |||||
| ( | ( | ||||
| #{item.id},#{item.tenantId},#{item.parentTenantId}, | #{item.id},#{item.tenantId},#{item.parentTenantId}, | ||||
| #{item.rentContractId},#{item.receivePay},#{item.pay},#{item.receiveDate},#{item.payDate},#{item.createtime}, | #{item.rentContractId},#{item.receivePay},#{item.pay},#{item.receiveDate},#{item.payDate},#{item.createtime}, | ||||
| #{item.expiredDay},#{item.owe},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId}, | |||||
| #{item.expiredDay},#{item.status},#{item.isDel},#{item.needPay},#{item.merchantId}, | |||||
| #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType}, | #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType}, | ||||
| #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.shopInfo}, | #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.shopInfo}, | ||||
| #{item.payWay},#{item.latePayStatus},#{item.serviceChargePay},#{item.manageFeeType} | #{item.payWay},#{item.latePayStatus},#{item.serviceChargePay},#{item.manageFeeType} | ||||
| @@ -12,7 +12,6 @@ | |||||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | <result column="pay_date" jdbcType="TIMESTAMP" property="payDate"/> | ||||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | ||||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay"/> | <result column="expired_day" jdbcType="INTEGER" property="expiredDay"/> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | <result column="status" jdbcType="INTEGER" property="status"/> | ||||
| <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | <result column="apply_status" jdbcType="INTEGER" property="applyStatus"/> | ||||
| <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | <result column="apply_pay_img" jdbcType="INTEGER" property="applyPayImg"/> | ||||
| @@ -61,7 +60,7 @@ | |||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`, | ||||
| `createtime`,`expired_day`,`owe`,`status`,`is_del`,`contract_need_pay`,`rent_price_info`,`need_pay`,`bussiness_manage_fee_need_pay`,`operating_manage_fee_need_pay`, | |||||
| `createtime`,`expired_day`,`status`,`is_del`,`contract_need_pay`,`rent_price_info`,`need_pay`,`bussiness_manage_fee_need_pay`,`operating_manage_fee_need_pay`, | |||||
| `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`apply_status`,`apply_pay_img`,`apply_update_time`, | `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`apply_status`,`apply_pay_img`,`apply_update_time`, | ||||
| `revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`, | `revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`, | ||||
| `pay_way`,`late_pay_status`,`comments`,starttime,endtime,bus_discount_ratio,freeze,join_rent_price,service_charge_pay,'租金' bill_type_name,'' bill_remark | `pay_way`,`late_pay_status`,`comments`,starttime,endtime,bus_discount_ratio,freeze,join_rent_price,service_charge_pay,'租金' bill_type_name,'' bill_remark | ||||
| @@ -83,7 +82,6 @@ | |||||
| <if test=" null != payDate ">and `pay_date` = #{payDate}</if> | <if test=" null != payDate ">and `pay_date` = #{payDate}</if> | ||||
| <if test=" null != createtime ">and `createtime` = #{createtime}</if> | <if test=" null != createtime ">and `createtime` = #{createtime}</if> | ||||
| <if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if> | <if test=" null != expiredDay ">and `expired_day` = #{expiredDay}</if> | ||||
| <if test=" null != owe ">and `owe` = #{owe}</if> | |||||
| <if test=" null != status ">and `status` = #{status}</if> | <if test=" null != status ">and `status` = #{status}</if> | ||||
| <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | <if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if> | ||||
| <if test=" null != isDel ">and `is_del` = #{isDel}</if> | <if test=" null != isDel ">and `is_del` = #{isDel}</if> | ||||
| @@ -141,7 +139,17 @@ | |||||
| <if test=" null != month and '' != month"> | <if test=" null != month and '' != month"> | ||||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | ||||
| </if> | </if> | ||||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||||
| <if test=" null == nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.`receive_pay` - br.`pay` > 0 and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != nearBillBeforeDays and null != oweBillBeforeDays"> | |||||
| and (br.`starttime` >= DATE_SUB(NOW(),INTERVAL #{nearBillBeforeDays} DAY) | |||||
| and br.`starttime` < DATE_SUB(NOW(),INTERVAL #{oweBillBeforeDays} DAY) | |||||
| and br.status not in (3,6) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != rentContractIdList "> | <if test=" null != rentContractIdList "> | ||||
| and br.`rent_contract_id` in | and br.`rent_contract_id` in | ||||
| <foreach collection="rentContractIdList" index="index" item="ridItem" open="(" separator="," close=")"> | <foreach collection="rentContractIdList" index="index" item="ridItem" open="(" separator="," close=")"> | ||||
| @@ -159,7 +167,7 @@ | |||||
| <select id="queryBillRentList" parameterType="com.iformall.domain.po.WxBillRent" resultMap="BaseResultMap"> | <select id="queryBillRentList" parameterType="com.iformall.domain.po.WxBillRent" resultMap="BaseResultMap"> | ||||
| select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | select br.`id`,br.`receive_pay`,br.`pay`,br.`receive_date`,br.`pay_date`,br.`createtime`,br.`expired_day`, | ||||
| case when br.status=1 then br.owe else 0 end owe,br.`status`,br.`contract_need_pay`,br.`rent_price_info`,br.`need_pay`,br.`bussiness_manage_fee_need_pay`,br.`operating_manage_fee_need_pay`, | |||||
| br.`status`,br.`contract_need_pay`,br.`rent_price_info`,br.`need_pay`,br.`bussiness_manage_fee_need_pay`,br.`operating_manage_fee_need_pay`, | |||||
| br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,br.`revenue`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`, | br.`updatetime`,br.`merchant_id`,br.`rent_shop_type`,br.`apply_status`,br.`apply_pay_img`,br.`apply_update_time`,br.`revenue`,br.`late_pay_time`,br.`period`,br.`rent_contract_id`, | ||||
| br.late_pay_price,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime,br.bus_discount_ratio,br.freeze,br.join_rent_price,br.service_charge_pay, | br.late_pay_price,br.shop_info,br.pay_way,br.late_pay_status,br.`comments`,br.starttime,br.endtime,br.bus_discount_ratio,br.freeze,br.join_rent_price,br.service_charge_pay, | ||||
| '租金' bill_type_name,'' bill_remark | '租金' bill_type_name,'' bill_remark | ||||
| @@ -179,10 +187,9 @@ | |||||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | ||||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | ||||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | <result column="paid" jdbcType="VARCHAR" property="paid" /> | ||||
| <result column="owe" jdbcType="VARCHAR" property="owe"/> | |||||
| </resultMap> | </resultMap> | ||||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillRent" resultMap="SumBaseResultMap"> | <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillRent" resultMap="SumBaseResultMap"> | ||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_rent br | |||||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid from wx_bill_rent br | |||||
| <include refid="queryBillRentListCondition"/> | <include refid="queryBillRentListCondition"/> | ||||
| </select> | </select> | ||||
| @@ -191,6 +198,16 @@ | |||||
| <include refid="queryBillRentListCondition"/> | <include refid="queryBillRentListCondition"/> | ||||
| </select> | </select> | ||||
| <resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify"> | |||||
| <result column="total_count" jdbcType="INTEGER" property="totalCount"/> | |||||
| <result column="total_money" jdbcType="VARCHAR" property="totalMoney" /> | |||||
| <result column="min_begin_time" jdbcType="TIMESTAMP" property="minBeginTime"/> | |||||
| </resultMap> | |||||
| <select id="getBillHotNotify" parameterType="com.iformall.domain.po.WxBillRent" resultMap="HotNotifyBaseResultMap"> | |||||
| select count(1) total_count , sum(br.`receive_pay` - br.`pay`) total_money,MIN(br.starttime) min_begin_time from wx_bill_rent br | |||||
| <include refid="queryBillRentListCondition"/> | |||||
| </select> | |||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent | select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent | ||||
| where is_preview = 0 | where is_preview = 0 | ||||
| @@ -229,7 +246,7 @@ | |||||
| <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | <select id="queryOweInfo" resultType="hashmap" parameterType="hashmap"> | ||||
| select IFNULL(sum(owe),0) owe,tenant_id from wx_bill_rent | |||||
| select IFNULL(sum(receive_pay-pay),0) owe,tenant_id from wx_bill_rent | |||||
| where status = 1 | where status = 1 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| @@ -289,8 +306,7 @@ | |||||
| </update> | </update> | ||||
| <update id="updatePreviewStatus" parameterType="com.iformall.domain.po.WxBillRent"> | <update id="updatePreviewStatus" parameterType="com.iformall.domain.po.WxBillRent"> | ||||
| update wx_bill_rent set is_preview = #{isPreview},merchant_id = #{merchantId},need_pay = receive_pay, | |||||
| owe=receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay | |||||
| update wx_bill_rent set is_preview = #{isPreview},merchant_id = #{merchantId},need_pay = receive_pay | |||||
| where rent_contract_id = #{rentContractId} | where rent_contract_id = #{rentContractId} | ||||
| </update> | </update> | ||||
| @@ -302,7 +318,7 @@ | |||||
| <insert id="insertBills" parameterType="java.util.List"> | <insert id="insertBills" parameterType="java.util.List"> | ||||
| INSERT INTO wx_bill_rent (id,tenant_id,parent_tenant_id, | INSERT INTO wx_bill_rent (id,tenant_id,parent_tenant_id, | ||||
| rent_contract_id, receive_pay, pay, receive_date, pay_date, createtime, expired_day, | rent_contract_id, receive_pay, pay, receive_date, pay_date, createtime, expired_day, | ||||
| owe, status, is_del, contract_need_pay,rent_price_info,need_pay,bussiness_manage_fee_need_pay,operating_manage_fee_need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime, | |||||
| status, is_del, contract_need_pay,rent_price_info,need_pay,bussiness_manage_fee_need_pay,operating_manage_fee_need_pay, merchant_id, user_id, shop_id, updatetime, starttime, endtime, | |||||
| rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info, | rent_shop_type, revenue, late_pay_ratio, late_pay_time, late_pay_price, period, is_preview, shop_info, | ||||
| pay_way, late_pay_status, comments,service_charge_pay) | pay_way, late_pay_status, comments,service_charge_pay) | ||||
| VALUES | VALUES | ||||
| @@ -310,7 +326,7 @@ | |||||
| ( | ( | ||||
| #{item.id},#{item.tenantId},#{item.parentTenantId}, | #{item.id},#{item.tenantId},#{item.parentTenantId}, | ||||
| #{item.rentContractId},#{item.receivePay},#{item.pay},#{item.receiveDate},#{item.payDate},#{item.createtime}, | #{item.rentContractId},#{item.receivePay},#{item.pay},#{item.receiveDate},#{item.payDate},#{item.createtime}, | ||||
| #{item.expiredDay},#{item.owe},#{item.status},#{item.isDel},#{item.contractNeedPay},#{item.rentPriceInfo},#{item.needPay},#{item.bussinessManageFeeNeedPay},#{item.operatingManageFeeNeedPay},#{item.merchantId}, | |||||
| #{item.expiredDay},#{item.status},#{item.isDel},#{item.contractNeedPay},#{item.rentPriceInfo},#{item.needPay},#{item.bussinessManageFeeNeedPay},#{item.operatingManageFeeNeedPay},#{item.merchantId}, | |||||
| #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue}, | #{item.userId},#{item.shopId},#{item.updatetime},#{item.starttime},#{item.endtime},#{item.rentShopType},#{item.revenue}, | ||||
| #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo}, | #{item.latePayRatio},#{item.latePayTime},#{item.latePayPrice},#{item.period},#{item.isPreview},#{item.shopInfo}, | ||||
| #{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay} | #{item.payWay},#{item.latePayStatus},#{item.comments},#{item.serviceChargePay} | ||||
| @@ -346,11 +362,11 @@ | |||||
| CONCAT('系统计入', | CONCAT('系统计入', | ||||
| if(b.late_pay_price is null, | if(b.late_pay_price is null, | ||||
| round( | round( | ||||
| b.owe * c.late_pay_ratio * DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) /10000 | |||||
| c.late_pay_ratio * DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) /10000 | |||||
| ,2) | ,2) | ||||
| , | , | ||||
| round( | round( | ||||
| b.owe * (c.late_pay_ratio) /10000 | |||||
| (c.late_pay_ratio) /10000 | |||||
| ,2) | ,2) | ||||
| ) | ) | ||||
| ,'元') details,b.tenant_id,b.parent_tenant_id | ,'元') details,b.tenant_id,b.parent_tenant_id | ||||
| @@ -364,13 +380,13 @@ | |||||
| update wx_bill_rent b set b.late_pay_price = | update wx_bill_rent b set b.late_pay_price = | ||||
| if(b.late_pay_price is null, | if(b.late_pay_price is null, | ||||
| round( | round( | ||||
| b.owe * (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) | |||||
| (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) | |||||
| * DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_rent_contract where id = b.`rent_contract_id`) day)) /100 | * DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_rent_contract where id = b.`rent_contract_id`) day)) /100 | ||||
| ,2) | ,2) | ||||
| , | , | ||||
| b.late_pay_price + | b.late_pay_price + | ||||
| round( | round( | ||||
| b.owe * (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) /100 | |||||
| (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) /100 | |||||
| ,2) | ,2) | ||||
| ) | ) | ||||
| where b.status!=3 and b.status!=6 | where b.status!=3 and b.status!=6 | ||||
| @@ -379,7 +395,7 @@ | |||||
| </update> | </update> | ||||
| <update id="updateServiceCharge" parameterType="com.iformall.domain.po.WxPayAccountBill"> | <update id="updateServiceCharge" parameterType="com.iformall.domain.po.WxPayAccountBill"> | ||||
| update wx_bill_rent set service_charge_pay=round(receive_pay*#{serviceChargeRate}/10000),owe=receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay | |||||
| update wx_bill_rent set service_charge_pay=round(receive_pay*#{serviceChargeRate}/10000) | |||||
| where service_charge_pay=0 | where service_charge_pay=0 | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | and `tenant_id` = #{tenantId} | ||||
| @@ -390,10 +406,11 @@ | |||||
| and status in(1,2,4) | and status in(1,2,4) | ||||
| </update> | </update> | ||||
| <update id="updateOwe"> | |||||
| <!-- <update id="updateOwe"> | |||||
| update wx_bill_rent set owe = receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay where status in (1,2,4) | update wx_bill_rent set owe = receive_pay + service_charge_pay + ifnull(late_pay_price,0) - pay where status in (1,2,4) | ||||
| </update> | |||||
| </update> --> | |||||
| </mapper> | </mapper> | ||||