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

This commit is contained in:
zhangchenbiao
2024-04-02 16:05:10 +08:00
23 changed files with 480 additions and 38 deletions

View File

@@ -0,0 +1,63 @@
package com.cool.store.utils;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SecureUtil {
private static final String API_KEY = "c344cbe01972777dcfe7f9767e3d2e7f";
private static final String API_SECRET = "fAIgCJc3kPmSzD3SgEHU";
/**
* 利用java原生的摘要实现SHA256加密
* @param source 加密内容
* @param salt 盐
* @return
*/
public static String sha256(String source, String salt) {
String encodeStr = "";
try {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
if (salt != null) {
digest.reset();
digest.update(salt.getBytes("UTF-8"));
}
digest.update(source.getBytes("UTF-8"));
encodeStr = byte2Hex(digest.digest());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return encodeStr;
}
/**
* 将byte转为16进制
* @param bytes
* @return
*/
private static String byte2Hex(byte[] bytes){
StringBuffer stringBuffer = new StringBuffer();
for (int i=0;i<bytes.length;i++) {
String temp = Integer.toHexString(bytes[i] & 0xFF);
if (temp.length() == 1) {
// 一位的进行补0操作
stringBuffer.append("0");
}
stringBuffer.append(temp);
}
return stringBuffer.toString();
}
public static String getSignature(long timestamp) {
return SecureUtil.sha256(timestamp + "$%^&" + API_KEY, API_SECRET);
}
public static void main(String[] args) {
long timestamp = System.currentTimeMillis();
System.out.println(getSignature(timestamp));
}
}

View File

@@ -97,8 +97,8 @@ public class LineInfoDAO {
return lineInfo; return lineInfo;
} }
public List<LineInfoDO> lineList(LineListRequest lineListRequest, String userId, List<Long> wantShopAreaIds) { public List<LineInfoDO> lineList(LineListRequest lineListRequest,String wantShopAreaName, String userId, List<Long> wantShopAreaIds) {
List<LineInfoDO> lineInfo = lineInfoMapper.lineList(lineListRequest,userId,wantShopAreaIds); List<LineInfoDO> lineInfo = lineInfoMapper.lineList(lineListRequest,wantShopAreaName,userId,wantShopAreaIds);
return lineInfo; return lineInfo;
} }

View File

@@ -37,6 +37,7 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
* @return * @return
*/ */
List<LineInfoDO> lineList(@Param("request") LineListRequest lineListRequest, List<LineInfoDO> lineList(@Param("request") LineListRequest lineListRequest,
@Param("wantShopAreaName") String wantShopAreaName,
@Param("userId") String userId, @Param("userId") String userId,
@Param("wantShopAreaIds") List<Long> wantShopAreaIds); @Param("wantShopAreaIds") List<Long> wantShopAreaIds);

View File

@@ -20,6 +20,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="deleted" jdbcType="TINYINT" property="deleted"/> <result column="deleted" jdbcType="TINYINT" property="deleted"/>
<result column="audit_id" jdbcType="BIGINT" property="auditId"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, id,
@@ -39,7 +40,8 @@
business_license_address, business_license_address,
create_time, create_time,
update_time, update_time,
deleted deleted,
audit_id
</sql> </sql>
<insert id="insert" parameterType="com.cool.store.entity.SigningBaseInfoDO" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="com.cool.store.entity.SigningBaseInfoDO" useGeneratedKeys="true" keyProperty="id">
insert into xfsg_signing_base_info insert into xfsg_signing_base_info

View File

