Commit 2a37793b by zhangxingmin

push

parent 8552fd00
......@@ -471,6 +471,7 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
// 按 brokerBizId 分组,收集月份(去重)
Map<String, Set<String>> brokerMonthMap = new LinkedHashMap<>();
Map<String, String> brokerNameMap = new HashMap<>();
Set<String> bizIdSet = new HashSet<>();
DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("yyyyMM");
for (FortuneAccount account : accountList) {
......@@ -488,11 +489,22 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
// 存储转介人名称(首次出现)
brokerNameMap.putIfAbsent(bizId, brokerName);
bizIdSet.add(bizId);
// 收集月份(自动去重)
brokerMonthMap.computeIfAbsent(bizId, k -> new LinkedHashSet<>()).add(month);
}
//获取转介人详细详细列表
List<String> bizIdList = bizIdSet.stream().collect(Collectors.toList());
ApiUserSaleExpandListRequest request = new ApiUserSaleExpandListRequest();
request.setClientUserBizIdList(bizIdList);
Result<List<ApiUserSaleExpandDetailResponse>> result = apiUserSaleExpandFeignClient.list(request);
Map<String, ApiUserSaleExpandDetailResponse> policyFollowMap = null;
if (CollectionUtils.isNotEmpty(result.getData())) {
policyFollowMap = result.getData().stream()
.collect(Collectors.toMap(ApiUserSaleExpandDetailResponse::getClientUserBizId, Function.identity()));
}
// 组装响应对象
List<ApiSalaryBrokerListResponse> resultList = new ArrayList<>();
for (Map.Entry<String, Set<String>> entry : brokerMonthMap.entrySet()) {
......@@ -500,6 +512,13 @@ public class ApiSalaryServiceImpl implements ApiSalaryService {
Set<String> monthSet = entry.getValue();
ApiSalaryBrokerListResponse response = new ApiSalaryBrokerListResponse();
if (policyFollowMap != null) {
ApiUserSaleExpandDetailResponse detailResponse = policyFollowMap.get(bizId);
if (detailResponse != null) {
//内部编号
response.setInternalNumber(detailResponse.getInternalNumber());
}
}
response.setBrokerBizId(bizId);
response.setBroker(brokerNameMap.getOrDefault(bizId, ""));
// 月份列表按时间升序排序
......
......@@ -15,4 +15,9 @@ public class ApiSalaryPageRequest extends PageDto {
* 薪资月份(同出账月,如:202605)
*/
private String month;
/**
* 薪资单状态:1-待提交 2-待核对 3-已核对 4-退回 5-已推送 6-已取消
*/
private String status;
}
......@@ -17,6 +17,11 @@ public class ApiSalaryBrokerListResponse {
private String brokerBizId;
/**
* 内部编号
*/
private String internalNumber;
/**
* 月份列表(格式: 202606)
*/
private List<String> monthList;
......
package com.yd.csf.feign.response.salary;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
......@@ -65,5 +66,6 @@ public class ApiSalaryPageResponse {
/**
* 制作时间(创建时间)
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime createTime;
}
......@@ -9,6 +9,11 @@ import java.time.LocalDateTime;
public class ApiSalaryPushPageResponse {
/**
* 薪资单表唯一业务ID
*/
private String salaryBizId;
/**
* 转介人名称
*/
private String brokerName;
......
package com.yd.csf.service.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
......@@ -148,7 +146,7 @@ public class Salary implements Serializable {
/**
* 创建人名称
*/
@TableField("creator_name")
@TableField(value = "creator_name", fill = FieldFill.INSERT)
private String creatorName;
/**
......
......@@ -25,6 +25,9 @@
<if test="request.month != null and request.month != ''">
AND s.month = #{request.month}
</if>
<if test="request.status != null and request.status != ''">
AND s.status = #{request.status}
</if>
AND s.is_deleted = 0
</where>
GROUP BY s.salary_biz_id
......@@ -33,6 +36,7 @@
<select id="pushPage" resultType="com.yd.csf.feign.response.salary.ApiSalaryPushPageResponse">
select
s.salary_biz_id,
s.broker_name,
s.month,
s.paid_amount,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment