开业筹备

This commit is contained in:
shuo.wang
2024-04-25 10:44:17 +08:00
parent a7441cf92b
commit 65e3a8cafa
4 changed files with 35 additions and 47 deletions

View File

@@ -1,32 +0,0 @@
package com.cool.store.enums;
/**
* @Auther: WangShuo
* @Date: 2024/04/22/下午4:42
* @Version 1.0
* @注释:
*/
public enum ShopAuditInfoTypeEnum {
VISUAL_ACCEPTANCE(0,"视觉审批"),
TRAINING_REGISTRATION_APPROVAL(1,"培训登记审批 "),
OPENING_OPERATION_PLAN(2,"开业运营方案"),
LICENSE_APPROVAL(3,"证照审批");
private Integer code;
private String msg;
ShopAuditInfoTypeEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
}

View File

@@ -36,7 +36,7 @@ public class FirstOrderServiceImp implements FirstOrderService {
@Override
public Integer saveOrder(FirstOrderDO order) {
String userId = CurrentUserHolder.getUserId();
log.info("save order:{}",order);
log.info("save order:{}",JSONObject.toJSONString(order));
if (order == null ) {
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dao.*;
@@ -8,8 +9,8 @@ import com.cool.store.dto.openPreparation.OpeningOperationPlanDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.dto.openPreparation.UserInfoDTO;
import com.cool.store.entity.OpeningOperationPlanDO;
import com.cool.store.enums.AuditTypeEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.ShopAuditInfoTypeEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.OpeningOperationPlanAuditRequest;
@@ -59,7 +60,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
@Override
@Transactional(rollbackFor = Exception.class)
public Long savePlan(OpeningOperationPlanRequest request) {
log.info("addNewPlan request:{}", request);
log.info("addNewPlan request:{}", JSONObject.toJSONString(request));
if (request.getActivityTheme().length() > CommonConstants.MAX_LENGTH_ONE_HUNDRED){
log.error("addNewPlan ActivityTheme length error");
throw new ServiceException(ErrorCodeEnum.ACTIVITY_THEME_LENGTH_FALSE);
@@ -77,7 +78,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
}
OpeningOperationPlanAuditRequest openingOperationPlanAuditRequest = new OpeningOperationPlanAuditRequest();
openingOperationPlanAuditRequest.setShopId(request.getShopId());
openingOperationPlanAuditRequest.setAuditType(ShopAuditInfoTypeEnum.OPENING_OPERATION_PLAN.getCode());
openingOperationPlanAuditRequest.setAuditType(AuditTypeEnum.OPENING_OPERATION_PLAN.getCode());
openingOperationPlanAuditRequest.setSubmittedUserName(userName);
openingOperationPlanAuditRequest.setSubmittedUserId(userId);
Long AuditId = openingOperationPlanAuditService.addNewPlanAudit(openingOperationPlanAuditRequest);
@@ -150,12 +151,12 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
@Override
public List<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
log.info("getPlanListPage request:{}", request);
log.info("getPlanListPage request:{}", JSONObject.toJSONString(request));
//根据ShopName等查询门店名字1门店代码1开店负责人1督导id1
Page<OpenPlanShopInfoDTO> openPlanShopList = shopInfoDAO.
getOpenPlanShopListByShopName(request.getShopName(), request.getBigName(), request.getFightName(),
request.getPageNum(), request.getPageSize());
log.info("getPlanListPage openPlanShopList:{}", openPlanShopList);
log.info("getPlanListPage openPlanShopList:{}",JSONObject.toJSONString(openPlanShopList) );
List<OpeningOperationPlanListVO> openingOperationPlanListVOList= openPlanShopList.stream().map(dto -> {
OpeningOperationPlanListVO vO = new OpeningOperationPlanListVO();
vO.setShopId(dto.getShopId());
@@ -168,7 +169,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
vO.setFightName(dto.getFightName());
return vO;
}).collect(Collectors.toList());
log.info("getPlanListPage openingOperationPlanVOList:{}", openingOperationPlanListVOList);
log.info("getPlanListPage openingOperationPlanVOList:{}", JSONObject.toJSONString(openingOperationPlanListVOList) );
//提交时间,审核状态
List<Long> shopIdList = openPlanShopList.stream()
.map(OpenPlanShopInfoDTO::getShopId)
@@ -177,37 +178,37 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
openingOperationPlanDTO.setPlanStartDate(request.getPlanStartDate());
openingOperationPlanDTO.setPlanEndDate(request.getPlanEndDate());
List<OpeningOperationPlanDTO> openingOperationPlanDTOS = openingOperationPlanDAO.selectConditionPlanList(shopIdList, openingOperationPlanDTO);
log.info("getPlanListPage openingOperationPlanDTOS:{}", openingOperationPlanDTOS);
log.info("getPlanListPage openingOperationPlanDTOS:{}",JSONObject.toJSONString(openingOperationPlanDTOS) );
Map<Long, OpeningOperationPlanDTO> voPlanMap = openingOperationPlanDTOS.stream()
.collect(Collectors.toMap(OpeningOperationPlanDTO::getShopId, vo -> vo));
log.info("getPlanListPage voPlanMap:{}", voPlanMap);
log.info("getPlanListPage voPlanMap:{}",JSONObject.toJSONString(voPlanMap) );
//开店负责人name
List<String> shopManagerUserIdList = openPlanShopList.stream()
.map(OpenPlanShopInfoDTO::getShopManagerUserId)
.collect(Collectors.toList());
List<UserInfoDTO> shopManagerList = enterpriseUserDAO.getNameByUserId(shopManagerUserIdList);
log.info("getPlanListPage hopManagerList :{}", shopManagerList);
log.info("getPlanListPage hopManagerList :{}",JSONObject.toJSONString(shopManagerList) );
Map<Long,UserInfoDTO> voManagerMap = shopManagerList.stream()
.collect(Collectors.toMap(UserInfoDTO::getUserId, vo -> vo));
log.info("getPlanListPage voManagerMap:{}", voManagerMap);
log.info("getPlanListPage voManagerMap:{}", JSONObject.toJSONString(voManagerMap) );
//督导name
List<String> supervisorUserIdList = openPlanShopList.stream()
.map(OpenPlanShopInfoDTO::getSupervisorUserId)
.collect(Collectors.toList());
List<UserInfoDTO> supervisorList = enterpriseUserDAO.getNameByUserId(supervisorUserIdList);
log.info("getPlanListPage supervisorList :{}", supervisorList);
log.info("getPlanListPage supervisorList :{}",JSONObject.toJSONString(supervisorList) );
Map<Long, UserInfoDTO> voSupervisorList = supervisorList.stream()
.collect(Collectors.toMap(UserInfoDTO::getUserId, vo -> vo));
log.info("getPlanListPage openingOperationPlanVOList:{}", openingOperationPlanListVOList);
log.info("getPlanListPage openingOperationPlanVOList:{}", JSONObject.toJSONString(openingOperationPlanListVOList) );
//加盟商姓名,手机号,招商name
List<Long> lines = openPlanShopList.stream()
.map(OpenPlanShopInfoDTO::getLineId)
.collect(Collectors.toList());
List<PlanLineDTO> getLines = lineInfoDAO.getLines(lines);
log.info("getPlanListPage getLines:{}", getLines);
log.info("getPlanListPage getLines:{}",JSONObject.toJSONString(getLines) );
Map<Long,PlanLineDTO> linemap = getLines.stream()
.collect(Collectors.toMap(PlanLineDTO::getLineId, vo -> vo));
log.info("getPlanListPage linemap:{}", linemap);
log.info("getPlanListPage linemap:{}",JSONObject.toJSONString(linemap) );
for (OpeningOperationPlanListVO vo:openingOperationPlanListVOList){
vo.setSubmissionTime(voPlanMap.get(vo.getShopId()).getSubmissionTime());
vo.setResultType(voPlanMap.get(vo.getShopId()).getResultType());

View File

@@ -1,10 +1,19 @@
package com.cool.store.controller.webc;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.OpeningOperationPlanAuditService;
import com.cool.store.service.OpeningOperationPlanService;
import com.cool.store.vo.OpeningOperationPlanVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @Auther: WangShuo
* @Date: 2024/04/24/下午7:32
@@ -16,5 +25,15 @@ import org.springframework.web.bind.annotation.RestController;
@Api(tags = "开业运营方案操作")
@Slf4j
public class MiniOpeningOperationPlanController {
@Resource
private OpeningOperationPlanService openingOperationPlanService;
@Resource
private OpeningOperationPlanAuditService openingOperationPlanAuditService;
@GetMapping("/getPlan")
@ApiOperation("查询开业运营方案")
public ResponseResult<OpeningOperationPlanVO> getPlan(@RequestParam Long planId){
OpeningOperationPlanVO plan = openingOperationPlanService.getPlanById(planId);
return ResponseResult.success(plan);
}
}