开业筹备阶段3.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.openPreparation.UserInfoDTO;
|
||||
import com.cool.store.dto.openPreparation.UserNameDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
@@ -125,7 +125,7 @@ public class EnterpriseUserDAO {
|
||||
}
|
||||
return enterpriseUserMapper.selectByInvestmentManager( investmentManager);
|
||||
}
|
||||
public List<UserInfoDTO> getNameByUserId(List<String> userIdList){
|
||||
public List<UserNameDTO> getNameByUserId(List<String> userIdList){
|
||||
return enterpriseUserMapper.selectNameByUserId(userIdList);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -29,17 +30,21 @@ public class OpeningOperationPlanDAO {
|
||||
}
|
||||
|
||||
|
||||
public Integer updateResultType(Long shopId,Long auditId,Integer resultType){
|
||||
return openingOperationPlanMapper.updateByShopId(shopId,auditId,resultType);
|
||||
|
||||
}
|
||||
public Long updateSelective( OpeningOperationPlanDO openingOperationPlanDO){
|
||||
openingOperationPlanMapper.updateByPrimaryKeySelective(openingOperationPlanDO);
|
||||
return openingOperationPlanDO.getId();
|
||||
openingOperationPlanMapper.updateByPrimaryKeySelective(openingOperationPlanDO);
|
||||
return openingOperationPlanDO.getId();
|
||||
}
|
||||
|
||||
public OpeningOperationPlanDO selectByShopId( Long shopId){
|
||||
return openingOperationPlanMapper.selectByShopId(shopId);
|
||||
}
|
||||
//条件关联查询
|
||||
public List<OpeningOperationPlanDTO> selectConditionPlanList( OpeningOperationPlanDTO openingOperationPlanDTO){
|
||||
return openingOperationPlanMapper.selectPlanListByShopId( openingOperationPlanDTO);
|
||||
|
||||
public List<OpeningOperationPlanDTO> selectConditionPlanList(Date StartDate,Date EndDate,Integer resultType){
|
||||
return openingOperationPlanMapper.selectPlanList( StartDate,EndDate,resultType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.openPreparation.UserInfoDTO;
|
||||
import com.cool.store.dto.openPreparation.UserNameDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -75,5 +75,5 @@ public interface EnterpriseUserMapper {
|
||||
* @Date: 2024/4/24
|
||||
* @description: 根据userid查询名字
|
||||
*/
|
||||
List<UserInfoDTO> selectNameByUserId(@Param("userIdList") List<String> userId);
|
||||
List<UserNameDTO> selectNameByUserId(@Param("userIdList") List<String> userId);
|
||||
}
|
||||
@@ -5,12 +5,16 @@ import com.cool.store.entity.OpeningOperationPlanDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface OpeningOperationPlanMapper extends Mapper<OpeningOperationPlanDO> {
|
||||
|
||||
OpeningOperationPlanDO selectByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
List<OpeningOperationPlanDTO> selectPlanListByShopId(@Param("openingOperationPlanDTO") OpeningOperationPlanDTO openingOperationPlanDTO );
|
||||
List<OpeningOperationPlanDTO> selectPlanList( @Param("startDate") Date startDate,
|
||||
@Param("endDate") Date endDate,
|
||||
@Param("resultType") Integer resultType);
|
||||
|
||||
Integer updateByShopId(@Param("shopId") Long shopId, @Param("audit") Long auditId, @Param("resulType") Integer resultType);
|
||||
}
|
||||
@@ -7,18 +7,19 @@ import tk.mybatis.mapper.common.Mapper;
|
||||
import java.util.List;
|
||||
|
||||
public interface ShopAuditInfoMapper extends Mapper<ShopAuditInfoDO> {
|
||||
|
||||
ShopAuditInfoDO selectBykeyAndType(@Param("shopId") Long shopId);
|
||||
|
||||
List<ShopAuditInfoDO> getAuditInfoList(@Param("auditIds") List<Long> auditIds);
|
||||
|
||||
List<ShopAuditInfoDO> getListByShopIdAndType(@Param("shopId") Long shopId,
|
||||
@Param("type") Integer type);
|
||||
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2024/4/23
|
||||
* @description:根据店铺id查询审批结果
|
||||
*/
|
||||
Long selectAuditIdByShopId(@Param("shopId") Long shopId);
|
||||
|
||||
|
||||
}
|
||||
@@ -132,7 +132,7 @@
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM enterprise_user_${enterpriseId} WHERE ( mobile = #{investmentManager} or `name` = #{investmentManager} ) and active = true LIMIT 1
|
||||
</select>
|
||||
<select id="selectNameByUserId" resultType="com.cool.store.dto.openPreparation.UserInfoDTO">
|
||||
<select id="selectNameByUserId" resultType="com.cool.store.dto.openPreparation.UserNameDTO">
|
||||
select user_id as userId ,name ,
|
||||
from enterprise_user_${enterpriseId}
|
||||
where user_id in
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
shop_id,plan_source,submitted_user_id,submission_time,survey_result,survey_result_url,activity_theme,activity_theme_url,preparation_user_ids,
|
||||
route_completed,deleted,audit_id,result_type
|
||||
</sql>
|
||||
<update id="updateByShopId">
|
||||
update xfsg_opening_operation_plan
|
||||
set audit_id = #{auditId},result_type = #{resultType}
|
||||
where shop_id = #{shopId}
|
||||
</update>
|
||||
|
||||
<select id="selectByShopId" resultType="com.cool.store.entity.OpeningOperationPlanDO">
|
||||
select
|
||||
@@ -38,19 +43,19 @@
|
||||
and
|
||||
deleted = 0
|
||||
</select>
|
||||
<select id="selectPlanListByShopId" resultType="com.cool.store.dto.openPreparation.OpeningOperationPlanDTO">
|
||||
SELECT op.shop_id AS shopId, op.update_time AS updateTime, op.result_type AS resultType
|
||||
<select id="selectPlanList" resultType="com.cool.store.dto.openPreparation.OpeningOperationPlanDTO">
|
||||
SELECT op.shop_id AS shopId, op.submission_time AS submissionTime, op.result_type AS resultType
|
||||
op.audit_id as auditId
|
||||
FROM xfsg_opening_operation_plan op
|
||||
JOIN xfsg_shop_info si ON op.shop_id = si.id
|
||||
where
|
||||
<if test="openingOperationPlanDTO.planStartDate != null">
|
||||
op.create_time >= #{openingOperationPlanDTO.planStartDate}
|
||||
op.create_time >= #{startDate}
|
||||
</if>
|
||||
<if test="openingOperationPlanDTO.planEndDate != null">
|
||||
<![CDATA[AND op.create_time <= #{openingOperationPlanDTO.planEndDate}]]>
|
||||
<![CDATA[AND op.create_time <= #{endDate}]]>
|
||||
</if>
|
||||
<if test="openingOperationPlanDTO.resultType != null">
|
||||
and op.result_type = #{openingOperationPlanDTO.resultType}
|
||||
and op.result_type = #{resultType}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.cool.store.dto.openPreparation;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -33,12 +31,10 @@ public class OpeningOperationPlanDTO {
|
||||
@ApiModelProperty("审核结果,0待审核,1通过,2拒绝")
|
||||
private Integer resultType;
|
||||
|
||||
@ApiModelProperty("起始日期")
|
||||
public Date planStartDate;
|
||||
|
||||
@ApiModelProperty("结束日期")
|
||||
public Date planEndDate;
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
private Long auditId;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
|
||||
public class UserInfoDTO {
|
||||
public class UserNameDTO {
|
||||
|
||||
|
||||
private Long userId;
|
||||
@@ -109,6 +109,9 @@ public class OpeningOperationPlanDO {
|
||||
@Column(name = "result_type")
|
||||
private Integer resultType;
|
||||
|
||||
|
||||
|
||||
|
||||
public Integer getResultType() {
|
||||
return resultType;
|
||||
}
|
||||
@@ -117,14 +120,6 @@ public class OpeningOperationPlanDO {
|
||||
this.resultType = resultType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.cool.store.entity.ShopAuditInfoDO;
|
||||
import com.cool.store.enums.AuditTypeEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -15,21 +16,9 @@ import java.util.Date;
|
||||
@Data
|
||||
public class OpeningOperationPlanAuditRequest {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty("2-开业运营方案")
|
||||
private Integer auditType;
|
||||
|
||||
@ApiModelProperty("提交人ID")
|
||||
private String submittedUserId;
|
||||
|
||||
@ApiModelProperty("提交人名称")
|
||||
private String submittedUserName;
|
||||
|
||||
@ApiModelProperty("结果类型 0通过,1拒绝")
|
||||
private Integer resultType;
|
||||
|
||||
@@ -39,20 +28,15 @@ public class OpeningOperationPlanAuditRequest {
|
||||
@ApiModelProperty("拒绝原因")
|
||||
private String rejectReason;
|
||||
|
||||
@ApiModelProperty("是否删除:0.否 1.是")
|
||||
private Boolean deleted;
|
||||
|
||||
public ShopAuditInfoDO toShopAuditInfoDO() {
|
||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||
shopAuditInfoDO.setId(id);
|
||||
shopAuditInfoDO.setShopId(shopId);
|
||||
shopAuditInfoDO.setAuditType(auditType);
|
||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.OPENING_OPERATION_PLAN.getCode());
|
||||
shopAuditInfoDO.setResultType(resultType);
|
||||
if (resultType == 0 )
|
||||
shopAuditInfoDO.setPassReason(passReason);
|
||||
else
|
||||
shopAuditInfoDO.setRejectReason(rejectReason);
|
||||
shopAuditInfoDO.setDeleted(deleted);
|
||||
shopAuditInfoDO.setSubmittedUserId(submittedUserId);
|
||||
shopAuditInfoDO.setSubmittedUserName(submittedUserName);
|
||||
shopAuditInfoDO.setCreateTime(new Date());
|
||||
shopAuditInfoDO.setUpdateTime(new Date());
|
||||
return shopAuditInfoDO;
|
||||
|
||||
@@ -13,8 +13,6 @@ import lombok.Data;
|
||||
@Data
|
||||
public class OpeningOperationPlanRequest {
|
||||
|
||||
@ApiModelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long shopId;
|
||||
@@ -40,12 +38,6 @@ public class OpeningOperationPlanRequest {
|
||||
@ApiModelProperty("是否完成排车路线")
|
||||
private Byte routeCompleted;
|
||||
|
||||
@ApiModelProperty("是否删除:0.否 1.是")
|
||||
private Boolean deleted;
|
||||
|
||||
@ApiModelProperty("审核结果,0待审核,1通过,2拒绝")
|
||||
private Integer resultType;
|
||||
|
||||
|
||||
|
||||
public OpeningOperationPlanDO toOpeningOperationPlanDO() {
|
||||
@@ -58,8 +50,6 @@ public class OpeningOperationPlanRequest {
|
||||
openingOperationPlanDO.setActivityThemeUrl(activityThemeUrl);
|
||||
openingOperationPlanDO.setPreparationUserIds(preparationUserIds);
|
||||
openingOperationPlanDO.setRouteCompleted(routeCompleted);
|
||||
openingOperationPlanDO.setDeleted(deleted);
|
||||
openingOperationPlanDO.setResultType(resultType);
|
||||
return openingOperationPlanDO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,11 +9,14 @@ import java.util.Date;
|
||||
* @Auther: WangShuo
|
||||
* @Date: 2024/04/23/上午10:47
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
* @注释: 运营方案审核
|
||||
*/
|
||||
@Data
|
||||
public class OpeningOperationPlanListVO {
|
||||
|
||||
@ApiModelProperty("方案关联审核id")
|
||||
private Long auditId;
|
||||
|
||||
@ApiModelProperty("门店id")
|
||||
private Long shopId;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class OpeningOperationPlanVO {
|
||||
@ApiModelProperty("活动主题url")
|
||||
private String activityThemeUrl;
|
||||
|
||||
@ApiModelProperty("筹备人员ids")
|
||||
@ApiModelProperty("筹备人员name")
|
||||
private String preparationUsers;
|
||||
|
||||
@ApiModelProperty("是否完成排车路线")
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.openPreparation.FirstOrderDTO;
|
||||
import com.cool.store.entity.FirstOrderDO;
|
||||
import com.cool.store.request.FirstOrderRequest;
|
||||
|
||||
/**
|
||||
* @Auther: WangShuo
|
||||
@@ -11,7 +12,7 @@ import com.cool.store.entity.FirstOrderDO;
|
||||
*/
|
||||
public interface FirstOrderService {
|
||||
|
||||
Integer saveOrder(FirstOrderDO order);
|
||||
Integer saveOrder(FirstOrderRequest request);
|
||||
|
||||
FirstOrderDTO getOrder(Long shopId);
|
||||
}
|
||||
|
||||
@@ -16,16 +16,19 @@ import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mq.util.HttpRestTemplateService;
|
||||
import com.cool.store.request.FirstOrderRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.CoolStoreStartFlowService;
|
||||
import com.cool.store.service.FirstOrderService;
|
||||
import com.cool.store.service.PreparationService;
|
||||
import com.cool.store.service.ShopService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -57,8 +60,16 @@ public class FirstOrderServiceImp implements FirstOrderService {
|
||||
private CoolStoreStartFlowService coolStoreStartFlowService;
|
||||
|
||||
@Override
|
||||
public Integer saveOrder(FirstOrderDO order) {
|
||||
public Integer saveOrder(FirstOrderRequest request) {
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
FirstOrderDO order = new FirstOrderDO();
|
||||
try {
|
||||
BeanUtils.copyProperties(order, request);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
log.info("save order:{}", JSONObject.toJSONString(order));
|
||||
if (order == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dao.OpeningOperationPlanAuditDAO;
|
||||
import com.cool.store.dao.OpeningOperationPlanDAO;
|
||||
import com.cool.store.dao.ShopAuditInfoDAO;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.OpeningOperationPlanDO;
|
||||
import com.cool.store.entity.ShopAuditInfoDO;
|
||||
import com.cool.store.enums.AuditTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.OpeningOperationPlanResultTypeEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
@@ -41,36 +41,40 @@ public class OpeningOperationPlanAuditImpl implements OpeningOperationPlanAuditS
|
||||
private ShopStageInfoDAO shopStageInfoDAO;
|
||||
@Resource
|
||||
private PreparationService preparationService;
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Override
|
||||
public Long addNewPlanAudit(OpeningOperationPlanAuditRequest request) {
|
||||
log.info("addNewPlanAudit request:{}", request);
|
||||
log.info("addNewPlanAudit request:{}", JSONObject.toJSONString(request));
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
ShopAuditInfoDO shopAuditInfoDO = request.toShopAuditInfoDO();
|
||||
EnterpriseUserDO userInfoById = enterpriseUserDAO.getUserInfoById(userId);
|
||||
shopAuditInfoDO.setSubmittedUserId(userId);
|
||||
shopAuditInfoDO.setSubmittedUserName(userInfoById.getName());
|
||||
shopAuditInfoDO.setAuditType(AuditTypeEnum.OPENING_OPERATION_PLAN.getCode());
|
||||
return openingOperationPlanAuditDAO.insertSelective(shopAuditInfoDO);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean auditPlan(OpeningOperationPlanAuditRequest request) {
|
||||
log.info("auditPlan request:{}", request);
|
||||
if (Objects.isNull(request.getId())) {
|
||||
log.error("auditPlan request id is null");
|
||||
throw new ServiceException("auditPlan request id is null");
|
||||
log.info("auditPlan request:{}", JSONObject.toJSONString(request));
|
||||
if (Objects.isNull(request)) {
|
||||
log.error("auditPlan request is null");
|
||||
throw new ServiceException("auditPlan request is null");
|
||||
}
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
try {
|
||||
Integer audit = openingOperationPlanAuditDAO.updateSelective(request.toShopAuditInfoDO());
|
||||
if (Objects.isNull(audit)) {
|
||||
Long auditId = openingOperationPlanAuditDAO.insertSelective(request.toShopAuditInfoDO());
|
||||
if (Objects.isNull(auditId)) {
|
||||
log.error("auditPlan audit is null");
|
||||
throw new ServiceException(ErrorCodeEnum.UPDATE_AUDIT_PLAN_FALSE);
|
||||
throw new ServiceException(ErrorCodeEnum.INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE);
|
||||
}
|
||||
Long auditId = openingOperationPlanAuditDAO.selectIdByShopId(request.getShopId());
|
||||
OpeningOperationPlanDO openingOperationPlanDO = new OpeningOperationPlanDO();
|
||||
openingOperationPlanDO.setUpdateUserId(userId);
|
||||
openingOperationPlanDO.setUpdateTime(new Date());
|
||||
openingOperationPlanDO.setShopId(request.getShopId());
|
||||
openingOperationPlanDO.setAuditId(auditId);
|
||||
openingOperationPlanDO.setResultType(request.getResultType());
|
||||
Long plan = openingOperationPlanDAO.updateSelective(openingOperationPlanDO);
|
||||
Integer plan = openingOperationPlanDAO.updateResultType(request.getShopId(),auditId,request.getResultType());
|
||||
if (Objects.isNull(plan)) {
|
||||
log.error("auditPlan plan is null");
|
||||
throw new ServiceException(ErrorCodeEnum.UPDATE_PLAN_FALSE);
|
||||
|
||||
@@ -7,8 +7,9 @@ import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||
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.dto.openPreparation.UserNameDTO;
|
||||
import com.cool.store.entity.OpeningOperationPlanDO;
|
||||
import com.cool.store.enums.AuditStatusEnum;
|
||||
import com.cool.store.enums.AuditTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
@@ -78,31 +79,34 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
}
|
||||
OpeningOperationPlanAuditRequest openingOperationPlanAuditRequest = new OpeningOperationPlanAuditRequest();
|
||||
openingOperationPlanAuditRequest.setShopId(request.getShopId());
|
||||
openingOperationPlanAuditRequest.setAuditType(AuditTypeEnum.OPENING_OPERATION_PLAN.getCode());
|
||||
openingOperationPlanAuditRequest.setSubmittedUserName(userName);
|
||||
openingOperationPlanAuditRequest.setSubmittedUserId(userId);
|
||||
Long AuditId = openingOperationPlanAuditService.addNewPlanAudit(openingOperationPlanAuditRequest);
|
||||
if (Objects.isNull(AuditId) ){
|
||||
log.error("addNewPlan AuditId is null");
|
||||
throw new ServiceException(ErrorCodeEnum.INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE);
|
||||
}
|
||||
OpeningOperationPlanDO selectByShopId = openingOperationPlanDAO.selectByShopId(request.getShopId());
|
||||
|
||||
Long planId ;
|
||||
if (Objects.isNull(selectByShopId)){
|
||||
OpeningOperationPlanDO openingOperationPlanDO = request.toOpeningOperationPlanDO();
|
||||
OpeningOperationPlanDO openingOperationPlanDO = request.toOpeningOperationPlanDO();
|
||||
if (!Objects.isNull(selectByShopId)){
|
||||
//提交修改
|
||||
openingOperationPlanDO.setId(selectByShopId.getId());
|
||||
openingOperationPlanDO.setSubmissionTime(new Date());
|
||||
openingOperationPlanDO.setSubmittedUserId(userId);
|
||||
openingOperationPlanDO.setAuditId(AuditId);
|
||||
openingOperationPlanDO.setUpdateTime(new Date());
|
||||
openingOperationPlanDO.setUpdateUserId(userId);
|
||||
openingOperationPlanDO.setResultType(AuditStatusEnum.TODO.getCode());
|
||||
planId = openingOperationPlanDAO.updateSelective(openingOperationPlanDO);
|
||||
}
|
||||
else {
|
||||
OpeningOperationPlanDO openingOperationPlanDO = request.toOpeningOperationPlanDO();
|
||||
//新增
|
||||
openingOperationPlanDO.setSubmissionTime(new Date());
|
||||
openingOperationPlanDO.setSubmittedUserId(userId);
|
||||
openingOperationPlanDO.setCreateTime(new Date());
|
||||
openingOperationPlanDO.setCreateUserId(userId);
|
||||
openingOperationPlanDO.setUpdateTime(new Date());
|
||||
openingOperationPlanDO.setUpdateUserId(userId);
|
||||
openingOperationPlanDO.setAuditId(AuditId);
|
||||
openingOperationPlanDO.setResultType(AuditStatusEnum.TODO.getCode());
|
||||
planId = openingOperationPlanDAO.insertSelective(openingOperationPlanDO);
|
||||
}
|
||||
if (Objects.isNull(planId)){
|
||||
@@ -114,7 +118,6 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
log.error("auditPlan stage is null");
|
||||
throw new ServiceException(ErrorCodeEnum.UPDATE_SHOP_SUB_STAGE_STATUS_FALSE);
|
||||
}
|
||||
|
||||
return planId;
|
||||
}catch (Exception e) {
|
||||
log.error("addNewPlan Exception:{}", e);
|
||||
@@ -136,9 +139,9 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
if ((openingOperationPlanDO!=null)){
|
||||
String preparationUserIds = openingOperationPlanDO.getPreparationUserIds();
|
||||
List<String> stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList());
|
||||
List<UserInfoDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(stream);
|
||||
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(stream);
|
||||
List<String> names = nameByUserId.stream()
|
||||
.map(UserInfoDTO::getName)
|
||||
.map(UserNameDTO::getName)
|
||||
.collect(Collectors.toList());
|
||||
String preparationUserName = String.join(CommonConstants.COMMA, names);
|
||||
BeanUtils.copyProperties(openingOperationPlanDO, openingOperationPlanVO);
|
||||
@@ -156,11 +159,8 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
public List<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
|
||||
log.info("getPlanListPage request:{}", JSONObject.toJSONString(request));
|
||||
//shopId,提交时间,审核状态
|
||||
OpeningOperationPlanDTO openingOperationPlanDTO =new OpeningOperationPlanDTO();
|
||||
openingOperationPlanDTO.setPlanStartDate(request.getPlanStartDate());
|
||||
openingOperationPlanDTO.setPlanEndDate(request.getPlanEndDate());
|
||||
openingOperationPlanDTO.setResultType(request.getResultType());
|
||||
List<OpeningOperationPlanDTO> openingOperationPlanDTOS = openingOperationPlanDAO.selectConditionPlanList(openingOperationPlanDTO);
|
||||
List<OpeningOperationPlanDTO> openingOperationPlanDTOS = openingOperationPlanDAO.
|
||||
selectConditionPlanList(request.getPlanStartDate(),request.getPlanEndDate(),request.getResultType());
|
||||
log.info("getPlanListPage openingOperationPlanDTOS:{}",JSONObject.toJSONString(openingOperationPlanDTOS) );
|
||||
//包装VO
|
||||
List<OpeningOperationPlanListVO> openingOperationPlanListVOList = openingOperationPlanDTOS.stream().map(dto->{
|
||||
@@ -168,6 +168,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
vO.setShopId(dto.getShopId());
|
||||
vO.setSubmissionTime(dto.getSubmissionTime());
|
||||
vO.setResultType(dto.getResultType());
|
||||
vO.setAuditId(dto.getAuditId());
|
||||
return vO;
|
||||
}).collect(Collectors.toList());
|
||||
log.info("getPlanListPage openingOperationPlanVOList:{}", JSONObject.toJSONString(openingOperationPlanListVOList) );
|
||||
@@ -186,19 +187,19 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
List<String> shopManagerUserIdList = openPlanShopList.stream()
|
||||
.map(OpenPlanShopInfoDTO::getShopManagerUserId)
|
||||
.collect(Collectors.toList());
|
||||
List<UserInfoDTO> shopManagerList = enterpriseUserDAO.getNameByUserId(shopManagerUserIdList);
|
||||
List<UserNameDTO> shopManagerList = enterpriseUserDAO.getNameByUserId(shopManagerUserIdList);
|
||||
log.info("getPlanListPage hopManagerList :{}",JSONObject.toJSONString(shopManagerList) );
|
||||
Map<Long,UserInfoDTO> voManagerMap = shopManagerList.stream()
|
||||
.collect(Collectors.toMap(UserInfoDTO::getUserId, vo -> vo));
|
||||
Map<Long, UserNameDTO> voManagerMap = shopManagerList.stream()
|
||||
.collect(Collectors.toMap(UserNameDTO::getUserId, vo -> vo));
|
||||
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);
|
||||
List<UserNameDTO> supervisorList = enterpriseUserDAO.getNameByUserId(supervisorUserIdList);
|
||||
log.info("getPlanListPage supervisorList :{}",JSONObject.toJSONString(supervisorList) );
|
||||
Map<Long, UserInfoDTO> voSupervisorList = supervisorList.stream()
|
||||
.collect(Collectors.toMap(UserInfoDTO::getUserId, vo -> vo));
|
||||
Map<Long, UserNameDTO> voSupervisorList = supervisorList.stream()
|
||||
.collect(Collectors.toMap(UserNameDTO::getUserId, vo -> vo));
|
||||
log.info("getPlanListPage openingOperationPlanVOList:{}", JSONObject.toJSONString(openingOperationPlanListVOList) );
|
||||
//加盟商姓名,手机号,招商name
|
||||
List<Long> lines = openPlanShopList.stream()
|
||||
|
||||
@@ -123,7 +123,7 @@ public class OpenPreparationController {
|
||||
FirstOrderDO firstOrderDO = new FirstOrderDO();
|
||||
try {
|
||||
BeanUtils.copyProperties(firstOrderDO, request);
|
||||
firstOrderService.saveOrder(firstOrderDO);
|
||||
firstOrderService.saveOrder(request);
|
||||
return ResponseResult.success();
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
@@ -76,9 +76,8 @@ public class MiniOpenPreparationController {
|
||||
order.setResultType(firstOrderStageInfo.getShopSubStageStatus());
|
||||
return ResponseResult.success(order);
|
||||
}
|
||||
|
||||
@GetMapping("/firstOrder/flush")
|
||||
public ResponseResult flush(@RequestParam Long shopId) {
|
||||
public ResponseResult<FirstOrderDTO> flush(@RequestParam Long shopId) {
|
||||
ShopStageInfoDO orderStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
|
||||
try {
|
||||
if (!orderStageInfo.getShopSubStageStatus().
|
||||
@@ -102,10 +101,9 @@ public class MiniOpenPreparationController {
|
||||
}
|
||||
ShopStageInfoDO firstOrderStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
|
||||
log.info("flush orderStageInfo:{}", firstOrderStageInfo);
|
||||
OpenPreparationFlushVO flushVO = new OpenPreparationFlushVO();
|
||||
flushVO.setShopId(shopId);
|
||||
flushVO.setFirstOderState(firstOrderStageInfo.getShopSubStageStatus());
|
||||
return ResponseResult.success(flushVO);
|
||||
FirstOrderDTO order = firstOrderService.getOrder(shopId);
|
||||
order.setResultType(firstOrderStageInfo.getShopSubStageStatus());
|
||||
return ResponseResult.success(order);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user