Commit 32bffff1 authored by 李灿灿's avatar 李灿灿

Merge branch 'feature-licancan' into 'develop'

订单、商险 导入导出数量20000校验

See merge request fangxinjiang/yifu!243
parents b65ae0a7 ca819135
......@@ -9,6 +9,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.Dept;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
......@@ -94,7 +95,7 @@ public class TInsuranceDetailController {
@PostMapping("/getInsuranceList")
@PreAuthorize("@pms.hasPermission('insurance_custserve_insure_export')")
public R<List<InsuranceListVO>> getInsuranceList(@RequestBody InsuranceListParam param) {
return R.ok(tInsuranceDetailService.getInsuranceList(param));
return tInsuranceDetailService.getInsuranceList(param);
}
/**
......@@ -255,6 +256,9 @@ public class TInsuranceDetailController {
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
if(param.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
return tInsuranceDetailService.insuranceHandleImport(user,param);
}
......
......@@ -54,9 +54,9 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*
* @author licancan
* @param param
* @return {@link List<InsuranceListVO>}
* @return {@link R<List<InsuranceListVO>>}
*/
List<InsuranceListVO> getInsuranceList(InsuranceListParam param);
R<List<InsuranceListVO>> getInsuranceList(InsuranceListParam param);
/**
* 投保办理分页查询
......
......@@ -208,16 +208,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* 投保不分页查询
*
* @param param
* @return {@link List<InsuranceListVO>}
* @return {@link R<List<InsuranceListVO>>}
* @author licancan
*/
@Override
public List<InsuranceListVO> getInsuranceList(InsuranceListParam param) {
public R<List<InsuranceListVO>> getInsuranceList(InsuranceListParam param) {
YifuUser user = SecurityUtils.getUser();
List<String> deptList = getDeptNoList(user);
List<InsuranceListVO> insuranceList = new ArrayList<>();
if (CollectionUtils.isEmpty(deptList)){
return insuranceList;
return R.ok(insuranceList);
}
param.setDeptNoList(deptList);
insuranceList = baseMapper.getInsuranceList(param);
......@@ -225,11 +225,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
setProjectNameByDeptNo(insuranceList);
// 购买月数
if (CollectionUtils.isNotEmpty(insuranceList)){
if(insuranceList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
insuranceList.stream().forEach(e ->{
e.setBuyMonth(LocalDateUtil.betweenMonth(e.getPolicyStart().toString(),e.getPolicyEnd().toString()));
});
}
return insuranceList;
return R.ok(insuranceList);
}
/**
* 投保办理分页查询
......@@ -277,6 +280,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
if(paramList.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
......@@ -327,6 +333,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
if(paramList.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
......@@ -375,6 +384,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
if(paramList.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
......@@ -880,6 +892,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceExportList = baseMapper.getInsuranceExportList(param);
}
if (CollectionUtils.isNotEmpty(insuranceExportList)){
if(insuranceExportList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}
List<TInsuranceDetail> detailList = new ArrayList<>();
//根据项目编码获取项目名称
List<String> collect = insuranceExportList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
......@@ -1372,6 +1387,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
if(paramList.size() > CommonConstants.IMPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.IMPORT_TOO_LONG);
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
......
......@@ -110,4 +110,8 @@ public class OrderConstants {
* 附件超出上传上限
*/
public static final String ENCLOSURE_SIZE_ERROR = "附件超出上传上限";
/**
* 一次性导出不可超过20000条,请分批导出
*/
public static final String EXPORT_TOO_LONG = "一次性导出不可超过20000条,请分批导出";
}
......@@ -60,7 +60,7 @@ public class OrderController {
@GetMapping("/getOrderList")
@PreAuthorize("@pms.hasPermission('order:order_getOrderList')")
public R<List<OrderListVO>> getOrderList(OrderListParam param) {
return R.ok(tOrderService.getOrderList(param));
return tOrderService.getOrderList(param);
}
/**
......
......@@ -34,9 +34,9 @@ public interface TOrderService extends IService<TOrder> {
*
* @author licancan
* @param param
* @return {@link List<OrderListVO>}
* @return {@link R<List<OrderListVO>>}
*/
List<OrderListVO> getOrderList(OrderListParam param);
R<List<OrderListVO>> getOrderList(OrderListParam param);
/**
* 变更订单状态
......
......@@ -83,7 +83,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
* @author licancan
*/
@Override
public List<OrderListVO> getOrderList(OrderListParam param) {
public R<List<OrderListVO>> getOrderList(OrderListParam param) {
YifuUser user = SecurityUtils.getUser();
List<OrderListVO> list;
if (CollectionUtils.isNotEmpty(param.getIdList())){
......@@ -91,7 +91,12 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
}else {
list = baseMapper.getOrderList(param,user.getUsername());
}
return list;
if (CollectionUtils.isNotEmpty(list)){
if(list.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(OrderConstants.EXPORT_TOO_LONG);
}
}
return R.ok(list);
}
/**
......
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