Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.enums.IDCardSideEnum;
|
||||
import com.cool.store.enums.SmsCodeTypeEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.vo.BusinessLicenseInfoVO;
|
||||
import com.cool.store.vo.IdentityCardInfoVO;
|
||||
|
||||
@@ -15,5 +17,21 @@ public interface AliyunService {
|
||||
*/
|
||||
IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl, IDCardSideEnum sideEnum) throws ApiException;
|
||||
|
||||
/**
|
||||
* ORC识别证照
|
||||
* @param imageUrl
|
||||
* @return
|
||||
* @throws ApiException
|
||||
*/
|
||||
BusinessLicenseInfoVO getBusinessLicenseInfo(String imageUrl) throws ApiException;
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
* @param mobile
|
||||
* @param codeType
|
||||
* @return
|
||||
*/
|
||||
ResponseResult sendMessage(String mobile, SmsCodeTypeEnum codeType);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.FranchiseAgreementRequest;
|
||||
import com.cool.store.request.NewStoreRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
|
||||
/**
|
||||
* 鲜丰水果API(筹备相关)
|
||||
* https://apifox.com/apidoc/shared-c48218f7-4a34-4422-8689-927502f171ff/api-164932487
|
||||
* 密码:aJJq9F7k
|
||||
*/
|
||||
public interface CoolStoreStartFlowService {
|
||||
|
||||
/**
|
||||
* 新店开业流程
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
ResponseResult newStore(NewStoreRequest request);
|
||||
|
||||
/**
|
||||
*特许经营合同
|
||||
* @param request
|
||||
* @param type 0:个人 1:企业
|
||||
* @return
|
||||
*/
|
||||
ResponseResult franchiseAgreement(FranchiseAgreementRequest request,Integer type);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +1,14 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.AuditResultRequest;
|
||||
import com.cool.store.request.SysBuildResultRequest;
|
||||
|
||||
public interface KdzApiService {
|
||||
/**
|
||||
* API审批
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
boolean auditResult(AuditResultRequest request);
|
||||
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface LineService {
|
||||
* @param loginUserInfo
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PublicLineListVO> getPublicLineList(PublicLineListRequest publicLineListRequest, LoginUserInfo loginUserInfo);
|
||||
PageInfo<PublicLineListVO> getPublicLineList(PublicLineListRequest publicLineListRequest, LoginUserInfo loginUserInfo ,Boolean publicFlag);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,7 @@ public interface PointService {
|
||||
* @param shopPointDetailRequest
|
||||
* @return
|
||||
*/
|
||||
Integer updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest);
|
||||
Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest);
|
||||
|
||||
/**
|
||||
* 生成铺位评估报告
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.request.SysStoreAppRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.SysStoreAppResponse;
|
||||
|
||||
public interface SysStoreAppService {
|
||||
|
||||
/**
|
||||
* 提交系统建店申请
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
ResponseResult submitSysBuildStore(SysStoreAppRequest request);
|
||||
|
||||
|
||||
SysStoreAppResponse getDefaultValueSysBuildStore(Long lineId, Long shopId);
|
||||
}
|
||||
@@ -2,10 +2,14 @@ package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyun.ocr20191230.models.*;
|
||||
import com.aliyuncs.CommonRequest;
|
||||
import com.aliyuncs.http.MethodType;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.IDCardSideEnum;
|
||||
import com.cool.store.enums.SmsCodeTypeEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.AliyunService;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.BusinessLicenseInfoVO;
|
||||
@@ -33,6 +37,9 @@ public class AliyunServiceImpl implements AliyunService {
|
||||
@Value("${aliyun.accessKeySecret:null}")
|
||||
private String accessKeySecret;
|
||||
|
||||
// @Value("${aliyun.sms.domain}")
|
||||
private String smsDomain;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@@ -133,4 +140,17 @@ public class AliyunServiceImpl implements AliyunService {
|
||||
throw new ApiException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResponseResult sendMessage(String mobile, SmsCodeTypeEnum codeType) {
|
||||
String msgKey = codeType + ":" + mobile;
|
||||
CommonRequest request = new CommonRequest();
|
||||
request.setSysMethod(MethodType.POST);
|
||||
request.setSysDomain(smsDomain);
|
||||
request.setSysVersion("2017-05-25");
|
||||
request.setSysAction("SendSms");
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
|
||||
import com.cool.store.request.AuditResultRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service("AuditResultService")
|
||||
public interface AuditResultService {
|
||||
Boolean auditResult(AuditResultRequest request);
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dto.message.SendMessageDTO;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.mq.producer.SimpleMessageService;
|
||||
import com.cool.store.request.AuditResultRequest;
|
||||
import com.cool.store.utils.UUIDUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import com.google.gson.Gson;
|
||||
@@ -68,6 +69,12 @@ public class CommonService {
|
||||
return (LineFlowService)applicationContext.getBean(workflowSubStageEnum.getClazz());
|
||||
}
|
||||
|
||||
public AuditResultService getAuditService(AuditResultRequest request) {
|
||||
String flag = splitMethod(request.getKdzBusinessId());
|
||||
AuditEnum auditEnum = AuditEnum.getWorkflowSubStageEnum(flag);
|
||||
return (AuditResultService) applicationContext.getBean(auditEnum.getClazz());
|
||||
}
|
||||
|
||||
public void sendMessage(List<String> userIds, Long lineId, MessageEnum message, String... param){
|
||||
if(CollectionUtils.isEmpty(userIds)){
|
||||
return;
|
||||
@@ -140,4 +147,13 @@ public class CommonService {
|
||||
}
|
||||
}
|
||||
|
||||
public static String splitMethod(String kdzBusinessId) {
|
||||
String[] split = kdzBusinessId.split(Constants.D_LINE);
|
||||
if (split.length >= 2) {
|
||||
return split[0];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.request.FranchiseAgreementRequest;
|
||||
import com.cool.store.request.NewStoreRequest;
|
||||
import com.cool.store.response.InitiatingResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.CoolStoreStartFlowService;
|
||||
import com.cool.store.utils.SecureUtil;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService {
|
||||
|
||||
|
||||
@Value("${xfsg.url}")
|
||||
private String xfsgUrl;
|
||||
|
||||
@Resource
|
||||
private HttpRestTemplateService httpRestTemplateService;
|
||||
|
||||
@Override
|
||||
public ResponseResult newStore(NewStoreRequest request) {
|
||||
log.info("newStore param:{}", 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.NEW_STORE_URL + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
|
||||
log.info("newStore API response:{}",JSONObject.toJSONString(initiatingResponse));
|
||||
if (initiatingResponse.getCode() != 0L){
|
||||
return new ResponseResult(500,initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
}else {
|
||||
return new ResponseResult(200000,initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResponseResult franchiseAgreement(FranchiseAgreementRequest request, Integer type) {
|
||||
log.info("newStore param:{}", JSONObject.toJSONString(request));
|
||||
if (Objects.isNull(request)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
fillSignatureInfo(requestMap);
|
||||
String url = null;
|
||||
if (Constants.ONE_INTEGER == type){
|
||||
url = xfsgUrl + Constants.FRANCHISE_AGREEMENT_COMPANY + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
}else if (Constants.ZERO_INTEGER == type){
|
||||
url = xfsgUrl + Constants.FRANCHISE_AGREEMENT_PERSON + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
}
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
|
||||
log.info("franchiseAgreement API response:{}",JSONObject.toJSONString(initiatingResponse));
|
||||
if (initiatingResponse.getCode() != 0L){
|
||||
return new ResponseResult(500,initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
}else {
|
||||
return new ResponseResult(200000,initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
}
|
||||
}
|
||||
|
||||
private void fillSignatureInfo(Map<String, Object> requestMap) {
|
||||
long timestamp = System.currentTimeMillis();
|
||||
String signature = SecureUtil.getSignature(timestamp);
|
||||
requestMap.put("timestamp", timestamp);
|
||||
requestMap.put("signature", signature);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,15 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.ReceivingBankEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageStatusEnum;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.*;
|
||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.request.FranchiseeSaveRequest;
|
||||
import com.cool.store.request.InitiatingRequest;
|
||||
import com.cool.store.request.IntentAgreementSubmitRequest;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.InitiatingResponse;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.SigningBaseInfoResponse;
|
||||
@@ -39,7 +33,7 @@ import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class IntentAgreementServiceImpl extends LineFlowService implements IntentAgreementService {
|
||||
public class IntentAgreementServiceImpl extends LineFlowService implements IntentAgreementService, AuditResultService {
|
||||
|
||||
|
||||
@Resource
|
||||
@@ -72,6 +66,9 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
@Resource
|
||||
RedisUtilPool redisUtilPool;
|
||||
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -121,7 +118,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) {
|
||||
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo, String userId) {
|
||||
//校验是否是审核节点
|
||||
if (!lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) &&
|
||||
!lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
|
||||
@@ -137,7 +134,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
|
||||
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
|
||||
//更新线索阶段
|
||||
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(),userId);
|
||||
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(), userId);
|
||||
}
|
||||
//更新auditId
|
||||
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineInfo.getId());
|
||||
@@ -150,7 +147,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo,String userId) {
|
||||
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo, String userId) {
|
||||
if ((!lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode()) &&
|
||||
!lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode()))) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_APPROVE_NODE);
|
||||
@@ -185,24 +182,24 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
InitiatingDO initiatingDO = request.toInitiatingDO();
|
||||
// LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
|
||||
initiatingDO.setKdzBusinessId(lineInfoDO.getId() + "_" + lineInfoDO.getWorkflowSubStageStatus());
|
||||
initiatingDO.setKdzBusinessId(AuditEnum.CONTRACT_INTENTION.getCode() + "_" + lineInfoDO.getId() + "_" + lineInfoDO.getWorkflowSubStageStatus());
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, initiatingDO, InitiatingResponse.class);
|
||||
if (initiatingResponse.getCode() != 0L){
|
||||
return new ResponseResult(500,initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
}else {
|
||||
String redisKey = "OA:"+request.getMobile()+request.getIdCardNo();
|
||||
redisUtilPool.setString(redisKey,JSONObject.toJSONString(request));
|
||||
if (initiatingResponse.getCode() != 0L) {
|
||||
return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
} else {
|
||||
String redisKey = "OA:" + request.getMobile() + request.getIdCardNo();
|
||||
redisUtilPool.setString(redisKey, JSONObject.toJSONString(request));
|
||||
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
|
||||
return new ResponseResult(200000,initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public InitiatingRequest getOaDetail(String mobile, String idCardNo) {
|
||||
String redisKey = "OA:"+mobile+idCardNo;
|
||||
String redisKey = "OA:" + mobile + idCardNo;
|
||||
String responseString = redisUtilPool.getString(redisKey);
|
||||
if (StringUtils.isNotBlank(responseString)){
|
||||
if (StringUtils.isNotBlank(responseString)) {
|
||||
InitiatingRequest initiatingRequest = JSONObject.parseObject(responseString, InitiatingRequest.class);
|
||||
return initiatingRequest;
|
||||
}
|
||||
@@ -221,7 +218,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
FranchiseeDO franchiseeDO = request.toFranchiseeDO();
|
||||
//查银行信息
|
||||
LinePayDO linePayDO = linePayMapper.getLinePayByLineId(request.getLineId());
|
||||
if (Objects.isNull(linePayDO)){
|
||||
if (Objects.isNull(linePayDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_PAY_FALSE);
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
@@ -232,7 +229,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
franchiseeDO.setBankSub(linePayDO.getBranchBankCode());
|
||||
//查城市信息
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
|
||||
if (Objects.isNull(lineInfoDO)){
|
||||
if (Objects.isNull(lineInfoDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoDO.getWantShopAreaId());
|
||||
@@ -243,7 +240,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
franchiseeDO.setOperator("22090043");
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, franchiseeDO, InitiatingResponse.class);
|
||||
//更新线索(进入蓄水池并回填加盟商编码)
|
||||
if (initiatingResponse.getCode() == 0){
|
||||
if (initiatingResponse.getCode() == 0) {
|
||||
LineInfoDO lineInfoParam = new LineInfoDO();
|
||||
lineInfoParam.setId(request.getLineId());
|
||||
//蓄水池
|
||||
@@ -251,15 +248,52 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
lineInfoParam.setPartnerNum(initiatingResponse.getData());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoParam);
|
||||
}
|
||||
if (initiatingResponse.getCode() != 0){
|
||||
if (initiatingResponse.getCode() != 0) {
|
||||
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
|
||||
return new ResponseResult(500,initiatingResponse.getMessage(),initiatingResponse.getData());
|
||||
}else {
|
||||
return new ResponseResult(200000,initiatingResponse.getMessage(),initiatingResponse.getData());
|
||||
return new ResponseResult(500, initiatingResponse.getMessage(), initiatingResponse.getData());
|
||||
} else {
|
||||
return new ResponseResult(200000, initiatingResponse.getMessage(), initiatingResponse.getData());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean auditResult(AuditResultRequest request) {
|
||||
try {
|
||||
String kdzBusinessId = request.getKdzBusinessId();
|
||||
String lineId = getLineId(kdzBusinessId);
|
||||
if (StringUtil.isBlank(lineId)) {
|
||||
throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
|
||||
}
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId));
|
||||
if (Objects.isNull(lineInfoDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
if (request.getAuditResult() == 1) {
|
||||
AuditPassRequest auditPassRequest = new AuditPassRequest();
|
||||
auditPassRequest.setLineId(lineInfoDO.getId());
|
||||
auditPassRequest.setPassReason(request.getCause());
|
||||
auditPassRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
|
||||
commonService.getLineFlowService(auditPassRequest.getWorkflowSubStage()).auditPass(auditPassRequest, null);
|
||||
} else if (request.getAuditResult() == 0) {
|
||||
AuditRejectRequest auditRejectRequest = new AuditRejectRequest();
|
||||
auditRejectRequest.setLineId(lineInfoDO.getId());
|
||||
auditRejectRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
|
||||
auditRejectRequest.setRejectPublicReason(request.getCause());
|
||||
auditRejectRequest.setRejectRealReason(request.getFailureCause());
|
||||
commonService.getLineFlowService(auditRejectRequest.getWorkflowSubStage()).auditReject(auditRejectRequest, null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private String getLineId(String kdzBusinessId) {
|
||||
String lindId = kdzBusinessId.substring(kdzBusinessId.indexOf("_") + 1, kdzBusinessId.lastIndexOf("_"));
|
||||
return lindId;
|
||||
}
|
||||
|
||||
private void fillSignatureInfo(Map<String, Object> requestMap) {
|
||||
long timestamp = System.currentTimeMillis();
|
||||
String signature = SecureUtil.getSignature(timestamp);
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.LineInfoMapper;
|
||||
import com.cool.store.request.AuditPassRequest;
|
||||
import com.cool.store.request.AuditRejectRequest;
|
||||
import com.cool.store.request.AuditResultRequest;
|
||||
import com.cool.store.service.KdzApiService;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -20,53 +15,16 @@ import java.util.Objects;
|
||||
@Slf4j
|
||||
public class KdzApiServiceImpl implements KdzApiService {
|
||||
|
||||
@Resource
|
||||
LineInfoMapper lineInfoMapper;
|
||||
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
|
||||
@Override
|
||||
public boolean auditResult(AuditResultRequest request) {
|
||||
if (Objects.isNull(request) || StringUtil.isBlank(request.getKdzBusinessId())){
|
||||
if (Objects.isNull(request) || StringUtil.isBlank(request.getKdzBusinessId())) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
String kdzBusinessId = request.getKdzBusinessId();
|
||||
String lineId = splitMethod(kdzBusinessId);
|
||||
if (StringUtil.isBlank(lineId)){
|
||||
throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
|
||||
}
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId));
|
||||
if (Objects.isNull(lineInfoDO)){
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
try {
|
||||
if (request.getAuditResult() == 1){
|
||||
AuditPassRequest auditPassRequest = new AuditPassRequest();
|
||||
auditPassRequest.setLineId(lineInfoDO.getId());
|
||||
auditPassRequest.setPassReason(request.getCause());
|
||||
auditPassRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
|
||||
commonService.getLineFlowService(auditPassRequest.getWorkflowSubStage()).auditPass(auditPassRequest,null);
|
||||
}else if (request.getAuditResult() == 0){
|
||||
AuditRejectRequest auditRejectRequest = new AuditRejectRequest();
|
||||
auditRejectRequest.setLineId(lineInfoDO.getId());
|
||||
auditRejectRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
|
||||
auditRejectRequest.setRejectPublicReason(request.getCause());
|
||||
auditRejectRequest.setRejectRealReason(request.getFailureCause());
|
||||
commonService.getLineFlowService(auditRejectRequest.getWorkflowSubStage()).auditReject(auditRejectRequest,null);
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
|
||||
}
|
||||
return true;
|
||||
Boolean result = commonService.getAuditService(request).auditResult(request);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String splitMethod(String kdzBusinessId){
|
||||
String[] split = kdzBusinessId.split(Constants.D_LINE);
|
||||
if (split.length >= 2){
|
||||
return split[0];
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,9 +168,9 @@ public class LineServiceImpl implements LineService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PublicLineListVO> getPublicLineList(PublicLineListRequest publicLineListRequest, LoginUserInfo loginUserInfo) {
|
||||
public PageInfo<PublicLineListVO> getPublicLineList(PublicLineListRequest publicLineListRequest, LoginUserInfo loginUserInfo, Boolean publicFlag) {
|
||||
PageHelper.startPage(publicLineListRequest.getPageNum(), publicLineListRequest.getPageSize());
|
||||
List<LineInfoDO> lineInfoDOS = lineInfoDAO.publicLineList(publicLineListRequest);
|
||||
List<LineInfoDO> lineInfoDOS = lineInfoDAO.publicLineList(publicLineListRequest,publicFlag);
|
||||
PageInfo page = new PageInfo(lineInfoDOS);
|
||||
Map<Long, HyPartnerLabelDO> userPortraitMap = deskService.getUserPortraitMap(lineInfoDOS);
|
||||
List<Long> wantShopAreaIdList = lineInfoDOS.stream().filter(lineInfoDO -> lineInfoDO.getWantShopAreaId() != null).map(LineInfoDO::getWantShopAreaId).collect(Collectors.toList());
|
||||
@@ -314,7 +314,7 @@ public class LineServiceImpl implements LineService {
|
||||
return null;
|
||||
}
|
||||
//总天数
|
||||
Integer totalDays = 20;
|
||||
Integer totalDays = 10;
|
||||
IntendProcessTotalVO intendProcessTotalVO = new IntendProcessTotalVO();
|
||||
intendProcessTotalVO.setTotalDays(totalDays);
|
||||
intendProcessTotalVO.setCompletionTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,DateUtils.addDays(memberQuestionDO.getCreateTime(),totalDays)));
|
||||
@@ -365,7 +365,7 @@ public class LineServiceImpl implements LineService {
|
||||
for (WorkflowSubStageEnum workflowSubStageEnum : WorkflowSubStageEnum.values()) {
|
||||
IntendProcessVO intend = getIntend(memberQuestionDO.getCreateTime(), workflowSubStageEnum);
|
||||
if (map.get(workflowSubStageEnum.getCode())!=null){
|
||||
intend.setActualTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,DateUtils.addDays(map.get(workflowSubStageEnum.getCode()),workflowSubStageEnum.getProgress())));
|
||||
intend.setActualTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,map.get(workflowSubStageEnum.getCode())));
|
||||
}
|
||||
list.add(intend);
|
||||
}
|
||||
|
||||
@@ -123,12 +123,13 @@ public class PointServiceImpl implements PointService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
|
||||
public Long updatePointDetailInfo(UpdatePointDetailRequest shopPointDetailRequest) {
|
||||
PointInfoDO shopPointInfo = UpdatePointDetailRequest.convertPointDO(shopPointDetailRequest);
|
||||
PointDetailInfoDO shopPoint = UpdatePointDetailRequest.convertDO(shopPointDetailRequest);
|
||||
shopPointInfo.setPointScore(shopPoint.getTotalPointScore());
|
||||
pointInfoDAO.updatePointInfo(shopPointInfo);
|
||||
return pointDetailInfoDAO.updatePointDetailInfo(shopPoint);
|
||||
pointDetailInfoDAO.updatePointDetailInfo(shopPoint);
|
||||
return shopPointDetailRequest.getPointId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -476,6 +477,9 @@ public class PointServiceImpl implements PointService {
|
||||
request.setRegionIds(regionService.getSubRegionIdsByRegionIds(request.getRegionIds()));
|
||||
}
|
||||
}
|
||||
if(Objects.nonNull(request.getPointStatus()) && PointStatusEnum.POINT_STATUS_3.getCode().equals(request.getPointStatus())){
|
||||
request.setPointStatus(PointStatusEnum.POINT_STATUS_4.getCode());
|
||||
}
|
||||
List<PointPageVO> resultList = new ArrayList();
|
||||
Page<PointInfoDO> pointPage = pointInfoDAO.getTeamPointPage(request);
|
||||
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
||||
|
||||
@@ -0,0 +1,402 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.AuditEnum;
|
||||
import com.cool.store.enums.AuditTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.UserRoleEnum;
|
||||
import com.cool.store.enums.prepare.newStore.BusinessDistrictEnum;
|
||||
import com.cool.store.enums.prepare.newStore.OfflineCompetitorEnum;
|
||||
import com.cool.store.enums.prepare.newStore.PassengerFlowEnum;
|
||||
import com.cool.store.enums.prepare.newStore.StoreOperatorEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.*;
|
||||
import com.cool.store.request.AuditResultRequest;
|
||||
import com.cool.store.request.NewStoreRequest;
|
||||
import com.cool.store.request.SysStoreAppRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.SysStoreAppResponse;
|
||||
import com.cool.store.service.CoolStoreStartFlowService;
|
||||
import com.cool.store.service.PreparationService;
|
||||
import com.cool.store.service.SysStoreAppService;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultService {
|
||||
|
||||
@Resource
|
||||
private CoolStoreStartFlowService coolStoreStartFlowService;
|
||||
|
||||
@Resource
|
||||
private SystemBuildingShopMapper systemBuildingShopMapper;
|
||||
|
||||
@Resource
|
||||
private LineInfoMapper lineInfoMapper;
|
||||
|
||||
@Resource
|
||||
PointInfoMapper pointInfoMapper;
|
||||
|
||||
@Resource
|
||||
RegionMapper regionMapper;
|
||||
|
||||
@Resource
|
||||
ThirdDepartmentMapper thirdDepartmentMapper;
|
||||
|
||||
@Resource
|
||||
EnterpriseUserMapper enterpriseUserMapper;
|
||||
|
||||
@Resource
|
||||
UserAuthMappingService userAuthMappingService;
|
||||
|
||||
@Resource
|
||||
PreparationService preparationService;
|
||||
|
||||
@Resource
|
||||
ShopAuditInfoMapper shopAuditInfoMapper;
|
||||
|
||||
@Resource
|
||||
ShopInfoMapper shopInfoMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseResult submitSysBuildStore(SysStoreAppRequest request) {
|
||||
log.info("submitSysBuildStore request :{}", JSONObject.toJSONString(request));
|
||||
if (Objects.isNull(request)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
//1.操作数据库
|
||||
SystemBuildingShopDO systemBuildingShopDO = SystemBuildingShopDO.convertToSystemBuildingShopDO(request);
|
||||
if (request.getId() == null) {
|
||||
systemBuildingShopMapper.insertSelective(systemBuildingShopDO);
|
||||
} else {
|
||||
systemBuildingShopDO.setId(request.getId());
|
||||
systemBuildingShopMapper.updateByPrimaryKeySelective(systemBuildingShopDO);
|
||||
}
|
||||
//2.查找、组装数组
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());//线索信息
|
||||
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(request.getLineId(), request.getShopId());//查铺位信息确定铺位所在大区、战区、门店所在省市区街道地址
|
||||
//3.请求鲜丰接口
|
||||
NewStoreRequest apiRequest = convertToNewStoreRequest(request,lineInfoDO,pointInfoDO);
|
||||
return coolStoreStartFlowService.newStore(apiRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysStoreAppResponse getDefaultValueSysBuildStore(Long lineId, Long shopId) {
|
||||
SysStoreAppResponse sysStoreAppResponse = new SysStoreAppResponse();
|
||||
//1.查找数据
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(lineId);
|
||||
SystemBuildingShopDO systemBuildingShopDO = SystemBuildingShopDO.builder().lineId(lineId).shopId(shopId).build();
|
||||
systemBuildingShopDO = systemBuildingShopMapper.selectOne(systemBuildingShopDO);
|
||||
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(lineId, shopId);
|
||||
//2.组装数据并返回
|
||||
sysStoreAppResponse = polymerization(sysStoreAppResponse,systemBuildingShopDO,lineInfoDO,pointInfoDO);
|
||||
return sysStoreAppResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 聚合返回体
|
||||
* @param systemBuildingShopDO
|
||||
* @param lineInfoDO
|
||||
*/
|
||||
private SysStoreAppResponse polymerization(SysStoreAppResponse sysStoreAppResponse,
|
||||
SystemBuildingShopDO systemBuildingShopDO,
|
||||
LineInfoDO lineInfoDO,
|
||||
PointInfoDO pointInfoDO) {
|
||||
sysStoreAppResponse = from(systemBuildingShopDO,lineInfoDO,pointInfoDO);
|
||||
return sysStoreAppResponse;
|
||||
}
|
||||
|
||||
public SysStoreAppResponse from(SystemBuildingShopDO systemBuildingShopDO,
|
||||
LineInfoDO lineInfoDO,
|
||||
PointInfoDO pointInfoDO) {
|
||||
SysStoreAppResponse.FranInfo franInfo = new SysStoreAppResponse.FranInfo();
|
||||
SysStoreAppResponse.StoreDetail storeDetail = new SysStoreAppResponse.StoreDetail();
|
||||
SysStoreAppResponse.SupervisorDetail supervisorDetail = new SysStoreAppResponse.SupervisorDetail();
|
||||
SysStoreAppResponse sysStoreAppResponse = new SysStoreAppResponse();
|
||||
Long regionId = pointInfoDO.getRegionId();
|
||||
RegionDO bigRegion = regionMapper.getBigRegionByRegionId(regionId);//大区
|
||||
RegionDO fightRegion = regionMapper.getByRegionId(regionId);//战区
|
||||
EnterpriseUserDO enterpriseUserDO = userAuthMappingService.getUserByRoleEnumAndRegionId(UserRoleEnum.REGION_MANAGER, bigRegion.getId());
|
||||
if (Objects.nonNull(enterpriseUserDO)){
|
||||
// supervisorName
|
||||
supervisorDetail.setSupervisorName(enterpriseUserDO.getName());
|
||||
// supervisorId
|
||||
supervisorDetail.setSupervisorId(enterpriseUserDO.getUserId());
|
||||
}
|
||||
if (Objects.nonNull(bigRegion)){
|
||||
storeDetail.setBigName(bigRegion.getName());
|
||||
storeDetail.setBigCode(bigRegion.getSynDingDeptId());
|
||||
}
|
||||
if (Objects.nonNull(fightRegion)){
|
||||
storeDetail.setFightName(fightRegion.getName());
|
||||
storeDetail.setFightCode(fightRegion.getSynDingDeptId());
|
||||
}
|
||||
if (Objects.nonNull(systemBuildingShopDO)){
|
||||
sysStoreAppResponse.setId(systemBuildingShopDO.getId());
|
||||
sysStoreAppResponse.setLineId(systemBuildingShopDO.getLineId());
|
||||
sysStoreAppResponse.setShopId(systemBuildingShopDO.getShopId());
|
||||
sysStoreAppResponse.setAuditId(systemBuildingShopDO.getAuditId());
|
||||
franInfo.setFranchiseeType(systemBuildingShopDO.getFranchiseeType());
|
||||
franInfo.setStoreInviteesName(systemBuildingShopDO.getStoreInviteesName());
|
||||
franInfo.setInviteUserId(systemBuildingShopDO.getStoreInviteesId());
|
||||
storeDetail.setStoreNature(systemBuildingShopDO.getStoreNature());
|
||||
storeDetail.setStoreOperator(systemBuildingShopDO.getStoreOperator());
|
||||
// bigDesc
|
||||
storeDetail.setBigDesc(systemBuildingShopDO.getBigDesc());
|
||||
// fightDesc
|
||||
storeDetail.setFightDesc(systemBuildingShopDO.getFightDesc());
|
||||
// smallCode
|
||||
storeDetail.setSmallCode(systemBuildingShopDO.getSmallCode());
|
||||
// smallDesc
|
||||
storeDetail.setSmallDesc(systemBuildingShopDO.getSmallDesc());
|
||||
// smallName
|
||||
storeDetail.setSmallName(systemBuildingShopDO.getSmallDesc());
|
||||
// mainBusinessType
|
||||
storeDetail.setMainBusinessType(systemBuildingShopDO.getMainBusinessType());
|
||||
// subBusinessType
|
||||
storeDetail.setSubBusinessType(systemBuildingShopDO.getSubBusinessType());
|
||||
// offlineCompetitor
|
||||
storeDetail.setOfflineCompetitor(systemBuildingShopDO.getOfflineCompetitor());
|
||||
// offlineCompetingBrand
|
||||
storeDetail.setOfflineCompetingBrand(systemBuildingShopDO.getOfflineCompetingBrand());
|
||||
// averagePriceSh
|
||||
storeDetail.setAveragePriceSh(systemBuildingShopDO.getAveragePriceSh());
|
||||
// averageDailyRs
|
||||
storeDetail.setAverageDailyRs(systemBuildingShopDO.getAverageDailyRs());
|
||||
// businessStoreType
|
||||
storeDetail.setBusinessStoreType(systemBuildingShopDO.getBusinessStoreType());
|
||||
// estimatedTurnover
|
||||
storeDetail.setEstimatedTurnover(systemBuildingShopDO.getEstimatedTurnover());
|
||||
// signDate
|
||||
storeDetail.setSignDate(systemBuildingShopDO.getSignDate());
|
||||
// landlordName
|
||||
storeDetail.setLandlordName(systemBuildingShopDO.getLandlordName());
|
||||
// contractDeliveryDate
|
||||
storeDetail.setContractDeliveryDate(systemBuildingShopDO.getContractDeliveryDate());
|
||||
// landlordMobile
|
||||
storeDetail.setLandlordMobile(systemBuildingShopDO.getLandlordMobile());
|
||||
// reservation
|
||||
storeDetail.setReservation(systemBuildingShopDO.getReservation());
|
||||
// storeRent
|
||||
storeDetail.setStoreRent(systemBuildingShopDO.getStoreRent());
|
||||
// storeFranchiseFee
|
||||
storeDetail.setStoreFranchiseFee(systemBuildingShopDO.getStoreFranchiseFee());
|
||||
// storeSecurityDeposit
|
||||
storeDetail.setStoreSecurityDeposit(systemBuildingShopDO.getStoreSecurityDeposit());
|
||||
// reasons
|
||||
storeDetail.setReasons(systemBuildingShopDO.getReasons());
|
||||
// regioGeneral
|
||||
supervisorDetail.setRegioGeneral(systemBuildingShopDO.getRegioGeneral());
|
||||
// regioGeneralId
|
||||
supervisorDetail.setRegioGeneralId(systemBuildingShopDO.getRegioGeneralId());
|
||||
}
|
||||
if (Objects.nonNull(lineInfoDO)){
|
||||
RegionDO byRegionId = regionMapper.getByRegionId(lineInfoDO.getRegionId());
|
||||
franInfo.setSubregion(byRegionId.getName());
|
||||
franInfo.setPartnerNum(lineInfoDO.getPartnerNum());
|
||||
franInfo.setFranchiseeMobile(lineInfoDO.getMobile());
|
||||
franInfo.setFranchiseeName(lineInfoDO.getUsername());
|
||||
}
|
||||
sysStoreAppResponse.setStoreDetail(storeDetail);
|
||||
sysStoreAppResponse.setSupervisorDetail(supervisorDetail);
|
||||
sysStoreAppResponse.setFranInfo(franInfo);
|
||||
return sysStoreAppResponse;
|
||||
}
|
||||
|
||||
public NewStoreRequest convertToNewStoreRequest(
|
||||
SysStoreAppRequest sysStoreAppRequest,
|
||||
LineInfoDO lineInfoDO,
|
||||
PointInfoDO pointInfoDO) {
|
||||
NewStoreRequest newStoreRequest = new NewStoreRequest();
|
||||
ArrayList<String> objects = new ArrayList<>();
|
||||
objects.add("123");
|
||||
// accessory_address
|
||||
newStoreRequest.setAccessory_address(objects);
|
||||
// apply_user
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
//todo 写死
|
||||
newStoreRequest.setApply_user("19110026");
|
||||
// city1
|
||||
newStoreRequest.setCity1(pointInfoDO.getCity());
|
||||
// csgs
|
||||
ThirdDepartmentDO thirdDepartmentDO = thirdDepartmentMapper.getByName(sysStoreAppRequest.getStoreDetail().getBigName());
|
||||
newStoreRequest.setCsgs(thirdDepartmentDO.getDepartmentCode());
|
||||
// csqmc
|
||||
newStoreRequest.setCsqmc(BusinessDistrictEnum.getByCode(sysStoreAppRequest.getStoreDetail().getSubBusinessType()).getDesc());
|
||||
// ddxm
|
||||
EnterpriseUserDO ddxm = enterpriseUserMapper.getUserInfoById(sysStoreAppRequest.getSupervisorDetail().getSupervisorId());//督导
|
||||
newStoreRequest.setDdxm("22090043");
|
||||
// dpzlht
|
||||
newStoreRequest.setDpzlht(objects);
|
||||
// end_time
|
||||
newStoreRequest.setEnd_time(null);
|
||||
// forecast_turnover
|
||||
newStoreRequest.setForecast_turnover(sysStoreAppRequest.getStoreDetail().getEstimatedTurnover());
|
||||
// invite_people
|
||||
//todo xiesi
|
||||
EnterpriseUserDO invitePeople = enterpriseUserMapper.getUserInfoById(sysStoreAppRequest.getFranInfo().getInviteUserId());//邀约人
|
||||
newStoreRequest.setInvite_people("21100037");
|
||||
// jms_id
|
||||
newStoreRequest.setJms_id(lineInfoDO.getPartnerNum());
|
||||
// jmskhdjbwzjt
|
||||
newStoreRequest.setJmskhdjbwzjt(objects);
|
||||
// join_channel
|
||||
newStoreRequest.setJoin_channel(sysStoreAppRequest.getFranInfo().getFranchiseeType());
|
||||
// jzdsmc
|
||||
newStoreRequest.setJzdsmc(OfflineCompetitorEnum.getByCode(sysStoreAppRequest.getStoreDetail().getOfflineCompetitor()).getDesc());
|
||||
// kdzBusinessid
|
||||
newStoreRequest.setKdzBusinessId(AuditEnum.SYS_BUILD.getCode() + "_" +sysStoreAppRequest.getShopId() + "_" +pointInfoDO.getId());
|
||||
// kllzsmc
|
||||
newStoreRequest.setKllzsmc(PassengerFlowEnum.getByCode(sysStoreAppRequest.getStoreDetail().getAverageDailyRs()).getDesc());
|
||||
// landlord_name
|
||||
newStoreRequest.setLandlord_name(sysStoreAppRequest.getStoreDetail().getLandlordName());
|
||||
// landlord_tel
|
||||
newStoreRequest.setLandlord_tel(sysStoreAppRequest.getStoreDetail().getLandlordMobile());
|
||||
// location_people
|
||||
EnterpriseUserDO locationPeople = enterpriseUserMapper.getUserInfoById(pointInfoDO.getDevelopmentManager());//门店选址人
|
||||
//todo 写死
|
||||
newStoreRequest.setLocation_people("21100037");
|
||||
// mdyzj
|
||||
newStoreRequest.setMdyzj(sysStoreAppRequest.getStoreDetail().getStoreRent());
|
||||
// merchant_people
|
||||
EnterpriseUserDO merchantPeople = enterpriseUserMapper.getUserInfoById(lineInfoDO.getInvestmentManager());//招商人工号
|
||||
//todo 写死
|
||||
newStoreRequest.setMerchant_people("22090043");
|
||||
// name1
|
||||
newStoreRequest.setName1(sysStoreAppRequest.getStoreDetail().getStoreName());
|
||||
// regio
|
||||
newStoreRequest.setRegio(pointInfoDO.getProvince());
|
||||
// reservation_date
|
||||
newStoreRequest.setReservation_date(DateUtil.format(sysStoreAppRequest.getStoreDetail().getReservation(), Constants.TIME_STAMP_FLAG));
|
||||
// room_date
|
||||
newStoreRequest.setRoom_date(DateUtil.format(sysStoreAppRequest.getStoreDetail().getContractDeliveryDate(), Constants.TIME_STAMP_FLAG));
|
||||
// scjdxz
|
||||
newStoreRequest.setScjdxz(objects);
|
||||
// signing_date
|
||||
newStoreRequest.setSigning_date(DateUtil.format(sysStoreAppRequest.getStoreDetail().getSignDate(), Constants.TIME_STAMP_FLAG));
|
||||
// sqmdlx
|
||||
newStoreRequest.setSqmdlx(sysStoreAppRequest.getStoreDetail().getBusinessStoreType());
|
||||
// sqrq
|
||||
newStoreRequest.setSqrq(DateUtil.today());
|
||||
// ssdq
|
||||
newStoreRequest.setSsdq(sysStoreAppRequest.getStoreDetail().getBigCode());
|
||||
// ssxq
|
||||
newStoreRequest.setSsxq(sysStoreAppRequest.getStoreDetail().getSmallCode());
|
||||
// sszq
|
||||
newStoreRequest.setSszq(sysStoreAppRequest.getStoreDetail().getFightCode());
|
||||
// start_time
|
||||
newStoreRequest.setStart_time(null);
|
||||
// store_bzj
|
||||
newStoreRequest.setStore_bzj(sysStoreAppRequest.getStoreDetail().getStoreSecurityDeposit());
|
||||
// store_jmf
|
||||
newStoreRequest.setStore_jmf(sysStoreAppRequest.getStoreDetail().getStoreFranchiseFee());
|
||||
// store_reason
|
||||
newStoreRequest.setStore_reason(sysStoreAppRequest.getStoreDetail().getReasons());
|
||||
// street
|
||||
newStoreRequest.setStreet(pointInfoDO.getTownship());
|
||||
// title
|
||||
newStoreRequest.setTitle("SAP-新店开业申请-" + lineInfoDO.getUsername() + "-" + DateUtil.today());
|
||||
// zcsqlx
|
||||
newStoreRequest.setZcsqlx(sysStoreAppRequest.getStoreDetail().getSubBusinessType());
|
||||
// zdqms
|
||||
newStoreRequest.setZdqms(sysStoreAppRequest.getStoreDetail().getBigName());
|
||||
// zhkkz
|
||||
newStoreRequest.setZhkkz("Y");
|
||||
// zjmsbm
|
||||
newStoreRequest.setZjmsbm(lineInfoDO.getPartnerNum());
|
||||
// zmddh
|
||||
newStoreRequest.setZmddh(lineInfoDO.getMobile());
|
||||
// zmdjyz
|
||||
newStoreRequest.setZmdjyz(sysStoreAppRequest.getStoreDetail().getStoreOperator());
|
||||
// zmdjyz_name
|
||||
newStoreRequest.setZmdjyz_name(StoreOperatorEnum.getByCode(sysStoreAppRequest.getStoreDetail().getStoreOperator()).getDesc());
|
||||
// zmdxz
|
||||
newStoreRequest.setZmdxz(20);
|
||||
// zmdxz_name
|
||||
newStoreRequest.setZmdxz_name("加盟");
|
||||
// zmdzt
|
||||
newStoreRequest.setZmdzt(10);
|
||||
// zmrjkllzs1
|
||||
newStoreRequest.setZmrjkllzs1(sysStoreAppRequest.getStoreDetail().getAverageDailyRs());
|
||||
// zppsyfy
|
||||
newStoreRequest.setZppsyfy(0.05);
|
||||
// zq
|
||||
newStoreRequest.setZq(pointInfoDO.getDistrict());
|
||||
// zsqmc
|
||||
newStoreRequest.setZsqmc(BusinessDistrictEnum.getByCode(sysStoreAppRequest.getStoreDetail().getMainBusinessType()).getDesc());
|
||||
// zssgs
|
||||
newStoreRequest.setZssgs("1060");
|
||||
// ztype
|
||||
newStoreRequest.setZtype("Z1");
|
||||
// zwesfj
|
||||
newStoreRequest.setZwesfj(sysStoreAppRequest.getStoreDetail().getAveragePriceSh());
|
||||
// zxqms
|
||||
newStoreRequest.setZxqms(sysStoreAppRequest.getStoreDetail().getSmallCode());
|
||||
// zxszyjzds
|
||||
newStoreRequest.setZxszyjzds(sysStoreAppRequest.getStoreDetail().getOfflineCompetingBrand());
|
||||
// zxxdz
|
||||
newStoreRequest.setZxxdz(pointInfoDO.getAddress());
|
||||
// zxxzyjzds
|
||||
newStoreRequest.setZxxzyjzds(sysStoreAppRequest.getStoreDetail().getOfflineCompetitor());
|
||||
// zymdbm
|
||||
newStoreRequest.setZymdbm(pointInfoDO.getPointCode());
|
||||
// zzqms
|
||||
newStoreRequest.setZzqms(sysStoreAppRequest.getStoreDetail().getFightName());
|
||||
newStoreRequest.setZzsqlx(sysStoreAppRequest.getStoreDetail().getMainBusinessType());
|
||||
// zzsqlx
|
||||
return newStoreRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean auditResult(AuditResultRequest request) {
|
||||
String kdzBusinessId = request.getKdzBusinessId();
|
||||
Long shopId = getShopId(kdzBusinessId);
|
||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||
//1.成功/失败原因
|
||||
try {
|
||||
shopAuditInfoDO.setShopId(shopId);
|
||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.SYS_BUILD.getCode());
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
|
||||
shopAuditInfoDO.setSubmittedUserName(user.getName());
|
||||
if (request.getAuditResult() == 0){
|
||||
shopAuditInfoDO.setResultType(1);
|
||||
shopAuditInfoDO.setRejectReason(request.getCause());
|
||||
}else if (request.getAuditResult() == 1){
|
||||
shopAuditInfoDO.setResultType(0);
|
||||
shopAuditInfoDO.setPassReason(request.getCause());
|
||||
}
|
||||
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
||||
}catch (Exception e){
|
||||
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
|
||||
}finally {
|
||||
//2.校验建店与加盟签约合同是否完成 并初始化后续流程数据
|
||||
preparationService.contractAndBuildStoreCompletion(shopId);
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setId(shopId);
|
||||
shopInfoDO.setStoreNum(request.getStoreNum());
|
||||
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private Long getShopId(String kdzBusinessId) {
|
||||
String shopId = kdzBusinessId.substring(kdzBusinessId.indexOf("_") + 1,kdzBusinessId.lastIndexOf("_"));
|
||||
return Long.valueOf(shopId);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.wx.*;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.UserChannelEnum;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.http.WechatRest;
|
||||
import com.cool.store.mapper.HyPartnerUserChannelMapper;
|
||||
@@ -123,6 +122,15 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
|
||||
}
|
||||
hyPartnerUserInfoDO.setUserChannelId(channelId);
|
||||
hyPartnerUserInfoDAO.insertSelective(hyPartnerUserInfoDO);
|
||||
//授权的时候 新增线索 放到公海
|
||||
LineInfoDO lineInfoDO = new LineInfoDO();
|
||||
lineInfoDO.setLineStatus(LineStatusEnum.PUBLIC_SEAS.getCode());
|
||||
lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.INTEND.getCode());
|
||||
lineInfoDO.setMobile(hyPartnerUserInfoDO.getMobile());
|
||||
lineInfoDO.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
|
||||
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_0.getCode());
|
||||
lineInfoDO.setPartnerId(hyPartnerUserInfoDO.getPartnerId());
|
||||
lineInfoDAO.insertOrUpdate(lineInfoDO);
|
||||
}else {
|
||||
hyPartnerUserInfoDO.setOpenid(openid);
|
||||
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(hyPartnerUserInfoDO);
|
||||
|
||||
@@ -172,8 +172,24 @@ public class Constants
|
||||
|
||||
public static final String FRANCHISEE_STORE_NUM = "/api/kdz/franchisee/save";
|
||||
|
||||
public static final String NEW_STORE_URL = "/api/coolstore/start-flow/new-store";
|
||||
|
||||
public static final String FRANCHISE_AGREEMENT_COMPANY = "/api/coolstore/start-flow/franchise-agreement-company";
|
||||
|
||||
public static final String FRANCHISE_AGREEMENT_PERSON = "/api/coolstore/start-flow/franchise-agreement-person";
|
||||
|
||||
public static final Integer ZERO_INTEGER = 0;
|
||||
|
||||
public static final Integer ONE_INTEGER = 1;
|
||||
|
||||
public static final String INSERT_FLAG = "insert";
|
||||
|
||||
public static final String UPDATE_FLAG = "update";
|
||||
|
||||
public static final String TIME_STAMP_FLAG = "yyyy-MM-dd";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user