数据处理

This commit is contained in:
shuo.wang
2025-06-04 14:30:04 +08:00
parent a101a89c21
commit e14806db30
12 changed files with 134 additions and 1 deletions

View File

@@ -26,4 +26,11 @@ public class FranchiseFeeDAO {
} }
return franchiseFeeMapper.updateBill(list); return franchiseFeeMapper.updateBill(list);
} }
public Integer batchUpdateXgjCollectionStatus(List<Long> shopIds,Integer collectionStatus){
if (CollectionUtils.isEmpty(shopIds)|| collectionStatus==null){
return 0;
}
return franchiseFeeMapper.batchUpdateXgjCollectionStatus(shopIds,collectionStatus);
}
} }

View File

@@ -87,4 +87,14 @@ public class LinePayDAO {
public Integer deleteById(Long id,String userId) { public Integer deleteById(Long id,String userId) {
return linePayMapper.deleteById(id,userId); return linePayMapper.deleteById(id,userId);
} }
//数据处理专用0604查询加盟费阶段缴费信息
public List<LinePayDO> getDateHandler() {
return linePayMapper.getDateHandler();
}
//数据处理专用0604处理paytime paypic
public Integer dataUpdateLinePay(List<LinePayDO> linePayDOList) {
if (CollectionUtils.isEmpty(linePayDOList)){
return null;
}
}
} }

View File

@@ -466,4 +466,10 @@ public class ShopStageInfoDAO {
example.createCriteria().andIn("shopId",shopIds).andEqualTo("shopStage",shopStage); example.createCriteria().andIn("shopId",shopIds).andEqualTo("shopStage",shopStage);
return shopStageInfoMapper.selectByExample(example); return shopStageInfoMapper.selectByExample(example);
} }
//查询处于xx状态的数据
public List<ShopStageInfoDO> getShopStageInfoByShopSubStageStatus(Integer shopSubStageStatus) {
Example example = new Example(ShopStageInfoDO.class);
example.createCriteria().andEqualTo("shopSubStageStatus", shopSubStageStatus);
return shopStageInfoMapper.selectByExample(example);
}
} }

View File

@@ -24,4 +24,6 @@ public interface FranchiseFeeMapper extends Mapper<FranchiseFeeDO> {
* @description: 数据处理修改账单 * @description: 数据处理修改账单
*/ */
Integer updateBill(@Param("list") List<FranchiseFeeDO> list); Integer updateBill(@Param("list") List<FranchiseFeeDO> list);
Integer batchUpdateXgjCollectionStatus(@Param("shopIds")List<Long> shopId, @Param("collectionStatus")Integer collectionStatus);
} }

View File

@@ -60,4 +60,8 @@ public interface LinePayMapper {
List<LinePayDO>getFranchiseFeePayInfoByShopId(@Param("shopId") Long shopId); List<LinePayDO>getFranchiseFeePayInfoByShopId(@Param("shopId") Long shopId);
Integer deleteById(@Param("id") Long id,@Param("userId")String userId); Integer deleteById(@Param("id") Long id,@Param("userId")String userId);
//数据处理专用0604查询加盟费阶段缴费信息
List<LinePayDO> getDateHandler();
Integer dataUpdateLinePay(@Param("list") List<LinePayDO> linePayDOList);
} }

View File

@@ -32,6 +32,14 @@
where shop_id = #{item.shopId} where shop_id = #{item.shopId}
</foreach> </foreach>
</update> </update>
<update id="batchUpdateXgjCollectionStatus">
update xfsg_franchise_fee
set xgj_collection_status = #{collectionStatus}
where shop_id in
<foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
#{shopId}
</foreach>
</update>
<select id="selectByShopId" resultType="com.cool.store.entity.FranchiseFeeDO"> <select id="selectByShopId" resultType="com.cool.store.entity.FranchiseFeeDO">
select * select *

View File

@@ -390,7 +390,11 @@
<select id="getFranchiseFeePayInfoByShopId" resultType="com.cool.store.entity.LinePayDO"> <select id="getFranchiseFeePayInfoByShopId" resultType="com.cool.store.entity.LinePayDO">
select * from xfsg_line_pay where deleted = 0 and shop_id = #{shopId} and pay_business_type = 1 order by create_time desc select * from xfsg_line_pay where deleted = 0 and shop_id = #{shopId} and pay_business_type = 1 order by create_time desc
</select> </select>
<select id="getDateHandler" resultType="com.cool.store.entity.LinePayDO">
select * from xfsg_line_pay where deleted = 0 and pay_business_type = 1 and pay_pic is null and combined_field is not null
</select>
<update id="deleteById"> <update id="deleteById">
update xfsg_line_pay set deleted = 1 ,update_time = now(),update_user_id = #{userId} where id = #{id} update xfsg_line_pay set deleted = 1 ,update_time = now(),update_user_id = #{userId} where id = #{id}
</update> </update>
<update id="dataUpdateLinePay"></update>
</mapper> </mapper>

