开业筹备阶段4.0
This commit is contained in:
@@ -11,9 +11,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -126,6 +124,9 @@ public class EnterpriseUserDAO {
|
|||||||
return enterpriseUserMapper.selectByInvestmentManager( investmentManager);
|
return enterpriseUserMapper.selectByInvestmentManager( investmentManager);
|
||||||
}
|
}
|
||||||
public List<UserNameDTO> getNameByUserId(List<String> userIdList){
|
public List<UserNameDTO> getNameByUserId(List<String> userIdList){
|
||||||
|
if (CollectionUtils.isEmpty(userIdList)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
return enterpriseUserMapper.selectNameByUserId(userIdList);
|
return enterpriseUserMapper.selectNameByUserId(userIdList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -140,9 +140,9 @@ public class ShopInfoDAO {
|
|||||||
* @Date: 2024/4/24
|
* @Date: 2024/4/24
|
||||||
* @description: 开业运营方案,根据shopname获取列表
|
* @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) {
|
public Map<Long, Integer> getSelectedShopNumMap(List<Long> lineIds) {
|
||||||
|
|||||||
@@ -17,5 +17,5 @@ public interface OpeningOperationPlanMapper extends Mapper<OpeningOperationPlanD
|
|||||||
@Param("endDate") Date endDate,
|
@Param("endDate") Date endDate,
|
||||||
@Param("resultType") Integer resultType);
|
@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获取列表
|
* @description: 开业运营方案,根据shopname获取列表
|
||||||
*/
|
*/
|
||||||
List<OpenPlanShopInfoDTO> getOpenPlanShopListByShopName(@Param("shopIdlist")List<Long> shopIdlist, @Param("shopName") String 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
|
* @Auther: wangshuo
|
||||||
* @Date: 2024/4/25
|
* @Date: 2024/4/25
|
||||||
|
|||||||
@@ -133,7 +133,7 @@
|
|||||||
FROM enterprise_user_${enterpriseId} WHERE ( mobile = #{investmentManager} or `name` = #{investmentManager} ) and active = true LIMIT 1
|
FROM enterprise_user_${enterpriseId} WHERE ( mobile = #{investmentManager} or `name` = #{investmentManager} ) and active = true LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
<select id="selectNameByUserId" resultType="com.cool.store.dto.openPreparation.UserNameDTO">
|
<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}
|
from enterprise_user_${enterpriseId}
|
||||||
where user_id in
|
where user_id in
|
||||||
<foreach item="userId" index="index" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" index="index" collection="userIdList" open="(" separator="," close=")">
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="selectByShopId" resultType="com.cool.store.dto.openPreparation.FirstOrderDTO">
|
<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
|
estimated_cost as estimatedCost ,fruits_cost as fruitsCost
|
||||||
from xfsg_first_order
|
from xfsg_first_order
|
||||||
where shop_id = #{shopId}
|
where shop_id = #{shopId}
|
||||||
|
|||||||
@@ -25,8 +25,9 @@
|
|||||||
<result column="result_type" jdbcType="TINYINT" property="resultType"/>
|
<result column="result_type" jdbcType="TINYINT" property="resultType"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<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,
|
id,shop_id,plan_source,survey_result,survey_result_url,activity_theme,activity_theme_url,
|
||||||
route_completed,deleted,audit_id,result_type
|
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>
|
</sql>
|
||||||
<update id="updateByShopId">
|
<update id="updateByShopId">
|
||||||
update xfsg_opening_operation_plan
|
update xfsg_opening_operation_plan
|
||||||
@@ -44,17 +45,17 @@
|
|||||||
deleted = 0
|
deleted = 0
|
||||||
</select>
|
</select>
|
||||||
<select id="selectPlanList" resultType="com.cool.store.dto.openPreparation.OpeningOperationPlanDTO">
|
<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
|
SELECT shop_id AS shopId, submission_time AS submissionTime, result_type AS resultType,
|
||||||
op.audit_id as auditId
|
audit_id as auditId
|
||||||
FROM xfsg_opening_operation_plan op
|
FROM xfsg_opening_operation_plan
|
||||||
where
|
where 1=1
|
||||||
<if test="openingOperationPlanDTO.planStartDate != null">
|
<if test="startDate != null">
|
||||||
op.create_time >= #{startDate}
|
and op.create_time >= #{startDate}
|
||||||
</if>
|
</if>
|
||||||
<if test="openingOperationPlanDTO.planEndDate != null">
|
<if test="endDate != null">
|
||||||
<![CDATA[AND op.create_time <= #{endDate}]]>
|
AND op.create_time <= #{endDate}
|
||||||
</if>
|
</if>
|
||||||
<if test="openingOperationPlanDTO.resultType != null">
|
<if test="resultType != null">
|
||||||
and op.result_type = #{resultType}
|
and op.result_type = #{resultType}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
<select id="getOpenPlanShopListByShopName" resultType="com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO">
|
<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,
|
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
|
xsbs.big_name as bigName, xsbs.fight_name as fightName
|
||||||
from xfsg_shop_info si
|
from xfsg_shop_info si
|
||||||
join xfsg_line_info li on si.line_id = li.id
|
join xfsg_line_info li on si.line_id = li.id
|
||||||
@@ -90,11 +90,8 @@
|
|||||||
<if test="shopName != null and shopName != ''">
|
<if test="shopName != null and shopName != ''">
|
||||||
AND si.shop_name = #{shopName}
|
AND si.shop_name = #{shopName}
|
||||||
</if>
|
</if>
|
||||||
<if test="bigName != null and bigName != ''">
|
<if test="regionId != null and regionId != ''">
|
||||||
AND xsbs.big_name = #{bigName}
|
AND xsbs.fight_code = #{fightCode}
|
||||||
</if>
|
|
||||||
<if test="fightName != null and fightName != ''">
|
|
||||||
AND xsbs.fight_name = #{fightName}
|
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -20,10 +20,8 @@ public class PlanListRequest {
|
|||||||
private Date planStartDate;
|
private Date planStartDate;
|
||||||
@ApiModelProperty("结束日期")
|
@ApiModelProperty("结束日期")
|
||||||
private Date planEndDate;
|
private Date planEndDate;
|
||||||
@ApiModelProperty("大区名称")
|
@ApiModelProperty("地区id")
|
||||||
private String bigName;
|
private String regionId;
|
||||||
@ApiModelProperty("战区名称")
|
|
||||||
private String fightName;
|
|
||||||
@ApiModelProperty("审核状态")
|
@ApiModelProperty("审核状态")
|
||||||
private Integer resultType;
|
private Integer resultType;
|
||||||
@ApiModelProperty("页数")
|
@ApiModelProperty("页数")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.vo;
|
package com.cool.store.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -57,6 +58,7 @@ public class OpeningOperationPlanListVO {
|
|||||||
private String supervisorName;
|
private String supervisorName;
|
||||||
|
|
||||||
@ApiModelProperty("提交申请时间")
|
@ApiModelProperty("提交申请时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date submissionTime;
|
private Date submissionTime;
|
||||||
|
|
||||||
@ApiModelProperty("审核结果,0待审核,1通过,2拒绝")
|
@ApiModelProperty("审核结果,0待审核,1通过,2拒绝")
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.cool.store.vo;
|
package com.cool.store.vo;
|
||||||
|
|
||||||
import com.cool.store.dto.openPreparation.UserNameDTO;
|
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 io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -35,6 +37,7 @@ public class OpeningOperationPlanVO {
|
|||||||
private Byte routeCompleted;
|
private Byte routeCompleted;
|
||||||
|
|
||||||
@ApiModelProperty("提交时间")
|
@ApiModelProperty("提交时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date submissionTime;
|
private Date submissionTime;
|
||||||
|
|
||||||
@ApiModelProperty("提交人")
|
@ApiModelProperty("提交人")
|
||||||
@@ -45,4 +48,16 @@ public class OpeningOperationPlanVO {
|
|||||||
|
|
||||||
@ApiModelProperty("审核结果,0待审核,1通过,2拒绝")
|
@ApiModelProperty("审核结果,0待审核,1通过,2拒绝")
|
||||||
private Integer resultType;
|
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");
|
log.error(" getPlanByShopId shopId is null");
|
||||||
throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL);
|
throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL);
|
||||||
}
|
}
|
||||||
OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO();
|
|
||||||
OpeningOperationPlanDO openingOperationPlanDO = openingOperationPlanDAO.selectByShopId(shopId);
|
OpeningOperationPlanDO openingOperationPlanDO = openingOperationPlanDAO.selectByShopId(shopId);
|
||||||
try {
|
|
||||||
if (openingOperationPlanDO != null) {
|
if (openingOperationPlanDO != null) {
|
||||||
|
OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO(openingOperationPlanDO);
|
||||||
String preparationUserIds = openingOperationPlanDO.getPreparationUserIds();
|
String preparationUserIds = openingOperationPlanDO.getPreparationUserIds();
|
||||||
List<String> stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList());
|
List<String> stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList());
|
||||||
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(stream);
|
List<UserNameDTO> nameByUserId = enterpriseUserDAO.getNameByUserId(stream);
|
||||||
BeanUtils.copyProperties(openingOperationPlanDO, openingOperationPlanVO);
|
|
||||||
openingOperationPlanVO.setPreparationUsers(nameByUserId);
|
openingOperationPlanVO.setPreparationUsers(nameByUserId);
|
||||||
return openingOperationPlanVO;
|
return openingOperationPlanVO;
|
||||||
}
|
}
|
||||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return openingOperationPlanVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
|
public List<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
|
||||||
@@ -163,9 +158,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
|||||||
log.info("getPlanListPage shopIdlist:{}", JSONObject.toJSONString(shopIdlist));
|
log.info("getPlanListPage shopIdlist:{}", JSONObject.toJSONString(shopIdlist));
|
||||||
//根据ShopName等查询门店名字1,门店代码1,开店负责人id1,督导id1,大区名称,战区名称,线索id
|
//根据ShopName等查询门店名字1,门店代码1,开店负责人id1,督导id1,大区名称,战区名称,线索id
|
||||||
List<OpenPlanShopInfoDTO> openPlanShopList = shopInfoDAO.
|
List<OpenPlanShopInfoDTO> openPlanShopList = shopInfoDAO.
|
||||||
getOpenPlanShopListByShopName(shopIdlist, request.getShopName(), request.getBigName(),
|
getOpenPlanShopListByShopName(shopIdlist, request.getShopName(), request.getRegionId());
|
||||||
request.getFightName()
|
|
||||||
);
|
|
||||||
log.info("getPlanListPage openPlanShopList:{}", JSONObject.toJSONString(openPlanShopList));
|
log.info("getPlanListPage openPlanShopList:{}", JSONObject.toJSONString(openPlanShopList));
|
||||||
Map<Long, OpenPlanShopInfoDTO> shopInfoMap = openPlanShopList.stream()
|
Map<Long, OpenPlanShopInfoDTO> shopInfoMap = openPlanShopList.stream()
|
||||||
.collect(Collectors.toMap(OpenPlanShopInfoDTO::getShopId, vo -> vo));
|
.collect(Collectors.toMap(OpenPlanShopInfoDTO::getShopId, vo -> vo));
|
||||||
|
|||||||
@@ -40,17 +40,9 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class OpenPreparationController {
|
public class OpenPreparationController {
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CoolStoreStartFlowService coolStoreStartFlowService;
|
|
||||||
@Resource
|
|
||||||
private ShopStageInfoDAO shopStageInfoDAO;
|
|
||||||
@Resource
|
@Resource
|
||||||
private FirstOrderService firstOrderService;
|
private FirstOrderService firstOrderService;
|
||||||
@Resource
|
@Resource
|
||||||
private ShopService shopService;
|
|
||||||
@Resource
|
|
||||||
private PreparationService preparationService;
|
|
||||||
@Resource
|
|
||||||
private OpeningOperationPlanService openingOperationPlanService;
|
private OpeningOperationPlanService openingOperationPlanService;
|
||||||
@Resource
|
@Resource
|
||||||
private AuditOpeningOperationPlanService auditOpeningOperationPlanService;
|
private AuditOpeningOperationPlanService auditOpeningOperationPlanService;
|
||||||
|
|||||||
Reference in New Issue
Block a user