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

This commit is contained in:
苏竹红
2024-03-27 18:07:53 +08:00
16 changed files with 181 additions and 28 deletions

View File

@@ -0,0 +1,33 @@
package com.cool.store.enums;
public enum JoinTypeEnum {
JOIN_TYPE_ONE(1,"个人加盟"),
JOIN_TYPE_TWO(2,"企业加盟"),
;
private Integer code;
private String typeName;
JoinTypeEnum(Integer code, String typeName) {
this.code = code;
this.typeName = typeName;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
}

View File

@@ -14,4 +14,6 @@ public interface TrainingExperienceMapper {
void updateStatus(@Param("lineId") Long lineId, void updateStatus(@Param("lineId") Long lineId,
@Param("status") Integer status, @Param("status") Integer status,
@Param("abandonCause") String abandonCause); @Param("abandonCause") String abandonCause);
LeaseBaseInfoDO selectByLineId(@Param("lineId") Long lineId);
} }

View File

@@ -42,14 +42,14 @@
<if test="entity.abandonCause != null">abandon_cause,</if> <if test="entity.abandonCause != null">abandon_cause,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="entity.partnerId != null">#{request.partnerId},</if> <if test="entity.partnerId != null">#{entity.partnerId},</if>
<if test="entity.lineId != null">#{request.lineId},</if> <if test="entity.lineId != null">#{entity.lineId},</if>
<if test="entity.storeName != null">#{request.storeName},</if> <if test="entity.storeName != null">#{entity.storeName},</if>
<if test="entity.storeId != null">#{request.storeId},</if> <if test="entity.storeId != null">#{entity.storeId},</if>
<if test="entity.experienceStartTime != null">#{request.experienceStartTime},</if> <if test="entity.experienceStartTime != null">#{entity.experienceStartTime},</if>
<if test="entity.experienceEndTime != null">#{request.experienceEndTime},</if> <if test="entity.experienceEndTime != null">#{entity.experienceEndTime},</if>
<if test="entity.experienceStatus != null">#{request.experienceStatus},</if> <if test="entity.experienceStatus != null">#{entity.experienceStatus},</if>
<if test="entity.abandonCause != null">#{request.abandonCause},</if> <if test="entity.abandonCause != null">#{entity.abandonCause},</if>
</trim> </trim>
</insert> </insert>
<update id="updateStatus"> <update id="updateStatus">
@@ -60,6 +60,12 @@
abandon_cause=#{abandonCause} abandon_cause=#{abandonCause}
where line_id = #{lineId} where line_id = #{lineId}
</update> </update>
<select id="selectByLineId" resultType="com.cool.store.entity.LeaseBaseInfoDO">
select
<include refid="Base_Column_List"/>
from xfsg_lease_base_info
where line_id = #{lineId}
</select>
</mapper> </mapper>

View File

