Przeglądaj źródła

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

release_toaliyun_real
xhxu 4 lat temu
rodzic
commit
1dbae0859a
11 zmienionych plików z 105 dodań i 80 usunięć
  1. +14
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java
  2. +2
    -0
      mallinkAdmin/src/main/resources/db/migration/V2022052700001__activity.sql
  3. BIN
      mallinkAdmin/src/main/resources/doc/抖音小程序/poi_匹配模板.xlsx
  4. BIN
      mallinkAdmin/src/main/resources/doc/抖音小程序/商家授权函 模板.docx
  5. BIN
      mallinkAdmin/src/main/resources/doc/抖音小程序/富茂抖音小城操作流程SOP.docx
  6. +37
    -27
      mallinkService/src/main/java/com/iformall/domain/po/WxActivityJoin.java
  7. +4
    -3
      mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java
  8. +3
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java
  9. +9
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java
  10. +33
    -45
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  11. +3
    -1
      mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml

+ 14
- 2
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java Wyświetl plik

@@ -205,9 +205,21 @@ public class WxCouponChannelController extends BaseController {
if (null == wxCouponChannel.getChannelPrice() || wxCouponChannel.getChannelPrice() < 0) { if (null == wxCouponChannel.getChannelPrice() || wxCouponChannel.getChannelPrice() < 0) {
return new ResultData(Result.ERROR, "价格未设置或者价格小于0, 如不需要可点击解除价格设置."); return new ResultData(Result.ERROR, "价格未设置或者价格小于0, 如不需要可点击解除价格设置.");
} }

wxCouponChannel.updateTenantInfo(getTenantInfo());
//免费券不能设置有价
WxCouponChannel cc = wxCouponChannelService.getById(wxCouponChannel.getId(), wxCouponChannel.getTenantId());
if (null == cc ) {
return new ResultData(Result.ERROR, "id无效.");
}
WxCoupon coupon = wxCouponService.getById(cc.getCouponId(), wxCouponChannel.getTenantId());
if (null == coupon ) {
return new ResultData(Result.ERROR, "优惠券不存在.");
}
if (coupon.getSalePrice() <= 0) {
return new ResultData(Result.ERROR, "免费券不能设置渠道价格.");
}
try { try {
wxCouponChannel.updateTenantInfo(getTenantInfo());
wxCouponChannelService.setChannelPrice(wxCouponChannel); wxCouponChannelService.setChannelPrice(wxCouponChannel);
CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId()); CouponCacheUtils.removeCouponChannelCache(redisTemplate, wxCouponChannel.getId());
return new ResultData(Result.SUCCESS, "设置成功", ""); return new ResultData(Result.SUCCESS, "设置成功", "");


+ 2
- 0
mallinkAdmin/src/main/resources/db/migration/V2022052700001__activity.sql Wyświetl plik

@@ -0,0 +1,2 @@
ALTER TABLE `mallink`.`wx_activity_join` ADD COLUMN `age` int(3) COMMENT '年龄';
ALTER TABLE `mallink`.`wx_activity_join` ADD COLUMN `number` int(9) COMMENT '人数';

BIN
mallinkAdmin/src/main/resources/doc/抖音小程序/poi_匹配模板.xlsx Wyświetl plik


BIN
mallinkAdmin/src/main/resources/doc/抖音小程序/商家授权函 模板.docx Wyświetl plik


BIN
mallinkAdmin/src/main/resources/doc/抖音小程序/富茂抖音小城操作流程SOP.docx Wyświetl plik


+ 37
- 27
mallinkService/src/main/java/com/iformall/domain/po/WxActivityJoin.java Wyświetl plik

@@ -29,38 +29,52 @@ public class WxActivityJoin extends TenantEntity {
@Excel(name = "姓名", width = 10, orderNum = "1") @Excel(name = "姓名", width = 10, orderNum = "1")
@io.swagger.annotations.ApiModelProperty(value = "姓名", name = "name") @io.swagger.annotations.ApiModelProperty(value = "姓名", name = "name")
private String name; private String name;

@Excel(name = "微信昵称", width = 10, orderNum = "4")
@io.swagger.annotations.ApiModelProperty(value = "昵称", name = "nickName")
private String nickName;

@Excel(name = "生日", format = "yyyy-MM-dd", width = 10, orderNum = "5")
@io.swagger.annotations.ApiModelProperty(value = "生日", name = "birthday")
private Date birthday;

@Excel(name = "性别", replace = {"保密_0", "男_1", "女_2"}, width = 10, orderNum = "3")
@Excel(name = "电话号码", width = 10, orderNum = "2")
@io.swagger.annotations.ApiModelProperty(value = "手机", name = "phone")
private String phone;
@Excel(name = "人数", width = 10, orderNum = "3")
@io.swagger.annotations.ApiModelProperty(value = "人数", name = "sex")
private Integer number;
@Excel(name = "年龄", width = 10, orderNum = "4")
@io.swagger.annotations.ApiModelProperty(value = "年龄", name = "sex")
private Integer age;
@Excel(name = "性别", replace = {"保密_0", "男_1", "女_2"}, width = 10, orderNum = "5")
@io.swagger.annotations.ApiModelProperty(value = "性别0保密1男2女", name = "sex") @io.swagger.annotations.ApiModelProperty(value = "性别0保密1男2女", name = "sex")
private Integer sex; private Integer sex;
@Excel(name = "生日", format = "yyyy-MM-dd", width = 10, orderNum = "6")
@io.swagger.annotations.ApiModelProperty(value = "生日", name = "birthday")
private Date birthday;


@io.swagger.annotations.ApiModelProperty(value = "地址", name = "address")
private String address;
@Excel(name = "微信昵称", width = 10, orderNum = "7")
@io.swagger.annotations.ApiModelProperty(value = "昵称", name = "nickName")
private String nickName;


@Excel(name = "电话号码", width = 10, orderNum = "2")
@io.swagger.annotations.ApiModelProperty(value = "手机", name = "phone")
private String phone;
@Excel(name = "报名时间", format = "yyyy-MM-dd HH:mm:ss", width = 10, orderNum = "8")
@io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime")
private Date createTime;


@Excel(name = "调查问券", width = 10, orderNum = "50")
@io.swagger.annotations.ApiModelProperty(value = "调查问券", name = "answer")
private String answer;
@Excel(name = "活动签到", replace = {"未签到_0", "已签到_1"}, width = 10, orderNum = "7")
@Excel(name = "活动签到", replace = {"未签到_0", "已签到_1"}, width = 10, orderNum = "9")
@io.swagger.annotations.ApiModelProperty(value = "签到状态1签到0未签到", name = "signIn") @io.swagger.annotations.ApiModelProperty(value = "签到状态1签到0未签到", name = "signIn")
private Integer signIn; private Integer signIn;
@Excel(name = "报名状态", replace = {"未确认_0", "已确认_1", "报名失败_2", "活动过期_3"}, width = 10, orderNum = "8")
@Excel(name = "报名状态", replace = {"未确认_0", "已确认_1", "报名失败_2", "活动过期_3"}, width = 10, orderNum = "10")
@io.swagger.annotations.ApiModelProperty(value = "状态0未确认-报名中1确认-报名成功2取消-报名失败3过期", name = "status") @io.swagger.annotations.ApiModelProperty(value = "状态0未确认-报名中1确认-报名成功2取消-报名失败3过期", name = "status")
private Integer status; private Integer status;
@Excel(name = "报名时间", format = "yyyy-MM-dd HH:mm:ss", width = 10, orderNum = "6")
@io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime")
private Date createTime;
@Excel(name = "调查问券", width = 10, orderNum = "11")
@io.swagger.annotations.ApiModelProperty(value = "调查问券", name = "answer")
private String answer;

@io.swagger.annotations.ApiModelProperty(value = "地址", name = "address")
private String address;

@io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateTime") @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateTime")
private Date updateTime; private Date updateTime;


@@ -74,8 +88,4 @@ public class WxActivityJoin extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "状态", name = "statusStr") @io.swagger.annotations.ApiModelProperty(value = "状态", name = "statusStr")
private String statusStr; private String statusStr;


@Excel(name = "联系电话", width = 10, orderNum = "9")
@io.swagger.annotations.ApiModelProperty(value = "联系电话", name = "telphone")
private String telphone;

} }

