| @@ -5,11 +5,10 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import com.iformall.domain.vo.WxBusinessDataVo; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.ExcelService; | |||
| import com.iformall.service.WxBusinessService; | |||
| import com.iformall.service.WxSubBusinessService; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -33,8 +32,6 @@ public class WxBusinessController extends BaseController { | |||
| @Autowired | |||
| private WxBusinessService wxBusinessService; | |||
| @Autowired | |||
| private WxSubBusinessService wxSubBusinessService; | |||
| @Autowired | |||
| private ExcelService excelService; | |||
| @@ -49,10 +46,15 @@ public class WxBusinessController extends BaseController { | |||
| @ApiOperation("子业态表接口") | |||
| @GetMapping("listSub") | |||
| @SystemControllerLog(description = "子业态") | |||
| public ResultData listSub(@ModelAttribute WxSubBusiness wxSubBusiness) { | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "businessId", value = "页数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData listSub(Integer businessId) { | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::getList"); | |||
| final List<WxSubBusiness> busList = wxSubBusinessService.findList(wxSubBusiness); | |||
| WxBusiness bq = new WxBusiness(); | |||
| bq.setFinalTenantId(this.getTenantInfo().getFinalTenantId()); | |||
| bq.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| bq.setParentId(businessId); | |||
| final List<WxBusiness> busList = wxBusinessService.findList(bq); | |||
| return new ResultData(busList); | |||
| } | |||
| @@ -0,0 +1,5 @@ | |||
| alter table wx_msg add column per_count int(3) not null default 1 comment '每条消息发送条数'; | |||
| alter table wx_msg add column sms_channel int(3) not null default 11 comment '发送渠道 EnumSMSChannel'; | |||
| update wx_msg set sms_channel = 12 where tenant_id in ('1035','1036'); | |||
| @@ -0,0 +1,101 @@ | |||
| alter table wx_coupon_0 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_1 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_2 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_3 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_4 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_5 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_6 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_7 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_8 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_9 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_10 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_11 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_12 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_13 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_14 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_15 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_16 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_17 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_18 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_19 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_20 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_21 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_22 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_23 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_24 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_25 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_26 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_27 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_28 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_29 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_30 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_31 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_32 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_33 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_34 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_35 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_36 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_37 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_38 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_39 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_40 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_41 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_42 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_43 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_44 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_45 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_46 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_47 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_48 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_49 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_50 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_51 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_52 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_53 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_54 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_55 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_56 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_57 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_58 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_59 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_60 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_61 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_62 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_63 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_64 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_65 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_66 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_67 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_68 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_69 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_70 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_71 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_72 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_73 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_74 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_75 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_76 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_77 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_78 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_79 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_80 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_81 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_82 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_83 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_84 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_85 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_86 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_87 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_88 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_89 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_90 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_91 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_92 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_93 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_94 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_95 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_96 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_97 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_98 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| alter table wx_coupon_99 add column press_pay_reduce_stock int(1) not null default 0 comment '砍价支付扣库存EnumYesOrNo' after press_limit_hours; | |||
| @@ -123,6 +123,9 @@ public class WxPayOrderController extends BaseController { | |||
| } catch (NumberFormatException e) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确"); | |||
| } | |||
| //如果是砍价付款扣库存,则此时扣库存 | |||
| WxPayOrder record = new WxPayOrder(); | |||
| record.setOrderId(orderId); | |||
| record.setOpenId(getCUser().getOpenId()); | |||
| @@ -50,7 +50,7 @@ public class WxMsgModelSchedule { | |||
| public void querySmsTemplate() { | |||
| WxMsgModel msgModel = new WxMsgModel(); | |||
| msgModel.setStatus(EnumMsgModelStatus.AUDITING.getCode()); | |||
| List<WxMsgModel> aliYunList = wxMsgModelMapper.findAliYunList(msgModel); | |||
| List<WxMsgModel> aliYunList = wxMsgModelMapper.findList(msgModel); | |||
| if(!aliYunList.isEmpty()){ | |||
| Map<String, List<WxMsgModel>> collect = aliYunList.stream().collect(groupingBy(WxMsgModel::getTenantId)); | |||
| for (String tenantId:collect.keySet()) { | |||
| @@ -27,6 +27,10 @@ public class WxBusiness extends TenantEntityWithoutFinalTenantId { | |||
| private Date updateDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否内置EnumYesOrNo",name="isSystem") | |||
| private Integer isSystem; | |||
| @io.swagger.annotations.ApiModelProperty(value="父编码",name="parentId") | |||
| private Integer parentId; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否删除EnumYesOrNo",name="isDel") | |||
| private Integer isDel; | |||
| @TableField(exist = false) | |||
| @@ -42,4 +46,7 @@ public class WxBusiness extends TenantEntityWithoutFinalTenantId { | |||
| @TableField(exist = false) | |||
| private Integer limitEnd; | |||
| @TableField(exist = false) | |||
| private Integer isRoot; | |||
| } | |||
| @@ -178,6 +178,9 @@ public class WxCoupon extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="砍价限制时间",name="pressLimitHours") | |||
| private Integer pressLimitHours; | |||
| @io.swagger.annotations.ApiModelProperty(value="砍价支付扣库存EnumYesOrNo",name="pressPayReduceStock") | |||
| private Integer pressPayReduceStock; | |||
| @io.swagger.annotations.ApiModelProperty(value="积分售价(适用于类型10,11)",name="creditPrice") | |||
| private Integer creditPrice; | |||
| @@ -222,9 +222,9 @@ public class WxMerchant extends TenantEntity { | |||
| // return EnumBusiness.getEnumMessage(businessId); | |||
| // } | |||
| public String getSubBusinessName() { | |||
| return EnumSubBusiness.getEnumMessage(subBusinessId); | |||
| } | |||
| // public String getSubBusinessName() { | |||
| // return EnumSubBusiness.getEnumMessage(subBusinessId); | |||
| // } | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="单价",name="price") | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.domain.po; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| @@ -30,10 +31,25 @@ public class WxMsgModel extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="reason",name="reason") | |||
| private String reason; | |||
| @io.swagger.annotations.ApiModelProperty(value="templateType",name="templateType") | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumMsgModelType",name="templateType") | |||
| private Integer templateType; | |||
| @io.swagger.annotations.ApiModelProperty(value="通道模板code",name="modelCode") | |||
| private String modelCode; | |||
| public Integer calcuteContentSize(int perSize) { | |||
| if (StringUtils.isBlank(content) || perSize <= 0 ) { | |||
| return 1; | |||
| } | |||
| if (content.length() <= perSize) { | |||
| return 1; | |||
| } | |||
| int count = content.length() % perSize; | |||
| int countSize = count * perSize; | |||
| if (countSize < content.length()) { | |||
| return count+1; | |||
| } | |||
| return count; | |||
| } | |||
| } | |||
| @@ -1,35 +0,0 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import java.util.Date; | |||
| @TableName(value = "wx_sub_business") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxSubBusiness extends BaseEntity { | |||
| private static final long serialVersionUID = 1L; | |||
| protected Integer id; | |||
| @io.swagger.annotations.ApiModelProperty(value="子业态名",name="title") | |||
| private String title; | |||
| @io.swagger.annotations.ApiModelProperty(value="业态ID",name="businessId") | |||
| private Integer businessId; | |||
| @io.swagger.annotations.ApiModelProperty(value="业态名",name="businessTitle") | |||
| private String businessTitle; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| } | |||
| @@ -69,6 +69,11 @@ public class WxMsg extends BaseMsg { | |||
| @io.swagger.annotations.ApiModelProperty(value = "couponInjectId", name = "couponInjectId") | |||
| private Long couponInjectId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "发送渠道 EnumSMSChannel", name = "smsChannel") | |||
| private Integer smsChannel; | |||
| @io.swagger.annotations.ApiModelProperty(value = "每条消息发送条数", name = "perCount") | |||
| private Integer perCount; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "模板消息", name = "wxTemplateMsg") | |||
| @@ -2,7 +2,6 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.TtGoodsCategory; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import java.util.List; | |||
| @@ -10,9 +10,9 @@ public interface WxBusinessMapper extends CommonMapper<WxBusiness, String> { | |||
| List<WxBusiness> findList(WxBusiness wxBusiness); | |||
| List<WxBusiness> findListAll(@Param("finalTenantId") String finalTenantId); | |||
| List<WxBusiness> findListForMerchant(@Param("tenantId") String tenantId, @Param("parentTenantId") String parentTenantId); | |||
| List<WxBusiness> findListForCoupon(@Param("tenantId") String tenantId, @Param("parentTenantId") String parentTenantId, @Param("platCode") Integer platCode); | |||
| List<WxBusiness> findListAll(WxBusiness wxBusiness); | |||
| List<WxBusiness> findListForMerchant(@Param("finalTenantId")String finalTenantId,@Param("isRoot")Integer isRoot,@Param("tenantId") String tenantId, @Param("parentTenantId") String parentTenantId); | |||
| List<WxBusiness> findListForCoupon(@Param("finalTenantId")String finalTenantId,@Param("isRoot")Integer isRoot,@Param("tenantId") String tenantId, @Param("parentTenantId") String parentTenantId, @Param("platCode") Integer platCode); | |||
| List<Map<String,Object>> businessDataList(WxBusiness wxBusiness); | |||
| @@ -8,10 +8,6 @@ public interface WxMsgModelMapper extends CommonMapper<WxMsgModel, String> { | |||
| List<WxMsgModel> findList(WxMsgModel wxMsgModel); | |||
| List<WxMsgModel> findAliYunList(WxMsgModel msgModel); | |||
| int updateByCode(WxMsgModel wxMsgModel); | |||
| } | |||
| @@ -1,14 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import java.util.List; | |||
| public interface WxSubBusinessMapper extends CommonMapper<WxSubBusiness, String> { | |||
| List<WxSubBusiness> findList(WxSubBusiness wxSubBusiness); | |||
| List<WxSubBusiness> findListAll(); | |||
| } | |||
| @@ -1,44 +0,0 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import java.util.List; | |||
| public interface WxSubBusinessService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxSubBusiness> listAsPage(WxSubBusiness record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询列表 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<WxSubBusiness> findList(WxSubBusiness record); | |||
| /** | |||
| * 查询全部列表 | |||
| * | |||
| * @return | |||
| */ | |||
| List<WxSubBusiness> findListAll(); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxSubBusiness getById(Integer id); | |||
| } | |||
| @@ -44,8 +44,6 @@ public class WxCUserTagsServiceHelper{ | |||
| @Autowired | |||
| WxCardSpendMapper wxCardSpendMapper; | |||
| @Autowired | |||
| WxSubBusinessMapper wxSubBusinessMapper; | |||
| @Autowired | |||
| WxCUserBasicChildMapper wxCUserBasicChildMapper; | |||
| @Autowired | |||
| WxCouponMapper wxCouponMapper; | |||
| @@ -0,0 +1,63 @@ | |||
| package com.iformall.service.helper; | |||
| import com.iformall.enums.*; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxCouponChannelService; | |||
| import com.iformall.service.WxCouponService; | |||
| import com.iformall.utils.RedisLock; | |||
| @Service | |||
| public class WxOrderServiceHelper { | |||
| private static final Logger logger = LoggerFactory.getLogger(WxOrderServiceHelper.class); | |||
| @Lazy | |||
| @Autowired | |||
| WxCouponChannelService wxCouponChannelService; | |||
| @Lazy | |||
| @Autowired | |||
| WxCouponService wxCouponService; | |||
| @Autowired | |||
| RedisLock redisLock; | |||
| /** | |||
| * 微信订单是否可以支付 | |||
| */ | |||
| public void reduceStock(boolean isChannelStockReduce, WxCoupon coupon,Long couponChannelId,int number) { | |||
| if (isChannelStockReduce) { | |||
| try { | |||
| wxCouponChannelService.reduceChannelStock(coupon,couponChannelId,number); | |||
| long stock = redisLock.decrease(EnumCacheKey.COUPON_CHANNEL_STOCK.getMessage()+couponChannelId, number); | |||
| if (stock < 0 ) { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券["+coupon.getTitle()+"]渠道["+couponChannelId+"]库存已为零!"); | |||
| } | |||
| } catch (RuntimeException e) { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券["+coupon.getTitle()+"]渠道["+couponChannelId+"]库存更新失败!"+e.getMessage()); | |||
| } | |||
| }else { | |||
| try { | |||
| wxCouponService.reduceRemainInventory(coupon,coupon.getId(),number); | |||
| long stock = redisLock.decrease(EnumCacheKey.COUPON_STOCK.getMessage()+coupon.getId(), number); | |||
| if (stock < 0 ) { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券["+coupon.getTitle()+"]库存已为零!"); | |||
| } | |||
| } catch (RuntimeException e) { | |||
| logger.error("此券减库存失败, couponId: " + coupon.getId(),e); | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券["+coupon.getTitle()+"]库存更新失败!"+e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -52,16 +52,19 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||
| @Override | |||
| public List<WxBusiness> findListAll(TenantEntity tenantEntity, Integer filter,Integer paltCode) { | |||
| if (filter == null){ | |||
| return wxBusinessMapper.findListAll(tenantEntity.getFinalTenantId()); | |||
| WxBusiness bq = new WxBusiness(); | |||
| bq.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| bq.setIsRoot(EnumYesOrNo.YES.getCode()); | |||
| if (filter == null){ | |||
| return wxBusinessMapper.findListAll(bq); | |||
| }else if (filter.equals(EnumBusinessFilter.FILTER_BY_COUPON.getCode())) { | |||
| if (paltCode == null) | |||
| paltCode = EnumAppPlat.WX.getCode(); | |||
| return wxBusinessMapper.findListForCoupon(tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), paltCode); | |||
| return wxBusinessMapper.findListForCoupon(tenantEntity.getFinalTenantId(),EnumYesOrNo.YES.getCode(),tenantEntity.getTenantId(), tenantEntity.getParentTenantId(), paltCode); | |||
| }else if (filter.equals(EnumBusinessFilter.FILTER_BY_MERCHANT.getCode())) { | |||
| return wxBusinessMapper.findListForMerchant(tenantEntity.getTenantId(), tenantEntity.getParentTenantId()); | |||
| return wxBusinessMapper.findListForMerchant(tenantEntity.getFinalTenantId(),EnumYesOrNo.YES.getCode(),tenantEntity.getTenantId(), tenantEntity.getParentTenantId()); | |||
| }else { | |||
| return wxBusinessMapper.findListAll(tenantEntity.getFinalTenantId()); | |||
| return wxBusinessMapper.findListAll(bq); | |||
| } | |||
| } | |||
| @@ -210,7 +213,9 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||
| @Override | |||
| public Map<Integer, WxBusiness> findAllMap(TenantEntity tenantEntity) { | |||
| List<WxBusiness> list = wxBusinessMapper.findListAll(tenantEntity.getFinalTenantId()); | |||
| WxBusiness bq = new WxBusiness(); | |||
| bq.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| List<WxBusiness> list = wxBusinessMapper.findListAll(bq); | |||
| Map<Integer,WxBusiness> map = new HashMap<Integer,WxBusiness>(); | |||
| if (null != list) { | |||
| for (int i = 0 ; i < list.size() ; i++) { | |||
| @@ -240,6 +240,7 @@ public class WxCouponInjectServiceImpl implements WxCouponInjectService { | |||
| wxmsg.setErrorNumber(0); | |||
| //1、标签短信2、精准发券 | |||
| wxmsg.setWay(EnumSendWay.COUPON.getCode()); | |||
| wxmsg.setSmsChannel(wxMsgConfig.getSmsChannel()); | |||
| wxMsgService.sendMsgFromCouponInject(wxmsg,wxMsgConfig,record); | |||
| return new ResultData(); | |||
| } | |||
| @@ -215,7 +215,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| if (null == merchantList || merchantList.size() <= 0 ) { | |||
| return null; | |||
| } | |||
| List<WxBusiness> bussinessList = wxBusinessMapper.findListAll(tenantEntity.getFinalTenantId()); | |||
| WxBusiness bq = new WxBusiness(); | |||
| bq.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| List<WxBusiness> bussinessList = wxBusinessMapper.findListAll(bq); | |||
| Map<Integer,WxBusiness> bussinessMap = new HashMap<Integer,WxBusiness>(); | |||
| if (null != bussinessList) { | |||
| for (int i = 0 ; i < bussinessList.size() ; i ++) { | |||
| @@ -22,6 +22,8 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.service.*; | |||
| import com.iformall.sms.EnumSMSChannel; | |||
| import com.iformall.sms.SMSFactory; | |||
| import com.iformall.utils.DateUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| @@ -90,6 +92,10 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| @Lazy | |||
| @Autowired | |||
| TtCUserService ttCUserService; | |||
| @Lazy | |||
| @Autowired | |||
| SMSFactory smsFactory; | |||
| @Override | |||
| public PageInfo<WxMsg> listAsPage(WxMsg record, Integer pageIndex, Integer pageSize) { | |||
| @@ -103,8 +109,8 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| int success = wxMsgCallbackMapper.queryMsgSendTotal(params); | |||
| params.put("status", "0"); | |||
| int error = wxMsgCallbackMapper.queryMsgSendTotal(params); | |||
| temp.setSuccessNumber(success); | |||
| temp.setErrorNumber(error); | |||
| temp.setSuccessNumber(success*temp.getPerCount()); | |||
| temp.setErrorNumber(error*temp.getPerCount()); | |||
| } | |||
| PageInfo<WxMsg> pageInfo = new PageInfo<>(templist); | |||
| @@ -121,8 +127,8 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| int success = wxMsgCallbackMapper.queryMsgSendTotal(params); | |||
| params.put("status", "0"); | |||
| int error = wxMsgCallbackMapper.queryMsgSendTotal(params); | |||
| wxMsg.setSuccessNumber(success); | |||
| wxMsg.setErrorNumber(error); | |||
| wxMsg.setSuccessNumber(success*wxMsg.getPerCount()); | |||
| wxMsg.setErrorNumber(error*wxMsg.getPerCount()); | |||
| if(null != wxMsg.getModelId() && wxMsg.getWay() == EnumSendWay.APPINFOR.getCode()){ | |||
| WxTemplateMsg wxTemplateMsg = wxTemplateMsgMapper.selectById(wxMsg.getModelId()); | |||
| wxMsg.setWxTemplateMsg(wxTemplateMsg); | |||
| @@ -275,7 +281,6 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| } | |||
| return new ResultData(ErrorCode.MSG_SEND_WAY_CHOOSE_ERROR); | |||
| } | |||
| if (phones.isEmpty()) {//没有手工输入手机号时解析标签,有,继续流转 | |||
| if(wxMsg.getWay() == EnumSendWay.TAG.getCode()){ | |||
| List<WxCUserBasicInfo> list = | |||
| @@ -323,6 +328,18 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| logger.info("短信数量不足"); | |||
| return new ResultData(ErrorCode.MSG_SUM_INSUFFICENT); | |||
| } | |||
| EnumSMSChannel smsChannel = EnumSMSChannel.getEnum(wxMsgConfig.getSmsChannel()); | |||
| if (null == smsChannel) { | |||
| return new ResultData(ErrorCode.MSG_SERVER_NOT_FIND,"短信配置渠道错误"); | |||
| } | |||
| wxMsg.setSmsChannel(smsChannel.getCode()); | |||
| WxMsgModel wxMsgModel = wxMsgModelMapper.selectById(wxMsg.getModelId()); | |||
| if (null == wxMsgModel) { | |||
| return new ResultData(ErrorCode.MSG_SERVER_NOT_FIND,"短信模版未查询到"); | |||
| } | |||
| wxMsg.setPerCount(calcuteMsgCount(wxMsgModel,smsChannel)); | |||
| wxMsg.setExpectSendNumber(wxMsg.getExpectSendNumber()*wxMsg.getPerCount()); | |||
| saveOrUpdate(wxMsg, wxMsgConfig); | |||
| return new ResultData(); | |||
| }else if(wxMsg.getWay() == EnumSendWay.APPINFOR.getCode()){ | |||
| @@ -334,6 +351,12 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| } | |||
| } | |||
| private Integer calcuteMsgCount(WxMsgModel wxMsgModel,EnumSMSChannel smsChannel) { | |||
| if (null != smsChannel.getPerSize() && smsChannel.getPerSize() > 0 ) { | |||
| return wxMsgModel.calcuteContentSize(smsChannel.getPerSize()); | |||
| } | |||
| return 1; | |||
| } | |||
| @Async | |||
| @Override | |||
| @@ -357,6 +380,7 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| wxMsg1.setSignature(wxMsg.getSignature()); | |||
| wxMsg1.setMsg(wxMsg.getMsg()); | |||
| wxMsg1.setModelId(wxMsg.getModelId()); | |||
| wxMsg1.setSmsChannel(wxMsg.getSmsChannel()); | |||
| if (extra > 0 && i == index) { | |||
| List<String> phoneList = Arrays.asList(split).subList(i * 1000, length); | |||
| String phones = StringUtils.join(phoneList, ","); | |||
| @@ -28,6 +28,7 @@ import com.iformall.douyin.payv2.result.CreateOrderCallback; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.service.helper.WxOrderServiceHelper; | |||
| import com.iformall.service.order.OrderAdapterService; | |||
| import com.iformall.service.order.OrderFactory; | |||
| import com.iformall.service.order.entity.WxComposeChildOrderPrice; | |||
| @@ -241,6 +242,10 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| @Autowired | |||
| WxCouponBatchService wxCouponBatchService; | |||
| @Lazy | |||
| @Autowired | |||
| private WxOrderServiceHelper wxOrderServiceHelper; | |||
| @Override | |||
| public PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize) { | |||
| @@ -1097,29 +1102,13 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_LIMITED.getCode(),"此券[未支付+已支付]购买数量已超限["+coupon.getTitle()+"], couponId: " + coupon.getId()+ ", count: " + paidCount); | |||
| } | |||
| //减库存, | |||
| if (isChannelStockReduce) { | |||
| try { | |||
| wxCouponChannelService.reduceChannelStock(coupon,couponChannel.getId(),number); | |||
| long stock = redisLock.decrease(EnumCacheKey.COUPON_CHANNEL_STOCK.getMessage()+couponChannel.getId(), number); | |||
| if (stock < 0 ) { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券["+coupon.getTitle()+"]渠道["+couponChannel.getId()+"]库存已为零!"); | |||
| } | |||
| } catch (RuntimeException e) { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券["+coupon.getTitle()+"]渠道["+couponChannel.getId()+"]库存更新失败!"+e.getMessage()); | |||
| } | |||
| }else { | |||
| try { | |||
| wxCouponService.reduceRemainInventory(coupon,coupon.getId(),number); | |||
| long stock = redisLock.decrease(EnumCacheKey.COUPON_STOCK.getMessage()+coupon.getId(), number); | |||
| if (stock < 0 ) { | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券["+coupon.getTitle()+"]库存已为零!"); | |||
| } | |||
| } catch (RuntimeException e) { | |||
| logger.error("此券减库存失败, couponId: " + coupon.getId(),e); | |||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"券["+coupon.getTitle()+"]库存更新失败!"+e.getMessage()); | |||
| } | |||
| boolean isReduceStock = true; | |||
| //减库存,砍价需要看券配置 | |||
| if (isPressOrder && null != coupon.getPressPayReduceStock() && coupon.getPressPayReduceStock().intValue() == EnumYesOrNo.YES.getCode().intValue()) { | |||
| isReduceStock = false; | |||
| } | |||
| if (isReduceStock) { | |||
| wxOrderServiceHelper.reduceStock(isChannelStockReduce,coupon,couponChannel.getId(), number); | |||
| } | |||
| reduceResult.setChannelStockReduce(isChannelStockReduce); | |||
| reduceResult.setCurrentPrice(currentPrice); | |||
| @@ -19,6 +19,7 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.pay.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.service.helper.WxOrderServiceHelper; | |||
| import com.iformall.service.helper.WxPayOrderServiceHelper; | |||
| import com.iformall.service.order.OrderAdapterService; | |||
| import com.iformall.service.order.OrderFactory; | |||
| @@ -44,6 +45,7 @@ import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.aop.framework.AopContext; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| @@ -134,6 +136,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| @Autowired | |||
| OrderFactory orderFactory; | |||
| @Lazy | |||
| @Autowired | |||
| WxOrderServiceHelper wxOrderServiceHelper; | |||
| JSONObject errorMapQuery = JSON.parseObject("{" + | |||
| "\"ORDERNOTEXIST\":{\"detail\":\"此交易订单号不存在\",\"reason\":\"查询系统中不存在此交易订单号\",\"resolution\":\"该API只能查提交支付交易返回成功的订单,请商户检查需要查询的订单号是否正确\"},\n" + | |||
| @@ -273,6 +279,12 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| for (WxOrder o : orderList) { | |||
| productNames.add(o.getProductName()); | |||
| checkSinglePayOrder(o, user, payWay); | |||
| //如果是砍价,并且是付款扣库存 | |||
| WxCoupon coupon = wxCouponMapper.selectById(o.getProductId(), appInfo.getTenantId()); | |||
| if (null != coupon && coupon.getType().intValue() == EnumCouponType.COUPON_PRESS.getCode().intValue() | |||
| && null != coupon.getPressPayReduceStock() && coupon.getPressPayReduceStock().intValue() == EnumYesOrNo.YES.getCode().intValue()) { | |||
| wxOrderServiceHelper.reduceStock(false,coupon,o.getCouponChannelId(), 1); | |||
| } | |||
| } | |||
| PayAdapterResult payResult = createPayOrder(appInfo, user, record,composeOrder,orderList,JSON.toJSONString(productNames), payWay, params,isCreatePay); | |||
| if (payResult.isSuccess()) { | |||
| @@ -1,47 +0,0 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import com.iformall.mapper.WxBusinessMapper; | |||
| import com.iformall.mapper.WxSubBusinessMapper; | |||
| import com.iformall.service.WxBusinessService; | |||
| import com.iformall.service.WxSubBusinessService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| @Service | |||
| public class WxSubBusinessServiceImpl implements WxSubBusinessService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxSubBusinessMapper wxSubBusinessMapper; | |||
| @Override | |||
| public PageInfo<WxSubBusiness> listAsPage(WxSubBusiness record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxSubBusinessMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public List<WxSubBusiness> findList(WxSubBusiness record) { | |||
| return wxSubBusinessMapper.findList(record); | |||
| } | |||
| @Override | |||
| public List<WxSubBusiness> findListAll() { | |||
| return wxSubBusinessMapper.findListAll(); | |||
| } | |||
| @Override | |||
| public WxSubBusiness getById(Integer id) { | |||
| return wxSubBusinessMapper.selectById(id); | |||
| } | |||
| } | |||
| @@ -399,7 +399,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| private Map<String, WxBusiness> getBusinessMap(TenantEntity tenantEntity) { | |||
| WxBusiness bq = new WxBusiness(); | |||
| bq.setFinalTenantId(tenantEntity.getFinalTenantId()); | |||
| List<WxBusiness> businesses = businessService.listAsPage(null, 1, Integer.MAX_VALUE).getList(); | |||
| List<WxBusiness> businesses = businessService.listAsPage(bq, 1, Integer.MAX_VALUE).getList(); | |||
| return getMap(businesses, WxBusiness::getTitle); | |||
| } | |||
| @@ -6,9 +6,9 @@ package com.iformall.sms; | |||
| */ | |||
| public enum EnumSMSChannel { | |||
| ALIYUN(11, "ALIYUN"), | |||
| ALIYUN_ZDY(12, "ALIYUN_ZDY"), | |||
| WIWIDE(0,"WIWIDE"); | |||
| ALIYUN(11, "ALIYUN",60), | |||
| ALIYUN_ZDY(12, "ALIYUN_ZDY(客户的阿里云短信)",0), | |||
| WIWIDE(0,"WIWIDE",0); | |||
| public static EnumSMSChannel getEnum(Integer code) { | |||
| for (EnumSMSChannel value : values()) { | |||
| @@ -21,10 +21,12 @@ public enum EnumSMSChannel { | |||
| private Integer code; | |||
| private String message; | |||
| private Integer perSize;//每条短信最大字数,0:无限制,都按1条算 | |||
| EnumSMSChannel(Integer code, String message) { | |||
| EnumSMSChannel(Integer code, String message,Integer perSize) { | |||
| this.code = code; | |||
| this.message = message; | |||
| this.perSize = perSize; | |||
| } | |||
| public Integer getCode() { | |||
| @@ -34,4 +36,8 @@ public enum EnumSMSChannel { | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| public Integer getPerSize() { | |||
| return perSize; | |||
| } | |||
| } | |||
| @@ -9,10 +9,12 @@ | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId" /> | |||
| <result column="is_system" jdbcType="INTEGER" property="isSystem" /> | |||
| <result column="parent_id" jdbcType="INTEGER" property="parentId" /> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`title`,`type`,`create_date`,`update_date`,`final_tenant_id`,`is_system` | |||
| `id`,`title`,`type`,`create_date`,`update_date`,`final_tenant_id`,`is_system`,`parent_id`,`is_del` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -45,6 +47,14 @@ | |||
| <if test=" null != isSystem "> | |||
| and `is_system` = #{isSystem} | |||
| </if> | |||
| <if test=" null != parentId "> | |||
| and `parent_id` = #{parentId} | |||
| </if> | |||
| <if test=" null != isDel "> | |||
| and `is_del` = #{isDel} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -78,18 +88,25 @@ | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="findListAll" resultMap="BaseResultMap"> | |||
| <select id="findListAll" parameterType="com.iformall.domain.po.WxBusiness" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_business where `final_tenant_id` = #{finalTenantId} | |||
| <if test=" 1 == isRoot"> | |||
| and `parent_id` is null | |||
| </if> | |||
| order by create_date asc | |||
| </select> | |||
| <select id="findListForMerchant" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_business b | |||
| where | |||
| from wx_business b | |||
| where b.`final_tenant_id` = #{finalTenantId} | |||
| <if test=" 1 == isRoot"> | |||
| and b.`parent_id` is null | |||
| </if> | |||
| and | |||
| (select count(*) from wx_merchant m | |||
| where b.id = m.business_id | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| @@ -106,8 +123,12 @@ | |||
| <select id="findListForCoupon" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_business b | |||
| where | |||
| from wx_business b | |||
| where b.`final_tenant_id` = #{finalTenantId} | |||
| <if test=" 1 == isRoot"> | |||
| and b.`parent_id` is null | |||
| </if> | |||
| and | |||
| (select count(*) from wx_coupon_channel cc | |||
| where b.id = cc.business | |||
| and cc.status = 0 | |||
| @@ -44,6 +44,7 @@ | |||
| <result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"/> | |||
| <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/> | |||
| <result column="press_limit_hours" jdbcType="INTEGER" property="pressLimitHours"/> | |||
| <result column="press_pay_reduce_stock" jdbcType="INTEGER" property="pressPayReduceStock"/> | |||
| <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/> | |||
| <result column="credit_price" jdbcType="INTEGER" property="creditPrice"/> | |||
| <result column="credit_refund" jdbcType="INTEGER" property="creditRefund"/> | |||
| @@ -107,6 +108,7 @@ | |||
| <result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"/> | |||
| <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/> | |||
| <result column="press_limit_hours" jdbcType="INTEGER" property="pressLimitHours"/> | |||
| <result column="press_pay_reduce_stock" jdbcType="INTEGER" property="pressPayReduceStock"/> | |||
| <result column="auto_refund" jdbcType="INTEGER" property="autoRefund"/> | |||
| <result column="sale_count" property="saleCount"/> | |||
| @@ -128,7 +130,7 @@ | |||
| c.`title`,c.`sub_title`,c.`item_group`,c.`sale_price`,c.`freight_price`,c.`use_price`,c.`use_limit_rule`,c.`use_limit_quantity`,c.`send_type`, | |||
| c.`valid_type`,c.`valid_start_date`,c.`valid_end_date`,c.pick_start_date,c.pick_end_date,c.`valid_days`,c.`detail`,c.`price`,c.tail_price,c.orig_price,c.`unit`,c.`remain_inventory`,c.`inventory`, | |||
| c.`remark`,c.`status`,c.`create_date`,c.`update_date`,c.`business`,c.`sub_business`,c.`support_transfer`,c.`subsidy_num`,c.`subsidy_type`,c.`is_after_set_price`, | |||
| c.`press_limit_num`, c.`press_limit_hours`, c.`auto_refund`,c.`credit_price`,c.`credit_refund`,c.`put_apply_status`,c.`stock_apply_status`,c.`cancle_apply_status`, | |||
| c.`press_limit_num`, c.`press_limit_hours`,c.`press_pay_reduce_stock`, c.`auto_refund`,c.`credit_price`,c.`credit_refund`,c.`put_apply_status`,c.`stock_apply_status`,c.`cancle_apply_status`, | |||
| c.`conditions`,c.approval_type,c.content_type,c.source_type,c.merchant_type,c.password_support,c.gift_list,c.product_type,c.category_id,c.goods_id | |||
| </sql> | |||
| @@ -273,6 +275,10 @@ | |||
| <if test=" null != pressLimitHours "> | |||
| and `press_limit_hours` = #{pressLimitHours} | |||
| </if> | |||
| <if test=" null != pressPayReduceStock "> | |||
| and `press_pay_reduce_stock` = #{pressPayReduceStock} | |||
| </if> | |||
| <if test=" null != autoRefund "> | |||
| and `auto_refund` = #{autoRefund} | |||
| @@ -624,6 +630,10 @@ | |||
| <if test=" null != pressLimitHours "> | |||
| and c.`press_limit_hours` = #{pressLimitHours} | |||
| </if> | |||
| <if test=" null != pressPayReduceStock "> | |||
| and c.`press_pay_reduce_stock` = #{pressPayReduceStock} | |||
| </if> | |||
| <if test=" null != autoRefund "> | |||
| and c.`auto_refund` = #{autoRefund} | |||
| @@ -791,6 +801,7 @@ | |||
| <result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"/> | |||
| <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/> | |||
| <result column="press_limit_hours" jdbcType="INTEGER" property="pressLimitHours"/> | |||
| <result column="press_pay_reduce_stock" jdbcType="INTEGER" property="pressPayReduceStock"/> | |||
| <result column="conditions" jdbcType="VARCHAR" property="conditions"/> | |||
| <result column="content_type" jdbcType="INTEGER" property="contentType"/> | |||
| <result column="source_type" jdbcType="INTEGER" property="sourceType"/> | |||
| @@ -843,6 +854,7 @@ | |||
| <result column="subsidy_num" jdbcType="INTEGER" property="subsidyNum"/> | |||
| <result column="press_limit_num" jdbcType="INTEGER" property="pressLimitNum"/> | |||
| <result column="press_limit_hours" jdbcType="INTEGER" property="pressLimitHours"/> | |||
| <result column="press_pay_reduce_stock" jdbcType="INTEGER" property="pressPayReduceStock"/> | |||
| <result column="conditions" jdbcType="VARCHAR" property="conditions"/> | |||
| <result column="content_type" jdbcType="INTEGER" property="contentType"/> | |||
| <result column="source_type" jdbcType="INTEGER" property="sourceType"/> | |||
| @@ -1340,7 +1352,7 @@ | |||
| wc.tenant_id,wc.parent_tenant_id,wc.`type`,wc.`cover_img`,wc.`cover_picture`,wc.`detail_picture`,wc.`title`,wc.`sub_title`,wc.`item_group`,wc.`sale_price`,wc.`freight_price`,wc.`use_price`,wc.`use_limit_rule`,wc.`use_limit_quantity`,wc.`send_type`, | |||
| wc.`valid_type`,wc.`valid_start_date`,wc.`valid_end_date`,wc.pick_start_date,wc.pick_end_date,wc.`valid_days`,wc.`detail`,wc.`price`,wc.tail_price,wc.orig_price,wc.`unit`,wc.`remain_inventory`,wc.`inventory`, | |||
| wc.`remark`,wc.`status`,wc.`create_date`,wc.`update_date`,wc.`business`,wc.`sub_business`,wc.`support_transfer`,wc.`subsidy_num`,wc.`subsidy_type`, | |||
| wc.`press_limit_num`, wc.`press_limit_hours`, wc.`auto_refund`,wc.`credit_price`,wc.`credit_refund`,wc.`conditions`, | |||
| wc.`press_limit_num`, wc.`press_limit_hours`,wc.`press_pay_reduce_stock`, wc.`auto_refund`,wc.`credit_price`,wc.`credit_refund`,wc.`conditions`, | |||
| wc.title as couponName,wc.`cover_img` as couponPic,wc.`cover_picture` as couponPicture,wc.`detail_picture` as detailPicture,wc.id as couponId | |||
| from wx_coupon_channel ct | |||
| left join wx_coupon wc on wc.id = ct.coupon_id | |||
| @@ -105,7 +105,7 @@ | |||
| <select id="queryMsgSendTotal" parameterType="hashmap" resultType="int"> | |||
| select count(*) from wx_msg_callback where msg_id=#{msgId} and status=#{status} | |||
| select count(1) from wx_msg_callback where msg_id=#{msgId} and status=#{status} | |||
| </select> | |||
| <update id="updateByBatchNo" parameterType="com.iformall.domain.po.WxMsgCallback"> | |||
| @@ -24,10 +24,13 @@ | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="way" jdbcType="INTEGER" property="way" /> | |||
| <result column="coupon_inject_id" jdbcType="BIGINT" property="couponInjectId" /> | |||
| <result column="per_count" jdbcType="INTEGER" property="perCount" /> | |||
| <result column="sms_channel" jdbcType="INTEGER" property="smsChannel" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`model_id`,`msg`,`sendtime`,`createtime`,`expect_send_number`,`success_number`,`error_number`,`return_result`,`phones`,`signature`,`isright`,`name`,`sendstatus`,`excelpath`,`label`,`tags`,`status`,`way`,`coupon_inject_id` | |||
| `id`,`tenant_id`,`parent_tenant_id`,`model_id`,`msg`,`sendtime`,`createtime`,`expect_send_number`,`success_number`,`error_number`,`return_result`, | |||
| `phones`,`signature`,`isright`,`name`,`sendstatus`,`excelpath`,`label`,`tags`,`status`,`way`,`coupon_inject_id`,`per_count`,`sms_channel` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -74,16 +74,7 @@ | |||
| from wx_msg_model | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findAliYunList" parameterType="com.iformall.domain.po.WxMsgModel" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_msg_model | |||
| where ifnull(model_code,'') != '' | |||
| and `status` = #{status} | |||
| </select> | |||
| <update id="updateByCode" parameterType="com.iformall.domain.po.WxMsgModel"> | |||
| update wx_msg_model set status=#{status},reason=#{reason} where `model_code` = #{modelCode} | |||
| </update> | |||
| @@ -1,62 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxSubBusinessMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxSubBusiness"> | |||
| <id column="id" jdbcType="INTEGER" property="id" /> | |||
| <result column="title" jdbcType="VARCHAR" property="title" /> | |||
| <result column="business_id" jdbcType="INTEGER" property="businessId" /> | |||
| <result column="business_title" jdbcType="VARCHAR" property="businessTitle" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`title`,`business_id`,`business_title`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != title "> | |||
| and `title` like concat('%', #{title},'%') | |||
| </if> | |||
| <if test=" null != businessId "> | |||
| and `business_id` = #{businessId} | |||
| </if> | |||
| <if test=" null != businessTitle "> | |||
| and `business_title` like concat('%', #{businessTitle},'%') | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxSubBusiness" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_sub_business | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="findListAll" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_sub_business | |||
| order by create_date asc | |||
| </select> | |||
| </mapper> | |||
| @@ -5,11 +5,9 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxSubBusiness; | |||
| import com.iformall.domain.vo.WxBusinessDataVo; | |||
| import com.iformall.service.ExcelService; | |||
| import com.iformall.service.WxBusinessService; | |||
| import com.iformall.service.WxSubBusinessService; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -33,8 +31,6 @@ public class WxBusinessController extends BaseController { | |||
| @Autowired | |||
| private WxBusinessService wxBusinessService; | |||
| @Autowired | |||
| private WxSubBusinessService wxSubBusinessService; | |||
| @Autowired | |||
| private ExcelService excelService; | |||
| @@ -47,15 +43,6 @@ public class WxBusinessController extends BaseController { | |||
| return new ResultData(busList); | |||
| } | |||
| @ApiOperation("子业态表接口") | |||
| @GetMapping("listSub") | |||
| @SystemControllerLog(description = "子业态") | |||
| public ResultData listSub(@ModelAttribute WxSubBusiness wxSubBusiness) { | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::getList"); | |||
| final List<WxSubBusiness> busList = wxSubBusinessService.findList(wxSubBusiness); | |||
| return new ResultData(busList); | |||
| } | |||
| @ApiOperation("业态分析接口") | |||
| @GetMapping("businessDataList") | |||
| @SystemControllerLog(description = "业态分析接口") | |||