开业筹备阶段4.0
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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=")">
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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 <= #{endDate}
|
||||
</if>
|
||||
<if test="openingOperationPlanDTO.resultType != null">
|
||||
<if test="resultType != null">
|
||||
and op.result_type = #{resultType}
|
||||
</if>
|
||||
|
||||
|
||||
@@ -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,11 +90,8 @@
|
||||
<if test="shopName != null and shopName != ''">
|
||||
AND si.shop_name = #{shopName}
|
||||
</if>
|
||||
<if test="bigName != null and bigName != ''">
|
||||
AND xsbs.big_name = #{bigName}
|
||||
</if>
|
||||
<if test="fightName != null and fightName != ''">
|
||||
AND xsbs.fight_name = #{fightName}
|
||||
<if test="regionId != null and regionId != ''">
|
||||
AND xsbs.fight_code = #{fightCode}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
@@ -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("页数")
|
||||
|
||||
@@ -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拒绝")
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,23 +121,18 @@ 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user