+ 4
- 3
mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java Wyświetl plik

@@ -134,7 +134,8 @@ public class WxCouponOrderBVo extends WxCouponOrder {
this.bUserName = bUserName; this.bUserName = bUserName;
} }


@io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="bUserName")
@Excel(name = "b端核销员工姓名", width = 50, orderNum = "5")
@io.swagger.annotations.ApiModelProperty(value="b端核销员工姓名",name="bUserName")
private String bUserName; private String bUserName;


public String getbUserPhone() { public String getbUserPhone() {
@@ -152,8 +153,8 @@ public class WxCouponOrderBVo extends WxCouponOrder {
public void setbuserPhone(String bUserPhone) { public void setbuserPhone(String bUserPhone) {
this.bUserPhone = bUserPhone; this.bUserPhone = bUserPhone;
} }
// @Excel(name = "商户操作人", width = 50, orderNum = "5")
@io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone")
@Excel(name = "b端核销手机号", width = 50, orderNum = "5")
@io.swagger.annotations.ApiModelProperty(value="b端核销手机号",name="bUserPhone")
private String bUserPhone; private String bUserPhone;
@Excel(name = "所属商户", width = 50, orderNum = "3") @Excel(name = "所属商户", width = 50, orderNum = "3")
@io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName") @io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName")


+ 3
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java Wyświetl plik

@@ -118,7 +118,7 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService {
} }
quesAnswer.append("[").append("问题").append(i + 1).append(":").append(wxActivityJoinQuestionAnswer.getQues()) quesAnswer.append("[").append("问题").append(i + 1).append(":").append(wxActivityJoinQuestionAnswer.getQues())
.append(" ").append("答案").append(":").append(wxActivityJoinQuestionAnswer.getAnswer()) .append(" ").append("答案").append(":").append(wxActivityJoinQuestionAnswer.getAnswer())
.append("]");
.append("]\r\n");
activityJoin.setAnswer(quesAnswer.toString()); activityJoin.setAnswer(quesAnswer.toString());
} }
} }
@@ -272,7 +272,8 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService {
String person = join.getName(); String person = join.getName();
person = StringUtils.isNotEmpty(person) ? person : ""; person = StringUtils.isNotEmpty(person) ? person : "";
//找出用户手机号 联系电话为空时 使用授权手机号 //找出用户手机号 联系电话为空时 使用授权手机号
String phone = StringUtils.isNotEmpty(join.getTelphone()) ? join.getTelphone() : join.getPhone();
//String phone = StringUtils.isNotEmpty(join.getTelphone()) ? join.getTelphone() : join.getPhone();
String phone = join.getPhone();
//活动名 //活动名
String party = activity.getTitle(); String party = activity.getTitle();
String time = DateUtils.date2String(activity.getActivityStartTime()); String time = DateUtils.date2String(activity.getActivityStartTime());


+ 9
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java Wyświetl plik

@@ -551,6 +551,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
WxCouponChannelAddVo vo = new WxCouponChannelAddVo(); WxCouponChannelAddVo vo = new WxCouponChannelAddVo();


WxCoupon wxCoupon = wxCouponService.getById(couponid,tenantEntity.getTenantId()); WxCoupon wxCoupon = wxCouponService.getById(couponid,tenantEntity.getTenantId());
if(wxCoupon==null){ if(wxCoupon==null){
logger.debug(couponid+ErrorCode.COUPON_IS_EMPTY.getMessage()); logger.debug(couponid+ErrorCode.COUPON_IS_EMPTY.getMessage());
vo.toCouponChannnelVo(null,channelId); vo.toCouponChannnelVo(null,channelId);
@@ -558,6 +559,14 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
return vo; return vo;
} }


if(null != channelPrice) {
if (wxCoupon.getSalePrice() <= 0 && channelPrice > 0) {
vo.toCouponChannnelVo(null,channelId);
vo.setErrorMsg("券为免费券,不能设置渠道价格");
return vo;
}
}
if (null != channelStock && channelStock > wxCoupon.getRemainInventory()) { if (null != channelStock && channelStock > wxCoupon.getRemainInventory()) {
vo.toCouponChannnelVo(null,channelId); vo.toCouponChannnelVo(null,channelId);
vo.setErrorMsg("渠道库存不能超过券剩余总库存。"); vo.setErrorMsg("渠道库存不能超过券剩余总库存。");


+ 33
- 45
mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java Wyświetl plik

@@ -843,8 +843,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
//循环list,获取 cUserId //循环list,获取 cUserId
List<Long> cUserIdList = new ArrayList<Long>(); List<Long> cUserIdList = new ArrayList<Long>();
// List<Long> bUserIdList = new ArrayList<Long>();
// List<Long> merchantIdList = new ArrayList<Long>();
List<Long> bUserIdList = new ArrayList<Long>();
List<Long> merchantIdList = new ArrayList<Long>();
List<Long> couponIdList = new ArrayList<Long>(); List<Long> couponIdList = new ArrayList<Long>();
for (int i = 0 ; i < list.size() ; i ++ ) { for (int i = 0 ; i < list.size() ; i ++ ) {
WxCouponOrder bo = list.get(i); WxCouponOrder bo = list.get(i);
@@ -852,39 +852,39 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
if (null != cusrid && (!cUserIdList.contains(cusrid))) { if (null != cusrid && (!cUserIdList.contains(cusrid))) {
cUserIdList.add(cusrid); cUserIdList.add(cusrid);
} }
// Long bUserId = bo.getBUserId();
// if(null != bUserId && (!bUserIdList.contains(bUserId))){
// bUserIdList.add(bUserId);
// }
// Long bmerchantId = bo.getBMerchantId();
// if (null != bmerchantId && (!merchantIdList.contains(bmerchantId))) {
// merchantIdList.add(bmerchantId);
// }
Long bUserId = bo.getBUserId();
if(null != bUserId && (!bUserIdList.contains(bUserId))){
bUserIdList.add(bUserId);
}
Long bmerchantId = bo.getBMerchantId();
if (null != bmerchantId && (!merchantIdList.contains(bmerchantId))) {
merchantIdList.add(bmerchantId);
}
Long couponId = bo.getCouponId(); Long couponId = bo.getCouponId();
if (null != couponId && (!couponIdList.contains(couponId))) { if (null != couponId && (!couponIdList.contains(couponId))) {
couponIdList.add(couponId); couponIdList.add(couponId);
} }
} }


// Map<Long,String> buserPhoneMap = new HashMap<Long,String>();
// if(bUserIdList.size() > 0){
// WxMerchantBUser buserQ = new WxMerchantBUser();
// buserQ.updateTenantInfo(tenantEntity);
// buserQ.setIds(bUserIdList);
// List<WxMerchantBUser> bUserList = wxMerchantBUserMapper.findSimpleList(buserQ);
// if(null != bUserList && bUserList.size() > 0){
// for (WxMerchantBUser bUser: bUserList) {
// buserPhoneMap.put(bUser.getId(),bUser.getPhone());
// }
// }
// }
Map<Long,WxMerchantBUser> buserPhoneMap = new HashMap<Long,WxMerchantBUser>();
if(bUserIdList.size() > 0){
WxMerchantBUser buserQ = new WxMerchantBUser();
buserQ.updateTenantInfo(tenantEntity);
buserQ.setIds(bUserIdList);
List<WxMerchantBUser> bUserList = wxMerchantBUserMapper.findSimpleList(buserQ);
if(null != bUserList && bUserList.size() > 0){
for (WxMerchantBUser bUser: bUserList) {
buserPhoneMap.put(bUser.getId(),bUser);
}
}
}
Map<Long,String> merchantNameMap = new HashMap<Long,String>(); Map<Long,String> merchantNameMap = new HashMap<Long,String>();
// if (null != merchantIdList && merchantIdList.size() > 0 ) {
if (null != merchantIdList && merchantIdList.size() > 0 ) {
WxMerchant merchantQ = new WxMerchant(); WxMerchant merchantQ = new WxMerchant();
merchantQ.updateTenantInfo(tenantEntity); merchantQ.updateTenantInfo(tenantEntity);
// merchantQ.setIds(merchantIdList);
merchantQ.setIds(merchantIdList);
List<WxMerchant> merchantList = wxMerchantMapper.findIdNameList(merchantQ); List<WxMerchant> merchantList = wxMerchantMapper.findIdNameList(merchantQ);
if (null != merchantList) { if (null != merchantList) {
for (int i = 0 ; i < merchantList.size() ; i ++) { for (int i = 0 ; i < merchantList.size() ; i ++) {
@@ -892,7 +892,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
merchantNameMap.put(m.getId(), m.getName()); merchantNameMap.put(m.getId(), m.getName());
} }
} }
// }
}
Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>(); Map<Long,WxCoupon> couponMap = new HashMap<Long,WxCoupon>();
Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>(); Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>();
@@ -921,22 +921,6 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
} }
} }
// Map<Long,Long> merchantProductIdMap = new HashMap<Long,Long>();
// if (null != merchantIdList && merchantIdList.size() > 0 ) {
// List<WxMerchantProductVo> merchantProductVos = wxCouponMerchantMapper.findMerchantProduct(tenantEntity.getTenantId(), couponIdList);
// if (null != merchantProductVos) {
// for (int i = 0 ; i < merchantProductVos.size(); i ++) {
// WxMerchantProductVo mp = merchantProductVos.get(i);
// if (mp.getMc() > 1) {
// merchantProductIdMap.put(mp.getProductId(), -999L);
// }else {
// merchantProductIdMap.put(mp.getProductId(), mp.getMerchantId());
// }
// }
// }
// }
Map<Long,WxCUserBasicInfo> cUserMap = new HashMap<Long,WxCUserBasicInfo>(); Map<Long,WxCUserBasicInfo> cUserMap = new HashMap<Long,WxCUserBasicInfo>();
if (cUserIdList.size() > 0) { if (cUserIdList.size() > 0) {
WxCUserBasicInfo cUserBasicInfoQ = new WxCUserBasicInfo(); WxCUserBasicInfo cUserBasicInfoQ = new WxCUserBasicInfo();
@@ -1009,9 +993,13 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
co.setVerifyMerchantName(merchantNameMap.get(bMechantId)); co.setVerifyMerchantName(merchantNameMap.get(bMechantId));
} }
//co.setChannelType();) //co.setChannelType();)
// if(null != co.getBUserId()){
// co.setbUserPhone(buserPhoneMap.get(co.getBUserId()));
// }
if(null != co.getBUserId()){
WxMerchantBUser buser = buserPhoneMap.get(co.getBUserId());
if (null != buser) {
co.setbUserPhone(buser.getPhone());
co.setbuserName(buser.getName());
}
}
retList.add(co); retList.add(co);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {


+ 3
- 1
mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml Wyświetl plik

@@ -11,6 +11,8 @@
<result column="nick_name" jdbcType="VARCHAR" property="nickName"/> <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
<result column="birthday" jdbcType="TIMESTAMP" property="birthday"/> <result column="birthday" jdbcType="TIMESTAMP" property="birthday"/>
<result column="sex" jdbcType="INTEGER" property="sex"/> <result column="sex" jdbcType="INTEGER" property="sex"/>
<result column="age" jdbcType="INTEGER" property="age"/>
<result column="number" jdbcType="INTEGER" property="number"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/> <result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="address" jdbcType="VARCHAR" property="address"/> <result column="address" jdbcType="VARCHAR" property="address"/>
<result column="answer" jdbcType="VARCHAR" property="answer"/> <result column="answer" jdbcType="VARCHAR" property="answer"/>
@@ -24,7 +26,7 @@
</resultMap> </resultMap>
<sql id="allColumns"> <sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`user_id`,`activity_id`,`name`,`nick_name`,`birthday`,`sex`,`phone`,
`id`,`tenant_id`,`parent_tenant_id`,`user_id`,`activity_id`,`name`,`nick_name`,`birthday`,`sex`,`age`,`number`,`phone`,
`address`,`answer`,`sign_in`,`status`,`create_time`,`update_time`,`img_url`,`send_msg` `address`,`answer`,`sign_in`,`status`,`create_time`,`update_time`,`img_url`,`send_msg`
</sql> </sql>


Ładowanie…
Anuluj
Zapisz