Selaa lähdekoodia

Merge branch 'release_real_202010' of https://git.malls.iformall.com/server/formallProject into release_real_202010

release_toaliyun_real
xiaohanzi 5 vuotta sitten
vanhempi
commit
083fa380b0
5 muutettua tiedostoa jossa 101 lisäystä ja 14 poistoa
  1. +35
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgController.java
  2. +14
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxTemplateMsg.java
  3. +16
    -8
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java
  4. +10
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java
  5. +26
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxMsgServiceImpl.java

+ 35
- 0
mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgController.java Näytä tiedosto

@@ -7,11 +7,13 @@ import com.iformall.common.ErrorCode;
import com.iformall.common.Result; import com.iformall.common.Result;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController; import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxTemplateMsg;
import com.iformall.domain.po.base.BaseEntity; import com.iformall.domain.po.base.BaseEntity;
import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.msg.WxMsg; import com.iformall.domain.po.msg.WxMsg;
import com.iformall.enums.EnumSendWay; import com.iformall.enums.EnumSendWay;
import com.iformall.service.WxMsgService; import com.iformall.service.WxMsgService;
import com.iformall.service.WxTemplateMsgService;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -40,6 +42,9 @@ public class WxMsgController extends BaseController {
@Autowired @Autowired
private WxMsgService wxMsgService; private WxMsgService wxMsgService;


@Autowired
WxTemplateMsgService wxTemplateMsgService;

@ApiOperation("分页列表接口") @ApiOperation("分页列表接口")
@GetMapping("list") @GetMapping("list")
@ApiImplicitParams({ @ApiImplicitParams({
@@ -56,6 +61,36 @@ public class WxMsgController extends BaseController {
return new ResultData(page); return new ResultData(page);
} }


@ApiOperation("模板分页列表接口")
@GetMapping("templateList")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
@SystemControllerLog(description = "moban-列表")
public ResultData templateList(@ModelAttribute WxTemplateMsg wxTemplateMsg, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxMsgController::list");
if (null == wxTemplateMsg) wxTemplateMsg = new WxTemplateMsg();
wxTemplateMsg.updateTenantInfo(getTenantInfo());
final PageInfo<WxTemplateMsg> page = wxTemplateMsgService.listAsPage(wxTemplateMsg, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("修改模板接口")
@PostMapping("tempUpd")
@SystemControllerLog(description = "moban xiugai")
public ResultData tempUpd(@RequestBody WxTemplateMsg wxTemplateMsg) {
logger.debug("[" + getIpAddr() + "] WxMsgController::tempUpd");
if(wxTemplateMsg.getId() == null){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
wxTemplateMsg.updateTenantInfo(getTenantInfo());
// if(null == wxTemplateMsg.getOnOff()){
// wxTemplateMsg.setOnOff(1);
// }
wxTemplateMsgService.saveOrUpdate(wxTemplateMsg);
return new ResultData();
}

@ApiOperation("新增接口") @ApiOperation("新增接口")
@PostMapping("add") @PostMapping("add")
@SystemControllerLog(description = "标签短信-新增") @SystemControllerLog(description = "标签短信-新增")


+ 14
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxTemplateMsg.java Näytä tiedosto

@@ -1,7 +1,9 @@
package com.iformall.domain.po; package com.iformall.domain.po;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumTemplateType;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;


@@ -27,4 +29,16 @@ public class WxTemplateMsg extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="消息开关(0/1)",name="onOff") @io.swagger.annotations.ApiModelProperty(value="消息开关(0/1)",name="onOff")
private Integer onOff; private Integer onOff;


@io.swagger.annotations.ApiModelProperty(value="模板类型1:核销成功消息,2:核销失败消息, 101:公众号审核结果消息, 102:公众号卡券核销消息",name="type")
@TableField(exist = false)
private String typeName;


public String getTypeName(){
if(this.getType() != null) {
this.typeName = EnumTemplateType.getEnum(this.getType()).getMessage();
}
return typeName;
}

} }

+ 16
- 8
mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java Näytä tiedosto

@@ -521,7 +521,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
return wxCUserBasicInfoMapper.findCountByFilter1(tenantEntity,wxCUserBasicInfoDto); return wxCUserBasicInfoMapper.findCountByFilter1(tenantEntity,wxCUserBasicInfoDto);
}else{ }else{
//直接查询本表 //直接查询本表
wxCUserBasicInfoDto.undateFinalTenantId(tenantEntity);
wxCUserBasicInfoDto.setTenantId(tenantEntity.getFinalTenantId());
wxCUserBasicInfoDto.setFinalTenantId(tenantEntity.getFinalTenantId());
return wxCUserBasicInfoMapper.findCountByFilter(wxCUserBasicInfoDto); return wxCUserBasicInfoMapper.findCountByFilter(wxCUserBasicInfoDto);
} }
} }
@@ -534,7 +535,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
return wxCUserBasicInfoMapper.findListByFilter1(tenantEntity,wxCUserBasicInfoDto); return wxCUserBasicInfoMapper.findListByFilter1(tenantEntity,wxCUserBasicInfoDto);
}else{ }else{
//直接查询本表 //直接查询本表
wxCUserBasicInfoDto.undateFinalTenantId(tenantEntity);
wxCUserBasicInfoDto.setTenantId(tenantEntity.getFinalTenantId());
wxCUserBasicInfoDto.setFinalTenantId(tenantEntity.getFinalTenantId());
return wxCUserBasicInfoMapper.findListByFilter(wxCUserBasicInfoDto); return wxCUserBasicInfoMapper.findListByFilter(wxCUserBasicInfoDto);
} }
} }
@@ -692,7 +694,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
return wxCUserBasicInfoMapper.findCountBySex1(tenantInfo,dto); return wxCUserBasicInfoMapper.findCountBySex1(tenantInfo,dto);
}else{ }else{
//直接查询本表 //直接查询本表
dto.undateFinalTenantId(tenantInfo);
dto.setTenantId(tenantInfo.getFinalTenantId());
dto.setFinalTenantId(tenantInfo.getFinalTenantId());
return wxCUserBasicInfoMapper.findCountBySex(dto); return wxCUserBasicInfoMapper.findCountBySex(dto);
} }
} }
@@ -709,7 +712,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
return wxCUserBasicInfoMapper.findCountByAge1(tenantInfo,dto); return wxCUserBasicInfoMapper.findCountByAge1(tenantInfo,dto);
}else{ }else{
//直接查询本表 //直接查询本表
dto.undateFinalTenantId(tenantInfo);
dto.setTenantId(tenantInfo.getFinalTenantId());
dto.setFinalTenantId(tenantInfo.getFinalTenantId());
return wxCUserBasicInfoMapper.findCountByAge(dto); return wxCUserBasicInfoMapper.findCountByAge(dto);
} }
} }
@@ -726,7 +730,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
return wxCUserBasicInfoMapper.findCountByScore1(tenantInfo,dto); return wxCUserBasicInfoMapper.findCountByScore1(tenantInfo,dto);
}else{ }else{
//直接查询本表 //直接查询本表
dto.undateFinalTenantId(tenantInfo);
dto.setTenantId(tenantInfo.getFinalTenantId());
dto.setFinalTenantId(tenantInfo.getFinalTenantId());
return wxCUserBasicInfoMapper.findCountByScore(dto); return wxCUserBasicInfoMapper.findCountByScore(dto);
} }
} }
@@ -1127,7 +1132,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
return wxCUserBasicInfoMapper.findCount1(tenantInfo,dto); return wxCUserBasicInfoMapper.findCount1(tenantInfo,dto);
}else{ }else{
//直接查询本表 //直接查询本表
dto.undateFinalTenantId(tenantInfo);
dto.setTenantId(tenantInfo.getFinalTenantId());
dto.setFinalTenantId(tenantInfo.getFinalTenantId());
return wxCUserBasicInfoMapper.findCount(dto); return wxCUserBasicInfoMapper.findCount(dto);
} }
} }
@@ -1144,7 +1150,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
return wxCUserBasicInfoMapper.findCountHistory1(tenantInfo,dto); return wxCUserBasicInfoMapper.findCountHistory1(tenantInfo,dto);
}else{ }else{
//直接查询本表 //直接查询本表
dto.undateFinalTenantId(tenantInfo);
dto.setTenantId(tenantInfo.getFinalTenantId());
dto.setFinalTenantId(tenantInfo.getFinalTenantId());
return wxCUserBasicInfoMapper.findCountHistory(dto); return wxCUserBasicInfoMapper.findCountHistory(dto);
} }
} }
@@ -1211,7 +1218,8 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc
return wxCUserBasicInfoMapper.findListByScore1(tenantEntity,wxCUserBasicInfoDto); return wxCUserBasicInfoMapper.findListByScore1(tenantEntity,wxCUserBasicInfoDto);
}else{ }else{
//直接查询本表 //直接查询本表
wxCUserBasicInfoDto.undateFinalTenantId(tenantEntity);
wxCUserBasicInfoDto.setTenantId(tenantEntity.getFinalTenantId());
wxCUserBasicInfoDto.setFinalTenantId(tenantEntity.getFinalTenantId());
return wxCUserBasicInfoMapper.findListByScore(wxCUserBasicInfoDto); return wxCUserBasicInfoMapper.findListByScore(wxCUserBasicInfoDto);
} }
} }