View File

@@ -61,7 +61,7 @@ public class FranchiseFeeDO {
private String discountReason; private String discountReason;
@Column(name = "xgj_collection_status") @Column(name = "xgj_collection_status")
@ApiModelProperty("新管家收款状态 1-部分缴款 2-已完成") @ApiModelProperty("新管家收款状态 0-待缴费 1-部分缴款 2-已完成")
private Integer xgjCollectionStatus; private Integer xgjCollectionStatus;
@Column(name = "xgj_remainder_payable_amount") @Column(name = "xgj_remainder_payable_amount")

View File

@@ -1,6 +1,7 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.BatchStatusRefreshDTO;
import com.cool.store.entity.ImportTaskDO; import com.cool.store.entity.ImportTaskDO;
import java.util.List; import java.util.List;
@@ -36,4 +37,16 @@ public interface DataHandlerServer {
//处理测量 设计 施工 验收 完成 //处理测量 设计 施工 验收 完成
Boolean dataHandlerV2025029(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user, Boolean dataHandlerV2025029(List<Map<String, Object>> dataMapList, String originalFilename, LoginUserInfo user,
ImportTaskDO task); ImportTaskDO task);
//处理加盟费阶段
Boolean franchiseFeeStageDateHandler();
//处理加盟费缴费信息历史数据
Boolean franchiseFeeDateHandler(Integer pageSize, Integer pageNum);
/**
* @Auther: wangshuo
* @Date: 2025/5/23
* @description:不是对外回调接口针对于已经在oa走完数据的我们手动调用接口批量修改数据只做云流水别的别用
*/
Boolean batchStatusRefreshYls(BatchStatusRefreshDTO batchStatusRefreshDTO);
} }

View File

