| @@ -89,7 +89,8 @@ public class WxCouponController extends BaseController { | |||
| EnumCouponType.COUPON_DAIJIN.getCode(), | |||
| EnumCouponType.COUPON_LIPIN.getCode(), | |||
| EnumCouponType.COUPON_TINGCHE.getCode(), | |||
| EnumCouponType.COUPON_MULTIMCH.getCode()}; | |||
| EnumCouponType.COUPON_MULTIMCH.getCode(), | |||
| EnumCouponType.COUPON_DOUYIN.getCode()}; | |||
| wxCoupon.setTypes(Arrays.asList(typeArray)); | |||
| } | |||
| @@ -122,6 +123,7 @@ public class WxCouponController extends BaseController { | |||
| EnumCouponType.COUPON_LIPIN.getCode(), | |||
| EnumCouponType.COUPON_TINGCHE.getCode(), | |||
| EnumCouponType.COUPON_MULTIMCH.getCode(), | |||
| EnumCouponType.COUPON_DOUYIN.getCode(), | |||
| EnumCouponType.COUPON_PRESS.getCode(), | |||
| EnumCouponType.COUPON_PREORDER.getCode()}; | |||
| @@ -2,3 +2,9 @@ INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 211, 212, 221, 222, 223, 251, 409, 410, 411, 416, 500, 502, 504, 505, 506, 507, 508, 511, 512, 521, 522, 523, 531, 532, 591, 592, 595, 602, 605, 606, 607, 610, 641, 671, 674, 675, 680, 711, 901, 902, 904, 907, 60702]' WHERE `id` = 11; | |||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (647, '抖音券', 602, 'Y', NULL, 1, NULL, NULL, 'douyinCoupon', NULL, 0, 641); | |||
| UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 211, 212, 221, 222, 223, 251, 409, 410, 411, 416, 500, 502, 504, 505, 506, 507, 508, 511, 512, 521, 522, 523, 531, 532, 591, 592, 595, 602, 605, 606, 607, 610, 641, 647, 671, 674, 675, 680, 711, 901, 902, 904, 907, 60702]' WHERE `id` = 11; | |||
| @@ -95,6 +95,7 @@ public class WxCouponController extends BaseController { | |||
| EnumCouponType.COUPON_LIPIN.getCode(), | |||
| EnumCouponType.COUPON_TINGCHE.getCode(), | |||
| EnumCouponType.COUPON_MULTIMCH.getCode(), | |||
| EnumCouponType.COUPON_DOUYIN.getCode(), | |||
| EnumCouponType.COUPON_PRESS.getCode(), | |||
| EnumCouponType.COUPON_PREORDER.getCode()}; | |||
| @@ -416,6 +416,7 @@ public class PosServiceImpl implements PosService { | |||
| // 2. 检查券类型 核销可用(4, 6, 8, 9) | |||
| EnumCouponType couponType = EnumCouponType.getEnum(couponOrderCVo.getCouponType()); | |||
| if (!(couponType.getCode().equals(EnumCouponType.COUPON_MULTIMCH.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_DOUYIN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_LIPIN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_PRESS.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_GROUP.getCode()) || | |||
| @@ -455,6 +456,7 @@ public class PosServiceImpl implements PosService { | |||
| // 2. 检查券类型 核销可用(4, 6, 8, 9) | |||
| EnumCouponType couponType = EnumCouponType.getEnum(couponOrderCVo.getCouponType()); | |||
| if (!(couponType.getCode().equals(EnumCouponType.COUPON_MULTIMCH.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_DOUYIN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_LIPIN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_PRESS.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_GROUP.getCode()) || | |||
| @@ -508,6 +510,7 @@ public class PosServiceImpl implements PosService { | |||
| // 2. 检查券类型 支付可用(1, 2, 6), | |||
| EnumCouponType couponType = EnumCouponType.getEnum(couponOrderCVo.getCouponType()); | |||
| if (!(couponType.getCode().equals(EnumCouponType.COUPON_MULTIMCH.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_DOUYIN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_MANJIAN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_DAIJIN.getCode()))) { | |||
| logger.error(ErrorCode.VERIFY_COUPON_TYPE_NOT_SUPPORT.getMessage()); | |||
| @@ -568,6 +571,7 @@ public class PosServiceImpl implements PosService { | |||
| // 2. 检查券类型 支付可用(1, 2, 6), | |||
| EnumCouponType couponType = EnumCouponType.getEnum(couponOrderCVo.getCouponType()); | |||
| if (!(couponType.getCode().equals(EnumCouponType.COUPON_MULTIMCH.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_DOUYIN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_MANJIAN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_DAIJIN.getCode()))) { | |||
| logger.error(ErrorCode.VERIFY_COUPON_TYPE_NOT_SUPPORT.getMessage()); | |||
| @@ -15,6 +15,8 @@ import java.util.List; | |||
| public class TtSpuSync implements Serializable { | |||
| private static final long serialVersionUID = -132141170587251217L; | |||
| private String spuId;//接入方商品ID******************** | |||
| /** | |||
| * 入口信息 | |||
| * entry_miniApp onject 小程序入口参数 | |||
| @@ -56,6 +58,7 @@ public class TtSpuSync implements Serializable { | |||
| private Boolean orderDependsOnDate;//下单是否依赖日期 | |||
| private Integer spuType;//spu类型号,1-日历房,30-酒店民宿预售券,90-门票,91-团购券********** | |||
| private Integer status;//SPU状态, 1 - 在线; 2 - 下线********** | |||
| private String statusDesc;//状态描述 | |||
| private Integer stock;//库存********* | |||
| @@ -76,6 +76,7 @@ public class TtSpuSyncAdapter implements JsonSerializer<TtSpuSync>, JsonDeserial | |||
| protected TtSpuSync convertFromJson(JsonObject json) { | |||
| TtSpuSync spuSync = new TtSpuSync(); | |||
| spuSync.setSpuId(GsonHelper.getString(json, "spu_id")); | |||
| spuSync.setEntryInfo(json.getAsJsonObject("entry_info")); | |||
| String[] front_category_tags = GsonHelper.getStringArray(json, "front_category_tag"); | |||
| if(front_category_tags != null){ | |||
| @@ -111,6 +112,7 @@ public class TtSpuSyncAdapter implements JsonSerializer<TtSpuSync>, JsonDeserial | |||
| spuSync.setOrderDependsOnDate(GsonHelper.getBoolean(json, "order_depends_on_date")); | |||
| spuSync.setSpuType(GsonHelper.getInteger(json, "spu_type")); | |||
| spuSync.setStatus(GsonHelper.getInteger(json, "status")); | |||
| spuSync.setStatusDesc(GsonHelper.getString(json, "status_desc")); | |||
| spuSync.setStock(GsonHelper.getInteger(json, "stock")); | |||
| return spuSync; | |||
| } | |||
| @@ -16,6 +16,7 @@ public enum EnumCouponType { | |||
| COUPON_LIPIN(4, "礼品券"), | |||
| COUPON_TINGCHE(5, "停车券"), | |||
| COUPON_MULTIMCH(6, "通用券"), | |||
| COUPON_DOUYIN(66, "抖音券"), | |||
| COUPON_PRESS(8, "砍价券"), | |||
| COUPON_GROUP(9, "团购券"), | |||
| COUPON_PREORDER(10, "预购商品"), | |||
| @@ -23,6 +24,7 @@ public enum EnumCouponType { | |||
| COUPON_GIFT(12, "券礼包"), | |||
| COUPON_CREDIT(50,"积分券"), | |||
| COUPON_CREDIT_PARK(51,"积分停车券"), | |||
| CARD_MULTIMCH(100, "消费卡"), | |||
| ; | |||
| @@ -61,14 +63,10 @@ public enum EnumCouponType { | |||
| return message; | |||
| } | |||
| //只有通用,满减,代金,礼品才能同步poi | |||
| //只有抖音卷才能同步poi | |||
| public static List<Integer> getSpuSyncType(){ | |||
| List<Integer> typeList = new ArrayList<>(); | |||
| typeList.add(COUPON_MANJIAN.getCode()); | |||
| typeList.add(COUPON_DAIJIN.getCode()); | |||
| typeList.add(COUPON_TUANGOU.getCode()); | |||
| typeList.add(COUPON_LIPIN.getCode()); | |||
| typeList.add(COUPON_MULTIMCH.getCode()); | |||
| typeList.add(COUPON_DOUYIN.getCode()); | |||
| return typeList; | |||
| } | |||
| } | |||
| @@ -28,9 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.*; | |||
| import java.util.stream.Collectors; | |||
| /** | |||
| @@ -725,16 +723,39 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { | |||
| TtSpuGet spuGet = new TtSpuGet(); | |||
| spuGet.setSpuExtId(couponChannel.getId().toString()); | |||
| spuGet.setNeedSpuDraft(true); | |||
| spuGet.setSpuDraftcount(10); | |||
| spuGet.setSpuDraftcount(3); | |||
| try { | |||
| TtSpuGetResult spuGetResult = getTtWebService(tenantInfo).getProductService().spuGet(spuGet); | |||
| return new ResultData(spuGetResult); | |||
| //处理一下数据 | |||
| Map<String,Object> map = new HashMap<>(); | |||
| if(spuGetResult.getSpuDetail() != null){//线上数据 | |||
| TtSpuSync spuDetail = spuGetResult.getSpuDetail(); | |||
| map.put("spuDetail",handSpuSync(spuDetail)); | |||
| } | |||
| if(spuGetResult.getSpuDraft() != null && spuGetResult.getSpuDraft().size() > 0){//最近一次审核数据 | |||
| TtSpuSync spuDraft = spuGetResult.getSpuDraft().get(0); | |||
| map.put("spuDraft",handSpuSync(spuDraft)); | |||
| } | |||
| return new ResultData(map); | |||
| } catch (WxErrorException e) { | |||
| logger.error("couponChannelId:"+couponChannelId +" 多门店SPU信息查询error "+e.getMessage()); | |||
| return new ResultData(ErrorCode.MSG_METHOD_REQUEST_ERROR.getCode(),e.getMessage()); | |||
| } | |||
| } | |||
| private Map<String,Object> handSpuSync(TtSpuSync spuSync){ | |||
| Map<String,Object> map = new HashMap<>(); | |||
| map.put("id",spuSync.getSpuExtId()); | |||
| map.put("spu_id",spuSync.getSpuId()); | |||
| map.put("name",spuSync.getName()); | |||
| map.put("price",spuSync.getPrice()); | |||
| map.put("origin_price",spuSync.getOriginPrice()); | |||
| map.put("stock",spuSync.getStock()); | |||
| map.put("status",spuSync.getStatus()); | |||
| map.put("status_desc",spuSync.getStatusDesc()); | |||
| return map; | |||
| } | |||
| @Override | |||
| public ResultData spuStatusSync(TenantEntity tenantInfo, Long couponChannelId) { | |||
| WxCouponChannel couponChannel = wxCouponChannelMapper.selectById(couponChannelId, tenantInfo.getTenantId()); | |||
| @@ -2471,6 +2471,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| // 2. 检查券类型 支付可用(1, 2, 6), | |||
| EnumCouponType couponType = EnumCouponType.getEnum(couponOrderCVo.getCouponType()); | |||
| if (!(couponType.getCode().equals(EnumCouponType.COUPON_MULTIMCH.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_DOUYIN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_MANJIAN.getCode()) || | |||
| couponType.getCode().equals(EnumCouponType.COUPON_DAIJIN.getCode()))) { | |||
| logger.error(ErrorCode.VERIFY_COUPON_TYPE_NOT_SUPPORT.getMessage()); | |||
| @@ -2549,8 +2550,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| throw new MallinkException(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| if (!(wxCoupon.getType().equals(EnumCouponType.COUPON_MANJIAN.getCode()) || | |||
| wxCoupon.getType().equals(EnumCouponType.COUPON_DAIJIN.getCode()) || | |||
| wxCoupon.getType().equals(EnumCouponType.COUPON_MULTIMCH.getCode()))) { | |||
| wxCoupon.getType().equals(EnumCouponType.COUPON_DOUYIN.getCode()) || | |||
| wxCoupon.getType().equals(EnumCouponType.COUPON_DAIJIN.getCode()) || | |||
| wxCoupon.getType().equals(EnumCouponType.COUPON_MULTIMCH.getCode()))) { | |||
| logger.error("收银台不支持此券类型: " + wxCoupon.getType()); | |||
| throw new MallinkException(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED); | |||
| } | |||
| @@ -3028,6 +3030,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| typeList.add(EnumCouponType.COUPON_MANJIAN.getCode()); | |||
| typeList.add(EnumCouponType.COUPON_DAIJIN.getCode()); | |||
| typeList.add(EnumCouponType.COUPON_MULTIMCH.getCode()); | |||
| typeList.add(EnumCouponType.COUPON_DOUYIN.getCode()); | |||
| couponQ.setTypes(typeList); | |||
| List<Long> couponIds = wxCouponMapper.findIdList(couponQ); | |||
| List<Long> realCouponIds = new ArrayList<Long>(); | |||