开业筹备阶段4.0

This commit is contained in:
shuo.wang
2024-04-26 19:08:34 +08:00
parent a5ca7a3a63
commit 9e4de953c4
13 changed files with 48 additions and 49 deletions

View File

@@ -11,9 +11,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -126,6 +124,9 @@ public class EnterpriseUserDAO {
return enterpriseUserMapper.selectByInvestmentManager( investmentManager);
}
public List<UserNameDTO> getNameByUserId(List<String> userIdList){
if (CollectionUtils.isEmpty(userIdList)) {
return new ArrayList<>();
}
return enterpriseUserMapper.selectNameByUserId(userIdList);
}
}

View File

@@ -140,9 +140,9 @@ public class ShopInfoDAO {
* @Date: 2024/4/24
* @description: 开业运营方案根据shopname获取列表
*/
public List<OpenPlanShopInfoDTO>getOpenPlanShopListByShopName( List<Long> shopIdlist,String shopName, String bigName, String fightName){
public List<OpenPlanShopInfoDTO>getOpenPlanShopListByShopName( List<Long> shopIdlist,String shopName, String regionId ){
return shopInfoMapper.getOpenPlanShopListByShopName(shopIdlist,shopName,bigName,fightName);
return shopInfoMapper.getOpenPlanShopListByShopName(shopIdlist,shopName,regionId);
}
public Map<Long, Integer> getSelectedShopNumMap(List<Long> lineIds) {

View File

@@ -17,5 +17,5 @@ public interface OpeningOperationPlanMapper extends Mapper<OpeningOperationPlanD
@Param("endDate") Date endDate,
@Param("resultType") Integer resultType);
Integer updateByShopId(@Param("shopId") Long shopId, @Param("audit") Long auditId, @Param("resulType") Integer resultType);
Integer updateByShopId(@Param("shopId") Long shopId, @Param("auditId") Long auditId, @Param("resultType") Integer resultType);
}

View File

@@ -69,7 +69,7 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
* @description: 开业运营方案根据shopname获取列表
*/
List<OpenPlanShopInfoDTO> getOpenPlanShopListByShopName(@Param("shopIdlist")List<Long> shopIdlist, @Param("shopName") String shopName,
@Param("bigName") String bigName, @Param("fightName") String fightName);
@Param("regionId") String regionId);
/**
* @Auther: wangshuo
* @Date: 2024/4/25

View File

@@ -133,7 +133,7 @@
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.UserNameDTO">
select user_id as userId ,name ,
select user_id as userId ,name
from enterprise_user_${enterpriseId}
where user_id in
<foreach item="userId" index="index" collection="userIdList" open="(" separator="," close=")">

View File

@@ -17,7 +17,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<select id="selectByShopId" resultType="com.cool.store.dto.openPreparation.FirstOrderDTO">
select total_order_deposit as totalOrderDeposit,latest_payment_date as latestPaymentDate
select total_order_deposit as totalOrderDeposit, latest_payment_date as latestPaymentDate ,
estimated_cost as estimatedCost ,fruits_cost as fruitsCost
from xfsg_first_order
where shop_id = #{shopId}

View File

@@ -25,8 +25,9 @@
<result column="result_type" jdbcType="TINYINT" property="resultType"/>
</resultMap>
<sql id="Base_Column_List">
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
id,shop_id,plan_source,survey_result,survey_result_url,activity_theme,activity_theme_url,
submission_time,submitted_user_id,preparation_user_ids,route_completed,create_time,
update_time,create_user_id,update_user_id,deleted,audit_id,result_type
</sql>
<update id="updateByShopId">
update xfsg_opening_operation_plan
@@ -44,17 +45,17 @@
deleted = 0
</select>
<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
where
<if test="openingOperationPlanDTO.planStartDate != null">
op.create_time >= #{startDate}
SELECT shop_id AS shopId, submission_time AS submissionTime, result_type AS resultType,
audit_id as auditId
FROM xfsg_opening_operation_plan
where 1=1
<if test="startDate != null">
and op.create_time >= #{startDate}
</if>
<if test="openingOperationPlanDTO.planEndDate != null">
<![CDATA[AND op.create_time <= #{endDate}]]>
<if test="endDate != null">
AND op.create_time &lt;= #{endDate}
</if>
<if test="openingOperationPlanDTO.resultType != null">
<if test="resultType != null">
and op.result_type = #{resultType}
</if>

View File

@@ -75,7 +75,7 @@
<select id="getOpenPlanShopListByShopName" resultType="com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO">
select si.id as shopId, si.line_id as lineId, si.shop_name as shopName,
si.shop_code as shopCode, si.shop_manager_user_id as shopManagerUserId,si.shop_manager_user_id as shopManagerUserId
si.shop_code as shopCode, si.shop_manager_user_id as shopManagerUserId,si.shop_manager_user_id as shopManagerUserId,
xsbs.big_name as bigName, xsbs.fight_name as fightName
from xfsg_shop_info si
join xfsg_line_info li on si.line_id = li.id
@@ -90,12 +90,9 @@
<if test="shopName != null and shopName != ''">
AND si.shop_name = #{shopName}
</if>
<if test="bigName != null and bigName != ''">
AND xsbs.big_name = #{bigName}
<if test="regionId != null and regionId != ''">
AND xsbs.fight_code = #{fightCode}
</if>
<if test="fightName != null and fightName != ''">
AND xsbs.fight_name = #{fightName}
</if>
</select>
<select id="queryShopIdListByStage" resultType="java.lang.Long">

View File

@@ -20,10 +20,8 @@ public class PlanListRequest {
private Date planStartDate;
@ApiModelProperty("结束日期")
private Date planEndDate;
@ApiModelProperty("大区名称")
private String bigName;
@ApiModelProperty("战区名称")
private String fightName;
@ApiModelProperty("地区id")
private String regionId;
@ApiModelProperty("审核状态")
private Integer resultType;
@ApiModelProperty("页数")

View File

@@ -1,5 +1,6 @@
package com.cool.store.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -57,6 +58,7 @@ public class OpeningOperationPlanListVO {
private String supervisorName;
@ApiModelProperty("提交申请时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date submissionTime;
@ApiModelProperty("审核结果,0待审核1通过2拒绝")

View File

@@ -1,6 +1,8 @@
package com.cool.store.vo;
import com.cool.store.dto.openPreparation.UserNameDTO;
import com.cool.store.entity.OpeningOperationPlanDO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -35,6 +37,7 @@ public class OpeningOperationPlanVO {
private Byte routeCompleted;
@ApiModelProperty("提交时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date submissionTime;
@ApiModelProperty("提交人")
@@ -45,4 +48,16 @@ public class OpeningOperationPlanVO {
@ApiModelProperty("审核结果,0待审核1通过2拒绝")
private Integer resultType;
public OpeningOperationPlanVO(OpeningOperationPlanDO openingOperationPlanDO) {
this.resultType = openingOperationPlanDO.getResultType();
this.submittedUserId = openingOperationPlanDO.getSubmittedUserId();
this.submissionTime = openingOperationPlanDO.getSubmissionTime();
this.routeCompleted = openingOperationPlanDO.getRouteCompleted();
this.activityThemeUrl = openingOperationPlanDO.getActivityThemeUrl();
this.activityTheme = openingOperationPlanDO.getActivityTheme();
this.surveyResultUrl = openingOperationPlanDO.getSurveyResultUrl();
this.surveyResult = openingOperationPlanDO.getSurveyResult();
}
}

View File

@@ -121,22 +121,17 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
log.error(" getPlanByShopId shopId is null");
throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL);
}
OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO();
OpeningOperationPlanDO openingOperationPlanDO = openingOperationPlanDAO.selectByShopId(shopId);
try {
if (openingOperationPlanDO != null) {
OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO(openingOperationPlanDO);
String preparationUserIds = openingOperationPlanDO.getPreparationUserIds();
List<String> stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList());
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(stream);
BeanUtils.copyProperties(openingOperationPlanDO, openingOperationPlanVO);
openingOperationPlanVO.setPreparationUsers(nameByUserId);
return openingOperationPlanVO;
}
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
return null;
}
return openingOperationPlanVO;
return null;
}
@Override
@@ -163,9 +158,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
log.info("getPlanListPage shopIdlist:{}", JSONObject.toJSONString(shopIdlist));
//根据ShopName等查询门店名字1门店代码1开店负责人id1督导id1,大区名称,战区名称,线索id
List<OpenPlanShopInfoDTO> openPlanShopList = shopInfoDAO.
getOpenPlanShopListByShopName(shopIdlist, request.getShopName(), request.getBigName(),
request.getFightName()
);
getOpenPlanShopListByShopName(shopIdlist, request.getShopName(), request.getRegionId());
log.info("getPlanListPage openPlanShopList:{}", JSONObject.toJSONString(openPlanShopList));
Map<Long, OpenPlanShopInfoDTO> shopInfoMap = openPlanShopList.stream()
.collect(Collectors.toMap(OpenPlanShopInfoDTO::getShopId, vo -> vo));

View File

@@ -40,17 +40,9 @@ import java.util.List;
@Slf4j
public class OpenPreparationController {
@Resource
private CoolStoreStartFlowService coolStoreStartFlowService;
@Resource
private ShopStageInfoDAO shopStageInfoDAO;
@Resource
private FirstOrderService firstOrderService;
@Resource
private ShopService shopService;
@Resource
private PreparationService preparationService;
@Resource
private OpeningOperationPlanService openingOperationPlanService;
@Resource
private AuditOpeningOperationPlanService auditOpeningOperationPlanService;