@@ -326,6 +326,9 @@
<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
and investment_manager = #{userId} and investment_manager = #{userId}
</if> </if>
<if test="wantShopAreaName != null">
and b.area_path like concat('%',#{wantShopAreaName},'%')
</if>
<if test="request.userName != null and request.username!=''"> <if test="request.userName != null and request.username!=''">
and username = #{request.userName} and username = #{request.userName}
</if> </if>

View File

@@ -0,0 +1,98 @@
package com.cool.store.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* https://apifox.com/apidoc/shared-c48218f7-4a34-4422-8689-927502f171ff/api-160442266
* 密码aJJq9F7k
*/
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class InitiatingDO {
private String kdzBusinessId;
private String title;
private String apply_user;
private String apply_user_name;
private String apply_date;
private String jms_id_card;
private String jms_id_card_address;
private String jms_name;
private BigDecimal lybzj;
private BigDecimal lybzjwb;
private String lybzjdx;
private String jms_mobile;
private String annex1;
private String annex2;
private String annex3;
private Integer qy_year;
private Integer qy_month;
private Integer qy_day;
private Integer jy_year;
private Integer jy_month;
private Integer jy_day;
private String yxjzz;
private Integer xyqx_month;
private BigDecimal jmf;
private BigDecimal jmfwb;
private String jmfdx;
private BigDecimal jmyxj;
private BigDecimal jmyxjwb;
private String csfz;
private String jmsxx;
private String annex4;
private String annex5;
private String annex6;
private String annex7;
private String dkr;
private String dkrq;
private Integer jm_type;
private Integer jms_type;
private String jm_csgs;
}

View File

@@ -20,9 +20,9 @@ public class LeaseBaseInfoDO {
private Date experienceStartTime; private Date experienceStartTime;
private Date experienceEndTime; private Date experienceEndTime;
@ApiModelProperty("体验状态 0完成 1放弃") @ApiModelProperty("体验状态 0完成 1放弃")
private Integer experienceStatus; private Integer experienceStatus;
@ApiModelProperty("放弃原因") @ApiModelProperty("放弃原因")
private String abandonCause; private String abandonCause;
private Date createTime; private Date createTime;

View File

@@ -43,4 +43,6 @@ public class SigningBaseInfoDO {
private Integer deleted; private Integer deleted;
private Long auditId;
} }

View File

@@ -0,0 +1,160 @@
package com.cool.store.request;
import com.cool.store.entity.InitiatingDO;
import com.cool.store.utils.StringUtil;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
@Data
public class InitiatingRequest {
private Long lineId;
private String signName;
private String idCardNo;
private String businessLicenseCode;
private String mobile;
private String idCardAddress;
private String businessLicenseAddress;
private String title;
private String apply_user;
private String apply_user_name;
private String apply_date;
private String jms_id_card;
private String jms_id_card_address;
private String jms_name;
private BigDecimal lybzj;
private BigDecimal lybzjwb;
private String lybzjdx;
private String jms_mobile;
private String annex1;
private String annex2;
private String annex3;
private Integer qy_year;
private Integer qy_month;
private Integer qy_day;
private Integer jy_year;
private Integer jy_month;
private Integer jy_day;
private String yxjzz;
private Integer xyqx_month;
private BigDecimal jmf;
private BigDecimal jmfwb;
private String jmfdx;
private BigDecimal jmyxj;
private BigDecimal jmyxjwb;
private String csfz;
private String jmsxx;
private String annex4;
private String annex5;
private String annex6;
private String annex7;
private String dkr;
private String dkrq;
private Integer jm_type;
private Integer jms_type;
private String jm_csgs;
public InitiatingDO toInitiatingDO() {
InitiatingDO initiatingDO = new InitiatingDO();
LocalDate currentDate = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 格式化日期并输出
String dateTime = currentDate.format(formatter);
initiatingDO.setTitle("加盟意向协议-" + this.signName + "-" + dateTime);
initiatingDO.setApply_user(this.apply_user);
initiatingDO.setApply_user_name(this.signName);
initiatingDO.setApply_date(this.apply_date);
initiatingDO.setJms_id_card(this.idCardNo);
if (StringUtil.isNotBlank(this.businessLicenseAddress)){
initiatingDO.setJms_id_card_address(this.businessLicenseAddress);
}else if (StringUtil.isNotBlank(this.businessLicenseCode)){
initiatingDO.setJms_id_card_address(this.businessLicenseCode);
}
if (StringUtil.isNotBlank(this.businessLicenseCode)){
initiatingDO.setJms_id_card(this.businessLicenseCode);
}else if (StringUtil.isNotBlank(this.idCardNo)){
initiatingDO.setJms_id_card(this.idCardNo);
}
initiatingDO.setJms_name(this.jms_name);
initiatingDO.setLybzj(this.lybzj);
initiatingDO.setLybzjwb(this.lybzj);
initiatingDO.setLybzjdx(this.lybzjdx);
initiatingDO.setJms_mobile(this.mobile);
initiatingDO.setAnnex1(this.annex1);
initiatingDO.setAnnex2(this.annex2);
initiatingDO.setAnnex3(this.annex3);
initiatingDO.setQy_year(this.qy_year);
initiatingDO.setQy_month(this.qy_month);
initiatingDO.setQy_day(this.qy_day);
initiatingDO.setJy_year(this.jy_year);
initiatingDO.setJy_month(this.jy_month);
initiatingDO.setJy_day(this.jy_day);
initiatingDO.setYxjzz(this.yxjzz);
initiatingDO.setXyqx_month(this.xyqx_month);
initiatingDO.setJmf(this.jmf);
initiatingDO.setJmfwb(this.jmf);
initiatingDO.setJmfdx(this.jmfdx);
initiatingDO.setJmyxj(this.jmyxj);
initiatingDO.setJmyxjwb(this.jmyxj);
initiatingDO.setCsfz(this.csfz);
initiatingDO.setJmsxx(this.jmsxx);
initiatingDO.setAnnex4(this.annex4);
initiatingDO.setAnnex5(this.annex5);
initiatingDO.setAnnex6(this.annex6);
initiatingDO.setAnnex7(this.annex7);
initiatingDO.setDkr(this.dkr);
initiatingDO.setDkrq(this.dkrq);
initiatingDO.setJm_type(this.jm_type);
initiatingDO.setJms_type(this.jms_type);
initiatingDO.setJm_csgs(this.jm_csgs);
return initiatingDO;
}
}

View File

@@ -27,7 +27,7 @@ public class LineListRequest extends PageBasicInfo {
@ApiModelProperty("线索创建时间_结束") @ApiModelProperty("线索创建时间_结束")
private String createTimeEnd; private String createTimeEnd;
@ApiModelProperty("意向区域ID") @ApiModelProperty("意向区域ID")
private Integer wantShopAreaId; private Long wantShopAreaId;
@ApiModelProperty("线索来源") @ApiModelProperty("线索来源")
private Integer lineSource; private Integer lineSource;
@ApiModelProperty("招商经理ID") @ApiModelProperty("招商经理ID")

View File

@@ -0,0 +1,21 @@
package com.cool.store.response;
import lombok.Data;
@Data
public class InitiatingResponse {
/**
* 返回结果代码
*/
private long code;
/**
* oa流程id
*/
private String data;
/**
* 提示信息
*/
private String msg;
private long serverTime;
}

View File

@@ -47,6 +47,8 @@ public class SigningBaseInfoResponse {
@ApiModelProperty("加盟身份 1个人加盟 2企业加盟") @ApiModelProperty("加盟身份 1个人加盟 2企业加盟")
private Integer type; private Integer type;
@ApiModelProperty("公开拒绝原因")
private String rejectPublicReason;
public static SigningBaseInfoResponse from(SigningBaseInfoDO signingBaseInfoDO) { public static SigningBaseInfoResponse from(SigningBaseInfoDO signingBaseInfoDO) {
if (signingBaseInfoDO == null) { if (signingBaseInfoDO == null) {

View File

@@ -1,6 +1,8 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.request.InitiatingRequest;
import com.cool.store.request.IntentAgreementSubmitRequest; import com.cool.store.request.IntentAgreementSubmitRequest;
import com.cool.store.response.InitiatingResponse;
import com.cool.store.response.SigningBaseInfoResponse; import com.cool.store.response.SigningBaseInfoResponse;
public interface IntentAgreementService { public interface IntentAgreementService {
@@ -18,4 +20,6 @@ public interface IntentAgreementService {
* @return * @return
*/ */
SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId); SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId);
InitiatingResponse initiating(InitiatingRequest request);
} }

View File

@@ -20,4 +20,6 @@ public interface TrainingExperienceService {
void experienceStatusChange(Long lineId, Integer status, String abandonCause); void experienceStatusChange(Long lineId, Integer status, String abandonCause);
LeaseBaseInfoDO getTrainingExperience(Long lineId); LeaseBaseInfoDO getTrainingExperience(Long lineId);
} }

View File

@@ -1,24 +1,33 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.LineInfoDAO; import com.cool.store.dao.LineInfoDAO;
import com.cool.store.entity.LineInfoDO; import com.cool.store.entity.*;
import com.cool.store.entity.MemberQuestionDO; import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.entity.SigningBaseInfoDO; import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.*; 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.JoinIntentionMapper;
import com.cool.store.mapper.LineAuditInfoMapper;
import com.cool.store.mapper.LineInfoMapper; import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.mq.util.HttpRestTemplateService;
import com.cool.store.request.InitiatingRequest;
import com.cool.store.request.IntentAgreementSubmitRequest; import com.cool.store.request.IntentAgreementSubmitRequest;
import com.cool.store.response.InitiatingResponse;
import com.cool.store.response.SigningBaseInfoResponse; import com.cool.store.response.SigningBaseInfoResponse;
import com.cool.store.service.IntentAgreementService; import com.cool.store.service.IntentAgreementService;
import com.cool.store.utils.SecureUtil;
import com.cool.store.utils.StringUtil; import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.StringUtils; import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
import static com.cool.store.enums.ErrorCodeEnum.PARAMS_VALIDATE_ERROR; import static com.cool.store.enums.ErrorCodeEnum.PARAMS_VALIDATE_ERROR;
@@ -40,21 +49,30 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Resource @Resource
LineInfoDAO lineInfoDAO; LineInfoDAO lineInfoDAO;
@Resource
private HttpRestTemplateService httpRestTemplateService;
@Value("${xfsg.url}")
private String xfsgUrl;
@Resource
LineAuditInfoMapper lineAuditInfoMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean submit(IntentAgreementSubmitRequest request) { public boolean submit(IntentAgreementSubmitRequest request) {
SigningBaseInfoDO signingBaseInfoDO = request.toSigningBaseInfoDO(); SigningBaseInfoDO signingBaseInfoDO = request.toSigningBaseInfoDO();
if(Objects.nonNull(request.getIdCardNo()) || Objects.nonNull(request.getBusinessLicenseCode())){ if (Objects.nonNull(request.getIdCardNo()) || Objects.nonNull(request.getBusinessLicenseCode())) {
SigningBaseInfoDO isExist = intentAgreementMapper.judge(request); SigningBaseInfoDO isExist = intentAgreementMapper.judge(request);
if (Objects.nonNull(isExist)){ if (Objects.nonNull(isExist)) {
throw new ServiceException(ErrorCodeEnum.BUSINESS_LICENSE_OR_ID_CARD_REPEAT); throw new ServiceException(ErrorCodeEnum.BUSINESS_LICENSE_OR_ID_CARD_REPEAT);
} }
} }
boolean submitStatus = intentAgreementMapper.insert(signingBaseInfoDO); boolean submitStatus = intentAgreementMapper.insert(signingBaseInfoDO);
if (submitStatus){ if (submitStatus) {
LineInfoDO lineInfoDO = lineInfoMapper.getByPartnerId(request.getPartnerId()); LineInfoDO lineInfoDO = lineInfoMapper.getByPartnerId(request.getPartnerId());
if (Objects.isNull(lineInfoDO)){ if (Objects.isNull(lineInfoDO)) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
} }
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()); lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode());
@@ -67,17 +85,27 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Override @Override
public SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId) { public SigningBaseInfoResponse getMiniIntentAgreement(String partnerId, Long lineId) {
if (StringUtil.isBlank(partnerId) && lineId == null){ if (StringUtil.isBlank(partnerId) && lineId == null) {
throw new ServiceException(PARAMS_VALIDATE_ERROR); throw new ServiceException(PARAMS_VALIDATE_ERROR);
} }
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(partnerId, lineId); SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(partnerId, lineId);
if (Objects.isNull(signingBaseInfoDO)){
if (Objects.isNull(signingBaseInfoDO)) {
log.info("getMiniIntentAgreement signingBaseInfoDO IS NULL......"); log.info("getMiniIntentAgreement signingBaseInfoDO IS NULL......");
return null; return null;
} }
SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO); SigningBaseInfoResponse response = SigningBaseInfoResponse.from(signingBaseInfoDO);
MemberQuestionDO byLineId = joinIntentionMapper.getByLineId(lineId); MemberQuestionDO byLineId = joinIntentionMapper.getByLineId(lineId);
response.setType(byLineId.getJoinType()); response.setType(byLineId.getJoinType());
if (Objects.nonNull(signingBaseInfoDO.getAuditId())){
LineAuditInfoDO lineAuditInfoDO = lineAuditInfoMapper.selectByPrimaryKey(signingBaseInfoDO.getAuditId());
if (Objects.isNull(lineAuditInfoDO)){
response.setRejectPublicReason(null);
}
response.setRejectPublicReason(lineAuditInfoDO.getRejectPublicReason());
}
return response; return response;
} }
@@ -90,25 +118,25 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo) { protected Boolean auditPass(Long auditId, LineInfoDO lineInfo) {
//校验是否是审核节点 //校验是否是审核节点
if (!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) && if (!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) &&
!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())){ !lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE); throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE);
} }
//待审核code 63 处理逻辑 //待审核code 63 处理逻辑
if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode())){ if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode())) {
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode()); lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode());
lineInfoDAO.updateLineInfo(lineInfo); lineInfoDAO.updateLineInfo(lineInfo);
} }
//待OA审核code 75 处理逻辑 //待OA审核code 75 处理逻辑
if(lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())){ if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage()); WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage(); WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
//更新线索阶段 //更新线索阶段
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus()); lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus());
//更新auditId //更新auditId
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineInfo.getId()); SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineInfo.getId());
if (Objects.nonNull(signingBaseInfoDO)){ if (Objects.nonNull(signingBaseInfoDO)) {
intentAgreementMapper.updateAuditId(lineInfo.getId(),auditId); intentAgreementMapper.updateAuditId(lineInfo.getId(), auditId);
}else { } else {
throw new ServiceException("无法更新,没有对应的签约基本信息"); throw new ServiceException("无法更新,没有对应的签约基本信息");
} }
@@ -119,20 +147,20 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Override @Override
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo) { protected Boolean auditReject(Long auditId, LineInfoDO lineInfo) {
if ((!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) && if ((!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) &&
!lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode()))){ !lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode()))) {
throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE); throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE);
} }
//待审核code 63 处理逻辑 //待审核code 63 处理逻辑
if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode())){ if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode())) {
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_65.getCode()); lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_65.getCode());
lineInfoDAO.updateLineInfo(lineInfo); lineInfoDAO.updateLineInfo(lineInfo);
} }
//待OA审核code 75 处理逻辑 //待OA审核code 75 处理逻辑
if(lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())){ if (lineInfo.getWorkflowStage().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_80.getCode()); lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_80.getCode());
lineInfoDAO.updateLineInfo(lineInfo); lineInfoDAO.updateLineInfo(lineInfo);
//更新auditId //更新auditId
intentAgreementMapper.updateAuditId(lineInfo.getId(),auditId); intentAgreementMapper.updateAuditId(lineInfo.getId(), auditId);
} }
return Boolean.TRUE; return Boolean.TRUE;
} }
@@ -141,4 +169,28 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
protected Boolean auditClose(Long auditId, LineInfoDO lineInfo) { protected Boolean auditClose(Long auditId, LineInfoDO lineInfo) {
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override
public InitiatingResponse initiating(InitiatingRequest request) {
log.info("initiating request:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
Map<String, Object> requestMap = new HashMap<>();
fillSignatureInfo(requestMap);
String url = xfsgUrl + Constants.INTENTION_CONTRACT_URL + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
InitiatingDO initiatingDO = request.toInitiatingDO();
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
initiatingDO.setKdzBusinessId(lineInfoDO.getId() + "_" + lineInfoDO.getWorkflowSubStageStatus());
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, initiatingDO, InitiatingResponse.class);
return initiatingResponse;
}
private void fillSignatureInfo(Map<String, Object> requestMap) {
long timestamp = System.currentTimeMillis();
String signature = SecureUtil.getSignature(timestamp);
requestMap.put("timestamp", timestamp);
requestMap.put("signature", signature);
}
} }

