Просмотр исходного кода

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

release_toaliyun_real
xiaohanzi 5 лет назад
Родитель
Сommit
6e54c05656
19 измененных файлов: 528 добавлений и 70 удалений
  1. +14
    -12
      mallinkPublicApi/src/main/java/com/iformall/utils/AppTest.java
  2. +61
    -0
      mallinkService/src/main/java/com/iformall/domain/po/tt/TtUpSettlein.java
  3. +13
    -0
      mallinkService/src/main/java/com/iformall/mapper/TtUpSettleinMapper.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/TtUserFollowMapper.java
  5. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxMerchantService.java
  6. +2
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  7. +10
    -0
      mallinkService/src/main/java/com/iformall/service/tt/TtCouponService.java
  8. +76
    -4
      mallinkService/src/main/java/com/iformall/service/tt/impl/TtCouponServiceImpl.java
  9. +34
    -22
      mallinkService/src/main/java/com/iformall/service/tt/impl/TtOrderServiceImpl.java
  10. +4
    -9
      mallinkService/src/main/resources/mapper/TtCUserMapper.xml
  11. +8
    -1
      mallinkService/src/main/resources/mapper/TtCouponMapper.xml
  12. +4
    -4
      mallinkService/src/main/resources/mapper/TtOrderMapper.xml
  13. +90
    -0
      mallinkService/src/main/resources/mapper/TtUpSettleinMapper.xml
  14. +28
    -4
      mallinkTTAdmin/src/main/java/com/iformall/controller/tt/TtCouponController.java
  15. +7
    -6
      mallinkTTCApi/src/main/java/com/iformall/controller/BaseController.java
  16. +70
    -4
      mallinkTTCApi/src/main/java/com/iformall/controller/TtCouponController.java
  17. +0
    -2
      mallinkTTCApi/src/main/java/com/iformall/controller/TtOrderController.java
  18. +31
    -0
      mallinkTTCApi/src/main/java/com/iformall/controller/WxBusinessController.java
  19. +74
    -0
      mallinkTTCApi/src/main/java/com/iformall/controller/WxMerchantController.java

+ 14
- 12
mallinkPublicApi/src/main/java/com/iformall/utils/AppTest.java Просмотреть файл

