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

This commit is contained in:
shuo.wang
2024-05-13 16:22:40 +08:00
12 changed files with 182 additions and 207 deletions

View File

@@ -30,6 +30,7 @@ public enum SMSMsgEnum {
DECORATION_MODEL_PAY("装修款待缴费", "","SMS_465961253"),
THREE_ACCEPTANCE_WAIT("三方验收待验收","","SMS_465961257"),
TRAINING_REGISTER_SUCCESS("培训登记中", "", "SMS_466035101"),
TRAINING_ASSESSMENT_SUCCESS("员工培训已完成", "", "SMS_465901266"),
;
private String title;

View File

@@ -77,4 +77,13 @@ public class EmployeeTrainingDAO {
.andIn("assessment_status", statusList);
return employeeTrainingMapper.selectByExample(example);
}
public Integer unCompleteNum() {
List<Integer> statusList = new ArrayList<>();
statusList.add(0);
statusList.add(1);
Example example = new Example(EmployeeTrainingDO.class);
example.createCriteria().andIn("assessment_status", statusList);
return employeeTrainingMapper.selectCountByExample(example);
}
}

View File

@@ -1,15 +1,16 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.RegionDao;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.enums.AuditTypeEnum;
import com.cool.store.enums.MessageEnum;
import com.cool.store.enums.SMSMsgEnum;
import com.cool.store.enums.UserRoleEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.*;
import com.cool.store.request.LicenseListRequest;
import com.cool.store.request.SubmitLicenseRequest;
@@ -97,7 +98,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
licenseTransactDO.setId(request.getId());
applyLicenseMapper.updateByPrimaryKeySelective(licenseTransactDO);
}
if (request.getSubmitStatus() == Constants.ONE_INTEGER) {
if (Constants.ONE_INTEGER.equals(request.getSubmitStatus())) {
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
shopAuditInfoDO.setShopId(request.getShopId());
shopAuditInfoDO.setAuditType(AuditTypeEnum.LICENSE_APPROVAL.getCode());
@@ -109,11 +110,11 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
Map<String, String> requestMap = new HashMap<>();
requestMap.put("shopId",String.valueOf(request.getShopId()));
requestMap.put("storeName",shopInfoDO.getShopName());
requestMap.put("partnerName,",lineInfoDO.getUsername());
requestMap.put("partnerMobile",lineInfoDO.getMobile());
commonService.sendMessage(Arrays.asList(shopInfoDO.getSupervisorUserId()), MessageEnum.MESSAGE_17,requestMap);
requestMap.put("shopId", String.valueOf(request.getShopId()));
requestMap.put("storeName", shopInfoDO.getShopName());
requestMap.put("partnerName,", lineInfoDO.getUsername());
requestMap.put("partnerMobile", lineInfoDO.getMobile());
commonService.sendMessage(Collections.singletonList(shopInfoDO.getSupervisorUserId()), MessageEnum.MESSAGE_17, requestMap);
}
return true;
}
@@ -124,17 +125,17 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
//1.如果已经提交过证照信息,直接查询后组装数据
LicenseTransactDO result = applyLicenseMapper.selectByShopId(shopId);
SubmitLicenseResponse submitLicenseResponse = new SubmitLicenseResponse();
if (Objects.nonNull(result)){
if (Objects.nonNull(result)) {
submitLicenseResponse = SubmitLicenseResponse.from(result);
List<ShopAuditInfoVO> listByShopIdAndType = shopAuditInfoMapper.getListByShopIdAndType(shopId, AuditTypeEnum.LICENSE_APPROVAL.getCode());
List<String> userIds = listByShopIdAndType.stream().map(ShopAuditInfoVO::getSubmittedUserId).collect(Collectors.toList());
List<EnterpriseUserDO> userInfoByUserIds = new ArrayList<>();
List<EnterpriseUserDO> userInfoByUserIds;
if (CollectionUtils.isNotEmpty(userIds)) {
userInfoByUserIds = userMapper.getUserInfoByUserIds(userIds);
Map<String, String> userAvatarMap = userInfoByUserIds.stream()
.filter(item -> StringUtil.isNotBlank(item.getUserId()) && StringUtil.isNotBlank(item.getAvatar()))
.collect(Collectors.toMap(k -> k.getUserId(), v -> v.getAvatar()));
listByShopIdAndType.stream().forEach(item -> {
.collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getAvatar));
listByShopIdAndType.forEach(item -> {
String avatar = userAvatarMap.get(item.getSubmittedUserId());
if (StringUtils.isBlank(avatar)) {
item.setAvatar(Constants.AVATAR_DEFAULT);
@@ -151,7 +152,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
GetStoreInfoByCodeResponse storeInfoCode = coolStoreStartFlowService.getStoreInfoCode(shopInfoDO.getStoreNum());
if (Objects.nonNull(storeInfoCode.getData().getStoreDocument()) && storeInfoCode.getCode() == 0) {
//替换落库的值
submitLicenseResponse = SubmitLicenseResponse.from(storeInfoCode,submitLicenseResponse);
submitLicenseResponse = SubmitLicenseResponse.from(storeInfoCode, submitLicenseResponse);
return submitLicenseResponse;
}
}
@@ -160,27 +161,27 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
}
@Override
public PageInfo<LicenseListResponse> licenseList(LicenseListRequest request,LoginUserInfo user) {
public PageInfo<LicenseListResponse> licenseList(LicenseListRequest request, LoginUserInfo user) {
//当前用户角色
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
List<LicenseListResponse> licenseListResponses = new ArrayList<>();
List<LicenseListResponse> licenseListResponses;
//查证照列表数据
if (userRoleIds.contains(UserRoleEnum.THEATER_MANAGER.getCode())){
if (userRoleIds.contains(UserRoleEnum.THEATER_MANAGER.getCode())) {
//当前用户所属区域
List<UserRegionMappingDO> regionIdsByUserIds = userRegionMappingMapper.getRegionIdsByUserIds(Arrays.asList(user.getUserId()));
List<UserRegionMappingDO> regionIdsByUserIds = userRegionMappingMapper.getRegionIdsByUserIds(Collections.singletonList(user.getUserId()));
List<String> regionIds = regionIdsByUserIds.stream().map(UserRegionMappingDO::getRegionId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(regionIds)){
if (CollectionUtils.isEmpty(regionIds)) {
return new PageInfo<>();
}
List<RegionDO> fightRegion = regionDao.getFightRegionByRegionIds(regionIds);
if (CollectionUtils.isEmpty(fightRegion)){
if (CollectionUtils.isEmpty(fightRegion)) {
return new PageInfo<>();
}
PageHelper.startPage(request.getPageNum(), request.getPageSize());
licenseListResponses = applyLicenseMapper.licenseList(request,null,fightRegion);
}else {
licenseListResponses = applyLicenseMapper.licenseList(request, null, fightRegion);
} else {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
licenseListResponses = applyLicenseMapper.licenseList(request,user.getUserId(),null);
licenseListResponses = applyLicenseMapper.licenseList(request, user.getUserId(), null);
}
List<String> userIdList = new ArrayList<>();
for (LicenseListResponse vo : licenseListResponses) {
@@ -209,7 +210,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean licenseExamine(Long shopId, Integer status, String result,LoginUserInfo user) {
public Boolean licenseExamine(Long shopId, Integer status, String result, LoginUserInfo user) {
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
shopAuditInfoDO.setShopId(shopId);
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
@@ -220,13 +221,13 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
shopAuditInfoDO.setResultType(status);
LicenseTransactDO licenseTransactDO = new LicenseTransactDO();
licenseTransactDO.setShopId(shopId);
if (status == Constants.ZERO_INTEGER) {
if (Constants.ZERO_INTEGER.equals(status)) {
//是否开业验收 改走的流程都已经完成 ->初始化开业验收数据
preparationService.whetherToOpenForAcceptance(shopId);
shopAuditInfoDO.setPassReason(result);
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_43;
licenseTransactDO.setSubmitStatus(3);
} else if (status == Constants.ONE_INTEGER) {
} else if (Constants.ONE_INTEGER.equals(status)) {
licenseTransactDO.setSubmitStatus(2);
shopAuditInfoDO.setRejectReason(result);
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_42;

View File

@@ -1,7 +1,6 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyOpenAreaInfoDAO;
@@ -23,7 +22,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -53,7 +51,7 @@ public class AuditStatusServiceImpl implements AuditStatusService {
@Override
public Boolean audit(AuditCheckRequest request,LoginUserInfo user) {
public Boolean audit(AuditCheckRequest request, LoginUserInfo user) {
//稽核信息
AuditStatusDO auditStatusDO = auditStatusMapper.selectByPrimaryKey(request.getCheckId());
//线索审核信息
@@ -87,8 +85,7 @@ public class AuditStatusServiceImpl implements AuditStatusService {
auditStatusDO.setInterviewId(interviewId);
auditStatusDO.setAuditId(auditId);
auditStatusDO.setAuditStage(auditStage);
int result = auditStatusMapper.insertSelective(auditStatusDO);
return result;
return auditStatusMapper.insertSelective(auditStatusDO);
}
@@ -99,13 +96,13 @@ public class AuditStatusServiceImpl implements AuditStatusService {
LineInterviewDO lineInterviewDO = lineInterviewMapper.selectByPrimaryKey(auditStatusDO.getInterviewId());
LineAuditInfoDO auditInfo = lineAuditInfoDAO.getAuditInfo(auditStatusDO.getAuditId());
response.setVideoUrl(JSONObject.parseArray(lineInterviewDO.getVideoUrl(), String.class));
if (Objects.nonNull(lineInterviewDO.getActualStartTime())){
if (Objects.nonNull(lineInterviewDO.getActualStartTime())) {
response.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, lineInterviewDO.getActualStartTime()));
}
if (Objects.nonNull(lineInterviewDO.getActualEndTime())){
if (Objects.nonNull(lineInterviewDO.getActualEndTime())) {
response.setEndTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, lineInterviewDO.getActualEndTime()));
}
if (Objects.nonNull(auditStatusDO.getUpdateTime())){
if (Objects.nonNull(auditStatusDO.getUpdateTime())) {
response.setCheckTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, auditStatusDO.getUpdateTime()));
}
response.setCheckUser(auditStatusDO.getAuditUserName());
@@ -154,8 +151,6 @@ public class AuditStatusServiceImpl implements AuditStatusService {
x.setWantRegionName(wantShopAreaMap.get(x.getWantRegion()));
x.setInvestmentName(investmentIdMap.get(x.getInvestmentId()));
});
PageInfo<CheckListResponse> pageInfo = new PageInfo<>(checkListResponses);
return pageInfo;
return new PageInfo<>(checkListResponses);
}
}

View File

@@ -2,9 +2,7 @@ package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.dto.xfsgFirstOderDTO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mq.util.HttpRestTemplateService;
@@ -24,7 +22,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Service
@Slf4j

View File

@@ -9,10 +9,7 @@ import com.cool.store.dto.SmallVideoInfoDTO;
import com.cool.store.dto.StaffExamInfoDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.AssessmentTemplateType;
import com.cool.store.enums.ExamStatusEnum;
import com.cool.store.enums.MessageEnum;
import com.cool.store.enums.UserRoleEnum;
import com.cool.store.enums.*;
import com.cool.store.enums.video.ResourceStatusEnum;
import com.cool.store.enums.video.UploadTypeEnum;
import com.cool.store.exception.ServiceException;
@@ -554,7 +551,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
}
EmployeeTrainingDO employeeTrainingDO = employeeTrainingDAO.selectById(request.getEmployeeTrainingId());
TempUserDetailDO tempUserDetailDO = tempUserDetailDAO.selectById(employeeTrainingDO.getXfsgUserDetailId());
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(tempUserDetailDO.getShopId());
Boolean pass = true;
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.getUserInfoByThirdOaUniqueFlag(tempUserDetailDO.getIdCard());
String userId = enterpriseUserDO.getUserId();
@@ -613,6 +610,16 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
employeeTrainingDO.setAssessmentStatus(CommonConstants.TWO);
}
employeeTrainingDAO.updateByPrimaryKeySelective(employeeTrainingDO);
//查询员工是否全部培训完成
Integer unCompleteNum =employeeTrainingDAO.unCompleteNum();
if(unCompleteNum != null && unCompleteNum == 0){
// 培训全部结束
Map<String, String> messageMap = new HashMap<>();
messageMap.put("storeName", shopInfoDO.getShopName());
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(tempUserDetailDO.getLineId());
commonService.sendSms(lineInfoDO.getMobile(), SMSMsgEnum.TRAINING_ASSESSMENT_SUCCESS, messageMap);
}
}
private void checkVideoHandel(List<AssessmentDataDO> assessmentDataDOList) {

View File

@@ -1,7 +1,6 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.*;
@@ -21,10 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.*;
@Service
@Slf4j
@@ -92,7 +88,7 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
}
@Override
public Boolean auditFranchiseFee(AuditFranchiseFeeRequest request,LoginUserInfo user) {
public Boolean auditFranchiseFee(AuditFranchiseFeeRequest request, LoginUserInfo user) {
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
shopAuditInfoDO.setShopId(request.getShopId());
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
@@ -101,21 +97,21 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
shopAuditInfoDO.setSubmittedUserName(user.getName());
shopAuditInfoDO.setDataType(1);
shopAuditInfoDO.setResultType(request.getStatus());
if (request.getStatus() == Constants.ZERO_INTEGER) {
if (Constants.ZERO_INTEGER.equals(request.getStatus())) {
shopAuditInfoDO.setPassReason(request.getResult());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73;
} else if (request.getStatus() == Constants.ONE_INTEGER) {
} else if (Constants.ONE_INTEGER.equals(request.getStatus())) {
shopAuditInfoDO.setRejectReason(request.getResult());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74;
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
commonService.sendSms(lineInfoDO.getMobile(),SMSMsgEnum.FRANCHISE_FEE_NOT_PASS);
commonService.sendSms(lineInfoDO.getMobile(), SMSMsgEnum.FRANCHISE_FEE_NOT_PASS);
}
//插入audit
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
//更新阶段信息
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80);
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), shopSubStageStatusEnum,shopAuditInfoDO.getId());
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), shopSubStageStatusEnum, shopAuditInfoDO.getId());
//更新auditId
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByPrimaryKey(request.getId());
franchiseFeeDO.setAuditId(shopAuditInfoDO.getId());
@@ -124,11 +120,11 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
Map<String, String> requestMap = new HashMap<>();
requestMap.put("storeName",shopInfoDO.getShopName());
requestMap.put("partnerName",lineInfoDO.getUsername());
requestMap.put("partnerMobile",lineInfoDO.getMobile());
requestMap.put("lineId",String.valueOf(lineInfoDO.getId()));
commonService.sendMessage(Arrays.asList(lineInfoDO.getInvestmentManager()), MessageEnum.MESSAGE_18,requestMap);
requestMap.put("storeName", shopInfoDO.getShopName());
requestMap.put("partnerName", lineInfoDO.getUsername());
requestMap.put("partnerMobile", lineInfoDO.getMobile());
requestMap.put("lineId", String.valueOf(lineInfoDO.getId()));
commonService.sendMessage(Collections.singletonList(lineInfoDO.getInvestmentManager()), MessageEnum.MESSAGE_18, requestMap);
return true;
}
}

View File

@@ -1,7 +1,6 @@
package com.cool.store.service.impl;
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.*;
@@ -171,7 +170,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Override
public ResponseResult initiating(InitiatingRequest request,LoginUserInfo user) {
public ResponseResult initiating(InitiatingRequest request, LoginUserInfo user) {
log.info("initiating request:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
@@ -191,7 +190,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
} else {
String redisKey = "OA:" + request.getMobile() + request.getIdCardNo();
log.info("initiating redisKey:{},request:{}",redisKey,JSONObject.toJSONString(request));
log.info("initiating redisKey:{},request:{}", redisKey, JSONObject.toJSONString(request));
redisUtilPool.setString(redisKey, JSONObject.toJSONString(request));
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
@@ -204,14 +203,13 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
String redisKey = "OA:" + mobile + idCardNo;
String responseString = redisUtilPool.getString(redisKey);
if (StringUtils.isNotBlank(responseString)) {
InitiatingRequest initiatingRequest = JSONObject.parseObject(responseString, InitiatingRequest.class);
return initiatingRequest;
return JSONObject.parseObject(responseString, InitiatingRequest.class);
}
return null;
}
@Override
public ResponseResult save(FranchiseeSaveRequest request,LoginUserInfo user) {
public ResponseResult save(FranchiseeSaveRequest request, LoginUserInfo user) {
log.info("save request:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
@@ -293,8 +291,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
}
private String getLineId(String kdzBusinessId) {
String lindId = kdzBusinessId.substring(kdzBusinessId.indexOf("_") + 1, kdzBusinessId.lastIndexOf("_"));
return lindId;
return kdzBusinessId.substring(kdzBusinessId.indexOf("_") + 1, kdzBusinessId.lastIndexOf("_"));
}
private void fillSignatureInfo(Map<String, Object> requestMap) {

View File

@@ -1,7 +1,6 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.HyOpenAreaInfoDAO;
import com.cool.store.dao.LineInfoDAO;
import com.cool.store.dao.RegionAreaConfigDao;
import com.cool.store.entity.*;
@@ -13,7 +12,6 @@ import com.cool.store.mapper.LineAuditInfoMapper;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.request.JoinIntentionRequest;
import com.cool.store.service.JoinIntentionService;
import com.cool.store.service.OpenAreaService;
import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.vo.PartnerBaseInfoVO;
@@ -22,16 +20,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.xml.bind.util.JAXBSource;
import java.util.Objects;
import static com.cool.store.enums.ErrorCodeEnum.LINE_ID_IS_NOT_EXIST;
/**
* @author guohb
* @ClassName JoinIntentionServiceImpl
* @Date 2022/10/23 16:16
*/
@Service
@Slf4j
public class JoinIntentionServiceImpl extends LineFlowService implements JoinIntentionService {
@@ -70,17 +61,14 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
lineInfoParam.setWorkflowStage(WorkflowStageEnum.INTENT.getCode());
lineInfoParam.setWorkflowSubStage(WorkflowSubStageEnum.INTEND.getCode());
lineInfoParam.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_5.getCode());
if (Objects.isNull(lineInfoParam)) {
throw new ServiceException(ErrorCodeEnum.INTERVIEW_PARTNER_NOT_EXIST);
}
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
if ((Objects.nonNull(request.getAreaCode()) && Objects.nonNull(lineInfoDO) && StringUtils.isBlank(lineInfoDO.getInvestmentManager())) || (Objects.isNull(lineInfoDO))){
if ((Objects.nonNull(request.getAreaCode()) && Objects.nonNull(lineInfoDO) && StringUtils.isBlank(lineInfoDO.getInvestmentManager())) || (Objects.isNull(lineInfoDO))) {
EnterpriseUserDO userByRoleNameAndAreaId = userAuthMappingService.getUserByRoleEnumAndWantShopAreaId(UserRoleEnum.INVESTMENT_COMMISSIONER, Long.valueOf(request.getAreaCode()));
lineInfoParam.setInvestmentManager(userByRoleNameAndAreaId.getUserId());
}
//todo 目前写死为进入私海
lineInfoParam.setLineStatus(1);
if (lineInfoParam.getWantShopAreaId() != null){
if (lineInfoParam.getWantShopAreaId() != null) {
Long regionId = regionAreaConfigDao.getByWantShopAreaId(lineInfoParam.getWantShopAreaId());
lineInfoParam.setRegionId(regionId);
}
@@ -92,23 +80,23 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
}
@Override
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo,String userId) {
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo, String userId) {
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
//更新线索阶段
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(), userId);
//更新加盟问卷信息
joinIntentionMapper.updateAuditIdByLineId(auditId,lineInfo.getId());
joinIntentionMapper.updateAuditIdByLineId(auditId, lineInfo.getId());
return Boolean.TRUE;
}
@Override
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo,String userId) {
protected Boolean auditReject(Long auditId, LineInfoDO lineInfo, String userId) {
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.INTENT_7.getCode());
lineInfo.setUpdateUserId(userId);
lineInfoDAO.updateLineInfo(lineInfo);
//更新加盟问卷信息
joinIntentionMapper.updateAuditIdByLineId(auditId,lineInfo.getId());
joinIntentionMapper.updateAuditIdByLineId(auditId, lineInfo.getId());
return Boolean.TRUE;
}
@@ -120,15 +108,15 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
if (Objects.isNull(byLineId)) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
if (Objects.isNull(result)){
if (Objects.isNull(result)) {
return new PartnerBaseInfoVO();
}
PartnerBaseInfoVO response = PartnerBaseInfoVO.from(result, byLineId);
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(Long.valueOf(response.getAreaCode()));
response.setArea(openAreaInfoDO.getAreaPath());
if (Objects.nonNull(result.getAuditId())){
if (Objects.nonNull(result.getAuditId())) {
LineAuditInfoDO lineAuditInfoDO = lineAuditInfoMapper.selectByPrimaryKey(result.getAuditId());
if (Objects.isNull(lineAuditInfoDO)){
if (Objects.isNull(lineAuditInfoDO)) {
response.setRejectPublicReason(null);
}
response.setRejectPublicReason(lineAuditInfoDO.getRejectPublicReason());

View File

@@ -6,7 +6,6 @@ import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.LicenseTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.ApplyLicenseMapper;
import com.cool.store.mapper.PointInfoMapper;
import com.cool.store.mapper.ShopInfoMapper;
import com.cool.store.request.AuditResultRequest;
import com.cool.store.response.LicenseApiResponse;
@@ -15,9 +14,6 @@ import com.cool.store.utils.StringUtil;
import com.cool.store.utils.poi.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.swagger2.mappers.LicenseMapper;
import javax.annotation.Resource;
import java.util.Objects;
@@ -40,34 +36,32 @@ public class KdzApiServiceImpl implements KdzApiService {
if (Objects.isNull(request) || StringUtil.isBlank(request.getKdzBusinessId())) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
}
Boolean result = commonService.getAuditService(request).auditResult(request);
return result;
return commonService.getAuditService(request).auditResult(request);
}
@Override
public LicenseApiResponse license(String storeNum) {
ShopInfoDO shopInfoDO = shopInfoMapper.selectByStoreNum(storeNum);
if (Objects.isNull(shopInfoDO)){
if (Objects.isNull(shopInfoDO)) {
throw new ServiceException(ErrorCodeEnum.STORE_NUM_NOT_FOUND);
}
Long shopId = shopInfoDO.getId();
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectByShopId(shopId);
if (Objects.isNull(licenseTransactDO)){
if (Objects.isNull(licenseTransactDO)) {
throw new ServiceException(ErrorCodeEnum.LICENSE_NOT_EXIST);
}
LicenseApiResponse convertResp = convert(licenseTransactDO,storeNum);
return convertResp;
return convert(licenseTransactDO, storeNum);
}
public LicenseApiResponse convert(LicenseTransactDO licenseTransactDO,
String storeNum){
LicenseApiResponse response = LicenseApiResponse.builder()
String storeNum) {
return LicenseApiResponse.builder()
.storeBusinessAdd(licenseTransactDO.getLicenseAddress())
.storeBusinessDate(DateUtils.dateTime(licenseTransactDO.getIssueTime()))
.storeBusinessImg(licenseTransactDO.getCreditUrl())
.storeBusinessName(licenseTransactDO.getBusinessLicense())
.storeBusinessNumber(licenseTransactDO.getCreditCode())
.storeBusinessType(LicenseTypeEnum.match(licenseTransactDO.getLicenseType()).getMessage())
.storeBusinessType(Objects.requireNonNull(LicenseTypeEnum.match(licenseTransactDO.getLicenseType())).getMessage())
.storeBusinessValidPeriod(Objects.isNull(licenseTransactDO.getValidity()) ? "9" : DateUtils.dateTime(licenseTransactDO.getValidity()))
.storeCode(storeNum)
.storeDirector(licenseTransactDO.getLicenseLegalPerson())
@@ -82,7 +76,5 @@ public class KdzApiServiceImpl implements KdzApiService {
.storeFoodLicenseOperatorName(licenseTransactDO.getOperator())
.storeRemark("")
.build();
return response;
}
}

View File

@@ -3,7 +3,6 @@ package com.cool.store.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.ShopStageInfoDAO;
import com.cool.store.entity.*;
@@ -21,7 +20,6 @@ import com.cool.store.service.PreparationService;
import com.cool.store.service.SignFranchiseService;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.constant.Constants;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -96,18 +94,18 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
shopAuditInfoDO.setAuditType(AuditTypeEnum.SIGN_FRANCHISE.getCode());
shopAuditInfoDO.setSubmittedUserId("");
shopAuditInfoDO.setSubmittedUserName("");
if (request.getAuditResult() == Constants.ZERO_INTEGER){
if (Constants.ZERO_INTEGER.equals(request.getAuditResult())) {
shopAuditInfoDO.setResultType(Constants.ONE_INTEGER);
shopAuditInfoDO.setRejectReason(request.getCause());
Map<String, String> requestMap = new HashMap<>();
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
LineInfoDO lineInfo = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
requestMap.put("storeName",shopInfoDO.getShopName());
requestMap.put("partnerName",lineInfo.getUsername());
requestMap.put("partnerMobile",lineInfo.getMobile());
requestMap.put("lineId",String.valueOf(lineInfo.getId()));
commonService.sendMessage(Arrays.asList(lineInfo.getInvestmentManager()), MessageEnum.MESSAGE_19,requestMap);
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
requestMap.put("storeName", shopInfoDO.getShopName());
requestMap.put("partnerName", lineInfo.getUsername());
requestMap.put("partnerMobile", lineInfo.getMobile());
requestMap.put("lineId", String.valueOf(lineInfo.getId()));
commonService.sendMessage(Collections.singletonList(lineInfo.getInvestmentManager()), MessageEnum.MESSAGE_19, requestMap);
} else if (Constants.ONE_INTEGER.equals(request.getAuditResult())) {
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
shopAuditInfoDO.setPassReason(request.getCause());
//校验建店与加盟签约合同是否完成 并初始化后续流程数据
@@ -115,8 +113,8 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
}
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
Long auditId = shopAuditInfoDO.getId();
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum,auditId);
systemBuildingShopMapper.updateAuditByShopId(auditId,shopId);
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum, auditId);
systemBuildingShopMapper.updateAuditByShopId(auditId, shopId);
return true;
}
@@ -127,7 +125,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
@Override
@Transactional(rollbackFor = Exception.class)
public ResponseResult submitSignFranchise(AddSignFranchiseRequest request,LoginUserInfo user) {
public ResponseResult submitSignFranchise(AddSignFranchiseRequest request, LoginUserInfo user) {
log.info("submitSignFranchise request:{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
@@ -143,7 +141,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
}
//店铺信息
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
FranchiseAgreementRequest franchiseAgreementRequest = convertFranchiseAgreement(request, shopInfoDO,user);
FranchiseAgreementRequest franchiseAgreementRequest = convertFranchiseAgreement(request, shopInfoDO, user);
MemberQuestionDO memberQuestionDO = joinIntentionMapper.getByLineId(shopInfoDO.getLineId());
ResponseResult responseResult = coolStoreStartFlowService.franchiseAgreement(franchiseAgreementRequest, memberQuestionDO.getJoinType());
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83);
@@ -166,7 +164,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
//签约信息
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineId);
//缴款信息
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId, 1,shopId);
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId, 1, shopId);
//铺位信息
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(lineId, shopId);
//建店数据
@@ -174,24 +172,24 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
//证照办理
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectByShopId(shopId);
ThirdDepartmentDO thirdDepartmentDO = new ThirdDepartmentDO();
if (Objects.nonNull(systemBuildingShopDO)){
if (Objects.nonNull(systemBuildingShopDO)) {
//三方部门表
thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
}
//找不到的url统一用这个
List<String> temp = new ArrayList<>();
temp.add("object");
Convert.digitToChinese(123);
FranchiseAgreementRequest buildResult = FranchiseAgreementRequest.builder()
// .apply_user(user.getJobNumber())
return FranchiseAgreementRequest.builder()
// todo .apply_user(user.getJobNumber())
.apply_user("20230724")
.company(0)
.start1(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO,franchiseFeeDO.getFirstYearStartTime()))
.start2(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO,franchiseFeeDO.getSecondYearStartTime()))
.start3(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO,franchiseFeeDO.getThirdYearStartTime()))
.end1(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO,franchiseFeeDO.getFirstYearEndTime()))
.end2(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO,franchiseFeeDO.getSecondYearEndTime()))
.end3(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO,franchiseFeeDO.getThirdYearEndTime()))
.start1(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO, franchiseFeeDO.getFirstYearStartTime()))
.start2(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO, franchiseFeeDO.getSecondYearStartTime()))
.start3(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO, franchiseFeeDO.getThirdYearStartTime()))
.end1(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO, franchiseFeeDO.getFirstYearEndTime()))
.end2(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO, franchiseFeeDO.getSecondYearEndTime()))
.end3(getDateTimeFormat(Constants.TIME_STAMP_FLAG_TWO, franchiseFeeDO.getThirdYearEndTime()))
.fjsc(temp)
.fqgsmc("鲜丰水果股份有限公司")
.fzzd1(0)
@@ -205,13 +203,13 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
.ht_month2(DateTime.of(request.getContractStartEndTime()).getMonth())
.ht_year1(DateTime.of(request.getContractStartTime()).getYear())
.ht_year2(DateTime.of(request.getContractStartEndTime()).getYear())
.idcard_1(Arrays.asList(signingBaseInfoDO.getIdCardFront()))
.idcard_2(Arrays.asList(signingBaseInfoDO.getIdCardReverse()))
.idcard_1(Collections.singletonList(signingBaseInfoDO.getIdCardFront()))
.idcard_2(Collections.singletonList(signingBaseInfoDO.getIdCardReverse()))
.idcard_address(signingBaseInfoDO.getIdCardAddress())
.is_business_license(request.getIsBusinessLicense())
.is_deposit(1)
.is_food_license(request.getIsFoodLicense())
.jiaokuandate(getDateTimeFormat(Constants.TIME_STAMP_FLAG,linePayDO.getPayTime()))
.jiaokuandate(getDateTimeFormat(Constants.TIME_STAMP_FLAG, linePayDO.getPayTime()))
.jkr(linePayDO.getPayUserName())
.jmd_area(pointInfoDO.getDistrict())
.jmd_city(pointInfoDO.getCity())
@@ -249,7 +247,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
.jmssfzhm(signingBaseInfoDO.getIdCardNo())
.jmsxm(lineInfoDO.getPartnerNum())
.jmsxm1(lineInfoDO.getUsername())
.jsrq(getDateTimeFormat(Constants.TIME_STAMP_FLAG,request.getContractStartEndTime()))
.jsrq(getDateTimeFormat(Constants.TIME_STAMP_FLAG, request.getContractStartEndTime()))
.jszhhz(linePayDO.getPayAccount())
.kdzBusinessId(AuditEnum.SIGN_FRANCHISE + "_" + shopId + "_" + lineId)
.khhjzh(linePayDO.getBankName())
@@ -263,10 +261,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
.partyb_name(licenseTransactDO.getBusinessLicense())
.partyb_operator(licenseTransactDO.getOperator())
.partyb_type(licenseTransactDO.getLicenseType())
.ppsyfbl(Double.valueOf(request.getBrandFee()))
.ppsyfbl(Double.parseDouble(request.getBrandFee()))
.psfl("以实际结算为准")
.qsdz("PUBLIC_COMPANY")
.qsrq(getDateTimeFormat(Constants.TIME_STAMP_FLAG,request.getContractStartTime()))
.qsrq(getDateTimeFormat(Constants.TIME_STAMP_FLAG, request.getContractStartTime()))
.qylx(SignTypeEnum.getWorkflowStageByCode(request.getSignType()).getCode())
.qys_dzyz("2731707107593166911")
.qys_htywfl("3051420203180101971")
@@ -274,12 +272,12 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
.remark(request.getRemark())
.remark2(systemBuildingShopDO.getReasons())
.sfbq__add(request.getResign())
.sj1(getDateTimeFormat(Constants.TIME_STAMP_FLAG_THREE,request.getBusinessStartHours()))
.sj2(getDateTimeFormat(Constants.TIME_STAMP_FLAG_THREE,request.getBusinessEndHours()))
.sj1(getDateTimeFormat(Constants.TIME_STAMP_FLAG_THREE, request.getBusinessStartHours()))
.sj2(getDateTimeFormat(Constants.TIME_STAMP_FLAG_THREE, request.getBusinessEndHours()))
.social_credit_code(licenseTransactDO.getCreditCode())
.spltxkz(temp)
.sqr_name(user.getName())
.sqrq(getDateTimeFormat(Constants.TIME_STAMP_FLAG,new Date()))
.sqrq(getDateTimeFormat(Constants.TIME_STAMP_FLAG, new Date()))
.title("特许经营合同审批申请2023-" + lineInfoDO.getUsername() + "-" + DateUtils.getDate())
.wlyzbm("201905081151092R")
.yycs(Integer.valueOf(request.getImpressionNum()))
@@ -288,28 +286,25 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
.zhihang(linePayDO.getBranchBankName())
.zqyty(SignTypeEnum.getWorkflowStageByCode(request.getSignType()).getSap())
.build();
return buildResult;
}
@Override
public AddSignFranchiseResponse getSignFranchise(Long shopId) {
SignFranchiseDO signFranchiseDO = signFranchiseMapper.selectByShopId(shopId);
if (Objects.isNull(signFranchiseDO)){
if (Objects.isNull(signFranchiseDO)) {
throw new ServiceException(ErrorCodeEnum.SIGN_FRANCHISE_NOT_FOUND);
}
AddSignFranchiseResponse response = from(signFranchiseDO, shopId);
if (Objects.nonNull(signFranchiseDO)){
ShopAuditInfoDO shopAuditInfoDO = shopAuditInfoMapper.selectByPrimaryKey(signFranchiseDO.getAuditId());
if (Objects.nonNull(shopAuditInfoDO)){
response.setStatus(shopAuditInfoDO.getResultType());
if (shopAuditInfoDO.getResultType() == 0){
response.setResult(shopAuditInfoDO.getPassReason());
}else {
response.setResult(shopAuditInfoDO.getRejectReason());
}
response.setResultTime(shopAuditInfoDO.getCreateTime());
ShopAuditInfoDO shopAuditInfoDO = shopAuditInfoMapper.selectByPrimaryKey(signFranchiseDO.getAuditId());
if (Objects.nonNull(shopAuditInfoDO)) {
response.setStatus(shopAuditInfoDO.getResultType());
if (shopAuditInfoDO.getResultType() == 0) {
response.setResult(shopAuditInfoDO.getPassReason());
} else {
response.setResult(shopAuditInfoDO.getRejectReason());
}
response.setResultTime(shopAuditInfoDO.getCreateTime());
}
return response;
}
@@ -330,7 +325,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
//签约信息
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineId);
//缴款信息
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId, 1,shopId);
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId, 1, shopId);
//铺位信息
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(lineId, shopId);
//建店数据
@@ -356,40 +351,40 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
} else {
addSignFranchiseResponse.setMobile(lineInfoDO.getMobile());
}
if(Objects.nonNull(systemBuildingShopDO)){
if (Objects.nonNull(systemBuildingShopDO)) {
addSignFranchiseResponse.setStoreName(systemBuildingShopDO.getStoreName());
addSignFranchiseResponse.setBigRegion(systemBuildingShopDO.getBigName());
addSignFranchiseResponse.setBigRegionManager(systemBuildingShopDO.getRegioGeneral());
addSignFranchiseResponse.setFranchiseeType(FranchiseeTypeEnum.getByCode(systemBuildingShopDO.getFranchiseeType()).getMessage());
addSignFranchiseResponse.setFranchiseeType(Objects.requireNonNull(FranchiseeTypeEnum.getByCode(systemBuildingShopDO.getFranchiseeType())).getMessage());
addSignFranchiseResponse.setReasons(systemBuildingShopDO.getReasons());
}
if (Objects.nonNull(pointInfoDO)){
if (Objects.nonNull(pointInfoDO)) {
addSignFranchiseResponse.setStoreAddress(pointInfoDO.getAddress());
}
if (Objects.nonNull(linePayDO)){
if (Objects.nonNull(linePayDO)) {
addSignFranchiseResponse.setPayName(linePayDO.getPayUserName());
addSignFranchiseResponse.setBankCardNo(linePayDO.getPayAccount());
addSignFranchiseResponse.setBank(linePayDO.getBankName());
addSignFranchiseResponse.setSubBank(linePayDO.getBranchBankName());
addSignFranchiseResponse.setPayDate(linePayDO.getPayTime());
}
if (Objects.nonNull(licenseTransactDO)){
if (Objects.nonNull(licenseTransactDO)) {
addSignFranchiseResponse.setLicenseName(licenseTransactDO.getBusinessLicense());
addSignFranchiseResponse.setOpeAddress(licenseTransactDO.getLicenseAddress());
addSignFranchiseResponse.setOperator(licenseTransactDO.getOperator());
}
if (Objects.nonNull(lineInfoDO)){
if (Objects.nonNull(lineInfoDO)) {
addSignFranchiseResponse.setPartnerName(lineInfoDO.getUsername());
}
if (Objects.nonNull(signingBaseInfoDO)){
if (JoinTypeEnum.JOIN_TYPE_ONE.getCode().equals(memberQuestionDO.getJoinType())){
if (Objects.nonNull(signingBaseInfoDO)) {
if (JoinTypeEnum.JOIN_TYPE_ONE.getCode().equals(memberQuestionDO.getJoinType())) {
addSignFranchiseResponse.setIdCardNo(signingBaseInfoDO.getIdCardNo());
}else if (JoinTypeEnum.JOIN_TYPE_TWO.getCode().equals(memberQuestionDO.getJoinType())){
} else if (JoinTypeEnum.JOIN_TYPE_TWO.getCode().equals(memberQuestionDO.getJoinType())) {
addSignFranchiseResponse.setIdCardNo(signingBaseInfoDO.getBusinessLicenseCode());
}
addSignFranchiseResponse.setIdCardAddress(signingBaseInfoDO.getIdCardAddress());
}
if (Objects.nonNull(franchiseFeeDO)){
if (Objects.nonNull(franchiseFeeDO)) {
addSignFranchiseResponse.setYearFranchiseFee(franchiseFeeDO.getYearFranchiseFee());
addSignFranchiseResponse.setBigYearFranchiseFee(Convert.digitToChinese(Integer.valueOf(franchiseFeeDO.getYearFranchiseFee())));
addSignFranchiseResponse.setLoanMargin(franchiseFeeDO.getLoanMargin());
@@ -409,7 +404,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
return addSignFranchiseResponse;
}
public static String getDateTimeFormat(String pattern,Date date) {
public static String getDateTimeFormat(String pattern, Date date) {
return new SimpleDateFormat(pattern).format(date);
}
}

View File

@@ -2,7 +2,6 @@ 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.dao.ShopStageInfoDAO;
import com.cool.store.entity.*;
@@ -30,13 +29,16 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service
@Slf4j
public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultService {
public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultService {
@Resource
private CoolStoreStartFlowService coolStoreStartFlowService;
@@ -82,7 +84,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
@Override
@Transactional(rollbackFor = Exception.class)
public ResponseResult submitSysBuildStore(SysStoreAppRequest request,LoginUserInfo user) {
public ResponseResult submitSysBuildStore(SysStoreAppRequest request, LoginUserInfo user) {
log.info("submitSysBuildStore request :{}", JSONObject.toJSONString(request));
if (Objects.isNull(request)) {
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
@@ -99,12 +101,12 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());//线索信息
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(request.getLineId(), request.getShopId());//查铺位信息确定铺位所在大区、战区、门店所在省市区街道地址
//3.请求鲜丰接口
NewStoreRequest apiRequest = convertToNewStoreRequest(request,lineInfoDO,pointInfoDO,user);
return coolStoreStartFlowService.newStore(apiRequest,request.getShopId());
NewStoreRequest apiRequest = convertToNewStoreRequest(request, lineInfoDO, pointInfoDO, user);
return coolStoreStartFlowService.newStore(apiRequest, request.getShopId());
}
@Override
public SysStoreAppResponse getDefaultValueSysBuildStore(Long lineId, Long shopId,LoginUserInfo user) {
public SysStoreAppResponse getDefaultValueSysBuildStore(Long lineId, Long shopId, LoginUserInfo user) {
SysStoreAppResponse sysStoreAppResponse = new SysStoreAppResponse();
//1.查找数据
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(lineId);
@@ -112,9 +114,9 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
systemBuildingShopDO = systemBuildingShopMapper.selectOne(systemBuildingShopDO);
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(lineId, shopId);
//2.组装数据并返回
sysStoreAppResponse = polymerization(sysStoreAppResponse,systemBuildingShopDO,lineInfoDO,pointInfoDO);
sysStoreAppResponse = polymerization(sysStoreAppResponse, systemBuildingShopDO, lineInfoDO, pointInfoDO);
ShopAuditInfoDO shopAuditInfoDO = shopAuditInfoMapper.selectBykeyAndType(shopId);
if (Objects.nonNull(shopAuditInfoDO)){
if (Objects.nonNull(shopAuditInfoDO)) {
SysStoreAppResponse.AuditDetail auditDetail = new SysStoreAppResponse.AuditDetail();
auditDetail.setAuditType(shopAuditInfoDO.getAuditType());
auditDetail.setPassReason(shopAuditInfoDO.getPassReason());
@@ -127,14 +129,12 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
/**
* 聚合返回体
* @param systemBuildingShopDO
* @param lineInfoDO
*/
private SysStoreAppResponse polymerization(SysStoreAppResponse sysStoreAppResponse,
SystemBuildingShopDO systemBuildingShopDO,
LineInfoDO lineInfoDO,
PointInfoDO pointInfoDO) {
sysStoreAppResponse = from(systemBuildingShopDO,lineInfoDO,pointInfoDO);
SystemBuildingShopDO systemBuildingShopDO,
LineInfoDO lineInfoDO,
PointInfoDO pointInfoDO) {
sysStoreAppResponse = from(systemBuildingShopDO, lineInfoDO, pointInfoDO);
return sysStoreAppResponse;
}
@@ -150,28 +150,24 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
RegionDO fightRegion = regionMapper.getByRegionId(regionId);//战区
EnterpriseUserDO regionManager = userAuthMappingService.getUserByRoleEnumAndRegionId(UserRoleEnum.REGION_MANAGER, bigRegion.getId());
EnterpriseUserDO supervisor = userAuthMappingService.getUserByRoleEnumAndRegionId(UserRoleEnum.SUPERVISION, fightRegion.getId());
if (Objects.nonNull(regionManager)){
if (Objects.nonNull(regionManager)) {
// regioGeneral
supervisorDetail.setRegioGeneral(regionManager.getName());
// regioGeneralId
supervisorDetail.setRegioGeneralId(regionManager.getUserId());
}
if (Objects.nonNull(supervisor)){
if (Objects.nonNull(supervisor)) {
// supervisorName
supervisorDetail.setSupervisorName(supervisor.getName());
// supervisorId
supervisorDetail.setSupervisorId(supervisor.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());
storeDetail.setFightId(fightRegion.getId());
}
if (Objects.nonNull(systemBuildingShopDO)){
storeDetail.setBigName(bigRegion.getName());
storeDetail.setBigCode(bigRegion.getSynDingDeptId());
storeDetail.setFightName(fightRegion.getName());
storeDetail.setFightCode(fightRegion.getSynDingDeptId());
storeDetail.setFightId(fightRegion.getId());
if (Objects.nonNull(systemBuildingShopDO)) {
sysStoreAppResponse.setId(systemBuildingShopDO.getId());
sysStoreAppResponse.setLineId(systemBuildingShopDO.getLineId());
sysStoreAppResponse.setShopId(systemBuildingShopDO.getShopId());
@@ -227,7 +223,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
// reasons
storeDetail.setReasons(systemBuildingShopDO.getReasons());
}
if (Objects.nonNull(lineInfoDO)){
if (Objects.nonNull(lineInfoDO)) {
RegionDO byRegionId = regionMapper.getByRegionId(lineInfoDO.getRegionId());
franInfo.setSubregion(byRegionId.getName());
franInfo.setPartnerNum(lineInfoDO.getPartnerNum());
@@ -237,18 +233,16 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
EnterpriseUserDO userInfoById = enterpriseUserMapper.getUserInfoById(lineInfoDO.getInvestmentManager());
franInfo.setInvestmentName(userInfoById.getName());
}
if (Objects.nonNull(pointInfoDO)){
EnterpriseUserDO locationPeople = enterpriseUserMapper.getUserInfoById(pointInfoDO.getDevelopmentManager());//门店选址人
franInfo.setSitterId(pointInfoDO.getDevelopmentManager());
franInfo.setSitterName(locationPeople.getName());
storeDetail.setProvince(pointInfoDO.getProvince());
storeDetail.setCity(pointInfoDO.getCity());
storeDetail.setDistrict(pointInfoDO.getDistrict());
storeDetail.setTownship(pointInfoDO.getTownship());
storeDetail.setDetailAddress(pointInfoDO.getAddress());
storeDetail.setStoreName(pointInfoDO.getPointName());
EnterpriseUserDO locationPeople = enterpriseUserMapper.getUserInfoById(pointInfoDO.getDevelopmentManager());//门店选址人
franInfo.setSitterId(pointInfoDO.getDevelopmentManager());
franInfo.setSitterName(locationPeople.getName());
storeDetail.setProvince(pointInfoDO.getProvince());
storeDetail.setCity(pointInfoDO.getCity());
storeDetail.setDistrict(pointInfoDO.getDistrict());
storeDetail.setTownship(pointInfoDO.getTownship());
storeDetail.setDetailAddress(pointInfoDO.getAddress());
storeDetail.setStoreName(pointInfoDO.getPointName());
}
sysStoreAppResponse.setStoreDetail(storeDetail);
sysStoreAppResponse.setSupervisorDetail(supervisorDetail);
sysStoreAppResponse.setFranInfo(franInfo);
@@ -267,7 +261,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
userIdList.add(pointInfoDO.getDevelopmentManager());//选址人
userIdList.add(lineInfoDO.getInvestmentManager());//招商人
List<EnterpriseUserDO> userInfoByUserIds = enterpriseUserMapper.getUserInfoByUserIds(userIdList);
Map<String, EnterpriseUserDO> userMap = userInfoByUserIds.stream().collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
Map<String, EnterpriseUserDO> userMap = userInfoByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, Function.identity()));
NewStoreRequest newStoreRequest = new NewStoreRequest();
ArrayList<String> objects = new ArrayList<>();
@@ -304,7 +298,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
// jzdsmc
newStoreRequest.setJzdsmc(OfflineCompetitorEnum.getByCode(sysStoreAppRequest.getStoreDetail().getOfflineCompetitor()).getDesc());
// kdzBusinessid
newStoreRequest.setKdzBusinessId(AuditEnum.SYS_BUILD.getCode() + "_" +sysStoreAppRequest.getShopId() + "_" +pointInfoDO.getId());
newStoreRequest.setKdzBusinessId(AuditEnum.SYS_BUILD.getCode() + "_" + sysStoreAppRequest.getShopId() + "_" + pointInfoDO.getId());
// kllzsmc
newStoreRequest.setKllzsmc(PassengerFlowEnum.getByCode(sysStoreAppRequest.getStoreDetail().getAverageDailyRs()).getDesc());
// landlord_name
@@ -414,11 +408,11 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
shopAuditInfoDO.setAuditType(AuditTypeEnum.SYS_BUILD.getCode());
shopAuditInfoDO.setSubmittedUserId("");
shopAuditInfoDO.setSubmittedUserName("");
if (request.getAuditResult() == Constants.ZERO_INTEGER){
if (Constants.ZERO_INTEGER.equals(request.getAuditResult())) {
shopAuditInfoDO.setResultType(Constants.ONE_INTEGER);
shopAuditInfoDO.setRejectReason(request.getCause());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
} else if (Constants.ONE_INTEGER.equals(request.getAuditResult())) {
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
EnterpriseUserDO supervisor = userAuthMappingService.getUserByRoleEnumAndRegionId(UserRoleEnum.SUPERVISION, shopInfoDO.getRegionId());
shopInfoDO.setStoreNum(request.getStoreNum()); //更新门店编码
@@ -437,15 +431,15 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
}
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
//更新阶段状态
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum,shopAuditInfoDO.getId());
}catch (Exception e){
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum, shopAuditInfoDO.getId());
} catch (Exception e) {
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
}
return true;
}
private Long getShopId(String kdzBusinessId) {
String shopId = kdzBusinessId.substring(kdzBusinessId.indexOf("_") + 1,kdzBusinessId.lastIndexOf("_"));
String shopId = kdzBusinessId.substring(kdzBusinessId.indexOf("_") + 1, kdzBusinessId.lastIndexOf("_"));
return Long.valueOf(shopId);
}
}