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/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更新接口") 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..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,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((wxCoupon.getValidEndDate()!=null&&coupon.getValidEndDate()!=null && DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate())) + && wxCoupon.getInventory().equals(coupon.getInventory())) + || + (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); + } } //启动审批流 diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyController.java b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyController.java index 46279133e..dce5ca5ae 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyController.java @@ -57,8 +57,7 @@ public class WxBillPropertyController extends BaseController { @SystemControllerLog(description = "物业账单-更新") public ResultData update(@RequestBody WxBillProperty wxBillProperty) { logger.debug("[" + getIpAddr() + "] WxBillPropertyController::update"); - wxBillPropertyService.saveOrUpdate(wxBillProperty, getUser()); - return new ResultData(); + return wxBillPropertyService.saveOrUpdate(wxBillProperty, getUser()); } @GetMapping("/del") 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/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); + diff --git a/mallinkAdmin/src/main/resources/db/migration/V201907051354__L_ADD_FLOW_DATA.sql b/mallinkAdmin/src/main/resources/db/migration/V201907051354__L_ADD_FLOW_DATA.sql new file mode 100644 index 000000000..908fb5bbc --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201907051354__L_ADD_FLOW_DATA.sql @@ -0,0 +1 @@ +update wx_flow_config set name = '有价券审批' where name ='有价卷审批'; diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java index ef778a5b0..68a1267c8 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java @@ -99,6 +99,7 @@ public class ActivitySchedule { activity.setIsExpired(EnumActivityExpired.YES.getCode()); activity.setUpdateTime(new Date()); wxActivityMapper.activityExipred(activity); + wxActivityJoinMapper.activityExpired(); } /** diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java index 2bbe494f9..57216490b 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java @@ -57,23 +57,23 @@ public class WxCouponOrderBVo extends WxCouponOrder{ @io.swagger.annotations.ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone") private String cUserPhone; - @Excel(name = "交易时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "8") + @Excel(name = "交易时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "9") @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate") private Date createDate; @Transient - @Excel(name = "面额(元)", width = 20, orderNum = "6") + @Excel(name = "面额(元)", width = 20, orderNum = "7") private String priceStr; @Transient - @Excel(name = "交易价格(元)", width = 20, orderNum = "5") + @Excel(name = "交易价格(元)", width = 20, orderNum = "6") private String salePriceStr; - @Excel(name = "状态", width = 20, replace = {"可以退款_0", "已经使用_1", "已经过期_2", "已经退款_3"}, orderNum = "14") + @Excel(name = "状态", width = 20, replace = {"待使用_0", "已核销_1", "已过期_2", "已退款_3"}, orderNum = "14") @io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus") private Integer couponOrderStatus; - @Excel(name = "核销/过期/退款时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "9") + @Excel(name = "核销/过期/退款时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "10") @io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate") private Date updateDate; @@ -101,7 +101,7 @@ public class WxCouponOrderBVo extends WxCouponOrder{ return new BigDecimal(subsidyNum == null ? 0 : subsidyNum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).toPlainString(); } - @Excel(name = "补贴额(元)", width = 50, orderNum = "7") + @Excel(name = "补贴额(元)", width = 50, orderNum = "8") @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidyNumStr") private String subsidyNumStr; @@ -112,11 +112,11 @@ public class WxCouponOrderBVo extends WxCouponOrder{ private String bUserName; @io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone") private String bUserPhone; - @Excel(name = "商户名", width = 50, orderNum = "3") + @Excel(name = "发券商户", width = 50, orderNum = "3") @io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName") private String merchantName; - @Excel(name = "商铺号", width = 50, orderNum = "4") + @Excel(name = "商铺号", width = 50, orderNum = "5") @Transient private String shopNumber; @@ -141,9 +141,15 @@ public class WxCouponOrderBVo extends WxCouponOrder{ @Transient private Long couponId; + + @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "积分券_50", "家积分停车券_51", "消费卡_100"}) @Transient private Integer couponType; + @Excel(name = "核销商户", width = 50, orderNum = "4") + @Transient + private String verifyMerchantName; + @Transient private Integer floor; @Transient diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java index 25628e3a9..bd130e2dc 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java @@ -20,4 +20,5 @@ public interface WxActivityJoinMapper extends CommonMapper void updateStatus(List wxActivity); + void activityExpired(); } diff --git a/mallinkService/src/main/java/com/iformall/pay/WxPayment.java b/mallinkService/src/main/java/com/iformall/pay/WxPayment.java index c1461fa0f..f5da84065 100644 --- a/mallinkService/src/main/java/com/iformall/pay/WxPayment.java +++ b/mallinkService/src/main/java/com/iformall/pay/WxPayment.java @@ -1,6 +1,7 @@ package com.iformall.pay; import com.iformall.utils.*; +import org.apache.commons.codec.digest.HmacAlgorithms; import org.apache.commons.codec.digest.HmacUtils; import org.apache.commons.lang3.StringUtils; @@ -416,7 +417,7 @@ public class WxPayment { params.remove("sign"); String stringA = packageSign(params, false); String stringSignTemp = stringA + "&key=" + partnerKey; - return HmacUtils.hmacSha256Hex(partnerKey, stringSignTemp).toUpperCase(); + return new HmacUtils(HmacAlgorithms.HMAC_SHA_256, partnerKey).hmacHex(stringSignTemp).toUpperCase(); } /** 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 e306d366f..a668b13f6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java @@ -172,7 +172,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { 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, "更新租赁账单成功", wxBillRent); } } 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..cc656913a 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,22 @@ 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(chart == null){ + return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN); + } 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"; } //出租率 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java index d5eb0afa1..99e72c345 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -279,6 +279,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { String filename = "券订单"; List list = wxCouponOrderMapper.findListOfAdmin(wxCouponOrder); list.parallelStream().forEach(c -> { + if (c.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode())) { + c.setUpdateDate(null); + } if (!c.getMerchantId().equals(0L)) { List merchantVoList = c.getMerchantVoList(); if (!merchantVoList.isEmpty()) { @@ -635,28 +638,30 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { // 6. get payOrder info int formType = EnumMsgLimitType.WEAPP_FORMID.getCode(); if(StringUtils.isBlank(order.getFormId()) || order.getFormId().equalsIgnoreCase("undefined")) { - // formId为空,获取prepayId - WxPayOrder payOrder = null; - WxPayOrder payOrderQ = new WxPayOrder(); - payOrderQ.setTenantId(couponOrder.getTenantId()); - payOrderQ.setOrderId(order.getId()); - payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); - List payList = wxPayOrderMapper.select(payOrderQ); - if (payList.size() > 0) { - payOrder = payList.get(0); - } - if (payOrder == null) { - logger.error("找不到payOrder信息"); - throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND); - } - if (payOrder.getPrepayId() == null) { - logger.error("payOrder信息中,prepay_id为空"); - throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); - } - dateAfter7Day = DateUtils.getHourTimeAfter(7, payOrder.getCreateTime()); - if(curDate.before(dateAfter7Day)) { - formId = payOrder.getPrepayId(); - formType = EnumMsgLimitType.WEAPP_PREPAYID.getCode(); + if(order.getPayment() > 0) { + // formId为空,获取prepayId + WxPayOrder payOrder = null; + WxPayOrder payOrderQ = new WxPayOrder(); + payOrderQ.setTenantId(couponOrder.getTenantId()); + payOrderQ.setOrderId(order.getId()); + payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); + List payList = wxPayOrderMapper.select(payOrderQ); + if (payList.size() > 0) { + payOrder = payList.get(0); + } + if (payOrder == null) { + logger.error("找不到payOrder信息"); + throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND); + } + if (payOrder.getPrepayId() == null) { + logger.error("payOrder信息中,prepay_id为空"); + throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); + } + dateAfter7Day = DateUtils.getHourTimeAfter(7, payOrder.getCreateTime()); + if (curDate.before(dateAfter7Day)) { + formId = payOrder.getPrepayId(); + formType = EnumMsgLimitType.WEAPP_PREPAYID.getCode(); + } } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index c4adb0d1d..fae2b2921 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -204,8 +204,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxCoupon.setPutApplyStatus(applyStatus); }else if(EnumCouponAppType.STOCK.getCode().equals(operateType)){ wxCoupon.setStockApplyStatus(applyStatus); - if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue() - ||EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { + if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { //减库存 if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { Integer inventory = (Integer) getVariableByKey(variables, "inventory"); 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()); 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); } diff --git a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml index 67b132c66..06eb2c96d 100644 --- a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml @@ -104,6 +104,9 @@ #{activity.id} - + + + update wx_activity_join set `status`=2 where `status`!=2 and activity_id in(select id from wx_activity where is_expired=1) + 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 diff --git a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml index bfd24a89c..551dacdfa 100644 --- a/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBusinessMapper.xml @@ -168,7 +168,7 @@ left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id left join wx_merchant_shop wmt on wmt.merchant_id = m.id left join wx_shop ws on(wmt.shop_id = ws.id) - where m.business_id=#{id} and m.tenant_id=#{tenantId}) + where m.business_id=#{id} and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate}) ,2) devoteRate from wx_merchant m @@ -176,6 +176,7 @@ left join wx_merchant_shop wmt on wmt.merchant_id = m.id left join wx_shop ws on(wmt.shop_id = ws.id) where m.business_id=#{id} and m.tenant_id=#{tenantId} + and mtd.create_date between #{startdate} and #{enddate} group by m.id order by devoteRate desc diff --git a/mallinkService/src/main/resources/mapper/WxCouponCarMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponCarMapper.xml index 8545d5c5a..df003c06b 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponCarMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponCarMapper.xml @@ -127,7 +127,7 @@ c.id,c.tenant_id,c.type,c.cover_img,c.cover_picture,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, - car.vendor_type, car.vendor_params,c.credit_price + car.vendor_type, car.vendor_params,c.credit_price, c.`auto_refund` select from - wx_coupon_order co, - wx_coupon c, - (select tco.id as tcoid, - (select count(*) from wx_coupon_merchant tcm - where tcm.product_id = tco.coupon_id - and tcm.status = 0) as mc - from wx_coupon_order tco) com - where com.tcoid = co.id + wx_coupon_order co inner join wx_coupon c on c.id = co.coupon_id + inner join (select tco.id as tcoid, + (select count(*) from wx_coupon_merchant tcm + where tcm.product_id = tco.coupon_id + and tcm.status = 0) as mc + from wx_coupon_order tco) com on com.tcoid = co.id + inner join wx_c_user cu on cu.id=co.c_user_id + left join ( + select bu.id as bu_id,m.name as verify_merchant_name + from wx_merchant_b_user bu inner join wx_merchant m on bu.merchant_id=m.id + where bu.tenant_id = #{tenantId} + ) bu on bu.bu_id = co.b_user_id + where 1=1 and co.coupon_type = #{couponType} @@ -423,7 +430,6 @@ and co.coupon_type < 100 - and c.id = co.coupon_id and co.tenant_id = #{tenantId} @@ -468,6 +474,10 @@ and c.business = #{business} + + and bu.verify_merchant_name = #{verifyMerchantName} + + and co.coupon_id in( select cm.product_id from wx_merchant_shop ms left join wx_merchant m on ms.merchant_id=m.id @@ -483,7 +493,7 @@ ) order by ${sortColumns} - order by id desc + order by co.create_date desc,co.id desc diff --git a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml index 36e0da58d..ae997cab2 100644 --- a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml @@ -566,7 +566,7 @@ order by ${sortColumns} - order by o.id desc + order by o.create_date desc, o.id desc diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 8c93f53d6..5e65f056e 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -348,7 +348,7 @@ and rc.`operation_type` = #{operationType} order by ${sortColumns} - order by rc.id desc + order by rc.createtime desc,rc.id desc