+ 10
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCampaignServiceImpl.java Näytä tiedosto

@@ -12,6 +12,7 @@ import com.iformall.domain.po.WxCampaign;
import com.iformall.domain.po.WxCoupon; import com.iformall.domain.po.WxCoupon;
import com.iformall.domain.po.WxCouponChannel; import com.iformall.domain.po.WxCouponChannel;
import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxCouponChannelVo;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.mapper.WxActivityMapper; import com.iformall.mapper.WxActivityMapper;
import com.iformall.mapper.WxCampaignMapper; import com.iformall.mapper.WxCampaignMapper;
@@ -249,8 +250,17 @@ public class WxCampaignServiceImpl implements WxCampaignService {
wxCouponChannelMapper.updateById(wxCouponChannel); wxCouponChannelMapper.updateById(wxCouponChannel);
wxCouponChannelsMap.remove(couponId); wxCouponChannelsMap.remove(couponId);
} else { } else {
WxCouponChannel wxCouponChannelQ = new WxCouponChannel();
wxCouponChannelQ.updateTenantInfo(wxCoupon);
wxCouponChannelQ.setCouponId(couponId);
wxCouponChannelQ.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode());
wxCouponChannelQ.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_LIST.getCode());
List<WxCouponChannelVo> voList = wxCouponChannelMapper.findVoList(wxCouponChannelQ);
// 不存在的, 新增 // 不存在的, 新增
wxCouponChannel = new WxCouponChannel(); wxCouponChannel = new WxCouponChannel();
if(voList != null && voList.size() > 0){
wxCouponChannel.setShowBeginTime(voList.get(0).getShowBeginTime());
}
wxCouponChannel.setBeginTime(record.getValidStartDate()); wxCouponChannel.setBeginTime(record.getValidStartDate());
wxCouponChannel.setEndTime(record.getValidEndDate()); wxCouponChannel.setEndTime(record.getValidEndDate());
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());


