Commit 3f0e299e authored by hongguangwu's avatar hongguangwu

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

# Conflicts:
#	yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/mapper/TDispatchInfoMapper.java
#	yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TDispatchInfoServiceImpl.java
#	yifu-social/yifu-social-biz/src/main/resources/mapper/TDispatchInfoMapper.xml
parents 1e2fff65 f4ff31f2
apiVersion: apps/v1 # 指定api版本,此值必须在kubectl api-versions中
kind: Deployment # 指定创建资源的角色/类型
metadata: # 资源的元数据/属性
name: yifu-insurances # 资源的名字,在同一个namespace中必须唯一
namespace: qas-mvp # 部署在哪个namespace中
spec: # 资源规范字段
selector: # 选择器
matchLabels: # 匹配标签
app: yifu-insurances
replicas: 1 # 声明副本数目
#revisionHistoryLimit: 3 # 保留历史版本
#strategy: # 策略
# rollingUpdate: # 滚动更新
# maxSurge: 30% # 最大额外可以存在的副本数,可以为百分比,也可以为整数
# maxUnavailable: 30% # 示在更新过程中能够进入不可用状态的 Pod 的最大值,可以为百分比,也可以为整数
# type: RollingUpdate # 滚动更新策略
template: # 模版
metadata: # 模版
labels: # 设定资源的标签
app: yifu-insurances
annotations:
dapr.io/enabled: "true" #设定此参数为 true 注入Dapr sidecar到pod
dapr.io/app-id: "yifu-insurances" #应用程序唯一 ID。 用于服务发现、状态封装 和 发布/订阅 消费者ID
dapr.io/app-port: "5005" #这个参数告诉Dapr你的应用程序正在监听哪个端口。
#dapr.io/log-level: "debug" #为 Dapr sidecar设置日志级别。 允许的值是debug,info,warn,error。 默认是 info
#dapr.io/log-as-json: "false" #将此参数设置为true以JSON格式输出日志。 默认值为 false.
#dapr.io/config: file #告诉 Dapr 要使用哪个配置 CRD
dapr.io/app-protocol: "http" #告诉 Dapr 你的应用程序正在使用哪种协议。 有效选项是 http and grpc。 Default is http
#dapr.io/app-max-concurrency: "20" #限制应用程序的并发量。 有效的数值是大于 0
#dapr.io/app-ssl: "false" #告诉Dapr通过不安全的SSL连接调用应用程序。 同时适用于HTTP和gRPC。 Traffic between your app and the Dapr sidecar is encrypted with a certificate issued by a non-trusted certificate authority, which is considered insecure. 默认值为 false.
dapr.io/metrics-port: "9090" #设置 sidecar 度量服务器的端口。 默认值为 9090
#dapr.io/sidecar-cpu-limit: 2 #Dapr sidecar可以使用的最大CPU数量。 默认情况下未设置
#dapr.io/sidecar-memory-limit: "800Mi" #Dapr sidecar可以使用的最大内存量。默认情况下未设置 请参阅 https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/ 的有效值。
#dapr.io/sidecar-cpu-request: 1 #Dapr sidecar要求的 CPU 数量
#dapr.io/sidecar-memory-request #Dapr sidecar 请求的内存数量
dapr.io/http-max-request-size: "100" #增加http和grpc服务器请求正文参数的最大大小,单位为MB,以处理大文件的上传。 默认值为 4 MB
dapr.io/http-read-buffer-size: "16" #Dapr has a default limit of 4KB for the http header read buffer size. When sending http headers that are bigger than the default 4KB, you can increase this value. Otherwise, you may encounter a Too big request header
dapr.io/sidecar-listen-addresses: "0.0.0.0"
# 更多dapr配置请参考 https://www.bookstack.cn/read/dapr-1.5-zh/cc77b74e2cc2f4d4.md
spec: # 资源规范字段
nodeSelector: # node 选择器
node-type: worker # node标签
containers: # 容器
- name: yifu-insurances # 容器的名字
image: hub.yifucenter.com:5500/qas-mvp/yifu-insurances-biz:1.0.0 # 容器镜像地址
imagePullPolicy: Always # 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent
# Always,每次都检查;Never,每次都不检查(不管本地是否有);IfNotPresent,如果本地有就不检查,如果没有就拉取(手动测试时,
# 已经打好镜像存在docker容器中时,使用存在不检查级别,
# 默认为每次都检查,然后会进行拉取新镜像,因镜像仓库不存在,导致部署失败)
ports:
- containerPort: 5005 # 容器端口
env: # 启动环境配置信息 active and timeZone set
- name: SPRING_PROFILES_ACTIVE
value: test
- name: TZ
value: Asia/Shanghai
resources: #资源配置限制
limits: # 最大使用
memory: "2048Mi"
#cpu: 300m # CPU,1核心 = 1000m
requests: # 容器运行时,最低资源需求,也就是说最少需要多少资源容器才能正常运行
#cpu: 100m
memory: "500Mi"
#livenessProbe: # pod 内部健康检查的设置
# httpGet: # 通过httpget检查健康,返回200-399之间,则认为容器正常
# path: /healthCheck # URI地址
# port: 8080 # 端口
# scheme: HTTP # 协议
# # host: 127.0.0.1 # 主机地址
# initialDelaySeconds: 30 # 表明第一次检测在容器启动后多长时间后开始
# timeoutSeconds: 5 # 检测的超时时间
# periodSeconds: 30 # 检查间隔时间
# successThreshold: 1 # 成功门槛
# failureThreshold: 5 # 失败门槛,连接失败5次,pod杀掉,重启一个新的pod
# readinessProbe: # Pod 准备服务健康检查设置
# httpGet:
# path: /healthCheck
# port: 8080
# scheme: HTTP
# initialDelaySeconds: 30
# timeoutSeconds: 5
# periodSeconds: 10
# successThreshold: 1
# failureThreshold: 5
#也可以用这种方法
#exec: 执行命令的方法进行监测,如果其退出码不为0,则认为容器正常
# command:
# - cat
# - /tmp/health
#也可以用这种方法
#tcpSocket: # 通过tcpSocket检查健康
# port: number
#ports:
# - name: http # 名称
# containerPort: 8080 # 容器开发对外的端口
# protocol: TCP # 协议
imagePullSecrets: # 镜像仓库拉取密钥
- name: login
#affinity: # 亲和性调试
# nodeAffinity: # 节点亲和力
# requiredDuringSchedulingIgnoredDuringExecution: # pod 必须部署到满足条件的节点上
# nodeSelectorTerms: # 节点满足任何一个条件就可以
# - matchExpressions: # 有多个选项,则只有同时满足这些逻辑选项的节点才能运行 pod
# - key: beta.kubernetes.io/arch
# operator: In
# values:
# - amd64
\ No newline at end of file
apiVersion: v1 # 指定api版本,此值必须在kubectl api-versions中
kind: Service # 指定创建资源的角色/类型
metadata: # 资源的元数据/属性
labels: # 设定资源的标签
app: yifu-insurances # 资源的名字,在同一个namespace中必须唯一
name: yifu-insurances # 资源的名字,在同一个namespace中必须唯一
namespace: qas-mvp # 部署在哪个namespace中
spec: # 资源规范字段
ports:
- port: 5005 # service 端口
protocol: TCP # 协议
targetPort: 5005 # 容器暴露的端口
name: http-insurances # 端口名称
- port: 3500 # service 端口
protocol: TCP # 协议
targetPort: 3500 # 容器暴露的端口
name: http-insurances-dapr
selector: # 选择器
app: yifu-insurances # 资源名称
type: ClusterIP # ClusterIP 类型
\ No newline at end of file
......@@ -28,7 +28,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
......@@ -49,7 +48,6 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
......@@ -64,7 +62,6 @@ import java.io.InputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* 人员档案表
......@@ -2079,17 +2076,21 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 新增项目档案不需要返回ID
saveProject(empAddsMap, projectsMap);
// 新增合同
saveContract(projectsMap, contractsMap);
saveContract(projectsMap, contractsMap,empAddsMap);
addVo.setProjectsMap(projectsMap);
addVo.setEmpAddsMap(empAddsMap);
addVo.setContractsMap(contractsMap);
return addVo;
}
private void saveContract(Map<String, EmpProjectDispatchVo> projectsMap, Map<String, EmpContractDispatchVo> contractsMap) {
private void saveContract(Map<String, EmpProjectDispatchVo> projectsMap,
Map<String, EmpContractDispatchVo> contractsMap,
Map<String, EmpAddDispatchVo> empAddsMap) {
if (Common.isNotNull(contractsMap)) {
EmpContractDispatchVo contractAdd;
TEmployeeContractInfo contract;
EmpAddDispatchVo emp;
EmpProjectDispatchVo project;
for (Map.Entry<String, EmpContractDispatchVo> entry : contractsMap.entrySet()) {
contractAdd = entry.getValue();
try {
......@@ -2097,11 +2098,15 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
contract = new TEmployeeContractInfo();
BeanUtil.copyProperties(contractAdd, contract);
if (Common.isEmpty(contract.getEmpId()) && Common.isNotNull(projectsMap)) {
EmpProjectDispatchVo project = projectsMap.get(contract.getEmpIdcard());
project = projectsMap.get(contract.getEmpIdcard());
if (Common.isNotNull(project)) {
contract.setEmpId(project.getId());
contract.setEmpNo(project.getEmpNo());
}
emp = empAddsMap.get(contract.getEmpIdcard());
if (Common.isNotNull(emp)){
contract.setEmpId(emp.getId());
}
}
contractMapper.insert(contract);
contractAdd.setId(contract.getId());
......
package com.yifu.cloud.plus.v1.yifu.common.core.constant;
import java.util.regex.Pattern;
/**
* @author fang
* 常用的一些验证,如手机、移动号码、联通号码、电信号码、密码、座机、 邮政编码、邮箱、年龄、身份证、URL、QQ、汉字、字母、数字等校验表达式
......@@ -63,4 +66,7 @@ public class ValidityConstants {
public static final String PATTERN_50 = "^.{1,50}$";
/** 最多60位 规则 */
public static final String PATTERN_60 = "^.{1,60}$";
/** 不超过两位小数的正数 */
public static final String POSITIVE_INTEGER_PATTERN_TWO_FLOAT = "^[+]?([0-9]+(.[0-9]{1,2})?)$";
}
......@@ -284,10 +284,34 @@ public class InsurancesConstants {
* 保单号不能为空
*/
public static final String POLICY_NO_EMPTY = "保单号不能为空";
/**
* 保单号长度超过50字符限制
*/
public static final String POLICY_NO_MORE_THAN_50 = "保单号长度超过50字符限制";
/**
* 发票号长度超过50字符限制
*/
public static final String INVOICE_NO_MORE_THAN_50 = "发票号长度超过50字符限制";
/**
* 保费不能为空
*/
public static final String ACTUAL_PREMIUM_NO_EMPTY = "保费不能为空";
public static final String ACTUAL_PREMIUM_EMPTY = "保费不能为空";
/**
* 保费金额格式错误
*/
public static final String ACTUAL_PREMIUM_PARSE_ERROR= "保费金额格式错误";
/**
* 替换类型无法登记保单保费
*/
public static final String BUY_TYPE_FOUR_NOT_REGISTERED= "替换类型无法登记保单保费";
/**
* 商险待投保,无法登记保单保费
*/
public static final String BUY_HANDLE_ONE_NOT_REGISTERED = "商险待投保,无法登记保单保费";
/**
* 商险投保中,无法登记保单保费
*/
public static final String BUY_HANDLE_TWO_NOT_REGISTERED = "商险投保中,无法登记保单保费";
/**
* 保单号不存在或已过期
*/
......@@ -304,24 +328,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 = "商险已减员,无法减员";
/**
* 替换结算月份和原有结算月份相同
......@@ -329,14 +378,41 @@ public class InsurancesConstants {
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_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_REDUCE_HANDLE_STATUS_ERROR = "当前保单已处于减员流程,无法变更结算月";
public static final String SETTLE_MONTH_CHANGE_SETTLE_STATUS_TWO_ERROR = "商险结算中,无法变更结算月";
/**
* 当前保单已结算,无法变更结算月
* 商险已结算,无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR = "当前保单已结算,无法变更结算月";
public static final String SETTLE_MONTH_CHANGE_SETTLE_STATUS_THREE_ERROR = "商险已结算,无法变更结算月";
/**
* 替换类型无法变更结算月
*/
public static final String SETTLE_MONTH_CHANGE_IS_EFFECT_ERROR ="替换类型无法变更结算月";
/**
* 替换项目ID和原有项目ID相同
......@@ -354,44 +430,55 @@ public class InsurancesConstants {
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 DEPT_NO_CHANGE_IS_NOT_EXIST = "替换项目不存在";
/**
* 退费金额不能为空
*/
public static final String EMP_NAME_MAX_LENGTH_ERROR = "姓名不能超过20个字符";
public static final String REFUND_MONEY_NOT_EMPTY = "保费不能为空";
/**
* 保费金额格式不正确
*/
public static final String REFUND_MONEY_PARSE_ERROR = "保费金额格式不正确";
/**
* 员工减员记录不存在
......@@ -408,5 +495,56 @@ public class InsurancesConstants {
*/
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 {
*/
@Schema(description = "险种id")
@TableId(type = IdType.ASSIGN_ID)
private Long id;
private String id;
/**
* 险种名称
......
......@@ -25,7 +25,7 @@ public class TInsuranceTypeStandard extends BaseEntity {
/**
* 购买标准id
*/
@Schema(description = "保险公司id")
@Schema(description = "购买标准id")
@TableId(type = IdType.ASSIGN_ID)
private String id;
......
......@@ -152,6 +152,29 @@ public class ValidityUtil {
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;
}
/**
* 姓名验证
*
......@@ -259,7 +282,7 @@ public class ValidityUtil {
}
/**
* 验证字符串 最多50位
* 验证字符串 最多60位
*
* @author licancan
* @param str
......
......@@ -15,7 +15,11 @@ import java.io.Serializable;
@Tag(name = "变更所属项目")
public class DeptChangeCheckParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
//姓名+身份证号+原项目编码+保险公司+险种+保单开始时间+保单结束时间+保单结束时间+标准+有效+未减员 是否存在校验
/**
* 商险id
*/
@Schema(description = "商险id")
private String id;
/**
* 员工姓名
*/
......
......@@ -226,6 +226,14 @@ public class InsuredListVo implements Serializable {
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 购买月数
*/
@Schema(description = "购买月数")
private Long buyMonth;
//订单编号、姓名、身份证号、投保类型、项目、岗位、保单开始日期、保单结束日期、保险公司、险种、购买标准、医保、身故或残疾、预估保费、实际保费、保单号、发票号、保单生效日期、商险购买地、商险办理地、是否出险、是否过期、是否失效、派单日期、派单人
}
......@@ -183,5 +183,15 @@ public class RefundExportListVo implements Serializable {
@Schema(description = "备注")
private String remark;
/**
* 购买月数
*/
@Schema(description = "购买月数")
private Long buyMonth;
/**
* 购买天数
*/
@Schema(description = "购买天数")
private long buyDay;
}
......@@ -15,7 +15,12 @@ import java.io.Serializable;
@Tag(name = "结算月变更")
public class SettleMonthChangeCheckParam implements Serializable {
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;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
......@@ -12,7 +11,6 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -88,7 +86,7 @@ public class TInsuranceCompanyController {
* @return
*/
@Operation(summary = "查询保险公司列表(不分页)", description = "查询保险公司列表(不分页)")
@GetMapping("/list" )
@GetMapping("/list")
public R<List<TInsuranceCompany>> getInsuranceCompanyList() {
return R.ok(insuranceCompanyService.getInsuranceCompanyList());
}
......
......@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import io.swagger.v3.oas.annotations.Operation;
......
......@@ -23,4 +23,6 @@ public interface TInsuranceRefundMapper extends BaseMapper<TInsuranceRefund> {
TInsuranceRefund getByInsDetailId(String id);
void updateByInsDetailId(TInsuranceRefund insuranceRefund);
int updateRefundMoney(TInsuranceRefund insuranceRefund);
}
......@@ -15,4 +15,6 @@ public interface TInsuranceRefundService extends IService<TInsuranceRefund> {
void updateByInsDetailId(TInsuranceRefund insuranceRefund);
int updateRefundMoney(TInsuranceRefund insuranceRefund);
}
......@@ -1669,12 +1669,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
listResult.add(param);
continue;
}
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
listResult.add(param);
......@@ -1685,6 +1679,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (StringUtils.isNotBlank(param.getInvoiceNo())){
if (!ValidityUtil.validate50(param.getInvoiceNo())){
param.setErrorMessage(InsurancesConstants.INVOICE_NO_MORE_THAN_50);
listResult.add(param);
continue;
}
}
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
......@@ -1707,12 +1708,37 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (!ValidityUtil.validate50(param.getPolicyNo())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_MORE_THAN_50);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getActualPremium())){
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_NO_EMPTY);
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_EMPTY);
listResult.add(param);
continue;
}
if(BigDecimalUtils.isBigDecimal(param.getActualPremium())){
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_PARSE_ERROR);
listResult.add(param);
continue;
}
}
if (detail.getBuyType() == CommonConstants.FOUR_INT){
param.setErrorMessage(InsurancesConstants.BUY_TYPE_FOUR_NOT_REGISTERED);
listResult.add(param);
continue;
}
if (detail.getBuyHandleStatus() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.BUY_HANDLE_ONE_NOT_REGISTERED);
listResult.add(param);
continue;
}
if (detail.getBuyHandleStatus() == CommonConstants.TWO_INT){
param.setErrorMessage(InsurancesConstants.BUY_HANDLE_TWO_NOT_REGISTERED);
listResult.add(param);
continue;
}
}
listSuccess.add(param);
}
......@@ -1802,10 +1828,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<InsuranceRefundCheck>> refundMap = checkInsuranceRefundList(insuranceRefundCheckList);
List<InsuranceRefundCheck> successList = refundMap.get("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){
TInsuranceRefund insuranceRefund = new TInsuranceRefund();
insuranceRefund.setInsDetailId(refund.getId());
......@@ -1813,12 +1835,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefund.setRemark(refund.getRemark());
if(null == refund.getReduceHandleStatus() || CommonConstants.THREE_INT == refund.getReduceHandleStatus()){
tInsuranceRefundService.updateByInsDetailId(insuranceRefund);
}else{
if(StringUtils.isNotBlank(refund.getRemark())){
insuranceRefund.setRemark(refund.getRemark());
}
if(null == refund.getReduceHandleStatus()){
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());
update(updateWrapper);
}
......@@ -1845,6 +1873,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (InsuredListVo record : insuranceList.getRecords()) {
//购买月数
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyStart().toString(),record.getPolicyEnd().toString()));
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
......@@ -1956,6 +1986,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (RefundExportListVo record : insuranceRefundHandlingPageList.getRecords()) {
//购买月数
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyStart().toString(),record.getPolicyEnd().toString()));
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
......@@ -1997,6 +2029,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
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());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
......@@ -2071,6 +2107,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
tInsuranceDetail.setUpdateBy(user.getId());
tInsuranceDetail.setReduceHandleStatus(refundType);
if(CommonConstants.FOUR_INT == refundType){
tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT);
}
successList.add(tInsuranceDetail);
refund.setInsDetailId(tInsuranceDetail.getId());
refund.setCreateBy(user.getId());
......@@ -2087,6 +2126,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceRefundService.updateByInsDetailId(refund);
}
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,"操作成功");
}
......@@ -2107,22 +2152,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList);
//todo 生成EKP通知,通知ekp变更结算月份
List<SettleMonthChangeCheckParam> successList = map.get("successList");
for (SettleMonthChangeCheckParam success : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,success.getEmpName())
.eq(TInsuranceDetail ::getEmpIdcardNo,success.getEmpIdCardNo()).eq(TInsuranceDetail :: getInsuranceTypeName,success.getInsuranceTypeName() )
.eq(TInsuranceDetail :: getDeptNo,success.getDeptNo()).eq(TInsuranceDetail :: getBuyStandard,success.getBuyStandard())
.eq(TInsuranceDetail :: getInsuranceCompanyName,success.getInsuranceCompanyName())
.eq(TInsuranceDetail :: getPolicyStart,success.getPolicyStart() ).eq(TInsuranceDetail :: getPolicyEnd,success.getPolicyEnd())
.set(TInsuranceDetail :: getSettleMonth,success.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
if(CollectionUtils.isNotEmpty(successList)){
for (SettleMonthChangeCheckParam success : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
.set(TInsuranceDetail :: getSettleMonth,success.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
}
}
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
//判断当前变更是否全部成功
return R.ok(errorList);
return R.ok(errorList,"导入成功");
}
/**
......@@ -2142,21 +2183,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList);
//todo 生成EKP通知,通知ekp变更结算所属项目
List<DeptChangeCheckParam> successList = stringListMap.get("successList");
for (DeptChangeCheckParam success : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,success.getEmpName())
.eq(TInsuranceDetail ::getEmpIdcardNo,success.getEmpIdCardNo()).eq(TInsuranceDetail :: getInsuranceTypeName,success.getInsuranceTypeName() )
.eq(TInsuranceDetail :: getDeptNo,success.getOldDeptNo()).eq(TInsuranceDetail :: getBuyStandard,success.getBuyStandard())
.eq(TInsuranceDetail :: getInsuranceCompanyName,success.getInsuranceCompanyName())
.eq(TInsuranceDetail :: getPolicyStart,success.getPolicyStart() ).eq(TInsuranceDetail :: getPolicyEnd,success.getPolicyEnd())
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
.set(TInsuranceDetail :: getSettleType,success.getSettleType())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
if(CollectionUtils.isNotEmpty(successList)){
for (DeptChangeCheckParam success : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
.set(TInsuranceDetail :: getSettleType,success.getSettleType())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
}
}
List<DeptChangeCheckParam> errorList = stringListMap.get("errorList");
return R.ok(errorList);
return R.ok(errorList,"导入成功");
}
/**
......@@ -2235,7 +2274,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
public R updateRefundMoney(List<RefundMoneyParam> paramList) {
YifuUser user = SecurityUtils.getUser();
List<TInsuranceRefund> insuranceRefundList = new ArrayList<>();
Map<String, List<RefundMoneyParam>> map = refundMoneyCheck(paramList);
List<RefundMoneyParam> successList = map.get("successList");
if (CollectionUtils.isNotEmpty(successList)){
......@@ -2247,9 +2285,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefundList.add(insuranceRefund);
tInsuranceRefundService.updateRefundMoney(insuranceRefund);
}
tInsuranceRefundService.saveBatch(insuranceRefundList);
}
return R.ok(map.get("errorList"));
}
......@@ -2274,7 +2311,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//员工身份证
String empIdCardNo = param.getEmpIdcardNo();
if(StringUtils.isBlank(empIdCardNo)){
......@@ -2282,7 +2318,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//保险公司名称
String insuranceCompanyName = param.getInsuranceCompanyName();
if(StringUtils.isBlank(insuranceCompanyName)){
......@@ -2290,7 +2325,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//险种名称
String insuranceTypeName = param.getInsuranceTypeName();
if(StringUtils.isBlank(insuranceTypeName)){
......@@ -2298,7 +2332,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//保单开始日期
String policyStart = param.getPolicyStart();
if(StringUtils.isBlank(policyStart)){
......@@ -2306,7 +2339,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//保单结束日期
String policyEnd = param.getPolicyEnd();
if(StringUtils.isBlank(policyEnd)){
......@@ -2314,7 +2346,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
......@@ -2333,46 +2364,70 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
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<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).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 one = getOne(queryWrapper);
if (Common.isEmpty(one)){
param.setErrorMessage(InsurancesConstants.DATA_IS_NOT_EXIST);
param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
errorList.add(param);
continue;
}
//当前保单信息的不是已投保状态不能导入
Integer buyHandleStatus = one.getBuyHandleStatus();
if (CommonConstants.THREE_INT != buyHandleStatus){
param.setErrorMessage(InsurancesConstants.REFUND_ERROR);
if (CommonConstants.ONE_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_ONE_ERROR);
errorList.add(param);
continue;
}
if (CommonConstants.TWO_INT == buyHandleStatus){
param.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
Integer reduceHandleStatus = one.getReduceHandleStatus();
//当前保单信息的减员状态不为空时不能进行导入
if(reduceHandleStatus != null && CommonConstants.THREE_INT != reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.REFUND_ERROR);
//当前保单信息的减员状态不为空且不为减员退回时时不能进行导入
if(CommonConstants.ONE_INT == reduceHandleStatus ){
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);
continue;
}
//出险状态
if(CommonConstants.ZERO_INT != one.getIsUse()){
param.setErrorMessage(InsurancesConstants.IS_USE_ERROR);
param.setErrorMessage(InsurancesConstants.INSURANCE_IS_USE_ERROR);
errorList.add(param);
continue;
}
//有效状态
if(CommonConstants.ZERO_INT != one.getIsEffect()){
param.setErrorMessage(InsurancesConstants.IS_EFFECT_ERROR);
param.setErrorMessage(InsurancesConstants.INSURANCE_IS_EFFECT_ERROR);
errorList.add(param);
continue;
}
//过期状态
if (CommonConstants.ZERO_INT != one.getIsOverdue()){
param.setErrorMessage(InsurancesConstants.IS_OVERDUE_ERROR);
param.setErrorMessage(InsurancesConstants.INSURANCE_IS_OVERDUE_ERROR);
errorList.add(param);
continue;
}
......@@ -2425,34 +2480,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
if(empName.length()>CommonConstants.TWENTY_INT){
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)){
if(!ValidityUtil.validateMoney(refundMoney)){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_PARSE_ERROR);
errorList.add(param);
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();
refundDetail.setEmpName(empName);
......@@ -2464,11 +2496,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
if ( null != tInsuranceRefundDetail.getRefundMoney()){
/* if ( null != tInsuranceRefundDetail.getRefundMoney()){
param.setErrorMessage(InsurancesConstants.REFUND_MONEY_IS_NOT_NULL);
errorList.add(param);
continue;
}
}*/
param.setId(tInsuranceRefundDetail.getInsDetailId());
successList.add(param);
}
......@@ -2485,16 +2517,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
private Map<String,List<SettleMonthChangeCheckParam>> settleMonthChangeCheck(List<SettleMonthChangeCheckParam> settleMonthCheckList) {
Map<String,List<SettleMonthChangeCheckParam>> map = new HashMap<>(16);
List<SettleMonthChangeCheckParam> errorList = new ArrayList();
List<SettleMonthChangeCheckParam> errorList = new ArrayList<>();
List<SettleMonthChangeCheckParam> successList = new ArrayList<>();
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();
if(StringUtils.isBlank(empName)){
......@@ -2502,7 +2527,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//员工身份证
String empIdCardNo = param.getEmpIdCardNo();
if(StringUtils.isBlank(empIdCardNo)){
......@@ -2510,7 +2534,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//所属项目
String deptNo = param.getDeptNo();
if(StringUtils.isBlank(deptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//保险公司名称
String insuranceCompanyName = param.getInsuranceCompanyName();
if(StringUtils.isBlank(insuranceCompanyName)){
......@@ -2518,7 +2548,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//险种名称
String insuranceTypeName = param.getInsuranceTypeName();
if(StringUtils.isBlank(insuranceTypeName)){
......@@ -2526,7 +2555,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//保单开始日期
String policyStart = param.getPolicyStart();
if(StringUtils.isBlank(policyStart)){
......@@ -2534,7 +2562,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//保单结束日期
String policyEnd = param.getPolicyEnd();
if(StringUtils.isBlank(policyEnd)){
......@@ -2542,13 +2569,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//所属项目
String deptNo = param.getDeptNo();
if(StringUtils.isBlank(deptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//购买标准
String buyStandard = param.getBuyStandard();
if(StringUtils.isBlank(buyStandard)){
......@@ -2556,12 +2576,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
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)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
......@@ -2574,7 +2588,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
// 结算月份 >= 派单月份(结算月 < 派单月份的记录予以拦截,并提示)
if(!LocalDateUtil.isDate(param.getSettleMonth(),LocalDateUtil.NORM_MONTH_PATTERN)){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_PARSE_ERROR);
......@@ -2586,17 +2599,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
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<>();
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 :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
TInsuranceDetail insuranceDetail = getOne(queryWrapper);
//如果保单信息为空
if (Common.isEmpty(insuranceDetail)){
param.setErrorMessage(InsurancesConstants.DATA_IS_NOT_EXIST);
param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
errorList.add(param);
continue;
}
......@@ -2606,16 +2626,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
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())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_IDENTICAL);
errorList.add(param);
continue;
}
//非已办理状态
Integer buyHandleStatus = insuranceDetail.getBuyHandleStatus();
if (CommonConstants.THREE_INT != buyHandleStatus){
param.setErrorMessage(InsurancesConstants.REFUND_ERROR);
//如果结算月份小于当前月份
if(!LocalDateUtil.isCurrentOrFutureMonth(param.getSettleMonth())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_SHOULD_IS_FUTURE);
errorList.add(param);
continue;
}
......@@ -2623,37 +2653,27 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为已结算时,不能变更结算月
if (CommonConstants.FOUR_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_HANDLE_STATUS_ERROR);
//当前结算状态为结算中时,不能变更结算月
if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus();
//当前保单信息的减员状态不为空时不能进行导入
if(reduceHandleStatus != null && CommonConstants.THREE_INT != reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_REDUCE_HANDLE_STATUS_ERROR);
//当前结算状态为已结算时,不能变更结算月
if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_THREE_ERROR);
errorList.add(param);
continue;
}
//有效状态
if(CommonConstants.ZERO_INT != insuranceDetail.getIsEffect()){
param.setErrorMessage(InsurancesConstants.IS_EFFECT_ERROR);
Integer reduceHandleStatus = insuranceDetail.getReduceHandleStatus();
//当前保单信息的为已减员时不能不能变更结算月
if( CommonConstants.FOUR_INT == reduceHandleStatus ){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_REFUND_STATUS_FOUR_ERROR);
errorList.add(param);
continue;
}
//判断当前数据中是否存在重复数据
boolean b = successList.stream().anyMatch(u -> u.getEmpName().equals(param.getEmpName())
&& 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);
}
param.setId(insuranceDetail.getId());
successList.add(param);
}
map.put("errorList",errorList);
map.put("successList",successList);
......@@ -2673,7 +2693,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (DeptChangeCheckParam param : deptChangeCheckList) {
String newDeptNo = param.getNewDeptNo();
if(StringUtils.isBlank(newDeptNo)){
param.setErrorMessage(InsurancesConstants.REPLACE_DEPT_NO_NOT_EMPTY);
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_NOT_EMPTY);
errorList.add(param);
continue;
}
......@@ -2691,6 +2711,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//所属项目
String oldDeptNo = param.getOldDeptNo();
if(StringUtils.isBlank(oldDeptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//保险公司名称
String insuranceCompanyName = param.getInsuranceCompanyName();
if(StringUtils.isBlank(insuranceCompanyName)){
......@@ -2720,13 +2747,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//所属项目
String oldDeptNo = param.getOldDeptNo();
if(StringUtils.isBlank(oldDeptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
errorList.add(param);
continue;
}
//新老项目id相同
if (oldDeptNo.equals(newDeptNo)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IDENTICAL);
......@@ -2740,12 +2760,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
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)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
......@@ -2763,13 +2777,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_IS_NOT_EXIST);
errorList.add(param);
continue;
}else {
ProjectSetInfoVo jsonObject = data.get(newDeptNo);
if (null == jsonObject){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_IS_NOT_EXIST);
errorList.add(param);
continue;
}else {
......@@ -2788,11 +2802,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceCompanyName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)).eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
TInsuranceDetail insuranceDetail = getOne(queryWrapper);
//如果保单信息为空
if (Common.isEmpty(insuranceDetail)){
param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
errorList.add(param);
continue;
}
//替换类型的保单不能变更所属项目
Integer buyType = insuranceDetail.getBuyType();
if (CommonConstants.FOUR_INT == buyType){
......@@ -2800,28 +2820,43 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
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<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId());
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为:结算中,已结算时,不能变更所属项目
if (CommonConstants.FOUR_STRING.equals(insuranceSettle.getSettleHandleStatus()) || CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_HANDLE_STATUS_ERROR);
//当前结算状态为结算中时,不能变更结算项目
if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
//判断当前数据中是否存在重复数据
boolean b = successList.stream().anyMatch(u -> u.getEmpName().equals(param.getEmpName())
&& u.getEmpIdCardNo().equals(param.getEmpIdCardNo())&& u.getOldDeptNo().equals(param.getOldDeptNo())
&& 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);
//当前结算状态为已结算时,不能变更结算项目
if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_THREE_ERROR);
errorList.add(param);
continue;
}
//判断当前数据中是否存在重复数据
param.setId(insuranceDetail.getId());
successList.add(param);
}
map.put("errorList",errorList);
map.put("successList",successList);
......
......@@ -24,4 +24,11 @@ implements TInsuranceRefundService {
public void updateByInsDetailId(TInsuranceRefund 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
return R.failed("当前险种信息不存在或已被删除");
}
String month = insuranceTypeRate.getMonth();
if (!ValidityUtil.isMonth(month)){
if (!ValidityUtil.validatePositiveInt(month)){
return R.failed("当前月份格式不正确");
}
String rate = insuranceTypeRate.getRate();
if (!Common.isNumber(rate)){
if (!ValidityUtil.validateMoney(rate)){
return R.failed("当前费率格式不正确");
}
LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>();
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);
if (list.isEmpty()){
insuranceTypeRate.setDeleteFlag(CommonConstants.ZERO_INT);
insuranceTypeRate.setCreateBy(user.getId());
insuranceTypeRate.setCreateName(user.getNickname());
insuranceTypeRate.setCreateTime(LocalDateTime.now());
return R.ok(this.baseMapper.insert(insuranceTypeRate));
}else{
return R.failed("当前险种已存在相同的费率");
......
......@@ -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.security.util.SecurityUtils;
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.TInsuranceTypeRate;
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.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.TInsuranceTypeStandardService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -31,10 +33,14 @@ import java.util.List;
@Service
public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTypeStandardMapper, TInsuranceTypeStandard> implements TInsuranceTypeStandardService {
@Resource
private TInsuranceTypeService insuranceTypeService;
private TInsuranceTypeService tInsuranceTypeService;
@Resource
private TInsuranceDetailService insuranceDetailService;
private TInsuranceDetailService tInsuranceDetailService;
@Resource
private TInsuranceOperateService tInsuranceOperateService;
/**
* 查询购买标准列表
......@@ -48,7 +54,7 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
if (Common.isEmpty(id)){
return R.failed("险种id为空");
}
TInsuranceType byId = insuranceTypeService.getById(id);
TInsuranceType byId = tInsuranceTypeService.getById(id);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除");
}
......@@ -79,7 +85,7 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
queryWrapper.eq(TInsuranceDetail::getInsuranceTypeId,byId.getInsuranceTypeId())
.eq(TInsuranceDetail::getBuyStandard,byId.getBuyStandard())
.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceDetail> list = insuranceDetailService.list(queryWrapper);
List<TInsuranceDetail> list = tInsuranceDetailService.list(queryWrapper);
if (Common.isNotEmpty(list)){
return R.failed("当前险种的购买标准已存在对应的商险信息,不能删除");
}
......@@ -105,20 +111,20 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
return R.failed("新增的购买标准信息为空");
}
Long insuranceTypeId = insuranceTypeStandard.getInsuranceTypeId();
TInsuranceType byId = insuranceTypeService.getById(insuranceTypeId);
TInsuranceType byId = tInsuranceTypeService.getById(insuranceTypeId);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除");
}
String buyStandard = insuranceTypeStandard.getBuyStandard();
String medicalQuota = insuranceTypeStandard.getMedicalQuota();
String dieDisableQuota = insuranceTypeStandard.getDieDisableQuota();
if (!Common.isNumber(buyStandard)){
if (!ValidityUtil.validateMoney(buyStandard)){
return R.failed("当前购买标准格式不正确");
}
if (!Common.isNumber(medicalQuota)){
if (!ValidityUtil.validateMoney(medicalQuota)){
return R.failed("当前医疗额度格式不正确");
}
if (!Common.isNumber(dieDisableQuota)){
if (!ValidityUtil.validateMoney(dieDisableQuota)){
return R.failed("当前身故或残疾额度格式不正确");
}
LambdaQueryWrapper<TInsuranceTypeStandard> queryWrapper = new LambdaQueryWrapper<>();
......@@ -131,10 +137,13 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
insuranceTypeStandard.setCreateBy(user.getId());
insuranceTypeStandard.setCreateName(user.getNickname());
insuranceTypeStandard.setCreateTime(LocalDateTime.now());
return R.ok(this.baseMapper.insert(insuranceTypeStandard),"新增购买标准成功");
}else{
return R.failed("当前险种下的购买标准已存在");
}
}
}
......@@ -5,7 +5,7 @@
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper">
<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="companyAddress" column="COMPANY_ADDRESS" jdbcType="VARCHAR"/>
<result property="companyDocking" column="COMPANY_DOCKING" jdbcType="VARCHAR"/>
......
......@@ -541,8 +541,6 @@
t_insurance_refund refund
where
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() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
......@@ -607,9 +605,6 @@
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.reduceHandleStatus != null ">
and detail.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if>
<if test="param.isOverdue != null ">
and detail.IS_OVERDUE like concat('%',replace(replace(#{param.isOverdue},'_','\_'),'%','\%'),'%')
</if>
......
......@@ -25,11 +25,22 @@
t_insurance_refund
set
REDUCE_HANDLE_STATUS = #{reduceHandleStatus},
REMARK = #{remark},
UPDATE_BY = #{createBy},
UPDATE_TIME = #{createTime}
where
INS_DETAIL_ID = #{insDetailId}
</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>
......
......@@ -5,9 +5,9 @@
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper">
<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="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="bankName" column="BANK_NAME" jdbcType="VARCHAR"/>
<result property="bankNo" column="BANK_NO" jdbcType="VARCHAR"/>
......
......@@ -6,7 +6,7 @@
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard">
<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="medicalQuota" column="MEDICAL_QUOTA" jdbcType="VARCHAR"/>
<result property="dieDisableQuota" column="DIE_DISABLE_QUOTA" jdbcType="VARCHAR"/>
......
......@@ -32,6 +32,8 @@ public class DispatchConstants {
public static final String DISPATCH_FUND_ADD_FAIL = "公积金派增办理失败:";
public static final String DISPATCH_FUND_REDUCE = "公积金派减";
public static final String DISPATCH_SOCIAL_REDUCE = "社保派减";
public static final String SOCIAL_RECORD_ROSTER_EXPORT = "社保花名册导出";
public static final String SOCIAL_RECORD_EXPORT = "公积金变更清册导出";
/**
......@@ -82,7 +84,6 @@ public class DispatchConstants {
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String PARAM_EMPLOYEE_ID_EMPTY = "传参有误:员工ID不可为空";
......@@ -92,7 +93,6 @@ public class DispatchConstants {
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String NO_EMPLOYEE_OF_ID = "无对应员工ID的员工信息";
......@@ -102,7 +102,6 @@ public class DispatchConstants {
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String EMPLOYEE_SOCIAL_FUND_INFO ="员工、社保、公积金信息";
......@@ -112,7 +111,6 @@ public class DispatchConstants {
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String DISPATCH_ID_NOT_EMPTY ="派单ID不可为空,多个ID请用逗号分割!";
......@@ -122,7 +120,6 @@ public class DispatchConstants {
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String OFFICE = "offical";
......@@ -132,7 +129,6 @@ public class DispatchConstants {
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String ADD = "add";
......@@ -142,7 +138,6 @@ public class DispatchConstants {
* @Date 2020-10-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String MINUS = "minus";
......@@ -152,7 +147,6 @@ public class DispatchConstants {
* @Date 2022-01-13
* @param null
* @return
* @see com.yifu.cloud.v1.common.core.constant
**/
public static final String UPDATE_RELATION_FROM_SALARY_FAILED = "更新缴费库薪资结算状态失败,请重新尝试或联系管理人员!";
......
......@@ -58,6 +58,14 @@ public class TProvidentFund extends BaseEntity {
@Schema(description = "公积金户" )
@ExcelProperty("公积金户" )
private String providentHousehold;
/**
* 公积金户名称
*/
@ExcelAttribute(name = "公积金户名称", maxLength = 32)
@Schema(description = "公积金户名称" )
@ExcelProperty("公积金户名称" )
private String providentHouseholdName;
/**
* 公积金起缴日期
*/
......
......@@ -58,6 +58,13 @@ public class TSocialInfo extends BaseEntity {
@Schema(description = "社保户" )
@ExcelProperty("社保户" )
private String socialHousehold;
/**
* 社保户名称
*/
@ExcelAttribute(name = "社保户名称", maxLength = 32)
@Schema(description = "社保户名称" )
@ExcelProperty("社保户名称" )
private String socialHouseholdName;
/**
* 社保起缴日期
*/
......
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @Author fxj
* @Description 社保办理导出花名册
* @Date 19:25 2022/7/27
* @Param
* @return
**/
@Data
public class FundHandleExportVo implements Serializable {
/**
* 派单类型:0派增1派减
*/
@ExcelAttribute(name = "派单类型", errorInfo = "派单类型不能为空", maxLength = 1,isDataId = true,readConverterExp = "0=派增,1=派减",needExport = true)
@ExcelProperty("派单类型" )
private String type;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", errorInfo = "员工姓名不能为空", maxLength = 50,needExport = true)
@ExcelProperty("员工姓名" )
private String empName;
/**
* 员工身份证
*/
@ExcelAttribute(name = "员工身份证", errorInfo = "员工身份证不能为空", maxLength = 20,needExport = true)
@ExcelProperty("员工身份证" )
private String empIdcard;
/**
* 所属单位
*/
@ExcelAttribute(name = "客户名称", isNotEmpty = true,needExport = true)
@Schema(description = "客户名称(所属单位)")
@ExcelProperty("客户名称" )
private String belongUnit;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", isNotEmpty = true,needExport = true)
@Schema(description = "项目名称(结算主体)")
@ExcelProperty("项目名称" )
private String settleDomain;
/**
* 手机号码
*/
@ExcelAttribute(name = "手机号码", maxLength = 20,needExport = true)
@ExcelProperty("手机号码" )
private String empMobile;
/**
* 创建人姓名
*/
@ExcelAttribute(name = "申请人",needExport = true)
@Schema(description = "申请人")
@ExcelProperty("申请人" )
private String creasteUserName;
/**
* 公积金缴纳地-省
*/
@ExcelAttribute(name = "公积金缴纳地-省", maxLength = 32, isDataId = true, isArea = true, parentField = "",needExport = true)
@ExcelProperty("公积金缴纳地-省" )
private String fundProvince;
/**
* 公积金缴纳地-市
*/
@ExcelAttribute(name = "公积金缴纳地-市", maxLength = 32, isDataId = true, isArea = true, parentField = "fundProvince",needExport = true)
@ExcelProperty("公积金缴纳地-市" )
private String fundCity;
/**
* 公积金缴纳地-县
*/
@ExcelAttribute(name = "公积金缴纳地-县", maxLength = 32, isDataId = true, isArea = true, parentField = "fundCity",needExport = true)
@ExcelProperty("公积金缴纳地-县" )
private String fundTown;
/**
* 公积金起缴日期
*/
@ExcelAttribute(name = "公积金起缴日期", errorInfo = "公积金起缴日期不能为空",needExport = true)
@ExcelProperty("公积金起缴日期" )
private LocalDateTime providentStart;
/**
* 单位公积金缴纳基数
*/
@ExcelAttribute(name = "单位公积金缴纳基数", errorInfo = "单位公积金缴纳基数不能为空",needExport = true)
@ExcelProperty("单位公积金缴纳基数" )
private BigDecimal unitProvidengCardinal;
/**
* 单位公积金缴纳比例
*/
@ExcelAttribute(name = "单位公积金缴纳比例", errorInfo = "单位公积金缴纳比例不能为空",needExport = true)
@ExcelProperty("单位公积金缴纳比例" )
private BigDecimal unitProvidentPer;
/**
* 单位公积金缴纳费用
*/
@ExcelAttribute(name = "单位公积金缴纳费用", isNotEmpty = true, errorInfo = "单位公积金缴纳费用不能为空",needExport = true)
@ExcelProperty("单位公积金缴纳费用" )
private BigDecimal unitProvidentFee;
/**
* 个人公积金缴纳基数
*/
@ExcelAttribute(name = "个人公积金缴纳基数", errorInfo = "个人公积金缴纳基数不能为空",needExport = true)
@ExcelProperty("个人公积金缴纳基数" )
private BigDecimal personalProvidentCardinal;
/**
* 个人公积金缴纳比例
*/
@ExcelAttribute(name = "个人公积金缴纳比例", errorInfo = "个人公积金缴纳比例不能为空",needExport = true)
@ExcelProperty("个人公积金缴纳比例" )
private BigDecimal personalProvidentPer;
/**
* 个人公积金缴纳费用
*/
@ExcelAttribute(name = "个人公积金缴纳费用", isNotEmpty = true, errorInfo = "个人公积金缴纳费用不能为空",needExport = true)
@ExcelProperty("个人公积金缴纳费用" )
private BigDecimal personalProvidentFee;
/**
* 公积金户
*/
@ExcelAttribute(name = "公积金户", errorInfo = "公积金户不能为空", maxLength = 32,needExport = true)
@ExcelProperty("公积金户" )
private String providentHouseholdName;
/**
*
*委托备注
**/
@ExcelAttribute(name = "委托备注",needExport = true)
@ExcelProperty("委托备注" )
private String fundTrustRemark;
/*******************************导出字段结束*************************************************/
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @Author fxj
* @Description 公积金补缴清册
* @Date 19:04 2022/7/27
* @Param
* @return
**/
@Data
public class FundSupplementaryExportVo implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", errorInfo = "员工姓名不能为空", maxLength = 50,needExport = true)
private String empName;
/**
* 公积金起缴日期
*/
@NotBlank(message = "公积金起缴日期不能为空")
@ExcelAttribute(name = "公积金起缴日期", errorInfo = "公积金起缴日期不能为空",needExport = true)
@Schema(description = "公积金起缴日期")
private LocalDateTime providentStart;
/**
* 单位公积金缴纳基数
*/
@NotBlank(message = "单位公积金缴纳基数不能为空")
@ExcelAttribute(name = "单位公积金缴纳基数", errorInfo = "单位公积金缴纳基数不能为空",needExport = true)
@Schema(description = "单位公积金缴纳基数")
private BigDecimal unitProvidengCardinal;
/**
* 单位公积金缴纳比例
*/
@NotBlank(message = "单位公积金缴纳比例不能为空")
@ExcelAttribute(name = "单位公积金缴纳比例", errorInfo = "单位公积金缴纳比例不能为空",needExport = true)
@Schema(description = "单位公积金缴纳比例")
private BigDecimal unitProvidentPer;
/**
* 单位公积金缴纳费用
*/
@NotBlank(message = "单位公积金缴纳费用不能为空")
@ExcelAttribute(name = "单位公积金缴纳费用", isNotEmpty = true, errorInfo = "单位公积金缴纳费用不能为空",needExport = true)
@Schema(description = "单位公积金缴纳费用")
private BigDecimal unitProvidentFee;
/**
* 个人公积金缴纳基数
*/
@NotBlank(message = "个人公积金缴纳基数不能为空")
@ExcelAttribute(name = "个人公积金缴纳基数", errorInfo = "个人公积金缴纳基数不能为空",needExport = true)
@Schema(description = "个人公积金缴纳基数")
private BigDecimal personalProvidentCardinal;
/**
* 个人公积金缴纳比例
*/
@NotBlank(message = "个人公积金缴纳比例不能为空")
@ExcelAttribute(name = "个人公积金缴纳比例", errorInfo = "个人公积金缴纳比例不能为空",needExport = true)
@Schema(description = "个人公积金缴纳比例")
private BigDecimal personalProvidentPer;
/**
* 个人公积金缴纳费用
*/
@NotBlank(message = "个人公积金缴纳费用不能为空")
@ExcelAttribute(name = "个人公积金缴纳费用", isNotEmpty = true, errorInfo = "个人公积金缴纳费用不能为空",needExport = true)
@Schema(description = "个人公积金缴纳费用")
private BigDecimal personalProvidentFee;
/*******************************导出字段结束*************************************************/
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* @Author fxj
* @Description 社保办理导出花名册
* @Date 15:21 2022/7/27
* @Param
* @return
**/
@Data
public class SocialHandleExportVo implements Serializable {
/**
* 派单类型:0派增1派减
*/
@ExcelAttribute(name = "派单类型", errorInfo = "派单类型不能为空", maxLength = 1,isDataId = true, readConverterExp = "0=派增,1=派减",needExport = true)
@ExcelProperty("派单类型" )
private String type;
/**
* 社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减 4办理中 (20210609派单拆分新增fxj) 5部分办理失败
*/
@Schema(description = "社保办理状态")
@ExcelAttribute(name = "社保办理状态", readConverterExp = "0=未办理,1=全部办理成功,2=全部办理失败,3=已派减,4=办理中,5=部分办理失败", needExport = true)
@ExcelProperty("社保办理状态" )
private String socialHandleStatus;
/**
* 养老办理状态:0待办理1办理成功2办理失败3已派减
*/
@ExcelAttribute(name = "养老状态" , maxLength = 1 , readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=已派减,null=——", needExport = true)
@Schema(description="养老办理状态:0待办理1办理成功2办理失败3已派减")
@ExcelProperty("养老状态" )
private String pensionHandle;
/**
* 医疗办理状态:0待办理1办理成功2办理失败3已派减
*/
@ExcelAttribute(name = "医疗状态" , maxLength = 1 , readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=已派减,null=——", needExport = true)
@Schema(description="医疗办理状态:0待办理1办理成功2办理失败3已派减")
@ExcelProperty("医疗状态" )
private String medicalHandle;
/**
* 失业办理状态:0待办理1办理成功2办理失败3已派减
*/
@ExcelAttribute(name = "失业状态" , maxLength = 1 , readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=已派减,null=——", needExport = true)
@Schema(description="失业办理状态:0待办理1办理成功2办理失败3已派减")
@ExcelProperty("失业状态" )
private String unemployHandle;
/**
* 工伤办理状态:0待办理1办理成功2办理失败3已派减
*/
@ExcelAttribute(name = "工伤状态" , maxLength = 1 , readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=已派减,null=——", needExport = true)
@Schema(description="工伤办理状态:0待办理1办理成功2办理失败3已派减")
@ExcelProperty("工伤状态" )
private String workInjuryHandle;
/**
* 生育办理状态:0待办理1办理成功2办理失败3已派减
*/
@ExcelAttribute(name = "生育状态" , maxLength = 1 , readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=已派减,null=——", needExport = true)
@Schema(description="生育办理状态:0待办理1办理成功2办理失败3已派减")
@ExcelProperty("生育状态" )
private String birthHandle;
/**
* 大病办理状态:0待办理1办理成功2办理失败3已派减
*/
@ExcelAttribute(name = "大病状态" , maxLength = 1 , readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=已派减,null=——", needExport = true)
@Schema(description="大病办理状态:0待办理1办理成功2办理失败3已派减")
@ExcelProperty("大病状态" )
private String bigailmentHandle;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", errorInfo = "员工姓名不能为空", maxLength = 50,needExport = true)
@ExcelProperty("员工姓名" )
private String empName;
/**
* 员工身份证
*/
@ExcelAttribute(name = "员工身份证", errorInfo = "员工身份证不能为空", maxLength = 20,needExport = true)
@ExcelProperty("员工身份证" )
private String empIdcard;
/**
* 学历
*/
@ExcelAttribute(name = "学历", maxLength = 32,needExport = true)
@Schema(description = "学历")
@ExcelProperty("学历" )
private String educationName;
/**
* 所属单位
*/
@ExcelAttribute(name = "客户名称", isNotEmpty = true,needExport = true)
@Schema(description = "客户名称(所属单位)")
@ExcelProperty("客户名称" )
private String belongUnit;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", isNotEmpty = true,needExport = true)
@Schema(description = "项目名称(结算主体)")
@ExcelProperty("项目名称" )
private String settleDomain;
/**
* 员工类型
*/
@ExcelAttribute(name = "员工类型", errorInfo = "员工类型不能为空", maxLength = 1, isDataId = true,dataType = ExcelAttributeConstants.PERSONNEL_TYPE,needExport = true)
@ExcelProperty("员工类型" )
private String empType;
/**
* 就职岗位
*/
@ExcelAttribute(name = "岗位", maxLength = 50,needExport = true)
@Schema(description = "岗位")
@ExcelProperty("岗位" )
private String post;
/**
* 员工电话
*/
@ExcelAttribute(name = "手机号码", maxLength = 20,needExport = true)
@ExcelProperty("手机号码" )
private String empMobile;
/**
* 户口性质
*/
@ExcelAttribute(name = "户口性质", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.HOUSEHOLD_NATURE,needExport = true)
@Schema(description = "户口性质")
@ExcelProperty("户口性质" )
private String empRegisType;
/**
* 民族
*/
@ExcelAttribute(name = "民族", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.NATION,needExport = true)
@Schema(description = "民族")
@ExcelProperty("民族" )
private String empNational;
/**
* 工时制(数据字典) 1标准工时 2 综合工时 3不定时工时制
*/
@ExcelAttribute(name = "工时制", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.WORKING_HOURS,needExport = true)
@Schema(description = "工时制")
@ExcelProperty("工时制" )
private String workingHours;
/**
* 合同年限
*/
@ExcelAttribute(name = "合同年限", errorInfo = "合同年限不能为空",needExport = true)
@Schema(description = "合同年限")
@ExcelProperty("合同年限" )
private Double contractTerm;
/**
* 合同起始时间
*/
@ExcelAttribute(name = "合同起始时间", errorInfo = "合同起始时间不能为空",dateFormat = DateUtil.ISO_DATE_FORMAT,needExport = true)
@Schema(description = "合同起始时间")
@ExcelProperty("合同起始时间" )
private LocalDate contractStart;
/**
* 合同到期时间
*/
@ExcelAttribute(name = "合同到期时间",needExport = true,dateFormat = DateUtil.ISO_DATE_FORMAT)
@Schema(description = "合同到期时间")
@ExcelProperty("合同到期时间" )
private LocalDate contractEnd;
/**
* 创建人姓名
*/
@ExcelAttribute(name = "申请人",needExport = true)
@Schema(description = "申请人")
@ExcelProperty("申请人" )
private String creasteUserName;
/**
* 备案基数
*/
@ExcelAttribute(name = "备案基数",needExport = true)
@Schema(description = "备案基数")
@ExcelProperty("备案基数" )
private String recordBase;
/**
* 缴纳类型(0最低缴纳、1自定义缴纳、2最高缴纳)
*/
@ExcelAttribute(name = "缴纳类型",isDataId = true,readConverterExp = "0=最低缴纳,1=自定义缴纳,2=最高缴纳",needExport = true)
@Schema(description = "缴纳类型(0最低缴纳、1自定义缴纳、2最高缴纳)")
@ExcelProperty("缴纳类型" )
private Integer paymentType;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户", needExport = true)
@Schema(description = "社保户")
@ExcelProperty("社保户" )
private String socialHouseholdName;
/**
* 缴纳地-省
*/
@ExcelAttribute(name = "社保缴纳地-省", maxLength = 32, isDataId = true, isArea = true, parentField = "",needExport = true)
@Schema(description = "社保缴纳地-省")
@ExcelProperty("社保缴纳地-省" )
private Integer socialProvince;
/**
* 缴纳地-市
*/
@ExcelAttribute(name = "社保缴纳地-市", maxLength = 32, isDataId = true, isArea = true, parentField = "socialProvince",needExport = true)
@Schema(description = "社保缴纳地-市")
@ExcelProperty("社保缴纳地-市" )
private Integer socialCity;
/**
* 缴纳地-县
*/
@ExcelAttribute(name = "社保缴纳地-县", maxLength = 32, isDataId = true, isArea = true, parentField = "socialCity",needExport = true)
@Schema(description = "社保缴纳地-县")
@ExcelProperty("社保缴纳地-县" )
private Integer socialTown;
/**
* 养老起缴日期
*/
@ExcelAttribute(name = "养老起缴日期", needExport = true)
@Schema(description="养老起缴日期")
@ExcelProperty("养老起缴日期" )
private LocalDateTime pensionStart;;
/**
* 养老基数
*/
@ExcelAttribute(name = "养老基数", isFloat = true,needExport = true)
@Schema(description = "养老基数")
@ExcelProperty("养老基数" )
private BigDecimal unitPensionCardinal;
/**
* 医疗起缴日期
*/
@ExcelAttribute(name = "医疗起缴日期", needExport = true)
@Schema(description="医疗起缴日期")
@ExcelProperty("医疗起缴日期" )
private LocalDateTime medicalStart;
/**
* 医疗基数
*/
@ExcelAttribute(name = "医疗基数",isFloat = true,needExport = true)
@Schema(description = "医疗基数")
@ExcelProperty("医疗基数" )
private BigDecimal unitMedicalCardinal;
/**
* 失业起缴日期
*/
@ExcelAttribute(name = "失业起缴日期", needExport = true)
@Schema(description="失业起缴日期")
@ExcelProperty("失业起缴日期" )
private LocalDateTime unemployStart;
/**
* 失业基数
*/
@ExcelAttribute(name = "失业基数", isFloat = true,needExport = true)
@Schema(description = "失业基数")
@ExcelProperty("失业基数" )
private BigDecimal unitUnemploymentCardinal;
/**
* 工伤起缴日期
*/
@ExcelAttribute(name = "工伤起缴日期", needExport = true)
@Schema(description="工伤起缴日期")
@ExcelProperty("工伤起缴日期" )
private LocalDateTime workInjuryStart;
/**
* 工伤基数
*/
@ExcelAttribute(name = "工伤基数", isFloat = true,needExport = true)
@Schema(description = "工伤基数")
@ExcelProperty("工伤基数" )
private BigDecimal unitWorkInjuryCardinal;
/**
* 生育起缴日期
*/
@ExcelAttribute(name = "生育起缴日期", needExport = true)
@Schema(description="生育起缴日期")
@ExcelProperty("生育起缴日期" )
private LocalDateTime birthStart;
/**
* 生育基数
*/
@ExcelAttribute(name = "生育基数", isFloat = true,needExport = true)
@Schema(description = "生育基数")
@ExcelProperty("生育基数" )
private BigDecimal unitBirthCardinal;
/**
* 大病起缴日期
*/
@ExcelAttribute(name = "大病起缴日期", needExport = true)
@Schema(description="大病起缴日期")
@ExcelProperty("大病起缴日期" )
private LocalDateTime bigailmentStart;
/**
* 大病缴纳基数
*/
@ExcelAttribute(name = "大病缴纳基数" )
@Schema(description="大病缴纳基数")
@ExcelProperty("大病缴纳基数" )
private BigDecimal unitBigailmentCardinal;
/**
* 单位大病缴纳金额
*/
@ExcelAttribute(name = "单位大病金额",needExport = true)
@Schema(description = "单位大病金额")
@ExcelProperty("单位大病金额" )
private BigDecimal unitBigailmentMoney;
/**
* 个人大病金额
*/
@ExcelAttribute(name = "个人大病金额",needExport = true)
@Schema(description = "个人大病金额")
@ExcelProperty("个人大病金额" )
private BigDecimal personalBigailmentMoney;
/**
*
*委托备注
**/
@ExcelAttribute(name = "委托备注",needExport = true)
@Schema(description = "委托备注")
@ExcelProperty("委托备注" )
private String socailTrustRemark;
/**
* 减少原因
*/
@ExcelAttribute(name = "减少原因" ,needExport = true)
@Schema(description="减少原因")
@ExcelProperty("减少原因" )
private String reduceReason;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @Author fxj
* @Date 2022/7/27
* @Description
* @Version 1.0
*/
@Data
public class SocialHandleSearchVo extends TDispatchInfo {
//派单开始时间(查询专用)
@ExcelAttribute(name = "创建开始时间")
@TableField(exist = false)
private LocalDateTime createTimeStart;
//派单截止时间(查询专用)
@ExcelAttribute(name = "创建截止时间")
@TableField(exist = false)
private LocalDateTime createTimeEnd;
/**
* 社保户
*/
@Schema(description = "社保户" )
@TableField(exist = false)
private String socialHouseholdName;
/**
* 公积金户
*/
@Schema(description = "公积金户" )
@TableField(exist = false)
private String providentHouseholdName;
/**
* @Author fxj
* 查询数据起
**/
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
private int limitEnd;
}
......@@ -37,6 +37,7 @@ import java.util.Date;
* @author fxj
* @date 2022-07-15 11:38:05
*/
@Schema(description = "社保公积金查询-导出使用" )
@Data
public class TSocialFundInfoExportVo extends RowIndex implements Serializable {
......
......@@ -28,18 +28,24 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
/**
......@@ -112,20 +118,39 @@ public class TDispatchInfoController {
}
/**
* 简单分页查询--审核
* 简单分页查询--社保办理列表
* @param page 分页对象
* @param tDispatchInfo 派单信息记录表--审核
* @param tDispatchInfo 派单信息记录表--社保办理列表
* @return
*/
@Operation(description = "简单分页查询--审核")
@GetMapping("/pageHandle")
public R<IPage<TDispatchInfo>> getTDispatchHandlePage(Page<TDispatchInfo> page, TDispatchInfoSearchVo tDispatchInfo) {
tDispatchInfo.setStatus(CommonConstants.ONE_STRING);
return new R<>(tDispatchInfoService.getTDispatchInfoPage(page,tDispatchInfo));
@Operation(description = "简单分页查询--社保办理列表")
@GetMapping("/pageSocialHandle")
public R<IPage<TDispatchInfo>> getTDispatchSocialHandlePage(Page<TDispatchInfo> page, SocialHandleSearchVo tDispatchInfo) {
// 获取结算主体权限 TODO
List<String> settleDomains = null;
// 获取自定义sql TODO
String sql = CommonConstants.EMPTY_STRING;
return new R<>(tDispatchInfoService.getTDispatchSocialHandlePage(page,tDispatchInfo,settleDomains,sql));
}
/**
* 简单分页查询--公积金办理列表
* @param page 分页对象
* @param tDispatchInfo 派单信息记录表--公积金办理列表
* @return
*/
@Operation(description = "简单分页查询--公积金办理列表")
@GetMapping("/pageFundHandle")
public R<IPage<TDispatchInfo>> getTDispatchFundHandlePage(Page<TDispatchInfo> page, SocialHandleSearchVo tDispatchInfo) {
// 获取结算主体权限 TODO
List<String> settleDomains = null;
// 获取自定义sql TODO
String sql = CommonConstants.EMPTY_STRING;
return new R<>(tDispatchInfoService.getTDispatchFundHandlePage(page,tDispatchInfo,settleDomains,sql));
}
/**
* 通过id查询派单信息记录表
* @param id id
* @param id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_tdispatchinfo_get')")
......@@ -268,4 +293,62 @@ public class TDispatchInfoController {
@RequestParam(name = "socialType", required = false) String socialType) {
return tDispatchInfoService.addApplyHandle(ids,typeSub,handleStatus,handleRemark,socialType);
}
/**
* @Author fxj
* @Description 导出 社保花名册
* @Date 17:40 2022/7/27
* @Param
* @return
**/
@PostMapping("/doexportSocialRecordRoster")
@Operation(description = "导出社保花名册 hasPermission('wxhr:tdispatchinfo_doexportSocialRecordRoster')")
@SysLog("导出社保花名册信息")
@PreAuthorize("@pms.hasPermission('wxhr:tdispatchinfo_doexportSocialRecordRoster')")
public void doexportSocialRecordRoster(HttpServletResponse response, HttpServletRequest request,
@RequestParam(name = "idStr", required = false) String idStr,
@RequestBody String[] exportFields, SocialHandleSearchVo searchVo) {
tDispatchInfoService.doexportSocialRecordRoster(response,searchVo,idStr,exportFields);
}
/**
* @Author fxj
* @Description 导出 公积金变更清册
* @Date 20:05 2022/7/27
* @Param
* @return
**/
@PostMapping("/doexportFundRecordChange")
@Operation(description = "导出公积金变更清册 hasPermission('wxhr:tdispatchinfo_doexportFundRecordChange')")
@SysLog("导出公积金变更清册")
@PreAuthorize("@pms.hasPermission('wxhr:tdispatchinfo_doexportFundRecordChange')")
public void doexportFundRecordChange(HttpServletResponse response, HttpServletRequest request,
@RequestParam(name = "idStr", required = false) String idStr,
@RequestBody String[] exportFields, SocialHandleSearchVo searchVo) {
// 获取结算主体权限 TODO
List<String> settleDomains = null;
// 获取自定义sql TODO
String sql = CommonConstants.EMPTY_STRING;
tDispatchInfoService.doexportFundRecordChange(response, idStr,searchVo,settleDomains,sql);
}
/**
* @Author fxj
* @Description 导出公积金补缴清册
* @Date 20:05 2022/7/27
* @Param
* @return
**/
@GetMapping("/doExportFundSupplementaryRecord")
@Operation(description = "导出公积金补缴清册 hasPermission('wxhr:tdispatchinfo_doExportFundSupplementaryRecord')")
@SysLog("导出公积金补缴清册")
@PreAuthorize("@pms.hasPermission('wxhr:tdispatchinfo_doExportFundSupplementaryRecord')")
public R<List<FundSupplementaryExportVo>> doExportFundSupplementaryRecord(HttpServletResponse response, HttpServletRequest request,
@RequestParam(name = "idStr", required = false) String idStr,
@RequestBody SocialHandleSearchVo searchVo) {
// 获取结算主体权限 TODO
List<String> settleDomains = null;
// 获取自定义sql TODO
String sql = CommonConstants.EMPTY_STRING;
return tDispatchInfoService.getFundSupplementaryRecords(idStr,searchVo,settleDomains,sql);
}
}
......@@ -146,12 +146,11 @@ public class TPreDispatchInfoController {
* @param status 0 是 1 否
* @return R
*/
@Operation(summary = "修改资料是否提交", description = "修改资料是否提交:status 0 是 1 否(social_tpredispatchinfo_edit)")
@Operation(summary = "修改资料是否提交", description = "修改资料是否提交:status 0 是 1 否")
@SysLog("修改资料是否提交")
@PostMapping("/modifyDataSubmitStatus")
@PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_edit')")
public R<Boolean> modifyDataSubmitStatus(@RequestParam(value = "ids",required = true)String ids,
@RequestParam(value = "status",required = true)String status) {
public R<Boolean> modifyDataSubmitStatus(@RequestParam(value = "ids")String ids,
@RequestParam(value = "status")String status) {
return tPreDispatchInfoService.modifyDataSubmitStatus(ids,status);
}
/**
......@@ -165,7 +164,7 @@ public class TPreDispatchInfoController {
@SysLog("清空预派单默认的派单合同信息")
@PostMapping("/clearContractInfo")
@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);
}
......@@ -178,12 +177,11 @@ public class TPreDispatchInfoController {
* @param cancelRemark 不派单 时填写
* @return R
**/
@Operation(summary = "更新预派单是否派单状态", description = "更新预派单是否派单状态(social_tpredispatchinfo_edit)")
@Operation(summary = "更新预派单是否派单状态", description = "更新预派单是否派单状态")
@SysLog("更新预派单是否派单状态")
@PostMapping("/updateDispatchFlag")
@PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_edit')")
public R<Boolean> updateDispatchFlag(@RequestParam(value = "id",required = true)String id,
@RequestParam(value = "dispatchFlag",required = true)String dispatchFlag,
public R<Boolean> updateDispatchFlag(@RequestParam(value = "id")String id,
@RequestParam(value = "dispatchFlag")String dispatchFlag,
@RequestParam(value = "cancelRemark",required = false)String cancelRemark) {
return tPreDispatchInfoService.updateDispatchFlag(id,dispatchFlag,cancelRemark);
}
......@@ -197,7 +195,8 @@ public class TPreDispatchInfoController {
*/
@Operation(summary = "单个派单:按创建人和ID", description = "单个派单:按创建人和ID")
@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);
}
......@@ -209,6 +208,7 @@ public class TPreDispatchInfoController {
*/
@Operation(summary = "一键派单:按创建人查找正常未派单的数据", description = "一键派单:按创建人查找正常未派单的数据")
@PostMapping("/oneKeyToDispatch")
@PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_dispatch')")
public R oneKeyToDispatch(@RequestParam String idStr) {
return tPreDispatchInfoService.oneKeyToDispatch(idStr);
}
......
......@@ -20,7 +20,12 @@ package com.yifu.cloud.plus.v1.yifu.social.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
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.SocialHandleExportVo;
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;
......@@ -51,4 +56,85 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
**/
List<TDispatchInfoExportVo> exportDispatch(@Param("tDispatchInfo") TDispatchInfoSearchVo tDispatchInfo);
/**
* 导出社保花名册数据查询
* @Author fxj
* @Date 2019-10-12
* @param dispatchInfo
* @param settleDomainIds
* @param idsStr
* @return
**/
List<SocialHandleExportVo> getSocialRecordRosterList(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,
@Param("settleDomainIds")List<String> settleDomainIds,
@Param("idsStr") List<String> idsStr,
@Param("sql") String sql);
/**
* 导出社保花名册数据查询count
* @Author fxj
* @Date 2019-10-12
* @param dispatchInfo
* @param settleDomainIds
* @param idsStr
* @return
**/
int getSocialRecordRosterListCount(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,
@Param("settleDomainIds")List<String> settleDomainIds,
@Param("idsStr") List<String> idsStr,
@Param("sql") String sql);
/**
* 社保页面查询
* @Author fxj
* @Date 2019-10-12
* @param tDispatchInfo
* @param settleDomains
* @param sql
* @return
**/
IPage<TDispatchInfo> getTDispatchSocialHandlePage(Page<TDispatchInfo> page,
@Param("tDispatchInfo") SocialHandleSearchVo tDispatchInfo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("sql")String sql);
/**
* 公积金办理页面查询
* @Author fxj
* @Date 2019-10-12
* @param tDispatchInfo
* @param settleDomains
* @param sql
* @return
**/
IPage<TDispatchInfo> getTDispatchFundHandlePage(Page<TDispatchInfo> page,
@Param("tDispatchInfo")SocialHandleSearchVo tDispatchInfo,
@Param("settleDomainIds")List<String> settleDomains,
@Param("sql")String sql);
/**
* @Author fxj
* @Description 公积金补交清册
* @Date 19:47 2022/7/27
* @Param
* @return
**/
List<FundSupplementaryExportVo> getFundSupplementaryRecords(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,
@Param("settleDomainIds")List<String> settleDomainIds,
@Param("idsStr") List<String> idsStr,
@Param("sql") String sql);
/**
* @Author fxj
* @Description 公积金变更清册cout
* @Date 19:47 2022/7/27
* @Param
* @return
**/
int getFundRecordCount(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,
@Param("settleDomainIds")List<String> settleDomainIds,
@Param("idsStr") List<String> idsStr,
@Param("sql") String sql);
List<FundHandleExportVo> getFundRecordList(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,
@Param("settleDomainIds")List<String> settleDomainIds,
@Param("idsStr") List<String> idsStr,
@Param("sql") String sql);
}
......@@ -23,9 +23,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
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.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.web.bind.annotation.RequestBody;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
......@@ -49,7 +51,12 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
List<TDispatchInfo> noPageDiy(TDispatchInfoSearchVo searchVo);
R<List<ErrorMessage>> importReduceDiy(InputStream inputStream);
@GlobalTransactional
void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList,
YifuUser user);
R<List<ErrorMessage>> importReduceDiy(InputStream inputStream);
R<Boolean> removeByIdDiy(String id);
......@@ -60,4 +67,14 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<List<ErrorMessage>> addApplyAudit(String ids,String auditStatus,String auditRemark);
R<List<ErrorMessage>> addApplyHandle(String ids,String typeSub,String handleStatus,String handleRemark,String socialType);
void doexportSocialRecordRoster(HttpServletResponse response, SocialHandleSearchVo searchVo, String idStr, String[] exportFields);
IPage<TDispatchInfo> getTDispatchSocialHandlePage(Page<TDispatchInfo> page, SocialHandleSearchVo tDispatchInfo, List<String> settleDomains, String sql);
IPage<TDispatchInfo> getTDispatchFundHandlePage(Page<TDispatchInfo> page, SocialHandleSearchVo tDispatchInfo, List<String> settleDomains, String sql);
R<List<FundSupplementaryExportVo>> getFundSupplementaryRecords(String idStr,SocialHandleSearchVo dispatchInfo, List<String> settleDomains, String sql);
void doexportFundRecordChange(HttpServletResponse response,String idStr, SocialHandleSearchVo searchVo, List<String> settleDomains, String sql);
}
......@@ -30,6 +30,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
......@@ -58,6 +60,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -268,9 +271,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
return R.ok(errorMessageList);
}
@Override
@GlobalTransactional
private void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
public void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList,
YifuUser user) {
if (!Common.isNotNull(excelVOList)){
......@@ -982,6 +985,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
social.setCanOverpay(socialSet.getCanOverpay());
social.setCardinalId(socialSet.getId());
social.setSocialHousehold(socialSet.getId());
social.setSocialHouseholdName(socialSet.getDepartName());
social.setCollectMoth(socialSet.getCollectMoth());
social.setCollectType(socialSet.getCollectType());
social.setHaveThisMonth(socialSet.getHaveThisMonth());
......@@ -1153,7 +1157,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TDispatchImportVo excel,
DispatchEmpVo empVo) {
// 合同开始时间和截止时间一致直接跳过
if (excel.getContractStart().equals(empVo.getContractStart())
if (Common.isNotNull(excel.getContractStart())
&& Common.isNotNull(empVo)
&& Common.isNotNull(excel.getContractEnd())
&& excel.getContractStart().equals(empVo.getContractStart())
&& excel.getContractEnd().equals(empVo.getContractEnd())){
return;
}
......@@ -1506,6 +1513,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 初始化派单 和 社保公积金查询信息
dispatch = gettDispatchInfo(empVo, excel, socialFund);
try {
dispatch.setStatus(CommonConstants.ONE_STRING);
baseMapper.insert(dispatch);
socialFundMapper.updateById(socialFund);
}catch (Exception e){
......@@ -2102,14 +2110,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sf.setSocialStatus(CommonConstants.EIGHT_STRING);
// 同步预估库数据 TODO
}
socialInfo.setHandleTime(now);
socialInfo.setHandleUser(user.getId());
if (CommonConstants.ONE_INT == flag) {
//派减办理不通过
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
sf.setSocialReduceStatus(CommonConstants.THREE_STRING);
sf.setSocialStatus(CommonConstants.NINE_STRING);
}
socialInfo.setHandleTime(now);
socialInfo.setHandleUser(user.getId());
socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
auditInfo = new TAuditInfo();
......@@ -2151,15 +2159,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sf.setFundStatus(CommonConstants.SEVEN_STRING);
// 派减办理成功后,同步预估库数据清理 TODO
}
providentFund.setHandleTime(now);
providentFund.setHandleUser(user.getId().toString());
if (CommonConstants.ONE_INT == flag) {
//派减办理不通过
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
sf.setSocialReduceStatus(CommonConstants.THREE_STRING);
sf.setSocialStatus(CommonConstants.NINE_STRING);
// 同步预估库数据
sf.setFundReduceStatus(CommonConstants.THREE_STRING);
sf.setFundStatus(CommonConstants.EIGHT_STRING);
}
providentFund.setHandleTime(now);
providentFund.setHandleUser(user.getId());
fundMapper.updateById(providentFund);
dis.setFundHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
if (CommonConstants.ZERO_INT == flag) {
......@@ -2176,21 +2183,21 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
//更新派单状态
if (null != auditInfo) {
if (Common.isNotNull(auditInfo)) {
//派增判断
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
if (null != socialInfo && null != providentFund
&& (
CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.ZERO_STRING.equals(providentFund.getHandleStatus())
if (Common.isNotNull(socialInfo) && Common.isNotNull(providentFund)
&& (CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.ZERO_STRING.equals(providentFund.getHandleStatus())
)) {
//同时有社保和公积金的只要有一条没办理就不改派单状态
} else {
if ((CommonConstants.ZERO_INT == flag || CommonConstants.ONE_INT == flag)
&& (socialInfo == null
|| (!CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
&& !CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())))) {
if ((Common.isEmpty(dis.getSocialHandleStatus())
&& (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())))
&& (Common.isEmpty(dis.getSocialHandleStatus())
&& (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus()) || CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus())))) {
//办理成功 更新为办理完结 2020-05-26 办理失败 更新为办理完结 2020-05-26
dis.setStatus(CommonConstants.FOUR_STRING);
}
......@@ -2463,4 +2470,194 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialInfo.setBigailmentHandle(handleStatus);
}
}
/**
* @Author fxj
* @Description 导出 社保花名册
* @Date 17:40 2022/7/27
* @Param
* @return
**/
@Override
public void doexportSocialRecordRoster(HttpServletResponse response, SocialHandleSearchVo searchVo, String idStr, String[] exportFields) {
String fileName = DispatchConstants.SOCIAL_RECORD_ROSTER_EXPORT + LocalDateTime.now() + ".xlsx";
//获取要导出的列表
List<SocialHandleExportVo> list = new ArrayList<>();
// 结算主体权限 TODO
List<String> settleDomains = null;
// 自定义sql TODO
String sql = CommonConstants.EMPTY_STRING;
long count = getRecordRosterCount(searchVo,idStr,settleDomains,sql);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TEmpBadRecord.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = getRecordRosterList(searchVo,idStr,settleDomains,sql);
if (Common.isNotNull(list)){
ExcelUtil<SocialHandleExportVo> util = new ExcelUtil<>(SocialHandleExportVo.class);
for (SocialHandleExportVo vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build();
excelWriter.write(list,writeSheet);
index++;
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
}
if (Common.isNotNull(list)){
list.clear();
}
}
excelWriter.finish();
}else {
WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build();
excelWriter.write(list,writeSheet);
excelWriter.finish();
}
if (Common.isNotNull(list)){
list.clear();
}
out.flush();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
/**
* @Author fxj
* @Description 社保花名册 count
* @Date 17:59 2022/7/27
* @Param
* @return
**/
private int getRecordRosterCount(SocialHandleSearchVo searchVo, String idStr, List<String> settleDomains, String sql) {
List<String> ids = new ArrayList<>();
if (Common.isNotNull(idStr)){
ids = Common.initStrToList(idStr,CommonConstants.COMMA_STRING);
}
return baseMapper.getSocialRecordRosterListCount(searchVo,ids,settleDomains,sql);
}
/**
* @Author fxj
* @Description 社保花名册 list
* @Date 17:59 2022/7/27
* @Param
* @return
**/
private List<SocialHandleExportVo> getRecordRosterList(SocialHandleSearchVo searchVo, String idStr, List<String> settleDomains, String sql) {
return baseMapper.getSocialRecordRosterList(searchVo,Common.getList(idStr),settleDomains,sql);
}
@Override
public IPage<TDispatchInfo> getTDispatchSocialHandlePage(Page<TDispatchInfo> page, SocialHandleSearchVo tDispatchInfo, List<String> settleDomains, String sql) {
return baseMapper.getTDispatchSocialHandlePage(page,tDispatchInfo,settleDomains,sql);
}
@Override
public IPage<TDispatchInfo> getTDispatchFundHandlePage(Page<TDispatchInfo> page, SocialHandleSearchVo tDispatchInfo,List<String> settleDomains, String sql) {
return baseMapper.getTDispatchFundHandlePage(page,tDispatchInfo,settleDomains,sql);
}
/**
* 导出公积金补缴清册
* @Author fxj
* @Date 2020-06-08
* @param idStr
* @param searchVo
* @return
**/
@Override
public R<List<FundSupplementaryExportVo>> getFundSupplementaryRecords(String idStr, SocialHandleSearchVo searchVo, List<String> settleDomains, String sql) {
return R.ok(baseMapper.getFundSupplementaryRecords(searchVo,Common.getList(idStr),settleDomains,sql));
}
/**
* @Author fxj
* @Description 导出公积金补缴清册
* @Date 20:05 2022/7/27
* @Param
* @return
**/
@Override
public void doexportFundRecordChange(HttpServletResponse response,String idStr, SocialHandleSearchVo searchVo, List<String> settleDomains, String sql) {
String fileName = DispatchConstants.SOCIAL_RECORD_EXPORT + LocalDateTime.now() + ".xlsx";
//获取要导出的列表
List<FundHandleExportVo> list = new ArrayList<>();
long count = getFundRecordCount(searchVo,idStr,settleDomains,sql);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TEmpBadRecord.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = getFundRecordList(searchVo,idStr,settleDomains,sql);
if (Common.isNotNull(list)){
ExcelUtil<FundHandleExportVo> util = new ExcelUtil<>(FundHandleExportVo.class);
for (FundHandleExportVo vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build();
excelWriter.write(list,writeSheet);
index++;
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
}
if (Common.isNotNull(list)){
list.clear();
}
}
excelWriter.finish();
}else {
WriteSheet writeSheet = EasyExcel.writerSheet(ArchivesConstants.EMP_BAD_RECORD+index).build();
excelWriter.write(list,writeSheet);
excelWriter.finish();
}
if (Common.isNotNull(list)){
list.clear();
}
out.flush();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
private List<FundHandleExportVo> getFundRecordList(SocialHandleSearchVo searchVo, String idStr, List<String> settleDomains, String sql) {
return baseMapper.getFundRecordList(searchVo,Common.getList(idStr),settleDomains,sql);
}
private long getFundRecordCount(SocialHandleSearchVo searchVo, String idStr, List<String> settleDomains, String sql) {
return baseMapper.getFundRecordCount(searchVo,Common.getList(idStr),settleDomains,sql);
}
}
......@@ -93,9 +93,6 @@
<result property="idCardCity" column="ID_CARD_CITY"/>
<result property="idCardTown" column="ID_CARD_TOWN"/>
<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
</resultMap>
<!-- 派单导出vo -->
......@@ -122,6 +119,18 @@
<result property="createTime" column="CREATE_TIME"/>
</resultMap>
<resultMap id="fundSupplementaryMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.FundSupplementaryExportVo">
<result property="providentStart" column="PROVIDENT_START"/>
<result property="unitProvidengCardinal" column="UNIT_PROVIDENG_CARDINAL"/>
<result property="personalProvidentCardinal" column="PERSONAL_PROVIDENT_CARDINAL"/>
<result property="unitProvidentPer" column="UNIT_PROVIDENT_PER"/>
<result property="personalProvidentPer" column="PERSONAL_PROVIDENT_PER"/>
<result property="unitProvidentFee" column="UNIT_PROVIDENT_FEE"/>
<result property="personalProvidentFee" column="PERSONAL_PROVIDENT_FEE"/>
<result property="empName" column="EMP_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_ID,
......@@ -195,12 +204,6 @@
</sql>
<sql id="tDispatchInfo_where">
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.idList != null">
AND a.ID in
<foreach item="idStr" index="index" collection="tDispatchInfo.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tDispatchInfo.id != null and tDispatchInfo.id.trim() != ''">
AND a.ID = #{tDispatchInfo.id}
</if>
......@@ -424,4 +427,382 @@
limit #{tDispatchInfo.limitStart},#{tDispatchInfo.limitEnd}
</if>
</select>
<resultMap id="socialHandleExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleExportVo">
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empType" column="EMP_TYPE"/>
<result property="empMobile" column="EMP_MOBILE"/>
<result property="empNational" column="EMP_NATIONAL"/>
<result property="type" column="TYPE"/>
<result property="settleDomain" column="SETTLE_DOMAIN_NAME"/>
<result property="reduceReason" column="REDUCE_REASON"/>
<result property="belongUnit" column="BELONG_UNIT_NAME"/>
<result property="contractStart" column="CONTRACT_START"/>
<result property="contractEnd" column="CONTRACT_END"/>
<result property="contractTerm" column="CONTRACT_TERM"/>
<result property="empRegisType" column="EMP_REGIS_TYPE"/>
<result property="post" column="POST"/>
<result property="socialHandleStatus" column="SOCIAL_HANDLE_STATUS"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="workingHours" column="WORKING_HOURS"/>
<result property="educationName" column="EDUCATION_NAME"/>
<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="unitPensionCardinal" column="UNIT_PENSION_CARDINAL"/>
<result property="unitMedicalCardinal" column="UNIT_MEDICAL_CARDINAL"/>
<result property="unitUnemploymentCardinal" column="UNIT_UNEMPLOYMENT_CARDINAL"/>
<result property="unitWorkInjuryCardinal" column="UNIT_WORK_INJURY_CARDINAL"/>
<result property="unitBirthCardinal" column="UNIT_BIRTH_CARDINAL"/>
<result property="personalBigailmentMoney" column="PERSONAL_BIGAILMENT_MONEY"/>
<result property="unitBigailmentMoney" column="UNIT_BIGAILMENT_MONEY"/>
<result property="unitBigailmentCardinal" column="UNIT_BIGAILMENT_CARDINAL"/>
<result property="socailTrustRemark" column="TRUST_REMARK"/>
<result property="pensionStart" column="PENSION_START"/>
<result property="medicalStart" column="MEDICAL_START"/>
<result property="unemployStart" column="UNEMPLOY_START"/>
<result property="workInjuryStart" column="WORK_INJURY_START"/>
<result property="birthStart" column="BIRTH_START"/>
<result property="bigailmentStart" column="BIGAILMENT_START"/>
</resultMap>
<resultMap id="fundHandleMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.FundHandleExportVo">
<result property="type" column="TYPE"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="belongUnit" column="BELONG_UNIT_NAME"/>
<result property="settleDomain" column="SETTLE_DOMAIN_NAME"/>
<result property="empMobile" column="EMP_MOBILE"/>
<result property="creasteUserName" column="CREATE_NAME"/>
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
<result property="providentStart" column="PROVIDENT_START"/>
<result property="unitProvidengCardinal" column="UNIT_PROVIDENG_CARDINAL"/>
<result property="personalProvidentCardinal" column="PERSONAL_PROVIDENT_CARDINAL"/>
<result property="unitProvidentPer" column="UNIT_PROVIDENT_PER"/>
<result property="personalProvidentPer" column="PERSONAL_PROVIDENT_PER"/>
<result property="unitProvidentFee" column="UNIT_PROVIDENT_FEE"/>
<result property="personalProvidentFee" column="PERSONAL_PROVIDENT_FEE"/>
<result property="fundProvince" column="FUND_PROVINCE"/>
<result property="fundCity" column="FUND_CITY"/>
<result property="fundTown" column="FUND_TOWN"/>
<result property="belongUnit" column="BELONG_UNIT_NAME"/>
</resultMap>
<!--tDispatchInfo 社保花名册数据查询-->
<select id="getSocialRecordRosterList" resultMap="socialHandleExportMap">
SELECT
a.TYPE,
a.SOCIAL_HANDLE_STATUS,
IF(a.TYPE='0',b.PENSION_HANDLE,IF(b.PENSION_HANDLE='2',"--",a.SOCIAL_HANDLE_STATUS)) as "PENSION_HANDLE",
IF(a.TYPE='0',b.MEDICAL_HANDLE,IF(b.MEDICAL_HANDLE='2',"--",a.SOCIAL_HANDLE_STATUS)) as "MEDICAL_HANDLE",
IF(a.TYPE='0',b.UNEMPLOY_HANDLE,IF(b.UNEMPLOY_HANDLE='2',"--",a.SOCIAL_HANDLE_STATUS)) as "UNEMPLOY_HANDLE",
IF(a.TYPE='0',b.WORK_INJURY_HANDLE,IF(b.WORK_INJURY_HANDLE='2',"--",a.SOCIAL_HANDLE_STATUS)) as "WORK_INJURY_HANDLE",
IF(a.TYPE='0',b.BIRTH_HANDLE,IF(b.BIRTH_HANDLE='2',"--",a.SOCIAL_HANDLE_STATUS)) as "BIRTH_HANDLE",
IF(a.TYPE='0',b.BIGAILMENT_HANDLE,IF(b.BIGAILMENT_HANDLE='2',"--",a.SOCIAL_HANDLE_STATUS)) as "BIGAILMENT_HANDLE",
a.EMP_NAME,
a.EMP_IDCARD,
a.EDUCATION_NAME,
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.EMP_TYPE,
a.POST,
a.EMP_MOBILE,
a.EMP_REGIS_TYPE,
a.EMP_NATIONAL,
a.WORKING_HOURS,
a.CONTRACT_TERM,
a.CONTRACT_START,
a.CONTRACT_END,
a.CREASTE_USER_NAME,
b.RECORD_BASE,
b.PAYMENT_TYPE,
b.SOCIAL_HOUSEHOLD_NAME,
b.SOCIAL_PROVINCE,
b.SOCIAL_CITY,
b.SOCIAL_TOWN,
b.PENSION_START,
b.UNIT_PENSION_CARDINAL,
b.MEDICAL_START,
b.UNIT_MEDICAL_CARDINAL,
b.UNEMPLOY_START,
b.UNIT_UNEMPLOYMENT_CARDINAL,
b.WORK_INJURY_START,
b.UNIT_WORK_INJURY_CARDINAL,
b.BIRTH_START,
b.UNIT_BIRTH_CARDINAL,
b.BIGAILMENT_START,
b.UNIT_BIGAILMENT_CARDINAL,
b.UNIT_BIGAILMENT_MONEY,
b.PERSONAL_BIGAILMENT_MONEY,
b.TRUST_REMARK socailTrustRemark,
a.REDUCE_REASON
<include refid="where_getSocialRecordRoster"/>
</select>
<!--tDispatchInfo 社保花名册数据查询count-->
<select id="getSocialRecordRosterListCount" resultType="java.lang.Integer">
SELECT
count(1)
<include refid="where_getSocialRecordRoster"/>
</select>
<!--tDispatchInfo 社保办理数据查询-->
<select id="getTDispatchSocialHandlePage" resultMap="tDispatchInfoMap">
SELECT
<include refid="Base_Column_List"/>
<include refid="where_getSocialRecordRoster"/>
</select>
<!--tDispatchInfo 公积金办理数据查询-->
<select id="getTDispatchFundHandlePage" resultMap="tDispatchInfoMap">
SELECT
<include refid="Base_Column_List"/>
<include refid="where_getFundRecord"/>
</select>
<!--tDispatchInfo 公积金变更清册cout-->
<select id="getFundRecordCount" resultType="java.lang.Integer">
SELECT
count(1)
<include refid="where_getFundRecord"/>
</select>
<!--tDispatchInfo 公积金变更清册查询-->
<select id="getFundRecordList" resultMap="fundHandleMap">
SELECT
a.TYPE,
a.EMP_NAME,
a.EMP_IDCARD,
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.EMP_MOBILE,
a.CREATE_NAME,
c.PROVIDENT_HOUSEHOLD_NAME,
c.PROVIDENT_START,
c.UNIT_PROVIDENG_CARDINAL,
c.PERSONAL_PROVIDENT_CARDINAL,
c.UNIT_PROVIDENT_PER,
c.PERSONAL_PROVIDENT_PER,
c.UNIT_PROVIDENT_FEE,
c.PERSONAL_PROVIDENT_FEE,
c.FUND_PROVINCE,
c.FUND_CITY,
c.FUND_TOWN
<include refid="where_getFundRecord"/>
</select>
<!--tDispatchInfo 公积金补交清册-->
<select id="getFundSupplementaryRecords" resultMap="fundSupplementaryMap">
SELECT
c.PROVIDENT_START,
c.UNIT_PROVIDENG_CARDINAL,
c.PERSONAL_PROVIDENT_CARDINAL,
c.UNIT_PROVIDENT_PER,
c.PERSONAL_PROVIDENT_PER,
c.UNIT_PROVIDENT_FEE,
c.PERSONAL_PROVIDENT_FEE,
c.EMP_NAME
<include refid="where_getFundRecord"/>
</select>
<sql id="where_getSocialRecordRoster">
FROM t_dispatch_info a
left join t_social_info b on a.SOCIAL_ID = b.id
<where>
1=1 and b.DELETE_FLAG = 0
<if test="idsStr != null">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
/** 社保办理状态:0待办理/1已办理2办理失败3已派减4 办理中 5 部分办理失败 派单社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3 部分办理成功 4 办理中 **/
/*社保代办理 1.派单审核通过 2.派增(type=0):待办理(social_handle_status='0') or 派减(type=1):已办理完成或部分办理失败 且已派减*/
AND a.social_id is not null
AND a.STATUS = "2"
and (( a.type = '0' AND (b.HANDLE_STATUS = "0" or b.HANDLE_STATUS = "4") ) or ( a.type ='1' AND b.HANDLE_STATUS in ('1','5') and b.REDUCE_CAN = '1'))
and a.SOCIAL_HANDLE_STATUS in ('0','4')
<!--<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''">
/*待办理组合判断*/
<if test="'2'.toString() == tDispatchInfo.status.trim() and tDispatchInfo.typeSub != null ">
/*社保代办理*/
<if test=" '0'.toString()==tDispatchInfo.typeSub.trim() ">
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus != ''">
</if>
<if test="tDispatchInfo.socialHandleStatus == null or tDispatchInfo.socialHandleStatus == ''">
and (( a.type = '0' AND b.HANDLE_STATUS in ('0','4')) or ( a.type ='1' AND b.HANDLE_STATUS in ('1','5') and b.REDUCE_CAN = '1'))
and a.SOCIAL_HANDLE_STATUS in ('0','4')
</if>
</if>
/* 公积金办理*/
<if test=" '1'.toString()==tDispatchInfo.typeSub.trim() ">
and (( a.type = '0' AND c.HANDLE_STATUS = '0') or ( a.type ='1' AND c.HANDLE_STATUS = '1' and c.REDUCE_CAN = '1'))
and a.FUND_HANDLE_STATUS='0'
</if>
</if>
</if>-->
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.socialProvince != null and tDispatchInfo.socialProvince!= null">
AND b.social_province = #{tDispatchInfo.socialProvince}
<if test="tDispatchInfo.socialCity != null and tDispatchInfo.socialCity!= null">
AND b.social_city = #{tDispatchInfo.socialCity}
</if>
<if test="tDispatchInfo.socialTown != null and tDispatchInfo.socialTown!= null">
AND b.social_town = #{tDispatchInfo.socialTown}
</if>
</if>
<if test="tDispatchInfo.empName != null and tDispatchInfo.empName.trim() != ''">
AND a.EMP_NAME = #{tDispatchInfo.empName}
</if>
<if test="tDispatchInfo.empIdcard != null and tDispatchInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tDispatchInfo.empIdcard}
</if>
<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''">
AND a.STATUS = #{tDispatchInfo.status}
</if>
<if test="tDispatchInfo.settleDomain != null and tDispatchInfo.settleDomain.trim() != ''">
AND a.SETTLE_DOMAIN = #{tDispatchInfo.settleDomain}
</if>
<if test="tDispatchInfo.settleDomainCode != null and tDispatchInfo.settleDomainCode.trim() != ''">
AND a.SETTLE_DOMAIN_CODE = #{tDispatchInfo.settleDomainCode}
</if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != ''">
AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus}
</if>
<if test="tDispatchInfo.createName != null and tDispatchInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tDispatchInfo.createName}
</if>
<if test="tDispatchInfo.settleDomainName != null and tDispatchInfo.settleDomainName.trim() != ''">
AND a.SETTLE_DOMAIN_NAME = #{tDispatchInfo.settleDomainName}
</if>
<if test="tDispatchInfo.belongUnitName != null and tDispatchInfo.belongUnitName.trim() != ''">
AND a.BELONG_UNIT_NAME = #{tDispatchInfo.belongUnitName}
</if>
<if test="tDispatchInfo.createTimeEnd != null">
AND a.CREATE_TIME <![CDATA[<=]]> #{tDispatchInfo.createTimeEnd}
</if>
<if test="tDispatchInfo.createTimeStart != null">
AND a.CREATE_TIME <![CDATA[>=]]> #{tDispatchInfo.createTimeStart}
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND b.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName}
</if>
</if>
<if test='sql != null and sql != ""'>
and <![CDATA[sql]]>
</if>
order by a.CREATE_TIME desc
</where>
</sql>
<sql id="where_getFundRecord">
FROM t_dispatch_info a
left join t_provident_fund c on a.FUND_ID = c.id
<where>
1=1 and b.DELETE_FLAG = 0
<if test="idsStr != null">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
/** 社保办理状态:0待办理/1已办理2办理失败3已派减4 办理中 5 部分办理失败 派单社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3 部分办理成功 4 办理中 **/
/*社保代办理 1.派单审核通过 2.派增(type=0):待办理(social_handle_status='0') or 派减(type=1):已办理完成或部分办理失败 且已派减*/
AND a.fund_id is not null
AND a.STATUS = "2"
and (( a.type = '0' AND c.HANDLE_STATUS = '0') or ( a.type ='1' AND c.HANDLE_STATUS = '1' and c.REDUCE_CAN = '1'))
and a.FUND_HANDLE_STATUS='0'
<!--<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''">
/*待办理组合判断*/
<if test="'2'.toString() == tDispatchInfo.status.trim() and tDispatchInfo.typeSub != null ">
/*社保代办理*/
<if test=" '0'.toString()==tDispatchInfo.typeSub.trim() ">
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus != ''">
</if>
<if test="tDispatchInfo.socialHandleStatus == null or tDispatchInfo.socialHandleStatus == ''">
and (( a.type = '0' AND b.HANDLE_STATUS in ('0','4')) or ( a.type ='1' AND b.HANDLE_STATUS in ('1','5') and b.REDUCE_CAN = '1'))
and a.SOCIAL_HANDLE_STATUS in ('0','4')
</if>
</if>
/* 公积金办理*/
<if test=" '1'.toString()==tDispatchInfo.typeSub.trim() ">
and (( a.type = '0' AND c.HANDLE_STATUS = '0') or ( a.type ='1' AND c.HANDLE_STATUS = '1' and c.REDUCE_CAN = '1'))
and a.FUND_HANDLE_STATUS='0'
</if>
</if>
</if>-->
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.fundProvince != null and tDispatchInfo.fundProvince.trim() != ''">
AND a.FUND_PROVINCE = #{tDispatchInfo.fundProvince}
</if>
<if test="tDispatchInfo.fundCity != null and tDispatchInfo.fundCity.trim() != ''">
AND a.FUND_CITY = #{tDispatchInfo.fundCity}
</if>
<if test="tDispatchInfo.fundTown != null and tDispatchInfo.fundTown.trim() != ''">
AND a.FUND_TOWN = #{tDispatchInfo.fundTown}
</if>
<if test="tDispatchInfo.empName != null and tDispatchInfo.empName.trim() != ''">
AND a.EMP_NAME = #{tDispatchInfo.empName}
</if>
<if test="tDispatchInfo.empIdcard != null and tDispatchInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tDispatchInfo.empIdcard}
</if>
<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''">
AND a.STATUS = #{tDispatchInfo.status}
</if>
<if test="tDispatchInfo.settleDomain != null and tDispatchInfo.settleDomain.trim() != ''">
AND a.SETTLE_DOMAIN = #{tDispatchInfo.settleDomain}
</if>
<if test="tDispatchInfo.settleDomainCode != null and tDispatchInfo.settleDomainCode.trim() != ''">
AND a.SETTLE_DOMAIN_CODE = #{tDispatchInfo.settleDomainCode}
</if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != ''">
AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus}
</if>
<if test="tDispatchInfo.createName != null and tDispatchInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tDispatchInfo.createName}
</if>
<if test="tDispatchInfo.settleDomainName != null and tDispatchInfo.settleDomainName.trim() != ''">
AND a.SETTLE_DOMAIN_NAME = #{tDispatchInfo.settleDomainName}
</if>
<if test="tDispatchInfo.belongUnitName != null and tDispatchInfo.belongUnitName.trim() != ''">
AND a.BELONG_UNIT_NAME = #{tDispatchInfo.belongUnitName}
</if>
<if test="tDispatchInfo.createTimeEnd != null">
AND a.CREATE_TIME <![CDATA[<=]]> #{tDispatchInfo.createTimeEnd}
</if>
<if test="tDispatchInfo.createTimeStart != null">
AND a.CREATE_TIME <![CDATA[>=]]> #{tDispatchInfo.createTimeStart}
</if>
<if test="tDispatchInfo.providentHouseholdName != null and tDispatchInfo.providentHouseholdName.trim() != ''">
AND b.PROVIDENT_HOUSEHOLD_NAME = #{tDispatchInfo.providentHouseholdName}
</if>
</if>
<if test='sql != null and sql != ""'>
and <![CDATA[sql]]>
</if>
order by a.CREATE_TIME desc
</where>
</sql>
</mapper>
......@@ -26,6 +26,7 @@
<resultMap id="tProvidentFundMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TProvidentFund">
<id property="id" column="ID"/>
<result property="providentHousehold" column="PROVIDENT_HOUSEHOLD"/>
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
<result property="providentStart" column="PROVIDENT_START"/>
<result property="unitProvidengCardinal" column="UNIT_PROVIDENG_CARDINAL"/>
<result property="personalProvidentCardinal" column="PERSONAL_PROVIDENT_CARDINAL"/>
......@@ -76,6 +77,7 @@
<sql id="Base_Column_List">
a.ID,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_HOUSEHOLD_NAME,
a.PROVIDENT_START,
a.UNIT_PROVIDENG_CARDINAL,
a.PERSONAL_PROVIDENT_CARDINAL,
......
......@@ -26,6 +26,7 @@
<resultMap id="tSocialInfoMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo">
<id property="id" column="ID"/>
<result property="socialHousehold" column="SOCIAL_HOUSEHOLD"/>
<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
<result property="socialStartDate" column="SOCIAL_START_DATE"/>
<result property="unitPensionCardinal" column="UNIT_PENSION_CARDINAL"/>
<result property="unitMedicalCardinal" column="UNIT_MEDICAL_CARDINAL"/>
......@@ -37,7 +38,6 @@
<result property="personalMedicalCardinal" column="PERSONAL_MEDICAL_CARDINAL"/>
<result property="personalBigailmentCardinal" column="PERSONAL_BIGAILMENT_CARDINAL"/>
<result property="personalUnemploymentCardinal" column="PERSONAL_UNEMPLOYMENT_CARDINAL"/>
<result property="personalWorkInjuryCardinal" column="PERSONAL_WORK_INJURY_CARDINAL"/>
<result property="empId" column="EMP_ID"/>
<result property="empNo" column="EMP_NO"/>
<result property="empName" column="EMP_NAME"/>
......@@ -124,6 +124,7 @@
<sql id="Base_Column_List">
a.ID,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_HOUSEHOLD_NAME,
a.SOCIAL_START_DATE,
a.UNIT_PENSION_CARDINAL,
a.UNIT_MEDICAL_CARDINAL,
......
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