视觉验收1.0

This commit is contained in:
shuo.wang
2024-05-17 20:57:54 +08:00
parent 46754391c2
commit 73703de324
16 changed files with 417 additions and 28 deletions

View File

@@ -195,12 +195,13 @@ public enum ErrorCodeEnum {
USER_NOT_LOGIN(103021,"用户未登录",null), USER_NOT_LOGIN(103021,"用户未登录",null),
XFSG_SERVICE_ERROR(103099,"鲜丰服务调用失败",null), XFSG_SERVICE_ERROR(103099,"鲜丰服务调用失败",null),
GET_FIRST_ORDER(103021,"获取鲜丰首批订货金失败",null), GET_FIRST_ORDER(103021,"获取鲜丰首批订货金失败",null),
YLF_ERROR(110001, "云立方接口异常!异常信息:{0}", null), YLF_ERROR(110001, "云立方接口异常!异常信息:{0}", null),
//装修 //装修
THREE_ACCEPTANCE(121001,"提交三方验收失败",null), THREE_ACCEPTANCE(121001,"提交三方验收失败",null),
CHECK_ITEM(12002,"插入检查项失败",null), CHECK_ITEM(12002,"插入检查项失败",null),
FITMENT_FAIL(12003,"装修款阶段未完成",null), FITMENT_FAIL(12003,"装修款阶段未完成",null),
SEE_ACCEPTANCE_ERROR(12004,"获取鲜丰撤场数据失败",null),
SEE_ACCEPTANCE_AUDIT_NULL(12005,"视觉验收结果为空",null),
; ;

View File

@@ -44,6 +44,7 @@ public enum MessageEnum {
MESSAGE_25("您有一个门店待进行三方验收,请查收","##### 门店名称:${storeName}\n##### 加盟商姓名:${partnerUsername}\n##### 加盟商手机号码:${partnerMobile}\n"), MESSAGE_25("您有一个门店待进行三方验收,请查收","##### 门店名称:${storeName}\n##### 加盟商姓名:${partnerUsername}\n##### 加盟商手机号码:${partnerMobile}\n"),
MESSAGE_26("您有一个门店需要上传开业运营方案,请查收","##### 门店名称:${storeName}\n##### 加盟商姓名:${partnerUsername}\n##### 加盟商手机号码:${partnerMobile}\n"), MESSAGE_26("您有一个门店需要上传开业运营方案,请查收","##### 门店名称:${storeName}\n##### 加盟商姓名:${partnerUsername}\n##### 加盟商手机号码:${partnerMobile}\n"),
MESSAGE_27("您有一个门店需要上传首批订货清单,请查收","##### 门店名称:${storeName}\n##### 加盟商姓名:${partnerUsername}\n##### 加盟商手机号码:${partnerMobile}\n"), MESSAGE_27("您有一个门店需要上传首批订货清单,请查收","##### 门店名称:${storeName}\n##### 加盟商姓名:${partnerUsername}\n##### 加盟商手机号码:${partnerMobile}\n"),
MESSAGE_28("您有一个门店需要进行视频验收,请查收","##### 门店名称:${storeName}\n##### 加盟商姓名:${partnerUsername}\n##### 加盟商手机号码:${partnerMobile}\n"),
; ;
private String title; private String title;
@@ -136,6 +137,9 @@ public enum MessageEnum {
case MESSAGE_27: case MESSAGE_27:
return domainUrl + "/dd-noticemsg?appId=" + appId + "&corpId=" + corpId + "&appUrl=" + return domainUrl + "/dd-noticemsg?appId=" + appId + "&corpId=" + corpId + "&appUrl=" +
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=orderList&timestamp=" + System.currentTimeMillis() +"&lineId="+ paramMap.get("lineId"), StandardCharsets.UTF_8.name()); URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=orderList&timestamp=" + System.currentTimeMillis() +"&lineId="+ paramMap.get("lineId"), StandardCharsets.UTF_8.name());
case MESSAGE_28:
return "dingtalk://dingtalkclient/action/open_micro_app?appId="+appId+"&corpId="+corpId+"&page=" +
URLEncoder.encode("pages/common-web-view/index?noticeType=xfsg&routerUrl=notice&target=eyeAcceptance&timestamp="+System.currentTimeMillis()+"&shopId="+ paramMap.get("shopId"), StandardCharsets.UTF_8.name());
default: default:
return ""; return "";

View File

@@ -56,9 +56,8 @@ public class ShopAuditInfoDAO {
return shopAuditInfoMapper.updateByPrimaryKeySelective(shopAuditInfoDO); return shopAuditInfoMapper.updateByPrimaryKeySelective(shopAuditInfoDO);
} }
public Long selectIdByShopId(Long shopId) { public List<ShopAuditInfoDO> getAuditList(Long shopId,Integer auditType) {
return shopAuditInfoMapper.selectAuditIdByShopId(shopId);
return shopAuditInfoMapper.getAuditList(shopId,auditType);
} }
} }

