三方验收

This commit is contained in:
shuo.wang
2024-05-05 21:03:12 +08:00
parent 3bd749a622
commit 6a39b8c10f
26 changed files with 699 additions and 148 deletions

View File

@@ -53,6 +53,8 @@ public class SignValidateFilter implements Filter {
"/xfsg/favicon.ico",
"/xfsg/v2/api-docs","/**/test/**",
"/xfsg/mini/program/oss/getUploadFileConfig",
//
"/xfsg/mini/**",
"/xfsg/mini/program/v1/partnerManage/partner/getIdentityCardInfo",
"/**/swagger*/**",
"/**/webjars/**",

View File

@@ -1,12 +1,21 @@
package com.cool.store.controller.webb;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.request.BookingAcceptanceRequest;
import com.cool.store.request.ThreeAcceptanceRequest;
import com.cool.store.response.FitmentResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.ThreeAcceptanceResponse;
import com.cool.store.service.DecorationService;
import com.cool.store.vo.Fitment.DecorationModelVO;
import com.cool.store.vo.Fitment.DesignInfoVo;
import com.cool.store.vo.OpeningOperationPlanListVO;
import com.cool.store.vo.PartnerUserInfoVO;
import com.cool.store.vo.fitmentCheckVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -30,18 +39,23 @@ public class PCDecorationController {
private DecorationService decorationService;
@ApiOperation("刷新")
@GetMapping("/flush")
public ResponseResult<Boolean> flush(@RequestParam("shopId") Long shopId) {
public ResponseResult<Boolean> flush(@RequestParam Long shopId) {
return ResponseResult.success(decorationService.flush(shopId));
}
@ApiOperation("获取设计阶段信息")
@GetMapping("/design")
public ResponseResult<DesignInfoVo> get(@RequestParam Long shopId){
@ApiOperation("获取新店装修下阶段的数据")
@GetMapping("/getFitmentSub")
public ResponseResult<FitmentResponse> getFitmentSub(@RequestParam Long shopId) {
return ResponseResult.success(decorationService.getFitmentSub(shopId));
}
@ApiOperation("获取设计子阶段信息")
@GetMapping("/designSub")
public ResponseResult<DesignInfoVo> getDesignSub(@RequestParam Long shopId){
return ResponseResult.success( decorationService.DesignInfo(shopId)) ;
}
@ApiOperation("获取施工阶段信息")
@GetMapping("/getConstruction")
public ResponseResult<List<ConstructionScheduleDTO>> getConstruction(@RequestParam Long shopId){
@ApiOperation("获取施工阶段信息")
@GetMapping("/getConstructionSub")
public ResponseResult<List<ConstructionScheduleDTO>> getConstructionSub(@RequestParam Long shopId){
return ResponseResult.success(decorationService.getConstruction(shopId)) ;
}
@ApiOperation("获取装修款信息")
@@ -49,9 +63,25 @@ public class PCDecorationController {
public ResponseResult<DecorationModelVO> getDecorationModelInfo(@RequestParam Long shopId){
return ResponseResult.success(decorationService.getDecorationModel(shopId,null));
}
@ApiOperation("获取验收列表三方验收1200待预约1210 待验收1220验收中1230已验收视觉验收1300待验收,1310验收不通过,1320验收通过")
@GetMapping("/getAcceptanceList")
public ResponseResult<PageInfo<fitmentCheckVO>> getAcceptanceList(@RequestParam Integer status, @RequestParam Integer pageNum,@RequestParam Integer pageSize){
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(decorationService.getFitmentAcceptanceList(status,user,pageNum,pageSize));
}
@ApiOperation("预约验收")
@PostMapping("/bookingAcceptance")
public ResponseResult<Boolean> submitBookingAcceptance(@RequestBody BookingAcceptanceRequest response){
return ResponseResult.success(decorationService.bookingAcceptance(response));
}
@ApiOperation("查看三方验收")
@GetMapping("/getThreeAcceptance")
public ResponseResult<ThreeAcceptanceResponse> getThreeAcceptance(@RequestParam Long shopId){
return ResponseResult.success(decorationService.getThreeAcceptance(shopId));
}
@ApiOperation("提交三方验收")
@PostMapping("/submitThreeAcceptance")
public ResponseResult<Boolean> submitThreeAcceptance(@RequestBody ThreeAcceptanceRequest request){
return ResponseResult.success(decorationService.submitAcceptance(request,null, CurrentUserHolder.getUser()));
}
}

View File

@@ -5,10 +5,13 @@ import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.dto.decoration.DecorationModelDTO;
import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.request.ThreeAcceptanceRequest;
import com.cool.store.response.FitmentResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.response.ThreeAcceptanceResponse;
import com.cool.store.service.AssessmentTemplateService;
import com.cool.store.service.DecorationService;
import com.cool.store.vo.Fitment.DecorationModeStageVO;
import com.cool.store.vo.AssessmentTemplateVO;
import com.cool.store.vo.Fitment.DecorationStageVO;
import com.cool.store.vo.Fitment.DecorationModelVO;
import com.cool.store.vo.Fitment.DesignInfoVo;
import com.cool.store.vo.PartnerUserInfoVO;
@@ -33,15 +36,21 @@ import java.util.List;
public class MiniDecorationController {
@Resource
private DecorationService decorationService;
@ApiOperation("获取设计阶段信息")
@GetMapping("/design")
public ResponseResult<DesignInfoVo> get(@RequestParam Long shopId){
@Resource
private AssessmentTemplateService assessmentTemplateService;
@ApiOperation("获取新店装修下阶段的数据")
@GetMapping("/getFitmentSub")
public ResponseResult<FitmentResponse> getFitmentSub(@RequestParam Long shopId) {
return ResponseResult.success(decorationService.getFitmentSub(shopId));
}
@ApiOperation("获取设计阶段子阶段信息")
@GetMapping("/designSub")
public ResponseResult<DesignInfoVo> getDesign(@RequestParam Long shopId){
return ResponseResult.success( decorationService.DesignInfo(shopId)) ;
}
@ApiOperation("获取施工阶段信息")
@GetMapping("/getConstruction")
public ResponseResult<List<ConstructionScheduleDTO>> getConstruction(@RequestParam Long shopId){
@ApiOperation("获取施工阶段子阶段信息")
@GetMapping("/getConstructionSub")
public ResponseResult<List<ConstructionScheduleDTO>> getConstructionSub(@RequestParam Long shopId){
return ResponseResult.success(decorationService.getConstruction(shopId)) ;
}
@PostMapping("/submitDecorationModel")
@@ -56,8 +65,8 @@ public class MiniDecorationController {
}
@ApiOperation("获取装修款阶段信息")
@GetMapping("/getDecorationModeStage")
public ResponseResult<DecorationModeStageVO> getDecorationModeStage(@RequestParam Long shopId){
return ResponseResult.success(decorationService.getDecorationModeStage(shopId)) ;
public ResponseResult<DecorationStageVO> getDecorationModeStage(@RequestParam Long shopId){
return ResponseResult.success(decorationService.getDecorationGoldStage(shopId)) ;
}
@ApiOperation("获取装修款详情信息")
@@ -66,10 +75,16 @@ public class MiniDecorationController {
PartnerUserInfoVO user = PartnerUserHolder.getUser();
return ResponseResult.success(decorationService.getDecorationModel(shopId,user));
}
@ApiOperation("获取三方验收检查项")
@GetMapping("/getChecks")
public ResponseResult<List<AssessmentTemplateVO>> getChecks(@RequestParam Integer type){
return ResponseResult.success(assessmentTemplateService.listByType(type));
}
@ApiOperation("提交三方验收")
@PostMapping("/submitThreeAcceptance")
public ResponseResult<Integer> submitThreeAcceptance(@RequestParam ThreeAcceptanceRequest request){
return ResponseResult.success(decorationService.submitAcceptance(request));
public ResponseResult<Boolean> submitThreeAcceptance(@RequestBody ThreeAcceptanceRequest request){
PartnerUserInfoVO user = PartnerUserHolder.getUser();
return ResponseResult.success(decorationService.submitAcceptance(request,user,null));
}
@ApiOperation("查看三方验收")
@GetMapping("/getThreeAcceptance")

View File

@@ -1,6 +1,7 @@
package com.cool.store.job;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*;
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
@@ -161,66 +162,61 @@ public class XxlJobHandler {
int PageSize = 50;
while (hasNext) {
log.info("----每天更新装修阶段进场时间等,至预约状态----");
log.info("----每天更新装修阶段进场时间,施工完成时间等,至预约状态----");
PageHelper.startPage(PageNum, PageSize);
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO.selectAcceptanceInfo();
if (CollectionUtils.isEmpty(acceptanceInfoDOS)) {
//获取施工阶段未完成shopID
List<Long> shops = shopStageInfoDAO.getShopContractIncompletion();
if (CollectionUtils.isEmpty(shops)) {
log.info("------今日没有待更新数据------");
return;
}
List<AcceptanceInfoDO> acceptanceInfoDOS = new ArrayList<>();
for (Long shopId : shops) {
acceptanceInfoDOS.add(acceptanceInfoDAO.selectByShopId(shopId));
}
for (AcceptanceInfoDO acceptanceInfoDO : acceptanceInfoDOS) {
Long shopId = acceptanceInfoDO.getShopId();
acceptanceInfoDO.setUpdateTime(new Date());
ConstructionScheduleDTO constructionInfo = decorationService.getConstructionInfo(shopId);
List<ConstructionScheduleDTO> construction = decorationService.getConstruction(shopId);
//施工完成时间
//施工完成时间,装修计划开始和完成时间
if (Objects.nonNull(constructionInfo) && !StringUtils.isNull(constructionInfo.getPlanEndDate())
&& Objects.isNull(acceptanceInfoDO.getConstructionCompletionTime())) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date constructionEndTime = sdf.parse(constructionInfo.getPlanEndDate());
Date constructionEndTime = sdf.parse(constructionInfo.getActualEndDate());
acceptanceInfoDO.setConstructionCompletionTime(constructionEndTime);
Date PlanBegin = sdf.parse(constructionInfo.getPlanBeginDate());
Date PlanEnd = sdf.parse(constructionInfo.getPlanEndDate());
acceptanceInfoDO.setDecorationPlannedStartTime(PlanBegin);
acceptanceInfoDO.setDecorationPlannedCompletionTime(PlanEnd);
acceptanceInfoDAO.updateAcceptanceInfo(acceptanceInfoDO);
} catch (ParseException e) {
log.error("初始化acceptanceInfo鲜丰服务施工完成时间日期转化异常");
}
}
//进场时间
if (Objects.nonNull(construction) && !StringUtils.isNull(construction.get(0).getActualBeginDate())
if (Objects.nonNull(construction) && !StringUtils.isNull(construction.get(CommonConstants.ZERO).getActualBeginDate())
&& Objects.isNull(acceptanceInfoDO.getActualEntryTime())) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date constructionBeginTime = sdf.parse(construction.get(0).getActualBeginDate());
Date constructionBeginTime = sdf.parse(construction.get(CommonConstants.ZERO).getActualBeginDate());
acceptanceInfoDO.setActualEntryTime(constructionBeginTime);
acceptanceInfoDAO.updateAcceptanceInfo(acceptanceInfoDO);
//+5tian
Instant instant = acceptanceInfoDO.getActualEntryTime().toInstant();
ZoneId zone = ZoneId.systemDefault();
LocalDate localDate = instant.atZone(zone).toLocalDate();
LocalDate datePlusFiveDays = localDate.plusDays(CommonConstants.FOUR); // 添加5天
LocalDate now = LocalDate.now();
if (datePlusFiveDays.equals(now)) {
shopStageInfoDAO.updateShopStageInfo(shopId,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120);
}
//TODO 短信通知
} catch (ParseException e) {
log.error("初始化acceptanceInfo鲜丰服务进场时间日期转化异常");
}
}
//进场时间+5
if (Objects.nonNull(construction) && !StringUtils.isNull(construction.get(0).getActualBeginDate())
&& Objects.nonNull(acceptanceInfoDO.getActualEntryTime())) {
Instant instant = acceptanceInfoDO.getActualEntryTime().toInstant();
ZoneId zone = ZoneId.systemDefault();
LocalDate localDate = instant.atZone(zone).toLocalDate();
LocalDate datePlusFiveDays = localDate.plusDays(5); // 添加5天
LocalDate now = LocalDate.now();
if (datePlusFiveDays.equals(now)) {
List<ShopStageInfoDO> shopStageInfo = shopStageInfoDAO.getShopStageInfo(shopId, null);
if (CollectionUtils.isNotEmpty(shopStageInfo)) {
Map<Integer, ShopStageInfoDO> shopStageInfoDOMap = shopStageInfo.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopSubStage, data -> data));
Boolean buildStoreCompletionFlag = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_3.getShopSubStage()).getShopSubStageStatus());
Boolean contractCompletionFlag = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus().equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage()).getShopSubStageStatus());
if (buildStoreCompletionFlag && contractCompletionFlag) {
List<ShopStageInfoDO> list = new ArrayList<>();
ShopStageInfoDO data1 = shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_12.getShopSubStage());
data1.setShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120.getShopSubStageStatus());
list.add(data1);
shopStageInfoDAO.batchUpdate(list);
}
}
}
acceptanceInfoDAO.insertAcceptanceInfo(acceptanceInfoDO);
//TODO 短信通知
}
}
hasNext = acceptanceInfoDOS.size() >= PageSize;
PageNum++;