Commit 2209c6b3 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents a43aedad fc4fa1fc
......@@ -243,6 +243,8 @@ public interface CommonConstants {
int FIVE_INT = 5;
String TEN_STRING = "10";
int SEVEN_INT = 7;
public static final String SPOT = ".";
int FIFTY_INT = 50;
......
......@@ -881,13 +881,13 @@ public class InsurancesConstants {
*/
public static final String REFUND_STATUS_ONE_HANDLE_ERROR = "当前为待减员状态,不可办理";
/**
* 当前为已减员状态,不可办理
* 当前为减员退回状态,不可办理
*/
public static final String REFUND_STATUS_THREE_HANDLE_ERROR = "当前为已减员状态,不可办理";
public static final String REFUND_STATUS_THREE_HANDLE_ERROR = "当前为减员退回状态,不可办理";
/**
* 当前为减员退回状态,不可办理
* 当前为已减员状态,不可办理
*/
public static final String REFUND_STATUS_FOUR_HANDLE_ERROR = "当前为减员退回状态,不可办理";
public static final String REFUND_STATUS_FOUR_HANDLE_ERROR = "当前为已减员状态,不可办理";
/**
* 办理意见长度超过50字符限制
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
......@@ -136,12 +138,18 @@ public class TInsuranceEkp implements Serializable {
/**
* 创建时间
*/
private Date createTime;
private LocalDateTime createTime;
/**
* 发送时间
*/
private Date pushTime;
private LocalDateTime pushTime;
/**
* EKP推送类型
*/
@Schema(description = "1推送预估费用,2推送实缴费用,3变更结算月,4推送作废信息,5推送红冲信息,6投保退回红冲,7变更保单保费")
private Integer pushType;
private static final long serialVersionUID = 1L;
......
......@@ -85,7 +85,7 @@ public class EKPUtil {
public static String sendToEKP(EKPInteractiveParam param){
log.info("推送EKP开始");
RestTemplate yourRestTemplate = new RestTemplate();
TInsuranceSettlePushParam pushParam = InsuranceDetail2PushParam(param);
TInsuranceSettlePushParam pushParam = insuranceDetail2PushParam(param);
try{
String formValues = new ObjectMapper().writeValueAsString(pushParam);
//指向EKP的接口url
......@@ -134,7 +134,7 @@ public class EKPUtil {
* @param param 转换类
* @return {@link TInsuranceSettlePushParam}
*/
public static TInsuranceSettlePushParam InsuranceDetail2PushParam(EKPInteractiveParam param){
public static TInsuranceSettlePushParam insuranceDetail2PushParam(EKPInteractiveParam param){
String format = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
TInsuranceSettlePushParam pushParam = new TInsuranceSettlePushParam();
param.setHappenDate(format);
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
/**
* @author zhaji
* @description TODO
* @date 2022-08-08 17:59:20
*/
@Data
public class EKP {
@Value("${ekp.url}")
private String url;
@Value("${ekp.fdModelId}")
private String fdModelId;
@Value("${ekp.fdFlowId}")
private String fdFlowId;
@Value("${ekp.docStatus}")
private String docStatus;
@Value("${ekp.docSubject}")
private String docSubject;
}
......@@ -165,4 +165,10 @@ public class EKPInteractiveParam implements Serializable {
@Schema(description = "状态:1新增结算单,2更新结算单信息,3作废结算单信息")
private Integer interactiveType;
/**
* EKP推送类型
*/
@Schema(description = "1推送预估费用,2推送实缴费用,3变更结算月,4推送作废信息,5推送红冲信息,6投保退回红冲,7变更保单保费")
private Integer pushType;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaji
* @description EKP结算信息表
* @date 2022-08-24 17:37:21
*/
@Data
@Tag(name = "EKP结算信息表")
public class SettleVo implements Serializable {
/**
* 结算id
*/
@Schema(description = "结算id")
private String fd_3b05ba46bb042e;
/**
* 预估单结算状态
*/
@Schema(description = "预估单结算状态:未结算、已结算、结算中、无需结算")
private String fd_3b05ba4808a3ca;
/**
* 实缴单结算状态
*/
@Schema(description = "实缴单结算状态:未结算、已结算、结算中、无需结算")
private String fd_3b05bd5ed0b976;
}
......@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author Administrator
* @description 针对表【t_insurance_ekp(ekp交互失败存储表)】的数据库操作Mapper
......@@ -13,5 +15,13 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TInsuranceEkpMapper extends BaseMapper<TInsuranceEkp> {
/**
* 获取所有待发送的ekp
*
* @author zhaji
* @param
* @return {@link List< TInsuranceEkp>}
*/
List<TInsuranceEkp> getEkpRefundList();
}
......@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Sets;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
......@@ -78,9 +77,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Resource
private TInsuranceOperateService tInsuranceOperateService;
@Resource
private CheckDaprUtil checkDaprUtil;
@Resource
private TInsuranceRefundService tInsuranceRefundService;
@Resource
private TInsuranceEkpService tInsuranceEkpService;
@Resource
private TInsuranceSettleCancelService tInsuranceSettleCancelService;
......@@ -1025,7 +1026,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//获取成功数据的remark
paramList.stream().forEach(e ->{
if (detail.getId().equals(e.getId())){
......@@ -1223,7 +1223,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateBatchById(successList);
if (CollectionUtils.isNotEmpty(successList)){
threadPool.execute(() -> {
//todo 根据结算类型是合并结算,推送预估保费到ekp(上面已经算好,这里直接判断有预估保费的就推送)
//根据结算类型是合并结算,推送预估保费到ekp(上面已经算好,这里直接判断有预估保费的就推送)
for (TInsuranceDetail tInsuranceDetail : successList) {
Integer settleType = tInsuranceDetail.getSettleType();
//如果是合并计算则推送至EKP
......@@ -1237,8 +1237,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.set(TInsuranceSettle :: getEstimatePushTime,LocalDateTime.now());
//更新结算信息表
tInsuranceSettleService.update(settleWrapper);
}else{
//todo 异常处理
}
}
}
......@@ -1325,6 +1323,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (detail.getActualPremium() == null || (new BigDecimal(success.getActualPremium()).compareTo(detail.getActualPremium()) != 0)){
// todo 判断是否推送过ekp,没推送过调新增接口,推送过调更新接口
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
SettleVo settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId());
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){
settle.setActualPremium(new BigDecimal(success.getActualPremium()));
......@@ -1358,6 +1357,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setActualPremium(new BigDecimal(success.getActualPremium()));
threadPool.execute(() ->{
String s = pushEstimate(detail, CommonConstants.TWO_INT);
//如果推送成功则更改推送状态
if(StringUtils.isNotBlank(s)){
settle.setActualPushTime(LocalDateTime.now());
settle.setIsActualPush(CommonConstants.ONE_INT);
......@@ -2340,13 +2340,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}else {
//校验当前项目是否在权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(param.getDeptNo()))){
if(deptNoList.stream().noneMatch(u ->u.equals(param.getDeptNo()))){
param.setErrorMessage(InsurancesConstants.OLD_DEPT_NO_NOT_IN_DEPT_LIST);
listResult.add(param);
continue;
}
//校验当前项目是否在权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(param.getReplaceDeptNo()))){
if(deptNoList.stream().noneMatch(u ->u.equals(param.getReplaceDeptNo()))){
param.setErrorMessage(InsurancesConstants.NEW_DEPT_NO_NOT_IN_DEPT_LIST);
listResult.add(param);
continue;
......@@ -2916,7 +2916,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceList = this.baseMapper.getInsuredListPage(page, param);
if (CollectionUtils.isNotEmpty(insuranceList.getRecords())){
//根据项目编码获取项目名称
List<String> collect = insuranceList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<String> collect = insuranceList.getRecords().stream().map(InsuredListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
......@@ -2954,7 +2954,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuredList = this.baseMapper.getInsuredList(param);
if (CollectionUtils.isNotEmpty(insuredList)){
//根据项目编码获取项目名称
List<String> collect = insuredList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<String> collect = insuredList.stream().map(InsuredListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
......@@ -2991,7 +2991,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
IPage<InsuranceRefundListVo> insuranceRefundPageList = this.baseMapper.getInsuranceRefundPageList(page, param);
if (CollectionUtils.isNotEmpty(insuranceRefundPageList.getRecords())){
//根据项目编码获取项目名称
List<String> collect = insuranceRefundPageList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<String> collect = insuranceRefundPageList.getRecords().stream().map(InsuranceRefundListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
......@@ -3023,7 +3023,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceRefundListVo> insuranceRefundList = this.baseMapper.getInsuranceRefundList(param);
if (CollectionUtils.isNotEmpty(insuranceRefundList)){
//根据项目编码获取项目名称
List<String> collect = insuranceRefundList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<String> collect = insuranceRefundList.stream().map(InsuranceRefundListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
......@@ -3061,7 +3061,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
IPage<RefundExportListVo> insuranceRefundHandlingPageList = this.baseMapper.getInsuranceRefundHandlingPageList(page, param);
if (CollectionUtils.isNotEmpty(insuranceRefundHandlingPageList.getRecords())){
//根据项目编码获取项目名称
List<String> collect = insuranceRefundHandlingPageList.getRecords().stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<String> collect = insuranceRefundHandlingPageList.getRecords().stream().map(RefundExportListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
......@@ -3097,11 +3097,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集
if (CollectionUtils.isNotEmpty(param.getIdList())){
refundExportList = baseMapper.getRefundExportListBySelect(param.getIdList());
for (RefundExportListVo refundExportListVo : refundExportList) {
if(null != refundExportListVo.getReduceHandleStatus() && CommonConstants.ONE_INT != refundExportListVo.getReduceHandleStatus()){
return R.failed(InsurancesConstants.CHANGE_ERROR);
}
}
}else {
refundExportList = baseMapper.getRefundExportList(param);
}
......@@ -3109,7 +3104,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> detailList = new ArrayList<>();
List<TInsuranceRefund> refundList = new ArrayList<>();
//根据项目编码获取项目名称
List<String> collect = refundExportList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<String> collect = refundExportList.stream().map(RefundExportListVo::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
......@@ -3139,10 +3134,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//批量更新
if (CollectionUtils.isNotEmpty(detailList)){
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
for (TInsuranceDetail s : detailList) {
updateWrapper.eq(TInsuranceDetail :: getId,s.getId())
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT);
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail :: getId,s.getId()).set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT);
update(updateWrapper);
}
}
......@@ -3286,6 +3280,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else{
operate.setOperateDesc(InsurancesConstants.INSURANCE_REFUND_FAILED);
}
operateList.add(operate);
}
}
tInsuranceOperateService.saveBatch(operateList);
......@@ -3305,6 +3300,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//初始化线程池
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(10, 10, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10));
YifuUser user = SecurityUtils.getUser();
List<TInsuranceDetail> detailList =new ArrayList<>();
if (!Common.isNotEmpty(settleMonthCheckList)) {
return R.failed(InsurancesConstants.SETTLE_MONTH_CHANGE_LIST_IS_EMPTY);
}
......@@ -3313,7 +3309,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
List<SettleMonthChangeCheckParam> ekpList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(successList)) {
if (CollectionUtils.isNotEmpty(successList)){
for (SettleMonthChangeCheckParam settleMonthChangeCheckParam : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail::getId, settleMonthChangeCheckParam.getId())
......@@ -3331,7 +3327,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceOperateService.save(insuranceOperate);
TInsuranceDetail byId = getById(settleMonthChangeCheckParam.getId());
String defaultSettleId = byId.getDefaultSettleId();
if (StringUtils.isNotBlank(defaultSettleId)) {
if (StringUtils.isNotBlank(defaultSettleId)){
TInsuranceSettle settle = tInsuranceSettleService.getById(defaultSettleId);
if (settle.getIsActualPush() == CommonConstants.ONE_INT || settle.getIsEstimatePush() == CommonConstants.ONE_INT) {
ekpList.add(settleMonthChangeCheckParam);
......@@ -3342,9 +3338,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//当前保单结算信息不为空且已推送的情况下,推送EKP进行变更
threadPool.execute(()->{
List<EKPInteractiveParam> deptDetail = getDeptDetail(ekpList);
for (EKPInteractiveParam ekpInteractiveParam : deptDetail) {
for (EKPInteractiveParam ekpInteractiveParam : deptDetail) {
String body = EKPUtil.sendToEKP(ekpInteractiveParam);
if (!StringUtils.isBlank(body)) {
if (!StringUtils.isBlank(body)){
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(ekpInteractiveParam.getDetailId());
insuranceOperate.setCreateBy(user.getId());
......@@ -3354,6 +3350,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate.setDisplayFlag(CommonConstants.ZERO_INT);
tInsuranceOperateService.save(insuranceOperate);
} else {
saveInsuranceEkp(ekpInteractiveParam,CommonConstants.THREE_INT);
for (SettleMonthChangeCheckParam success : successList) {
if (success.getId().equals(ekpInteractiveParam.getDetailId())) {
success.setErrorMessage(InsurancesConstants.EKP_UPDATE_SETTLE_MONTH_ERROR);
......@@ -3364,6 +3361,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
});
}
//操作记录
addOperate(detailList,user,InsurancesConstants.MONTH_CHANGE,null,CommonConstants.ZERO_INT);
return R.ok(errorList, InsurancesConstants.IMPORT_SUCCESS );
}
/**
......@@ -3446,7 +3445,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleCancelService.save(cancel);
//如果已经推送过实际保费,则先作废,再推送新的实际保费
if (byId.getIsActualPush() == CommonConstants.ONE_INT) {
//TODO: 2022/8/2
//推送至EKP执行作废操作
interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setCustomerCode(success.getOldCustomerCode());
......@@ -3476,12 +3474,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else {
//异常处理 // TODO: 2022/8/9
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}
//变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType) {
// TODO: 2022/8/2
//先推送预估,再推送实际
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
......@@ -3510,13 +3508,76 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}else{
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
}
}
}
}else{
// TODO: 2022/8/9 已有实缴但是未推送属于异常,暂时不推
// TODO: 2022/8/9 已有实缴但是未推送则推送新的结算信息
//变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType) {
//推送新的结算信息至EKP
interactiveParam.setSettleType(CommonConstants.ONE_INT);
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setActualPremium(success.getActualPremium());
String addBody = EKPUtil.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) {
//先推送预估,再推送实际
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(estimateBody)) {
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
//推送实缴单
interactiveParam.setSettleType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(null);
interactiveParam.setActualPremium(success.getActualPremium());
String actualBody = EKPUtil.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);
}
}
}
}
//未登记保单保费
......@@ -3524,7 +3585,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更后为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//变更项目且不做处理
//update(updateWrapper);
}
//变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
......@@ -3542,7 +3602,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId());
update(updateWrapper);
//推送结算信息至EKP
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
......@@ -3559,7 +3618,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
}
}
}
......@@ -3591,9 +3651,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.save(newInsuranceSettle);
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//如果预估和实缴都推送了
if(byId.getIsActualPush() == CommonConstants.ONE_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){
//推送作废结算信息至EKP
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getOldDeptNo());
......@@ -3613,7 +3673,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
update(updateWrapper);
//推送新的结算信息至EKP,推实际保费
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
......@@ -3630,12 +3689,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.TWO_INT);
}
}
//变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
// 推送新的结算信息 TODO: 2022/8/2
// 推送新的结算信息
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
......@@ -3654,20 +3714,107 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//todo 异常情况,需进行处理
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
}
}
}else{
//todo 异常情况,需进行处理
//异常处理
saveInsuranceEkp(interactiveParam,CommonConstants.FOUR_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(CommonConstants.THREE_INT);
interactiveParam.setEstimatePremium(one.getEstimatePremium());
interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setSettleType(CommonConstants.ONE_INT);
String deleteBody = EKPUtil.sendToEKP(interactiveParam);
if(StringUtils.isNotBlank(deleteBody)){
//先推送预估,再推送实际
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(estimateBody)) {
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
//推送实缴单
interactiveParam.setSettleType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(null);
interactiveParam.setActualPremium(success.getActualPremium());
String actualBody = EKPUtil.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);
}
}
}
//如果预估和实缴均未推送
if(byId.getIsActualPush() == CommonConstants.ZERO_INT && byId.getIsEstimatePush() == CommonConstants.ONE_INT){
//先推送预估,再推送实际
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(estimateBody)) {
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
//推送实缴单
interactiveParam.setSettleType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(null);
interactiveParam.setActualPremium(success.getActualPremium());
String actualBody = EKPUtil.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);
}
}else{
//todo 异常情况,需进行处理
}
}
//如果没有登记保费
if (BigDecimalUtils.isNullOrZero(actualPremium)){
if(byId.getIsEstimatePush() == CommonConstants.ONE_INT){
//推送至EKP TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getOldCustomerCode());
interactiveParam.setCustomerName(success.getOldCustomerName());
interactiveParam.setDeptNo(success.getOldDeptNo());
......@@ -3702,7 +3849,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息至EKP
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
......@@ -3720,13 +3866,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
}
}
}else{
//异常处理 // TODO: 2022/8/9
saveInsuranceEkp(interactiveParam,CommonConstants.FOUR_INT);
}
}else{
//todo 异常情况,需进行处理
//推送新的结算信息至EKP
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ONE_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if(StringUtils.isNotBlank(estimateBody)){
//推送成功更新预估推送状态
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
saveInsuranceEkp(interactiveParam,CommonConstants.ONE_INT);
}
}
}
}
......@@ -3952,7 +4119,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
if(!deptNoList.stream().anyMatch(u -> u.equals(one.getDeptNo()))){
if(deptNoList.stream().noneMatch(u -> u.equals(one.getDeptNo()))){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_DEPT_LIST);
errorList.add(param);
continue;
......@@ -4131,7 +4298,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//项目所属权限验证
if(!deptNoList.stream().anyMatch(u ->u.equals(deptNo))){
if(deptNoList.stream().noneMatch(u ->u.equals(deptNo))){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
errorList.add(param);
continue;
......@@ -4500,15 +4667,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//已减员
//减员退回
if(CommonConstants.THREE_INT == reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.REFUND_STATUS_THREE_HANDLE_ERROR);
param.setErrorMessage(InsurancesConstants.REFUND_STATUS_FOUR_HANDLE_ERROR);
errorList.add(param);
continue;
}
//减员退回
if(CommonConstants.FOUR_INT == reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.REFUND_STATUS_FOUR_HANDLE_ERROR);
//已减员
if(CommonConstants.FOUR_INT== reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.REFUND_STATUS_THREE_HANDLE_ERROR);
errorList.add(param);
continue;
}
......@@ -4696,18 +4863,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
//旧项目ID不在当前权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(oldDeptNo))){
param.setErrorMessage(InsurancesConstants.OLD_DEPT_NO_NOT_IN_DEPT_LIST);
errorList.add(param);
continue;
}
//新项目ID不在当前权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(newDeptNo))){
param.setErrorMessage(InsurancesConstants.NEW_DEPT_NO_NOT_IN_DEPT_LIST);
errorList.add(param);
continue;
}
//必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT)
......@@ -4735,13 +4890,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//旧项目ID不在当前权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(oldDeptNo))){
if(deptNoList.stream().noneMatch(u ->u.equals(oldDeptNo))){
param.setErrorMessage(InsurancesConstants.OLD_DEPT_NO_NOT_IN_DEPT_LIST);
errorList.add(param);
continue;
}
//新项目ID不在当前权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(newDeptNo))){
if(deptNoList.stream().noneMatch(u ->u.equals(newDeptNo))){
param.setErrorMessage(InsurancesConstants.NEW_DEPT_NO_NOT_IN_DEPT_LIST);
errorList.add(param);
continue;
......@@ -4860,7 +5015,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public R getDeptList(){
List<TInsuranceDetail> detailList = new ArrayList<>();
//EKPUtil.testAddNewsInRestTemplate(detailList);
/* List<Dept> deptList = new ArrayList<>();
List<Dept> deptList = new ArrayList<>();
R<TSettleDomainListVo> tSettleDomainListVoR = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (null != tSettleDomainListVoR && tSettleDomainListVoR.getCode() == CommonConstants.SUCCESS && Common.isNotNull(tSettleDomainListVoR.getData())) {
TSettleDomainListVo data = tSettleDomainListVoR.getData();
......@@ -4873,8 +5028,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
return R.ok(deptList);*/
return R.ok();
return R.ok(deptList);
}
/**
......@@ -5031,7 +5185,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
public List<EKPInteractiveParam> getDeptDetail(List<SettleMonthChangeCheckParam> list){
//根据项目编码获取项目名称
List<String> collect = list.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<String> collect = list.stream().map(SettleMonthChangeCheckParam::getDeptNo).distinct().collect(Collectors.toList());
List<EKPInteractiveParam> ekpInteractiveParams = new ArrayList<>();
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
......@@ -5052,13 +5206,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
/**
* 投保成功后推送预估保费
* 推送EKP
*
* @author zhaji
* @param
* @return {@link String}
*/
public String pushEstimate(TInsuranceDetail tInsuranceDetail,Integer pushType){
public String pushEstimate(TInsuranceDetail tInsuranceDetail,Integer type){
Integer pushType = null;
//1,推送预估保费,2,推送实际保费,3推送预估冲正保费,4更新实际保费
EKPInteractiveParam param = new EKPInteractiveParam();
List<String> deptNoList =new ArrayList<>();
......@@ -5075,17 +5230,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setCustomerCode(projectSetInfoVo.getCustomerCode());
}
//1,推送预估保费(用户办理成功,推送预估保费)
if(CommonConstants.ONE_INT == pushType){
if(CommonConstants.ONE_INT == type){
param.setInteractiveType(CommonConstants.ONE_INT);
param.setSettleType(CommonConstants.ONE_INT);
pushType = CommonConstants.ONE_INT;
}
//2,推送实际保费(用于登记保单保费未推送过实缴保费)
if(CommonConstants.TWO_INT == pushType){
if(CommonConstants.TWO_INT == type){
param.setInteractiveType(CommonConstants.ONE_INT);
param.setSettleType(CommonConstants.TWO_INT);
pushType = CommonConstants.TWO_INT;
}
//3推送预估冲正保费(用于投保退回场景)
if(CommonConstants.THREE_INT == pushType){
if(CommonConstants.THREE_INT == type){
String defaultSettleId = tInsuranceDetail.getDefaultSettleId();
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//冲正取负数
......@@ -5097,14 +5254,54 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
param.setInteractiveType(CommonConstants.ONE_INT);
param.setSettleType(CommonConstants.ONE_INT);
pushType = CommonConstants.FIVE_INT;
}
//4更新实际保费(用于登记保单保费场景推送过实缴保费)
if(CommonConstants.FOUR_INT == pushType){
if(CommonConstants.FOUR_INT == type){
param.setInteractiveType(CommonConstants.TWO_INT);
param.setSettleType(CommonConstants.ONE_INT);
pushType = CommonConstants.SEVEN_INT;
}
String body = EKPUtil.sendToEKP(param);
return body;
if(StringUtils.isBlank(EKPUtil.sendToEKP(param))){
saveInsuranceEkp(param,pushType);
return null;
}else {
return EKPUtil.sendToEKP(param);
}
}
/**
* 获取当前保单的结算状态
*
* @author zhaji
* @param
* @return {@link String}
*/
public SettleVo getInsuranceDetailSettleStatus(String detailId,String settleId){
String id = detailId+CommonConstants.DOWN_LINE_STRING+settleId;
//获取ekp结算信息
SettleVo settleVo = new SettleVo();
//id
settleVo.setFd_3b05ba46bb042e(id);
settleVo.setFd_3b05ba4808a3ca("预估单结算状态");
settleVo.setFd_3b05bd5ed0b976("实缴单结算状态");
return settleVo;
}
/**
* 保存失败信息
*
* @author zhaji
* @param
* @return {@link String}
*/
public Boolean saveInsuranceEkp(EKPInteractiveParam param,Integer pushType){
TInsuranceEkp ekp = new TInsuranceEkp();
BeanCopyUtils.copyProperties(param,ekp);
ekp.setCreateTime(LocalDateTime.now());
ekp.setPushType(pushType);
tInsuranceEkpService.save(ekp);
return Boolean.TRUE;
}
......
......@@ -24,13 +24,9 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
@Override
public R resend() {
LambdaQueryWrapper<TInsuranceEkp> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceEkp :: getResendFlag , CommonConstants.ZERO_INT);
queryWrapper.orderByDesc(TInsuranceEkp::getDetailId);
queryWrapper.orderByAsc(TInsuranceEkp::getCreateTime);
List<TInsuranceEkp> list = list(queryWrapper);
if (CollectionUtils.isNotEmpty(list)){
for (TInsuranceEkp tInsuranceEkp : list) {
List<TInsuranceEkp> ekpRefundList = this.baseMapper.getEkpRefundList();
if (CollectionUtils.isNotEmpty(ekpRefundList)){
for (TInsuranceEkp tInsuranceEkp : ekpRefundList) {
EKPInteractiveParam ekpParam = new EKPInteractiveParam();
BeanCopyUtils.copyProperties(tInsuranceEkp,ekpParam);
String detailId = ekpParam.getDetailId();
......
......@@ -31,6 +31,8 @@
<result property="resendFlag" column="RESEND_FLAG" jdbcType="VARCHAR"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="pushTime" column="PUSH_TIME" jdbcType="TIMESTAMP"/>
<result property="pushType" column="PUSH_TYPE" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -42,8 +44,17 @@
POLICY_END,BUY_STANDARD,MEDICAL_QUOTA,
DIE_DISABLE_QUOTA,ACTUAL_PREMIUM,ESTIMATE_PREMIUM,
SETTLE_MONTH,INTERACTIVE_TYPE,RESEND_FLAG,
CREATE_TIME,PUSH_TIME
CREATE_TIME,PUSH_TIME,PUSH_TYPE
</sql>
<select id="getEkpRefundList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from
t_insurance_ekp
where
RESEND_FLAG = 0
</select>
</mapper>
......@@ -64,14 +64,7 @@ public class TSalaryAccount {
@Length(max = 32, message = "工资表ID不能超过32个字符")
@ExcelProperty("工资表ID")
private String salaryFormId;
/**
* 薪酬月份
*/
@ExcelAttribute(name = "薪酬月份", isNotEmpty = true, errorInfo = "薪酬月份不能为空", maxLength = 6)
@NotBlank(message = "薪酬月份不能为空")
@Length(max = 6, message = "薪酬月份不能超过6个字符")
@ExcelProperty("薪酬月份")
private String salaryMonth;
/**
* 员工 ID
*/
......@@ -93,6 +86,13 @@ public class TSalaryAccount {
@Length(max = 25, message = "身份证号不能超过25个字符")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 手机号
*/
@ExcelAttribute(name = "手机号码", maxLength = 11)
@Length(max = 11, message = "手机号码不能超过11个字符")
@ExcelProperty("手机号码")
private String empPhone;
/**
* 银行卡号
*/
......@@ -107,6 +107,25 @@ public class TSalaryAccount {
@Length(max = 50, message = "开户行总行不能超过50个字符")
@ExcelProperty("开户行总行")
private String bankName;
/**
* 开户行省
*/
@ExcelAttribute(name = "开户行省", isArea = true)
@ExcelProperty("开户行省")
private String bankProvince;
/**
* 开户行市
*/
@ExcelAttribute(name = "开户行市", isArea = true, parentField = "bankProvince")
@ExcelProperty("开户行市")
private String bankCity;
/**
* 开户行支行
*/
@ExcelAttribute(name = "开户行支行", maxLength = 50)
@Length(max = 50, message = "开户行支行不能超过50个字符")
@ExcelProperty("开户行支行")
private String bankSubName;
/**
* 项目id
*/
......@@ -169,13 +188,21 @@ public class TSalaryAccount {
@ExcelProperty("公积金扣缴月份")
private String deduProvidentMonth;
/**
* 报表类型0:薪资;1:绩效;2:其他;3:劳务费;4:稿酬
* 表单类型0:薪资;1:绩效;2:其他;3:劳务费;4:稿酬
*/
@ExcelAttribute(name = "报表类型", readConverterExp = "0=薪资,1=绩效,2=其他,3=劳务费,4=稿酬")
@NotBlank(message = "报表类型不能为空")
@Length(max = 32, message = "报表类型不能超过32个字符")
@ExcelProperty("报表类型")
@ExcelAttribute(name = "表单类型", readConverterExp = "0=薪资,1=绩效,2=其他,3=劳务费,4=稿酬")
@NotBlank(message = "表单类型不能为空")
@Length(max = 32, message = "表单类型不能超过32个字符")
@ExcelProperty("表单类型")
private String formType;
/**
* 薪酬月份
*/
@ExcelAttribute(name = "薪酬月份", isNotEmpty = true, errorInfo = "薪酬月份不能为空", maxLength = 6)
@NotBlank(message = "薪酬月份不能为空")
@Length(max = 6, message = "薪酬月份不能超过6个字符")
@ExcelProperty("薪酬月份")
private String salaryMonth;
/**
* 结算月
*/
......@@ -265,13 +292,7 @@ public class TSalaryAccount {
@ExcelAttribute(name = "县")
@ExcelProperty("县")
private Integer town;
/**
* 手机号
*/
@ExcelAttribute(name = "手机号码", maxLength = 11)
@Length(max = 11, message = "手机号码不能超过11个字符")
@ExcelProperty("手机号码")
private String empPhone;
/**
* 是否自有员工0:否;1:是自有员工
*/
......@@ -295,25 +316,7 @@ public class TSalaryAccount {
@ExcelAttribute(name = "本月是否重复金额0:否;1:是重复导入的")
@ExcelProperty("本月是否重复金额0:否;1:是重复导入的")
private Integer isRepeat;
/**
* 开户行支行
*/
@ExcelAttribute(name = "开户行支行", maxLength = 50)
@Length(max = 50, message = "开户行支行不能超过50个字符")
@ExcelProperty("开户行支行")
private String bankSubName;
/**
* 开户行省
*/
@ExcelAttribute(name = "开户行省", isArea = true)
@ExcelProperty("开户行省")
private String bankProvince;
/**
* 开户行市
*/
@ExcelAttribute(name = "开户行市", isArea = true, parentField = "bankProvince")
@ExcelProperty("开户行市")
private String bankCity;
/**
* 是否个人承担部分税费:0否1是
*/
......
......@@ -19,9 +19,8 @@ package com.yifu.cloud.plus.v1.yifu.salary.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -30,6 +29,7 @@ import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 薪酬人员表
......@@ -74,6 +74,20 @@ public class TSalaryEmployee extends BaseEntity {
@ExcelProperty("客户id")
@ExcelIgnore
private String unitId;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Length(max = 30, message = "项目编码不能超过30个字符")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 封面抬头
*/
......@@ -104,20 +118,7 @@ public class TSalaryEmployee extends BaseEntity {
@ExcelProperty("项目id")
@ExcelIgnore
private String deptId;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Length(max = 30, message = "项目编码不能超过30个字符")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 开户行总行
*/
......@@ -130,13 +131,13 @@ public class TSalaryEmployee extends BaseEntity {
*/
@ExcelAttribute(name = "开户行省",isArea = true)
@ExcelProperty("开户行省")
private Integer bankProvince;
private String bankProvince;
/**
* 开户行市
*/
@ExcelAttribute(name = "开户行市",isArea = true,parentField = "bankProvince")
@ExcelProperty("开户行市")
private Integer bankCity;
private String bankCity;
/**
* 开户行支行
*/
......@@ -170,6 +171,5 @@ public class TSalaryEmployee extends BaseEntity {
*/
@ExcelAttribute(name = "在职状态",isDataId = true,readConverterExp = "0=在职,1=离职")
@ExcelProperty("在职状态")
private Integer fileStatus;
private String fileStatus;
}
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* @Author fxj
* @Date 2022/8/25
* @Description
* @Version 1.0
*/
@Data
public class TSalaryEmployeeExportVo{
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, errorInfo = "员工姓名不能为空", maxLength = 32)
@NotBlank(message = "员工姓名不能为空")
@Length(max = 32, message = "员工姓名不能超过32个字符")
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号不能为空", maxLength = 32)
@NotBlank(message = "身份证号不能为空")
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 客户id
*/
@ExcelAttribute(name = "客户id", maxLength = 32)
@Length(max = 32, message = "客户id不能超过32个字符")
@ExcelProperty("客户id")
@ExcelIgnore
private String unitId;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Length(max = 30, message = "项目编码不能超过30个字符")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 封面抬头
*/
@ExcelAttribute(name = "封面抬头", maxLength = 50)
@Length(max = 50, message = "封面抬头不能超过50个字符")
@ExcelProperty("封面抬头")
private String invoiceTitle;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Length(max = 50, message = "客户名称不能超过50个字符")
@ExcelProperty("客户名称")
private String unitName;
/**
* 客户编码
*/
@ExcelAttribute(name = "客户编码", maxLength = 32)
@Length(max = 32, message = "客户编码不能超过32个字符")
@ExcelProperty("客户编码")
@ExcelIgnore
private String unitNo;
/**
* 项目id
*/
@ExcelAttribute(name = "项目id", maxLength = 32)
@Length(max = 32, message = "项目id不能超过32个字符")
@ExcelProperty("项目id")
@ExcelIgnore
private String deptId;
/**
* 开户行总行
*/
@ExcelAttribute(name = "开户行总行", maxLength = 50)
@Length(max = 50, message = "开户行总行不能超过50个字符")
@ExcelProperty("开户行总行")
private String bankName;
/**
* 开户行省
*/
@ExcelAttribute(name = "开户行省",isArea = true)
@ExcelProperty("开户行省")
private String bankProvince;
/**
* 开户行市
*/
@ExcelAttribute(name = "开户行市",isArea = true,parentField = "bankProvince")
@ExcelProperty("开户行市")
private String bankCity;
/**
* 开户行支行
*/
@ExcelAttribute(name = "开户行支行", maxLength = 50)
@Length(max = 50, message = "开户行支行不能超过50个字符")
@ExcelProperty("开户行支行")
private String bankSubName;
/**
* 银行卡号
*/
@ExcelAttribute(name = "银行卡号", maxLength = 50)
@Length(max = 50, message = "银行卡号不能超过50个字符")
@ExcelProperty("银行卡号")
private String bankNo;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码", maxLength = 32)
@Length(max = 32, message = "手机号码不能超过32个字符")
@ExcelProperty("手机号码")
private String empPhone;
/**
* 计税月份
*/
@ExcelAttribute(name = "计税月份", maxLength = 6)
@Length(max = 6, message = "计税月份不能超过6个字符")
@ExcelProperty("计税月份")
private String taxMonth;
/**
* 在职状态(0在职;1离职)
*/
@ExcelAttribute(name = "在职状态",isDataId = true,readConverterExp = "0=在职,1=离职")
@ExcelProperty("在职状态")
private String fileStatus;
}
......@@ -27,7 +27,7 @@ public class TSalaryStandardExportVo implements Serializable {
*/
@ExcelAttribute(name = "状态", isDataId = true, readConverterExp = "0=待提交,1=待审核,2=待推送,3=已推送待发放,4=已发放,5=审核不通过,6=确认不通过,7=财务退回,8=结算单调整待审核,9=结算单调整待打印")
@NotBlank(message = "状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)不能为空")
@ExcelProperty("状态")
@ExcelProperty("薪酬状态")
private String status;
/**
* 推送月份(YYYYMM)
......@@ -35,7 +35,7 @@ public class TSalaryStandardExportVo implements Serializable {
@ExcelAttribute(name = "推送月份", isNotEmpty = true, errorInfo = "推送月份(YYYYMM)不能为空", maxLength = 6)
@NotBlank(message = "推送月份(YYYYMM)不能为空")
@Length(max = 6, message = "推送月份(YYYYMM)不能超过6个字符")
@ExcelProperty("推送月份")
@ExcelProperty("发放月份")
private String sendMonth;
/**
* 项目名称
......@@ -65,13 +65,6 @@ public class TSalaryStandardExportVo implements Serializable {
@Length(max = 50, message = "封面抬头不能超过50个字符")
@ExcelProperty("封面抬头")
private String invoiceTitle;
/**
* 创建者-姓名
*/
@Schema(description = "创建人-姓名")
@TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建人")
private String createName;
/**
* 工资月份(YYYYMM)
*/
......@@ -97,4 +90,11 @@ public class TSalaryStandardExportVo implements Serializable {
@TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
/**
* 创建者-姓名
*/
@Schema(description = "创建人-姓名")
@TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建人")
private String createName;
}
......@@ -72,6 +72,7 @@ public class TSalaryAccountController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSalaryAccount>> getTSalaryAccountPage(Page<TSalaryAccount> page, TSalaryAccountSearchVo tSalaryAccount) {
tSalaryAccount.setDeleteFlag(CommonConstants.ZERO_INT);
return new R<>(tSalaryAccountService.getTSalaryAccountPage(page, tSalaryAccount));
}
......
......@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryEmployeeService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -71,7 +72,7 @@ public class TSalaryEmployeeController {
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('salary_tsalaryemployee_get')" )
public R<List<TSalaryEmployee>> getTSalaryEmployeeNoPage(@RequestBody TSalaryEmployeeSearchVo tSalaryEmployee) {
public R<List<TSalaryEmployeeExportVo>> getTSalaryEmployeeNoPage(@RequestBody TSalaryEmployeeSearchVo tSalaryEmployee) {
return R.ok(tSalaryEmployeeService.noPageDiy(tSalaryEmployee));
}
......
......@@ -68,6 +68,7 @@ public class TSalaryStandardController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSalaryStandard>> getTSalaryStandardPage(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard) {
tSalaryStandard.setDeleteFlag(CommonConstants.ZERO_INT);
return new R<>(tSalaryStandardService.getTSalaryStandardPage(page, tSalaryStandard));
}
......
......@@ -21,8 +21,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 薪酬人员表
*
......@@ -37,4 +42,6 @@ public interface TSalaryEmployeeMapper extends BaseMapper<TSalaryEmployee> {
* @return
*/
IPage<TSalaryEmployee> getTSalaryEmployeePage(Page<TSalaryEmployee> page, @Param("tSalaryEmployee") TSalaryEmployee tSalaryEmployee);
List<TSalaryEmployeeExportVo> noPageDiy( @Param("tSalaryEmployee") TSalaryEmployeeSearchVo searchVo, @Param("idList")List<String> idList);
}
......@@ -50,7 +50,7 @@ public interface TSalaryStandardMapper extends BaseMapper<TSalaryStandard> {
*/
IPage<TSalaryStandard> getTSalaryStandardAuditPage(Page<TSalaryStandard> page, @Param("tSalaryStandard") TSalaryStandard tSalaryStandard);
List<TSalaryStandardExportVo> getSalaryStandardExport(@Param("searchVo") TSalaryStandardSearchVo searchVo);
List<TSalaryStandardExportVo> getSalaryStandardExport(@Param("searchVo") TSalaryStandardSearchVo searchVo, @Param("idList")List<String> idList);
int getSalaryStandardExportCount(@Param("searchVo")TSalaryStandardSearchVo searchVo);
int getSalaryStandardExportCount(@Param("searchVo") TSalaryStandardSearchVo searchVo, @Param("idList")List<String> idList);
}
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
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.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeSearchVo;
import javax.servlet.http.HttpServletResponse;
......@@ -47,7 +48,7 @@ public interface TSalaryEmployeeService extends IService<TSalaryEmployee> {
void listExport(HttpServletResponse response, TSalaryEmployeeSearchVo searchVo);
List<TSalaryEmployee> noPageDiy(TSalaryEmployeeSearchVo searchVo);
List<TSalaryEmployeeExportVo> noPageDiy(TSalaryEmployeeSearchVo searchVo);
/**
* @param employee
......
......@@ -162,8 +162,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
TSalaryEmployee es;//筛选人员,添加判断:非在职,或开户行为空,或 结算主体等于选择的结算主体且在职,都可以存入Map优先备用
for (TSalaryEmployee e : empList) {
es = empIdCardMap.get(e.getEmpIdcard());
if (es == null || CommonConstants.ZERO_INT != es.getFileStatus() || Common.isEmpty(es.getBankName())
|| (e.getDeptId().equals(settleDepart) && CommonConstants.ZERO_INT == e.getFileStatus()
if (es == null || CommonConstants.ZERO_STRING != es.getFileStatus() || Common.isEmpty(es.getBankName())
|| (e.getDeptId().equals(settleDepart) && CommonConstants.ZERO_STRING == e.getFileStatus()
&& Common.isNotNull(e.getBankName()))) {
empIdCardMap.put(e.getEmpIdcard(), e);
empNameMap.put(e.getEmpName().replace(" ", ""), e);
......
......@@ -54,6 +54,9 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
if (Common.isNotNull(tMinSalary.getTown())){
query.eq(TMinSalary::getTown,tMinSalary.getTown());
}
if (Common.isEmpty(tMinSalary.getTown())){
query.isNull(TMinSalary::getTown);
}
query.eq(TMinSalary::getStatus, CommonConstants.ONE_INT);
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT){
......
......@@ -43,6 +43,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryEmployeeMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryEmployeeService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeVo;
import lombok.extern.log4j.Log4j2;
......@@ -92,7 +93,7 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
public void listExport(HttpServletResponse response, TSalaryEmployeeSearchVo searchVo) {
String fileName = "薪酬人员表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TSalaryEmployee> list = new ArrayList<>();
List<TSalaryEmployeeExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
......@@ -102,7 +103,7 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TSalaryEmployee.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TSalaryEmployeeExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
......@@ -111,8 +112,8 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TSalaryEmployee> util = new ExcelUtil<>(TSalaryEmployee.class);
for (TSalaryEmployee vo : list) {
ExcelUtil<TSalaryEmployeeExportVo> util = new ExcelUtil<>(TSalaryEmployeeExportVo.class);
for (TSalaryEmployeeExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
......@@ -149,17 +150,8 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
}
@Override
public List<TSalaryEmployee> noPageDiy(TSalaryEmployeeSearchVo searchVo) {
LambdaQueryWrapper<TSalaryEmployee> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TSalaryEmployee::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
public List<TSalaryEmployeeExportVo> noPageDiy(TSalaryEmployeeSearchVo searchVo) {
return baseMapper.noPageDiy(searchVo,Common.getList(searchVo.getIds()));
}
private Long noPageCountDiy(TSalaryEmployeeSearchVo searchVo) {
......
......@@ -161,11 +161,13 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
@Override
public List<TSalaryStandardExportVo> noPageDiy(TSalaryStandardSearchVo searchVo) {
return baseMapper.getSalaryStandardExport(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
return baseMapper.getSalaryStandardExport(searchVo,idList);
}
private int noPageCountDiy(TSalaryStandardSearchVo searchVo) {
return baseMapper.getSalaryStandardExportCount(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
return baseMapper.getSalaryStandardExportCount(searchVo,idList);
}
@Override
......
......@@ -420,7 +420,7 @@ public class SalaryAccountUtil implements Serializable {
} else {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + entity.getBankProvince().trim());
if (Common.isNotNull(areaStr)) {
newEmp.setBankProvince(Integer.parseInt(areaStr));
newEmp.setBankProvince(areaStr);
} else {
error = "第" + (i + 2) + "行:新员工-开户行省错误:" + entity.getBankProvince();
errorList.add(new ErrorMessage((i + 2), error));
......@@ -429,7 +429,7 @@ public class SalaryAccountUtil implements Serializable {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + entity.getBankCity().trim()
+ CommonConstants.DOWN_LINE_STRING + entity.getBankProvince().trim());
if (Common.isNotNull(areaStr)) {
newEmp.setBankCity(Integer.parseInt(areaStr));
newEmp.setBankCity(areaStr);
} else {
error = "第" + (i + 2) + "行:新员工-开户行市错误:" + entity.getBankCity();
errorList.add(new ErrorMessage((i + 2), error));
......@@ -459,19 +459,19 @@ public class SalaryAccountUtil implements Serializable {
if (Common.isNotNull(entity.getBankProvince())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + entity.getBankProvince().trim());
if (Common.isNotNull(areaStr)) {
newEmp.setBankProvince(Integer.parseInt(areaStr));
newEmp.setBankProvince(areaStr);
}
if (Common.isNotNull(entity.getBankCity())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + entity.getBankCity().trim()
+ CommonConstants.DOWN_LINE_STRING + entity.getBankProvince().trim());
if (Common.isNotNull(areaStr)) {
newEmp.setBankCity(Integer.parseInt(areaStr));
newEmp.setBankCity(areaStr);
}
}
}
}
}
newEmp.setFileStatus(CommonConstants.ZERO_INT); //临时
newEmp.setFileStatus(CommonConstants.ZERO_STRING); //临时
newEmp.setDeptId(dept.getId());
newEmp.setDeptName(dept.getDepartName());
newEmp.setDeptNo(dept.getDepartNo());
......
......@@ -48,6 +48,25 @@
<result property="taxMonth" column="TAX_MONTH"/>
<result property="fileStatus" column="FILE_STATUS"/>
</resultMap>
<resultMap id="salaryEmployeeExportMap" type="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo">
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="bankName" column="BANK_NAME"/>
<result property="bankSubName" column="BANK_SUB_NAME"/>
<result property="bankNo" column="BANK_NO"/>
<result property="invoiceTitle" column="INVOICE_TITLE"/>
<result property="bankProvince" column="BANK_PROVINCE"/>
<result property="bankCity" column="BANK_CITY"/>
<result property="empPhone" column="EMP_PHONE"/>
<result property="taxMonth" column="TAX_MONTH"/>
<result property="fileStatus" column="FILE_STATUS"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_NAME,
......@@ -154,6 +173,32 @@
<where>
1=1
<include refid="tSalaryEmployee_where"/>
</where>
ORDER BY a.CREATE_TIME DESC
</where>
</select>
<select id="noPageDiy" resultMap="salaryEmployeeExportMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo">
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_employee a
<where>
1=1
<include refid="where_export"/>
ORDER BY a.CREATE_TIME DESC
</where>
<if test="tSalaryEmployee != null">
<if test="tSalaryEmployee.limitStart != null">
limit #{tSalaryEmployee.limitStart},#{tSalaryEmployee.limitEnd}
</if>
</if>
</select>
<sql id="where_export">
<include refid="tSalaryEmployee_where"/>
<if test="idList != null and idList.size>0">
AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
</sql>
</mapper>
......@@ -256,8 +256,11 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_standard a
left join t_dept_see d on a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0
<!-- 薪资是否可查看 0 是 1否-->
and d.CAN_SEE= 0
<include refid="tSalaryStandard_where"/>
</where>
ORDER BY a.CREATE_TIME desc
......@@ -304,8 +307,9 @@
a.FORM_TYPE,
a.CREATE_TIME
FROM t_salary_standard a
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0
a.DELETE_FLAG = 0 AND d.CAN_SEE = 0
<include refid="where_export"/>
</where>
ORDER BY a.CREATE_TIME desc
......@@ -320,8 +324,9 @@
SELECT
count(1)
FROM t_salary_standard a
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0
a.DELETE_FLAG = 0 AND d.CAN_SEE = 0
<include refid="where_export"/>
</where>
</select>
......@@ -336,15 +341,21 @@
<if test="tSalaryStandard.salaryMonth != null and tSalaryStandard.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{tSalaryStandard.salaryMonth}
</if>
<if test="tSalaryStandard.status == null">
<!--<if test="tSalaryStandard.status == null">
AND (a.STATUS = 1 OR a.STATUS = 2 OR a.STATUS = 5)
</if>
</if>-->
<if test="tSalaryStandard.status != null">
AND a.STATUS = #{tSalaryStandard.status}
</if>
</if>
</sql>
<sql id="where_export">
<if test="idList != null and idList.size>0">
AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="searchVo != null">
<if test="searchVo.deptName != null and searchVo.deptName.trim() != ''">
AND a.DEPT_NAME like concat('%',#{searchVo.deptName},'%')
......@@ -355,9 +366,9 @@
<if test="searchVo.salaryMonth != null and searchVo.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{searchVo.salaryMonth}
</if>
<if test="searchVo.status == null">
<!--<if test="searchVo.status == null">
AND (a.STATUS = 1 OR a.STATUS = 2 OR a.STATUS = 5)
</if>
</if>-->
<if test="searchVo.status != null">
AND a.STATUS = #{searchVo.status}
</if>
......
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