| @@ -295,6 +295,15 @@ public class MallUserInfoController extends BaseController { | |||
| return new ResultData(info); | |||
| } | |||
| @ApiOperation(value = "获取菜单") | |||
| @GetMapping("/getMenu") | |||
| @SystemControllerLog(description = "用户管理-获取菜单") | |||
| public ResultData getMenu() { | |||
| MallUserInfo info = getUser(); | |||
| String menu = userRoleService.getPermissionsByUser(info); | |||
| return new ResultData(menu); | |||
| } | |||
| @ApiOperation(value = "用户密码发送验证码") | |||
| @GetMapping("sendvalidationcode") | |||
| @ApiImplicitParams({ | |||
| @@ -131,6 +131,10 @@ public class TenantInfoImpl implements TenantInfo { | |||
| return true; | |||
| if ("com.iformall.mapper.WxCouponPasswordMapper.updateStatus".equals(ms.getId())) | |||
| return true; | |||
| if ("com.iformall.mapper.WxBillAllMapper.getReceiveAndPayBillAsPage".equals(ms.getId())) | |||
| return true; | |||
| return false; | |||
| } | |||
| } | |||
| @@ -115,4 +115,9 @@ public class WxBillDaily extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") | |||
| @TableField(exist = false) | |||
| private Long realReceivePay; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayBefore; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayUpdate; | |||
| } | |||
| @@ -83,4 +83,9 @@ public class WxBillDeposit extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") | |||
| @TableField(exist = false) | |||
| private Long realReceivePay; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayBefore; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayUpdate; | |||
| } | |||
| @@ -137,4 +137,9 @@ public class WxBillOther extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") | |||
| @TableField(exist = false) | |||
| private Long realReceivePay; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayBefore; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayUpdate; | |||
| } | |||
| @@ -146,4 +146,9 @@ public class WxBillOtherDeposit extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") | |||
| @TableField(exist = false) | |||
| private Long realReceivePay; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayBefore; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayUpdate; | |||
| } | |||
| @@ -81,4 +81,9 @@ public class WxBillPropertyDeposit extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") | |||
| @TableField(exist = false) | |||
| private Long realReceivePay; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayBefore; | |||
| @TableField(exist = false) | |||
| private String serviceChargePayUpdate; | |||
| } | |||
| @@ -210,4 +210,6 @@ public class WxBillRent extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") | |||
| @TableField(exist = false) | |||
| private Long realReceivePay; | |||
| } | |||
| @@ -152,4 +152,13 @@ public class WxBillAll extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "多个类型", name = "typeStr") | |||
| private String typeStr; | |||
| @TableField(exist = false) | |||
| private Integer servicePayRate; | |||
| @TableField(exist = false) | |||
| private Integer limitStart; | |||
| @TableField(exist = false) | |||
| private Integer limitEnd; | |||
| } | |||
| @@ -1719,19 +1719,36 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| @Override | |||
| public Map<String, Object> getReceiveAndPayBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize) { | |||
| PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxBillAllMapper.getReceiveAndPayBillAsPage(record)); | |||
| pageInfo.getList().stream().forEach(e->{ | |||
| if(e.get("receivePay") == null){ | |||
| e.put("receivePay",0); | |||
| } | |||
| if(e.get("payOut") == null){ | |||
| e.put("payOut",0); | |||
| } | |||
| if(e.get("balance") == null){ | |||
| e.put("balance",0); | |||
| } | |||
| }); | |||
| Map<String, Object> result = new HashMap<>(); | |||
| record.setLimitStart(0); | |||
| record.setLimitEnd(Integer.MAX_VALUE); | |||
| List totalList = wxBillAllMapper.getReceiveAndPayBillAsPage(record); | |||
| if(CollectionUtils.isEmpty(totalList)){ | |||
| PageHelper.startPage(pageNum, pageSize); | |||
| PageInfo<Map<String, Object>> pageInfo = new PageInfo(new ArrayList()); | |||
| pageInfo.setPages(0); | |||
| pageInfo.setTotal(0); | |||
| PageHelper.clearPage(); | |||
| result.put("pageInfo", pageInfo); | |||
| return result; | |||
| } | |||
| int total = totalList.size(); | |||
| int pages; | |||
| if(total % pageSize == 0){ | |||
| pages = total / pageSize; | |||
| }else{ | |||
| pages = total / pageSize +1; | |||
| } | |||
| record.setLimitStart((pageNum -1) * pageSize); | |||
| record.setLimitEnd(pageSize); | |||
| List<Map<String, Object>> list = wxBillAllMapper.getReceiveAndPayBillAsPage(record); | |||
| PageHelper.startPage(pageNum, pageSize); | |||
| PageInfo<Map<String, Object>> pageInfo = new PageInfo(list); | |||
| pageInfo.setPages(pages); | |||
| pageInfo.setTotal(total); | |||
| PageHelper.clearPage(); | |||
| result.put("pageInfo", pageInfo); | |||
| return result; | |||
| } | |||
| @@ -141,8 +141,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillDaily record, MallUserInfo user) { | |||
| int receivepay = record.getReceivePay().intValue(); | |||
| int pay = record.getPay().intValue(); | |||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||
| int pay = record.getPay()==null?0:record.getPay().intValue(); | |||
| if(pay>receivepay){ | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(),"实收金额不能大于实际应收金额"); | |||
| } | |||
| @@ -180,26 +180,34 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| if(wxBillDaily==null){ | |||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | |||
| } | |||
| Long addpay = wxBillDaily.getPay(); | |||
| wxBillDaily.setPayDate(record.getPayDate()); | |||
| wxBillDaily.setPay(record.getPay()); | |||
| wxBillDaily.setReceivePay(record.getReceivePay()); | |||
| wxBillDaily.setOwe(record.getReceivePay()-record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = wxBillDaily.getReceiveDate(); | |||
| wxBillDaily.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| wxBillDaily.setExpiredDay((long) expiredDay); | |||
| String price = ""; | |||
| String message = ""; | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillDaily.setServiceChargePay(Integer.parseInt(record.getServiceChargePayUpdate()) * 100); | |||
| }else{ | |||
| Long addpay = wxBillDaily.getPay(); | |||
| wxBillDaily.setPayDate(record.getPayDate()); | |||
| wxBillDaily.setPay(record.getPay()); | |||
| wxBillDaily.setReceivePay(record.getReceivePay()); | |||
| wxBillDaily.setOwe(record.getReceivePay()-record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = wxBillDaily.getReceiveDate(); | |||
| wxBillDaily.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| wxBillDaily.setExpiredDay((long) expiredDay); | |||
| } | |||
| } | |||
| wxBillDaily.setPayDate(record.getPayDate()); | |||
| wxBillDaily.setUpdatetime(date); | |||
| wxBillDaily.setPayWay(record.getPayWay()); | |||
| wxBillDaily.setPriceDetail(record.getPriceDetail()); | |||
| message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| } | |||
| wxBillDaily.setPayDate(record.getPayDate()); | |||
| wxBillDaily.setUpdatetime(date); | |||
| wxBillDaily.setPayWay(record.getPayWay()); | |||
| wxBillDaily.setPriceDetail(record.getPriceDetail()); | |||
| wxBillDaily.setServiceChargePay(record.getServiceChargePay()); | |||
| try { | |||
| wxBillDailyMapper.updateById(wxBillDaily); | |||
| } catch (Exception e) { | |||
| @@ -209,10 +217,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| //日志 | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(wxBillDaily.getId()); | |||
| String message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| String price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| wxBillAction.setDetails(message + price + "元"); | |||
| if(record.getServiceChargePay() != null){ | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); | |||
| }else{ | |||
| wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| @@ -121,8 +121,8 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillDeposit record, MallUserInfo user) { | |||
| int receivepay = record.getReceivePay().intValue(); | |||
| int pay = record.getPay().intValue(); | |||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||
| int pay = record.getPay()==null?0:record.getPay().intValue(); | |||
| if(pay>receivepay){ | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收金额"); | |||
| } | |||
| @@ -164,7 +164,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||
| wxBillDeposit.setPayDate(date); | |||
| wxBillDeposit.setUpdatetime(date); | |||
| wxBillDeposit.setPayWay(record.getPayWay()); | |||
| wxBillDeposit.setServiceChargePay(record.getServiceChargePay()); | |||
| //wxBillDeposit.setServiceChargePay(record.getServiceChargePay()); | |||
| try { | |||
| wxBillDepositMapper.updateById(wxBillDeposit); | |||
| } catch (Exception e) { | |||
| @@ -177,11 +177,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||
| String message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| String price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| wxBillAction.setDetails(message + price + "元"); | |||
| if(record.getServiceChargePay() != null){ | |||
| wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); | |||
| }else{ | |||
| wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| } | |||
| wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| wxBillAction.setUserId(user.getId()); | |||
| wxBillAction.setUserName(user.getName()); | |||
| wxBillAction.setPhone(user.getPhone()); | |||
| @@ -135,8 +135,8 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillOtherDeposit record, MallUserInfo user) { | |||
| int receivepay = record.getReceivePay().intValue(); | |||
| int pay = record.getPay().intValue(); | |||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||
| int pay = record.getPay()==null?0:record.getPay().intValue(); | |||
| if (pay > receivepay) { | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收金额"); | |||
| } | |||
| @@ -176,26 +176,34 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||
| if (wxBillOtherDeposit == null) { | |||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | |||
| } | |||
| Long addpay = wxBillOtherDeposit.getPay(); | |||
| wxBillOtherDeposit.setPayDate(record.getPayDate()); | |||
| wxBillOtherDeposit.setPay(record.getPay()); | |||
| wxBillOtherDeposit.setReceivePay(record.getReceivePay()); | |||
| wxBillOtherDeposit.setOwe(record.getReceivePay() - record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = wxBillOtherDeposit.getReceiveDate(); | |||
| wxBillOtherDeposit.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| wxBillOtherDeposit.setExpiredDay((long) expiredDay); | |||
| String message = ""; | |||
| String price = ""; | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillOtherDeposit.setServiceChargePay(Integer.parseInt(record.getServiceChargePayUpdate()) * 100); | |||
| }else{ | |||
| Long addpay = wxBillOtherDeposit.getPay(); | |||
| wxBillOtherDeposit.setPayDate(record.getPayDate()); | |||
| wxBillOtherDeposit.setPay(record.getPay()); | |||
| wxBillOtherDeposit.setReceivePay(record.getReceivePay()); | |||
| wxBillOtherDeposit.setOwe(record.getReceivePay() - record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = wxBillOtherDeposit.getReceiveDate(); | |||
| wxBillOtherDeposit.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| wxBillOtherDeposit.setExpiredDay((long) expiredDay); | |||
| } | |||
| } | |||
| wxBillOtherDeposit.setPayDate(record.getPayDate()); | |||
| wxBillOtherDeposit.setUpdatetime(date); | |||
| wxBillOtherDeposit.setPayWay(record.getPayWay()); | |||
| wxBillOtherDeposit.setComments(record.getComments()); | |||
| message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| } | |||
| wxBillOtherDeposit.setPayDate(record.getPayDate()); | |||
| wxBillOtherDeposit.setUpdatetime(date); | |||
| wxBillOtherDeposit.setPayWay(record.getPayWay()); | |||
| wxBillOtherDeposit.setComments(record.getComments()); | |||
| wxBillOtherDeposit.setServiceChargePay(record.getServiceChargePay()); | |||
| try { | |||
| wxBillOtherDepositMapper.updateById(wxBillOtherDeposit); | |||
| } catch (Exception e) { | |||
| @@ -205,10 +213,8 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||
| //日志 | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(wxBillOtherDeposit.getId()); | |||
| String message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| String price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| wxBillAction.setDetails(message + price + "元"); | |||
| if(record.getServiceChargePay() != null){ | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); | |||
| }else{ | |||
| wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| @@ -137,8 +137,8 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillOther record, MallUserInfo user) { | |||
| int receivepay = record.getReceivePay().intValue(); | |||
| int pay = record.getPay().intValue(); | |||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||
| int pay = record.getPay()==null?0:record.getPay().intValue(); | |||
| if(pay>receivepay){ | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR,"实收金额不能大于实际应收金额"); | |||
| } | |||
| @@ -176,27 +176,36 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| if(wxBillOther==null){ | |||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | |||
| } | |||
| Long addpay = wxBillOther.getPay(); | |||
| wxBillOther.setPayDate(record.getPayDate()); | |||
| wxBillOther.setPay(record.getPay()); | |||
| wxBillOther.setReceivePay(record.getReceivePay()); | |||
| wxBillOther.setOwe(record.getReceivePay()-record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = wxBillOther.getReceiveDate(); | |||
| wxBillOther.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| wxBillOther.setExpiredDay((long) expiredDay); | |||
| String message = ""; | |||
| String price = ""; | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillOther.setServiceChargePay(Integer.parseInt(record.getServiceChargePayUpdate()) * 100); | |||
| }else{ | |||
| Long addpay = wxBillOther.getPay(); | |||
| wxBillOther.setPayDate(record.getPayDate()); | |||
| wxBillOther.setPay(record.getPay()); | |||
| wxBillOther.setReceivePay(record.getReceivePay()); | |||
| wxBillOther.setOwe(record.getReceivePay()-record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = wxBillOther.getReceiveDate(); | |||
| wxBillOther.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| wxBillOther.setExpiredDay((long) expiredDay); | |||
| } | |||
| } | |||
| wxBillOther.setPayDate(record.getPayDate()); | |||
| wxBillOther.setUpdatetime(date); | |||
| wxBillOther.setPayWay(record.getPayWay()); | |||
| wxBillOther.setComments(record.getComments()); | |||
| wxBillOther.setName(record.getName()); | |||
| message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| } | |||
| wxBillOther.setPayDate(record.getPayDate()); | |||
| wxBillOther.setUpdatetime(date); | |||
| wxBillOther.setPayWay(record.getPayWay()); | |||
| wxBillOther.setComments(record.getComments()); | |||
| wxBillOther.setName(record.getName()); | |||
| wxBillOther.setServiceChargePay(record.getServiceChargePay()); | |||
| try { | |||
| wxBillOtherMapper.updateById(wxBillOther); | |||
| } catch (Exception e) { | |||
| @@ -206,10 +215,8 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| //日志 | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(wxBillOther.getId()); | |||
| String message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| String price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| wxBillAction.setDetails(message + price + "元"); | |||
| if(record.getServiceChargePay() != null){ | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); | |||
| }else{ | |||
| wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| @@ -120,8 +120,8 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillPropertyDeposit record, MallUserInfo user) { | |||
| int receivepay = record.getReceivePay().intValue(); | |||
| int pay = record.getPay().intValue(); | |||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||
| int pay = record.getPay()==null?0:record.getPay().intValue(); | |||
| if(pay>receivepay){ | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收金额"); | |||
| } | |||
| @@ -163,7 +163,6 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||
| wxBillDeposit.setPayDate(date); | |||
| wxBillDeposit.setUpdatetime(date); | |||
| wxBillDeposit.setPayWay(record.getPayWay()); | |||
| wxBillDeposit.setServiceChargePay(record.getServiceChargePay()); | |||
| try { | |||
| wxBillPropertyDepositMapper.updateById(wxBillDeposit); | |||
| } catch (Exception e) { | |||
| @@ -176,11 +175,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||
| String message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| String price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| wxBillAction.setDetails(message + price + "元"); | |||
| if(record.getServiceChargePay() != null){ | |||
| wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); | |||
| }else{ | |||
| wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| } | |||
| wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| wxBillAction.setUserId(user.getId()); | |||
| wxBillAction.setUserName(user.getName()); | |||
| wxBillAction.setPhone(user.getPhone()); | |||
| @@ -130,8 +130,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillProperty record, MallUserInfo user) { | |||
| int receivepay = record.getReceivePay().intValue(); | |||
| int pay = record.getPay().intValue(); | |||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||
| int pay = record.getPay()==null?0:record.getPay().intValue(); | |||
| if(pay>receivepay){ | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR,"实收金额不能大于实际应收金额"); | |||
| } | |||
| @@ -157,29 +157,38 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| if(property==null){ | |||
| return new ResultData(ErrorCode.BILL_PROPERTY_IS_NOT_FOUND); | |||
| } | |||
| Long addpay = property.getPay(); | |||
| property.setRevenue(record.getRevenue()); | |||
| property.setLatePayRatio(record.getLatePayRatio()); | |||
| property.setLatePayTime(record.getLatePayTime()); | |||
| property.setLatePayStatus(record.getLatePayStatus()); | |||
| property.setPayDate(record.getPayDate()); | |||
| property.setPay(record.getPay()); | |||
| property.setReceivePay(record.getReceivePay()); | |||
| property.setOwe(record.getReceivePay()-record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| property.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = property.getReceiveDate(); | |||
| property.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| property.setExpiredDay((long) expiredDay); | |||
| String message = ""; | |||
| String price = ""; | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| property.setServiceChargePay(Integer.parseInt(record.getServiceChargePayUpdate()) * 100); | |||
| }else{ | |||
| Long addpay = property.getPay(); | |||
| property.setRevenue(record.getRevenue()); | |||
| property.setLatePayRatio(record.getLatePayRatio()); | |||
| property.setLatePayTime(record.getLatePayTime()); | |||
| property.setLatePayStatus(record.getLatePayStatus()); | |||
| property.setPayDate(record.getPayDate()); | |||
| property.setPay(record.getPay()); | |||
| property.setReceivePay(record.getReceivePay()); | |||
| property.setOwe(record.getReceivePay()-record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| property.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = property.getReceiveDate(); | |||
| property.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| property.setExpiredDay((long) expiredDay); | |||
| } | |||
| } | |||
| property.setPayDate(record.getPayDate()); | |||
| property.setUpdatetime(date); | |||
| property.setPayWay(record.getPayWay()); | |||
| message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| } | |||
| property.setPayDate(record.getPayDate()); | |||
| property.setUpdatetime(date); | |||
| property.setPayWay(record.getPayWay()); | |||
| property.setServiceChargePay(record.getServiceChargePay()); | |||
| try { | |||
| wxBillPropertyMapper.updateById(property); | |||
| } catch (Exception e) { | |||
| @@ -189,10 +198,9 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| //日志 | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(property.getId()); | |||
| String message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| String price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| wxBillAction.setDetails(message + price + "元"); | |||
| if(record.getServiceChargePay() != null){ | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillAction.setDetails(record.getServiceChargePayBefore()+"元变更为" +record.getServiceChargePayUpdate()+"元"); | |||
| wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); | |||
| }else{ | |||
| @@ -134,8 +134,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillRent record, MallUserInfo user) { | |||
| int receivepay = record.getReceivePay().intValue(); | |||
| int pay = record.getPay().intValue(); | |||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||
| int pay = record.getPay()==null?0:record.getPay().intValue(); | |||
| if(pay>receivepay){ | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR,"实收金额不能大于实际应收金额"); | |||
| } | |||
| @@ -161,28 +161,36 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| if(wxBillRent==null){ | |||
| return new ResultData(ErrorCode.BILL_RENT_IS_NOT_FOUND); | |||
| } | |||
| Long addpay = wxBillRent.getPay(); | |||
| wxBillRent.setRevenue(record.getRevenue()); | |||
| wxBillRent.setLatePayRatio(record.getLatePayRatio()); | |||
| wxBillRent.setLatePayTime(record.getLatePayTime()); | |||
| wxBillRent.setLatePayStatus(record.getLatePayStatus()); | |||
| wxBillRent.setPay(record.getPay()); | |||
| wxBillRent.setReceivePay(record.getReceivePay()); | |||
| wxBillRent.setOwe(record.getReceivePay()-record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = wxBillRent.getReceiveDate(); | |||
| wxBillRent.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| wxBillRent.setExpiredDay((long) expiredDay); | |||
| String price = ""; | |||
| String message =""; | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillRent.setServiceChargePay(Integer.parseInt(record.getServiceChargePayUpdate()) * 100); | |||
| }else{ | |||
| Long addpay = wxBillRent.getPay(); | |||
| wxBillRent.setRevenue(record.getRevenue()); | |||
| wxBillRent.setLatePayRatio(record.getLatePayRatio()); | |||
| wxBillRent.setLatePayTime(record.getLatePayTime()); | |||
| wxBillRent.setLatePayStatus(record.getLatePayStatus()); | |||
| wxBillRent.setPay(record.getPay()); | |||
| wxBillRent.setReceivePay(record.getReceivePay()); | |||
| wxBillRent.setOwe(record.getReceivePay()-record.getPay()); | |||
| if (record.getPay().equals(record.getReceivePay())) { | |||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| Date payDate = record.getPayDate(); | |||
| Date receiveDate = wxBillRent.getReceiveDate(); | |||
| wxBillRent.setExpiredDay(0L); | |||
| if (payDate.after(receiveDate)) { | |||
| int expiredDay = DateUtils.daysBetween(receiveDate, payDate); | |||
| wxBillRent.setExpiredDay((long) expiredDay); | |||
| } | |||
| } | |||
| wxBillRent.setPayDate(record.getPayDate()); | |||
| wxBillRent.setUpdatetime(date); | |||
| wxBillRent.setPayWay(record.getPayWay()); | |||
| price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| } | |||
| wxBillRent.setPayDate(record.getPayDate()); | |||
| wxBillRent.setUpdatetime(date); | |||
| wxBillRent.setPayWay(record.getPayWay()); | |||
| wxBillRent.setServiceChargePay(record.getServiceChargePay()); | |||
| try { | |||
| wxBillRentMapper.updateById(wxBillRent); | |||
| } catch (Exception e) { | |||
| @@ -192,15 +200,14 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| //日志 | |||
| WxBillAction wxBillAction = new WxBillAction(); | |||
| wxBillAction.setBillId(wxBillRent.getId()); | |||
| String message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| String price = new BigDecimal(record.getPay() - addpay).divide(new BigDecimal(100)).toPlainString(); | |||
| wxBillAction.setDetails(message + price + "元"); | |||
| if(record.getServiceChargePay() != null){ | |||
| if(record.getServiceChargePayUpdate() != null){ | |||
| wxBillAction.setDetails(record.getServiceChargePayBefore()+"元变更为" +record.getServiceChargePayUpdate()+"元"); | |||
| wxBillAction.setAction(EnumBillAction.UPDATE_SERVICE_MONEY.getCode()); | |||
| }else{ | |||
| wxBillAction.setAction(EnumBillAction.OFFLINE_PAY.getCode()); | |||
| message = EnumBillPayWay.getEnum(record.getPayWay()).getMessage(); | |||
| } | |||
| wxBillAction.setDetails(message + price + "元"); | |||
| wxBillAction.setUserId(user.getId()); | |||
| wxBillAction.setUserName(user.getName()); | |||
| wxBillAction.setPhone(user.getPhone()); | |||
| @@ -762,14 +762,44 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); | |||
| WxCUserTags userTags = getById(wxCUserBasicInfo.getTagId()); | |||
| List<Long> tagList = JSONArray.parseArray(userTags.getTags(), Long.class); | |||
| if (!tagList.isEmpty()) { | |||
| tagList.addAll(tags); | |||
| } | |||
| String tagStr = JSONArray.toJSONString(tagList); | |||
| //先从现有标签中查看用户是否有 服饰尺码 和 鞋码 类别 有 删除 | |||
| Long tagId = 0L; | |||
| WxTags wxTags = new WxTags(); | |||
| wxTags.setTypeId(EnumTagType.ID_27.getCode()); | |||
| tagId = getTagId(tagList, tagId, wxTags); | |||
| if (!tagId.equals(0L)) { | |||
| tagList.remove(tagId); | |||
| } | |||
| wxTags.setTypeId(EnumTagType.ID_28.getCode()); | |||
| tagId = getTagId(tagList, tagId, wxTags); | |||
| if (!tagId.equals(0L)) { | |||
| tagList.remove(tagId); | |||
| } | |||
| //添加新的标签 | |||
| tagList.addAll(tags); | |||
| String tagStr = JSONArray.toJSONString(tagList); | |||
| userTags.setTags(tagStr); | |||
| userTags.setUpdateDate(new Date()); | |||
| wxCUserTagsMapper.updateById(userTags); | |||
| } | |||
| public Long getTagId(List<Long> tagList, Long id, WxTags wxTags) { | |||
| List<WxTags> list = wxTagsMapper.findList(wxTags); | |||
| for (WxTags tag : list) { | |||
| boolean flag = false; | |||
| for (Long tagId : tagList) { | |||
| if (tag.getId().equals(tagId)) { | |||
| id = tagId; | |||
| flag = true; | |||
| break; | |||
| } | |||
| } | |||
| if (flag) { | |||
| break; | |||
| } | |||
| } | |||
| return id; | |||
| } | |||
| } | |||
| @@ -739,26 +739,28 @@ | |||
| </select> | |||
| <select id="getReceiveAndPayBillAsPage" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap"> | |||
| select tt.* from ( | |||
| select m.tenant_id,m.id,m.name,ws.shop_number shopNumber,ws.type,m.link_person linkPerson,m.link_phone linkPhone, | |||
| xb.title business,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate,rc.rent_shop_type, | |||
| ifnull(round( | |||
| (select sum(bill.receive_pay) from ( | |||
| select merchant_id,receive_pay from wx_bill_rent where is_preview = 0 and status not in(3,6) | |||
| (select sum(bill.receive_pay)+sum(bill.late_pay_price)+bill.receivePay from ( | |||
| select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,late_pay_price from wx_bill_rent where is_preview = 0 and status not in(3,6) | |||
| union all | |||
| select merchant_id,receive_pay from wx_bill_rent_deposit where status not in(3,6) | |||
| select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_rent_deposit where status not in(3,6) | |||
| union all | |||
| select merchant_id,receive_pay from wx_bill_property where is_preview = 0 and status not in(3,6) | |||
| select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,late_pay_price from wx_bill_property where is_preview = 0 and status not in(3,6) | |||
| union all | |||
| select merchant_id,receive_pay from wx_bill_property_deposit where status not in(3,6) | |||
| select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_property_deposit where status not in(3,6) | |||
| union all | |||
| select merchant_id,receive_pay from wx_bill_daily where type in(1,2,3) and status not in(3,6) | |||
| select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_daily where type in(1,2,3) and status not in(3,6) | |||
| union all | |||
| select merchant_id,receive_pay from wx_bill_other where status not in(3,6) | |||
| select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_other where status not in(3,6) | |||
| union all | |||
| select merchant_id,receive_pay from wx_bill_other_deposit where status not in(3,6) | |||
| select merchant_id,receive_pay,if(service_charge_pay>0,service_charge_pay,receive_pay/10000*(select service_charge_rate from wx_pay_account_bill where tenant_id=456)) receivePay,0 late_pay_price from wx_bill_other_deposit where status not in(3,6) | |||
| ) bill where bill.merchant_id = m.id | |||
| )/100,2),0) receivePay, | |||
| ifnull(round( | |||
| (select sum(ss.money) from ( | |||
| select ms.subsidy money,mm.id | |||
| @@ -777,7 +779,7 @@ | |||
| select receive_pay money,merchant_id id from wx_bill_other_deposit where status = 3 | |||
| )ss where ss.id = m.id | |||
| )/100,2),0) payOut, | |||
| (ifnull(round( | |||
| (select sum(bill.receive_pay) from ( | |||
| select merchant_id,receive_pay from wx_bill_rent where is_preview = 0 and status not in(3,6) | |||
| @@ -813,7 +815,7 @@ | |||
| select receive_pay money,merchant_id id from wx_bill_other_deposit where status = 3 | |||
| )ss where ss.id = m.id | |||
| )/100,2),0)) balance | |||
| from wx_merchant m | |||
| left join (select ms.merchant_id,s.type,GROUP_CONCAT(s.shop_number) as shop_number | |||
| from wx_merchant_shop ms inner join wx_shop s on ms.shop_id=s.id where ms.is_del=0 | |||
| @@ -822,6 +824,7 @@ | |||
| left join wx_rent_contract rc on(rc.merchant_id = m.id) | |||
| where m.status=1 | |||
| ) tt where 1=1 | |||
| <if test=" null != tenantId"> and tt.tenant_id = #{tenantId} </if> | |||
| <if test=" null != merchantId"> and tt.id = #{merchantId} </if> | |||
| <if test=" null != merchantName and ''!=merchantName">and tt.name like concat('%', #{merchantName},'%')</if> | |||
| @@ -829,6 +832,10 @@ | |||
| and (receivePay >0 or payOut>0) | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| <if test=" null == sortColumns"> order by tt.id desc </if> | |||
| <if test="null != limitStart and null != limitEnd"> | |||
| limit #{limitStart},#{limitEnd} | |||
| </if> | |||
| </select> | |||
| <select id="allDepositList" parameterType="com.iformall.domain.vo.WxBillAll" resultType="hashmap"> | |||