Merge remote-tracking branch 'xfsg/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -174,6 +174,8 @@ public enum ErrorCodeEnum {
|
||||
|
||||
SIGN_FRANCHISE_NOT_FOUND(109009, "加盟合同签约信息为空", null),
|
||||
|
||||
UNISSUED_STATEMENT(109010, "该门店未发布账单,无法付款", null),
|
||||
|
||||
|
||||
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
|
||||
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),
|
||||
|
||||
@@ -28,4 +28,7 @@ public class FirstOrderDAO {
|
||||
public FirstOrderDTO selectFirstOrderByShopId(Long shopId) {
|
||||
return firstOrderMapper.selectByShopId(shopId);
|
||||
}
|
||||
public Integer updateByPrimaryKeySelective(FirstOrderDO firstOrderDO) {
|
||||
return firstOrderMapper.updateByPrimaryKeySelective(firstOrderDO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,11 +34,12 @@ public class LinePayDAO {
|
||||
}
|
||||
|
||||
/**
|
||||
* //todo 全部替换掉后弃用
|
||||
*
|
||||
* @param lineId
|
||||
* @param payBusinessType
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public LinePayDO getLinePayByLineIdAndPayType(Long lineId,Integer payBusinessType) {
|
||||
LinePayDO linePayDO = linePayMapper.getByLineIdAndPayTypeAndShopId(lineId,payBusinessType,null);
|
||||
return linePayDO;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.FranchiseFeeDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
public interface FranchiseFeeMapper extends Mapper<FranchiseFeeDO> {
|
||||
FranchiseFeeDO selectByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/3
|
||||
* @description:根据区域id查询所有处于装修验收阶段的店铺
|
||||
* @description:根据区域id查询所有处于的店铺
|
||||
*/
|
||||
List<ShopInfoDO> selectShopListByRegionId(@Param("regionIds") List<Long> regionIds,@Param("status")Integer status);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<select id="selectByShopId" resultType="com.cool.store.dto.openPreparation.FirstOrderDTO">
|
||||
select total_order_deposit as totalOrderDeposit, latest_payment_date as latestPaymentDate ,
|
||||
select id, total_order_deposit as totalOrderDeposit, latest_payment_date as latestPaymentDate ,
|
||||
estimated_cost as estimatedCost ,fruits_cost as fruitsCost
|
||||
from xfsg_first_order
|
||||
where shop_id = #{shopId}
|
||||
|
||||
@@ -2,4 +2,9 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cool.store.mapper.FranchiseFeeMapper">
|
||||
|
||||
<select id="selectByShopId" resultType="com.cool.store.entity.FranchiseFeeDO">
|
||||
select *
|
||||
from xfsg_franchise_fee
|
||||
where shop_id = #{shopId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -101,7 +101,10 @@
|
||||
deleted,
|
||||
</if>
|
||||
<if test="payBusinessType !=null">
|
||||
pay_business_type
|
||||
pay_business_type,
|
||||
</if>
|
||||
<if test="shopId !=null">
|
||||
shop_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@@ -160,7 +163,10 @@
|
||||
#{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="payBusinessType !=null">
|
||||
#{payBusinessType,jdbcType=TINYINT}
|
||||
#{payBusinessType,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="shopId !=null">
|
||||
#{shopId},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
AND xssi.shop_sub_stage_status != -100
|
||||
and xssi.shop_sub_stage in (120,130)
|
||||
and xssi.shop_sub_stage = 120
|
||||
<if test="status != null">
|
||||
and xssi.shop_sub_stage_status = #{status}
|
||||
</if>
|
||||
|
||||
@@ -15,12 +15,12 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
public class FirstOrderDTO {
|
||||
|
||||
private Long id;
|
||||
@ApiModelProperty("店铺Id")
|
||||
private Long shopId;
|
||||
@ApiModelProperty("首批订货金总额")
|
||||
private String totalOrderDeposit;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
||||
@ApiModelProperty("最晚打款时间")
|
||||
private Date latestPaymentDate;
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ public class LinePaySubmitRequest {
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("line_info.id")
|
||||
@NotNull(message = "线索id不能为空")
|
||||
private Long lineId;
|
||||
|
||||
@ApiModelProperty("支付状态 45:待缴费 50:已缴费 55缴费失败")
|
||||
|
||||
@@ -39,7 +39,7 @@ public class OpeningOperationPlanRequest {
|
||||
@ApiModelProperty("筹备人员ids")
|
||||
private List<String> preparationUserIds;
|
||||
|
||||
@ApiModelProperty("是否完成排车路线")
|
||||
@ApiModelProperty("是否完成排车路线0未完成,1完成")
|
||||
private Byte routeCompleted;
|
||||
|
||||
|
||||
|
||||
@@ -26,8 +26,5 @@ public class PlanListRequest extends PageBasicInfo {
|
||||
private List<String> regionIds;
|
||||
@ApiModelProperty("审核状态")
|
||||
private Integer resultType;
|
||||
@ApiModelProperty(value = "当前登录用户", hidden = true)
|
||||
private String curUserId;
|
||||
@ApiModelProperty(value = "管辖区域",hidden = true)
|
||||
private List<String> authRegionIds;
|
||||
|
||||
}
|
||||
|
||||
@@ -28,5 +28,5 @@ public class DecorationStageVO {
|
||||
@ApiModelProperty("计划结束时间")
|
||||
private String planEndTime;
|
||||
@ApiModelProperty("实际完成时间")
|
||||
private String actualCompleteTime;
|
||||
private String actualEndTime;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public interface DecorationService {
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/3
|
||||
* @description:获取新店装修下阶段的数据
|
||||
* @description:获取新店装修阶段的数据/flush
|
||||
*/
|
||||
FitmentResponse getFitmentSub(Long shopId);
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface DecorationService {
|
||||
* @Date: 2024/4/28
|
||||
* @description:获取装修款和支付二维码
|
||||
*/
|
||||
DecorationModelDTO DecorationModel(Long shopId);
|
||||
DecorationModelDTO decorationModel(Long shopId);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/28
|
||||
|
||||
@@ -107,6 +107,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
|
||||
@Override
|
||||
public SubmitLicenseResponse getDefault(Long shopId) {
|
||||
//todo 业务逻辑问题 @zhy
|
||||
//1.如果已经提交过证照信息,直接查询后组装数据返回
|
||||
LicenseTransactDO result = applyLicenseMapper.selectByShopId(shopId);
|
||||
SubmitLicenseResponse submitLicenseResponse = new SubmitLicenseResponse();
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import com.cool.store.vo.fitmentCheckVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -45,6 +46,7 @@ import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -103,10 +105,6 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
//施工阶段
|
||||
this.getConstructionInfo(shopId);
|
||||
stageInfoList.add(getDecorationStageVOS(shopId, ShopSubStageEnum.SHOP_STAGE_11));
|
||||
//TODO 三方验收
|
||||
stageInfoList.add(getDecorationStageVOS(shopId, ShopSubStageEnum.SHOP_STAGE_12));
|
||||
//TODO 视觉验收
|
||||
stageInfoList.add(getDecorationStageVOS(shopId, ShopSubStageEnum.SHOP_STAGE_13));
|
||||
fitmentResponse.setStageInfoList(stageInfoList);
|
||||
return fitmentResponse;
|
||||
}
|
||||
@@ -119,7 +117,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
decorationStageVO.setShopSubStageName(shopSubStageEnum.getShopSubStageName());
|
||||
decorationStageVO.setCreatTime(ShopStage.getCreateTime());
|
||||
decorationStageVO.setPlanEndTime(ShopStage.getPlanCompleteTime());
|
||||
decorationStageVO.setActualCompleteTime(ShopStage.getActualCompleteTime());
|
||||
decorationStageVO.setActualEndTime(ShopStage.getActualCompleteTime());
|
||||
return decorationStageVO;
|
||||
}
|
||||
|
||||
@@ -130,68 +128,44 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
log.error("拉取云立方接口获取数据为空");
|
||||
return null;
|
||||
}
|
||||
AtomicInteger flag = new AtomicInteger(0);
|
||||
Long flag ;
|
||||
DesignInfoVo designInfoVo = new DesignInfoVo();
|
||||
//平面图和施工
|
||||
List<DesignSchemeDTO> designScheme = decoration.getDesignScheme();
|
||||
if (designScheme != null && designScheme.size() > CommonConstants.ZERO) {
|
||||
Map<String, DesignSchemeDTO> designSchemeMap = designScheme.stream().collect(Collectors.toMap(DesignSchemeDTO::getName, dto -> dto));
|
||||
List<DesignSchemeDTO> designSchemeDTOS = new ArrayList<>();
|
||||
//平面图
|
||||
DesignSchemeDTO planeGraph = designSchemeMap.get(CommonConstants.FLOOR_PLAN);
|
||||
if (Objects.nonNull(planeGraph)) {
|
||||
designSchemeDTOS.add(planeGraph);
|
||||
if (DesignPhaseEnum.DESIGN_PHASE_ACCEPTANCE_PASS.getCode().equals(planeGraph.getStatus())) {
|
||||
flag.incrementAndGet();
|
||||
}
|
||||
}
|
||||
//施工图
|
||||
DesignSchemeDTO constructionDrawing = designSchemeMap.get(CommonConstants.CONSTRUCTION_DRAWING);
|
||||
if (Objects.nonNull(constructionDrawing)) {
|
||||
designSchemeDTOS.add(designSchemeMap.get(CommonConstants.CONSTRUCTION_DRAWING));
|
||||
if (DesignPhaseEnum.DESIGN_PHASE_ACCEPTANCE_PASS.getCode().equals(constructionDrawing.getStatus())) {
|
||||
flag.incrementAndGet();
|
||||
}
|
||||
}
|
||||
designInfoVo.setDesignScheme(designSchemeDTOS);
|
||||
}
|
||||
|
||||
long count = designScheme.stream().filter(design -> DesignPhaseEnum.DESIGN_PHASE_ACCEPTANCE_PASS.getCode().equals(design.getStatus())).count();
|
||||
flag = count;
|
||||
designInfoVo.setDesignScheme(designScheme);
|
||||
List<ConstructionScheduleDTO> constructionSchedule = decoration.getConstructionSchedule();
|
||||
if (constructionSchedule != null && constructionSchedule.size() > CommonConstants.ZERO) {
|
||||
if (CollectionUtils.isNotEmpty(constructionSchedule)) {
|
||||
Map<String, ConstructionScheduleDTO> constructionScheduleMap = constructionSchedule.stream().collect(Collectors.toMap(ConstructionScheduleDTO::getName,
|
||||
dto -> dto));
|
||||
if (constructionScheduleMap != null && constructionScheduleMap.size() > 0) {
|
||||
Function.identity(), (a, b) -> b));
|
||||
if (CollectionUtils.isNotEmpty(constructionSchedule)) {
|
||||
//量房
|
||||
ConstructionScheduleDTO measuringRoom = constructionScheduleMap.get(CommonConstants.MEASURING_THE_ROOM);
|
||||
if (Objects.nonNull(measuringRoom)) {
|
||||
designInfoVo.setMeasuringRoom(measuringRoom);
|
||||
if (ConstructionPhaseEnum.construction_FINSH.getCode().equals(measuringRoom.getState())) {
|
||||
flag.incrementAndGet();
|
||||
flag++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//预算
|
||||
//预算 TODO 产品
|
||||
List<BudgetDTO> proposedBookBudget = decoration.getProposedBookBudget();
|
||||
Collections.sort(decoration.getProposedBookBudget(), (x1, x2) -> x2.getId().compareTo(x1.getId()));
|
||||
if (!proposedBookBudget.isEmpty()) {
|
||||
BudgetDTO budgetDTO = proposedBookBudget.get(CommonConstants.ZERO);
|
||||
designInfoVo.setProposedBookBudget(budgetDTO);
|
||||
flag.incrementAndGet();
|
||||
flag++;
|
||||
}
|
||||
if (flag.get() == CommonConstants.FOUR) {
|
||||
if (flag == CommonConstants.FOUR) {
|
||||
//如果设计阶段未完成
|
||||
if (!ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91.getShopSubStageStatus().
|
||||
equals(shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_9).getShopSubStageStatus())) {
|
||||
//更新设计阶段状态完成
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91);
|
||||
//初始化装修款阶段
|
||||
List<ShopStageInfoDO> list = new ArrayList<>();
|
||||
List<ShopStageInfoDO> shopStageInfo = shopStageInfoDAO.getShopStageInfo(shopId, null);
|
||||
Map<Integer, ShopStageInfoDO> shopStageInfoDOMap = shopStageInfo.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopSubStage, data -> data));
|
||||
ShopStageInfoDO data = shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_10.getShopSubStage());
|
||||
data.setShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_100.getShopSubStageStatus());
|
||||
list.add(data);
|
||||
shopStageInfoDAO.batchUpdate(list);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91,
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_100));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,13 +182,13 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
DecorationStageVO decorationStageVO = new DecorationStageVO();
|
||||
decorationStageVO.setShopSubStageStatus(shopSubStageInfo.getShopSubStageStatus());
|
||||
decorationStageVO.setPlanBeginTime(shopSubStageInfo.getPlanCompleteTime());
|
||||
decorationStageVO.setActualCompleteTime(shopSubStageInfo.getActualCompleteTime());
|
||||
decorationStageVO.setActualEndTime(shopSubStageInfo.getActualCompleteTime());
|
||||
return decorationStageVO;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DecorationModelDTO DecorationModel(Long shopId) {
|
||||
public DecorationModelDTO decorationModel(Long shopId) {
|
||||
DecorationDTO decoration = getDecorationDTO(shopId);
|
||||
if (decoration == null) {
|
||||
log.error("拉取云立方接口获取数据为空");
|
||||
@@ -222,11 +196,13 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
}
|
||||
//预算
|
||||
List<BudgetDTO> proposedBookBudget = decoration.getProposedBookBudget();
|
||||
Collections.sort(decoration.getProposedBookBudget(), (x1, x2) -> x2.getId().compareTo(x1.getId()));
|
||||
if (proposedBookBudget.isEmpty()) {
|
||||
if (CollectionUtils.isEmpty(proposedBookBudget)) {
|
||||
log.error("云立方获取预算 is null");
|
||||
return null;
|
||||
}
|
||||
//TODO 抽出
|
||||
Collections.sort(decoration.getProposedBookBudget(), (x1, x2) -> x2.getId().compareTo(x1.getId()));
|
||||
//TODO 产品是否 最新
|
||||
String totalAmount = proposedBookBudget.get(0).getTotalAmount();
|
||||
//支付二维码url
|
||||
Long regionId = shopInfoDAO.getRegionIdByid(shopId);
|
||||
@@ -245,7 +221,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
log.error("拉取云立方接口获取数据为空");
|
||||
return null;
|
||||
}
|
||||
if (!decoration.getPayment().isEmpty()) {
|
||||
if (CollectionUtils.isNotEmpty(decoration.getPayment())) {
|
||||
request.setPayStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
|
||||
//更新阶段状态
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_102);
|
||||
@@ -262,6 +238,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public DecorationModelVO getDecorationModel(Long shopId, PartnerUserInfoVO partnerUserInfoVO) {
|
||||
//获取支付信息
|
||||
//Todo getLinePayInfo
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
Long lineId = shopInfo.getLineId();
|
||||
LinePayVO linePayInfo = linePayService.getLinePayInfo(lineId);
|
||||
@@ -299,10 +276,12 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
return null;
|
||||
}
|
||||
String totalAmount = proposedBookBudget.get(0).getTotalAmount();
|
||||
//已完成 TODO 改状态是否能单独提出
|
||||
if (!decoration.getPayment().isEmpty()) {
|
||||
linePayInfo.setPayStatus((byte) WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode().intValue());
|
||||
LinePaySubmitRequest submitRequest = new LinePaySubmitRequest();
|
||||
BeanUtil.copyProperties(linePayInfo, submitRequest);
|
||||
|
||||
linePayService.submitPayInfo(submitRequest, partnerUserInfoVO);
|
||||
//更新阶段状态
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_102);
|
||||
@@ -325,6 +304,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
Map<String, ConstructionScheduleDTO> constructionScheduleMap = constructionSchedule.stream().collect(Collectors.toMap(ConstructionScheduleDTO::getName,
|
||||
dto -> dto));
|
||||
List<ConstructionScheduleDTO> collect = new ArrayList<>();
|
||||
//TODO 把namefangjinlist 用collect.contains()
|
||||
collect.add(constructionScheduleMap.get(CommonConstants.APPROACH));
|
||||
collect.add(constructionScheduleMap.get(CommonConstants.ONE_DAY));
|
||||
collect.add(constructionScheduleMap.get(CommonConstants.TWO_DAY));
|
||||
@@ -336,20 +316,19 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
collect.add(constructionScheduleMap.get(CommonConstants.EIGHT_DAY));
|
||||
collect.add(constructionScheduleMap.get(CommonConstants.WITHDRAWAL));
|
||||
collect.sort(Comparator.comparing(ConstructionScheduleDTO::getId));
|
||||
//设置进场时间xfsg_acceptance_info
|
||||
//设置进场时间xfsg_acceptance_info TODO 用工具类
|
||||
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId);
|
||||
if (Objects.nonNull(acceptanceInfoDO) && StringUtils.isNotEmpty(constructionScheduleMap.get(CommonConstants.APPROACH).getActualBeginDate())) {
|
||||
if (StringUtils.isNotEmpty(constructionScheduleMap.get(CommonConstants.APPROACH).getActualBeginDate())) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
try {
|
||||
Date date = sdf.parse(constructionScheduleMap.get(CommonConstants.APPROACH).getActualBeginDate());
|
||||
acceptanceInfoDO.setActualEntryTime(date);
|
||||
} catch (ParseException e) {
|
||||
log.error("转化进场时间类型异常");
|
||||
}
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
try {
|
||||
Date date = sdf.parse(constructionScheduleMap.get(CommonConstants.APPROACH).getActualBeginDate());
|
||||
acceptanceInfoDO.setActualEntryTime(date);
|
||||
} catch (ParseException e) {
|
||||
log.error("转化进场时间类型异常");
|
||||
}
|
||||
}
|
||||
//施工完成时间,计划开始和完成时间
|
||||
//施工完成时间,计划开始和完成时间 //TODO 工具类处理为空
|
||||
if (StringUtils.isNotEmpty(constructionScheduleMap.get(CommonConstants.CONSTRUCTION_PHASE).getActualEndDate())) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
try {
|
||||
@@ -407,6 +386,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean submitThreeCheck(ThreeAcceptanceCheckRequest request) {
|
||||
log.info("submitThreeCheck, request:{} ", JSONObject.toJSONString(request));
|
||||
//TODO 未确定
|
||||
Boolean flag = assessmentDataDAO.deleteByShopId(request.getShopId());
|
||||
if (Boolean.FALSE.equals(flag)) {
|
||||
log.error("三方验收插入检查项失败");
|
||||
@@ -429,8 +409,9 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
|
||||
@Override
|
||||
public ThreeAcceptanceCheckRequest getThreeChecks(Long shopId) {
|
||||
//sql 确定范围
|
||||
List<AssessmentDataDO> assessmentDataDOS = assessmentDataDAO.selectListByShopId(shopId);
|
||||
if (assessmentDataDOS.isEmpty()) {
|
||||
if (CollectionUtils.isEmpty(assessmentDataDOS)) {
|
||||
log.error("该用户门店三方验收检查项为空");
|
||||
return null;
|
||||
}
|
||||
@@ -635,35 +616,17 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
//工程部
|
||||
if (StringUtils.isNotEmpty(acceptanceInfoDO.getEngineeringAcceptanceSignatures())) {
|
||||
ThreeAcceptanceDTO engineering = JSONObject.parseObject(acceptanceInfoDO.getEngineeringAcceptanceSignatures(), ThreeAcceptanceDTO.class);
|
||||
ThreeAcceptanceDTO engineeringDTO = new ThreeAcceptanceDTO();
|
||||
engineeringDTO.setPic(engineering.getPic());
|
||||
engineeringDTO.setRemark(engineering.getRemark());
|
||||
engineeringDTO.setResult(engineering.getResult());
|
||||
engineeringDTO.setAcceptanceTime(engineering.getAcceptanceTime());
|
||||
engineeringDTO.setStatus(engineering.getStatus());
|
||||
threeSignResponse.setEngineeringAcceptance(engineeringDTO);
|
||||
threeSignResponse.setEngineeringAcceptance(engineering);
|
||||
}
|
||||
//营运部
|
||||
if (StringUtils.isNotEmpty(acceptanceInfoDO.getOperationsAcceptanceSignatures())) {
|
||||
ThreeAcceptanceDTO operations = JSONObject.parseObject(acceptanceInfoDO.getOperationsAcceptanceSignatures(), ThreeAcceptanceDTO.class);
|
||||
ThreeAcceptanceDTO operationsDTO = new ThreeAcceptanceDTO();
|
||||
operationsDTO.setPic(operations.getPic());
|
||||
operationsDTO.setRemark(operations.getRemark());
|
||||
operationsDTO.setResult(operations.getResult());
|
||||
operationsDTO.setAcceptanceTime(operations.getAcceptanceTime());
|
||||
operationsDTO.setStatus(operations.getStatus());
|
||||
threeSignResponse.setOperationsAcceptance(operationsDTO);
|
||||
threeSignResponse.setOperationsAcceptance(operations);
|
||||
}
|
||||
//加盟商
|
||||
if (StringUtils.isNotEmpty(acceptanceInfoDO.getPartnerAcceptanceSignatures())) {
|
||||
ThreeAcceptanceDTO partner = JSONObject.parseObject(acceptanceInfoDO.getPartnerAcceptanceSignatures(), ThreeAcceptanceDTO.class);
|
||||
ThreeAcceptanceDTO partnerDTO = new ThreeAcceptanceDTO();
|
||||
partnerDTO.setPic(partner.getPic());
|
||||
partnerDTO.setRemark(partner.getRemark());
|
||||
partnerDTO.setResult(partner.getResult());
|
||||
partnerDTO.setAcceptanceTime(partner.getAcceptanceTime());
|
||||
partnerDTO.setStatus(partner.getStatus());
|
||||
threeSignResponse.setPartnerAcceptance(partnerDTO);
|
||||
threeSignResponse.setPartnerAcceptance(partner);
|
||||
}
|
||||
return threeSignResponse;
|
||||
}
|
||||
@@ -671,6 +634,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean bookingAcceptance(BookingAcceptanceRequest request) {
|
||||
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_121);
|
||||
ShopStageInfoDO newShopStageInfoDO = new ShopStageInfoDO();
|
||||
newShopStageInfoDO.setPlanCompleteTime(request.getBookingAcceptanceTime().toString());
|
||||
@@ -681,10 +645,13 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
|
||||
|
||||
private DecorationDTO getDecorationDTO(Long shopId) {
|
||||
List<Long> shopIds = new ArrayList<>();
|
||||
shopIds.add(shopId);
|
||||
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = shopInfoDAO.queryStoreNumeListByid(shopIds);
|
||||
String storeNum = openPlanShopInfoDTOS.get(0).getStoreNum();
|
||||
|
||||
//TODO
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (Objects.isNull(shopInfo)) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
|
||||
}
|
||||
String storeNum = shopInfo.getStoreNum();
|
||||
if (StringUtils.isNotEmpty(storeNum)) {
|
||||
ProjectDTO projectList = ylfService.getProjectList(storeNum);
|
||||
String projectId = projectList.getProjectId();
|
||||
|
||||
@@ -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.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.FirstOrderDAO;
|
||||
@@ -22,10 +23,12 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
@@ -64,32 +67,36 @@ public class FirstOrderServiceImp implements FirstOrderService {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
FirstOrderDTO firstOrderDTO = firstOrderDAO.selectFirstOrderByShopId(order.getShopId());
|
||||
if (firstOrderDTO == null) {
|
||||
Integer num;
|
||||
if (Objects.isNull(firstOrderDTO)) {
|
||||
//第一次提交
|
||||
order.setCreateTime(new Date());
|
||||
order.setCreateUserId(userId);
|
||||
order.setUpdateUserId(userId);
|
||||
num = firstOrderDAO.insertFirstOrder(order);
|
||||
} else {
|
||||
//修改只更新下面2个
|
||||
order.setId(firstOrderDTO.getId());
|
||||
order.setUpdateTime(new Date());
|
||||
order.setUpdateUserId(userId);
|
||||
num = firstOrderDAO.updateByPrimaryKeySelective(order);
|
||||
}
|
||||
//修改只更新下面2个
|
||||
order.setUpdateTime(new Date());
|
||||
order.setUpdateUserId(userId);
|
||||
Integer num = firstOrderDAO.insertFirstOrder(order);
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(order.getShopId(),
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152, null);
|
||||
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152);
|
||||
//云立方同步
|
||||
if (num > 0) {
|
||||
try {
|
||||
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
|
||||
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
|
||||
String storeNum = shopInfo.getStoreNum();
|
||||
Boolean flag = coolStoreStartFlowService.getFirstOrder(storeNum);
|
||||
Boolean flag = coolStoreStartFlowService.getFirstOrder(storeNum);
|
||||
log.info("saveOrder,flag:{}", flag);
|
||||
if (flag == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
|
||||
}
|
||||
if (flag) {
|
||||
//更改子阶段状态
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(order.getShopId(),
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151, null);
|
||||
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
|
||||
preparationService.whetherToOpenForAcceptance(order.getShopId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -98,7 +105,7 @@ public class FirstOrderServiceImp implements FirstOrderService {
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public FirstOrderDTO getOrder(Long shopId) {
|
||||
log.info("getOrder shopId:{},", shopId);
|
||||
@@ -107,9 +114,29 @@ public class FirstOrderServiceImp implements FirstOrderService {
|
||||
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
|
||||
}
|
||||
FirstOrderDTO order = firstOrderDAO.selectFirstOrderByShopId(shopId);
|
||||
ShopStageInfoDO firstOrderStageInfo = shopStageInfoDAO.
|
||||
getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
|
||||
order.setFirstOrderSubStage(firstOrderStageInfo.getShopSubStageStatus());
|
||||
if (Objects.nonNull(order)) {
|
||||
try {
|
||||
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
|
||||
String storeNum = shopInfo.getStoreNum();
|
||||
Boolean flag = coolStoreStartFlowService.getFirstOrder(storeNum);
|
||||
log.info("saveOrder,flag:{}", flag);
|
||||
if (flag == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
|
||||
}
|
||||
if (flag) {
|
||||
//更改子阶段状态
|
||||
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
|
||||
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
|
||||
order.setFirstOrderSubStage( ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
|
||||
preparationService.whetherToOpenForAcceptance(order.getShopId());
|
||||
}else {
|
||||
order.setFirstOrderSubStage(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("获取鲜丰订货金异常", e);
|
||||
}
|
||||
|
||||
}
|
||||
return order;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,10 +101,11 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
shopAuditInfoDO.setRejectReason(request.getResult());
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_74;
|
||||
}
|
||||
//更新阶段信息
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), shopSubStageStatusEnum);
|
||||
//插入audit
|
||||
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
||||
//更新阶段信息
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_80);
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), shopSubStageStatusEnum,shopAuditInfoDO.getId());
|
||||
//更新auditId
|
||||
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByPrimaryKey(request.getId());
|
||||
franchiseFeeDO.setAuditId(shopAuditInfoDO.getId());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.dao.LinePayDAO;
|
||||
@@ -23,6 +24,7 @@ import com.cool.store.service.LinePayService;
|
||||
import com.cool.store.utils.poi.constant.Constants;
|
||||
import com.cool.store.vo.LinePayVO;
|
||||
import com.cool.store.vo.PartnerUserInfoVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -38,6 +40,7 @@ import java.util.Objects;
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LinePayServiceImpl implements LinePayService {
|
||||
|
||||
@Resource
|
||||
@@ -68,59 +71,44 @@ public class LinePayServiceImpl implements LinePayService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long submitPayInfo(LinePaySubmitRequest request, PartnerUserInfoVO partnerUser) {
|
||||
public Long submitPayInfo(LinePaySubmitRequest request, PartnerUserInfoVO partnerUser){
|
||||
log.info("submitPayInfo request:{},partnerUser:{}", JSONObject.toJSONString(request),JSONObject.toJSONString(partnerUser));
|
||||
LineInfoDO lineInfo = new LineInfoDO();
|
||||
if (request.getLineId() != null){
|
||||
lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
}
|
||||
if (request.getPayBusinessType() != null
|
||||
&& request.getPayBusinessType() == Constants.ONE_INTEGER
|
||||
&& request.getShopId() != null) {
|
||||
LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(request.getLineId(), request.getPayBusinessType(),request.getShopId());
|
||||
if (Objects.isNull(linePayDO)) {
|
||||
fillLinePay(true, linePayDO, request, partnerUser);
|
||||
Long aLong = linePayDAO.addLinePay(linePayDO);
|
||||
FranchiseFeeDO franchiseFeeDO = new FranchiseFeeDO();
|
||||
franchiseFeeDO.setShopId(request.getShopId());
|
||||
FranchiseFeeDO result = franchiseFeeMapper.selectOneByExample(franchiseFeeDO);
|
||||
result.setPayId(aLong);
|
||||
franchiseFeeMapper.updateByPrimaryKeySelective(result);
|
||||
} else {
|
||||
fillLinePay(false, linePayDO, request, partnerUser);
|
||||
linePayDAO.updateLinePay(linePayDO);
|
||||
LinePayDO linePayDO = linePayDAO.getByLineIdAndPayTypeAndShopId(request.getLineId(), request.getPayBusinessType(),request.getShopId());
|
||||
Long payId = checkAndFill(linePayDO, request, partnerUser);
|
||||
if (PayBusinessTypeEnum.FRANCHISE_FEE.getCode().equals(request.getPayBusinessType()) && payId != null){
|
||||
FranchiseFeeDO franchiseFeeDO = franchiseFeeMapper.selectByShopId(request.getShopId());
|
||||
if (Objects.isNull(franchiseFeeDO)){
|
||||
throw new ServiceException(ErrorCodeEnum.UNISSUED_STATEMENT);
|
||||
}
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72);
|
||||
} else if (request.getPayBusinessType() != null
|
||||
&& request.getPayBusinessType() == PayBusinessTypeEnum.DECORATION_MODEL.getCode()
|
||||
&& request.getShopId() != null) {
|
||||
LinePayDO linePayDO = linePayDAO.getLinePayByLineIdAndPayType(request.getLineId(), PayBusinessTypeEnum.DECORATION_MODEL.getCode());
|
||||
if (linePayDO == null) {
|
||||
linePayDO = new LinePayDO();
|
||||
fillLinePay(true, linePayDO, request, partnerUser);
|
||||
linePayDAO.addLinePay(linePayDO);
|
||||
} else {
|
||||
fillLinePay(false, linePayDO, request, partnerUser);
|
||||
linePayDAO.updateLinePay(linePayDO);
|
||||
}
|
||||
return linePayDO.getId();
|
||||
} else {
|
||||
LinePayDO linePayDO = linePayDAO.getLinePayByLineIdAndPayType(request.getLineId(), 0);
|
||||
if (linePayDO == null) {
|
||||
linePayDO = new LinePayDO();
|
||||
fillLinePay(true, linePayDO, request, partnerUser);
|
||||
linePayDAO.addLinePay(linePayDO);
|
||||
} else {
|
||||
fillLinePay(false, linePayDO, request, partnerUser);
|
||||
linePayDAO.updateLinePay(linePayDO);
|
||||
}
|
||||
|
||||
franchiseFeeDO.setPayId(payId);
|
||||
franchiseFeeMapper.updateByPrimaryKeySelective(franchiseFeeDO);
|
||||
}
|
||||
if (PayBusinessTypeEnum.INTENT_MONEY.getCode().equals(request.getPayBusinessType())){
|
||||
lineInfo.setWorkflowSubStage(WorkflowSubStageEnum.PAY_DEPOSIT.getCode());
|
||||
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
|
||||
lineInfoDAO.insertOrUpdate(lineInfo);
|
||||
return linePayDO.getId();
|
||||
}
|
||||
return payId == null ? null : payId;
|
||||
}
|
||||
|
||||
return null;
|
||||
private Long checkAndFill(LinePayDO linePayDO,
|
||||
LinePaySubmitRequest request,
|
||||
PartnerUserInfoVO partnerUser) {
|
||||
if (Objects.isNull(linePayDO)){
|
||||
linePayDO = new LinePayDO();
|
||||
fillLinePay(Boolean.TRUE, linePayDO, request, partnerUser);
|
||||
Long aLong = linePayDAO.addLinePay(linePayDO);
|
||||
return aLong;
|
||||
}
|
||||
else {
|
||||
fillLinePay(Boolean.FALSE, linePayDO, request, partnerUser);
|
||||
linePayDAO.updateLinePay(linePayDO);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void fillLinePay(Boolean isAdd, LinePayDO linePayDO, LinePaySubmitRequest request, PartnerUserInfoVO partnerUser) {
|
||||
|
||||
@@ -31,6 +31,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -61,6 +62,8 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
private UserAuthMappingService userAuthMappingService;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
private CoolStoreStartFlowService coolStoreStartFlowService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -94,15 +97,10 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
openingOperationPlanDO.setCreateUserId(userId);
|
||||
planId = openingOperationPlanDAO.insertSelective(openingOperationPlanDO);
|
||||
}
|
||||
Integer Stage = shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_141, request.getShopId());
|
||||
if (Objects.isNull(Stage) || Stage == CommonConstants.ZERO) {
|
||||
log.error("auditPlan stage is null");
|
||||
throw new ServiceException(ErrorCodeEnum.UPDATE_SHOP_SUB_STAGE_STATUS_FALSE);
|
||||
}
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_141);
|
||||
return planId;
|
||||
} catch (Exception e) {
|
||||
log.error("addNewPlan Exception:{}", e);
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -115,18 +113,19 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL);
|
||||
}
|
||||
OpeningOperationPlanDO openingOperationPlanDO = openingOperationPlanDAO.selectByShopId(shopId);
|
||||
if (openingOperationPlanDO != null) {
|
||||
OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO(openingOperationPlanDO);
|
||||
String preparationUserIds = openingOperationPlanDO.getPreparationUserIds();
|
||||
List<String> stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList());
|
||||
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(stream);
|
||||
EnterpriseUserDO username = enterpriseUserDAO.getUserInfoById(openingOperationPlanDO.getSubmittedUserId());
|
||||
openingOperationPlanVO.setSubmittedUserName(username.getName());
|
||||
openingOperationPlanVO.setPreparationUsers(nameByUserId);
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
openingOperationPlanVO.setShopName(shopInfo.getShopName());
|
||||
return openingOperationPlanVO;
|
||||
}
|
||||
if (Objects.nonNull(openingOperationPlanDO) ) {
|
||||
OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO(openingOperationPlanDO);
|
||||
String preparationUserIds = openingOperationPlanDO.getPreparationUserIds();
|
||||
List<String> stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList());
|
||||
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(stream);
|
||||
//TODO getname方法
|
||||
EnterpriseUserDO username = enterpriseUserDAO.getUserInfoById(openingOperationPlanDO.getSubmittedUserId());
|
||||
openingOperationPlanVO.setSubmittedUserName(username.getName());
|
||||
openingOperationPlanVO.setPreparationUsers(nameByUserId);
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
openingOperationPlanVO.setShopName(shopInfo.getShopName());
|
||||
return openingOperationPlanVO;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -134,14 +133,12 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
@Override
|
||||
public PageInfo<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
|
||||
log.info("getPlanListPage request:{}", JSONObject.toJSONString(request));
|
||||
if(!sysRoleService.checkIsAdmin(request.getCurUserId())){
|
||||
request.setAuthRegionIds(userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(request.getCurUserId()));
|
||||
}
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
//去shop_info表查询店铺名字,店铺code,开店负责人id,督导id,区域id,lineinfo 加盟商name,手机号,招商经理id,open_plan,提交时间,审核状态
|
||||
//TODO 拆表 产品沟通限定时间
|
||||
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = openingOperationPlanDAO.getOpenPlanShopListByCondition(request);
|
||||
PageInfo pageInfo = new PageInfo<>(openPlanShopInfoDTOS);
|
||||
//开店负责人id,督导id,招商经理id
|
||||
//开店负责人id,督导id,招商经理id // TODO id 为null过滤
|
||||
Set<String> userIdset = openPlanShopInfoDTOS.stream()
|
||||
.map(OpenPlanShopInfoDTO::getShopManagerUserId)
|
||||
.collect(Collectors.toSet());
|
||||
@@ -153,23 +150,22 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
.collect(Collectors.toSet()));
|
||||
List<String> userlist = new ArrayList<>();
|
||||
userlist.addAll(userIdset);
|
||||
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(userlist);
|
||||
Map<String, UserNameDTO> vonameMap = nameByUserId.stream()
|
||||
.collect(Collectors.toMap(UserNameDTO::getUserId, vo -> vo));
|
||||
Map<String, EnterpriseUserDO> vonameMap = enterpriseUserDAO.getUserMap(userlist);
|
||||
log.info("getPlanListPage vonameMap:{}", JSONObject.toJSONString(vonameMap));
|
||||
//region
|
||||
List<Long> regionIds = openPlanShopInfoDTOS.stream().map(OpenPlanShopInfoDTO::getRegionId).collect(Collectors.toList());
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
List<OpeningOperationPlanListVO> openingOperationPlanListVOList = new ArrayList<>();
|
||||
openPlanShopInfoDTOS.forEach(x->{
|
||||
openPlanShopInfoDTOS.forEach(x -> {
|
||||
OpeningOperationPlanListVO openingOperationPlanListVO = new OpeningOperationPlanListVO();
|
||||
openingOperationPlanListVO.setShopId(x.getShopId());
|
||||
openingOperationPlanListVO.setShopName(x.getShopName());
|
||||
openingOperationPlanListVO.setStoreNum(x.getStoreNum());
|
||||
openingOperationPlanListVO.setPartnerName(x.getPartnerName());
|
||||
openingOperationPlanListVO.setMobile(x.getMobile());
|
||||
//TODO
|
||||
String[] split = regionNameMap.getOrDefault(x.getRegionId(), "").split("-");
|
||||
if(split.length >0){
|
||||
if (split.length > 0) {
|
||||
openingOperationPlanListVO.setBigName(split[0]);
|
||||
openingOperationPlanListVO.setFightName(split[1]);
|
||||
}
|
||||
@@ -181,8 +177,9 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
openingOperationPlanListVO.setShopManagerName
|
||||
(vonameMap.get(x.getInvestmentManagerId()).getName());
|
||||
}
|
||||
if (!StringUtils.isEmpty(x.getSupervisorUserId()))
|
||||
{openingOperationPlanListVO.setSupervisorName(vonameMap.get(x.getSupervisorUserId()).getName());}
|
||||
if (!StringUtils.isEmpty(x.getSupervisorUserId())) {
|
||||
openingOperationPlanListVO.setSupervisorName(vonameMap.get(x.getSupervisorUserId()).getName());
|
||||
}
|
||||
openingOperationPlanListVO.setSubmissionTime(x.getSubmissionTime());
|
||||
openingOperationPlanListVO.setResultType(x.getResultType());
|
||||
openingOperationPlanListVOList.add(openingOperationPlanListVO);
|
||||
@@ -197,10 +194,11 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
try {
|
||||
if (orderStageInfo.getShopSubStageStatus().
|
||||
equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus())) {
|
||||
// ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
|
||||
// String shopCode = shopInfo.getShopCode();
|
||||
//Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
|
||||
Boolean firstOrder =Boolean.TRUE;
|
||||
//TODO 调试接口
|
||||
// ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
|
||||
// String shopCode = shopInfo.getShopCode();
|
||||
// Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
|
||||
Boolean firstOrder = Boolean.TRUE;
|
||||
log.info("saveOrder,flag:{}", firstOrder);
|
||||
if (firstOrder) {
|
||||
//更改子阶段状态
|
||||
|
||||
@@ -165,8 +165,11 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
SystemBuildingShopDO systemBuildingShopDO = systemBuildingShopMapper.selectOne(SystemBuildingShopDO.builder().shopId(shopId).lineId(lineId).build());
|
||||
//证照办理
|
||||
LicenseTransactDO licenseTransactDO = applyLicenseMapper.selectOne(LicenseTransactDO.builder().shopId(shopId).build());
|
||||
//三方部门表
|
||||
ThirdDepartmentDO thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
|
||||
ThirdDepartmentDO thirdDepartmentDO = new ThirdDepartmentDO();
|
||||
if (Objects.nonNull(systemBuildingShopDO)){
|
||||
//三方部门表
|
||||
thirdDepartmentDO = thirdDepartmentMapper.getByName(systemBuildingShopDO.getBigName());
|
||||
}
|
||||
//找不到的url统一用这个
|
||||
List<String> temp = new ArrayList<>();
|
||||
temp.add("object");
|
||||
|
||||
@@ -418,6 +418,11 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
|
||||
shopAuditInfoDO.setRejectReason(request.getCause());
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
|
||||
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
|
||||
//更新门店编码
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setId(shopId);
|
||||
shopInfoDO.setStoreNum(request.getStoreNum());
|
||||
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
|
||||
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
|
||||
shopAuditInfoDO.setPassReason(request.getCause());
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33;
|
||||
@@ -425,16 +430,10 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
|
||||
preparationService.contractAndBuildStoreCompletion(shopId);
|
||||
}
|
||||
shopAuditInfoMapper.insertSelective(shopAuditInfoDO);
|
||||
//更新阶段状态
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum,shopAuditInfoDO.getId());
|
||||
}catch (Exception e){
|
||||
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
|
||||
}finally {
|
||||
//更新门店编码
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setId(shopId);
|
||||
shopInfoDO.setStoreNum(request.getStoreNum());
|
||||
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
|
||||
//更新阶段状态
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, shopSubStageStatusEnum,null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,9 +69,11 @@ public class YlfServiceImpl implements YlfService {
|
||||
log.info("CoolStoreStartFlowServiceImpl#getOrder, url:{}", url);
|
||||
try {
|
||||
String jsonString = httpRestTemplateService.getForObject(url, String.class, new HashMap<>());
|
||||
//TODO
|
||||
JSONObject jsonObject = JSONObject.parseObject(jsonString);
|
||||
Object data = JSONObject.parseObject(jsonString, JSONObject.class).get("data");
|
||||
log.info("CoolStoreStartFlowServiceImpl#getOrder,jsonObject:{}", jsonObject);
|
||||
//TODO
|
||||
if (jsonObject.get("status").equals(Constants.SUCCESS)) {
|
||||
if (Objects.isNull(data)) {
|
||||
return null;
|
||||
@@ -79,6 +81,8 @@ public class YlfServiceImpl implements YlfService {
|
||||
DesignRowsDTO designRowsDTO = JSONObject.parseObject(JSONObject.toJSONString(data), DesignRowsDTO.class);
|
||||
List<ProjectDTO> rows = designRowsDTO.getRows();
|
||||
if (CollectionUtils.isNotEmpty(rows)) {
|
||||
//TODO 排序
|
||||
|
||||
return rows.get(0);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -35,9 +35,11 @@ public class KdzApiController {
|
||||
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
|
||||
//todo 暂时去掉验签测试
|
||||
// if(!verifyMD5(request,eid)){
|
||||
// log.error("验签失败,request:{};eid:{}",JSONObject.toJSONString(request),eid);
|
||||
// return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
|
||||
// }
|
||||
// if(eid == null || request.getBizContent() == null){
|
||||
// log.error("参数校验失败,BizContent:{}",JSONObject.toJSONString(request.getBizContent()));
|
||||
// return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
// }
|
||||
AuditResultRequest auditResultRequest = JSONObject.parseObject(request.getBizContent(), AuditResultRequest.class);
|
||||
@@ -50,9 +52,11 @@ public class KdzApiController {
|
||||
@RequestBody XfsgOpenApiRequest request) {
|
||||
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
|
||||
if(!verifyMD5(request,eid)){
|
||||
log.error("验签失败,request:{};eid:{}",JSONObject.toJSONString(request),eid);
|
||||
return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
|
||||
}
|
||||
if(eid == null || request.getBizContent() == null){
|
||||
log.error("参数校验失败,BizContent:{}",JSONObject.toJSONString(request.getBizContent()));
|
||||
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
LicenseBizContentRequest storeNum = JSONObject.parseObject(request.getBizContent(), LicenseBizContentRequest.class);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class PCApplyLicenseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/examine")
|
||||
@ApiOperation("证照审批列表")
|
||||
@ApiOperation("证照审批")
|
||||
public ResponseResult licenseExamine(@RequestParam("id") Long shopId,
|
||||
@RequestParam("status") Integer status,
|
||||
@RequestParam("result") String result) {
|
||||
|
||||
@@ -47,7 +47,7 @@ public class PCOpenPreparationController {
|
||||
private OpeningOperationPlanService openingOperationPlanService;
|
||||
@Resource
|
||||
private AuditOpeningOperationPlanService auditOpeningOperationPlanService;
|
||||
@ApiOperation("刷新")
|
||||
@ApiOperation("刷新订货金状态")
|
||||
@GetMapping("/flush")
|
||||
public ResponseResult<Boolean> flush(@RequestParam("shopId") Long shopId) {
|
||||
return ResponseResult.success(openingOperationPlanService.flush(shopId));
|
||||
@@ -67,6 +67,7 @@ public class PCOpenPreparationController {
|
||||
@PostMapping("/openingOperationPlan/planList")
|
||||
@ApiOperation("查询运营方案列表")
|
||||
public ResponseResult<PageInfo<OpeningOperationPlanListVO>> planList(@RequestBody PlanListRequest request) {
|
||||
|
||||
return ResponseResult.success(openingOperationPlanService.getPlanListPage(request));
|
||||
}
|
||||
@PostMapping("/openingOperationPlan/audit")
|
||||
|
||||
@@ -41,7 +41,7 @@ public class MiniDecorationController {
|
||||
private DecorationService decorationService;
|
||||
@Resource
|
||||
private AssessmentTemplateService assessmentTemplateService;
|
||||
@ApiOperation("获取新店装修下阶段的数据")
|
||||
@ApiOperation("获取新店装修下阶段的数据/flush")
|
||||
@GetMapping("/getFitmentSub")
|
||||
public ResponseResult<FitmentResponse> getFitmentSub(@RequestParam Long shopId) {
|
||||
return ResponseResult.success(decorationService.getFitmentSub(shopId));
|
||||
@@ -64,7 +64,7 @@ public class MiniDecorationController {
|
||||
@ApiOperation("获取装修款信息,和二维码")
|
||||
@GetMapping("/getDecorationModel")
|
||||
public ResponseResult<DecorationModelDTO> getDecorationModel(@RequestParam Long shopId){
|
||||
return ResponseResult.success(decorationService.DecorationModel(shopId)) ;
|
||||
return ResponseResult.success(decorationService.decorationModel(shopId)) ;
|
||||
}
|
||||
@ApiOperation("获取装修款阶段信息")
|
||||
@GetMapping("/getDecorationModeStage")
|
||||
|
||||
@@ -124,6 +124,7 @@ public class XxlJobHandler {
|
||||
|
||||
while (hasNext) {
|
||||
log.info("----查询更新订货金----");
|
||||
//sql 判定传入
|
||||
Page<Long> shopIdListByStageStatus = shopStageInfoDAO.getShopIdListByStageStatus(PageNum, PageSize);
|
||||
if (CollectionUtils.isEmpty(shopIdListByStageStatus)) {
|
||||
log.info("------今日没有待更新数据------");
|
||||
@@ -135,12 +136,13 @@ public class XxlJobHandler {
|
||||
for (Long shopId : map.keySet()) {
|
||||
String shopCode = map.get(shopId);
|
||||
try {
|
||||
// TOdo 能不能一次调用
|
||||
Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopCode);
|
||||
|
||||
if (firstOrder == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
|
||||
}
|
||||
if (firstOrder.equals(Boolean.TRUE)) {
|
||||
if (firstOrder) {
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151, null);
|
||||
preparationService.whetherToOpenForAcceptance(shopId);
|
||||
}
|
||||
@@ -177,6 +179,7 @@ public class XxlJobHandler {
|
||||
}
|
||||
List<AcceptanceInfoDO> acceptanceInfoDOS = new ArrayList<>();
|
||||
for (Long shopId : shops) {
|
||||
//TODO ids查
|
||||
acceptanceInfoDOS.add(acceptanceInfoDAO.selectByShopId(shopId));
|
||||
}
|
||||
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
|
||||
@@ -214,6 +217,7 @@ public class XxlJobHandler {
|
||||
LocalDate localDate = instant.atZone(zone).toLocalDate();
|
||||
LocalDate datePlusFiveDays = localDate.plusDays(CommonConstants.FOUR); // 添加5天
|
||||
LocalDate now = LocalDate.now();
|
||||
//TODO 时间问题
|
||||
if (datePlusFiveDays.equals(now)) {
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user