View File

@@ -13,6 +13,7 @@ import com.cool.store.request.PreparationRequest;
import com.cool.store.vo.shop.StageShopCountVO; import com.cool.store.vo.shop.StageShopCountVO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@@ -156,4 +157,5 @@ public class ShopInfoDAO {
} }
return shopInfoMapper.selectByStoreNum(storeNum); return shopInfoMapper.selectByStoreNum(storeNum);
} }
} }

View File

@@ -15,10 +15,5 @@ public interface ShopAuditInfoMapper extends Mapper<ShopAuditInfoDO> {
List<ShopAuditInfoVO> getListByShopIdAndType(@Param("shopId") Long shopId, List<ShopAuditInfoVO> getListByShopIdAndType(@Param("shopId") Long shopId,
@Param("type") Integer type); @Param("type") Integer type);
/** List<ShopAuditInfoDO> getAuditList(@Param("shopId") Long shopId,@Param("auditType") Integer auditType);
* @Auther: wangshuo
* @Date: 2024/4/23
* @description:根据店铺id查询审批结果
*/
Long selectAuditIdByShopId(@Param("shopId") Long shopId);
} }

View File

@@ -86,5 +86,7 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
* @Date: 2024/5/3 * @Date: 2024/5/3
* @description:根据区域id查询所有处于XXX的店铺 * @description:根据区域id查询所有处于XXX的店铺
*/ */
List<ShopInfoDO> selectShopListByRegionId(@Param("regionIds") List<Long> regionIds,@Param("subStageStatus")List<Integer> subStageStatus); List<ShopInfoDO> selectShopListByRegionId(@Param("regionIds") List<Long> regionIds,@Param("subStageStatus")List<Integer> subStageStatus,@Param("request")String request);
} }

View File

@@ -41,14 +41,7 @@
id,shop_id,audit_type,submitted_user_id,submitted_user_name,result_type,pass_reason,reject_reason, id,shop_id,audit_type,submitted_user_id,submitted_user_name,result_type,pass_reason,reject_reason,
certify_file,create_time,update_time,deleted,data_type certify_file,create_time,update_time,deleted,data_type
</sql> </sql>
<select id="selectAuditIdByShopId" resultType="java.lang.Long">
select
id
from
xfsg_shop_audit_info
where
shop_id = #{shopId} and deleted = 0
</select>
<select id="getListByShopIdAndType" resultType="com.cool.store.vo.ShopAuditInfoVO"> <select id="getListByShopIdAndType" resultType="com.cool.store.vo.ShopAuditInfoVO">
select <include refid="Base_Column_List"/> select <include refid="Base_Column_List"/>
from xfsg_shop_audit_info from xfsg_shop_audit_info
@@ -56,4 +49,8 @@
and audit_type = #{type} and audit_type = #{type}
order by create_time order by create_time
</select> </select>
<select id="getAuditList" resultType="com.cool.store.entity.ShopAuditInfoDO">
select * from xfsg_shop_audit_info
where shop_id = #{shopId} and audit_type =#{auditType}
</select>
</mapper> </mapper>

View File

