修改订货金bug时间戳

This commit is contained in:
shuo.wang
2024-05-08 11:31:53 +08:00
parent c0d966423e
commit 92c7ddc7af
6 changed files with 51 additions and 46 deletions

View File

@@ -17,7 +17,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap> </resultMap>
<select id="selectByShopId" resultType="com.cool.store.dto.openPreparation.FirstOrderDTO"> <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 estimated_cost as estimatedCost ,fruits_cost as fruitsCost
from xfsg_first_order from xfsg_first_order
where shop_id = #{shopId} where shop_id = #{shopId}

View File

@@ -15,12 +15,12 @@ import java.util.Date;
*/ */
@Data @Data
public class FirstOrderDTO { public class FirstOrderDTO {
private Long id;
@ApiModelProperty("店铺Id") @ApiModelProperty("店铺Id")
private Long shopId; private Long shopId;
@ApiModelProperty("首批订货金总额") @ApiModelProperty("首批订货金总额")
private String totalOrderDeposit; private String totalOrderDeposit;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("最晚打款时间") @ApiModelProperty("最晚打款时间")
private Date latestPaymentDate; private Date latestPaymentDate;

View File

@@ -117,7 +117,7 @@ public class DecorationServiceImpl implements DecorationService {
decorationStageVO.setShopSubStageName(shopSubStageEnum.getShopSubStageName()); decorationStageVO.setShopSubStageName(shopSubStageEnum.getShopSubStageName());
decorationStageVO.setCreatTime(ShopStage.getCreateTime()); decorationStageVO.setCreatTime(ShopStage.getCreateTime());
decorationStageVO.setPlanEndTime(ShopStage.getPlanCompleteTime()); decorationStageVO.setPlanEndTime(ShopStage.getPlanCompleteTime());
decorationStageVO.setActualCompleteTime(ShopStage.getActualCompleteTime()); decorationStageVO.setActualEndTime(ShopStage.getActualCompleteTime());
return decorationStageVO; return decorationStageVO;
} }
@@ -128,43 +128,24 @@ public class DecorationServiceImpl implements DecorationService {
log.error("拉取云立方接口获取数据为空"); log.error("拉取云立方接口获取数据为空");
return null; return null;
} }
AtomicInteger flag = new AtomicInteger(0); Long flag ;
DesignInfoVo designInfoVo = new DesignInfoVo(); DesignInfoVo designInfoVo = new DesignInfoVo();
//平面图和施工
List<DesignSchemeDTO> designScheme = decoration.getDesignScheme(); List<DesignSchemeDTO> designScheme = decoration.getDesignScheme();
if (CollectionUtils.isNotEmpty(designScheme)) { long count = designScheme.stream().filter(design -> DesignPhaseEnum.DESIGN_PHASE_ACCEPTANCE_PASS.getCode().equals(design.getStatus())).count();
flag = count;
Map<String, DesignSchemeDTO> designSchemeMap = designScheme.stream().collect(Collectors.toMap(DesignSchemeDTO::getName, Function.identity(), (a, b) -> b)); designInfoVo.setDesignScheme(designScheme);
List<DesignSchemeDTO> designSchemeDTOS = new ArrayList<>();
//平面图 TODO
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);
}
List<ConstructionScheduleDTO> constructionSchedule = decoration.getConstructionSchedule(); List<ConstructionScheduleDTO> constructionSchedule = decoration.getConstructionSchedule();
if (CollectionUtils.isNotEmpty(constructionSchedule)) { if (CollectionUtils.isNotEmpty(constructionSchedule)) {
Map<String, ConstructionScheduleDTO> constructionScheduleMap = constructionSchedule.stream().collect(Collectors.toMap(ConstructionScheduleDTO::getName, Map<String, ConstructionScheduleDTO> constructionScheduleMap = constructionSchedule.stream().collect(Collectors.toMap(ConstructionScheduleDTO::getName,
dto -> dto)); Function.identity(), (a, b) -> b));
if (constructionScheduleMap != null && constructionScheduleMap.size() > 0) { if (CollectionUtils.isNotEmpty(constructionSchedule)) {
//量房 //量房
ConstructionScheduleDTO measuringRoom = constructionScheduleMap.get(CommonConstants.MEASURING_THE_ROOM); ConstructionScheduleDTO measuringRoom = constructionScheduleMap.get(CommonConstants.MEASURING_THE_ROOM);
if (Objects.nonNull(measuringRoom)) { if (Objects.nonNull(measuringRoom)) {
designInfoVo.setMeasuringRoom(measuringRoom); designInfoVo.setMeasuringRoom(measuringRoom);
if (ConstructionPhaseEnum.construction_FINSH.getCode().equals(measuringRoom.getState())) { if (ConstructionPhaseEnum.construction_FINSH.getCode().equals(measuringRoom.getState())) {
flag.incrementAndGet(); flag++;
} }
} }
} }
@@ -175,9 +156,9 @@ public class DecorationServiceImpl implements DecorationService {
if (!proposedBookBudget.isEmpty()) { if (!proposedBookBudget.isEmpty()) {
BudgetDTO budgetDTO = proposedBookBudget.get(CommonConstants.ZERO); BudgetDTO budgetDTO = proposedBookBudget.get(CommonConstants.ZERO);
designInfoVo.setProposedBookBudget(budgetDTO); designInfoVo.setProposedBookBudget(budgetDTO);
flag.incrementAndGet(); flag++;
} }
if (flag.get() == CommonConstants.FOUR) { if (flag == CommonConstants.FOUR) {
//如果设计阶段未完成 //如果设计阶段未完成
if (!ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91.getShopSubStageStatus(). if (!ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91.getShopSubStageStatus().
equals(shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_9).getShopSubStageStatus())) { equals(shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_9).getShopSubStageStatus())) {
@@ -201,7 +182,7 @@ public class DecorationServiceImpl implements DecorationService {
DecorationStageVO decorationStageVO = new DecorationStageVO(); DecorationStageVO decorationStageVO = new DecorationStageVO();
decorationStageVO.setShopSubStageStatus(shopSubStageInfo.getShopSubStageStatus()); decorationStageVO.setShopSubStageStatus(shopSubStageInfo.getShopSubStageStatus());
decorationStageVO.setPlanBeginTime(shopSubStageInfo.getPlanCompleteTime()); decorationStageVO.setPlanBeginTime(shopSubStageInfo.getPlanCompleteTime());
decorationStageVO.setActualCompleteTime(shopSubStageInfo.getActualCompleteTime()); decorationStageVO.setActualEndTime(shopSubStageInfo.getActualCompleteTime());
return decorationStageVO; return decorationStageVO;
} }
@@ -664,11 +645,13 @@ public class DecorationServiceImpl implements DecorationService {
private DecorationDTO getDecorationDTO(Long shopId) { private DecorationDTO getDecorationDTO(Long shopId) {
List<Long> shopIds = new ArrayList<>();
shopIds.add(shopId);
//TODO //TODO
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = shopInfoDAO.queryStoreNumeListByid(shopIds); ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
String storeNum = openPlanShopInfoDTOS.get(0).getStoreNum(); if (Objects.isNull(shopInfo)) {
throw new ServiceException(ErrorCodeEnum.SHOP_ID_NOT_EXIST);
}
String storeNum = shopInfo.getStoreNum();
if (StringUtils.isNotEmpty(storeNum)) { if (StringUtils.isNotEmpty(storeNum)) {
ProjectDTO projectList = ylfService.getProjectList(storeNum); ProjectDTO projectList = ylfService.getProjectList(storeNum);
String projectId = projectList.getProjectId(); String projectId = projectList.getProjectId();

View File

@@ -23,10 +23,12 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.Date; import java.util.Date;
import java.util.Objects;
/** /**
@@ -66,7 +68,7 @@ public class FirstOrderServiceImp implements FirstOrderService {
} }
FirstOrderDTO firstOrderDTO = firstOrderDAO.selectFirstOrderByShopId(order.getShopId()); FirstOrderDTO firstOrderDTO = firstOrderDAO.selectFirstOrderByShopId(order.getShopId());
Integer num; Integer num;
if (firstOrderDTO == null) { if (Objects.isNull(firstOrderDTO)) {
//第一次提交 //第一次提交
order.setCreateTime(new Date()); order.setCreateTime(new Date());
order.setCreateUserId(userId); order.setCreateUserId(userId);
@@ -74,6 +76,7 @@ public class FirstOrderServiceImp implements FirstOrderService {
num = firstOrderDAO.insertFirstOrder(order); num = firstOrderDAO.insertFirstOrder(order);
} else { } else {
//修改只更新下面2个 //修改只更新下面2个
order.setId(firstOrderDTO.getId());
order.setUpdateTime(new Date()); order.setUpdateTime(new Date());
order.setUpdateUserId(userId); order.setUpdateUserId(userId);
num = firstOrderDAO.updateByPrimaryKeySelective(order); num = firstOrderDAO.updateByPrimaryKeySelective(order);
@@ -102,7 +105,7 @@ public class FirstOrderServiceImp implements FirstOrderService {
} }
return num; return num;
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public FirstOrderDTO getOrder(Long shopId) { public FirstOrderDTO getOrder(Long shopId) {
log.info("getOrder shopId:{},", shopId); log.info("getOrder shopId:{},", shopId);
@@ -110,11 +113,30 @@ public class FirstOrderServiceImp implements FirstOrderService {
log.error("shopId is null"); log.error("shopId is null");
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL); throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
} }
//TODO 是否需要更新
FirstOrderDTO order = firstOrderDAO.selectFirstOrderByShopId(shopId); FirstOrderDTO order = firstOrderDAO.selectFirstOrderByShopId(shopId);
ShopStageInfoDO firstOrderStageInfo = shopStageInfoDAO. if (Objects.nonNull(order)) {
getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15); try {
order.setFirstOrderSubStage(firstOrderStageInfo.getShopSubStageStatus()); 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; return order;
} }
} }

View File

@@ -82,6 +82,7 @@ public class YlfServiceImpl implements YlfService {
List<ProjectDTO> rows = designRowsDTO.getRows(); List<ProjectDTO> rows = designRowsDTO.getRows();
if (CollectionUtils.isNotEmpty(rows)) { if (CollectionUtils.isNotEmpty(rows)) {
//TODO 排序 //TODO 排序
return rows.get(0); return rows.get(0);
} }
} else { } else {

View File

@@ -41,7 +41,7 @@ public class MiniDecorationController {
private DecorationService decorationService; private DecorationService decorationService;
@Resource @Resource
private AssessmentTemplateService assessmentTemplateService; private AssessmentTemplateService assessmentTemplateService;
@ApiOperation("获取新店装修下阶段的数据") @ApiOperation("获取新店装修下阶段的数据/flush")
@GetMapping("/getFitmentSub") @GetMapping("/getFitmentSub")
public ResponseResult<FitmentResponse> getFitmentSub(@RequestParam Long shopId) { public ResponseResult<FitmentResponse> getFitmentSub(@RequestParam Long shopId) {
return ResponseResult.success(decorationService.getFitmentSub(shopId)); return ResponseResult.success(decorationService.getFitmentSub(shopId));
@@ -66,7 +66,6 @@ public class MiniDecorationController {
public ResponseResult<DecorationModelDTO> getDecorationModel(@RequestParam Long shopId){ public ResponseResult<DecorationModelDTO> getDecorationModel(@RequestParam Long shopId){
return ResponseResult.success(decorationService.decorationModel(shopId)) ; return ResponseResult.success(decorationService.decorationModel(shopId)) ;
} }
// TOdo 是否删除
@ApiOperation("获取装修款阶段信息") @ApiOperation("获取装修款阶段信息")
@GetMapping("/getDecorationModeStage") @GetMapping("/getDecorationModeStage")
public ResponseResult<DecorationStageVO> getDecorationModeStage(@RequestParam Long shopId){ public ResponseResult<DecorationStageVO> getDecorationModeStage(@RequestParam Long shopId){