+ 26
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxMsgServiceImpl.java Näytä tiedosto

@@ -42,6 +42,9 @@ public class WxMsgServiceImpl implements WxMsgService {
@Autowired @Autowired
WxMsgMapper wxMsgMapper; WxMsgMapper wxMsgMapper;


@Autowired
WxCUserMapper wxCUserMapper;

@Autowired @Autowired
WxMsgConfigMapper wxMsgConfigMapper; WxMsgConfigMapper wxMsgConfigMapper;


@@ -244,10 +247,14 @@ public class WxMsgServiceImpl implements WxMsgService {
//2、通过标签 //2、通过标签
String phones = wxMsg.getPhones(); String phones = wxMsg.getPhones();
List<WxCUserBasicInfoFilterListDto> filter = wxMsg.getFilterList(); List<WxCUserBasicInfoFilterListDto> filter = wxMsg.getFilterList();
if (!phones.isEmpty() && !filter.isEmpty()) {//两种方式只能选其一
if(StringUtils.isNotBlank(phones) && filter != null && !filter.isEmpty()){
return new ResultData(ErrorCode.MSG_SEND_WAY_CHOOSE_ERROR); return new ResultData(ErrorCode.MSG_SEND_WAY_CHOOSE_ERROR);
} }
if (phones.isEmpty() && filter.isEmpty()) {//两种方式必须选其一
if (StringUtils.isBlank(phones) && (filter==null || filter.isEmpty())) {//两种方式必须选其一
if(wxMsg.getWay() == EnumSendWay.APPINFOR.getCode()){
saveOrUpdate(wxMsg,null);
return new ResultData();
}
return new ResultData(ErrorCode.MSG_SEND_WAY_CHOOSE_ERROR); return new ResultData(ErrorCode.MSG_SEND_WAY_CHOOSE_ERROR);
} }


@@ -395,10 +402,23 @@ public class WxMsgServiceImpl implements WxMsgService {
}else{ }else{
return; return;
} }
String[] split = wxMsg.getPhones().split(",");
for (String s:split) {
smartAppMsg.setTo(s);
mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());

if(StringUtils.isNotBlank(wxMsg.getPhones())){
String[] split = wxMsg.getPhones().split(",");
for (String s:split) {
smartAppMsg.setTo(s);
mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}
}else{
WxCUser wxCUserQ = new WxCUser();
wxCUserQ.updateTenantInfo(tenantEntity);

List<WxCUser> list = wxCUserMapper.findList(wxCUserQ);
wxMsg.setExpectSendNumber(list.size());
for (WxCUser u:list) {
smartAppMsg.setTo(u.getOpenId());
mqBaseProducer.sendMessage(smartAppMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode());
}
} }


} }


Ladataan…
Peruuta
Tallenna