@@ -1,5 +1,6 @@
package com.cool.store.entity; package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@@ -19,9 +20,9 @@ public class LeaseBaseInfoDO {
private Date experienceStartTime; private Date experienceStartTime;
private Date experienceEndTime; private Date experienceEndTime;
@ApiModelProperty("体验状态 0完成 1放弃")
private Integer experienceStatus; private Integer experienceStatus;
@ApiModelProperty("放弃原因")
private String abandonCause; private String abandonCause;
private Date createTime; private Date createTime;

View File

@@ -2,6 +2,7 @@ package com.cool.store.response;
import com.cool.store.entity.SigningBaseInfoDO; import com.cool.store.entity.SigningBaseInfoDO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@@ -43,6 +44,9 @@ public class SigningBaseInfoResponse {
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
private Date updateTime; private Date updateTime;
@ApiModelProperty("加盟身份 1个人加盟 2企业加盟")
private Integer type;
public static SigningBaseInfoResponse from(SigningBaseInfoDO signingBaseInfoDO) { public static SigningBaseInfoResponse from(SigningBaseInfoDO signingBaseInfoDO) {
if (signingBaseInfoDO == null) { if (signingBaseInfoDO == null) {

View File

@@ -25,6 +25,8 @@ public class PartnerBaseInfoVO {
private String mobile; private String mobile;
@ApiModelProperty("1男 2女") @ApiModelProperty("1男 2女")
private Integer sex; private Integer sex;
@ApiModelProperty("意向加盟区域")
private String area;
@ApiModelProperty("意向区域编码") @ApiModelProperty("意向区域编码")
private String areaCode; private String areaCode;
@ApiModelProperty("常驻区域详细地址(居住地址)") @ApiModelProperty("常驻区域详细地址(居住地址)")

View File

@@ -1,5 +1,6 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.entity.LeaseBaseInfoDO;
import com.cool.store.request.TrainingExperienceDistributionRequest; import com.cool.store.request.TrainingExperienceDistributionRequest;
public interface TrainingExperienceService { public interface TrainingExperienceService {
@@ -18,4 +19,5 @@ public interface TrainingExperienceService {
*/ */
void experienceStatusChange(Long lineId, Integer status, String abandonCause); void experienceStatusChange(Long lineId, Integer status, String abandonCause);
LeaseBaseInfoDO getTrainingExperience(Long lineId);
} }

View File

@@ -1,11 +1,14 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.cool.store.entity.LineInfoDO; import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.MemberQuestionDO;
import com.cool.store.entity.SigningBaseInfoDO; import com.cool.store.entity.SigningBaseInfoDO;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.JoinTypeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum; import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.IntentAgreementMapper; import com.cool.store.mapper.IntentAgreementMapper;
import com.cool.store.mapper.JoinIntentionMapper;
import com.cool.store.mapper.LineInfoMapper; import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.IntentAgreementSubmitRequest; import com.cool.store.request.IntentAgreementSubmitRequest;
import com.cool.store.response.SigningBaseInfoResponse; import com.cool.store.response.SigningBaseInfoResponse;
@@ -32,6 +35,9 @@ public class IntentAgreementServiceImpl implements IntentAgreementService {
@Resource @Resource
LineInfoMapper lineInfoMapper; LineInfoMapper lineInfoMapper;
@Resource
JoinIntentionMapper joinIntentionMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@@ -62,6 +68,8 @@ public class IntentAgreementServiceImpl implements IntentAgreementService {
return null; return null;
} }
SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO); SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO);
MemberQuestionDO byLineId = joinIntentionMapper.getByLineId(lineId);
response.setType(byLineId.getJoinType());
return response; return response;
} }
} }

View File

@@ -1,16 +1,21 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.cool.store.dao.HyOpenAreaInfoDAO;
import com.cool.store.entity.HyOpenAreaInfoDO;
import com.cool.store.entity.LineInfoDO; import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.MemberQuestionDO; import com.cool.store.entity.MemberQuestionDO;
import com.cool.store.entity.PartnerBaseInfoDO; import com.cool.store.entity.PartnerBaseInfoDO;
import com.cool.store.enums.ErrorCodeEnum; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowStageEnum;
import com.cool.store.enums.WorkflowSubStageEnum; import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum; import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.exception.ServiceException; import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.HyOpenAreaInfoMapper;
import com.cool.store.mapper.JoinIntentionMapper; import com.cool.store.mapper.JoinIntentionMapper;
import com.cool.store.mapper.LineInfoMapper; import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.JoinIntentionRequest; import com.cool.store.request.JoinIntentionRequest;
import com.cool.store.service.JoinIntentionService; import com.cool.store.service.JoinIntentionService;
import com.cool.store.service.OpenAreaService;
import com.cool.store.vo.PartnerBaseInfoVO; import com.cool.store.vo.PartnerBaseInfoVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -36,25 +41,32 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
@Resource @Resource
LineInfoMapper lineInfoMapper; LineInfoMapper lineInfoMapper;
@Resource
HyOpenAreaInfoMapper openAreaInfoMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean submit(JoinIntentionRequest request) { public boolean submit(JoinIntentionRequest request) {
if (Objects.isNull(request)){ if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED); throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
} }
MemberQuestionDO memberQuestionDO = request.toMemberQuestionDO(); //更改线索流程子状态为【待审核】
boolean submitStatus = joinIntentionMapper.insertOrUpdate(memberQuestionDO); LineInfoDO lineInfoParam = request.toLineInfoDO();
if (submitStatus){ lineInfoParam.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
//更改线索流程子状态为【待审核】 lineInfoParam.setWorkflowSubStage(WorkflowSubStageEnum.INTEND.getCode());
LineInfoDO lineInfoParam = request.toLineInfoDO(); lineInfoParam.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
lineInfoParam.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode()); if (Objects.isNull(lineInfoParam)) {
if (Objects.isNull(lineInfoParam)){ throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
}
lineInfoMapper.insertOrUpdate(lineInfoParam);
return Boolean.TRUE;
} }
return Boolean.FALSE; //todo 目前写死为进入私海
lineInfoParam.setLineStatus(1);
lineInfoMapper.insertOrUpdate(lineInfoParam);
MemberQuestionDO memberQuestionDO = request.toMemberQuestionDO();
memberQuestionDO.setLineId(lineInfoParam.getId());
joinIntentionMapper.insertOrUpdate(memberQuestionDO);
return Boolean.TRUE;
} }
@Override @Override
@@ -84,10 +96,12 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
public PartnerBaseInfoVO getByLineId(Long lineId) { public PartnerBaseInfoVO getByLineId(Long lineId) {
MemberQuestionDO result = joinIntentionMapper.getByLineId(lineId); MemberQuestionDO result = joinIntentionMapper.getByLineId(lineId);
LineInfoDO byLineId = lineInfoMapper.getByLineId(lineId); LineInfoDO byLineId = lineInfoMapper.getByLineId(lineId);
if (Objects.isNull(result)){ if (Objects.isNull(result)) {
throw new ServiceException(LINE_ID_IS_NOT_EXIST); throw new ServiceException(LINE_ID_IS_NOT_EXIST);
} }
PartnerBaseInfoVO response = PartnerBaseInfoVO.from(result,byLineId); PartnerBaseInfoVO response = PartnerBaseInfoVO.from(result, byLineId);
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(Long.valueOf(response.getAreaCode()));
response.setArea(openAreaInfoDO.getAreaPath());
return response; return response;
} }
} }

