| @@ -61,7 +61,8 @@ public class WxBusinessController extends BaseController { | |||
| @SystemControllerLog(description = "业态分析接口") | |||
| public ResultData businessDataList(@ModelAttribute WxBusiness wxBusiness) throws Exception{ | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::businessDataList"); | |||
| wxBusiness.updateTenantInfo(getTenantInfo()); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| wxBusiness.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| if(wxBusiness.getStartdate() == null || wxBusiness.getEnddate() == null){ | |||
| Date sDate = DateUtils.getFirstDayForCurrMonth(DateUtils.getLastMonthToDay()); | |||
| Date eDate = DateUtils.getLastDayForMonth(DateUtils.getLastMonthToDay()); | |||
| @@ -71,7 +72,7 @@ public class WxBusinessController extends BaseController { | |||
| wxBusiness.setEnddate(sdT.parse(sd.format(eDate)+" 23:59:59")); | |||
| } | |||
| List<Map<String,Object>> mapList = wxBusinessService.businessDataList(wxBusiness,getUserId()); | |||
| List<Map<String,Object>> mapList = wxBusinessService.businessDataList(tenantEntity,wxBusiness,getUserId()); | |||
| for (Map<String,Object> map:mapList) { | |||
| if(map.get("rent") == null){ | |||
| map.put("rent",0); | |||
| @@ -99,7 +100,8 @@ public class WxBusinessController extends BaseController { | |||
| @SystemControllerLog(description = "导出业态数据列表") | |||
| public void exportBusinessDataList(@ModelAttribute WxBusiness wxBusiness, HttpServletResponse response) throws Exception{ | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::exportBusinessDataList"); | |||
| wxBusiness.updateTenantInfo(getTenantInfo()); | |||
| TenantEntity tenantEntity = getTenantInfo(); | |||
| wxBusiness.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| if(wxBusiness.getStartdate() == null || wxBusiness.getEnddate() == null){ | |||
| Date sDate = DateUtils.getFirstDayForCurrMonth(DateUtils.getLastMonthToDay()); | |||
| Date eDate = DateUtils.getLastDayForMonth(DateUtils.getLastMonthToDay()); | |||
| @@ -108,7 +110,7 @@ public class WxBusinessController extends BaseController { | |||
| wxBusiness.setStartdate(sdT.parse(sd.format(sDate)+" 00:00:00")); | |||
| wxBusiness.setEnddate(sdT.parse(sd.format(eDate)+" 23:59:59")); | |||
| } | |||
| List<Map<String,Object>> dataList = wxBusinessService.businessDataList(wxBusiness,getUserId()); | |||
| List<Map<String,Object>> dataList = wxBusinessService.businessDataList(tenantEntity,wxBusiness,getUserId()); | |||
| List<WxBusinessDataVo> exeList = new ArrayList<>(); | |||
| for (Map<String,Object> m:dataList) { | |||
| WxBusinessDataVo businessDataVo = new WxBusinessDataVo(); | |||
| @@ -162,7 +164,7 @@ public class WxBusinessController extends BaseController { | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData devoteList(@ModelAttribute WxBusiness wxBusiness,Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::devoteList"); | |||
| wxBusiness.updateTenantInfo(getTenantInfo()); | |||
| wxBusiness.setFinalTenantId(this.getTenantInfo().getFinalTenantId()); | |||
| return new ResultData(wxBusinessService.devoteList(wxBusiness,pageNum,pageSize)); | |||
| } | |||
| @@ -0,0 +1,9 @@ | |||
| alter table wx_tags add column is_del int(1) not null default 0 comment '是否已删除,1-是,0-否'; | |||
| update wx_tags set is_del = 1 where type_id in (14,17); | |||
| alter table wx_business add column final_tenant_id varchar(5) comment ''; | |||
| wx_business 主见改自增 | |||
| @@ -2,6 +2,7 @@ package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntityWithoutFinalTenantId; | |||
| import com.iformall.domain.po.base.TenantVEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -11,10 +12,11 @@ import java.util.Date; | |||
| @TableName(value = "wx_business") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxBusiness extends TenantVEntity { | |||
| public class WxBusiness extends TenantEntityWithoutFinalTenantId { | |||
| protected Integer id; | |||
| @io.swagger.annotations.ApiModelProperty(value="如果是集团版的,存集团版的tenantId,如果是商场,则存商场",name="finalTenantId") | |||
| private String finalTenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="业态名",name="title") | |||
| private String title; | |||
| @io.swagger.annotations.ApiModelProperty(value="1.优惠券",name="type") | |||
| @@ -218,9 +218,9 @@ public class WxMerchant extends TenantEntity { | |||
| } | |||
| } | |||
| public String getBusinessName() { | |||
| return EnumBusiness.getEnumMessage(businessId); | |||
| } | |||
| // public String getBusinessName() { | |||
| // return EnumBusiness.getEnumMessage(businessId); | |||
| // } | |||
| public String getSubBusinessName() { | |||
| return EnumSubBusiness.getEnumMessage(subBusinessId); | |||
| @@ -28,6 +28,8 @@ public class WxTags extends BaseEntity { | |||
| private String typeName; | |||
| @io.swagger.annotations.ApiModelProperty(value="专属商场标签时填写",name="tenantId") | |||
| private String tenantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否已删除EnumYesOrNo",name="tenantId") | |||
| private Integer isDel; | |||
| @TableField(exist = false) | |||
| protected Long count; | |||
| @@ -3,7 +3,6 @@ package com.iformall.domain.vo; | |||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumBusiness; | |||
| import com.iformall.enums.EnumSubBusiness; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -122,9 +121,9 @@ public class WxMerchantTradeDailyVo extends TenantEntity { | |||
| } | |||
| } | |||
| public String getBusinessName() { | |||
| return EnumBusiness.getEnumMessage(businessId); | |||
| } | |||
| // public String getBusinessName() { | |||
| // return EnumBusiness.getEnumMessage(businessId); | |||
| // } | |||
| public String getSubBusinessName() { | |||
| return EnumSubBusiness.getEnumMessage(subBusinessId); | |||
| @@ -1,69 +0,0 @@ | |||
| package com.iformall.enums; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumBusiness { | |||
| //抖音poi同步店铺类型 | |||
| //店铺类型 1 - 酒店民宿 2 - 餐饮 3 - 景区 4 - 电商 5 - 教育 6 - 丽人 7 - 爱车 8 - 亲子 9 - 宠物 10 - 家装 11 - 娱乐场所 12 - 图文快印 | |||
| // 0:无, 1:餐饮, 2:娱乐, 3:服饰, 4:亲子, 5:超市, 6:其他 | |||
| BUSINESS_NULL(0, "无", null), | |||
| BUSINESS_ID1(1, "餐饮", 2), | |||
| BUSINESS_ID2(2, "娱乐", 11), | |||
| BUSINESS_ID3(3, "服饰", 6), | |||
| BUSINESS_ID4(4, "亲子", 8), | |||
| BUSINESS_ID5(5, "超市", null), | |||
| BUSINESS_ID6(6, "其它", null), | |||
| BUSINESS_ID7(7, "美妆",6), | |||
| BUSINESS_ID8(8, "珠宝",null), | |||
| BUSINESS_ID9(9, "服务",11), | |||
| BUSINESS_ID10(10, "家居",10), | |||
| BUSINESS_ID11(11, "数码家电",null), | |||
| ; | |||
| private static Map<Integer,EnumBusiness> map = new HashMap<Integer,EnumBusiness>(); | |||
| static { | |||
| for (EnumBusiness value : values()) { | |||
| map.put(value.code, value); | |||
| } | |||
| } | |||
| public static EnumBusiness getEnum(Integer code) { | |||
| if (code == null) return null; | |||
| return map.get(code); | |||
| } | |||
| public static String getEnumMessage(Integer code) { | |||
| if (code == null) return null; | |||
| if (map.get(code) == null) | |||
| return null; | |||
| return map.get(code).getMessage(); | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| private Integer ttType; | |||
| EnumBusiness(Integer code, String message,Integer ttType) { | |||
| this.code = code; | |||
| this.message = message; | |||
| this.ttType = ttType; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| public Integer getTtType() { | |||
| return ttType; | |||
| } | |||
| } | |||
| @@ -8,70 +8,70 @@ import java.util.Map; | |||
| */ | |||
| public enum EnumSubBusiness { | |||
| SUB_BUSINESS_NULL(0,"无" ), | |||
| SUB_BUSINESS_ID1 (1,"西餐"), | |||
| SUB_BUSINESS_ID2 (2,"日本料理"), | |||
| SUB_BUSINESS_ID3 (3,"韩国料理"), | |||
| SUB_BUSINESS_ID4 (4,"东南亚菜"), | |||
| SUB_BUSINESS_ID5 (5,"自助餐"), | |||
| SUB_BUSINESS_ID6 (6,"火锅"), | |||
| SUB_BUSINESS_ID7 (7,"特色菜"), | |||
| SUB_BUSINESS_ID8 (8,"私房菜"), | |||
| SUB_BUSINESS_ID9 (9,"素食"), | |||
| SUB_BUSINESS_ID10(10,"烧烤"), | |||
| SUB_BUSINESS_ID11(11,"小吃快餐"), | |||
| SUB_BUSINESS_ID12(12,"川菜"), | |||
| SUB_BUSINESS_ID13(13,"湘菜"), | |||
| SUB_BUSINESS_ID14(14,"鲁菜"), | |||
| SUB_BUSINESS_ID15(15,"粤菜"), | |||
| SUB_BUSINESS_ID16(16,"湖北菜"), | |||
| SUB_BUSINESS_ID17(17,"云贵菜"), | |||
| SUB_BUSINESS_ID18(18,"东北菜"), | |||
| SUB_BUSINESS_ID19(19,"面包店"), | |||
| SUB_BUSINESS_ID20(20,"咖啡厅"), | |||
| SUB_BUSINESS_ID21(21,"饮品店"), | |||
| SUB_BUSINESS_ID22(22,"男装"), | |||
| SUB_BUSINESS_ID23(23,"女装"), | |||
| SUB_BUSINESS_ID24(24,"童装"), | |||
| SUB_BUSINESS_ID25(25,"鞋帽"), | |||
| SUB_BUSINESS_ID26(26,"配饰"), | |||
| SUB_BUSINESS_ID27(27,"内衣"), | |||
| SUB_BUSINESS_ID28(28,"亲子摄影"), | |||
| SUB_BUSINESS_ID29(29,"亲子游乐"), | |||
| SUB_BUSINESS_ID30(30,"幼儿教育"), | |||
| SUB_BUSINESS_ID31(31,"孕产护理"), | |||
| SUB_BUSINESS_ID32(32,"童车童床"), | |||
| SUB_BUSINESS_ID33(33,"玩具"), | |||
| SUB_BUSINESS_ID34(34,"喂养用品"), | |||
| SUB_BUSINESS_ID35(35,"面部护肤"), | |||
| SUB_BUSINESS_ID36(36,"香水彩妆"), | |||
| SUB_BUSINESS_ID37(37,"男士护肤"), | |||
| SUB_BUSINESS_ID38(38,"营养保健"), | |||
| SUB_BUSINESS_ID39(39,"黄金"), | |||
| SUB_BUSINESS_ID40(40,"钻石"), | |||
| SUB_BUSINESS_ID41(41,"时尚饰品"), | |||
| SUB_BUSINESS_ID42(42,"翡翠玉石"), | |||
| SUB_BUSINESS_ID43(43,"钟表"), | |||
| SUB_BUSINESS_ID44(44,"KTV"), | |||
| SUB_BUSINESS_ID45(45,"轰趴馆"), | |||
| SUB_BUSINESS_ID46(46,"DIY手工"), | |||
| SUB_BUSINESS_ID47(47,"文化艺术"), | |||
| SUB_BUSINESS_ID48(48,"游艺娱乐"), | |||
| SUB_BUSINESS_ID49(49,"桌游"), | |||
| SUB_BUSINESS_ID50(50,"运动健身"), | |||
| SUB_BUSINESS_ID51(51,"婚纱摄影"), | |||
| SUB_BUSINESS_ID52(52,"美容美发"), | |||
| SUB_BUSINESS_ID53(53,"学习培训"), | |||
| SUB_BUSINESS_ID54(54,"家具"), | |||
| SUB_BUSINESS_ID55(55,"家饰"), | |||
| SUB_BUSINESS_ID56(56,"家纺"), | |||
| SUB_BUSINESS_ID57(57,"生活用品"), | |||
| SUB_BUSINESS_ID58(58,"厨具"), | |||
| SUB_BUSINESS_ID59(59,"家用电器"), | |||
| SUB_BUSINESS_ID60(60,"数码产品"), | |||
| SUB_BUSINESS_ID61(61,"手机通信"), | |||
| SUB_BUSINESS_ID62(62,"电脑办公"), | |||
| SUB_BUSINESS_ID63(63,"影音娱乐"), | |||
| // SUB_BUSINESS_NULL(0,"无" ), | |||
| // SUB_BUSINESS_ID1 (1,"西餐"), | |||
| // SUB_BUSINESS_ID2 (2,"日本料理"), | |||
| // SUB_BUSINESS_ID3 (3,"韩国料理"), | |||
| // SUB_BUSINESS_ID4 (4,"东南亚菜"), | |||
| // SUB_BUSINESS_ID5 (5,"自助餐"), | |||
| // SUB_BUSINESS_ID6 (6,"火锅"), | |||
| // SUB_BUSINESS_ID7 (7,"特色菜"), | |||
| // SUB_BUSINESS_ID8 (8,"私房菜"), | |||
| // SUB_BUSINESS_ID9 (9,"素食"), | |||
| // SUB_BUSINESS_ID10(10,"烧烤"), | |||
| // SUB_BUSINESS_ID11(11,"小吃快餐"), | |||
| // SUB_BUSINESS_ID12(12,"川菜"), | |||
| // SUB_BUSINESS_ID13(13,"湘菜"), | |||
| // SUB_BUSINESS_ID14(14,"鲁菜"), | |||
| // SUB_BUSINESS_ID15(15,"粤菜"), | |||
| // SUB_BUSINESS_ID16(16,"湖北菜"), | |||
| // SUB_BUSINESS_ID17(17,"云贵菜"), | |||
| // SUB_BUSINESS_ID18(18,"东北菜"), | |||
| // SUB_BUSINESS_ID19(19,"面包店"), | |||
| // SUB_BUSINESS_ID20(20,"咖啡厅"), | |||
| // SUB_BUSINESS_ID21(21,"饮品店"), | |||
| // SUB_BUSINESS_ID22(22,"男装"), | |||
| // SUB_BUSINESS_ID23(23,"女装"), | |||
| // SUB_BUSINESS_ID24(24,"童装"), | |||
| // SUB_BUSINESS_ID25(25,"鞋帽"), | |||
| // SUB_BUSINESS_ID26(26,"配饰"), | |||
| // SUB_BUSINESS_ID27(27,"内衣"), | |||
| // SUB_BUSINESS_ID28(28,"亲子摄影"), | |||
| // SUB_BUSINESS_ID29(29,"亲子游乐"), | |||
| // SUB_BUSINESS_ID30(30,"幼儿教育"), | |||
| // SUB_BUSINESS_ID31(31,"孕产护理"), | |||
| // SUB_BUSINESS_ID32(32,"童车童床"), | |||
| // SUB_BUSINESS_ID33(33,"玩具"), | |||
| // SUB_BUSINESS_ID34(34,"喂养用品"), | |||
| // SUB_BUSINESS_ID35(35,"面部护肤"), | |||
| // SUB_BUSINESS_ID36(36,"香水彩妆"), | |||
| // SUB_BUSINESS_ID37(37,"男士护肤"), | |||
| // SUB_BUSINESS_ID38(38,"营养保健"), | |||
| // SUB_BUSINESS_ID39(39,"黄金"), | |||
| // SUB_BUSINESS_ID40(40,"钻石"), | |||
| // SUB_BUSINESS_ID41(41,"时尚饰品"), | |||
| // SUB_BUSINESS_ID42(42,"翡翠玉石"), | |||
| // SUB_BUSINESS_ID43(43,"钟表"), | |||
| // SUB_BUSINESS_ID44(44,"KTV"), | |||
| // SUB_BUSINESS_ID45(45,"轰趴馆"), | |||
| // SUB_BUSINESS_ID46(46,"DIY手工"), | |||
| // SUB_BUSINESS_ID47(47,"文化艺术"), | |||
| // SUB_BUSINESS_ID48(48,"游艺娱乐"), | |||
| // SUB_BUSINESS_ID49(49,"桌游"), | |||
| // SUB_BUSINESS_ID50(50,"运动健身"), | |||
| // SUB_BUSINESS_ID51(51,"婚纱摄影"), | |||
| // SUB_BUSINESS_ID52(52,"美容美发"), | |||
| // SUB_BUSINESS_ID53(53,"学习培训"), | |||
| // SUB_BUSINESS_ID54(54,"家具"), | |||
| // SUB_BUSINESS_ID55(55,"家饰"), | |||
| // SUB_BUSINESS_ID56(56,"家纺"), | |||
| // SUB_BUSINESS_ID57(57,"生活用品"), | |||
| // SUB_BUSINESS_ID58(58,"厨具"), | |||
| // SUB_BUSINESS_ID59(59,"家用电器"), | |||
| // SUB_BUSINESS_ID60(60,"数码产品"), | |||
| // SUB_BUSINESS_ID61(61,"手机通信"), | |||
| // SUB_BUSINESS_ID62(62,"电脑办公"), | |||
| // SUB_BUSINESS_ID63(63,"影音娱乐"), | |||
| ; | |||
| private static Map<Integer,EnumSubBusiness> map | |||
| @@ -88,15 +88,15 @@ public enum EnumTag { | |||
| ID_66(66L, EnumTagType.ID_13,"自购"), | |||
| ID_67(67L, EnumTagType.ID_13,"宿舍"), | |||
| ID_68(68L, EnumTagType.ID_14,"餐饮"), | |||
| ID_69(69L, EnumTagType.ID_14,"娱乐"), | |||
| ID_70(70L, EnumTagType.ID_14,"服饰"), | |||
| ID_71(71L, EnumTagType.ID_14,"亲子"), | |||
| ID_72(72L, EnumTagType.ID_14,"超市"), | |||
| ID_73(73L, EnumTagType.ID_14,"美妆"), | |||
| ID_74(74L, EnumTagType.ID_14,"珠宝"), | |||
| ID_75(75L, EnumTagType.ID_14,"服务"), | |||
| ID_76(76L, EnumTagType.ID_14,"家居"), | |||
| // ID_68(68L, EnumTagType.ID_14,"餐饮"), | |||
| // ID_69(69L, EnumTagType.ID_14,"娱乐"), | |||
| // ID_70(70L, EnumTagType.ID_14,"服饰"), | |||
| // ID_71(71L, EnumTagType.ID_14,"亲子"), | |||
| // ID_72(72L, EnumTagType.ID_14,"超市"), | |||
| // ID_73(73L, EnumTagType.ID_14,"美妆"), | |||
| // ID_74(74L, EnumTagType.ID_14,"珠宝"), | |||
| // ID_75(75L, EnumTagType.ID_14,"服务"), | |||
| // ID_76(76L, EnumTagType.ID_14,"家居"), | |||
| ID_77(77L, EnumTagType.ID_15,"中低端"), | |||
| ID_78(78L, EnumTagType.ID_15,"中端"), | |||
| @@ -179,7 +179,7 @@ public enum EnumTag { | |||
| ID_143(143L, EnumTagType.ID_17,"咖啡厅"), | |||
| ID_144(144L, EnumTagType.ID_17,"饮品店"), | |||
| ID_145(145L, EnumTagType.ID_14,"数码家电"), | |||
| // ID_145(145L, EnumTagType.ID_14,"数码家电"), | |||
| ID_146(146L, EnumTagType.ID_16, "品牌偏好"), | |||
| @@ -20,7 +20,7 @@ public enum EnumTagType { | |||
| ID_12(12L, EnumTagTypeFlag.FLAG_SINGLE, EnumTagGroup.ID_2, "职业"), | |||
| ID_13(13L, EnumTagTypeFlag.FLAG_SINGLE, EnumTagGroup.ID_2, "住房情况"), | |||
| ID_14(14L, EnumTagTypeFlag.FLAG_NORMAL, EnumTagGroup.ID_3, "消费类别"), | |||
| //ID_14(14L, EnumTagTypeFlag.FLAG_NORMAL, EnumTagGroup.ID_3, "消费类别"), | |||
| ID_15(15L, EnumTagTypeFlag.FLAG_SINGLE, EnumTagGroup.ID_3, "消费档次"), | |||
| ID_16(16L, EnumTagTypeFlag.FLAG_NORMAL, EnumTagGroup.ID_3, "品牌偏好"), | |||
| ID_17(17L, EnumTagTypeFlag.FLAG_NORMAL, EnumTagGroup.ID_3, "饮食偏好"), | |||
| @@ -50,7 +50,7 @@ public interface WxBusinessService { | |||
| List<WxBusiness> getByIds(Collection<? extends Serializable> ids); | |||
| List<Map<String,Object>> businessDataList(WxBusiness wxBusiness,Long userid); | |||
| List<Map<String,Object>> businessDataList(TenantEntity tenantEntity,WxBusiness wxBusiness,Long userid); | |||
| ResultData devoteList(WxBusiness wxBusiness,Integer pageNum, Integer pageSize); | |||
| @@ -341,223 +341,223 @@ public class WxCUserTagsServiceHelper{ | |||
| } | |||
| public List<WxTags> assignTypeId14(WxCUserBasicInfo user,TenantEntity tenantEntity, WxCUserTagsService wxCUserTagsService) | |||
| { | |||
| List<WxTags> resList = new ArrayList<WxTags>(); | |||
| Calendar endC = Calendar.getInstance(); | |||
| Calendar startC = Calendar.getInstance(); | |||
| endC.setTime(new Date()); | |||
| startC.setTime(new Date()); | |||
| startC.add(Calendar.DAY_OF_YEAR, -30); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.setCUserId(user.getId()); | |||
| wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | |||
| wxCouponOrder.setStartTime(startC.getTime()); | |||
| wxCouponOrder.setEndTime(endC.getTime()); | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| WxCardSpend wxCardSpend = new WxCardSpend(); | |||
| wxCardSpend.setPayType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| wxCardSpend.setOwnerId(user.getId()); | |||
| wxCardSpend.setStartdate(startC.getTime()); | |||
| wxCardSpend.setEnddate(endC.getTime()); | |||
| wxCardSpend.updateTenantInfo(tenantEntity); | |||
| WxBusiness business = new WxBusiness(); | |||
| List<WxBusiness> list = wxBusinessMapper.findList(business); | |||
| List<Map<String, Object>> cardSpendMerchantCountList = wxCardSpendMapper.getMerchantCount(wxCardSpend); | |||
| //查询商户 | |||
| WxMerchant merchantQ = new WxMerchant(); | |||
| merchantQ.updateTenantInfo(tenantEntity); | |||
| List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ); | |||
| Map<Long,Integer> merchantBussinessMap = new HashMap<Long,Integer>(); | |||
| if (null != merchantList) { | |||
| for (int i = 0 ; i < merchantList.size() ;i ++) { | |||
| WxMerchant m = merchantList.get(i); | |||
| merchantBussinessMap.put(m.getId(), m.getBusinessId()); | |||
| } | |||
| } | |||
| List<Map<String, Object>> couponCountList = wxCouponOrderMapper.getCouponCount(wxCouponOrder); | |||
| //查询业态 | |||
| WxCoupon couponQ = new WxCoupon(); | |||
| couponQ.updateTenantInfo(tenantEntity); | |||
| Map<Long,Integer> couponBussinessMap = new HashMap<Long,Integer>(); | |||
| List<WxCoupon> couponList = wxCouponMapper.newfindCList(couponQ); | |||
| if (null != couponList) { | |||
| for (int i = 0 ; i < couponList.size() ;i ++) { | |||
| WxCoupon c = couponList.get(i); | |||
| couponBussinessMap.put(c.getId(), c.getBusiness()); | |||
| } | |||
| } | |||
| list.stream().forEach(b->{ | |||
| int count = 0; | |||
| if(null != cardSpendMerchantCountList && cardSpendMerchantCountList.size() > 0) { | |||
| for (Map<String, Object> cardSpendCount : cardSpendMerchantCountList) { | |||
| Long merchantId = (Long)cardSpendCount.get("merchantId") ; | |||
| Long merchantCount = (Long)cardSpendCount.get("count"); | |||
| if (null != merchantId && null != merchantCount) { | |||
| Integer bussiness = merchantBussinessMap.get(merchantId); | |||
| if (null != bussiness && bussiness.intValue() == b.getId().intValue()) { | |||
| count += merchantCount.intValue(); | |||
| } | |||
| } | |||
| if (cardSpendCount.get("business_id") != null | |||
| && cardSpendCount.get("business_id").equals(b.getId().toString())) { | |||
| count += (Integer) cardSpendCount.get("bu_count"); | |||
| } | |||
| } | |||
| } | |||
| if(null!= couponCountList && couponCountList.size() > 0) { | |||
| for (Map<String, Object> cardOrderCount : couponCountList) { | |||
| Long couponId = (Long)cardOrderCount.get("couponId") ; | |||
| Long couponCount = (Long)cardOrderCount.get("count"); | |||
| if (null != couponId && null != couponCount) { | |||
| Integer bussiness = couponBussinessMap.get(couponId); | |||
| if (null != bussiness && bussiness.intValue() == b.getId().intValue()) { | |||
| count += couponCount.intValue(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| if (count > 0) { | |||
| EnumTag tag = null; | |||
| if (b.getId().intValue() >= EnumBusiness.BUSINESS_ID1.getCode() && | |||
| b.getId().intValue() <= EnumBusiness.BUSINESS_ID5.getCode()){ | |||
| tag = EnumTag.getEnum(EnumTag.ID_68.getCode() | |||
| + (b.getId().intValue() - EnumBusiness.BUSINESS_ID1.getCode())); | |||
| } | |||
| if (b.getId().intValue() >= EnumBusiness.BUSINESS_ID7.getCode() && | |||
| b.getId().intValue() <= EnumBusiness.BUSINESS_ID10.getCode()){ | |||
| tag = EnumTag.getEnum(EnumTag.ID_73.getCode() | |||
| + (b.getId().intValue() - EnumBusiness.BUSINESS_ID7.getCode())); | |||
| } | |||
| if (b.getId().intValue() == EnumBusiness.BUSINESS_ID11.getCode()){ | |||
| tag = EnumTag.ID_145; | |||
| } | |||
| resList.clear(); | |||
| resList.addAll(assign(user, tag,wxCUserTagsService)); | |||
| } | |||
| }); | |||
| if (resList.size() == 0) { | |||
| return null; | |||
| } | |||
| return resList; | |||
| } | |||
| public List<WxTags> assignTypeId17(WxCUserBasicInfo user,TenantEntity tenantEntity, WxCUserTagsService wxCUserTagsService) | |||
| { | |||
| List<WxTags> resList = null; | |||
| Calendar endC = Calendar.getInstance(); | |||
| Calendar startC = Calendar.getInstance(); | |||
| endC.setTime(new Date()); | |||
| startC.setTime(new Date()); | |||
| startC.add(Calendar.DAY_OF_YEAR, -30); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.setCUserId(user.getId()); | |||
| wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | |||
| wxCouponOrder.setStartTime(startC.getTime()); | |||
| wxCouponOrder.setEndTime(endC.getTime()); | |||
| wxCouponOrder.setBusinessId(EnumBusiness.BUSINESS_ID1.getCode()); | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| WxCardSpend wxCardSpend = new WxCardSpend(); | |||
| wxCardSpend.setPayType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| wxCardSpend.setOwnerId(user.getId()); | |||
| wxCardSpend.setStartdate(startC.getTime()); | |||
| wxCardSpend.setEnddate(endC.getTime()); | |||
| wxCardSpend.setBusinessId(EnumBusiness.BUSINESS_ID1.getCode()); | |||
| WxSubBusiness subBusiness = new WxSubBusiness(); | |||
| subBusiness.setBusinessId(EnumBusiness.BUSINESS_ID1.getCode()); | |||
| List<WxSubBusiness> list = wxSubBusinessMapper.findList(subBusiness); | |||
| List<Map<String, Object>> cardSpendMerchantCountList = wxCardSpendMapper.getMerchantCount(wxCardSpend); | |||
| //查询商户子业态 | |||
| WxMerchant merchantQ = new WxMerchant(); | |||
| merchantQ.updateTenantInfo(tenantEntity); | |||
| merchantQ.setSubBusinessId(wxCouponOrder.getSubBusinessId()); | |||
| List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ); | |||
| Map<Long,Integer> merchantBussinessMap = new HashMap<Long,Integer>(); | |||
| if (null != merchantList) { | |||
| for (int i = 0 ; i < merchantList.size() ;i ++) { | |||
| WxMerchant m = merchantList.get(i); | |||
| merchantBussinessMap.put(m.getId(), m.getSubBusinessId()); | |||
| } | |||
| } | |||
| List<Map<String, Object>> couponCountList = wxCouponOrderMapper.getCouponCount(wxCouponOrder); | |||
| //查询券子业态 | |||
| WxCoupon couponQ = new WxCoupon(); | |||
| couponQ.updateTenantInfo(tenantEntity); | |||
| couponQ.setBusiness(wxCouponOrder.getBusinessId()); | |||
| List<WxCoupon> couponList = wxCouponMapper.newfindCList(couponQ); | |||
| Map<Long,Integer> couponBussinessMap = new HashMap<Long,Integer>(); | |||
| if (null != couponList) { | |||
| for (int i = 0 ; i < couponList.size() ;i ++) { | |||
| WxCoupon c = couponList.get(i); | |||
| couponBussinessMap.put(c.getId(), c.getSubBusiness()); | |||
| } | |||
| } | |||
| list.stream().forEach(sb->{ | |||
| int count = 0; | |||
| if(null != cardSpendMerchantCountList && cardSpendMerchantCountList.size() > 0) { | |||
| for (Map<String, Object> cardSpendCount : cardSpendMerchantCountList) { | |||
| Long merchantId = (Long)cardSpendCount.get("merchantId") ; | |||
| Long merchantCount = (Long)cardSpendCount.get("count"); | |||
| if (null != merchantId && null != merchantCount) { | |||
| Integer subBussiness = merchantBussinessMap.get(merchantId); | |||
| if (null != subBussiness && subBussiness.intValue() == sb.getId().intValue()) { | |||
| count += merchantCount.intValue(); | |||
| } | |||
| } | |||
| Long subBusinessId = (Long)cardSpendCount.get("subBusinessId"); | |||
| if (subBusinessId != null && subBusinessId.equals(sb.getId())) { | |||
| count += (Integer) cardSpendCount.get("buCount"); | |||
| } | |||
| } | |||
| } | |||
| if(null!= couponCountList && couponCountList.size() > 0) { | |||
| for (Map<String, Object> cardOrderCount : couponCountList) { | |||
| Long couponId = (Long)cardOrderCount.get("couponId") ; | |||
| Long couponCount = (Long)cardOrderCount.get("count"); | |||
| if (null != couponId && null != couponCount) { | |||
| Integer subBussiness = couponBussinessMap.get(couponId); | |||
| if (null != subBussiness && subBussiness.intValue() == sb.getId().intValue()) { | |||
| count += couponCount.intValue(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| if (count > 0) { | |||
| EnumTag tag = null; | |||
| if (sb.getId().intValue() >= EnumSubBusiness.SUB_BUSINESS_ID1.getCode() && | |||
| sb.getId().intValue() <= EnumSubBusiness.SUB_BUSINESS_ID5.getCode()){ | |||
| tag = EnumTag.getEnum(EnumTag.ID_92.getCode() | |||
| + (sb.getId().intValue() - EnumSubBusiness.SUB_BUSINESS_ID1.getCode())); | |||
| } | |||
| if (sb.getId().intValue() >= EnumSubBusiness.SUB_BUSINESS_ID6.getCode() && | |||
| sb.getId().intValue() <= EnumSubBusiness.SUB_BUSINESS_ID21.getCode()){ | |||
| tag = EnumTag.getEnum(EnumTag.ID_129.getCode() | |||
| + (sb.getId().intValue() - EnumSubBusiness.SUB_BUSINESS_ID6.getCode())); | |||
| } | |||
| resList.clear(); | |||
| resList.addAll(assign(user, tag,wxCUserTagsService)); | |||
| } | |||
| }); | |||
| return resList; | |||
| } | |||
| // public List<WxTags> assignTypeId14(WxCUserBasicInfo user,TenantEntity tenantEntity, WxCUserTagsService wxCUserTagsService) | |||
| // { | |||
| // List<WxTags> resList = new ArrayList<WxTags>(); | |||
| // Calendar endC = Calendar.getInstance(); | |||
| // Calendar startC = Calendar.getInstance(); | |||
| // endC.setTime(new Date()); | |||
| // startC.setTime(new Date()); | |||
| // startC.add(Calendar.DAY_OF_YEAR, -30); | |||
| // WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| // wxCouponOrder.setCUserId(user.getId()); | |||
| // wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | |||
| // wxCouponOrder.setStartTime(startC.getTime()); | |||
| // wxCouponOrder.setEndTime(endC.getTime()); | |||
| // wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| // | |||
| // WxCardSpend wxCardSpend = new WxCardSpend(); | |||
| // wxCardSpend.setPayType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| // wxCardSpend.setOwnerId(user.getId()); | |||
| // wxCardSpend.setStartdate(startC.getTime()); | |||
| // wxCardSpend.setEnddate(endC.getTime()); | |||
| // wxCardSpend.updateTenantInfo(tenantEntity); | |||
| // | |||
| // WxBusiness business = new WxBusiness(); | |||
| // List<WxBusiness> list = wxBusinessMapper.findList(business); | |||
| // | |||
| // List<Map<String, Object>> cardSpendMerchantCountList = wxCardSpendMapper.getMerchantCount(wxCardSpend); | |||
| // //查询商户 | |||
| // WxMerchant merchantQ = new WxMerchant(); | |||
| // merchantQ.updateTenantInfo(tenantEntity); | |||
| // List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ); | |||
| // Map<Long,Integer> merchantBussinessMap = new HashMap<Long,Integer>(); | |||
| // if (null != merchantList) { | |||
| // for (int i = 0 ; i < merchantList.size() ;i ++) { | |||
| // WxMerchant m = merchantList.get(i); | |||
| // merchantBussinessMap.put(m.getId(), m.getBusinessId()); | |||
| // } | |||
| // } | |||
| // | |||
| // List<Map<String, Object>> couponCountList = wxCouponOrderMapper.getCouponCount(wxCouponOrder); | |||
| // //查询业态 | |||
| // WxCoupon couponQ = new WxCoupon(); | |||
| // couponQ.updateTenantInfo(tenantEntity); | |||
| // Map<Long,Integer> couponBussinessMap = new HashMap<Long,Integer>(); | |||
| // List<WxCoupon> couponList = wxCouponMapper.newfindCList(couponQ); | |||
| // if (null != couponList) { | |||
| // for (int i = 0 ; i < couponList.size() ;i ++) { | |||
| // WxCoupon c = couponList.get(i); | |||
| // couponBussinessMap.put(c.getId(), c.getBusiness()); | |||
| // } | |||
| // } | |||
| // | |||
| // list.stream().forEach(b->{ | |||
| // int count = 0; | |||
| // if(null != cardSpendMerchantCountList && cardSpendMerchantCountList.size() > 0) { | |||
| // for (Map<String, Object> cardSpendCount : cardSpendMerchantCountList) { | |||
| // | |||
| // Long merchantId = (Long)cardSpendCount.get("merchantId") ; | |||
| // Long merchantCount = (Long)cardSpendCount.get("count"); | |||
| // if (null != merchantId && null != merchantCount) { | |||
| // Integer bussiness = merchantBussinessMap.get(merchantId); | |||
| // if (null != bussiness && bussiness.intValue() == b.getId().intValue()) { | |||
| // count += merchantCount.intValue(); | |||
| // } | |||
| // } | |||
| // if (cardSpendCount.get("business_id") != null | |||
| // && cardSpendCount.get("business_id").equals(b.getId().toString())) { | |||
| // count += (Integer) cardSpendCount.get("bu_count"); | |||
| // } | |||
| // } | |||
| // } | |||
| // if(null!= couponCountList && couponCountList.size() > 0) { | |||
| // for (Map<String, Object> cardOrderCount : couponCountList) { | |||
| // Long couponId = (Long)cardOrderCount.get("couponId") ; | |||
| // Long couponCount = (Long)cardOrderCount.get("count"); | |||
| // if (null != couponId && null != couponCount) { | |||
| // Integer bussiness = couponBussinessMap.get(couponId); | |||
| // if (null != bussiness && bussiness.intValue() == b.getId().intValue()) { | |||
| // count += couponCount.intValue(); | |||
| // } | |||
| // } | |||
| // } | |||
| // } | |||
| // if (count > 0) { | |||
| // EnumTag tag = null; | |||
| // if (b.getId().intValue() >= EnumBusiness.BUSINESS_ID1.getCode() && | |||
| // b.getId().intValue() <= EnumBusiness.BUSINESS_ID5.getCode()){ | |||
| // tag = EnumTag.getEnum(EnumTag.ID_68.getCode() | |||
| // + (b.getId().intValue() - EnumBusiness.BUSINESS_ID1.getCode())); | |||
| // } | |||
| // | |||
| // if (b.getId().intValue() >= EnumBusiness.BUSINESS_ID7.getCode() && | |||
| // b.getId().intValue() <= EnumBusiness.BUSINESS_ID10.getCode()){ | |||
| // tag = EnumTag.getEnum(EnumTag.ID_73.getCode() | |||
| // + (b.getId().intValue() - EnumBusiness.BUSINESS_ID7.getCode())); | |||
| // } | |||
| // if (b.getId().intValue() == EnumBusiness.BUSINESS_ID11.getCode()){ | |||
| // tag = EnumTag.ID_145; | |||
| // } | |||
| // resList.clear(); | |||
| // resList.addAll(assign(user, tag,wxCUserTagsService)); | |||
| // } | |||
| // }); | |||
| // | |||
| // if (resList.size() == 0) { | |||
| // return null; | |||
| // } | |||
| // return resList; | |||
| // } | |||
| // public List<WxTags> assignTypeId17(WxCUserBasicInfo user,TenantEntity tenantEntity, WxCUserTagsService wxCUserTagsService) | |||
| // { | |||
| // List<WxTags> resList = null; | |||
| // Calendar endC = Calendar.getInstance(); | |||
| // Calendar startC = Calendar.getInstance(); | |||
| // endC.setTime(new Date()); | |||
| // startC.setTime(new Date()); | |||
| // startC.add(Calendar.DAY_OF_YEAR, -30); | |||
| // WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| // wxCouponOrder.setCUserId(user.getId()); | |||
| // wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | |||
| // wxCouponOrder.setStartTime(startC.getTime()); | |||
| // wxCouponOrder.setEndTime(endC.getTime()); | |||
| // wxCouponOrder.setBusinessId(EnumBusiness.BUSINESS_ID1.getCode()); | |||
| // wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| // | |||
| // WxCardSpend wxCardSpend = new WxCardSpend(); | |||
| // wxCardSpend.setPayType(EnumPayType.PAY_PAYMENT.getCode()); | |||
| // wxCardSpend.setOwnerId(user.getId()); | |||
| // wxCardSpend.setStartdate(startC.getTime()); | |||
| // wxCardSpend.setEnddate(endC.getTime()); | |||
| // wxCardSpend.setBusinessId(EnumBusiness.BUSINESS_ID1.getCode()); | |||
| // | |||
| // WxSubBusiness subBusiness = new WxSubBusiness(); | |||
| // subBusiness.setBusinessId(EnumBusiness.BUSINESS_ID1.getCode()); | |||
| // List<WxSubBusiness> list = wxSubBusinessMapper.findList(subBusiness); | |||
| // | |||
| // List<Map<String, Object>> cardSpendMerchantCountList = wxCardSpendMapper.getMerchantCount(wxCardSpend); | |||
| // //查询商户子业态 | |||
| // WxMerchant merchantQ = new WxMerchant(); | |||
| // merchantQ.updateTenantInfo(tenantEntity); | |||
| // merchantQ.setSubBusinessId(wxCouponOrder.getSubBusinessId()); | |||
| // List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ); | |||
| // Map<Long,Integer> merchantBussinessMap = new HashMap<Long,Integer>(); | |||
| // if (null != merchantList) { | |||
| // for (int i = 0 ; i < merchantList.size() ;i ++) { | |||
| // WxMerchant m = merchantList.get(i); | |||
| // merchantBussinessMap.put(m.getId(), m.getSubBusinessId()); | |||
| // } | |||
| // } | |||
| // | |||
| // | |||
| // List<Map<String, Object>> couponCountList = wxCouponOrderMapper.getCouponCount(wxCouponOrder); | |||
| // //查询券子业态 | |||
| // WxCoupon couponQ = new WxCoupon(); | |||
| // couponQ.updateTenantInfo(tenantEntity); | |||
| // couponQ.setBusiness(wxCouponOrder.getBusinessId()); | |||
| // List<WxCoupon> couponList = wxCouponMapper.newfindCList(couponQ); | |||
| // Map<Long,Integer> couponBussinessMap = new HashMap<Long,Integer>(); | |||
| // if (null != couponList) { | |||
| // for (int i = 0 ; i < couponList.size() ;i ++) { | |||
| // WxCoupon c = couponList.get(i); | |||
| // couponBussinessMap.put(c.getId(), c.getSubBusiness()); | |||
| // } | |||
| // } | |||
| // | |||
| // list.stream().forEach(sb->{ | |||
| // int count = 0; | |||
| // if(null != cardSpendMerchantCountList && cardSpendMerchantCountList.size() > 0) { | |||
| // for (Map<String, Object> cardSpendCount : cardSpendMerchantCountList) { | |||
| // Long merchantId = (Long)cardSpendCount.get("merchantId") ; | |||
| // Long merchantCount = (Long)cardSpendCount.get("count"); | |||
| // if (null != merchantId && null != merchantCount) { | |||
| // Integer subBussiness = merchantBussinessMap.get(merchantId); | |||
| // if (null != subBussiness && subBussiness.intValue() == sb.getId().intValue()) { | |||
| // count += merchantCount.intValue(); | |||
| // } | |||
| // } | |||
| // | |||
| // Long subBusinessId = (Long)cardSpendCount.get("subBusinessId"); | |||
| // if (subBusinessId != null && subBusinessId.equals(sb.getId())) { | |||
| // count += (Integer) cardSpendCount.get("buCount"); | |||
| // } | |||
| // } | |||
| // } | |||
| // | |||
| // if(null!= couponCountList && couponCountList.size() > 0) { | |||
| // for (Map<String, Object> cardOrderCount : couponCountList) { | |||
| // Long couponId = (Long)cardOrderCount.get("couponId") ; | |||
| // Long couponCount = (Long)cardOrderCount.get("count"); | |||
| // if (null != couponId && null != couponCount) { | |||
| // Integer subBussiness = couponBussinessMap.get(couponId); | |||
| // if (null != subBussiness && subBussiness.intValue() == sb.getId().intValue()) { | |||
| // count += couponCount.intValue(); | |||
| // } | |||
| // } | |||
| // } | |||
| // } | |||
| // if (count > 0) { | |||
| // EnumTag tag = null; | |||
| // if (sb.getId().intValue() >= EnumSubBusiness.SUB_BUSINESS_ID1.getCode() && | |||
| // sb.getId().intValue() <= EnumSubBusiness.SUB_BUSINESS_ID5.getCode()){ | |||
| // tag = EnumTag.getEnum(EnumTag.ID_92.getCode() | |||
| // + (sb.getId().intValue() - EnumSubBusiness.SUB_BUSINESS_ID1.getCode())); | |||
| // } | |||
| // | |||
| // if (sb.getId().intValue() >= EnumSubBusiness.SUB_BUSINESS_ID6.getCode() && | |||
| // sb.getId().intValue() <= EnumSubBusiness.SUB_BUSINESS_ID21.getCode()){ | |||
| // tag = EnumTag.getEnum(EnumTag.ID_129.getCode() | |||
| // + (sb.getId().intValue() - EnumSubBusiness.SUB_BUSINESS_ID6.getCode())); | |||
| // } | |||
| // resList.clear(); | |||
| // resList.addAll(assign(user, tag,wxCUserTagsService)); | |||
| // } | |||
| // }); | |||
| // | |||
| // return resList; | |||
| // } | |||
| public List<WxTags> assignTypeId18(WxCUserBasicInfo user,TenantEntity tenantEntity, WxCUserTagsService wxCUserTagsService) { | |||
| List<WxTags> resList = null; | |||
| @@ -11,6 +11,7 @@ import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.AliBusinessCircleOrderMapper; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.RedisLock; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| @@ -188,7 +189,7 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder | |||
| logger.error("支付发券: " + e.getMessage()); | |||
| } | |||
| Integer businessId = EnumBusiness.BUSINESS_ID6.getCode(); | |||
| Integer businessId = Constant.default_business; | |||
| if(wxMerchant != null){ | |||
| businessId = wxMerchant.getBusinessId(); | |||
| } | |||
| @@ -254,7 +254,7 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { | |||
| List<String> images = new ArrayList<>(); | |||
| Integer status = EnumMerchantStatus.VALID.getCode(); | |||
| String introduction = ""; | |||
| Integer businessId = EnumBusiness.BUSINESS_ID1.getCode(); | |||
| //Integer businessId = EnumBusiness.BUSINESS_ID1.getCode(); | |||
| if(merchantPoi.getTenantId().equals(id.toString())){ | |||
| // if(merchantPoi.getId() == 1038){ | |||
| @@ -271,7 +271,7 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { | |||
| } | |||
| String supplierId = supplierSync(tenantInfo, merchantPoi, linkPhone,contactTel, images, status, introduction, businessId); | |||
| String supplierId = supplierSync(tenantInfo, merchantPoi, linkPhone,contactTel, images, status, introduction); | |||
| // if(StringUtils.isBlank(supplierId)){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"同步失败"); | |||
| @@ -286,7 +286,7 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { | |||
| } | |||
| private String supplierSync(TenantEntity tenantInfo,TtMerchantPoi merchantPoi, | |||
| String linkPhone,String contactTel,List<String> images,Integer status,String introduction,Integer businessId){ | |||
| String linkPhone,String contactTel,List<String> images,Integer status,String introduction){ | |||
| TtSupplierSync supplierSync = new TtSupplierSync(); | |||
| supplierSync.setContactPhone(linkPhone); | |||
| supplierSync.setContactTel(contactTel);//联系座机号 | |||
| @@ -323,7 +323,8 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { | |||
| supplierSync.setPoiId(merchantPoi.getPoiId()); | |||
| //todo 如果抖音没有这个类型怎么办 | |||
| Integer ttType = EnumBusiness.getEnum(businessId).getTtType(); | |||
| //Integer ttType = EnumBusiness.getEnum(businessId).getTtType(); | |||
| Integer ttType = Constant.default_business; | |||
| if(ttType == null){ | |||
| logger.error("未找到对应的店铺类型"); | |||
| throw new MallinkException(ErrorCode.MSG_METHOD_REQUEST_ERROR.getCode(),"未找到对应的店铺类型"); | |||
| @@ -19,6 +19,7 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBusinessCircleOrderMapper; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.MaUtil; | |||
| import com.iformall.utils.RedisLock; | |||
| @@ -206,7 +207,7 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| logger.error("支付发券: " + e.getMessage()); | |||
| } | |||
| Integer businessId = EnumBusiness.BUSINESS_ID6.getCode(); | |||
| Integer businessId = Constant.default_business; | |||
| if(wxMerchant != null){ | |||
| businessId = wxMerchant.getBusinessId(); | |||
| } | |||
| @@ -78,7 +78,7 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||
| @Override | |||
| public List<Map<String, Object>> businessDataList(WxBusiness wxBusiness, Long userid) { | |||
| public List<Map<String, Object>> businessDataList(TenantEntity tenantEntity,WxBusiness wxBusiness, Long userid) { | |||
| //1 得到天数+1 | |||
| int day = DateUtils.daysBetween(wxBusiness.getStartdate(), wxBusiness.getEnddate()) + 1; | |||
| List<Map<String, Object>> resultList = wxBusinessMapper.businessDataList(wxBusiness); | |||
| @@ -87,7 +87,7 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||
| WxRentContract query = new WxRentContract(); | |||
| query.setBusinessId((Integer) e.get("id")); | |||
| query.setIsDel(0); | |||
| query.updateTenantInfo(wxBusiness.getTenantInfo()); | |||
| query.updateTenantInfo(tenantEntity); | |||
| List<WxRentContract> rentContractList = wxRentContractMapper.selectList(new QueryWrapper<>(query)); | |||
| for (WxRentContract dbRent : rentContractList) { | |||
| // if (dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) || | |||
| @@ -113,7 +113,7 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||
| WxPropertyContract pquery = new WxPropertyContract(); | |||
| pquery.setBusinessId((Integer) e.get("id")); | |||
| query.setIsDel(0); | |||
| pquery.updateTenantInfo(wxBusiness.getTenantInfo()); | |||
| pquery.updateTenantInfo(tenantEntity); | |||
| List<WxPropertyContract> propertyContractList = wxPropertyContractMapper.selectList(new QueryWrapper<>(pquery)); | |||
| for (WxPropertyContract dbRent : propertyContractList) { | |||
| // if (dbRent.getStatus().equals(EnumRentContractStatus.INTENTION.getCode()) || | |||
| @@ -188,9 +188,9 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||
| WxCUserBasicInfo user = (WxCUserBasicInfo) obj; | |||
| if (user != null) { | |||
| //消费类别 | |||
| resList = wxCUserTagsServiceHelper.assignTypeId14(user,tenantEntity,this); | |||
| //resList = wxCUserTagsServiceHelper.assignTypeId14(user,tenantEntity,this); | |||
| //饮食偏好 | |||
| resList = wxCUserTagsServiceHelper.assignTypeId17(user,tenantEntity,this); | |||
| //resList = wxCUserTagsServiceHelper.assignTypeId17(user,tenantEntity,this); | |||
| //消费时段 | |||
| resList = wxCUserTagsServiceHelper.assignTypeId18(user,tenantEntity,this); | |||
| //消费频度 | |||
| @@ -259,9 +259,9 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||
| resList = wxCUserTagsServiceHelper.assignTypeId29(user,this); | |||
| //消费类别 | |||
| resList = wxCUserTagsServiceHelper.assignTypeId14(user,tenantEntity,this); | |||
| //resList = wxCUserTagsServiceHelper.assignTypeId14(user,tenantEntity,this); | |||
| //饮食偏好 | |||
| resList = wxCUserTagsServiceHelper.assignTypeId17(user,tenantEntity,this); | |||
| //resList = wxCUserTagsServiceHelper.assignTypeId17(user,tenantEntity,this); | |||
| //消费时段 | |||
| resList = wxCUserTagsServiceHelper.assignTypeId18(user,tenantEntity,this); | |||
| @@ -624,7 +624,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| record.setCreateDate(new Date()); | |||
| record.setUpdateDate(new Date()); | |||
| if (null == record.getBusiness()) { | |||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | |||
| record.setBusiness(Constant.default_business); | |||
| } | |||
| wxCouponMapper.insert(record); | |||
| @@ -699,7 +699,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| record.setUpdateDate(new Date()); | |||
| if (null == record.getBusiness()) { | |||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | |||
| record.setBusiness(Constant.default_business); | |||
| } | |||
| wxCouponMapper.updateById(record); | |||
| } | |||
| @@ -786,13 +786,13 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| i++; | |||
| } | |||
| record.setMallTenantIds(mallTenantIds); | |||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | |||
| record.setBusiness(Constant.default_business); | |||
| return retMap; | |||
| }else { | |||
| if (check) { | |||
| List<WxMerchant> merchantList = checkCouponOneMallMerchantReceiver(record,record.getMerchantParams(),record); | |||
| if(merchantList.size() > 1){ | |||
| record.setBusiness(EnumBusiness.BUSINESS_ID6.getCode()); | |||
| record.setBusiness(Constant.default_business); | |||
| }else{ | |||
| record.setBusiness(merchantList.get(0).getBusinessId()); | |||
| record.setSubBusiness(merchantList.get(0).getSubBusinessId()); | |||
| @@ -1821,7 +1821,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| StringBuffer merchantParams = new StringBuffer("[{\"tenantId\":").append(mallTenantEntity.getTenantId()).append(",\"mallMerchantParams\":").append("["); | |||
| Long[] mids = wxCoupon.getMerchantIds(); | |||
| for (int i = 0 ;i < mids.length; i++ ){ | |||
| merchantParams.append("{\"id\":").append(mids[i]).append(",\"businessId\":").append(EnumBusiness.BUSINESS_ID6.getCode()).append("}"); | |||
| merchantParams.append("{\"id\":").append(mids[i]).append(",\"businessId\":").append(Constant.default_business).append("}"); | |||
| if (i < mids.length-1 ) { | |||
| merchantParams.append(","); | |||
| } | |||
| @@ -17,6 +17,7 @@ import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.CreditUtil; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.RedisLock; | |||
| @@ -968,7 +969,7 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { | |||
| if (record.getBusinessId().equals(businessId1)) { | |||
| busRule = bus; | |||
| } | |||
| if (businessId1.equals(EnumBusiness.BUSINESS_ID6.getCode())) { | |||
| if (businessId1.equals(Constant.default_business)) { | |||
| busRuleOther = bus; | |||
| } | |||
| } | |||
| @@ -1536,7 +1536,6 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| merchantShopVoList = wxShopService.findMerchantShopVoListMap(mallTenantEntity,merchantIds); | |||
| } | |||
| for (int i = 0 ; i < couponMerchantList.size() ; i ++) { | |||
| WxCouponMerchant cm = couponMerchantList.get(i); | |||
| Long couponId = cm.getProductId(); | |||
| @@ -1547,7 +1546,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| volist = new ArrayList<WxMerchantVo>(); | |||
| retMap.put(couponId, volist); | |||
| } | |||
| WxMerchantVo vo = merchantToVo(cm,merchantMap.get(merchantId),hasShop,merchantShopVoList); | |||
| WxMerchant m = merchantMap.get(merchantId); | |||
| WxMerchantVo vo = merchantToVo(cm,m,hasShop,merchantShopVoList); | |||
| if (null != vo) { | |||
| volist.add(vo); | |||
| } | |||
| @@ -336,7 +336,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||
| if (businessId.equals(businessId1)) { | |||
| busRule = bus; | |||
| } | |||
| if (businessId1.equals(EnumBusiness.BUSINESS_ID6.getCode())) { | |||
| if (businessId1.equals(Constant.default_business)) { | |||
| busRuleOther = bus; | |||
| } | |||
| } | |||
| @@ -9,6 +9,7 @@ import com.iformall.domain.po.WxTagsType; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxTagsGroupVo; | |||
| import com.iformall.domain.vo.WxTagsTypeVo; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.mapper.WxTagsMapper; | |||
| import com.iformall.service.WxTagsGroupService; | |||
| import com.iformall.service.WxTagsService; | |||
| @@ -88,6 +89,7 @@ public class WxTagsServiceImpl implements WxTagsService { | |||
| WxTags t = new WxTags(); | |||
| t.setTypeId(tt.getId()); | |||
| t.setTenantId(tenantEntity.getTenantId()); | |||
| t.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| ttvo.setTags(findList(t)); | |||
| typeVos.add(ttvo); | |||
| } | |||
| @@ -12,6 +12,7 @@ import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxThirdPartyOrdersMapper; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.RedisLock; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| @@ -183,7 +184,7 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService | |||
| logger.error("支付发券: " + e.getMessage()); | |||
| } | |||
| Integer businessId = EnumBusiness.BUSINESS_ID6.getCode(); | |||
| Integer businessId = Constant.default_business; | |||
| if(wxMerchant != null){ | |||
| businessId = wxMerchant.getBusinessId(); | |||
| } | |||
| @@ -125,5 +125,9 @@ public class Constant { | |||
| //默认c端虚拟会员编号 | |||
| public static final Long defaultCUserId = 111111111111111111L; | |||
| //默认业态 | |||
| public static final Integer default_business = 6; | |||
| public static final Integer dy_business = 2; | |||
| } | |||
| @@ -7,10 +7,11 @@ | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`title`,`type`,`create_date`,`update_date` | |||
| `id`,`title`,`type`,`create_date`,`update_date`,`final_tenant_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -34,7 +35,12 @@ | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| </if> | |||
| <if test=" null != finalTenantId "> | |||
| and `final_tenant_id` = #{finalTenantId} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -9,10 +9,11 @@ | |||
| <result column="type_id" jdbcType="BIGINT" property="typeId"/> | |||
| <result column="type_name" jdbcType="VARCHAR" property="typeName"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`name`,`group_id`,`group_name`,`type_id`,`type_name`,`tenant_id` | |||
| `id`,`name`,`group_id`,`group_name`,`type_id`,`type_name`,`tenant_id`,`is_del` | |||
| </sql> | |||
| <sql id="allColumnsVo"> | |||
| @@ -49,6 +50,10 @@ | |||
| <if test=" null != tenantId "> | |||
| and (`tenant_id` = #{tenantId} or tenant_id is null or tenant_id = '') | |||
| </if> | |||
| <if test=" null != isDel "> | |||
| and `is_del` = #{isDel} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -61,7 +61,8 @@ public class WxBusinessController extends BaseController { | |||
| @SystemControllerLog(description = "业态分析接口") | |||
| public ResultData businessDataList(@ModelAttribute WxBusiness wxBusiness) throws Exception{ | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::businessDataList"); | |||
| wxBusiness.updateTenantInfo(getTenantInfo()); | |||
| TenantEntity tenantEntity = this.getTenantInfo(); | |||
| wxBusiness.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| if(wxBusiness.getStartdate() == null || wxBusiness.getEnddate() == null){ | |||
| Date sDate = DateUtils.getFirstDayForCurrMonth(DateUtils.getLastMonthToDay()); | |||
| Date eDate = DateUtils.getLastDayForMonth(DateUtils.getLastMonthToDay()); | |||
| @@ -71,7 +72,7 @@ public class WxBusinessController extends BaseController { | |||
| wxBusiness.setEnddate(sdT.parse(sd.format(eDate)+" 23:59:59")); | |||
| } | |||
| List<Map<String,Object>> mapList = wxBusinessService.businessDataList(wxBusiness,getUserId()); | |||
| List<Map<String,Object>> mapList = wxBusinessService.businessDataList(tenantEntity,wxBusiness,getUserId()); | |||
| for (Map<String,Object> map:mapList) { | |||
| if(map.get("rent") == null){ | |||
| map.put("rent",0); | |||
| @@ -99,7 +100,8 @@ public class WxBusinessController extends BaseController { | |||
| @SystemControllerLog(description = "导出业态数据列表") | |||
| public void exportBusinessDataList(@ModelAttribute WxBusiness wxBusiness, HttpServletResponse response) throws Exception{ | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::exportBusinessDataList"); | |||
| wxBusiness.updateTenantInfo(getTenantInfo()); | |||
| TenantEntity tenantEntity = this.getTenantInfo(); | |||
| wxBusiness.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| if(wxBusiness.getStartdate() == null || wxBusiness.getEnddate() == null){ | |||
| Date sDate = DateUtils.getFirstDayForCurrMonth(DateUtils.getLastMonthToDay()); | |||
| Date eDate = DateUtils.getLastDayForMonth(DateUtils.getLastMonthToDay()); | |||
| @@ -108,7 +110,7 @@ public class WxBusinessController extends BaseController { | |||
| wxBusiness.setStartdate(sdT.parse(sd.format(sDate)+" 00:00:00")); | |||
| wxBusiness.setEnddate(sdT.parse(sd.format(eDate)+" 23:59:59")); | |||
| } | |||
| List<Map<String,Object>> dataList = wxBusinessService.businessDataList(wxBusiness,getUserId()); | |||
| List<Map<String,Object>> dataList = wxBusinessService.businessDataList(tenantEntity,wxBusiness,getUserId()); | |||
| List<WxBusinessDataVo> exeList = new ArrayList<>(); | |||
| for (Map<String,Object> m:dataList) { | |||
| WxBusinessDataVo businessDataVo = new WxBusinessDataVo(); | |||
| @@ -162,7 +164,8 @@ public class WxBusinessController extends BaseController { | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData devoteList(@ModelAttribute WxBusiness wxBusiness,Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::devoteList"); | |||
| wxBusiness.updateTenantInfo(getTenantInfo()); | |||
| TenantEntity tenantEntity = this.getTenantInfo(); | |||
| wxBusiness.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| return new ResultData(wxBusinessService.devoteList(wxBusiness,pageNum,pageSize)); | |||
| } | |||