This commit is contained in:
zhangchenbiao
2024-04-26 14:04:52 +08:00
parent 425474d5c5
commit b83c6633d6
5 changed files with 61 additions and 8 deletions

View File

@@ -16,7 +16,8 @@ public enum ShopSubStageStatusEnum {
//选址 //选址
SHOP_SUB_STAGE_STATUS_10(ShopSubStageEnum.SHOP_STAGE_1, 100, "待选址", Boolean.FALSE), SHOP_SUB_STAGE_STATUS_10(ShopSubStageEnum.SHOP_STAGE_1, 100, "待选址", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_11(ShopSubStageEnum.SHOP_STAGE_1, 110, "已选址", Boolean.TRUE), SHOP_SUB_STAGE_STATUS_11(ShopSubStageEnum.SHOP_STAGE_1, 110, "待审核", Boolean.FALSE),
SHOP_SUB_STAGE_STATUS_12(ShopSubStageEnum.SHOP_STAGE_1, 120, "已选址", Boolean.TRUE),
//上传租赁合同 //上传租赁合同
SHOP_SUB_STAGE_STATUS_20(ShopSubStageEnum.SHOP_STAGE_2, 200, "待上传", Boolean.FALSE), SHOP_SUB_STAGE_STATUS_20(ShopSubStageEnum.SHOP_STAGE_2, 200, "待上传", Boolean.FALSE),

View File

@@ -113,6 +113,32 @@ public class ShopStageInfoDAO {
return shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark); return shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark);
} }
/**
* 批量更新店铺状态
* @param shopId
* @param subStageStatusList
* @return
*/
public Integer batchUpdateShopStageStatus(Long shopId, List<ShopSubStageStatusEnum> subStageStatusList) {
if(Objects.isNull(shopId) || CollectionUtils.isEmpty(subStageStatusList)){
return CommonConstants.ZERO;
}
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) {
String remark = subStageStatus.getShopSubStageName() + CommonConstants.PATH_BAR + subStageStatus.getShopSubStageStatusName();
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
shopStageInfo.setShopId(shopId);
shopStageInfo.setShopSubStage(subStageStatus.getShopSubStageEnum().getShopSubStage());
shopStageInfo.setShopSubStageStatus(subStageStatus.getShopSubStageStatus());
shopStageInfo.setRemark(remark);
shopStageInfo.setIsTerminated(subStageStatus.isTerminated());
shopStageList.add(shopStageInfo);
}
return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
}
/** /**
* 更新子阶段到未开始状态 * 更新子阶段到未开始状态
* @param shopId * @param shopId

View File

@@ -51,6 +51,14 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
Integer updateShopStageInfo(@Param("shopId") Long shopId, @Param("shopSubStage") Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus, Integer updateShopStageInfo(@Param("shopId") Long shopId, @Param("shopSubStage") Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus,
@Param("isTerminated")boolean isTerminated, @Param("remark") String remark); @Param("isTerminated")boolean isTerminated, @Param("remark") String remark);
/**
* 批量更新阶段及审核信息
* @param shopId
* @param updateList
* @return
*/
Integer batchUpdateShopStageStatus(@Param("shopId") Long shopId, @Param("updateList") List<ShopStageInfoDO> updateList);
/** /**
* 更新阶段及审核信息 * 更新阶段及审核信息
* @param shopId * @param shopId

View File

@@ -86,6 +86,21 @@
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage} shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
</update> </update>
<update id="batchUpdateShopStageStatus">
<foreach collection="updateList" separator=";" item="update">
update
xfsg_shop_stage_info
set
shop_sub_stage_status = #{update.shopSubStageStatus},
is_terminated = #{update.isTerminated},
remark = #{update.remark},
actual_complete_time = if(is_terminated, now(), null)
where
shop_id = #{shopId} and shop_sub_stage = #{update.shopSubStage}
</foreach>
</update>
<select id="getShopSubStageInfo" resultMap="BaseResultMap"> <select id="getShopSubStageInfo" resultMap="BaseResultMap">
select select
<include refid="allColumn"/> <include refid="allColumn"/>

View File

@@ -349,7 +349,7 @@ public class PointServiceImpl implements PointService {
//没有下一节点 审批通过 //没有下一节点 审批通过
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_5.getCode()); updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_5.getCode());
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){ if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
shopStageInfoDAO.updateShopStageInfo(pointInfo.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20); shopStageInfoDAO.batchUpdateShopStageStatus(pointInfo.getShopId(), Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_12, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20));
} }
} }
return pointInfoDAO.updatePointInfo(updatePoint); return pointInfoDAO.updatePointInfo(updatePoint);
@@ -407,7 +407,8 @@ public class PointServiceImpl implements PointService {
pointInfoUpdate.setId(pointId); pointInfoUpdate.setId(pointId);
pointInfoUpdate.setPointStatus(PointStatusEnum.POINT_STATUS_5.getCode()); pointInfoUpdate.setPointStatus(PointStatusEnum.POINT_STATUS_5.getCode());
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){ if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
shopStageInfoDAO.updateShopStageInfo(pointInfo.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20); shopStageInfoDAO.batchUpdateShopStageStatus(pointInfo.getShopId(), Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_12, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20));
} }
return pointInfoDAO.updatePointInfo(pointInfoUpdate); return pointInfoDAO.updatePointInfo(pointInfoUpdate);
} }
@@ -708,16 +709,20 @@ public class PointServiceImpl implements PointService {
updateShop.setShopName(pointInfo.getPointName()); updateShop.setShopName(pointInfo.getPointName());
updateShop.setPointId(pointId); updateShop.setPointId(pointId);
shopInfoDAO.updateShopInfo(updateShop); shopInfoDAO.updateShopInfo(updateShop);
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_11); ShopSubStageStatusEnum selectStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_11;
PointDetailInfoDO updateDetail = new PointDetailInfoDO(); PointDetailInfoDO updateDetail = new PointDetailInfoDO();
updateDetail.setPointId(pointId); updateDetail.setPointId(pointId);
updateDetail.setLineSign(request.getLineSign()); updateDetail.setLineSign(request.getLineSign());
updateDetail.setLineSignTime(new Date()); updateDetail.setLineSignTime(new Date());
pointDetailInfoDAO.updatePointDetailInfo(updateDetail); pointDetailInfoDAO.updatePointDetailInfo(updateDetail);
List<ShopSubStageStatusEnum> updateStatusList = new ArrayList<>();
//如果铺位是已审核 则进入上传租赁合同状态 //如果铺位是已审核 则进入上传租赁合同状态
if(PointStatusEnum.POINT_STATUS_5.getCode().equals(pointInfo.getPointStatus())){ if(PointStatusEnum.POINT_STATUS_5.getCode().equals(pointInfo.getPointStatus())){
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20); selectStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_12;
updateStatusList.add(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_20);
} }
updateStatusList.add(selectStatus);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, updateStatusList);
return pointRecommendDAO.updateStatusByPointIdAndLineId(pointId, lineId); return pointRecommendDAO.updateStatusByPointIdAndLineId(pointId, lineId);
} catch (ServiceException e) { } catch (ServiceException e) {
throw e; throw e;
@@ -816,7 +821,6 @@ public class PointServiceImpl implements PointService {
shopRentInfo.setId(rentContract.getId()); shopRentInfo.setId(rentContract.getId());
shopRentInfoDAO.updateRentContract(shopRentInfo); shopRentInfoDAO.updateRentContract(shopRentInfo);
} }
return shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21); return shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21);
} }
@@ -857,8 +861,7 @@ public class PointServiceImpl implements PointService {
updatePoint.setId(shopInfo.getPointId()); updatePoint.setId(shopInfo.getPointId());
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_6.getCode()); updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_6.getCode());
pointInfoDAO.updatePointInfo(updatePoint); pointInfoDAO.updatePointInfo(updatePoint);
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30); shopStageInfoDAO.batchUpdateShopStageStatus(shopId, Lists.newArrayList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40));
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40);
ShopInfoDO updateShop = new ShopInfoDO(); ShopInfoDO updateShop = new ShopInfoDO();
updateShop.setId(shopId); updateShop.setId(shopId);
updateShop.setShopStage(ShopStageEnum.SHOP_STAGE_2.getShopStage()); updateShop.setShopStage(ShopStageEnum.SHOP_STAGE_2.getShopStage());