diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/sys/MallUserInfoController.java b/mallinkAdmin/src/main/java/com/iformall/controller/sys/MallUserInfoController.java index 5cabed938..4415afdbe 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/sys/MallUserInfoController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/sys/MallUserInfoController.java @@ -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({ diff --git a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java index 4ce39a2d0..5aaa2fc83 100644 --- a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -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; } } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java index e173ed315..e4fae0b6c 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java @@ -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; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java index d52a06d3e..f019263a2 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java @@ -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; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java index 100abd9eb..1238a3648 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java @@ -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; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java index 74519dfb4..dbe308fab 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java @@ -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; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java index 0c94f8136..74d850971 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java @@ -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; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java index d3a8db6ec..9735cbc4f 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java @@ -210,4 +210,6 @@ public class WxBillRent extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") @TableField(exist = false) private Long realReceivePay; + + } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java index 4d310d355..8fb4b02e0 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxBillAll.java @@ -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; + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 29f5ea41a..5ce01abc3 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -1719,19 +1719,36 @@ public class WxBillAllServiceImpl implements WxBillAllService { @Override public Map getReceiveAndPayBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize) { - PageInfo> 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 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> 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> list = wxBillAllMapper.getReceiveAndPayBillAsPage(record); + + PageHelper.startPage(pageNum, pageSize); + PageInfo> pageInfo = new PageInfo(list); + pageInfo.setPages(pages); + pageInfo.setTotal(total); + PageHelper.clearPage(); result.put("pageInfo", pageInfo); return result; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java index 81e011b0a..bde2ff563 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java @@ -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()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java index 4828a712b..22da6ca52 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java @@ -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()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java index bcd82a94b..20224990a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java @@ -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()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java index 97d6abcb4..aadcd2424 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java @@ -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()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java index ee4866fb2..4d625b0d5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java @@ -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()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java index 12b5c1eaa..8b6be5106 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java @@ -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{ diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java index 5efba1555..fcff8bb92 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java @@ -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()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java index 8e50eb6f1..46e368a31 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java @@ -762,14 +762,44 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId); WxCUserTags userTags = getById(wxCUserBasicInfo.getTagId()); List 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 tagList, Long id, WxTags wxTags) { + List 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; + } + } diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index 8b25ffe46..d4fa4cffa 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -739,26 +739,28 @@