| @@ -66,7 +66,7 @@ public class AsyncTask { | |||||
| public void importExcelData(File file, MallUserInfo user, String importKey, String tenantId) { | public void importExcelData(File file, MallUserInfo user, String importKey, String tenantId) { | ||||
| ImportParams params = new ImportParams(); | ImportParams params = new ImportParams(); | ||||
| // 需要验证 | // 需要验证 | ||||
| params.setImportFields(new String[]{"姓名", "性别", "手机号", "微信昵称", "学历", "生日", "地址", "上次活跃时间", "注册时间", "标签", "成长值"}); | |||||
| params.setImportFields(new String[]{"姓名", "性别", "手机号", "微信昵称", "学历", "生日","积分", "地址", "上次活跃时间", "注册时间", "标签", "成长值"}); | |||||
| IExcelDataHandler<CUserBaseInfoT> handler = new AsyncTask.UserExcelHandler(); | IExcelDataHandler<CUserBaseInfoT> handler = new AsyncTask.UserExcelHandler(); | ||||
| handler.setNeedHandlerFields(new String[] { "手机号" }); | handler.setNeedHandlerFields(new String[] { "手机号" }); | ||||
| params.setNeedVerify(true); | params.setNeedVerify(true); | ||||
| @@ -39,19 +39,7 @@ public class WxBusinessController extends BaseController { | |||||
| final PageInfo<WxBusiness> page = wxBusinessService.listAsPage(wxBusiness, pageNum, pageSize); | final PageInfo<WxBusiness> page = wxBusinessService.listAsPage(wxBusiness, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("成长值业态列表接口") | |||||
| @GetMapping("busListForScore") | |||||
| @SystemControllerLog(description = "成长值-业态-列表") | |||||
| public ResultData getList() { | |||||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::getList"); | |||||
| WxBusiness wxBusiness = new WxBusiness(); | |||||
| final List<WxBusiness> busList = wxBusinessService.getList(wxBusiness); | |||||
| // 业态 全部 不返回 | |||||
| List<WxBusiness> busList2 = busList.stream().filter(b -> !b.getId().equals(0L)).collect(Collectors.toList()); | |||||
| return new ResultData(busList2); | |||||
| } | |||||
| @ApiOperation("业态全列表接口") | @ApiOperation("业态全列表接口") | ||||
| @GetMapping("allist") | @GetMapping("allist") | ||||
| @SystemControllerLog(description = "业态-全列表") | @SystemControllerLog(description = "业态-全列表") | ||||
| @@ -38,6 +38,7 @@ import java.util.concurrent.TimeUnit; | |||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
| import static com.iformall.domain.po.WxCouponOrder.Field.CreateDate_DESC; | import static com.iformall.domain.po.WxCouponOrder.Field.CreateDate_DESC; | ||||
| import static com.iformall.ueditor.define.AppInfo.info; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCUserBasicInfo") | @RequestMapping("wxCUserBasicInfo") | ||||
| @@ -452,4 +453,18 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| wxCUserBasicInfoService.exportCarPayData(record, request, response); | wxCUserBasicInfoService.exportCarPayData(record, request, response); | ||||
| } | } | ||||
| @ApiOperation("根据手机号查询接口") | |||||
| @GetMapping("/findByPhone") | |||||
| @ApiImplicitParam(name = "phone", value = "phone", dataType = "String", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "根据手机号查询接口") | |||||
| public ResultData findByPhone(String phone) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::findByPhone"); | |||||
| List<WxCUserBasicInfo> wxCUserBasicInfoList = wxCUserBasicInfoService.findByPhone(getTenantId(),phone); | |||||
| WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo(); | |||||
| if (wxCUserBasicInfoList != null && wxCUserBasicInfoList.size() > 0) { | |||||
| wxCUserBasicInfo = wxCUserBasicInfoList.get(0); | |||||
| } | |||||
| return new ResultData(wxCUserBasicInfo); | |||||
| } | |||||
| } | } | ||||
| @@ -7,11 +7,13 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxLevelConfig; | import com.iformall.domain.po.WxLevelConfig; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxProfitSharingReceiver; | import com.iformall.domain.po.WxProfitSharingReceiver; | ||||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | |||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxProfitSharingReceiverService; | import com.iformall.service.WxProfitSharingReceiverService; | ||||
| 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; | ||||
| import org.apache.commons.beanutils.BeanUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -154,4 +156,12 @@ public class WxMerchantController extends BaseController { | |||||
| return wxMerchantService.updateMerchantLevel(wxMerchant); | return wxMerchantService.updateMerchantLevel(wxMerchant); | ||||
| } | } | ||||
| @ApiOperation("查询当前租户下商户名称列表") | |||||
| @GetMapping("/name_list") | |||||
| @SystemControllerLog(description = "查询当前租户下商户名称列表") | |||||
| public ResultData nameList() { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::name_list"); | |||||
| return new ResultData(wxMerchantService.findList(getTenantId())); | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,2 @@ | |||||
| ALTER TABLE `wx_order` | |||||
| ADD COLUMN `form_id` VARCHAR(64) NULL COMMENT 'formId' AFTER `order_group_id`; | |||||
| @@ -40,15 +40,6 @@ public class WxBusinessController extends BaseController { | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("成长值业态列表接口") | |||||
| @GetMapping("busListForScore") | |||||
| public ResultData getList(@ModelAttribute WxBusiness wxBusiness) { | |||||
| if (null == wxBusiness) wxBusiness = new WxBusiness(); | |||||
| final List<WxBusiness> busList = wxBusinessService.getList(wxBusiness); | |||||
| // 业态 全部 不返回 | |||||
| List<WxBusiness> busList2 = busList.stream().filter(b -> !b.getId().equals(0L)).collect(Collectors.toList()); | |||||
| return new ResultData(busList2); | |||||
| } | |||||
| @ApiOperation("业态全列表接口") | @ApiOperation("业态全列表接口") | ||||
| @GetMapping("allist") | @GetMapping("allist") | ||||
| @@ -39,13 +39,14 @@ public class WxOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxOrderService wxOrderService; | private WxOrderService wxOrderService; | ||||
| @ApiOperation(value = "免费领取", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\"}") | |||||
| @ApiOperation(value = "免费领取", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"formId\":\"String\"}") | |||||
| @PostMapping("freeCoupon") | @PostMapping("freeCoupon") | ||||
| public ResultData freeCoupon(@RequestBody Map<String, String> paramMap) { | public ResultData freeCoupon(@RequestBody Map<String, String> paramMap) { | ||||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String couponChannelIdStr = paramMap.get("couponChannelId"); | String couponChannelIdStr = paramMap.get("couponChannelId"); | ||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| String formId = paramMap.get("formId"); | |||||
| if (StringUtils.isBlank(couponChannelIdStr)) { | if (StringUtils.isBlank(couponChannelIdStr)) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | ||||
| } | } | ||||
| @@ -72,7 +73,7 @@ public class WxOrderController extends BaseController { | |||||
| WxOrder order = null; | WxOrder order = null; | ||||
| try { | try { | ||||
| order = wxOrderService.saveFreeCouponOrder(getUserId(), couponChannelId, couponId); | |||||
| order = wxOrderService.saveFreeCouponOrder(getUserId(), couponChannelId, couponId, formId); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -83,7 +84,7 @@ public class WxOrderController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\"}") | |||||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||||
| @PostMapping("save") | @PostMapping("save") | ||||
| public ResultData saveOrder(@RequestBody Map<String, String> paramMap) { | public ResultData saveOrder(@RequestBody Map<String, String> paramMap) { | ||||
| logger.info("OrderSave: " + paramMap.toString()); | logger.info("OrderSave: " + paramMap.toString()); | ||||
| @@ -93,6 +94,7 @@ public class WxOrderController extends BaseController { | |||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| String pressStr = paramMap.get("press"); | String pressStr = paramMap.get("press"); | ||||
| String orderGroupIdStr = paramMap.get("orderGroupId"); | String orderGroupIdStr = paramMap.get("orderGroupId"); | ||||
| String formId = paramMap.get("formId"); | |||||
| if (StringUtils.isBlank(couponChannelIdStr)) { | if (StringUtils.isBlank(couponChannelIdStr)) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | ||||
| @@ -165,7 +167,7 @@ public class WxOrderController extends BaseController { | |||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| try { | try { | ||||
| WxOrder order = wxOrderService.saveCouponOrder(user, couponChannelId, couponId, isPress, orderGroupId); | |||||
| WxOrder order = wxOrderService.saveCouponOrder(user, couponChannelId, couponId, isPress, orderGroupId, formId); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -3,10 +3,7 @@ package com.iformall.mq; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.mapper.WxMsgRecordMapper; | import com.iformall.mapper.WxMsgRecordMapper; | ||||
| import com.iformall.service.impl.SendCallBackSmsServiceImpl; | |||||
| import com.iformall.service.impl.SendEmailServiceImpl; | |||||
| import com.iformall.service.impl.SendSmartAppMsgServiceImpl; | |||||
| import com.iformall.service.impl.SendSmsServiceImpl; | |||||
| import com.iformall.service.impl.*; | |||||
| import com.iformall.utils.JsonUtil; | import com.iformall.utils.JsonUtil; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -29,6 +26,8 @@ public class MqBaseConsumer { | |||||
| private SendEmailServiceImpl sendEmailService; | private SendEmailServiceImpl sendEmailService; | ||||
| @Autowired | @Autowired | ||||
| private SendSmartAppMsgServiceImpl sendSmartAppMsgService; | private SendSmartAppMsgServiceImpl sendSmartAppMsgService; | ||||
| @Autowired | |||||
| private SendMpMsgServiceImpl sendMpMsgService; | |||||
| // @Autowired | // @Autowired | ||||
| // private MqBaseProducer mqBaseProducer; | // private MqBaseProducer mqBaseProducer; | ||||
| @@ -42,15 +41,18 @@ public class MqBaseConsumer { | |||||
| if(EnumMsgRecordType.SMS.getCode().equals(baseMsg.getMsgType())){ | if(EnumMsgRecordType.SMS.getCode().equals(baseMsg.getMsgType())){ | ||||
| //短信 | //短信 | ||||
| sendSmsService.send((WxMsgRecord)JsonUtil.readValue(message,WxMsgRecord.class)); | sendSmsService.send((WxMsgRecord)JsonUtil.readValue(message,WxMsgRecord.class)); | ||||
| }else if(EnumMsgRecordType.SMS_CALLBACK.getCode().equals(baseMsg.getMsgType())){ | |||||
| } else if(EnumMsgRecordType.SMS_CALLBACK.getCode().equals(baseMsg.getMsgType())){ | |||||
| //业务短信 | //业务短信 | ||||
| sendCallBackSmsService.send((WxMsg)JsonUtil.readValue(message,WxMsg.class)); | sendCallBackSmsService.send((WxMsg)JsonUtil.readValue(message,WxMsg.class)); | ||||
| }else if(EnumMsgRecordType.EMAIL.getCode().equals(baseMsg.getMsgType())){ | |||||
| } else if(EnumMsgRecordType.EMAIL.getCode().equals(baseMsg.getMsgType())){ | |||||
| //邮件 | //邮件 | ||||
| sendEmailService.send((MailMsg)JsonUtil.readValue(message,MailMsg.class)); | sendEmailService.send((MailMsg)JsonUtil.readValue(message,MailMsg.class)); | ||||
| }else if(EnumMsgRecordType.SMART_APP.getCode().equals(baseMsg.getMsgType())){ | |||||
| //微信小程序 | |||||
| } else if(EnumMsgRecordType.SMART_APP.getCode().equals(baseMsg.getMsgType())){ | |||||
| //微信小程序-模板消息 | |||||
| sendSmartAppMsgService.send((SmartAppMsg)JsonUtil.readValue(message,SmartAppMsg.class)); | sendSmartAppMsgService.send((SmartAppMsg)JsonUtil.readValue(message,SmartAppMsg.class)); | ||||
| } else if(EnumMsgRecordType.PUBLIC.getCode().equals(baseMsg.getMsgType())) { | |||||
| //公众号-模板消息 | |||||
| sendMpMsgService.send((MpAppMsg)JsonUtil.readValue(message,MpAppMsg.class)); | |||||
| } | } | ||||
| baseMsg.setMsgStatus(EnumMsgRecordStatus.CONSUME_SUCC.getCode()); | baseMsg.setMsgStatus(EnumMsgRecordStatus.CONSUME_SUCC.getCode()); | ||||
| wxMsgRecordMapper.update(baseMsg); | wxMsgRecordMapper.update(baseMsg); | ||||
| @@ -20,6 +20,11 @@ | |||||
| <scope>compile</scope> | <scope>compile</scope> | ||||
| </dependency> | </dependency> | ||||
| --> | --> | ||||
| <dependency> | |||||
| <groupId>net.sf.dozer</groupId> | |||||
| <artifactId>dozer</artifactId> | |||||
| <version>5.5.1</version> | |||||
| </dependency> | |||||
| </dependencies> | </dependencies> | ||||
| </project> | </project> | ||||
| @@ -1,5 +1,7 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import lombok.Data; | |||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| @@ -7,101 +9,37 @@ import java.io.Serializable; | |||||
| * @author luozukai | * @author luozukai | ||||
| * @date 2019/3/7 10:05 | * @date 2019/3/7 10:05 | ||||
| */ | */ | ||||
| @Data | |||||
| public class BaseMsg implements Serializable { | public class BaseMsg implements Serializable { | ||||
| private static final long serialVersionUID = 923764283764823L; | private static final long serialVersionUID = 923764283764823L; | ||||
| //域0全部 1sys 2a端 3c端 4b端 | |||||
| @io.swagger.annotations.ApiModelProperty(value="域0全部 1sys 2a端 3c端 4b端",name="domain") | |||||
| private Integer domain = 0; | private Integer domain = 0; | ||||
| //租户id | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId") | |||||
| private String tenantId; | private String tenantId; | ||||
| //唯一标识 | |||||
| @io.swagger.annotations.ApiModelProperty(value="唯一标识",name="uuid") | |||||
| @Transient | @Transient | ||||
| private String uuid; | private String uuid; | ||||
| //接收人,手机号邮件地址等 | |||||
| @io.swagger.annotations.ApiModelProperty(value="接收人,手机号邮件地址等",name="receiver") | |||||
| @Transient | @Transient | ||||
| private String receiver; | private String receiver; | ||||
| //消息类型 1短信 2回调短信 3邮件 4微信小程序模板 5微信公众号模板 6系统通知 | |||||
| @io.swagger.annotations.ApiModelProperty(value="消息类型 1短信 2回调短信 3邮件 4微信小程序模板 5微信公众号模板 6系统通知 7websocket",name="msgType") | |||||
| @Transient | @Transient | ||||
| private Integer msgType; | private Integer msgType; | ||||
| //消息状态 0默认1发送成功2消费成功3消费失败 | |||||
| @io.swagger.annotations.ApiModelProperty(value="消息状态 0默认1发送成功2消费成功3消费失败",name="msgStatus") | |||||
| @Transient | @Transient | ||||
| private Integer msgStatus; | private Integer msgStatus; | ||||
| //结果信息 | |||||
| @io.swagger.annotations.ApiModelProperty(value="结果信息",name="statusMessage") | |||||
| @Transient | @Transient | ||||
| private String statusMessage; | private String statusMessage; | ||||
| //rocketMQ延迟消息1s,5s,10s,30s,1m,2m,3m,4m,5m,6m,7m,8m,9m,10m,20m,30m,1h,2h | |||||
| @io.swagger.annotations.ApiModelProperty(value="rocketMQ延迟消息1s,5s,10s,30s,1m,2m,3m,4m,5m,6m,7m,8m,9m,10m,20m,30m,1h,2h",name="delayTimeLevel") | |||||
| @Transient | @Transient | ||||
| private Integer delayTimeLevel = 0; | private Integer delayTimeLevel = 0; | ||||
| public Integer getDomain() { | |||||
| return domain; | |||||
| } | |||||
| public void setDomain(Integer domain) { | |||||
| this.domain = domain; | |||||
| } | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String tenantId) { | |||||
| this.tenantId = tenantId; | |||||
| } | |||||
| public String getReceiver() { | |||||
| return receiver; | |||||
| } | |||||
| public void setReceiver(String receiver) { | |||||
| this.receiver = receiver; | |||||
| } | |||||
| public Integer getDelayTimeLevel() { | |||||
| return delayTimeLevel; | |||||
| } | |||||
| public void setDelayTimeLevel(Integer delayTimeLevel) { | |||||
| this.delayTimeLevel = delayTimeLevel; | |||||
| } | |||||
| public String getStatusMessage() { | |||||
| return statusMessage; | |||||
| } | |||||
| public void setStatusMessage(String statusMessage) { | |||||
| this.statusMessage = statusMessage; | |||||
| } | |||||
| public String getUuid() { | |||||
| return uuid; | |||||
| } | |||||
| public void setUuid(String uuid) { | |||||
| this.uuid = uuid; | |||||
| } | |||||
| public Integer getMsgStatus() { | |||||
| return msgStatus; | |||||
| } | |||||
| public void setMsgStatus(Integer msgStatus) { | |||||
| this.msgStatus = msgStatus; | |||||
| } | |||||
| public Integer getMsgType() { | |||||
| return msgType; | |||||
| } | |||||
| public void setMsgType(Integer msgType) { | |||||
| this.msgType = msgType; | |||||
| } | |||||
| } | } | ||||
| @@ -1,11 +1,18 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| /** | /** | ||||
| * @author luozukai | * @author luozukai | ||||
| * @date 2019/3/7 10:05 | * @date 2019/3/7 10:05 | ||||
| */ | */ | ||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class MailMsg extends BaseMsg { | public class MailMsg extends BaseMsg { | ||||
| private static final long serialVersionUID = 923764283760321L; | private static final long serialVersionUID = 923764283760321L; | ||||
| // 模板id | // 模板id | ||||
| @@ -26,84 +33,4 @@ public class MailMsg extends BaseMsg { | |||||
| //动态替换内容 | //动态替换内容 | ||||
| private Map<String,String> dynamicContentMap; | private Map<String,String> dynamicContentMap; | ||||
| public Map<String, String> getDynamicContentMap() { | |||||
| return dynamicContentMap; | |||||
| } | |||||
| public void setDynamicContentMap(Map<String, String> dynamicContentMap) { | |||||
| this.dynamicContentMap = dynamicContentMap; | |||||
| } | |||||
| public Integer getModelId() { | |||||
| return modelId; | |||||
| } | |||||
| public void setModelId(Integer modelId) { | |||||
| this.modelId = modelId; | |||||
| } | |||||
| public String[] getTo() { | |||||
| return to; | |||||
| } | |||||
| public void setTo(String[] to) { | |||||
| this.to = to; | |||||
| } | |||||
| public String getFrom() { | |||||
| return from; | |||||
| } | |||||
| public void setFrom(String from) { | |||||
| this.from = from; | |||||
| } | |||||
| public String getMsg() { | |||||
| return msg; | |||||
| } | |||||
| public void setMsg(String msg) { | |||||
| this.msg = msg; | |||||
| } | |||||
| public String getSubject() { | |||||
| return subject; | |||||
| } | |||||
| public void setSubject(String subject) { | |||||
| this.subject = subject; | |||||
| } | |||||
| public boolean isHtml() { | |||||
| return isHtml; | |||||
| } | |||||
| public void setHtml(boolean html) { | |||||
| isHtml = html; | |||||
| } | |||||
| public String getFilePath() { | |||||
| return filePath; | |||||
| } | |||||
| public void setFilePath(String filePath) { | |||||
| this.filePath = filePath; | |||||
| } | |||||
| public String getRscPath() { | |||||
| return rscPath; | |||||
| } | |||||
| public void setRscPath(String rscPath) { | |||||
| this.rscPath = rscPath; | |||||
| } | |||||
| public String getRscI() { | |||||
| return rscI; | |||||
| } | |||||
| public void setRscI(String rscI) { | |||||
| this.rscI = rscI; | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,35 @@ | |||||
| package com.iformall.domain.po; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import me.chanjar.weixin.mp.bean.template.WxMpTemplateData; | |||||
| import java.util.List; | |||||
| /** | |||||
| * 微信公众号模板消息 | |||||
| * @author Stormeye | |||||
| * @date 2019/4/9 13:55 | |||||
| */ | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class MpAppMsg extends BaseMsg { | |||||
| private static final long serialVersionUID = 223232132183760321L; | |||||
| @io.swagger.annotations.ApiModelProperty(value="公众号AppId",name="appId") | |||||
| private String appId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="公众号openid",name="to") | |||||
| private String to; | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板类型",name="templateType") | |||||
| private Integer templateType; | |||||
| @io.swagger.annotations.ApiModelProperty(value="小程序AppId",name="miniAppId") | |||||
| private String miniAppId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="小程序路径",name="miniPagePath") | |||||
| private String miniPagePath; | |||||
| @io.swagger.annotations.ApiModelProperty(value="公众号AppId",name="appId") | |||||
| private String emphasisKeyword; | |||||
| @io.swagger.annotations.ApiModelProperty(value="公众号模板主体",name="templateDataList") | |||||
| private List<WxMpTemplateData> templateDataList; | |||||
| } | |||||
| @@ -1,6 +1,10 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import cn.binarywang.wx.miniapp.bean.WxMaTemplateData; | import cn.binarywang.wx.miniapp.bean.WxMaTemplateData; | ||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.util.List; | import java.util.List; | ||||
| /** | /** | ||||
| @@ -8,71 +12,24 @@ import java.util.List; | |||||
| * @author luozukai | * @author luozukai | ||||
| * @date 2019/3/7 10:05 | * @date 2019/3/7 10:05 | ||||
| */ | */ | ||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class SmartAppMsg extends BaseMsg { | public class SmartAppMsg extends BaseMsg { | ||||
| private static final long serialVersionUID = 223232132183760321L; | private static final long serialVersionUID = 223232132183760321L; | ||||
| //小程序的appId | |||||
| @io.swagger.annotations.ApiModelProperty(value="小程序AppId",name="appId") | |||||
| private String appId; | private String appId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="小程序用户openId",name="to") | |||||
| private String to; | private String to; | ||||
| private String from; | |||||
| @io.swagger.annotations.ApiModelProperty(value="小程序formId",name="formId") | |||||
| private String formId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="小程序模板类型",name="templateType") | |||||
| private Integer templateType; | private Integer templateType; | ||||
| @io.swagger.annotations.ApiModelProperty(value="小程序路径",name="gotopage") | |||||
| private String gotopage; | private String gotopage; | ||||
| @io.swagger.annotations.ApiModelProperty(value="小程序模板消息标题",name="emphasisKeyword") | |||||
| private String emphasisKeyword; | private String emphasisKeyword; | ||||
| @io.swagger.annotations.ApiModelProperty(value="小程序模板实体",name="templateDataList") | |||||
| private List<WxMaTemplateData> templateDataList; | private List<WxMaTemplateData> templateDataList; | ||||
| public String getAppId() { | |||||
| return appId; | |||||
| } | |||||
| public void setAppId(String appId) { | |||||
| this.appId = appId; | |||||
| } | |||||
| public String getEmphasisKeyword() { | |||||
| return emphasisKeyword; | |||||
| } | |||||
| public void setEmphasisKeyword(String emphasisKeyword) { | |||||
| this.emphasisKeyword = emphasisKeyword; | |||||
| } | |||||
| public String getGotopage() { | |||||
| return gotopage; | |||||
| } | |||||
| public void setGotopage(String gotopage) { | |||||
| this.gotopage = gotopage; | |||||
| } | |||||
| public String getTo() { | |||||
| return to; | |||||
| } | |||||
| public void setTo(String to) { | |||||
| this.to = to; | |||||
| } | |||||
| public String getFrom() { | |||||
| return from; | |||||
| } | |||||
| public void setFrom(String from) { | |||||
| this.from = from; | |||||
| } | |||||
| public Integer getTemplateType() { | |||||
| return templateType; | |||||
| } | |||||
| public void setTemplateType(Integer templateType) { | |||||
| this.templateType = templateType; | |||||
| } | |||||
| public List<WxMaTemplateData> getTemplateDataList() { | |||||
| return templateDataList; | |||||
| } | |||||
| public void setTemplateDataList(List<WxMaTemplateData> templateDataList) { | |||||
| this.templateDataList = templateDataList; | |||||
| } | |||||
| } | } | ||||
| @@ -97,6 +97,9 @@ public class WxMerchant implements Serializable { | |||||
| @Transient | @Transient | ||||
| private List<WxLevelConfig> levelConfigList; | private List<WxLevelConfig> levelConfigList; | ||||
| @Transient | |||||
| private Integer rentShopType; | |||||
| /*租户ID**/ | /*租户ID**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| @@ -399,6 +402,14 @@ public class WxMerchant implements Serializable { | |||||
| this.isPublic = isPublic; | this.isPublic = isPublic; | ||||
| } | } | ||||
| public Integer getRentShopType() { | |||||
| return rentShopType; | |||||
| } | |||||
| public void setRentShopType(Integer rentShopType) { | |||||
| this.rentShopType = rentShopType; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| @@ -1,5 +1,9 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import javax.persistence.Table; | import javax.persistence.Table; | ||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| @@ -8,6 +12,9 @@ import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| @Table(name = "wx_msg") | @Table(name = "wx_msg") | ||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxMsg extends BaseMsg { | public class WxMsg extends BaseMsg { | ||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @@ -19,66 +26,32 @@ public class WxMsg extends BaseMsg { | |||||
| @Transient | @Transient | ||||
| protected String sortColumns; | protected String sortColumns; | ||||
| public Long getId() { | |||||
| return id; | |||||
| } | |||||
| public void setId(Long id) { | |||||
| this.id = id; | |||||
| } | |||||
| public String getSortColumns() { | |||||
| return sortColumns; | |||||
| } | |||||
| public List<String> getIds() { | |||||
| return ids; | |||||
| } | |||||
| public void setIds(List<String> ids) { | |||||
| this.ids = ids; | |||||
| } | |||||
| /*租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") | @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| /*模板id**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "模板id", name = "modelId") | @io.swagger.annotations.ApiModelProperty(value = "模板id", name = "modelId") | ||||
| private Long modelId; | private Long modelId; | ||||
| /*内容**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "内容", name = "msg") | @io.swagger.annotations.ApiModelProperty(value = "内容", name = "msg") | ||||
| private String msg; | private String msg; | ||||
| /*发送时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "发送时间", name = "sendtime") | @io.swagger.annotations.ApiModelProperty(value = "发送时间", name = "sendtime") | ||||
| private String sendtime; | private String sendtime; | ||||
| /*发送时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "发送时间", name = "createtime") | @io.swagger.annotations.ApiModelProperty(value = "发送时间", name = "createtime") | ||||
| private Date createtime; | private Date createtime; | ||||
| /*预计发送数量**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "预计发送数量", name = "expectSendNumber") | @io.swagger.annotations.ApiModelProperty(value = "预计发送数量", name = "expectSendNumber") | ||||
| private Integer expectSendNumber; | private Integer expectSendNumber; | ||||
| /*成功数量**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "成功数量", name = "successNumber") | @io.swagger.annotations.ApiModelProperty(value = "成功数量", name = "successNumber") | ||||
| private Integer successNumber; | private Integer successNumber; | ||||
| /*错误数量**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "错误数量", name = "errorNumber") | @io.swagger.annotations.ApiModelProperty(value = "错误数量", name = "errorNumber") | ||||
| private Integer errorNumber; | private Integer errorNumber; | ||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "returnResult") | @io.swagger.annotations.ApiModelProperty(value = "", name = "returnResult") | ||||
| private String returnResult; | private String returnResult; | ||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "phones") | @io.swagger.annotations.ApiModelProperty(value = "", name = "phones") | ||||
| private String phones; | private String phones; | ||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "signature") | @io.swagger.annotations.ApiModelProperty(value = "", name = "signature") | ||||
| private String signature; | private String signature; | ||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "isright") | @io.swagger.annotations.ApiModelProperty(value = "", name = "isright") | ||||
| private Integer isright; | private Integer isright; | ||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "name") | @io.swagger.annotations.ApiModelProperty(value = "", name = "name") | ||||
| private String name; | private String name; | ||||
| /*发送状态0未发送 1已发送 2草稿箱**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "发送状态0失败1成功", name = "sendstatus") | @io.swagger.annotations.ApiModelProperty(value = "发送状态0失败1成功", name = "sendstatus") | ||||
| private Integer sendstatus; | private Integer sendstatus; | ||||
| @@ -121,168 +94,23 @@ public class WxMsg extends BaseMsg { | |||||
| this.couponInject = couponInject; | this.couponInject = couponInject; | ||||
| } | } | ||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String _tenantId) { | |||||
| tenantId = _tenantId; | |||||
| } | |||||
| public Long getModelId() { | |||||
| return modelId; | |||||
| } | |||||
| public void setModelId(Long _modelId) { | |||||
| modelId = _modelId; | |||||
| } | |||||
| public String getMsg() { | |||||
| return msg; | |||||
| } | |||||
| public void setMsg(String _msg) { | |||||
| msg = _msg; | |||||
| } | |||||
| public String getSendtime() { | |||||
| return sendtime; | |||||
| } | |||||
| public void setSendtime(String _sendtime) { | |||||
| sendtime = _sendtime; | |||||
| } | |||||
| public Date getCreatetime() { | |||||
| return createtime; | |||||
| } | |||||
| public void setCreatetime(Date _createtime) { | |||||
| createtime = _createtime; | |||||
| } | |||||
| public Integer getExpectSendNumber() { | |||||
| return expectSendNumber; | |||||
| } | |||||
| public void setExpectSendNumber(Integer _expectSendNumber) { | |||||
| expectSendNumber = _expectSendNumber; | |||||
| } | |||||
| public Integer getSuccessNumber() { | |||||
| return successNumber; | |||||
| } | |||||
| public void setSuccessNumber(Integer _successNumber) { | |||||
| successNumber = _successNumber; | |||||
| } | |||||
| public Integer getErrorNumber() { | |||||
| return errorNumber; | |||||
| } | |||||
| public void setErrorNumber(Integer _errorNumber) { | |||||
| errorNumber = _errorNumber; | |||||
| } | |||||
| public String getReturnResult() { | |||||
| return returnResult; | |||||
| } | |||||
| public void setReturnResult(String _returnResult) { | |||||
| returnResult = _returnResult; | |||||
| } | |||||
| public String getPhones() { | |||||
| return phones; | |||||
| } | |||||
| public void setPhones(String _phones) { | |||||
| phones = _phones; | |||||
| } | |||||
| public String getSignature() { | |||||
| return signature; | |||||
| } | |||||
| public void setSignature(String _signature) { | |||||
| signature = _signature; | |||||
| } | |||||
| public Integer getIsright() { | |||||
| return isright; | |||||
| } | |||||
| public void setIsright(Integer _isright) { | |||||
| isright = _isright; | |||||
| } | |||||
| public String getName() { | |||||
| return name; | |||||
| } | |||||
| public void setName(String _name) { | |||||
| name = _name; | |||||
| } | |||||
| public Integer getSendstatus() { | |||||
| return sendstatus; | |||||
| } | |||||
| public void setSendstatus(Integer _sendstatus) { | |||||
| sendstatus = _sendstatus; | |||||
| } | |||||
| public String getExcelpath() { | |||||
| return excelpath; | |||||
| } | |||||
| public void setExcelpath(String excelpath) { | |||||
| this.excelpath = excelpath; | |||||
| } | |||||
| public String getLabel() { | |||||
| return label; | |||||
| } | |||||
| public void setLabel(String label) { | |||||
| this.label = label; | |||||
| } | |||||
| public Integer getStatus() { | |||||
| return status; | |||||
| } | |||||
| public void setStatus(Integer status) { | |||||
| this.status = status; | |||||
| } | |||||
| public Integer getWay() { | |||||
| return way; | |||||
| } | |||||
| public void setWay(Integer way) { | |||||
| this.way = way; | |||||
| } | |||||
| public List<WxTags> getTagsList() { | |||||
| return tagsList; | |||||
| } | |||||
| public void setTagsList(List<WxTags> tagsList) { | |||||
| this.tagsList = tagsList; | |||||
| } | |||||
| public Long getCouponInjectId() { | |||||
| return couponInjectId; | |||||
| } | |||||
| public void setCouponInjectId(Long couponInjectId) { | |||||
| this.couponInjectId = couponInjectId; | |||||
| } | |||||
| public static enum Field { | public static enum Field { | ||||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), ModelId_ASC("`model_id` ASC"), ModelId_DESC("`model_id` DESC"), Msg_ASC("`msg` ASC"), Msg_DESC("`msg` DESC"), Sendtime_ASC("`sendtime` ASC"), Sendtime_DESC("`sendtime` DESC"), Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC"), ExpectSendNumber_ASC("`expect_send_number` ASC"), ExpectSendNumber_DESC("`expect_send_number` DESC"), SuccessNumber_ASC("`success_number` ASC"), SuccessNumber_DESC("`success_number` DESC"), ErrorNumber_ASC("`error_number` ASC"), ErrorNumber_DESC("`error_number` DESC"), ReturnResult_ASC("`return_result` ASC"), ReturnResult_DESC("`return_result` DESC"), Phones_ASC("`phones` ASC"), Phones_DESC("`phones` DESC"), Signature_ASC("`signature` ASC"), Signature_DESC("`signature` DESC"), Isright_ASC("`isright` ASC"), Isright_DESC("`isright` DESC"), Name_ASC("`name` ASC"), Name_DESC("`name` DESC"), Sendstatus_ASC("`sendstatus` ASC"), Sendstatus_DESC("`sendstatus` DESC"); | |||||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC") | |||||
| , TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC") | |||||
| , ModelId_ASC("`model_id` ASC"), ModelId_DESC("`model_id` DESC") | |||||
| , Msg_ASC("`msg` ASC"), Msg_DESC("`msg` DESC") | |||||
| , Sendtime_ASC("`sendtime` ASC"), Sendtime_DESC("`sendtime` DESC") | |||||
| , Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC") | |||||
| , ExpectSendNumber_ASC("`expect_send_number` ASC"), ExpectSendNumber_DESC("`expect_send_number` DESC") | |||||
| , SuccessNumber_ASC("`success_number` ASC"), SuccessNumber_DESC("`success_number` DESC") | |||||
| , ErrorNumber_ASC("`error_number` ASC"), ErrorNumber_DESC("`error_number` DESC") | |||||
| , ReturnResult_ASC("`return_result` ASC"), ReturnResult_DESC("`return_result` DESC") | |||||
| , Phones_ASC("`phones` ASC"), Phones_DESC("`phones` DESC") | |||||
| , Signature_ASC("`signature` ASC"), Signature_DESC("`signature` DESC") | |||||
| , Isright_ASC("`isright` ASC"), Isright_DESC("`isright` DESC") | |||||
| , Name_ASC("`name` ASC"), Name_DESC("`name` DESC") | |||||
| , Sendstatus_ASC("`sendstatus` ASC"), Sendstatus_DESC("`sendstatus` DESC") | |||||
| ; | |||||
| private String value; | private String value; | ||||
| Field(String value) { | Field(String value) { | ||||
| @@ -1,201 +1,59 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import javax.persistence.Table; | import javax.persistence.Table; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @Table(name = "wx_msg_record") | @Table(name = "wx_msg_record") | ||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxMsgRecord extends BaseMsg { | public class WxMsgRecord extends BaseMsg { | ||||
| private static final long serialVersionUID = 18957895653478L; | private static final long serialVersionUID = 18957895653478L; | ||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| //租户id | |||||
| private String tenantId; | |||||
| //msg 消息类型1短信 2回调短信 邮件 3微信小程序模板 4微信公众号模板 5系统通 | //msg 消息类型1短信 2回调短信 邮件 3微信小程序模板 4微信公众号模板 5系统通 | ||||
| @io.swagger.annotations.ApiModelProperty(value="消息类型 1短信 2回调短信 3邮件 4微信小程序模板 5微信公众号模板 6系统通知 7websocket",name="msg") | |||||
| private String msg; | private String msg; | ||||
| //发送时间 | |||||
| @io.swagger.annotations.ApiModelProperty(value="发送时间",name="sendTime") | |||||
| private String sendTime; | private String sendTime; | ||||
| //model_id | |||||
| @io.swagger.annotations.ApiModelProperty(value="modelId",name="modelId") | |||||
| private Long modelId; | private Long modelId; | ||||
| //from,手机号邮件地址等 | |||||
| @io.swagger.annotations.ApiModelProperty(value="from,手机号邮件地址等",name="sender") | |||||
| private String sender; | private String sender; | ||||
| //发送人id | |||||
| @io.swagger.annotations.ApiModelProperty(value="发送人id",name="senderUserId") | |||||
| private Long senderUserId; | private Long senderUserId; | ||||
| //发送人姓名 | |||||
| @io.swagger.annotations.ApiModelProperty(value="发送人姓名",name="senderUserName") | |||||
| private String senderUserName; | private String senderUserName; | ||||
| //接收人用户id | |||||
| @io.swagger.annotations.ApiModelProperty(value="接收人用户id",name="receiverUserId") | |||||
| private Long receiverUserId; | private Long receiverUserId; | ||||
| //接收人姓名 | |||||
| @io.swagger.annotations.ApiModelProperty(value="接收人姓名",name="receiverUserName") | |||||
| private String receiverUserName; | private String receiverUserName; | ||||
| //签名 | |||||
| @io.swagger.annotations.ApiModelProperty(value="签名",name="signature") | |||||
| private String signature; | private String signature; | ||||
| //模板类型 | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板类型",name="modelType") | |||||
| private Integer modelType; | private Integer modelType; | ||||
| //消息json | |||||
| @io.swagger.annotations.ApiModelProperty(value="消息json",name="msgJson") | |||||
| private String msgJson; | private String msgJson; | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||||
| private Date createtime; | private Date createtime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||||
| private Date updatetime; | private Date updatetime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="消息状态",name="msgStatus") | |||||
| private Integer msgStatus; | private Integer msgStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value="结果信息",name="statusMessage") | |||||
| private String statusMessage; | private String statusMessage; | ||||
| //动态替换内容 | |||||
| @io.swagger.annotations.ApiModelProperty(value="动态替换内容",name="dynamicContentMap") | |||||
| private Map<String,String> dynamicContentMap; | private Map<String,String> dynamicContentMap; | ||||
| @Override | |||||
| public Integer getMsgStatus() { | |||||
| return msgStatus; | |||||
| } | |||||
| @Override | |||||
| public void setMsgStatus(Integer msgStatus) { | |||||
| this.msgStatus = msgStatus; | |||||
| } | |||||
| @Override | |||||
| public String getStatusMessage() { | |||||
| return statusMessage; | |||||
| } | |||||
| @Override | |||||
| public void setStatusMessage(String statusMessage) { | |||||
| this.statusMessage = statusMessage; | |||||
| } | |||||
| public String getMsgJson() { | |||||
| return msgJson; | |||||
| } | |||||
| public void setMsgJson(String msgJson) { | |||||
| this.msgJson = msgJson; | |||||
| } | |||||
| public Map<String, String> getDynamicContentMap() { | |||||
| return dynamicContentMap; | |||||
| } | |||||
| public void setDynamicContentMap(Map<String, String> dynamicContentMap) { | |||||
| this.dynamicContentMap = dynamicContentMap; | |||||
| } | |||||
| public Long getId() { | |||||
| return id; | |||||
| } | |||||
| public void setId(Long id) { | |||||
| this.id = id; | |||||
| } | |||||
| public String getSender() { | |||||
| return sender; | |||||
| } | |||||
| public void setSender(String sender) { | |||||
| this.sender = sender; | |||||
| } | |||||
| public Long getSenderUserId() { | |||||
| return senderUserId; | |||||
| } | |||||
| public void setSenderUserId(Long senderUserId) { | |||||
| this.senderUserId = senderUserId; | |||||
| } | |||||
| public String getSenderUserName() { | |||||
| return senderUserName; | |||||
| } | |||||
| public void setSenderUserName(String senderUserName) { | |||||
| this.senderUserName = senderUserName; | |||||
| } | |||||
| public Long getReceiverUserId() { | |||||
| return receiverUserId; | |||||
| } | |||||
| public void setReceiverUserId(Long receiverUserId) { | |||||
| this.receiverUserId = receiverUserId; | |||||
| } | |||||
| public String getReceiverUserName() { | |||||
| return receiverUserName; | |||||
| } | |||||
| public void setReceiverUserName(String receiverUserName) { | |||||
| this.receiverUserName = receiverUserName; | |||||
| } | |||||
| public Integer getModelType() { | |||||
| return modelType; | |||||
| } | |||||
| public void setModelType(Integer modelType) { | |||||
| this.modelType = modelType; | |||||
| } | |||||
| public String getSignature() { | |||||
| return signature; | |||||
| } | |||||
| public void setSignature(String signature) { | |||||
| this.signature = signature; | |||||
| } | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String tenantId) { | |||||
| this.tenantId = tenantId; | |||||
| } | |||||
| public String getMsg() { | |||||
| return msg; | |||||
| } | |||||
| public void setMsg(String msg) { | |||||
| this.msg = msg; | |||||
| } | |||||
| public String getSendTime() { | |||||
| return sendTime; | |||||
| } | |||||
| public void setSendTime(String sendTime) { | |||||
| this.sendTime = sendTime; | |||||
| } | |||||
| public Long getModelId() { | |||||
| return modelId; | |||||
| } | |||||
| public void setModelId(Long modelId) { | |||||
| this.modelId = modelId; | |||||
| } | |||||
| public Date getCreatetime() { | |||||
| return createtime; | |||||
| } | |||||
| public void setCreatetime(Date createtime) { | |||||
| this.createtime = createtime; | |||||
| } | |||||
| public Date getUpdatetime() { | |||||
| return updatetime; | |||||
| } | |||||
| public void setUpdatetime(Date updatetime) { | |||||
| this.updatetime = updatetime; | |||||
| } | |||||
| } | } | ||||
| @@ -48,65 +48,52 @@ public class WxOrder implements Serializable { | |||||
| @Transient | @Transient | ||||
| private String phone; | private String phone; | ||||
| /**订单码;正反向交易保持一致。**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单码;正反向交易保持一致。",name="orderNumber") | @io.swagger.annotations.ApiModelProperty(value="订单码;正反向交易保持一致。",name="orderNumber") | ||||
| private Long orderNumber; | private Long orderNumber; | ||||
| /**租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| /**c端用户id**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | ||||
| private Long cUserId; | private Long cUserId; | ||||
| /**渠道ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="渠道ID",name="couponChannelId") | @io.swagger.annotations.ApiModelProperty(value="渠道ID",name="couponChannelId") | ||||
| private Long couponChannelId; | private Long couponChannelId; | ||||
| /**产品ID,根据order type**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="产品ID(type-0:couponId, 1:buserId, 3:merchantId)",name="productId") | @io.swagger.annotations.ApiModelProperty(value="产品ID(type-0:couponId, 1:buserId, 3:merchantId)",name="productId") | ||||
| private Long productId; | private Long productId; | ||||
| /**类型0:券,1:B刷卡支付,2:C扫码支付,3:储值卡**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="类型",name="type") | |||||
| @io.swagger.annotations.ApiModelProperty(value="类型(0:券,1:B刷卡支付,2:C扫码支付,3:储值卡)",name="type") | |||||
| private Integer type; | private Integer type; | ||||
| /**0: 付款 1: 退款**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="0: 付款 1: 退款",name="paymentType") | @io.swagger.annotations.ApiModelProperty(value="0: 付款 1: 退款",name="paymentType") | ||||
| private Integer paymentType; | private Integer paymentType; | ||||
| /**支付金额(分):允许有负数,退款时为负值。**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") | @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") | ||||
| private Integer payment; | private Integer payment; | ||||
| /**支付时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | ||||
| private Date paymentTime; | private Date paymentTime; | ||||
| /**订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-待退款;4-已退款,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款; 4-退款失败,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败",name="orderStatus") | @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款; 4-退款失败,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败",name="orderStatus") | ||||
| private Integer orderStatus; | private Integer orderStatus; | ||||
| /**创建时间/砍价开始时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间/砍价开始时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间/砍价开始时间",name="createDate") | ||||
| private Date createDate; | private Date createDate; | ||||
| /**更新时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| /**支付描述,订单支付时用**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付描述,订单支付时用",name="detail") | @io.swagger.annotations.ApiModelProperty(value="支付描述,订单支付时用",name="detail") | ||||
| private String detail; | private String detail; | ||||
| /**砍价结束时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="砍价结束时间",name="pressEndDate") | @io.swagger.annotations.ApiModelProperty(value="砍价结束时间",name="pressEndDate") | ||||
| private Date pressEndDate; | private Date pressEndDate; | ||||
| /**砍价人数**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="砍价人数",name="pressCurrentNum") | @io.swagger.annotations.ApiModelProperty(value="砍价人数",name="pressCurrentNum") | ||||
| private Integer pressCurrentNum; | private Integer pressCurrentNum; | ||||
| /**已砍价格**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="已砍价格",name="pressCurrentValue") | @io.swagger.annotations.ApiModelProperty(value="已砍价格",name="pressCurrentValue") | ||||
| private Integer pressCurrentValue; | private Integer pressCurrentValue; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "拼团ID", name = "orderGroupId") | |||||
| private Long orderGroupId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "formId", name = "formId") | |||||
| private String formId; | |||||
| @Transient | @Transient | ||||
| protected List<Integer> statusS; | protected List<Integer> statusS; | ||||
| @Transient | @Transient | ||||
| protected String statusStr; | protected String statusStr; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "拼团ID", name = "orderGroupId") | |||||
| private Long orderGroupId; | |||||
| public Long getOrderNumber() { | public Long getOrderNumber() { | ||||
| return orderNumber; | return orderNumber; | ||||
| @@ -275,7 +262,15 @@ public class WxOrder implements Serializable { | |||||
| this.orderGroupId = orderGroupId; | this.orderGroupId = orderGroupId; | ||||
| } | } | ||||
| public static enum Field | |||||
| public String getFormId() { | |||||
| return formId; | |||||
| } | |||||
| public void setFormId(String formId) { | |||||
| this.formId = formId; | |||||
| } | |||||
| public static enum Field | |||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| ,OrderNumber_ASC("`order_number` ASC"),OrderNumber_DESC("`order_number` DESC") | ,OrderNumber_ASC("`order_number` ASC"),OrderNumber_DESC("`order_number` DESC") | ||||
| @@ -37,11 +37,11 @@ public class WxScoreRules implements Serializable { | |||||
| " {\"businessId\":3,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | " {\"businessId\":3,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | ||||
| " {\"businessId\":4,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | " {\"businessId\":4,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | ||||
| " {\"businessId\":5,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | " {\"businessId\":5,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | ||||
| " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":7,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | " {\"businessId\":7,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | ||||
| " {\"businessId\":8,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | " {\"businessId\":8,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | ||||
| " {\"businessId\":9,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | " {\"businessId\":9,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | ||||
| " {\"businessId\":10,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}" + | |||||
| " {\"businessId\":10,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}" + | |||||
| "]}," + | "]}," + | ||||
| "{\"id\":3,\"limit\":1,\"step\":1,\"score\":100,\"desc\":\"绑定车牌1个\"}," + | "{\"id\":3,\"limit\":1,\"step\":1,\"score\":100,\"desc\":\"绑定车牌1个\"}," + | ||||
| "{\"id\":4,\"limit\":0,\"step\":1,\"score\":10 ,\"desc\":\"连接WIFI1次\"}," + | "{\"id\":4,\"limit\":0,\"step\":1,\"score\":10 ,\"desc\":\"连接WIFI1次\"}," + | ||||
| @@ -21,21 +21,15 @@ public class WxTemplateMsg implements Serializable { | |||||
| protected List<Long> ids; | protected List<Long> ids; | ||||
| @Transient | @Transient | ||||
| protected String sortColumns; | protected String sortColumns; | ||||
| /**租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| /**模板ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板ID",name="templateId") | @io.swagger.annotations.ApiModelProperty(value="模板ID",name="templateId") | ||||
| private String templateId; | private String templateId; | ||||
| /**模板类型1:核销成功消息, 2:核销失败消息**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板类型1:核销成功消息,2:核销失败消息",name="type") | |||||
| @io.swagger.annotations.ApiModelProperty(value="模板类型1:核销成功消息,2:核销失败消息, 101:公众号审核结果消息, 102:公众号卡券核销消息",name="type") | |||||
| private Integer type; | private Integer type; | ||||
| /**创建时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| private Date createDate; | private Date createDate; | ||||
| /**更新时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| @@ -34,27 +34,31 @@ public class CUserBaseInfoT implements Serializable { | |||||
| @Excel(name="生日",width = 20,orderNum = "6") | @Excel(name="生日",width = 20,orderNum = "6") | ||||
| @io.swagger.annotations.ApiModelProperty(value="出生日期",name="birthdate") | @io.swagger.annotations.ApiModelProperty(value="出生日期",name="birthdate") | ||||
| private String birthdate; | private String birthdate; | ||||
| /**积分**/ | |||||
| @Excel(name="积分",width = 20,orderNum = "7") | |||||
| @io.swagger.annotations.ApiModelProperty(value="积分",name="credit") | |||||
| private String credit; | |||||
| /**地址**/ | /**地址**/ | ||||
| @Excel(name="地址",width = 20,orderNum = "7") | |||||
| @Excel(name="地址",width = 20,orderNum = "8") | |||||
| @io.swagger.annotations.ApiModelProperty(value="地址",name="address") | @io.swagger.annotations.ApiModelProperty(value="地址",name="address") | ||||
| private String address; | private String address; | ||||
| /**更新时间**/ | /**更新时间**/ | ||||
| @Excel(name="上次活跃时间",width = 20, orderNum = "8") | |||||
| @Excel(name="上次活跃时间",width = 20, orderNum = "9") | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private String updateDate; | private String updateDate; | ||||
| /**创建时间**/ | /**创建时间**/ | ||||
| @Excel(name="注册时间",width = 20, orderNum = "9") | |||||
| @Excel(name="注册时间",width = 20, orderNum = "10") | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| private String createDate; | private String createDate; | ||||
| @Transient | @Transient | ||||
| @Excel(name="标签",width = 20,orderNum = "10") | |||||
| @Excel(name="标签",width = 20,orderNum = "11") | |||||
| private String tagNames; | private String tagNames; | ||||
| @Transient | @Transient | ||||
| @Excel(name="成长值",width = 20,orderNum = "11") | |||||
| @Excel(name="成长值",width = 20,orderNum = "12") | |||||
| private String poins; | private String poins; | ||||
| public String getName() { | public String getName() { | ||||
| @@ -144,4 +148,12 @@ public class CUserBaseInfoT implements Serializable { | |||||
| public void setPoins(String poins) { | public void setPoins(String poins) { | ||||
| this.poins = poins; | this.poins = poins; | ||||
| } | } | ||||
| public String getCredit() { | |||||
| return credit; | |||||
| } | |||||
| public void setCredit(String credit) { | |||||
| this.credit = credit; | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,16 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| @Data | |||||
| public class WxMerchantSimpleVo { | |||||
| /**id**/ | |||||
| @ApiModelProperty(value="id",name="id") | |||||
| private Long id; | |||||
| /**商户名**/ | |||||
| @ApiModelProperty(value="商户名",name="name") | |||||
| private String merchantName; | |||||
| } | |||||
| @@ -10,6 +10,7 @@ public enum EnumMsgRecordType { | |||||
| SMART_APP(4, "小程序"), | SMART_APP(4, "小程序"), | ||||
| PUBLIC(5, "公众号"), | PUBLIC(5, "公众号"), | ||||
| SYSTEM(6, "系统通知"), | SYSTEM(6, "系统通知"), | ||||
| WEBSOCKET_APP(7, "小程序websocket"), | |||||
| ; | ; | ||||
| public static EnumMsgRecordType getEnum(Integer code) { | public static EnumMsgRecordType getEnum(Integer code) { | ||||
| @@ -7,9 +7,10 @@ public enum EnumTemplateType { | |||||
| // 1-核销成功消息, 2-核销失败消息 | // 1-核销成功消息, 2-核销失败消息 | ||||
| VERIFY_SUCCESS(1, "核销成功消息"), | |||||
| VERIFY_FAIL(2, "核销失败消息"), | |||||
| AUDIT_MESSAGE(3, "审核结果通知") | |||||
| VERIFY_SUCCESS(1, "核销成功消息"), // 小程序 | |||||
| VERIFY_FAIL(2, "核销失败消息"), // 小程序 | |||||
| AUDIT_MESSAGE(101, "公众号审核结果通知"), // 公众号 | |||||
| VERIFY_RESULT(102, "公众号卡券核销通知"), // 公众号 | |||||
| ; | ; | ||||
| public static EnumTemplateType getEnum(Integer code) { | public static EnumTemplateType getEnum(Integer code) { | ||||
| @@ -0,0 +1,17 @@ | |||||
| package com.iformall.exception; | |||||
| public class BeanMappingException extends RuntimeException { | |||||
| private static final long serialVersionUID = -3616240376550557648L; | |||||
| public BeanMappingException() { | |||||
| this("Bean对象映射异常"); | |||||
| } | |||||
| public BeanMappingException(String message) { | |||||
| super(message); | |||||
| } | |||||
| public BeanMappingException(Throwable cause) { | |||||
| super(cause); | |||||
| } | |||||
| } | |||||
| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxLevelConfig; | import com.iformall.domain.po.WxLevelConfig; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | |||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| @@ -39,6 +40,13 @@ public interface WxMerchantService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| List<WxMerchant> etcpList(WxMerchant record); | List<WxMerchant> etcpList(WxMerchant record); | ||||
| /** | |||||
| * 查询商户列表 | |||||
| * @param tenantId | |||||
| * @return | |||||
| */ | |||||
| List<WxMerchantSimpleVo> findList(String tenantId); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| @@ -33,6 +33,14 @@ public interface WxOrderService { | |||||
| ResultData microPayListOnDateAsPage(Long bUserId, Integer type, String date, Integer pageIndex, Integer pageSize); | ResultData microPayListOnDateAsPage(Long bUserId, Integer type, String date, Integer pageIndex, Integer pageSize); | ||||
| /** | |||||
| * 下免费券订单接口 | |||||
| * @param userId | |||||
| * @param couponId | |||||
| * @return WxOrder | |||||
| */ | |||||
| WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId, String formId); | |||||
| /** | /** | ||||
| * 提交订单 | * 提交订单 | ||||
| * @param user | * @param user | ||||
| @@ -40,7 +48,7 @@ public interface WxOrderService { | |||||
| * @param orderGroupId | * @param orderGroupId | ||||
| * @return 订单id | * @return 订单id | ||||
| */ | */ | ||||
| WxOrder saveCouponOrder(WxCUser user, Long couponChannelId, Long couponId, boolean isPress, Long orderGroupId); | |||||
| WxOrder saveCouponOrder(WxCUser user, Long couponChannelId, Long couponId, boolean isPress, Long orderGroupId, String formId); | |||||
| /** | /** | ||||
| * 付款码支付 | * 付款码支付 | ||||
| @@ -60,14 +68,6 @@ public interface WxOrderService { | |||||
| */ | */ | ||||
| WxOrder saveCardPayOrder(WxMerchant merchant, Long cUserId, String totalFeeStr, Integer payment); | WxOrder saveCardPayOrder(WxMerchant merchant, Long cUserId, String totalFeeStr, Integer payment); | ||||
| /** | |||||
| * 免费券订单接口 | |||||
| * @param userId | |||||
| * @param couponId | |||||
| * @return WxOrder | |||||
| */ | |||||
| WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId); | |||||
| /** | /** | ||||
| * 免费券订单接口 | * 免费券订单接口 | ||||
| * @param userId | * @param userId | ||||
| @@ -0,0 +1,65 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxTemplateMsgMapper; | |||||
| import com.iformall.service.MsgSendService; | |||||
| import com.iformall.service.wechat.FmOpenService; | |||||
| import me.chanjar.weixin.mp.api.WxMpService; | |||||
| import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| /** | |||||
| * 发送微信公众号模板消息 | |||||
| * @author Stormeye | |||||
| * @date 2019/4/9 13:51 | |||||
| */ | |||||
| @Service | |||||
| public class SendMpMsgServiceImpl implements MsgSendService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxTemplateMsgMapper wxTemplateMsgMapper; | |||||
| @Autowired | |||||
| private FmOpenService openService; | |||||
| @Override | |||||
| public void send(BaseMsg baseMsg) throws Exception{ | |||||
| MpAppMsg mpAppMsg = (MpAppMsg)baseMsg; | |||||
| WxTemplateMsg msg = null; | |||||
| WxMpService wxMpService = openService.getWxOpenComponentService().getWxMpServiceByAppid(mpAppMsg.getAppId()); | |||||
| // 查询信息模板 | |||||
| WxTemplateMsg msgQ = new WxTemplateMsg(); | |||||
| msgQ.setTenantId(mpAppMsg.getTenantId()); | |||||
| msgQ.setType(mpAppMsg.getTemplateType()); | |||||
| try { | |||||
| msg = wxTemplateMsgMapper.selectOne(msgQ); | |||||
| } catch (Exception e) { | |||||
| logger.error("公众号消息模板错误: " + e.getMessage()); | |||||
| } | |||||
| if (msg == null) { | |||||
| logger.error("找不到模板Id"); | |||||
| throw new MallinkException(ErrorCode.TEMPLATE_NOT_FOUND); | |||||
| } | |||||
| WxMpTemplateMessage.MiniProgram miniprogram = new WxMpTemplateMessage.MiniProgram(); | |||||
| miniprogram.setAppid(mpAppMsg.getMiniAppId()); | |||||
| miniprogram.setPagePath(mpAppMsg.getMiniPagePath()); | |||||
| miniprogram.setUsePath(true); | |||||
| WxMpTemplateMessage mpTemplateMessage = WxMpTemplateMessage.builder() | |||||
| .toUser(mpAppMsg.getTo()) | |||||
| .templateId(msg.getTemplateId()) | |||||
| .miniProgram(miniprogram) | |||||
| .data(mpAppMsg.getTemplateDataList()) | |||||
| .build(); | |||||
| String retStr = wxMpService.getTemplateMsgService().sendTemplateMsg(mpTemplateMessage); | |||||
| logger.info(retStr); | |||||
| } | |||||
| } | |||||
| @@ -69,7 +69,7 @@ public class SendSmartAppMsgServiceImpl implements MsgSendService { | |||||
| */ | */ | ||||
| templateMessage = WxMaTemplateMessage.builder() | templateMessage = WxMaTemplateMessage.builder() | ||||
| .toUser(smartAppMsg.getTo()) | .toUser(smartAppMsg.getTo()) | ||||
| .formId(smartAppMsg.getFrom()) // 微信支付的formId是prepayId | |||||
| .formId(smartAppMsg.getFormId()) // 微信支付的formId是prepayId | |||||
| .page(smartAppMsg.getGotopage()) | .page(smartAppMsg.getGotopage()) | ||||
| .data(smartAppMsg.getTemplateDataList()) | .data(smartAppMsg.getTemplateDataList()) | ||||
| .templateId(msg.getTemplateId()) | .templateId(msg.getTemplateId()) | ||||
| @@ -300,6 +300,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| u1.setPhone("13900010001"); | u1.setPhone("13900010001"); | ||||
| u1.setNickName("昵称"); | u1.setNickName("昵称"); | ||||
| u1.setEducation("本科"); | u1.setEducation("本科"); | ||||
| u1.setCredit(10); | |||||
| u1.setAddress("地址"); | u1.setAddress("地址"); | ||||
| try { | try { | ||||
| u1.setBirthdate(sdf.parse("2018-09-10")); | u1.setBirthdate(sdf.parse("2018-09-10")); | ||||
| @@ -310,7 +311,6 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| u1.setCreateDate(new Date()); | u1.setCreateDate(new Date()); | ||||
| u1.setUpdateDate(new Date()); | u1.setUpdateDate(new Date()); | ||||
| } | } | ||||
| u1.setTagNames("附近住户"); | u1.setTagNames("附近住户"); | ||||
| u1.setPoins(100); | u1.setPoins(100); | ||||
| @@ -319,6 +319,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| u2.setPhone("13900010002"); | u2.setPhone("13900010002"); | ||||
| u2.setNickName("昵称"); | u2.setNickName("昵称"); | ||||
| u2.setEducation("本科"); | u2.setEducation("本科"); | ||||
| u2.setCredit(20); | |||||
| u2.setAddress("地址"); | u2.setAddress("地址"); | ||||
| try { | try { | ||||
| @@ -339,6 +340,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| u3.setPhone("13900010003"); | u3.setPhone("13900010003"); | ||||
| u3.setNickName("昵称"); | u3.setNickName("昵称"); | ||||
| u3.setEducation("本科"); | u3.setEducation("本科"); | ||||
| u3.setCredit(30); | |||||
| u3.setAddress("地址"); | u3.setAddress("地址"); | ||||
| try { | try { | ||||
| @@ -566,6 +568,17 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| } | } | ||||
| } | } | ||||
| //积分 | |||||
| Integer credit = null; | |||||
| if (StringUtils.isNotBlank(uBase.getCredit())) { | |||||
| try { | |||||
| credit = Integer.valueOf(uBase.getCredit()); | |||||
| userBase.setCredit(credit); | |||||
| } catch (Exception e) { | |||||
| logger.error(e.getMessage()); | |||||
| } | |||||
| } | |||||
| WxCUserBasicInfo oldUserBase = null; | WxCUserBasicInfo oldUserBase = null; | ||||
| WxCUserBasicInfo userBaseQ = new WxCUserBasicInfo(); | WxCUserBasicInfo userBaseQ = new WxCUserBasicInfo(); | ||||
| userBaseQ.setTenantId(tenantId); | userBaseQ.setTenantId(tenantId); | ||||
| @@ -590,10 +603,18 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| if(points != null) { | if(points != null) { | ||||
| oldUserBase.setPoins(points); | oldUserBase.setPoins(points); | ||||
| } | } | ||||
| // 覆盖原积分 | |||||
| if(credit != null) { | |||||
| oldUserBase.setCredit(credit); | |||||
| } | |||||
| } else { | } else { | ||||
| userBase.setId(idWorker.nextId()); | userBase.setId(idWorker.nextId()); | ||||
| userBase.setUpdateDate(userBase.getUpdateDate() == null ? new Date() : userBase.getUpdateDate()); | userBase.setUpdateDate(userBase.getUpdateDate() == null ? new Date() : userBase.getUpdateDate()); | ||||
| userBase.setCreateDate(userBase.getCreateDate() == null ? new Date() : userBase.getCreateDate()); | userBase.setCreateDate(userBase.getCreateDate() == null ? new Date() : userBase.getCreateDate()); | ||||
| //新增积分 | |||||
| if(credit != null) { | |||||
| userBase.setCredit(credit); | |||||
| } | |||||
| } | } | ||||
| // update 昵称 | // update 昵称 | ||||
| @@ -606,6 +627,11 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| if (userList.size() > 0) { | if (userList.size() > 0) { | ||||
| WxCUser user = userList.get(0); | WxCUser user = userList.get(0); | ||||
| if (user != null) { | if (user != null) { | ||||
| //覆盖积分 | |||||
| if(credit != null) { | |||||
| user.setCredit(credit); | |||||
| wxCUserMapper.updateByPrimaryKey(user); | |||||
| } | |||||
| bHaveCUser = true; | bHaveCUser = true; | ||||
| if (oldUserBase != null) { | if (oldUserBase != null) { | ||||
| if(oldUserBase != null) { | if(oldUserBase != null) { | ||||
| @@ -26,6 +26,7 @@ import com.iformall.utils.Constant; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import com.iformall.utils.MaUtil; | import com.iformall.utils.MaUtil; | ||||
| import me.chanjar.weixin.common.error.WxErrorException; | import me.chanjar.weixin.common.error.WxErrorException; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.apache.poi.ss.usermodel.Workbook; | import org.apache.poi.ss.usermodel.Workbook; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -535,16 +536,16 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| logger.error("找不到订单信息"); | logger.error("找不到订单信息"); | ||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | ||||
| } | } | ||||
| String formId = null; | |||||
| if(StringUtils.isNotBlank(order.getFormId())) { | |||||
| formId = order.getFormId(); | |||||
| } | |||||
| // 2. get coupon info | // 2. get coupon info | ||||
| WxCoupon coupon = wxCouponMapper.selectByPrimaryKey(couponOrder.getCouponId()); | WxCoupon coupon = wxCouponMapper.selectByPrimaryKey(couponOrder.getCouponId()); | ||||
| if (coupon == null) { | if (coupon == null) { | ||||
| logger.error("找不到券信息"); | logger.error("找不到券信息"); | ||||
| throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); | throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); | ||||
| } | } | ||||
| if(coupon.getSalePrice().equals(0)) { | |||||
| logger.info("免费券不发模板消息!"); | |||||
| return; | |||||
| } | |||||
| // 3. merchant info | // 3. merchant info | ||||
| WxMerchant merchant = wxMerchantMapper.selectByPrimaryKey(bUser.getMerchantId()); | WxMerchant merchant = wxMerchantMapper.selectByPrimaryKey(bUser.getMerchantId()); | ||||
| if (merchant == null) { | if (merchant == null) { | ||||
| @@ -562,26 +563,27 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| // WxAppinfo appInfo = wxAppinfoService.getByAppId(user.getAppId()); | // WxAppinfo appInfo = wxAppinfoService.getByAppId(user.getAppId()); | ||||
| // 6. get payOrder info | // 6. get payOrder info | ||||
| WxPayOrder payOrder = null; | |||||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||||
| payOrderQ.setTenantId(couponOrder.getTenantId()); | |||||
| payOrderQ.setOrderId(order.getId()); | |||||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||||
| List<WxPayOrder> payList = wxPayOrderMapper.select(payOrderQ); | |||||
| if (payList.size() > 0) { | |||||
| payOrder = payList.get(0); | |||||
| } | |||||
| if (payOrder == null) { | |||||
| logger.error("找不到payOrder信息"); | |||||
| throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND); | |||||
| } | |||||
| if (payOrder.getPrepayId() == null) { | |||||
| logger.error("payOrder信息中,prepay_id为空"); | |||||
| throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); | |||||
| if(StringUtils.isBlank(order.getFormId())) { | |||||
| WxPayOrder payOrder = null; | |||||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||||
| payOrderQ.setTenantId(couponOrder.getTenantId()); | |||||
| payOrderQ.setOrderId(order.getId()); | |||||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | |||||
| List<WxPayOrder> payList = wxPayOrderMapper.select(payOrderQ); | |||||
| if (payList.size() > 0) { | |||||
| payOrder = payList.get(0); | |||||
| } | |||||
| if (payOrder == null) { | |||||
| logger.error("找不到payOrder信息"); | |||||
| throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND); | |||||
| } | |||||
| if (payOrder.getPrepayId() == null) { | |||||
| logger.error("payOrder信息中,prepay_id为空"); | |||||
| throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); | |||||
| } | |||||
| formId = payOrder.getPrepayId(); | |||||
| } | } | ||||
| // WxMaService wxMaService = MaUtil.getWeappService(appInfo); | |||||
| SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); | ||||
| String couponDetail = ""; | String couponDetail = ""; | ||||
| if (coupon.getType() == EnumCouponType.COUPON_MANJIAN.getCode()) { | if (coupon.getType() == EnumCouponType.COUPON_MANJIAN.getCode()) { | ||||
| @@ -596,7 +598,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| gotopage = "pages/couponorder/index/index"; | gotopage = "pages/couponorder/index/index"; | ||||
| notes = "您有新的券"; | notes = "您有新的券"; | ||||
| } | } | ||||
| //mq发送小程序消息 | |||||
| //mq发送小程序消息 - 核销成功消息 | |||||
| smartAppMsg = new SmartAppMsg(); | smartAppMsg = new SmartAppMsg(); | ||||
| smartAppMsg.setMsgType(EnumMsgRecordType.SMART_APP.getCode()); | smartAppMsg.setMsgType(EnumMsgRecordType.SMART_APP.getCode()); | ||||
| smartAppMsg.setAppId(user.getAppId()); | smartAppMsg.setAppId(user.getAppId()); | ||||
| @@ -604,7 +606,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| smartAppMsg.setTemplateType(EnumTemplateType.VERIFY_SUCCESS.getCode()); | smartAppMsg.setTemplateType(EnumTemplateType.VERIFY_SUCCESS.getCode()); | ||||
| smartAppMsg.setGotopage(gotopage); | smartAppMsg.setGotopage(gotopage); | ||||
| smartAppMsg.setTo(user.getOpenId()); | smartAppMsg.setTo(user.getOpenId()); | ||||
| smartAppMsg.setFrom(payOrder.getPrepayId()); | |||||
| smartAppMsg.setFormId(formId); | |||||
| smartAppMsg.setTemplateDataList(Lists.newArrayList( | smartAppMsg.setTemplateDataList(Lists.newArrayList( | ||||
| new WxMaTemplateData("keyword1", coupon.getPriceStr() + "元", "#173177"), | new WxMaTemplateData("keyword1", coupon.getPriceStr() + "元", "#173177"), | ||||
| new WxMaTemplateData("keyword2", merchant.getName(), "#173177"), | new WxMaTemplateData("keyword2", merchant.getName(), "#173177"), | ||||
| @@ -615,7 +617,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| new WxMaTemplateData("keyword7", notes, "#173177"))); | new WxMaTemplateData("keyword7", notes, "#173177"))); | ||||
| smartAppMsg.setEmphasisKeyword("keyword1.DATA"); | smartAppMsg.setEmphasisKeyword("keyword1.DATA"); | ||||
| } else { | } else { | ||||
| //mq发送小程序消息 | |||||
| //mq发送小程序消息 - 核销失败消息 | |||||
| smartAppMsg = new SmartAppMsg(); | smartAppMsg = new SmartAppMsg(); | ||||
| smartAppMsg.setMsgType(EnumMsgRecordType.SMART_APP.getCode()); | smartAppMsg.setMsgType(EnumMsgRecordType.SMART_APP.getCode()); | ||||
| smartAppMsg.setAppId(user.getAppId()); | smartAppMsg.setAppId(user.getAppId()); | ||||
| @@ -624,7 +626,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| smartAppMsg.setGotopage("pages/index/index"); | smartAppMsg.setGotopage("pages/index/index"); | ||||
| smartAppMsg.setTo(user.getOpenId()); | smartAppMsg.setTo(user.getOpenId()); | ||||
| smartAppMsg.setReceiver(user.getOpenId()); | smartAppMsg.setReceiver(user.getOpenId()); | ||||
| smartAppMsg.setFrom(payOrder.getPrepayId()); | |||||
| smartAppMsg.setFormId(formId); | |||||
| smartAppMsg.setTemplateDataList(Lists.newArrayList( | smartAppMsg.setTemplateDataList(Lists.newArrayList( | ||||
| new WxMaTemplateData("keyword1", coupon.getTitle(), "#173177"), | new WxMaTemplateData("keyword1", coupon.getTitle(), "#173177"), | ||||
| new WxMaTemplateData("keyword2", dateFormat.format(new Date()), "#173177"), | new WxMaTemplateData("keyword2", dateFormat.format(new Date()), "#173177"), | ||||
| @@ -314,6 +314,7 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| //下架所有投放频道 | //下架所有投放频道 | ||||
| wxCouponChannelService | wxCouponChannelService | ||||
| .updateStatusByCouponId(record.getId(), record.getTenantId(), EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()); | .updateStatusByCouponId(record.getId(), record.getTenantId(), EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()); | ||||
| //下架所有场景投放 | |||||
| wxCouponSendService | wxCouponSendService | ||||
| .updateStatusByCouponId(record.getId(), record.getTenantId(), EnumCouponSendStatus.INVALID.getCode()); | .updateStatusByCouponId(record.getId(), record.getTenantId(), EnumCouponSendStatus.INVALID.getCode()); | ||||
| //下架所有已砍价券 | //下架所有已砍价券 | ||||
| @@ -7,11 +7,13 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | |||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.BeanMapping; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -81,12 +83,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { | ||||
| WxRentContract wxRentContract = new WxRentContract(); | WxRentContract wxRentContract = new WxRentContract(); | ||||
| wxRentContract.setTenantId(record.getTenantId()); | wxRentContract.setTenantId(record.getTenantId()); | ||||
| List<WxRentContract> list = wxRentContractMapper.findList(wxRentContract); | List<WxRentContract> list = wxRentContractMapper.findList(wxRentContract); | ||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<WxMerchant> merchants = wxMerchantMapper.findList(record); | List<WxMerchant> merchants = wxMerchantMapper.findList(record); | ||||
| for (WxMerchant merchant : merchants) { | for (WxMerchant merchant : merchants) { | ||||
| @@ -98,8 +97,23 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| merchant.setRentalStartDate(collect.get(0).getRentalStartDate()); | merchant.setRentalStartDate(collect.get(0).getRentalStartDate()); | ||||
| merchant.setRentalEndDate(collect.get(0).getRentalEndDate()); | merchant.setRentalEndDate(collect.get(0).getRentalEndDate()); | ||||
| } | } | ||||
| if (record.getRentShopType() != null) { | |||||
| List<Map<String, Object>> shops = new ArrayList<>(); | |||||
| WxMerchantShop wxMerchantShop = new WxMerchantShop(); | |||||
| wxMerchantShop.setMerchantId(merchant.getId()); | |||||
| wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||||
| List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); | |||||
| for (WxMerchantShop merchantShop : wxMerchantShopList) { | |||||
| WxShop shop = new WxShop(); | |||||
| shop.setId(merchantShop.getShopId()); | |||||
| List<Map<String, Object>> shoplist = wxShopMapper.findListMap(shop); | |||||
| if (shoplist.size() > 0) { | |||||
| shops.add(shoplist.get(0)); | |||||
| } | |||||
| } | |||||
| merchant.setShoplist(shops); | |||||
| } | |||||
| } | } | ||||
| PageInfo<WxMerchant> pageInfo = new PageInfo<>(merchants); | PageInfo<WxMerchant> pageInfo = new PageInfo<>(merchants); | ||||
| return pageInfo; | return pageInfo; | ||||
| } | } | ||||
| @@ -121,6 +135,14 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| return wxMerchantMapper.findList(record); | return wxMerchantMapper.findList(record); | ||||
| } | } | ||||
| @Override | |||||
| public List<WxMerchantSimpleVo> findList(String tenantId) { | |||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| wxMerchant.setTenantId(tenantId); | |||||
| List<WxMerchant> wxMerchantList = wxMerchantMapper.findList(wxMerchant); | |||||
| return BeanMapping.mapList(wxMerchantList,WxMerchantSimpleVo.class,(s, t)->t.setMerchantName(s.getName())); | |||||
| } | |||||
| @Override | @Override | ||||
| public WxMerchant getById(Long id) { | public WxMerchant getById(Long id) { | ||||
| WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(id); | WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(id); | ||||
| @@ -337,7 +337,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public WxOrder saveCouponOrder(WxCUser user, Long couponChannelId, Long couponId, boolean isPress, Long orderGroupId) { | |||||
| public WxOrder saveCouponOrder(WxCUser user, Long couponChannelId, Long couponId, boolean isPress, Long orderGroupId, String formId) { | |||||
| // 检查用户 | // 检查用户 | ||||
| if (user == null) { | if (user == null) { | ||||
| logger.error("用户不存在"); | logger.error("用户不存在"); | ||||
| @@ -428,6 +428,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| record.setCreateDate(curr); | record.setCreateDate(curr); | ||||
| record.setUpdateDate(curr); | record.setUpdateDate(curr); | ||||
| record.setOrderGroupId(orderGroupId); | record.setOrderGroupId(orderGroupId); | ||||
| record.setFormId(formId); | |||||
| if (isPress) { | if (isPress) { | ||||
| // 初始砍价信息 | // 初始砍价信息 | ||||
| @@ -688,7 +689,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId) { | |||||
| public WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId, String formId) { | |||||
| // check 用户状态 | // check 用户状态 | ||||
| WxCUser user = null; | WxCUser user = null; | ||||
| try { | try { | ||||
| @@ -750,6 +751,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| record.setDetail(bodyStr); | record.setDetail(bodyStr); | ||||
| record.setCreateDate(curr); | record.setCreateDate(curr); | ||||
| record.setUpdateDate(curr); | record.setUpdateDate(curr); | ||||
| record.setFormId(formId); | |||||
| // 保存订单 | // 保存订单 | ||||
| try { | try { | ||||
| @@ -298,7 +298,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| ResultData resultData = getResultDataForUpdate(record, userId); | ResultData resultData = getResultDataForUpdate(record, userId); | ||||
| if (dbRent.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { | if (dbRent.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { | ||||
| if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null) { | |||||
| if (record.getReceivePeriod() != null && record.getLease() != null && record.getPrice() != null | |||||
| && !record.getReceivePeriod().equals(0) && !record.getLease().equals(0) && !record.getPrice().equals(0)) { | |||||
| //删除预账单,重新生成 | //删除预账单,重新生成 | ||||
| wxBillRentMapper.deletePreviewBill(record); | wxBillRentMapper.deletePreviewBill(record); | ||||
| @@ -0,0 +1,139 @@ | |||||
| package com.iformall.utils; | |||||
| import com.iformall.exception.BeanMappingException; | |||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.dozer.DozerBeanMapper; | |||||
| import org.dozer.Mapper; | |||||
| import org.dozer.MappingException; | |||||
| import java.util.ArrayList; | |||||
| import java.util.Collection; | |||||
| import java.util.List; | |||||
| import java.util.concurrent.locks.Lock; | |||||
| import java.util.concurrent.locks.ReentrantLock; | |||||
| import java.util.function.BiConsumer; | |||||
| /** | |||||
| * 不同类型的bean对象属性映射转化 | |||||
| * 基于Dozer封装, 对使用者透明 | |||||
| */ | |||||
| @Slf4j | |||||
| public class BeanMapping { | |||||
| private static Mapper __instance__; | |||||
| private static Lock lock = new ReentrantLock(); | |||||
| private BeanMapping() { | |||||
| } | |||||
| private static Mapper getInstance() { | |||||
| // TODO 支持XML配置或者传入映射关系 | |||||
| if (__instance__ == null) { | |||||
| lock.lock(); | |||||
| if (__instance__ == null) { | |||||
| __instance__ = new DozerBeanMapper(); | |||||
| } | |||||
| lock.unlock(); | |||||
| } | |||||
| return __instance__; | |||||
| } | |||||
| /** | |||||
| * 源对象 {@code source} 转换成目标bean对象 {@code D}; 将名称一致的属性进行转换 | |||||
| * @param source 源Bean | |||||
| * @param dstClass 目标Bean的class | |||||
| * @param <S> 原Bean的泛型定义 | |||||
| * @param <D> 目标Bean的泛型定义 | |||||
| * @return 目标Bean对象 | |||||
| */ | |||||
| public static <S, D> D map(S source, Class<D> dstClass) throws BeanMappingException { | |||||
| return map(source, dstClass, null); | |||||
| } | |||||
| /** | |||||
| * 源对象 {@code source} 转换成目标bean对象 {@code D}; 将名称一致的属性进行转换; 转换完成后进行回调后续处理 | |||||
| * @param source 源Bean | |||||
| * @param dstClass 目标Bean的class | |||||
| * @param biConsumer 目标Bean转换完成后的回调操作 | |||||
| * @param <S> 原Bean的泛型定义 | |||||
| * @param <D> 目标Bean的泛型定义 | |||||
| * @return 目标Bean对象 | |||||
| * @throws BeanMappingException | |||||
| */ | |||||
| public static <S, D> D map(S source, Class<D> dstClass, BiConsumer<S, D> biConsumer) throws BeanMappingException { | |||||
| if (source == null) { | |||||
| return null; | |||||
| } | |||||
| try { | |||||
| D dstObject = getInstance().map(source, dstClass); | |||||
| if (dstObject != null && biConsumer != null) { | |||||
| biConsumer.accept(source, dstObject); | |||||
| } | |||||
| return dstObject; | |||||
| } catch (MappingException e) { | |||||
| log.error("对象映射出错, 原对象类型: {}, 目标对象类型: {}", source.getClass(), dstClass); | |||||
| throw new BeanMappingException(e); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * 源对象集合 {@code source} 转换成目标bean对象后添加到传入的集合中 {@code D}; 将名称一致的属性进行转换 | |||||
| * @param source 源对象集合 | |||||
| * @param destination 目标对象集合 | |||||
| * @param dstClass 目标Bean的class | |||||
| * @param <S> 原Bean的泛型定义 | |||||
| * @param <D> 目标Bean的泛型定义 | |||||
| * @throws BeanMappingException | |||||
| */ | |||||
| public static <S, D> void map(Collection<S> source, Collection<D> destination, Class<D> dstClass) throws BeanMappingException { | |||||
| map(source, destination, dstClass, null); | |||||
| } | |||||
| /** | |||||
| * 源对象集合 {@code source} 转换成目标bean对象后添加到传入的集合中 {@code D}; 将名称一致的属性进行转换 | |||||
| * @param source 源对象集合 | |||||
| * @param destination 目标对象集合 | |||||
| * @param dstClass 目标Bean的class | |||||
| * @param biConsumer 目标Bean转换完成后的回调操作 | |||||
| * @param <S> 原Bean的泛型定义 | |||||
| * @param <D> 目标Bean的泛型定义 | |||||
| * @throws BeanMappingException | |||||
| */ | |||||
| public static <S, D> void map(Collection<S> source, Collection<D> destination, Class<D> dstClass, BiConsumer<S, D> biConsumer) throws BeanMappingException { | |||||
| for (S s : source) { | |||||
| destination.add(map(s, dstClass, biConsumer)); | |||||
| } | |||||
| } | |||||
| /** | |||||
| * 源对象集合 {@code source} 转换成目标bean对象 {@code D}; 将名称一致的属性进行转换 | |||||
| * @param source 源对象集合 | |||||
| * @param dstClass 目标Bean的class | |||||
| * @param <S> 原Bean的泛型定义 | |||||
| * @param <D> 目标Bean的泛型定义 | |||||
| * @return 映射完的List集合, 默认返回ArrayList | |||||
| * @throws BeanMappingException | |||||
| */ | |||||
| public static <S, D> List<D> mapList(Collection<S> source, Class<D> dstClass) throws BeanMappingException { | |||||
| return mapList(source, dstClass, null); | |||||
| } | |||||
| /** | |||||
| * 源对象集合 {@code source} 转换成目标bean对象 {@code D}; 将名称一致的属性进行转换 | |||||
| * @param source 源对象集合 | |||||
| * @param dstClass 目标Bean的class | |||||
| * @param biConsumer 目标Bean转换完成后的回调操作 | |||||
| * @param <S> 原Bean的泛型定义 | |||||
| * @param <D> 目标Bean的泛型定义 | |||||
| * @return 映射完的List集合, 默认返回ArrayList | |||||
| * @throws BeanMappingException | |||||
| */ | |||||
| public static <S, D> List<D> mapList(Collection<S> source, Class<D> dstClass, BiConsumer<S, D> biConsumer) throws BeanMappingException { | |||||
| List<D> result = new ArrayList<>(); | |||||
| map(source, result, dstClass, biConsumer); | |||||
| return result; | |||||
| } | |||||
| } | |||||
| @@ -84,6 +84,12 @@ | |||||
| <if test=" null != email "> | <if test=" null != email "> | ||||
| and `email` = #{email} | and `email` = #{email} | ||||
| </if> | </if> | ||||
| <if test=" null != rentShopType "> | |||||
| and id not in( | |||||
| select merchant_id from wx_rent_contract where tenant_id=#{tenantId} and rent_shop_type=1 and merchant_id is | |||||
| not null and status in(1,2,3,4) | |||||
| ) | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -20,12 +20,13 @@ | |||||
| <result column="press_current_num" jdbcType="INTEGER" property="pressCurrentNum"/> | <result column="press_current_num" jdbcType="INTEGER" property="pressCurrentNum"/> | ||||
| <result column="press_current_value" jdbcType="INTEGER" property="pressCurrentValue"/> | <result column="press_current_value" jdbcType="INTEGER" property="pressCurrentValue"/> | ||||
| <result column="order_group_id" jdbcType="BIGINT" property="orderGroupId"/> | <result column="order_group_id" jdbcType="BIGINT" property="orderGroupId"/> | ||||
| <result column="form_id" jdbcType="VARCHAR" property="formId"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`order_number`,`tenant_id`,`c_user_id`,`coupon_channel_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`, | `id`,`order_number`,`tenant_id`,`c_user_id`,`coupon_channel_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`, | ||||
| `press_end_date`,`press_current_num`,`press_current_value`,`order_group_id` | |||||
| `press_end_date`,`press_current_num`,`press_current_value`,`order_group_id`,`form_id` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -102,6 +103,10 @@ | |||||
| <if test=" null != orderGroupId "> | <if test=" null != orderGroupId "> | ||||
| and `order_group_id` = #{orderGroupId} | and `order_group_id` = #{orderGroupId} | ||||
| </if> | </if> | ||||
| <if test=" null != formId "> | |||||
| and `form_id` = #{formId} | |||||
| </if> | |||||
| <if test=" null != statusS "> | <if test=" null != statusS "> | ||||
| and `order_status` in | and `order_status` in | ||||