From e4537c33c511b66b77a882367c67d0ddab228a05 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Thu, 4 Jul 2019 17:50:51 +0800 Subject: [PATCH 01/13] =?UTF-8?q?[=E6=B4=BB=E5=8A=A8][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8C=87=E7=A4=BA]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/impl/WxActivityServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityServiceImpl.java index 109cfefe6..964431b51 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityServiceImpl.java @@ -159,13 +159,14 @@ public class WxActivityServiceImpl implements WxActivityService { WxCampaign campaignQuery = new WxCampaign(); campaignQuery.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); int count = wxCampaignMapper.selectCount(campaignQuery); - if (count == 7) { - throw new MallinkException(ErrorCode.ACTIVITY_SEND_ERROR); + int campaignTotal = 7; + if (count == campaignTotal) { + return new ResultData(ErrorCode.ACTIVITY_SEND_ERROR); } //修改投放状态 WxActivity wxActivity = wxActivityMapper.selectByPrimaryKey(id); if (wxActivity.getEndTime().before(new Date())) { - throw new MallinkException(ErrorCode.ACTIVITY_JOIN_TIME_END); + return new ResultData(ErrorCode.ACTIVITY_JOIN_TIME_END); } wxActivity.setStatus(EnumActivityStatus.INJECT_CAMPAIGN.getCode()); wxActivity.setUpdateTime(new Date()); From 06282e03bda42a48a476964e4810d2749dafc9d4 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Thu, 4 Jul 2019 17:56:48 +0800 Subject: [PATCH 02/13] =?UTF-8?q?[=E6=B4=BB=E5=8A=A8][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8C=87=E7=A4=BA]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxActivityJoinServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java index 2e8d5cf5c..25af72644 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java @@ -12,6 +12,7 @@ import com.iformall.domain.po.WxCUser; import com.iformall.domain.po.WxCreditHistory; import com.iformall.domain.po.msg.WxMsgRecord; import com.iformall.enums.*; +import com.iformall.exception.MallinkException; import com.iformall.mapper.*; import com.iformall.mq.MqBaseProducer; import com.iformall.service.ExcelService; @@ -168,10 +169,11 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { wxCreditHistory.setCreditType(EnumScoreType.ACTIVITY_JOIN.getCode()); wxCreditHistory.setOperatorType(EnumUserType.CUSER.getCode()); wxCreditHistory.setOperatorId(wxActivityJoin.getUserId()); - WxCreditHistory creditHistory = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); - Map data = new HashMap<>(2); - data.put("useCredit", credit); - data.put("totalCredit", creditHistory.getCreditAmount()); + try { + wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + } catch (MallinkException e) { + return new ResultData(e.getErrorCode(), e.getMessage()); + } } //保存到报名表中 final IdWorker idWorker = IdWorker.get(); From aa6e58c6d7860873288de1b3e75c49a74be581c9 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Thu, 4 Jul 2019 18:56:50 +0800 Subject: [PATCH 03/13] =?UTF-8?q?[=E6=B4=BB=E5=8A=A8][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8C=87=E7=A4=BA]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/controller/WxActivityJoinController.java | 7 ++++++- .../iformall/service/impl/WxActivityJoinServiceImpl.java | 8 +------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxActivityJoinController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxActivityJoinController.java index c18baaf45..fe00c456a 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxActivityJoinController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxActivityJoinController.java @@ -5,6 +5,7 @@ import com.iformall.common.ErrorCode; import com.iformall.common.ResultData; import com.iformall.domain.po.WxActivity; import com.iformall.domain.po.WxActivityJoin; +import com.iformall.exception.MallinkException; import com.iformall.service.WxActivityJoinService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -50,7 +51,11 @@ public class WxActivityJoinController extends BaseController { wxActivityJoin.setTenantId(getTenantId()); wxActivityJoin.setUserId(getUserId()); wxActivityJoin.setNickName(getUser().getNickName()); - return wxActivityJoinService.join(wxActivityJoin); + try { + return wxActivityJoinService.join(wxActivityJoin); + } catch (MallinkException e) { + return new ResultData(e.getErrorCode(), e.getMessage()); + } } @ApiOperation("签到") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java index 25af72644..14e67748e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java @@ -12,7 +12,6 @@ import com.iformall.domain.po.WxCUser; import com.iformall.domain.po.WxCreditHistory; import com.iformall.domain.po.msg.WxMsgRecord; import com.iformall.enums.*; -import com.iformall.exception.MallinkException; import com.iformall.mapper.*; import com.iformall.mq.MqBaseProducer; import com.iformall.service.ExcelService; @@ -147,7 +146,6 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) @Override public ResultData join(WxActivityJoin wxActivityJoin) { - WxActivityJoin joinQuery = new WxActivityJoin(); joinQuery.setUserId(wxActivityJoin.getUserId()); joinQuery.setActivityId(wxActivityJoin.getActivityId()); @@ -169,11 +167,7 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { wxCreditHistory.setCreditType(EnumScoreType.ACTIVITY_JOIN.getCode()); wxCreditHistory.setOperatorType(EnumUserType.CUSER.getCode()); wxCreditHistory.setOperatorId(wxActivityJoin.getUserId()); - try { - wxCreditHistoryService.saveOrUpdate(wxCreditHistory); - } catch (MallinkException e) { - return new ResultData(e.getErrorCode(), e.getMessage()); - } + wxCreditHistoryService.saveOrUpdate(wxCreditHistory); } //保存到报名表中 final IdWorker idWorker = IdWorker.get(); From 1792a6f14c2dcb4b5732c4abdd9bc439d074a3ad Mon Sep 17 00:00:00 2001 From: luozukai Date: Thu, 4 Jul 2019 19:41:27 +0800 Subject: [PATCH 04/13] =?UTF-8?q?[=E5=AE=A1=E6=89=B9][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98=E6=8A=A5=E9=94=99]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/controller/basic/WxBrandController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxBrandController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxBrandController.java index 71b6a295d..72557307a 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxBrandController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxBrandController.java @@ -75,7 +75,7 @@ public class WxBrandController extends BaseController { wxMerchant.setBrand(wxBrand.getId()); List merchantList = wxMerchantService.findList(wxMerchant); if(CollectionUtils.isNotEmpty(merchantList)){ - return new ResultData(Result.ERROR, "您有未解绑的商户,请先解绑。"); + return new ResultData(Result.ERROR, "请先删除已绑定该品牌的商户。"); } } wxBrandService.update(wxBrand); From 4763aa14837f58366ce082ee6ed5afb505e5f3ee Mon Sep 17 00:00:00 2001 From: hupeng Date: Thu, 4 Jul 2019 21:01:54 +0800 Subject: [PATCH 05/13] =?UTF-8?q?[=E5=8D=A1=E5=88=B8][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E5=8D=A1=E5=88=B8=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E4=BD=BF=E7=94=A8=E4=B8=80=E4=B8=AA=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/service/impl/WxOrderServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 b7a3028be..b783f50d7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -1199,8 +1199,9 @@ public class WxOrderServiceImpl implements WxOrderService { order = saveFreeOrderForCoupon(user, coupon, orderSaveDto.getCouponChannelId(), orderSaveDto.getFormId()); if(order != null) { // 6. 下订单完成,发送内部消息 + // 下订单完成,发送内部消息 try { - sendInsideOrderSuccessMsg(order, coupon, user); + sendOrderSuccessActionMsg(order); } catch (Exception e) { logger.error("内部消息发送失败: " + e.getMessage()); throw new MallinkException(ErrorCode.MSG_INSIDE_ERROR); From f61578b233ce3359355ab5977528939aa9bb5f31 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Fri, 5 Jul 2019 09:53:58 +0800 Subject: [PATCH 06/13] =?UTF-8?q?[=E6=B4=BB=E5=8A=A8=E6=8A=A5=E5=90=8D][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:catch=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/market/WxActivityController.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java index 0e8cac415..fea5d1104 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; import com.iformall.domain.po.WxActivity; import com.iformall.enums.EnumActivityStatus; +import com.iformall.exception.MallinkException; import com.iformall.service.WxActivityService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -54,7 +55,12 @@ public class WxActivityController extends BaseController { logger.debug("[" + getIpAddr() + "] WxActivityController::add"); wxActivity.setStatus(EnumActivityStatus.STATUS_THROW_IN.getCode()); wxActivity.setTenantId(getTenantId()); - wxActivityService.saveOrUpdate(wxActivity); + try { + wxActivityService.saveOrUpdate(wxActivity); + } catch (MallinkException e) { + logger.error(e.getMessage()); + return new ResultData(e.getErrorCode(), e.getMessage()); + } return new ResultData(); } @@ -63,7 +69,12 @@ public class WxActivityController extends BaseController { @SystemControllerLog(description = "活动-id更新") public ResultData update(@RequestBody WxActivity wxActivity) { logger.debug("[" + getIpAddr() + "] WxActivityController::update"); - return wxActivityService.saveOrUpdate(wxActivity); + try { + return wxActivityService.saveOrUpdate(wxActivity); + } catch (MallinkException e) { + logger.error(e.getMessage()); + return new ResultData(e.getErrorCode(), e.getMessage()); + } } @ApiOperation("根据id更新接口") From 40698ac43775730137c3ee9debdc622902e534eb Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 5 Jul 2019 10:19:45 +0800 Subject: [PATCH 07/13] =?UTF-8?q?[=E7=89=A9=E4=B8=9A=E5=90=88=E5=90=8C][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E6=B2=A1=E6=9C=89=E7=A7=9F=E8=B5=81?= =?UTF-8?q?=E5=90=88=E5=90=8C=E4=B8=8D=E8=83=BD=E5=88=9B=E5=BB=BA=E7=89=A9?= =?UTF-8?q?=E4=B8=9A=E5=90=88=E5=90=8C]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/service/impl/WxPropertyContractServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 6e5813322..82249435e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -262,6 +262,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService wxRentContract.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { return new ResultData(ErrorCode.RENT_CONTRACT_IS_TERMINATED); } + } else { + return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); } if (null == record.getMerchantId() && record.getOperationType().equals(EnumContractOperationType.PART.getCode())) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId不能为空"); @@ -365,7 +367,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND); } - record.setRentalStartDate(wxPropertyContract.getRentalStartDate()); + record.setRentalStartDate(wxRentContract.getRentalStartDate()); record.setRentalEndDate(wxRentContract.getRentalEndDate()); record.setStartDate(wxRentContract.getStartDate()); record.setEndDate(wxRentContract.getEndDate()); From d9363fb9c191e86a6bc499e8c6a3cab772350cb7 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Fri, 5 Jul 2019 10:29:53 +0800 Subject: [PATCH 08/13] =?UTF-8?q?[queryData][=E4=BF=AE=E6=94=B9]:NullPoint?= =?UTF-8?q?er=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/impl/WxChartServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java index 94110d4c1..e112021fb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java @@ -84,14 +84,18 @@ public class WxChartServiceImpl implements WxChartDataService { public ResultData queryData(Map paramsMap) { String tenantId = paramsMap.get("tenantId"); Integer chart = Integer.valueOf(paramsMap.get("chart")); - String startdate = paramsMap.get("startdate") + " 00:00:00"; - String enddate = paramsMap.get("enddate") + " 23:59:59"; + String startdate = paramsMap.get("startdate"); + String enddate = paramsMap.get("enddate"); if (StringUtils.isEmpty(startdate)) { startdate = DateUtils.getSystemTime("yyyy-MM-dd") + " 00:00:00" ; + } else { + startdate = startdate + " 00:00:00"; } if (StringUtils.isEmpty(enddate)) { enddate = DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"; + } else { + enddate = enddate + " 23:59:59"; } //出租率 From 23185a84f86ba1e7e807d82e8ca6522d2202439b Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 5 Jul 2019 10:47:51 +0800 Subject: [PATCH 09/13] =?UTF-8?q?[=E5=8D=B7][=E4=BF=AE=E6=94=B9][=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=BC=95=E6=93=8E=E4=B8=8D=E8=BF=87=E6=BB=A4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/controller/market/WxCouponController.java | 8 ++++++++ .../src/main/java/com/iformall/tenant/TenantInfoImpl.java | 4 ++++ .../com/iformall/service/impl/WxChartServiceImpl.java | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index 9def9d0b9..538c7a8ac 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -179,6 +179,14 @@ public class WxCouponController extends BaseController { if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); } + if(DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) + && wxCoupon.getInventory().equals(coupon.getInventory()) + || + (DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) && + wxCoupon.getValidDays().equals(coupon.getValidDays())) + ){ + return new ResultData(ErrorCode.COUPON_STOCK_VALID_DATE_SETTING_ERR); + } } //启动审批流 diff --git a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java index 18ffe2c96..c8ff737d0 100644 --- a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -100,6 +100,10 @@ public class TenantInfoImpl implements TenantInfo { return true; if ("com.iformall.mapper.WxActivityJoinMapper.updateStatus".equals(ms.getId())) return true; + if ("com.iformall.mapper.WxCouponMapper.findCouponList".equals(ms.getId())) + return true; + if ("com.iformall.mapper.WxCouponMapper.findCouponListCount".equals(ms.getId())) + return true; return false; } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java index e112021fb..cc656913a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java @@ -87,6 +87,10 @@ public class WxChartServiceImpl implements WxChartDataService { String startdate = paramsMap.get("startdate"); String enddate = paramsMap.get("enddate"); + if(chart == null){ + return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN); + } + if (StringUtils.isEmpty(startdate)) { startdate = DateUtils.getSystemTime("yyyy-MM-dd") + " 00:00:00" ; } else { From d572ea673726fbab1aa1655185a726e072904d3f Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 5 Jul 2019 10:59:17 +0800 Subject: [PATCH 10/13] =?UTF-8?q?[=E5=8D=B7][=E4=BF=AE=E6=94=B9][=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=BC=95=E6=93=8E=E4=B8=8D=E8=BF=87=E6=BB=A4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V201907051056__L_ADD_FLOW_DATA.sql | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201907051056__L_ADD_FLOW_DATA.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201907051056__L_ADD_FLOW_DATA.sql b/mallinkAdmin/src/main/resources/db/migration/V201907051056__L_ADD_FLOW_DATA.sql new file mode 100644 index 000000000..4c9a5fb53 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201907051056__L_ADD_FLOW_DATA.sql @@ -0,0 +1,90 @@ +delete from wx_flow_config where name in('营销审批','拼团审批','有价卷审批','卡审批','砍价审批'); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560252222, 0, '789', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560253333, 0, '790', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560254444, 0, '1001', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560255555, 0, '1002', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560255556, 0, '1003', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560256666, 0, '1004', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560257777, 0, '1005', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560258888, 0, '1006', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560259999, 0, '1007', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560260000, 0, '1008', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560260001, 0, '1009', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + From 0512486012591c448a3479070fc449079b4d6105 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 5 Jul 2019 11:09:27 +0800 Subject: [PATCH 11/13] =?UTF-8?q?[=E5=8D=B7][=E4=BF=AE=E6=94=B9][=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E5=BC=95=E6=93=8E=E4=B8=8D=E8=BF=87=E6=BB=A4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/controller/market/WxCouponController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index 538c7a8ac..4b8a1f401 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -179,10 +179,10 @@ public class WxCouponController extends BaseController { if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); } - if(DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) - && wxCoupon.getInventory().equals(coupon.getInventory()) + if((wxCoupon.getValidEndDate()!=null&&coupon.getValidEndDate()!=null && DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) + && wxCoupon.getInventory().equals(coupon.getInventory())) || - (DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) && + (wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getInventory().equals(coupon.getInventory()) && wxCoupon.getValidDays().equals(coupon.getValidDays())) ){ return new ResultData(ErrorCode.COUPON_STOCK_VALID_DATE_SETTING_ERR); From 030035886476e90ba648a572a5b8297c9003463e Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 5 Jul 2019 11:09:41 +0800 Subject: [PATCH 12/13] =?UTF-8?q?[=E8=B4=A6=E5=8D=95=E5=88=97=E8=A1=A8][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][SQL=E8=B0=83=E6=95=B4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/WxBillAllMapper.xml | 178 +++++++++--------- 1 file changed, 84 insertions(+), 94 deletions(-) diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index b5952dcfc..f85307324 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -53,45 +53,37 @@ select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments - from wx_bill_rent where is_preview = 0 - union + from wx_bill_rent where tenant_id=#{tenantId} and is_preview = 0 + union all select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' - endtime,rent_shop_type,shop_info,NULL comments from wx_bill_rent_deposit - union + endtime,rent_shop_type,shop_info,NULL comments from wx_bill_rent_deposit where tenant_id=#{tenantId} + union all select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments - from wx_bill_property where is_preview = 0 - union + from wx_bill_property where tenant_id=#{tenantId} and is_preview = 0 + union all select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' - endtime,rent_shop_type,shop_info,NULL comments from wx_bill_property_deposit - union - select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as + endtime,rent_shop_type,shop_info,NULL comments from wx_bill_property_deposit where tenant_id=#{tenantId} + union all + select id,merchant_id,shop_id,tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name, + case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value, + case when type=1 then '水费' when type=2 then '电费' else '空调费' end bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, rent_shop_type,'[]' shop_info,NULL comments - from wx_bill_daily where type=1 - union - select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as - need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, - rent_shop_type,'[]' shop_info,NULL comments - from wx_bill_daily where type=2 - union - select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as - need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, - rent_shop_type,'[]' shop_info,NULL comments - from wx_bill_daily where type=3 - union + from wx_bill_daily where tenant_id=#{tenantId} + union all select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, rent_shop_type,'[]' shop_info,comments - from wx_bill_other - union + from wx_bill_other where tenant_id=#{tenantId} + union all select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,'其他押金' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, rent_shop_type,'[]' shop_info,comments - from wx_bill_other_deposit + from wx_bill_other_deposit where tenant_id=#{tenantId} ) bill left join wx_merchant m on bill.merchant_id=m.id left join wx_shop s on bill.shop_id=s.id @@ -130,34 +122,34 @@ select count(bill.id) owncount,IFNULL(sum(bill.owe),0) owe from ( select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent_deposit - union + union all select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_property where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_property_deposit - union + union all select id,merchant_id,shop_id,tenant_id,5 bill_type_value,'水费' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where type=1 - union + union all select id,merchant_id,shop_id,tenant_id,6 bill_type_value,'电费' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where type=2 - union + union all select id,merchant_id,shop_id,tenant_id,9 bill_type_value,'空调费' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where type=3 - union + union all select id,merchant_id,shop_id,tenant_id,7 bill_type_value,'其他' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other - union + union all select id,merchant_id,shop_id,tenant_id,8 bill_type_value,'其他押金' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit ) bill @@ -185,34 +177,34 @@ select count(bill.id) paycount,IFNULL(sum(bill.pay),0) pay from ( select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent_deposit - union + union all select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_property where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_property_deposit - union + union all select id,merchant_id,shop_id,tenant_id,5 bill_type_value,'水费' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where type=1 - union + union all select id,merchant_id,shop_id,tenant_id,6 bill_type_value,'电费' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where type=2 - union + union all select id,merchant_id,shop_id,tenant_id,9 bill_type_value,'空调费' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where type=3 - union + union all select id,merchant_id,shop_id,tenant_id,7 bill_type_value,'其他' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other - union + union all select id,merchant_id,shop_id,tenant_id,8 bill_type_value,'其他押金' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit ) bill @@ -237,42 +229,40 @@ rentShopType from ( select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type - from wx_bill_rent where is_preview = 0 and rent_contract_id in (select id from wx_rent_contract where status in + from wx_bill_rent where is_preview = 0 and tenant_id=#{tenantId}and rent_contract_id in (select id from + wx_rent_contract where status in (2,3,4)) - union + union all select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type - from wx_bill_rent_deposit where rent_contract_id in (select id from wx_rent_contract where status in (2,3,4)) - union + from wx_bill_rent_deposit where tenant_id=#{tenantId} and rent_contract_id in (select id from wx_rent_contract + where status in (2,3,4)) + union all select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type - from wx_bill_property where is_preview = 0 and property_contract_id in (select id from wx_property_contract + from wx_bill_property where is_preview = 0 and tenant_id=#{tenantId} and property_contract_id in (select id from + wx_property_contract where status in(2,3,4)) - union + union all select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type - from wx_bill_property_deposit where property_contract_id in (select id from wx_property_contract where status in + from wx_bill_property_deposit where tenant_id=#{tenantId} and property_contract_id in (select id from + wx_property_contract where status in (2,3,4)) - union - select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type, 0 as - need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type - from wx_bill_daily where type=1 - union - select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as - need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type - from wx_bill_daily where type=2 - union - select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as - need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type - from wx_bill_daily where type=3 - union + union all + select id,merchant_id,shop_id,tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name, + case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value, + case when type=1 then '水费' when type=2 then '电费' else '空调费' end bill_type, 0 as need_pay,receive_pay, + pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type + from wx_bill_daily where tenant_id=#{tenantId} + union all select id,merchant_id,shop_id,tenant_id,name,7 bill_type_vaue,'其他' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type - from wx_bill_other - union + from wx_bill_other where tenant_id=#{tenantId} + union all select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,'其他押金' bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type - from wx_bill_other_deposit + from wx_bill_other_deposit where tenant_id=#{tenantId} ) bill left join wx_merchant m on bill.merchant_id=m.id left join wx_shop s on bill.shop_id=s.id @@ -323,35 +313,35 @@ select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_rent where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_rent_deposit - union + union all select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_property where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_property_deposit - union + union all select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=1 - union + union all select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=2 - union + union all select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=3 - union + union all select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_other - union + union all select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_other_deposit @@ -370,35 +360,35 @@ select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_rent where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_rent_deposit - union + union all select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_property where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_property_deposit - union + union all select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=1 - union + union all select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=2 - union + union all select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=3 - union + union all select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_other - union + union all select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_other_deposit @@ -417,11 +407,11 @@ select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_rent where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_rent_deposit - union + union all select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_property where is_preview = 0 @@ -429,23 +419,23 @@ select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_property_deposit - union + union all select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=1 - union + union all select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=2 - union + union all select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=3 - union + union all select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_other - union + union all select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_other_deposit @@ -468,35 +458,35 @@ select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_rent where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_rent_deposit - union + union all select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_property where is_preview = 0 - union + union all select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_property_deposit - union + union all select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=1 - union + union all select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=2 - union + union all select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_daily where type=3 - union + union all select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_other - union + union all select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type from wx_bill_other_deposit From 8f7259c42c99177fb4bb80de9bb055950dc2c972 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Fri, 5 Jul 2019 11:10:31 +0800 Subject: [PATCH 13/13] =?UTF-8?q?[ProperTyContract/findById][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]:=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contract/WxPropertyContractController.java | 10 ++++++++-- .../impl/WxRentPropertyContractServiceImpl.java | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java index fc0ddd668..7c3ec44e9 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java @@ -8,6 +8,7 @@ import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.WxBillProperty; import com.iformall.domain.po.WxPropertyContract; import com.iformall.enums.EnumRentStartType; +import com.iformall.exception.MallinkException; import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.service.WxBillPropertyService; import com.iformall.service.WxPropertyContractService; @@ -107,8 +108,13 @@ public class WxPropertyContractController extends BaseController { WxBillProperty wxBillProperty = new WxBillProperty(); wxBillProperty.setTenantId(super.getTenantId()); wxBillPropertyService.updateBillStatus(wxBillProperty); - Map data = wxPropertyContractService.getById(id); - return new ResultData(data); + try { + Map data = wxPropertyContractService.getById(id); + return new ResultData(data); + } catch (MallinkException e) { + logger.error(e.getMessage()); + return new ResultData(e.getErrorCode(), e.getMessage()); + } } @RequestMapping("/download") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java index 49f94c4e4..5f11d9121 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java @@ -7,6 +7,7 @@ import com.iformall.domain.po.WxBillProperty; import com.iformall.domain.po.WxPropertyContract; import com.iformall.domain.po.WxRentContract; import com.iformall.domain.vo.WxRentPropertyContractVo; +import com.iformall.exception.MallinkException; import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxRentContractMapper; import com.iformall.service.WxPropertyContractService; @@ -71,8 +72,12 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract wxPropertyContractQuery.setRentContractId(id); WxPropertyContract propertyContract = wxPropertyContractMapper.selectOne(wxPropertyContractQuery); if (propertyContract != null) { - Map property = wxPropertyContractService.getById(propertyContract.getId()); - data.put("property", property); + try { + Map property = wxPropertyContractService.getById(propertyContract.getId()); + data.put("property", property); + } catch (MallinkException e) { + logger.error(e.getMessage()); + } } return new ResultData(data); }