Commit c9a7f6e2 authored by hongguangwu's avatar hongguangwu

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

# Conflicts:
#	yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/mapper/TSalaryAccountMapper.java
#	yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/TSalaryStandardService.java
#	yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardServiceImpl.java
#	yifu-salary/yifu-salary-biz/src/main/resources/mapper/TSalaryAccountMapper.xml
parents cce7558e cec4142b
apiVersion: apps/v1 # 指定api版本,此值必须在kubectl api-versions中
kind: Deployment # 指定创建资源的角色/类型
metadata: # 资源的元数据/属性
name: yifu-order # 资源的名字,在同一个namespace中必须唯一
namespace: qas-mvp # 部署在哪个namespace中
spec: # 资源规范字段
selector: # 选择器
matchLabels: # 匹配标签
app: yifu-order
replicas: 1 # 声明副本数目
#revisionHistoryLimit: 3 # 保留历史版本
#strategy: # 策略
# rollingUpdate: # 滚动更新
# maxSurge: 30% # 最大额外可以存在的副本数,可以为百分比,也可以为整数
# maxUnavailable: 30% # 示在更新过程中能够进入不可用状态的 Pod 的最大值,可以为百分比,也可以为整数
# type: RollingUpdate # 滚动更新策略
template: # 模版
metadata: # 模版
labels: # 设定资源的标签
app: yifu-order
annotations:
dapr.io/enabled: "true" #设定此参数为 true 注入Dapr sidecar到pod
dapr.io/app-id: "yifu-order" #应用程序唯一 ID。 用于服务发现、状态封装 和 发布/订阅 消费者ID
dapr.io/app-port: "5006" #这个参数告诉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标签
kubernetes.io/hostname: yfmaster1
containers: # 容器
- name: yifu-order # 容器的名字
image: hub.worfu.com/qas-mvp/yifu-order-biz:1.0.0 #临时地址
# image: 192.168.1.110:5500/qas-mvp/yifu-order-biz:1.0.0 # 容器镜像地址
imagePullPolicy: Always # 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent
# Always,每次都检查;Never,每次都不检查(不管本地是否有);IfNotPresent,如果本地有就不检查,如果没有就拉取(手动测试时,
# 已经打好镜像存在docker容器中时,使用存在不检查级别,
# 默认为每次都检查,然后会进行拉取新镜像,因镜像仓库不存在,导致部署失败)
ports:
- containerPort: 5006 # 容器端口
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-order # 资源的名字,在同一个namespace中必须唯一
name: yifu-order # 资源的名字,在同一个namespace中必须唯一
namespace: qas-mvp # 部署在哪个namespace中
spec: # 资源规范字段
ports:
- port: 5006 # service 端口
protocol: TCP # 协议
targetPort: 5006 # 容器暴露的端口
name: http-order # 端口名称
- port: 3500 # service 端口
protocol: TCP # 协议
targetPort: 3500 # 容器暴露的端口
name: http-order-dapr
selector: # 选择器
app: yifu-order # 资源名称
type: ClusterIP # ClusterIP 类型
\ No newline at end of file
......@@ -101,6 +101,7 @@
<module>yifu-social</module>
<module>yifu-insurances</module>
<module>yifu-salary</module>
<module>yifu-order</module>
</modules>
<dependencyManagement>
......
......@@ -472,4 +472,5 @@ public interface CommonConstants {
**/
public static final String PARAM_INFO_ERROR = "传参有误!";
}
......@@ -11,6 +11,10 @@ public class InsurancesConstants {
* 新增
*/
public static final String ADD = "“新增”提交申请";
/**
* 替换导出新增
*/
public static final String ADD_ = "新增";
/**
* 离职
*/
......@@ -985,8 +989,30 @@ public class InsurancesConstants {
*/
public static final String INSURANCE_ENCLOSURE_DELETE_ABNORMAL = "电子保单删除异常";
/**
* 未结算
*/
public static final String SETTLE_ZERO = "未结算";
/**
* 已结算
*/
public static final String SETTLE_ONE = "已结算";
/**
* 结算中
*/
public static final String SETTLE_TWO = "结算中";
/**
* 无需结算
*/
public static final String SETTLE_THREE = "无需结算";
/**
* 订单编号不能为空
*/
public static final String ORDER_NO_IS_EMPTY = "订单编号不能为空";
......
......@@ -285,5 +285,29 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "商险办理时间")
private LocalDateTime handledTime;
private static final long serialVersionUID = 1L;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 创建人所在部门
*/
@Schema(description = "创建人所在部门")
private String createUserDeptId;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -5,6 +5,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
......@@ -30,6 +32,11 @@ public class TInsuranceEkp implements Serializable {
*/
private String defaultSettleId;
/**
* 单据类型 (0、与薪资合并结算 1、单独结算)
*/
private Integer settleType;
/**
* 项目编码
*/
......@@ -88,12 +95,12 @@ public class TInsuranceEkp implements Serializable {
/**
* 保单开始时间
*/
private Date policyStart;
private LocalDate policyStart;
/**
* 保单结束时间
*/
private Date policyEnd;
private LocalDate policyEnd;
/**
* 购买标准
......@@ -113,12 +120,12 @@ public class TInsuranceEkp implements Serializable {
/**
* 实际保费
*/
private String actualPremium;
private BigDecimal actualPremium;
/**
* 预估保费
*/
private String estimatePremium;
private BigDecimal estimatePremium;
/**
* 结算月
......@@ -128,12 +135,12 @@ public class TInsuranceEkp implements Serializable {
/**
* 单据状态
*/
private String interactiveType;
private Integer interactiveType;
/**
* 重发标识
*/
private String resendFlag;
private Integer resendFlag;
/**
* 创建时间
......
......@@ -32,6 +32,12 @@ public class TInsuranceRefund extends BaseEntity {
@Schema(description = "保单信息主键")
private String insDetailId;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 减员状态
*/
......@@ -56,7 +62,17 @@ public class TInsuranceRefund extends BaseEntity {
@Schema(description = "是否删除 0否/1是")
private Integer deleteFlag;
/**
* 创建人所在部门
*/
@Schema(description = "创建人所在部门")
private String createUserDeptId;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
private static final long serialVersionUID = 1L;
......
......@@ -88,6 +88,7 @@ public class EKPUtil {
TInsuranceSettlePushParam pushParam = insuranceDetail2PushParam(param);
try{
String formValues = new ObjectMapper().writeValueAsString(pushParam);
log.info("formValues:"+formValues);
//指向EKP的接口url
//把ModelingAppModelParameterAddForm转换成MultiValueMap
JSONObject loginName = new JSONObject();
......@@ -104,7 +105,7 @@ public class EKPUtil {
//wholeForm.add("formValues", new String(formValues.getBytes("UTF-8"),"ISO-8859-1"));
wholeForm.add("formValues", formValues);
//wholeForm.add("formValues", new String("{\"fd_3adfe6af71a1cc\":\"王五\", \"fd_3adfe658c6229e\":\"2019-03-26\", \"fd_3adfe6592b4158\":\"这里内容\"}".getBytes("UTF-8"),"ISO-8859-1") );
System.out.println("wholeForm:"+wholeForm);
//System.out.println("wholeForm:"+wholeForm);
HttpHeaders headers = new HttpHeaders();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入
//addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 11:57:55
*/
@Data
public class InsuranceListOrderParam {
private String orderNo;
private List<InsuranceAddParam> data;
}
......@@ -22,6 +22,12 @@ public class InsuranceListParam implements Serializable {
@Schema(description = "项目编码")
private String deptNo;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
......
......@@ -104,6 +104,12 @@ public class InsuranceListVO implements Serializable {
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 创建人部门名称
*/
@Schema(description = "创建人部门名称(派单人)")
private String createUserDeptName;
/**
* 创建者
*/
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 12:13:48
*/
@Data
public class InsuranceOrderBatchParam {
private String orderNo;
private List<InsuranceBatchParam> data;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 12:35:52
*/
@Data
public class InsuranceOrderRefundParam {
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
private List<InsuranceRefundCheck> data;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 12:29:28
*/
@Data
public class InsuranceOrderReplaceParam {
private String orderNo;
private List<InsuranceReplaceParam> data;
}
......@@ -23,6 +23,12 @@ public class InsuranceRefundCheck implements Serializable {
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 员工姓名
*/
......
......@@ -15,23 +15,28 @@ import java.io.Serializable;
@Tag(name = "EKP结算信息表")
public class SettleVo implements Serializable {
/**
* 主键id
*/
private String id;
/**
* 结算id
*/
@Schema(description = "结算id")
private String fd_3b05ba46bb042e;
private String detailId;
/**
* 预估单结算状态
*/
@Schema(description = "预估单结算状态:未结算、已结算、结算中、无需结算")
private String fd_3b05ba4808a3ca;
private String estimateStatus;
/**
* 实缴单结算状态
*/
@Schema(description = "实缴单结算状态:未结算、已结算、结算中、无需结算")
private String fd_3b05bd5ed0b976;
private String actualStatus;
}
package com.yifu.cloud.plus.v1.yifu.insurances.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.config.MybatisPlusMetaObjectHandler;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.plugins.YifuPaginationInnerInterceptor;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.support.TransactionTemplate;
import javax.sql.DataSource;
/**
* @author zhaji
* @description TODO
* @date 2022-08-25 17:03:43
*/
@Configuration
@MapperScan(basePackages = "com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp", sqlSessionTemplateRef = "ekpSqlSessionTemplate", sqlSessionFactoryRef = "ekpSqlSessionFactory")
public class EkpDataSourceConfig {
/**
* 配置ekp的数据源
* @return
*/
@Bean(name="ekpDataSource")
@ConfigurationProperties(prefix = "spring.datasource.ekp")
public DataSource ekpDataSource() {
return DataSourceBuilder.create().build();
}
/**
* 配置该数据源的sql会话工厂
* @param dataSource
* @return
* @throws Exception
*/
@Bean
public SqlSessionFactory ekpSqlSessionFactory(@Qualifier("ekpDataSource") DataSource dataSource) throws Exception {
MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
bean.setDataSource(dataSource);
//添加XML目录
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
try {
bean.setMapperLocations(resolver.getResources("classpath:mapper/ekp/*.xml"));
//分页插件配置,不配置分页插件无效,否则会出现total为0的情况
bean.setPlugins(ekpPlusInterceptor());
return bean.getObject();
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
/* MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
bean.setDataSource(dataSource);
MybatisConfiguration configuration = new MybatisConfiguration();
configuration.setMapUnderscoreToCamelCase(true);
bean.setConfiguration(configuration);
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/ekp/*.xml"));
return bean.getObject();*/
}
/**
* 配置该数据源的事务管理器
* @param dataSource
* @return
*/
@Bean
public DataSourceTransactionManager ekpTransactionManager(@Qualifier("ekpDataSource") DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
/**
* 配置ekp数据源的sql会话模板
* @param sqlSessionFactory
* @return
*/
@Bean
public SqlSessionTemplate ekpSqlSessionTemplate(@Qualifier("ekpSqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
/**
* 配置ekp数据源的事务模板
* @param dataSourceTransactionManager
* @return
*/
@Bean
public TransactionTemplate ekpTransactionTemplate(@Qualifier("ekpTransactionManager") DataSourceTransactionManager dataSourceTransactionManager) {
return new TransactionTemplate(dataSourceTransactionManager);
}
@Bean
public MybatisPlusInterceptor ekpPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new YifuPaginationInnerInterceptor());
return interceptor;
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.config.MybatisPlusMetaObjectHandler;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.plugins.YifuPaginationInnerInterceptor;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.support.TransactionTemplate;
import javax.sql.DataSource;
/**
* @author zhaji
* @description TODO
* @date 2022-08-25 16:57:06
*/
@Configuration
@MapperScan(basePackages = "com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances", sqlSessionTemplateRef = "insurancesSqlSessionTemplate", sqlSessionFactoryRef = "insurancesSqlSessionFactory")
public class InsurancesDataSourceConfig {
@Bean(name = "insurancesDataSource")
@ConfigurationProperties(prefix = "spring.datasource.insurances")
@Primary
public DataSource insurancesDataSource() {
return DataSourceBuilder.create().build();
}
@Bean
public SqlSessionFactory insurancesSqlSessionFactory(@Qualifier("insurancesDataSource") DataSource dataSource) throws Exception {
MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
bean.setDataSource(dataSource);
//多数据源 myMetaObjectHandler不起作用问题解决
GlobalConfig globalConfig = new GlobalConfig();
globalConfig.setMetaObjectHandler(new MybatisPlusMetaObjectHandler());
globalConfig.setDbConfig(new GlobalConfig.DbConfig());
globalConfig.setBanner(false);
bean.setGlobalConfig(globalConfig);
//添加XML目录
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
try {
bean.setMapperLocations(resolver.getResources("classpath:mapper/insurances/*.xml"));
//分页插件配置,不配置分页插件无效,否则会出现total为0的情况
bean.setPlugins(insurancesPlusInterceptor());
SqlSessionFactory sqlSessionFactory = bean.getObject();
sqlSessionFactory.getConfiguration().setMapUnderscoreToCamelCase(true);
return sqlSessionFactory;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
/* MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
bean.setDataSource(dataSource);
MybatisConfiguration configuration = new MybatisConfiguration();
configuration.setMapUnderscoreToCamelCase(true);
bean.setConfiguration(configuration);
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/insurances/*.xml"));
return bean.getObject();*/
}
@Bean(name = "insurancesTransactionManager")
@Primary
public DataSourceTransactionManager insurancesTransactionManager(@Qualifier("insurancesDataSource") DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
public SqlSessionTemplate insurancesSqlSessionTemplate(@Qualifier("insurancesSqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
@Bean
public TransactionTemplate insurancesTransactionTemplate(@Qualifier("insurancesTransactionManager") DataSourceTransactionManager dataSourceTransactionManager) {
return new TransactionTemplate(dataSourceTransactionManager);
}
@Bean
public MybatisPlusInterceptor insurancesPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new YifuPaginationInnerInterceptor());
return interceptor;
}
}
......@@ -5,7 +5,7 @@ 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.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceCompanyService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
......
......@@ -11,7 +11,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.Dept;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -119,7 +119,7 @@ public class TInsuranceDetailController {
@Operation(summary = "投保新增", description = "投保新增")
@PostMapping("/addInsurance")
public R<List<InsuranceAddParam>> addInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceAddParam> paramList){
return tInsuranceDetailService.addInsurance(paramList);
return tInsuranceDetailService.addInsurance(paramList,null);
}
/**
......@@ -132,7 +132,7 @@ public class TInsuranceDetailController {
@Operation(summary = "投保批增", description = "投保批增")
@PostMapping("/batchInsurance")
public R<List<InsuranceBatchParam>> batchInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceBatchParam> paramList){
return tInsuranceDetailService.batchInsurance(paramList);
return tInsuranceDetailService.batchInsurance(paramList,null);
}
/**
......@@ -145,7 +145,7 @@ public class TInsuranceDetailController {
@Operation(summary = "投保替换", description = "投保替换")
@PostMapping("/replaceInsurance")
public R<List<InsuranceReplaceParam>> replaceInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceReplaceParam> paramList){
return tInsuranceDetailService.replaceInsurance(paramList);
return tInsuranceDetailService.replaceInsurance(paramList,null);
}
/**
......@@ -288,7 +288,7 @@ public class TInsuranceDetailController {
*/
@PostMapping("/saveInsuranceRefund")
public R saveInsuranceRefund(@RequestBody @Valid @Size(min = 1,message = "导入减员列表不能为空") List<InsuranceRefundCheck> insuranceRefundCheckList){
return tInsuranceDetailService.saveInsuranceRefund(insuranceRefundCheckList);
return tInsuranceDetailService.saveInsuranceRefund(insuranceRefundCheckList,null);
}
/**
......@@ -353,7 +353,7 @@ public class TInsuranceDetailController {
*/
@Operation(summary = "已减员列表分页查询", description = "已减员列表分页查询")
@PostMapping("/getInsuranceRefundPageList")
public R<IPage<InsuranceRefundListVo>> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, @RequestBody InsuranceRefundParam param) {
public R getInsuranceRefundPageList(Page<InsuranceRefundParam> page, @RequestBody InsuranceRefundParam param) {
return tInsuranceDetailService.getInsuranceRefundPageList(page,param);
}
......@@ -524,4 +524,57 @@ public class TInsuranceDetailController {
public R<IPage<InsuranceListByIdCardVo>> getInsuranceListByIdCard(Page page, String idCard,String deptNo) {
return new R<>(tInsuranceDetailService.getInsuranceListByIdCard(page, idCard,deptNo));
}
/**
* 商险新增
*
* @author zhaji
* @param paramList
* @return {@link R<List<InsuranceAddParam>>}
*/
@Operation(summary = "投保新增", description = "投保新增")
@PostMapping("/addOrderInsurance")
public R<List<InsuranceAddParam>> addOrderInsurance(@RequestBody InsuranceListOrderParam paramList ){
return tInsuranceDetailService.addOrderInsurance(paramList);
}
/**
* 商险批增
*
* @author zhaji
* @param paramList
* @return {@link R<List<InsuranceBatchParam>>}
*/
@Operation(summary = "投保批增", description = "投保批增")
@PostMapping("/batchOrderInsurance")
public R<List<InsuranceBatchParam>> batchOrderInsurance(@RequestBody InsuranceOrderBatchParam paramList){
return tInsuranceDetailService.batchOrderInsurance(paramList);
}
/**
* 商险替换
*
* @author zhaji
* @param paramList
* @return {@link R<List<InsuranceReplaceParam>>}
*/
@Operation(summary = "投保替换", description = "投保替换")
@PostMapping("/replaceOrderInsurance")
public R<List<InsuranceReplaceParam>> replaceOrderInsurance(@RequestBody InsuranceOrderReplaceParam paramList){
return tInsuranceDetailService.replaceOrderInsurance(paramList);
}
/**
* 导入减员校验
* @param paramList 导入减员校验
* @author zhaji
* @date 2022-07-19
* @since v1.0
*/
@PostMapping("/refundOrderInsurance")
public R refundOrderInsurance(@RequestBody InsuranceOrderRefundParam paramList){
return tInsuranceDetailService.refundOrderInsurance(paramList);
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceEkpService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceEkpService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
......
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
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.TInsuranceEnclosure;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceEnclosureService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceEnclosureService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceEnclosureParam;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListParam;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAtta;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -21,7 +16,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.net.URL;
/**
* @author zhaji
......
......@@ -4,21 +4,17 @@ 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.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundHandlingParam;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import io.swagger.v3.oas.annotations.Operation;
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;
import java.util.List;
/**
* @author zhaji
......
......@@ -2,19 +2,16 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
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;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeRateService;
import io.swagger.v3.oas.annotations.Operation;
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;
import java.util.List;
/**
* @author zhaji
......
......@@ -2,15 +2,13 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
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.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeStandardService;
import io.swagger.v3.oas.annotations.Operation;
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;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import org.apache.ibatis.annotations.Mapper;
/**
* @author zhaji
* @description TODO
* @date 2022-08-26 09:12:46
*/
@Mapper
public interface EkpSettleMapper {
/**
* 获取结算信息
*
* @author zhaji
* @param id
* @return {@link SettleVo}
*/
SettleVo getSettle(String id);
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -84,6 +84,15 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/
void updatePolicyNoBatch(@Param("details") List<TInsuranceDetail> details);
/**
* 批量更新发票号
*
* @author licancan
* @param details
* @return void
*/
void updateInvoiceNoBatch(@Param("details") List<TInsuranceDetail> details);
/***********************减员办理********************************/
/**
......@@ -188,7 +197,22 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard, @Param("deptNo")String deptNo);
/**
* 查询所有在保,未出险,未过期,未失效,未减员的保单信息
*
* @author zhaji
* @param empIdcardNo
* @return {@link List< TInsuranceDetail>}
*/
List<TInsuranceDetail> selectListByempIdcardNo(String empIdcardNo);
/**
* 查数据是否存在权限范围内
*
* @author zhaji
* @param regionSQL
* @param id
* @return {@link TInsuranceDetail}
*/
TInsuranceDetail selectByregionSQL(@Param("regionSql") String regionSQL,@Param("id") String id);
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author Administrator
......@@ -22,7 +23,7 @@ public interface TInsuranceRefundMapper extends BaseMapper<TInsuranceRefund> {
*/
TInsuranceRefund getByInsDetailId(String id);
void updateByInsDetailId(TInsuranceRefund insuranceRefund);
void updateByInsDetailId(@Param("param") TInsuranceRefund insuranceRefund);
int updateRefundMoney(TInsuranceRefund insuranceRefund);
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
......
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.ekp;
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.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import org.springframework.stereotype.Service;
/**
* @author zhaji
* @description TODO
* @date 2022-08-26 09:25:36
*/
public interface EkpSettleService extends IService<TInsuranceTypeRate> {
/**
* 新增保险公司
*
* @author zhaji
* @param id 新增类
* @return {@link R}
*/
SettleVo getSettle(String id);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp.EkpSettleMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.Map;
import java.util.function.Function;
/**
* @author zhaji
* @description TODO
* @date 2022-08-26 09:25:51
*/
@Service
public class EkpSettleServiceImpl implements EkpSettleService {
@Resource
EkpSettleMapper ekpSettleMapper;
@Override
public SettleVo getSettle(String id) {
return ekpSettleMapper.getSettle(id);
}
@Override
public boolean saveBatch(Collection<TInsuranceTypeRate> entityList, int batchSize) {
return false;
}
@Override
public boolean saveOrUpdateBatch(Collection<TInsuranceTypeRate> entityList, int batchSize) {
return false;
}
@Override
public boolean updateBatchById(Collection<TInsuranceTypeRate> entityList, int batchSize) {
return false;
}
@Override
public boolean saveOrUpdate(TInsuranceTypeRate entity) {
return false;
}
@Override
public TInsuranceTypeRate getOne(Wrapper<TInsuranceTypeRate> queryWrapper, boolean throwEx) {
return null;
}
@Override
public Map<String, Object> getMap(Wrapper<TInsuranceTypeRate> queryWrapper) {
return null;
}
@Override
public <V> V getObj(Wrapper<TInsuranceTypeRate> queryWrapper, Function<? super Object, V> mapper) {
return null;
}
@Override
public BaseMapper<TInsuranceTypeRate> getBaseMapper() {
return null;
}
@Override
public Class<TInsuranceTypeRate> getEntityClass() {
return null;
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceEkpMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceEkpService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EKPInteractiveParam;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author Administrator
* @description 针对表【t_insurance_ekp(ekp交互失败存储表)】的数据库操作Service实现
* @createDate 2022-08-23 17:02:49
*/
@Service
public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, TInsuranceEkp> implements TInsuranceEkpService {
@Override
public R resend() {
List<TInsuranceEkp> ekpRefundList = this.baseMapper.getEkpRefundList();
if (CollectionUtils.isNotEmpty(ekpRefundList)){
for (TInsuranceEkp tInsuranceEkp : ekpRefundList) {
EKPInteractiveParam ekpParam = new EKPInteractiveParam();
BeanCopyUtils.copyProperties(tInsuranceEkp,ekpParam);
String detailId = ekpParam.getDetailId();
String defaultSettleId = ekpParam.getDefaultSettleId();
//查询当前结算状态
String status = CommonConstants.ONE_STRING;
if(status.equals(CommonConstants.ONE_STRING)){
}
}
return R.ok("发送成功");
}else{
return R.failed("无需要发送的信息");
}
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -75,7 +75,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList
* @return {@link R<List<InsuranceAddParam>>}
*/
R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList);
R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList,String orderNo);
/**
* 商险批增
......@@ -84,7 +84,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList
* @return {@link R<List<InsuranceBatchParam>>}
*/
R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList);
R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList,String orderNo);
/**
* 商险替换
*
......@@ -92,7 +92,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList
* @return {@link R<List<InsuranceReplaceParam>>}
*/
R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList);
R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList,String orderNo);
/**
* 通过id删除
......@@ -187,7 +187,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param insuranceRefundCheckList 减员表
* @return {@link R}
*/
R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList);
R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList,String orderNo);
/**
* 已投保列表分页查询
......@@ -354,4 +354,33 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @return {@link R}
*/
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard,String deptNo);
/**
* 新增订单商险
*
* @author zhaji
* @param paramList
* @return {@link R< List< InsuranceReplaceParam>>}
*/
R<List<InsuranceAddParam>> addOrderInsurance(InsuranceListOrderParam paramList);
/**
* 批增订单商险
*
* @author zhaji
* @param paramList
* @return {@link R< List< InsuranceBatchParam>>}
*/
R<List<InsuranceBatchParam>> batchOrderInsurance(InsuranceOrderBatchParam paramList);
/**
* 替换订单商险
*
* @author zhaji
* @param paramList
* @return {@link R< List< InsuranceReplaceParam>>}
*/
R<List<InsuranceReplaceParam>> replaceOrderInsurance(InsuranceOrderReplaceParam paramList);
R refundOrderInsurance(InsuranceOrderRefundParam paramList);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.core.metadata.IPage;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
......@@ -14,13 +14,14 @@ import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
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.mapper.TInsuranceCompanyMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
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.mapper.insurances.TInsuranceCompanyMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
......@@ -102,6 +103,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
* @return {@link R}
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R updateInsuranceCompany(TInsuranceCompany insuranceCompany) {
YifuUser user = SecurityUtils.getUser();
String id = insuranceCompany.getId();
......@@ -164,6 +166,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
* @return {@link R}
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R deleteById(String id) {
YifuUser user = SecurityUtils.getUser();
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
......@@ -19,12 +19,12 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CheckDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceDetailMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.*;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceDetailMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.*;
import com.yifu.cloud.plus.v1.yifu.insurances.util.*;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import lombok.extern.slf4j.Slf4j;
......@@ -80,7 +80,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private TInsuranceRefundService tInsuranceRefundService;
@Resource
private TInsuranceEkpService tInsuranceEkpService;
@Resource
private EkpSettleService ekpSettleService;
@Resource
......@@ -265,8 +266,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @author licancan
*/
@Override
@Transactional(rollbackFor = {Exception.class})
public R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList) {
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList,String orderNo) {
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
......@@ -285,7 +286,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail detail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(success,detail);
//购买类型,默认为「新增」
detail.setOrderNo(orderNo);
detail.setBuyType(CommonConstants.ONE_INT);
detail.setCreateUserDeptId(user.getDeptId().toString());
detail.setCreateUserDeptName(user.getDeptName());
//投保状态:待投保
detail.setBuyHandleStatus(CommonConstants.ONE_INT);
detail.setPolicyStart(LocalDateUtil.parseLocalDate(success.getPolicyStart()));
......@@ -312,8 +316,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @author licancan
*/
@Override
@Transactional(rollbackFor = {Exception.class})
public R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList) {
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList,String orderNo) {
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
......@@ -336,6 +340,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//投保状态:待投保
detail.setBuyHandleStatus(CommonConstants.ONE_INT);
//保费都默认是0
detail.setOrderNo(orderNo);
detail.setCreateUserDeptId(user.getDeptId().toString());
detail.setCreateUserDeptName(user.getDeptName());
detail.setActualPremium(new BigDecimal("0.00"));
detail.setEstimatePremium(new BigDecimal("0.00"));
detail.setCreateBy(user.getId());
......@@ -357,8 +364,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @author licancan
*/
@Override
@Transactional(rollbackFor = {Exception.class})
public R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList) {
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList,String orderNo) {
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
......@@ -396,6 +403,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.updateById(detail);
//新数据置为待办理
newDetail.setId(null);
newDetail.setOrderNo(orderNo);
newDetail.setBuyHandleStatus(CommonConstants.ONE_INT);
newDetail.setBuyType(CommonConstants.FOUR_INT);
newDetail.setEmpName(success.getReplaceEmpName());
......@@ -409,6 +417,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail.setIsUse(null);
newDetail.setIsEffect(null);
newDetail.setReduceHandleStatus(null);
newDetail.setCreateUserDeptId(user.getDeptId().toString());
newDetail.setCreateUserDeptName(user.getDeptName());
newDetail.setSignFlag(CommonConstants.ZERO_INT);
//创建时间是新数据插入时间
newDetail.setCreateTime(LocalDateTime.now());
......@@ -416,6 +426,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail.setCreateName(user.getNickname());
//替换不参与结算
newDetail.setDefaultSettleId(null);
//替换不继承备注
newDetail.setRemark(null);
//替换不继承保单生效日期
newDetail.setPolicyEffect(null);
//保费都默认是0
newDetail.setActualPremium(new BigDecimal("0.00"));
newDetail.setEstimatePremium(new BigDecimal("0.00"));
......@@ -776,6 +790,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
//减员类型 处理创建人、创建时间、备注
if(CommonConstants.FIVE_INT == insuranceDetailVO.getDistributeType()){
TInsuranceRefund refund = tInsuranceRefundService.getOne(Wrappers.<TInsuranceRefund>query().lambda()
.eq(TInsuranceRefund::getInsDetailId, insuranceDetailVO.getId())
.orderByDesc(TInsuranceRefund::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(refund).isPresent()){
insuranceDetailVO.setCreateName(refund.getCreateName());
insuranceDetailVO.setCreateTime(refund.getCreateTime());
insuranceDetailVO.setRemark(refund.getRemark());
}
}
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(insuranceDetailVO.getDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
......@@ -880,7 +908,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceExportListVO> list = new ArrayList<>();
if(CollectionUtils.isNotEmpty(listVOS)){
for (InsuranceExportListVO listVO : listVOS) {
listVO.setRemark(InsurancesConstants.ADD);
listVO.setRemark(InsurancesConstants.ADD_);
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, listVO.getId())
.last(CommonConstants.LAST_ONE_SQL));
......@@ -1133,6 +1161,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
detail.setUpdateBy(user.getId());
//替换类型,保单生效日期:T + 1
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
successList.add(detail);
}else{
//根据结算类型判断是否需要计算预估保费
......@@ -1299,6 +1329,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
);
if (StringUtils.isNotBlank(success.getInvoiceNo())){
detail.setInvoiceNo(success.getInvoiceNo());
//如果发票号不为空,将替换类型的发票号也全部更新
List<TInsuranceReplace> list = tInsuranceReplaceService.list(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getOriginInsuranceDetailId, detail.getId()));
if (CollectionUtils.isNotEmpty(list)){
List<String> collect = list.stream().map(TInsuranceReplace::getToInsuranceDetailId).distinct().collect(Collectors.toList());
List<TInsuranceDetail> details = this.baseMapper.selectBatchIds(collect);
if (CollectionUtils.isNotEmpty(details)){
details.stream().forEach(e -> e.setInvoiceNo(success.getInvoiceNo()));
//这里自己写sql更新发票号,防止用mybatisPlus批量更新,把updateTime更新了(updateTime不能更新)
baseMapper.updateInvoiceNoBatch(details);
}
}
}
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
......@@ -2733,9 +2776,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param displayFlag 是否显示 0不显示/1显示
* @return void
*/
private void addOperate(List<TInsuranceDetail> detailList,YifuUser user,String operateDesc,String remark,Integer displayFlag){
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public void addOperate(List<TInsuranceDetail> detailList,YifuUser user,String operateDesc,String remark,Integer displayFlag){
if (CollectionUtils.isNotEmpty(detailList)){
try {
List<TInsuranceOperate> operateList = new ArrayList<>();
for (TInsuranceDetail detail : detailList) {
TInsuranceOperate operate = new TInsuranceOperate();
......@@ -2749,9 +2792,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
operateList.add(operate);
}
tInsuranceOperateService.saveBatch(operateList);
}catch (Exception e){
e.getStackTrace();
}
}
}
......@@ -2764,7 +2804,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(List<InsuranceHandleParam> paramList,YifuUser user,String operateDesc){
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public void addOperate(List<InsuranceHandleParam> paramList,YifuUser user,String operateDesc){
if (CollectionUtils.isNotEmpty(paramList)){
try {
List<TInsuranceOperate> operateList = new ArrayList<>();
......@@ -2850,7 +2891,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link R}
*/
@Override
public R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList) {
public R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList,String orderNo) {
YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(insuranceRefundCheckList)){
return R.failed("当前导入的减员信息为空");
......@@ -2867,6 +2908,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefund.setUpdateTime(LocalDateTime.now());
insuranceRefund.setUpdateBy(user.getId());
insuranceRefund.setOrderNo(orderNo);
insuranceRefund.setCreateUserDeptId(user.getDeptId().toString());
insuranceRefund.setCreateUserDeptName(user.getDeptName());
if(StringUtils.isNotBlank(refund.getRemark())){
insuranceRefund.setRemark(refund.getRemark());
}
......@@ -3087,7 +3133,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link List< RefundExportListVo >}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){
YifuUser user = SecurityUtils.getUser();
List<RefundExportListVo> refundExportList;
......@@ -3127,8 +3173,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detailList.add(detail);
refund.setInsDetailId(record.getId());
refund.setReduceHandleStatus(CommonConstants.TWO_INT);
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
refund.setUpdateBy(user.getId());
refund.setUpdateTime(LocalDateTime.now());
refundList.add(refund);
}
}
......@@ -3160,7 +3206,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R updateInsuranceRefund(InsuranceRefundListParam insuranceDetail) {
Integer refundType = insuranceDetail.getRefundType();
if(CommonConstants.THREE_INT != refundType && CommonConstants.FOUR_INT != refundType){
......@@ -3207,8 +3253,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
successList.add(tInsuranceDetail);
//更新减员记录
refund.setInsDetailId(tInsuranceDetail.getId());
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
refund.setUpdateBy(user.getId());
refund.setUpdateTime(LocalDateTime.now());
refund.setReduceHandleStatus(refundType);
refundList.add(refund);
}else{
......@@ -3237,7 +3283,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param
* @return void
*/
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
@Override
public R insuranceRefundImport(List<InsuranceHandleImportParam> insuranceRefundImportList) {
YifuUser user = SecurityUtils.getUser();
......@@ -3253,8 +3299,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (InsuranceHandleImportParam param : successList) {
TInsuranceOperate operate = new TInsuranceOperate();
LambdaUpdateWrapper<TInsuranceRefund> refund = new LambdaUpdateWrapper<>();
refund.eq(TInsuranceRefund :: getInsDetailId ,param.getId());
refund.set(TInsuranceRefund :: getRemark,param.getRemark());
refund.eq(TInsuranceRefund :: getInsDetailId ,param.getId())
.set(TInsuranceRefund :: getRemark,param.getRemark())
.set(TInsuranceRefund :: getUpdateTime,LocalDateTime.now())
.set(TInsuranceRefund :: getUpdateBy,user.getId());
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail::getId, param.getId())
.set(TInsuranceDetail::getUpdateBy, user.getId())
......@@ -3294,7 +3342,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param
* @return void
*/
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
@Override
public R settleMonthChange(List<SettleMonthChangeCheckParam> settleMonthCheckList) {
//初始化线程池
......@@ -3373,7 +3421,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R deptChange(List<DeptChangeCheckParam> deptChangeCheckList) {
//初始化线程池
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 50, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10));
......@@ -3950,7 +3998,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R updateIsUse(String id) {
YifuUser user = SecurityUtils.getUser();
TInsuranceDetail insuranceDetail = getById(id);
......@@ -4625,7 +4673,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//查数据是否存在权限范围内
String regionSQL = getRegionSQL(user);
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByregionSQL(regionSQL,detailId);
if (!Optional.ofNullable(detailByRegionSQL).isPresent()){
if (!Optional.ofNullable(detailByRegionSQL).isPresent() || !user.getId().equals(detailByRegionSQL.getUpdateBy())){
param.setErrorMessage(InsurancesConstants.NO_DETAIL_JURISDICTION);
errorList.add(param);
continue;
......@@ -5067,6 +5115,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link R}
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R urgentUpdateIsUse(String empIdcardNo) {
//员工身份证
if(StringUtils.isBlank(empIdcardNo)){
......@@ -5113,6 +5162,42 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
@Override
public R<List<InsuranceAddParam>> addOrderInsurance(InsuranceListOrderParam paramList) {
String orderNo = paramList.getOrderNo();
if (StringUtils.isBlank(orderNo)) {
return R.failed(InsurancesConstants.ORDER_NO_IS_EMPTY);
}
return addInsurance(paramList.getData(),paramList.getOrderNo());
}
@Override
public R<List<InsuranceBatchParam>> batchOrderInsurance(InsuranceOrderBatchParam paramList) {
String orderNo = paramList.getOrderNo();
if (StringUtils.isBlank(orderNo)) {
return R.failed(InsurancesConstants.ORDER_NO_IS_EMPTY);
}
return batchInsurance(paramList.getData(),paramList.getOrderNo());
}
@Override
public R<List<InsuranceReplaceParam>> replaceOrderInsurance(InsuranceOrderReplaceParam paramList) {
String orderNo = paramList.getOrderNo();
if (StringUtils.isBlank(orderNo)) {
return R.failed(InsurancesConstants.ORDER_NO_IS_EMPTY);
}
return replaceInsurance(paramList.getData(),paramList.getOrderNo());
}
@Override
public R refundOrderInsurance(InsuranceOrderRefundParam paramList) {
String orderNo = paramList.getOrderNo();
if (StringUtils.isBlank(orderNo)) {
return R.failed(InsurancesConstants.ORDER_NO_IS_EMPTY);
}
return saveInsuranceRefund(paramList.getData(),paramList.getOrderNo());
}
/**
* 获取项目权限
*
......@@ -5280,12 +5365,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public SettleVo getInsuranceDetailSettleStatus(String detailId,String settleId){
String id = detailId+CommonConstants.DOWN_LINE_STRING+settleId;
//获取ekp结算信息
SettleVo settleVo = new SettleVo();
//id
settleVo.setFd_3b05ba46bb042e(id);
settleVo.setFd_3b05ba4808a3ca("预估单结算状态");
settleVo.setFd_3b05bd5ed0b976("实缴单结算状态");
return settleVo;
SettleVo settle = ekpSettleService.getSettle(id);
return settle;
}
/**
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceEkpMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceEkpService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BigDecimalUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.EKPUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EKPInteractiveParam;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* @author Administrator
* @description 针对表【t_insurance_ekp(ekp交互失败存储表)】的数据库操作Service实现
* @createDate 2022-08-23 17:02:49
*/
@Service
@Slf4j
public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, TInsuranceEkp> implements TInsuranceEkpService {
@Resource
TInsuranceSettleService tInsuranceSettleService;
@Resource
@Lazy
TInsuranceDetailService tInsuranceDetailService;
@Resource
@Lazy
EkpSettleService ekpSettleService;
@Override
public R resend() {
List<TInsuranceEkp> ekpRefundList = this.baseMapper.getEkpRefundList();
List<TInsuranceEkp> failList = new ArrayList<>();
List<TInsuranceEkp> successLit = new ArrayList<>();
SettleVo settle = ekpSettleService.getSettle("12345");
String actualStatus = settle.getActualStatus();
log.info("settle:"+settle.toString());
log.info("actualStatus:"+actualStatus);
if (CollectionUtils.isNotEmpty(ekpRefundList)){
for (TInsuranceEkp tInsuranceEkp : ekpRefundList) {
Integer pushType = tInsuranceEkp.getPushType();
LambdaQueryWrapper<TInsuranceSettle> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceSettle :: getId,tInsuranceEkp.getDefaultSettleId());
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(queryWrapper);
//如果当前需要重发预估保费的数据已发送,则过滤掉执行下一条数据
if(CommonConstants.ONE_INT == pushType && CommonConstants.ONE_INT == insuranceSettle.getIsEstimatePush()){
tInsuranceEkp.setResendFlag(CommonConstants.THREE_INT);
failList.add(tInsuranceEkp);
continue;
}
//如果当前需要重发实际保费的数据已发送,则过滤掉执行下一条数据
if(CommonConstants.TWO_INT == pushType && CommonConstants.ONE_INT == insuranceSettle.getIsActualPush()){
tInsuranceEkp.setResendFlag(CommonConstants.THREE_INT);
failList.add(tInsuranceEkp);
continue;
}
EKPInteractiveParam ekpParam = new EKPInteractiveParam();
BeanCopyUtils.copyProperties(tInsuranceEkp,ekpParam);
String detailId = ekpParam.getDetailId();
String defaultSettleId = ekpParam.getDefaultSettleId();
//查询当前结算状态
String status = CommonConstants.ONE_STRING;
if(actualStatus.equals(InsurancesConstants.SETTLE_ZERO)){
String s = EKPUtil.sendToEKP(ekpParam);
//如果发送成功
if (StringUtils.isNotBlank(s)){
//预估则更新预估保费
if(CommonConstants.ONE_INT == pushType){
LambdaUpdateWrapper<TInsuranceSettle> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceSettle :: getId,tInsuranceEkp.getDefaultSettleId())
.set(TInsuranceSettle :: getIsEstimatePush,CommonConstants.ONE_INT)
.set(TInsuranceSettle :: getEstimatePushTime, LocalDateTime.now());
tInsuranceSettleService.update(updateWrapper);
}
//预估则更新预估保费
if(CommonConstants.TWO_INT == pushType){
LambdaUpdateWrapper<TInsuranceSettle> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceSettle :: getId,tInsuranceEkp.getDefaultSettleId())
.set(TInsuranceSettle :: getIsActualPush,CommonConstants.ONE_INT)
.set(TInsuranceSettle :: getActualPushTime, LocalDateTime.now());
tInsuranceSettleService.update(updateWrapper);
}
//结算月则变更结算月
if(CommonConstants.THREE_INT == pushType){
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail :: getId,tInsuranceEkp.getDetailId())
.set(TInsuranceDetail :: getSettleMonth,tInsuranceEkp.getSettleMonth())
.set(TInsuranceDetail :: getUpdateTime, LocalDateTime.now());
tInsuranceDetailService.update(updateWrapper);
}
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
successLit.add(tInsuranceEkp);
}else{
break;
}
}else{
//如果为作废信息,已结算和结算中发送红冲数据
if(CommonConstants.FOUR_INT == pushType){
//预估保费
BigDecimal estimatePremium = ekpParam.getEstimatePremium();
//实际保费
BigDecimal actualPremium = ekpParam.getActualPremium();
if(!BigDecimalUtils.isNullOrZero(estimatePremium)){
ekpParam.setEstimatePremium(estimatePremium.negate());
}
if(!BigDecimalUtils.isNullOrZero(actualPremium)){
ekpParam.setActualPremium(actualPremium.negate());
}
ekpParam.setInteractiveType(CommonConstants.ONE_INT);
String s = EKPUtil.sendToEKP(ekpParam);
if(StringUtils.isNotBlank(s)){
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
successLit.add(tInsuranceEkp);
}else{
break;
}
//如果为红冲数据则正常发送
}else if(CommonConstants.FIVE_INT == pushType || CommonConstants.SIX_INT == pushType){
String s = EKPUtil.sendToEKP(ekpParam);
if(StringUtils.isNotBlank(s)){
tInsuranceEkp.setResendFlag(CommonConstants.ONE_INT);
successLit.add(tInsuranceEkp);
}else{
break;
}
}else{
tInsuranceEkp.setResendFlag(CommonConstants.TWO_INT);
failList.add(tInsuranceEkp);
}
}
}
updateBatchById(successLit);
updateBatchById(failList);
return R.ok("发送成功");
}else{
return R.failed("无需要发送的信息");
}
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -7,13 +7,12 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
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.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEnclosure;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceEnclosureMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceEnclosureService;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceEnclosureMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceEnclosureService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceEnclosureParam;
import lombok.extern.slf4j.Slf4j;
......@@ -54,6 +53,7 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos
*/
@Override
public R uploadInsuranceEnclosure(MultipartFile file, String filePath, String remark) throws IOException {
YifuUser user = SecurityUtils.getUser();
if(Common.isEmpty(file)){
return R.failed(InsurancesConstants.INSURANCE_ENCLOSURE_IS_EMPTY);
}
......@@ -85,8 +85,10 @@ public class TInsuranceEnclosureServiceImpl extends ServiceImpl<TInsuranceEnclos
insuranceEnclosure.setRemark(remark);
}
}
insuranceEnclosure.setEnclosureName(enclosureName);
insuranceEnclosure.setEnclosureName(file.getOriginalFilename());
insuranceEnclosure.setEnclosureAddress(key);
insuranceEnclosure.setCreateName(user.getNickname());
insuranceEnclosure.setCreateTime(LocalDateTime.now());
try {
this.save(insuranceEnclosure);
} catch (Exception e) {
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceOperateMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceOperateMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceOperateService;
import org.springframework.stereotype.Service;
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceRefundMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceRefundService;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceRefundMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceRefundService;
import org.springframework.stereotype.Service;
/**
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceReplace;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceReplaceMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceReplaceService;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceReplaceMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceReplaceService;
import org.springframework.stereotype.Service;
/**
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceSettleCancelMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceSettleCancelService;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceSettleCancelMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleCancelService;
import org.springframework.stereotype.Service;
/**
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceSettleMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceSettleMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleService;
import org.springframework.stereotype.Service;
/**
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
......@@ -11,10 +10,10 @@ 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.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeRateMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceTypeRateMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeRateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -67,7 +66,7 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R deleteInsuranceTypeRate(String id) {
YifuUser user = SecurityUtils.getUser();
if(Common.isEmpty(id)){
......@@ -95,7 +94,7 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R saveInsuranceTypeRate(TInsuranceTypeRate insuranceTypeRate) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(insuranceTypeRate)){
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -12,10 +12,10 @@ 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.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
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.mapper.insurances.TInsuranceTypeMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceCompanyService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import org.apache.commons.lang3.StringUtils;
......@@ -61,7 +61,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R saveInsuranceType(TInsuranceType insuranceType) {
if(Common.isEmpty(insuranceType)){
return R.failed("新增的险种信息为空");
......@@ -136,7 +136,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R updateInsuranceType(TInsuranceType insuranceType) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(insuranceType.getId())){
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
......@@ -9,15 +9,13 @@ 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.constants.InsurancesConstants;
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.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.mapper.insurances.TInsuranceTypeStandardMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceTypeStandardService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
......@@ -71,7 +69,7 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R deleteInsuranceTypeStandard(String id) {
YifuUser user = SecurityUtils.getUser();
if(Common.isEmpty(id)){
......@@ -98,7 +96,7 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R saveInsuranceTypeStandard(TInsuranceTypeStandard insuranceTypeStandard) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(insuranceTypeStandard)){
......
......@@ -10,17 +10,19 @@ spring:
port: 22379
password: '@yf_2017'
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: yf_zsk
url: jdbc:mysql://192.168.1.65:22306/mvp_insurances?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
insurances:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: yf_zsk
jdbc-url: jdbc:mysql://192.168.1.65:22306/mvp_insurances?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
ekp:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: hroread
password: 123456
jdbc-url: jdbc:mysql://119.96.192.73:3306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
pool-name: AmytangHikariCP
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp.EkpSettleMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo">
<id property="id" column="fd_id" jdbcType="VARCHAR"/>
<result property="detailId" column="fd_3b05ba46bb042e" jdbcType="VARCHAR"/>
<result property="estimateStatus" column="fd_3b05ba4808a3ca" jdbcType="VARCHAR"/>
<result property="actualStatus" column="fd_3b05bd5ed0b976" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
fd_id,fd_3b05ba46bb042e,fd_3b05ba4808a3ca,fd_3b05bd5ed0b976
</sql>
<select id="getSettle" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from
ekp_f80727b647a403b975ae
where
fd_3b05ba46bb042e = #{id}
</select>
</mapper>
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceCompanyMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany">
<id property="id" column="ID" jdbcType="VARCHAR"/>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceDetailMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceDetailMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
<id property="id" column="ID" jdbcType="VARCHAR"/>
......@@ -53,6 +53,9 @@
<result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/>
<result property="handledBy" column="HANDLED_BY" jdbcType="VARCHAR"/>
<result property="handledTime" column="HANDLED_TIME" jdbcType="TIMESTAMP"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="createUserDeptId" column="CREATE_USER_DEPT_ID" jdbcType="VARCHAR"/>
<result property="createUserDeptName" column="CREATE_USER_DEPT_NAME" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -67,7 +70,8 @@
BUY_HANDLE_STATUS,DEFAULT_SETTLE_ID,REDUCE_HANDLE_STATUS,
IS_USE,IS_EFFECT,IS_OVERDUE,REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME,
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME
</sql>
<!--投保分页查询-->
<select id="getInsuranceListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
......@@ -86,12 +90,16 @@
detail.CREATE_NAME as createName,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
detail.SETTLE_TYPE as settleType,
detail.CREATE_USER_DEPT_NAME as createUserDeptName,
detail.SETTLE_MONTH as settleMonth
from t_insurance_detail detail
where detail.DELETE_FLAG = 0
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO = #{param.deptNo}
</if>
<if test="param.orderNo != null and param.orderNo.trim() != ''">
and detail.DEPT_NO = #{param.orderNo}
</if>
<if test="param.deptNo == null or param.deptNo.trim() == ''">
and detail.DEPT_NO in
<foreach collection="param.deptNoList" index="index" item="item" open="(" separator="," close=")">
......@@ -392,6 +400,12 @@
</foreach>
</update>
<update id="updateInvoiceNoBatch">
<foreach collection="details" index="index" item="item" separator=";">
update t_insurance_detail set INVOICE_NO = #{item.invoiceNo} where ID = #{item.id}
</foreach>
</update>
<!-- ***********************减员办理******************************** -->
<!-- 已投保列表分页查询-->
<select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceEkpMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceEkpMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp">
<id property="id" column="id" jdbcType="VARCHAR"/>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceEnclosureMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceEnclosureMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEnclosure">
<id property="id" column="ID" jdbcType="INTEGER"/>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceOperateMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceOperateMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate">
<id property="id" column="ID" jdbcType="VARCHAR"/>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceRefundMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceRefundMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund">
<id property="id" column="ID" jdbcType="BIGINT"/>
......@@ -13,23 +13,51 @@
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
<result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
</resultMap>
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="createUserDeptId" column="CREATE_USER_DEPT_ID" jdbcType="VARCHAR"/>
<result property="createUserDeptName" column="CREATE_USER_DEPT_NAME" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,INS_DETAIL_ID,REDUCE_HANDLE_STATUS,
REFUND_MONEY,REMARK,CREATE_TIME,
CREATE_BY,CREATE_NAME
CREATE_BY,CREATE_NAME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME
</sql>
<update id="updateByInsDetailId">
update
t_insurance_refund
set
REDUCE_HANDLE_STATUS = #{reduceHandleStatus},
REMARK = #{remark},
UPDATE_BY = #{createBy},
UPDATE_TIME = #{createTime}
<if test="param.createName != null and param.createName.trim() != ''">
CREATE_NAME= #{param.createName},
</if>
<if test="param.createBy != null and param.createBy.trim() != ''">
CREATE_BY = #{param.createBy},
</if>
<if test="param.createTime != null">
CREATE_TIME = #{param.createTime},
</if>
<if test="param.updateBy != null and param.updateBy.trim() != ''">
UPDATE_BY = #{param.updateBy},
</if>
<if test="param.updateTime != null ">
UPDATE_TIME = #{param.updateTime},
</if>
<if test="param.createUserDeptName != null and param.createUserDeptName.trim() != ''">
CREATE_USER_DEPT_NAME= #{param.createUserDeptName},
</if>
<if test="param.createUserDeptId != null and param.createUserDeptId.trim() != ''">
CREATE_USER_DEPT_ID = #{param.createUserDeptId},
</if>
<if test="param.orderNo != null and param.orderNo.trim() != ''">
ORDER_NO = #{param.orderNo},
</if>
<if test="param.remark != null and param.remark.trim() != ''">
REMARK = #{param.remark},
</if>
REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
where
INS_DETAIL_ID = #{insDetailId}
INS_DETAIL_ID = #{param.insDetailId}
</update>
<update id="updateRefundMoney">
update
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceReplaceMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceReplaceMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceReplace">
<id property="id" column="ID" jdbcType="VARCHAR"/>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceSettleCancelMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceSettleCancelMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel">
<id property="id" column="ID" jdbcType="VARCHAR"/>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceSettleMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceSettleMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle">
<id property="id" column="ID" jdbcType="VARCHAR"/>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceTypeMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType">
<id property="id" column="ID" jdbcType="VARCHAR"/>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeRateMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceTypeRateMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate">
<id property="id" column="ID" jdbcType="VARCHAR"/>
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeStandardMapper">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceTypeStandardMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard">
<id property="id" column="ID" jdbcType="VARCHAR"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>yifu</artifactId>
<groupId>com.yifu.cloud.plus.v1</groupId>
<version>1.0.0</version>
</parent>
<artifactId>yifu-order</artifactId>
<packaging>pom</packaging>
<!--项目子模块-->
<modules>
<module>yifu-order-api</module>
<module>yifu-order-biz</module>
</modules>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>yifu</artifactId>
<groupId>com.yifu.cloud.plus.v1</groupId>
<version>1.0.0</version>
</parent>
<artifactId>yifu-order-api</artifactId>
<packaging>jar</packaging>
<description>yifu-order 接口模块</description>
<dependencies>
<!-- core 工具类 -->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-core</artifactId>
</dependency>
<!--swagger 注解-->
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
<!--mybatis 依赖-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-mybatis</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.order.constants;
/**
* @author licancan
* @description 订单常量
* @date 2022-08-29 11:36:21
*/
public class OrderConstants {
/**
* 状态不合法
*/
public static final String STATUS_ERROR = "状态不合法";
/**
* 数据不存在
*/
public static final String DATA_IS_EMPTY = "数据不存在";
/**
* 订单id不可为空
*/
public static final String ORDER_ID_IS_EMPTY = "订单id不可为空";
/**
* 订单已办结,不可操作
*/
public static final String ORDER_IS_HANDLED= "订单已办结,不可操作";
/**
* 操作成功
*/
public static final String OPERATE_SUCCESS = "操作成功";
}
package com.yifu.cloud.plus.v1.yifu.order.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author licancan
* @description 订单表 t_order
* @date 2022-08-26 17:20:16
*/
@Data
@TableName("t_order")
@Schema(description = "订单表")
public class TOrder implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String customerName;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String deptName;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 订单状态 0待办理 1办理中 2已办结
*/
@Schema(description = "订单状态 0待办理 1办理中 2已办结")
private Integer orderStatus;
/**
* 订单内容
*/
@Schema(description = "订单内容")
private String orderContent;
/**
* 创建人姓名(下单人)
*/
@Schema(description = "创建人姓名(下单人)")
private String createName;
/**
* 创建时间(下单时间)
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间(下单时间)")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
/**
* 更新人
*/
@Schema(description = "更新人")
private String updateBy;
/**
* 更新人姓名
*/
@Schema(description = "更新人姓名")
private String updateName;
/**
* 更新时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
/**
* 是否删除 0未删除/1删除
*/
@Schema(description = "是否删除 0未删除/1删除")
private Integer deleteFlag;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.order.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @author licancan
* @description 订单附件表 t_order_enclosure
* @date 2022-08-26 17:20:16
*/
@Data
@TableName("t_order_enclosure")
@Schema(description = "订单附件表")
public class TOrderEnclosure implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private Integer id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 附件名
*/
@Schema(description = "附件名")
private String enclosureName;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 附件标识 0订单附件 1回复附件
*/
@JsonIgnore
private Integer enclosureFlag;
/**
* 附件地址
*/
@Schema(description = "附件地址")
private String enclosureAddress;
/**
* 删除标识
*/
@Schema(description = "删除标识")
private Integer deleteFlag;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.order.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author licancan
* @description 订单回复表 t_order_reply
* @date 2022-08-26 17:20:16
*/
@Data
@TableName("t_order_reply")
@Schema(description = "订单回复表")
public class TOrderReply implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private Integer id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 回复内容
*/
@Schema(description = "回复内容")
private String replyContent;
/**
* 创建人姓名(回复人)
*/
@Schema(description = "创建人姓名(回复人)")
private String createName;
/**
* 创建时间(回复时间)
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间(回复时间)")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
/**
* 删除标识
*/
@Schema(description = "删除标识")
private Integer deleteFlag;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.order.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author licancan
* @description 订单列表入参
* @date 2022-08-29 09:10:02
*/
@Data
@Schema(description = "订单列表入参")
public class OrderListParam implements Serializable {
private static final long serialVersionUID = 2575913025864285604L;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 订单开始时间
*/
@Schema(description = "订单开始时间")
private String startDate;
/**
* 订单结束时间
*/
@Schema(description = "订单结束时间")
private String endDate;
/**
* 创建人姓名(下单人)
*/
@Schema(description = "创建人姓名(下单人)")
private String createName;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String customerName;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String deptName;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 订单状态 0待办理 1办理中 2已办结
*/
@Schema(description = "订单状态 0待办理 1办理中 2已办结")
private Integer orderStatus;
/**
* 订单id集合
*/
@Schema(description = "订单id集合")
private List<String> idList;
}
package com.yifu.cloud.plus.v1.yifu.order.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author licancan
* @description 订单列表VO
* @date 2022-08-29 09:16:07
*/
@Data
@Schema(description = "订单列表VO")
public class OrderListVO implements Serializable{
private static final long serialVersionUID = 4067597933537194227L;
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 创建时间(下单时间)
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间(下单时间)")
private LocalDateTime createTime;
/**
* 创建人姓名(下单人)
*/
@Schema(description = "创建人姓名(下单人)")
private String createName;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String customerName;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String deptName;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 订单状态 0待办理 1办理中 2已办结
*/
@Schema(description = "订单状态 0待办理 1办理中 2已办结")
private Integer orderStatus;
}
FROM moxm/java:1.8-full
RUN mkdir -p /yifu-order-biz
WORKDIR yifu-order-biz
ARG JAR_FILE=target/yifu-order-biz.jar
COPY ${JAR_FILE} app.jar
EXPOSE 5002
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
CMD sleep 60; java -jar app.jar $JAVA_OPTS
#!/usr/bin/env bash
mvn clean package -Pprd -Dmaven.test.skip=true docker:build -DpushImage
\ No newline at end of file
#!/usr/bin/env bash
mvn clean package -Ptest -Dmaven.test.skip=true docker:build -DpushImage
\ No newline at end of file
#!/usr/bin/env bash
mvn clean package -Dmaven.test.skip=true docker:build -DpushImage
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>yifu</artifactId>
<groupId>com.yifu.cloud.plus.v1</groupId>
<version>1.0.0</version>
</parent>
<artifactId>yifu-order-biz</artifactId>
<packaging>jar</packaging>
<description>yifu-order 业务模块</description>
<dependencies>
<!-- seata 依赖 -->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-seata</artifactId>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-order-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<!--选配: orm 模块-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--必备:安全模块-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-security</artifactId>
</dependency>
<!--必备:日志处理-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-log</artifactId>
</dependency>
<!--必备:swagger-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>
<!--必备:undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<version>5.8.0</version>
<artifactId>hutool-all</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-collections/commons-collections -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
<serverId>docker-hub</serverId>
<!--指定生成的镜像名-->
<imageName>${my.hub.host}/${map.group.name}/${project.artifactId}:${project.version}</imageName>
<dockerDirectory>${project.basedir}/</dockerDirectory>
<!--指定远程 docker api地址-->
<!--<dockerHost>http://172.16.66.232:2375</dockerHost>-->
<!-- 这里是复制 jar 包到 docker 容器指定目录配置-->
<resources>
<resource>
<targetPath>/</targetPath>
<!--jar 包所在的路径 此处配置的 即对应 target 目录-->
<directory>${project.build.directory}</directory>
<!-- 需要包含的 jar包 ,这里对应的是 Dockerfile中添加的文件名 -->
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<forceTags>true</forceTags>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>**/*.xlsx</exclude>
<exclude>**/*.xls</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*.xlsx</include>
<include>**/*.xls</include>
</includes>
</resource>
</resources>
</build>
</project>
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.order;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author licancan
* @description 项目启动类
* @date 2022-08-26 14:39:44
*/
@EnableYifuResourceServer
@SpringBootApplication
public class YifuOrderApplication {
public static void main(String[] args) {
SpringApplication.run(YifuOrderApplication.class, args);
}
}
package com.yifu.cloud.plus.v1.yifu.order.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.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author licancan
* @description 订单controller
* @date 2022-08-29 09:05:23
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/order")
@Tag(name = "订单相关")
public class OrderController {
@Resource
private TOrderService tOrderService;
/**
* 订单列表分页查询
*
* @author licancan
* @param page
* @param param
* @return {@link R<IPage<OrderListVO>>}
*/
@Operation(summary = "订单列表分页查询", description = "订单列表分页查询")
@GetMapping("/getOrderPageList")
public R<IPage<OrderListVO>> getOrderPageList(Page<OrderListParam> page, OrderListParam param) {
return R.ok(tOrderService.getOrderPageList(page,param));
}
/**
* 订单列表不分页查询
*
* @author licancan
* @param param
* @return {@link R<List<OrderListVO>>}
*/
@Operation(summary = "订单列表不分页查询", description = "订单列表不分页查询")
@GetMapping("/getOrderList")
public R<List<OrderListVO>> getOrderList(OrderListParam param) {
return R.ok(tOrderService.getOrderList(param));
}
/**
* 变更订单状态
*
* @author licancan
* @param id
* @param status
* @return {@link R< String>}
*/
@GetMapping("/handleOrder")
@Operation(summary = "变更订单状态", description = "变更订单状态")
public R<String> handleOrder(@RequestParam String id,@RequestParam Integer status) {
return tOrderService.handleOrder(id,status);
}
}
package com.yifu.cloud.plus.v1.yifu.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderEnclosure;
import org.apache.ibatis.annotations.Mapper;
/**
* @author licancan
* @description 针对表【t_order_enclosure(订单附件表)】的数据库操作Mapper
* @date 2022-08-26 17:22:18
*/
@Mapper
public interface TOrderEnclosureMapper extends BaseMapper<TOrderEnclosure> {
}
package com.yifu.cloud.plus.v1.yifu.order.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.order.entity.TOrder;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author licancan
* @description 针对表【t_order(订单表)】的数据库操作Mapper
* @date 2022-08-26 17:22:18
*/
@Mapper
public interface TOrderMapper extends BaseMapper<TOrder> {
/**
* 订单列表分页查询
*
* @author licancan
* @param page
* @param param
* @return {@link IPage<OrderListVO>}
*/
IPage<OrderListVO> getOrderPageList(Page<OrderListParam> page,@Param("param") OrderListParam param);
/**
* 导出勾选查询结果
*
* @author licancan
* @param idList
* @return {@link List<OrderListVO>}
*/
List<OrderListVO> getOrderListBySelect(@Param("idList") List<String> idList);
/**
* 导出非勾选查询结果
*
* @author licancan
* @param param
* @return {@link List< OrderListVO>}
*/
List<OrderListVO> getOrderList(@Param("param") OrderListParam param);
}
package com.yifu.cloud.plus.v1.yifu.order.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderReply;
import org.apache.ibatis.annotations.Mapper;
/**
* @author licancan
* @description 针对表【t_order_reply(订单回复表)】的数据库操作Mapper
* @date 2022-08-26 17:22:18
*/
@Mapper
public interface TOrderReplyMapper extends BaseMapper<TOrderReply> {
}
package com.yifu.cloud.plus.v1.yifu.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderEnclosure;
/**
* @author licancan
* @description 针对表【t_order_enclosure(订单附件表)】的数据库操作Service
* @date 2022-08-26 17:22:41
*/
public interface TOrderEnclosureService extends IService<TOrderEnclosure> {
}
package com.yifu.cloud.plus.v1.yifu.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderReply;
/**
* @author licancan
* @description 针对表【t_order_reply(订单回复表)】的数据库操作Service
* @date 2022-08-26 17:22:41
*/
public interface TOrderReplyService extends IService<TOrderReply> {
}
package com.yifu.cloud.plus.v1.yifu.order.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.order.entity.TOrder;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO;
import java.util.List;
/**
* @author licancan
* @description 针对表【t_order(订单表)】的数据库操作Service
* @date 2022-08-26 17:22:41
*/
public interface TOrderService extends IService<TOrder> {
/**
* 订单列表分页查询
*
* @author licancan
* @param page
* @param param
* @return {@link IPage<OrderListVO>}
*/
IPage<OrderListVO> getOrderPageList(Page<OrderListParam> page, OrderListParam param);
/**
* 订单列表不分页查询
*
* @author licancan
* @param param
* @return {@link List<OrderListVO>}
*/
List<OrderListVO> getOrderList(OrderListParam param);
/**
* 变更订单状态
*
* @author licancan
* @param id
* @param status
* @return {@link R<String>}
*/
R<String> handleOrder(String id, Integer status);
}
package com.yifu.cloud.plus.v1.yifu.order.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderEnclosure;
import com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderEnclosureMapper;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderEnclosureService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @author licancan
* @description 针对表【t_order_enclosure(订单附件表)】的数据库操作Service实现
* @date 2022-08-26 17:22:18
*/
@Slf4j
@Service
public class TOrderEnclosureServiceImpl extends ServiceImpl<TOrderEnclosureMapper, TOrderEnclosure> implements TOrderEnclosureService {
}
package com.yifu.cloud.plus.v1.yifu.order.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderReply;
import com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderReplyMapper;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderReplyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @author licancan
* @description 针对表【t_order_reply(订单回复表)】的数据库操作Service实现
* @date 2022-08-26 17:22:18
*/
@Slf4j
@Service
public class TOrderReplyServiceImpl extends ServiceImpl<TOrderReplyMapper, TOrderReply>
implements TOrderReplyService {
}
package com.yifu.cloud.plus.v1.yifu.order.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.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.order.constants.OrderConstants;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder;
import com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderMapper;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
/**
* @author licancan
* @description 针对表【t_order(订单表)】的数据库操作Service实现
* @date 2022-08-26 17:22:18
*/
@Slf4j
@Service
public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> implements TOrderService {
/**
* 订单列表分页查询
*
* @param page
* @param param
* @return {@link IPage <OrderListVO>}
* @author licancan
*/
@Override
public IPage<OrderListVO> getOrderPageList(Page<OrderListParam> page, OrderListParam param) {
IPage<OrderListVO> orderList = baseMapper.getOrderPageList(page,param);
return orderList;
}
/**
* 订单列表不分页查询
*
* @param param
* @return {@link List<OrderListVO>}
* @author licancan
*/
@Override
public List<OrderListVO> getOrderList(OrderListParam param) {
List<OrderListVO> list;
if (CollectionUtils.isNotEmpty(param.getIdList())){
list = baseMapper.getOrderListBySelect(param.getIdList());
}else {
list = baseMapper.getOrderList(param);
}
return list;
}
/**
* 变更订单状态
*
* @param id
* @param status
* @return {@link R <String>}
* @author licancan
*/
@Override
public R<String> handleOrder(String id, Integer status) {
if (StringUtils.isEmpty(id)){
return R.failed(OrderConstants.ORDER_ID_IS_EMPTY);
}
if (CommonConstants.TWO_INT != status && CommonConstants.THREE_INT != status){
return R.failed(OrderConstants.STATUS_ERROR);
}
YifuUser user = SecurityUtils.getUser();
TOrder byId = this.getById(id);
if (!Optional.ofNullable(byId).isPresent()){
return R.failed(OrderConstants.DATA_IS_EMPTY);
}
if (CommonConstants.THREE_INT == byId.getOrderStatus()){
return R.failed(OrderConstants.ORDER_IS_HANDLED);
}
byId.setOrderStatus(status);
byId.setUpdateBy(user.getId());
byId.setUpdateName(user.getNickname());
byId.setUpdateTime(LocalDateTime.now());
this.updateById(byId);
return R.ok(OrderConstants.OPERATE_SUCCESS);
}
}
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
config:
activate:
on-profile: dev
redis:
host: 127.0.0.1
port: 6379
password:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: yf_zsk
url: jdbc:mysql://192.168.1.65:22306/mvp_order?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
config:
activate:
on-profile: test
redis:
host: 192.168.1.65
port: 22379
password: '@yf_2017'
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: yf_zsk
url: jdbc:mysql://192.168.1.65:22306/mvp_order?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
pool-name: AmytangHikariCP
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
server:
port: 5006
# 加解密根密码
jasypt:
encryptor:
password: yifu #根密码
# 暴露监控端点
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
# mybaits-plus配置
mybatis-plus:
mapper-locations: classpath:/mapper/*Mapper.xml
global-config:
banner: false
db-config:
id-type: auto
table-underline: true
logic-delete-value: 1
logic-not-delete-value: 0
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# spring security 配置
security:
oauth2:
resource:
loadBalanced: true
token-info-uri: http://yifu-auth/oauth/check_token
ignore: # 通用放行URL,服务个性化,请在对应配置文件覆盖
urls:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
# 文件上传相关 支持阿里云、华为云、腾讯、minio
oss:
endpoint: http://oss-cn-beijing.aliyuncs.com
accessKey: LTAIDh9goA3jgpun
secretKey: eN8EHPAZxglNfcUCMhAT02cy93omLa
bucket-name: yf-hr-static-source
# swagger 配置
#swagger:
# enabled: true
# title: Yifu Swagger API
# gateway: http://${GATEWAY_HOST:yifu-gateway}:${GATEWAY-PORT:9999}
# token-url: ${swagger.gateway}/auth/oauth/token
# services:
# yifu-upms-biz: admin
# yifu-codegen: gen
# Spring 相关
spring:
application:
name: @artifactId@
#mvc:
# pathmatch:
# matching-strategy: ANT_PATH_MATCHER
servlet:
multipart:
#所有上传文件最大大小
max-request-size: 100MB
#单个文件最大大小
max-file-size: 50MB
#swagger 文档 https://springdoc.org/
### OpenAPI3 注解
# OpenAPI 3 注解位置
# @Tag(name = “接口类描述”) Controller 类上
# @Operation(summary =“接口方法描述”) Controller 方法上
# @Parameters Controller 方法上
# @Parameter(description=“参数描述”) Controller 方法上 @Parameters 里
# @Parameter(description=“参数描述”) Controller 方法的参数上
# @Parameter(hidden = true) 或 @Hidden --
# @Schema DTO类上
# @Schema DTO属性上
springdoc:
api-docs:
#是否开启文档功能
enabled: true
#swagger后端请求地址
path: /api-docs
swagger-ui:
#自定义swagger前端请求路径,输入http:127.0.0.1:8080/test会自动重定向到swagger页面
path: /api
#包扫描路径
packages-to-scan: com.yifu.cloud.plus.v1.yifu.order.controller
#这里定义了两个分组,可定义多个,也可以不定义
group-configs:
#分组名
#- group: admin
#按路径匹配
# pathsToMatch: /admin/**
#分组名
- group: order
#按包路径匹配
packagesToScan: com.yifu.cloud.plus.v1.yifu.order.controller
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!-- Console log output -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!-- Log file debug output -->
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/debug.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
</encoder>
</appender>
<!-- Log file error output -->
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="INFO">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderEnclosureMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.order.entity.TOrderEnclosure">
<id property="id" column="ID" jdbcType="INTEGER"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="enclosureName" column="ENCLOSURE_NAME" jdbcType="VARCHAR"/>
<result property="remark" column="REMARK" jdbcType="VARCHAR"/>
<result property="enclosureFlag" column="ENCLOSURE_FLAG" jdbcType="TINYINT"/>
<result property="enclosureAddress" column="ENCLOSURE_ADDRESS" jdbcType="VARCHAR"/>
<result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
ID,ORDER_NO,ENCLOSURE_NAME,
REMARK,ENCLOSURE_FLAG,ENCLOSURE_ADDRESS,
DELETE_FLAG
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.order.entity.TOrder">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="customerName" column="CUSTOMER_NAME" jdbcType="VARCHAR"/>
<result property="deptName" column="DEPT_NAME" jdbcType="VARCHAR"/>
<result property="deptNo" column="DEPT_NO" jdbcType="VARCHAR"/>
<result property="orderStatus" column="ORDER_STATUS" jdbcType="TINYINT"/>
<result property="orderContent" column="ORDER_CONTENT" jdbcType="VARCHAR"/>
<result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="UPDATE_BY" jdbcType="VARCHAR"/>
<result property="updateName" column="UPDATE_NAME" jdbcType="VARCHAR"/>
<result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
<result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
ID,ORDER_NO,CUSTOMER_NAME,
DEPT_NAME,DEPT_NO,ORDER_STATUS,
ORDER_CONTENT,CREATE_NAME,CREATE_TIME,
UPDATE_BY,UPDATE_NAME,UPDATE_TIME,
DELETE_FLAG
</sql>
<select id="getOrderPageList" resultType="com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO">
select t.id as id,
t.ORDER_NO as orderNo,
t.CREATE_TIME as createTime,
t.CREATE_NAME as createName,
t.CUSTOMER_NAME as customerName,
t.DEPT_NAME as deptName,
t.DEPT_NO as deptNo,
t.ORDER_STATUS as orderStatus
from t_order t
where t.DELETE_FLAG = 0
<if test="param.orderNo != null and param.orderNo.trim() != ''">
and t.ORDER_NO = #{param.orderNo}
</if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and t.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and t.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and t.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.customerName != null and param.customerName.trim() != ''">
and t.CUSTOMER_NAME = #{param.customerName}
</if>
<if test="param.deptName != null and param.deptName.trim() != ''">
and t.DEPT_NAME = #{param.deptName}
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and t.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.orderStatus != null">
and t.ORDER_STATUS = #{param.orderStatus}
</if>
ORDER BY t.ORDER_STATUS,t.CREATE_TIME DESC
</select>
<select id="getOrderListBySelect" resultType="com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO">
select t.id as id,
t.ORDER_NO as orderNo,
t.CREATE_TIME as createTime,
t.CREATE_NAME as createName,
t.CUSTOMER_NAME as customerName,
t.DEPT_NAME as deptName,
t.DEPT_NO as deptNo,
t.ORDER_STATUS as orderStatus
from t_order t
where t.DELETE_FLAG = 0 and t.id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
ORDER BY t.ORDER_STATUS,t.CREATE_TIME DESC
</select>
<select id="getOrderList" resultType="com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO">
select t.id as id,
t.ORDER_NO as orderNo,
t.CREATE_TIME as createTime,
t.CREATE_NAME as createName,
t.CUSTOMER_NAME as customerName,
t.DEPT_NAME as deptName,
t.DEPT_NO as deptNo,
t.ORDER_STATUS as orderStatus
from t_order t
where t.DELETE_FLAG = 0
<if test="param.orderNo != null and param.orderNo.trim() != ''">
and t.ORDER_NO = #{param.orderNo}
</if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and t.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and t.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and t.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.customerName != null and param.customerName.trim() != ''">
and t.CUSTOMER_NAME = #{param.customerName}
</if>
<if test="param.deptName != null and param.deptName.trim() != ''">
and t.DEPT_NAME = #{param.deptName}
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and t.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.orderStatus != null">
and t.ORDER_STATUS = #{param.orderStatus}
</if>
ORDER BY t.ORDER_STATUS,t.CREATE_TIME DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderReplyMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.order.entity.TOrderReply">
<id property="id" column="ID" jdbcType="INTEGER"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="replyContent" column="REPLY_CONTENT" jdbcType="VARCHAR"/>
<result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
ID,ORDER_NO,REPLY_CONTENT,
CREATE_NAME,CREATE_TIME,DELETE_FLAG
</sql>
</mapper>
......@@ -157,13 +157,6 @@ public class SysMessageSalary extends BaseEntity {
@ExcelAttribute(name = "应发工资")
@ExcelProperty("应发工资")
private BigDecimal relaySalary;
/**
* 反馈
*/
@ExcelAttribute(name = "反馈", maxLength = 300)
@Length(max = 300, message = "反馈不能超过300个字符")
@ExcelProperty("反馈")
private String feedback;
/**
* 有忽略提醒 0:忽略 1:不忽略
*/
......@@ -199,5 +192,5 @@ public class SysMessageSalary extends BaseEntity {
@Schema(description = "反馈原因", name = "reasonType")
@ExcelAttribute(name = "反馈原因", maxLength = 32)
@ExcelProperty(value = "反馈原因")
private Integer feedBack;
private String feedBack;
}
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.salary.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -46,7 +47,7 @@ public class TStatisticsDeclarer {
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("ID")
@ExcelIgnore
private String id;
/**
* 申报单位
......@@ -84,26 +85,18 @@ public class TStatisticsDeclarer {
@Length(max = 11, message = "手机号码不能超过11个字符")
@ExcelProperty("手机号码")
private String empPhone;
/**
* 人员状态
*/
@ExcelAttribute(name = "人员状态", maxLength = 2,readConverterExp = "0=在职,1=离职")
@Length(max = 2, message = "人员状态不能超过2个字符")
@ExcelProperty("人员状态")
private String empStatus;
/**
* 任职受雇从业类型
*/
@ExcelAttribute(name = "任职受雇从业类型", maxLength = 2,readConverterExp = "0=雇员,1=其他")
@Length(max = 2, message = "任职受雇从业类型不能超过2个字符")
@ExcelAttribute(name = "任职受雇从业类型", maxLength = 2,readConverterExp = "0=雇员,1=其他")
@ExcelProperty("任职受雇从业类型")
private String occupationType;
/**
* 任职受雇从业日期
*/
@ExcelAttribute(name = "任职受雇从业日期", maxLength = 20)
@Length(max = 20, message = "任职受雇从业日期不能超过20个字符")
@ExcelProperty("任职受雇从业日期")
@ExcelIgnore
private String occupationMonth;
/**
* 本月是否申报 0 是 1 否
......
......@@ -36,7 +36,7 @@ import java.time.LocalDateTime;
* @date 2022-08-05 11:40:14
*/
@Data
public class SysMessageSalaryExportVo extends SysMessageSalary {
public class SysMessageSalaryExportVo {
/**
* 客户名称
*/
......@@ -46,12 +46,12 @@ public class SysMessageSalaryExportVo extends SysMessageSalary {
@ExcelProperty("客户名称")
private String customerName;
/**
* 部门名称
* 项目名称
*/
@ExcelAttribute(name = "部门名称", isNotEmpty = true, errorInfo = "部门名称不能为空", maxLength = 50)
@NotBlank(message = "部门名称不能为空")
@Length(max = 50, message = "部门名称不能超过50个字符")
@ExcelProperty("部门名称")
@ExcelAttribute(name = "项目名称", isNotEmpty = true, errorInfo = "项目名称不能为空", maxLength = 50)
@NotBlank(message = "项目名称不能为空")
@Length(max = 50, message = "项目名称不能超过50个字符")
@ExcelProperty("项目名称")
private String departName;
/**
* 员工姓名
......@@ -61,20 +61,26 @@ public class SysMessageSalaryExportVo extends SysMessageSalary {
@ExcelProperty("员工姓名")
private String employeeName;
/**
* employeeIdnum
* 身份证号
*/
@ExcelAttribute(name = "employeeIdnum", maxLength = 50)
@Length(max = 50, message = "employeeIdnum不能超过50个字符")
@ExcelProperty("employeeIdnum")
@ExcelAttribute(name = "身份证号", maxLength = 50)
@Length(max = 50, message = "身份证号身份证号")
@ExcelProperty("身份证号")
private String employeeIdnum;
/**
* 工资月
*/
@ExcelAttribute(name = "工资月", maxLength = 10)
@Length(max = 10, message = "工资月不能超过10个字符")
@ExcelProperty("工资月")
@ExcelProperty("工资月")
private String salaryMonth;
/**
* 应发工资
*/
@ExcelAttribute(name = "应发工资")
@ExcelProperty("应发工资")
private BigDecimal relaySalary;
/**
* 实发工资
*/
......@@ -82,30 +88,24 @@ public class SysMessageSalaryExportVo extends SysMessageSalary {
@NotBlank(message = "实发工资不能为空")
@ExcelProperty("实发工资")
private BigDecimal actualSalary;
/**
* 应发工资
*/
@ExcelAttribute(name = "应发工资")
@ExcelProperty("应发工资")
private BigDecimal relaySalary;
/**
* 省
*/
@ExcelAttribute(name = "省")
@ExcelProperty("省")
private Integer province;
@ExcelAttribute(name = "省", isArea = true)
@ExcelProperty("项目-省")
private String province;
/**
* 市
*/
@ExcelAttribute(name = "市")
@ExcelProperty("市")
private Integer city;
@ExcelAttribute(name = "市", isArea = true,parentField = "province")
@ExcelProperty("项目-市")
private String city;
/**
* 县
*/
@ExcelAttribute(name = "县")
@ExcelProperty("县")
private Integer town;
@ExcelAttribute(name = "县", isArea = true,parentField = "city")
@ExcelProperty("项目-县")
private String town;
/**
* 最低工资标准
*/
......@@ -119,22 +119,14 @@ public class SysMessageSalaryExportVo extends SysMessageSalary {
@ExcelAttribute(name = "工资制表人-创建人", maxLength = 32)
@Length(max = 32, message = "工资制表人-创建人不能超过32个字符")
@ExcelProperty("创建人")
private String salaryMakeMan;
private String createName;
/**
* 反馈
*/
@ExcelAttribute(name = "反馈", maxLength = 300)
@Length(max = 300, message = "反馈不能超过300个字符")
@ExcelProperty("反馈")
@ExcelProperty("反馈原因")
private String feedback;
/**
* 原因大类 根据数据字典来判断
*/
@TableField(exist = false)
@Schema(description = "原因大类 根据数据字典来判断 ", name = "reasonType")
@ExcelAttribute(name = "原因大类", errorInfo = "原因大类不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.HAVE_SALARY_NO_SOCIAL_TYPE, needExport = true)
private Integer reasonType;
}
......@@ -20,7 +20,7 @@ import java.io.Serializable;
* @Version 1.0
*/
@Data
public class THaveSalaryNoSocialExportVo extends THaveSalaryNosocial implements Serializable {
public class THaveSalaryNoSocialExportVo implements Serializable {
/**
* 客户名称
......@@ -73,6 +73,13 @@ public class THaveSalaryNoSocialExportVo extends THaveSalaryNosocial implements
@ExcelProperty(value = "应发工资")
private String relaySalary;
/**
* 创建者-姓名
*/
@Schema(description = "创建人-姓名")
@TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建人")
private String createName;
/**
* 反馈原因
*/
......@@ -81,11 +88,4 @@ public class THaveSalaryNoSocialExportVo extends THaveSalaryNosocial implements
@ExcelProperty(value = "反馈原因")
private String feedBack;
/**
* 创建者-姓名
*/
@Schema(description = "创建人-姓名")
@TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建人")
private String createName;
}
......@@ -33,7 +33,7 @@ import java.math.BigDecimal;
* @date 2022-08-14 21:31:15
*/
@Data
public class TStatisticsBonusImportVo extends RowIndex implements Serializable {
public class TStatisticsBonusImportVo implements Serializable {
/**
* 员工姓名
......
......@@ -87,8 +87,8 @@ public class TMinSalaryController {
@SysLog("修改各地市最低工资标准")
@PutMapping
@PreAuthorize("@pms.hasPermission('wxhr:tminsalary_edit')")
public R update(@RequestBody TMinSalary tMinSalary) {
return new R<>(tMinSalaryService.updateById(tMinSalary));
public R<Boolean> update(@RequestBody TMinSalary tMinSalary) {
return tMinSalaryService.updateByIdDIy(tMinSalary);
}
/**
......
......@@ -58,6 +58,21 @@ public class TSalaryStandardController {
private final TApprovalRecordService auditLogService;
/**
* 简单分页查询-申请
*
* @param page 分页对象
* @param tSalaryStandard 标准薪酬工资表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/pageApply")
public R<IPage<TSalaryStandard>> getTSalaryStandardPageApply(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard) {
tSalaryStandard.setDeleteFlag(CommonConstants.ZERO_INT);
return new R<>(tSalaryStandardService.getTSalaryStandardPageApply(page, tSalaryStandard));
}
/**
* 简单分页查询
*
......
......@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -98,4 +99,9 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
**/
List<EkpSalaryParam> getEkpSalaryParamList(@Param("salaryId") String salaryId);
List<TSalaryAccount> noPageDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList")List<String> idList);
int noPageCountDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList")List<String> idList);
}
......@@ -43,6 +43,7 @@ public interface TSalaryStandardMapper extends BaseMapper<TSalaryStandard> {
*/
IPage<TSalaryStandard> getTSalaryStandardPage(Page<TSalaryStandard> page, @Param("tSalaryStandard") TSalaryStandard tSalaryStandard);
IPage<TSalaryStandard> getTSalaryStandardPageApply(Page<TSalaryStandard> page, @Param("tSalaryStandard") TSalaryStandard tSalaryStandard);
/**
* 标准薪酬工资表审核页面简单分页查询
* @param tSalaryStandard 标准薪酬工资表
......@@ -53,4 +54,5 @@ public interface TSalaryStandardMapper extends BaseMapper<TSalaryStandard> {
List<TSalaryStandardExportVo> getSalaryStandardExport(@Param("searchVo") TSalaryStandardSearchVo searchVo, @Param("idList")List<String> idList);
int getSalaryStandardExportCount(@Param("searchVo") TSalaryStandardSearchVo searchVo, @Param("idList")List<String> idList);
}
......@@ -46,5 +46,5 @@ public interface TStatisticsDeclarerMapper extends BaseMapper<TStatisticsDeclare
* @Description: 统计
* @return:
**/
List<TStatisticsDeclarer> doStatisticsTaxDeclarer(@Param("nowMonth") String nowMonth, @Param("lastYear") String lastYear);
List<TStatisticsDeclarer> doStatisticsTaxDeclarer(@Param("nowMonth") String nowMonth, @Param("lastMonth") String lastYear);
}
......@@ -24,4 +24,6 @@ public interface TMinSalaryService extends IService<TMinSalary> {
R<Boolean> saveDiy(TMinSalary tMinSalary);
R<Boolean> updateByIdDIy(TMinSalary tMinSalary);
}
......@@ -83,4 +83,5 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
**/
R<String> doSend(String id);
IPage<TSalaryStandard> getTSalaryStandardPageApply(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard);
}
......@@ -962,7 +962,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<TSalaryAccountItem> backList = new ArrayList<>();
if (itemList != null && !itemList.isEmpty()) {
for (TSalaryAccountItem item : itemList) {
if (("3".equals(item.getFormType()) || "4".equals(item.getFormType()))
if (("3".equals(item.getFormType()))
&& settleMonth.equals(item.getSettlementMonth())) {
backList.add(item);
}
......@@ -1650,7 +1650,15 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
//保存工资表
tSalaryStandardService.save(salary);
TApprovalRecord tApprovalRecord = new TApprovalRecord();
tApprovalRecord.setApprovalResult(CommonConstants.TWO_STRING);
tApprovalRecord.setApprovalOpinion("新建表单");
tApprovalRecord.setSalaryId(salary.getId());
tApprovalRecord.setNodeId("待提交");
tApprovalRecord.setApprovalMan(user.getId());
tApprovalRecord.setApprovalManName(user.getNickname());
tApprovalRecord.setApprovalTime(DateUtil.getCurrentDateTime());
auditLogService.save(tApprovalRecord);
for (TSalaryAccount account : aList) {
saiList = account.getSaiList();
......@@ -1819,7 +1827,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<TSalaryAccount> aList = new ArrayList<>();
TSalaryAccount a;//定库:
BigDecimal relaySalarySum = BigDecimal.ZERO; //工资应发
List<TSalaryAccountItem> asList; //累计扣税
int size = savList.size();
// 自有员工人数
int ownNum = 0;
......@@ -1869,14 +1876,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
//累计扣税list
asList = this.getLaborAsList(itemMap.get(a.getEmpIdcard()), a.getSettlementMonth());
// 实发劳务费,按月累计扣税
// 实发稿酬,按月累计扣税
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculationRemu(saiList, asList
, saiList, a), CommonConstants.ZERO_INT);
calculationRemu(saiList, saiList, a), CommonConstants.ZERO_INT);
// 自有员工以及自有员工应发金额
if (Common.isNotNull(a.getOwnFlag()) && a.getOwnFlag() == 1) {
......@@ -1913,6 +1916,15 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
//保存工资表
tSalaryStandardService.save(salary);
TApprovalRecord tApprovalRecord = new TApprovalRecord();
tApprovalRecord.setApprovalResult(CommonConstants.TWO_STRING);
tApprovalRecord.setApprovalOpinion("新建表单");
tApprovalRecord.setSalaryId(salary.getId());
tApprovalRecord.setNodeId("待提交");
tApprovalRecord.setApprovalMan(user.getId());
tApprovalRecord.setApprovalManName(user.getNickname());
tApprovalRecord.setApprovalTime(DateUtil.getCurrentDateTime());
auditLogService.save(tApprovalRecord);
for (TSalaryAccount account : aList) {
saiList = account.getSaiList();
......@@ -1935,15 +1947,14 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
/**
* @param itemList
* @param itemHistoryList
* @param saiList
* @Description: 计算劳务费个税、应发
* @Author: hgw
* @Date: 2022/3/3 11:30
* @return: java.math.BigDecimal
**/
private static BigDecimal calculationRemu(List<TSalaryAccountItem> itemList, List<TSalaryAccountItem> itemHistoryList,
List<TSalaryAccountItem> saiList, TSalaryAccount a) {
private static BigDecimal calculationRemu(List<TSalaryAccountItem> itemList, List<TSalaryAccountItem> saiList,
TSalaryAccount a) {
// 本次实发
BigDecimal actualSalarySumNow = BigDecimal.ZERO;
// 历史个税合计
......@@ -1954,31 +1965,22 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
actualSalarySumNow = actualSalarySumNow.add(item.getSalaryMoney());
}
}
// 历史实发、个税
for (TSalaryAccountItem item : itemHistoryList) {
if (SalaryConstants.SALARY_TAX_JAVA.equals(item.getJavaFiedName())) {
sumTax = sumTax.add(item.getSalaryMoney());
}
}
//个人税费
BigDecimal nowTaxT = BigDecimal.ZERO;
BigDecimal relaySalary;
nowTaxT = getNowTaxRemu(actualSalarySumNow);
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
a.setSalaryTaxUnit(nowTaxT);
a.setActualSalary(actualSalarySumNow);
a.setRelaySalaryUnit(relaySalary);
relaySalary = BigDecimalUtils.safeSubtract(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
a.setSalaryTax(nowTaxT);
a.setActualSalary(relaySalary);
a.setRelaySalaryUnit(actualSalarySumNow);
a.setRelaySalary(actualSalarySumNow);
if (sumTax.compareTo(BigDecimal.ZERO) != 0) {
nowTaxT = BigDecimalUtils.safeSubtract(nowTaxT, sumTax).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
}
// 本次个人应发合计
TSalaryAccountItem sai = new TSalaryAccountItem();
sai.setCnName(SalaryConstants.RELAY_SALARY);
sai.setJavaFiedName(SalaryConstants.RELAY_SALARY_JAVA);
sai.setIsTax(CommonConstants.ZERO_INT);
sai.setSalaryMoney(relaySalary);
sai.setSalaryMoney(actualSalarySumNow);
saiList.add(sai);
return nowTaxT;
}
......
......@@ -150,7 +150,7 @@ public class SysMessageSalaryServiceImpl extends ServiceImpl<SysMessageSalaryMap
**/
@Override
public void listExport(HttpServletResponse response, SysMessageSalarySearchVo searchVo) {
String fileName = "最低工资提醒导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "最低工资提醒查询批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<SysMessageSalaryExportVo> list = new ArrayList<>();
// TODO
......@@ -246,7 +246,7 @@ public class SysMessageSalaryServiceImpl extends ServiceImpl<SysMessageSalaryMap
return R.failed("允许创建人反馈信息!");
}
entity.setReasonType(reasonType);
entity.setFeedback(feedBack);
entity.setFeedBack(feedBack);
int res = baseMapper.updateById(entity);
if (res == CommonConstants.ONE_INT_NEGATE){
return R.failed(CommonConstants.SAVE_FAILED);
......
......@@ -191,7 +191,7 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
**/
@Override
public void listExport(HttpServletResponse response, THaveSalaryNosocialSearchVo searchVo) {
String fileName = "消息提醒导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "有工资无社保查询批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<THaveSalaryNoSocialExportVo> list = new ArrayList<>();
// TODO
......
......@@ -66,4 +66,38 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
return R.ok(true,CommonConstants.SAVE_SUCCESS);
}
@Override
public R<Boolean> updateByIdDIy(TMinSalary tMinSalary) {
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed("获取登录用户信息失败!");
}
TMinSalary entity = baseMapper.selectById(tMinSalary.getId());
if (Common.isNotNull(entity)){
LambdaQueryWrapper<TMinSalary> query = new LambdaQueryWrapper<>();
if (Common.isNotNull(tMinSalary.getProvince())){
query.eq(TMinSalary::getProvince,tMinSalary.getProvince());
}
if (Common.isNotNull(tMinSalary.getCity())){
query.eq(TMinSalary::getCity,tMinSalary.getCity());
}
if (Common.isNotNull(tMinSalary.getTown())){
query.eq(TMinSalary::getTown,tMinSalary.getTown());
}
if (Common.isEmpty(tMinSalary.getTown())){
query.isNull(TMinSalary::getTown);
}
query.ne(TMinSalary::getId,tMinSalary.getId());
query.eq(TMinSalary::getStatus, CommonConstants.ONE_INT);
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT){
return R.failed("已存在对应区域在用的配置信息");
}
baseMapper.updateById(entity);
return R.ok(true,CommonConstants.UPDATE_SUCCESS);
}else {
return R.failed(false,CommonConstants.SAVE_FAILED);
}
}
}
......@@ -75,7 +75,7 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
*/
@Override
public void listExport(HttpServletResponse response, TSalaryAccountSearchVo searchVo) {
String fileName = "员工报账批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "员工报账查询批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TSalaryAccount> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -134,28 +134,11 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
@Override
public List<TSalaryAccount> noPageDiy(TSalaryAccountSearchVo searchVo) {
LambdaQueryWrapper<TSalaryAccount> wrapper = buildQueryWrapper(searchVo);
if (Common.isNotNull(searchVo.getIdList())) {
wrapper.in(TSalaryAccount::getId, searchVo.getIdList());
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(TSalaryAccount::getSalaryMonth);
return baseMapper.selectList(wrapper);
}
private Long noPageCountDiy(TSalaryAccountSearchVo searchVo) {
LambdaQueryWrapper<TSalaryAccount> wrapper = buildQueryWrapper(searchVo);
if (Common.isNotNull(searchVo.getIdList())) {
wrapper.in(TSalaryAccount::getId, searchVo.getIdList());
}
return baseMapper.selectCount(wrapper);
return baseMapper.noPageDiy(searchVo,searchVo.getIdList());
}
private LambdaQueryWrapper buildQueryWrapper(TSalaryAccountSearchVo entity) {
LambdaQueryWrapper<TSalaryAccount> wrapper = Wrappers.lambdaQuery();
return wrapper;
private int noPageCountDiy(TSalaryAccountSearchVo searchVo) {
return baseMapper.noPageCountDiy(searchVo,searchVo.getIdList());
}
@Override
......
......@@ -91,7 +91,7 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
*/
@Override
public void listExport(HttpServletResponse response, TSalaryEmployeeSearchVo searchVo) {
String fileName = "薪酬人员批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "薪酬人员查询批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TSalaryEmployeeExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......
......@@ -90,6 +90,17 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
@Autowired
private EkpSalaryUtil ekpSalaryUtil;
/**
* 标准薪酬工资表简单分页查询
*
* @param tSalaryStandard 标准薪酬工资表
* @return
*/
@Override
public IPage<TSalaryStandard> getTSalaryStandardPageApply(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard) {
return baseMapper.getTSalaryStandardPageApply(page, tSalaryStandard);
}
/**
* 标准薪酬工资表简单分页查询
*
......@@ -108,7 +119,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
*/
@Override
public void listExport(HttpServletResponse response, TSalaryStandardSearchVo searchVo) {
String fileName = "项目薪酬查询导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "项目薪酬查询批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TSalaryStandardExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -167,13 +178,11 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
@Override
public List<TSalaryStandardExportVo> noPageDiy(TSalaryStandardSearchVo searchVo) {
List<String> idList = Common.getList(searchVo.getIds());
return baseMapper.getSalaryStandardExport(searchVo,idList);
return baseMapper.getSalaryStandardExport(searchVo,Common.getList(searchVo.getIds()));
}
private int noPageCountDiy(TSalaryStandardSearchVo searchVo) {
List<String> idList = Common.getList(searchVo.getIds());
return baseMapper.getSalaryStandardExportCount(searchVo,idList);
return baseMapper.getSalaryStandardExportCount(searchVo,Common.getList(searchVo.getIds()));
}
@Override
......
......@@ -19,6 +19,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author fxj
......@@ -128,7 +129,10 @@ public class TSpecialDeducationSumServiceImpl extends ServiceImpl<TSpecialDeduca
if (Common.isEmpty(declareTitle)) {
return R.failed("申报单位不能为空");
}
List<String> uc = sdsList.stream().map(TSpecialDeducationSum::getDeclareTitle).collect(Collectors.toList());
if (Common.isNotNull(uc) && uc.size() > CommonConstants.ONE_INT){
return R.failed("一次只允许导入一个申报单位");
}
TSpecialDeducationSum sdsCheck = new TSpecialDeducationSum();
sdsCheck.setCreateMonth(yearMonth);
sdsCheck.setDeclareTitle(declareTitle);
......
......@@ -201,7 +201,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
if (sdr != null && sdr.getData() != null) {
dept = sdr.getData();
}
if (dept == null || dept.getId() == null) {
if (dept != null && dept.getId() != null) {
invoiceTitle = dept.getBusinessSubjectName();
}
......@@ -269,14 +269,19 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
sumDeductSalary = BigDecimalUtils.safeAdd(sdSum,isTax,costReduction);
//年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
//年终奖合并扣税
if (isSend) {
//年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
wSalary = infoVo.getAnnualBonus();
finalSalaryWithSalary = finalSalaryNoSalary;
} else {
finalSalaryWithSalary = calculationSalary(annousTax, BigDecimalUtils.safeAdd(infoVo.getAnnualBonus(),
infoVo.getAnnualTSalary()));
//年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
BigDecimal annualTSalary = calculationSalaryT(personTax,infoVo.getAnnualTSalary(),sumTax);
finalSalaryNoSalary = BigDecimalUtils.safeAdd(finalSalaryNoSalary,annualTSalary);
wSalary = BigDecimalUtils.safeAdd(infoVo.getAnnualBonus(), infoVo.getAnnualTSalary());
finalSalaryWithSalary = calculationSalary(annousTax, wSalary);
}
if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
......@@ -393,8 +398,13 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
infoVo.setBestPlanTSalary(map.get(res.toString()));
infoVo.setBestPlanBonus(BigDecimalUtils.safeSubtract(wSalary,map.get(res.toString())));
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("全年一次性奖金测算").build();
excelWriter.write(list, writeSheet);
}
}else {
WriteSheet writeSheet = EasyExcel.writerSheet("全年一次性奖金测算"+index).build();
WriteSheet writeSheet = EasyExcel.writerSheet("全年一次性奖金测算").build();
excelWriter.write(list,writeSheet);
}
if (Common.isNotNull(list)){
......@@ -434,7 +444,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
BigDecimal anRes;
List<BigDecimal> zySalary = new ArrayList<>();
Map<String,BigDecimal> map = new HashMap<>();
for (BigDecimal i = minSalary; i.compareTo(maxAnualSalary) <= 0; BigDecimalUtils.safeAdd(i,new BigDecimal(100)) ) {
for (BigDecimal i = minSalary; i.compareTo(maxAnualSalary) <= 0; i = BigDecimalUtils.safeAdd(i,new BigDecimal(100)) ) {
//本次薪资纳税额
BigDecimal res = BigDecimal.ZERO;
//本次年终奖纳税额
......@@ -471,8 +481,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
zySalary.add(BigDecimalUtils.safeAdd(res,anRes));
map.put(BigDecimalUtils.safeAdd(res,anRes).toString(),i);
}
BigDecimal salary = BigDecimal.ZERO;
if (Common.isNotNull(zySalary)) {
salary = Collections.min(zySalary);
}
jsonObject.put("anRes",map);
jsonObject.put("zySalary",Collections.max(zySalary));
jsonObject.put("zySalary",salary);
return jsonObject;
}
......@@ -506,6 +520,32 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
return anRes;
}
/**
* @param personTax 薪资扣税阶梯表list
* @param annualSalary 年终奖
* @Description: 计算薪资扣税-个税
* @Author: huyc
* @Date: 2022/8/23
* @return: java.math.BigDecimal
**/
private static BigDecimal calculationSalaryT(List<TSalaryTaxConfig> personTax, BigDecimal annualSalary, BigDecimal sumTax) {
//本次年终奖纳税额
BigDecimal res = BigDecimal.ZERO;
//计算年终奖税
//计算个税
for (TSalaryTaxConfig sub : personTax) {
if (annualSalary.compareTo(sub.getMinIncome()) == SalaryConstants.MORE_THAN
&& annualSalary.compareTo(sub.getMaxIncome()) != SalaryConstants.MORE_THAN) {
//annualSalary = realDeduSalary * ((double) ((annualSalary.getTaxRate() * 1.0) / 100)) - sumTax - sub.getQuick();
res = annualSalary.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP))
.subtract(sumTax).subtract(sub.getQuickDeducation());// 应纳税额
break;
}
}
return res;
}
@Override
public List<TStatisticsBonus> noPageDiy(TStatisticsBonusSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsBonus> wrapper = buildQueryWrapper(searchVo);
......
......@@ -55,6 +55,7 @@ import java.util.List;
@Log4j2
@Service
public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDeclarerMapper, TStatisticsDeclarer> implements TStatisticsDeclarerService {
/**
* 申报对象表简单分页查询
* @param tStatisticsDeclarer 申报对象表
......@@ -72,7 +73,7 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
*/
@Override
public void listExport(HttpServletResponse response, TStatisticsDeclarerSearchVo searchVo){
String fileName = "个税申报对象" + DateUtil.getThisTime() + ".xlsx";
String fileName = "申报对象批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TStatisticsDeclarer> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -157,7 +158,7 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
baseMapper.updateById(tStatisticsDeclarer);
return R.ok();
}
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
@Override
......@@ -172,8 +173,7 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
return R.failed("上月数据已生成,不可重复生成!");
} else {
String lastMonth = DateUtil.addMonth(-1); //上月
String lastYear = lastMonth.substring(0,4);
List<TStatisticsDeclarer> stdvoList = baseMapper.doStatisticsTaxDeclarer(nowMonth,lastYear);
List<TStatisticsDeclarer> stdvoList = baseMapper.doStatisticsTaxDeclarer(nowMonth,lastMonth);
for (TStatisticsDeclarer declarer : stdvoList) {
this.save(declarer);
}
......@@ -264,38 +264,32 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
}
private void importTStatisticsDeclarer(List<TStatisticsDeclarerVo> excelVOList, List<ErrorMessage> errorMessageList) {
int successInt = 0;
int failuerInt = 0;
List<TStatisticsDeclarerVo> updateList = new ArrayList<>();
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TStatisticsDeclarerVo excel = excelVOList.get(i);
if (CommonConstants.ONE_STRING.equals(excel.getIsDeclare()) && Common.isEmpty(excel.getUndeclareReason())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "本期是否申报为否时,不申报原因不可为空"));
failuerInt++;
continue;
}
//根据身份证号和申报月份查找申报人员
TStatisticsDeclarer tStatisticsDeclarer = baseMapper.selectOne(Wrappers.<TStatisticsDeclarer>query().lambda()
List<TStatisticsDeclarer> declarerList = baseMapper.selectList(Wrappers.<TStatisticsDeclarer>query().lambda()
.eq(TStatisticsDeclarer::getEmpIdcard, excel.getEmpIdcard())
.eq(TStatisticsDeclarer::getDeclareMonth, excel.getDeclareMonth())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(tStatisticsDeclarer)) {
tStatisticsDeclarer.setIsDeclare(excel.getIsDeclare());
if (Common.isNotNull(excel.getUndeclareReason())) {
tStatisticsDeclarer.setUndeclareReason(excel.getUndeclareReason());
.eq(TStatisticsDeclarer::getEmpName, excel.getEmpName()));
if (Common.isNotNull(declarerList)) {
for (TStatisticsDeclarer tStatisticsDeclarer: declarerList) {
tStatisticsDeclarer.setIsDeclare(excel.getIsDeclare());
if (Common.isNotNull(excel.getUndeclareReason())) {
tStatisticsDeclarer.setUndeclareReason(excel.getUndeclareReason());
}
baseMapper.updateById(tStatisticsDeclarer);
}
baseMapper.updateById(tStatisticsDeclarer);
successInt++;
}else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "未找到身份证和申报月份对应的申报人员信息"));
failuerInt++;
continue;
}
}
errorMessageList.add(new ErrorMessage(-1, "成功操作" + successInt +"条数据," + "失败"
+ failuerInt + "条数据"));
}
}
......@@ -20,7 +20,21 @@
<result property="type" column="TYPE"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="customerName" column="CUSTOMER_NAME"/>
<result property="reasonType" column="REASON_TYPE"/>
<result property="feedBack" column="FEED_BACK"/>
</resultMap>
<resultMap id="sysMessageSalaryExportMap" type="com.yifu.cloud.plus.v1.yifu.salary.vo.SysMessageSalaryExportVo">
<result property="actualSalary" column="actual_salary"/>
<result property="salaryBase" column="salary_base"/>
<result property="salaryMonth" column="salary_month"/>
<result property="employeeName" column="employee_name"/>
<result property="employeeIdnum" column="employee_idnum"/>
<result property="province" column="province"/>
<result property="city" column="city"/>
<result property="town" column="town"/>
<result property="departName" column="DEPART_NAME"/>
<result property="customerName" column="CUSTOMER_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.actual_salary,
......@@ -39,9 +53,12 @@
a.DEPART_NAME,
a.DEPART_NO,
a.type,
a.FEEDBACK,
a.FEED_BACK,
a.CUSTOMER_NAME,
a.CUSTOMER_ID
a.CUSTOMER_ID,
a.REASON_TYPE,
a.CREATE_BY,
a.CREATE_NAME
</sql>
<sql id="sysMessageSalary_where">
<if test="sysMessageSalary != null">
......@@ -104,8 +121,7 @@
<!--sysMessageSalary简单分页查询-->
<select id="getSysMessageSalaryPage" resultMap="sysMessageSalaryMap">
SELECT
<include refid="Base_Column_List"/>,
b.*
<include refid="Base_Column_List"/>
FROM sys_message_salary a
left join t_feed_back b on a.ID=b.RELATE_ID
<where>
......@@ -158,7 +174,7 @@
employee_id,
employee_name,
employee_idnum,
salary_make_man,
create_by,
province,
city,
town,
......@@ -180,7 +196,7 @@
a.SETTLEMENT_MONTH settle_month,
sum(i.SALARY_MONEY) AS actual_salary,
sum(l.SALARY_MONEY) AS relay_Salary,
s.CREATE_USER AS salary_make_man,
s.createBy AS create_by,
min(IFNULL(t.salary_base,c.salary_base)) AS salary_base,
a.PROVINCE,
a.CITY,
......@@ -262,7 +278,7 @@
<!--noPageDiy查询-->
<select id="noPageDiy" resultMap="sysMessageSalaryMap">
<select id="noPageDiy" resultMap="sysMessageSalaryExportMap">
SELECT
<include refid="Base_Column_List"/>,
b.*
......@@ -305,7 +321,7 @@
and 1=2
</if>
</if>
<if test="settleDomainVos == null">
<if test="settleDomainIds == null">
and 1=1
</if>
<if test='sql != null and sql != ""'>
......
......@@ -12,6 +12,7 @@
<result property="settlementOrganName" column="SETTLEMENT_ORGAN_NAME"/>
<result property="settlementOrganNo" column="SETTLEMENT_ORGAN_NO"/>
<result property="feedBack" column="FEEDBACK"/>
<result property="reasonType" column="REASON_TYPE"/>
<result property="month" column="month"/>
</resultMap>
<resultMap id="haveSalaryNoSocialExportMap" type="com.yifu.cloud.plus.v1.yifu.salary.vo.THaveSalaryNoSocialExportVo">
......@@ -39,7 +40,8 @@
a.SETTLE_MONTH,
a.relay_salary,
a.FEEDBACK,
a.CREATE_NAME
a.CREATE_NAME,
a.REASON_TYPE
</sql>
<sql id="tHaveSalaryNosocial_where">
<if test="tHaveSalaryNosocial != null">
......@@ -85,13 +87,15 @@
<!--tHaveSalaryNosocial简单分页查询-->
<select id="getTHaveSalaryNosocialPage" resultMap="tHaveSalaryNosocialMap">
SELECT
a.id,
a.employee_name,
a.employee_id_card,
a.CUSTOMER_NAME,
a.SETTLEMENT_ORGAN_NAME,
a.month,
a.relay_salary,
a.CREATE_NAME
a.CREATE_NAME,
a.feed_back,a.reason_type
FROM t_have_salary_nosocial a
<include refid="querPage"/>
</select>
......@@ -209,8 +213,11 @@
<include refid="Base_Column_List"/>
,b.*
FROM t_have_salary_nosocial a
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<include refid="export_where"/>
left join t_feed_back b on a.ID=b.RELATE_ID
<where>
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<include refid="export_where"/>
</where>
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
......@@ -242,7 +249,7 @@
and 1=2
</if>
</if>
<if test="settleDomainVos == null">
<if test="settleDomainIds == null">
and 1=1
</if>
<if test='sql != null and sql != ""'>
......
......@@ -299,8 +299,9 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_account a
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="tSalaryAccount_where"/>
</where>
order by a.CREATE_TIME desc
......@@ -442,4 +443,165 @@
where a.DELETE_FLAG = 0 and a.SALARY_FORM_ID = #{salaryId} and a.SEND_STATUS = '0'
</select>
<select id="noPageDiy" resultMap="tSalaryAccountMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_account a
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="where_export"/>
ORDER BY a.CREATE_TIME desc
<if test="searchVo != null">
<if test="searchVo.limitStart != null">
limit #{searchVo.limitStart},#{searchVo.limitEnd}
</if>
</if>
</where>
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_salary_account a
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="where_export"/>
</where>
</select>
<sql id="where_export">
<if test="idList != null and idList.size>0">
AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="searchVo != null">
<if test="searchVo.id != null and searchVo.id.trim() != ''">
AND a.ID = #{searchVo.id}
</if>
<if test="searchVo.invoiceTitle != null and searchVo.invoiceTitle.trim() != ''">
AND a.INVOICE_TITLE = #{searchVo.invoiceTitle}
</if>
<if test="searchVo.salaryFormId != null and searchVo.salaryFormId.trim() != ''">
AND a.SALARY_FORM_ID = #{searchVo.salaryFormId}
</if>
<if test="searchVo.salaryMonth != null and searchVo.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{searchVo.salaryMonth}
</if>
<if test="searchVo.empId != null and searchVo.empId.trim() != ''">
AND a.EMP_ID = #{searchVo.empId}
</if>
<if test="searchVo.empName != null and searchVo.empName.trim() != ''">
AND a.EMP_NAME = #{searchVo.empName}
</if>
<if test="searchVo.empIdcard != null and searchVo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{searchVo.empIdcard}
</if>
<if test="searchVo.bankNo != null and searchVo.bankNo.trim() != ''">
AND a.BANK_NO = #{searchVo.bankNo}
</if>
<if test="searchVo.bankName != null and searchVo.bankName.trim() != ''">
AND a.BANK_NAME = #{searchVo.bankName}
</if>
<if test="searchVo.deptId != null and searchVo.deptId.trim() != ''">
AND a.DEPT_ID = #{searchVo.deptId}
</if>
<if test="searchVo.deptNo != null and searchVo.deptNo.trim() != ''">
AND a.DEPT_NO = #{searchVo.deptNo}
</if>
<if test="searchVo.deptName != null and searchVo.deptName.trim() != ''">
AND a.DEPT_NAME = #{searchVo.deptName}
</if>
<if test="searchVo.salaryStyle != null and searchVo.salaryStyle.trim() != ''">
AND a.SALARY_STYLE = #{searchVo.salaryStyle}
</if>
<if test="searchVo.salaryGiveTime != null and searchVo.salaryGiveTime.trim() != ''">
AND a.SALARY_GIVE_TIME = #{searchVo.salaryGiveTime}
</if>
<if test="searchVo.distributionFlag != null and searchVo.distributionFlag.trim() != ''">
AND a.DISTRIBUTION_FLAG = #{searchVo.distributionFlag}
</if>
<if test="searchVo.deduSocialMonth != null and searchVo.deduSocialMonth.trim() != ''">
AND a.DEDU_SOCIAL_MONTH = #{searchVo.deduSocialMonth}
</if>
<if test="searchVo.deduProvidentMonth != null and searchVo.deduProvidentMonth.trim() != ''">
AND a.DEDU_PROVIDENT_MONTH = #{searchVo.deduProvidentMonth}
</if>
<if test="searchVo.formType != null and searchVo.formType.trim() != ''">
AND a.FORM_TYPE = #{searchVo.formType}
</if>
<if test="searchVo.settlementMonth != null and searchVo.settlementMonth.trim() != ''">
AND a.SETTLEMENT_MONTH = #{searchVo.settlementMonth}
</if>
<if test="searchVo.deleteFlag != null">
AND a.DELETE_FLAG = #{searchVo.deleteFlag}
</if>
<if test="searchVo.socialPriority != null and searchVo.socialPriority.trim() != ''">
AND a.SOCIAL_PRIORITY = #{searchVo.socialPriority}
</if>
<if test="searchVo.fundPriority != null and searchVo.fundPriority.trim() != ''">
AND a.FUND_PRIORITY = #{searchVo.fundPriority}
</if>
<if test="searchVo.annualBonusType != null and searchVo.annualBonusType.trim() != ''">
AND a.ANNUAL_BONUS_TYPE = #{searchVo.annualBonusType}
</if>
<if test="searchVo.taxMonth != null and searchVo.taxMonth.trim() != ''">
AND a.TAX_MONTH = #{searchVo.taxMonth}
</if>
<if test="searchVo.isDeductSocial != null and searchVo.isDeductSocial.trim() != ''">
AND a.IS_DEDUCT_SOCIAL = #{searchVo.isDeductSocial}
</if>
<if test="searchVo.isDeductFund != null and searchVo.isDeductFund.trim() != ''">
AND a.IS_DEDUCT_FUND = #{searchVo.isDeductFund}
</if>
<if test="searchVo.province != null">
AND a.PROVINCE = #{searchVo.province}
</if>
<if test="searchVo.city != null">
AND a.CITY = #{searchVo.city}
</if>
<if test="searchVo.town != null">
AND a.TOWN = #{searchVo.town}
</if>
<if test="searchVo.empPhone != null and searchVo.empPhone.trim() != ''">
AND a.EMP_PHONE = #{searchVo.empPhone}
</if>
<if test="searchVo.ownFlag != null">
AND a.OWN_FLAG = #{searchVo.ownFlag}
</if>
<if test="searchVo.isRepeat != null">
AND a.IS_REPEAT = #{searchVo.isRepeat}
</if>
<if test="searchVo.bankSubName != null and searchVo.bankSubName.trim() != ''">
AND a.BANK_SUB_NAME = #{searchVo.bankSubName}
</if>
<if test="searchVo.bankProvince != null">
AND a.BANK_PROVINCE = #{searchVo.bankProvince}
</if>
<if test="searchVo.bankCity != null">
AND a.BANK_CITY = #{searchVo.bankCity}
</if>
<if test="searchVo.isPersonTax != null and searchVo.isPersonTax.trim() != ''">
AND a.IS_PERSON_TAX = #{searchVo.isPersonTax}
</if>
<if test="searchVo.relaySalary != null">
AND a.RELAY_SALARY = #{searchVo.relaySalary}
</if>
<if test="searchVo.actualSalary != null">
AND a.ACTUAL_SALARY = #{searchVo.actualSalary}
</if>
<if test="searchVo.salaryTax != null">
AND a.SALARY_TAX = #{searchVo.salaryTax}
</if>
<if test="searchVo.relaySalaryUnit != null">
AND a.RELAY_SALARY_UNIT = #{searchVo.relaySalaryUnit}
</if>
<if test="searchVo.salaryTaxUnit != null">
AND a.SALARY_TAX_UNIT = #{searchVo.salaryTaxUnit}
</if>
</if>
</sql>
</mapper>
......@@ -260,11 +260,23 @@
<where>
a.DELETE_FLAG = 0
<!-- 薪资是否可查看 0 是 1否-->
and d.CAN_SEE= 0
and (d.CAN_SEE = 0 OR d.id is null)
<include refid="tSalaryStandard_where"/>
</where>
ORDER BY a.CREATE_TIME desc
</select>
<!--tSalaryStandard简单分页查询-->
<select id="getTSalaryStandardPageApply" resultMap="tSalaryStandardMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_standard a
<where>
a.DELETE_FLAG = 0
<!-- 薪资是否可查看 0 是 1否-->
<include refid="tSalaryStandard_where"/>
</where>
ORDER BY a.CREATE_TIME desc
</select>
<!--tSalaryStandard简单分页查询-->
<select id="getTSalaryStandardAuditPage" resultMap="tSalaryStandardMap">
SELECT
......@@ -275,7 +287,7 @@
AND a.DELETE_FLAG = 0
<if test="tSalaryStandard != null">
<if test="tSalaryStandard.deptName != null and tSalaryStandard.deptName.trim() != ''">
AND a.DEPT_NAME like concat(#{'%',#{tSalaryStandard.deptName},'%')
AND a.DEPT_NAME = #{tSalaryStandard.deptName}
</if>
<if test="tSalaryStandard.deptNo != null and tSalaryStandard.deptNo.trim() != ''">
AND a.DEPT_NO = #{tSalaryStandard.deptNo}
......@@ -284,7 +296,7 @@
AND a.SALARY_MONTH = #{tSalaryStandard.salaryMonth}
</if>
<if test="tSalaryStandard.status == null">
AND a.STATUS = 1 OR a.STATUS = 2 or a.STATUS = 5
AND (a.STATUS = 1 OR a.STATUS = 2 or a.STATUS = 5)
</if>
<if test="tSalaryStandard.status != null">
AND a.STATUS = #{tSalaryStandard.status}
......@@ -325,15 +337,15 @@
FROM t_salary_standard a
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0 AND d.CAN_SEE = 0
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="where_export"/>
</where>
ORDER BY a.CREATE_TIME desc
<if test="searchVo != null">
<if test="searchVo.limitStart != null">
limit #{searchVo.limitStart},#{searchVo.limitEnd}
ORDER BY a.CREATE_TIME desc
<if test="searchVo != null">
<if test="searchVo.limitStart != null">
limit #{searchVo.limitStart},#{searchVo.limitEnd}
</if>
</if>
</if>
</where>
</select>
<!--tSalaryStandard简单分页查询-->
<select id="getSalaryStandardExportCount" resultType="java.lang.Integer">
......@@ -342,7 +354,7 @@
FROM t_salary_standard a
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where>
a.DELETE_FLAG = 0 AND d.CAN_SEE = 0
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="where_export"/>
</where>
</select>
......
......@@ -106,7 +106,7 @@
<!--统计-->
<select id="doStatisticsBonus" resultMap="tStatisticsBonusMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,b.UNIT_NAME DECLARE_UNIT,
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,a.INVOICE_TITLE DECLARE_UNIT,
sum(annualbonus.SALARY_MONEY) ANNUAL_BONUS,sum(tax.SALARY_MONEY) BONUS_TAX
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
......
......@@ -30,7 +30,6 @@
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empPhone" column="EMP_PHONE"/>
<result property="empStatus" column="EMP_STATUS"/>
<result property="occupationType" column="OCCUPATION_TYPE"/>
<result property="occupationMonth" column="OCCUPATION_MONTH"/>
<result property="isDeclare" column="IS_DECLARE"/>
......@@ -43,7 +42,6 @@
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_PHONE,
a.EMP_STATUS,
a.OCCUPATION_TYPE,
a.OCCUPATION_MONTH,
a.IS_DECLARE,
......@@ -69,9 +67,6 @@
<if test="tStatisticsDeclarer.empPhone != null and tStatisticsDeclarer.empPhone.trim() != ''">
AND a.EMP_PHONE = #{tStatisticsDeclarer.empPhone}
</if>
<if test="tStatisticsDeclarer.empStatus != null and tStatisticsDeclarer.empStatus.trim() != ''">
AND a.EMP_STATUS = #{tStatisticsDeclarer.empStatus}
</if>
<if test="tStatisticsDeclarer.occupationType != null and tStatisticsDeclarer.occupationType.trim() != ''">
AND a.OCCUPATION_TYPE = #{tStatisticsDeclarer.occupationType}
</if>
......@@ -100,12 +95,16 @@
<!--统计-->
<select id="doStatisticsTaxDeclarer" resultMap="tStatisticsDeclarerMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,b.FILE_STATUS EMP_STATUS,
b.UNIT_NAME DECLARE_UNIT,'雇员' OCCUPATION_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = '0' and a.SETTLEMENT_MONTH like '${lastYear}%'
GROUP BY a.EMP_IDCARD
SELECT
#{nowMonth} DECLARE_MONTH,c.EMP_NAME,c.EMP_IDCARD,c.EMP_PHONE,c.INVOICE_TITLE DECLARE_UNIT,
if(c.FORM_TYPE=0,'0',if(c.FORM_TYPE=3 or c.FORM_TYPE=4,'1','-')) OCCUPATION_TYPE FROM
(SELECT s.* FROM t_salary_account s,
(SELECT a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,a.INVOICE_TITLE,a.FORM_TYPE,MAX(CREATE_TIME) max_day,a.SETTLEMENT_MONTH,
if(a.FORM_TYPE=0,'0',if(a.FORM_TYPE=3 or a.FORM_TYPE=4,'1','-')) CUPATION_TYPE
FROM t_salary_account a WHERE a.DELETE_FLAG = '0' AND a.SETTLEMENT_MONTH = #{lastMonth}
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE,CUPATION_TYPE,a.SETTLEMENT_MONTH) b
WHERE s.DELETE_FLAG = '0' AND b.max_day = s.CREATE_TIME
AND s.EMP_IDCARD = b.EMP_IDCARD AND s.INVOICE_TITLE = b.INVOICE_TITLE
AND s.SETTLEMENT_MONTH = b.SETTLEMENT_MONTH) c
</select>
</mapper>
......@@ -92,7 +92,7 @@
<select id="doStatisticsLabor" resultMap="tStatisticsLaborMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,sum(a.ACTUAL_SALARY) INCOME,
b.UNIT_NAME DECLARE_UNIT,'一般劳务报酬所得' INCOME_ITEM,'居民身份证' CARD_TYPE
a.INVOICE_TITLE DECLARE_UNIT,'一般劳务报酬所得' INCOME_ITEM,'居民身份证' CARD_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = '1' and a.SETTLEMENT_MONTH like '${lastYear}%' and a.FORM_TYPE = '3'
......
......@@ -88,7 +88,7 @@
<select id="doStatisticsRemuneration" resultMap="tStatisticsRemunerationMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,
sum(a.ACTUAL_SALARY) INCOME,b.UNIT_NAME DECLARE_UNIT,'居民身份证' CARD_TYPE
sum(a.ACTUAL_SALARY) INCOME,a.INVOICE_TITLE DECLARE_UNIT,'居民身份证' CARD_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = '1' and a.SETTLEMENT_MONTH like '${lastYear}%' and a.FORM_TYPE = '4'
......
......@@ -88,6 +88,14 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
* */
List<TPaymentInfo> selectListForPaymentImport(@Param("months")List<String> months, @Param("idcards")List<String> idcards);
/*
* 已存在公积金缴费库数据 非删除状态
* @param months
* @param idcards
* @return
* */
List<TPaymentInfo> selectListForPaymentImport1(@Param("months")List<String> months, @Param("idcards")List<String> idcards);
/**
* 薪资获取缴费库
* @Author hgw
......
......@@ -200,8 +200,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return R.failed("已推送至结算平台禁止删除!");
}
if (CommonConstants.TWO_STRING.equals(paymentInfo.getSalaryFundFlag()) ||
CommonConstants.TWO_STRING.equals(paymentInfo.getSalarySocialFlag())) {
if (CommonConstants.ONE_STRING.equals(paymentInfo.getSalaryFundFlag()) ||
CommonConstants.ONE_STRING.equals(paymentInfo.getSalarySocialFlag())) {
return R.failed("该数据已与薪资结算,禁止删除");
}
baseMapper.deleteById(id);
......@@ -225,8 +225,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus())) {
return R.failed("存在不符合条件的数据(已推送至结算平台或非本人创建),禁止删除!");
}
if (CommonConstants.TWO_STRING.equals(paymentInfo.getSalaryFundFlag()) ||
CommonConstants.TWO_STRING.equals(paymentInfo.getSalarySocialFlag())) {
if (CommonConstants.ONE_STRING.equals(paymentInfo.getSalaryFundFlag()) ||
CommonConstants.ONE_STRING.equals(paymentInfo.getSalarySocialFlag())) {
return R.failed("存在不符合条件的数据(已与薪资结算),禁止删除");
}
baseMapper.deleteById(id);
......@@ -262,7 +262,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
for (TPaymentInfo paymentInfo : list) {
if ((!user.getId().equals(paymentInfo.getCreateBy()) &&
!CommonConstants.ONE_STRING.equals(user.getId())) ||
CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus())) {
CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus()) ||
CommonConstants.ONE_STRING.equals(paymentInfo.getSalaryFundFlag()) ||
CommonConstants.ONE_STRING.equals(paymentInfo.getSalarySocialFlag())) {
delFlag = true;
} else {
idList.add(paymentInfo.getId());
......@@ -1256,7 +1258,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<String> monthList = list.stream().map(TPaymentInfoVo::getProvidentPayMonth).collect(Collectors.toList());
//已存在社保缴费库数据 非删除状态
List<TPaymentInfo> paymentInfos = baseMapper.selectListForPaymentImport(monthList, idcards);
List<TPaymentInfo> paymentInfos = baseMapper.selectListForPaymentImport1(monthList, idcards);
//公积金唯一性检验条件:身份证编码+公积金缴纳月份
HashMap<String, Object> paymentInfoMap = new HashMap<>();
if (Common.isNotNull(paymentInfos)) {
......@@ -1348,9 +1350,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+ Math.round(BigDecimalUtils.safeAdd(infoVo.getProvidentSum()).doubleValue() * 100) / 100.0);
}
//存在公积金缴费数据
if (null != paymentInfo && ((BigDecimalUtils.isNullToZero(paymentInfo.getProvidentSum()).compareTo(BigDecimal.ZERO) != 0)
|| ((BigDecimalUtils.isNullToZero(paymentInfo.getSocialSum()).compareTo(BigDecimal.ZERO) == 0)
&& BigDecimalUtils.isNullToZero(paymentInfo.getProvidentSum()).compareTo(BigDecimal.ZERO) == 0))) {
if (null != paymentInfo && BigDecimalUtils.isNullToZero(paymentInfo.getProvidentSum()).compareTo(BigDecimal.ZERO) != 0) {
//允许覆盖,但已核准表或工资结算或已锁定不允许覆盖
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" +
......@@ -1415,7 +1415,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setProvidentNo(infoVo.getProvidentNo());
paymentInfo.setPersonalProvidentSum(null == infoVo.getUnitProvidentSum() ? BigDecimal.ZERO : infoVo.getUnitProvidentSum());
paymentInfo.setUnitProvidentSum(null == infoVo.getUnitProvidentSum() ? BigDecimal.ZERO : infoVo.getUnitProvidentSum());
paymentInfo.setProvidentSum(BigDecimalUtils.safeAdd(paymentInfo.getUnitProvidentSum(), paymentInfo.getPersonalProvidentSum()));
paymentInfo.setProvidentSum(null == infoVo.getProvidentSum() ? BigDecimal.ZERO : infoVo.getProvidentSum());
paymentInfo.setSumAll(paymentInfo.getProvidentSum());
if (null != paymentInfo && Common.isEmpty(paymentInfo.getFundId())) {
paymentInfo.setFundId(UUID.randomUUID().toString());
......
......@@ -2258,6 +2258,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
importVo.setWorkingHours(preInfo.getWorkingHoursAdd());
importVo.setEmpNational(CommonConstants.ONE_STRING);
importVo.setEducationName(CommonConstants.FIVE_STRING);
importVo.setTrustRemark("预派单");
if (null != preInfo.getPensionBase()){
importVo.setRecordBase(preInfo.getPensionBase());
}
......
......@@ -955,6 +955,25 @@
</if>
</select>
<select id="selectListForPaymentImport1" resultMap="tPaymentInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_payment_info a
where 1=1
<if test="months != null and months.size > 0">
AND a.PROVIDENT_PAY_MONTH in
<foreach item="item" index="index" collection="months" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="idcards != null and idcards.size > 0">
AND a.EMP_IDCARD IN
<foreach item="item" index="index" collection="idcards" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<!--tPaymentInfo 查询缴费库要删除的数据-->
<select id="selectListForDelete" resultType="com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo">
select
......
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