View File

@@ -114,8 +114,13 @@ public class LineServiceImpl implements LineService {
userId = loginUserInfo.getUserId(); userId = loginUserInfo.getUserId();
} }
} }
String areaName = null;
if (lineListRequest.getWantShopAreaId() != null){
HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(lineListRequest.getWantShopAreaId());
areaName = hyOpenAreaInfoDO.getAreaPath();
}
PageHelper.startPage(lineListRequest.getPageNum(), lineListRequest.getPageSize()); PageHelper.startPage(lineListRequest.getPageNum(), lineListRequest.getPageSize());
List<LineInfoDO> lineInfoDOS = lineInfoDAO.lineList(lineListRequest, userId, wantShopAreaIds); List<LineInfoDO> lineInfoDOS = lineInfoDAO.lineList(lineListRequest,areaName, userId, wantShopAreaIds);
PageInfo page = new PageInfo(lineInfoDOS); PageInfo page = new PageInfo(lineInfoDOS);
Map<Long, HyPartnerLabelDO> userPortraitMap = deskService.getUserPortraitMap(lineInfoDOS); Map<Long, HyPartnerLabelDO> userPortraitMap = deskService.getUserPortraitMap(lineInfoDOS);
List<Long> wantShopAreaIdList = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList()); List<Long> wantShopAreaIdList = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
@@ -191,7 +196,7 @@ public class LineServiceImpl implements LineService {
String areaName = null; String areaName = null;
if (partnerRequest.getWantShopAreaId() != null){ if (partnerRequest.getWantShopAreaId() != null){
HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(partnerRequest.getWantShopAreaId()); HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(partnerRequest.getWantShopAreaId());
areaName = hyOpenAreaInfoDO.getAreaName(); areaName = hyOpenAreaInfoDO.getAreaPath();
} }
PageHelper.startPage(partnerRequest.getPageNum(), partnerRequest.getPageSize()); PageHelper.startPage(partnerRequest.getPageNum(), partnerRequest.getPageSize());
List<LineInfoDO> lineInfoDOS = lineInfoDAO.partnerList(partnerRequest,areaName, userId, wantShopAreaIds); List<LineInfoDO> lineInfoDOS = lineInfoDAO.partnerList(partnerRequest,areaName, userId, wantShopAreaIds);

View File

@@ -98,4 +98,5 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
protected Boolean auditClose(Long auditId, LineInfoDO lineInfo) { protected Boolean auditClose(Long auditId, LineInfoDO lineInfo) {
return Boolean.TRUE; return Boolean.TRUE;
} }
} }

