Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init

This commit is contained in:
zhangchenbiao
2024-03-27 11:13:53 +08:00
23 changed files with 452 additions and 249 deletions

View File

@@ -0,0 +1,33 @@
package com.cool.store.enums;
public enum ExperienceStatusEnum {
DONE(0,"完成体验"),
ABANDON(1,"放弃体验"),
;
private Integer experienceStatus;
private String message;
ExperienceStatusEnum(Integer experienceStatus, String message) {
this.experienceStatus = experienceStatus;
this.message = message;
}
public Integer getExperienceStatus() {
return experienceStatus;
}
public void setExperienceStatus(Integer experienceStatus) {
this.experienceStatus = experienceStatus;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

View File

@@ -75,13 +75,6 @@ public class HyPartnerUserInfoDAO {
return hyPartnerUserInfoMapper.insertSelective(record);
}
public int updateJoinKnowById(Integer isWritePartnerKnow, Long id){
if (id == null || isWritePartnerKnow == null){
return 0;
}
return hyPartnerUserInfoMapper.updateJoinKnowById(isWritePartnerKnow, id);
}
public int updateByPartnerId(HyPartnerUserInfoDO record){
if(StringUtils.isBlank(record.getPartnerId())){
return 0;

View File

@@ -38,7 +38,6 @@ public interface HyPartnerUserInfoMapper {
HyPartnerUserInfoDO selectByOpenid(@Param("openid") String openid);
/**
* 根据partnerIDs批量查询用户信息
* @param partnerIdList
@@ -46,10 +45,6 @@ public interface HyPartnerUserInfoMapper {
*/
List<HyPartnerUserInfoDO> selectByPartnerIds(@Param("partnerIdList") List<String> partnerIdList);
int updateJoinKnowById(@Param("isWritePartnerKnow")Integer isWritePartnerKnow, @Param("id")Long id);
int selectByHourDateCount(@Param("selectTime") String hourDayDate, @Param("now") String now);
int updateByPartnerId(@Param("record") HyPartnerUserInfoDO record);
String selectLastCrmCreateTime();

View File

@@ -9,4 +9,7 @@ import org.apache.ibatis.annotations.Param;
public interface IntentAgreementMapper {
boolean insert(@Param("request") SigningBaseInfoDO request);
SigningBaseInfoDO selectByPartnerIdOrLineId(@Param("partnerId") String partnerId,
@Param("lineId") Long lineId);
}

View File

@@ -6,4 +6,6 @@ import tk.mybatis.mapper.common.Mapper;
public interface LineInfoMapper extends Mapper<LineInfoDO> {
LineInfoDO getByPartnerId(@Param("partnerId") String partnerId);
LineInfoDO getByLineId(@Param("lineId") Long lineId);
}

View File

@@ -0,0 +1,17 @@
package com.cool.store.mapper;
import com.cool.store.entity.LeaseBaseInfoDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import javax.websocket.server.PathParam;
@Mapper
public interface TrainingExperienceMapper {
void insert(@Param("entity") LeaseBaseInfoDO toLeaseBaseInfoDO);
void updateStatus(@Param("lineId") Long lineId,
@Param("status") Integer status,
@Param("abandonCause") String abandonCause);
}

View File

@@ -5,28 +5,14 @@
<id column="id" jdbcType="BIGINT" property="id" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="live_area" jdbcType="VARCHAR" property="liveArea" />
<result column="want_shop_area" jdbcType="VARCHAR" property="wantShopArea" />
<result column="accept_adjust_type" jdbcType="TINYINT" property="acceptAdjustType" />
<result column="invite_code" jdbcType="VARCHAR" property="inviteCode" />
<result column="is_write_partner_know" jdbcType="TINYINT" property="isWritePartnerKnow" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="shop_code" jdbcType="VARCHAR" property="shopCode" />
<result column="shop_name" jdbcType="VARCHAR" property="shopName" />
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
<result column="recommend_partner_id" jdbcType="VARCHAR" property="recommendPartnerId" />
<result column="recommend_partner_name" jdbcType="VARCHAR" property="recommendPartnerName" />
<result column="recommend_partner_mobile" jdbcType="VARCHAR" property="recommendPartnerMobile" />
<result column="user_channel_id" jdbcType="BIGINT" property="userChannelId" />
<result column="crm_create_time" jdbcType="TIMESTAMP" property="crmCreateTime" />
<result column="openid" jdbcType="VARCHAR" property="openid" />
</resultMap>
<sql id="Base_Column_List">
id, partner_id, mobile, username, live_area, want_shop_area, accept_adjust_type,
invite_code, is_write_partner_know, create_time, update_time, shop_code, shop_name, shop_id,
recommend_partner_id, recommend_partner_name, recommend_partner_mobile,user_channel_id,openid
id, partner_id, mobile, create_time, update_time, user_channel_id, crm_create_time, openid
</sql>
<select id="selectByPartnerId" resultMap="BaseResultMap" >
select
@@ -62,31 +48,6 @@
</where>
</select>
<select id="selectByHourDateCount" resultType="java.lang.Integer">
SELECT
count(*)
FROM
hy_partner_line_info a
LEFT JOIN xfsg_partner_user_info b ON a.partner_id = b.partner_id
AND a.deleted = 0
LEFT JOIN hy_partner_user_channel c ON b.user_channel_id = c.channel_id
LEFT JOIN enterprise_user d ON a.investment_manager = d.user_id
AND d.deleted = 0
LEFT JOIN (
SELECT
partner_id,
IFNULL( COUNT( 1 ), 0 ) AS followCount
FROM
hy_partner_line_info
WHERE
( deleted = 1 OR ( deleted = 0 AND line_status IN ( 0, 3 ) AND close_time IS NOT NULL ) )
AND investment_manager IS NOT NULL
GROUP BY
partner_id
) tl_l ON b.partner_id = tl_l.partner_id
WHERE (b.update_time BETWEEN #{selectTime} and #{now} or
a.update_time BETWEEN #{selectTime} and #{now} ) and b.partner_id is not null
</select>
<select id="selectLastCrmCreateTime" resultType="java.lang.String">
SELECT crm_create_time as crmCreateTime FROM xfsg_partner_user_info ORDER BY crm_create_time desc limit 1
</select>
@@ -100,48 +61,12 @@
<if test="record.mobile != null">
mobile,
</if>
<if test="record.username != null">
username,
</if>
<if test="record.liveArea != null">
live_area,
</if>
<if test="record.wantShopArea != null">
want_shop_area,
</if>
<if test="record.acceptAdjustType != null">
accept_adjust_type,
</if>
<if test="record.inviteCode != null">
invite_code,
</if>
<if test="record.isWritePartnerKnow != null">
is_write_partner_know,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.shopCode != null">
shop_code,
</if>
<if test="record.shopName != null">
shop_name,
</if>
<if test="record.shopId != null">
shop_id,
</if>
<if test="record.recommendPartnerId != null">
recommend_partner_id,
</if>
<if test="record.recommendPartnerName != null">
recommend_partner_name,
</if>
<if test="record.recommendPartnerMobile != null">
recommend_partner_mobile,
</if>
<if test="record.userChannelId!=null">
user_channel_id,
</if>
@@ -162,48 +87,12 @@
<if test="record.mobile != null">
#{record.mobile},
</if>
<if test="record.username != null">
#{record.username},
</if>
<if test="record.liveArea != null">
#{record.liveArea},
</if>
<if test="record.wantShopArea != null">
#{record.wantShopArea},
</if>
<if test="record.acceptAdjustType != null">
#{record.acceptAdjustType},
</if>
<if test="record.inviteCode != null">
#{record.inviteCode},
</if>
<if test="record.isWritePartnerKnow != null">
#{record.isWritePartnerKnow},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.shopCode != null">
#{record.shopCode},
</if>
<if test="record.shopName != null">
#{record.shopName},
</if>
<if test="record.shopId != null">
#{record.shopId},
</if>
<if test="record.recommendPartnerId != null">
#{record.recommendPartnerId},
</if>
<if test="record.recommendPartnerName != null">
#{record.recommendPartnerName},
</if>
<if test="record.recommendPartnerMobile != null">
#{record.recommendPartnerMobile},
</if>
<if test="record.userChannelId != null">
#{record.userChannelId},
</if>
@@ -218,6 +107,7 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update xfsg_partner_user_info
<set>
@@ -227,48 +117,12 @@
<if test="record.mobile != null">
mobile = #{record.mobile},
</if>
<if test="record.username != null">
username = #{record.username},
</if>
<if test="record.liveArea != null">
live_area = #{record.liveArea},
</if>
<if test="record.wantShopArea != null">
want_shop_area = #{record.wantShopArea},
</if>
<if test="record.acceptAdjustType != null">
accept_adjust_type = #{record.acceptAdjustType},
</if>
<if test="record.inviteCode != null">
invite_code = #{record.inviteCode},
</if>
<if test="record.isWritePartnerKnow != null">
is_write_partner_know = #{record.isWritePartnerKnow},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.shopCode != null">
shop_code = #{record.shopCode},
</if>
<if test="record.shopName != null">
shop_name = #{record.shopName},
</if>
<if test="record.shopId != null">
shop_id = #{record.shopId},
</if>
<if test="record.recommendPartnerId != null">
recommend_partner_id = #{record.recommendPartnerId},
</if>
<if test="record.recommendPartnerName != null">
recommend_partner_name = #{record.recommendPartnerName},
</if>
<if test="record.recommendPartnerMobile != null">
recommend_partner_mobile = #{record.recommendPartnerMobile},
</if>
<if test="record.ecWantShopArea != null">
ec_want_shop_area = #{record.ecWantShopArea},
</if>
@@ -279,60 +133,18 @@
where id = #{record.id}
</update>
<update id="updateJoinKnowById">
update xfsg_partner_user_info
set `is_write_partner_know`=#{isWritePartnerKnow,jdbcType=INTEGER}
where id=#{id,jdbcType=BIGINT}
</update>
<update id="updateByPartnerId">
update xfsg_partner_user_info
<set>
<if test="record.mobile != null">
mobile = #{record.mobile},
</if>
<if test="record.username != null">
username = #{record.username},
</if>
<if test="record.liveArea != null">
live_area = #{record.liveArea},
</if>
<if test="record.wantShopArea != null">
want_shop_area = #{record.wantShopArea},
</if>
<if test="record.acceptAdjustType != null">
accept_adjust_type = #{record.acceptAdjustType},
</if>
<if test="record.inviteCode != null">
invite_code = #{record.inviteCode},
</if>
<if test="record.isWritePartnerKnow != null">
is_write_partner_know = #{record.isWritePartnerKnow},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.shopCode != null">
shop_code = #{record.shopCode},
</if>
<if test="record.shopName != null">
shop_name = #{record.shopName},
</if>
<if test="record.shopId != null">
shop_id = #{record.shopId},
</if>
<if test="record.recommendPartnerId != null">
recommend_partner_id = #{record.recommendPartnerId},
</if>
<if test="record.recommendPartnerName != null">
recommend_partner_name = #{record.recommendPartnerName},
</if>
<if test="record.recommendPartnerMobile != null">
recommend_partner_mobile = #{record.recommendPartnerMobile},
</if>
</set>
where partner_id = #{record.partnerId}
</update>

View File

@@ -3,7 +3,8 @@
<mapper namespace="com.cool.store.mapper.IntentAgreementMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.SigningBaseInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="partner_base_info_id" jdbcType="VARCHAR" property="partnerBaseInfoId" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="sign_name" jdbcType="VARCHAR" property="signName" />
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
<result column="sex" jdbcType="TINYINT" property="sex" />
@@ -22,7 +23,8 @@
</resultMap>
<sql id="Base_Column_List">
id,
partner_base_info_id,
partner_id,
line_id,
sign_name
mobile,
sex,
@@ -74,6 +76,20 @@
<if test="request.businessLicenseAddress != null">#{request.businessLicenseAddress},</if>
</trim>
</insert>
<select id="selectByPartnerIdOrLineId" resultType="com.cool.store.entity.SigningBaseInfoDO">
select
<include refid="Base_Column_List"/>
from xfsg_signing_base_info
<where>
deleted = 0
<if test="partnerId != null and partnerId != ''">
and partner_id = #{partnerId}
</if>
<if test="lineId != null">
and line_id = #{lineId}
</if>
</where>
</select>
</mapper>

View File

@@ -48,7 +48,7 @@
<if test="request.areaCode != null">area_code,</if>
<if test="request.liveArea != null">live_area,</if>
<if test="request.liveAddress != null">live_address,</if>
<if test="request.joiningQuestionnaire != null">joining_questionnaire,</if>
<if test="request.joiningQuestionnaire != null">joining_questionnaire,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="request.lineId != null">#{request.lineId},</if>

View File

@@ -34,5 +34,8 @@
<select id="getByPartnerId" resultMap="BaseResultMap">
select * from xfsg_line_info where partner_id = #{partnerId} and deleted = 0
</select>
<select id="getByLineId" resultType="com.cool.store.entity.LineInfoDO">
select * from xfsg_line_info where id = #{lineId} and deleted = 0
</select>
</mapper>

View File

@@ -0,0 +1,65 @@
<?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.cool.store.mapper.TrainingExperienceMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.LeaseBaseInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
<result column="store_name" jdbcType="VARCHAR" property="storeName"/>
<result column="store_id" jdbcType="VARCHAR" property="storeId"/>
<result column="experience_start_time" jdbcType="TIMESTAMP" property="experienceStartTime"/>
<result column="experience_end_time" jdbcType="TIMESTAMP" property="experienceEndTime"/>
<result column="experience_status" jdbcType="TINYINT" property="experienceStatus"/>
<result column="abandon_cause" jdbcType="VARCHAR" property="abandonCause"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="deleted" jdbcType="TINYINT" property="deleted"/>
</resultMap>
<sql id="Base_Column_List">
id,
partner_id,
line_id,
store_name,
store_id,
experience_start_time,
experience_end_time,
experience_status,
abandon_cause,
create_time,
update_time,
deleted
</sql>
<insert id="insert">
insert into xfsg_lease_base_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="entity.partnerId != null">partner_id,</if>
<if test="entity.lineId != null">line_id,</if>
<if test="entity.storeName != null">store_name,</if>
<if test="entity.storeId != null">store_id,</if>
<if test="entity.experienceStartTime != null">experience_start_time,</if>
<if test="entity.experienceEndTime != null">experience_end_time,</if>
<if test="entity.experienceStatus != null">experience_status,</if>
<if test="entity.abandonCause != null">abandon_cause,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="entity.partnerId != null">#{request.partnerId},</if>
<if test="entity.lineId != null">#{request.lineId},</if>
<if test="entity.storeName != null">#{request.storeName},</if>
<if test="entity.storeId != null">#{request.storeId},</if>
<if test="entity.experienceStartTime != null">#{request.experienceStartTime},</if>
<if test="entity.experienceEndTime != null">#{request.experienceEndTime},</if>
<if test="entity.experienceStatus != null">#{request.experienceStatus},</if>
<if test="entity.abandonCause != null">#{request.abandonCause},</if>
</trim>
</insert>
<update id="updateStatus">
update
xfsg_lease_base_info
set
experience_status = #{status},
abandon_cause=#{abandonCause}
where line_id = #{lineId}
</update>
</mapper>

View File

@@ -30,23 +30,6 @@ public class HyPartnerUserInfoDO implements Serializable {
@ApiModelProperty("手机号")
private String mobile;
@ApiModelProperty("申请人姓名")
private String username;
@ApiModelProperty("常驻区域")
private String liveArea;
@ApiModelProperty("意向开店区域")
private String wantShopArea;
@ApiModelProperty("0不接受调剂、1全国调剂、2省内调剂、3市内调剂")
private Integer acceptAdjustType;
@ApiModelProperty("邀请码")
private String inviteCode;
@ApiModelProperty("是否填写加盟需知")
private Integer isWritePartnerKnow;
@ApiModelProperty("创建时间")
private Date createTime;
@@ -54,28 +37,9 @@ public class HyPartnerUserInfoDO implements Serializable {
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("店铺编码")
private String shopCode;
@ApiModelProperty("店铺名称")
private String shopName;
@ApiModelProperty("店铺ID")
private String shopId;
@ApiModelProperty("推荐加盟商id")
private String recommendPartnerId;
@ApiModelProperty("推荐加盟商姓名")
private String recommendPartnerName;
@ApiModelProperty("推荐加盟商手机号")
private String recommendPartnerMobile;
@ApiModelProperty("hy_partner_user_channel.channel_id")
private Integer userChannelId;
@ApiModelProperty("ec意向区域")
private String ecWantShopArea;

View File

@@ -0,0 +1,34 @@
package com.cool.store.entity;
import lombok.Data;
import java.util.Date;
@Data
public class LeaseBaseInfoDO {
private Long id;
private String partnerId;
private Long lineId;
private String storeName;
private String storeId;
private Date experienceStartTime;
private Date experienceEndTime;
private Integer experienceStatus;
private String abandonCause;
private Date createTime;
private Date updateTime;
private Integer deleted;
}

View File

@@ -10,8 +10,9 @@ import javax.validation.constraints.NotBlank;
@ApiModel("加盟意向Request")
public class JoinIntentionRequest {
private Long id;
@ApiModelProperty("线索信息表-线索id")
@NotBlank(message = "线索id不能为空")
private Long lineId;
@ApiModelProperty("用户信息表partnerId")

View File

@@ -0,0 +1,37 @@
package com.cool.store.request;
import com.cool.store.entity.LeaseBaseInfoDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.Date;
@Data
public class TrainingExperienceDistributionRequest {
@ApiModelProperty("线索信息表-线索id")
private Long lineId;
@ApiModelProperty("用户信息表partnerId")
private String partnerId;
@ApiModelProperty("体验门店id")
private String storeId;
@ApiModelProperty("门店名")
private String storeName;
@ApiModelProperty("开始体验时间")
private Date experienceStartTime;
@ApiModelProperty("结束体验时间")
private Date experienceEndTime;
public LeaseBaseInfoDO toLeaseBaseInfoDO() {
LeaseBaseInfoDO leaseBaseInfoDO = new LeaseBaseInfoDO();
leaseBaseInfoDO.setLineId(this.lineId);
leaseBaseInfoDO.setStoreName(this.storeName);
leaseBaseInfoDO.setStoreId(this.storeId);
leaseBaseInfoDO.setExperienceStartTime(this.experienceStartTime);
leaseBaseInfoDO.setExperienceEndTime(this.experienceEndTime);
leaseBaseInfoDO.setPartnerId(this.partnerId);
return leaseBaseInfoDO;
}
}

View File

@@ -0,0 +1,71 @@
package com.cool.store.response;
import com.cool.store.entity.SigningBaseInfoDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class SigningBaseInfoResponse {
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("加盟商id")
private String partnerId;
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("签名")
private String signName;
@ApiModelProperty("手机号")
private String mobile;
@ApiModelProperty("性别 1男 2女")
private Integer sex;
@ApiModelProperty("身份证正面url")
private String idCardFront;
@ApiModelProperty("身份证反面url")
private String idCardReverse;
@ApiModelProperty("身份证号")
private String idCardNo;
@ApiModelProperty("身份证地址")
private String idCardAddress;
@ApiModelProperty("当前地址")
private String currentResidence;
@ApiModelProperty("地址详情")
private String addressDetail;
@ApiModelProperty("证照url")
private String businessLicense;
@ApiModelProperty("证照码")
private String businessLicenseCode;
@ApiModelProperty("证照地址")
private String businessLicenseAddress;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
public static SigningBaseInfoResponse from(SigningBaseInfoDO signingBaseInfoDO) {
if (signingBaseInfoDO == null) {
return null;
}
SigningBaseInfoResponse signingBaseInfoResponse = new SigningBaseInfoResponse();
signingBaseInfoResponse.setId(signingBaseInfoDO.getId());
signingBaseInfoResponse.setPartnerId(signingBaseInfoDO.getPartnerId());
signingBaseInfoResponse.setLineId(signingBaseInfoDO.getLineId());
signingBaseInfoResponse.setSignName(signingBaseInfoDO.getSignName());
signingBaseInfoResponse.setMobile(signingBaseInfoDO.getMobile());
signingBaseInfoResponse.setSex(signingBaseInfoDO.getSex());
signingBaseInfoResponse.setIdCardFront(signingBaseInfoDO.getIdCardFront());
signingBaseInfoResponse.setIdCardReverse(signingBaseInfoDO.getIdCardReverse());
signingBaseInfoResponse.setIdCardNo(signingBaseInfoDO.getIdCardNo());
signingBaseInfoResponse.setIdCardAddress(signingBaseInfoDO.getIdCardAddress());
signingBaseInfoResponse.setCurrentResidence(signingBaseInfoDO.getCurrentResidence());
signingBaseInfoResponse.setAddressDetail(signingBaseInfoDO.getAddressDetail());
signingBaseInfoResponse.setBusinessLicense(signingBaseInfoDO.getBusinessLicense());
signingBaseInfoResponse.setBusinessLicenseCode(signingBaseInfoDO.getBusinessLicenseCode());
signingBaseInfoResponse.setBusinessLicenseAddress(signingBaseInfoDO.getBusinessLicenseAddress());
signingBaseInfoResponse.setCreateTime(signingBaseInfoDO.getCreateTime());
signingBaseInfoResponse.setUpdateTime(signingBaseInfoDO.getUpdateTime());
return signingBaseInfoResponse;
}
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service;
import com.cool.store.request.IntentAgreementSubmitRequest;
import com.cool.store.response.SigningBaseInfoResponse;
public interface IntentAgreementService {
/**
@@ -10,4 +11,11 @@ public interface IntentAgreementService {
*/
boolean submit(IntentAgreementSubmitRequest request);
/**
* 根据线索id或者加盟商id查询意向协议信息
* @param partnerId
* @param lineId
* @return
*/
SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId);
}

View File

@@ -0,0 +1,21 @@
package com.cool.store.service;
import com.cool.store.request.TrainingExperienceDistributionRequest;
public interface TrainingExperienceService {
/**
* 实训分配
* @param request
* @return
*/
boolean distribution(TrainingExperienceDistributionRequest request);
/**
* 实训状态变更
* @param lineId
* @param status
* @param abandonCause
*/
void experienceStatusChange(Long lineId, Integer status, String abandonCause);
}

View File

@@ -8,13 +8,19 @@ import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.IntentAgreementSubmitRequest;
import com.cool.store.response.SigningBaseInfoResponse;
import com.cool.store.service.IntentAgreementService;
import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Objects;
import static com.cool.store.enums.ErrorCodeEnum.PARAMS_VALIDATE_ERROR;
@Service
@Slf4j
public class IntentAgreementServiceImpl implements IntentAgreementService {
@@ -28,6 +34,7 @@ public class IntentAgreementServiceImpl implements IntentAgreementService {
@Override
@Transactional(rollbackFor = Exception.class)
public boolean submit(IntentAgreementSubmitRequest request) {
SigningBaseInfoDO signingBaseInfoDO = request.toSigningBaseInfoDO();
boolean submitStatus = intentAgreementMapper.insert(signingBaseInfoDO);
@@ -43,4 +50,18 @@ public class IntentAgreementServiceImpl implements IntentAgreementService {
}
return false;
}
@Override
public SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId) {
if (StringUtil.isBlank(partnerId) && lineId == null){
throw new ServiceException(PARAMS_VALIDATE_ERROR);
}
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(partnerId, lineId);
if (Objects.isNull(signingBaseInfoDO)){
log.info("getMiniIntentAgreement signingBaseInfoDO IS NULL......");
return null;
}
SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO);
return response;
}
}

View File

@@ -0,0 +1,59 @@
package com.cool.store.service.impl;
import com.cool.store.entity.LeaseBaseInfoDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.ExperienceStatusEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.mapper.TrainingExperienceMapper;
import com.cool.store.request.TrainingExperienceDistributionRequest;
import com.cool.store.service.TrainingExperienceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.annotation.Tainted;
import java.util.Objects;
import static com.cool.store.enums.ErrorCodeEnum.INTERVIEW_LINE_ID_IS_NULL;
@Service
@Slf4j
public class TrainingExperienceServiceImpl implements TrainingExperienceService {
@Resource
TrainingExperienceMapper trainingExperienceMapper;
@Resource
LineInfoMapper lineInfoMapper;
@Override
public boolean distribution(TrainingExperienceDistributionRequest request) {
if (Objects.isNull(request)) {
return Boolean.FALSE;
}
if (Objects.isNull(request.getLineId())) {
throw new ServiceException(INTERVIEW_LINE_ID_IS_NULL);
}
trainingExperienceMapper.insert(request.toLeaseBaseInfoDO());
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void experienceStatusChange(Long lineId, Integer status, String abandonCause) {
trainingExperienceMapper.updateStatus(lineId,status,abandonCause);
if (ExperienceStatusEnum.DONE.getExperienceStatus().equals(status)){
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(lineId);
if (Objects.isNull(lineInfoDO)){
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
}
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_100.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
}
}
}

View File

@@ -102,7 +102,6 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
hyPartnerUserInfoDO.setMobile(phoneInfoDTO.getPhoneInfo().getPhoneNumber());
hyPartnerUserInfoDO.setOpenid(openid);
hyPartnerUserInfoDO.setPartnerId(UUIDUtils.get32UUID());
hyPartnerUserInfoDO.setIsWritePartnerKnow(0);
Integer channelId = null;
String userChannel = param.getUserChannelEnum();
if(StringUtils.isNotEmpty(userChannel)){
@@ -211,10 +210,10 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByOpenid(openId);
if(hyPartnerUserInfoDO != null){
BeanUtil.copyProperties(hyPartnerUserInfoDO, userInfoVO);
if(StringUtils.isNotBlank(hyPartnerUserInfoDO.getWantShopArea())){
/*if(StringUtils.isNotBlank(hyPartnerUserInfoDO.getWantShopArea())){
HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(Long.valueOf(hyPartnerUserInfoDO.getWantShopArea()));
userInfoVO.setWantShopAreaName(hyOpenAreaInfoDO.getAreaPath().replace("/", " ").trim());
}
}*/
fillLineInfo(userInfoVO, hyPartnerUserInfoDO.getPartnerId());
}
return userInfoVO;

View File

@@ -0,0 +1,42 @@
package com.cool.store.controller.webb;
import com.cool.store.enums.ExperienceStatusEnum;
import com.cool.store.request.TrainingExperienceDistributionRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.TrainingExperienceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.websocket.server.PathParam;
@RestController
@RequestMapping("/pc/training/experience/")
@Api(tags = "PC端-实训体验")
@Slf4j
public class TrainingExperienceController {
@Resource
TrainingExperienceService trainingExperienceService;
@ApiOperation("实训体验分配")
@PostMapping("/distribution")
public ResponseResult<Boolean> distribution(@RequestBody TrainingExperienceDistributionRequest request) {
return ResponseResult.success(trainingExperienceService.distribution(request));
}
@ApiOperation("实训体验状态变更")
@GetMapping("/experience/{status}")
public ResponseResult experienceStatusChange(@ApiParam(value = "实训体验状态 DONE:完成 ABANDON:放弃") @PathVariable(value = "status") ExperienceStatusEnum statusEnum,
@ApiParam(value = "线索id")@RequestParam(value = "lineId") Long lineId,
@ApiParam(value = "放弃原因状态为ABANDON才填写")@RequestParam(value = "abandonCause",required = false)String abandonCause) {
trainingExperienceService.experienceStatusChange(lineId,statusEnum.getExperienceStatus(),abandonCause);
return ResponseResult.success();
}
}

View File

@@ -3,14 +3,12 @@ package com.cool.store.controller.webc;
import com.cool.store.request.IntentAgreementSubmitRequest;
import com.cool.store.request.JoinIntentionRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.SigningBaseInfoResponse;
import com.cool.store.service.IntentAgreementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -29,4 +27,13 @@ public class MiniIntentAgreementController {
boolean resp = intentAgreementService.submit(request);
return ResponseResult.success(resp);
}
@PostMapping(path = "/get")
@ApiOperation("查询意向协议信息")
public ResponseResult<SigningBaseInfoResponse> getMiniIntentAgreement(
@RequestParam(value = "partnerId",required = false) String partnerId,
@RequestParam(value = "lineId",required = false) Long lineId) {
SigningBaseInfoResponse resp = intentAgreementService.getMiniIntentAgreement(partnerId,lineId);
return ResponseResult.success(resp);
}
}