Commit 1e5ca149 authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

parents 19df76dd 7b9e12ff
...@@ -1181,7 +1181,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1181,7 +1181,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 户籍所在地 // 户籍所在地
if (Common.isNotNull(excel.getIdProvince())) { if (Common.isNotNull(excel.getIdProvince())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1189,7 +1189,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1189,7 +1189,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getIdCity())) { if (Common.isNotNull(excel.getIdCity())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdCity() + CommonConstants.DOWN_LINE_STRING + excel.getIdProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdCity() + CommonConstants.DOWN_LINE_STRING + excel.getIdProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1197,7 +1197,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1197,7 +1197,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getIdTown())) { if (Common.isNotNull(excel.getIdTown())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdTown() + CommonConstants.DOWN_LINE_STRING + excel.getIdCity().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdTown() + CommonConstants.DOWN_LINE_STRING + excel.getIdCity().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1206,7 +1206,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1206,7 +1206,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 档案所在地 // 档案所在地
if (Common.isNotNull(excel.getFileProvince())) { if (Common.isNotNull(excel.getFileProvince())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1214,7 +1214,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1214,7 +1214,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getFileCity())) { if (Common.isNotNull(excel.getFileCity())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileCity() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileCity() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1222,7 +1222,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1222,7 +1222,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getFileTown())) { if (Common.isNotNull(excel.getFileTown())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileTown() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileTown() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1692,7 +1692,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1692,7 +1692,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 户籍所在地 // 户籍所在地
if (Common.isNotNull(excel.getIdProvince())) { if (Common.isNotNull(excel.getIdProvince())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1700,7 +1700,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1700,7 +1700,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getIdCity())) { if (Common.isNotNull(excel.getIdCity())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdCity() + CommonConstants.DOWN_LINE_STRING + excel.getIdProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdCity() + CommonConstants.DOWN_LINE_STRING + excel.getIdProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1708,7 +1708,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1708,7 +1708,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getIdTown())) { if (Common.isNotNull(excel.getIdTown())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdTown() + CommonConstants.DOWN_LINE_STRING + excel.getIdCity().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdTown() + CommonConstants.DOWN_LINE_STRING + excel.getIdCity().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1717,7 +1717,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1717,7 +1717,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 档案所在地 // 档案所在地
if (Common.isNotNull(excel.getFileProvince())) { if (Common.isNotNull(excel.getFileProvince())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1725,7 +1725,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1725,7 +1725,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getFileCity())) { if (Common.isNotNull(excel.getFileCity())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileCity() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileCity() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1733,7 +1733,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1733,7 +1733,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getFileTown())) { if (Common.isNotNull(excel.getFileTown())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileTown() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileTown() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
......
package com.yifu.cloud.plus.v1.yifu.common.core.constant; package com.yifu.cloud.plus.v1.yifu.common.core.constant;
import java.util.regex.Pattern;
/** /**
* @author fang * @author fang
* 常用的一些验证,如手机、移动号码、联通号码、电信号码、密码、座机、 邮政编码、邮箱、年龄、身份证、URL、QQ、汉字、字母、数字等校验表达式 * 常用的一些验证,如手机、移动号码、联通号码、电信号码、密码、座机、 邮政编码、邮箱、年龄、身份证、URL、QQ、汉字、字母、数字等校验表达式
...@@ -63,4 +66,7 @@ public class ValidityConstants { ...@@ -63,4 +66,7 @@ public class ValidityConstants {
public static final String PATTERN_50 = "^.{1,50}$"; public static final String PATTERN_50 = "^.{1,50}$";
/** 最多60位 规则 */ /** 最多60位 规则 */
public static final String PATTERN_60 = "^.{1,60}$"; public static final String PATTERN_60 = "^.{1,60}$";
/** 不超过两位小数的正数 */
public static final String POSITIVE_INTEGER_PATTERN_TWO_FLOAT = "^[+]?([0-9]+(.[0-9]{1,2})?)$";
} }
...@@ -356,24 +356,49 @@ public class InsurancesConstants { ...@@ -356,24 +356,49 @@ public class InsurancesConstants {
/***********************减员办理错误码********************************/ /***********************减员办理错误码********************************/
/** /**
* 已被替换,不允许减员 * 商险已出险,无法减员
*/ */
public static final String IS_EFFECT_ERROR = "已被替换,不允许减员"; public static final String INSURANCE_IS_USE_ERROR = "商险已出险,无法减员";
/** /**
* 已超出保单截止日期,不允许减员 * 非已投保状态,无法减员
*/ */
public static final String IS_OVERDUE_ERROR = "已超出保单截止日期,不允许减员"; public static final String REFUND_ERROR = "非已投保状态,无法减员";
/** /**
* 已出险的,不允许减员 * 商险待投保,无法减员
*/ */
public static final String IS_USE_ERROR = "已出险的,不允许减员"; public static final String INSURANCE_BUY_STATUS_ONE_ERROR = "商险待投保,无法减员";
/** /**
* 非已投保状态,无法减员 * 商险投保中,无法减员
*/ */
public static final String REFUND_ERROR = "非已投保状态,无法减员"; public static final String INSURANCE_BUY_STATUS_TWO_ERROR = "商险投保中,无法减员";
/**
* 商险无效,无法减员
*/
public static final String INSURANCE_IS_EFFECT_ERROR = "商险无效,无法减员";
/**
* 商险已过期,无法减员
*/
public static final String INSURANCE_IS_OVERDUE_ERROR = "商险已过期,无法减员";
/**
* 商险待减员,无法减员
*/
public static final String INSURANCE_REFUND_STATUS_ONE_ERROR = "商险待减员,无法减员";
/**
* 商险减员中,无法减员
*/
public static final String INSURANCE_REFUND_STATUS_TWO_ERROR = "商险减员中,无法减员";
/**
* 商险已减员,无法减员
*/
public static final String INSURANCE_REFUND_STATUS_FOUR_ERROR = "商险已减员,无法减员";
/** /**
* 替换结算月份和原有结算月份相同 * 替换结算月份和原有结算月份相同
...@@ -381,14 +406,41 @@ public class InsurancesConstants { ...@@ -381,14 +406,41 @@ public class InsurancesConstants {
public static final String SETTLE_MONTH_IDENTICAL = "替换结算月份和原有结算月份相同"; public static final String SETTLE_MONTH_IDENTICAL = "替换结算月份和原有结算月份相同";
/** /**
* 当前保单已处于减员流程,无法变更结算月 * 商险待投保,无法减员
*/ */
public static final String SETTLE_MONTH_CHANGE_REDUCE_HANDLE_STATUS_ERROR = "当前保单已处于减员流程,无法变更结算月"; public static final String SETTLE_MONTH_CHANGE_REDUCE_HANDLE_STATUS_ERROR = "商险待投保,无法减员";
/** /**
* 当前保单已结算,无法变更结算月 * 商险待投保,无法变更结算月
*/ */
public static final String SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR = "当前保单已结算,无法变更结算月"; public static final String SETTLE_MONTH_CHANGE_BUY_STATUS_ONE_ERROR = "商险待投保,无法变更结算月";
/**
* 商险投保中,无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_BUY_STATUS_TWO_ERROR = "商险投保中,无法变更结算月";
/**
* 商险已减员,无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_REFUND_STATUS_FOUR_ERROR = "商险已减员,无法变更结算月";
/**
* 商险结算中,无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_SETTLE_STATUS_TWO_ERROR = "商险结算中,无法变更结算月";
/**
* 商险已结算,无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_SETTLE_STATUS_THREE_ERROR = "商险已结算,无法变更结算月";
/**
* 替换类型无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_IS_EFFECT_ERROR ="替换类型无法变更结算月";
/** /**
* 替换项目ID和原有项目ID相同 * 替换项目ID和原有项目ID相同
...@@ -406,44 +458,55 @@ public class InsurancesConstants { ...@@ -406,44 +458,55 @@ public class InsurancesConstants {
public static final String SETTLE_MONTH_CHANGE_LIST_IS_EMPTY ="当前变更结算月列表为空"; public static final String SETTLE_MONTH_CHANGE_LIST_IS_EMPTY ="当前变更结算月列表为空";
/** /**
* 替换人员不允许变更结算月 * 替换类型无法变更项目
*/ */
public static final String SETTLE_MONTH_CHANGE_IS_EFFECT_ERROR ="替换人员不允许变更结算月"; public static final String DEPT_NO_CHANGE_IS_EFFECT_ERROR ="替换类型无法变更项目";
/** /**
* 替换人员不允许变更所属项目 * 商险待投保,无法变更项目
*/ */
public static final String DEPT_NO_CHANGE_IS_EFFECT_ERROR ="替换人员不允许变更所属项目"; public static final String DEPT_NO_CHANGE_BUY_STATUS_ONE_ERROR = "商险待投保,无法变更项目";
/** /**
* 当前保单已结算,无法变更所属项目 * 商险投保中,无法变更项目
*/ */
public static final String DEPT_NO_CHANGE_SETTLE_HANDLE_STATUS_ERROR = "当前保单已结算,无法变更所属项目"; public static final String DEPT_NO_CHANGE_BUY_STATUS_TWO_ERROR = "商险投保中,无法变更项目";
/** /**
* 退费金额不能为空 * 商险已减员,无法变更项目
*/ */
public static final String REFUND_MONEY_NOT_EMPTY = "退费金额不能为空"; public static final String DEPT_NO_CHANGE_REFUND_STATUS_FOUR_ERROR = "商险已减员,无法变更项目";
/** /**
* 退费金额格式不正确 * 商险结算中,无法变更项目
*/ */
public static final String REFUND_MONEY_PARSE_ERROR = "退费金额格式不正确"; public static final String DEPT_NO_CHANGE_SETTLE_STATUS_TWO_ERROR = "商险结算中,无法变更项目";
/** /**
* 退费金额不能小于零 * 商险已结算,无法变更项目
*/ */
public static final String REFUND_MONEY_MIN_ERROR= "退费金额不能小于零"; public static final String DEPT_NO_CHANGE_SETTLE_STATUS_THREE_ERROR = "商险已结算,无法变更项目";
/** /**
* 退费金额不能大于999999.99 * 替换项目编码不能为空
*/ */
public static final String REFUND_MONEY_MAX_ERROR = "退费金额不能大于999999.99"; public static final String DEPT_NO_CHANGE_NOT_EMPTY = "替换项目编码不能为空";
/** /**
* 姓名不能超过20个字符 * 替换项目不存在
*/ */
public static final String EMP_NAME_MAX_LENGTH_ERROR = "姓名不能超过20个字符"; public static final String DEPT_NO_CHANGE_IS_NOT_EXIST = "替换项目不存在";
/**
* 退费金额不能为空
*/
public static final String REFUND_MONEY_NOT_EMPTY = "保费不能为空";
/**
* 保费金额格式不正确
*/
public static final String REFUND_MONEY_PARSE_ERROR = "保费金额格式不正确";
/** /**
* 员工减员记录不存在 * 员工减员记录不存在
...@@ -460,5 +523,56 @@ public class InsurancesConstants { ...@@ -460,5 +523,56 @@ public class InsurancesConstants {
*/ */
public static final String REFUND_EXPORT = "减员导出办理"; public static final String REFUND_EXPORT = "减员导出办理";
/**
* 减员办理成功
*/
public static final String REFUND_EXPORT_SUCCESS = "减员办理成功";
/**
* 减员办理成功
*/
public static final String REFUND_EXPORT_FAILED = "减员办理失败";
/**
* 员工投保信息不存在
*/
public static final String USER_DATA_IS_NOT_EXIST = "员工投保信息不存在";
/***********************商险产品错误码********************************/
/**
* 新增保险公司
*/
public static final String NEW_INSURANCE_COMPANY = "新增保险公司";
/**
* 修改保险公司
*/
public static final String UPDATE_INSURANCE_COMPANY = "修改保险公司";
/**
* 新增险种
*/
public static final String NEW_INSURANCE_TYPE = "新增险种";
/**
* 修改险种
*/
public static final String UPDATE_INSURANCE_TYPE = "修改险种";
/**
* 新增费率
*/
public static final String NEW_INSURANCE_TYPE_RATE = "新增费率";
/**
* 删除费率
*/
public static final String DELETE_INSURANCE_TYPE_RATE = "删除费率";
/**
* 新增购买标准
*/
public static final String NEW_INSURANCE_TYPE_STANDARD = "新增购买标准";
/**
* 删除购买标准
*/
public static final String DELETE_INSURANCE_TYPE_STANDARD = "删除购买标准";
} }
...@@ -27,7 +27,7 @@ public class TInsuranceType extends BaseEntity { ...@@ -27,7 +27,7 @@ public class TInsuranceType extends BaseEntity {
*/ */
@Schema(description = "险种id") @Schema(description = "险种id")
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
private Long id; private String id;
/** /**
* 险种名称 * 险种名称
......
...@@ -25,7 +25,7 @@ public class TInsuranceTypeStandard extends BaseEntity { ...@@ -25,7 +25,7 @@ public class TInsuranceTypeStandard extends BaseEntity {
/** /**
* 购买标准id * 购买标准id
*/ */
@Schema(description = "保险公司id") @Schema(description = "购买标准id")
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
private String id; private String id;
......
...@@ -152,6 +152,29 @@ public class ValidityUtil { ...@@ -152,6 +152,29 @@ public class ValidityUtil {
return idCard.matches(ValidityConstants.IDCARD_PATTERN) ; return idCard.matches(ValidityConstants.IDCARD_PATTERN) ;
} }
/**
* 判断是否是整数或者是携带一位或者两位的小数
* @param refundMoney 金额
* @return boolean
*/
public static boolean validateMoney(final String refundMoney) {
if(Common.isEmpty(refundMoney)){
return Boolean.FALSE ;
}
if(!BigDecimalUtils.isBigDecimal(refundMoney)){
return Boolean.FALSE ;
}
if(!refundMoney.matches(ValidityConstants.POSITIVE_INTEGER_PATTERN_TWO_FLOAT)){
return Boolean.FALSE ;
}
boolean max = refundMoney.compareTo(CommonConstants.MONEY_MAX) < 0;
boolean min = refundMoney.compareTo(CommonConstants.MONEY_MIN) > 0;
if (!max || !min){
return Boolean.FALSE ;
}
return Boolean.TRUE;
}
/** /**
* 姓名验证 * 姓名验证
* *
......
...@@ -15,7 +15,11 @@ import java.io.Serializable; ...@@ -15,7 +15,11 @@ import java.io.Serializable;
@Tag(name = "变更所属项目") @Tag(name = "变更所属项目")
public class DeptChangeCheckParam implements Serializable { public class DeptChangeCheckParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
//姓名+身份证号+原项目编码+保险公司+险种+保单开始时间+保单结束时间+保单结束时间+标准+有效+未减员 是否存在校验 /**
* 商险id
*/
@Schema(description = "商险id")
private String id;
/** /**
* 员工姓名 * 员工姓名
*/ */
......
...@@ -226,6 +226,14 @@ public class InsuredListVo implements Serializable { ...@@ -226,6 +226,14 @@ public class InsuredListVo implements Serializable {
@Schema(description = "创建人(派单人)") @Schema(description = "创建人(派单人)")
private String createName; private String createName;
/**
* 购买月数
*/
@Schema(description = "购买月数")
private Long buyMonth;
//订单编号、姓名、身份证号、投保类型、项目、岗位、保单开始日期、保单结束日期、保险公司、险种、购买标准、医保、身故或残疾、预估保费、实际保费、保单号、发票号、保单生效日期、商险购买地、商险办理地、是否出险、是否过期、是否失效、派单日期、派单人 //订单编号、姓名、身份证号、投保类型、项目、岗位、保单开始日期、保单结束日期、保险公司、险种、购买标准、医保、身故或残疾、预估保费、实际保费、保单号、发票号、保单生效日期、商险购买地、商险办理地、是否出险、是否过期、是否失效、派单日期、派单人
} }
...@@ -183,5 +183,15 @@ public class RefundExportListVo implements Serializable { ...@@ -183,5 +183,15 @@ public class RefundExportListVo implements Serializable {
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;
/**
* 购买月数
*/
@Schema(description = "购买月数")
private Long buyMonth;
/**
* 购买天数
*/
@Schema(description = "购买天数")
private long buyDay;
} }
...@@ -15,7 +15,12 @@ import java.io.Serializable; ...@@ -15,7 +15,12 @@ import java.io.Serializable;
@Tag(name = "结算月变更") @Tag(name = "结算月变更")
public class SettleMonthChangeCheckParam implements Serializable { public class SettleMonthChangeCheckParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
//姓名+身份证号+原项目编码+保险公司+险种+保单开始时间+保单结束时间+保单结束时间+标准+有效+未减员 是否存在校验
/**
* 商险id
*/
@Schema(description = "商险id")
private String id;
/** /**
* 员工姓名 * 员工姓名
*/ */
......
...@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller; ...@@ -2,7 +2,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.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.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
...@@ -12,7 +11,6 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; ...@@ -12,7 +11,6 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -88,7 +86,7 @@ public class TInsuranceCompanyController { ...@@ -88,7 +86,7 @@ public class TInsuranceCompanyController {
* @return * @return
*/ */
@Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页)") @Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页)")
@GetMapping("/list" ) @GetMapping("/list")
public R<List<TInsuranceCompany>> getInsuranceCompanyList() { public R<List<TInsuranceCompany>> getInsuranceCompanyList() {
return R.ok(insuranceCompanyService.getInsuranceCompanyList()); return R.ok(insuranceCompanyService.getInsuranceCompanyList());
} }
......
...@@ -23,4 +23,6 @@ public interface TInsuranceRefundMapper extends BaseMapper<TInsuranceRefund> { ...@@ -23,4 +23,6 @@ public interface TInsuranceRefundMapper extends BaseMapper<TInsuranceRefund> {
TInsuranceRefund getByInsDetailId(String id); TInsuranceRefund getByInsDetailId(String id);
void updateByInsDetailId(TInsuranceRefund insuranceRefund); void updateByInsDetailId(TInsuranceRefund insuranceRefund);
int updateRefundMoney(TInsuranceRefund insuranceRefund);
} }
...@@ -15,4 +15,6 @@ public interface TInsuranceRefundService extends IService<TInsuranceRefund> { ...@@ -15,4 +15,6 @@ public interface TInsuranceRefundService extends IService<TInsuranceRefund> {
void updateByInsDetailId(TInsuranceRefund insuranceRefund); void updateByInsDetailId(TInsuranceRefund insuranceRefund);
int updateRefundMoney(TInsuranceRefund insuranceRefund);
} }
...@@ -1900,10 +1900,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1900,10 +1900,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<InsuranceRefundCheck>> refundMap = checkInsuranceRefundList(insuranceRefundCheckList); Map<String, List<InsuranceRefundCheck>> refundMap = checkInsuranceRefundList(insuranceRefundCheckList);
List<InsuranceRefundCheck> successList = refundMap.get("successList"); List<InsuranceRefundCheck> successList = refundMap.get("successList");
if (CollectionUtils.isNotEmpty(successList)){ if (CollectionUtils.isNotEmpty(successList)){
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now())
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT);
for (InsuranceRefundCheck refund : successList){ for (InsuranceRefundCheck refund : successList){
TInsuranceRefund insuranceRefund = new TInsuranceRefund(); TInsuranceRefund insuranceRefund = new TInsuranceRefund();
insuranceRefund.setInsDetailId(refund.getId()); insuranceRefund.setInsDetailId(refund.getId());
...@@ -1911,12 +1907,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1911,12 +1907,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceRefund.setCreateBy(user.getId()); insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname()); insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now()); insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefund.setRemark(refund.getRemark()); if(StringUtils.isNotBlank(refund.getRemark())){
if(null == refund.getReduceHandleStatus() || CommonConstants.THREE_INT == refund.getReduceHandleStatus()){ insuranceRefund.setRemark(refund.getRemark());
tInsuranceRefundService.updateByInsDetailId(insuranceRefund); }
}else{ if(null == refund.getReduceHandleStatus()){
tInsuranceRefundService.save(insuranceRefund); tInsuranceRefundService.save(insuranceRefund);
}else{
tInsuranceRefundService.updateByInsDetailId(insuranceRefund);
} }
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now())
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT);
updateWrapper.eq(TInsuranceDetail :: getId,refund.getId()); updateWrapper.eq(TInsuranceDetail :: getId,refund.getId());
update(updateWrapper); update(updateWrapper);
} }
...@@ -1943,6 +1945,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1943,6 +1945,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
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 : insuranceList.getRecords()) { for (InsuredListVo record : insuranceList.getRecords()) {
//购买月数
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(""));
...@@ -2054,6 +2058,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2054,6 +2058,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
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 (RefundExportListVo record : insuranceRefundHandlingPageList.getRecords()) { for (RefundExportListVo record : insuranceRefundHandlingPageList.getRecords()) {
//购买月数
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(""));
...@@ -2095,6 +2101,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2095,6 +2101,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
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 (RefundExportListVo record : refundExportList) { for (RefundExportListVo record : refundExportList) {
//购买月数
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyStart().toString(),record.getPolicyEnd().toString()));
//购买天数
record.setBuyDay(LocalDateUtil.betweenDay(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(""));
...@@ -2169,6 +2179,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2169,6 +2179,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setUpdateTime(LocalDateTime.now()); tInsuranceDetail.setUpdateTime(LocalDateTime.now());
tInsuranceDetail.setUpdateBy(user.getId()); tInsuranceDetail.setUpdateBy(user.getId());
tInsuranceDetail.setReduceHandleStatus(refundType); tInsuranceDetail.setReduceHandleStatus(refundType);
if(CommonConstants.FOUR_INT == refundType){
tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT);
}
successList.add(tInsuranceDetail); successList.add(tInsuranceDetail);
refund.setInsDetailId(tInsuranceDetail.getId()); refund.setInsDetailId(tInsuranceDetail.getId());
refund.setCreateBy(user.getId()); refund.setCreateBy(user.getId());
...@@ -2185,6 +2198,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2185,6 +2198,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceRefundService.updateByInsDetailId(refund); tInsuranceRefundService.updateByInsDetailId(refund);
} }
updateBatchById(successList); updateBatchById(successList);
//操作记录
if(CommonConstants.FOUR_INT == refundType){
addOperate(successList,user,InsurancesConstants.REFUND_EXPORT_SUCCESS);
}else{
addOperate(successList,user,InsurancesConstants.REFUND_EXPORT_FAILED);
}
return R.ok(errorList,"操作成功"); return R.ok(errorList,"操作成功");
} }
...@@ -2205,22 +2224,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2205,22 +2224,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList); Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList);
//todo 生成EKP通知,通知ekp变更结算月份 //todo 生成EKP通知,通知ekp变更结算月份
List<SettleMonthChangeCheckParam> successList = map.get("successList"); List<SettleMonthChangeCheckParam> successList = map.get("successList");
for (SettleMonthChangeCheckParam success : successList) { if(CollectionUtils.isNotEmpty(successList)){
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); for (SettleMonthChangeCheckParam success : successList) {
updateWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,success.getEmpName()) LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
.eq(TInsuranceDetail ::getEmpIdcardNo,success.getEmpIdCardNo()).eq(TInsuranceDetail :: getInsuranceTypeName,success.getInsuranceTypeName() ) updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
.eq(TInsuranceDetail :: getDeptNo,success.getDeptNo()).eq(TInsuranceDetail :: getBuyStandard,success.getBuyStandard()) .set(TInsuranceDetail :: getSettleMonth,success.getSettleMonth())
.eq(TInsuranceDetail :: getInsuranceCompanyName,success.getInsuranceCompanyName()) .set(TInsuranceDetail :: getUpdateBy,user.getId())
.eq(TInsuranceDetail :: getPolicyStart,success.getPolicyStart() ).eq(TInsuranceDetail :: getPolicyEnd,success.getPolicyEnd()) .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
.set(TInsuranceDetail :: getSettleMonth,success.getSettleMonth()) update(updateWrapper);
.set(TInsuranceDetail :: getUpdateBy,user.getId()) }
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
} }
List<SettleMonthChangeCheckParam> errorList = map.get("errorList"); List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
//判断当前变更是否全部成功 return R.ok(errorList,"导入成功");
return R.ok(errorList);
} }
/** /**
...@@ -2240,21 +2255,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2240,21 +2255,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList); Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList);
//todo 生成EKP通知,通知ekp变更结算所属项目 //todo 生成EKP通知,通知ekp变更结算所属项目
List<DeptChangeCheckParam> successList = stringListMap.get("successList"); List<DeptChangeCheckParam> successList = stringListMap.get("successList");
for (DeptChangeCheckParam success : successList) { if(CollectionUtils.isNotEmpty(successList)){
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); for (DeptChangeCheckParam success : successList) {
updateWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,success.getEmpName()) LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
.eq(TInsuranceDetail ::getEmpIdcardNo,success.getEmpIdCardNo()).eq(TInsuranceDetail :: getInsuranceTypeName,success.getInsuranceTypeName() ) updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
.eq(TInsuranceDetail :: getDeptNo,success.getOldDeptNo()).eq(TInsuranceDetail :: getBuyStandard,success.getBuyStandard()) .set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
.eq(TInsuranceDetail :: getInsuranceCompanyName,success.getInsuranceCompanyName()) .set(TInsuranceDetail :: getSettleType,success.getSettleType())
.eq(TInsuranceDetail :: getPolicyStart,success.getPolicyStart() ).eq(TInsuranceDetail :: getPolicyEnd,success.getPolicyEnd()) .set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo()) .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
.set(TInsuranceDetail :: getSettleType,success.getSettleType()) update(updateWrapper);
.set(TInsuranceDetail :: getUpdateBy,user.getId()) }
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
} }
List<DeptChangeCheckParam> errorList = stringListMap.get("errorList"); List<DeptChangeCheckParam> errorList = stringListMap.get("errorList");
return R.ok(errorList); return R.ok(errorList,"导入成功");
} }
/** /**
...@@ -2333,7 +2346,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2333,7 +2346,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
public R updateRefundMoney(List<RefundMoneyParam> paramList) { public R updateRefundMoney(List<RefundMoneyParam> paramList) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<TInsuranceRefund> insuranceRefundList = new ArrayList<>();
Map<String, List<RefundMoneyParam>> map = refundMoneyCheck(paramList); Map<String, List<RefundMoneyParam>> map = refundMoneyCheck(paramList);
List<RefundMoneyParam> successList = map.get("successList"); List<RefundMoneyParam> successList = map.get("successList");
if (CollectionUtils.isNotEmpty(successList)){ if (CollectionUtils.isNotEmpty(successList)){
...@@ -2345,9 +2357,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2345,9 +2357,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceRefund.setCreateBy(user.getId()); insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname()); insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now()); insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefundList.add(insuranceRefund); tInsuranceRefundService.updateRefundMoney(insuranceRefund);
} }
tInsuranceRefundService.saveBatch(insuranceRefundList);
} }
return R.ok(map.get("errorList")); return R.ok(map.get("errorList"));
} }
...@@ -2372,7 +2383,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2372,7 +2383,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//员工身份证 //员工身份证
String empIdCardNo = param.getEmpIdcardNo(); String empIdCardNo = param.getEmpIdcardNo();
if(StringUtils.isBlank(empIdCardNo)){ if(StringUtils.isBlank(empIdCardNo)){
...@@ -2380,7 +2390,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2380,7 +2390,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//保险公司名称 //保险公司名称
String insuranceCompanyName = param.getInsuranceCompanyName(); String insuranceCompanyName = param.getInsuranceCompanyName();
if(StringUtils.isBlank(insuranceCompanyName)){ if(StringUtils.isBlank(insuranceCompanyName)){
...@@ -2388,7 +2397,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2388,7 +2397,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//险种名称 //险种名称
String insuranceTypeName = param.getInsuranceTypeName(); String insuranceTypeName = param.getInsuranceTypeName();
if(StringUtils.isBlank(insuranceTypeName)){ if(StringUtils.isBlank(insuranceTypeName)){
...@@ -2396,7 +2404,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2396,7 +2404,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//保单开始日期 //保单开始日期
String policyStart = param.getPolicyStart(); String policyStart = param.getPolicyStart();
if(StringUtils.isBlank(policyStart)){ if(StringUtils.isBlank(policyStart)){
...@@ -2404,7 +2411,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2404,7 +2411,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//保单结束日期 //保单结束日期
String policyEnd = param.getPolicyEnd(); String policyEnd = param.getPolicyEnd();
if(StringUtils.isBlank(policyEnd)){ if(StringUtils.isBlank(policyEnd)){
...@@ -2412,7 +2418,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2412,7 +2418,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
...@@ -2431,46 +2436,70 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2431,46 +2436,70 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//备注格式校验
String remark = param.getRemark();
if(StringUtils.isNotBlank(remark) && !ValidityUtil.validate50(remark)){
param.setErrorMessage(InsurancesConstants.REMARK_NOT_MORE_THAN_50);
errorList.add(param);
continue;
}
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName ) queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName ) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName) .eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)); .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
TInsuranceDetail one = getOne(queryWrapper); TInsuranceDetail one = getOne(queryWrapper);
if (Common.isEmpty(one)){ if (Common.isEmpty(one)){
param.setErrorMessage(InsurancesConstants.DATA_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
errorList.add(param); errorList.add(param);
continue; continue;
} }
//当前保单信息的不是已投保状态不能导入 //当前保单信息的不是已投保状态不能导入
Integer buyHandleStatus = one.getBuyHandleStatus(); Integer buyHandleStatus = one.getBuyHandleStatus();
if (CommonConstants.THREE_INT != buyHandleStatus){ if (CommonConstants.ONE_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.REFUND_ERROR); param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_ONE_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
if (CommonConstants.TWO_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
Integer reduceHandleStatus = one.getReduceHandleStatus(); Integer reduceHandleStatus = one.getReduceHandleStatus();
//当前保单信息的减员状态不为空时不能进行导入 //当前保单信息的减员状态不为空且不为减员退回时时不能进行导入
if(reduceHandleStatus != null && CommonConstants.THREE_INT != reduceHandleStatus ){ if(CommonConstants.ONE_INT == reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.REFUND_ERROR); param.setErrorMessage(InsurancesConstants.INSURANCE_REFUND_STATUS_ONE_ERROR);
errorList.add(param);
continue;
}
if(CommonConstants.TWO_INT == reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.INSURANCE_REFUND_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
if(CommonConstants.FOUR_INT == reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.INSURANCE_REFUND_STATUS_FOUR_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
//出险状态 //出险状态
if(CommonConstants.ZERO_INT != one.getIsUse()){ if(CommonConstants.ZERO_INT != one.getIsUse()){
param.setErrorMessage(InsurancesConstants.IS_USE_ERROR); param.setErrorMessage(InsurancesConstants.INSURANCE_IS_USE_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
//有效状态 //有效状态
if(CommonConstants.ZERO_INT != one.getIsEffect()){ if(CommonConstants.ZERO_INT != one.getIsEffect()){
param.setErrorMessage(InsurancesConstants.IS_EFFECT_ERROR); param.setErrorMessage(InsurancesConstants.INSURANCE_IS_EFFECT_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
//过期状态 //过期状态
if (CommonConstants.ZERO_INT != one.getIsOverdue()){ if (CommonConstants.ZERO_INT != one.getIsOverdue()){
param.setErrorMessage(InsurancesConstants.IS_OVERDUE_ERROR); param.setErrorMessage(InsurancesConstants.INSURANCE_IS_OVERDUE_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
...@@ -2523,34 +2552,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2523,34 +2552,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
if(empName.length()>CommonConstants.TWENTY_INT){ if(!ValidityUtil.validateMoney(refundMoney)){
param.setErrorMessage(InsurancesConstants.EMP_NAME_MAX_LENGTH_ERROR);
errorList.add(param);
continue;
}
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(empIdcardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param);
continue;
}
if(BigDecimalUtils.isBigDecimal(refundMoney)){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.REFUND_MONEY_PARSE_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
boolean max = refundMoney.compareTo(CommonConstants.MONEY_MAX) < 0;
boolean min = refundMoney.compareTo(CommonConstants.MONEY_MIN) > 0;
if (max){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_MAX_ERROR);
errorList.add(param);
continue;
}
if (min){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_MIN_ERROR);
errorList.add(param);
continue;
}
//必填格式校通过后查询对应的保单信息 //必填格式校通过后查询对应的保单信息
TInsuranceRefundDetail refundDetail = new TInsuranceRefundDetail(); TInsuranceRefundDetail refundDetail = new TInsuranceRefundDetail();
refundDetail.setEmpName(empName); refundDetail.setEmpName(empName);
...@@ -2562,11 +2568,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2562,11 +2568,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
if ( null != tInsuranceRefundDetail.getRefundMoney()){ /* if ( null != tInsuranceRefundDetail.getRefundMoney()){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_IS_NOT_NULL); param.setErrorMessage(InsurancesConstants.REFUND_MONEY_IS_NOT_NULL);
errorList.add(param); errorList.add(param);
continue; continue;
} }*/
param.setId(tInsuranceRefundDetail.getInsDetailId()); param.setId(tInsuranceRefundDetail.getInsDetailId());
successList.add(param); successList.add(param);
} }
...@@ -2583,16 +2589,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2583,16 +2589,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
private Map<String,List<SettleMonthChangeCheckParam>> settleMonthChangeCheck(List<SettleMonthChangeCheckParam> settleMonthCheckList) { private Map<String,List<SettleMonthChangeCheckParam>> settleMonthChangeCheck(List<SettleMonthChangeCheckParam> settleMonthCheckList) {
Map<String,List<SettleMonthChangeCheckParam>> map = new HashMap<>(16); Map<String,List<SettleMonthChangeCheckParam>> map = new HashMap<>(16);
List<SettleMonthChangeCheckParam> errorList = new ArrayList(); List<SettleMonthChangeCheckParam> errorList = new ArrayList<>();
List<SettleMonthChangeCheckParam> successList = new ArrayList<>(); List<SettleMonthChangeCheckParam> successList = new ArrayList<>();
for (SettleMonthChangeCheckParam param : settleMonthCheckList) { for (SettleMonthChangeCheckParam param : settleMonthCheckList) {
//结算月
String settleMonth = param.getSettleMonth();
if(StringUtils.isBlank(settleMonth)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_NOT_EMPTY);
errorList.add(param);
continue;
}
//员工姓名 //员工姓名
String empName = param.getEmpName(); String empName = param.getEmpName();
if(StringUtils.isBlank(empName)){ if(StringUtils.isBlank(empName)){
...@@ -2600,7 +2599,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2600,7 +2599,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//员工身份证 //员工身份证
String empIdCardNo = param.getEmpIdCardNo(); String empIdCardNo = param.getEmpIdCardNo();
if(StringUtils.isBlank(empIdCardNo)){ if(StringUtils.isBlank(empIdCardNo)){
...@@ -2608,7 +2606,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2608,7 +2606,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//所属项目
String deptNo = param.getDeptNo();
if(StringUtils.isBlank(deptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//保险公司名称 //保险公司名称
String insuranceCompanyName = param.getInsuranceCompanyName(); String insuranceCompanyName = param.getInsuranceCompanyName();
if(StringUtils.isBlank(insuranceCompanyName)){ if(StringUtils.isBlank(insuranceCompanyName)){
...@@ -2616,7 +2620,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2616,7 +2620,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//险种名称 //险种名称
String insuranceTypeName = param.getInsuranceTypeName(); String insuranceTypeName = param.getInsuranceTypeName();
if(StringUtils.isBlank(insuranceTypeName)){ if(StringUtils.isBlank(insuranceTypeName)){
...@@ -2624,7 +2627,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2624,7 +2627,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//保单开始日期 //保单开始日期
String policyStart = param.getPolicyStart(); String policyStart = param.getPolicyStart();
if(StringUtils.isBlank(policyStart)){ if(StringUtils.isBlank(policyStart)){
...@@ -2632,7 +2634,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2632,7 +2634,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//保单结束日期 //保单结束日期
String policyEnd = param.getPolicyEnd(); String policyEnd = param.getPolicyEnd();
if(StringUtils.isBlank(policyEnd)){ if(StringUtils.isBlank(policyEnd)){
...@@ -2640,13 +2641,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2640,13 +2641,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//所属项目
String deptNo = param.getDeptNo();
if(StringUtils.isBlank(deptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//购买标准 //购买标准
String buyStandard = param.getBuyStandard(); String buyStandard = param.getBuyStandard();
if(StringUtils.isBlank(buyStandard)){ if(StringUtils.isBlank(buyStandard)){
...@@ -2654,12 +2648,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2654,12 +2648,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdCardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param);
continue;
}
// 保单开始日期格式校验 // 保单开始日期格式校验
if(!LocalDateUtil.isDate(policyStart,LocalDateUtil.NORM_DATE_PATTERN)){ if(!LocalDateUtil.isDate(policyStart,LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
...@@ -2672,7 +2660,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2672,7 +2660,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示) // 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if(!LocalDateUtil.isDate(param.getSettleMonth(),LocalDateUtil.NORM_MONTH_PATTERN)){ if(!LocalDateUtil.isDate(param.getSettleMonth(),LocalDateUtil.NORM_MONTH_PATTERN)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_PARSE_ERROR);
...@@ -2684,17 +2671,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2684,17 +2671,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//结算月
String settleMonth = param.getSettleMonth();
if(StringUtils.isBlank(settleMonth)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_NOT_EMPTY);
errorList.add(param);
continue;
}
//必填格式校通过后查询对应的保单信息 //必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName ) queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceCompanyName ) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard) .eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName) .eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)); .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
TInsuranceDetail insuranceDetail = getOne(queryWrapper); TInsuranceDetail insuranceDetail = getOne(queryWrapper);
//如果保单信息为空 //如果保单信息为空
if (Common.isEmpty(insuranceDetail)){ if (Common.isEmpty(insuranceDetail)){
param.setErrorMessage(InsurancesConstants.DATA_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
errorList.add(param); errorList.add(param);
continue; continue;
} }
...@@ -2704,16 +2698,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2704,16 +2698,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
Integer buyHandleStatus = insuranceDetail.getBuyHandleStatus();
if (CommonConstants.ONE_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_BUY_STATUS_ONE_ERROR);
errorList.add(param);
continue;
}
if (CommonConstants.TWO_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_BUY_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
//如果结算月份相同 //如果结算月份相同
if (settleMonth.equals(insuranceDetail.getSettleMonth())){ if (settleMonth.equals(insuranceDetail.getSettleMonth())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_IDENTICAL); param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_IDENTICAL);
errorList.add(param); errorList.add(param);
continue; continue;
} }
//非已办理状态 //如果结算月份小于当前月份
Integer buyHandleStatus = insuranceDetail.getBuyHandleStatus(); if(!LocalDateUtil.isCurrentOrFutureMonth(param.getSettleMonth())){
if (CommonConstants.THREE_INT != buyHandleStatus){ param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_SHOULD_IS_FUTURE);
param.setErrorMessage(InsurancesConstants.REFUND_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
...@@ -2721,37 +2725,27 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2721,37 +2725,27 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId()); insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery); TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为已结算时,不能变更结算月 //当前结算状态为结算中时,不能变更结算月
if (CommonConstants.FOUR_STRING.equals(insuranceSettle.getSettleHandleStatus())){ if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR); param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus(); //当前结算状态为已结算时,不能变更结算月
//当前保单信息的减员状态不为空时不能进行导入 if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
if(reduceHandleStatus != null && CommonConstants.THREE_INT != reduceHandleStatus ){ param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_THREE_ERROR);
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_REDUCE_HANDLE_STATUS_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
//有效状态 Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus();
if(CommonConstants.ZERO_INT != insuranceDetail.getIsEffect()){ //当前保单信息的为已减员时不能不能变更结算月
param.setErrorMessage(InsurancesConstants.IS_EFFECT_ERROR); if( CommonConstants.FOUR_INT == reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_REFUND_STATUS_FOUR_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
//判断当前数据中是否存在重复数据 param.setId(insuranceDetail.getId());
boolean b = successList.stream().anyMatch(u -> u.getEmpName().equals(param.getEmpName()) successList.add(param);
&& u.getEmpIdCardNo().equals(param.getEmpIdCardNo())&& u.getDeptNo().equals(param.getDeptNo())
&& u.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())&& u.getInsuranceTypeName().equals(param.getInsuranceTypeName())
&& u.getPolicyStart().equals(param.getPolicyStart())&& u.getPolicyEnd().equals(param.getPolicyEnd())
&& u.getSettleMonth().equals(param.getSettleMonth())&& u.getBuyStandard().equals(param.getBuyStandard()));
if(!b){
successList.add(param);
}else{
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR);
errorList.add(param);
}
} }
map.put("errorList",errorList); map.put("errorList",errorList);
map.put("successList",successList); map.put("successList",successList);
...@@ -2771,7 +2765,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2771,7 +2765,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (DeptChangeCheckParam param : deptChangeCheckList) { for (DeptChangeCheckParam param : deptChangeCheckList) {
String newDeptNo = param.getNewDeptNo(); String newDeptNo = param.getNewDeptNo();
if(StringUtils.isBlank(newDeptNo)){ if(StringUtils.isBlank(newDeptNo)){
param.setErrorMessage(InsurancesConstants.REPLACE_DEPT_NO_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_NOT_EMPTY);
errorList.add(param); errorList.add(param);
continue; continue;
} }
...@@ -2789,6 +2783,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2789,6 +2783,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//所属项目
String oldDeptNo = param.getOldDeptNo();
if(StringUtils.isBlank(oldDeptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//保险公司名称 //保险公司名称
String insuranceCompanyName = param.getInsuranceCompanyName(); String insuranceCompanyName = param.getInsuranceCompanyName();
if(StringUtils.isBlank(insuranceCompanyName)){ if(StringUtils.isBlank(insuranceCompanyName)){
...@@ -2818,13 +2819,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2818,13 +2819,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//所属项目
String oldDeptNo = param.getOldDeptNo();
if(StringUtils.isBlank(oldDeptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//新老项目id相同 //新老项目id相同
if (oldDeptNo.equals(newDeptNo)){ if (oldDeptNo.equals(newDeptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IDENTICAL); param.setErrorMessage(InsurancesConstants.DEPT_NO_IDENTICAL);
...@@ -2838,12 +2832,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2838,12 +2832,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdCardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
errorList.add(param);
continue;
}
// 保单开始日期格式校验 // 保单开始日期格式校验
if(!LocalDateUtil.isDate(policyStart,LocalDateUtil.NORM_DATE_PATTERN)){ if(!LocalDateUtil.isDate(policyStart,LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
...@@ -2861,13 +2849,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2861,13 +2849,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
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); param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_IS_NOT_EXIST);
errorList.add(param); errorList.add(param);
continue; continue;
}else { }else {
ProjectSetInfoVo jsonObject = data.get(newDeptNo); ProjectSetInfoVo jsonObject = data.get(newDeptNo);
if (null == jsonObject){ if (null == jsonObject){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_IS_NOT_EXIST);
errorList.add(param); errorList.add(param);
continue; continue;
}else { }else {
...@@ -2886,11 +2874,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2886,11 +2874,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//必填格式校通过后查询对应的保单信息 //必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName ) queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceCompanyName ) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard) .eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName) .eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)); .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
TInsuranceDetail insuranceDetail = getOne(queryWrapper); TInsuranceDetail insuranceDetail = getOne(queryWrapper);
//如果保单信息为空
if (Common.isEmpty(insuranceDetail)){
param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
errorList.add(param);
continue;
}
//替换类型的保单不能变更所属项目 //替换类型的保单不能变更所属项目
Integer buyType = insuranceDetail.getBuyType(); Integer buyType = insuranceDetail.getBuyType();
if (CommonConstants.FOUR_INT == buyType){ if (CommonConstants.FOUR_INT == buyType){
...@@ -2898,28 +2892,43 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2898,28 +2892,43 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
Integer buyHandleStatus = insuranceDetail.getBuyHandleStatus();
if (CommonConstants.ONE_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_BUY_STATUS_ONE_ERROR);
errorList.add(param);
continue;
}
if (CommonConstants.TWO_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_BUY_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus();
//当前保单信息的为已减员时,不能变更结算项目
if( CommonConstants.FOUR_INT == reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_REFUND_STATUS_FOUR_ERROR);
errorList.add(param);
continue;
}
//查询结算状态 //查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId()); insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery); TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为:结算中,已结算时,不能变更所属项目 //当前结算状态为结算中时,不能变更结算项目
if (CommonConstants.FOUR_STRING.equals(insuranceSettle.getSettleHandleStatus()) || CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){ if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_HANDLE_STATUS_ERROR); param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param); errorList.add(param);
continue; continue;
} }
//判断当前数据中是否存在重复数据 //当前结算状态为已结算时,不能变更结算项目
boolean b = successList.stream().anyMatch(u -> u.getEmpName().equals(param.getEmpName()) if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
&& u.getEmpIdCardNo().equals(param.getEmpIdCardNo())&& u.getOldDeptNo().equals(param.getOldDeptNo()) param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_THREE_ERROR);
&& u.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())&& u.getInsuranceTypeName().equals(param.getInsuranceTypeName())
&& u.getPolicyStart().equals(param.getPolicyStart())&& u.getPolicyEnd().equals(param.getPolicyEnd())
&& u.getNewDeptNo().equals(param.getNewDeptNo())&& u.getBuyStandard().equals(param.getBuyStandard()));
if(!b){
successList.add(param);
}else{
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR);
errorList.add(param); errorList.add(param);
continue;
} }
//判断当前数据中是否存在重复数据
param.setId(insuranceDetail.getId());
successList.add(param);
} }
map.put("errorList",errorList); map.put("errorList",errorList);
map.put("successList",successList); map.put("successList",successList);
......
...@@ -24,4 +24,11 @@ implements TInsuranceRefundService { ...@@ -24,4 +24,11 @@ implements TInsuranceRefundService {
public void updateByInsDetailId(TInsuranceRefund insuranceRefund) { public void updateByInsDetailId(TInsuranceRefund insuranceRefund) {
this.baseMapper.updateByInsDetailId(insuranceRefund); this.baseMapper.updateByInsDetailId(insuranceRefund);
} }
@Override
public int updateRefundMoney(TInsuranceRefund insuranceRefund) {
return this.baseMapper.updateRefundMoney(insuranceRefund);
}
} }
...@@ -101,22 +101,23 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat ...@@ -101,22 +101,23 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
return R.failed("当前险种信息不存在或已被删除"); return R.failed("当前险种信息不存在或已被删除");
} }
String month = insuranceTypeRate.getMonth(); String month = insuranceTypeRate.getMonth();
if (!ValidityUtil.isMonth(month)){ if (!ValidityUtil.validatePositiveInt(month)){
return R.failed("当前月份格式不正确"); return R.failed("当前月份格式不正确");
} }
String rate = insuranceTypeRate.getRate(); String rate = insuranceTypeRate.getRate();
if (!Common.isNumber(rate)){ if (!ValidityUtil.validateMoney(rate)){
return R.failed("当前费率格式不正确"); return R.failed("当前费率格式不正确");
} }
LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,insuranceTypeId) queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,insuranceTypeId)
.eq(TInsuranceTypeRate :: getRate,insuranceTypeRate.getRate()).eq(TInsuranceTypeRate:: getMonth ,insuranceTypeRate.getMonth()); .eq(TInsuranceTypeRate:: getMonth ,insuranceTypeRate.getMonth());
List<TInsuranceTypeRate> list = this.list(queryWrapper); List<TInsuranceTypeRate> list = this.list(queryWrapper);
if (list.isEmpty()){ if (list.isEmpty()){
insuranceTypeRate.setDeleteFlag(CommonConstants.ZERO_INT); insuranceTypeRate.setDeleteFlag(CommonConstants.ZERO_INT);
insuranceTypeRate.setCreateBy(user.getId()); insuranceTypeRate.setCreateBy(user.getId());
insuranceTypeRate.setCreateName(user.getNickname()); insuranceTypeRate.setCreateName(user.getNickname());
insuranceTypeRate.setCreateTime(LocalDateTime.now()); insuranceTypeRate.setCreateTime(LocalDateTime.now());
return R.ok(this.baseMapper.insert(insuranceTypeRate)); return R.ok(this.baseMapper.insert(insuranceTypeRate));
}else{ }else{
return R.failed("当前险种已存在相同的费率"); return R.failed("当前险种已存在相同的费率");
......
...@@ -9,13 +9,15 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -9,13 +9,15 @@ 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.core.vo.YifuUser;
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.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeStandardMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeStandardMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -31,10 +33,14 @@ import java.util.List; ...@@ -31,10 +33,14 @@ import java.util.List;
@Service @Service
public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTypeStandardMapper, TInsuranceTypeStandard> implements TInsuranceTypeStandardService { public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTypeStandardMapper, TInsuranceTypeStandard> implements TInsuranceTypeStandardService {
@Resource @Resource
private TInsuranceTypeService insuranceTypeService; private TInsuranceTypeService tInsuranceTypeService;
@Resource @Resource
private TInsuranceDetailService insuranceDetailService; private TInsuranceDetailService tInsuranceDetailService;
@Resource
private TInsuranceOperateService tInsuranceOperateService;
/** /**
* 查询购买标准列表 * 查询购买标准列表
...@@ -48,7 +54,7 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp ...@@ -48,7 +54,7 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
if (Common.isEmpty(id)){ if (Common.isEmpty(id)){
return R.failed("险种id为空"); return R.failed("险种id为空");
} }
TInsuranceType byId = insuranceTypeService.getById(id); TInsuranceType byId = tInsuranceTypeService.getById(id);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){ if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除"); return R.failed("当前险种信息不存在或已被删除");
} }
...@@ -79,7 +85,7 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp ...@@ -79,7 +85,7 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
queryWrapper.eq(TInsuranceDetail::getInsuranceTypeId,byId.getInsuranceTypeId()) queryWrapper.eq(TInsuranceDetail::getInsuranceTypeId,byId.getInsuranceTypeId())
.eq(TInsuranceDetail::getBuyStandard,byId.getBuyStandard()) .eq(TInsuranceDetail::getBuyStandard,byId.getBuyStandard())
.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT); .eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceDetail> list = insuranceDetailService.list(queryWrapper); List<TInsuranceDetail> list = tInsuranceDetailService.list(queryWrapper);
if (Common.isNotEmpty(list)){ if (Common.isNotEmpty(list)){
return R.failed("当前险种的购买标准已存在对应的商险信息,不能删除"); return R.failed("当前险种的购买标准已存在对应的商险信息,不能删除");
} }
...@@ -105,20 +111,20 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp ...@@ -105,20 +111,20 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
return R.failed("新增的购买标准信息为空"); return R.failed("新增的购买标准信息为空");
} }
Long insuranceTypeId = insuranceTypeStandard.getInsuranceTypeId(); Long insuranceTypeId = insuranceTypeStandard.getInsuranceTypeId();
TInsuranceType byId = insuranceTypeService.getById(insuranceTypeId); TInsuranceType byId = tInsuranceTypeService.getById(insuranceTypeId);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){ if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除"); return R.failed("当前险种信息不存在或已被删除");
} }
String buyStandard = insuranceTypeStandard.getBuyStandard(); String buyStandard = insuranceTypeStandard.getBuyStandard();
String medicalQuota = insuranceTypeStandard.getMedicalQuota(); String medicalQuota = insuranceTypeStandard.getMedicalQuota();
String dieDisableQuota = insuranceTypeStandard.getDieDisableQuota(); String dieDisableQuota = insuranceTypeStandard.getDieDisableQuota();
if (!Common.isNumber(buyStandard)){ if (!ValidityUtil.validateMoney(buyStandard)){
return R.failed("当前购买标准格式不正确"); return R.failed("当前购买标准格式不正确");
} }
if (!Common.isNumber(medicalQuota)){ if (!ValidityUtil.validateMoney(medicalQuota)){
return R.failed("当前医疗额度格式不正确"); return R.failed("当前医疗额度格式不正确");
} }
if (!Common.isNumber(dieDisableQuota)){ if (!ValidityUtil.validateMoney(dieDisableQuota)){
return R.failed("当前身故或残疾额度格式不正确"); return R.failed("当前身故或残疾额度格式不正确");
} }
LambdaQueryWrapper<TInsuranceTypeStandard> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceTypeStandard> queryWrapper = new LambdaQueryWrapper<>();
...@@ -131,10 +137,13 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp ...@@ -131,10 +137,13 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
insuranceTypeStandard.setCreateBy(user.getId()); insuranceTypeStandard.setCreateBy(user.getId());
insuranceTypeStandard.setCreateName(user.getNickname()); insuranceTypeStandard.setCreateName(user.getNickname());
insuranceTypeStandard.setCreateTime(LocalDateTime.now()); insuranceTypeStandard.setCreateTime(LocalDateTime.now());
return R.ok(this.baseMapper.insert(insuranceTypeStandard),"新增购买标准成功"); return R.ok(this.baseMapper.insert(insuranceTypeStandard),"新增购买标准成功");
}else{ }else{
return R.failed("当前险种下的购买标准已存在"); return R.failed("当前险种下的购买标准已存在");
} }
} }
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper"> <mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany"> <resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany">
<id property="id" column="ID" jdbcType="BIGINT"/> <id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="companyName" column="COMPANY_NAME" jdbcType="VARCHAR"/> <result property="companyName" column="COMPANY_NAME" jdbcType="VARCHAR"/>
<result property="companyAddress" column="COMPANY_ADDRESS" jdbcType="VARCHAR"/> <result property="companyAddress" column="COMPANY_ADDRESS" jdbcType="VARCHAR"/>
<result property="companyDocking" column="COMPANY_DOCKING" jdbcType="VARCHAR"/> <result property="companyDocking" column="COMPANY_DOCKING" jdbcType="VARCHAR"/>
......
...@@ -541,8 +541,6 @@ ...@@ -541,8 +541,6 @@
t_insurance_refund refund t_insurance_refund refund
where where
detail.ID = refund.INS_DETAIL_ID detail.ID = refund.INS_DETAIL_ID
and
(detail.REDUCE_HANDLE_STATUS is not null and detail.REDUCE_HANDLE_STATUS != 3)
<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},'_','\_'),'%','\%'),'%')
</if> </if>
...@@ -607,9 +605,6 @@ ...@@ -607,9 +605,6 @@
<if test="param.deptNo != null and param.deptNo.trim() != ''"> <if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%') and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.reduceHandleStatus != null ">
and detail.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if>
<if test="param.isOverdue != null "> <if test="param.isOverdue != null ">
and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%') and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%')
</if> </if>
......
...@@ -25,11 +25,22 @@ ...@@ -25,11 +25,22 @@
t_insurance_refund t_insurance_refund
set set
REDUCE_HANDLE_STATUS = #{reduceHandleStatus}, REDUCE_HANDLE_STATUS = #{reduceHandleStatus},
REMARK = #{remark},
UPDATE_BY = #{createBy}, UPDATE_BY = #{createBy},
UPDATE_TIME = #{createTime} UPDATE_TIME = #{createTime}
where where
INS_DETAIL_ID = #{insDetailId} INS_DETAIL_ID = #{insDetailId}
</update> </update>
<update id="updateRefundMoney">
update
t_insurance_refund
set
REFUND_MONEY = #{refundMoney},
UPDATE_BY = #{updateBy},
UPDATE_TIME = #{updateTime}
where
INS_DETAIL_ID = #{insDetailId}
</update>
<select id="getByInsDetailId" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund"> <select id="getByInsDetailId" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund">
</select> </select>
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper"> <mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType"> <resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType">
<id property="id" column="ID" jdbcType="BIGINT"/> <id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="name" column="NAME" jdbcType="VARCHAR"/> <result property="name" column="NAME" jdbcType="VARCHAR"/>
<result property="insuranceCompanyId" column="INSURANCE_COMPANY_ID" jdbcType="BIGINT"/> <result property="insuranceCompanyId" column="INSURANCE_COMPANY_ID" jdbcType="VARCHAR"/>
<result property="receiptUnitName" column="RECEIPT_UNIT_NAME" jdbcType="VARCHAR"/> <result property="receiptUnitName" column="RECEIPT_UNIT_NAME" jdbcType="VARCHAR"/>
<result property="bankName" column="BANK_NAME" jdbcType="VARCHAR"/> <result property="bankName" column="BANK_NAME" jdbcType="VARCHAR"/>
<result property="bankNo" column="BANK_NO" jdbcType="VARCHAR"/> <result property="bankNo" column="BANK_NO" jdbcType="VARCHAR"/>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard"> <resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard">
<id property="id" column="ID" jdbcType="VARCHAR"/> <id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="insuranceTypeId" column="INSURANCE_TYPE_ID" jdbcType="BIGINT"/> <result property="insuranceTypeId" column="INSURANCE_TYPE_ID" jdbcType="VARCHAR"/>
<result property="buyStandard" column="BUY_STANDARD" jdbcType="VARCHAR"/> <result property="buyStandard" column="BUY_STANDARD" jdbcType="VARCHAR"/>
<result property="medicalQuota" column="MEDICAL_QUOTA" jdbcType="VARCHAR"/> <result property="medicalQuota" column="MEDICAL_QUOTA" jdbcType="VARCHAR"/>
<result property="dieDisableQuota" column="DIE_DISABLE_QUOTA" jdbcType="VARCHAR"/> <result property="dieDisableQuota" column="DIE_DISABLE_QUOTA" jdbcType="VARCHAR"/>
......
...@@ -96,7 +96,7 @@ public class TDispatchInfo extends BaseEntity { ...@@ -96,7 +96,7 @@ public class TDispatchInfo extends BaseEntity {
* 员工类型 * 员工类型
*/ */
@Length(max = 32, message = "员工类型 不能超过32个字符" ) @Length(max = 32, message = "员工类型 不能超过32个字符" )
@ExcelAttribute(name = "员工类型", maxLength = 32) @ExcelAttribute(name = "员工类型", isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description = "员工类型" ) @Schema(description = "员工类型" )
@ExcelProperty("员工类型" ) @ExcelProperty("员工类型" )
private String empType; private String empType;
...@@ -112,7 +112,7 @@ public class TDispatchInfo extends BaseEntity { ...@@ -112,7 +112,7 @@ public class TDispatchInfo extends BaseEntity {
* 民族 * 民族
*/ */
@Length(max = 32, message = "民族 不能超过32个字符" ) @Length(max = 32, message = "民族 不能超过32个字符" )
@ExcelAttribute(name = "民族", maxLength = 32) @ExcelAttribute(name = "民族", isDataId = true,dataType = ExcelAttributeConstants.EMP_NATIONAL)
@Schema(description = "民族" ) @Schema(description = "民族" )
@ExcelProperty("民族" ) @ExcelProperty("民族" )
private String empNational; private String empNational;
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
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.core.constant.ExcelAttributeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 派单导出Vo
* @author hgw
* @date 2022-7-28 10:40:34
*/
@Data
@Schema(description = "派单导出Vo")
public class TDispatchInfoExportVo {
@Schema(description = "主键")
@ExcelProperty("主键")
private String id;
@ExcelAttribute(name = "申请编码", maxLength = 30)
@Schema(description = "申请编码")
@ExcelProperty("申请编码")
private String dispatchCode;
@ExcelAttribute(name = "员工编码", maxLength = 30)
@Schema(description = "员工编码")
@ExcelProperty("员工编码")
private String empNo;
@ExcelAttribute(name = "员工姓名", maxLength = 50)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
@ExcelAttribute(name = "身份证号", maxLength = 20)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelAttribute(name = "员工类型", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description = "员工类型")
@ExcelProperty("员工类型")
private String empType;
@ExcelAttribute(name = "社保公积金类型", readConverterExp = "0=社保,1=公积金")
@Schema(description = "社保公积金类型:0社保1公积金")
@ExcelProperty("社保公积金类型")
private String typeSub;
@ExcelAttribute(name = "单位名称", maxLength = 50)
@Schema(description = "单位名称")
@ExcelProperty("单位名称")
private String belongUnitName;
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String settleDomainName;
@ExcelAttribute(name = "项目编码", maxLength = 50)
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String settleDomainCode;
@ExcelAttribute(name = "派单类型", readConverterExp = "0=增加派单,1=减少派单")
@Schema(description = "派单类型:0派增1派减")
@ExcelProperty("派单类型")
private String type;
@ExcelAttribute(name = "派单项", maxLength = 50)
@Schema(description = "派单项:如 养老、公积金")
@ExcelProperty("派单项")
private String dispatchItem;
@ExcelAttribute(name = "社保户", maxLength = 32)
@Schema(description = "社保户")
@ExcelProperty("社保户")
private String socialHouseholdName;
@ExcelAttribute(name = "公积金户", maxLength = 32)
@Schema(description = "公积金户")
@ExcelProperty("公积金户")
private String providentHouseholdName;
@ExcelAttribute(name = "审核状态", readConverterExp = "1=待审核,2=审核通过,3=审核不通过")
@Schema(description = "审核状态:1待审核2审核通过3审核不通过")
@ExcelProperty("审核状态")
private String status;
@ExcelAttribute(name = "社保办理状态", readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=部分办理成功,4=办理中")
@Schema(description = "社保办理状态 0 待办理 1 办理成功 2 办理失败 3 部分办理成功 4 办理中")
@ExcelProperty("社保办理状态")
private String socialHandleStatus;
@ExcelAttribute(name = "公积金办理状态", readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=已派减")
@Schema(description = "公积金办理状态:0 待办理 1办理成功 2 办理失败 3 已派减")
@ExcelProperty("公积金办理状态")
private String fundHandleStatus;
@Schema(description = "申请人")
@ExcelProperty("申请人")
private String createName;
@ExcelAttribute(name = "申请人所在部门", maxLength = 50)
@Schema(description = "申请人所在部门")
@ExcelProperty("申请人所在部门")
private String organName;
@Schema(description = "申请时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@ExcelProperty("申请时间")
private LocalDateTime createTime;
}
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.social.vo; package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/** /**
* 派单信息记录表 * 派单信息记录表
...@@ -31,28 +34,34 @@ import java.time.LocalDateTime; ...@@ -31,28 +34,34 @@ import java.time.LocalDateTime;
@Data @Data
public class TDispatchInfoSearchVo extends TDispatchInfo { public class TDispatchInfoSearchVo extends TDispatchInfo {
/** @TableField(exist = false)
* 多选导出或删除等操作 @Schema(description = "导出的表头的Set")
*/ private Set<String> exportFields;
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/** @Schema(description = "选中的idList")
* 创建时间区间 [开始时间,结束时间] private List<String> idList;
*/ /**
@Schema(description = "创建时间区间") * 多选导出或删除等操作
private LocalDateTime[] createTimes; */
/** @Schema(description = "选中ID,多个逗号分割")
* @Author fxj private String ids;
* 查询数据起
**/ /**
@Schema(description = "查询limit 开始") * 创建时间区间 [开始时间,结束时间]
private int limitStart; */
/** @Schema(description = "创建时间区间")
* @Author fxj private LocalDateTime[] createTimes;
* 查询数据止 /**
**/ * @Author fxj
@Schema(description = "查询limit 数据条数") * 查询数据起
private int limitEnd; **/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
} }
...@@ -230,12 +230,12 @@ public class TDispatchInfoController { ...@@ -230,12 +230,12 @@ public class TDispatchInfoController {
/** /**
* 派单信息记录表 批量导出 * 派单信息记录表 批量导出
* @author fxj * @author hgw
* @date 2022-07-15 11:38:05 * @date 2022-7-28 11:01:56
**/ **/
@Operation(description = "导出派单信息记录表 hasPermission('demo_tdispatchinfo-export')") @Operation(description = "导出派单信息记录表 hasPermission('tdispatchinfo-export')")
@PostMapping("/export") @PostMapping("/export")
@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-export')") @PreAuthorize("@pms.hasPermission('tdispatchinfo-export')")
public void export(HttpServletResponse response, @RequestBody TDispatchInfoSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TDispatchInfoSearchVo searchVo) {
tDispatchInfoService.listExport(response,searchVo); tDispatchInfoService.listExport(response,searchVo);
} }
......
...@@ -146,12 +146,11 @@ public class TPreDispatchInfoController { ...@@ -146,12 +146,11 @@ public class TPreDispatchInfoController {
* @param status 0 是 1 否 * @param status 0 是 1 否
* @return R * @return R
*/ */
@Operation(summary = "修改资料是否提交", description = "修改资料是否提交:status 0 是 1 否(social_tpredispatchinfo_edit)") @Operation(summary = "修改资料是否提交", description = "修改资料是否提交:status 0 是 1 否")
@SysLog("修改资料是否提交") @SysLog("修改资料是否提交")
@PostMapping("/modifyDataSubmitStatus") @PostMapping("/modifyDataSubmitStatus")
@PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_edit')") public R<Boolean> modifyDataSubmitStatus(@RequestParam(value = "ids")String ids,
public R<Boolean> modifyDataSubmitStatus(@RequestParam(value = "ids",required = true)String ids, @RequestParam(value = "status")String status) {
@RequestParam(value = "status",required = true)String status) {
return tPreDispatchInfoService.modifyDataSubmitStatus(ids,status); return tPreDispatchInfoService.modifyDataSubmitStatus(ids,status);
} }
/** /**
...@@ -165,7 +164,7 @@ public class TPreDispatchInfoController { ...@@ -165,7 +164,7 @@ public class TPreDispatchInfoController {
@SysLog("清空预派单默认的派单合同信息") @SysLog("清空预派单默认的派单合同信息")
@PostMapping("/clearContractInfo") @PostMapping("/clearContractInfo")
@PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_edit')") @PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_edit')")
public R<Boolean> clearContractInfo(@RequestParam(value = "ids",required = true)String ids) { public R<Boolean> clearContractInfo(@RequestParam(value = "ids")String ids) {
return tPreDispatchInfoService.clearContractInfo(ids); return tPreDispatchInfoService.clearContractInfo(ids);
} }
...@@ -178,12 +177,11 @@ public class TPreDispatchInfoController { ...@@ -178,12 +177,11 @@ public class TPreDispatchInfoController {
* @param cancelRemark 不派单 时填写 * @param cancelRemark 不派单 时填写
* @return R * @return R
**/ **/
@Operation(summary = "更新预派单是否派单状态", description = "更新预派单是否派单状态(social_tpredispatchinfo_edit)") @Operation(summary = "更新预派单是否派单状态", description = "更新预派单是否派单状态")
@SysLog("更新预派单是否派单状态") @SysLog("更新预派单是否派单状态")
@PostMapping("/updateDispatchFlag") @PostMapping("/updateDispatchFlag")
@PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_edit')") public R<Boolean> updateDispatchFlag(@RequestParam(value = "id")String id,
public R<Boolean> updateDispatchFlag(@RequestParam(value = "id",required = true)String id, @RequestParam(value = "dispatchFlag")String dispatchFlag,
@RequestParam(value = "dispatchFlag",required = true)String dispatchFlag,
@RequestParam(value = "cancelRemark",required = false)String cancelRemark) { @RequestParam(value = "cancelRemark",required = false)String cancelRemark) {
return tPreDispatchInfoService.updateDispatchFlag(id,dispatchFlag,cancelRemark); return tPreDispatchInfoService.updateDispatchFlag(id,dispatchFlag,cancelRemark);
} }
...@@ -197,7 +195,8 @@ public class TPreDispatchInfoController { ...@@ -197,7 +195,8 @@ public class TPreDispatchInfoController {
*/ */
@Operation(summary = "单个派单:按创建人和ID", description = "单个派单:按创建人和ID") @Operation(summary = "单个派单:按创建人和ID", description = "单个派单:按创建人和ID")
@PostMapping("/dispatchById") @PostMapping("/dispatchById")
public R<Boolean> dispatchById(@RequestParam(value = "id",required = true)String id) { @PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_dispatch')")
public R<Boolean> dispatchById(@RequestParam(value = "id")String id) {
return tPreDispatchInfoService.dispatchById(id); return tPreDispatchInfoService.dispatchById(id);
} }
...@@ -209,6 +208,7 @@ public class TPreDispatchInfoController { ...@@ -209,6 +208,7 @@ public class TPreDispatchInfoController {
*/ */
@Operation(summary = "一键派单:按创建人查找正常未派单的数据", description = "一键派单:按创建人查找正常未派单的数据") @Operation(summary = "一键派单:按创建人查找正常未派单的数据", description = "一键派单:按创建人查找正常未派单的数据")
@PostMapping("/oneKeyToDispatch") @PostMapping("/oneKeyToDispatch")
@PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_dispatch')")
public R oneKeyToDispatch(@RequestParam String idStr) { public R oneKeyToDispatch(@RequestParam String idStr) {
return tPreDispatchInfoService.oneKeyToDispatch(idStr); return tPreDispatchInfoService.oneKeyToDispatch(idStr);
} }
......
...@@ -26,6 +26,8 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.FundHandleExportVo; ...@@ -26,6 +26,8 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.FundHandleExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.FundSupplementaryExportVo; import com.yifu.cloud.plus.v1.yifu.social.vo.FundSupplementaryExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleExportVo; import com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -46,6 +48,15 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> { ...@@ -46,6 +48,15 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
*/ */
IPage<TDispatchInfo> getTDispatchInfoPage(Page<TDispatchInfo> page, @Param("tDispatchInfo") TDispatchInfo tDispatchInfo); IPage<TDispatchInfo> getTDispatchInfoPage(Page<TDispatchInfo> page, @Param("tDispatchInfo") TDispatchInfo tDispatchInfo);
/**
* @Description: 派单导出
* @Author: hgw
* @Date: 2022/7/28 10:45
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoExportVo>
**/
List<TDispatchInfoExportVo> exportDispatch(@Param("tDispatchInfo") TDispatchInfoSearchVo tDispatchInfo);
/** /**
* 导出社保花名册数据查询 * 导出社保花名册数据查询
* @Author fxj * @Author fxj
......
...@@ -103,9 +103,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -103,9 +103,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/ */
@Override @Override
public void listExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo) { public void listExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo) {
String fileName = "派单信息导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "派单批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TDispatchInfo> list = new ArrayList<>(); List<TDispatchInfoExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo); long count = noPageCountDiy(searchVo);
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
...@@ -114,22 +114,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -114,22 +114,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TDispatchInfo.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, TDispatchInfoExportVo.class).includeColumnFiledNames(searchVo.getExportFields()).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) { for (int i = 0; i <= count; ) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo); list = exportDispatch(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
ExcelUtil<TDispatchInfo> util = new ExcelUtil<>(TDispatchInfo.class); ExcelUtil<TDispatchInfoExportVo> util = new ExcelUtil<>(TDispatchInfoExportVo.class);
for (TDispatchInfo vo : list) { for (TDispatchInfoExportVo vo : list) {
util.convertEntity(vo, null, null, null); util.convertEntity(vo, null, null, null);
} }
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("派单信息记录表" + index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("派单" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
} }
...@@ -139,7 +139,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -139,7 +139,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
} }
} else { } else {
WriteSheet writeSheet = EasyExcel.writerSheet("派单信息记录表" + index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("派单" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
...@@ -163,8 +163,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -163,8 +163,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Override @Override
public List<TDispatchInfo> noPageDiy(TDispatchInfoSearchVo searchVo) { public List<TDispatchInfo> noPageDiy(TDispatchInfoSearchVo searchVo) {
LambdaQueryWrapper<TDispatchInfo> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TDispatchInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds()); List<String> idList;
if (Common.isNotNull(idList)) { if (Common.isNotNull(searchVo.getIds())) {
idList = Common.getList(searchVo.getIds());
wrapper.in(TDispatchInfo::getId, idList);
} else if (searchVo.getIdList() != null) {
idList = searchVo.getIdList();
wrapper.in(TDispatchInfo::getId, idList); wrapper.in(TDispatchInfo::getId, idList);
} }
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) { if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
...@@ -174,10 +178,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -174,10 +178,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return baseMapper.selectList(wrapper); return baseMapper.selectList(wrapper);
} }
private List<TDispatchInfoExportVo> exportDispatch(TDispatchInfoSearchVo searchVo) {
if (Common.isNotNull(searchVo.getIds())) {
List<String> idList = Common.getList(searchVo.getIds());
searchVo.setIdList(idList);
}
return baseMapper.exportDispatch(searchVo);
}
private Long noPageCountDiy(TDispatchInfoSearchVo searchVo) { private Long noPageCountDiy(TDispatchInfoSearchVo searchVo) {
LambdaQueryWrapper<TDispatchInfo> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TDispatchInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds()); List<String> idList;
if (Common.isNotNull(idList)) { if (Common.isNotNull(searchVo.getIds())) {
idList = Common.getList(searchVo.getIds());
wrapper.in(TDispatchInfo::getId, idList);
} else if (searchVo.getIdList() != null) {
idList = searchVo.getIdList();
wrapper.in(TDispatchInfo::getId, idList); wrapper.in(TDispatchInfo::getId, idList);
} }
return baseMapper.selectCount(wrapper); return baseMapper.selectCount(wrapper);
......
...@@ -158,9 +158,6 @@ ...@@ -158,9 +158,6 @@
<if test="sysBaseSetInfo.town != null"> <if test="sysBaseSetInfo.town != null">
AND a.TOWN = #{sysBaseSetInfo.town} AND a.TOWN = #{sysBaseSetInfo.town}
</if> </if>
<if test="sysBaseSetInfo.applyStartDate != null">
AND a.APPLY_START_DATE = #{sysBaseSetInfo.applyStartDate}
</if>
<if test="sysBaseSetInfo.applyStartDate != null"> <if test="sysBaseSetInfo.applyStartDate != null">
AND a.APPLY_START_DATE <![CDATA[ <= ]]> #{sysBaseSetInfo.applyStartDate} AND a.APPLY_START_DATE <![CDATA[ <= ]]> #{sysBaseSetInfo.applyStartDate}
AND (a.APPLY_END_DATE is null or a.APPLY_END_DATE <![CDATA[ >= ]]> #{sysBaseSetInfo.applyStartDate}) AND (a.APPLY_END_DATE is null or a.APPLY_END_DATE <![CDATA[ >= ]]> #{sysBaseSetInfo.applyStartDate})
......
...@@ -95,6 +95,31 @@ ...@@ -95,6 +95,31 @@
<result property="idCardAddress" column="ID_CARD_ADDRESS"/> <result property="idCardAddress" column="ID_CARD_ADDRESS"/>
</resultMap> </resultMap>
<!-- 派单导出vo -->
<resultMap id="exportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoExportVo">
<id property="id" column="ID"/>
<result property="dispatchCode" column="DISPATCH_CODE"/>
<result property="empNo" column="EMP_NO"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empType" column="EMP_TYPE"/>
<result property="typeSub" column="TYPE_SUB"/>
<result property="belongUnitName" column="BELONG_UNIT_NAME"/>
<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
<result property="settleDomainCode" column="SETTLE_DOMAIN_CODE"/>
<result property="type" column="TYPE"/>
<result property="dispatchItem" column="DISPATCH_ITEM"/>
<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
<result property="status" column="STATUS"/>
<result property="socialHandleStatus" column="SOCIAL_HANDLE_STATUS"/>
<result property="fundHandleStatus" column="FUND_HANDLE_STATUS"/>
<result property="createName" column="CREATE_NAME"/>
<result property="organName" column="ORGAN_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
</resultMap>
<resultMap id="fundSupplementaryMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.FundSupplementaryExportVo"> <resultMap id="fundSupplementaryMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.FundSupplementaryExportVo">
<result property="providentStart" column="PROVIDENT_START"/> <result property="providentStart" column="PROVIDENT_START"/>
<result property="unitProvidengCardinal" column="UNIT_PROVIDENG_CARDINAL"/> <result property="unitProvidengCardinal" column="UNIT_PROVIDENG_CARDINAL"/>
...@@ -364,6 +389,43 @@ ...@@ -364,6 +389,43 @@
1=1 1=1
<include refid="tDispatchInfo_where"/> <include refid="tDispatchInfo_where"/>
</where> </where>
order by a.CREATE_TIME desc
</select>
<!-- 派单导出 -->
<select id="exportDispatch" resultMap="exportMap">
select
a.ID,
a.DISPATCH_CODE,
a.EMP_NO,
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_TYPE,
a.TYPE_SUB,
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.SETTLE_DOMAIN_CODE,
a.TYPE,
a.DISPATCH_ITEM,
s.SOCIAL_HOUSEHOLD_NAME,
f.PROVIDENT_HOUSEHOLD_NAME,
a.STATUS,
a.SOCIAL_HANDLE_STATUS,
a.FUND_HANDLE_STATUS,
a.CREATE_NAME,
a.ORGAN_NAME,
a.CREATE_TIME
from t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
left join t_provident_fund f on f.id=a.FUND_ID
<where>
1=1
<include refid="tDispatchInfo_where"/>
</where>
order by a.CREATE_TIME desc
<if test="tSocialFundInfo.limitStart != null">
limit #{tDispatchInfo.limitStart},#{tDispatchInfo.limitEnd}
</if>
</select> </select>
<resultMap id="socialHandleExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleExportVo"> <resultMap id="socialHandleExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleExportVo">
<result property="empName" column="EMP_NAME"/> <result property="empName" column="EMP_NAME"/>
......
...@@ -392,7 +392,7 @@ ...@@ -392,7 +392,7 @@
<sql id="tSocialFundInfo_where"> <sql id="tSocialFundInfo_where">
<if test="tSocialFundInfo != null"> <if test="tSocialFundInfo != null">
<if test="tSocialFundInfo.idList != null"> <if test="tSocialFundInfo.idList != null">
AND a.id in AND a.ID in
<foreach item="idStr" index="index" collection="tSocialFundInfo.idList" open="(" separator="," close=")"> <foreach item="idStr" index="index" collection="tSocialFundInfo.idList" open="(" separator="," close=")">
#{idStr} #{idStr}
</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