Commit 0a9d2c8a authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

Feature zhaji

See merge request fangxinjiang/yifu!240
parents 065e5ebd d5491491
......@@ -91,7 +91,10 @@ public interface CommonConstants {
*/
Integer SUCCESS = 200;
/**
* 商险导出最大值
*/
Integer TWENTY_THOUSAND = 20000;
/**
* 失败标记
......
......@@ -1066,6 +1066,17 @@ public class InsurancesConstants {
public static final String SYSTEM_TRIGGER = "系统触发";
/**
* 一次性导出不可超过20000条,请分批导出
*/
public static final String EXPORT_TOO_LONG = "一次性导出不可超过20000条,请分批导出";
/**
* 一次性导入不可超过20000条,请分批导入
*/
public static final String IMPORT_TOO_LONG = "一次性导入不可超过20000条,请分批导入";
......
......@@ -355,8 +355,8 @@ public class TInsuranceDetailController {
@Operation(summary = "已投保列表不分页查询", description = "已投保列表不分页查询")
@PostMapping("/getInsuredList")
@PreAuthorize("@pms.hasPermission('insurance_custserve_insured_export')")
public R<List<InsuredListVo>> getInsuredList(@RequestBody InsuredParam param) {
return R.ok(tInsuranceDetailService.getInsuredList(param),"查询成功");
public R getInsuredList(@RequestBody InsuredParam param) {
return tInsuranceDetailService.getInsuredList(param);
}
/**
......@@ -382,8 +382,8 @@ public class TInsuranceDetailController {
@Operation(summary = "已减员列表导出", description = "已减员列表导出")
@PostMapping("/getInsuranceRefundList")
@PreAuthorize("@pms.hasPermission('insurance_custserve_reduction_export')")
public R<List<InsuranceRefundListVo>> getInsuranceRefundList(@RequestBody InsuranceRefundParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundList(param));
public R getInsuranceRefundList(@RequestBody InsuranceRefundParam param) {
return tInsuranceDetailService.getInsuranceRefundList(param);
}
......@@ -410,7 +410,7 @@ public class TInsuranceDetailController {
@Operation(summary = "导出减员列表", description = "导出减员列表")
@PostMapping("/getInsuranceRefundHandlingList")
@PreAuthorize("@pms.hasPermission('handle_down_export')")
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(@RequestBody RefundExportListParam param) {
public R getInsuranceRefundHandlingList(@RequestBody RefundExportListParam param) {
return tInsuranceDetailService.getInsuranceRefundHandlingList(param);
}
......
......@@ -206,7 +206,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param param 查询参数
* @return {@link List< InsuredListVo>}
*/
List<InsuredListVo> getInsuredList(InsuredParam param);
R getInsuredList(InsuredParam param);
/**
* 已减员列表分页查询
......@@ -225,7 +225,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param param 查询参数
* @return {@link List< InsuranceRefundListVo >}
*/
List<InsuranceRefundListVo> getInsuranceRefundList(InsuranceRefundParam param);
R getInsuranceRefundList(InsuranceRefundParam param);
/**
* 减员办理列表分页查询
......
......@@ -3110,6 +3110,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(!Common.isNotEmpty(insuranceRefundCheckList)){
return R.failed("当前导入的减员信息为空");
}
if(insuranceRefundCheckList.size() > CommonConstants.TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
Map<String, List<InsuranceRefundCheck>> refundMap = checkInsuranceRefundList(insuranceRefundCheckList,user);
List<InsuranceRefundCheck> successList = refundMap.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>();
......@@ -3198,17 +3201,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link List< InsuredListVo>}
*/
@Override
public List<InsuredListVo> getInsuredList(InsuredParam param) {
public R getInsuredList(InsuredParam param) {
YifuUser user = SecurityUtils.getUser();
List<String> deptList = getDeptNoList(user);
List<InsuredListVo> insuredList = new ArrayList<>();
if (CollectionUtils.isEmpty(deptList)){
return insuredList;
return R.ok(insuredList);
}
param.setDeptNoList(deptList);
param.setDeptNoList(deptList);
insuredList = this.baseMapper.getInsuredList(param);
if (CollectionUtils.isNotEmpty(insuredList)){
if(insuredList.size() > CommonConstants.TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
//根据项目编码获取项目名称
List<String> collect = insuredList.stream().map(InsuredListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
......@@ -3224,7 +3230,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
return insuredList;
return R.ok(insuredList);
}
/**
......@@ -3271,16 +3277,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link List< InsuranceRefundListVo >}
*/
@Override
public List<InsuranceRefundListVo> getInsuranceRefundList(InsuranceRefundParam param) {
public R getInsuranceRefundList(InsuranceRefundParam param) {
YifuUser user = SecurityUtils.getUser();
List<String> deptNoList = getDeptNoList(user);
List<InsuranceRefundListVo> pageList = new ArrayList<>();
if(CollectionUtils.isEmpty(deptNoList)){
return pageList;
return R.ok(pageList);
}
param.setDeptNoList(deptNoList);
List<InsuranceRefundListVo> insuranceRefundList = this.baseMapper.getInsuranceRefundList(param);
if (CollectionUtils.isNotEmpty(insuranceRefundList)){
if(insuranceRefundList.size() > CommonConstants.TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
//根据项目编码获取项目名称
List<String> collect = insuranceRefundList.stream().map(InsuranceRefundListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
......@@ -3297,7 +3306,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
return insuranceRefundList;
return R.ok(insuranceRefundList);
}
/**
......@@ -3348,7 +3357,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){
public R getInsuranceRefundHandlingList(RefundExportListParam param){
YifuUser user = SecurityUtils.getUser();
List<RefundExportListVo> refundExportList;
String regionSQL = getRegionSQL(user);
......@@ -3360,6 +3369,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
refundExportList = baseMapper.getRefundExportList(param);
}
if (CollectionUtils.isNotEmpty(refundExportList)){
if(refundExportList.size() > CommonConstants.TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
List<TInsuranceDetail> detailList = new ArrayList<>();
List<TInsuranceRefund> refundList = new ArrayList<>();
//根据项目编码获取项目名称
......@@ -3502,9 +3514,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
public R insuranceRefundImport(List<InsuranceHandleImportParam> insuranceRefundImportList) {
YifuUser user = SecurityUtils.getUser();
if (!Common.isNotEmpty(insuranceRefundImportList)) {
if (CollectionUtils.isEmpty(insuranceRefundImportList)) {
return R.failed(InsurancesConstants.INSURANCE_REFUND_IMPORT_LIST_IS_EMPTY);
}
if(insuranceRefundImportList.size() > CommonConstants.TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
Map<String, List<InsuranceHandleImportParam>> map = insuranceChangeCheck(insuranceRefundImportList, user,true);
List<InsuranceHandleImportParam> successList = map.get("successList");
List<InsuranceHandleImportParam> errorList = map.get("errorList");
......@@ -3567,6 +3582,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (!Common.isNotEmpty(settleMonthCheckList)) {
return R.failed(InsurancesConstants.SETTLE_MONTH_CHANGE_LIST_IS_EMPTY);
}
if(settleMonthCheckList.size() > CommonConstants.TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList, user);
List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
......@@ -3651,6 +3669,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(!Common.isNotEmpty(deptChangeCheckList)){
return R.failed(InsurancesConstants.OPERATION_LIST_IS_EMPTY);
}
if(deptChangeCheckList.size() > CommonConstants.TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList,user);
List<DeptChangeCheckParam> successList = stringListMap.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>(16);
......
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