From d394283c0593d0cf2e2c422e8c915dcf56d57dce Mon Sep 17 00:00:00 2001 From: Burce Date: Fri, 25 Oct 2019 14:48:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E6=8B=9B=E5=95=86][=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E6=8F=90=E9=86=92]=E6=9F=A5=E8=AF=A2=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/invest/InvestBaseController.java | 2 ++ .../domain/po/invest/InvestRemindEntity.java | 5 +++-- .../service/invest/impl/InvestBizServiceImpl.java | 15 +++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java index ee2e2ac17..d3abfb8de 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java @@ -92,6 +92,8 @@ public class InvestBaseController extends BaseController { try { if (StringUtils.isBlank(text)) { setValue(null); + } else if (StringUtils.equals("undefined", text)) { + InvestHelper.throwException(ErrorCode.SYS_PARAMETER_ERROR, text); } else { setValue(InvestHelper.codeOf(clz, text)); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java index 28dc0cbe3..ca8462c27 100755 --- a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -49,11 +50,11 @@ public class InvestRemindEntity extends InvestBaseEntity { /** * 开始时间 */ - @io.swagger.annotations.ApiModelProperty(value = "开始时间", name = "beginDate" ,example = "2018-10-01 12:18:48") + @io.swagger.annotations.ApiModelProperty(value = "开始时间", name = "beginDate" ,example = "2018-10-01") private Date beginDate; /** * 结束时间 */ - @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endDate" ,example = "2018-10-01 12:18:48") + @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endDate" ,example = "2018-10-01") private Date endDate; } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index 73162dc1f..a07f85d16 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -38,6 +38,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.*; +import java.time.temporal.TemporalAmount; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.function.Function; @@ -595,8 +596,11 @@ public class InvestBizServiceImpl implements InvestBizService { } remindPageQuery.setQueryData(remindQuery); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.ge(Objects.nonNull(params.getRemindDate()), InvestRemindEntity::getBeginDate, getDayStart(params.getRemindDate())); - queryWrapper.ge(Objects.nonNull(params.getRemindDate()), InvestRemindEntity::getEndDate, getDayEnd(params.getRemindDate())); + queryWrapper.eq(InvestRemindEntity::getTenantId,InvestUserContext.getUser().getTenantId()); + queryWrapper.apply(Objects.nonNull(params.getRemindDate()), + "date_format(begin_date,'%Y-%m-%d') >= {0} AND date_format(end_date,'%Y-%m-%d') <= {1}" + , getDayStart(params.getRemindDate()) + , getDayEnd(params.getRemindDate())); queryWrapper.orderByDesc(InvestRemindEntity::getCreateDate); InvestPageResult recordPage = remindService.queryPage(remindPageQuery, queryWrapper); if (CollectionUtils.isEmpty(recordPage.getRecords())) { @@ -633,11 +637,14 @@ public class InvestBizServiceImpl implements InvestBizService { } private String getDayEnd(Date date) { - return DateUtils.format(date) + " 23:59:59"; + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_YEAR, 1); + return DateUtils.format(calendar.getTime()); } private String getDayStart(Date date) { - return DateUtils.format(date) + " 00:00:00"; + return DateUtils.format(date); } @Override From 54b3c8da41449b8dab861714d8d2ec037cfec4fa Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 25 Oct 2019 15:03:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E8=B4=A6=E5=8D=95][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E6=89=8B=E7=BB=AD=E8=B4=B9=E4=B8=8E=E6=BB=9E=E7=BA=B3=E9=87=91?= =?UTF-8?q?=E5=8F=98=E6=9B=B4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxBillDailyServiceImpl.java | 1 + .../impl/WxBillOtherDepositServiceImpl.java | 1 + .../service/impl/WxBillOtherServiceImpl.java | 13 +++++++------ .../service/impl/WxBillPropertyServiceImpl.java | 13 ++++++++----- .../service/impl/WxBillRentServiceImpl.java | 14 ++++++++------ 5 files changed, 25 insertions(+), 17 deletions(-) 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 30a419537..58f58a6d8 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java @@ -196,6 +196,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { if(record.getServiceChargePayUpdate() != null){ Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; wxBillDaily.setServiceChargePay(l.intValue()); + wxBillDaily.setOwe(wxBillDaily.getReceivePay() + wxBillDaily.getServiceChargePay() - wxBillDaily.getPay()); }else{ Long addpay = wxBillDaily.getPay(); wxBillDaily.setPayDate(record.getPayDate()); 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 d021d5bdb..1ca890f3a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java @@ -192,6 +192,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService if(record.getServiceChargePayUpdate() != null){ Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; wxBillOtherDeposit.setServiceChargePay(l.intValue()); + wxBillOtherDeposit.setOwe(wxBillOtherDeposit.getReceivePay() + wxBillOtherDeposit.getServiceChargePay() - wxBillOtherDeposit.getPay()); }else{ Long addpay = wxBillOtherDeposit.getPay(); wxBillOtherDeposit.setPayDate(record.getPayDate()); 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 b333990cf..4f4160c90 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java @@ -154,7 +154,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { } Date date = new Date(); if (record.getId() == null) { - logger.info("新增其他账单"); + logger.info("新增其他押金账单"); WxBillOther otherQuery = new WxBillOther(); otherQuery.setTenantId(record.getTenantId()); otherQuery.setMerchantId(record.getMerchantId()); @@ -176,10 +176,10 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { try { wxBillOtherMapper.insert(record); } catch (Exception e) { - logger.error("保存其他账单失败,e:" + e.getMessage()); + logger.error("保存其他押金账单失败,e:" + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); } - return new ResultData(Result.SUCCESS, "保存其他账单成功"); + return new ResultData(Result.SUCCESS, "保存其他押金账单成功"); } else { logger.info("更新其他押金账单"); WxBillOther wxBillOther = wxBillOtherMapper.selectById(record.getId()); @@ -192,6 +192,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { if(record.getServiceChargePayUpdate() != null){ Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; wxBillOther.setServiceChargePay(l.intValue()); + wxBillOther.setOwe(wxBillOther.getReceivePay() + wxBillOther.getServiceChargePay() - wxBillOther.getPay()); }else{ Long addpay = wxBillOther.getPay(); wxBillOther.setPayDate(record.getPayDate()); @@ -220,7 +221,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { try { wxBillOtherMapper.updateById(wxBillOther); } catch (Exception e) { - logger.error("更新其他账单失败,e:" + e.getMessage()); + logger.error("更新其他押金账单失败,e:" + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); } //日志 @@ -241,10 +242,10 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { try { wxBillActionService.save(wxBillAction); } catch (Exception e) { - logger.error("添加其他账单行为日志,e:" + e.getMessage()); + logger.error("添加其他押金账单行为日志,e:" + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); } - return new ResultData(Result.SUCCESS, "更新其他账单成功"); + return new ResultData(Result.SUCCESS, "更新其他押金账单成功"); } } 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 5b9159168..030680acd 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java @@ -180,6 +180,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { if (record.getServiceChargePayUpdate() != null) { Double l = Double.valueOf(record.getServiceChargePayUpdate()) * 100; property.setServiceChargePay(l.intValue()); + long latePayPrice = property.getLatePayPrice() == null ? 0 : property.getLatePayPrice(); + property.setOwe(property.getReceivePay() + latePayPrice + property.getServiceChargePay() - property.getPay()); } else { Long addpay = property.getPay(); property.setRevenue(record.getRevenue()); @@ -357,12 +359,13 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { @Override public ResultData updateLatePayMoney(WxBillProperty record, MallUserInfo user) { - final IdWorker idWorker = IdWorker.get(); - WxBillAction billAction = new WxBillAction(); + WxBillProperty property = wxBillPropertyMapper.selectById(record.getId()); if (record.getLatePayMoneyUpdate() != null) { - record.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); - + property.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); + property.setOwe(property.getReceivePay() + property.getLatePayPrice() + property.getServiceChargePay() - property.getPay()); + final IdWorker idWorker = IdWorker.get(); + WxBillAction billAction = new WxBillAction(); billAction.setId(idWorker.nextId()); billAction.setCreatetime(new Date()); billAction.setUserName("系统端"); @@ -372,7 +375,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { billAction.setUpdatetime(new Date()); wxBillActionMapper.insert(billAction); } - wxBillPropertyMapper.updateById(record); + wxBillPropertyMapper.updateById(property); return new ResultData(); } } 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 2c4171d7d..74d30dd9c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java @@ -182,6 +182,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { if(record.getServiceChargePayUpdate() != null){ Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; wxBillRent.setServiceChargePay(l.intValue()); + long latePayPrice = wxBillRent.getLatePayPrice() == null ? 0 : wxBillRent.getLatePayPrice(); + wxBillRent.setOwe(wxBillRent.getReceivePay() + latePayPrice + wxBillRent.getServiceChargePay() - wxBillRent.getPay()); }else{ Long addpay = wxBillRent.getPay(); wxBillRent.setRevenue(record.getRevenue()); @@ -468,12 +470,12 @@ public class WxBillRentServiceImpl implements WxBillRentService { @Override public ResultData updateLatePayMoney(WxBillRent record, MallUserInfo user) { - final IdWorker idWorker = IdWorker.get(); - WxBillAction billAction = new WxBillAction(); - + WxBillRent rent = wxBillRentMapper.selectById(record.getId()); if(record.getLatePayMoneyUpdate() != null) { - record.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); - + rent.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); + rent.setOwe(rent.getReceivePay() + rent.getLatePayPrice() + rent.getServiceChargePay() - rent.getPay()); + final IdWorker idWorker = IdWorker.get(); + WxBillAction billAction = new WxBillAction(); billAction.setId(idWorker.nextId()); billAction.setCreatetime(new Date()); billAction.setUserName("系统端"); @@ -483,7 +485,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { billAction.setUpdatetime(new Date()); wxBillActionMapper.insert(billAction); } - wxBillRentMapper.updateById(record); + wxBillRentMapper.updateById(rent); return new ResultData(); } }