feat:签约合同优化 + 数据处理
This commit is contained in:
@@ -272,4 +272,16 @@ public class ShopInfoDAO {
|
||||
public List<ShopInfoDO> getListByTime(){
|
||||
return shopInfoMapper.getListByTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/5/8
|
||||
* @description: 数据处理专用 处理shop 省市区
|
||||
*/
|
||||
public Integer updateShopCity(List<ShopInfoDO> list){
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return 0;
|
||||
}
|
||||
return shopInfoMapper.updateShopCity(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,4 +139,6 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
||||
|
||||
List<ShopInfoDO> getListByTime();
|
||||
|
||||
Integer updateShopCity(@Param("list") List<ShopInfoDO> list);
|
||||
|
||||
}
|
||||
|
||||
@@ -498,4 +498,9 @@
|
||||
<update id="updateShopCode">
|
||||
update xfsg_shop_info set shop_code = #{shopCode} where id = #{shopId}
|
||||
</update>
|
||||
<update id="updateShopCity">
|
||||
<foreach collection="list" item="item" index="index" separator=";">
|
||||
update xfsg_shop_info set province =#{item.province}, city = #{item.city}, district=#{item.district} where id = #{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -111,4 +111,6 @@ public interface ShopService {
|
||||
ShopResponse getShopNameAndCode(Long shopId,Long lineId);
|
||||
|
||||
String getFranchiseBrandName(Long shopId);
|
||||
//处理shop表省市区
|
||||
Integer dateHandler(Integer pageNum, Integer pageSize);
|
||||
}
|
||||
|
||||
@@ -644,5 +644,29 @@ public class ShopServiceImpl implements ShopService {
|
||||
return FranchiseBrandEnum.getDescByCode(shopInfo.getFranchiseBrand());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer dateHandler(Integer pageNum, Integer pageSize) {
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<ShopStageInfoDO> shopIdListByStageStatus = shopStageInfoDAO.getShopIdListByStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_84.getShopSubStageStatus());
|
||||
List<Long> shopIds = shopIdListByStageStatus.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
|
||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByIds(shopIds);
|
||||
List<Long> pointIdList = shopList.stream().filter(o -> o.getPointId() != null).map(ShopInfoDO::getPointId).collect(Collectors.toList());
|
||||
List<PointInfoDO> pointListByIds = pointInfoDAO.getPointListByIds(pointIdList);
|
||||
Map<Long, PointInfoDO> pointInfoDOMap = pointListByIds.stream().collect(Collectors.toMap(PointInfoDO::getId, Function.identity()));
|
||||
for (ShopInfoDO shopInfoDO : shopList) {
|
||||
if (shopInfoDO.getPointId() == null ){
|
||||
continue;
|
||||
}
|
||||
PointInfoDO pointInfoDO = pointInfoDOMap.get(shopInfoDO.getPointId());
|
||||
if (pointInfoDO == null ){
|
||||
continue;
|
||||
}
|
||||
shopInfoDO.setProvince(pointInfoDO.getProvince());
|
||||
shopInfoDO.setCity(pointInfoDO.getCity());
|
||||
shopInfoDO.setDistrict(pointInfoDO.getDistrict());
|
||||
}
|
||||
return shopInfoDAO.updateShopCity(shopList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -208,16 +208,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
}
|
||||
//修改shop & point
|
||||
updateShopAndPoint(request, shopInfoDO, pointInfoById);
|
||||
OrderSysInfoDO orderSysInfoDO = orderSysInfoDAO.selectByShopId(request.getShopId());
|
||||
if (Objects.isNull(orderSysInfoDO)){
|
||||
orderSysInfoDO = new OrderSysInfoDO();
|
||||
orderSysInfoDO.setShopId(request.getShopId());
|
||||
orderSysInfoDAO.insertSelective(orderSysInfoDO);
|
||||
}else{
|
||||
//同步建店资料地址
|
||||
orderSysInfoDO.setAddresseeAddress(request.getDetailAddress());
|
||||
orderSysInfoDAO.updateAddresseeAddress(orderSysInfoDO);
|
||||
}
|
||||
|
||||
return new ResponseResult(200000, "提交成功");
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
|
||||
@@ -254,7 +245,7 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
SignFranchiseDO signFranchiseDO = request.toSignFranchiseDO();
|
||||
//修改信息
|
||||
signFranchiseMapper.updateByPrimaryKeySelective(signFranchiseDO);
|
||||
// //修改shop & point
|
||||
// //修改shop & point & 同步建店资料地址
|
||||
updateShopAndPoint(request, shopInfoDO, pointInfoById);
|
||||
//修改阶段状态
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_83);
|
||||
@@ -301,6 +292,19 @@ public class SignFranchiseServiceImpl implements SignFranchiseService, AuditResu
|
||||
pointInfoById.setAddress(request.getDetailAddress());
|
||||
pointInfoById.setUpdateTime(new Date());
|
||||
pointInfoDAO.updatePointInfo(pointInfoById);
|
||||
OrderSysInfoDO orderSysInfoDO = orderSysInfoDAO.selectByShopId(request.getShopId());
|
||||
if (Objects.isNull(orderSysInfoDO)){
|
||||
orderSysInfoDO = new OrderSysInfoDO();
|
||||
orderSysInfoDO.setShopId(request.getShopId());
|
||||
orderSysInfoDAO.insertSelective(orderSysInfoDO);
|
||||
}else{
|
||||
//同步建店资料地址
|
||||
orderSysInfoDO.setAddresseeAddress(request.getDetailAddress());
|
||||
orderSysInfoDO.setAddresseeCity(request.getCity());
|
||||
orderSysInfoDO.setAddresseeDistrict(request.getDistrict());
|
||||
orderSysInfoDO.setAddresseeProvince(request.getProvince());
|
||||
orderSysInfoDAO.updateAddresseeAddress(orderSysInfoDO);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public AddSignFranchiseResponse getSignFranchise(Long shopId) {
|
||||
|
||||
@@ -129,4 +129,10 @@ public class PCShopController {
|
||||
public ResponseResult<Boolean> updateShopStatue(@RequestParam("shopId")Long shopId) {
|
||||
return ResponseResult.success(shopService.updateShopStatue(shopId));
|
||||
}
|
||||
|
||||
@ApiOperation("数据处理专用 处理shop 省市区")
|
||||
@GetMapping("/dateHandler")
|
||||
public ResponseResult<Integer> dateHandler(@RequestParam("pageSize")Integer pageSize,@RequestParam("pageNum")Integer pageNum) {
|
||||
return ResponseResult.success(shopService.dateHandler(pageNum,pageSize));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user