View File

@@ -167,4 +167,9 @@ public class Constants
public static final String CONTENT_ENCODING = "Content-Encoding"; public static final String CONTENT_ENCODING = "Content-Encoding";
public static final String INTENTION_CONTRACT_URL = "/api/coolstore/start-flow/intention-contract";
} }

View File

@@ -1,5 +1,7 @@
package com.cool.store.controller.webb; package com.cool.store.controller.webb;
import com.cool.store.request.InitiatingRequest;
import com.cool.store.response.InitiatingResponse;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.response.SigningBaseInfoResponse; import com.cool.store.response.SigningBaseInfoResponse;
import com.cool.store.service.IntentAgreementService; import com.cool.store.service.IntentAgreementService;
@@ -27,4 +29,11 @@ public class PCIntentAgreementController {
SigningBaseInfoResponse resp = intentAgreementService.getMiniIntentAgreement(partnerId, lineId); SigningBaseInfoResponse resp = intentAgreementService.getMiniIntentAgreement(partnerId, lineId);
return ResponseResult.success(resp); return ResponseResult.success(resp);
} }
@PostMapping(path = "/initiating")
@ApiOperation("kdz -> xfsg 发起意向协议流程")
public ResponseResult<InitiatingResponse> initiating(@RequestParam
@RequestBody InitiatingRequest request) {
return ResponseResult.success(intentAgreementService.initiating(request));
}
} }

