feat:数据处理
This commit is contained in:
@@ -23,6 +23,8 @@ import com.cool.store.service.*;
|
||||
import com.cool.store.utils.poi.ExcelUtil;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.RegionPathNameVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -33,6 +35,7 @@ import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Future;
|
||||
@@ -257,6 +260,62 @@ public class TestController {
|
||||
}
|
||||
|
||||
|
||||
@ApiModelProperty("装修阶段数据处理")
|
||||
@GetMapping("/decorationStageDataHandler")
|
||||
public ResponseResult decorationStageDataHandler(){
|
||||
//查询设计阶段
|
||||
List<ShopStageInfoDO> subStages = shopStageInfoDAO.getSubStages(ShopSubStageEnum.SHOP_STAGE_9.getShopSubStage());
|
||||
//已经含有测量阶段
|
||||
List<ShopStageInfoDO> existSubStages = shopStageInfoDAO.getSubStages(ShopSubStageEnum.SHOP_STAGE_8_6.getShopSubStage());
|
||||
|
||||
List<Long> shopIds = existSubStages.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
|
||||
List<ShopStageInfoDO> list = new ArrayList<>();
|
||||
List<Long> updateList = new ArrayList<>();
|
||||
for (ShopStageInfoDO x : subStages) {
|
||||
if (shopIds.contains(x.getShopId())) {
|
||||
log.info("已存在");
|
||||
continue;
|
||||
}
|
||||
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
|
||||
shopStageInfo.setLineId(x.getLineId());
|
||||
shopStageInfo.setShopId(x.getShopId());
|
||||
ShopStageEnum shopStageEnum = ShopStageEnum.SHOP_STAGE_2;
|
||||
shopStageInfo.setShopStage(shopStageEnum.getShopStage());
|
||||
ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.SHOP_STAGE_8_6;
|
||||
shopStageInfo.setShopSubStage(shopSubStageEnum.getShopSubStage());
|
||||
|
||||
/**
|
||||
* 原设计阶段为【已完成】或者【待确认】测量阶段为【已完成】
|
||||
* 原设计阶段为【待上传】,将设计阶段回退到【未开始】,测量阶段为【待分配测量员、设计组】
|
||||
* 原设计阶段为【未开始】,测量阶段为【未开始】
|
||||
*/
|
||||
ShopSubStageStatusEnum initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00;
|
||||
if (x.getShopSubStageStatus()==900){
|
||||
//当前状态回退 测量阶段为【待分配测量员、设计组】
|
||||
initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_861;
|
||||
x.setShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus());
|
||||
x.setRemark("设计阶段" + CommonConstants.PATH_BAR + ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatusName());
|
||||
shopStageInfoDAO.updateByPrimaryKeySelective(x);
|
||||
}else if (x.getShopSubStageStatus()==905||x.getShopSubStageStatus()==910){
|
||||
//测量阶段已完成
|
||||
initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_863;
|
||||
}
|
||||
shopStageInfo.setShopSubStageStatus(initStatus.getShopSubStageStatus());
|
||||
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR + initStatus.getShopSubStageStatusName());
|
||||
shopStageInfo.setIsTerminated(initStatus.isTerminated());
|
||||
LocalDate localDate = LocalDate.parse(x.getPlanCompleteTime()).plusDays(-1);
|
||||
shopStageInfo.setPlanCompleteTime(shopSubStageEnum.getPlanCompleteTime(localDate));
|
||||
list.add(shopStageInfo);
|
||||
}
|
||||
log.info("list:{}",JSONObject.toJSONString(list));
|
||||
shopStageInfoDAO.batchInsert(list);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
PointService pointService;
|
||||
@Resource
|
||||
|
||||
Reference in New Issue
Block a user