优化数据处理接口

This commit is contained in:
shuo.wang
2025-06-09 13:26:28 +08:00
parent 06fc2affdc
commit 248d6c8367
8 changed files with 97 additions and 16 deletions

View File

@@ -8,7 +8,7 @@ package com.cool.store.enums;
*/
public enum ClaimStatusEnum {
TO_BE_CLAIMED(0,"待认领"),
Claimed(1,"已认领");
CLAIMED(1,"已认领");
private Integer code;
private String message;
ClaimStatusEnum(Integer code,String message){

View File

@@ -1,10 +1,12 @@
package com.cool.store.dao;
import com.cool.store.dto.FranchiseFeeStageDateDTO;
import com.cool.store.entity.FranchiseFeeDO;
import com.cool.store.mapper.FranchiseFeeMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.List;
@@ -33,4 +35,11 @@ public class FranchiseFeeDAO {
}
return franchiseFeeMapper.batchUpdateXgjCollectionStatus(shopIds,collectionStatus);
}
public Integer batchUpdateXgjCollectionStatusAndXgjFeesPaid( List<FranchiseFeeStageDateDTO> franchiseFeeStageDateDTOList){
if (CollectionUtils.isEmpty(franchiseFeeStageDateDTOList)){
return 0;
}
return franchiseFeeMapper.batchUpdateXgjCollectionStatusAndXgjFeesPaid(franchiseFeeStageDateDTOList);
}
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.mapper;
import com.cool.store.dto.FranchiseFeeDTO;
import com.cool.store.dto.FranchiseFeeStageDateDTO;
import com.cool.store.entity.FranchiseFeeDO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
@@ -26,4 +27,6 @@ public interface FranchiseFeeMapper extends Mapper<FranchiseFeeDO> {
Integer updateBill(@Param("list") List<FranchiseFeeDO> list);
Integer batchUpdateXgjCollectionStatus(@Param("shopIds")List<Long> shopId, @Param("collectionStatus")Integer collectionStatus);
Integer batchUpdateXgjCollectionStatusAndXgjFeesPaid( @Param("list") List<FranchiseFeeStageDateDTO> franchiseFeeStageDateDTOList);
}

View File

@@ -40,6 +40,14 @@
#{shopId}
</foreach>
</update>
<update id="batchUpdateXgjCollectionStatusAndXgjFeesPaid">
<foreach collection="list" separator=";" item="item">
update xfsg_franchise_fee
set xgj_collection_status = #{item.xgjCollectionStatus},
xgj_fees_paid = #{item.xgjFeesPaid}
where shop_id = #{item.shopId}
</foreach>
</update>
<select id="selectByShopId" resultType="com.cool.store.entity.FranchiseFeeDO">
select *

View File

@@ -0,0 +1,18 @@
package com.cool.store.dto;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Author: WangShuo
* @Date: 2025/06/09/11:02
* @Version 1.0
* @注释:
*/
@Data
public class FranchiseFeeStageDateDTO {
private Long shopId;
private Integer xgjCollectionStatus;
private BigDecimal xgjFeesPaid = BigDecimal.ZERO;
}

View File

@@ -23,25 +23,52 @@ public interface DataHandlerServer {
Boolean importOaOldShopData(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user,
ImportTaskDO task);
//数据处理阶段完成 某些阶段数据处理
Boolean dataStageHandler(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user, ImportTaskDO task,Boolean flag);
/**
* @Auther: wangshuo
* @Date: 2025/6/9
* @description: //数据处理阶段完成 某些阶段数据处理
*/
Boolean dataStageHandler(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user, ImportTaskDO task, Boolean flag);
//装修数据初始化
/**
* @Auther: wangshuo
* @Date: 2025/6/9
* @description: //装修数据初始化
*/
Boolean decorationDataInit();
//处理2024年10-12月数据
/**
* @Auther: wangshuo
* @Date: 2025/6/9
* @description: //处理2024年10-12月数据
*/
Boolean dataHandlerV20241012(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user,
ImportTaskDO task);
Integer JingDongStageHandler();
//处理测量 设计 施工 验收 完成
/**
* @Auther: wangshuo
* @Date: 2025/6/9
* //处理测量 设计 施工 验收 完成
*/
Boolean dataHandlerV2025029(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user,
ImportTaskDO task);
//处理加盟费阶段
/**
* @Auther: wangshuo
* @Date: 2025/6/9
* @description: //处理加盟费阶段
*/
Boolean franchiseFeeStageDateHandler();
//处理加盟费缴费信息历史数据
/**
* @Auther: wangshuo
* @Date: 2025/6/9
* @description:处理加盟费缴费信息历史数据
*/
Boolean franchiseFeeDateHandler(Integer pageSize, Integer pageNum);
/**
* @Auther: wangshuo
* @Date: 2025/5/23

View File

@@ -29,6 +29,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -1060,12 +1061,27 @@ public class DataHandlerServerImpl implements DataHandlerServer {
List<Long> waitAuditShopIdList = waitAuditStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
// shopStageInfoDAO.dataUpdateStatus(waitAuditShopIdList,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73);
franchiseFeeDAO.batchUpdateXgjCollectionStatus(waitAuditShopIdList, XGJCollectionStatusEnum.WAIT_PAY.getCode());
linePayDAO.updateXgjClaimStatus(waitAuditShopIdList, ClaimStatusEnum.TO_BE_CLAIMED.getCode(), PayBusinessTypeEnum.FRANCHISE_FEE.getCode());
// linePayDAO.updateXgjClaimStatus(waitAuditShopIdList, ClaimStatusEnum.TO_BE_CLAIMED.getCode(), PayBusinessTypeEnum.FRANCHISE_FEE.getCode());
//已缴费 修改新管家回调状态
List<ShopStageInfoDO> isPaidStageList = shopStageInfoDAO.getShopStageInfoByShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus());
List<Long> isPaidShopId = isPaidStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
franchiseFeeDAO.batchUpdateXgjCollectionStatus(isPaidShopId, XGJCollectionStatusEnum.COMPLETED.getCode());
linePayDAO.updateXgjClaimStatus(isPaidShopId, ClaimStatusEnum.Claimed.getCode(), PayBusinessTypeEnum.FRANCHISE_FEE.getCode());
List<FranchiseFeeDO> franchiseFeeByShopIds = franchiseFeeMapper.getFranchiseFeeByShopIds(isPaidShopId);
List<FranchiseFeeStageDateDTO> franchiseFeeStageDateDTOList = new ArrayList<>();
for (FranchiseFeeDO franchiseFeeDO : franchiseFeeByShopIds){
FranchiseFeeStageDateDTO dto = new FranchiseFeeStageDateDTO();
dto.setShopId(franchiseFeeDO.getShopId());
dto.setXgjCollectionStatus(XGJCollectionStatusEnum.COMPLETED.getCode());
dto.setXgjFeesPaid(dto.getXgjFeesPaid()
.add(new BigDecimal(franchiseFeeDO.getYearFranchiseFee()))
.add(new BigDecimal(franchiseFeeDO.getLoanMargin()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearManageFee()))
.add(new BigDecimal(franchiseFeeDO.getPerformanceBond()))
.add(new BigDecimal(franchiseFeeDO.getFirstYearFee()))
);
franchiseFeeStageDateDTOList.add(dto);
}
franchiseFeeDAO.batchUpdateXgjCollectionStatusAndXgjFeesPaid(franchiseFeeStageDateDTOList);
// linePayDAO.updateXgjClaimStatus(isPaidShopId, ClaimStatusEnum.CLAIMED.getCode(), PayBusinessTypeEnum.FRANCHISE_FEE.getCode());
//待加盟商缴费阶段
List<ShopStageInfoDO> waitPayStageList = shopStageInfoDAO.getShopStageInfoByShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus());
List<Long> waitPayShopIds = waitPayStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
@@ -1098,7 +1114,7 @@ public class DataHandlerServerImpl implements DataHandlerServer {
linePayDO.setPaymentReceiptCode(linePayService.getPaymentReceiptCode());
}
} else {
linePayDO.setXgjClaimStatus(ClaimStatusEnum.Claimed.getCode());
linePayDO.setXgjClaimStatus(ClaimStatusEnum.CLAIMED.getCode());
}
}
linePayDAO.dataUpdateLinePay(dateHandler);

View File

@@ -195,7 +195,7 @@ public class LinePayServiceImpl implements LinePayService {
if (linePayById == null) {
throw new ServiceException(ErrorCodeEnum.UPDATE_ERROR);
}
if (linePayById.getXgjClaimStatus().equals(ClaimStatusEnum.Claimed.getCode())) {
if (linePayById.getXgjClaimStatus().equals(ClaimStatusEnum.CLAIMED.getCode())) {
throw new ServiceException(ErrorCodeEnum.CLAIM_STATUS_ERROR);
}
}
@@ -291,7 +291,7 @@ public class LinePayServiceImpl implements LinePayService {
if (linePay == null) {
throw new ServiceException(ErrorCodeEnum.DELETE_ERROR);
}
if (linePay.getXgjClaimStatus().equals(ClaimStatusEnum.Claimed.getCode())) {
if (linePay.getXgjClaimStatus().equals(ClaimStatusEnum.CLAIMED.getCode())) {
throw new ServiceException(ErrorCodeEnum.CLAIM_STATUS_ERROR);
}
linePayDAO.deleteById(id, userId);