From ceaaa8df014ba50e69cafa10b9f3310e1aaec2b6 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 25 Jun 2019 10:16:09 +0800 Subject: [PATCH 01/50] =?UTF-8?q?[cUser=E9=87=8D=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98][=E4=BF=AE=E6=94=B9]:=E7=94=A8=E6=88=B7=E5=85=88?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=B0=8F=E7=A8=8B=E5=BA=8F=EF=BC=8C=E5=90=8E?= =?UTF-8?q?=E5=85=B3=E6=B3=A8=E5=85=AC=E4=BC=97=E5=8F=B7=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4cUser=E9=87=8D=E5=A4=8D=EF=BC=8C=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=88=A0=E9=99=A4=E8=80=81=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WxUserGrantController.java | 20 +++++++++------- .../domain/po/msg/FmInsideCLoginMsg.java | 3 +++ .../com/iformall/service/WxCUserService.java | 4 ++-- .../service/impl/WxCUserServiceImpl.java | 24 ++++++++++++++++--- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java index d2b507da8..d2ca98021 100755 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java @@ -186,7 +186,8 @@ public class WxUserGrantController extends BaseController { String session_key = null; String openId = null; String unionId = null; - boolean bHaveUnionId = false; + boolean boolHaveUnionId = false; + boolean boolFindByUnionId = false; Long userId = null; try { @@ -196,7 +197,7 @@ public class WxUserGrantController extends BaseController { openId = session.getOpenid(); unionId = session.getUnionid(); if (StringUtils.isNotBlank(unionId)) { - bHaveUnionId = true; + boolHaveUnionId = true; } logger.info("session_key: " + session_key + ", openId: " + openId + ", unionId: " + unionId); @@ -213,24 +214,26 @@ public class WxUserGrantController extends BaseController { newUser.setTenantId(wxAuthorizerInfo.getTenantId()); newUser.setAppId(appId); newUser.setOpenId(openId); - if (bHaveUnionId) { + if (boolHaveUnionId) { newUser.setUnionId(unionId); } WxCUser oldUser = null; - if (bHaveUnionId) { + if (boolHaveUnionId) { // 优先根据unionId查询 WxCUser userQ = new WxCUser(); userQ.setTenantId(wxAuthorizerInfo.getTenantId()); userQ.setUnionId(unionId); oldUser = wxCUserService.getByObject(userQ); + if(oldUser != null) { + boolFindByUnionId = true; + } } if (oldUser == null) { oldUser = wxCUserService.getByOpenId(newUser); } if (oldUser != null) { // 已有用户 - userId = oldUser.getId(); token = oldUser.createToken(new Date()); resultMap.put("token", token); @@ -241,7 +244,7 @@ public class WxUserGrantController extends BaseController { oldUser.setSessionKey(session_key); oldUser.setAppId(appId); oldUser.setOpenId(openId); - if (bHaveUnionId) { + if (boolHaveUnionId) { oldUser.setUnionId(unionId); } if (StringUtils.isNotBlank(wxAuthorizerInfo.getOpenAppid())) { @@ -272,9 +275,10 @@ public class WxUserGrantController extends BaseController { userTokenService.saveOrUpdate(oldUser); // 登录后处理 - int score = wxCUserService.actionAfterLogin(oldUser); + int score = wxCUserService.actionAfterLogin(oldUser, boolFindByUnionId); resultMap.put("score", score); } else { + // 新用户 newUser.setTenantId(wxAuthorizerInfo.getTenantId()); token = newUser.createToken(new Date()); @@ -309,7 +313,7 @@ public class WxUserGrantController extends BaseController { request.setAttribute(Constant.TENANT_ID, newUser.getTenantId()); // 登录后处理 - int score = wxCUserService.actionAfterLogin(newUser); + int score = wxCUserService.actionAfterLogin(newUser, null); resultMap.put("score", score); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCLoginMsg.java b/mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCLoginMsg.java index e03c813c6..8b4209abb 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCLoginMsg.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCLoginMsg.java @@ -14,4 +14,7 @@ public class FmInsideCLoginMsg extends BaseMsg{ private String tenantId; @io.swagger.annotations.ApiModelProperty(value = "用户ID", name = "cUserId") private Long cUserId; + + @io.swagger.annotations.ApiModelProperty(value = "是否从unionId更新", name = "findByUnionId") + private Boolean findByUnionId; } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserService.java index 196385321..c7a4638b5 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserService.java @@ -110,14 +110,14 @@ public interface WxCUserService { * 登录后发消息 * @param user */ - void actionMsgAfterLogin(WxCUser user); + void actionMsgAfterLogin(WxCUser user, Boolean findByUnionId); /** * 登录后处理 * @param user * @return */ - int actionAfterLogin(WxCUser user); + int actionAfterLogin(WxCUser user, Boolean findByUnionId); /** * 积分 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java index 57ec31d7a..5bdeac54c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java @@ -9,7 +9,6 @@ import com.iformall.domain.po.WxCUser; import com.iformall.domain.po.WxCUserBasicInfo; import com.iformall.domain.po.WxCreditHistory; import com.iformall.domain.po.msg.FmInsideCLoginMsg; -import com.iformall.domain.po.msg.FmInsideCouponVerifyMsg; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxCUserMapper; @@ -23,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; +import java.util.List; @Service public class WxCUserServiceImpl implements WxCUserService { @@ -216,17 +216,18 @@ public class WxCUserServiceImpl implements WxCUserService { } @Override - public void actionMsgAfterLogin(WxCUser user) { + public void actionMsgAfterLogin(WxCUser user, Boolean findByUnionId) { FmInsideCLoginMsg loginMsg = new FmInsideCLoginMsg(); loginMsg.setMsgType(EnumMsgRecordType.INSIDE_C_LOGIN.getCode()); loginMsg.setTenantId(user.getTenantId()); loginMsg.setCUserId(user.getId()); + loginMsg.setFindByUnionId(findByUnionId); mqBaseProducer.sendMessage(loginMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); } @Override - public int actionAfterLogin(WxCUser user) { + public int actionAfterLogin(WxCUser user, Boolean findByUnionId) { int score = 0; int credit = 0; // 成长值 @@ -267,6 +268,23 @@ public class WxCUserServiceImpl implements WxCUserService { saveOrUpdate(cUser); } } + // 用户从unionId来的,可能会有重复 + if(findByUnionId != null) { + if(findByUnionId) { + WxCUser userQ = new WxCUser(); + userQ.setOpenAppId(user.getAppId()); + userQ.setOpenId(user.getOpenId()); + List userList = wxCUserMapper.findList(userQ); + if(userList.size() > 1) { + for(WxCUser tempUser: userList) { + if(tempUser.getUnionId() == null) { + // 删除 无unionId的用户 + wxCUserMapper.deleteByPrimaryKey(tempUser.getId()); + } + } + } + } + } return score; } From a4bf8a58a3cc71b0834acb88646aed825daf3a3e Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 25 Jun 2019 11:18:48 +0800 Subject: [PATCH 02/50] =?UTF-8?q?[cUser=E9=87=8D=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98][=E4=BF=AE=E6=94=B9]:=E7=94=A8=E6=88=B7=E5=85=88?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=B0=8F=E7=A8=8B=E5=BA=8F=EF=BC=8C=E5=90=8E?= =?UTF-8?q?=E5=85=B3=E6=B3=A8=E5=85=AC=E4=BC=97=E5=8F=B7=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4cUser=E9=87=8D=E5=A4=8D=EF=BC=8C=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=88=A0=E9=99=A4=E8=80=81=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java index ad0d24044..0fa7610c1 100644 --- a/mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java @@ -41,6 +41,6 @@ public class FmInsideCLoginMsgServiceImpl implements MsgSendService { throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "用户ID未找到" + msg.getCUserId()); } - userService.actionAfterLogin(user); + userService.actionAfterLogin(user, msg.getFindByUnionId()); } } From 7ffe5ee48b6a79685de8ef222c5e9b5675034f5d Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 25 Jun 2019 14:00:38 +0800 Subject: [PATCH 03/50] =?UTF-8?q?[=E5=BA=93=E5=AD=98=E9=80=80=E5=9B=9E][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:=E5=BA=93=E5=AD=98=E9=80=80=E5=9B=9E?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/mapper/WxCouponMapper.java | 2 ++ .../service/impl/WxOrderServiceImpl.java | 17 ++++++----------- .../main/resources/mapper/WxCouponMapper.xml | 4 ++++ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index 068ef8c1e..4a1294c88 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -21,6 +21,8 @@ public interface WxCouponMapper extends CommonMapper { void reduceInventory(@Param("id")Long id,@Param("number")Integer number); + void backInventory(@Param("id")Long id,@Param("remainInventory")Integer remainInventory, @Param("number")Integer number); + void offExpiriedCouponByValidDate(); void offExpiriedCouponByMerchantStatus(); 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 e4524609f..77caa369e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -360,13 +360,8 @@ public class WxOrderServiceImpl implements WxOrderService { throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); } - WxCoupon updateRecord = new WxCoupon(); - updateRecord.setId(coupon.getId()); - updateRecord.setRemainInventory(coupon.getRemainInventory() + 1); - updateRecord.setUpdateDate(new Date()); - try { - wxCouponMapper.updateByPrimaryKeySelective(updateRecord); + wxCouponMapper.backInventory(coupon.getId(), coupon.getRemainInventory(), 1); } catch (Exception e) { logger.error("数据库更新失败,库存+1失败, e:" + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "库存恢复失败"); @@ -839,8 +834,8 @@ public class WxOrderServiceImpl implements WxOrderService { public int updateOrderStatus(WxOrder updateOrder, EnumOrderStatus enumOrderStatus) { Date currentDate = new Date(); switch (enumOrderStatus) { - case ORDER_STATUS_OVERTIME_CANCEL: - case ORDER_STATUS_REFUND_SUCCESS: { + case ORDER_STATUS_OVERTIME_CANCEL: // 支付取消,库存退回 + case ORDER_STATUS_REFUND_SUCCESS: { // 退款成功,库存退回 try { stockBack(updateOrder); } catch (Exception e) { @@ -849,7 +844,7 @@ public class WxOrderServiceImpl implements WxOrderService { } break; } - case ORDER_STATUS_COOPERATING_OVERTIME: { + case ORDER_STATUS_COOPERATING_OVERTIME: { // 拼团超时,退库存 try { stockBack(updateOrder); } catch (Exception e) { @@ -858,7 +853,7 @@ public class WxOrderServiceImpl implements WxOrderService { } break; } - case ORDER_STATUS_COOPERATING_CANCEL: { + case ORDER_STATUS_COOPERATING_CANCEL: { // 拼团取消,退库存 try { stockBack(updateOrder); } catch (Exception e) { @@ -867,7 +862,7 @@ public class WxOrderServiceImpl implements WxOrderService { } break; } - case ORDER_STATUS_COOPERATING_COMPLETE: { + case ORDER_STATUS_COOPERATING_COMPLETE: { // 拼团完成,退库存 try { stockBack(updateOrder); } catch (Exception e) { diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 546491a09..9c017e182 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -487,6 +487,10 @@ update wx_coupon SET remain_inventory = remain_inventory - #{number} where id = #{id} and remain_inventory>= #{number} + + update wx_coupon SET remain_inventory = remain_inventory + #{number} where id = #{id} and remain_inventory>= #{remainInventory} + + update wx_coupon SET status = 1, update_date = now() where status = 0 and valid_type = 1 and valid_end_date < now() From 2ed89ff7ab73bc3639b1464c4c7ffd5951530f2d Mon Sep 17 00:00:00 2001 From: hupeng Date: Tue, 25 Jun 2019 14:12:23 +0800 Subject: [PATCH 04/50] =?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=A2=9E=E5=8A=A0=E8=B4=AD=E4=B9=B0=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...201906251400__ADD_CONDITION_FOR_COUPON.sql | 4 ++ .../controller/WxOrderController.java | 44 ++++++++++++++++++- .../java/com/iformall/common/ErrorCode.java | 2 + .../iformall/domain/po/WxCUserBasicInfo.java | 3 ++ .../java/com/iformall/domain/po/WxCoupon.java | 4 ++ .../iformall/domain/vo/WxCouponChannelVo.java | 3 ++ .../enums/EnumCouponConditionType.java | 37 ++++++++++++++++ .../mapper/WxCUserBasicInfoMapper.java | 2 + .../service/impl/WxOrderServiceImpl.java | 18 ++++++++ .../mapper/WxCUserBasicInfoMapper.xml | 20 +++++++-- .../mapper/WxCouponChannelMapper.xml | 8 +++- .../main/resources/mapper/WxCouponMapper.xml | 7 +-- 12 files changed, 142 insertions(+), 10 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201906251400__ADD_CONDITION_FOR_COUPON.sql create mode 100644 mallinkService/src/main/java/com/iformall/enums/EnumCouponConditionType.java diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906251400__ADD_CONDITION_FOR_COUPON.sql b/mallinkAdmin/src/main/resources/db/migration/V201906251400__ADD_CONDITION_FOR_COUPON.sql new file mode 100644 index 000000000..cf2e0042a --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906251400__ADD_CONDITION_FOR_COUPON.sql @@ -0,0 +1,4 @@ +ALTER TABLE `wx_c_user_basic_info` +ADD COLUMN `act_record` INT(11) NULL DEFAULT '0' AFTER `active_time`; +ALTER TABLE `wx_coupon` +ADD COLUMN `condition` JSON NULL DEFAULT NULL AFTER `is_del`; \ No newline at end of file diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java index 2f5b4a698..f0f8d80d3 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java @@ -1,16 +1,18 @@ package com.iformall.controller; +import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageInfo; import com.iformall.common.ErrorCode; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.dto.OrderSaveDto; import com.iformall.domain.po.*; -import com.iformall.domain.vo.WxMerchantVo; +import com.iformall.domain.vo.WxCouponCVo; import com.iformall.domain.vo.WxOrderCouponPressVo; import com.iformall.domain.vo.WxOrderCouponVo; import com.iformall.enums.*; import com.iformall.exception.MallinkException; +import com.iformall.service.WxCUserBasicInfoService; import com.iformall.service.WxCouponChannelService; import com.iformall.service.WxCouponService; import com.iformall.service.WxOrderService; @@ -44,6 +46,9 @@ public class WxOrderController extends BaseController { @Autowired private WxCouponService wxCouponService; + @Autowired + private WxCUserBasicInfoService wxCUserBasicInfoService; + @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") @PostMapping("save") public ResultData saveOrder(@RequestBody OrderSaveDto orderSaveDto) { @@ -55,6 +60,10 @@ public class WxOrderController extends BaseController { ResultData resultData = couponChannelCheck(orderSaveDto, wxCouponChannel); if (resultData != null) return resultData; + WxCUser user = getUser(); + resultData = couponUserCheck(user, wxCouponChannelService.findDetailVo(orderSaveDto.getCouponChannelId())); + if (resultData != null) return resultData; + Long couponId = orderSaveDto.getCouponId() == null ? wxCouponChannel.getCouponId() : orderSaveDto.getCouponId(); if (couponId == null) { logger.error("couponChannelId或者couponId不能为空"); @@ -63,7 +72,6 @@ public class WxOrderController extends BaseController { // 是否砍价 boolean isPress = orderSaveDto.getPress() != null ? orderSaveDto.getPress() : false; - WxCUser user = getUser(); try { WxCoupon coupon = wxCouponService.getById(couponId); @@ -81,6 +89,38 @@ public class WxOrderController extends BaseController { } } + private ResultData couponUserCheck(WxCUser user, WxCouponCVo coupon) { + if (coupon.getCondition() == null) return null; + JSONObject jo = null; + try { + jo = JSONObject.parseObject(coupon.getCondition()); + } catch (Exception e) { + logger.error("购买券条件判断错误:ID=" + coupon.getId() + e.getMessage()); + } + if (jo != null) { + if (jo.getIntValue("type") == EnumCouponConditionType.NEW_MEMBER.getCode()){ + WxCUserBasicInfo cUserBasicInfo = wxCUserBasicInfoService.getById(user.getId()); + if (cUserBasicInfo != null && cUserBasicInfo.getActRecord() > 0) + return new ResultData(ErrorCode.COUPON_ONLY_FOR_NEW_MEMBER); + }else if (jo.getIntValue("type") == EnumCouponConditionType.SCORE_SCOPE.getCode()){ + int max = jo.getIntValue("max"); + int min = jo.getIntValue("min"); + + if (max!=0 && min ==0 && user.getScore() > max) { + return new ResultData(ErrorCode.COUPON_ONLY_FOR_NEW_MEMBER); + } + if (max==0 && min !=0 && user.getScore() < min) { + return new ResultData(ErrorCode.COUPON_ONLY_FOR_NEW_MEMBER); + } + if (max!=0 && min !=0 && (user.getScore() < min || user.getScore() > max)) { + return new ResultData(ErrorCode.COUPON_ONLY_FOR_NEW_MEMBER); + } + } + } + + return null; + } + private ResultData couponChannelCheck(@RequestBody OrderSaveDto orderSaveDto, WxCouponChannel wxCouponChannel) { if (wxCouponChannel == null) { logger.error("couponChannelId convert error, " + orderSaveDto.getCouponChannelId()); diff --git a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java index 6dcbe937d..a3e8f931f 100644 --- a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java +++ b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java @@ -110,6 +110,8 @@ public enum ErrorCode{ COUPON_VALID_DATE_ERR(2035, "券有效期设置错误"), COUPON_STOCK_VALID_DATE_SETTING_ERR(2036, "券库存有效期未修改"), COUPON_STOCK_DATE_NO_CAR(2037, "券库存不支持停车券"), + COUPON_ONLY_FOR_NEW_MEMBER(2038, "您已参加过新会员活动"), + COUPON_SCORE_NOT_IN_RANGE(2038, "您的成长值/等级与要求不符"), PUSH_LIMIT_UP_TO_1DAYLIMIT(2040, "此用户一天内发券到达疲劳度限制"), PUSH_LIMIT_UP_TO_COUPONLIMIT(2041, "此用户发此券到达疲劳度限制"), diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java index 7bcd4b417..57c10b718 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java @@ -101,6 +101,9 @@ public class WxCUserBasicInfo extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="积分",name="credit") private Integer credit; + @io.swagger.annotations.ApiModelProperty(value="活动记录",name="actRecord") + private Integer actRecord; + @Transient @Excel(name="标签",width = 50,orderNum = "10") private String tagNames; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index 971213ab9..afd404e97 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -142,6 +142,10 @@ public class WxCoupon extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="过期退积分(0:正常,1不退)",name="autoRefund") private Integer creditRefund; + @io.swagger.annotations.ApiModelProperty(value="领取条件",name="condition") + private String condition; + + @Transient private String merchantParams; diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java index 681eb130c..2268f36cb 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java @@ -66,6 +66,9 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { @io.swagger.annotations.ApiModelProperty(value="积分售价(适用于类型10,11)",name="creditPrice") private Integer creditPrice; + @io.swagger.annotations.ApiModelProperty(value="领取条件",name="condition") + private String condition; + @Transient private String salePriceStr; diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumCouponConditionType.java b/mallinkService/src/main/java/com/iformall/enums/EnumCouponConditionType.java new file mode 100644 index 000000000..b460c6b2d --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumCouponConditionType.java @@ -0,0 +1,37 @@ +package com.iformall.enums; + +/** + * Created by Stormeye on 2018/08/09. + */ +public enum EnumCouponConditionType { + + // 0-可投放;1-已作废; + NEW_MEMBER(1, "新会员"), + SCORE_SCOPE(2, "积分值"), + ; + + public static EnumCouponConditionType getEnum(Integer code) { + for (EnumCouponConditionType value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumCouponConditionType(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java index ac19428cf..338bab9b7 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java @@ -38,5 +38,7 @@ public interface WxCUserBasicInfoMapper extends CommonMapper listAsPage(WxOrder record, Integer pageIndex, Integer pageSize) { return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrderMapper.findList(record)); @@ -724,6 +728,20 @@ public class WxOrderServiceImpl implements WxOrderService { logger.error("用户不存在, userId: " + updateOrder.getCUserId()); throw new MallinkException(ErrorCode.USER_IS_EMPTY); } + + // 记录活动 + JSONObject jo = null; + try { + jo = JSONObject.parseObject(coupon.getCondition()); + } catch (Exception e) { + logger.error("购买券条件判断错误:ID=" + coupon.getId() + e.getMessage()); + } + if (jo != null) { + if (jo.getIntValue("type") == EnumCouponConditionType.NEW_MEMBER.getCode()) { + wxCUserBasicInfoMapper.incActRecordById(user.getId()); + } + } + sendInsideOrderSuccessMsg(updateOrder, coupon, user); } diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml index 2c3516f7a..d2888f257 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml @@ -19,11 +19,12 @@ + `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`, - `create_date`,`update_date`,`tenant_id`,`name`,`nick_name`,`credit`,`active_time` + `create_date`,`update_date`,`tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record` ,(select level from wx_level_config where poins >= points and tenant_id=#{tenantId} order by points desc limit 1 ) level @@ -82,6 +83,10 @@ and `update_date` = #{updateDate} + + and `act_record` = #{actRecord} + + and `name` like concat('%', #{name},'%') @@ -112,7 +117,7 @@ c.`id`,c.`phone`,cb.`birthdate`,cb.`education`,cb.`sex`,cb.`email`,cb.`address`,cb.`poins`,cb.`tag_id`, - cb.`create_date`,cb.`update_date`,c.`tenant_id`,cb.`name`,cb.level,cb.nick_name + cb.`create_date`,cb.`update_date`,c.`tenant_id`,cb.`name`,cb.level,cb.nick_name,`cb.act_record` @@ -264,7 +269,7 @@ cu.`id`,cu.`phone`,cu.`birthdate`,cu.`education`,cu.`sex`,cu.`email`,cu.`address`,cu.`poins`,cu.`tag_id`, cu.`create_date`,cu.`update_date`,cu.`tenant_id`,cu.`name`,cu.`level`,cu.`nick_name`, - cut.`tags`,cu.`credit`,cu.`active_time` + cut.`tags`,cu.`credit`,cu.`active_time`,cu.`act_record` @@ -318,6 +323,10 @@ and cu.`update_date` = #{updateDate} + + and cu.`act_record` = #{actRecord} + + and `name` like concat('%', #{name},'%') @@ -450,5 +459,10 @@ and cubi.tenant_id =#{tenantId} + + + UPDATE wx_c_user_basic_info set act_record = act_record +1 where id = #{id} + + diff --git a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml index 341752d80..b05d0417b 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml @@ -123,7 +123,7 @@ , c.remain_inventory,c.inventory,c.cover_img,c.title,c.sub_title,c.sale_price, - c.use_price,c.price,c.unit,c.use_limit_quantity,c.send_type,c.support_transfer,c.press_limit_num,c.auto_refund, + c.use_price,c.price,c.unit,c.use_limit_quantity,c.send_type,c.support_transfer,c.press_limit_num,c.auto_refund,c.condition, c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.credit_price @@ -140,6 +140,7 @@ + @@ -159,6 +160,8 @@ + + @@ -244,6 +247,7 @@ + + @@ -91,7 +92,7 @@ `id`,`tenant_id`,`type`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`send_type`, `valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`, `remark`,`status`,`create_date`,`update_date`,`business`,`sub_business`,`support_transfer`,`subsidy_num`,`subsidy_type`, - `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund` + `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,`condition` @@ -466,7 +467,7 @@ - + Date: Tue, 25 Jun 2019 15:04:41 +0800 Subject: [PATCH 05/50] =?UTF-8?q?[=E5=8D=A1=E5=88=B8][=E4=BF=AE=E5=A4=8D]:?= =?UTF-8?q?=E5=8D=A1=E5=88=B8=E9=A2=86=E5=8F=96=E6=9D=A1=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V201906251500__CHANGE_CONDITION_COLUMN.sql | 2 ++ .../java/com/iformall/controller/WxOrderController.java | 4 ++-- .../src/main/java/com/iformall/domain/po/WxCoupon.java | 2 +- .../java/com/iformall/domain/vo/WxCouponChannelVo.java | 2 +- .../com/iformall/service/impl/WxOrderServiceImpl.java | 2 +- .../src/main/resources/mapper/WxCouponChannelMapper.xml | 8 ++++---- .../src/main/resources/mapper/WxCouponMapper.xml | 8 ++++---- 7 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201906251500__CHANGE_CONDITION_COLUMN.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906251500__CHANGE_CONDITION_COLUMN.sql b/mallinkAdmin/src/main/resources/db/migration/V201906251500__CHANGE_CONDITION_COLUMN.sql new file mode 100644 index 000000000..94ddb4ff1 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906251500__CHANGE_CONDITION_COLUMN.sql @@ -0,0 +1,2 @@ +ALTER TABLE wx_coupon` +CHANGE COLUMN `condition` `conditions` JSON NULL DEFAULT NULL ; \ No newline at end of file diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java index f0f8d80d3..5e2586286 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java @@ -90,10 +90,10 @@ public class WxOrderController extends BaseController { } private ResultData couponUserCheck(WxCUser user, WxCouponCVo coupon) { - if (coupon.getCondition() == null) return null; + if (coupon.getConditions() == null) return null; JSONObject jo = null; try { - jo = JSONObject.parseObject(coupon.getCondition()); + jo = JSONObject.parseObject(coupon.getConditions()); } catch (Exception e) { logger.error("购买券条件判断错误:ID=" + coupon.getId() + e.getMessage()); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index afd404e97..893f73a99 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -143,7 +143,7 @@ public class WxCoupon extends BaseEntity { private Integer creditRefund; @io.swagger.annotations.ApiModelProperty(value="领取条件",name="condition") - private String condition; + private String conditions; @Transient diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java index 2268f36cb..825749455 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java @@ -67,7 +67,7 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { private Integer creditPrice; @io.swagger.annotations.ApiModelProperty(value="领取条件",name="condition") - private String condition; + private String conditions; @Transient private String salePriceStr; 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 17318af5e..d8e8424d2 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -732,7 +732,7 @@ public class WxOrderServiceImpl implements WxOrderService { // 记录活动 JSONObject jo = null; try { - jo = JSONObject.parseObject(coupon.getCondition()); + jo = JSONObject.parseObject(coupon.getConditions()); } catch (Exception e) { logger.error("购买券条件判断错误:ID=" + coupon.getId() + e.getMessage()); } diff --git a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml index b05d0417b..f90303680 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml @@ -123,7 +123,7 @@ , c.remain_inventory,c.inventory,c.cover_img,c.title,c.sub_title,c.sale_price, - c.use_price,c.price,c.unit,c.use_limit_quantity,c.send_type,c.support_transfer,c.press_limit_num,c.auto_refund,c.condition, + c.use_price,c.price,c.unit,c.use_limit_quantity,c.send_type,c.support_transfer,c.press_limit_num,c.auto_refund,c.conditions, c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.credit_price @@ -160,7 +160,7 @@ - + @@ -247,7 +247,7 @@ - + - + @@ -92,7 +92,7 @@ `id`,`tenant_id`,`type`,`cover_img`,`cover_picture`,`detail_picture`,`title`,`sub_title`,`sale_price`,`use_price`,`use_limit_quantity`,`send_type`, `valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`, `remark`,`status`,`create_date`,`update_date`,`business`,`sub_business`,`support_transfer`,`subsidy_num`,`subsidy_type`, - `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,`condition` + `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,`conditions` @@ -467,7 +467,7 @@ - + Date: Tue, 25 Jun 2019 15:14:38 +0800 Subject: [PATCH 06/50] =?UTF-8?q?[=E5=8D=A1=E5=88=B8][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V201906251500__CHANGE_CONDITION_COLUMN.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906251500__CHANGE_CONDITION_COLUMN.sql b/mallinkAdmin/src/main/resources/db/migration/V201906251500__CHANGE_CONDITION_COLUMN.sql index 94ddb4ff1..f4d29b946 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V201906251500__CHANGE_CONDITION_COLUMN.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V201906251500__CHANGE_CONDITION_COLUMN.sql @@ -1,2 +1,2 @@ -ALTER TABLE wx_coupon` +ALTER TABLE `wx_coupon` CHANGE COLUMN `condition` `conditions` JSON NULL DEFAULT NULL ; \ No newline at end of file From e90e29130b5eb0af47ed9f9c3a5d9f0c545519a6 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 25 Jun 2019 16:27:44 +0800 Subject: [PATCH 07/50] =?UTF-8?q?[=E5=AE=A1=E6=89=B9][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A1=E6=89=B9=E6=B5=81]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V201906251622__L_ALTER_FLOW.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201906251622__L_ALTER_FLOW.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906251622__L_ALTER_FLOW.sql b/mallinkAdmin/src/main/resources/db/migration/V201906251622__L_ALTER_FLOW.sql new file mode 100644 index 000000000..767dcfff9 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906251622__L_ALTER_FLOW.sql @@ -0,0 +1,8 @@ +ALTER TABLE `wx_coupon` +ADD COLUMN `put_apply_status` SMALLINT(1) NULL DEFAULT 0 COMMENT '投放审核状态0未审核1审核中2审核完成3驳回4异常终止5撤回'; + +ALTER TABLE `wx_coupon` +ADD COLUMN `stock_apply_status` SMALLINT(1) NULL DEFAULT 0 COMMENT '库存审核状态0未审核1审核中2审核完成3驳回4异常终止5撤回'; + +ALTER TABLE `wx_coupon` +ADD COLUMN `cancle_apply_status` SMALLINT(1) NULL DEFAULT 0 COMMENT '作废审核状态0未审核1审核中2审核完成3驳回4异常终止5撤回'; \ No newline at end of file From c5f3783d3fd70f4fb1cde0ef29ab15b0bd7aaec1 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Tue, 25 Jun 2019 16:15:07 +0800 Subject: [PATCH 08/50] =?UTF-8?q?[=E5=88=B8=E8=AE=A2=E5=8D=95][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../market/WxCouponOrderController.java | 56 ++++------------- .../iformall/domain/vo/WxCouponOrderBVo.java | 61 ++++++++++++++++--- .../service/WxCouponOrderService.java | 5 +- .../impl/WxCouponOrderServiceImpl.java | 26 ++++++-- .../resources/mapper/WxCouponOrderMapper.xml | 46 +++++++++++--- 5 files changed, 125 insertions(+), 69 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponOrderController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponOrderController.java index f51053363..56e6a0b9b 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponOrderController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponOrderController.java @@ -6,7 +6,6 @@ import com.iformall.common.ErrorCode; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; import com.iformall.domain.po.WxAppinfo; -import com.iformall.domain.po.WxCouponOrder; import com.iformall.domain.vo.WxCouponOrderBVo; import com.iformall.enums.EnumAppType; import com.iformall.enums.EnumPayType; @@ -26,7 +25,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.text.SimpleDateFormat; import java.util.Map; @RestController @@ -74,47 +72,6 @@ public class WxCouponOrderController extends BaseController { return wxCouponOrderService.detailAdminVo(couponOrderId); } - @RequestMapping("/exportData") - @SystemControllerLog(description = "券包-导出") - public void exportData( - @RequestParam("endDate") String endDate, - @RequestParam("startDate") String startDate, - @RequestParam("merchantName") String merchantName, - @RequestParam("couponOrderStatus") String couponOrderStatus, - @RequestParam("id") String id, - HttpServletRequest request, HttpServletResponse response) { - logger.debug("[" + getIpAddr() + "] WxCouponOrderController::exportData"); - - WxCouponOrderBVo wxCouponOrder = new WxCouponOrderBVo(); - wxCouponOrder.setTenantId(getTenantId()); - wxCouponOrder.setMerchantName(merchantName); - try { - wxCouponOrder.setId(Long.valueOf(id)); - }catch (Exception e){ - wxCouponOrder.setId(null); - } - try { - wxCouponOrder.setCouponOrderStatus(Integer.valueOf(couponOrderStatus)); - }catch (Exception e){ - wxCouponOrder.setCouponOrderStatus(null); - } - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - wxCouponOrder.setStartTime( sdf.parse(startDate)); - } catch (Exception e) { - wxCouponOrder.setStartTime(null); - } - try { - wxCouponOrder.setEndTime( sdf.parse(endDate)); - } catch (Exception e) { - wxCouponOrder.setEndTime(null); - } - wxCouponOrder.setSortColumns(WxCouponOrder.Field.Id_DESC); - wxCouponOrderService.exportData(request, response, wxCouponOrder); - - } - @ApiOperation(value = "退券退款", notes = "{\"couponOrderId\":\"string\"}") @PostMapping("/refund") @SystemControllerLog(description = "券包-退券退款") @@ -158,4 +115,17 @@ public class WxCouponOrderController extends BaseController { return new ResultData(ErrorCode.REFUND_ORDER_ERROR.getCode(), "AppInfo获取失败"); } + @GetMapping("exportData") + @SystemControllerLog(description = "券订单数据-导出数据") + public void exportData(@ModelAttribute WxCouponOrderBVo wxCouponOrder, HttpServletRequest request, HttpServletResponse response) { + logger.debug("[" + getIpAddr() + "] WxCouponOrderController::exportData"); + if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderBVo(); + wxCouponOrder.setTenantId(getTenantId()); + if (wxCouponOrder.getMerchantName() != null && + wxCouponOrder.getMerchantName().isEmpty()) { + wxCouponOrder.setMerchantName(null); + } + wxCouponOrderService.exportData(wxCouponOrder, request, response); + } + } 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 ed400f188..9f74ada21 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java @@ -9,6 +9,8 @@ import lombok.ToString; import javax.persistence.Id; import javax.persistence.Transient; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.Date; import java.util.List; @@ -20,7 +22,7 @@ public class WxCouponOrderBVo extends WxCouponOrder{ private static final long serialVersionUID = 6687954932922444531L; @Id - @Excel(name="券码",width = 20) + @Excel(name = "券码", width = 20, orderNum = "1") protected Long id; @Override @@ -40,31 +42,31 @@ public class WxCouponOrderBVo extends WxCouponOrder{ @io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间 ", name = "expiredTime") private Date expiredTime; - @Excel(name="券名称",width = 50) + @Excel(name = "券名称", width = 50, orderNum = "2") @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") private String title; - @Excel(name="用户手机号",width = 20) + @Excel(name = "会员手机号", width = 20, orderNum = "13") @io.swagger.annotations.ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone") private String cUserPhone; - @Excel(name="交易时间",width = 20,exportFormat="yyyy-MM-dd HH:mm:ss") + @Excel(name = "交易时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "8") @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate") private Date createDate; @Transient - @Excel(name="面额",width = 20) + @Excel(name = "面额(元)", width = 20, orderNum = "6") private String priceStr; @Transient - @Excel(name="交易价格",width = 20) + @Excel(name = "交易价格(元)", width = 20, orderNum = "5") private String salePriceStr; - @Excel(name="订单状态",width = 20,replace = { "可以退款_0", "已经使用_1","已经过期_2","已经退款_3"}) + @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") + @Excel(name = "核销/过期/退款时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "9") @io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate") private Date updateDate; @@ -81,6 +83,23 @@ public class WxCouponOrderBVo extends WxCouponOrder{ @io.swagger.annotations.ApiModelProperty(value="面额",name="price") private Integer price; + @Excel(name = "所属业态", width = 50, orderNum = "11", replace = {"餐饮_1", "娱乐_2", "服饰_3", "亲子_4", "超市_5", "其它_6", "美妆_7", "珠宝_8", "服务_9", "家居_10"}) + @io.swagger.annotations.ApiModelProperty(value = "业态", name = "business") + private Integer business; + + @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidySum") + private Integer subsidySum; + + public String getSubsidySumStr() { + return new BigDecimal(subsidySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).toPlainString(); + } + + @Excel(name = "补贴额(元)", width = 50, orderNum = "7") + @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidySum") + private String subsidySumStr; + + @io.swagger.annotations.ApiModelProperty(value = "补贴类型", name = "subsidyType") + private Integer subsidyType; @Excel(name="商户管理员(核销人)姓名",width = 50) @io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="bUserName") @@ -88,10 +107,14 @@ public class WxCouponOrderBVo extends WxCouponOrder{ @Excel(name="商户管理员手机",width = 20) @io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone") private String bUserPhone; - @Excel(name="使用券商户名",width = 50) + @Excel(name = "商户名", width = 50, orderNum = "3") @io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName") private String merchantName; + @Excel(name = "商铺号", width = 50, orderNum = "4") + @Transient + private String shopNumber; + /**发券商户信息*/ @io.swagger.annotations.ApiModelProperty(value="商户列表",name="merchantVoList") private List merchantVoList; @@ -102,12 +125,30 @@ public class WxCouponOrderBVo extends WxCouponOrder{ @Transient private Date endDate; + @Transient + private Long merchantId; + + @Transient + private Date verifyStartDate; + + @Transient + private Date verifyEndDate; + @Transient private Long couponId; @Transient private Integer couponType; - @Override + @Transient + private Integer floor; + @Transient + private Integer building; + + @Excel(name = "楼层楼座", width = 50, orderNum = "12") + @Transient + private String buildingStr; + + @Override public Long getCouponId() { return couponId; } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java index 4ca99cc6b..339507e93 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java @@ -152,9 +152,6 @@ public interface WxCouponOrderService { ResultData detailAdminVo(Long couponOrderId); - void exportData(HttpServletRequest request, HttpServletResponse response, WxCouponOrderBVo wxCouponOrder); - - /** * 日期分组 消费总数 * @param tenantId @@ -190,4 +187,6 @@ public interface WxCouponOrderService { ResultData queryCardStatus(WxCouponOrder wxCouponOrder); + void exportData(WxCouponOrderBVo wxCouponOrder, HttpServletRequest request, HttpServletResponse response); + } 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 41d92d7c6..cca9c20d2 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -20,7 +20,6 @@ import com.iformall.exception.MallinkException; import com.iformall.mapper.*; import com.iformall.mq.MqBaseProducer; import com.iformall.service.*; -import com.iformall.utils.DateUtils; import com.iformall.utils.PayUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -272,12 +271,27 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { } @Override - public void exportData(HttpServletRequest request, HttpServletResponse response, WxCouponOrderBVo wxCouponOrder) { - WxMall wxMall = new WxMall(); - wxMall.setTenantId(wxCouponOrder.getTenantId()); - wxMall = wxMallMapper.findList(wxMall).get(0); - String filename = wxMall.getName() + DateUtils.getSystemTime("yyyyMMDDHHmmss"); + public void exportData(WxCouponOrderBVo wxCouponOrder, HttpServletRequest request, HttpServletResponse response) { + String filename = "券订单"; List list = wxCouponOrderMapper.findListOfAdmin(wxCouponOrder); + list.parallelStream().forEach(c -> { + if (!c.getMerchantId().equals(0L)) { + List merchantVoList = c.getMerchantVoList(); + if (!merchantVoList.isEmpty()) { + StringBuffer shopNumber = new StringBuffer(); + StringBuffer building = new StringBuffer(); + WxMerchantVo wxMerchantVo = merchantVoList.get(0); + List shopVoList = wxMerchantVo.getShopVoList(); + for (int j = 0, s_size = shopVoList.size(); j < s_size; j++) { + WxShopVo wxShopVo = shopVoList.get(j); + shopNumber.append(wxShopVo.getShopNumber()).append(";"); + building.append(wxShopVo.getBuildingName()).append(wxShopVo.getFloorName()).append(";"); + } + c.setShopNumber(shopNumber.toString()); + c.setBuildingStr(building.toString()); + } + } + }); excelService.exportExcel(list, null, filename, WxCouponOrderBVo.class, filename + ".xlsx", response, false); } diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index 642bdfbda..91f1f748d 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -360,19 +360,24 @@ - + + + - + + + + - + co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, - c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund, + c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,c.subsidy_sum, (case when com.mc=1 then (select m.name from wx_merchant m, wx_coupon_merchant cm - where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name + where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name, + case when com.mc = 1 then (select m.id from wx_merchant m, + wx_coupon_merchant cm where m.id = cm.merchant_id and cm.product_id = co.coupon_id + and cm.status = 0) else 0 end) as merchant_id co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, - c.type,c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund, + c.type,c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,c.subsidy_sum, bu.name, bu.phone as bphone, cu.phone, m.name as merchant_name @@ -443,13 +451,37 @@ AND co.create_date < #{endDate,jdbcType=TIMESTAMP} + + AND co.update_date > #{verifyStartDate,jdbcType=TIMESTAMP} + + + + AND co.update_date < #{verifyEndDate,jdbcType=TIMESTAMP} + + and co.id = #{id} and c.id = #{couponId} - + + and c.business = #{business} + + + 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 + left join wx_shop s on ms.shop_id=s.id + left join wx_coupon_merchant cm on ms.merchant_id=cm.merchant_id + where ms.is_del=0 and s.building=#{building} + + and ms.tenant_id=#{tenant_id} + + + and s.floor=#{floor} + + ) + order by ${sortColumns} order by id desc From aca09db7e24ecb9860743089ad4b1e140b20ff7e Mon Sep 17 00:00:00 2001 From: gongbiao Date: Tue, 25 Jun 2019 17:27:26 +0800 Subject: [PATCH 09/50] =?UTF-8?q?[=E5=88=B8=E8=AE=A2=E5=8D=95][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/domain/vo/WxCouponOrderBVo.java | 12 ++++++------ .../main/resources/mapper/WxCouponOrderMapper.xml | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) 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 9f74ada21..7c677ee83 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java @@ -87,16 +87,16 @@ public class WxCouponOrderBVo extends WxCouponOrder{ @io.swagger.annotations.ApiModelProperty(value = "业态", name = "business") private Integer business; - @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidySum") - private Integer subsidySum; + @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidyNum") + private Integer subsidyNum; - public String getSubsidySumStr() { - return new BigDecimal(subsidySum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).toPlainString(); + public String getSubsidyNumStr() { + return new BigDecimal(subsidyNum == null ? 0 : subsidyNum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).toPlainString(); } @Excel(name = "补贴额(元)", width = 50, orderNum = "7") - @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidySum") - private String subsidySumStr; + @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidyNumStr") + private String subsidyNumStr; @io.swagger.annotations.ApiModelProperty(value = "补贴类型", name = "subsidyType") private Integer subsidyType; diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index 91f1f748d..8e555184e 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -370,7 +370,7 @@ - + @@ -387,11 +387,11 @@ co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, - c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,c.subsidy_sum, + c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,c.subsidy_num, (case when com.mc=1 then (select m.name from wx_merchant m, wx_coupon_merchant cm where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name, - case when com.mc = 1 then (select m.id from wx_merchant m, + (case when com.mc = 1 then (select m.id from wx_merchant m, wx_coupon_merchant cm where m.id = cm.merchant_id and cm.product_id = co.coupon_id and cm.status = 0) else 0 end) as merchant_id @@ -401,7 +401,7 @@ c.type,c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,c.subsidy_sum, bu.name, bu.phone as bphone, cu.phone, - m.name as merchant_name + m.name as merchant_name,m.id as merchant_id From fdceaf48a248db9e8ff97b97f0ae6804519984a6 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Tue, 25 Jun 2019 18:01:58 +0800 Subject: [PATCH 12/50] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=8A=B6=E6=80=81]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/schedule/ContractSchedule.java | 62 +++++++++++++++++++ .../service/WxPropertyContractService.java | 2 + .../service/WxRentContractService.java | 2 + .../service/impl/WxMerchantServiceImpl.java | 6 +- .../impl/WxPropertyContractServiceImpl.java | 9 ++- .../impl/WxRentContractServiceImpl.java | 7 ++- 6 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java new file mode 100644 index 000000000..68c196f94 --- /dev/null +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java @@ -0,0 +1,62 @@ +package com.iformall.schedule; + +import com.iformall.domain.po.WxMall; +import com.iformall.domain.po.WxPropertyContract; +import com.iformall.domain.po.WxRentContract; +import com.iformall.mapper.WxMallMapper; +import com.iformall.service.WxPropertyContractService; +import com.iformall.service.WxRentContractService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author gongbiao + */ +@Component +public class ContractSchedule { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxRentContractService wxRentContractService; + + @Autowired + private WxPropertyContractService wxPropertyContractService; + + @Autowired + private WxMallMapper wxMallMapper; + + + /** + * 每天6点执行 + */ + @Scheduled(cron = "0 0 6 * * ?") + public void sendMsg() { + logger.info("合同状态更新开始"); + + List wxMalls = wxMallMapper.findList(null); + for (WxMall wxMall : wxMalls) { + String tenantId = wxMall.getTenantId(); + WxRentContract wxRentContract = new WxRentContract(); + wxRentContract.setTenantId(tenantId); + logger.info("租赁合同状态更新开始"); + wxRentContractService.updateStatus(wxRentContract); + logger.info("租赁合同状态更新结束"); + + WxPropertyContract wxPropertyContract = new WxPropertyContract(); + wxPropertyContract.setTenantId(tenantId); + logger.info("物业合同状态更新开始"); + wxPropertyContractService.updateStatus(wxPropertyContract); + logger.info("物业合同状态更新结束"); + } + logger.info("合同状态更新结束"); + + } + + +} \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java b/mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java index c73d99534..0c3c09852 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java @@ -70,4 +70,6 @@ public interface WxPropertyContractService { void updatePropertyPreviewBill(WxPropertyContract record); List getWxBillPropertyPreview(Long id); + + Map updateStatus(WxPropertyContract record); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java b/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java index bc034c83b..b8348c372 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java @@ -91,4 +91,6 @@ public interface WxRentContractService { void endContract(WxRentContract wxRentContract); void updatePropertyPreviewBill(WxRentContract record); + + Map updateStatus(WxRentContract record); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java index 4dddfcf98..452902ddf 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -401,7 +401,11 @@ public class WxMerchantServiceImpl implements WxMerchantService { } wxRentContract.setMerchantId(merchantId); wxRentContract.setUpdatetime(new Date()); - wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); + if (wxRentContract.getRentalStartDate().before(new Date())) { + wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode()); + } else { + wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); + } wxRentContractMapper.updateByPrimaryKeySelective(wxRentContract); //预览账单改为正式,并写入商户id(租赁合同需要绑定商户才变成已签约) WxBillRent billRent = new WxBillRent(); 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 dfbffaa21..52a1c0df6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -398,13 +398,17 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService if (id == null) { return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); } + WxPropertyContract record = wxPropertyContractMapper.selectByPrimaryKey(id); //更新合同状态为签约 WxPropertyContract wxPropertyContract = new WxPropertyContract(); wxPropertyContract.setId(id); - wxPropertyContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); + if (record.getRentalStartDate().before(new Date())) { + wxPropertyContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode()); + } else { + wxPropertyContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); + } wxPropertyContractMapper.updateByPrimaryKeySelective(wxPropertyContract); //建立账单 - WxPropertyContract record = wxPropertyContractMapper.selectByPrimaryKey(id); if (record.getMerchantId() != null && record.getReceivePeriod() != null && record.getPrice() > 0) { //预览账单改为正式,并写入商户id @@ -877,6 +881,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService return new ResultData(false); } + @Override public Map updateStatus(WxPropertyContract record) { Map resultData = new HashMap(); WxPropertyContract wxPropertyContract = new WxPropertyContract(); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 06be47e83..d1d7bf18a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -1208,6 +1208,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { return pageInfo; } + @Override public Map updateStatus(WxRentContract record) { Map resultData = new HashMap(); WxRentContract wxRentContract = new WxRentContract(); @@ -1340,7 +1341,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { //更新合同状态为签约 WxRentContract wxRentContract = new WxRentContract(); wxRentContract.setId(id); - wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); + if (record.getRentalStartDate().before(new Date())) { + wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode()); + } else { + wxRentContract.setStatus(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()); + } wxRentContractMapper.updateByPrimaryKeySelective(wxRentContract); //建立账单 if (record != null && From 92565e70777f542c75306aad2da2377097f17355 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 25 Jun 2019 18:12:39 +0800 Subject: [PATCH 13/50] =?UTF-8?q?[=E4=B8=93=E9=A2=98][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=93=E9=A2=98=E7=BC=96=E8=BE=91=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/WxCouponChannelMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml index 57ce67512..061234a24 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml @@ -24,7 +24,7 @@ - where 1 = 1 + where cc.status = 0 and cc.`id` = #{id} From 1296be951adf15aec98d0e508cf700fda2d676ad Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 25 Jun 2019 18:16:13 +0800 Subject: [PATCH 14/50] =?UTF-8?q?[=E4=B8=93=E9=A2=98][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=93=E9=A2=98=E7=BC=96=E8=BE=91=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/service/impl/WxTopicServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java index f37aab56e..96e6d16d3 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxTopicServiceImpl.java @@ -106,6 +106,7 @@ public class WxTopicServiceImpl implements WxTopicService { record.setUpdatetime(new Date()); wxTopicMapper.updateByPrimaryKeySelective(record); if(StringUtils.isNotBlank(record.getCouponIds())) { + //优化:区分添加的和删除的 wxCouponChannelMapper.delByTopic(record); addCouponTopic(record); } From 1635d7d2af155638832ff8baa2eff46537296e5e Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 25 Jun 2019 18:00:17 +0800 Subject: [PATCH 15/50] =?UTF-8?q?[=E5=8E=BB=E9=99=A4=E5=88=A0=E9=99=A4][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:=E5=8E=BB=E9=99=A4=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/service/WxCouponChannelService.java | 7 ------- .../iformall/service/impl/WxCouponChannelServiceImpl.java | 5 ----- 2 files changed, 12 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java index 66055f162..28d030b91 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java @@ -67,13 +67,6 @@ public interface WxCouponChannelService { */ ResultData saveOrUpdate(WxCouponChannel record); - /** - * 根据Id删除实体 - * - * @param id - */ - void deleteById(Long id); - ResultData addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime, Date endTime); void updateStatusByCouponId(Long couponId,String tenantId,int status); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index 7bcfe1a8f..c134311ce 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -108,11 +108,6 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { return new ResultData(); } - @Override - public void deleteById(Long id) { - wxCouponChannelMapper.deleteByPrimaryKey(id); - } - @Override public ResultData addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime, Date endTime) { From bdd71b3fcbdb0926a5f9f76a7f1cc0bb59b695ef Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 25 Jun 2019 18:37:42 +0800 Subject: [PATCH 16/50] =?UTF-8?q?[=E6=B6=88=E6=81=AF][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AFtenantId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/service/impl/WxPayOrderServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java index 1eec80095..b0be66704 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java @@ -1169,6 +1169,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { // 修改支付订单状态 WxPayOrder updateOrder = new WxPayOrder(); updateOrder.setId(record.getId()); + updateOrder.setTenantId(record.getTenantId()); updateOrder.setOrderId(record.getOrderId()); updateOrder.setUpdateTime(currentDate); updateOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); From c32c95a48418e146287bd643cd19e84f15362dee Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 25 Jun 2019 19:02:15 +0800 Subject: [PATCH 17/50] =?UTF-8?q?[=E5=88=A0=E9=99=A4][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/market/WxCouponChannelController.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java index f5ac302bc..85f9a793c 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java @@ -100,16 +100,6 @@ public class WxCouponChannelController extends BaseController { return resultData; } - @ApiOperation("根据id删除接口") - @GetMapping("/del") - @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) - @SystemControllerLog(description = "券投放-删除") - public ResultData delete(Long id) { - logger.debug("[" + getIpAddr() + "] WxCouponChannelController::delete"); - wxCouponChannelService.deleteById(id); - return new ResultData(Result.SUCCESS, "删除成功", null); - } - @ApiOperation("根据id查询接口") @GetMapping("/findById") @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) From 473feb18cde724682c5fbb18bff98d654542ead5 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 25 Jun 2019 19:02:56 +0800 Subject: [PATCH 18/50] =?UTF-8?q?[=E6=B6=88=E6=81=AF][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E8=A1=A5=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/msg/WxMsgRecordController.java | 15 ++++++++++----- .../main/resources/mapper/WxMsgRecordMapper.xml | 7 ++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgRecordController.java b/mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgRecordController.java index 860b75a63..ae3604eca 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgRecordController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgRecordController.java @@ -2,10 +2,7 @@ package com.iformall.controller.msg; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; -import com.iformall.domain.po.msg.MailMsg; -import com.iformall.domain.po.msg.SmartAppMsg; -import com.iformall.domain.po.msg.WxMsg; -import com.iformall.domain.po.msg.WxMsgRecord; +import com.iformall.domain.po.msg.*; import com.iformall.enums.*; import com.iformall.mapper.WxMsgMapper; import com.iformall.mq.MqBaseProducer; @@ -66,9 +63,10 @@ public class WxMsgRecordController extends BaseController { * @return */ @GetMapping(value = "/resendMsg") - public ResultData resendMsg(String x) { + public ResultData resendMsg(String x, Integer msgType) { if("xll1dxx1314".equals(x)){ WxMsgRecord msgRecord = new WxMsgRecord(); + msgRecord.setMsgType(msgType); msgRecord.setMsgStatus(EnumMsgRecordStatus.CONSUME_FAIL.getCode()); List recordList = wxMsgRecordService.findList(msgRecord); for (WxMsgRecord wxMsgRecord:recordList) { @@ -96,6 +94,13 @@ public class WxMsgRecordController extends BaseController { wxMsg.setReceiver(wxMsgRecord.getReceiver()); wxMsg.setTenantId(wxMsgRecord.getTenantId()); mqBaseProducer.sendMessage(wxMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); + }else if(EnumMsgRecordType.INSIDE_ORDER_SUCCESS.getCode().equals(wxMsgRecord.getMsgType())){ + //内部消息 - 下订单成功 + FmInsideOrderSuccessMsg msg = (FmInsideOrderSuccessMsg) JsonUtil.readValue(wxMsgRecord.getMsgJson(),FmInsideOrderSuccessMsg.class); + msg.setMsgType(wxMsgRecord.getMsgType()); + msg.setReceiver(wxMsgRecord.getReceiver()); + msg.setTenantId(wxMsgRecord.getTenantId()); + mqBaseProducer.sendMessage(msg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); } } return new ResultData(); diff --git a/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml b/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml index 988a00c7f..f907f14a0 100644 --- a/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml @@ -38,6 +38,9 @@ and `id` = #{id} + + and `tenant_id` = #{tenantId} + and `receiver_user_id` = #{receiverUserId} @@ -50,7 +53,9 @@ and `domain` = #{domain} - + + and `msg_type` = #{msgType} + order by createtime desc From 88f69c4f0cda09621145ef785a02c635f3cd52f1 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Tue, 25 Jun 2019 19:28:14 +0800 Subject: [PATCH 19/50] =?UTF-8?q?[=E8=90=A5=E9=94=80=E6=95=B0=E6=8D=AE][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9]:=E4=BC=98=E5=8C=96=E8=90=A5=E9=94=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...201906251915__ADD_MD_FOR_COUPON_ACTION.sql | 4 ++ .../iformall/domain/po/WxCouponActionLog.java | 9 ++- .../domain/vo/MarkingSceneDataReportTVo.java | 14 +++++ .../mapper/WxCouponActionLogMapper.java | 5 +- .../impl/MarkingDataReportServiceImpl.java | 60 +++++++++++-------- .../mapper/WxCouponActionLogMapper.xml | 11 ++++ 6 files changed, 73 insertions(+), 30 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201906251915__ADD_MD_FOR_COUPON_ACTION.sql create mode 100644 mallinkService/src/main/java/com/iformall/domain/vo/MarkingSceneDataReportTVo.java diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906251915__ADD_MD_FOR_COUPON_ACTION.sql b/mallinkAdmin/src/main/resources/db/migration/V201906251915__ADD_MD_FOR_COUPON_ACTION.sql new file mode 100644 index 000000000..c9ef1862a --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906251915__ADD_MD_FOR_COUPON_ACTION.sql @@ -0,0 +1,4 @@ +ALTER TABLE `wx_coupon_action_log` +ADD COLUMN `create_time_md` varchar(8) NULL DEFAULT NULL AFTER `create_time`; + +UPDATE `wx_coupon_action_log` set `create_time_md` = DATE_FORMAT(create_time, '%m/%d'); \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponActionLog.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponActionLog.java index a96a6187b..5caef8362 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponActionLog.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponActionLog.java @@ -32,12 +32,14 @@ public class WxCouponActionLog implements Serializable { private Long couponId; @io.swagger.annotations.ApiModelProperty(value="券包ID",name="couponOrderId") private Long couponOrderId; - @io.swagger.annotations.ApiModelProperty(value="0:精准 1:主动领取 2:用户购买 3:停车 4:核销",name="channelType") + @io.swagger.annotations.ApiModelProperty(value="发券方式:0.精准发券,1.主动领取(保留),2.停车发券,3.核销发券,4.B端刷卡发券,5.交易发券,6.定期发券",name="channelType") private Integer channelType; - @io.swagger.annotations.ApiModelProperty(value="",name="channelId") + @io.swagger.annotations.ApiModelProperty(value="channelId",name="channelId") private Long channelId; - @io.swagger.annotations.ApiModelProperty(value="",name="createTime") + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") private Date createTime; + @io.swagger.annotations.ApiModelProperty(value="月日",name="createTimeMd") + private String createTimeMd; public static enum Field { @@ -48,6 +50,7 @@ public class WxCouponActionLog implements Serializable { ,ChannelType_ASC("`channel_type` ASC"),ChannelType_DESC("`channel_type` DESC") ,ChannelId_ASC("`channel_id` ASC"),ChannelId_DESC("`channel_id` DESC") ,CreateTime_ASC("`create_time` ASC"),CreateTime_DESC("`create_time` DESC") + ,CreateTimeMd_ASC("`create_time_md` ASC"),CreateTimeMd_DESC("`create_time_md` DESC") ; private String value; Field(String value){ diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/MarkingSceneDataReportTVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/MarkingSceneDataReportTVo.java new file mode 100644 index 000000000..981b0bb58 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/vo/MarkingSceneDataReportTVo.java @@ -0,0 +1,14 @@ +package com.iformall.domain.vo; + +import lombok.Data; + +/** + * Created by syf on 2018/8/29. + */ +@Data +public class MarkingSceneDataReportTVo { + + private String xTime; + private int channelType; + private int count; +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponActionLogMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponActionLogMapper.java index f18091e51..12e84ab64 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponActionLogMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponActionLogMapper.java @@ -3,6 +3,7 @@ package com.iformall.mapper; import java.util.*; import com.iformall.common.CommonMapper; import com.iformall.domain.dto.MarkingCouponDataReportDto; +import com.iformall.domain.vo.MarkingSceneDataReportTVo; import com.iformall.domain.vo.MarkingSceneDataReportVo; import com.iformall.domain.vo.MarkingSceneDataVo; import org.apache.ibatis.annotations.Param; @@ -12,7 +13,9 @@ public interface WxCouponActionLogMapper extends CommonMapper findList(WxCouponActionLog wxCouponActionLog); - List sceneDataMap(HashMap params); + List sceneDataMap(HashMap params); // will be deleted + + List getSceneDataMap(HashMap params); List sceneDataMapJoinCouponOrder(HashMap params); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java index ebfd8f66c..c11425bb5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java @@ -158,7 +158,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { params.put("startTime", addDay(-30)); params.put("endTime", addDay(1)); //停车发券数 停车发券被核销数 核销发券数 核销发券被核销数 - List list = wxCouponActionLogMapper.sceneDataMap(params); + // TODO DELETE sceneDataMap + List sceneList = wxCouponActionLogMapper.getSceneDataMap(params); //停车发券被核销数 HashMap params1 = new HashMap<>(); @@ -196,13 +197,6 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { List list4 = wxCouponActionLogMapper.sceneDataMapJoinCouponOrder(params4); Map OrderCountMap = list4.stream().collect(Collectors.toMap(MarkingSceneDataReportVo::getXTime, p -> p.getTempCount())); - for (MarkingSceneDataReportVo vo : list) { - vo.setParkCount(parkCountMap.get(vo.getXTime()) == null ? 0 : parkCountMap.get(vo.getXTime())); - vo.setVerifyCount(verifyCountMap.get(vo.getXTime()) == null ? 0 : verifyCountMap.get(vo.getXTime())); - vo.setMicroPayCount(microPayCountMap.get(vo.getXTime()) == null ? 0 : microPayCountMap.get(vo.getXTime())); - vo.setOrderCount(OrderCountMap.get(vo.getXTime()) == null ? 0 : OrderCountMap.get(vo.getXTime())); - } - String startdate = DateUtils.getTimeBefore(30, new Date()); String enddate = DateUtils.getTimeBefore(1,new Date()); List tjTimeList = DateUtils.getTjTimeList(startdate, enddate, "0"); @@ -210,30 +204,44 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { List tempDatalist =new LinkedList<>(); for(String tj:tjList){ - Optional first = list.stream().filter(c -> c.getXTime().equals(tj)).findFirst(); - - MarkingSceneDataReportVo msdVo; - if(!first.isPresent()){ - msdVo = new MarkingSceneDataReportVo(); - msdVo.setXTime(tj); - msdVo.setCarCount(0); - msdVo.setParkCount(0); - msdVo.setVerifyCount(0); - msdVo.setMicroPayCount(0); - msdVo.setOrderCount(0); - msdVo.setTempCount(0); + MarkingSceneDataReportVo msdVo = new MarkingSceneDataReportVo(); + msdVo.setXTime(tj); + Optional carStop = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.CAR_STOP.getCode()).findFirst(); + if(!carStop.isPresent()) { msdVo.setParkSendCount(0); + } else { + MarkingSceneDataReportTVo tvo = carStop.get(); + msdVo.setParkSendCount(tvo.getCount()); + } + + Optional couponVerify = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.COUPON_VERIFY.getCode()).findFirst(); + if(!couponVerify.isPresent()) { msdVo.setVerifySendCount(0); + } else { + MarkingSceneDataReportTVo tvo = couponVerify.get(); + msdVo.setVerifySendCount(tvo.getCount()); + } + + Optional microPay = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.B_MICROPAY.getCode()).findFirst(); + if(!microPay.isPresent()) { msdVo.setMicroPaySendCount(0); + } else { + MarkingSceneDataReportTVo tvo = microPay.get(); + msdVo.setMicroPaySendCount(tvo.getCount()); + } + + Optional orderSend = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.B_MICROPAY.getCode()).findFirst(); + if(!orderSend.isPresent()) { msdVo.setOrderSendCount(0); - msdVo.setTotal(0); } else { - msdVo = first.get(); - msdVo.setTotal(msdVo.getParkSendCount() + - msdVo.getVerifySendCount() + - msdVo.getMicroPaySendCount() + - msdVo.getOrderSendCount()); + MarkingSceneDataReportTVo tvo = orderSend.get(); + msdVo.setOrderSendCount(tvo.getCount()); } + msdVo.setTotal(msdVo.getParkSendCount() + + msdVo.getVerifySendCount() + + msdVo.getMicroPaySendCount() + + msdVo.getOrderSendCount()); + tempDatalist.add(msdVo); } diff --git a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml index 67302f9ea..a95022773 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml @@ -99,6 +99,17 @@ order by xTime desc + + + + update wx_coupon_press_data cpd set change_rate = + IFNULL(round((select count(o.id) from wx_order o + where o.tenant_id = #{tenantId} and o.order_status = 1 and o.product_id = cpd.id)/ + (select count(wop.id) from wx_order o + left join wx_order_press wop on wop.order_id = o.id + where o.product_id = cpd.id and o.tenant_id = #{tenantId} and wop.first = 1)*100,2),0) + where cpd.tenant_id = #{tenantId} + + + + update wx_coupon_press_data cpd set press_count= (select count(wop.id) from wx_order o + left join wx_order_press wop on wop.order_id = o.id + where o.product_id = cpd.id and o.tenant_id = #{tenantId} and wop.first = 1) + where cpd.tenant_id=#{tenantId} + + + + update wx_coupon_press_data cpd set + press_succ_count = + (select count(o.id) from wx_order o + where o.product_id = cpd.id and o.tenant_id = #{tenantId} and o.order_status = 1) + where cpd.tenant_id=#{tenantId} + + + + update wx_coupon_press_data cpd set join_count = + (select count(wop.id) from wx_order o + left join wx_order_press wop on wop.order_id = o.id + where o.tenant_id = #{tenantId} and o.product_id = cpd.id and o.payment_type = 0) +where cpd.tenant_id=#{tenantId} + + + + + + insert into `wx_coupon_press_data` + (`id`, `tenant_id`, `cover_img`, `title`, `sale_price`, `price`) + select `id`, `tenant_id`, `cover_img`, `title`, `sale_price`, `price` + from wx_coupon where type = 8 and tenant_id = #{tenantId} and id = #{id} + + + + update wx_coupon_press_data cpd, wx_coupon c + set cpd.id=c.id, cpd.`cover_img`=c.`cover_img`, + cpd.`title`=c.`title`,cpd.c.`sale_price`=,cpd.`price`=c.`price` + where cpd.tenant_id = #{tenantId} and cpd.`id` = c.`id` and c.type = 8 and c.id = #{id} + + update wx_coupon_press_data cpd set change_rate = IFNULL(round((select count(o.id) from wx_order o From a1fff1b4944d82dbf2d3f7fe8b1aec1eb6dd156d Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 26 Jun 2019 10:15:56 +0800 Subject: [PATCH 29/50] =?UTF-8?q?[coupon=5Fpress=5Fdata][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]:=E5=88=B8=E5=88=9B=E5=BB=BA=E5=88=A0=E9=99=A4pressda?= =?UTF-8?q?ta=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/service/impl/WxCouponServiceImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 962d8d0bc..39b233f8a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -292,8 +292,6 @@ public class WxCouponServiceImpl implements WxCouponService { record.setUpdateDate(new Date()); wxCouponMapper.insertSelective(record); - wxCouponMapper.insertPressData(record); - } else { if (merchantParamList != null && merchantParamList.size() > 0) { WxCouponMerchant cmParam = new WxCouponMerchant(); @@ -361,7 +359,6 @@ public class WxCouponServiceImpl implements WxCouponService { } record.setUpdateDate(new Date()); wxCouponMapper.updateByPrimaryKeySelective(record); - wxCouponMapper.insertPressData(record); } return new ResultData(record.getId()); } From b2ba647711d6aa7c600401d716dc6916398c6bb2 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 26 Jun 2019 10:20:01 +0800 Subject: [PATCH 30/50] =?UTF-8?q?[=E7=A0=8D=E4=BB=B7=E8=90=A5=E9=94=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE][=E4=BF=AE=E6=94=B9]:=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/mapper/WxCouponMapper.java | 2 +- .../iformall/service/impl/WxCouponServiceImpl.java | 2 ++ .../src/main/resources/mapper/WxCouponMapper.xml | 13 +++++-------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index 25e2732c0..a3b013a34 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -10,8 +10,8 @@ import com.iformall.domain.po.WxCoupon; public interface WxCouponMapper extends CommonMapper { List findPressData(WxCoupon wxCoupon); + void delPressData(WxCoupon wxCoupon); void insertPressData(WxCoupon wxCoupon); - void updatePressData0(WxCoupon wxCoupon); void updatePressData1(WxCoupon wxCoupon); void updatePressData2(WxCoupon wxCoupon); void updatePressData3(WxCoupon wxCoupon); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 39b233f8a..7390f4c17 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -443,6 +443,8 @@ public class WxCouponServiceImpl implements WxCouponService { @Override public PageInfo findPressData(WxCoupon record, Integer pageNum, Integer pageSize) { if(pageNum == 0) { + wxCouponMapper.delPressData(record); + wxCouponMapper.insertPressData(record); wxCouponMapper.updatePressData1(record); wxCouponMapper.updatePressData2(record); wxCouponMapper.updatePressData3(record); diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index b5c939f9f..8f6eb9605 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -641,20 +641,17 @@ order by c.status asc,c.create_date desc + + delete from `wx_coupon_press_data` where type = 8 and tenant_id = #{tenantId} + + insert into `wx_coupon_press_data` (`id`, `tenant_id`, `cover_img`, `title`, `sale_price`, `price`) select `id`, `tenant_id`, `cover_img`, `title`, `sale_price`, `price` - from wx_coupon where type = 8 and tenant_id = #{tenantId} and id = #{id} + from wx_coupon where type = 8 and tenant_id = #{tenantId} - - update wx_coupon_press_data cpd, wx_coupon c - set cpd.id=c.id, cpd.`cover_img`=c.`cover_img`, - cpd.`title`=c.`title`,cpd.c.`sale_price`=,cpd.`price`=c.`price` - where cpd.tenant_id = #{tenantId} and cpd.`id` = c.`id` and c.type = 8 and c.id = #{id} - - update wx_coupon_press_data cpd set change_rate = IFNULL(round((select count(o.id) from wx_order o From d9d60bf8ac69d8114da28d0274ef2bc56586adef Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 26 Jun 2019 10:56:08 +0800 Subject: [PATCH 31/50] =?UTF-8?q?[=E5=8D=B7][=E4=BF=AE=E6=94=B9][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2=E5=8D=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=8C=E8=BF=87=E6=BB=A4=E6=8E=89=E5=B7=B2=E4=B8=8B?= =?UTF-8?q?=E6=9E=B6]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mallinkService/src/main/resources/mapper/WxCouponMapper.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 8f6eb9605..633101793 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -825,10 +825,11 @@ where cpd.tenant_id=#{tenantId} wc.tenant_id,wc.`type`,wc.`cover_img`,wc.`cover_picture`,wc.`detail_picture`,wc.`title`,wc.`sub_title`,wc.`sale_price`,wc.`use_price`,wc.`use_limit_quantity`,wc.`send_type`, wc.`valid_type`,wc.`valid_start_date`,wc.`valid_end_date`,wc.`valid_days`,wc.`detail`,wc.`price`,wc.`unit`,wc.`remain_inventory`,wc.`inventory`, wc.`remark`,wc.`status`,wc.`create_date`,wc.`update_date`,wc.`business`,wc.`sub_business`,wc.`support_transfer`,wc.`subsidy_num`,wc.`subsidy_type`, - wc.`press_limit_num`, wc.`press_limit_hours`, wc.`auto_refund`,wc.`credit_price`,wc.`credit_refund`,wx.`conditions` + wc.`press_limit_num`, wc.`press_limit_hours`, wc.`auto_refund`,wc.`credit_price`,wc.`credit_refund`,wc.`conditions` ,wc.title as couponName,wc.`cover_img` as couponPic,wc.`cover_picture` as couponPicture,wc.`detail_picture` as detailPicture,wc.id as couponId from wx_coupon_channel ct left join wx_coupon wc on wc.id = ct.coupon_id where ct.`sub_target_id` = #{id} + and ct.status = 0 From b77b6ef29cf34fe6b5909edfbb8aeeb457b49315 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 26 Jun 2019 11:07:01 +0800 Subject: [PATCH 32/50] =?UTF-8?q?[=E5=88=B8=E8=AE=A2=E5=8D=95][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/domain/vo/WxCouponOrderBVo.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 7c677ee83..49c0c2b06 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java @@ -46,6 +46,14 @@ public class WxCouponOrderBVo extends WxCouponOrder{ @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") private String title; + public String getcUserPhone() { + return cUserPhone; + } + + public void setcUserPhone(String cUserPhone) { + this.cUserPhone = cUserPhone; + } + @Excel(name = "会员手机号", width = 20, orderNum = "13") @io.swagger.annotations.ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone") private String cUserPhone; From 272aa1c2acd38200ba709e62a63f67684452cd84 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 26 Jun 2019 11:14:50 +0800 Subject: [PATCH 33/50] =?UTF-8?q?[=E5=88=B8=E8=AE=A2=E5=8D=95][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/domain/vo/WxCouponOrderBVo.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 49c0c2b06..2f2f567b0 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java @@ -109,7 +109,23 @@ public class WxCouponOrderBVo extends WxCouponOrder{ @io.swagger.annotations.ApiModelProperty(value = "补贴类型", name = "subsidyType") private Integer subsidyType; - @Excel(name="商户管理员(核销人)姓名",width = 50) + public String getbUserName() { + return bUserName; + } + + public void setbUserName(String bUserName) { + this.bUserName = bUserName; + } + + public String getbUserPhone() { + return bUserPhone; + } + + public void setbUserPhone(String bUserPhone) { + this.bUserPhone = bUserPhone; + } + + @Excel(name = "商户管理员(核销人)姓名", width = 50) @io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="bUserName") private String bUserName; @Excel(name="商户管理员手机",width = 20) From 8c372bad8d0ffcbc42bf5928561b1dc48a269043 Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 26 Jun 2019 11:28:44 +0800 Subject: [PATCH 34/50] =?UTF-8?q?[=E5=8D=B7][=E4=BF=AE=E6=94=B9][=E5=88=A0?= =?UTF-8?q?=E6=8E=89=E5=A4=9A=E4=BD=99=E5=AD=97=E6=AE=B5]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mallinkService/src/main/resources/mapper/WxCouponMapper.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 633101793..fbbb34a09 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -96,7 +96,6 @@ `valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`, `remark`,`status`,`create_date`,`update_date`,`business`,`sub_business`,`support_transfer`,`subsidy_num`,`subsidy_type`, `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,put_apply_status,stock_apply_status,cancle_apply_status - `press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,`conditions` From 9596a0b1e06dd9350150ca41108b14304ffe8c28 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 26 Jun 2019 11:41:22 +0800 Subject: [PATCH 35/50] =?UTF-8?q?[=E5=9C=BA=E6=99=AF=E8=90=A5=E9=94=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE][=E4=BF=AE=E6=94=B9]:=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/mapper/WxCouponActionLogMapper.java | 2 ++ .../iformall/service/impl/MarkingDataReportServiceImpl.java | 6 +++--- .../src/main/resources/mapper/WxCouponActionLogMapper.xml | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponActionLogMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponActionLogMapper.java index 12e84ab64..dd19a6a04 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponActionLogMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponActionLogMapper.java @@ -15,6 +15,8 @@ public interface WxCouponActionLogMapper extends CommonMapper sceneDataMap(HashMap params); // will be deleted + void updateCreateTimeMd(HashMap params); + List getSceneDataMap(HashMap params); List sceneDataMapJoinCouponOrder(HashMap params); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java index c11425bb5..8c9f75339 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/MarkingDataReportServiceImpl.java @@ -158,7 +158,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { params.put("startTime", addDay(-30)); params.put("endTime", addDay(1)); //停车发券数 停车发券被核销数 核销发券数 核销发券被核销数 - // TODO DELETE sceneDataMap + wxCouponActionLogMapper.updateCreateTimeMd(params); List sceneList = wxCouponActionLogMapper.getSceneDataMap(params); //停车发券被核销数 @@ -207,13 +207,12 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { MarkingSceneDataReportVo msdVo = new MarkingSceneDataReportVo(); msdVo.setXTime(tj); Optional carStop = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.CAR_STOP.getCode()).findFirst(); - if(!carStop.isPresent()) { + if (!carStop.isPresent()) { msdVo.setParkSendCount(0); } else { MarkingSceneDataReportTVo tvo = carStop.get(); msdVo.setParkSendCount(tvo.getCount()); } - Optional couponVerify = sceneList.stream().filter(c -> c.getXTime().equals(tj) && c.getChannelType() == EnumCouponSendSendType.COUPON_VERIFY.getCode()).findFirst(); if(!couponVerify.isPresent()) { msdVo.setVerifySendCount(0); @@ -237,6 +236,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { MarkingSceneDataReportTVo tvo = orderSend.get(); msdVo.setOrderSendCount(tvo.getCount()); } + msdVo.setTotal(msdVo.getParkSendCount() + msdVo.getVerifySendCount() + msdVo.getMicroPaySendCount() + diff --git a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml index a95022773..8b1aa838e 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml @@ -110,6 +110,12 @@ order by create_time_md desc + + update wx_coupon_action_log + set create_time_md = DATE_FORMAT(create_time,'%m/%d') where tenant_id = #{tenantId}; + + + - + From 08e545e534a525ac688c34e6f527e889f2767c23 Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 26 Jun 2019 13:50:07 +0800 Subject: [PATCH 43/50] =?UTF-8?q?[=E7=BB=9F=E8=AE=A1][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=9A=E6=80=81=E5=88=86=E6=9E=90=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/basic/WxBrandController.java | 2 +- .../controller/sys/WxBusinessController.java | 68 +++++++++++++++++++ .../com/iformall/domain/po/WxBusiness.java | 8 +++ 3 files changed, 77 insertions(+), 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 470369fda..71b6a295d 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxBrandController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxBrandController.java @@ -43,7 +43,7 @@ public class WxBrandController extends BaseController { @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) @SystemControllerLog(description = "品牌-列表") - public ResultData list(@ModelAttribute WxBrand wxBrand, Integer pageNum, Integer pageSize) { + public ResultData list(@ModelAttribute WxBrand wxBrand,Integer pageNum, Integer pageSize) { logger.debug("[" + getIpAddr() + "] WxBrandController::list"); if (null == wxBrand) { wxBrand = new WxBrand(); diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java b/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java index e01d23700..0a4f55ef3 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java @@ -1,5 +1,6 @@ package com.iformall.controller.sys; +import com.github.pagehelper.PageInfo; import com.iformall.annotation.SystemControllerLog; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; @@ -9,12 +10,16 @@ import com.iformall.service.WxBusinessService; import com.iformall.service.WxSubBusinessService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.collections.map.LinkedMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; @RestController @RequestMapping("wxBusiness") @@ -46,4 +51,67 @@ public class WxBusinessController extends BaseController { return new ResultData(busList); } + @ApiOperation("业态分析接口") + @GetMapping("businessDataList") + @SystemControllerLog(description = "业态分析接口") + public ResultData businessDataList(@ModelAttribute WxBusiness wxBusiness) { + logger.debug("[" + getIpAddr() + "] WxBusinessController::businessDataList"); + List> result = new ArrayList<>(); + Map map = new HashMap<>(); + map.put("title","餐饮");//业态 + map.put("volume","2323.23");//营业额 + map.put("sale","32323.23");//销售坪效 + map.put("rent","32323.23");//租赁坪效 + map.put("rentSaleRate","0.23");//租售比 + map.put("comPrice","香奈儿");//客单价 + map.put("maxCom","32323.23");//贡献率最高商户 + result.add(map); + map = new HashMap<>(); + map.put("title","娱乐");//业态 + map.put("volume","2323.23");//营业额 + map.put("sale","32323.23");//销售坪效 + map.put("rent","32323.23");//租赁坪效 + map.put("rentSaleRate","0.23");//租售比 + map.put("comPrice","香奈儿");//客单价 + map.put("maxCom","32323.23");//贡献率最高商户 + result.add(map); + map = new HashMap<>(); + map.put("title","影视");//业态 + map.put("volume","2323.23");//营业额 + map.put("sale","32323.23");//销售坪效 + map.put("rent","32323.23");//租赁坪效 + map.put("rentSaleRate","0.23");//租售比 + map.put("comPrice","香奈儿");//客单价 + map.put("maxCom","32323.23");//贡献率最高商户 + result.add(map); + return new ResultData(result); + } + + @ApiOperation("贡献率排行") + @GetMapping("devoteList") + @SystemControllerLog(description = "业态分析接口") + public ResultData devoteList(@ModelAttribute WxBusiness wxBusiness,Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxBusinessController::devoteList"); + List> result = new ArrayList<>(); + Map map = new HashMap<>(); + map.put("merchantName","西贝筱面"); + map.put("sale","2323.23");//营业额 + map.put("sale","32323.23");//商户销售坪效 + map.put("devoteRate","1.23");//贡献率 + result.add(map); + map = new HashMap<>(); + map.put("merchantName","肯德基"); + map.put("sale","2323.23");//营业额 + map.put("sale","32323.23");//商户销售坪效 + map.put("devoteRate","1.23");//贡献率 + result.add(map); + PageInfo> page = new PageInfo<>(); + page.setList(result); + page.setTotal(2); + page.setPageNum(1); + page.setPageSize(20); + return new ResultData(page); + } + + } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBusiness.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBusiness.java index 6780d8739..8fdcf0dd3 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBusiness.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBusiness.java @@ -31,6 +31,14 @@ public class WxBusiness implements Serializable { @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") private Date updateDate; + @Transient + @io.swagger.annotations.ApiModelProperty(value="查询-开始时间",name="startdate") + private Date startdate; + + @Transient + @io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="enddate") + private Date enddate; + public static enum Field { Id_ASC("`id` ASC"),Id_DESC("`id` DESC") From be4ec6eb76b5b7c5edd3af5aa1b1b3bb6daa18a9 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 26 Jun 2019 14:00:20 +0800 Subject: [PATCH 44/50] =?UTF-8?q?[=E5=88=B8][=E4=BF=AE=E6=94=B9][couponAct?= =?UTF-8?q?ionLog=E6=B7=BB=E5=8A=A0]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/service/impl/WxOrderServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 d8e8424d2..baf089474 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -1205,6 +1205,15 @@ public class WxOrderServiceImpl implements WxOrderService { // 有价券 order = saveNoFreeOrderForCoupon(user, coupon, orderSaveDto.getCouponChannelId(), isPress, orderSaveDto.getOrderGroupId(), orderSaveDto.getFormId()); } + // couponActionLog + try { + wxCouponActionLogService.addOne(user.getTenantId(), order.getProductId(), order.getOrderNumber(), EnumCouponSendSendType.ACTIVE.getCode(), orderSaveDto.getCouponChannelId()); + } catch (Exception e) { + // 库存恢复 + stockBack(order); + logger.error("保存订单:" + e.getMessage()); + throw new MallinkException(ErrorCode.ORDER_SAVE_ERR); + } return order; } From cd82bdeede12a9829746adae82bf6e133fac69fd Mon Sep 17 00:00:00 2001 From: gongbiao Date: Wed, 26 Jun 2019 14:17:58 +0800 Subject: [PATCH 45/50] =?UTF-8?q?[=E8=B4=A6=E5=8D=95][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=9F=A5=E8=AF=A2=E5=88=97=E8=A1=A8=E6=97=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=B4=A6=E5=8D=95=E7=8A=B6=E6=80=81]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/service/impl/WxBillDailyServiceImpl.java | 2 -- .../com/iformall/service/impl/WxBillDepositServiceImpl.java | 2 -- .../iformall/service/impl/WxBillOtherDepositServiceImpl.java | 2 -- .../java/com/iformall/service/impl/WxBillOtherServiceImpl.java | 2 -- .../iformall/service/impl/WxBillPropertyDepositServiceImpl.java | 2 -- .../com/iformall/service/impl/WxBillPropertyServiceImpl.java | 2 -- .../java/com/iformall/service/impl/WxBillRentServiceImpl.java | 2 -- 7 files changed, 14 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java index 59a49ed98..08430b006 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java @@ -52,8 +52,6 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { WxMerchantShopMapper wxMerchantShopMapper; @Override public PageInfo> listAsPage(WxBillDaily record, Integer pageIndex, Integer pageSize) { - //更新账单状态 - updateBillStatus(record); //分页对象设置页数和条数 PageHelper.startPage(pageIndex, pageSize); //查询 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java index 36d873166..5ea8e9028 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java @@ -44,8 +44,6 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { @Override public PageInfo> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize) { - //更新账单状态 - //updateBillStatus(record); PageHelper.startPage(pageIndex, pageSize); List> billDepositList = wxBillDepositMapper.queryBillDepositList(record); PageInfo> pageInfo = new PageInfo<>(billDepositList); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java index 079d54ee2..7a88b8b1e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java @@ -44,8 +44,6 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService @Override public PageInfo> listAsPage(WxBillOtherDeposit record, Integer pageIndex, Integer pageSize) { - //更新账单状态 - //updateBillStatus(record); //分页对象设置页数和条数 PageHelper.startPage(pageIndex, pageSize); //查询 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java index e98e91f80..3783dd1c7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java @@ -43,8 +43,6 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { @Override public PageInfo> listAsPage(WxBillOther record, Integer pageIndex, Integer pageSize) { - //更新账单状态 - updateBillStatus(record); //分页对象设置页数和条数 PageHelper.startPage(pageIndex, pageSize); //查询 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java index 52cad67d8..b83c03e89 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java @@ -43,8 +43,6 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe @Override public PageInfo> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) { - //更新账单状态 - //updateBillStatus(record); PageHelper.startPage(pageIndex, pageSize); List> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(record); PageInfo> pageInfo = new PageInfo<>(billDepositList); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java index 48e3cfba9..ef20d0220 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java @@ -43,8 +43,6 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { @Override public PageInfo> listAsPage(WxBillProperty record, Integer pageIndex, Integer pageSize) { - //更新账单状态 - //updateBillStatus(record); PageHelper.startPage(pageIndex, pageSize); List> billRentList = wxBillPropertyMapper.queryBillPropertyList(record); PageInfo> pageInfo = new PageInfo<>(billRentList); 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 ed98b2fc9..f3036f158 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java @@ -43,8 +43,6 @@ public class WxBillRentServiceImpl implements WxBillRentService { @Override public PageInfo> listAsPage(WxBillRent record, Integer pageIndex, Integer pageSize) { - //更新账单状态 - updateBillStatus(record); PageHelper.startPage(pageIndex, pageSize); List> billRentList = wxBillRentMapper.queryBillRentList(record); PageInfo> pageInfo = new PageInfo<>(billRentList); From b8c4ccf44c7c512fedce1bf8673f8c3b5b068ea9 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 26 Jun 2019 15:01:13 +0800 Subject: [PATCH 46/50] =?UTF-8?q?[=E7=A7=9F=E6=88=B7][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E7=A0=8D=E4=BB=B7=E8=90=A5=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/iformall/tenant/TenantInfoImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java index bce6667ae..18ffe2c96 100644 --- a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -100,8 +100,6 @@ public class TenantInfoImpl implements TenantInfo { return true; if ("com.iformall.mapper.WxActivityJoinMapper.updateStatus".equals(ms.getId())) return true; - if ("com.iformall.mapper.WxCouponMapper.findPressData".equals(ms.getId())) - return true; return false; } } From c53144eb9eda4c720719fe73f7905896ff35982d Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 26 Jun 2019 15:19:48 +0800 Subject: [PATCH 47/50] =?UTF-8?q?[=E6=B6=88=E6=81=AF=E5=92=8C=E4=B8=93?= =?UTF-8?q?=E9=A2=98][=E4=BF=AE=E6=94=B9][=E4=BF=AE=E5=A4=8D=E6=AD=BB?= =?UTF-8?q?=E9=94=81=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/controller/sys/WxBusinessController.java | 2 -- .../com/iformall/mq/impl/RabbitMqMessageProducer.java | 6 +++--- .../com/iformall/service/impl/WxFlowServiceImpl.java | 2 +- .../iformall/service/impl/WxMsgRecordServiceImpl.java | 2 +- .../src/main/resources/mapper/WxMsgRecordMapper.xml | 8 +++++--- .../src/main/resources/mapper/WxTopicMapper.xml | 10 ++++++---- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java b/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java index 0a4f55ef3..bc033b620 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java @@ -10,12 +10,10 @@ import com.iformall.service.WxBusinessService; import com.iformall.service.WxSubBusinessService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.commons.collections.map.LinkedMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/mallinkService/src/main/java/com/iformall/mq/impl/RabbitMqMessageProducer.java b/mallinkService/src/main/java/com/iformall/mq/impl/RabbitMqMessageProducer.java index af7cd9852..cfc19a689 100644 --- a/mallinkService/src/main/java/com/iformall/mq/impl/RabbitMqMessageProducer.java +++ b/mallinkService/src/main/java/com/iformall/mq/impl/RabbitMqMessageProducer.java @@ -13,7 +13,6 @@ import org.springframework.amqp.core.AmqpTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Service; - import java.util.UUID; /** @@ -32,15 +31,16 @@ public class RabbitMqMessageProducer implements MqBaseProducer { @Autowired private WxMsgRecordService wxMsgRecordService; - @Override public void sendMessage(BaseMsg data, String topic, String tags, String keys) { try { data.setUuid(UUID.randomUUID().toString()); + wxMsgRecordService.save(data); rabbitTemplate.convertAndSend(topic, JsonUtil.obj2Json(data)); - wxMsgRecordService.save(data); + data.setMsgStatus(EnumMsgRecordStatus.SEND_SUCC.getCode()); + wxMsgRecordMapper.update(data); } catch (Exception e) { log.error("RabbitMqMessageProducer: Send Message Error ", e); } 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 b3432f9d1..fa6346793 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -138,7 +138,7 @@ public class WxFlowServiceImpl implements WxFlowService { if(supplement!=null && supplement && EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { wxRentContractService.updateRentContractStatus(businessId); } - }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType) || EnumFlowContractType.PROPERTY_POINT.getCode().equals(contractType)){ + }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType) || EnumFlowContractType.PROPERTY_POINT.getCode().equals(contractType)){ WxPropertyContract wxPropertyContract = new WxPropertyContract(); wxPropertyContract.setId(businessId); wxPropertyContract.setApplyStatus(applyStatus); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgRecordServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgRecordServiceImpl.java index 658cbde2d..714ff5b00 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgRecordServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgRecordServiceImpl.java @@ -46,7 +46,7 @@ public class WxMsgRecordServiceImpl implements WxMsgRecordService { msgRecord.setUuid(data.getUuid()); msgRecord.setId(idWorker.nextId()); msgRecord.setMsgJson(JsonUtil.obj2Json(data)); - msgRecord.setMsgStatus(EnumMsgRecordStatus.SEND_SUCC.getCode()); + msgRecord.setMsgStatus(EnumMsgRecordStatus.DEFAULT.getCode()); wxMsgRecordMapper.save(msgRecord); } diff --git a/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml b/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml index f907f14a0..6e02cd58f 100644 --- a/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml @@ -63,9 +63,11 @@ update wx_msg_record set updatetime = now() ,msg_status = #{msgStatus} ,status_message = #{statusMessage} - - and uuid = #{uuid} - + where id in( + select t.id from ( + select id from wx_msg_record where uuid = #{uuid} + ) t + ) - update wx_topic set status = 3 where now() >= end_time and tenant_id = #{tenantId} + update wx_topic set status = 3 where id in( + select t.id from ( + select id from wx_topic where status !=3 and now() >= end_time and tenant_id = #{tenantId} + ) t + ) - - update wx_coupon_channel set status = 1 where target_ad = 8 and sub_target_id in( + update wx_coupon_channel set status = 1 where status = 0 and target_ad = 8 and sub_target_id in( select id from wx_topic where status in(2,3) and tenant_id = #{tenantId} ) - From fd39dc4c1b8aa4e55415675e0f1c0bb939fa1991 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 26 Jun 2019 16:27:32 +0800 Subject: [PATCH 48/50] =?UTF-8?q?[=E5=BA=93=E5=AD=98][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=A0=8D=E4=BB=B7=E4=B8=AD=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/service/impl/WxOrderServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 baf089474..1812d927a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -201,6 +201,7 @@ public class WxOrderServiceImpl implements WxOrderService { orderQ.setType(EnumOrderType.COUPON.getCode()); orderQ.setCUserId(user.getId()); List statusS = new ArrayList<>(); + statusS.add(EnumOrderStatus.ORDER_STATUS_PRESSING.getCode()); statusS.add(EnumOrderStatus.ORDER_STATUS_PRESS_COMPLETE.getCode()); statusS.add(EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode()); statusS.add(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode()); From 55a0533cc44321af3bcfc8c2908be166be185073 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 26 Jun 2019 16:29:40 +0800 Subject: [PATCH 49/50] =?UTF-8?q?[=E5=BA=93=E5=AD=98][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=A0=8D=E4=BB=B7=E4=B8=AD=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/iformall/service/impl/WxOrderServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 1812d927a..8d34476a3 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -229,6 +229,7 @@ public class WxOrderServiceImpl implements WxOrderService { orderQ.setType(EnumOrderType.COUPON.getCode()); orderQ.setCUserId(user.getId()); List statusS = new ArrayList<>(); + statusS.add(EnumOrderStatus.ORDER_STATUS_PRESSING.getCode()); statusS.add(EnumOrderStatus.ORDER_STATUS_PRESS_COMPLETE.getCode()); statusS.add(EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode()); statusS.add(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode()); From d867037369ed9b569df3d1f2f70b8cd5c64c2e68 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 26 Jun 2019 16:51:53 +0800 Subject: [PATCH 50/50] =?UTF-8?q?[=E5=88=B8=E6=8A=95=E6=94=BE][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]:=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/controller/WxOrderController.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java index 5e2586286..8102b3f55 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java @@ -57,6 +57,10 @@ public class WxOrderController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); } WxCouponChannel wxCouponChannel = wxCouponChannelService.getById(orderSaveDto.getCouponChannelId()); + if (wxCouponChannel == null) { + logger.error("couponChannelId find error, " + orderSaveDto.getCouponChannelId()); + return new ResultData(ErrorCode.COUPON_CHANNEL_IS_TAKE_OFF); + } ResultData resultData = couponChannelCheck(orderSaveDto, wxCouponChannel); if (resultData != null) return resultData; @@ -122,11 +126,6 @@ public class WxOrderController extends BaseController { } private ResultData couponChannelCheck(@RequestBody OrderSaveDto orderSaveDto, WxCouponChannel wxCouponChannel) { - if (wxCouponChannel == null) { - logger.error("couponChannelId convert error, " + orderSaveDto.getCouponChannelId()); - return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR); - } - if (wxCouponChannel.getTargetAd().equals(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode())) { Date now = new Date(); if (wxCouponChannel.getBeginTime().getTime() > now.getTime()) {