From b9ae4f675e01517280a893d4c10e9f676d4216ef Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Fri, 28 Dec 2018 21:51:06 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[rentcontract][=E4=BF=AE=E6=94=B9]:updateRe?= =?UTF-8?q?ntContractStatus=E6=B7=BB=E5=8A=A0=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxRentContractServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 46c528692..bd25c5bba 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -702,6 +702,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { @Override public ResultData updateRentContractStatus(Long id) { + if(id == null) { + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); + } //更新合同状态为签约 WxRentContract wxRentContract = new WxRentContract(); wxRentContract.setId(id); @@ -709,8 +712,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { wxRentContractMapper.updateByPrimaryKeySelective(wxRentContract); //建立账单 WxRentContract record = wxRentContractMapper.selectByPrimaryKey(id); - if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) - && record.getReceivePeriod() != null && record.getDeposit() > 0 && record.getPrice() > 0) { + if (record != null && + record.getMerchantId() != null && + record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) && + record.getReceivePeriod() != null && + record.getDeposit() > 0 && + record.getPrice() > 0) { WxBillRent wxBillRent = new WxBillRent(); wxBillRent.setMerchantId(record.getMerchantId()); List> billRentList = wxBillRentMapper.queryBillRentList(wxBillRent); From 6ebff062b63d9bd0ed85d027dddbcbdde9e7a083 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Sat, 29 Dec 2018 10:04:55 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[=E5=88=86=E8=B4=A6=E5=AF=B9=E8=B4=A6?= =?UTF-8?q?=E5=8D=95][=E4=BF=AE=E6=94=B9][=E6=8E=92=E9=98=9F=E6=8E=A5?= =?UTF-8?q?=E6=94=B6=E8=80=85=E4=B8=BA0=E7=9A=84=E6=95=B0=E6=8D=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/WxProfitSharingOrderMapper.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml index d65314805..3b77a249d 100644 --- a/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxProfitSharingOrderMapper.xml @@ -190,12 +190,10 @@ From fef3ac0ed4d674bc0ef9cba2a0a879fab1ded9ab Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Sat, 29 Dec 2018 10:21:55 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[=E9=87=8D=E5=A4=8D=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=93=8D=E4=BD=9C=E5=BC=82=E5=B8=B8=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E5=8F=91email=EF=BC=8C=E4=B9=9F=E4=B8=8D=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E5=A0=86=E6=A0=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/GlobalDefultExceptionHandler.java | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/common/GlobalDefultExceptionHandler.java b/mallinkService/src/main/java/com/iformall/common/GlobalDefultExceptionHandler.java index 331c6267d..c92bde582 100644 --- a/mallinkService/src/main/java/com/iformall/common/GlobalDefultExceptionHandler.java +++ b/mallinkService/src/main/java/com/iformall/common/GlobalDefultExceptionHandler.java @@ -34,13 +34,11 @@ public class GlobalDefultExceptionHandler { log(e, request); if(isFmException) { - if(e instanceof MallinkException) { + // 处理异常,发送邮件 + if(checkExceptionType(e)) { + // 某些异常不发邮件 MallinkException me = (MallinkException)e; - if(me.getErrorCode() == ErrorCode.NET_TOKEN_EMPTY.getCode() - || me.getErrorCode() == ErrorCode.NET_TOKEN_INVALID.getCode()) { - // token异常问题, 不发邮件 - return new ResultData(me.getErrorCode(),me.getMessage()); - } + return new ResultData(me.getErrorCode(),me.getMessage()); } StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); @@ -66,6 +64,12 @@ public class GlobalDefultExceptionHandler { private void log(Exception ex, HttpServletRequest request) { logger.error("************************异常开始*******************************"); + if(checkExceptionType(ex)) { + // 特殊异常不打印堆栈 + logger.error(ex.getMessage()); + logger.error("************************异常结束*******************************"); + return; + } logger.error("请求地址:" + request.getRequestURL()); Enumeration enumeration = request.getParameterNames(); logger.error("请求参数"); @@ -80,4 +84,19 @@ public class GlobalDefultExceptionHandler { } logger.error("************************异常结束*******************************"); } + + private boolean checkExceptionType(Exception e) { + if(e instanceof MallinkException) { + MallinkException me = (MallinkException)e; + if(me.getErrorCode() == ErrorCode.NET_TOKEN_EMPTY.getCode() + || me.getErrorCode() == ErrorCode.NET_TOKEN_INVALID.getCode()) { + // token异常问题, 不发邮件 + return true; + } else if(me.getErrorCode() == ErrorCode.SYS_REPEAT_SUBMIT_EXCEPTION.getCode()) { + // 重复访问不打印异常消息 + return true; + } + } + return false; + } } From 7c7450f2cef80370371e41555ad6483d952f8d83 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Sat, 29 Dec 2018 11:00:10 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[=E5=AF=B9=E8=B4=A6=E5=8D=95][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E6=80=BB=E6=95=B0=E4=B8=BA=E8=BF=9130=E5=A4=A9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/impl/WxOrderServiceImpl.java | 11 ++++++++--- .../service/impl/WxProfitSharingOrderServiceImpl.java | 5 ++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index 1c1eab2b7..d658ec1ef 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -986,13 +986,16 @@ public class WxOrderServiceImpl implements WxOrderService { } public void queryMerchantCount(String tenantId, Map result) { + String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); //全部商户个数 Map params = new HashMap<>(); params.put("tenantId", tenantId); + String thirtyTime = DateUtils.getTimeBefore(29, new Date()); + params.put("startdate", thirtyTime + " 00:00:00"); + params.put("enddate", systemTime + " 23:59:59"); Long allMerchantCount=wxOrderMapper.queryOrderForMerchantCount(params); result.put("allMerchantCount",allMerchantCount); //今日 - String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); params.put("startdate", systemTime + " 00:00:00"); params.put("enddate", systemTime + " 23:59:59"); Long todayMerchantCount=wxOrderMapper.queryOrderForMerchantCount(params); @@ -1028,13 +1031,16 @@ public class WxOrderServiceImpl implements WxOrderService { } public void queryOrderSummary(String tenantId, Map result) { + String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); //全部商户个数 Map params = new HashMap<>(); params.put("tenantId", tenantId); + String thirtyTime = DateUtils.getTimeBefore(29, new Date()); + params.put("startdate", thirtyTime + " 00:00:00"); + params.put("enddate", systemTime + " 23:59:59"); Long allOrderSummary=wxOrderMapper.queryOrderForSum(params); result.put("allOrderSummary",allOrderSummary); //今日 - String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); params.put("startdate", systemTime + " 00:00:00"); params.put("enddate", systemTime + " 23:59:59"); Long todayOrderSummary=wxOrderMapper.queryOrderForSum(params); @@ -1069,5 +1075,4 @@ public class WxOrderServiceImpl implements WxOrderService { } } - } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java index 51d0ed53c..d03e3af09 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitSharingOrderServiceImpl.java @@ -665,13 +665,16 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ } public void queryMerchantCount(String tenantId, Map result) { + String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); //全部商户个数 Map params = new HashMap<>(); params.put("tenantId", tenantId); + String thirtyTime = DateUtils.getTimeBefore(29, new Date()); + params.put("startdate", thirtyTime + " 00:00:00"); + params.put("enddate", systemTime + " 23:59:59"); Long allMerchantCount=wxProfitSharingOrderMapper.queryOrderForMerchantCount(params); result.put("allMerchantCount",allMerchantCount); //今日 - String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); params.put("startdate", systemTime + " 00:00:00"); params.put("enddate", systemTime + " 23:59:59"); Long todayMerchantCount=wxProfitSharingOrderMapper.queryOrderForMerchantCount(params); From 825cb21a28057bd6bb6bd12488601be39b8342b8 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Sun, 30 Dec 2018 09:05:33 +0800 Subject: [PATCH 5/5] =?UTF-8?q?[=E8=A1=A5=E8=B4=B4][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E8=A1=A5=E8=B4=B4=E9=A2=9D=E8=A6=81=E4=BF=9D=E5=AD=98=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/domain/po/WxCoupon.java | 15 +++++++++++++++ .../service/impl/WxCouponServiceImpl.java | 3 +++ 2 files changed, 18 insertions(+) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index 2717502eb..26fa601b7 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -53,6 +53,9 @@ public class WxCoupon implements Serializable { @Transient private String priceStr; + @Transient + private String subsidyNumStr; + @Transient private Date startdate; @@ -318,6 +321,18 @@ public class WxCoupon implements Serializable { return priceStr; } + public String getSubsidyNumStr() { + if(subsidyNum!=null) { + subsidyNumStr = new BigDecimal(subsidyNum).divide(new BigDecimal(100)).toString(); + } + return subsidyNumStr; + } + + public void setSubsidyNumStr(String subsidyNumStr) { + this.subsidyNumStr = subsidyNumStr; + + } + public void setPriceStr(String priceStr) { this.priceStr = priceStr; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index a9a17aaef..dc17646f0 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -95,6 +95,9 @@ public class WxCouponServiceImpl implements WxCouponService { if (StringUtils.isNotEmpty(record.getPriceStr())) { record.setPrice((int) (Double.parseDouble(record.getPriceStr()) * 100)); } + if (StringUtils.isNotEmpty(record.getSubsidyNumStr())) { + record.setSubsidyNum((int) (Double.parseDouble(record.getSubsidyNumStr()) * 100)); + } if (record.getValidType() != null) { if (record.getValidType().equals(EnumCouponValidType.DAYS_AFTER_RECEIVING)) {