@@ -40,21 +40,21 @@ public class AppTest {
* 查询用户详细信息 参数
*/
// paramMap.put("phone","18872592633");
paramMap.put("openId","opvcM5A41kbQF_NY8k3LMDqxCDUM");
// paramMap.put("openId","opvcM5A41kbQF_NY8k3LMDqxCDUM");


/**
* 创建交易信息 参数
*/
// IdWorker idWorker = IdWorker.get();
// paramMap.put("transactionId",String.valueOf(idWorker.nextId()));//***订单Id
// paramMap.put("shopNumber","1001");//***门店唯一标识 对应双方平台门店
// paramMap.put("shopName","百丽");//门店名称
// paramMap.put("userNumber","546907706202185728");//***会员Id
// paramMap.put("userPhone","18872592633");//会员手机号
// paramMap.put("timeEnd","2021-04-27 11:43:00");//***付款时间(yyyy-MM-dd HH:mm:ss)
// paramMap.put("amount","1000");//***付款金额(分)
// paramMap.put("summary","我要加积分");//付款摘要
IdWorker idWorker = IdWorker.get();
paramMap.put("transactionId",String.valueOf(idWorker.nextId()));//***订单Id
paramMap.put("shopNumber","1001");//***门店唯一标识 对应双方平台门店
paramMap.put("shopName","百丽");//门店名称
paramMap.put("userNumber","546907706202185728");//***会员Id
paramMap.put("userPhone","18872592633");//会员手机号
paramMap.put("timeEnd","2021-04-27 11:43:00");//***付款时间(yyyy-MM-dd HH:mm:ss)
paramMap.put("amount","1100");//***付款金额(分)
paramMap.put("summary","我要加积分");//付款摘要

/**
* 交易退款信息 参数
@@ -96,13 +96,15 @@ public class AppTest {
/**
* 注册并查询用户详细信息 接口
*/
String s = HttpUtil.doPost("https://openapitest.malls.iformall.com/api/userInfo/get", headMap, JSON.toJSONString(paramMap));
// String s = HttpUtil.doPost("https://openapitest.malls.iformall.com/api/userInfo/get", headMap, JSON.toJSONString(paramMap));


/**
* 创建交易信息 接口
*/
// String s = HttpUtil.doPost("https://openapitest.malls.iformall.com/api/thirdCircle/order", headMap, JSON.toJSONString(paramMap));
String s = HttpUtil.doPost("https://openapitest.malls.iformall.com/api/thirdCircle/order", headMap, JSON.toJSONString(paramMap));
// String s = HttpUtil.doPost("http://localhost:7070/public/api/thirdCircle/order", headMap, JSON.toJSONString(paramMap));


/**
* 交易退款 接口


+ 61
- 0
mallinkService/src/main/java/com/iformall/domain/po/tt/TtUpSettlein.java Просмотреть файл

@@ -0,0 +1,61 @@
package com.iformall.domain.po.tt;

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

import java.util.Date;

@TableName(value = "tt_up_settlein")
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class TtUpSettlein extends TenantEntity {

protected Long id;

private Long cuserId;

@io.swagger.annotations.ApiModelProperty(value="邀请码",name="invitationCode")
private String invitationCode;
@io.swagger.annotations.ApiModelProperty(value="联系人",name="liaisonMan")
private String liaisonMan;
@io.swagger.annotations.ApiModelProperty(value="联系电话",name="liaisonPhone")
private String liaisonPhone;

@io.swagger.annotations.ApiModelProperty(value="抖音号",name="name")
private String ttUserName;
@io.swagger.annotations.ApiModelProperty(value="",name="ttCountFans")
private String ttCountFans;

@io.swagger.annotations.ApiModelProperty(value="类型",name="bussinessTypes")
private String bussinessTypes;

@io.swagger.annotations.ApiModelProperty(value="说明",name="explain")
private String explain;

@io.swagger.annotations.ApiModelProperty(value = "处理状态0:未处理,1已处理", name = "handleStatus")
private Integer handleStatus;
@io.swagger.annotations.ApiModelProperty(value="备注",name="remark")
private String remark;

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

@io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel")
private Integer isDel;

@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="查询-起始时间",name="startdate")
private Date startdate;

@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="enddate")
private Date enddate;

}

+ 13
- 0
mallinkService/src/main/java/com/iformall/mapper/TtUpSettleinMapper.java Просмотреть файл

@@ -0,0 +1,13 @@
package com.iformall.mapper;


import com.iformall.common.CommonMapper;
import com.iformall.domain.po.tt.TtUpSettlein;

import java.util.List;

public interface TtUpSettleinMapper extends CommonMapper<TtUpSettlein, Long> {

List<TtUpSettlein> findList(TtUpSettlein record);

}

+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/TtUserFollowMapper.java Просмотреть файл

@@ -7,7 +7,7 @@ import java.util.List;

public interface TtUserFollowMapper extends CommonMapper<TtUserFollow, Long> {

List<TtUserFollow> findList(TtUserFollow collect);
List<TtUserFollow> findList(TtUserFollow follow);
int deleteById(Long id);



+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxMerchantService.java Просмотреть файл

@@ -13,6 +13,7 @@ import com.iformall.domain.vo.WxMerchantTradeVo;
import com.iformall.domain.vo.WxMerchantVo;
import com.iformall.enums.EnumPayWay;

import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.ModelAttribute;

import javax.servlet.http.HttpServletRequest;


+ 2
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Просмотреть файл

@@ -18,12 +18,12 @@ import com.iformall.exception.MallinkException;
import com.iformall.mapper.*;
import com.iformall.service.*;
import com.iformall.utils.DateUtils;
import com.iformall.utils.EventUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
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 org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
@@ -940,4 +940,5 @@ public class WxMerchantServiceImpl implements WxMerchantService {
public List<Long> getMerchantShopIds(Long merchantId) {
return wxMerchantShopMapper.findShopIds(merchantId);
}

}

+ 10
- 0
mallinkService/src/main/java/com/iformall/service/tt/TtCouponService.java Просмотреть файл

@@ -48,4 +48,14 @@ public interface TtCouponService {

@Async
void collectCoupon(TenantEntity tenantEntity,Long memberId, Long id);
void cancelCollect(Long memberId, Long id);

@Async
void followMerchant(TenantEntity tenantEntity, Long memberId, Long id);
void cancelFollow(Long memberId, Long id);

ResultData auditPass(Long id);

ResultData auditRejected(Long id);

}

+ 76
- 4
mallinkService/src/main/java/com/iformall/service/tt/impl/TtCouponServiceImpl.java Просмотреть файл

@@ -11,11 +11,11 @@ import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.tt.TtCoupon;
import com.iformall.domain.po.tt.TtUserCollect;
import com.iformall.domain.po.tt.TtUserFollow;
import com.iformall.enums.EnumTtCouponStatus;
import com.iformall.enums.EnumTtCouponType;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.mapper.*;
import com.iformall.service.WxMerchantService;
import com.iformall.service.tt.TtCouponService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -38,11 +38,14 @@ public class TtCouponServiceImpl implements TtCouponService {
TtCouponMapper ttCouponMapper;

@Autowired
WxMerchantService wxMerchantService;
WxMerchantMapper wxMerchantMapper;

@Autowired
TtUserCollectMapper ttUserCollectMapper;

@Autowired
TtUserFollowMapper ttUserFollowMapper;


@Override
public PageInfo<TtCoupon> listAsPage(TtCoupon record, Integer pageIndex, Integer pageSize) {
@@ -129,10 +132,11 @@ public class TtCouponServiceImpl implements TtCouponService {
if(byId == null){
return byId;
}
// WxMerchant author = wxMerchantService.getById(byId.getMerchantId());
// WxMerchant author = wxMerchantMapper.selectById(byId.getMerchantId());
// byId.setMerchantName(author.getName());
// byId.setMerchantPic(author.getImgUrl());
// byId.setAuthor(wxMerchantService.getById(byId.getMerchantId()));

byId.setAuthor(wxMerchantMapper.selectById(byId.getMerchantId()));
if(byId.getType().equals(EnumTtCouponType.COUPON_COLUMN.getCode())){
TtCoupon couponQ = new TtCoupon();
couponQ.setColumnId(productId);
@@ -174,6 +178,7 @@ public class TtCouponServiceImpl implements TtCouponService {
}

@Override
// @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public void collectCoupon(TenantEntity tenantEntity,Long memberId, Long id) {
final IdWorker idWorker = IdWorker.get();
TtUserCollect userCollect = new TtUserCollect();
@@ -188,5 +193,72 @@ public class TtCouponServiceImpl implements TtCouponService {
} catch (Exception e) {
// e.printStackTrace();
}
ttCouponMapper.addCollectCount(id);
}

@Override
public void cancelCollect(Long memberId, Long id) {
TtUserCollect userCollect = new TtUserCollect();
userCollect.setUserId(memberId);
userCollect.setCouponId(id);
int delete = ttUserCollectMapper.delete(new QueryWrapper<>(userCollect));
if(delete > 0){
ttCouponMapper.reduceCollectCount(id);
}
}

@Override
public void followMerchant(TenantEntity tenantEntity, Long memberId, Long id) {
final IdWorker idWorker = IdWorker.get();
TtUserFollow userFollow = new TtUserFollow();
userFollow.setId(idWorker.nextId());
userFollow.updateTenantInfo(tenantEntity);
userFollow.setUserId(memberId);
userFollow.setMerchernId(id);
userFollow.setCreateDate(new Date());
userFollow.setUpdateDate(new Date());
try {
ttUserFollowMapper.insert(userFollow);
} catch (Exception e) {
// e.printStackTrace();
}
}

@Override
public void cancelFollow(Long memberId, Long id) {
TtUserFollow userFollow = new TtUserFollow();
userFollow.setUserId(memberId);
userFollow.setMerchernId(id);
int delete = ttUserFollowMapper.delete(new QueryWrapper<>(userFollow));
}

@Override
public ResultData auditPass(Long id) {
TtCoupon byId = this.getById(id);
if(byId == null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"未找到课程");
}
if(!byId.getStatus().equals(EnumTtCouponStatus.TTCOUPON_STATUS_EXAMINE.getCode())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"此课程状态不在审核中");
}
byId.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_BEFOR_SHELF.getCode());
byId.setUpdateDate(new Date());
ttCouponMapper.updateById(byId);
return new ResultData();
}

@Override
public ResultData auditRejected(Long id) {
TtCoupon byId = this.getById(id);
if(byId == null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"未找到课程");
}
if(!byId.getStatus().equals(EnumTtCouponStatus.TTCOUPON_STATUS_EXAMINE.getCode())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"此课程状态不在审核中");
}
byId.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_REJECT.getCode());
byId.setUpdateDate(new Date());
ttCouponMapper.updateById(byId);
return new ResultData();
}
}

+ 34
- 22
mallinkService/src/main/java/com/iformall/service/tt/impl/TtOrderServiceImpl.java Просмотреть файл

@@ -7,6 +7,7 @@ import com.iformall.common.IdWorker;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.tt.TtCUser;
import com.iformall.domain.po.tt.TtCoupon;
import com.iformall.domain.po.tt.TtOrder;
import com.iformall.douyin.pay.DouYinPayHelper;
@@ -16,6 +17,7 @@ import com.iformall.douyin.pay.preOrder.DouYinCreatePreOrder;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.*;
import com.iformall.service.TtCUserService;
import com.iformall.service.WxAppinfoService;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.tt.TtCouponService;
@@ -41,8 +43,11 @@ public class TtOrderServiceImpl implements TtOrderService {
@Autowired
private TtCouponService ttCouponService;

// @Autowired
// private WxCUserBasicInfoService wxCUserBasicInfoService;

@Autowired
private WxCUserBasicInfoService wxCUserBasicInfoService;
private TtCUserService ttCUserService;

@Autowired
private WxAppinfoService wxAppinfoService;
@@ -55,8 +60,10 @@ public class TtOrderServiceImpl implements TtOrderService {
@Override
public ResultData saveOrder(Long couponId,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity) {
logger.info("OrderSave: couponId:" + couponId + "---cUserId:"+cUserId);
WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUserId,tenantEntity.getFinalTenantId());
if(wxCUserBasicInfo == null){
TtCUser byId = ttCUserService.getById(cUserId, tenantEntity.getTenantId());
// WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUserId,tenantEntity.getFinalTenantId());
// if(wxCUserBasicInfo == null){
if(byId == null){
return new ResultData(ErrorCode.USER_IS_EMPTY);
}
TtOrder orderQ = new TtOrder();
@@ -71,10 +78,10 @@ public class TtOrderServiceImpl implements TtOrderService {
return new ResultData(ErrorCode.ORDER_IS_FIND);
}

if (wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) {
logger.info("会员权益被锁定:cUserId:" + cUserId);
return new ResultData(ErrorCode.MEMBER_IS_LOCKED);
}
// if (wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) {
// logger.info("会员权益被锁定:cUserId:" + cUserId);
// return new ResultData(ErrorCode.MEMBER_IS_LOCKED);
// }
TtCoupon coupon = ttCouponService.getById(couponId);
if (null == coupon) {
return new ResultData(ErrorCode.TTCOUPON_IS_EMPTY);
@@ -93,7 +100,7 @@ public class TtOrderServiceImpl implements TtOrderService {
TtOrder order = new TtOrder();
order.setId(idWorker.nextId());
order.updateTenantInfo(tenantEntity);
order.setCUserId(wxCUserBasicInfo.getId());
order.setCUserId(cUserId);
order.setProductId(coupon.getId());
order.setType(payWay.getCode());
order.setPaymentType(EnumPayType.PAY_PAYMENT.getCode());
@@ -176,14 +183,17 @@ public class TtOrderServiceImpl implements TtOrderService {
if(!order.getCUserId().equals(memberId)){
return new ResultData(ErrorCode.ORDER_USER_NOT_MATCH);
}
WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(memberId,tenantEntity.getFinalTenantId());
if ( null == wxCUserBasicInfo) {
logger.error("会员用户不存在."+memberId);
return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(),"会员用户不存在."+memberId);
}
if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) {
return new ResultData(ErrorCode.MEMBER_IS_LOCKED);
TtCUser byId = ttCUserService.getById(memberId, tenantEntity.getTenantId());
// WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(memberId,tenantEntity.getFinalTenantId());
// if ( null == wxCUserBasicInfo) {
if ( byId == null) {
logger.error("用户不存在."+memberId);
return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(),"用户不存在."+memberId);
}
// if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) {
// return new ResultData(ErrorCode.MEMBER_IS_LOCKED);
// }

// WxAppinfo appInfo = wxAppinfoService.getByAppId(appId);
if(appInfo == null) {
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
@@ -258,14 +268,16 @@ public class TtOrderServiceImpl implements TtOrderService {
if(!order.getCUserId().equals(memberId)){
return new ResultData(ErrorCode.ORDER_USER_NOT_MATCH);
}
WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(memberId,tenantEntity.getFinalTenantId());
if ( null == wxCUserBasicInfo) {
logger.error("会员用户不存在."+memberId);
return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(),"会员用户不存在."+memberId);
}
if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) {
return new ResultData(ErrorCode.MEMBER_IS_LOCKED);
TtCUser byId = ttCUserService.getById(memberId, tenantEntity.getTenantId());
// WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(memberId,tenantEntity.getFinalTenantId());
// if ( null == wxCUserBasicInfo) {
if ( byId == null) {
logger.error("用户不存在."+memberId);
return new ResultData(ErrorCode.USER_IS_EMPTY.getCode(),"用户不存在."+memberId);
}
// if (null != wxCUserBasicInfo && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) {
// return new ResultData(ErrorCode.MEMBER_IS_LOCKED);
// }
// WxAppinfo appInfo = wxAppinfoService.getByAppId(appId);
if(appInfo == null) {
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);


+ 4
- 9
mallinkService/src/main/resources/mapper/TtCUserMapper.xml Просмотреть файл

@@ -150,12 +150,11 @@
and `score` = #{score}
</if>

<if test=" null != updateDate ">
and `update_date` = #{updateDate}
<if test="startdate != null">
and `create_date` &gt;= #{startdate}
</if>

<if test=" null != createDate ">
and `create_date` = #{createDate}
<if test="enddate != null">
and `create_date` &lt;= #{enddate}
</if>

<if test=" null != appId ">
@@ -166,10 +165,6 @@
and `token` like concat('%', #{token},'%')
</if>

<if test=" null != expireTime ">
and `expire_time` = #{expireTime}
</if>

<if test=" null != latitude ">
and `latitude` = #{latitude}
</if>


+ 8
- 1
mallinkService/src/main/resources/mapper/TtCouponMapper.xml Просмотреть файл

@@ -57,7 +57,10 @@
</sql>

<sql id="dynamicWhereConditions">
where c.`is_del` = 0 and c.`type` != 3
where c.`is_del` = 0
<if test=" null == type or type != 3">
and c.`type` != 3
</if>

<if test=" null != id ">
and c.`id` = #{id}
@@ -74,6 +77,10 @@
and c.`type` = #{type}
</if>

<if test=" null != columnId ">
and c.`column_id` = #{columnId}
</if>

<if test=" null != title and ''!=title">
and c.`title` like concat('%', #{title},'%')
</if>


+ 4
- 4
mallinkService/src/main/resources/mapper/TtOrderMapper.xml Просмотреть файл

@@ -108,19 +108,19 @@
order by o.`update_date` desc
</sql>

<select id="findList" parameterType="com.iformall.domain.po.WxOrder" resultMap="BaseResultMap">
<select id="findList" parameterType="com.iformall.domain.po.tt.TtOrder" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_order o
from tt_order o
left join tt_c_user u on o.c_user_id = u.id
left join tt_coupon c on o.product_id = c.id
left join wx_merchant m on c.merchant_id = m.id
<include refid="dynamicWhereConditions"/>
</select>

<select id="findListCount" parameterType="com.iformall.domain.po.WxOrder" resultType="Integer">
<select id="findListCount" parameterType="com.iformall.domain.po.tt.TtOrder" resultType="Integer">
select count(1)
from wx_order
from tt_order
where 1 = 1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}


+ 90
- 0
mallinkService/src/main/resources/mapper/TtUpSettleinMapper.xml Просмотреть файл

@@ -0,0 +1,90 @@
<?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.TtUpSettleinMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.tt.TtUpSettlein">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="cuser_id" jdbcType="BIGINT" property="cuserId"/>
<result column="invitation_code" jdbcType="VARCHAR" property="invitationCode"/>
<result column="liaison_man" jdbcType="VARCHAR" property="liaisonMan"/>
<result column="liaison_phone" jdbcType="VARCHAR" property="liaisonPhone"/>
<result column="tt_user_name" jdbcType="VARCHAR" property="ttUserName"/>
<result column="tt_count_fans" jdbcType="VARCHAR" property="ttCountFans"/>
<result column="bussiness_types" jdbcType="VARCHAR" property="bussinessTypes"/>
<result column="explain" jdbcType="VARCHAR" property="explain"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="handle_status" jdbcType="INTEGER" property="handleStatus"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>

</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`cuser_id`,`invitation_code`,`liaison_man`,`liaison_phone`,
`tt_user_name`,`tt_count_fans`,`bussiness_types`,`explain`,
`remark`,`handle_status`,`create_date`,`update_date`
</sql>

<sql id="dynamicWhereConditions">
where `is_del` = 0

<if test=" null != id ">
and `id` = #{id}
</if>

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != cuserId ">
and `cuser_id` = #{cuserId}
</if>

<if test=" null != invitationCode and '' != invitationCode">
and `invitation_code` = #{invitationCode}
</if>

<if test=" null != liaisonMan ">
and `liaison_man` like concat('%', #{liaisonMan},'%')
</if>

<if test=" null != liaisonPhone ">
and `liaison_phone` like concat('%', #{liaisonPhone},'%')
</if>

<if test=" null != ttUserName ">
and `tt_user_name` like concat('%', #{ttUserName},'%')
</if>

<if test=" null != handleStatus ">
and `handle_status` = #{handleStatus}
</if>

<if test="startdate != null">
and `create_date` &gt;= #{startdate}
</if>
<if test="enddate != null">
and `create_date` &lt;= #{enddate}
</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.tt.TtUpSettlein" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from tt_up_settlein
<include refid="dynamicWhereConditions"/>
</select>

</mapper>

+ 28
- 4
mallinkTTAdmin/src/main/java/com/iformall/controller/tt/TtCouponController.java Просмотреть файл

@@ -124,7 +124,7 @@ public class TtCouponController extends BaseController {
VideUploadResult result = videoFactory.getExcutor(videoType).getVideoDetail(record.getVideoId());
if(result.isSuccess()){
record.setVideoTime(result.getDuration());
record.setVideoUrl(result.getVideoUrl());
// record.setVideoUrl(result.getVideoUrl());
TtVideoLibrary video = new TtVideoLibrary();
video.updateTenantInfo(tenantEntity);
video.setVideoId(record.getVideoId());
@@ -145,7 +145,7 @@ public class TtCouponController extends BaseController {
VideUploadResult result = videoFactory.getExcutor(videoType).getVideoDetail(ttc.getVideoId());
if(result.isSuccess()){
ttc.setVideoTime(result.getDuration());
ttc.setVideoUrl(result.getVideoUrl());
// ttc.setVideoUrl(result.getVideoUrl());
TtVideoLibrary video = new TtVideoLibrary();
video.updateTenantInfo(tenantEntity);
video.setVideoId(record.getVideoId());
@@ -281,10 +281,10 @@ public class TtCouponController extends BaseController {
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "")
public ResultData puton(@RequestParam Long id) {
logger.debug("[" + getIpAddr() + "] TtCouponController::findById");if (id == null) {
logger.debug("[" + getIpAddr() + "] TtCouponController::findById");
if (id == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}

return ttCouponService.puton(id);
}

@@ -300,4 +300,28 @@ public class TtCouponController extends BaseController {
return ttCouponService.putoff(id);
}

@ApiOperation("审批通过")
@GetMapping("/auditPass")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "")
public ResultData auditPass(@RequestParam Long id) {
logger.debug("[" + getIpAddr() + "] TtCouponController::auditPass");
if (id == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}
return ttCouponService.auditPass(id);
}

@ApiOperation("审批拒绝")
@PostMapping("/auditRejected")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "")
public ResultData auditRejected(@RequestBody TtCoupon record) {
logger.debug("[" + getIpAddr() + "] TtCouponController::auditRejected");
if (record.getId() == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}
return ttCouponService.auditRejected(record.getId());
}

}

+ 7
- 6
mallinkTTCApi/src/main/java/com/iformall/controller/BaseController.java Просмотреть файл

@@ -233,12 +233,13 @@ public class BaseController {
}

public Long getMemberId() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
Long memberId = (Long) request.getAttribute(Constant.LOGIN_MEMBER_KEY);
if(memberId == null){
throw new MallinkException(ErrorCode.USER_IS_NOT_MEMBER);
}
return memberId;
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// Long memberId = (Long) request.getAttribute(Constant.LOGIN_MEMBER_KEY);
// if(memberId == null){
// throw new MallinkException(ErrorCode.USER_IS_NOT_MEMBER);
// }
// return memberId;
return getTtCUser().getId();
}

public String getIpAddr() {


+ 70
- 4
mallinkTTCApi/src/main/java/com/iformall/controller/TtCouponController.java Просмотреть файл

@@ -2,8 +2,11 @@ package com.iformall.controller;

import com.iformall.common.ErrorCode;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.tt.TtCoupon;
import com.iformall.enums.EnumTtCouponStatus;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxMerchantService;
import com.iformall.service.tt.TtCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -15,7 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("ttCoupon")
@RequestMapping("api/ttCoupon")
@Api(description = "")
public class TtCouponController extends BaseController {

@@ -24,14 +27,18 @@ public class TtCouponController extends BaseController {
@Autowired
private TtCouponService ttCouponService;

@Autowired
private WxMerchantService wxMerchantService;

@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData list(@ModelAttribute TtCoupon record, Integer pageNum, Integer pageSize, Integer dataType) {
public ResultData list(@ModelAttribute TtCoupon record, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] TtCouponController::list");
if (record == null) record = new TtCoupon();
record.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_SHELFING.getCode());
return new ResultData(ttCouponService.listAsPage(record, pageNum, pageSize));
}

@@ -50,13 +57,13 @@ public class TtCouponController extends BaseController {
@GetMapping("/collectCoupon")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData collectCoupon(@RequestParam Long id) {
logger.debug("[" + getIpAddr() + "] TtCouponController::findById");
logger.debug("[" + getIpAddr() + "] TtCouponController::collectCoupon");
if (id == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}
TtCoupon byId = ttCouponService.getById(id);
if(byId == null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"找不到课程");
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"找不到数据");
}
Long memberId;
try {
@@ -68,4 +75,63 @@ public class TtCouponController extends BaseController {
return new ResultData();
}

@ApiOperation("取消收藏")
@GetMapping("/cancelCollect")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData cancelCollect(@RequestParam Long id) {
logger.debug("[" + getIpAddr() + "] TtCouponController::collectCoupon");
if (id == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}
Long memberId;
try {
memberId = getMemberId();
} catch (MallinkException e) {
return new ResultData(e.getErrorCode(), e.getMessage());
}
ttCouponService.cancelCollect(memberId,id);
return new ResultData();
}


@ApiOperation("关注")
@GetMapping("/followMerchant")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData followMerchant(@RequestParam Long id) {
logger.debug("[" + getIpAddr() + "] TtCouponController::followMerchant");
if (id == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}
WxMerchant byId = wxMerchantService.getById(id);
if(byId == null){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"找不到数据");
}
Long memberId;
try {
memberId = getMemberId();
} catch (MallinkException e) {
return new ResultData(e.getErrorCode(), e.getMessage());
}
ttCouponService.followMerchant(getTenantInfo(),memberId,byId.getId());
return new ResultData();
}

@ApiOperation("取消关注")
@GetMapping("/cancelFollow")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData cancelFollow(@RequestParam Long id) {
logger.debug("[" + getIpAddr() + "] TtCouponController::cancelFollow");
if (id == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}
Long memberId;
try {
memberId = getMemberId();
} catch (MallinkException e) {
return new ResultData(e.getErrorCode(), e.getMessage());
}
ttCouponService.cancelFollow(memberId,id);
return new ResultData();
}

}

+ 0
- 2
mallinkTTCApi/src/main/java/com/iformall/controller/TtOrderController.java Просмотреть файл

@@ -35,8 +35,6 @@ public class TtOrderController extends BaseController {
@Autowired
private WxAppinfoService wxAppinfoService;

@Autowired
private WxCUserBasicInfoService wxCUserBasicInfoService;

@ApiOperation("分页订单列表接口")
@GetMapping("list")


+ 31
- 0
mallinkTTCApi/src/main/java/com/iformall/controller/WxBusinessController.java Просмотреть файл

@@ -0,0 +1,31 @@
package com.iformall.controller;

import com.iformall.annotation.RedisCache;
import com.iformall.common.ResultData;
import com.iformall.service.WxBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/wxBusiness")
@Api(description = "业态查询接口")
public class WxBusinessController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxBusinessService wxBusinessService;

@RedisCache
@ApiOperation("业态全列表接口")
@GetMapping("listAll")
public ResultData listAll(Integer filter) {
return new ResultData(wxBusinessService.findListAll(getTenantInfo(),filter));
}

}

+ 74
- 0
mallinkTTCApi/src/main/java/com/iformall/controller/WxMerchantController.java Просмотреть файл

@@ -0,0 +1,74 @@
package com.iformall.controller;

import com.iformall.common.ErrorCode;
import com.iformall.common.ResultData;
import com.iformall.domain.dto.WxMerchantDto;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxMerchantVo;
import com.iformall.enums.EnumMerchantPublic;
import com.iformall.enums.EnumMerchantStatus;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxMerchantService;
import com.iformall.utils.HashUtil;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
* @author Stormeye
*/
@RestController
@RequestMapping("/api/merchant")
public class WxMerchantController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxMerchantService wxMerchantService;

@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData list(@ModelAttribute WxMerchantDto wxMerchantDto, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxMerchantController::list");
if (null == wxMerchantDto) wxMerchantDto = new WxMerchantDto();
wxMerchantDto.updateTenantInfo(getTenantInfo());
wxMerchantDto.setMerchantStatus(EnumMerchantStatus.VALID.getCode());
wxMerchantDto.setIsPublic(EnumMerchantPublic.PUBLIC.getCode());
return new ResultData(wxMerchantService.listAsPageCVo(wxMerchantDto, pageNum, pageSize));
}

@ApiOperation("根据code查询接口")
@GetMapping("/findByCode")
@ApiImplicitParam(name = "merchantCode", value = "merchantCode", dataType = "String", paramType = "query", required = true)
public ResultData findByCode(String merchantCode) {
logger.debug("[" + getIpAddr() + "] WxMerchantController::findByCode");
if(merchantCode == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
String codeMD5 = HashUtil.DecodeByMD5(merchantCode);
if(StringUtils.isBlank(codeMD5)) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
HashMap<String, String> params = new HashMap<String, String>();
TenantEntity tenantEntity = getTenantInfo();
params.put("tenantId", tenantEntity.getTenantId());
if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) {
params.put("parentTenantId", tenantEntity.getParentTenantId());
}
params.put("merchantCode", codeMD5);
WxMerchantVo wxMerchant = wxMerchantService.getMerchantInfo(params);
return new ResultData(wxMerchant);
}


}

Загрузка…
Отмена
Сохранить