diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906241100__G_BILL_ACTION.sql b/mallinkAdmin/src/main/resources/db/migration/V201906241100__G_BILL_ACTION.sql new file mode 100644 index 000000000..5cbb96930 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906241100__G_BILL_ACTION.sql @@ -0,0 +1 @@ +ALTER TABLE `wx_bill_action` ADD COLUMN `pay_date` datetime DEFAULT NULL COMMENT '付款时间'; \ No newline at end of file diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906241140__L_ADD_FLOW_DATA.sql b/mallinkAdmin/src/main/resources/db/migration/V201906241140__L_ADD_FLOW_DATA.sql new file mode 100644 index 000000000..6d0785680 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906241140__L_ADD_FLOW_DATA.sql @@ -0,0 +1,88 @@ +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560252222, 0, '789', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560253333, 0, '790', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560254444, 0, '1001', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560255555, 0, '1002', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560255556, 0, '1003', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560256666, 0, '1004', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560257777, 0, '1005', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560258888, 0, '1006', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560259999, 0, '1007', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560260000, 0, '1008', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) +VALUES + (1560260001, 0, '1009', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '卡审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '拼团审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3), + ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '砍价审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4); + diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906241400__DROP_SCREENAD_QRCODE.sql b/mallinkAdmin/src/main/resources/db/migration/V201906241400__DROP_SCREENAD_QRCODE.sql new file mode 100644 index 000000000..e439c620c --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906241400__DROP_SCREENAD_QRCODE.sql @@ -0,0 +1,2 @@ +ALTER TABLE `wx_screen_ad` +DROP COLUMN `qrcode`; \ No newline at end of file diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java index 4b264c6bf..4bbaac6e4 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -2,7 +2,6 @@ package com.iformall.controller; import com.github.pagehelper.PageInfo; import com.iformall.domain.po.WxMerchant; -import com.iformall.domain.po.WxMerchantBUser; import com.iformall.domain.vo.WxCouponChannelVo; import com.iformall.enums.EnumCouponChannelActivityStatus; import com.iformall.enums.EnumCouponChannelStatus; @@ -24,7 +23,6 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import java.util.Date; -import java.util.HashMap; import java.util.Map; @RestController @@ -48,7 +46,7 @@ public class WxCouponChannelController extends BaseController { if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); wxCouponChannel.setTenantId(getTenantId()); wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); - wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC); + wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC, WxCouponChannel.Field.Id_DESC); PageInfo page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); filterTimed(wxCouponChannel, page); @@ -64,7 +62,7 @@ public class WxCouponChannelController extends BaseController { public ResultData listByMerchant(@ModelAttribute WxCouponChannel wxCouponChannel, Integer pageNum, Integer pageSize) { wxCouponChannel.setTenantId(getTenantId()); wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); - wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC); + wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC, WxCouponChannel.Field.Id_DESC); Map map = new HashedMap(); PageInfo page = wxCouponChannelService.listByMerchant(wxCouponChannel,pageNum,pageSize); diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java index c312e05d4..d5e33c65a 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponOrderController.java @@ -3,14 +3,12 @@ package com.iformall.controller; import com.github.pagehelper.PageInfo; import com.iformall.common.ErrorCode; import com.iformall.common.ResultData; -import com.iformall.domain.po.WxCUser; import com.iformall.domain.po.WxCouponOrder; import com.iformall.domain.vo.WxCardCVo; import com.iformall.domain.vo.WxCouponOrderCVo; import com.iformall.enums.EnumCouponChannelActivityStatus; import com.iformall.enums.EnumCouponOrderStatus; import com.iformall.enums.EnumCouponOrderValidStatus; -import com.iformall.exception.MallinkException; import com.iformall.service.WxCouponOrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -51,11 +49,11 @@ public class WxCouponOrderController extends BaseController { if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderCVo(); wxCouponOrder.setCUserId(getUserId()); if (wxCouponOrder.getCouponOrderStatus() == null) - wxCouponOrder.setSortColumns(WxCouponOrder.Field.CreateDate_DESC); + wxCouponOrder.setSortColumns(WxCouponOrder.Field.CreateDate_DESC, WxCouponOrder.Field.Id_DESC); else if (wxCouponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()) - wxCouponOrder.setSortColumns(WxCouponOrder.Field.CreateDate_DESC); + wxCouponOrder.setSortColumns(WxCouponOrder.Field.CreateDate_DESC, WxCouponOrder.Field.Id_DESC); else - wxCouponOrder.setSortColumns(WxCouponOrder.Field.UpdateDate_DESC); + wxCouponOrder.setSortColumns(WxCouponOrder.Field.UpdateDate_DESC, WxCouponOrder.Field.Id_DESC); PageInfo page = wxCouponOrderService.listCUserVoAsPage(wxCouponOrder, pageNum, pageSize); diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java index c56f11dcc..2f5b4a698 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java @@ -257,6 +257,46 @@ public class WxOrderController extends BaseController { } } + @ApiOperation(value = "获取未支付订单", notes = "{\"couponId\":\"string\"}") + @GetMapping("/getUnPaidOrder") + public ResultData getUnPaidOrder(@RequestBody Map paramMap) { + String couponIdStr = paramMap.get("couponId"); + if (StringUtils.isBlank(couponIdStr)) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); + } + Long couponId = 0L; + try { + couponId = Long.valueOf(couponIdStr); + } catch (NumberFormatException e) { + logger.error("parse couponId failed"); + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "券ID转换异常"); + } + WxCoupon wxCoupon = null; + try { + wxCoupon = wxCouponService.getById(couponId); + } catch (Exception e) { + logger.error("券ID获取券信息失败, couponId: " + couponIdStr); + return new ResultData(ErrorCode.COUPON_IS_EMPTY); + } + if(wxCoupon == null) { + logger.error("券ID获取券信息失败, couponId: " + couponIdStr); + return new ResultData(ErrorCode.COUPON_IS_EMPTY); + } + + WxOrder order = null; + try { + order = wxOrderService.getUnPaidOrder(getUser(), wxCoupon); + if (order != null) { + return new ResultData(Result.SUCCESS, "查询成功", order); + } else { + return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); + } + } catch (Exception e) { + logger.error("parse orderId failed"); + return new ResultData(ErrorCode.DB_FAIL.getCode(), "订单查询未成功,e:" + e.getMessage()); + } + } + @ApiOperation("我的砍价-分页列表接口") @GetMapping("pressOrderList") @ApiImplicitParams({ diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillAction.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillAction.java index bfdefd74c..bd1392144 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillAction.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillAction.java @@ -53,6 +53,9 @@ public class WxBillAction implements Serializable { @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updatetime") private Date updatetime; + @io.swagger.annotations.ApiModelProperty(value = "付款时间", name = "payDate") + private Date payDate; + @Transient private Long oldPrice; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxScreenAd.java b/mallinkService/src/main/java/com/iformall/domain/po/WxScreenAd.java index f6f092cf4..6255b0033 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxScreenAd.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxScreenAd.java @@ -59,9 +59,6 @@ public class WxScreenAd extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="广告目标ID: couponChannelId or campaignId",name="targetId") private Long targetId; - @io.swagger.annotations.ApiModelProperty(value="广告目标二维码",name="qrcode") - private byte[] qrcode; - @Transient protected Object target; diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java b/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java index 3f6cc3673..a7da5eb57 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumFlowKey.java @@ -14,7 +14,11 @@ public enum EnumFlowKey{ NEW_RENT_END_CONTRACT(6, "商铺合同终止"), NEW_SHOP_END_CONTRACT(7, "多经点位合同终止"), NEW_BILL_CHANGE(8, "账单应收金额变更"), - NEW_COUPON_UPLINE(9, "有价券上架"), + + NEW_COUPON_UPLINE(9, "有价券审批"), + NEW_CARD_UPLINE(10, "卡审批"), + NEW_GROUP_UPLINE(11, "拼团"), + NEW_PRESS_UPLINE(12, "砍价审批"), ; public static EnumFlowKey getEnum(Integer code) { diff --git a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java index 14a94ccc6..090e0e32b 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java @@ -158,6 +158,14 @@ public interface WxOrderService { WxOrder saveOrderForCoupon(WxCUser user, WxCoupon coupon, OrderSaveDto orderSaveDto, boolean isPress); void sendOrderSuccessActionMsg(WxOrder updateOrder); + /** + * 未支付订单 + * @param cUser + * @param coupon + * @return + */ + WxOrder getUnPaidOrder(WxCUser cUser, WxCoupon coupon); + /** * 订单处理 * 1. 检查coupon是否免费 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 85418a705..59a49ed98 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java @@ -159,8 +159,8 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { wxBillDaily.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); - wxBillDaily.setPayDate(date); } + wxBillDaily.setPayDate(record.getPayDate()); wxBillDaily.setUpdatetime(date); wxBillDaily.setPayWay(record.getPayWay()); try { @@ -180,6 +180,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { wxBillAction.setUserName(user.getName()); wxBillAction.setPhone(user.getPhone()); wxBillAction.setTenantId(wxBillDaily.getTenantId()); + wxBillAction.setPayDate(wxBillDaily.getPayDate()); try { wxBillActionService.save(wxBillAction); } catch (Exception e) { 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 496cab032..36d873166 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java @@ -135,8 +135,8 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { wxBillDeposit.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); - wxBillDeposit.setPayDate(date); } + wxBillDeposit.setPayDate(record.getPayDate()); wxBillDeposit.setUpdatetime(date); wxBillDeposit.setUpdatetime(new Date()); wxBillDeposit.setPayWay(record.getPayWay()); @@ -157,6 +157,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { wxBillAction.setUserName(user.getName()); wxBillAction.setPhone(user.getPhone()); wxBillAction.setTenantId(wxBillDeposit.getTenantId()); + wxBillAction.setPayDate(wxBillDeposit.getPayDate()); try { wxBillActionService.save(wxBillAction); } catch (Exception e) { 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 00eba0e86..079d54ee2 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java @@ -151,8 +151,8 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService wxBillOtherDeposit.setOwe(record.getReceivePay() - record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); - wxBillOtherDeposit.setPayDate(date); } + wxBillOtherDeposit.setPayDate(record.getPayDate()); wxBillOtherDeposit.setUpdatetime(date); wxBillOtherDeposit.setPayWay(record.getPayWay()); wxBillOtherDeposit.setComments(record.getComments()); @@ -173,6 +173,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService wxBillAction.setUserName(user.getName()); wxBillAction.setPhone(user.getPhone()); wxBillAction.setTenantId(wxBillOtherDeposit.getTenantId()); + wxBillAction.setPayDate(wxBillOtherDeposit.getPayDate()); try { wxBillActionService.save(wxBillAction); } catch (Exception e) { 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 a2e633404..e98e91f80 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java @@ -150,8 +150,8 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { wxBillOther.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); - wxBillOther.setPayDate(date); } + wxBillOther.setPayDate(record.getPayDate()); wxBillOther.setUpdatetime(date); wxBillOther.setPayWay(record.getPayWay()); wxBillOther.setComments(record.getComments()); @@ -173,6 +173,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { wxBillAction.setUserName(user.getName()); wxBillAction.setPhone(user.getPhone()); wxBillAction.setTenantId(wxBillOther.getTenantId()); + wxBillAction.setPayDate(wxBillOther.getPayDate()); try { wxBillActionService.save(wxBillAction); } catch (Exception e) { 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 3e18ccb29..52cad67d8 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java @@ -135,8 +135,8 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe wxBillDeposit.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); - wxBillDeposit.setPayDate(date); } + wxBillDeposit.setPayDate(record.getPayDate()); wxBillDeposit.setUpdatetime(date); wxBillDeposit.setPayWay(record.getPayWay()); try { @@ -156,6 +156,7 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe wxBillAction.setUserName(user.getName()); wxBillAction.setPhone(user.getPhone()); wxBillAction.setTenantId(wxBillDeposit.getTenantId()); + wxBillAction.setPayDate(wxBillDeposit.getPayDate()); try { wxBillActionService.save(wxBillAction); } catch (Exception e) { 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 49cdfdd1c..48e3cfba9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java @@ -138,8 +138,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { property.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { property.setStatus(EnumBillRentStatus.PAID.getCode()); - property.setPayDate(date); } + property.setPayDate(record.getPayDate()); property.setUpdatetime(date); property.setPayWay(record.getPayWay()); try { @@ -159,6 +159,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { wxBillAction.setUserName(user.getName()); wxBillAction.setPhone(user.getPhone()); wxBillAction.setTenantId(property.getTenantId()); + wxBillAction.setPayDate(property.getPayDate()); try { wxBillActionService.save(wxBillAction); } catch (Exception e) { 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 829cc17e8..ed98b2fc9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java @@ -137,8 +137,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { wxBillRent.setOwe(record.getReceivePay()-record.getPay()); if (record.getPay().equals(record.getReceivePay())) { wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); - wxBillRent.setPayDate(date); } + wxBillRent.setPayDate(record.getPayDate()); wxBillRent.setUpdatetime(date); wxBillRent.setPayWay(record.getPayWay()); try { @@ -158,6 +158,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { wxBillAction.setUserName(user.getName()); wxBillAction.setPhone(user.getPhone()); wxBillAction.setTenantId(wxBillRent.getTenantId()); + wxBillAction.setPayDate(wxBillRent.getPayDate()); try { wxBillActionService.save(wxBillAction); } catch (Exception e) { 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 0626cff64..e4524609f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -209,6 +209,36 @@ public class WxOrderServiceImpl implements WxOrderService { } + /** + * 用户购买的订单数量 + * @param user + * @param counpon + * @return + */ + public WxOrder getUnPaidOrder(WxCUser user, WxCoupon counpon) { + // + Order 待支付 + try { + WxOrder orderQ = new WxOrder(); + orderQ.setTenantId(user.getTenantId()); + orderQ.setProductId(counpon.getId()); + orderQ.setType(EnumOrderType.COUPON.getCode()); + orderQ.setCUserId(user.getId()); + List statusS = new ArrayList<>(); + statusS.add(EnumOrderStatus.ORDER_STATUS_PRESS_COMPLETE.getCode()); + statusS.add(EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode()); + statusS.add(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode()); + orderQ.setStatusS(statusS); + List orders = wxOrderMapper.findList(orderQ); + if(orders.size() > 1) { + return orders.get(0); + } + } catch (Exception e) { + logger.error("待支付Order, couponId: " + counpon.getId() + ", e:" + e.getMessage()); + throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); + } + return null; + } + /** * 用户购买的券包数量- 待使用的券 * @param user diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxScreenAdServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxScreenAdServiceImpl.java index c70dd7076..672df8b72 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxScreenAdServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxScreenAdServiceImpl.java @@ -34,18 +34,12 @@ import java.util.List; public class WxScreenAdServiceImpl implements WxScreenAdService { private final Logger logger = LoggerFactory.getLogger(this.getClass()); - @Autowired - private boolean isFmOpen; - @Autowired WxScreenAdMapper wxScreenAdMapper; @Autowired WxAppinfoService wxAppinfoService; - @Autowired - private FmOpenService openService; - @Autowired WxCouponChannelMapper wxCouponChannelMapper; @@ -89,15 +83,10 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { record.setId(idWorker.nextId()); record.setCreateDate(new Date()); record.setUpdateDate(new Date()); - setQrcode(record); - if (record.getQrcode() == null) - return new ResultData(ErrorCode.DEVICE_QRCODE_GET_FAILED); - wxScreenAdMapper.insertSelective(record); } else { record.setUpdateDate(new Date()); - setQrcode(record); wxScreenAdMapper.updateByPrimaryKeySelective(record); } return new ResultData(); @@ -142,63 +131,4 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { wxScreenAdMapper.updateStatusByCouponChannelId(wxScreenAd); }); } - - - private void setQrcode(WxScreenAd record){ - if (record.getTargetId() != null && - record.getType() != null && - record.getTenantId() != null) - try { - record.setQrcode(getQrcode(record.getTargetId(), - record.getType().intValue(), - record.getSubType().intValue(), - wxAppinfoService.getCAppInfo(record.getTenantId()))); - }catch (Exception e) { - logger.error("QRCODE set Error:"+e.getMessage()); - } - } - - private static int QRCODE_WIDTH = 280; - private static String QRCODE_PAGE_HOME = "pages/index/index"; - private static boolean QRCODE_AUTO_COLOR = false; - private static boolean QRCODE_IS_HYALINE = true; - //private static int QRCODE_LINCOLOR =; - - private static String QRCODE_JUMP_CMD_HOME = "JH"; - private static String QRCODE_JUMP_CMD_COUPON = "JC"; - private static String QRCODE_JUMP_CMD_GROUP = "JG"; - private static String QRCODE_JUMP_CMD_CAMPGIN = "JB"; - - private byte[] getQrcode(Long id, int type, int subType, WxAppinfo appInfo) throws Exception { - if(appInfo == null) { - logger.error("QRCODE get error: appinfo is null"); - return null; - } - WxMaService wxMaService = null; - if(isFmOpen) { - wxMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appInfo.getAppId()); - } else { - wxMaService = MaUtil.getWeappService(appInfo); - } - - String scene = ""; - if (EnumScreenAdType.COUPON.getCode().equals(type)) { - if (EnumCouponChannelType.COUPON_CHANNEL_ID_ORDER_GROUP.getCode().equals(subType)) { - scene = QRCODE_JUMP_CMD_GROUP + ":" + id.toString(); - } else { - scene = QRCODE_JUMP_CMD_COUPON + ":" + id.toString(); - } - } - else if (EnumScreenAdType.CAMPAIGN.getCode().equals(type)) - scene = QRCODE_JUMP_CMD_CAMPGIN+":"+id.toString(); - else - scene = QRCODE_JUMP_CMD_HOME+":"+"0"; - - try { - return wxMaService.getQrcodeService().createWxaCodeUnlimitBytes(scene, QRCODE_PAGE_HOME, QRCODE_WIDTH, QRCODE_AUTO_COLOR, null, QRCODE_IS_HYALINE); - }catch (WxErrorException e) { - logger.error("QRCODE get error: " + e.getMessage()); - } - return null; - } } diff --git a/mallinkService/src/main/resources/mapper/WxScreenAdMapper.xml b/mallinkService/src/main/resources/mapper/WxScreenAdMapper.xml index 70d7dd33d..8e9929502 100644 --- a/mallinkService/src/main/resources/mapper/WxScreenAdMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxScreenAdMapper.xml @@ -12,11 +12,10 @@ - - `id`, `tenant_id`, `title`, `type`, `sub_type`, `status`, `create_date`, `update_date`, `cover_img`, `target_id`, `qrcode` + `id`, `tenant_id`, `title`, `type`, `sub_type`, `status`, `create_date`, `update_date`, `cover_img`, `target_id`