View File

@@ -56,4 +56,10 @@ public class TrainingExperienceServiceImpl implements TrainingExperienceService
} }
} }
@Override
public LeaseBaseInfoDO getTrainingExperience(Long lineId) {
LeaseBaseInfoDO leaseBaseInfoDO = trainingExperienceMapper.selectByLineId(lineId);
return leaseBaseInfoDO;
}
} }

View File

@@ -56,8 +56,8 @@ public class SignValidateFilter implements Filter {
"/xfsg/mini/program/v1/partnerManage/partner/getIdentityCardInfo", "/xfsg/mini/program/v1/partnerManage/partner/getIdentityCardInfo",
"/**/swagger*/**", "/**/swagger*/**",
"/**/webjars/**", "/**/webjars/**",
"/xfsg/mini/program/v1/partnerManage/openArea/areaApplyQuery", "/xfsg/mini/program/v1/partnerManage/openArea/areaApplyQuery"
"/xfsg/mini/**" // "/xfsg/mini/**"
); );

View File

@@ -0,0 +1,30 @@
package com.cool.store.controller.webb;
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.*;
import javax.annotation.Resource;
@RestController
@RequestMapping({"/pc/IntentAgreement"})
@Slf4j
@Api(tags = "PC意向协议")
public class PCIntentAgreementController {
@Resource
IntentAgreementService intentAgreementService;
@GetMapping(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);
}
}

View File

@@ -0,0 +1,32 @@
package com.cool.store.controller.webb;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.JoinIntentionService;
import com.cool.store.vo.PartnerBaseInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping({"/pc/JoinIntention"})
@Slf4j
@Api(tags = "PC意向加盟")
public class PCJoinIntentionController {
@Resource
private JoinIntentionService joinIntentionService;
@GetMapping(path = "/getByLineId")
@ApiOperation("查找加盟意向申请书")
public ResponseResult<PartnerBaseInfoVO> getByLineId(@RequestParam("lineId") Long lineId) {
return ResponseResult.success(joinIntentionService.getByLineId(lineId));
}
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.controller.webb; package com.cool.store.controller.webb;
import com.cool.store.entity.LeaseBaseInfoDO;
import com.cool.store.enums.ExperienceStatusEnum; import com.cool.store.enums.ExperienceStatusEnum;
import com.cool.store.request.TrainingExperienceDistributionRequest; import com.cool.store.request.TrainingExperienceDistributionRequest;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
@@ -28,4 +29,10 @@ public class PCTrainingExperienceController {
return ResponseResult.success(trainingExperienceService.distribution(request)); return ResponseResult.success(trainingExperienceService.distribution(request));
} }
@ApiOperation("查询实训体验")
@GetMapping("/get")
public ResponseResult<LeaseBaseInfoDO> getTrainingExperience(@RequestParam("lineId") Long lineId) {
return ResponseResult.success(trainingExperienceService.getTrainingExperience(lineId));
}
} }

View File

@@ -42,6 +42,12 @@ public class LineController {
return ResponseResult.success(lineService.getLineInfo(lineId)); return ResponseResult.success(lineService.getLineInfo(lineId));
} }
@ApiOperation("根据线索id查询大区的支付二维码图片")
@GetMapping("/getRegionPayPic")
public ResponseResult<String> getRegionPayPic(@RequestParam("lineId")Long lineId) {
String pic = "https://coolstore-storage.oss-cn-hangzhou.aliyuncs.com/120207001943.png";
return ResponseResult.success(pic);
}

View File

@@ -28,7 +28,7 @@ public class MiniIntentAgreementController {
return ResponseResult.success(resp); return ResponseResult.success(resp);
} }
@PostMapping(path = "/get") @GetMapping(path = "/get")
@ApiOperation("查询意向协议信息") @ApiOperation("查询意向协议信息")
public ResponseResult<SigningBaseInfoResponse> getMiniIntentAgreement( public ResponseResult<SigningBaseInfoResponse> getMiniIntentAgreement(
@RequestParam(value = "partnerId",required = false) String partnerId, @RequestParam(value = "partnerId",required = false) String partnerId,