View File

@@ -1,15 +1,13 @@
package com.cool.store.controller.webc; package com.cool.store.controller.webc;
import com.cool.store.entity.LeaseBaseInfoDO;
import com.cool.store.request.TrainingExperienceChangeRequest; import com.cool.store.request.TrainingExperienceChangeRequest;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.service.TrainingExperienceService; import com.cool.store.service.TrainingExperienceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -29,4 +27,12 @@ public class MiniTrainingExperienceController {
return ResponseResult.success(); return ResponseResult.success();
} }
@ApiOperation("查询实训体验")
@GetMapping("/getStore")
public ResponseResult<LeaseBaseInfoDO> getStore(@RequestParam("lineId") Long lineId) {
return ResponseResult.success(trainingExperienceService.getTrainingExperience(lineId));
}
} }

View File

@@ -75,3 +75,5 @@ aliyun.accessKeyId=LTAI5tQ6QBnWaB5LaJYz6zcD
aliyun.accessKeySecret=spqsOgtfr54cwK861O3N3fInydTgjA aliyun.accessKeySecret=spqsOgtfr54cwK861O3N3fInydTgjA
coolstore.page.domain=https://t2store.coolstore.cn/ coolstore.page.domain=https://t2store.coolstore.cn/
xfsg.url=https://inf-test.xianfengsg.com/InfService

View File

@@ -78,3 +78,5 @@ xxl.job.accessToken=25365115eed84e9ba5e0040abb255a09
exhibition.channel.id=52399 exhibition.channel.id=52399
recommended.channel.id=52400 recommended.channel.id=52400
xfsg.url=https://inf-test.xianfengsg.com/InfService

View File

@@ -80,3 +80,5 @@ exhibition.channel.id=52399
recommended.channel.id=52400 recommended.channel.id=52400
coolstore.page.domain=https://t2store.coolstore.cn/ coolstore.page.domain=https://t2store.coolstore.cn/
xfsg.url=https://inf-test.xianfengsg.com/InfService