@@ -1,5 +1,6 @@
package com.cool.store.service.impl; package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants; import com.cool.store.constants.CommonConstants;
import com.cool.store.context.LoginUserInfo; import com.cool.store.context.LoginUserInfo;
@@ -14,13 +15,16 @@ import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.*; import com.cool.store.mapper.*;
import com.cool.store.service.DataHandlerServer; import com.cool.store.service.DataHandlerServer;
import com.cool.store.service.FranchiseFeeService; import com.cool.store.service.FranchiseFeeService;
import com.cool.store.service.OpenApiService;
import com.cool.store.service.PreparationService; import com.cool.store.service.PreparationService;
import com.cool.store.utils.StringUtil; import com.cool.store.utils.StringUtil;
import com.cool.store.utils.easyExcel.EasyExcelUtil; import com.cool.store.utils.easyExcel.EasyExcelUtil;
import com.cool.store.utils.poi.DateUtils; import com.cool.store.utils.poi.DateUtils;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -43,6 +47,10 @@ import static com.cool.store.utils.poi.DateUtils.YYYY_MM_DD;
@Service @Service
@Slf4j @Slf4j
public class DataHandlerServerImpl implements DataHandlerServer { public class DataHandlerServerImpl implements DataHandlerServer {
@Resource
private OpenApiService openApiService;
@Resource
private LinePayDAO linePayDAO;
@Resource @Resource
private AcceptanceInfoDAO acceptanceInfoDAO; private AcceptanceInfoDAO acceptanceInfoDAO;
@Resource @Resource
@@ -1043,6 +1051,62 @@ public class DataHandlerServerImpl implements DataHandlerServer {
return null; return null;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean franchiseFeeStageDateHandler() {
//处理加盟费阶段待审核(对账中)
List<ShopStageInfoDO> waitAuditStageList = shopStageInfoDAO.getShopStageInfoByShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus());
log.info("waitAuditStageList:{}", JSONObject.toJSONString(waitAuditStageList));
List<Long> waitAuditShopIdList = waitAuditStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
shopStageInfoDAO.dataUpdateStatus(waitAuditShopIdList,ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73);
franchiseFeeDAO.batchUpdateXgjCollectionStatus(waitAuditShopIdList,XGJCollectionStatusEnum.COMPLETED.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());
//待加盟商缴费阶段
List<ShopStageInfoDO> waitPayStageList = shopStageInfoDAO.getShopStageInfoByShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71.getShopSubStageStatus());
List<Long> waitPayShopIds = waitPayStageList.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
franchiseFeeDAO.batchUpdateXgjCollectionStatus(waitPayShopIds,XGJCollectionStatusEnum.WAIT_PAY.getCode());
return true;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean franchiseFeeDateHandler(Integer pageSize, Integer pageNum) {
PageHelper.startPage(pageNum, pageSize);
List<LinePayDO> dateHandler = linePayDAO.getDateHandler();
for (LinePayDO linePayDO : dateHandler){
JSONArray jsonArray = JSONObject.parseArray(linePayDO.getCombinedField());
JSONObject jsonObject = jsonArray.getJSONObject(0);
linePayDO.setPayTime(jsonObject.getDate("payTime"));
linePayDO.setPayPic(jsonObject.getString("payPic"));
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean batchStatusRefreshYls(BatchStatusRefreshDTO batchStatusRefreshDTO) {
if (CollectionUtils.isEmpty(batchStatusRefreshDTO.getShopCode())){
log.info("数据处理 门店编码为空");
return null;
}
for (String shopCode : batchStatusRefreshDTO.getShopCode()){
StatusRefreshDTO statusRefreshDTO = new StatusRefreshDTO();
statusRefreshDTO.setShopCode(shopCode);
statusRefreshDTO.setSystemSource(batchStatusRefreshDTO.getSystemSource());
statusRefreshDTO.setOpenStatus(batchStatusRefreshDTO.getOpenStatus());
openApiService.statusRefresh(statusRefreshDTO);
}
List<String> shopCodeList = new ArrayList<>();
for (String shopCode : batchStatusRefreshDTO.getShopCode()){
shopCodeList.add(StringUtils.substringAfter(shopCode, "_"));
}
posAndOrderInfoDAO.batchUpdateYlsRemarkByShopCode(shopCodeList,batchStatusRefreshDTO.getRemark());
return true;
}
private static @NotNull ShopStageInfoDO getShopStageInfoDO(ShopSubStageEnum shopSubStageEnum, ShopStageInfoDO shopStageInfoDO, ShopSubStageStatusEnum shopSubStageStatus) { private static @NotNull ShopStageInfoDO getShopStageInfoDO(ShopSubStageEnum shopSubStageEnum, ShopStageInfoDO shopStageInfoDO, ShopSubStageStatusEnum shopSubStageStatus) {
ShopStageEnum shopStageEnum = shopSubStageEnum.getShopStageEnum(); ShopStageEnum shopStageEnum = shopSubStageEnum.getShopStageEnum();
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO(); ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();

View File

@@ -76,6 +76,7 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
if (Objects.nonNull(isExist)){ if (Objects.nonNull(isExist)){
throw new ServiceException(ErrorCodeEnum.UNISSUED_STATEMENT_2); throw new ServiceException(ErrorCodeEnum.UNISSUED_STATEMENT_2);
} }
franchiseFeeDO.setXgjCollectionStatus(XGJCollectionStatusEnum.WAIT_PAY.getCode());
franchiseFeeMapper.insertSelective(franchiseFeeDO); franchiseFeeMapper.insertSelective(franchiseFeeDO);
} }
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId()); ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(request.getShopId());

View File

@@ -3,16 +3,19 @@ package com.cool.store.controller.webb;
import cn.hutool.poi.excel.ExcelReader; import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import com.cool.store.context.CurrentUserHolder; import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dto.BatchStatusRefreshDTO;
import com.cool.store.entity.ImportTaskDO; import com.cool.store.entity.ImportTaskDO;
import com.cool.store.enums.FileTypeEnum; import com.cool.store.enums.FileTypeEnum;
import com.cool.store.enums.ImportTaskStatusEnum; import com.cool.store.enums.ImportTaskStatusEnum;
import com.cool.store.mapper.ImportTaskMapper; import com.cool.store.mapper.ImportTaskMapper;
import com.cool.store.response.ResponseResult; import com.cool.store.response.ResponseResult;
import com.cool.store.response.bigdata.ApiResponse;
import com.cool.store.service.DataHandlerServer; import com.cool.store.service.DataHandlerServer;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -152,4 +155,15 @@ public class DataHandlerController {
dataHandlerServer.dataHandlerV2025029(dataMapList, file.getOriginalFilename(), CurrentUserHolder.getUser(), importTaskDO); dataHandlerServer.dataHandlerV2025029(dataMapList, file.getOriginalFilename(), CurrentUserHolder.getUser(), importTaskDO);
return ResponseResult.success(true); return ResponseResult.success(true);
} }
/**
* @Auther: wangshuo
* @Date: 2025/5/23
* @description:不是对外回调接口针对于已经在oa走完数据的我们手动调用接口批量修改数据只做云流水别的别用
*/
@ApiOperation("批量修改门店云流水开通状态")
@PostMapping("/batchStatusRefreshYls")
public ApiResponse<Boolean> batchStatusRefreshYls(@RequestBody @Validated BatchStatusRefreshDTO batchStatusRefreshDTO) {
return ApiResponse.success(dataHandlerServer.batchStatusRefreshYls(batchStatusRefreshDTO));
}
} }