新增待办
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.dao;
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import com.cool.store.entity.PointAuditRecordDO;
|
||||||
import com.cool.store.entity.PointInfoDO;
|
import com.cool.store.entity.PointInfoDO;
|
||||||
import com.cool.store.entity.PointTodoInfoDO;
|
import com.cool.store.entity.PointTodoInfoDO;
|
||||||
import com.cool.store.enums.NodeNoEnum;
|
import com.cool.store.enums.NodeNoEnum;
|
||||||
@@ -7,13 +8,18 @@ import com.cool.store.mapper.PointTodoInfoMapper;
|
|||||||
import com.cool.store.request.PointTodoPageRequest;
|
import com.cool.store.request.PointTodoPageRequest;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public class PointTodoInfoDAO {
|
public class PointTodoInfoDAO {
|
||||||
@@ -58,4 +64,12 @@ public class PointTodoInfoDAO {
|
|||||||
}
|
}
|
||||||
return pointTodoInfoMapper.getCurNodeNoByPoint(pointId);
|
return pointTodoInfoMapper.getCurNodeNoByPoint(pointId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<Long, Date> getPointSubmitTimeMap(List<Long> pointIds){
|
||||||
|
if(CollectionUtils.isEmpty(pointIds)){
|
||||||
|
return Maps.newHashMap();
|
||||||
|
}
|
||||||
|
List<PointAuditRecordDO> auditList = pointTodoInfoMapper.getPointSubmitAuditTime(pointIds);
|
||||||
|
return auditList.stream().collect(Collectors.toMap(k->k.getPointId(), v->v.getFinishTaskTime(), (oldDate, newDate) -> oldDate.compareTo(newDate) > 0 ? oldDate : newDate));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -116,4 +116,16 @@ public class ShopInfoDAO {
|
|||||||
}
|
}
|
||||||
return shopInfoMapper.unbindPoint(shopId);
|
return shopInfoMapper.unbindPoint(shopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量获取店铺信息
|
||||||
|
* @param shopIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<ShopInfoDO> getShopListByIds(List<Long> shopIds){
|
||||||
|
if(CollectionUtils.isNotEmpty(shopIds)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return shopInfoMapper.getShopListByIds(shopIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ import com.cool.store.constants.CommonConstants;
|
|||||||
import com.cool.store.entity.ShopRentInfoDO;
|
import com.cool.store.entity.ShopRentInfoDO;
|
||||||
import com.cool.store.mapper.ShopRentInfoMapper;
|
import com.cool.store.mapper.ShopRentInfoMapper;
|
||||||
import com.cool.store.vo.point.ShopRentInfoVO;
|
import com.cool.store.vo.point.ShopRentInfoVO;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
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.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -46,4 +48,11 @@ public class ShopRentInfoDAO {
|
|||||||
}
|
}
|
||||||
return shopRentInfoMapper.deleteRentContractByShopId(shopId);
|
return shopRentInfoMapper.deleteRentContractByShopId(shopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ShopRentInfoDO> getRentContractByShopIds(List<Long> shopIds) {
|
||||||
|
if(CollectionUtils.isEmpty(shopIds)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return shopRentInfoMapper.getRentContractByShopIds(shopIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import com.cool.store.enums.point.ShopStageEnum;
|
|||||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||||
import com.cool.store.mapper.ShopStageInfoMapper;
|
import com.cool.store.mapper.ShopStageInfoMapper;
|
||||||
|
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -123,4 +126,10 @@ public class ShopStageInfoDAO {
|
|||||||
return shopStageInfoMapper.updateShopStageAndAuditInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark, auditId);
|
return shopStageInfoMapper.updateShopStageAndAuditInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark, auditId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Page<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNum, Integer pageSize){
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
ShopSubStageStatusEnum shopSubStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21;
|
||||||
|
return shopStageInfoMapper.getRentContractToDoPage(userId, shopSubStageStatus.getShopSubStageEnum().getShopSubStage(), shopSubStageStatus.getShopSubStageStatus());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
|
import com.cool.store.entity.PointAuditRecordDO;
|
||||||
import com.cool.store.entity.PointInfoDO;
|
import com.cool.store.entity.PointInfoDO;
|
||||||
import com.cool.store.entity.PointTodoInfoDO;
|
import com.cool.store.entity.PointTodoInfoDO;
|
||||||
import com.cool.store.request.PointTodoPageRequest;
|
import com.cool.store.request.PointTodoPageRequest;
|
||||||
@@ -63,4 +64,11 @@ public interface PointTodoInfoMapper extends Mapper<PointTodoInfoDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer getCurNodeNoByPoint(@Param("pointId") Long pointId);
|
Integer getCurNodeNoByPoint(@Param("pointId") Long pointId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取提交时间
|
||||||
|
* @param pointIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PointAuditRecordDO> getPointSubmitAuditTime(@Param("pointIds") List<Long> pointIds);
|
||||||
}
|
}
|
||||||
@@ -53,4 +53,11 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer unbindPoint(@Param("shopId") Long shopId);
|
Integer unbindPoint(@Param("shopId") Long shopId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量获取铺位
|
||||||
|
* @param shopIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ShopInfoDO> getShopListByIds(@Param("shopIds")List<Long> shopIds);
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@ import com.cool.store.entity.ShopRentInfoDO;
|
|||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import tk.mybatis.mapper.common.Mapper;
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface ShopRentInfoMapper extends Mapper<ShopRentInfoDO> {
|
public interface ShopRentInfoMapper extends Mapper<ShopRentInfoDO> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,4 +21,12 @@ public interface ShopRentInfoMapper extends Mapper<ShopRentInfoDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer deleteRentContractByShopId(@Param("shopId") Long shopId);
|
Integer deleteRentContractByShopId(@Param("shopId") Long shopId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量获取租赁合同
|
||||||
|
* @param shopIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ShopRentInfoDO> getRentContractByShopIds(@Param("shopIds") List<Long> shopIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
import com.cool.store.entity.ShopStageInfoDO;
|
import com.cool.store.entity.ShopStageInfoDO;
|
||||||
|
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import tk.mybatis.mapper.common.Mapper;
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
@@ -63,4 +65,11 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer updateShopStageToNotStarted(@Param("shopId") Long shopId, @Param("shopSubStage") Integer shopSubStage);
|
Integer updateShopStageToNotStarted(@Param("shopId") Long shopId, @Param("shopSubStage") Integer shopSubStage);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取租赁合同待办列表
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<RentInfoToDoVO> getRentContractToDoPage(@Param("userId") String userId, @Param("shopSubStage")Integer shopSubStage, @Param("shopSubStageStatus") Integer shopSubStageStatus);
|
||||||
}
|
}
|
||||||
@@ -100,4 +100,15 @@
|
|||||||
select node_no from xfsg_point_todo_info where point_id = #{pointId} and status = 0 and deleted = 0 limit 1
|
select node_no from xfsg_point_todo_info where point_id = #{pointId} and status = 0 and deleted = 0 limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getPointSubmitAuditTime" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
point_id, receive_task_time, finish_task_time
|
||||||
|
from
|
||||||
|
xfsg_point_audit_record
|
||||||
|
where point_id in and node_no = 1
|
||||||
|
<foreach collection="pointIds" item="pointId" open="(" close=")" separator=",">
|
||||||
|
#{pointId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -64,4 +64,14 @@
|
|||||||
update xfsg_shop_info set point_id = null where id = #{shopId}
|
update xfsg_shop_info set point_id = null where id = #{shopId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getShopListByIds" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="allColumn"/>
|
||||||
|
from
|
||||||
|
xfsg_shop_info where id in
|
||||||
|
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
|
||||||
|
#{shopId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -44,4 +44,16 @@
|
|||||||
where shop_id = #{shopId}
|
where shop_id = #{shopId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getRentContractByShopIds" resultType="com.cool.store.entity.ShopRentInfoDO">
|
||||||
|
select
|
||||||
|
<include refid="allColumn"/>
|
||||||
|
from
|
||||||
|
xfsg_shop_rent_info
|
||||||
|
where
|
||||||
|
deleted = 0 and shop_id in
|
||||||
|
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
|
||||||
|
#{shopId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -87,5 +87,18 @@
|
|||||||
where
|
where
|
||||||
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
|
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getRentContractToDoPage" resultType="com.cool.store.vo.shop.RentInfoToDoVO">
|
||||||
|
select
|
||||||
|
b.id as lineId,
|
||||||
|
b.username as lineUsername,
|
||||||
|
b.mobile as lineMobile,
|
||||||
|
a.shop_id as shopId
|
||||||
|
from
|
||||||
|
xfsg_shop_stage_info a
|
||||||
|
inner join xfsg_line_info b on a.line_id = b.id
|
||||||
|
where
|
||||||
|
a.shop_sub_stage = #{shopSubStage} and a.shop_sub_stage_status = #{shopSubStageStatus} and a.deleted = 0 and b.deleted = 0 and b.investment_manager = #{userId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -3,8 +3,9 @@ package com.cool.store.request;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
@@ -19,4 +20,8 @@ public class AddShopRequest {
|
|||||||
@ApiModelProperty("线索id")
|
@ApiModelProperty("线索id")
|
||||||
private Long lineId;
|
private Long lineId;
|
||||||
|
|
||||||
|
@NotEmpty
|
||||||
|
@ApiModelProperty("店铺名称")
|
||||||
|
private List<String> shopNameList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.cool.store.vo.point;
|
||||||
|
|
||||||
|
import com.cool.store.entity.PointInfoDO;
|
||||||
|
import com.cool.store.enums.point.PointStatusEnum;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: PointToDoVO
|
||||||
|
* @Description:
|
||||||
|
* @date 2024-04-22 14:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PointToDoVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("铺位id")
|
||||||
|
private Long pointId;
|
||||||
|
|
||||||
|
@ApiModelProperty("铺位名称")
|
||||||
|
private String pointName;
|
||||||
|
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属大区")
|
||||||
|
private String regionNodeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("提交时间")
|
||||||
|
private Date submitTime;
|
||||||
|
|
||||||
|
public static List<PointToDoVO> convertVO(List<PointInfoDO> pointList, Map<Long, String> regionNameMap, Map<Long, Date> submitTimeMap) {
|
||||||
|
if(CollectionUtils.isEmpty(pointList)){
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
List<PointToDoVO> resultList = new ArrayList<>();
|
||||||
|
for (PointInfoDO pointInfo : pointList) {
|
||||||
|
PointToDoVO pointPageVO = new PointToDoVO();
|
||||||
|
pointPageVO.setPointId(pointInfo.getId());
|
||||||
|
pointPageVO.setPointName(pointInfo.getPointName());
|
||||||
|
pointPageVO.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId()));
|
||||||
|
pointPageVO.setAddress(pointInfo.getAddress());
|
||||||
|
pointPageVO.setSubmitTime(submitTimeMap.get(pointInfo.getId()));
|
||||||
|
resultList.add(pointPageVO);
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.cool.store.vo.shop;
|
||||||
|
|
||||||
|
import com.cool.store.entity.PointInfoDO;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: PointToDoVO
|
||||||
|
* @Description:
|
||||||
|
* @date 2024-04-22 14:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RentInfoToDoVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("线索id")
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("加盟商名称")
|
||||||
|
private String lineUsername;
|
||||||
|
|
||||||
|
@ApiModelProperty("电话号码")
|
||||||
|
private String lineMobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("铺位id")
|
||||||
|
private Long pointId;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺id")
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺名称")
|
||||||
|
private String pointName;
|
||||||
|
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属大区")
|
||||||
|
private String regionNodeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("提交时间")
|
||||||
|
private Date submitTime;
|
||||||
|
|
||||||
|
public static List<RentInfoToDoVO> convert(List<RentInfoToDoVO> list, Map<Long, Long> shopPointMap, Map<Long, PointInfoDO> pointMap, Map<Long, String> regionNameMap, Map<Long, Date> rentContractSubmitTimeMap){
|
||||||
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
List<RentInfoToDoVO> resultList = new ArrayList<>();
|
||||||
|
for (RentInfoToDoVO rent : list) {
|
||||||
|
Long pointId = shopPointMap.get(rent.getShopId());
|
||||||
|
rent.setPointId(pointId);
|
||||||
|
PointInfoDO pointInfo = pointMap.get(pointId);
|
||||||
|
if(Objects.nonNull(pointInfo)){
|
||||||
|
rent.setPointName(pointInfo.getPointName());
|
||||||
|
rent.setAddress(pointInfo.getAddress());
|
||||||
|
}
|
||||||
|
rent.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId()));
|
||||||
|
rent.setSubmitTime(rentContractSubmitTimeMap.get(rent.getShopId()));
|
||||||
|
resultList.add(rent);
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.cool.store.service;
|
|||||||
import com.cool.store.request.*;
|
import com.cool.store.request.*;
|
||||||
import com.cool.store.vo.LinePointBaseInfoVO;
|
import com.cool.store.vo.LinePointBaseInfoVO;
|
||||||
import com.cool.store.vo.point.*;
|
import com.cool.store.vo.point.*;
|
||||||
|
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -256,4 +257,23 @@ public interface PointService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer updateRentContract(UpdateRentContractRequest request);
|
Integer updateRentContract(UpdateRentContractRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取选址审批待办
|
||||||
|
* @param userId
|
||||||
|
* @param pageNumber
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<PointToDoVO> getSelectPointToDoPage(String userId, Integer pageNumber, Integer pageSize);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取租赁合同审批
|
||||||
|
* @param userId
|
||||||
|
* @param pageNumber
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNumber, Integer pageSize);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import com.cool.store.entity.LineInfoDO;
|
|||||||
import com.cool.store.request.AddShopRequest;
|
import com.cool.store.request.AddShopRequest;
|
||||||
import com.cool.store.request.DeleteShopRequest;
|
import com.cool.store.request.DeleteShopRequest;
|
||||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||||
|
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||||
import com.cool.store.vo.shop.StageShopCountVO;
|
import com.cool.store.vo.shop.StageShopCountVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -60,4 +62,6 @@ public interface ShopService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Long addShop(AddShopRequest request);
|
Long addShop(AddShopRequest request);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.cool.store.utils.poi.StringUtils;
|
|||||||
import com.cool.store.vo.AuditInfoVO;
|
import com.cool.store.vo.AuditInfoVO;
|
||||||
import com.cool.store.vo.LinePointBaseInfoVO;
|
import com.cool.store.vo.LinePointBaseInfoVO;
|
||||||
import com.cool.store.vo.point.*;
|
import com.cool.store.vo.point.*;
|
||||||
|
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@@ -32,6 +33,7 @@ import java.text.MessageFormat;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -545,11 +547,12 @@ public class PointServiceImpl implements PointService {
|
|||||||
if(CollectionUtils.isNotEmpty(recommendPointList)){
|
if(CollectionUtils.isNotEmpty(recommendPointList)){
|
||||||
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus()) ||
|
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_4.getCode().equals(o.getStatus())).collect(Collectors.toList());
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_4.getCode().equals(o.getStatus()))
|
||||||
|
.filter(o->request.getPointIds().contains(o.getPointId())).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(recommendList)){
|
if(CollectionUtils.isNotEmpty(recommendList)){
|
||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "铺位已推送,请勿重复推送");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "铺位已推送,请勿重复推送");
|
||||||
}
|
}
|
||||||
List<PointRecommendDO> selectedList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(o.getStatus())).collect(Collectors.toList());
|
List<PointRecommendDO> selectedList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(o.getStatus())).filter(o->request.getPointIds().contains(o.getPointId())).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(selectedList)){
|
if(CollectionUtils.isNotEmpty(selectedList)){
|
||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "铺位已选,请勿重复推送");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "铺位已选,请勿重复推送");
|
||||||
}
|
}
|
||||||
@@ -575,11 +578,12 @@ public class PointServiceImpl implements PointService {
|
|||||||
if(CollectionUtils.isNotEmpty(recommendPointList)){
|
if(CollectionUtils.isNotEmpty(recommendPointList)){
|
||||||
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
List<PointRecommendDO> recommendList = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_2.getCode().equals(o.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(o.getStatus()) ||
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_3.getCode().equals(o.getStatus()) ||
|
||||||
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_4.getCode().equals(o.getStatus())).collect(Collectors.toList());
|
PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_4.getCode().equals(o.getStatus()))
|
||||||
|
.filter(o->request.getLineIds().contains(o.getLineId())).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(recommendList)){
|
if(CollectionUtils.isNotEmpty(recommendList)){
|
||||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "推送失败,铺位已被选");
|
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "推送失败,铺位已被选");
|
||||||
}
|
}
|
||||||
List<Long> lineIds = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus())).map(PointRecommendDO::getLineId).collect(Collectors.toList());
|
List<Long> lineIds = recommendPointList.stream().filter(o -> PointRecommendStatusEnum.POINT_RECOMMEND_STATUS_1.getCode().equals(o.getStatus())).filter(o->request.getLineIds().contains(o.getLineId())).map(PointRecommendDO::getLineId).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isNotEmpty(lineIds)){
|
if(CollectionUtils.isNotEmpty(lineIds)){
|
||||||
lineIds.retainAll(request.getLineIds());
|
lineIds.retainAll(request.getLineIds());
|
||||||
if(CollectionUtils.isNotEmpty(lineIds)){
|
if(CollectionUtils.isNotEmpty(lineIds)){
|
||||||
@@ -787,10 +791,18 @@ public class PointServiceImpl implements PointService {
|
|||||||
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(pointId);
|
||||||
shopId = pointInfo.getShopId();
|
shopId = pointInfo.getShopId();
|
||||||
}
|
}
|
||||||
|
//是否存在租赁合同
|
||||||
|
ShopRentInfoDO rentContract = shopRentInfoDAO.getRentContractByShopId(shopId);
|
||||||
ShopRentInfoDO shopRentInfo = AddRentContractRequest.convertDO(request);
|
ShopRentInfoDO shopRentInfo = AddRentContractRequest.convertDO(request);
|
||||||
shopRentInfo.setShopId(shopId);
|
shopRentInfo.setShopId(shopId);
|
||||||
shopRentInfo.setPointId(pointId);
|
shopRentInfo.setPointId(pointId);
|
||||||
shopRentInfoDAO.addShopRentInfo(shopRentInfo);
|
if(Objects.isNull(rentContract)){
|
||||||
|
shopRentInfoDAO.addShopRentInfo(shopRentInfo);
|
||||||
|
}else{
|
||||||
|
shopRentInfo.setId(rentContract.getId());
|
||||||
|
shopRentInfoDAO.updateRentContract(shopRentInfo);
|
||||||
|
}
|
||||||
|
|
||||||
return shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21);
|
return shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -856,6 +868,49 @@ public class PointServiceImpl implements PointService {
|
|||||||
return shopRentInfoDAO.updateRentContract(shopRentInfo);
|
return shopRentInfoDAO.updateRentContract(shopRentInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<PointToDoVO> getSelectPointToDoPage(String userId, Integer pageNumber, Integer pageSize) {
|
||||||
|
PointTodoPageRequest request = new PointTodoPageRequest();
|
||||||
|
request.setDevelopmentManager(userId);
|
||||||
|
request.setPageNum(pageNumber);
|
||||||
|
request.setPageSize(pageSize);
|
||||||
|
Page<PointInfoDO> pointPage = pointTodoInfoDAO.getUserTodoList(request);
|
||||||
|
List<PointToDoVO> resultList = new ArrayList<>();
|
||||||
|
if(Objects.nonNull(pointPage) && CollectionUtils.isNotEmpty(pointPage.getResult())){
|
||||||
|
List<Long> regionIds = pointPage.stream().map(PointInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
|
List<Long> pointIds = pointPage.stream().map(PointInfoDO::getId).collect(Collectors.toList());
|
||||||
|
//获取提交时间
|
||||||
|
Map<Long, Date> submitTimeMap = pointTodoInfoDAO.getPointSubmitTimeMap(pointIds);
|
||||||
|
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||||
|
resultList = PointToDoVO.convertVO(pointPage.getResult(), regionNameMap, submitTimeMap);
|
||||||
|
}
|
||||||
|
PageInfo resultPage = new PageInfo(pointPage);
|
||||||
|
resultPage.setList(resultList);
|
||||||
|
return resultPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNumber, Integer pageSize) {
|
||||||
|
Page<RentInfoToDoVO> todoPage = shopStageInfoDAO.getRentContractToDoPage(userId, pageNumber, pageSize);
|
||||||
|
List<RentInfoToDoVO> resultList = null;
|
||||||
|
if(Objects.nonNull(todoPage) && CollectionUtils.isNotEmpty(todoPage.getResult())){
|
||||||
|
List<Long> shopIds = todoPage.getResult().stream().map(RentInfoToDoVO::getShopId).collect(Collectors.toList());
|
||||||
|
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByIds(shopIds);
|
||||||
|
Map<Long, Long> shopPointMap = shopList.stream().collect(Collectors.toMap(k->k.getId(), v->v.getPointId()));
|
||||||
|
List<Long> regionIds = shopList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
|
List<Long> pointIds = shopList.stream().map(ShopInfoDO::getPointId).collect(Collectors.toList());
|
||||||
|
List<PointInfoDO> pointList = pointInfoDAO.getPointListByIds(pointIds);
|
||||||
|
Map<Long, PointInfoDO> pointMap = ListUtils.emptyIfNull(pointList).stream().collect(Collectors.toMap(k->k.getId(), Function.identity()));
|
||||||
|
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||||
|
List<ShopRentInfoDO> rentContractList = shopRentInfoDAO.getRentContractByShopIds(shopIds);
|
||||||
|
Map<Long, Date> rentContractSubmitTimeMap = ListUtils.emptyIfNull(rentContractList).stream().collect(Collectors.toMap(k->k.getShopId(), v->v.getCreateTime()));
|
||||||
|
resultList = RentInfoToDoVO.convert(todoPage, shopPointMap, pointMap, regionNameMap, rentContractSubmitTimeMap);
|
||||||
|
}
|
||||||
|
PageInfo resultPage = new PageInfo(todoPage);
|
||||||
|
resultPage.setList(resultList);
|
||||||
|
return resultPage;
|
||||||
|
}
|
||||||
|
|
||||||
public List<AuditNodeDTO> dealAuditNode(AuditSettingVO auditSetting, Long regionId, String operateUserId, String developmentManager) {
|
public List<AuditNodeDTO> dealAuditNode(AuditSettingVO auditSetting, Long regionId, String operateUserId, String developmentManager) {
|
||||||
List<String> roleIds = new ArrayList<>();
|
List<String> roleIds = new ArrayList<>();
|
||||||
//审核人
|
//审核人
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ import com.cool.store.request.DeleteShopRequest;
|
|||||||
import com.cool.store.service.ShopService;
|
import com.cool.store.service.ShopService;
|
||||||
import com.cool.store.utils.NumberConverter;
|
import com.cool.store.utils.NumberConverter;
|
||||||
import com.cool.store.vo.shop.MiniShopPageVO;
|
import com.cool.store.vo.shop.MiniShopPageVO;
|
||||||
|
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||||
import com.cool.store.vo.shop.ShopStageInfoVO;
|
import com.cool.store.vo.shop.ShopStageInfoVO;
|
||||||
import com.cool.store.vo.shop.StageShopCountVO;
|
import com.cool.store.vo.shop.StageShopCountVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.cool.store.controller.webb;
|
||||||
|
|
||||||
|
import com.cool.store.context.CurrentUserHolder;
|
||||||
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.service.PointService;
|
||||||
|
import com.cool.store.vo.point.PointToDoVO;
|
||||||
|
import com.cool.store.vo.shop.RentInfoToDoVO;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangchenbiao
|
||||||
|
* @FileName: ToDoController
|
||||||
|
* @Description:
|
||||||
|
* @date 2024-04-22 14:29
|
||||||
|
*/
|
||||||
|
@Api(tags = "待办")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/todo")
|
||||||
|
public class ToDoController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PointService pointService;
|
||||||
|
|
||||||
|
@ApiOperation("获取铺位选址待办")
|
||||||
|
@GetMapping("/getSelectPointToDoPage")
|
||||||
|
public ResponseResult<PageInfo<PointToDoVO>> getSelectPointToDoPage(@RequestParam(value = "pageNumber",defaultValue = "1")Integer pageNumber,
|
||||||
|
@RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize){
|
||||||
|
String userId = CurrentUserHolder.getUserId();
|
||||||
|
return ResponseResult.success(pointService.getSelectPointToDoPage(userId, pageNumber, pageSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("上传租赁合同待办")
|
||||||
|
@PostMapping("/getRentContractToDoPage")
|
||||||
|
public ResponseResult<PageInfo<RentInfoToDoVO>> getRentContractToDoPage(@RequestParam(value = "pageNumber",defaultValue = "1")Integer pageNumber,
|
||||||
|
@RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize){
|
||||||
|
String userId = CurrentUserHolder.getUserId();
|
||||||
|
return ResponseResult.success(pointService.getRentContractToDoPage(userId, pageNumber, pageSize));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user