@@ -168,7 +168,11 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="request != null and request != '' ">
and xsi.shop_name Like concat("%",#{request},"%") or xsi.shop_num Like concat("%",#{request},"%")
</if>
</select> </select>
</mapper> </mapper>

View File

@@ -1,5 +1,7 @@
package com.cool.store.request; package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data; import lombok.Data;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@@ -13,7 +15,9 @@ import java.util.List;
*/ */
@Data @Data
public class AcceptanceListRequest { public class AcceptanceListRequest {
@ApiModelProperty("门店名称或编码")
private String request;
@ApiModelProperty("阶段状态")
private List<Integer> subStageStatus; private List<Integer> subStageStatus;
private Integer pageNum; private Integer pageNum;
private Integer pageSize; private Integer pageSize;

View File

@@ -0,0 +1,22 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @Auther: WangShuo
* @Date: 2024/05/17/下午6:15
* @Version 1.0
* @注释:
*/
@Data
public class SeeAcceptanceRequest {
private Long shopId;
@ApiModelProperty("'结果类型 0通过,1拒绝',")
@NotNull(message = "审核结果不能为空")
private Integer resultType;
@ApiModelProperty("原因")
private String reason;
}

View File

@@ -0,0 +1,18 @@
package com.cool.store.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Auther: WangShuo
* @Date: 2024/05/17/下午8:32
* @Version 1.0
* @注释:
*/
@Data
public class SeeAccetanceListRequest {
@ApiModelProperty("门店名称或编码")
private String request;
private Integer pageNum;
private Integer pageSize;
}

View File

@@ -0,0 +1,25 @@
package com.cool.store.service;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.entity.ShopAuditInfoDO;
import com.cool.store.request.AcceptanceListRequest;
import com.cool.store.request.SeeAcceptanceRequest;
import com.cool.store.request.SeeAccetanceListRequest;
import com.cool.store.vo.fitmentCheckVO;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* @Auther: WangShuo
* @Date: 2024/05/17/下午5:57
* @Version 1.0
* @注释:
*/
public interface SeeAcceptanceService {
Boolean auditSeeAcceptance(SeeAcceptanceRequest seeAcceptanceRequest, LoginUserInfo user);
ConstructionScheduleDTO getWithdrawal(Long shopId);
List<ShopAuditInfoDO> getAuditInfo(Long shopId);
PageInfo<fitmentCheckVO> getAcceptanceList(AcceptanceListRequest request, LoginUserInfo user);
}

View File

@@ -176,7 +176,7 @@ public class DecorationServiceImpl implements DecorationService {
} }
//预算 //预算
BudgetDTO proposedBookBudget = getBudgetDTOS(decoration); BudgetDTO proposedBookBudget = getBudgetDTOS(decoration);
if (proposedBookBudget == null) return null; if (proposedBookBudget == null) {return null;}
BigDecimal vzHj = proposedBookBudget.getVzHj(); BigDecimal vzHj = proposedBookBudget.getVzHj();
//支付二维码url //支付二维码url
Long regionId = shopInfoDAO.getRegionIdByid(shopId); Long regionId = shopInfoDAO.getRegionIdByid(shopId);
@@ -286,15 +286,31 @@ public class DecorationServiceImpl implements DecorationService {
name.add(CommonConstants.WITHDRAWAL); name.add(CommonConstants.WITHDRAWAL);
ConstructionScheduleDTO approach = new ConstructionScheduleDTO(); ConstructionScheduleDTO approach = new ConstructionScheduleDTO();
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId); AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId);
ConstructionScheduleDTO constructionSage = new ConstructionScheduleDTO(); ConstructionScheduleDTO constructionSage = new ConstructionScheduleDTO();
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
LineInfoDO lineInfo = lineInfoMapper.getByLineId(shopInfo.getLineId());
for (ConstructionScheduleDTO constructionScheduleDTO : constructionSchedule) { for (ConstructionScheduleDTO constructionScheduleDTO : constructionSchedule) {
if (name.contains(constructionScheduleDTO.getName())) { if (name.contains(constructionScheduleDTO.getName())) {
collect.add(constructionScheduleDTO); collect.add(constructionScheduleDTO);
if (constructionScheduleDTO.getName().equals(CommonConstants.APPROACH)) { if (constructionScheduleDTO.getName().equals(CommonConstants.APPROACH)) {
approach = constructionScheduleDTO; approach = constructionScheduleDTO;
} }
//计划撤场时间 //计划撤场时间 //如果撤场并且视觉验收状态为-100则更新待验收
if (constructionScheduleDTO.getName().equals(CommonConstants.WITHDRAWAL)) { if (constructionScheduleDTO.getName().equals(CommonConstants.WITHDRAWAL)) {
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_13);
if(shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())
&& constructionScheduleDTO.getState().equals(ConstructionPhaseEnum.construction_FINSH.getCode())){
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_130);
//发送给品牌设计经理
EnterpriseUserDO enterpriseUser = userAuthMappingService.getUserByRoleEnumAndWantShopAreaId(UserRoleEnum.DESIGN_MANAGER, lineInfo.getWantShopAreaId());
Map<String, String> messageMap = new HashMap<>();
messageMap.put("storeName",shopInfo.getShopName());
messageMap.put("shopId",String.valueOf(shopId));
messageMap.put("shopName",shopInfo.getShopName());
messageMap.put("partnerMobile",lineInfo.getMobile());
commonService.sendMessage(Arrays.asList(enterpriseUser.getUserId()), MessageEnum.MESSAGE_28, messageMap);
}
ConstructionScheduleDTO withdrawal = constructionScheduleDTO; ConstructionScheduleDTO withdrawal = constructionScheduleDTO;
if (Objects.nonNull(acceptanceInfoDO)) { if (Objects.nonNull(acceptanceInfoDO)) {
Date date = CoolDateUtils.parseDate(withdrawal.getPlanBeginDate(), CoolDateUtils.DATE_FORMAT_DAY); Date date = CoolDateUtils.parseDate(withdrawal.getPlanBeginDate(), CoolDateUtils.DATE_FORMAT_DAY);
@@ -306,12 +322,12 @@ public class DecorationServiceImpl implements DecorationService {
constructionSage = constructionScheduleDTO; constructionSage = constructionScheduleDTO;
} }
} }
//设置进场时间xfsg_acceptance_info //设置进场时间xfsg_acceptance_info
if (Objects.nonNull(acceptanceInfoDO) && StringUtils.isNotEmpty(approach.getActualBeginDate())) { if (Objects.nonNull(acceptanceInfoDO) && StringUtils.isNotEmpty(approach.getActualBeginDate())) {
Date date = CoolDateUtils.parseDate(approach.getActualBeginDate(), CoolDateUtils.DATE_FORMAT_DAY); Date date = CoolDateUtils.parseDate(approach.getActualBeginDate(), CoolDateUtils.DATE_FORMAT_DAY);
acceptanceInfoDO.setActualEntryTime(date); acceptanceInfoDO.setActualEntryTime(date);
} }
//施工完成时间,计划开始和完成时间 // //施工完成时间,计划开始和完成时间 //
if (Objects.nonNull(acceptanceInfoDO) && StringUtils.isNotEmpty(constructionSage.getActualEndDate())) { if (Objects.nonNull(acceptanceInfoDO) && StringUtils.isNotEmpty(constructionSage.getActualEndDate())) {
Date date = CoolDateUtils.parseDate(constructionSage.getActualEndDate(), CoolDateUtils.DATE_FORMAT_DAY); Date date = CoolDateUtils.parseDate(constructionSage.getActualEndDate(), CoolDateUtils.DATE_FORMAT_DAY);
@@ -327,6 +343,8 @@ public class DecorationServiceImpl implements DecorationService {
} }
acceptanceInfoDO.setUpdateTime(new Date()); acceptanceInfoDO.setUpdateTime(new Date());
acceptanceInfoDAO.updateAcceptanceInfo(acceptanceInfoDO); acceptanceInfoDAO.updateAcceptanceInfo(acceptanceInfoDO);
//如果完成更新施工阶段状态 //如果完成更新施工阶段状态
if (ConstructionPhaseEnum.construction_FINSH.getCode().equals(constructionSage.getState())) { if (ConstructionPhaseEnum.construction_FINSH.getCode().equals(constructionSage.getState())) {
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_112); shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_112);
@@ -465,7 +483,7 @@ public class DecorationServiceImpl implements DecorationService {
List<fitmentCheckVO> fitmentCheckVOList = new ArrayList<>(); List<fitmentCheckVO> fitmentCheckVOList = new ArrayList<>();
//shopId,lineid,regionid,shopname,storenum, //shopId,lineid,regionid,shopname,storenum,
List<ShopInfoDO> shopInfoDOS = shopInfoMapper.selectShopListByRegionId(regions, request.getSubStageStatus()); List<ShopInfoDO> shopInfoDOS = shopInfoMapper.selectShopListByRegionId(regions, request.getSubStageStatus(),null);
PageInfo pageInfo = new PageInfo<>(shopInfoDOS); PageInfo pageInfo = new PageInfo<>(shopInfoDOS);
if (shopInfoDOS.isEmpty()) { if (shopInfoDOS.isEmpty()) {
log.info("该工程部监理下门店为空"); log.info("该工程部监理下门店为空");

View File

@@ -0,0 +1,255 @@
package com.cool.store.service.impl;
import com.cool.store.constants.CommonConstants;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dao.*;
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.dto.decoration.DecorationDTO;
import com.cool.store.dto.decoration.ProjectDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.AuditResultTypeEnum;
import com.cool.store.enums.AuditTypeEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.UserRoleEnum;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.LineInfoMapper;
import com.cool.store.mapper.ShopInfoMapper;
import com.cool.store.request.AcceptanceListRequest;
import com.cool.store.request.SeeAcceptanceRequest;
import com.cool.store.request.SeeAccetanceListRequest;
import com.cool.store.service.*;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.vo.fitmentCheckVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Auther: WangShuo
* @Date: 2024/05/17/下午5:58
* @Version 1.0
* @注释:
*/
@Service
public class SeeAcceptanceServiceImpl implements SeeAcceptanceService {
private static final Logger log = LoggerFactory.getLogger(SeeAcceptanceServiceImpl.class);
@Resource
private DecorationService decorationService;
@Resource
private ShopInfoDAO shopInfoDAO;
@Resource
private YlfService ylfService;
@Resource
private ShopAuditInfoDAO shopAuditInfoDAO;
@Resource
private TempUserDetailDAO tempUserDetailDAO;
@Resource
private ShopStageInfoDAO shopStageInfoDAO;
@Resource
private PreparationService preparationService;
@Resource
private UserAuthMappingService userAuthMappingService;
@Resource
private ShopInfoMapper shopInfoMapper;
@Resource
private LineInfoMapper lineInfoMapper;
@Resource
private EnterpriseUserDAO enterpriseUserDAO;
@Resource
private RegionService regionService;
@Resource
private SysRoleService sysRoleService;
@Resource
private AcceptanceInfoDAO acceptanceInfoDAO;
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean auditSeeAcceptance(SeeAcceptanceRequest request, LoginUserInfo user) {
if (request.getShopId() == null || request.getShopId() == 0) {
throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL);
}
if (request.getResultType() == null) {
throw new ServiceException(ErrorCodeEnum.SEE_ACCEPTANCE_AUDIT_NULL);
}
if (Objects.isNull(user)) {
throw new ServiceException(ErrorCodeEnum.USER_NOT_LOGIN);
}
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
shopAuditInfoDO.setShopId(request.getShopId());
shopAuditInfoDO.setAuditType(AuditTypeEnum.VISUAL_ACCEPTANCE.getCode());
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
shopAuditInfoDO.setSubmittedUserName(user.getName());
shopAuditInfoDO.setResultType(request.getResultType());
if (AuditResultTypeEnum.PASS.getCode().equals(request.getResultType())) {
shopAuditInfoDO.setPassReason(request.getReason());
} else {
shopAuditInfoDO.setRejectReason(request.getReason());
}
// TODO xfsg_user_detail_id
shopAuditInfoDO.setCreateTime(new Date());
shopAuditInfoDO.setDataType(CommonConstants.ONE);
Long id = shopAuditInfoDAO.addAuditInfo(shopAuditInfoDO);
if (AuditResultTypeEnum.PASS.getCode().equals(request.getResultType())) {
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_132, id);
preparationService.whetherToOpenForAcceptance(request.getShopId());
} else {
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_131, id);
}
return true;
}
@Override
public ConstructionScheduleDTO getWithdrawal(Long shopId) {
DecorationDTO decoration = getDecorationDTO(shopId);
if (decoration == null) {
log.error("DecorationModel is null");
return null;
}
ConstructionScheduleDTO constructionScheduleDTO = new ConstructionScheduleDTO();
List<ConstructionScheduleDTO> constructionSchedule = decoration.getConstructionSchedule();
for (ConstructionScheduleDTO a : constructionSchedule) {
if (CommonConstants.WITHDRAWAL.equals(a.getName())) {
constructionScheduleDTO = a;
}
}
if (Objects.isNull(constructionScheduleDTO)) {
throw new ServiceException(ErrorCodeEnum.SEE_ACCEPTANCE_ERROR);
}
return constructionScheduleDTO;
}
@Override
public List<ShopAuditInfoDO> getAuditInfo(Long shopId) {
return shopAuditInfoDAO.getAuditList(shopId, AuditTypeEnum.VISUAL_ACCEPTANCE.getCode());
}
@Override
public PageInfo<fitmentCheckVO> getAcceptanceList(AcceptanceListRequest request, LoginUserInfo user) {
List<String> authRegionIds = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(user.getUserId());
List<Long> regions = new ArrayList<>();
for (String authRegionId : authRegionIds) {
regions.add(Long.parseLong(authRegionId));
}
PageHelper.startPage(request.getPageNum(), request.getPageSize());
if (regions.isEmpty()) {
log.info("该用户下权限没有管理区域");
return new PageInfo<>();
}
List<fitmentCheckVO> fitmentCheckVOList = new ArrayList<>();
//shopId,lineid,regionid,shopname,storenum,
List<ShopInfoDO> shopInfoDOS = shopInfoMapper.selectShopListByRegionId(regions, request.getSubStageStatus(),request.getRequest());
PageInfo pageInfo = new PageInfo<>(shopInfoDOS);
if (shopInfoDOS.isEmpty()) {
log.info("该工程部监理下门店为空");
return pageInfo;
}
Map<Long, ShopInfoDO> ShopIdmap = shopInfoDOS.stream().collect(Collectors.toMap(ShopInfoDO::getId, dto1 -> dto1));
//招商经理选址人员拓展经理id
List<Long> lineIds = shopInfoDOS.stream().filter(o -> o.getLineId() != null)
.map(ShopInfoDO::getLineId).distinct().collect(Collectors.toList());
List<LineInfoDO> lineInfos = lineInfoMapper.getByLineIds(lineIds);
Map<Long, LineInfoDO> lineInfoDOMap = lineInfos.stream().collect(Collectors.toMap(LineInfoDO::getId, dto -> dto));
//招商name
List<String> userIds = new ArrayList<>();
userIds.addAll(lineInfos.stream().filter(o -> o.getInvestmentManager() != null)
.map(LineInfoDO::getInvestmentManager).distinct().collect(Collectors.toList()));
//选址人员拓展经理name
userIds.addAll(lineInfos.stream().filter(o -> o.getDevelopmentManager() != null)
.map(LineInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList()));
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIds);
//所属战区
List<Long> regionIds = shopInfoDOS.stream().filter(o -> o.getRegionId() != null).
map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
//战区经理name
Map<Long, String> fightManger = new HashMap<>();
for (Long regionId : regionIds) {
String fightMangerUserId = sysRoleService.getUserIdByRegionIdWithRolePriority(regionId, Arrays.asList(UserRoleEnum.THEATER_MANAGER));
String userName = enterpriseUserDAO.getUserName(fightMangerUserId);
fightManger.put(regionId, userName);
}
//施工实际完成实际
List<Long> shopIds = new ArrayList<>(ShopIdmap.keySet());
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO.selectByShopIds(shopIds);
Map<Long, AcceptanceInfoDO> acceptanceInfoDOSMap = acceptanceInfoDOS.stream()
.collect(Collectors.toMap(AcceptanceInfoDO::getShopId, dto1 -> dto1));
//验收状态
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_13.getShopSubStage());
List<Long> audits = subStageList.stream().filter(o -> o.getAuditId() != null).map(ShopStageInfoDO::getAuditId).collect(Collectors.toList());
//验收时间
List<ShopAuditInfoDO> auditInfoList = shopAuditInfoDAO.getAuditInfoList(audits);
Map<Long, ShopAuditInfoDO> auditMap = auditInfoList.stream().filter(o -> o.getShopId() != null).collect(Collectors.toMap(ShopAuditInfoDO::getShopId, Function.identity()));
Map<Long, ShopStageInfoDO> ShopStageInfoDOMap = subStageList.stream()
.collect(Collectors.toMap(ShopStageInfoDO::getShopId, dto1 -> dto1));
for (ShopInfoDO shopInfoDO : shopInfoDOS) {
Long shopId = shopInfoDO.getId();
Long lineId = shopInfoDO.getLineId();
Long regionId = shopInfoDO.getRegionId();
fitmentCheckVO fitmentCheckVO = new fitmentCheckVO();
fitmentCheckVO.setShopId(shopId);
fitmentCheckVO.setLineId(lineId);
fitmentCheckVO.setShopName(shopInfoDO.getShopName());
fitmentCheckVO.setStoreNum(shopInfoDO.getStoreNum());
fitmentCheckVO.setRegionId(regionId);
fitmentCheckVO.setRegion(regionNameMap.get(regionId));
fitmentCheckVO.setFightManager(fightManger.get(regionId));
if (lineId != null) {
fitmentCheckVO.setInvestmentManagerId(lineInfoDOMap.get(lineId)
.getInvestmentManager());
fitmentCheckVO.setInvestmentManager(userNameMap.get(lineInfoDOMap.get(lineId)
.getInvestmentManager()));
fitmentCheckVO.setSitterId(lineInfoDOMap.get(lineId)
.getDevelopmentManager());
fitmentCheckVO.setSitterName(userNameMap.get(lineInfoDOMap.get(lineId)
.getDevelopmentManager()));
fitmentCheckVO.setPartnerName(lineInfoDOMap.get(lineId).getUsername());
}
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDOSMap.get(shopId);
if (shopId != null) {
if (Objects.nonNull(acceptanceInfoDO)) {
fitmentCheckVO.setActualEndTime(acceptanceInfoDO.getConstructionCompletionTime());
}
}
if (Objects.nonNull(auditMap.get(shopId))) {
fitmentCheckVO.setAcceptanceTime(auditMap.get(shopId).getCreateTime());
}
if (Objects.nonNull(ShopStageInfoDOMap.get(shopId))) {
fitmentCheckVO.setShopSubStageStatus(ShopStageInfoDOMap.get(shopId).getShopSubStageStatus());
}
fitmentCheckVOList.add(fitmentCheckVO);
}
pageInfo.setList(fitmentCheckVOList);
return pageInfo;
}
private DecorationDTO getDecorationDTO(Long shopId) {
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);
Long projectId = projectList.getProjectId();
DecorationDTO decoration = ylfService.getDecoration(projectId);
return decoration;
}
return null;
}
}

