Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -15,4 +15,6 @@ public interface AssessmentDataService {
|
||||
Boolean batchInsert(List<AssessmentDataDO> assessmentDataDOS);
|
||||
|
||||
Integer batchUpdate(List<AssessmentDataDO> assessmentDataDOS);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,12 +3,14 @@ package com.cool.store.service;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
|
||||
import com.cool.store.dto.decoration.DecorationModelDTO;
|
||||
import com.cool.store.dto.decoration.ThreeAcceptanceDTO;
|
||||
import com.cool.store.request.LinePaySubmitRequest;
|
||||
import com.cool.store.request.ThreeAcceptanceCheckRequest;
|
||||
import com.cool.store.request.ThreeAcceptanceRequest;
|
||||
import com.cool.store.request.BookingAcceptanceRequest;
|
||||
import com.cool.store.response.FitmentResponse;
|
||||
import com.cool.store.response.ThreeAcceptanceResponse;
|
||||
import com.cool.store.response.ThreeSignResponse;
|
||||
import com.cool.store.vo.Fitment.DecorationStageVO;
|
||||
import com.cool.store.vo.Fitment.DecorationModelVO;
|
||||
import com.cool.store.vo.Fitment.DesignInfoVo;
|
||||
@@ -88,19 +90,37 @@ public interface DecorationService {
|
||||
* @description:提交三方验收检查项
|
||||
*/
|
||||
Boolean submitThreeCheck(ThreeAcceptanceCheckRequest request);
|
||||
Boolean submitAcceptance(ThreeAcceptanceRequest request,PartnerUserInfoVO minUser, LoginUserInfo pcUser );
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/6
|
||||
* @description:查看三方验收检查项
|
||||
*/
|
||||
ThreeAcceptanceCheckRequest getThreeChecks(Long shopId);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/6
|
||||
* @description:mini提交三方验收检签字
|
||||
*/
|
||||
Boolean miniSubmitAcceptanceSign(ThreeAcceptanceRequest request);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/6
|
||||
* @description:pc提交三方验收检签字
|
||||
*/
|
||||
Boolean pcSubmitAcceptanceSign(ThreeAcceptanceRequest request);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/6
|
||||
* @description:查看三方验收签字
|
||||
*/
|
||||
List<ThreeAcceptanceDTO> getThreeAcceptanceSign(Long shopId);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/3
|
||||
* @description:预约验收
|
||||
*/
|
||||
Boolean bookingAcceptance(BookingAcceptanceRequest response);
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/29
|
||||
* @description:查看三方验收
|
||||
*/
|
||||
ThreeAcceptanceResponse getThreeAcceptance(Long shopId);
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/5/3
|
||||
|
||||
@@ -28,10 +28,7 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -109,11 +106,15 @@ public class CommonService {
|
||||
}
|
||||
}
|
||||
|
||||
public void sendSms(String poneNumber, SMSMsgEnum templateCode, List<JSONObject> templateParamList){
|
||||
sendSms(Arrays.asList(poneNumber), templateCode, templateParamList);
|
||||
public void sendSms(String poneNumber, SMSMsgEnum templateCode){
|
||||
sendSms(Arrays.asList(poneNumber), templateCode, null);
|
||||
}
|
||||
|
||||
public void sendSms(List<String> poneNumbers, SMSMsgEnum templateCode, List<JSONObject> templateParamList){
|
||||
public void sendSms(String poneNumber, SMSMsgEnum templateCode, Map<String, String> templateParamMap){
|
||||
sendSms(Arrays.asList(poneNumber), templateCode, templateParamMap);
|
||||
}
|
||||
|
||||
public void sendSms(List<String> poneNumbers, SMSMsgEnum templateCode, Map<String, String> templateParamMap){
|
||||
List<String> signNameList = new ArrayList<>();
|
||||
signNameList.add("酷店掌");
|
||||
AsyncClient client = null;
|
||||
@@ -134,11 +135,11 @@ public class CommonService {
|
||||
.phoneNumberJson(JSONObject.toJSONString(poneNumbers))
|
||||
.signNameJson(JSONObject.toJSONString(signNameList))
|
||||
.templateCode(templateCode.getTemplateCode())
|
||||
.templateParamJson(JSONObject.toJSONString(templateParamList))
|
||||
.templateParamJson("[" + JSONObject.toJSONString(templateParamMap) + "]")
|
||||
.build();
|
||||
CompletableFuture<SendBatchSmsResponse> response = client.sendBatchSms(sendBatchSmsRequest);
|
||||
SendBatchSmsResponse resp = response.get();
|
||||
log.info("短信发送response:{}", JSONObject.toJSONString(resp));
|
||||
log.info("短信发送templateCode:{}, response:{}", templateCode.getTemplateCode(), JSONObject.toJSONString(resp));
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
} catch (ExecutionException e) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.cool.store.request.ThreeAcceptanceRequest;
|
||||
import com.cool.store.request.BookingAcceptanceRequest;
|
||||
import com.cool.store.response.FitmentResponse;
|
||||
import com.cool.store.response.ThreeAcceptanceResponse;
|
||||
import com.cool.store.response.ThreeSignResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import com.cool.store.vo.Fitment.DecorationStageVO;
|
||||
@@ -58,7 +59,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(DecorationServiceImpl.class);
|
||||
@Resource
|
||||
private ShopAuditInfoDAO shopAuditInfoDAO;
|
||||
private AssessmentDataDAO assessmentDataDAO;
|
||||
@Resource
|
||||
private SysRoleService sysRoleService;
|
||||
@Resource
|
||||
@@ -412,9 +413,11 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
public Boolean submitThreeCheck(ThreeAcceptanceCheckRequest request) {
|
||||
log.info("submitThreeCheck, request:{} ", JSONObject.toJSONString(request));
|
||||
List<AssessmentDataDO> assessmentDataDOS = new ArrayList<>();
|
||||
BeanUtil.copyProperties(request.getAssessmentDataDTOS(),assessmentDataDOS);
|
||||
for(AssessmentDataDO assessmentDataDO : assessmentDataDOS){
|
||||
for (AssessmentDataDTO assessmentDataDTO : request.getAssessmentDataDTOS()) {
|
||||
AssessmentDataDO assessmentDataDO = new AssessmentDataDO();
|
||||
BeanUtil.copyProperties(assessmentDataDTO, assessmentDataDO);
|
||||
assessmentDataDO.setShopId(request.getShopId());
|
||||
assessmentDataDOS.add(assessmentDataDO);
|
||||
}
|
||||
Boolean assessment = assessmentDataService.batchInsert(assessmentDataDOS);
|
||||
if (assessment == Boolean.FALSE) {
|
||||
@@ -424,6 +427,53 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
return assessment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThreeAcceptanceCheckRequest getThreeChecks(Long shopId) {
|
||||
List<AssessmentDataDO> assessmentDataDOS = assessmentDataDAO.selectListByShopId(shopId);
|
||||
List<AssessmentDataDTO> assessmentDataDTOS = new ArrayList<>();
|
||||
for (AssessmentDataDO assessmentDataDO : assessmentDataDOS) {
|
||||
AssessmentDataDTO assessmentDataDTO = new AssessmentDataDTO();
|
||||
BeanUtil.copyProperties(assessmentDataDO, assessmentDataDTO);
|
||||
assessmentDataDTOS.add(assessmentDataDTO);
|
||||
}
|
||||
ThreeAcceptanceCheckRequest threeAcceptanceCheckRequest = new ThreeAcceptanceCheckRequest();
|
||||
threeAcceptanceCheckRequest.setShopId(shopId);
|
||||
threeAcceptanceCheckRequest.setAssessmentDataDTOS(assessmentDataDTOS);
|
||||
return threeAcceptanceCheckRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean miniSubmitAcceptanceSign(ThreeAcceptanceRequest request) {
|
||||
try {
|
||||
//工程部验收签名
|
||||
JSONObject engineering = new JSONObject();
|
||||
engineering.put("pic", request.getEngineeringAcceptance().getAcceptanceSignatures());
|
||||
engineering.put("acceptanceTime", new Date());
|
||||
engineering.put("result", request.getEngineeringAcceptance().getResultType());
|
||||
engineering.put("remark", request.getEngineeringAcceptance().getComments());
|
||||
engineering.put("status", 1);
|
||||
//加盟商
|
||||
JSONObject partner = new JSONObject();
|
||||
partner.put("pic", request.getPartnerAcceptance().getAcceptanceSignatures());
|
||||
partner.put("acceptanceTime", new Date());
|
||||
partner.put("result", request.getPartnerAcceptance().getResultType());
|
||||
partner.put("remark", request.getPartnerAcceptance().getComments());
|
||||
partner.put("status", 1);
|
||||
AcceptanceInfoDO acceptanceInfoDO = new AcceptanceInfoDO();
|
||||
acceptanceInfoDO.setShopId(request.getShopId());
|
||||
acceptanceInfoDO.setPartnerAcceptanceSignatures(partner.toString());
|
||||
acceptanceInfoDO.setEngineeringAcceptanceSignatures(engineering.toString());
|
||||
acceptanceInfoDO.setUpdateTime(new Date());
|
||||
acceptanceInfoDAO.updateAcceptanceInfo(acceptanceInfoDO);
|
||||
//更新阶段状态验收中
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122);
|
||||
return Boolean.TRUE;
|
||||
} catch (Exception e) {
|
||||
log.error("mini提交三方验收失败");
|
||||
throw new ServiceException(ErrorCodeEnum.THREE_ACCEPTANCE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<fitmentCheckVO> getFitmentAcceptanceList(Integer subStageStatus, LoginUserInfo user, Integer pageNum, Integer pageSize) {
|
||||
List<String> authRegionIds = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(user.getUserId());
|
||||
@@ -532,51 +582,14 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public Boolean submitAcceptance(ThreeAcceptanceRequest request, PartnerUserInfoVO minUser, LoginUserInfo pcUser) {
|
||||
public Boolean pcSubmitAcceptanceSign(ThreeAcceptanceRequest request) {
|
||||
log.info("submitAcceptance, request:{} ", JSONObject.toJSONString(request));
|
||||
if (Objects.nonNull(minUser)) {
|
||||
try {
|
||||
//插入检查项
|
||||
for (AssessmentDataDO assessmentDataDO : request.getAssessmentDataDOS()) {
|
||||
//TODO 考核人是谁?
|
||||
assessmentDataDO.setAssessmentUserId(minUser.getPartnerId());
|
||||
}
|
||||
Boolean assessment = assessmentDataService.batchInsert(request.getAssessmentDataDOS());
|
||||
if (assessment == Boolean.FALSE) {
|
||||
log.error("三方验收插入检查项失败");
|
||||
throw new ServiceException(ErrorCodeEnum.CHECK_ITEM);
|
||||
}
|
||||
//工程部验收签名
|
||||
JSONObject engineering = new JSONObject();
|
||||
engineering.put("pic", request.getEngineeringAcceptance().getAcceptanceSignatures());
|
||||
engineering.put("acceptanceTime", new Date());
|
||||
engineering.put("result", request.getEngineeringAcceptance().getResultType());
|
||||
engineering.put("remark", request.getEngineeringAcceptance().getComments());
|
||||
engineering.put("status", 1);
|
||||
//加盟商
|
||||
JSONObject partner = new JSONObject();
|
||||
partner.put("pic", request.getPartnerAcceptance().getAcceptanceSignatures());
|
||||
partner.put("acceptanceTime", new Date());
|
||||
partner.put("result", request.getPartnerAcceptance().getResultType());
|
||||
partner.put("remark", request.getPartnerAcceptance().getComments());
|
||||
partner.put("status", 1);
|
||||
AcceptanceInfoDO acceptanceInfoDO = new AcceptanceInfoDO();
|
||||
acceptanceInfoDO.setShopId(request.getShopId());
|
||||
acceptanceInfoDO.setPartnerAcceptanceSignatures(partner.toString());
|
||||
acceptanceInfoDO.setEngineeringAcceptanceSignatures(engineering.toString());
|
||||
acceptanceInfoDO.setUpdateTime(new Date());
|
||||
acceptanceInfoDAO.updateAcceptanceInfo(acceptanceInfoDO);
|
||||
//更新阶段状态验收中
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122);
|
||||
return Boolean.TRUE;
|
||||
} catch (Exception e) {
|
||||
log.error("mini提交三方验收失败");
|
||||
throw new ServiceException(ErrorCodeEnum.THREE_ACCEPTANCE);
|
||||
}
|
||||
} else {
|
||||
//营运部验收签名
|
||||
try {
|
||||
AcceptanceInfoDO acceptanceInfoDO1 = acceptanceInfoDAO.selectByShopId(request.getShopId());
|
||||
//营运部验收签名
|
||||
try {
|
||||
AcceptanceInfoDO acceptanceInfoDO1 = acceptanceInfoDAO.selectByShopId(request.getShopId());
|
||||
if (StringUtils.isNotEmpty(acceptanceInfoDO1.getEngineeringAcceptanceSignatures())
|
||||
&& StringUtils.isNotEmpty(acceptanceInfoDO1.getPartnerAcceptanceSignatures())
|
||||
&& Objects.nonNull(request.getOperationsAcceptance())) {
|
||||
JSONObject engineering = JSONObject.parseObject(acceptanceInfoDO1.getEngineeringAcceptanceSignatures());
|
||||
JSONObject partner = JSONObject.parseObject(acceptanceInfoDO1.getPartnerAcceptanceSignatures());
|
||||
JSONObject operations = new JSONObject();
|
||||
@@ -594,19 +607,57 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
&& AuditResultTypeEnum.PASS.getCode() == partner.getInteger("result")
|
||||
&& AuditResultTypeEnum.PASS.getCode() == engineering.getInteger("result")) {
|
||||
//更新阶段状态验收完毕
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123,null);
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_123, null);
|
||||
preparationService.whetherToOpenForAcceptance(request.getShopId());
|
||||
} else {
|
||||
//未通过至为带预约
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_120, null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("PC提交三方验收失败");
|
||||
throw new ServiceException(ErrorCodeEnum.THREE_ACCEPTANCE);
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
} catch (Exception e) {
|
||||
log.error("PC提交三方验收失败");
|
||||
throw new ServiceException(ErrorCodeEnum.THREE_ACCEPTANCE);
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ThreeAcceptanceDTO> getThreeAcceptanceSign(Long shopId) {
|
||||
List<ThreeAcceptanceDTO> threeAcceptanceDTOS = new ArrayList<>();
|
||||
|
||||
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId);
|
||||
//工程部
|
||||
if (StringUtils.isNotEmpty(acceptanceInfoDO.getEngineeringAcceptanceSignatures())) {
|
||||
JSONObject engineering = JSONObject.parseObject(acceptanceInfoDO.getEngineeringAcceptanceSignatures());
|
||||
ThreeAcceptanceDTO engineeringDTO = new ThreeAcceptanceDTO();
|
||||
engineeringDTO.setAcceptanceSignatures(engineering.getString("pic"));
|
||||
engineeringDTO.setComments(engineering.getString("remark"));
|
||||
engineeringDTO.setResultType(engineering.getInteger("result"));
|
||||
engineeringDTO.setAcceptanceTime(engineering.getString("acceptanceTime"));
|
||||
threeAcceptanceDTOS.add(CommonConstants.ZERO, engineeringDTO);
|
||||
}
|
||||
//营运部
|
||||
if (StringUtils.isNotEmpty(acceptanceInfoDO.getOperationsAcceptanceSignatures())) {
|
||||
JSONObject operations = JSONObject.parseObject(acceptanceInfoDO.getOperationsAcceptanceSignatures());
|
||||
ThreeAcceptanceDTO operationsDTO = new ThreeAcceptanceDTO();
|
||||
operationsDTO.setAcceptanceSignatures(operations.getString("pic"));
|
||||
operationsDTO.setComments(operations.getString("remark"));
|
||||
operationsDTO.setResultType(operations.getInteger("result"));
|
||||
operationsDTO.setAcceptanceTime(operations.getString("acceptanceTime"));
|
||||
threeAcceptanceDTOS.add(CommonConstants.ONE, operationsDTO);
|
||||
}
|
||||
//加盟商
|
||||
if (StringUtils.isNotEmpty(acceptanceInfoDO.getPartnerAcceptanceSignatures())) {
|
||||
JSONObject partner = JSONObject.parseObject(acceptanceInfoDO.getPartnerAcceptanceSignatures());
|
||||
ThreeAcceptanceDTO partnerDTO = new ThreeAcceptanceDTO();
|
||||
partnerDTO.setAcceptanceSignatures(partner.getString("pic"));
|
||||
partnerDTO.setComments(partner.getString("remark"));
|
||||
partnerDTO.setResultType(partner.getInteger("result"));
|
||||
partnerDTO.setAcceptanceTime(partner.getString("acceptanceTime"));
|
||||
threeAcceptanceDTOS.add(CommonConstants.TWO, partnerDTO);
|
||||
}
|
||||
return threeAcceptanceDTOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -620,14 +671,7 @@ public class DecorationServiceImpl implements DecorationService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThreeAcceptanceResponse getThreeAcceptance(Long shopId) {
|
||||
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDAO.selectByShopId(shopId);
|
||||
ThreeAcceptanceResponse response = new ThreeAcceptanceResponse();
|
||||
BeanUtil.copyProperties(acceptanceInfoDO, response);
|
||||
response.setAcceptanceTime(acceptanceInfoDO.getUpdateTime());
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
private DecorationDTO getDecorationDTO(Long shopId) {
|
||||
List<Long> shopIds = new ArrayList<>();
|
||||
|
||||
@@ -142,7 +142,7 @@ public class PointServiceImpl implements PointService {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
shopPointInfo.setPointScore(shopPoint.getTotalPointScore());
|
||||
pointInfoDAO.updatePointInfo(shopPointInfo);
|
||||
pointInfoDAO.perfectPointInfo(shopPointInfo);
|
||||
pointDetailInfoDAO.updatePartFieldPointDetail(shopPoint);
|
||||
return shopPointDetailRequest.getPointId();
|
||||
}
|
||||
@@ -382,9 +382,9 @@ public class PointServiceImpl implements PointService {
|
||||
private void initUploadRentContract(PointInfoDO pointInfo) {
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(pointInfo.getLineId());
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(pointInfo.getShopId(), Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_12, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20));
|
||||
JSONObject templateParam = new JSONObject();
|
||||
Map<String, String> templateParam = new HashMap<>();
|
||||
templateParam.put("pointName", pointInfo.getAddress());
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SELECT_SUCCESS, Arrays.asList(templateParam));
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SELECT_SUCCESS, templateParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -760,10 +760,10 @@ public class PointServiceImpl implements PointService {
|
||||
if(PointStatusEnum.POINT_STATUS_5.getCode().equals(pointInfo.getPointStatus())){
|
||||
selectStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_12;
|
||||
updateStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20);
|
||||
JSONObject templateParam = new JSONObject();
|
||||
Map<String, String> templateParam = new HashMap<>();
|
||||
templateParam.put("pointName", pointInfo.getAddress());
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(request.getLineId());
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SELECT_SUCCESS, Arrays.asList(templateParam));
|
||||
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.SELECT_SUCCESS, templateParam);
|
||||
}
|
||||
updateStatusList.add(selectStatus);
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, updateStatusList);
|
||||
|
||||
Reference in New Issue
Block a user