Merge branch 'cc_20240603_wantarea_bigregion' into 'master'
Cc 20240603 wantarea bigregion See merge request hangzhou/java/custom_xfsg!8
This commit is contained in:
@@ -25,6 +25,8 @@ public class CommonConstants {
|
||||
public static final int NORMAL_LOCK_TIMES = 60 * 1000;
|
||||
|
||||
public static final int AN_HOUR_SECONDS = 3600;
|
||||
//十秒
|
||||
public static final int TEN_SECONDS = 10000;
|
||||
|
||||
/**
|
||||
* 跟进任务通知缓存时间 1小时
|
||||
|
||||
@@ -159,7 +159,7 @@ public enum ErrorCodeEnum {
|
||||
OPEN_AREA_IS_NOT_EXISTS(107006, "意向区域城市不存在", null),
|
||||
|
||||
REGION_NOT_EXIST(108001, "区域不存在",null),
|
||||
ONLY_WAR_REGION_CONFIG(108002, "意向省市只能配置到战区",null),
|
||||
ONLY_WAR_REGION_CONFIG(108002, "意向省市只能配置到大区",null),
|
||||
|
||||
NOT_APPROVE_NODE(109001, "不是审批节点",null),
|
||||
|
||||
@@ -194,6 +194,8 @@ public enum ErrorCodeEnum {
|
||||
|
||||
UNISSUED_STATEMENT_2(109014, "该门店已发布账单", null),
|
||||
|
||||
DUPLICATE_SUBMISSION(109015, "重复提交!", null),
|
||||
|
||||
|
||||
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
|
||||
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: NumberConverter
|
||||
@@ -30,5 +34,20 @@ public class NumberConverter {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static Float convertMath(String mathExpression) {
|
||||
BigDecimal bd = null;
|
||||
try {
|
||||
if (StringUtil.isEmpty(mathExpression)){
|
||||
return null;
|
||||
}
|
||||
bd = new BigDecimal(mathExpression);
|
||||
bd = bd.setScale(1, RoundingMode.HALF_UP);
|
||||
return bd.floatValue();
|
||||
}catch (Exception e){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -321,6 +321,16 @@ public class RedisUtilPool {
|
||||
public boolean setNxExpire(final String key, final String value, final int expire) {
|
||||
String res = new Executor<String>(shardedJedisPool) {
|
||||
@Override
|
||||
/**
|
||||
* 参数定义详解,避免用错:
|
||||
* set(String key, String value, String nxxx, String expx, int time)
|
||||
* @key key
|
||||
* @value value
|
||||
* @nxxx 1.nx : not exists, 只有key 不存在时才把key value set 到redis;
|
||||
* 2.xx : is exists ,只有 key 存在是,才把key value set 到redis
|
||||
* @expx 1.ex : seconds 秒; 2.px : milliseconds 毫秒
|
||||
* 我们当前选用的是 nx,px,即key不存在时才set,且过期时间为毫秒
|
||||
*/
|
||||
String execute() {
|
||||
return jedis.set(key, value, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, expire);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<result column="assessment_num" jdbcType="INTEGER" property="assessmentNum"/>
|
||||
<result column="assessment_total_num" jdbcType="INTEGER" property="assessmentTotalNum"/>
|
||||
<result column="theoretical_exam_status" jdbcType="TINYINT" property="theoreticalExamStatus"/>
|
||||
<result column="theoretical_exam_score" jdbcType="INTEGER" property="theoreticalExamScore"/>
|
||||
<result column="theoretical_exam_score" jdbcType="FLOAT" property="theoreticalExamScore"/>
|
||||
<result column="practical_exam_status" jdbcType="TINYINT" property="practicalExamStatus"/>
|
||||
<result column="practical_exam_score" jdbcType="INTEGER" property="practicalExamScore"/>
|
||||
<result column="assessment_status" jdbcType="TINYINT" property="assessmentStatus"/>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="partner_num" jdbcType="VARCHAR" property="partnerNum" />
|
||||
<result column="big_region_id" jdbcType="BIGINT" property="bigRegionId" />
|
||||
</resultMap>
|
||||
<insert id="insertOrUpdate" parameterType="com.cool.store.entity.LineInfoDO" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO xfsg_line_info
|
||||
@@ -43,6 +44,9 @@
|
||||
<if test="param.regionId != null">
|
||||
region_id,
|
||||
</if>
|
||||
<if test="param.bigRegionId != null">
|
||||
big_region_id,
|
||||
</if>
|
||||
<if test="param.mobile != null and param.mobile != ''">
|
||||
mobile,
|
||||
</if>
|
||||
@@ -129,6 +133,9 @@
|
||||
<if test="param.regionId != null">
|
||||
#{param.regionId},
|
||||
</if>
|
||||
<if test="param.bigRegionId != null">
|
||||
#{param.bigRegionId},
|
||||
</if>
|
||||
<if test="param.mobile != null and param.mobile != ''">
|
||||
#{param.mobile},
|
||||
</if>
|
||||
@@ -213,6 +220,9 @@
|
||||
<if test="param.regionId != null">
|
||||
region_id = #{param.regionId},
|
||||
</if>
|
||||
<if test="param.bigRegionId != null">
|
||||
big_region_id = #{param.bigRegionId},
|
||||
</if>
|
||||
<if test="param.mobile != null and param.mobile != ''">
|
||||
mobile = #{param.mobile},
|
||||
</if>
|
||||
|
||||
@@ -61,4 +61,6 @@ public class StaffBaseInfoDTO {
|
||||
|
||||
@ApiModelProperty("健康证")
|
||||
private String healthCertificate;
|
||||
|
||||
private Boolean storeManagerFlag;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class EmployeeTrainingDO {
|
||||
* 理论考试分值
|
||||
*/
|
||||
@Column(name = "theoretical_exam_score")
|
||||
private Integer theoreticalExamScore;
|
||||
private Float theoreticalExamScore;
|
||||
|
||||
/**
|
||||
* 实操考试状态 0-未开始 1-合格 2-不合格
|
||||
|
||||
@@ -21,6 +21,9 @@ public class LineInfoDO {
|
||||
@Column(name = "region_id")
|
||||
private Long regionId;
|
||||
|
||||
@Column(name = "big_region_id")
|
||||
private Long bigRegionId;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
|
||||
@@ -17,5 +17,4 @@ public class AddLineRequest {
|
||||
private Long wantShopAreaId;
|
||||
|
||||
private String investmentManagerUserId;
|
||||
|
||||
}
|
||||
|
||||
@@ -26,4 +26,7 @@ public class AuditPassRequest {
|
||||
@ApiModelProperty("通过原因")
|
||||
private String passReason;
|
||||
|
||||
@ApiModelProperty("战区regionId,只在意向加盟申请阶段使用")
|
||||
private Long fightRegion;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@@ -37,88 +37,119 @@ public class SysStoreAppRequest {
|
||||
"6-直营门店;" +
|
||||
"7-同异业转化;" +
|
||||
"8-老加盟商迁址开新店")
|
||||
private Integer franchiseeType;
|
||||
@NotBlank(message = "加盟商类型不能为空")
|
||||
private Integer franchiseeType;
|
||||
|
||||
@ApiModelProperty("门店邀约人id")
|
||||
@NotBlank(message = "门店邀约人id不能为空")
|
||||
private String inviteUserId;
|
||||
|
||||
@ApiModelProperty("门店邀约人姓名")
|
||||
@NotBlank(message = "门店邀约人姓名不能为空")
|
||||
private String storeInviteesName;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class StoreDetail{
|
||||
public static class StoreDetail {
|
||||
@ApiModelProperty("门店性质 20:加盟 10:直营")
|
||||
@NotBlank(message = "门店性质不能为空")
|
||||
private Integer storeNature;
|
||||
@ApiModelProperty("门店经营者")
|
||||
@ApiModelProperty("门店性质")
|
||||
@NotBlank(message = "门店性质不能为空")
|
||||
private Integer storeOperator;
|
||||
@ApiModelProperty("门店名称(默认带入一个门店名称,但是可修改)")
|
||||
@NotBlank(message = "门店名称不能为空")
|
||||
private String storeName;
|
||||
@ApiModelProperty("大区描述")
|
||||
@NotBlank(message = "大区描述不能为空")
|
||||
private String bigDesc;
|
||||
@ApiModelProperty("大区名称")
|
||||
@NotBlank(message = "大区名称不能为空")
|
||||
private String bigName;
|
||||
@ApiModelProperty("大区code")
|
||||
@NotBlank(message = "大区code不能为空")
|
||||
private String bigCode;
|
||||
|
||||
@ApiModelProperty("战区描述")
|
||||
@NotBlank(message = "战区描述不能为空")
|
||||
private String fightDesc;
|
||||
@ApiModelProperty("战区编码")
|
||||
@NotBlank(message = "战区编码不能为空")
|
||||
private String fightCode;
|
||||
@ApiModelProperty("战区名称")
|
||||
@NotBlank(message = "战区名称不能为空")
|
||||
private String fightName;
|
||||
|
||||
@ApiModelProperty("小区code")
|
||||
@NotBlank(message = "小区code不能为空")
|
||||
private String smallCode;
|
||||
@ApiModelProperty("小区描述")
|
||||
@NotBlank(message = "小区描述不能为空")
|
||||
private String smallDesc;
|
||||
@ApiModelProperty("小区名称")
|
||||
@NotBlank(message = "小区名称不能为空")
|
||||
private String smallName;
|
||||
|
||||
@ApiModelProperty("主商圈类型 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型")
|
||||
@NotBlank(message = "主商圈类型不能为空")
|
||||
private Integer mainBusinessType;
|
||||
@ApiModelProperty("次商圈类型 10-社区型;20-商业街边型;30-学校型;40-CBD/办公型;60-医院型;70-菜场型")
|
||||
@NotBlank(message = "次商圈类型不能为空")
|
||||
private Integer subBusinessType;
|
||||
@ApiModelProperty("线下主要竞争对手 10-品牌水果店;20-夫妻水果店;30-菜场店;40-大商超;50-生鲜店;60-无")
|
||||
@NotBlank(message = "线下主要竞争对手不能为空")
|
||||
private Integer offlineCompetitor;
|
||||
@ApiModelProperty("线下主要竞争品牌")
|
||||
@NotBlank(message = "线下主要竞争品牌不能为空")
|
||||
private String offlineCompetingBrand;
|
||||
@ApiModelProperty("周边500米内二手房均价")
|
||||
@NotBlank(message = "周边500米内二手房均价不能为空")
|
||||
private Integer averagePriceSh;
|
||||
@ApiModelProperty("100米周末日均客流量指数 0:1000以下 1:1000-1万 2:1万以上")
|
||||
@NotBlank(message = "100米周末日均客流量指数不能为空")
|
||||
private Integer averageDailyRs;
|
||||
@ApiModelProperty("商圈门店类型 普通社区店 高档社区店")
|
||||
@NotBlank(message = "商圈门店类型不能为空")
|
||||
private String businessStoreType;
|
||||
@ApiModelProperty("预估营业额")
|
||||
@NotBlank(message = "预估营业额不能为空")
|
||||
private Integer estimatedTurnover;
|
||||
@ApiModelProperty("签约日期")
|
||||
@NotBlank(message = "签约日期不能为空")
|
||||
private Date signDate;
|
||||
@ApiModelProperty("房东姓名")
|
||||
@NotBlank(message = "房东姓名不能为空")
|
||||
private String landlordName;
|
||||
@ApiModelProperty("合同交房日期")
|
||||
@NotBlank(message = "合同交房日期不能为空")
|
||||
private Date contractDeliveryDate;
|
||||
@ApiModelProperty("房东联系电话")
|
||||
@NotBlank(message = "房东联系电话不能为空")
|
||||
private String landlordMobile;
|
||||
@ApiModelProperty("预约量房日期")
|
||||
@NotBlank(message = "预约量房日期不能为空")
|
||||
private Date reservation;
|
||||
@ApiModelProperty("门店月租金")
|
||||
@NotBlank(message = "门店月租金不能为空")
|
||||
private Integer storeRent;
|
||||
@ApiModelProperty("此店加盟费")
|
||||
@NotBlank(message = "此店加盟费不能为空")
|
||||
private Integer storeFranchiseFee;
|
||||
@ApiModelProperty("此店保证金")
|
||||
@NotBlank(message = "此店保证金不能为空")
|
||||
private Integer storeSecurityDeposit;
|
||||
@ApiModelProperty("享受加盟费和保证金优惠原因")
|
||||
private String reasons;
|
||||
@ApiModelProperty("品牌使用费率")
|
||||
@NotBlank(message = "品牌使用费率不能为空")
|
||||
private String usageRate;
|
||||
|
||||
@ApiModelProperty("详细地址")
|
||||
private String detailAddress;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SupervisorDetail{
|
||||
public static class SupervisorDetail {
|
||||
|
||||
@ApiModelProperty("督导姓名")
|
||||
private String supervisorName;
|
||||
|
||||
@@ -84,7 +84,7 @@ public class AssessmentUserTrainingVO {
|
||||
* 理论考试分值
|
||||
*/
|
||||
@ApiModelProperty("理论考试分值")
|
||||
private Integer theoreticalExamScore;
|
||||
private Float theoreticalExamScore;
|
||||
|
||||
/**
|
||||
* 实操考试分值
|
||||
|
||||
@@ -130,7 +130,7 @@ public class EmployeeTrainingDetailVO {
|
||||
* 理论考试分值
|
||||
*/
|
||||
@ApiModelProperty("理论考试分值")
|
||||
private Integer theoreticalExamScore;
|
||||
private Float theoreticalExamScore;
|
||||
|
||||
/**
|
||||
* 实操考试状态 0-未开始 1-合格 2-不合格
|
||||
|
||||
@@ -55,7 +55,7 @@ public class EmployeeTrainingVO {
|
||||
private Integer theoreticalExamStatus;
|
||||
|
||||
@ApiModelProperty("理论考试分值")
|
||||
private Integer theoreticalExamScore;
|
||||
private Float theoreticalExamScore;
|
||||
|
||||
@ApiModelProperty("实操考试状态 0-未开始 1-合格 2-不合格")
|
||||
private Integer practicalExamStatus;
|
||||
|
||||
@@ -221,5 +221,7 @@ public class LineInfoVO {
|
||||
@ApiModelProperty("加盟商编码")
|
||||
private String partnerNum;
|
||||
|
||||
private Long bigRegionId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -36,9 +36,15 @@ public class OpenAcceptanceInfoListVO {
|
||||
@ApiModelProperty("战区Id")
|
||||
private Long regionId;
|
||||
|
||||
@ApiModelProperty("所属区域")
|
||||
@ApiModelProperty("所属战区区域")
|
||||
private String regionNodeName;
|
||||
|
||||
@ApiModelProperty("大区Id")
|
||||
private Long bigRegionId;
|
||||
|
||||
@ApiModelProperty("所属大区区域")
|
||||
private String bigRegionNodeName;
|
||||
|
||||
@ApiModelProperty("计划开业时间")
|
||||
private Date planOpenTime;
|
||||
@ApiModelProperty("新店开业结束时间")
|
||||
|
||||
@@ -68,6 +68,8 @@ public class PartnerBaseInfoVO {
|
||||
|
||||
@ApiModelProperty("公开拒绝原因")
|
||||
private String rejectPublicReason;
|
||||
@ApiModelProperty("大区regionId")
|
||||
private Long bigRegionId;
|
||||
|
||||
|
||||
|
||||
@@ -102,6 +104,7 @@ public class PartnerBaseInfoVO {
|
||||
partnerBaseInfoVO.setLineId(lineInfoDO.getId());
|
||||
partnerBaseInfoVO.setSex(Integer.valueOf(lineInfoDO.getSex()));
|
||||
partnerBaseInfoVO.setAreaCode(String.valueOf(lineInfoDO.getWantShopAreaId()));
|
||||
partnerBaseInfoVO.setBigRegionId(lineInfoDO.getBigRegionId());
|
||||
return partnerBaseInfoVO;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.vo.shop;
|
||||
|
||||
import com.cool.store.entity.PointInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.google.common.collect.Lists;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -44,20 +45,23 @@ public class RentInfoToDoVO {
|
||||
@ApiModelProperty("提交时间")
|
||||
private Date submitTime;
|
||||
|
||||
public static List<RentInfoToDoVO> convert(List<RentInfoToDoVO> list, Map<Long, Long> shopPointMap, Map<Long, PointInfoDO> pointMap, Map<Long, String> regionNameMap, Map<Long, Date> rentContractSubmitTimeMap){
|
||||
public static List<RentInfoToDoVO> convert(List<RentInfoToDoVO> list, Map<Long, ShopInfoDO> shopPointMap, Map<Long, PointInfoDO> pointMap, Map<Long, String> regionNameMap, Map<Long, Date> rentContractSubmitTimeMap){
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<RentInfoToDoVO> resultList = new ArrayList<>();
|
||||
for (RentInfoToDoVO rent : list) {
|
||||
Long pointId = shopPointMap.get(rent.getShopId());
|
||||
rent.setPointId(pointId);
|
||||
PointInfoDO pointInfo = pointMap.get(pointId);
|
||||
ShopInfoDO shopInfo = shopPointMap.get(rent.getShopId());
|
||||
if(Objects.isNull(shopInfo)){
|
||||
continue;
|
||||
}
|
||||
PointInfoDO pointInfo = pointMap.get(shopInfo.getPointId());
|
||||
if(Objects.nonNull(pointInfo)){
|
||||
rent.setPointName(pointInfo.getPointName());
|
||||
rent.setAddress(pointInfo.getAddress());
|
||||
rent.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId()));
|
||||
}
|
||||
rent.setPointId(shopInfo.getPointId());
|
||||
rent.setRegionNodeName(regionNameMap.get(shopInfo.getRegionId()));
|
||||
rent.setSubmitTime(rentContractSubmitTimeMap.get(rent.getShopId()));
|
||||
resultList.add(rent);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.RegionDao;
|
||||
@@ -9,6 +10,7 @@ import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
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;
|
||||
@@ -18,6 +20,7 @@ import com.cool.store.response.SubmitLicenseResponse;
|
||||
import com.cool.store.service.ApplyLicenseService;
|
||||
import com.cool.store.service.CoolStoreStartFlowService;
|
||||
import com.cool.store.service.PreparationService;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
@@ -80,6 +83,9 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
@Resource
|
||||
LineInfoMapper lineInfoMapper;
|
||||
|
||||
@Resource
|
||||
RedisUtilPool redisUtilPool;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -88,7 +94,19 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
if (Objects.isNull(request)) {
|
||||
return false;
|
||||
}
|
||||
String lockKey = "submitLicense:" + request.getShopId();
|
||||
String lockValue = UUID.randomUUID().toString();
|
||||
boolean acquired = Boolean.FALSE;
|
||||
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
|
||||
if (!acquired) {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
}
|
||||
LicenseTransactDO licenseTransactDO = request.toLicenseTransactDO();
|
||||
//防止一直在页面提交
|
||||
if (licenseTransactDO.getId() == null) {
|
||||
LicenseTransactDO license = applyLicenseMapper.selectByShopId(request.getShopId());
|
||||
licenseTransactDO.setId(license.getId());
|
||||
}
|
||||
if (request.getId() == null) {
|
||||
applyLicenseMapper.insertSelective(licenseTransactDO);
|
||||
} else {
|
||||
@@ -120,7 +138,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
List<UserAuthMappingDO> userAuthByMappingIds = userAuthMappingMapper.getUserAuthByMappingIds(Collections.singletonList(String.valueOf(regionId)));
|
||||
if (CollectionUtils.isNotEmpty(userAuthByMappingIds)) {
|
||||
List<String> sendUserIds = userAuthByMappingIds.stream().map(UserAuthMappingDO::getUserId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(sendUserIds)){
|
||||
if (CollectionUtils.isNotEmpty(sendUserIds)) {
|
||||
sendUsers = enterpriseUserRoleMapper.getUserIdsByRoleIds(Collections.singletonList("130000000"), sendUserIds);
|
||||
}
|
||||
}
|
||||
@@ -191,7 +209,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
submitLicenseResponse.setLicenseLegalPerson(storeDocument.getStoreDirector());
|
||||
submitLicenseResponse.setIssueTime(DateUtil.parseDate(storeDocument.getStoreBusinessDate()));
|
||||
submitLicenseResponse.setLicenseAddress(storeDocument.getStoreBusinessAdd());
|
||||
submitLicenseResponse.setValidity(storeBusinessValidPeriod ? null : DateUtil.parse(storeDocument.getStoreBusinessValidPeriod(),"yyyy-MM-dd"));
|
||||
submitLicenseResponse.setValidity(storeBusinessValidPeriod ? null : DateUtil.parse(storeDocument.getStoreBusinessValidPeriod(), "yyyy-MM-dd"));
|
||||
submitLicenseResponse.setValidityType(storeBusinessValidPeriod ? 0 : 1);
|
||||
submitLicenseResponse.setOperator(storeDocument.getStoreDirector());
|
||||
submitLicenseResponse.setFoodLicenseLegalPerson(storeDocument.getStoreFoodLicenseLegalRepresentative());
|
||||
|
||||
@@ -53,7 +53,6 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
||||
log.info("newStore API response:{}", JSONObject.toJSONString(initiatingResponse));
|
||||
if (initiatingResponse.getCode() != 0L) {
|
||||
throw new ServiceException(ErrorCodeEnum.FRANCHISE_AGREEMENT_FALSE, initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
// return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
} else {
|
||||
//更新阶段信息
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_31, null);
|
||||
@@ -79,7 +78,6 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
|
||||
log.info("franchiseAgreement API response:{}", JSONObject.toJSONString(initiatingResponse));
|
||||
if (initiatingResponse.getCode() != 0L) {
|
||||
// throw new ServiceException(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
throw new ServiceException(ErrorCodeEnum.FRANCHISE_AGREEMENT_FALSE, initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||
} else {
|
||||
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
|
||||
@@ -539,9 +539,9 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
if (lineId != null) {
|
||||
LineInfoDO a = lineInfoDOMap.getOrDefault(lineId, new LineInfoDO());
|
||||
fitmentCheckVO.setInvestmentManagerId(a.getInvestmentManager());
|
||||
fitmentCheckVO.setInvestmentManager(a.getInvestmentManager());
|
||||
fitmentCheckVO.setInvestmentManager(userNameMap.getOrDefault(a.getInvestmentManager(), ""));
|
||||
fitmentCheckVO.setSitterId(a.getDevelopmentManager());
|
||||
fitmentCheckVO.setSitterName(a.getDevelopmentManager());
|
||||
fitmentCheckVO.setSitterName(userNameMap.getOrDefault(a.getDevelopmentManager(), ""));
|
||||
fitmentCheckVO.setPartnerName(a.getUsername());
|
||||
}
|
||||
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDOSMap.get(shopId);
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.cool.store.enums.video.UploadTypeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.NumberConverter;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.utils.vod.SmallVideoParam;
|
||||
@@ -199,7 +200,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
StaffExamInfoDTO staffExamInfoDTO = xfsgEhrService.getUserExamInfo(enterpriseUserDO.getJobnumber());
|
||||
if (staffExamInfoDTO != null && StringUtils.isNotBlank(staffExamInfoDTO.getExamResult())
|
||||
&& StringUtils.isNotBlank(staffExamInfoDTO.getExamScore())) {
|
||||
employeeTrainingVO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? Integer.valueOf(staffExamInfoDTO.getExamScore()) : null);
|
||||
employeeTrainingVO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? NumberConverter.convertMath(staffExamInfoDTO.getExamScore()) : null);
|
||||
employeeTrainingVO.setTheoreticalExamStatus(ExamStatusEnum.matchCodeByDesc(staffExamInfoDTO.getExamResult()));
|
||||
if(!employeeTrainingVO.getTheoreticalExamScore().equals(employeeTrainingDO.getTheoreticalExamScore())
|
||||
|| !employeeTrainingVO.getTheoreticalExamStatus().equals(employeeTrainingDO.getTheoreticalExamStatus())){
|
||||
@@ -501,7 +502,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
StaffExamInfoDTO staffExamInfoDTO = xfsgEhrService.getUserExamInfo(enterpriseUserDO.getJobnumber());
|
||||
if (staffExamInfoDTO != null && StringUtils.isNotBlank(staffExamInfoDTO.getExamResult())
|
||||
&& StringUtils.isNotBlank(staffExamInfoDTO.getExamScore())) {
|
||||
assessmentUserTrainingVO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? Integer.valueOf(staffExamInfoDTO.getExamScore()) : null);
|
||||
assessmentUserTrainingVO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? NumberConverter.convertMath(staffExamInfoDTO.getExamScore()) : null);
|
||||
assessmentUserTrainingVO.setTheoreticalExamStatus(ExamStatusEnum.matchCodeByDesc(staffExamInfoDTO.getExamResult()));
|
||||
if(!assessmentUserTrainingVO.getTheoreticalExamScore().equals(employeeTrainingDO.getTheoreticalExamScore())
|
||||
|| !assessmentUserTrainingVO.getTheoreticalExamStatus().equals(employeeTrainingDO.getTheoreticalExamStatus())){
|
||||
@@ -644,7 +645,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
|
||||
StaffExamInfoDTO staffExamInfoDTO = xfsgEhrService.getUserExamInfo(enterpriseUserDO.getJobnumber());
|
||||
if (staffExamInfoDTO != null && StringUtils.isNotBlank(staffExamInfoDTO.getExamResult())
|
||||
&& StringUtils.isNotBlank(staffExamInfoDTO.getExamScore())) {
|
||||
employeeTrainingDO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? Integer.valueOf(staffExamInfoDTO.getExamScore()) : null);
|
||||
employeeTrainingDO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? NumberConverter.convertMath(staffExamInfoDTO.getExamScore()) : null);
|
||||
employeeTrainingDO.setTheoreticalExamStatus(ExamStatusEnum.matchCodeByDesc(staffExamInfoDTO.getExamResult()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.entity.*;
|
||||
@@ -29,10 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@Service
|
||||
@@ -76,7 +74,6 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
@Resource
|
||||
AliyunService aliyunService;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean submit(IntentAgreementSubmitRequest request) {
|
||||
@@ -148,8 +145,8 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
requestMap.put("partnerUsername", lineInfo.getUsername());
|
||||
requestMap.put("lineId", String.valueOf(lineInfo.getId()));
|
||||
requestMap.put("partnerMobile", lineInfo.getMobile());
|
||||
commonService.sendMessage(Collections.singletonList(lineInfo.getInvestmentManager()),MessageEnum.MESSAGE_32,requestMap);
|
||||
commonService.sendSms(lineInfo.getMobile(),SMSMsgEnum.INTENTION_PAYMENT_PASS);
|
||||
commonService.sendMessage(Collections.singletonList(lineInfo.getInvestmentManager()), MessageEnum.MESSAGE_32, requestMap);
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.INTENTION_PAYMENT_PASS);
|
||||
}
|
||||
//更新auditId
|
||||
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineInfo.getId());
|
||||
@@ -202,26 +199,45 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
verifyDate(request);
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
fillSignatureInfo(requestMap);
|
||||
String url = xfsgUrl + Constants.INTENTION_CONTRACT_URL + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
InitiatingDO initiatingDO = request.toInitiatingDO();
|
||||
initiatingDO.setApply_user(user.getJobNumber());
|
||||
initiatingDO.setApply_user_name(user.getName());
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
|
||||
initiatingDO.setJmsxx(lineInfoDO.getPartnerNum());
|
||||
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();
|
||||
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);
|
||||
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
String lockKey = "submitSignFranchise:" + request.getLineId();
|
||||
//流水
|
||||
String lockValue = UUID.randomUUID().toString();
|
||||
boolean acquired = false;
|
||||
try {
|
||||
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
|
||||
if (Boolean.TRUE.equals(acquired)) {
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
fillSignatureInfo(requestMap);
|
||||
String url = xfsgUrl + Constants.INTENTION_CONTRACT_URL + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
InitiatingDO initiatingDO = request.toInitiatingDO();
|
||||
initiatingDO.setApply_user(user.getJobNumber());
|
||||
initiatingDO.setApply_user_name(user.getName());
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
|
||||
initiatingDO.setJmsxx(lineInfoDO.getPartnerNum());
|
||||
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();
|
||||
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);
|
||||
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||
}
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
}
|
||||
} finally {
|
||||
if (Boolean.TRUE.equals(acquired)) {
|
||||
String currentValue = redisUtilPool.getString(lockKey);
|
||||
if (lockValue.equals(currentValue)) {
|
||||
redisUtilPool.delKey(lockKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void verifyDate(InitiatingRequest request) {
|
||||
@@ -249,62 +265,83 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
if (Objects.isNull(request)) {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
fillSignatureInfo(requestMap);
|
||||
String url = xfsgUrl + Constants.FRANCHISEE_STORE_NUM + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
FranchiseeDO franchiseeDO = request.toFranchiseeDO();
|
||||
//查银行信息
|
||||
LinePayDO linePayDO = linePayMapper.getLinePayByLineId(request.getLineId());
|
||||
if (Objects.isNull(linePayDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_PAY_FALSE);
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String dateString = sdf.format(linePayDO.getPayTime());
|
||||
franchiseeDO.setPayDateStr(dateString);
|
||||
franchiseeDO.setRetAccount(ReceivingBankEnum.XFSG_RECEIVING_BANK.getAccountNum());
|
||||
franchiseeDO.setBank(linePayDO.getBankCode());
|
||||
franchiseeDO.setBankSub(linePayDO.getBranchBankCode());
|
||||
//查城市信息
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
|
||||
if (Objects.isNull(lineInfoDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
if (lineInfoDO.getPartnerNum() != null){
|
||||
return new ResponseResult(200000,null,null);
|
||||
}
|
||||
if ("1".equals(lineInfoDO.getSex())){
|
||||
franchiseeDO.setSex(1);
|
||||
}else if ("2".equals(lineInfoDO.getSex())){
|
||||
franchiseeDO.setSex(0);
|
||||
}
|
||||
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoDO.getWantShopAreaId());
|
||||
franchiseeDO.setProvinceCode(String.valueOf(openAreaInfoDO.getParentId()));
|
||||
franchiseeDO.setCityCode(String.valueOf(openAreaInfoDO.getId()));
|
||||
franchiseeDO.setOperator(user.getJobNumber());
|
||||
MemberQuestionDO memberQuestionDO = joinIntentionMapper.getByLineId(lineInfoDO.getId());
|
||||
//如果是企业加盟,需要传有效期和法人
|
||||
if (Objects.nonNull(memberQuestionDO) && Constants.TWO_INTEGER.equals(memberQuestionDO.getJoinType())){
|
||||
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null,lineInfoDO.getId());
|
||||
BusinessLicenseInfoVO businessLicenseInfo = aliyunService.getBusinessLicenseInfo(signingBaseInfoDO.getBusinessLicense());
|
||||
franchiseeDO.setBusinessTerm(businessLicenseInfo.getValidPeriod());
|
||||
franchiseeDO.setLegalPerson(businessLicenseInfo.getLegalPerson());
|
||||
}
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, franchiseeDO, InitiatingResponse.class);
|
||||
//更新线索(进入蓄水池并回填加盟商编码)
|
||||
if (initiatingResponse.getCode() == 0) {
|
||||
LineInfoDO lineInfoParam = new LineInfoDO();
|
||||
lineInfoParam.setId(request.getLineId());
|
||||
//蓄水池
|
||||
lineInfoParam.setJoinStatus(1);
|
||||
lineInfoParam.setPartnerNum(initiatingResponse.getData());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoParam);
|
||||
}
|
||||
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());
|
||||
|
||||
String lockKey = "saveFranchise:" + request.getLineId();
|
||||
String lockValue = UUID.randomUUID().toString();
|
||||
boolean acquired = false;
|
||||
try {
|
||||
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
|
||||
if (Boolean.TRUE.equals(acquired)) {
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
fillSignatureInfo(requestMap);
|
||||
String url = xfsgUrl + Constants.FRANCHISEE_STORE_NUM + "?timestamp=" + requestMap.get("timestamp") + "&signature=" + requestMap.get("signature");
|
||||
FranchiseeDO franchiseeDO = request.toFranchiseeDO();
|
||||
//查银行信息
|
||||
LinePayDO linePayDO = linePayMapper.getLinePayByLineId(request.getLineId());
|
||||
if (Objects.isNull(linePayDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_PAY_FALSE);
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String dateString = sdf.format(linePayDO.getPayTime());
|
||||
franchiseeDO.setPayDateStr(dateString);
|
||||
franchiseeDO.setRetAccount(ReceivingBankEnum.XFSG_RECEIVING_BANK.getAccountNum());
|
||||
franchiseeDO.setBank(linePayDO.getBankCode());
|
||||
franchiseeDO.setBankSub(linePayDO.getBranchBankCode());
|
||||
//查城市信息
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
|
||||
if (Objects.isNull(lineInfoDO)) {
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
if (StringUtil.isNotBlank(lineInfoDO.getPartnerNum())) {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
}
|
||||
if (lineInfoDO.getPartnerNum() != null) {
|
||||
return new ResponseResult(200000, null, null);
|
||||
}
|
||||
if ("1".equals(lineInfoDO.getSex())) {
|
||||
franchiseeDO.setSex(1);
|
||||
} else if ("2".equals(lineInfoDO.getSex())) {
|
||||
franchiseeDO.setSex(0);
|
||||
}
|
||||
HyOpenAreaInfoDO openAreaInfoDO = openAreaInfoMapper.selectById(lineInfoDO.getWantShopAreaId());
|
||||
franchiseeDO.setProvinceCode(String.valueOf(openAreaInfoDO.getParentId()));
|
||||
franchiseeDO.setCityCode(String.valueOf(openAreaInfoDO.getId()));
|
||||
franchiseeDO.setOperator(user.getJobNumber());
|
||||
MemberQuestionDO memberQuestionDO = joinIntentionMapper.getByLineId(lineInfoDO.getId());
|
||||
//如果是企业加盟,需要传有效期和法人
|
||||
if (Objects.nonNull(memberQuestionDO) && Constants.TWO_INTEGER.equals(memberQuestionDO.getJoinType())) {
|
||||
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineInfoDO.getId());
|
||||
BusinessLicenseInfoVO businessLicenseInfo = aliyunService.getBusinessLicenseInfo(signingBaseInfoDO.getBusinessLicense());
|
||||
franchiseeDO.setBusinessTerm(businessLicenseInfo.getValidPeriod());
|
||||
franchiseeDO.setLegalPerson(businessLicenseInfo.getLegalPerson());
|
||||
}
|
||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, franchiseeDO, InitiatingResponse.class);
|
||||
//更新线索(进入蓄水池并回填加盟商编码)
|
||||
if (initiatingResponse.getCode() == 0) {
|
||||
LineInfoDO lineInfoParam = new LineInfoDO();
|
||||
lineInfoParam.setId(request.getLineId());
|
||||
//蓄水池
|
||||
lineInfoParam.setJoinStatus(1);
|
||||
lineInfoParam.setPartnerNum(initiatingResponse.getData());
|
||||
lineInfoMapper.updateByPrimaryKeySelective(lineInfoParam);
|
||||
}
|
||||
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());
|
||||
}
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
}
|
||||
} finally {
|
||||
if (Boolean.TRUE.equals(acquired)) {
|
||||
String currentValue = redisUtilPool.getString(lockKey);
|
||||
if (lockValue.equals(currentValue)) {
|
||||
redisUtilPool.delKey(lockKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +358,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
String auditResult = redisUtilPool.getString(redisKey);
|
||||
if (WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode().equals(lineInfoDO.getWorkflowSubStageStatus())){
|
||||
if (WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode().equals(lineInfoDO.getWorkflowSubStageStatus())) {
|
||||
//鲜丰系统不稳定,会出现调用成功但内部状态未更改的情况,这时直接返回true即可
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -64,8 +64,7 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
}
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());
|
||||
log.info("lineInfoDO : {}", JSONObject.toJSONString(lineInfoDO));
|
||||
if (!Objects.isNull(lineInfoDO) && (WorkflowSubStageStatusEnum.INTENT_5.getCode().equals(lineInfoDO.getWorkflowSubStageStatus())||
|
||||
WorkflowSubStageEnum.INTEND.getCode()<lineInfoDO.getWorkflowSubStage())) {
|
||||
if (!Objects.isNull(lineInfoDO) && (WorkflowSubStageEnum.INTEND.getCode()<lineInfoDO.getWorkflowSubStage())) {
|
||||
throw new ServiceException(ErrorCodeEnum.INTENT_PASS);
|
||||
}
|
||||
//更改线索流程子状态为【待审核】
|
||||
@@ -80,7 +79,7 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
lineInfoParam.setLineStatus(1);
|
||||
if (lineInfoParam.getWantShopAreaId() != null) {
|
||||
Long regionId = regionAreaConfigDao.getByWantShopAreaId(lineInfoParam.getWantShopAreaId());
|
||||
lineInfoParam.setRegionId(regionId);
|
||||
lineInfoParam.setBigRegionId(regionId);
|
||||
}
|
||||
lineInfoDAO.insertOrUpdate(lineInfoParam);
|
||||
MemberQuestionDO memberQuestionDO = request.toMemberQuestionDO();
|
||||
@@ -103,6 +102,7 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo, String userId) {
|
||||
WorkflowSubStageEnum workflowSubStageEnum = WorkflowSubStageEnum.getWorkflowSubStageEnum(lineInfo.getWorkflowSubStage());
|
||||
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
//更新线索阶段
|
||||
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(), userId);
|
||||
//更新加盟问卷信息
|
||||
@@ -142,6 +142,7 @@ public class JoinIntentionServiceImpl extends LineFlowService implements JoinInt
|
||||
}
|
||||
response.setRejectPublicReason(lineAuditInfoDO.getRejectPublicReason());
|
||||
}
|
||||
response.setBigRegionId(byLineId.getBigRegionId());
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.enums.AuditResultTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.LineStatusEnum;
|
||||
import com.cool.store.enums.WorkflowSubStageEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.AuditCloseRequest;
|
||||
import com.cool.store.request.AuditPassRequest;
|
||||
@@ -47,6 +48,9 @@ public abstract class LineFlowService {
|
||||
if(!lineInfo.getWorkflowSubStage().equals(request.getWorkflowSubStage())){
|
||||
throw new ServiceException(ErrorCodeEnum.WORK_FLOW_STAGE_PASS_ERROR);
|
||||
}
|
||||
if (WorkflowSubStageEnum.INTEND.getCode().equals(lineInfo.getWorkflowStage())){
|
||||
lineInfo.setRegionId(request.getFightRegion());
|
||||
}
|
||||
String partnerId = lineInfo.getPartnerId();
|
||||
LineAuditInfoDO auditInfo = new LineAuditInfoDO();
|
||||
auditInfo.setLineId(request.getLineId());
|
||||
|
||||
@@ -100,6 +100,7 @@ public class LineServiceImpl implements LineService {
|
||||
result.setInvestmentManagerName(user.getName());
|
||||
result.setInvestmentManagerMobile(user.getMobile());
|
||||
}
|
||||
result.setBigRegionId(lineInfo.getBigRegionId());
|
||||
if(lineInfo.getRegionId() != null && lineInfo.getRegionId() != 0){
|
||||
Long bigRegionIdByAreaId = regionService.getBigRegionIdByAreaId(lineInfo.getWantShopAreaId());
|
||||
Map<Long, String> regionNameMap = regionDao.getRegionNameMap(Arrays.asList(bigRegionIdByAreaId, lineInfo.getRegionId()));
|
||||
@@ -417,7 +418,7 @@ public class LineServiceImpl implements LineService {
|
||||
userId = user.getUserId();
|
||||
}
|
||||
Long regionId = regionAreaConfigDao.getByWantShopAreaId(addLineRequest.getWantShopAreaId());
|
||||
lineInfoDO.setRegionId(regionId);
|
||||
lineInfoDO.setBigRegionId(regionId);
|
||||
lineInfoDO.setInvestmentManager(userId);
|
||||
lineInfoDO.setCreateUserId(userId);
|
||||
lineInfoDO.setUpdateUserId(userId);
|
||||
|
||||
@@ -357,6 +357,11 @@ public class PointServiceImpl implements PointService {
|
||||
*/
|
||||
private void initUploadRentContract(PointInfoDO pointInfo) {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(pointInfo.getLineId());
|
||||
ShopInfoDO updateShopInfo = new ShopInfoDO();
|
||||
updateShopInfo.setId(pointInfo.getShopId());
|
||||
updateShopInfo.setRegionId(pointInfo.getRegionId());
|
||||
updateShopInfo.setShopName(pointInfo.getPointName());
|
||||
shopInfoDAO.updateShopInfo(updateShopInfo);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(pointInfo.getShopId(), Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_12, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20));
|
||||
Map<String, String> templateParam = new HashMap<>();
|
||||
templateParam.put("pointName", pointInfo.getAddress());
|
||||
@@ -759,7 +764,7 @@ public class PointServiceImpl implements PointService {
|
||||
public Integer lineSelectPoint(SelectPointRequest request) {
|
||||
Long pointId = request.getPointId(), shopId = request.getShopId(), lineId = request.getLineId();
|
||||
String lockKey = MessageFormat.format(POINT_SELECT_KEY, enterpriseId, pointId);
|
||||
if(!redisUtilPool.setNxExpire(lockKey, JSONObject.toJSONString(request), 30)){
|
||||
if(!redisUtilPool.setNxExpire(lockKey, JSONObject.toJSONString(request), 30*1000)){
|
||||
throw new ServiceException(ErrorCodeEnum.POINT_IS_LOCK);
|
||||
}
|
||||
try {
|
||||
@@ -793,6 +798,7 @@ public class PointServiceImpl implements PointService {
|
||||
updateShop.setId(shopId);
|
||||
updateShop.setShopName(pointInfo.getPointName());
|
||||
updateShop.setPointId(pointId);
|
||||
updateShop.setRegionId(pointInfo.getRegionId());
|
||||
shopInfoDAO.updateShopInfo(updateShop);
|
||||
ShopSubStageStatusEnum selectStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_11;
|
||||
PointDetailInfoDO updateDetail = new PointDetailInfoDO();
|
||||
@@ -1035,7 +1041,7 @@ public class PointServiceImpl implements PointService {
|
||||
if(Objects.nonNull(todoPage) && CollectionUtils.isNotEmpty(todoPage.getResult())){
|
||||
List<Long> shopIds = todoPage.getResult().stream().map(RentInfoToDoVO::getShopId).collect(Collectors.toList());
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByIds(shopIds);
|
||||
Map<Long, Long> shopPointMap = shopList.stream().collect(Collectors.toMap(k->k.getId(), v->v.getPointId()));
|
||||
Map<Long, ShopInfoDO> shopPointMap = shopList.stream().collect(Collectors.toMap(k->k.getId(), Function.identity()));
|
||||
List<Long> regionIds = shopList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||
List<Long> pointIds = shopList.stream().map(ShopInfoDO::getPointId).collect(Collectors.toList());
|
||||
List<PointInfoDO> pointList = pointInfoDAO.getPointListByIds(pointIds);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class RegionAreaConfigServiceImpl implements RegionAreaConfigService {
|
||||
if(regionDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
|
||||
}
|
||||
if(!ThirdRegionTypeEnum.WAR_REGION.getCode().equals(regionDO.getThirdRegionType())){
|
||||
if(!ThirdRegionTypeEnum.LARGE_REGION.getCode().equals(regionDO.getThirdRegionType())){
|
||||
throw new ServiceException(ErrorCodeEnum.ONLY_WAR_REGION_CONFIG);
|
||||
}
|
||||
List<Long> areaIdList = regionAreaConfigAddRequest.getAreaIdList();
|
||||
|
||||
@@ -53,7 +53,7 @@ public class RegionServiceImpl implements RegionService {
|
||||
public RegionPathNameVO getAllRegionName(Long regionId) {
|
||||
RegionDO regionDO = regionMapper.getByRegionId(regionId);
|
||||
if(regionDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
|
||||
return null;
|
||||
}
|
||||
|
||||
if(regionDO.getDeleted() || StringUtils.isBlank(regionDO.getRegionPath()) || CommonConstants.LONG_ONE.equals(regionDO.getId())){
|
||||
@@ -126,20 +126,21 @@ public class RegionServiceImpl implements RegionService {
|
||||
if(Objects.isNull(warRegionId)){
|
||||
return 0L;
|
||||
}
|
||||
RegionDO warRegion = regionMapper.getByRegionId(warRegionId);
|
||||
if(warRegion == null){
|
||||
throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
|
||||
}
|
||||
// 根据战区id获取大区id
|
||||
String warRegionPath = warRegion.getRegionPath().substring(1, warRegion.getRegionPath().length() - 1);
|
||||
String[] warRegionIdArr = warRegionPath.split(Constants.FORWARD_SLASH);
|
||||
List<RegionDO> regionDOList = regionMapper.getRegionByRegionIds(Arrays.asList(warRegionIdArr));
|
||||
for (RegionDO regionDO : regionDOList){
|
||||
if(ThirdRegionTypeEnum.LARGE_REGION.getCode().equals(regionDO.getThirdRegionType())){
|
||||
return regionDO.getId();
|
||||
}
|
||||
}
|
||||
return 0L;
|
||||
return warRegionId;
|
||||
// RegionDO warRegion = regionMapper.getByRegionId(warRegionId);
|
||||
// if(warRegion == null){
|
||||
// throw new ServiceException(ErrorCodeEnum.REGION_NOT_EXIST);
|
||||
// }
|
||||
// // 根据战区id获取大区id
|
||||
// String warRegionPath = warRegion.getRegionPath().substring(1, warRegion.getRegionPath().length() - 1);
|
||||
// String[] warRegionIdArr = warRegionPath.split(Constants.FORWARD_SLASH);
|
||||
// List<RegionDO> regionDOList = regionMapper.getRegionByRegionIds(Arrays.asList(warRegionIdArr));
|
||||
// for (RegionDO regionDO : regionDOList){
|
||||
// if(ThirdRegionTypeEnum.LARGE_REGION.getCode().equals(regionDO.getThirdRegionType())){
|
||||
// return regionDO.getId();
|
||||
// }
|
||||
// }
|
||||
// return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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.constants.CommonConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.entity.*;
|
||||
@@ -19,6 +19,7 @@ import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.CoolStoreStartFlowService;
|
||||
import com.cool.store.service.PreparationService;
|
||||
import com.cool.store.service.SignFranchiseService;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -80,6 +81,10 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
@Resource
|
||||
CommonService commonService;
|
||||
|
||||
@Resource
|
||||
RedisUtilPool redisUtilPool;
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean auditResult(AuditResultRequest request) {
|
||||
log.info("SignFranchiseServiceImpl auditResult request:{}", JSONObject.toJSONString(request));
|
||||
@@ -135,24 +140,45 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
if (Objects.isNull(request.getShopId())) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
|
||||
}
|
||||
SignFranchiseDO signFranchiseDO = request.toSignFranchiseDO();
|
||||
if (Objects.isNull(request.getId())) {
|
||||
signFranchiseMapper.insertSelective(signFranchiseDO);
|
||||
} else {
|
||||
signFranchiseMapper.updateByPrimaryKeySelective(signFranchiseDO);
|
||||
String lockKey = "submitSignFranchise:" + request.getShopId();
|
||||
//流水
|
||||
String lockValue = UUID.randomUUID().toString();
|
||||
boolean acquired = false;
|
||||
try {
|
||||
//10s过期
|
||||
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
|
||||
if (Boolean.TRUE.equals(acquired)) {
|
||||
SignFranchiseDO signFranchiseDO = request.toSignFranchiseDO();
|
||||
if (Objects.isNull(request.getId())) {
|
||||
signFranchiseMapper.insertSelective(signFranchiseDO);
|
||||
} else {
|
||||
signFranchiseMapper.updateByPrimaryKeySelective(signFranchiseDO);
|
||||
}
|
||||
//店铺信息
|
||||
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
|
||||
FranchiseAgreementRequest franchiseAgreementRequest = convertFranchiseAgreement(request, shopInfoDO, user);
|
||||
MemberQuestionDO memberQuestionDO = joinIntentionMapper.getByLineId(shopInfoDO.getLineId());
|
||||
log.info("submitSignFranchise franchiseAgreementRequest :{}", JSONObject.toJSONString(franchiseAgreementRequest));
|
||||
ResponseResult responseResult = coolStoreStartFlowService.franchiseAgreement(franchiseAgreementRequest, memberQuestionDO.getJoinType());
|
||||
//更新状态为加盟商
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
|
||||
lineInfoDO.setJoinStatus(2);
|
||||
lineInfoMapper.insertOrUpdate(lineInfoDO);
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83);
|
||||
return responseResult;
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
}
|
||||
|
||||
} finally {
|
||||
if (Boolean.TRUE.equals(acquired)) {
|
||||
String currentValue = redisUtilPool.getString(lockKey);
|
||||
if (lockValue.equals(currentValue)) {
|
||||
redisUtilPool.delKey(lockKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
//店铺信息
|
||||
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());
|
||||
FranchiseAgreementRequest franchiseAgreementRequest = convertFranchiseAgreement(request, shopInfoDO, user);
|
||||
MemberQuestionDO memberQuestionDO = joinIntentionMapper.getByLineId(shopInfoDO.getLineId());
|
||||
log.info("submitSignFranchise franchiseAgreementRequest :{}",JSONObject.toJSONString(franchiseAgreementRequest));
|
||||
ResponseResult responseResult = coolStoreStartFlowService.franchiseAgreement(franchiseAgreementRequest, memberQuestionDO.getJoinType());
|
||||
//更新状态为加盟商
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
|
||||
lineInfoDO.setJoinStatus(2);
|
||||
lineInfoMapper.insertOrUpdate(lineInfoDO);
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83);
|
||||
return responseResult;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -164,47 +190,47 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
Long shopId = request.getShopId();
|
||||
//线索信息
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());
|
||||
if (Objects.isNull(lineInfoDO)){
|
||||
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("lineInfoDO").getErrorMessage());
|
||||
if (Objects.isNull(lineInfoDO)) {
|
||||
throw new ServiceException(109014, ApiErrorCodeEnum.getByCode("lineInfoDO").getErrorMessage());
|
||||
}
|
||||
//缴费信息
|
||||
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(shopId);
|
||||
if (Objects.isNull(franchiseFeeDO)){
|
||||
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("franchiseFeeDO").getErrorMessage());
|
||||
if (Objects.isNull(franchiseFeeDO)) {
|
||||
throw new ServiceException(109014, ApiErrorCodeEnum.getByCode("franchiseFeeDO").getErrorMessage());
|
||||
}
|
||||
//线索id
|
||||
Long lineId = shopInfoDO.getLineId();
|
||||
//签约信息
|
||||
SigningBaseInfoDO signingBaseInfoDO = intentAgreementMapper.selectByPartnerIdOrLineId(null, lineId);
|
||||
if (Objects.isNull(signingBaseInfoDO)){
|
||||
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("signingBaseInfoDO").getErrorMessage());
|
||||
if (Objects.isNull(signingBaseInfoDO)) {
|
||||
throw new ServiceException(109014, ApiErrorCodeEnum.getByCode("signingBaseInfoDO").getErrorMessage());
|
||||
}
|
||||
//缴款信息
|
||||
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId, 1, shopId);
|
||||
if (Objects.isNull(linePayDO)){
|
||||
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("linePayDO").getErrorMessage());
|
||||
if (Objects.isNull(linePayDO)) {
|
||||
throw new ServiceException(109014, ApiErrorCodeEnum.getByCode("linePayDO").getErrorMessage());
|
||||
}
|
||||
//铺位信息
|
||||
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(lineId, shopId);
|
||||
if (Objects.isNull(pointInfoDO)){
|
||||
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("pointInfoDO").getErrorMessage());
|
||||
if (Objects.isNull(pointInfoDO)) {
|
||||
throw new ServiceException(109014, ApiErrorCodeEnum.getByCode("pointInfoDO").getErrorMessage());
|
||||
}
|
||||
//建店数据
|
||||
SystemBuildingShopDO systemBuildingShopDO = systemBuildingShopMapper.selectOne(SystemBuildingShopDO.builder().shopId(shopId).lineId(lineId).build());
|
||||
if (Objects.isNull(systemBuildingShopDO)){
|
||||
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("systemBuildingShopDO").getErrorMessage());
|
||||
if (Objects.isNull(systemBuildingShopDO)) {
|
||||
throw new ServiceException(109014, ApiErrorCodeEnum.getByCode("systemBuildingShopDO").getErrorMessage());
|
||||
}
|
||||
//证照办理
|
||||
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectByShopId(shopId);
|
||||
if (Objects.isNull(licenseTransactDO)){
|
||||
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("licenseTransactDO").getErrorMessage());
|
||||
if (Objects.isNull(licenseTransactDO)) {
|
||||
throw new ServiceException(109014, ApiErrorCodeEnum.getByCode("licenseTransactDO").getErrorMessage());
|
||||
}
|
||||
ThirdDepartmentDO thirdDepartmentDO = new ThirdDepartmentDO();
|
||||
if (Objects.nonNull(systemBuildingShopDO)) {
|
||||
//三方部门表
|
||||
thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
|
||||
if (Objects.isNull(thirdDepartmentDO)){
|
||||
throw new ServiceException(109014,ApiErrorCodeEnum.getByCode("thirdDepartmentDO").getErrorMessage());
|
||||
if (Objects.isNull(thirdDepartmentDO)) {
|
||||
throw new ServiceException(109014, ApiErrorCodeEnum.getByCode("thirdDepartmentDO").getErrorMessage());
|
||||
}
|
||||
}
|
||||
//找不到的url统一用这个
|
||||
@@ -226,12 +252,12 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
.hkbzj(Integer.valueOf(franchiseFeeDO.getLoanMargin()))
|
||||
.hkbzjdx(Integer.valueOf(franchiseFeeDO.getLoanMargin()))
|
||||
.hkbzjwb(Convert.digitToChinese(Integer.valueOf(franchiseFeeDO.getLoanMargin())))
|
||||
.ht_day(timeUtils(request.getContractStartTime(),"day"))
|
||||
.ht_day2(timeUtils(request.getContractStartEndTime(),"day"))
|
||||
.ht_month1(timeUtils(request.getContractStartTime(),"month"))
|
||||
.ht_month2(timeUtils(request.getContractStartEndTime(),"month"))
|
||||
.ht_year1(timeUtils(request.getContractStartTime(),"year"))
|
||||
.ht_year2(timeUtils(request.getContractStartEndTime(),"year"))
|
||||
.ht_day(timeUtils(request.getContractStartTime(), "day"))
|
||||
.ht_day2(timeUtils(request.getContractStartEndTime(), "day"))
|
||||
.ht_month1(timeUtils(request.getContractStartTime(), "month"))
|
||||
.ht_month2(timeUtils(request.getContractStartEndTime(), "month"))
|
||||
.ht_year1(timeUtils(request.getContractStartTime(), "year"))
|
||||
.ht_year2(timeUtils(request.getContractStartEndTime(), "year"))
|
||||
.idcard_1(Collections.singletonList(signingBaseInfoDO.getIdCardFront()))
|
||||
.idcard_2(Collections.singletonList(signingBaseInfoDO.getIdCardReverse()))
|
||||
.idcard_address(signingBaseInfoDO.getIdCardAddress())
|
||||
@@ -248,26 +274,26 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
.jmf2(Integer.valueOf(franchiseFeeDO.getFirstYearFee()))
|
||||
.jmf3(Integer.valueOf(franchiseFeeDO.getSecondYearFee()))
|
||||
.jmf4(Integer.valueOf(franchiseFeeDO.getThirdYearFee()))
|
||||
.jmfday1(timeUtils(franchiseFeeDO.getFirstYearStartTime(),"day"))
|
||||
.jmfday2(timeUtils(franchiseFeeDO.getFirstYearEndTime(),"day"))
|
||||
.jmfday3(timeUtils(franchiseFeeDO.getSecondYearStartTime(),"day"))
|
||||
.jmfday4(timeUtils(franchiseFeeDO.getSecondYearEndTime(),"day"))
|
||||
.jmfday5(timeUtils(franchiseFeeDO.getThirdYearStartTime(),"day"))
|
||||
.jmfday6(timeUtils(franchiseFeeDO.getThirdYearEndTime(),"day"))
|
||||
.jmfday1(timeUtils(franchiseFeeDO.getFirstYearStartTime(), "day"))
|
||||
.jmfday2(timeUtils(franchiseFeeDO.getFirstYearEndTime(), "day"))
|
||||
.jmfday3(timeUtils(franchiseFeeDO.getSecondYearStartTime(), "day"))
|
||||
.jmfday4(timeUtils(franchiseFeeDO.getSecondYearEndTime(), "day"))
|
||||
.jmfday5(timeUtils(franchiseFeeDO.getThirdYearStartTime(), "day"))
|
||||
.jmfday6(timeUtils(franchiseFeeDO.getThirdYearEndTime(), "day"))
|
||||
.jmfdx(Integer.valueOf(franchiseFeeDO.getYearFranchiseFee()))
|
||||
.jmfmonth1(timeUtils(franchiseFeeDO.getFirstYearStartTime(),"month"))
|
||||
.jmfmonth2(timeUtils(franchiseFeeDO.getFirstYearEndTime(),"month"))
|
||||
.jmfmonth3(timeUtils(franchiseFeeDO.getSecondYearStartTime(),"month"))
|
||||
.jmfmonth4(timeUtils(franchiseFeeDO.getSecondYearEndTime(),"month"))
|
||||
.jmfmonth5(timeUtils(franchiseFeeDO.getThirdYearStartTime(),"month"))
|
||||
.jmfmonth6(timeUtils(franchiseFeeDO.getThirdYearEndTime(),"month"))
|
||||
.jmfmonth1(timeUtils(franchiseFeeDO.getFirstYearStartTime(), "month"))
|
||||
.jmfmonth2(timeUtils(franchiseFeeDO.getFirstYearEndTime(), "month"))
|
||||
.jmfmonth3(timeUtils(franchiseFeeDO.getSecondYearStartTime(), "month"))
|
||||
.jmfmonth4(timeUtils(franchiseFeeDO.getSecondYearEndTime(), "month"))
|
||||
.jmfmonth5(timeUtils(franchiseFeeDO.getThirdYearStartTime(), "month"))
|
||||
.jmfmonth6(timeUtils(franchiseFeeDO.getThirdYearEndTime(), "month"))
|
||||
.jmfwb(Convert.digitToChinese(Integer.valueOf(franchiseFeeDO.getYearFranchiseFee())))
|
||||
.jmfyear1(timeUtils(franchiseFeeDO.getFirstYearStartTime(),"year"))
|
||||
.jmfyear2(timeUtils(franchiseFeeDO.getFirstYearEndTime(),"year"))
|
||||
.jmfyear3(timeUtils(franchiseFeeDO.getSecondYearStartTime(),"year"))
|
||||
.jmfyear4(timeUtils(franchiseFeeDO.getSecondYearEndTime(),"year"))
|
||||
.jmfyear5(timeUtils(franchiseFeeDO.getThirdYearStartTime(),"year"))
|
||||
.jmfyear6(timeUtils(franchiseFeeDO.getThirdYearEndTime(),"year"))
|
||||
.jmfyear1(timeUtils(franchiseFeeDO.getFirstYearStartTime(), "year"))
|
||||
.jmfyear2(timeUtils(franchiseFeeDO.getFirstYearEndTime(), "year"))
|
||||
.jmfyear3(timeUtils(franchiseFeeDO.getSecondYearStartTime(), "year"))
|
||||
.jmfyear4(timeUtils(franchiseFeeDO.getSecondYearEndTime(), "year"))
|
||||
.jmfyear5(timeUtils(franchiseFeeDO.getThirdYearStartTime(), "year"))
|
||||
.jmfyear6(timeUtils(franchiseFeeDO.getThirdYearEndTime(), "year"))
|
||||
.jmsdkjt(temp)
|
||||
.jmsdm(lineInfoDO.getPartnerNum())
|
||||
.jmshtzt(0)
|
||||
@@ -444,7 +470,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean rePay(Long shopId) {
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74);
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74);
|
||||
shopStageInfoDAO.updateShopStageToNotStarted(shopId, ShopSubStageEnum.SHOP_STAGE_8);
|
||||
return true;
|
||||
}
|
||||
@@ -452,13 +478,13 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
private int timeUtils(Date time, String type) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(time);
|
||||
switch (type){
|
||||
switch (type) {
|
||||
case "year":
|
||||
return calendar.get(Calendar.YEAR);
|
||||
case "month":
|
||||
return calendar.get(Calendar.MONTH) + 1;
|
||||
case "day":
|
||||
return calendar.get(Calendar.DAY_OF_MONTH);
|
||||
return calendar.get(Calendar.DAY_OF_MONTH);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.entity.*;
|
||||
@@ -23,6 +24,7 @@ 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.RedisUtilPool;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -30,10 +32,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -86,6 +85,9 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
|
||||
@Resource
|
||||
PointDetailInfoMapper pointDetailInfoMapper;
|
||||
|
||||
@Resource
|
||||
RedisUtilPool redisUtilPool;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseResult submitSysBuildStore(SysStoreAppRequest request, LoginUserInfo user) {
|
||||
@@ -93,21 +95,38 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
|
||||
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);
|
||||
String lockKey = "submitSysBuildStore:" + request.getShopId();
|
||||
String lockValue = UUID.randomUUID().toString();
|
||||
boolean acquired = false;
|
||||
try {
|
||||
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
|
||||
if (Boolean.TRUE.equals(acquired)) {
|
||||
//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, user);
|
||||
log.info("submitSysBuildStore apiRequest:{}",JSONObject.toJSONString(apiRequest));
|
||||
return coolStoreStartFlowService.newStore(apiRequest, request.getShopId());
|
||||
}else {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
}
|
||||
}finally {
|
||||
if (Boolean.TRUE.equals(acquired)) {
|
||||
String currentValue = redisUtilPool.getString(lockKey);
|
||||
if (lockValue.equals(currentValue)) {
|
||||
redisUtilPool.delKey(lockKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
//2.查找、组装数组
|
||||
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(request.getLineId());//线索信息
|
||||
PointInfoDO pointInfoDO = pointInfoMapper.getDataByShopIdAndLineId(request.getLineId(), request.getShopId());//查铺位信息确定铺位所在大区、战区、门店所在省市区街道地址
|
||||
//3.请求鲜丰接口
|
||||
NewStoreRequest apiRequest = convertToNewStoreRequest(request, lineInfoDO, pointInfoDO, user);
|
||||
log.info("submitSysBuildStore apiRequest:{}",JSONObject.toJSONString(apiRequest));
|
||||
return coolStoreStartFlowService.newStore(apiRequest, request.getShopId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -295,7 +314,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
|
||||
// csqmc
|
||||
newStoreRequest.setCsqmc(BusinessDistrictEnum.getByCode(sysStoreAppRequest.getStoreDetail().getSubBusinessType()).getDesc());
|
||||
//ddxm 督导
|
||||
newStoreRequest.setDdxm(userMap.get(sysStoreAppRequest.getSupervisorDetail().getSupervisorId()).getJobnumber());
|
||||
newStoreRequest.setDdxm(sysStoreAppRequest.getSupervisorDetail().getSupervisorId());
|
||||
// dpzlht
|
||||
newStoreRequest.setDpzlht(objects);
|
||||
// end_time
|
||||
@@ -386,7 +405,6 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
|
||||
// zmrjkllzs1
|
||||
newStoreRequest.setZmrjkllzs1(PassengerFlowEnum.getByCode(sysStoreAppRequest.getStoreDetail().getAverageDailyRs()).getType());
|
||||
// zppsyfy
|
||||
newStoreRequest.setZppsyfy(0.05);
|
||||
newStoreRequest.setZppsyfy(Double.valueOf(sysStoreAppRequest.getStoreDetail().getUsageRate()));
|
||||
// zq
|
||||
newStoreRequest.setZq(pointInfoDO.getDistrict());
|
||||
@@ -444,6 +462,10 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
|
||||
shopInfoDO.setStoreNum(request.getStoreNum()); //更新门店编码
|
||||
shopInfoDO.setSupervisorUserId(Objects.isNull(supervisor) ? "" : supervisor.getUserId());//更新督导
|
||||
SystemBuildingShopDO systemBuildingShopDO = systemBuildingShopMapper.selectOne(SystemBuildingShopDO.builder().shopId(shopId).build());
|
||||
if (StringUtils.isEmpty(shopInfoDO.getSupervisorUserId())&&StringUtils.isNotEmpty(systemBuildingShopDO.getSupervisorId())){
|
||||
EnterpriseUserDO user = enterpriseUserMapper.getUserInfoByJobnumber(systemBuildingShopDO.getSupervisorId());
|
||||
shopInfoDO.setSupervisorUserId(user!=null?user.getUserId():"");
|
||||
}
|
||||
shopInfoDO.setShopName(systemBuildingShopDO.getStoreName());//更新铺位名称
|
||||
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
|
||||
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
|
||||
|
||||
@@ -140,14 +140,16 @@ public class TempUserDetailServiceImpl implements TempUserDetailService {
|
||||
List<String> userIdList = enterpriseUserRoleDao.getUserIdsByRoleIdList(Collections.singletonList(UserRoleEnum.TRAINER.getCode()));
|
||||
RegionDO regionDO = regionDao.getRegionById(shopInfoDO.getRegionId());
|
||||
//
|
||||
userIdList = enterpriseUserDAO.getUserIdListByRegionId(Long.valueOf(regionDO.getParentId()), userIdList);
|
||||
if (regionDO != null && regionDO.getParentId() != null){
|
||||
userIdList = enterpriseUserDAO.getUserIdListByRegionId(Long.valueOf(regionDO.getParentId()), userIdList);
|
||||
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("userName", tempUserDetailRequest.getName());
|
||||
messageMap.put("mobile", tempUserDetailRequest.getPhone());
|
||||
messageMap.put("registerTime", DateUtils.dateTime(tempUserDetailRequest.getRegisterTime()));
|
||||
messageMap.put("userDetailId", tempUserDetailDO.getId().toString());
|
||||
commonService.sendMessage(userIdList, MessageEnum.MESSAGE_21, messageMap);
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("userName", tempUserDetailRequest.getName());
|
||||
messageMap.put("mobile", tempUserDetailRequest.getPhone());
|
||||
messageMap.put("registerTime", DateUtils.dateTime(tempUserDetailRequest.getRegisterTime()));
|
||||
messageMap.put("userDetailId", tempUserDetailDO.getId().toString());
|
||||
commonService.sendMessage(userIdList, MessageEnum.MESSAGE_21, messageMap);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -183,8 +185,17 @@ public class TempUserDetailServiceImpl implements TempUserDetailService {
|
||||
}
|
||||
if (StringUtil.isBlank(enterpriseUserDO.getJobnumber())) {
|
||||
throw new ServiceException(ErrorCodeEnum.JOBNUMBER_NOT_EXIST);
|
||||
|
||||
}
|
||||
return xfsgEhrService.getUserInfoByCode(enterpriseUserDO.getJobnumber());
|
||||
StaffBaseInfoDTO userInfoByCode = xfsgEhrService.getUserInfoByCode(enterpriseUserDO.getJobnumber());
|
||||
//默认是店员
|
||||
userInfoByCode.setStoreManagerFlag(Boolean.FALSE);
|
||||
//如果有店长角色 则是店长
|
||||
List<Long> userRoleIds = enterpriseUserRoleDao.getUserRoleIds(enterpriseUserDO.getUserId());
|
||||
if (CollectionUtils.isNotEmpty(userRoleIds)&&userRoleIds.contains(UserRoleEnum.XFSG_SHOPOWNER.getCode())){
|
||||
userInfoByCode.setStoreManagerFlag(Boolean.TRUE);
|
||||
}
|
||||
return userInfoByCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.cool.store.response.xfsgFirstOderListResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.service.impl.CommonService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.NumberConverter;
|
||||
import com.cool.store.utils.poi.DateUtils;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
@@ -486,7 +487,7 @@ public class XxlJobHandler {
|
||||
StaffExamInfoDTO staffExamInfoDTO = xfsgEhrService.getUserExamInfo(enterpriseUserDO.getJobnumber());
|
||||
if (staffExamInfoDTO != null && StringUtils.isNotBlank(staffExamInfoDTO.getExamResult())
|
||||
&& StringUtils.isNotBlank(staffExamInfoDTO.getExamScore())) {
|
||||
employeeTrainingDO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? Integer.valueOf(staffExamInfoDTO.getExamScore()) : null);
|
||||
employeeTrainingDO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? NumberConverter.convertMath(staffExamInfoDTO.getExamScore()) : null);
|
||||
employeeTrainingDO.setTheoreticalExamStatus(ExamStatusEnum.matchCodeByDesc(staffExamInfoDTO.getExamResult()));
|
||||
employeeTrainingDAO.updateByPrimaryKeySelective(employeeTrainingDO);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user