View File

@@ -4,15 +4,14 @@ import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
import com.cool.store.context.PartnerUserHolder; import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dto.decoration.ConstructionScheduleDTO; import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.request.AcceptanceListRequest; import com.cool.store.entity.ShopAuditInfoDO;
import com.cool.store.request.BookingAcceptanceRequest; import com.cool.store.request.*;
import com.cool.store.request.ThreeAcceptanceCheckRequest;
import com.cool.store.request.ThreeAcceptanceRequest;
import com.cool.store.response.FitmentResponse; import com.cool.store.response.FitmentResponse;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.response.ThreeSignResponse; import com.cool.store.response.ThreeSignResponse;
import com.cool.store.service.DecorationService; import com.cool.store.service.DecorationService;
import com.cool.store.service.PreparationService; import com.cool.store.service.PreparationService;
import com.cool.store.service.SeeAcceptanceService;
import com.cool.store.vo.Fitment.DecorationModelVO; import com.cool.store.vo.Fitment.DecorationModelVO;
import com.cool.store.vo.Fitment.DesignInfoVo; import com.cool.store.vo.Fitment.DesignInfoVo;
import com.cool.store.vo.LinePayVO; import com.cool.store.vo.LinePayVO;
@@ -43,6 +42,8 @@ public class PCDecorationController {
private DecorationService decorationService; private DecorationService decorationService;
@Resource @Resource
private PreparationService preparationService; private PreparationService preparationService;
@Resource
private SeeAcceptanceService seeAcceptanceService;
@ApiOperation("获取新店装修flush") @ApiOperation("获取新店装修flush")
@GetMapping("/flush") @GetMapping("/flush")
public ResponseResult<Boolean> getFitmentSub(@RequestParam Long shopId) { public ResponseResult<Boolean> getFitmentSub(@RequestParam Long shopId) {
@@ -97,4 +98,32 @@ public class PCDecorationController {
public ResponseResult<ThreeSignResponse> getThreeAcceptance(@RequestParam Long shopId){ public ResponseResult<ThreeSignResponse> getThreeAcceptance(@RequestParam Long shopId){
return ResponseResult.success(decorationService.getThreeAcceptanceSign(shopId)); return ResponseResult.success(decorationService.getThreeAcceptanceSign(shopId));
} }
@ApiOperation("获取视觉验收撤场数据")
@GetMapping("/getSeeAcceptanceWithdrawal")
public ResponseResult<ConstructionScheduleDTO> getSeeAcceptanceWithdrawal(@RequestParam Long shopId){
return ResponseResult.success(seeAcceptanceService.getWithdrawal(shopId));
}
@ApiOperation("视觉验收列表")
@PostMapping("/getSeeAcceptanceList")
public ResponseResult< PageInfo<fitmentCheckVO>> getSeeAcceptanceList(@RequestBody AcceptanceListRequest request){
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(seeAcceptanceService.getAcceptanceList(request,user));
}
@ApiOperation("获取撤场数据")
@GetMapping("/getWithdrawal")
public ResponseResult<ConstructionScheduleDTO> getWithdrawal(@RequestParam Long shopId){
return ResponseResult.success(seeAcceptanceService.getWithdrawal(shopId));
}
@ApiOperation("获取视觉验收审核数据")
@GetMapping("/getSeeAuditInfo")
public ResponseResult< List<ShopAuditInfoDO> > getAuditInfo(@RequestParam Long shopId){
return ResponseResult.success(seeAcceptanceService.getAuditInfo(shopId));
}
@ApiOperation("验收视觉验收")
@PostMapping("/auditSee")
public ResponseResult<Boolean> auditSee(@RequestBody SeeAcceptanceRequest request){
LoginUserInfo user = CurrentUserHolder.getUser();
return ResponseResult.success(seeAcceptanceService.auditSeeAcceptance(request,user));
}
} }

View File

@@ -4,6 +4,7 @@ import com.cool.store.context.PartnerUserHolder;
import com.cool.store.dto.decoration.ConstructionScheduleDTO; import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.dto.decoration.DecorationModelDTO; import com.cool.store.dto.decoration.DecorationModelDTO;
import com.cool.store.dto.decoration.ThreeAcceptanceDTO; import com.cool.store.dto.decoration.ThreeAcceptanceDTO;
import com.cool.store.entity.ShopAuditInfoDO;
import com.cool.store.request.LinePaySubmitRequest; import com.cool.store.request.LinePaySubmitRequest;
import com.cool.store.request.ThreeAcceptanceCheckRequest; import com.cool.store.request.ThreeAcceptanceCheckRequest;
import com.cool.store.request.ThreeAcceptanceRequest; import com.cool.store.request.ThreeAcceptanceRequest;
@@ -13,6 +14,7 @@ import com.cool.store.response.ResponseResult;
import com.cool.store.response.ThreeSignResponse; import com.cool.store.response.ThreeSignResponse;
import com.cool.store.service.AssessmentTemplateService; import com.cool.store.service.AssessmentTemplateService;
import com.cool.store.service.DecorationService; import com.cool.store.service.DecorationService;
import com.cool.store.service.SeeAcceptanceService;
import com.cool.store.vo.AssessmentTemplateVO; import com.cool.store.vo.AssessmentTemplateVO;
import com.cool.store.vo.Fitment.DecorationStageVO; import com.cool.store.vo.Fitment.DecorationStageVO;
import com.cool.store.vo.Fitment.DecorationModelVO; import com.cool.store.vo.Fitment.DecorationModelVO;
@@ -42,6 +44,8 @@ public class MiniDecorationController {
private DecorationService decorationService; private DecorationService decorationService;
@Resource @Resource
private AssessmentTemplateService assessmentTemplateService; private AssessmentTemplateService assessmentTemplateService;
@Resource
private SeeAcceptanceService seeAcceptanceService;
@ApiOperation("获取设计阶段子阶段信息") @ApiOperation("获取设计阶段子阶段信息")
@GetMapping("/designSub") @GetMapping("/designSub")
public ResponseResult<DesignInfoVo> getDesign(@RequestParam Long shopId){ public ResponseResult<DesignInfoVo> getDesign(@RequestParam Long shopId){
@@ -99,4 +103,14 @@ public class MiniDecorationController {
public ResponseResult<ThreeSignResponse> getThreeAcceptance(@RequestParam Long shopId){ public ResponseResult<ThreeSignResponse> getThreeAcceptance(@RequestParam Long shopId){
return ResponseResult.success(decorationService.getThreeAcceptanceSign(shopId)); return ResponseResult.success(decorationService.getThreeAcceptanceSign(shopId));
} }
@ApiOperation("获取撤场数据")
@GetMapping("/getWithdrawal")
public ResponseResult<ConstructionScheduleDTO> getWithdrawal(@RequestParam Long shopId){
return ResponseResult.success(seeAcceptanceService.getWithdrawal(shopId));
}
@ApiOperation("获取视觉验收审核数据")
@GetMapping("/getSeeAuditInfo")
public ResponseResult< List<ShopAuditInfoDO> > getAuditInfo(@RequestParam Long shopId){
return ResponseResult.success(seeAcceptanceService.getAuditInfo(shopId));
}
} }