Commit 444af7e0 authored by zhaji's avatar zhaji

Merge branch 'develop' into feature-zhaji

parents 4de0e087 a0f3dfad
...@@ -67,8 +67,14 @@ public class TEmpContractAlert extends BaseEntity { ...@@ -67,8 +67,14 @@ public class TEmpContractAlert extends BaseEntity {
@Schema(description ="员工ID") @Schema(description ="员工ID")
@ExcelProperty("员工ID") @ExcelProperty("员工ID")
private String empId; private String empId;
/** /**
* 项目id
*/
@ExcelAttribute(name = "项目id" )
@Schema(description ="项目id")
@ExcelProperty("项目id")
private String deptId;
/**
* 项目名称 * 项目名称
*/ */
@ExcelAttribute(name = "项目名称" ) @ExcelAttribute(name = "项目名称" )
......
...@@ -71,6 +71,9 @@ public class TCertRecordController { ...@@ -71,6 +71,9 @@ public class TCertRecordController {
return R.failed(CommonConstants.PLEASE_LOG_IN); return R.failed(CommonConstants.PLEASE_LOG_IN);
} }
menuUtil.setAuthSql(user, searchVo); menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
}
return R.ok(tCertRecordService.pageDiy(page, searchVo)); return R.ok(tCertRecordService.pageDiy(page, searchVo));
} }
/** /**
...@@ -87,6 +90,9 @@ public class TCertRecordController { ...@@ -87,6 +90,9 @@ public class TCertRecordController {
return R.failed(CommonConstants.PLEASE_LOG_IN); return R.failed(CommonConstants.PLEASE_LOG_IN);
} }
menuUtil.setAuthSql(user, searchVo); menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
}
return R.ok(tCertRecordService.getTCertRecordNoPage(searchVo)); return R.ok(tCertRecordService.getTCertRecordNoPage(searchVo));
} }
......
...@@ -22,9 +22,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -22,9 +22,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; 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.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -48,6 +53,7 @@ import java.util.List; ...@@ -48,6 +53,7 @@ import java.util.List;
public class TEmpContractAlertController { public class TEmpContractAlertController {
private final TEmpContractAlertService tEmpContractAlertService; private final TEmpContractAlertService tEmpContractAlertService;
private final MenuUtil menuUtil;
/** /**
* 分页查询 * 分页查询
...@@ -59,6 +65,11 @@ public class TEmpContractAlertController { ...@@ -59,6 +65,11 @@ public class TEmpContractAlertController {
@GetMapping("/page" ) @GetMapping("/page" )
//@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_get')" ) //@PreAuthorize("@pms.hasPermission('demo_tempcontractalert_get')" )
public R<IPage<TEmpContractAlert>> getTEmpContractAlertPage(Page page, ContractAlertSearchVo searchVo) { public R<IPage<TEmpContractAlert>> getTEmpContractAlertPage(Page page, ContractAlertSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
}
return R.ok(tEmpContractAlertService.pageDiy(page, searchVo)); return R.ok(tEmpContractAlertService.pageDiy(page, searchVo));
} }
/** /**
...@@ -134,6 +145,11 @@ public class TEmpContractAlertController { ...@@ -134,6 +145,11 @@ public class TEmpContractAlertController {
@Operation(description = "导出") @Operation(description = "导出")
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, @RequestBody ContractAlertSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody ContractAlertSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "dept_id"));
}
tEmpContractAlertService.listExport(response,searchVo); tEmpContractAlertService.listExport(response,searchVo);
} }
/** /**
......
...@@ -26,8 +26,11 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; ...@@ -26,8 +26,11 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; 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.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -53,7 +56,7 @@ import java.util.List; ...@@ -53,7 +56,7 @@ import java.util.List;
public class TEmployeeContractInfoController { public class TEmployeeContractInfoController {
private final TEmployeeContractInfoService tEmployeeContractInfoService; private final TEmployeeContractInfoService tEmployeeContractInfoService;
private final MenuUtil menuUtil;
/** /**
* 申请、归档分页查询 * 申请、归档分页查询
* *
...@@ -64,6 +67,7 @@ public class TEmployeeContractInfoController { ...@@ -64,6 +67,7 @@ public class TEmployeeContractInfoController {
@Operation(summary = "申请分页查询(全部的数据(后面加上权限:自己创建的))", description = "申请分页查询") @Operation(summary = "申请分页查询(全部的数据(后面加上权限:自己创建的))", description = "申请分页查询")
@GetMapping("/applyPage") @GetMapping("/applyPage")
public R<IPage<TEmployeeContractInfo>> getApplyPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) { public R<IPage<TEmployeeContractInfo>> getApplyPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) {
this.setAuth(tEmployeeContractInfo);
return new R<>(tEmployeeContractInfoService.getTEmployeeContractInfoPage(page, tEmployeeContractInfo)); return new R<>(tEmployeeContractInfoService.getTEmployeeContractInfoPage(page, tEmployeeContractInfo));
} }
...@@ -72,9 +76,25 @@ public class TEmployeeContractInfoController { ...@@ -72,9 +76,25 @@ public class TEmployeeContractInfoController {
public R<IPage<TEmployeeContractInfo>> getFilingPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) { public R<IPage<TEmployeeContractInfo>> getFilingPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) {
tEmployeeContractInfo.setIsFilePage(CommonConstants.ONE_INT); tEmployeeContractInfo.setIsFilePage(CommonConstants.ONE_INT);
tEmployeeContractInfo.setAuditStatus(CommonConstants.dingleDigitIntArray[2]); tEmployeeContractInfo.setAuditStatus(CommonConstants.dingleDigitIntArray[2]);
this.setAuth(tEmployeeContractInfo);
return new R<>(tEmployeeContractInfoService.getTEmployeeContractInfoPage(page, tEmployeeContractInfo)); return new R<>(tEmployeeContractInfoService.getTEmployeeContractInfoPage(page, tEmployeeContractInfo));
} }
/**
* @param tEmployeeContractInfo
* @Description: 加入权限
* @Author: hgw
* @Date: 2022/9/16 16:39
* @return: void
**/
private void setAuth(TEmployeeContractInfo tEmployeeContractInfo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tEmployeeContractInfo);
if (Common.isNotNull(tEmployeeContractInfo.getAuthSql()) && tEmployeeContractInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tEmployeeContractInfo.setAuthSql(tEmployeeContractInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
}
/** /**
* 合同审核分页查询 * 合同审核分页查询
* *
...@@ -86,6 +106,7 @@ public class TEmployeeContractInfoController { ...@@ -86,6 +106,7 @@ public class TEmployeeContractInfoController {
@GetMapping("/auditPage") @GetMapping("/auditPage")
public R<IPage<TEmployeeContractInfo>> getAuditPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) { public R<IPage<TEmployeeContractInfo>> getAuditPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) {
tEmployeeContractInfo.setAuditStatus(CommonConstants.ONE_INT); tEmployeeContractInfo.setAuditStatus(CommonConstants.ONE_INT);
this.setAuth(tEmployeeContractInfo);
return new R<>(tEmployeeContractInfoService.getTEmployeeContractInfoPage(page, tEmployeeContractInfo)); return new R<>(tEmployeeContractInfoService.getTEmployeeContractInfoPage(page, tEmployeeContractInfo));
} }
...@@ -99,6 +120,7 @@ public class TEmployeeContractInfoController { ...@@ -99,6 +120,7 @@ public class TEmployeeContractInfoController {
@Operation(summary = "合同查询(全部的数据)", description = "合同查询") @Operation(summary = "合同查询(全部的数据)", description = "合同查询")
@GetMapping("/page") @GetMapping("/page")
public R<IPage<TEmployeeContractInfo>> gettemployeecontractinfoPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) { public R<IPage<TEmployeeContractInfo>> gettemployeecontractinfoPage(Page<TEmployeeContractInfo> page, TEmployeeContractInfo tEmployeeContractInfo) {
this.setAuth(tEmployeeContractInfo);
return new R<>(tEmployeeContractInfoService.getTEmployeeContractInfoPage(page, tEmployeeContractInfo)); return new R<>(tEmployeeContractInfoService.getTEmployeeContractInfoPage(page, tEmployeeContractInfo));
} }
...@@ -263,6 +285,13 @@ public class TEmployeeContractInfoController { ...@@ -263,6 +285,13 @@ public class TEmployeeContractInfoController {
@SysLog("批量导出合同") @SysLog("批量导出合同")
@PostMapping("/exportContractInfo") @PostMapping("/exportContractInfo")
public void exportContractInfo(@RequestBody(required = false) TEmployeeContractInfo contractInfo, HttpServletResponse response) { public void exportContractInfo(@RequestBody(required = false) TEmployeeContractInfo contractInfo, HttpServletResponse response) {
YifuUser user = SecurityUtils.getUser();
if (user != null && !Common.isEmpty(user.getId())) {
menuUtil.setAuthSql(user, contractInfo);
if (Common.isNotNull(contractInfo.getAuthSql()) && contractInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
contractInfo.setAuthSql(contractInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
}
tEmployeeContractInfoService.exportContractInfo(contractInfo, response); tEmployeeContractInfoService.exportContractInfo(contractInfo, response);
} }
...@@ -276,6 +305,13 @@ public class TEmployeeContractInfoController { ...@@ -276,6 +305,13 @@ public class TEmployeeContractInfoController {
@SysLog("批量导出合同[历史]") @SysLog("批量导出合同[历史]")
@PostMapping("/exportContractInfoHistory") @PostMapping("/exportContractInfoHistory")
public void exportContractInfoHistory(@RequestBody(required = false) TEmployeeContractInfo contractInfo, HttpServletResponse response) { public void exportContractInfoHistory(@RequestBody(required = false) TEmployeeContractInfo contractInfo, HttpServletResponse response) {
YifuUser user = SecurityUtils.getUser();
if (user != null && !Common.isEmpty(user.getId())) {
menuUtil.setAuthSql(user, contractInfo);
if (Common.isNotNull(contractInfo.getAuthSql()) && contractInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
contractInfo.setAuthSql(contractInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
}
tEmployeeContractInfoService.exportContractInfoHistory(contractInfo, response); tEmployeeContractInfoService.exportContractInfoHistory(contractInfo, response);
} }
......
...@@ -22,10 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -22,10 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCertRecordMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCertRecordMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
...@@ -37,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; ...@@ -37,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -123,9 +121,10 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert ...@@ -123,9 +121,10 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
public IPage<TCertRecord> pageDiy(Page page, CertRecordSearchVo searchVo) { public IPage<TCertRecord> pageDiy(Page page, CertRecordSearchVo searchVo) {
LambdaQueryWrapper<TCertRecord> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TCertRecord> wrapper = buildQueryWrapper(searchVo);
if (Common.isNotNull(searchVo.getAuthSql())) { if (Common.isNotNull(searchVo.getAuthSql())) {
wrapper.last(searchVo.getAuthSql()); wrapper.last(searchVo.getAuthSql() + " order by CREATE_TIME desc");
} else {
wrapper.orderByDesc(BaseEntity::getCreateTime);
} }
wrapper.orderByDesc(TCertRecord::getCreateTime);
return baseMapper.selectPage(page,wrapper); return baseMapper.selectPage(page,wrapper);
} }
...@@ -143,6 +142,7 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert ...@@ -143,6 +142,7 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
} }
private LambdaQueryWrapper buildQueryWrapper(CertRecordSearchVo entity){ private LambdaQueryWrapper buildQueryWrapper(CertRecordSearchVo entity){
LambdaQueryWrapper<TCertRecord> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<TCertRecord> wrapper = Wrappers.lambdaQuery();
wrapper.ne(TCertRecord::getId,CommonConstants.ZERO_STRING);
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) { if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TCertRecord::getOpenTime, entity.getCreateTimes()[0]) wrapper.ge(TCertRecord::getOpenTime, entity.getCreateTimes()[0])
.le(TCertRecord::getOpenTime, .le(TCertRecord::getOpenTime,
......
...@@ -65,7 +65,11 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -65,7 +65,11 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
@Override @Override
public IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo) { public IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo) {
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
wrapper.orderByDesc(BaseEntity::getCreateTime); if (Common.isNotNull(searchVo.getAuthSql())) {
wrapper.last(searchVo.getAuthSql() + " order by CREATE_TIME desc");
} else {
wrapper.orderByDesc(BaseEntity::getCreateTime);
}
return baseMapper.selectPage(page,wrapper); return baseMapper.selectPage(page,wrapper);
} }
...@@ -76,6 +80,10 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -76,6 +80,10 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if (Common.isNotNull(idList)){ if (Common.isNotNull(idList)){
wrapper.in(TEmpContractAlert::getId,idList); wrapper.in(TEmpContractAlert::getId,idList);
} }
wrapper.ne(TEmpContractAlert::getId,CommonConstants.ZERO_STRING);
if (Common.isNotNull(searchVo.getAuthSql())) {
wrapper.last(searchVo.getAuthSql());
}
return baseMapper.selectList(wrapper); return baseMapper.selectList(wrapper);
} }
...@@ -85,6 +93,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -85,6 +93,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
if (Common.isNotNull(idList)){ if (Common.isNotNull(idList)){
wrapper.in(TEmpContractAlert::getId,idList); wrapper.in(TEmpContractAlert::getId,idList);
} }
if (Common.isNotNull(searchVo.getAuthSql())) {
wrapper.last(searchVo.getAuthSql());
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() >= 0){ if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() >= 0){
wrapper.last(" limit "+ searchVo.getLimitStart() +","+ searchVo.getLimitEnd()); wrapper.last(" limit "+ searchVo.getLimitStart() +","+ searchVo.getLimitEnd());
} }
...@@ -152,6 +163,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -152,6 +163,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
private LambdaQueryWrapper buildQueryWrapper(ContractAlertSearchVo entity){ private LambdaQueryWrapper buildQueryWrapper(ContractAlertSearchVo entity){
LambdaQueryWrapper<TEmpContractAlert> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<TEmpContractAlert> wrapper = Wrappers.lambdaQuery();
wrapper.ne(TEmpContractAlert::getId,CommonConstants.ZERO_STRING);
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) { if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TEmpContractAlert::getCreateTime, entity.getCreateTimes()[0]) wrapper.ge(TEmpContractAlert::getCreateTime, entity.getCreateTimes()[0])
.le(TEmpContractAlert::getCreateTime, .le(TEmpContractAlert::getCreateTime,
...@@ -309,6 +321,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -309,6 +321,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setEmpName(contract.getEmpName()); alert.setEmpName(contract.getEmpName());
alert.setEmpId(contract.getEmpId()); alert.setEmpId(contract.getEmpId());
alert.setEmpCode(contract.getEmpNo()); alert.setEmpCode(contract.getEmpNo());
alert.setDeptId(contract.getSettleDomain());
alert.setProject(contract.getSubjectDepart()); alert.setProject(contract.getSubjectDepart());
alert.setProjectNo(contract.getDeptNo()); alert.setProjectNo(contract.getDeptNo());
alert.setEmpIdcard(contract.getEmpIdcard()); alert.setEmpIdcard(contract.getEmpIdcard());
......
...@@ -394,10 +394,17 @@ ...@@ -394,10 +394,17 @@
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_employee_contract_info a FROM t_employee_contract_info a
<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
left join t_employee_contract_area_res p on a.CREATE_BY=p.USER_ID
</if>
<where> <where>
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
<include refid="tEmployeeContractInfo_where"/> <include refid="tEmployeeContractInfo_where"/>
<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
${tEmployeeContractInfo.authSql}
</if>
</where> </where>
GROUP BY a.id
order by a.CREATE_TIME desc order by a.CREATE_TIME desc
</select> </select>
...@@ -418,10 +425,17 @@ ...@@ -418,10 +425,17 @@
SELECT SELECT
<include refid="Base_Export_Column_List"/> <include refid="Base_Export_Column_List"/>
FROM t_employee_contract_info a FROM t_employee_contract_info a
<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
left join t_employee_contract_area_res p on a.CREATE_BY=p.USER_ID
</if>
<where> <where>
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
<include refid="tEmployeeContractInfo_where"/> <include refid="tEmployeeContractInfo_where"/>
<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
${tEmployeeContractInfo.authSql}
</if>
</where> </where>
GROUP BY a.id
order by a.CREATE_TIME desc order by a.CREATE_TIME desc
</select> </select>
...@@ -437,6 +451,9 @@ ...@@ -437,6 +451,9 @@
<where> <where>
a.DELETE_FLAG = 0 and a.AUDIT_TIME_LAST is not null and a.SITUATION != '作废' and a.SITUATION != '终止' a.DELETE_FLAG = 0 and a.AUDIT_TIME_LAST is not null and a.SITUATION != '作废' and a.SITUATION != '终止'
<include refid="tEmployeeContractInfo_where"/> <include refid="tEmployeeContractInfo_where"/>
<if test="tEmployeeContractInfo.authSql != null and tEmployeeContractInfo.authSql.trim() != ''">
${tEmployeeContractInfo.authSql}
</if>
</where> </where>
GROUP BY a.EMP_IDCARD,a.SETTLE_DOMAIN GROUP BY a.EMP_IDCARD,a.SETTLE_DOMAIN
order by a.CREATE_TIME desc order by a.CREATE_TIME desc
......
...@@ -37,7 +37,7 @@ public class MenuUtil { ...@@ -37,7 +37,7 @@ public class MenuUtil {
public void setAuthSql(YifuUser user, BaseEntity entity) { public void setAuthSql(YifuUser user, BaseEntity entity) {
// 普通用户: // 普通用户:
if (CommonConstants.ONE_STRING.equals(user.getSystemFlag())) { if (user != null && Common.isNotNull(user.getId()) && CommonConstants.ONE_STRING.equals(user.getSystemFlag())) {
// 菜单id // 菜单id
String menuId = entity.getMId(); String menuId = entity.getMId();
......
...@@ -10,7 +10,7 @@ import java.util.Date; ...@@ -10,7 +10,7 @@ import java.util.Date;
@Data @Data
@ToString @ToString
@Entry(objectClasses = {"posixAccount","top","inetOrgPerson"}, base = "ou=安徽皖信人力资源管理有限公司,ou=wanxin") @Entry(objectClasses = {"posixAccount","top","inetOrgPerson"}, base = "ou=皖信人力集团,ou=wanxin")
public class PersonVo { public class PersonVo {
/** /**
......
...@@ -28,9 +28,6 @@ public class PersonAttributesMapper implements AttributesMapper<PersonVo> { ...@@ -28,9 +28,6 @@ public class PersonAttributesMapper implements AttributesMapper<PersonVo> {
if (null != attributes.get("ou")) { if (null != attributes.get("ou")) {
personVo.setDeptName((String) attributes.get("ou").get()); personVo.setDeptName((String) attributes.get("ou").get());
} }
if (null != attributes.get("userPassword")) {
personVo.setPassword((String) attributes.get("userPassword").get());
}
return personVo; return personVo;
} }
} }
...@@ -10,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -10,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.ldap.core.LdapTemplate; import org.springframework.ldap.core.LdapTemplate;
import javax.naming.AuthenticationException;
import javax.naming.Context; import javax.naming.Context;
import javax.naming.NamingEnumeration; import javax.naming.NamingEnumeration;
import javax.naming.NamingException; import javax.naming.NamingException;
...@@ -36,7 +35,7 @@ public class LdapUtil { ...@@ -36,7 +35,7 @@ public class LdapUtil {
private static LdapContext ctx = null; private static LdapContext ctx = null;
private static Control[] connCtls = null; private static final Control[] connCtls = null;
/** /**
* @return List<SearchResultEntry> * @return List<SearchResultEntry>
...@@ -45,16 +44,14 @@ public class LdapUtil { ...@@ -45,16 +44,14 @@ public class LdapUtil {
* @description get请求获取指定对象信息 * @description get请求获取指定对象信息
**/ **/
public List<SearchResultEntry> getAllPersonNamesWithTraditionalWay() { public List<SearchResultEntry> getAllPersonNamesWithTraditionalWay() {
List<SearchResultEntry> result = new ArrayList<SearchResultEntry>(); List<SearchResultEntry> result = new ArrayList<>();
try { try {
LDAPConnection connection = new LDAPConnection(ldapProperties.getUrl(), ldapProperties.getPort(), LDAPConnection connection = new LDAPConnection(ldapProperties.getUrl(), ldapProperties.getPort(),
ldapProperties.getUserName(), ldapProperties.getPassword()); ldapProperties.getUserName(), ldapProperties.getPassword());
SearchRequest searchRequest = new SearchRequest(ldapProperties.getBaseDn(), SearchScope.SUB, "(objectclass=*)"); SearchRequest searchRequest = new SearchRequest(ldapProperties.getBaseDn(), SearchScope.SUB, "(objectclass=*)");
searchRequest.addControl(new SubentriesRequestControl()); searchRequest.addControl(new SubentriesRequestControl());
SearchResult searchResult = connection.search(searchRequest); SearchResult searchResult = connection.search(searchRequest);
for (SearchResultEntry entry : searchResult.getSearchEntries()) { result.addAll(searchResult.getSearchEntries());
result.add(entry);
}
} catch (LDAPException e) { } catch (LDAPException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -62,15 +59,14 @@ public class LdapUtil { ...@@ -62,15 +59,14 @@ public class LdapUtil {
} }
public List<PersonVo> getAllPersons() { public List<PersonVo> getAllPersons() {
List<PersonVo> list = ldapTemplate.search(query() return ldapTemplate.search(query()
.where("objectclass").is("posixAccount"), new PersonAttributesMapper()); .where("objectclass").is("posixAccount"), new PersonAttributesMapper());
return list;
} }
// 校验用户名密码的方法 // 校验用户名密码的方法
public Boolean authenticate(String usr, String pwd) { public Boolean authenticate(String usr, String pwd) {
boolean valide = false; boolean valide;
if (pwd == null || pwd == "") if (pwd == null || "".equals(pwd))
return false; return false;
if (ctx == null) { if (ctx == null) {
getCtx(); getCtx();
...@@ -85,9 +81,6 @@ public class LdapUtil { ...@@ -85,9 +81,6 @@ public class LdapUtil {
ctx.reconnect(connCtls); ctx.reconnect(connCtls);
valide = true; valide = true;
closeCtx(); closeCtx();
} catch (AuthenticationException e) {
log.error(userDN + " is not authenticated");
valide = false;
} catch (NamingException e) { } catch (NamingException e) {
log.error(userDN + " is not authenticated"); log.error(userDN + " is not authenticated");
valide = false; valide = false;
...@@ -99,7 +92,7 @@ public class LdapUtil { ...@@ -99,7 +92,7 @@ public class LdapUtil {
if (ctx != null) { if (ctx != null) {
return; return;
} }
Hashtable<String, String> env = new Hashtable<String, String>(); Hashtable<String, String> env = new Hashtable<>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://" + ldapProperties.getUrl() + ":" + ldapProperties.getPort() + env.put(Context.PROVIDER_URL, "ldap://" + ldapProperties.getUrl() + ":" + ldapProperties.getPort() +
"/" + ldapProperties.getDn()); "/" + ldapProperties.getDn());
...@@ -120,7 +113,7 @@ public class LdapUtil { ...@@ -120,7 +113,7 @@ public class LdapUtil {
} }
public String getUserDN(String uid) { public String getUserDN(String uid) {
String userDN = ""; StringBuilder userDN = new StringBuilder();
try { try {
SearchControls constraints = new SearchControls(); SearchControls constraints = new SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE); constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
...@@ -129,13 +122,13 @@ public class LdapUtil { ...@@ -129,13 +122,13 @@ public class LdapUtil {
Object obj = en.nextElement(); Object obj = en.nextElement();
if (obj instanceof javax.naming.directory.SearchResult) { if (obj instanceof javax.naming.directory.SearchResult) {
javax.naming.directory.SearchResult si = (javax.naming.directory.SearchResult) obj; javax.naming.directory.SearchResult si = (javax.naming.directory.SearchResult) obj;
userDN += si.getName(); userDN.append(si.getName());
userDN += "," + ldapProperties.getDn(); userDN.append(",").append(ldapProperties.getDn());
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return userDN; return userDN.toString();
} }
} }
...@@ -3,4 +3,4 @@ ldap.port=389 ...@@ -3,4 +3,4 @@ ldap.port=389
ldap.userName=cn=admin,dc=worfu,dc=com ldap.userName=cn=admin,dc=worfu,dc=com
ldap.password=yifu123456! ldap.password=yifu123456!
ldap.dn=dc=worfu,dc=com ldap.dn=dc=worfu,dc=com
ldap.baseDn=ou=\u5B89\u5FBD\u7696\u4FE1\u4EBA\u529B\u8D44\u6E90\u7BA1\u7406\u6709\u9650\u516C\u53F8,ou=wanxin,dc=worfu,dc=com ldap.baseDn=ou=\u7696\u4FE1\u4EBA\u529B\u96C6\u56E2,ou=wanxin,dc=worfu,dc=com
\ No newline at end of file \ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -13,7 +14,7 @@ import java.util.List; ...@@ -13,7 +14,7 @@ import java.util.List;
*/ */
@Data @Data
@Schema(description = "导出办理请求参数") @Schema(description = "导出办理请求参数")
public class InsuranceExportListParam implements Serializable { public class InsuranceExportListParam extends BaseEntity implements Serializable {
private static final long serialVersionUID = 3623027153213352936L; private static final long serialVersionUID = 3623027153213352936L;
/** /**
...@@ -46,12 +47,6 @@ public class InsuranceExportListParam implements Serializable { ...@@ -46,12 +47,6 @@ public class InsuranceExportListParam implements Serializable {
@Schema(description = "商险id集合") @Schema(description = "商险id集合")
private List<String> idList; private List<String> idList;
/**
* 办理地分流sql
*/
@Schema(description = "办理地分流sql")
private String regionSql;
/** /**
* 购买类型, 1新增、3批增、4替换 * 购买类型, 1新增、3批增、4替换
*/ */
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -13,7 +14,7 @@ import java.util.List; ...@@ -13,7 +14,7 @@ import java.util.List;
*/ */
@Data @Data
@Schema(description = "投保列表请求参数") @Schema(description = "投保列表请求参数")
public class InsuranceListParam implements Serializable { public class InsuranceListParam extends BaseEntity implements Serializable {
private static final long serialVersionUID = -4692341622141432288L; private static final long serialVersionUID = -4692341622141432288L;
/** /**
...@@ -70,12 +71,6 @@ public class InsuranceListParam implements Serializable { ...@@ -70,12 +71,6 @@ public class InsuranceListParam implements Serializable {
@Schema(description = "项目编码列表") @Schema(description = "项目编码列表")
private List<String> deptNoList; private List<String> deptNoList;
/**
* 办理地分流sql
*/
@Schema(description = "办理地分流sql")
private String regionSql;
/** /**
* 保单办理人 * 保单办理人
*/ */
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
...@@ -13,7 +14,7 @@ import java.io.Serializable; ...@@ -13,7 +14,7 @@ import java.io.Serializable;
*/ */
@Data @Data
@Tag(name = "减员办理查询条件") @Tag(name = "减员办理查询条件")
public class InsuranceRefundHandlingParam implements Serializable { public class InsuranceRefundHandlingParam extends BaseEntity implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
...@@ -77,12 +78,6 @@ public class InsuranceRefundHandlingParam implements Serializable { ...@@ -77,12 +78,6 @@ public class InsuranceRefundHandlingParam implements Serializable {
@Schema(description = "是否过期 0未过期 1已过期") @Schema(description = "是否过期 0未过期 1已过期")
private Integer isOverdue; private Integer isOverdue;
/**
* 办理地分流sql
*/
@Schema(description = "办理地分流sql")
private String regionSql;
/** /**
* 办理人 * 办理人
*/ */
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
...@@ -14,7 +15,7 @@ import java.util.List; ...@@ -14,7 +15,7 @@ import java.util.List;
*/ */
@Data @Data
@Tag(name = "已减员查询列表参数") @Tag(name = "已减员查询列表参数")
public class InsuranceRefundParam implements Serializable { public class InsuranceRefundParam extends BaseEntity implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
/** /**
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
...@@ -19,7 +16,7 @@ import java.util.List; ...@@ -19,7 +16,7 @@ import java.util.List;
*/ */
@Data @Data
@Tag(name = "已投保列表查询条件") @Tag(name = "已投保列表查询条件")
public class InsuredParam implements Serializable { public class InsuredParam extends BaseEntity implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
/** /**
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -13,7 +14,7 @@ import java.util.List; ...@@ -13,7 +14,7 @@ import java.util.List;
*/ */
@Data @Data
@Schema(description = "导出减员办理请求参数") @Schema(description = "导出减员办理请求参数")
public class RefundExportListParam implements Serializable { public class RefundExportListParam extends BaseEntity implements Serializable {
private static final long serialVersionUID = 3623027153213352936L; private static final long serialVersionUID = 3623027153213352936L;
/** /**
...@@ -52,10 +53,4 @@ public class RefundExportListParam implements Serializable { ...@@ -52,10 +53,4 @@ public class RefundExportListParam implements Serializable {
@Schema(description = "商险id集合") @Schema(description = "商险id集合")
private List<String> idList; private List<String> idList;
/**
* 办理地分流sql
*/
@Schema(description = "办理地分流sql")
private String regionSql;
} }
...@@ -206,16 +206,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -206,16 +206,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/ */
List<TInsuranceDetail> selectListByEmpIdcardNo(String empIdcardNo); List<TInsuranceDetail> selectListByEmpIdcardNo(String empIdcardNo);
/**
* 查数据是否存在权限范围内
*
* @author zhaji
* @param regionSql
* @param id
* @return {@link TInsuranceDetail}
*/
TInsuranceDetail selectByRegionSql(@Param("regionSql") String regionSql, @Param("id") String id);
/** /**
* 商险订单减员列表查询 * 商险订单减员列表查询
* *
......
...@@ -19,6 +19,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*; ...@@ -19,6 +19,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CheckDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CheckDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants; import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
...@@ -101,6 +102,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -101,6 +102,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Resource @Resource
private SocialDaprUtils socialDaprUtils; private SocialDaprUtils socialDaprUtils;
@Resource
private MenuUtil menuUtil;
/***********************商险办理********************************/ /***********************商险办理********************************/
/** /**
...@@ -190,6 +193,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -190,6 +193,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
public IPage<InsuranceListVO> getInsuranceListPage(Page<InsuranceListVO> page, InsuranceListParam param) { public IPage<InsuranceListVO> getInsuranceListPage(Page<InsuranceListVO> page, InsuranceListParam param) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, param);
List<String> deptNoList = getDeptNoList(user); List<String> deptNoList = getDeptNoList(user);
IPage<InsuranceListVO> insuranceList = new Page<>(); IPage<InsuranceListVO> insuranceList = new Page<>();
if (CollectionUtils.isEmpty(deptNoList)){ if (CollectionUtils.isEmpty(deptNoList)){
...@@ -250,11 +254,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -250,11 +254,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public IPage<InsuranceListVO> getInsuranceHandleListPage(Page<InsuranceListVO> page, InsuranceListParam param) { public IPage<InsuranceListVO> getInsuranceHandleListPage(Page<InsuranceListVO> page, InsuranceListParam param) {
IPage<InsuranceListVO> iPage = new Page<>(); IPage<InsuranceListVO> iPage = new Page<>();
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
String regionSQL = getRegionSQL(user); menuUtil.setAuthSql(user, param);
if (StringUtils.isBlank(regionSQL)){
return iPage;
}
param.setRegionSql(regionSQL);
Integer buyHandleStatus = param.getBuyHandleStatus(); Integer buyHandleStatus = param.getBuyHandleStatus();
if(buyHandleStatus == CommonConstants.TWO_INT || buyHandleStatus == CommonConstants.THREE_INT){ if(buyHandleStatus == CommonConstants.TWO_INT || buyHandleStatus == CommonConstants.THREE_INT){
param.setUpdateBy(user.getId()); param.setUpdateBy(user.getId());
...@@ -650,13 +650,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -650,13 +650,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
//有效 //有效
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsEffect) .or().isNull(TInsuranceDetail::getIsEffect)
) )
//未过期 //未过期
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
...@@ -673,26 +673,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -673,26 +673,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus) .notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.and( .and(
wrapper -> wrapper.and( wrapper -> wrapper.and(
s -> s.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart())) s -> s.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart())) .ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
) )
.or(e -> e.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd())) .or(e -> e.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))) .ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
.or(s -> s.ge(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart())) .or(s -> s.ge(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))) .le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
.or(s -> s.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart())) .or(s -> s.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.le(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))) .le(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
) )
//有效 //有效
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsEffect) .or().isNull(TInsuranceDetail::getIsEffect)
) )
//未过期 //未过期
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
...@@ -877,12 +877,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -877,12 +877,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
public R<List<InsuranceExportListVO>> getInsuranceExportList(InsuranceExportListParam param) { public R<List<InsuranceExportListVO>> getInsuranceExportList(InsuranceExportListParam param) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, param);
List<InsuranceExportListVO> insuranceExportList = new ArrayList<>(); List<InsuranceExportListVO> insuranceExportList = new ArrayList<>();
String regionSQL = getRegionSQL(user);
param.setRegionSql(regionSQL);
if(StringUtils.isBlank(regionSQL)){
return R.ok(insuranceExportList);
}
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待投保」的结果集 //如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待投保」的结果集
if (CollectionUtils.isNotEmpty(param.getIdList())){ if (CollectionUtils.isNotEmpty(param.getIdList())){
insuranceExportList = baseMapper.getInsuranceExportListBySelect(param.getIdList()); insuranceExportList = baseMapper.getInsuranceExportListBySelect(param.getIdList());
...@@ -1024,7 +1020,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1024,7 +1020,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isNotEmpty(detailList)){ if (CollectionUtils.isNotEmpty(detailList)){
for (TInsuranceDetail detail : detailList) { for (TInsuranceDetail detail : detailList) {
if (detail.getBuyHandleStatus() == CommonConstants.FOUR_INT if (detail.getBuyHandleStatus() == CommonConstants.FOUR_INT
|| detail.getBuyHandleStatus() == CommonConstants.FIVE_INT){ || detail.getBuyHandleStatus() == CommonConstants.FIVE_INT){
InsuranceListVO listVO = new InsuranceListVO(); InsuranceListVO listVO = new InsuranceListVO();
BeanCopyUtils.copyProperties(detail,listVO); BeanCopyUtils.copyProperties(detail,listVO);
listVO.setErrorMessage(InsurancesConstants.REDUCE_ROLLBACK_IS_NOT_ALLOW); listVO.setErrorMessage(InsurancesConstants.REDUCE_ROLLBACK_IS_NOT_ALLOW);
...@@ -1295,10 +1291,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1295,10 +1291,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.save(settle); tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId()); detail.setDefaultSettleId(settle.getId());
successList.add(detail); successList.add(detail);
if (detail.getBuyType() != CommonConstants.FOUR_INT) { //生成收入数据
//生成收入数据 createInsuranceInfo(detail);
createInsuranceInfo(detail);
}
}else { }else {
//按天 //按天
//计算起止时间的天数 //计算起止时间的天数
...@@ -1331,10 +1325,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1331,10 +1325,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.save(settle); tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId()); detail.setDefaultSettleId(settle.getId());
successList.add(detail); successList.add(detail);
if (detail.getBuyType() != CommonConstants.FOUR_INT) { //生成收入数据
//生成收入数据 createInsuranceInfo(detail);
createInsuranceInfo(detail);
}
} }
} }
//实缴 //实缴
...@@ -1359,23 +1351,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1359,23 +1351,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateBatchById(successList); updateBatchById(successList);
if (CollectionUtils.isNotEmpty(successList)){ if (CollectionUtils.isNotEmpty(successList)){
threadPool.execute(() -> { threadPool.execute(() -> {
//根据结算类型是合并结算,推送预估保费到ekp(上面已经算好,这里直接判断有预估保费的就推送) //根据结算类型是合并结算,推送预估保费到ekp(上面已经算好,这里直接判断有预估保费的就推送)
for (TInsuranceDetail tInsuranceDetail : successList) { for (TInsuranceDetail tInsuranceDetail : successList) {
Integer settleType = tInsuranceDetail.getSettleType(); Integer settleType = tInsuranceDetail.getSettleType();
//如果是合并计算则推送至EKP //如果是合并计算则推送至EKP
if(CommonConstants.ZERO_INT == settleType){ if(CommonConstants.ZERO_INT == settleType){
//存储成功后发送给EKP //存储成功后发送给EKP
String s = pushEstimate(tInsuranceDetail,CommonConstants.ONE_INT); String s = pushEstimate(tInsuranceDetail,CommonConstants.ONE_INT);
if(StringUtils.isNotBlank(s)){ if(StringUtils.isNotBlank(s)){
LambdaUpdateWrapper<TInsuranceSettle> settleWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TInsuranceSettle> settleWrapper = new LambdaUpdateWrapper<>();
settleWrapper.eq(TInsuranceSettle :: getId,tInsuranceDetail.getDefaultSettleId()) settleWrapper.eq(TInsuranceSettle :: getId,tInsuranceDetail.getDefaultSettleId())
.set(TInsuranceSettle :: getIsEstimatePush,CommonConstants.ONE_INT) .set(TInsuranceSettle :: getIsEstimatePush,CommonConstants.ONE_INT)
.set(TInsuranceSettle :: getEstimatePushTime,LocalDateTime.now()); .set(TInsuranceSettle :: getEstimatePushTime,LocalDateTime.now());
//更新结算信息表 //更新结算信息表
tInsuranceSettleService.update(settleWrapper); tInsuranceSettleService.update(settleWrapper);
}
} }
} }
}
}); });
} }
//根据项目编码获取项目名称 //根据项目编码获取项目名称
...@@ -1916,32 +1908,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1916,32 +1908,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据项目编码查询项目是否存在 //根据项目编码查询项目是否存在
try{ try{
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo())); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) { if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){ if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
//结算类型,根据项目编码获取,并冗余到明细记录中 ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
String settleType = projectSetInfoVo.getInsuranceSettleType(); if (null == projectSetInfoVo){
if (StringUtils.isEmpty(settleType)){ param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
param.setBpoFlag(projectSetInfoVo.getBpoFlag()); //结算类型,根据项目编码获取,并冗余到明细记录中
param.setSettleType(Integer.parseInt(settleType)); String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
continue;
}else {
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setSettleType(Integer.parseInt(settleType));
}
} }
} }
} }
}
}catch (Exception e){ }catch (Exception e){
log.error(InsurancesConstants.GET_DEPT_DETAIL_ERROR+e); log.error(InsurancesConstants.GET_DEPT_DETAIL_ERROR+e);
param.setErrorMessage(InsurancesConstants.GET_DEPT_DETAIL_ERROR); param.setErrorMessage(InsurancesConstants.GET_DEPT_DETAIL_ERROR);
...@@ -1993,7 +1985,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1993,7 +1985,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName()) .eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(insuranceCompany).isPresent()){ if (!Optional.ofNullable(insuranceCompany).isPresent()){
param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EXIST); param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EXIST);
listResult.add(param); listResult.add(param);
...@@ -2081,13 +2073,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2081,13 +2073,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus) .notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
//有效 //有效
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsEffect) .or().isNull(TInsuranceDetail::getIsEffect)
) )
//未过期 //未过期
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
...@@ -2107,26 +2099,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2107,26 +2099,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus) .notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.and( .and(
wrapper -> wrapper.and( wrapper -> wrapper.and(
s -> s.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart())) s -> s.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart())) .ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
) )
.or(e -> e.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd())) .or(e -> e.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))) .ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
.or(s -> s.ge(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart())) .or(s -> s.ge(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))) .le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
.or(s -> s.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart())) .or(s -> s.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.le(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))) .le(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
) )
//有效 //有效
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsEffect) .or().isNull(TInsuranceDetail::getIsEffect)
) )
//未过期 //未过期
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
...@@ -2372,8 +2364,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2372,8 +2364,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
)*/ )*/
//未过期 //未过期
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
...@@ -2492,13 +2484,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2492,13 +2484,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
//有效 //有效
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsEffect) .or().isNull(TInsuranceDetail::getIsEffect)
) )
//未过期 //未过期
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
...@@ -2805,13 +2797,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2805,13 +2797,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
//有效 //有效
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsEffect) .or().isNull(TInsuranceDetail::getIsEffect)
) )
//未过期 //未过期
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
...@@ -2830,26 +2822,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2830,26 +2822,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus) .notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.and( .and(
wrapper -> wrapper.and( wrapper -> wrapper.and(
s -> s.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart())) s -> s.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart())) .ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
) )
.or(e -> e.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd())) .or(e -> e.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))) .ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
.or(s -> s.ge(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart())) .or(s -> s.ge(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))) .le(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
.or(s -> s.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart())) .or(s -> s.ge(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.le(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))) .le(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd())))
) )
//有效 //有效
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsEffect) .or().isNull(TInsuranceDetail::getIsEffect)
) )
//未过期 //未过期
.and( .and(
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
...@@ -2879,7 +2871,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2879,7 +2871,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String,List<InsuranceRegisterParam>> map = new HashMap<>(); Map<String,List<InsuranceRegisterParam>> map = new HashMap<>();
List<InsuranceRegisterParam> listResult = new ArrayList<>(); List<InsuranceRegisterParam> listResult = new ArrayList<>();
List<InsuranceRegisterParam> listSuccess = new ArrayList<>(); List<InsuranceRegisterParam> listSuccess = new ArrayList<>();
String regionSQL = getRegionSQL(user);
for (InsuranceRegisterParam param : paramList.stream().distinct().collect(Collectors.toList())) { for (InsuranceRegisterParam param : paramList.stream().distinct().collect(Collectors.toList())) {
// 必填校验 // 必填校验
if (StringUtils.isBlank(param.getEmpName())){ if (StringUtils.isBlank(param.getEmpName())){
...@@ -2960,13 +2951,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2960,13 +2951,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
//查数据是否存在权限范围内
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByRegionSql(regionSQL, detail.getId());
if (!Optional.ofNullable(detailByRegionSQL).isPresent()){
param.setErrorMessage(InsurancesConstants.NO_UPDATE_DETAIL_JURISDICTION);
listResult.add(param);
continue;
}
// 如果保费不存在,保单号、保费必填 // 如果保费不存在,保单号、保费必填
if (detail.getActualPremium() == null){ if (detail.getActualPremium() == null){
if (StringUtils.isBlank(param.getPolicyNo())){ if (StringUtils.isBlank(param.getPolicyNo())){
...@@ -3147,19 +3131,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3147,19 +3131,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isNotEmpty(insuranceList)){ if (CollectionUtils.isNotEmpty(insuranceList)){
List<String> collect = insuranceList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList()); List<String> collect = insuranceList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
try{ try{
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) { if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuranceListVO record : insuranceList) { for (InsuranceListVO record : insuranceList) {
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){ if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
}
} }
} }
}
}catch (Exception e){ }catch (Exception e){
for (InsuranceListVO record : insuranceList) { for (InsuranceListVO record : insuranceList) {
record.setProjectName(CommonConstants.EMPTY_STRING); record.setProjectName(CommonConstants.EMPTY_STRING);
} }
} }
} }
...@@ -3177,19 +3161,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3177,19 +3161,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
public void addOperate(List<TInsuranceDetail> detailList,YifuUser user,String operateDesc,String remark,Integer displayFlag){ public void addOperate(List<TInsuranceDetail> detailList,YifuUser user,String operateDesc,String remark,Integer displayFlag){
if (CollectionUtils.isNotEmpty(detailList)){ if (CollectionUtils.isNotEmpty(detailList)){
List<TInsuranceOperate> operateList = new ArrayList<>(); List<TInsuranceOperate> operateList = new ArrayList<>();
for (TInsuranceDetail detail : detailList) { for (TInsuranceDetail detail : detailList) {
TInsuranceOperate operate = new TInsuranceOperate(); TInsuranceOperate operate = new TInsuranceOperate();
operate.setRemark(remark); operate.setRemark(remark);
operate.setDisplayFlag(displayFlag); operate.setDisplayFlag(displayFlag);
operate.setInsuranceDetailId(detail.getId()); operate.setInsuranceDetailId(detail.getId());
operate.setOperateDesc(operateDesc); operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId()); operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname()); operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now()); operate.setCreateTime(LocalDateTime.now());
operateList.add(operate); operateList.add(operate);
} }
tInsuranceOperateService.saveBatch(operateList); tInsuranceOperateService.saveBatch(operateList);
} }
} }
...@@ -3351,6 +3335,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3351,6 +3335,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
public IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param) { public IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, param);
List<String> deptList = getDeptNoList(user); List<String> deptList = getDeptNoList(user);
IPage<InsuredListVo> insuranceList = new Page<>(); IPage<InsuredListVo> insuranceList = new Page<>();
if (CollectionUtils.isEmpty(deptList)){ if (CollectionUtils.isEmpty(deptList)){
...@@ -3402,18 +3387,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3402,18 +3387,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//根据项目编码获取项目名称 //根据项目编码获取项目名称
List<String> collect = insuredList.stream().map(InsuredListVo::getDeptNo).distinct().collect(Collectors.toList()); List<String> collect = insuredList.stream().map(InsuredListVo::getDeptNo).distinct().collect(Collectors.toList());
try{ try{
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) { if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap(); Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuredListVo record : insuredList) { for (InsuredListVo record : insuredList) {
//购买月数 //购买月数
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyStart().toString(), record.getPolicyEnd().toString())); record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyStart().toString(), record.getPolicyEnd().toString()));
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo()); ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject) { if (null != jsonObject) {
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse("")); record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
}
} }
} }
}
}catch (Exception e){ }catch (Exception e){
for (InsuredListVo record : insuredList) { for (InsuredListVo record : insuredList) {
record.setProjectName(CommonConstants.EMPTY_STRING); record.setProjectName(CommonConstants.EMPTY_STRING);
...@@ -3434,6 +3419,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3434,6 +3419,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
public R getInsuranceRefundPageList(Page<InsuranceRefundParam> page, InsuranceRefundParam param) { public R getInsuranceRefundPageList(Page<InsuranceRefundParam> page, InsuranceRefundParam param) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, param);
List<String> deptList = getDeptNoList(user); List<String> deptList = getDeptNoList(user);
if (CollectionUtils.isEmpty(deptList)){ if (CollectionUtils.isEmpty(deptList)){
return R.ok("当前登录人无任何项目权限"); return R.ok("当前登录人无任何项目权限");
...@@ -3515,13 +3501,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3515,13 +3501,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
public IPage<RefundExportListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param) { public IPage<RefundExportListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, param);
String id = user.getId(); String id = user.getId();
Integer reduceHandleStatus = param.getReduceHandleStatus(); Integer reduceHandleStatus = param.getReduceHandleStatus();
if(null != reduceHandleStatus && reduceHandleStatus != CommonConstants.ONE_INT){ if(null != reduceHandleStatus && reduceHandleStatus != CommonConstants.ONE_INT){
param.setUpdateBy(id); param.setUpdateBy(id);
} }
String regionSQL = getRegionSQL(user);
param.setRegionSql(regionSQL);
IPage<RefundExportListVo> insuranceRefundHandlingPageList = this.baseMapper.getInsuranceRefundHandlingPageList(page, param); IPage<RefundExportListVo> insuranceRefundHandlingPageList = this.baseMapper.getInsuranceRefundHandlingPageList(page, param);
if (CollectionUtils.isNotEmpty(insuranceRefundHandlingPageList.getRecords())){ if (CollectionUtils.isNotEmpty(insuranceRefundHandlingPageList.getRecords())){
//根据项目编码获取项目名称 //根据项目编码获取项目名称
...@@ -3554,9 +3539,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3554,9 +3539,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class}) @Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R getInsuranceRefundHandlingList(RefundExportListParam param){ public R getInsuranceRefundHandlingList(RefundExportListParam param){
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, param);
List<RefundExportListVo> refundExportList; List<RefundExportListVo> refundExportList;
String regionSQL = getRegionSQL(user);
param.setRegionSql(regionSQL);
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集 //如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集
if (CollectionUtils.isNotEmpty(param.getIdList())){ if (CollectionUtils.isNotEmpty(param.getIdList())){
refundExportList = baseMapper.getRefundExportListBySelect(param.getIdList()); refundExportList = baseMapper.getRefundExportListBySelect(param.getIdList());
...@@ -3841,7 +3825,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3841,7 +3825,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
} }
} }
}); });
} }
//操作记录 //操作记录
...@@ -3872,102 +3856,214 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3872,102 +3856,214 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceOperate> operateList = new ArrayList<>(16); List<TInsuranceOperate> operateList = new ArrayList<>(16);
if(CollectionUtils.isNotEmpty(successList)){ if(CollectionUtils.isNotEmpty(successList)){
threadPool.execute(() -> { threadPool.execute(() -> {
for (DeptChangeCheckParam success : successList) { for (DeptChangeCheckParam success : successList) {
//新的结算信息 //新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle(); TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
//实际保费 //实际保费
BigDecimal actualPremium = success.getActualPremium(); BigDecimal actualPremium = success.getActualPremium();
//预估保费 //预估保费
BigDecimal estimatePremium = success.getEstimatePremium(); BigDecimal estimatePremium = success.getEstimatePremium();
//EKP推送类 //EKP推送类
EkpInteractiveParam interactiveParam = new EkpInteractiveParam(); EkpInteractiveParam interactiveParam = new EkpInteractiveParam();
TInsuranceDetail one = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId())); TInsuranceDetail one = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId()));
BeanCopyUtils.copyProperties(one,interactiveParam); BeanCopyUtils.copyProperties(one,interactiveParam);
interactiveParam.setDetailId(success.getId()); interactiveParam.setDetailId(success.getId());
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
Integer oldSettleType = success.getOldSettleType(); Integer oldSettleType = success.getOldSettleType();
Integer newSettleType = success.getNewSettleType(); Integer newSettleType = success.getNewSettleType();
//更新新的项目编码,结算方式,预估保费,实际保费 //更新新的项目编码,结算方式,预估保费,实际保费
updateWrapper.eq(TInsuranceDetail :: getId,success.getId()) updateWrapper.eq(TInsuranceDetail :: getId,success.getId())
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo()) .set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
.set(TInsuranceDetail :: getSettleType,newSettleType) .set(TInsuranceDetail :: getSettleType,newSettleType)
.set(TInsuranceDetail :: getActualPremium,actualPremium) .set(TInsuranceDetail :: getActualPremium,actualPremium)
.set(TInsuranceDetail :: getEstimatePremium,estimatePremium) .set(TInsuranceDetail :: getEstimatePremium,estimatePremium)
.set(TInsuranceDetail :: getUpdateBy,user.getId()) .set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now()); .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
//更新项目编码 //更新项目编码
update(updateWrapper); update(updateWrapper);
//更换项目更新收入 //更换项目更新收入
TInsuranceDetail income = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId())); TInsuranceDetail income = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId()));
if (Common.isNotNull(income)) { if (Common.isNotNull(income)) {
if (income.getBuyType() != CommonConstants.FOUR_INT) { if (income.getBuyType() != CommonConstants.FOUR_INT) {
//判断是否存在当月的商险收入数据 //判断是否存在当月的商险收入数据
TIncomeDetail incomeDetail = new TIncomeDetail(); TIncomeDetail incomeDetail = new TIncomeDetail();
incomeDetail.setSourceId(income.getId()); incomeDetail.setSourceId(income.getId());
R<TIncomeDetailReturnVo> detailList = socialDaprUtils.getTIncomeDetailList(incomeDetail); R<TIncomeDetailReturnVo> detailList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if (Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS if (Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS
&& detailList.getData().getDetailList().size() > 0) { && detailList.getData().getDetailList().size() > 0) {
//原项目生成红冲数据 //原项目生成红冲数据
for (TIncomeDetail detail : detailList.getData().getDetailList()) { for (TIncomeDetail detail : detailList.getData().getDetailList()) {
TIncomeDetail detail1 = new TIncomeDetail(); TIncomeDetail detail1 = new TIncomeDetail();
BeanCopyUtils.copyProperties(detail,detail1); BeanCopyUtils.copyProperties(detail,detail1);
detail1.setId(CommonConstants.NULL); detail1.setId(CommonConstants.NULL);
detail1.setRedData(CommonConstants.ONE_STRING); detail1.setRedData(CommonConstants.ONE_STRING);
detail1.setMoney(detail.getMoney().negate()); detail1.setMoney(detail.getMoney().negate());
socialDaprUtils.createTIncomeDetail(detail1); socialDaprUtils.createTIncomeDetail(detail1);
}
//新项目下生成收入数据
createInsuranceInfo(income);
} }
//新项目下生成收入数据
createInsuranceInfo(income);
} }
} }
} //商险id
//商险id String insuranceDetailId = success.getId();
String insuranceDetailId = success.getId(); //旧结算信息id
//旧结算信息id String oldDefaultSettleId = success.getDefaultSettleId();
String oldDefaultSettleId = success.getDefaultSettleId(); //如果变更前为单独结算
//如果变更前为单独结算 if(CommonConstants.ONE_INT == oldSettleType){
if(CommonConstants.ONE_INT == oldSettleType){ //登记了保单保费
//登记了保单保费 if (!BigDecimalUtils.isNullOrZero(actualPremium)) {
if (!BigDecimalUtils.isNullOrZero(actualPremium)) { newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setInsDetailId(insuranceDetailId); newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setSettleType(newSettleType); newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT); newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT); newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setCreateTime(LocalDateTime.now()); newInsuranceSettle.setActualPremium(actualPremium);
newInsuranceSettle.setActualPremium(actualPremium); newInsuranceSettle.setEstimatePremium(estimatePremium);
newInsuranceSettle.setEstimatePremium(estimatePremium); //存储新的结算信息
//存储新的结算信息 tInsuranceSettleService.save(newInsuranceSettle);
tInsuranceSettleService.save(newInsuranceSettle); updateWrapper.set(TInsuranceDetail::getDefaultSettleId, newInsuranceSettle.getId());
updateWrapper.set(TInsuranceDetail::getDefaultSettleId, newInsuranceSettle.getId()); //更新新的结算信息
//更新新的结算信息 update(updateWrapper);
update(updateWrapper); //根据旧的结算id获取旧的结算信息
//根据旧的结算id获取旧的结算信息 TInsuranceSettle byId = tInsuranceSettleService.getById(oldDefaultSettleId);
TInsuranceSettle byId = tInsuranceSettleService.getById(oldDefaultSettleId); //作废旧的数据,生成作废结算信息记录
//作废旧的数据,生成作废结算信息记录 TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel(); cancel.setDeptNo(success.getOldDeptNo());
cancel.setDeptNo(success.getOldDeptNo()); cancel.setInsDetailId(insuranceDetailId);
cancel.setInsDetailId(insuranceDetailId); cancel.setSettleId(oldDefaultSettleId);
cancel.setSettleId(oldDefaultSettleId); cancel.setCreateUesr(user.getId());
cancel.setCreateUesr(user.getId()); cancel.setCreateTime(LocalDateTime.now());
cancel.setCreateTime(LocalDateTime.now()); cancel.setDeptName(success.getOldDeptName());
cancel.setDeptName(success.getOldDeptName()); cancel.setIsCancelPush(CommonConstants.ZERO_INT);
cancel.setIsCancelPush(CommonConstants.ZERO_INT); tInsuranceSettleCancelService.save(cancel);
tInsuranceSettleCancelService.save(cancel); //如果已经推送过实际保费,则先作废,再推送新的实际保费
//如果已经推送过实际保费,则先作废,再推送新的实际保费 if (byId.getIsActualPush() == CommonConstants.ONE_INT) {
if (byId.getIsActualPush() == CommonConstants.ONE_INT) { //推送至EKP执行作废操作
//推送至EKP执行作废操作 interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setActualPremium(one.getActualPremium()); interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerCode(success.getOldCustomerCode()); interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setCustomerName(success.getOldCustomerName()); interactiveParam.setDeptNo(success.getOldDeptNo());
interactiveParam.setDeptNo(success.getOldDeptNo()); interactiveParam.setDeptName(success.getOldDeptName());
interactiveParam.setDeptName(success.getOldDeptName()); interactiveParam.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL);
interactiveParam.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL); String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam); if (StringUtils.isNotBlank(deleteBody)) {
if (StringUtils.isNotBlank(deleteBody)) { //推送成功更新作废推送状态
//推送成功更新作废推送状态 cancel.setIsCancelPush(CommonConstants.ONE_INT);
cancel.setIsCancelPush(CommonConstants.ONE_INT); tInsuranceSettleCancelService.updateById(cancel);
tInsuranceSettleCancelService.updateById(cancel); //变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) {
//推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
String pushResult = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(pushResult)){
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else {
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}
//变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType) {
//先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(estimateBody)) {
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
//推送实缴单
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
String actualBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(actualBody)) {
//推送成功后更新本地推送状态
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}else{
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
//推送实缴单
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}
}else{
//保存作废信息
saveInsuranceEkp(interactiveParam,CommonConstants.FOUR_INT);
//保存预估信息
//变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) {
//推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
//保存实缴信息
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
//变更后为单独结算
if (CommonConstants.ZERO_INT == newSettleType) {
//先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
//保存预估信息
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
//保存实缴信息
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}
}else{
//变更后为单独结算 //变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) { if (CommonConstants.ONE_INT == newSettleType) {
//推送新的结算信息至EKP //推送新的结算信息至EKP
...@@ -3980,9 +4076,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3980,9 +4076,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
interactiveParam.setDeptNo(success.getNewDeptNo()); interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName()); interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId()); String addBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
String pushResult = eKPInsuranceUtil.sendToEkp(interactiveParam); if (StringUtils.isNotBlank(addBody)){
if (StringUtils.isNotBlank(pushResult)){
newInsuranceSettle.setActualPushTime(LocalDateTime.now()); newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT); newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now()); newInsuranceSettle.setUpdateTime(LocalDateTime.now());
...@@ -4037,239 +4132,225 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4037,239 +4132,225 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT); saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
} }
} }
}else{
//保存作废信息
saveInsuranceEkp(interactiveParam,CommonConstants.FOUR_INT);
//保存预估信息
//变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) {
//推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
//保存实缴信息
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
//变更后为单独结算
if (CommonConstants.ZERO_INT == newSettleType) {
//先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
//保存预估信息
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
//保存实缴信息
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
} }
}else{ }
//未登记保单保费
if(BigDecimalUtils.isNullOrZero(actualPremium)){
//变更后为单独结算 //变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) { if (CommonConstants.ONE_INT == newSettleType){
//推送新的结算信息至EKP //变更项目且不做处理
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setActualPremium(success.getActualPremium());
String addBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(addBody)){
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else {
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
} }
//变更后为合并结算 //变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType) { if (CommonConstants.ZERO_INT == newSettleType){
//先推送预估,再推送实际 //生成预估结算信息
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId()); TInsuranceSettle tInsuranceSettle = new TInsuranceSettle();
tInsuranceSettle.setInsDetailId(success.getId());
tInsuranceSettle.setSettleType(success.getNewSettleType());
tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
tInsuranceSettle.setEstimatePremium(estimatePremium);
tInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
tInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
tInsuranceSettle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(tInsuranceSettle);
//将结算id赋值给保单信息,并新增预估费用
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId());
update(updateWrapper);
//推送结算信息至EKP
interactiveParam.setDefaultSettleId(tInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo()); interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName()); interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL); interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium()); interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam); String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(estimateBody)) { if(StringUtils.isNotBlank(estimateBody)){
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now()); //推送成功后更新本地推送状态
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT); tInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now()); tInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle); tInsuranceSettle.setUpdateTime(LocalDateTime.now());
//推送实缴单 tInsuranceSettleService.updateById(tInsuranceSettle);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
String actualBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(actualBody)) {
//推送成功后更新本地推送状态
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}else{ }else{
//异常处理 //异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT); saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
//推送实缴单
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
} }
} }
} }
} }
//未登记保单保费 //变更前为合并结算
if(BigDecimalUtils.isNullOrZero(actualPremium)){ if(CommonConstants.ZERO_INT == oldSettleType){
//变更后为单独结算 //作废旧的结算信息
if (CommonConstants.ONE_INT == newSettleType){ TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
//变更项目且不做处理 cancel.setDeptNo(success.getOldDeptNo());
} cancel.setInsDetailId(success.getId());
//变更后为合并结算 cancel.setSettleId(oldDefaultSettleId);
if (CommonConstants.ZERO_INT == newSettleType){ cancel.setCreateUesr(user.getId());
//生成预估结算信息 cancel.setCreateTime(LocalDateTime.now());
TInsuranceSettle tInsuranceSettle = new TInsuranceSettle(); cancel.setDeptName(success.getOldDeptName());
tInsuranceSettle.setInsDetailId(success.getId()); cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettle.setSettleType(success.getNewSettleType()); tInsuranceSettleCancelService.save(cancel);
tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); TInsuranceSettle byId = tInsuranceSettleService.getById(oldDefaultSettleId);
tInsuranceSettle.setEstimatePremium(estimatePremium); //如果已经登记保费
tInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT); if (!BigDecimalUtils.isNullOrZero(actualPremium)){
tInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT); //新增新的结算信息
tInsuranceSettle.setCreateTime(LocalDateTime.now()); newInsuranceSettle.setInsDetailId(insuranceDetailId);
tInsuranceSettleService.save(tInsuranceSettle); newInsuranceSettle.setSettleType(newSettleType);
//将结算id赋值给保单信息,并新增预估费用 newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId()); newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle);
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper); update(updateWrapper);
//推送结算信息至EKP //如果预估和实缴都推送了
interactiveParam.setDefaultSettleId(tInsuranceSettle.getId()); if(byId.getIsActualPush() == CommonConstants.ONE_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){
interactiveParam.setEstimateStatus(EkpConstants.HAVE); //推送作废结算信息至EKP
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName()); interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo()); interactiveParam.setDeptNo(success.getOldDeptNo());
interactiveParam.setDeptName(success.getNewDeptName()); interactiveParam.setDeptName(success.getOldDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL); interactiveParam.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium()); interactiveParam.setEstimatePremium(one.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam); String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if(StringUtils.isNotBlank(estimateBody)){ if(StringUtils.isNotBlank(deleteBody)){
//推送成功后更新本地推送状态 //推送成功更新作废推送状态
tInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT); cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettle.setEstimatePushTime(LocalDateTime.now()); tInsuranceSettleCancelService.updateById(cancel);
tInsuranceSettle.setUpdateTime(LocalDateTime.now()); //变更为单独结算
tInsuranceSettleService.updateById(tInsuranceSettle); if (CommonConstants.ONE_INT == newSettleType){
}else{ //更新预估费用为0.00
//异常处理 updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT); update(updateWrapper);
} //推送新的结算信息至EKP,推实际保费
} interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
} interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
} interactiveParam.setCustomerCode(success.getNewCustomerCode());
//变更前为合并结算 interactiveParam.setCustomerName(success.getNewCustomerName());
if(CommonConstants.ZERO_INT == oldSettleType){ interactiveParam.setDeptNo(success.getNewDeptNo());
//作废旧的结算信息 interactiveParam.setDeptName(success.getNewDeptName());
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel(); interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
cancel.setDeptNo(success.getOldDeptNo()); interactiveParam.setEstimatePremium(success.getEstimatePremium());
cancel.setInsDetailId(success.getId()); interactiveParam.setActualPremium(success.getActualPremium());
cancel.setSettleId(oldDefaultSettleId); interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
cancel.setCreateUesr(user.getId()); String actualBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
cancel.setCreateTime(LocalDateTime.now()); if(StringUtils.isNotBlank(actualBody)){
cancel.setDeptName(success.getOldDeptName()); //推送成功,更新推送状态
cancel.setIsCancelPush(CommonConstants.ZERO_INT); newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.save(cancel); newInsuranceSettle.setActualPushTime(LocalDateTime.now());
TInsuranceSettle byId = tInsuranceSettleService.getById(oldDefaultSettleId); newInsuranceSettle.setUpdateTime(LocalDateTime.now());
//如果已经登记保费 tInsuranceSettleService.updateById(newInsuranceSettle);
if (!BigDecimalUtils.isNullOrZero(actualPremium)){ }else{
//新增新的结算信息 //异常处理
newInsuranceSettle.setInsDetailId(insuranceDetailId); saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
newInsuranceSettle.setSettleType(newSettleType); }
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT); }
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT); //变更为合并结算
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); if (CommonConstants.ZERO_INT == newSettleType){
newInsuranceSettle.setCreateTime(LocalDateTime.now()); // 推送新的结算信息
newInsuranceSettle.setActualPremium(success.getActualPremium()); interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium()); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
tInsuranceSettleService.save(newInsuranceSettle); interactiveParam.setCustomerCode(success.getNewCustomerCode());
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId()); interactiveParam.setCustomerName(success.getNewCustomerName());
update(updateWrapper); interactiveParam.setDeptNo(success.getNewDeptNo());
//如果预估和实缴都推送了 interactiveParam.setDeptName(success.getNewDeptName());
if(byId.getIsActualPush() == CommonConstants.ONE_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){ interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
//推送作废结算信息至EKP interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setCustomerCode(success.getOldCustomerCode()); interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setCustomerName(success.getOldCustomerName()); interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
interactiveParam.setDeptNo(success.getOldDeptNo()); String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
interactiveParam.setDeptName(success.getOldDeptName()); //推送成功,更新预估和实际保费的推送状态
interactiveParam.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL); if (StringUtils.isNotBlank(estimateBody)) {
interactiveParam.setEstimatePremium(one.getEstimatePremium()); newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
interactiveParam.setActualPremium(one.getActualPremium()); newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL); newInsuranceSettle.setUpdateTime(LocalDateTime.now());
String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam); tInsuranceSettleService.updateById(newInsuranceSettle);
if(StringUtils.isNotBlank(deleteBody)){ //推送实缴单
//推送成功更新作废推送状态 interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
cancel.setIsCancelPush(CommonConstants.ONE_INT); interactiveParam.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleCancelService.updateById(cancel); interactiveParam.setActualPremium(success.getActualPremium());
//变更为单独结算 String actualBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (CommonConstants.ONE_INT == newSettleType){ if (StringUtils.isNotBlank(actualBody)) {
//更新预估费用为0.00 //推送成功后更新本地推送状态
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00")); newInsuranceSettle.setActualPushTime(LocalDateTime.now());
update(updateWrapper); newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
//推送新的结算信息至EKP,推实际保费 newInsuranceSettle.setUpdateTime(LocalDateTime.now());
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId()); tInsuranceSettleService.updateById(newInsuranceSettle);
interactiveParam.setEstimateStatus(EkpConstants.NOTHING); }else{
interactiveParam.setCustomerCode(success.getNewCustomerCode()); //异常处理
interactiveParam.setCustomerName(success.getNewCustomerName()); saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
interactiveParam.setDeptNo(success.getNewDeptNo()); }
interactiveParam.setDeptName(success.getNewDeptName()); }else{
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL); //异常处理
interactiveParam.setEstimatePremium(success.getEstimatePremium()); saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
interactiveParam.setActualPremium(success.getActualPremium()); //推送实缴单
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
String actualBody = eKPInsuranceUtil.sendToEkp(interactiveParam); interactiveParam.setEstimatePremium(success.getEstimatePremium());
if(StringUtils.isNotBlank(actualBody)){ interactiveParam.setActualPremium(success.getActualPremium());
//推送成功,更新推送状态 saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT); }
newInsuranceSettle.setActualPushTime(LocalDateTime.now()); }
newInsuranceSettle.setUpdateTime(LocalDateTime.now()); }else{
tInsuranceSettleService.updateById(newInsuranceSettle); //异常处理
}else{ saveInsuranceEkp(interactiveParam,CommonConstants.FOUR_INT);
//异常处理 //变更为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//推送新的结算信息至EKP,推实际保费
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
//变更为单独结算
if (CommonConstants.ZERO_INT == newSettleType){
// 推送新的结算信息
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
//推送实缴单
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT); saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
} }
} }
//变更为合并结算 }
if (CommonConstants.ZERO_INT == newSettleType){ //如果预估已推送和实缴未推送
// 推送新的结算信息 if(byId.getIsActualPush() == CommonConstants.ZERO_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){
//推送作废结算信息至EKP
interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getOldDeptNo());
interactiveParam.setDeptName(success.getOldDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL);
interactiveParam.setEstimatePremium(one.getEstimatePremium());
interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if(StringUtils.isNotBlank(deleteBody)){
//先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId()); interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
...@@ -4277,11 +4358,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4277,11 +4358,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
interactiveParam.setDeptNo(success.getNewDeptNo()); interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName()); interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL); interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium()); interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam); String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
//推送成功,更新预估和实际保费的推送状态
if (StringUtils.isNotBlank(estimateBody)) { if (StringUtils.isNotBlank(estimateBody)) {
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now()); newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT); newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
...@@ -4311,28 +4392,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4311,28 +4392,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(success.getActualPremium());
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT); saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
} }
} }else{
}else{ //保存预估推送失败的数据
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.FOUR_INT);
//变更为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//推送新的结算信息至EKP,推实际保费
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.NOTHING);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
//变更为单独结算
if (CommonConstants.ZERO_INT == newSettleType){
// 推送新的结算信息
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId()); interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
...@@ -4344,28 +4405,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4344,28 +4405,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT); saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
//推送实缴单 //保存实缴推送失败的数据
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium()); interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(success.getActualPremium());
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT); saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
} }
} }
} //如果预估和实缴均未推送
//如果预估已推送和实缴未推送 if(byId.getIsActualPush() == CommonConstants.ZERO_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){
if(byId.getIsActualPush() == CommonConstants.ZERO_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){
//推送作废结算信息至EKP
interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getOldDeptNo());
interactiveParam.setDeptName(success.getOldDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL);
interactiveParam.setEstimatePremium(one.getEstimatePremium());
interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if(StringUtils.isNotBlank(deleteBody)){
//先推送预估,再推送实际 //先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId()); interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
...@@ -4402,14 +4450,91 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4402,14 +4450,91 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else{ }else{
//异常处理 //异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT); saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
//推送实缴单
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium()); interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(success.getActualPremium());
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT); saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
} }
}
}
//如果没有登记保费
if (BigDecimalUtils.isNullOrZero(actualPremium)){
if(byId.getIsEstimatePush() == CommonConstants.ONE_INT){
interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getOldDeptNo());
interactiveParam.setDeptName(success.getOldDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL);
interactiveParam.setEstimatePremium(one.getEstimatePremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(deleteBody)){
//推送成功后更新作废信息推送状态
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//变更为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//删除预估费用和结算id
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,null);
update(updateWrapper);
}
//变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//新增新的结算信息
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle);
//更新结算信息
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if(StringUtils.isNotBlank(estimateBody)){
//推送成功更新预估推送状态
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
}
}
}else{
saveInsuranceEkp(interactiveParam,CommonConstants.FOUR_INT);
//变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
}
}
}else{ }else{
//保存预估推送失败的数据 //推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId()); interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE); interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
...@@ -4420,170 +4545,29 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4420,170 +4545,29 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
interactiveParam.setEstimatePremium(success.getEstimatePremium()); interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium()); interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL); interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT); String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
//保存实缴推送失败的数据 if(StringUtils.isNotBlank(estimateBody)){
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL); //推送成功更新预估推送状态
interactiveParam.setEstimatePremium(success.getEstimatePremium()); newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
interactiveParam.setActualPremium(success.getActualPremium()); newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}
//如果预估和实缴均未推送
if(byId.getIsActualPush() == CommonConstants.ZERO_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){
//先推送预估,再推送实际
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(estimateBody)) {
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
//推送实缴单
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
String actualBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(actualBody)) {
//推送成功后更新本地推送状态
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now()); newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle); tInsuranceSettleService.updateById(newInsuranceSettle);
}else{ }else{
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}else{
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
interactiveParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}
}
//如果没有登记保费
if (BigDecimalUtils.isNullOrZero(actualPremium)){
if(byId.getIsEstimatePush() == CommonConstants.ONE_INT){
interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getOldDeptNo());
interactiveParam.setDeptName(success.getOldDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL);
interactiveParam.setEstimatePremium(one.getEstimatePremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String deleteBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if (StringUtils.isNotBlank(deleteBody)){
//推送成功后更新作废信息推送状态
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//变更为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//删除预估费用和结算id
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,null);
update(updateWrapper);
}
//变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//新增新的结算信息
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle);
//更新结算信息
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if(StringUtils.isNotBlank(estimateBody)){
//推送成功更新预估推送状态
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
}
}
}else{
saveInsuranceEkp(interactiveParam,CommonConstants.FOUR_INT);
//变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT); saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
} }
} }
}else{
//推送新的结算信息至EKP
interactiveParam.setDefaultSettleId(newInsuranceSettle.getId());
interactiveParam.setEstimateStatus(EkpConstants.HAVE);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
String estimateBody = eKPInsuranceUtil.sendToEkp(interactiveParam);
if(StringUtils.isNotBlank(estimateBody)){
//推送成功更新预估推送状态
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
}
} }
} }
//新增操作信息
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(success.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setDisplayFlag(CommonConstants.ZERO_INT);
insuranceOperate.setOperateDesc(InsurancesConstants.DEPT_CHANGE);
operateList.add(insuranceOperate);
} }
//新增操作信息
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(success.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setDisplayFlag(CommonConstants.ZERO_INT);
insuranceOperate.setOperateDesc(InsurancesConstants.DEPT_CHANGE);
operateList.add(insuranceOperate);
}
}); });
} }
tInsuranceOperateService.saveBatch(operateList); tInsuranceOperateService.saveBatch(operateList);
...@@ -5298,14 +5282,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5298,14 +5282,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
String detailId = insuranceDetail.getId(); String detailId = insuranceDetail.getId();
//查数据是否存在权限范围内
String regionSQL = getRegionSQL(user);
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByRegionSql(regionSQL,detailId);
if (!Optional.ofNullable(detailByRegionSQL).isPresent() || !user.getId().equals(detailByRegionSQL.getUpdateBy())){
param.setErrorMessage(InsurancesConstants.NO_DETAIL_JURISDICTION);
errorList.add(param);
continue;
}
if (flag){ if (flag){
//减员办理 //减员办理
//投保办理状态 //投保办理状态
...@@ -5902,32 +5878,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5902,32 +5878,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return deptList; return deptList;
} }
/**
* 获取地市权限
*
* @author zhaji
* @param user
* @return {@link String}
*/
public String getRegionSQL(YifuUser user){
//todo 根据登录人获取其办理地SQL
String id = user.getId();
String sql ;
//user_id=14, 合肥办理1
//user_id=15,合肥办理2
//user_id=16,上海办理
if(CommonConstants.FOURTEEN_STRING.equals(id)){
sql = "detail.INSURANCE_HANDLE_PROVINCE in (12) and detail.INSURANCE_HANDLE_CITY in (135)";
}else if(CommonConstants.FIFTEEN_STRING.equals(id)){
sql = "detail.INSURANCE_HANDLE_PROVINCE in (12) and detail.INSURANCE_HANDLE_CITY in (135)";
}else if(CommonConstants.SIXTEEN_STRING.equals(id)){
sql = "detail.INSURANCE_HANDLE_PROVINCE in (9) and detail.INSURANCE_HANDLE_CITY in (109)";
}else{
sql = "detail.INSURANCE_HANDLE_PROVINCE in (12,9) and detail.INSURANCE_HANDLE_CITY in (135,109)";
}
return sql;
}
/** /**
* 获取项目名称,客户编码,客户名称 * 获取项目名称,客户编码,客户名称
* *
...@@ -6114,9 +6064,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6114,9 +6064,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
incomeDetail.setSourceType(CommonConstants.THREE_STRING); incomeDetail.setSourceType(CommonConstants.THREE_STRING);
R<TIncomeDetailReturnVo> detailList = socialDaprUtils.getTIncomeDetailList(incomeDetail); R<TIncomeDetailReturnVo> detailList = socialDaprUtils.getTIncomeDetailList(incomeDetail);
if(Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS if(Common.isNotNull(detailList) && detailList.getCode() == CommonConstants.SUCCESS
&& detailList.getData().getDetailList().size() > 0){ && !detailList.getData().getDetailList().isEmpty()){
incomeDetailList = detailList.getData().getDetailList(); incomeDetailList = detailList.getData().getDetailList();
isExist = true; BigDecimal sumMoney = BigDecimal.ZERO;
for (TIncomeDetail income : incomeDetailList) {
sumMoney = BigDecimalUtils.safeAdd(income.getMoney(), sumMoney);
}
if (sumMoney.compareTo(BigDecimal.ZERO) > 0) {
isExist = true;
}
} }
//预估或者实缴保费 //预估或者实缴保费
...@@ -6191,16 +6147,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6191,16 +6147,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) { if (CommonConstants.ZERO_STRING.equals(settleDomain.getRiskFundTag())) {
if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) { if (CommonConstants.ONE_STRING.equals(settleDomain.getMrSettleType())) {
if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) { if (CommonConstants.THREE_STRING.equals(settleDomain.getRiskFundType())) {
if (Common.isNotNull(incomeDetailList)) { if (Common.isNotNull(incomeDetailList)) {
for (TIncomeDetail incomeDetailSum: incomeDetailList) { for (TIncomeDetail incomeDetailSum: incomeDetailList) {
if (!(incomeDetailSum.getSourceId().equals(insuranceDetail.getId()) && if (!(incomeDetailSum.getSourceId().equals(insuranceDetail.getId()) &&
CommonConstants.TWO_STRING.equals(incomeDetailSum.getFeeType()) && CommonConstants.TWO_STRING.equals(incomeDetailSum.getFeeType()) &&
CommonConstants.ONE_STRING.equals(incomeDetailSum.getMrSettleType()))) { CommonConstants.ONE_STRING.equals(incomeDetailSum.getMrSettleType()))) {
isSum = 3; isSum = 3;
break; break;
}
} }
} }
}
} }
if (!isExist || isSum == 3) { if (!isExist || isSum == 3) {
createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.TWO_STRING, createIncomeInsurance(insuranceDetail, settleDomain, CommonConstants.TWO_STRING,
......
...@@ -95,6 +95,9 @@ ...@@ -95,6 +95,9 @@
detail.SETTLE_MONTH as settleMonth detail.SETTLE_MONTH as settleMonth
from t_insurance_detail detail from t_insurance_detail detail
where detail.DELETE_FLAG = 0 where detail.DELETE_FLAG = 0
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on detail.CREATE_BY=p.USER_ID
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''"> <if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO = #{param.deptNo} and detail.DEPT_NO = #{param.deptNo}
</if> </if>
...@@ -137,6 +140,10 @@ ...@@ -137,6 +140,10 @@
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if> </if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
GROUP BY detail.id
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
<!--投保不分页查询--> <!--投保不分页查询-->
...@@ -218,6 +225,9 @@ ...@@ -218,6 +225,9 @@
detail.SETTLE_TYPE as settleType, detail.SETTLE_TYPE as settleType,
detail.SETTLE_MONTH as settleMonth detail.SETTLE_MONTH as settleMonth
from t_insurance_detail detail from t_insurance_detail detail
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on detail.CREATE_BY=p.USER_ID
</if>
where detail.DELETE_FLAG = 0 where detail.DELETE_FLAG = 0
<if test="param.deptNo != null and param.deptNo.trim() != ''"> <if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO = #{param.deptNo} and detail.DEPT_NO = #{param.deptNo}
...@@ -243,9 +253,6 @@ ...@@ -243,9 +253,6 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="param.regionSql != null and param.regionSql.trim() != ''">
and ${param.regionSql}
</if>
<if test="param.updateBy != null and param.updateBy.trim() != ''"> <if test="param.updateBy != null and param.updateBy.trim() != ''">
and detail.HANDLED_BY = #{param.updateBy} and detail.HANDLED_BY = #{param.updateBy}
</if> </if>
...@@ -258,6 +265,10 @@ ...@@ -258,6 +265,10 @@
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if> </if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
GROUP BY detail.id
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
<!--通过id查询商险信息--> <!--通过id查询商险信息-->
...@@ -365,6 +376,9 @@ ...@@ -365,6 +376,9 @@
detail.POLICY_NO as policyNo, detail.POLICY_NO as policyNo,
detail.REMARK as remark detail.REMARK as remark
from t_insurance_detail detail from t_insurance_detail detail
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on detail.CREATE_BY=p.USER_ID
</if>
where detail.DELETE_FLAG = 0 and detail.BUY_HANDLE_STATUS = 1 where detail.DELETE_FLAG = 0 and detail.BUY_HANDLE_STATUS = 1
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%') and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
...@@ -378,9 +392,6 @@ ...@@ -378,9 +392,6 @@
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%') and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.regionSql != null and param.regionSql.trim() != ''">
and ${param.regionSql}
</if>
<if test="param.buyType != null"> <if test="param.buyType != null">
and detail.BUY_TYPE = #{param.buyType} and detail.BUY_TYPE = #{param.buyType}
</if> </if>
...@@ -390,6 +401,10 @@ ...@@ -390,6 +401,10 @@
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if> </if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
GROUP BY detail.id
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
<!--批量更新保单号--> <!--批量更新保单号-->
...@@ -428,6 +443,9 @@ ...@@ -428,6 +443,9 @@
detail.BUY_STANDARD as buyStandard detail.BUY_STANDARD as buyStandard
from from
t_insurance_detail detail t_insurance_detail detail
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on detail.CREATE_BY=p.USER_ID
</if>
where where
detail.DELETE_FLAG = 0 detail.DELETE_FLAG = 0
and and
...@@ -481,6 +499,10 @@ ...@@ -481,6 +499,10 @@
<if test="param.createEndTime != null and param.createEndTime.trim() != ''"> <if test="param.createEndTime != null and param.createEndTime.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, ' 23:59:59') AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, ' 23:59:59')
</if> </if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
GROUP BY detail.id
ORDER BY detail.CREATE_TIME DESC ,detail.ID ASC ORDER BY detail.CREATE_TIME DESC ,detail.ID ASC
</select> </select>
<!-- 已投保列表不分页查询--> <!-- 已投保列表不分页查询-->
...@@ -587,6 +609,9 @@ ...@@ -587,6 +609,9 @@
from from
t_insurance_detail detail, t_insurance_detail detail,
t_insurance_refund refund t_insurance_refund refund
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on detail.CREATE_BY=p.USER_ID
</if>
where where
detail.DELETE_FLAG = 0 detail.DELETE_FLAG = 0
and and
...@@ -627,6 +652,10 @@ ...@@ -627,6 +652,10 @@
(detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) (detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59'))
) )
</if> </if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
GROUP BY detail.id
ORDER BY refund.CREATE_TIME DESC,detail.ID ASC ORDER BY refund.CREATE_TIME DESC,detail.ID ASC
</select> </select>
<!-- 已减员列表不分页查询--> <!-- 已减员列表不分页查询-->
...@@ -721,6 +750,9 @@ ...@@ -721,6 +750,9 @@
from from
t_insurance_detail detail, t_insurance_detail detail,
t_insurance_refund refund t_insurance_refund refund
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on detail.CREATE_BY=p.USER_ID
</if>
where where
detail.REFUND_ID = refund.ID detail.REFUND_ID = refund.ID
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
...@@ -741,9 +773,6 @@ ...@@ -741,9 +773,6 @@
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName} and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if> </if>
<if test="param.regionSql != null and param.regionSql.trim() != ''">
and ${param.regionSql}
</if>
<if test="param.updateBy != null and param.updateBy.trim() != ''"> <if test="param.updateBy != null and param.updateBy.trim() != ''">
and refund.UPDATE_BY = #{param.updateBy} and refund.UPDATE_BY = #{param.updateBy}
</if> </if>
...@@ -756,6 +785,10 @@ ...@@ -756,6 +785,10 @@
<if test="param.endDate != null and param.endDate.trim() != ''"> <if test="param.endDate != null and param.endDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if> </if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
GROUP BY detail.id
ORDER BY refund.CREATE_TIME DESC,detail.ID ASC ORDER BY refund.CREATE_TIME DESC,detail.ID ASC
</select> </select>
<!-- 查询保单列表--> <!-- 查询保单列表-->
...@@ -861,6 +894,9 @@ ...@@ -861,6 +894,9 @@
detail.REMARK as remark detail.REMARK as remark
from from
t_insurance_detail detail t_insurance_detail detail
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on detail.CREATE_BY=p.USER_ID
</if>
where where
detail.DELETE_FLAG = 0 and detail.REDUCE_HANDLE_STATUS = 1 detail.DELETE_FLAG = 0 and detail.REDUCE_HANDLE_STATUS = 1
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
...@@ -878,9 +914,10 @@ ...@@ -878,9 +914,10 @@
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName} and detail.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if> </if>
<if test="param.regionSql != null and param.regionSql.trim() != ''"> <if test="param.authSql != null and param.authSql.trim() != ''">
and ${param.regionSql} ${param.authSql}
</if> </if>
GROUP BY detail.id
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
<!-- 减员办理--> <!-- 减员办理-->
...@@ -926,20 +963,6 @@ ...@@ -926,20 +963,6 @@
</where> </where>
ORDER BY CREATE_TIME desc ORDER BY CREATE_TIME desc
</select> </select>
<!--查数据是否存在权限范围内-->
<select id="selectByRegionSql" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
SELECT
<include refid="Base_Column_List"/>
FROM
t_insurance_detail detail
<where>
detail.ID = #{id}
<if test="regionSql != null and regionSql.trim() != ''">
and ${regionSql}
</if>
</where>
ORDER BY CREATE_TIME desc
</select>
<!--商险订单列表查询--> <!--商险订单列表查询-->
<select id="getOrderInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredOrderListVo"> <select id="getOrderInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredOrderListVo">
( (
......
...@@ -197,7 +197,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -197,7 +197,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
} }
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error("薪资导入异常:",e);
return R.failed("数据导入解析失败!"); return R.failed("数据导入解析失败!");
} }
......
...@@ -185,7 +185,7 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc ...@@ -185,7 +185,7 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
List<THaveSalaryNoSocialExportVo> list = new ArrayList<>(); List<THaveSalaryNoSocialExportVo> list = new ArrayList<>();
// TODO // TODO
List<String> settleDomainIds =null; List<String> settleDomainIds =null;
List<String> ids = null; List<String> ids = Common.getList(searchVo.getIds());
String sql = null; String sql = null;
int count = noPageCountDiy(searchVo,settleDomainIds,ids,sql); int count = noPageCountDiy(searchVo,settleDomainIds,ids,sql);
ServletOutputStream out = null; ServletOutputStream out = null;
......
...@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
...@@ -95,6 +96,10 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper, ...@@ -95,6 +96,10 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
ExcelUtil<TSalaryAccount> util = new ExcelUtil<>(TSalaryAccount.class); ExcelUtil<TSalaryAccount> util = new ExcelUtil<>(TSalaryAccount.class);
for (TSalaryAccount vo : list) { for (TSalaryAccount vo : list) {
if (CommonConstants.THREE_STRING.equals(vo.getFormType())){
vo.setRelaySalary(vo.getRelaySalaryUnit());
vo.setSalaryTax(BigDecimalUtils.safeAdd(vo.getSalaryTax(),vo.getSalaryTaxUnit()));
}
util.convertEntity(vo, null, null, null); util.convertEntity(vo, null, null, null);
} }
} }
......
...@@ -317,6 +317,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -317,6 +317,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund, false); , fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund, false);
if (coreR != null) return coreR; if (coreR != null) return coreR;
boolean isSaveAndUpdate = false; boolean isSaveAndUpdate = false;
TSocialFundInfo socialFundInfo;
TSocialFundInfo socialFundInfoF;
List<TForecastLibrary> libraryFundInfoListSocial = new ArrayList<>();
List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>();
for (TForecastLibrary library : saveLibraryMap.values()) { for (TForecastLibrary library : saveLibraryMap.values()) {
if (Common.isEmpty(library.getSocialId()) && Common.isEmpty(library.getProvidentId())) { if (Common.isEmpty(library.getSocialId()) && Common.isEmpty(library.getProvidentId())) {
continue; continue;
...@@ -333,31 +340,41 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -333,31 +340,41 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
} }
//生成社保收入 //生成社保收入
TSocialFundInfo socialFundInfo = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda() socialFundInfo = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getEmpIdcard, empIdCard) .eq(TSocialFundInfo::getEmpIdcard, empIdCard)
.eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId()) .eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId())
.eq(TSocialFundInfo::getSocialHousehold, library.getSocialHousehold())); .eq(TSocialFundInfo::getSocialHousehold, library.getSocialHousehold()));
if (Common.isNotNull(socialFundInfo)) { if (Common.isNotNull(socialFundInfo) && (Common.isNotNull(socialFundInfo.getSocialId())
if (Common.isNotNull(socialFundInfo.getSocialId()) && CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus()) || CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus()))) {
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) { //办理成功生成收入
//办理成功生成收入 createIncomeInfo(library);
createIncomeInfo(library); if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListSocial.add(library);
} }
} }
//生成公积金收入 //生成公积金收入
TSocialFundInfo socialFundInfoF = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda() socialFundInfoF = socialFundInfoMapper.selectOne(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getEmpIdcard, empIdCard) .eq(TSocialFundInfo::getEmpIdcard, empIdCard)
.eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId()) .eq(TSocialFundInfo::getSettleDomain, library.getSettleDomainId())
.eq(TSocialFundInfo::getProvidentHousehold, library.getProvidentHousehold())); .eq(TSocialFundInfo::getProvidentHousehold, library.getProvidentHousehold()));
if (Common.isNotNull(socialFundInfoF)) { if (Common.isNotNull(socialFundInfoF) && (Common.isNotNull(socialFundInfoF.getFundId())
if (Common.isNotNull(socialFundInfoF.getFundId()) && CommonConstants.THREE_STRING.equals(socialFundInfoF.getFundStatus()))) {
&& CommonConstants.THREE_STRING.equals(socialFundInfoF.getFundStatus())) { //办理成功生成收入
//办理成功生成收入 createIncomeInfo(library);
createIncomeInfo(library); if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListFund.add(library);
} }
} }
} }
//推送社保明细
if (Common.isNotNull(libraryFundInfoListSocial)) {
pushForecastInfo(libraryFundInfoListSocial);
}
//推送公积金明细
if (Common.isNotNull(libraryFundInfoListFund)) {
pushForecastFundInfo(libraryFundInfoListFund);
}
if (isSaveAndUpdate) { if (isSaveAndUpdate) {
return R.ok(null, "执行成功!"); return R.ok(null, "执行成功!");
} else { } else {
...@@ -1498,6 +1515,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1498,6 +1515,8 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
@Override @Override
public R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo, int forecastFlag) { public R<String> updateForecastLibaryByDispatchReduce(TSocialFundInfo socialFundInfo, int forecastFlag) {
String empIdCard = socialFundInfo.getEmpIdcard(); String empIdCard = socialFundInfo.getEmpIdcard();
List<TForecastLibrary> libraryFundInfoListSocial = new ArrayList<>();
List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>();
if (Common.isNotNull(empIdCard)) { if (Common.isNotNull(empIdCard)) {
Date minStartDate = this.getMinSocialDate(socialFundInfo); Date minStartDate = this.getMinSocialDate(socialFundInfo);
BigDecimal zero = BigDecimal.ZERO; BigDecimal zero = BigDecimal.ZERO;
...@@ -1514,11 +1533,11 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1514,11 +1533,11 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (socialReduceDate != null) { if (socialReduceDate != null) {
// 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据 // 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据
if (DateUtil.formatDateInt(socialReduceDate) <= Integer.parseInt(library.getSocialPayMonth())) { if (DateUtil.formatDateInt(socialReduceDate) <= Integer.parseInt(library.getSocialPayMonth())) {
this.calculateSocialType(zero, library); this.calculateSocialType(zero, library, libraryFundInfoListSocial);
} }
} else { } else {
if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getSocialPayMonth())) { if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getSocialPayMonth())) {
this.calculateSocialType(zero, library); this.calculateSocialType(zero, library, libraryFundInfoListSocial);
} }
} }
} }
...@@ -1539,22 +1558,30 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1539,22 +1558,30 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
if (fundReduceDate != null) { if (fundReduceDate != null) {
// 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据 // 存在社保派减且处于派减期间内,未被预估结算,工资结算引用则清空相关数据
if (DateUtil.formatDateInt(fundReduceDate) <= Integer.parseInt(library.getProvidentPayMonth())) { if (DateUtil.formatDateInt(fundReduceDate) <= Integer.parseInt(library.getProvidentPayMonth())) {
this.calculateFundType(zero, library); this.calculateFundType(zero, library,libraryFundInfoListFund);
} }
} else { } else {
if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getProvidentPayMonth())) { if (DateUtil.formatDateInt(minStartDate) <= Integer.parseInt(library.getProvidentPayMonth())) {
this.calculateFundType(zero, library); this.calculateFundType(zero, library,libraryFundInfoListFund);
} }
} }
} }
} }
} }
} }
//推送社保明细
if (Common.isNotNull(libraryFundInfoListSocial)) {
pushForecastInfo(libraryFundInfoListSocial);
}
//推送公积金明细
if (Common.isNotNull(libraryFundInfoListFund)) {
pushForecastFundInfo(libraryFundInfoListFund);
}
} }
return R.ok(); return R.ok();
} }
private void calculateSocialType(BigDecimal zero, TForecastLibrary library) { private void calculateSocialType(BigDecimal zero, TForecastLibrary library,List<TForecastLibrary> libraryFundInfoListSocial) {
if (library.getDataPush() == CommonConstants.ONE_INT || CommonConstants.ONE_STRING.equals(library.getSalarySocialFlag())) { if (library.getDataPush() == CommonConstants.ONE_INT || CommonConstants.ONE_STRING.equals(library.getSalarySocialFlag())) {
// 加负数 // 加负数
TForecastLibrary negateLib = new TForecastLibrary(); TForecastLibrary negateLib = new TForecastLibrary();
...@@ -1580,6 +1607,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1580,6 +1607,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
negateLib.setSumAll(BigDecimalUtils.safeSubtract(false, zero, library.getSumAll())); negateLib.setSumAll(BigDecimalUtils.safeSubtract(false, zero, library.getSumAll()));
negateLib.setDiffType(SocialConstants.DIFF_TYPE_TWO); negateLib.setDiffType(SocialConstants.DIFF_TYPE_TWO);
baseMapper.insert(negateLib); baseMapper.insert(negateLib);
libraryFundInfoListSocial.add(negateLib);
} else { } else {
// 删除 // 删除
baseMapper.deleteById(library.getId()); baseMapper.deleteById(library.getId());
...@@ -1603,7 +1631,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1603,7 +1631,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
} }
private void calculateFundType(BigDecimal zero, TForecastLibrary library) { private void calculateFundType(BigDecimal zero, TForecastLibrary library, List<TForecastLibrary> libraryFundInfoListFund) {
if (library.getDataPush() == CommonConstants.ONE_INT || CommonConstants.ONE_STRING.equals(library.getSalaryFundFlag())) { if (library.getDataPush() == CommonConstants.ONE_INT || CommonConstants.ONE_STRING.equals(library.getSalaryFundFlag())) {
// 加负数 // 加负数
TForecastLibrary negateLib = new TForecastLibrary(); TForecastLibrary negateLib = new TForecastLibrary();
...@@ -1618,6 +1646,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1618,6 +1646,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
negateLib.setSumAll(BigDecimalUtils.safeSubtract(false, zero, library.getSumAll())); negateLib.setSumAll(BigDecimalUtils.safeSubtract(false, zero, library.getSumAll()));
negateLib.setDiffType(SocialConstants.DIFF_TYPE_TWO); negateLib.setDiffType(SocialConstants.DIFF_TYPE_TWO);
baseMapper.insert(negateLib); baseMapper.insert(negateLib);
libraryFundInfoListFund.add(negateLib);
} else { } else {
// 删除 // 删除
baseMapper.deleteById(library.getId()); baseMapper.deleteById(library.getId());
...@@ -2192,13 +2221,15 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2192,13 +2221,15 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
isSaveAndUpdate = true; isSaveAndUpdate = true;
} }
List<TForecastLibrary> libraryFundInfoListSocial = new ArrayList<>();
List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>();
//社保收入 //社保收入
if (Common.isNotNull(socialFundInfo.getSocialId()) if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus()) && CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) { || CommonConstants.THREE_STRING.equals(socialFundInfo.getSocialStatus())) {
//获取所有的预估数据 //获取所有的预估数据
List<TForecastLibrary> librarySocialInfoList = null; List<TForecastLibrary> librarySocialInfoList;
librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() librarySocialInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard) .eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain()) .eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain())
...@@ -2208,6 +2239,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2208,6 +2239,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
for (TForecastLibrary library : librarySocialInfoList) { for (TForecastLibrary library : librarySocialInfoList) {
//办理成功生成收入 //办理成功生成收入
createIncomeInfo(library); createIncomeInfo(library);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListSocial.add(library);
}
} }
} }
} }
...@@ -2217,7 +2251,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2217,7 +2251,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
&& CommonConstants.THREE_STRING.equals(socialFundInfo.getFundStatus())) { && CommonConstants.THREE_STRING.equals(socialFundInfo.getFundStatus())) {
//获取所有的预估数据 //获取所有的预估数据
List<TForecastLibrary> libraryFundInfoList = null; List<TForecastLibrary> libraryFundInfoList;
libraryFundInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda() libraryFundInfoList = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getEmpIdcard, empIdCard) .eq(TForecastLibrary::getEmpIdcard, empIdCard)
.eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain()) .eq(TForecastLibrary::getSettleDomainId, socialFundInfo.getSettleDomain())
...@@ -2227,9 +2261,20 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2227,9 +2261,20 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
for (TForecastLibrary library : libraryFundInfoList) { for (TForecastLibrary library : libraryFundInfoList) {
//办理成功生成收入 //办理成功生成收入
createIncomeInfo(library); createIncomeInfo(library);
if (CommonConstants.ZERO_INT == library.getDataPush()) {
libraryFundInfoListFund.add(library);
}
} }
} }
} }
//推送社保明细
if (Common.isNotNull(libraryFundInfoListSocial)) {
pushForecastInfo(libraryFundInfoListSocial);
}
//推送公积金明细
if (Common.isNotNull(libraryFundInfoListFund)) {
pushForecastFundInfo(libraryFundInfoListFund);
}
if (isSaveAndUpdate) { if (isSaveAndUpdate) {
return R.ok(null, "执行成功!"); return R.ok(null, "执行成功!");
} else { } else {
......
...@@ -1172,12 +1172,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1172,12 +1172,12 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
} }
// 默认合同名称为代理社保 合同类型为其他 // 默认合同名称为代理社保 合同类型为其他
info.setContractNameAdd(PreDispatchConstants.CONTRACT_NAME); info.setContractNameAdd(PreDispatchConstants.CONTRACT_NAME);
info.setContractTypeAdd(CommonConstants.THREE_STRING); info.setContractTypeAdd(CommonConstants.ONE_STRING);
info.setContractStartAdd(info.getContractStart()); info.setContractStartAdd(DateUtil.getFirstDayString(info.getPensionStart()));
// 默认为开始时间后的两年时间 // 默认为开始时间后的两年时间
info.setContractEndAdd(info.getContractEnd()); info.setContractEndAdd(DateUtil.getFirstDayString(DateUtil.getYearAndMonth(info.getPensionStart(),24)));
// 默认合同期限2年 // 默认合同期限2年
info.setContractTermAdd(Integer.toString(Common.getYearOfTime(info.getContractStart(), info.getContractEnd()))); info.setContractTermAdd(CommonConstants.TWO_STRING);
// 默认工时制 综合工时制2 // 默认工时制 综合工时制2
info.setWorkingHoursAdd(CommonConstants.TWO_STRING); info.setWorkingHoursAdd(CommonConstants.TWO_STRING);
......
...@@ -191,7 +191,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -191,7 +191,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
List<String> dnList = sysDeptMapper.selectDnList(); List<String> dnList = sysDeptMapper.selectDnList();
List<String> delList = dnList.stream().filter(p-> !entryDnList.contains(p)).collect(Collectors.toList()); List<String> delList = dnList.stream().filter(p-> !entryDnList.contains(p)).collect(Collectors.toList());
//删除ldap中不存在的dn的数据 //删除ldap中不存在的dn的数据
if (delList.size() >0) { if (!delList.isEmpty()) {
sysDeptMapper.delete(Wrappers.<SysDept>query().lambda().in(SysDept::getDeptDn, delList)); sysDeptMapper.delete(Wrappers.<SysDept>query().lambda().in(SysDept::getDeptDn, delList));
} }
List<Map<String,Object>> updUserList = new ArrayList<>(); List<Map<String,Object>> updUserList = new ArrayList<>();
...@@ -202,7 +202,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -202,7 +202,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
userId = dn.substring(4, dn.indexOf(",", 1)); userId = dn.substring(4, dn.indexOf(",", 1));
dn = dn.substring(dn.indexOf(",", 1) + 1); dn = dn.substring(dn.indexOf(",", 1) + 1);
} }
List<String> saveDnList = Arrays.asList(dn.split(",")).stream().filter(e -> (e.contains("ou=") && !e.equals("ou=wanxin"))).collect(Collectors.toList()); List<String> saveDnList = Arrays.stream(dn.split(",")).filter(e -> (e.contains("ou=") && !e.equals("ou=wanxin"))).collect(Collectors.toList());
String deptName = saveDnList.get(0).replace("ou=", ""); String deptName = saveDnList.get(0).replace("ou=", "");
int size = saveDnList.size(); int size = saveDnList.size();
if (size == 1) { if (size == 1) {
...@@ -220,7 +220,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl ...@@ -220,7 +220,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
sysDept.setName(deptName); sysDept.setName(deptName);
this.updateDeptById(sysDept); this.updateDeptById(sysDept);
} }
} else if (size >= 2) { } else {
try { try {
SysDept sysDept = this.getOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn.substring(dn.indexOf("ou=", 2), dn.length()))); SysDept sysDept = this.getOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn.substring(dn.indexOf("ou=", 2), dn.length())));
if (null != sysDept) { if (null != sysDept) {
......
...@@ -380,8 +380,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -380,8 +380,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
// 根据角色名称查询角色ID // 根据角色名称查询角色ID
List<Long> roleIdList = roleCollList.stream().map(SysRole::getRoleId).collect(Collectors.toList()); List<Long> roleIdList = roleCollList.stream().map(SysRole::getRoleId).collect(Collectors.toList());
userDTO.setRole(roleIdList); userDTO.setRole(roleIdList);
// List<Long> postIdList = postCollList.stream().map(SysPost::getPostId).collect(Collectors.toList());
// userDTO.setPost(postIdList);
// 插入用户 // 插入用户
this.saveUser(userDTO); this.saveUser(userDTO);
} }
...@@ -433,10 +431,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -433,10 +431,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
insertList.add(personVo); insertList.add(personVo);
} }
} }
if (updateList.size() > 0) { if (!updateList.isEmpty()) {
sysUserMapper.batchUpdateUser(updateList); sysUserMapper.batchUpdateUser(updateList);
} }
if (insertList.size() > 0) { if (!insertList.isEmpty()) {
sysUserMapper.batchInsertUser(insertList); sysUserMapper.batchInsertUser(insertList);
} }
} }
...@@ -447,7 +445,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -447,7 +445,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
List<String> dnList = sysDeptMapper.selectDnList(); List<String> dnList = sysDeptMapper.selectDnList();
List<String> delList = dnList.stream().filter(p-> !entryDnList.contains(p)).collect(Collectors.toList()); List<String> delList = dnList.stream().filter(p-> !entryDnList.contains(p)).collect(Collectors.toList());
//删除ldap中不存在的dn的数据 //删除ldap中不存在的dn的数据
if (delList.size() >0) { if (!delList.isEmpty()) {
sysDeptMapper.delete(Wrappers.<SysDept>query().lambda().in(SysDept::getDeptDn, delList)); sysDeptMapper.delete(Wrappers.<SysDept>query().lambda().in(SysDept::getDeptDn, delList));
} }
List<Map<String,Object>> updUserList = new ArrayList<>(); List<Map<String,Object>> updUserList = new ArrayList<>();
...@@ -458,7 +456,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -458,7 +456,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
userId = dn.substring(4, dn.indexOf(",", 1)); userId = dn.substring(4, dn.indexOf(",", 1));
dn = dn.substring(dn.indexOf(",", 1) + 1); dn = dn.substring(dn.indexOf(",", 1) + 1);
} }
List<String> saveDnList = Arrays.asList(dn.split(",")).stream().filter(e -> (e.contains("ou=") && !e.equals("ou=wanxin"))).collect(Collectors.toList()); List<String> saveDnList = Arrays.stream(dn.split(",")).filter(e -> (e.contains("ou=") && !e.equals("ou=wanxin"))).collect(Collectors.toList());
String deptName = saveDnList.get(0).replace("ou=", ""); String deptName = saveDnList.get(0).replace("ou=", "");
int size = saveDnList.size(); int size = saveDnList.size();
if (size == 1) { if (size == 1) {
...@@ -476,7 +474,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -476,7 +474,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
sysDept.setName(deptName); sysDept.setName(deptName);
sysDeptMapper.updateById(sysDept); sysDeptMapper.updateById(sysDept);
} }
} else if (size >= 2) { } else {
SysDept sysDept = sysDeptMapper.selectOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn.substring(dn.indexOf("ou=", 2), dn.length()))); SysDept sysDept = sysDeptMapper.selectOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn.substring(dn.indexOf("ou=", 2), dn.length())));
if (null != sysDept) { if (null != sysDept) {
SysDept sysDeptCount = sysDeptMapper.selectOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn)); SysDept sysDeptCount = sysDeptMapper.selectOne(Wrappers.<SysDept>query().lambda().eq(SysDept::getDeptDn, dn));
......
...@@ -210,17 +210,15 @@ ...@@ -210,17 +210,15 @@
<insert id="batchInsertUser" parameterType="java.util.List"> <insert id="batchInsertUser" parameterType="java.util.List">
insert into sys_user insert into sys_user
(user_id,username,phone,email,password,nickname,deptId,create_time) (user_id,username,phone,email,nickname,create_time)
VALUES VALUES
<foreach collection="list" item="item" index="index" separator=","> <foreach collection="list" item="item" index="index" separator=",">
( (
REPLACE(UUID(),"-",""), REPLACE(UUID(),"-",""),
#{item.uid,jdbcType=VARCHAR}, #{item.uid},
#{item.telephoneNumber,jdbcType=VARCHAR}, #{item.telephoneNumber},
#{item.email,jdbcType=VARCHAR}, #{item.email},
#{item.password,jdbcType=VARCHAR}, #{item.personName},
#{item.personName,jdbcType=VARCHAR},
#{item.deptId,jdbcType=VARCHAR},
now() now()
) )
</foreach> </foreach>
......
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