| @@ -155,7 +155,7 @@ public class WxAllBillController extends BillBaseController { | |||
| vo.setShopNumber(billAllHelper.getMerchantShopNumber(m)); | |||
| wxMerchant.setId(m.getId()); | |||
| wxMerchant.setBillStatus(billStaus); | |||
| //wxMerchant.setBillStatus(billStaus); | |||
| WxBillSum rentSum = billAllHelper.getBillSum(wxMerchant,starttime, enttime); | |||
| vo.setNeedPay(rentSum.getNeedPay()); | |||
| vo.setPaid(rentSum.getPaid()); | |||
| @@ -642,17 +642,17 @@ public class WxAllBillController extends BillBaseController { | |||
| //商户待结算账单 | |||
| @GetMapping("settleList") | |||
| public ResultData settleList(@ModelAttribute WxMerchant wxMerchant,Integer billType) { | |||
| wxMerchant.setBillStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| //wxMerchant.setBillStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| return new ResultData(getBillList(wxMerchant, false,getNearBillBeforeDays(), 1, 100)); | |||
| } | |||
| //商户待结算账单 | |||
| @PostMapping("billCompleted") | |||
| public ResultData billCompleted(@ModelAttribute WxMerchant wxMerchant) { | |||
| wxMerchant.setBillCompleteRemark("商户退租结算完成"); | |||
| billAllHelper.completeBill(EnumBillStatus.STOP_TO_SETTLE, wxMerchant, getUser()); | |||
| return new ResultData(); | |||
| } | |||
| // //商户待结算账单 | |||
| // @PostMapping("billCompleted") | |||
| // public ResultData billCompleted(@ModelAttribute WxMerchant wxMerchant) { | |||
| // wxMerchant.setBillCompleteRemark("商户退租结算完成"); | |||
| // billAllHelper.completeBill(EnumBillStatus.STOP_TO_SETTLE, wxMerchant, getUser()); | |||
| // return new ResultData(); | |||
| // } | |||
| //商户可以缴费账单,临期账单以内都可以缴费 | |||
| @GetMapping("merchantPayBills") | |||
| @@ -805,25 +805,5 @@ public class WxAllBillController extends BillBaseController { | |||
| record.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| return new ResultData(wxAllBillService.getBillMonthSum(record)); | |||
| } | |||
| //增加临时费用 | |||
| @PostMapping("addOtherBill") | |||
| public ResultData addOtherBill(@RequestBody WxAllBill record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| if (StringUtils.isBlank(record.getReceivePay()) || new BigDecimal(record.getReceivePay()).compareTo(new BigDecimal(0)) <= 0 ) { | |||
| return new ResultData(Result.ERROR,"请输入正确金额"); | |||
| } | |||
| WxMerchant merchant = wxMerchantService.selectById(record.getMerchantId()); | |||
| record.setMerchantId(merchant.getId()); | |||
| record.setRentShopType(merchant.getRentShopType()); | |||
| record.setNeedPay(record.getReceivePay()); | |||
| record.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| record.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| billAllHelper.saveOrUpdateBill(record, getUser()); | |||
| return new ResultData(); | |||
| //return wxBillAllService.updateReceivePay(wxBillAll, getUser(),false); | |||
| } | |||
| } | |||
| @@ -186,19 +186,19 @@ public class WxAllBill extends TenantEntity { | |||
| return "0"; | |||
| } | |||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "坏账_7", "退租待结算_8","预收待抵扣_9"}, width = 20, orderNum = "10") | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") | |||
| public Integer status; | |||
| @TableField(exist = false) | |||
| private String statusName; | |||
| public String getStatusName() { | |||
| if (null != status) { | |||
| return EnumBillStatus.getEnum(status).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| public List<Integer> statusList; | |||
| // @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "坏账_7", "退租待结算_8","预收待抵扣_9"}, width = 20, orderNum = "10") | |||
| // @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") | |||
| // public Integer status; | |||
| // @TableField(exist = false) | |||
| // private String statusName; | |||
| // public String getStatusName() { | |||
| // if (null != status) { | |||
| // return EnumBillStatus.getEnum(status).getMessage(); | |||
| // } | |||
| // return null; | |||
| // } | |||
| // @TableField(exist = false) | |||
| // public List<Integer> statusList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "费用科目", name = "energyFeesId") | |||
| public Long energyFeesId; | |||
| @@ -208,7 +208,6 @@ public class WxEnergyMeterReading extends TenantEntity { | |||
| daily.setStarttime(this.startTime); | |||
| daily.setEndtime(this.endTime); | |||
| daily.setOwe(needPay); | |||
| daily.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| daily.setShopId(this.shopId); | |||
| daily.setShopNumber(this.shopNumber); | |||
| daily.setBillType(EnumBillAllType.DAILY.getCode()); | |||
| @@ -456,10 +456,6 @@ public class WxMerchant extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private Integer nearBillBeforeDays; | |||
| //账单状态 | |||
| @TableField(exist = false) | |||
| private Integer billStatus; | |||
| //账单完结备注 | |||
| @TableField(exist = false) | |||
| private String billCompleteRemark; | |||
| @@ -50,8 +50,6 @@ public class PrintBillDataHandler implements PrintDataParser{ | |||
| return ""; | |||
| }else if (name.equals("owe")) { | |||
| return receive.getOwe(); | |||
| }else if (name.equals("statusName")) { | |||
| return receive.getStatusName(); | |||
| }else if (name.equals("merchantName")) { | |||
| if (null != merchantMap && null != receive.getMerchantId()) { | |||
| WxMerchant m = merchantMap.get(receive.getMerchantId()); | |||
| @@ -96,7 +96,6 @@ public class WxBillAllHelper { | |||
| if (null != wxMerchant.getNearBillBeforeDays()) { | |||
| bill.setNearBillLastTime(getDateBefore(wxMerchant.getNearBillBeforeDays())); | |||
| } | |||
| bill.setStatus(wxMerchant.getBillStatus()); | |||
| if (null != wxMerchant.getNeedPayPreDays()) { | |||
| bill.setNeedPayStartDay(getDateBefore(wxMerchant.getNeedPayPreDays())); | |||
| } | |||
| @@ -358,45 +357,20 @@ public class WxBillAllHelper { | |||
| */ | |||
| public boolean billEndCalcute(Integer decimalSize,Date endTime,WxAllBill bill,WxBillAction action, boolean isAllReturn) { | |||
| String endTimeStr = DateUtils.date2String(endTime,DateUtils.DATE_TIME_PATTERN); | |||
| boolean isPaid = false; | |||
| if (StringUtils.isNotBlank(bill.getPay()) && new BigDecimal(bill.getPay()).compareTo(new BigDecimal(0)) > 0 ) { | |||
| isPaid = true; | |||
| } | |||
| boolean isUpdate = false; | |||
| action.setBillId(bill.getId()); | |||
| action.setBillType(bill.getBillType()); | |||
| String oldReceivePay = bill.getReceivePay(); | |||
| //如果账单的开始时间在结束时间之后,已经支付了的要退回。 | |||
| if (!bill.getStarttime().before(endTime)) { | |||
| if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue()) { | |||
| EnumBillStatus realBillStatus = EnumBillStatus.INVALID; | |||
| String newReceivePay = bill.getReceivePay(); | |||
| if (isPaid) { | |||
| realBillStatus = EnumBillStatus.STOP_TO_SETTLE; | |||
| bill.setReceivePay("0"); | |||
| newReceivePay = "0"; | |||
| } | |||
| bill.setStatus(realBillStatus.getCode()); | |||
| action.setOldMoney(oldReceivePay); | |||
| action.setNewMoney(newReceivePay); | |||
| action.setAction(EnumBillAction.STATUS_CHANGE.getCode()); | |||
| action.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null, null,null,EnumBillStatus.getEnum(bill.getStatus()),realBillStatus)); | |||
| action.setRemark("商户停用,停用日期["+endTimeStr+"]"+"系统自动变更状态,应收金额变为0"); | |||
| isUpdate = true; | |||
| //如果是已结清,则需退回全部费用 | |||
| }else if (bill.getStatus().intValue() == EnumBillStatus.PAID.getCode().intValue()) { | |||
| bill.setReceivePay("0"); | |||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| action.setOldMoney(oldReceivePay); | |||
| action.setNewMoney("0"); | |||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(bill.getReceivePay(), "0",null, null,null,null)); | |||
| action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); | |||
| isUpdate = true; | |||
| }else { | |||
| //其他状态的账单无需处理 | |||
| } | |||
| bill.setReceivePay("0"); | |||
| bill.setBillRemark(StringUtils.trimToEmpty(bill.getBillRemark())+";终止计费,终止日期["+endTimeStr+"],"); | |||
| action.setOldMoney(oldReceivePay); | |||
| action.setNewMoney("0"); | |||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(bill.getReceivePay(), "0",null, null,null,null)); | |||
| action.setRemark("终止计费,终止日期["+endTimeStr+"],"); | |||
| isUpdate = true; | |||
| //如果结束时间在中间,则按天计算差额退回 | |||
| }else if (bill.getStarttime().before(endTime) && bill.getEndtime().after(endTime)){ | |||
| int realDays = DateUtils.daysBetween(bill.getStarttime(),endTime); | |||
| @@ -407,58 +381,24 @@ public class WxBillAllHelper { | |||
| } | |||
| action.setOldMoney(oldReceivePay); | |||
| action.setNewMoney(newReceivePay); | |||
| //账单有欠费 | |||
| if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue()) { | |||
| bill.setReceivePay(newReceivePay); | |||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, newReceivePay, null,null,null,null)); | |||
| action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); | |||
| isUpdate = true; | |||
| }else if (bill.getStatus().intValue() == EnumBillStatus.PAID.getCode().intValue()) { | |||
| bill.setReceivePay(newReceivePay); | |||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, newReceivePay, null,null,null,null)); | |||
| action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); | |||
| isUpdate = true; | |||
| }else { | |||
| //do nothing | |||
| } | |||
| bill.setReceivePay(newReceivePay); | |||
| bill.setBillRemark(StringUtils.trimToEmpty(bill.getBillRemark())+";终止计费,终止日期["+endTimeStr+"],"); | |||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, newReceivePay, null,null,null,null)); | |||
| action.setRemark("终止计费,终止日期["+endTimeStr+"],"); | |||
| isUpdate = true; | |||
| }else { | |||
| //如果账单属于结束时间之前的,欠缴费的也需要结算 | |||
| if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue()) { | |||
| if (isAllReturn) { | |||
| bill.setReceivePay("0"); | |||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| action.setOldMoney(oldReceivePay); | |||
| action.setNewMoney("0"); | |||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, "0", null,null,null,null)); | |||
| action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); | |||
| }else { | |||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| action.setOldMoney(oldReceivePay); | |||
| action.setNewMoney("0"); | |||
| action.setAction(EnumBillAction.STATUS_CHANGE.getCode()); | |||
| action.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null, null,null,EnumBillStatus.getEnum(bill.getStatus()),EnumBillStatus.STOP_TO_SETTLE)); | |||
| action.setRemark("商户停用,停用日期["+endTimeStr+"]"+"系统自动变更状态"); | |||
| } | |||
| if (isAllReturn) { | |||
| bill.setReceivePay("0"); | |||
| action.setOldMoney(oldReceivePay); | |||
| action.setNewMoney("0"); | |||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, "0", null,null,null,null)); | |||
| action.setRemark("终止计费,终止日期["+endTimeStr+"],"); | |||
| isUpdate = true; | |||
| }else if (bill.getStatus().intValue() == EnumBillStatus.PAID.getCode().intValue()) { | |||
| if (isAllReturn) { | |||
| bill.setReceivePay("0"); | |||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| action.setOldMoney(oldReceivePay); | |||
| action.setNewMoney("0"); | |||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, "0", null,null,null,null)); | |||
| action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); | |||
| isUpdate = true; | |||
| } | |||
| }else { | |||
| //do nothing | |||
| } | |||
| } | |||
| } | |||
| return isUpdate; | |||
| } | |||
| @@ -250,9 +250,8 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| wxBillRent.setUpdateByName(user.getName()); | |||
| if (forcePaid) { | |||
| wxBillRent.setReceivePay(dbBill.getPay()); | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| wxAllBillMapper.updateById(wxBillRent); | |||
| String remark = StringUtils.trimToEmpty(dto.getRemark())+ ";【系统】账单被强制为支付完成,自动归结为结清。"; | |||
| String remark = StringUtils.trimToEmpty(dto.getRemark()); | |||
| this.addBillAction(EnumBillAction.UPDATE_BILL, dto.getBillTypeValue(),dto.getId(), dbBill.getPay(), dbBill.getPay(),null,null,null,null,remark,null,null, user); | |||
| }else { | |||
| if (StringUtils.isNotBlank(dto.getOldLatePrice()) && StringUtils.isNotBlank(dto.getNewLatePrice())) { | |||
| @@ -274,10 +273,8 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| String paywayname = null; | |||
| String remark = StringUtils.trimToEmpty(dto.getRemark()); | |||
| if (new BigDecimal(dto.getNewPrice()).compareTo(new BigDecimal(dbBill.getPay())) <= 0) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| payDate = new Date(); | |||
| payWay = wxFinanceService.getPayWayById(dto, Constant.bill_pay_way_system); | |||
| remark = remark + ";【系统】账单实际应付金额调整至小于等于已付金额,自动归结为结清。"; | |||
| } | |||
| wxAllBillMapper.updateById(wxBillRent); | |||
| //账单日志 | |||
| @@ -365,10 +362,6 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| sb.append(";已付金额增加").append(remainPay.toPlainString()); | |||
| } | |||
| } | |||
| if (opay.compareTo(new BigDecimal(dbBill.getOwe())) >= 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| sb.append(";【系统】账单已付金额已大于等于实际应付金额,自动归结为结清。"); | |||
| } | |||
| } | |||
| String oldSetOff = dbBill.getSetOff(); | |||
| if (StringUtils.isBlank(oldSetOff)) { | |||
| @@ -425,10 +418,6 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| if (StringUtils.isBlank(pay)) { | |||
| pay = "0"; | |||
| } | |||
| BigDecimal needReturn = new BigDecimal(pay).add(new BigDecimal(setoff)).subtract(new BigDecimal(wxBillRent.getReturnPay())); | |||
| if (needReturn.compareTo(new BigDecimal(0)) == 0) { | |||
| wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| } | |||
| wxAllBillMapper.updateById(wxBillRent); | |||
| @@ -446,7 +435,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| wxBillRent.setUpdateBy(user.getId()); | |||
| wxBillRent.setUpdateByName(user.getName()); | |||
| wxBillRent.setStatus(EnumBillStatus.BAD.getCode()); | |||
| //wxBillRent.setStatus(EnumBillStatus.BAD.getCode()); | |||
| wxAllBillMapper.updateById(wxBillRent); | |||
| String badMoney = dbBill.getOwe(); | |||
| this.addBillAction(EnumBillAction.BAD, dto.getBillTypeValue(),dto.getId(), | |||
| @@ -462,7 +451,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| bill.setBuilding(wxMerchant.getBuilding()); | |||
| bill.setFloor(wxMerchant.getFloor()); | |||
| bill.setMerchantId(wxMerchant.getId()); | |||
| bill.setStatus(status.getCode()); | |||
| //bill.setStatus(status.getCode()); | |||
| updateQueryParam(bill); | |||
| PageInfo<WxAllBill> bpage = this.listAsPage(bill, 1, 100); | |||
| if (null != bpage && null != bpage.getList()) { | |||
| @@ -472,7 +461,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| WxAllBill bu = new WxAllBill(); | |||
| bu.setId(b.getId()); | |||
| bu.updateTenantInfo(b); | |||
| bu.setStatus(EnumBillStatus.INVALID.getCode()); | |||
| //bu.setStatus(EnumBillStatus.INVALID.getCode()); | |||
| bu.setUpdatetime(new Date()); | |||
| bu.setUpdateBy(user.getId()); | |||
| bu.setUpdateByName(user.getName()); | |||
| @@ -482,7 +471,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| wxBillAction.setBillId(b.getId()); | |||
| wxBillAction.setBillType(b.getBillType()); | |||
| wxBillAction.setAction(EnumBillAction.STATUS_CHANGE.getCode()); | |||
| wxBillAction.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null,null,null,EnumBillStatus.getEnum(b.getStatus()),EnumBillStatus.INVALID)); | |||
| //wxBillAction.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null,null,null,EnumBillStatus.getEnum(b.getStatus()),EnumBillStatus.INVALID)); | |||
| wxBillAction.setRemark(wxMerchant.getBillCompleteRemark()); | |||
| this.addBillAction(wxBillAction, user); | |||
| } | |||
| @@ -525,11 +514,6 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| wxBillRent.setPay(oldpay.subtract(new BigDecimal(dto.getAddpay())).toPlainString()); | |||
| wxBillRent.setSetOff(oldsetoff.subtract(new BigDecimal(dto.getSetOff())).toPlainString()); | |||
| if (dbBill.getStatus().intValue() == EnumBillStatus.PAID.getCode().intValue()) { | |||
| if (new BigDecimal(wxBillRent.getOwe()).compareTo(new BigDecimal(0)) > 0 ) { | |||
| wxBillRent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| } | |||
| } | |||
| wxAllBillMapper.updateById(wxBillRent); | |||
| EnumBillAction action = EnumBillAction.RETURN; | |||
| this.addBillAction(action, dto.getBillTypeValue(),dto.getId(), | |||
| @@ -969,7 +969,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| advanceBill.setPayDate(new Date()); | |||
| advanceBill.setStarttime(record.getStarttime()); | |||
| advanceBill.setEndtime(record.getEndtime()); | |||
| advanceBill.setStatus(billStatus.getCode()); | |||
| //advanceBill.setStatus(billStatus.getCode()); | |||
| advanceBill.setEnergyFeesId(record.getEnergyFeesId()); | |||
| advanceBill.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| advanceBill.setBillRemark(record.getBillRemark()); | |||
| @@ -1050,9 +1050,9 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| for (int j = 0 ; j < setoffList.size() ; j ++) { | |||
| WxFinanceReceiveSetoff rs = setoffList.get(j); | |||
| WxAllBill advance = wxAllBillService.getById(record, rs.getAdvanceId()); | |||
| if (advance.getStatus().intValue() != EnumBillStatus.SET_OFF.getCode().intValue()) { | |||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"关联的预充账单["+advance.getId()+"]状态无法修改"); | |||
| } | |||
| // if (advance.getStatus().intValue() != EnumBillStatus.SET_OFF.getCode().intValue()) { | |||
| // throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"关联的预充账单["+advance.getId()+"]状态无法修改"); | |||
| // } | |||
| BigDecimal advanceUserMoney = new BigDecimal(0); | |||
| if (StringUtils.isNotBlank(advance.getUseMoney())) { | |||
| advanceUserMoney = new BigDecimal(advance.getUseMoney()); | |||
| @@ -323,7 +323,6 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| bill.setBillType(EnumBillAllType.PROPERTY.getCode()); | |||
| //bill.setShopId(record.getShopId()); | |||
| if (bill.getReceivePay().equals("0")) { | |||
| bill.setStatus(EnumBillStatus.PAID.getCode()); | |||
| bill.setPayDate(date); | |||
| } | |||
| //BigDecimal servicePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(100), record.getDecimalSize(), BigDecimal.ROUND_HALF_UP); | |||
| @@ -560,7 +559,6 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| // instance.add(dayType, wxPropertyContract.getLease()); | |||
| // wxBillDeposit.setEndtime(instance.getTime()); | |||
| wxBillDeposit.setEndtime(record.getFirstBillDateEnd()); | |||
| wxBillDeposit.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| wxBillDeposit.updateTenantInfo(wxPropertyContract); | |||
| wxBillDeposit.setMerchantId(record.getMerchantId()); | |||
| wxBillDeposit.setCreatetime(date); | |||
| @@ -861,7 +859,6 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| wxBillProperty.setUpdateBy(user.getId()); | |||
| wxBillProperty.setUpdateByName(user.getName()); | |||
| //wxBillProperty.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| wxBillProperty.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| wxBillProperty.setRentShopType(wxPropertyContract.getRentShopType()); | |||
| //wxBillProperty.setPeriod(billcount); | |||
| if (shopInfo != null) { | |||
| @@ -560,7 +560,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //bill.setLatePayRatio(0); | |||
| bill.setPay("0"); | |||
| //bill.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| bill.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| bill.setMerchantId(record.getMerchantId()); | |||
| if (null != shopIds && shopIds.size() == 1) { | |||
| bill.setShopId(shopIds.get(0)); | |||
| @@ -568,7 +567,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| bill.setEnergyFeesId(EnumBillAllType.RENT.getEnergyFeesId()); | |||
| //setExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod()); | |||
| if (bill.getReceivePay().equals("0")) { | |||
| bill.setStatus(EnumBillStatus.PAID.getCode()); | |||
| bill.setPayDate(date); | |||
| } | |||
| //计算手续费 | |||
| @@ -643,14 +641,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //bill.setLatePayRatio(0); | |||
| bill.setPay("0"); | |||
| //bill.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| bill.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| bill.setMerchantId(record.getMerchantId()); | |||
| if (null != shopIds && shopIds.size() == 1) { | |||
| bill.setShopId(shopIds.get(0)); | |||
| } | |||
| //setManageExpiredDay(bill,Calendar.MONTH,record.getReceivePeriod()); | |||
| if (bill.getReceivePay().equals("0")) { | |||
| bill.setStatus(EnumBillStatus.PAID.getCode()); | |||
| bill.setPayDate(date); | |||
| } | |||
| @@ -849,7 +845,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxBillDeposit.setStarttime(wxRentContract.getFirstBillDateStart()); | |||
| wxBillDeposit.setEndtime(wxRentContract.getFirstBillDateEnd()); | |||
| wxBillDeposit.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| //wxBillDeposit.setExpiredDay(0L); | |||
| //wxBillDeposit.setReceiveDate(time); | |||
| wxBillDeposit.updateTenantInfo(wxRentContract); | |||
| @@ -1398,7 +1393,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxBillRent.setId(idWorker.nextId()); | |||
| wxBillRent.setRentContractId(wxRentContract.getId()); | |||
| wxBillRent.setRentShopType(wxRentContract.getRentShopType()); | |||
| wxBillRent.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| wxBillRent.setBillType(EnumBillAllType.RENT.getCode()); | |||
| wxBillRent.setPay("0"); | |||
| wxBillRent.setStarttime(billTimeVo.getStartDate()); | |||
| @@ -1486,7 +1480,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| manage.setUpdatetime(wxBillRent.getUpdatetime()); | |||
| manage.setUpdateByName(wxBillRent.getUpdateByName()); | |||
| manage.setRentShopType(wxBillRent.getRentShopType()); | |||
| manage.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| if (feeType.getCode().intValue() == EnumRentContractManageFeeType.RENT_BUSSINESS_MANAGE_FEE.getCode().intValue()){ | |||
| manage.setEnergyFeesId(EnumBillAllType.RENT_BUSSINESS_MANAGE.getEnergyFeesId()); | |||
| manage.setBillType(EnumBillAllType.RENT_BUSSINESS_MANAGE.getCode()); | |||
| @@ -2845,7 +2838,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| rentBill.setBillRemark("设置销售额,自动计算"); | |||
| rentBill.setUpdatetime(new Date()); | |||
| if (new BigDecimal(rentBill.getOwe()).compareTo(new BigDecimal(0)) < 0 ) { | |||
| rentBill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| //rentBill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| }else { | |||
| //rentBill.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| @@ -2896,7 +2889,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| bmbill.setReceivePay(bussinessmoney); | |||
| bmbill.setBillRemark("设置销售额,自动计算"); | |||
| if (new BigDecimal(bmbill.getOwe()).compareTo(new BigDecimal(0)) < 0 ) { | |||
| bmbill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| //bmbill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| }else { | |||
| //bmbill.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| @@ -2922,7 +2915,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| bmbill.setPay("0"); | |||
| bmbill.setStarttime(rentBill.getStarttime()); | |||
| bmbill.setEndtime(rentBill.getEndtime()); | |||
| bmbill.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| bmbill.setBillRemark(createFrom.getMessage()+",自动计算创建"); | |||
| bmbill.setExtraCreateFrom(createFrom.getCode()); | |||
| bmbill.setMoneyChangeDetail("自动计算创建,总计分摊比率为:"+rate+",应收金额为:"+bussinessmoney+"元,"); | |||
| @@ -2941,7 +2933,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| propertyBill.setReceivePay(bussinessmoney); | |||
| propertyBill.setBillRemark("设置销售额,自动计算"); | |||
| if (new BigDecimal(propertyBill.getOwe()).compareTo(new BigDecimal(0)) < 0 ) { | |||
| propertyBill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| //propertyBill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| }else { | |||
| //bmbill.setStatus(EnumBillStatus.PAID.getCode()); | |||
| } | |||
| @@ -2969,7 +2961,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| bmbill.setPay("0"); | |||
| bmbill.setStarttime(rentBill.getStarttime()); | |||
| bmbill.setEndtime(rentBill.getEndtime()); | |||
| bmbill.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| bmbill.setBillRemark(createFrom.getMessage()+",自动计算创建"); | |||
| bmbill.setExtraCreateFrom(createFrom.getCode()); | |||
| bmbill.setMoneyChangeDetail("自动计算创建,总计分摊比率为:"+rate+",应收金额为:"+bussinessmoney+"元,"); | |||
| @@ -3000,7 +2991,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| bmbill.setPay("0"); | |||
| bmbill.setStarttime(starttime); | |||
| bmbill.setEndtime(endtime); | |||
| bmbill.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| bmbill.setBillRemark(createFrom.getMessage()+",自动计算创建"); | |||
| bmbill.setExtraCreateFrom(createFrom.getCode()); | |||
| bmbill.setMoneyChangeDetail("自动计算创建,分摊比例为"+rate+",计算应收金额为:"+money+"元,"); | |||
| @@ -3065,12 +3055,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| rentBillq.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| rentBillq.setStarttime(rentcontract.getYearsBegin()); | |||
| rentBillq.setEndtime(rentcontract.getYearsEnd()); | |||
| List<Integer> status = new ArrayList<Integer>(); | |||
| status.add(EnumBillStatus.WAIT_PAY.getCode()); | |||
| status.add(EnumBillStatus.PAID.getCode()); | |||
| status.add(EnumBillStatus.BAD.getCode()); | |||
| status.add(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| rentBillq.setStatusList(status); | |||
| WxBillSum rentBillSum = wxAllBillMapper.getBillMonthSum(rentBillq); | |||
| if (null != rentBillSum) { | |||
| receivepay = receivepay.add(rentBillSum.getNeedPayNumber()); | |||
| @@ -3115,12 +3099,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| prpoertyBillq.setStarttime(rentcontract.getYearsBegin()); | |||
| prpoertyBillq.setEndtime(rentcontract.getYearsEnd()); | |||
| prpoertyBillq.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_REVENUE_SALES.getCode()); | |||
| List<Integer> propertyStatus = new ArrayList<Integer>(); | |||
| propertyStatus.add(EnumBillStatus.WAIT_PAY.getCode()); | |||
| propertyStatus.add(EnumBillStatus.PAID.getCode()); | |||
| propertyStatus.add(EnumBillStatus.BAD.getCode()); | |||
| propertyStatus.add(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||
| prpoertyBillq.setStatusList(propertyStatus); | |||
| WxBillSum propertyBillSum = wxAllBillMapper.getBillMonthSum(prpoertyBillq); | |||
| if (null != propertyBillSum) { | |||
| receivepay = receivepay.add(propertyBillSum.getNeedPayNumber()); | |||