修改订货金bug时间戳
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -117,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;
|
||||
}
|
||||
|
||||
@@ -128,43 +128,24 @@ 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 (CollectionUtils.isNotEmpty(designScheme)) {
|
||||
|
||||
Map<String, DesignSchemeDTO> designSchemeMap = designScheme.stream().collect(Collectors.toMap(DesignSchemeDTO::getName, Function.identity(), (a, b) -> b));
|
||||
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);
|
||||
}
|
||||
|
||||
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 (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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,9 +156,9 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
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())) {
|
||||
@@ -201,7 +182,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -664,11 +645,13 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
|
||||
|
||||
private DecorationDTO getDecorationDTO(Long shopId) {
|
||||
List<Long> shopIds = new ArrayList<>();
|
||||
shopIds.add(shopId);
|
||||
|
||||
//TODO
|
||||
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = shopInfoDAO.queryStoreNumeListByid(shopIds);
|
||||
String storeNum = openPlanShopInfoDTOS.get(0).getStoreNum();
|
||||
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();
|
||||
|
||||
@@ -23,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;
|
||||
|
||||
|
||||
/**
|
||||
@@ -66,7 +68,7 @@ public class FirstOrderServiceImp implements FirstOrderService {
|
||||
}
|
||||
FirstOrderDTO firstOrderDTO = firstOrderDAO.selectFirstOrderByShopId(order.getShopId());
|
||||
Integer num;
|
||||
if (firstOrderDTO == null) {
|
||||
if (Objects.isNull(firstOrderDTO)) {
|
||||
//第一次提交
|
||||
order.setCreateTime(new Date());
|
||||
order.setCreateUserId(userId);
|
||||
@@ -74,6 +76,7 @@ public class FirstOrderServiceImp implements FirstOrderService {
|
||||
num = firstOrderDAO.insertFirstOrder(order);
|
||||
} else {
|
||||
//修改只更新下面2个
|
||||
order.setId(firstOrderDTO.getId());
|
||||
order.setUpdateTime(new Date());
|
||||
order.setUpdateUserId(userId);
|
||||
num = firstOrderDAO.updateByPrimaryKeySelective(order);
|
||||
@@ -102,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);
|
||||
@@ -110,11 +113,30 @@ public class FirstOrderServiceImp implements FirstOrderService {
|
||||
log.error("shopId is null");
|
||||
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
|
||||
}
|
||||
//TODO 是否需要更新
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ public class YlfServiceImpl implements YlfService {
|
||||
List<ProjectDTO> rows = designRowsDTO.getRows();
|
||||
if (CollectionUtils.isNotEmpty(rows)) {
|
||||
//TODO 排序
|
||||
|
||||
return rows.get(0);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -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));
|
||||
@@ -66,7 +66,6 @@ public class MiniDecorationController {
|
||||
public ResponseResult<DecorationModelDTO> getDecorationModel(@RequestParam Long shopId){
|
||||
return ResponseResult.success(decorationService.decorationModel(shopId)) ;
|
||||
}
|
||||
// TOdo 是否删除
|
||||
@ApiOperation("获取装修款阶段信息")
|
||||
@GetMapping("/getDecorationModeStage")
|
||||
public ResponseResult<DecorationStageVO> getDecorationModeStage(@RequestParam Long shopId){
|
||||
|
||||
Reference in New Issue
Block a user