Commit 7e4f26bd by jianan

出账检核-增加币种70

parent d0523a47
...@@ -1344,7 +1344,11 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService ...@@ -1344,7 +1344,11 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
queryWrapper.in(ObjectUtils.isNotEmpty(teamBizIdList), "team_biz_id", teamBizIdList); queryWrapper.in(ObjectUtils.isNotEmpty(teamBizIdList), "team_biz_id", teamBizIdList);
queryWrapper.in(ObjectUtils.isNotEmpty(insuranceCompanyBizIdList), "insurance_company_biz_id", insuranceCompanyBizIdList); queryWrapper.in(ObjectUtils.isNotEmpty(insuranceCompanyBizIdList), "insurance_company_biz_id", insuranceCompanyBizIdList);
queryWrapper.in(ObjectUtils.isNotEmpty(productLaunchBizIdList), "product_launch_biz_id", productLaunchBizIdList); queryWrapper.in(ObjectUtils.isNotEmpty(productLaunchBizIdList), "product_launch_biz_id", productLaunchBizIdList);
queryWrapper.in(ObjectUtils.isNotEmpty(brokerBizIdList), "broker_biz_id", brokerBizIdList); // 根据转介人(主)查询
if (!CollectionUtils.isEmpty(brokerBizIdList)) {
queryWrapper.apply("EXISTS (SELECT 1 FROM policy_follow f WHERE f.policy_no = expected_fortune.policy_no AND f.first_broker_biz_id in ({0}))",
brokerBizIdList);
}
queryWrapper.in(ObjectUtils.isNotEmpty(signerBizIdList), "signer_biz_id", signerBizIdList); queryWrapper.in(ObjectUtils.isNotEmpty(signerBizIdList), "signer_biz_id", signerBizIdList);
queryWrapper.eq(StringUtils.isNotBlank(fortuneBizType), "fortune_biz_type", fortuneBizType); queryWrapper.eq(StringUtils.isNotBlank(fortuneBizType), "fortune_biz_type", fortuneBizType);
......
...@@ -51,7 +51,7 @@ public class ApiExpectedFortunePageRequest extends PageDto { ...@@ -51,7 +51,7 @@ public class ApiExpectedFortunePageRequest extends PageDto {
@Schema(description = "产品计划业务ID列表") @Schema(description = "产品计划业务ID列表")
private List<String> productLaunchBizIdList; private List<String> productLaunchBizIdList;
@Schema(description = "转介人业务ID列表") @Schema(description = "转介人(主)业务ID列表")
private List<String> brokerBizIdList; private List<String> brokerBizIdList;
@Schema(description = "签单员业务ID列表") @Schema(description = "签单员业务ID列表")
......
...@@ -35,6 +35,16 @@ public class PolicyFollow implements Serializable { ...@@ -35,6 +35,16 @@ public class PolicyFollow implements Serializable {
private String policyNo; private String policyNo;
/** /**
* 转介人(主)
*/
private String firstBroker;
/**
* 转介人(主)业务ID
*/
private String firstBrokerBizId;
/**
* FNA 业务ID * FNA 业务ID
*/ */
private String fnaBizId; private String fnaBizId;
......
...@@ -1220,6 +1220,8 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -1220,6 +1220,8 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
// 更新 fortune 的字段, 已设置的不更新,记录更新成功及跳过的条数 // 更新 fortune 的字段, 已设置的不更新,记录更新成功及跳过的条数
int updateCount = 0; int updateCount = 0;
int skipCount = 0; int skipCount = 0;
List<Fortune> updateFortuneList = new ArrayList<>();
List<String> expectedFortuneBizIdList = new ArrayList<>();
for (Fortune fortune : fortuneList) { for (Fortune fortune : fortuneList) {
if (ObjectUtils.isEmpty(fortune.getActualPayoutDate())) { if (ObjectUtils.isEmpty(fortune.getActualPayoutDate())) {
updateCount++; updateCount++;
...@@ -1227,12 +1229,24 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune> ...@@ -1227,12 +1229,24 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
skipCount++; skipCount++;
continue; continue;
} }
this.lambdaUpdate()
.set(Fortune::getActualPayoutDate, actualPayoutDate) Fortune updateFortune = new Fortune();
.eq(Fortune::getId, fortune.getId()) updateFortune.setId(fortune.getId());
.update(); updateFortune.setActualPayoutDate(actualPayoutDate);
updateFortuneList.add(updateFortune);
expectedFortuneBizIdList.add(fortune.getExpectedFortuneBizId());
} }
// 更新 fortune 的字段
this.updateBatchById(updateFortuneList);
// 更新预计 fortune 的字段
expectedFortuneService.lambdaUpdate()
.set(ExpectedFortune::getActualPayoutDate, actualPayoutDate)
.in(ExpectedFortune::getExpectedFortuneBizId, expectedFortuneBizIdList)
.update();
return String.format("设置成功。已更新 %d 条数据,跳过 %d 条(已有实际出账年月)", updateCount, skipCount); return String.format("设置成功。已更新 %d 条数据,跳过 %d 条(已有实际出账年月)", updateCount, skipCount);
} }
......
...@@ -1081,7 +1081,19 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -1081,7 +1081,19 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
brokerList.add(policyBroker); brokerList.add(policyBroker);
} }
return policyBrokerService.saveBatch(brokerList); policyBrokerService.saveBatch(brokerList);
// brokerList 根据 id 升序
brokerList.sort(Comparator.comparing(PolicyBroker::getId));
// policyFollow 表更新 first_broker_biz_id 字段
policyFollowService.lambdaUpdate()
.eq(PolicyFollow::getPolicyBizId, policyBizId)
.set(PolicyFollow::getFirstBroker, brokerList.get(0).getBrokerName())
.set(PolicyFollow::getFirstBrokerBizId, brokerList.get(0).getBrokerBizId())
.update();
return true;
} }
@Override @Override
......
...@@ -79,11 +79,12 @@ ...@@ -79,11 +79,12 @@
then round(100 - (ifnull(sum(ef.paid_amount), 0) / ifnull(sum(ef.hkd_amount), 0) * 100), 2) then round(100 - (ifnull(sum(ef.paid_amount), 0) / ifnull(sum(ef.hkd_amount), 0) * 100), 2)
else 100 else 100
end as unpaidRatio, end as unpaidRatio,
MAX(ef.broker) as broker, pf.first_broker as broker,
MAX(ef.broker_biz_id) as brokerBizId, pf.first_broker_biz_id as brokerBizId,
DATE_ADD(DATE_ADD(MAX(p.effective_date), INTERVAL 2 MONTH), INTERVAL (ef.fortune_period - 1) YEAR) as payoutDate DATE_ADD(DATE_ADD(MAX(p.effective_date), INTERVAL 2 MONTH), INTERVAL (ef.fortune_period - 1) YEAR) as payoutDate
from expected_fortune ef from expected_fortune ef
left join policy p on ef.policy_no = p.policy_no left join policy p on ef.policy_no = p.policy_no
left join policy_follow pf on ef.policy_no = pf.policy_no
<where> <where>
ef.fortune_biz_type = 'R' ef.fortune_biz_type = 'R'
<if test="expectedFortuneIds != null and expectedFortuneIds.size > 0"> <if test="expectedFortuneIds != null and expectedFortuneIds.size > 0">
...@@ -122,8 +123,8 @@ ...@@ -122,8 +123,8 @@
then round(100 - (ifnull(ef.paid_amount, 0) / ifnull(ef.hkd_amount, 0) * 100), 2) then round(100 - (ifnull(ef.paid_amount, 0) / ifnull(ef.hkd_amount, 0) * 100), 2)
else 100 else 100
end as unpaidRatio, end as unpaidRatio,
ef.broker as broker, NULL as broker,
ef.broker_biz_id as brokerBizId, NULL as brokerBizId,
ef.payout_date as payoutDate ef.payout_date as payoutDate
from expected_fortune ef from expected_fortune ef
left join policy p on ef.policy_no = p.policy_no left join policy p on ef.policy_no = p.policy_no
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
<id property="id" column="id" /> <id property="id" column="id" />
<result property="policyBizId" column="policy_biz_id" /> <result property="policyBizId" column="policy_biz_id" />
<result property="policyNo" column="policy_no" /> <result property="policyNo" column="policy_no" />
<result property="firstBroker" column="first_broker" />
<result property="firstBrokerBizId" column="first_broker_biz_id" />
<result property="fnaBizId" column="fna_biz_id" /> <result property="fnaBizId" column="fna_biz_id" />
<result property="appointmentBizId" column="appointment_biz_id" /> <result property="appointmentBizId" column="appointment_biz_id" />
<result property="appointmentNo" column="appointment_no" /> <result property="appointmentNo" column="appointment_no" />
...@@ -88,7 +90,7 @@ ...@@ -88,7 +90,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,policy_biz_id,policy_no,fna_biz_id,appointment_biz_id,appointment_no,customer_biz_id, id,policy_biz_id,policy_no,first_broker,first_broker_biz_id,fna_biz_id,appointment_biz_id,appointment_no,customer_biz_id,
submit_date,customer_name,sign_date,signer,signer_biz_id, submit_date,customer_name,sign_date,signer,signer_biz_id,
practice_code,sign_location,issue_date,cooling_off_end_date,cooling_off_days, practice_code,sign_location,issue_date,cooling_off_end_date,cooling_off_days,
underwriting_date,effective_date,renewal_date,receipt_date,receipt_status, underwriting_date,effective_date,renewal_date,receipt_date,receipt_status,
......
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