parent
ba99bbcc48
commit
fa847c94d0
|
|
@ -72,5 +72,13 @@ public class SalaryCacheKey {
|
|||
|
||||
public final static String UPLOAD_SALARY_CONFIG = "UPLOAD_SALARY_CONFIG";
|
||||
|
||||
/**
|
||||
* 欧姆龙环比报表
|
||||
*/
|
||||
public final static String OML_REPORT_YEARS = "OML_REPORT_YEARS";
|
||||
public final static String OML_REPORT_DATA = "OML_REPORT_DATA";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.salary.entity.salaryacct.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName OMLSalary2ModeInfo
|
||||
* @date 2024/12/17 14:44
|
||||
* @description
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OMLSalary2ModeInfo {
|
||||
// 建模字段数据库名
|
||||
private String modeName;
|
||||
|
||||
// 数据库字段类型
|
||||
private String type;
|
||||
|
||||
// 薪资项目名称
|
||||
private String salaryItemName;
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.engine.salary.entity.salaryacct.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName UfCjfykctzPO
|
||||
* @date 2024/12/17 16:05
|
||||
* @description 欧姆龙产假建模
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UfCjfykctzPO {
|
||||
private Integer bm;
|
||||
private String bz;
|
||||
private BigDecimal cjdkcfy;
|
||||
private BigDecimal cjfykc;
|
||||
private String cjjsrq;
|
||||
private Integer cjkcjsts;
|
||||
private String cjkcssyf;
|
||||
private String cjkcyf;
|
||||
private BigDecimal cjkczje;
|
||||
private String cjksrq;
|
||||
private String formBizId;
|
||||
private Integer formmodeid;
|
||||
private String gh;
|
||||
private String hzcsrq;
|
||||
private Integer id;
|
||||
private Integer kczt;
|
||||
private BigDecimal ljkcje;
|
||||
private String modedatacreatedate;
|
||||
private Integer modedatacreater;
|
||||
private Integer modedatacreatertype;
|
||||
private String modedatacreatetime;
|
||||
private Integer modedatamodifier;
|
||||
private String modedatamodifydatetime;
|
||||
private String modeuuid;
|
||||
private BigDecimal mycjkcfy;
|
||||
private BigDecimal qyztcrycgwkhjb;
|
||||
private Integer requestId;
|
||||
private Integer scfs;
|
||||
private BigDecimal syje;
|
||||
private String syjsrq;
|
||||
private String syksrq;
|
||||
private Integer xm;
|
||||
private String ycq;
|
||||
private BigDecimal zjgzjcyx;
|
||||
private BigDecimal zngz;
|
||||
|
||||
private String hsjlid;
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.engine.salary.mapper.salaryacct;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.po.UfCjfykctzPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName UfCjfykctzMapper
|
||||
* @date 2024/12/17 16:06
|
||||
* @description 欧姆龙 - 产假建模
|
||||
*/
|
||||
public interface UfCjfykctzMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<UfCjfykctzPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<UfCjfykctzPO> listSome(UfCjfykctzPO ufCjfykctz);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
UfCjfykctzPO getById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param ufCjfykctz 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(UfCjfykctzPO ufCjfykctz);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param ufCjfykctz 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(UfCjfykctzPO ufCjfykctz);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param ufCjfykctz 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(UfCjfykctzPO ufCjfykctz);
|
||||
|
||||
|
||||
List<UfCjfykctzPO> listBycjkcyf(@Param("salaryMonth") String salaryMonth, @Param("empIdList")List<Long> empIdList);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,595 @@
|
|||
<?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.engine.salary.mapper.salaryacct.UfCjfykctzMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryacct.po.UfCjfykctzPO">
|
||||
<result column="bm" property="bm" />
|
||||
<result column="bz" property="bz" />
|
||||
<result column="cjdkcfy" property="cjdkcfy" />
|
||||
<result column="cjfykc" property="cjfykc" />
|
||||
<result column="cjjsrq" property="cjjsrq" />
|
||||
<result column="cjkcjsts" property="cjkcjsts" />
|
||||
<result column="cjkcssyf" property="cjkcssyf" />
|
||||
<result column="cjkcyf" property="cjkcyf" />
|
||||
<result column="cjkczje" property="cjkczje" />
|
||||
<result column="cjksrq" property="cjksrq" />
|
||||
<result column="form_biz_id" property="formBizId" />
|
||||
<result column="formmodeid" property="formmodeid" />
|
||||
<result column="gh" property="gh" />
|
||||
<result column="hzcsrq" property="hzcsrq" />
|
||||
<result column="id" property="id" />
|
||||
<result column="kczt" property="kczt" />
|
||||
<result column="ljkcje" property="ljkcje" />
|
||||
<result column="modedatacreatedate" property="modedatacreatedate" />
|
||||
<result column="modedatacreater" property="modedatacreater" />
|
||||
<result column="modedatacreatertype" property="modedatacreatertype" />
|
||||
<result column="modedatacreatetime" property="modedatacreatetime" />
|
||||
<result column="modedatamodifier" property="modedatamodifier" />
|
||||
<result column="modedatamodifydatetime" property="modedatamodifydatetime" />
|
||||
<result column="MODEUUID" property="modeuuid" />
|
||||
<result column="mycjkcfy" property="mycjkcfy" />
|
||||
<result column="qyztcrycgwkhjb" property="qyztcrycgwkhjb" />
|
||||
<result column="requestId" property="requestId" />
|
||||
<result column="scfs" property="scfs" />
|
||||
<result column="syje" property="syje" />
|
||||
<result column="syjsrq" property="syjsrq" />
|
||||
<result column="syksrq" property="syksrq" />
|
||||
<result column="xm" property="xm" />
|
||||
<result column="ycq" property="ycq" />
|
||||
<result column="zjgzjcyx" property="zjgzjcyx" />
|
||||
<result column="zngz" property="zngz" />
|
||||
<result column="hsjlid" property="hsjlid" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.bm
|
||||
, t.bz
|
||||
, t.cjdkcfy
|
||||
, t.cjfykc
|
||||
, t.cjjsrq
|
||||
, t.cjkcjsts
|
||||
, t.cjkcssyf
|
||||
, t.cjkcyf
|
||||
, t.cjkczje
|
||||
, t.cjksrq
|
||||
, t.form_biz_id
|
||||
, t.formmodeid
|
||||
, t.gh
|
||||
, t.hzcsrq
|
||||
, t.id
|
||||
, t.kczt
|
||||
, t.ljkcje
|
||||
, t.modedatacreatedate
|
||||
, t.modedatacreater
|
||||
, t.modedatacreatertype
|
||||
, t.modedatacreatetime
|
||||
, t.modedatamodifier
|
||||
, t.modedatamodifydatetime
|
||||
, t.MODEUUID
|
||||
, t.mycjkcfy
|
||||
, t.qyztcrycgwkhjb
|
||||
, t.requestId
|
||||
, t.scfs
|
||||
, t.syje
|
||||
, t.syjsrq
|
||||
, t.syksrq
|
||||
, t.xm
|
||||
, t.ycq
|
||||
, t.zjgzjcyx
|
||||
, t.zngz
|
||||
, t.hsjlid
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM uf_cjfykctz t
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Integer">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM uf_cjfykctz t
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.salaryacct.po.UfCjfykctzPO">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM uf_cjfykctz t
|
||||
WHERE 1 = 1
|
||||
<if test="bm != null">
|
||||
AND bm = #{bm}
|
||||
</if>
|
||||
<if test="bz != null">
|
||||
AND bz = #{bz}
|
||||
</if>
|
||||
<if test="cjdkcfy != null">
|
||||
AND cjdkcfy = #{cjdkcfy}
|
||||
</if>
|
||||
<if test="cjfykc != null">
|
||||
AND cjfykc = #{cjfykc}
|
||||
</if>
|
||||
<if test="cjjsrq != null">
|
||||
AND cjjsrq = #{cjjsrq}
|
||||
</if>
|
||||
<if test="cjkcjsts != null">
|
||||
AND cjkcjsts = #{cjkcjsts}
|
||||
</if>
|
||||
<if test="cjkcssyf != null">
|
||||
AND cjkcssyf = #{cjkcssyf}
|
||||
</if>
|
||||
<if test="cjkcyf != null">
|
||||
AND cjkcyf = #{cjkcyf}
|
||||
</if>
|
||||
<if test="cjkczje != null">
|
||||
AND cjkczje = #{cjkczje}
|
||||
</if>
|
||||
<if test="cjksrq != null">
|
||||
AND cjksrq = #{cjksrq}
|
||||
</if>
|
||||
<if test="formBizId != null">
|
||||
AND form_biz_id = #{formBizId}
|
||||
</if>
|
||||
<if test="formmodeid != null">
|
||||
AND formmodeid = #{formmodeid}
|
||||
</if>
|
||||
<if test="gh != null">
|
||||
AND gh = #{gh}
|
||||
</if>
|
||||
<if test="hzcsrq != null">
|
||||
AND hzcsrq = #{hzcsrq}
|
||||
</if>
|
||||
<if test="kczt != null">
|
||||
AND kczt = #{kczt}
|
||||
</if>
|
||||
<if test="ljkcje != null">
|
||||
AND ljkcje = #{ljkcje}
|
||||
</if>
|
||||
<if test="modedatacreatedate != null">
|
||||
AND modedatacreatedate = #{modedatacreatedate}
|
||||
</if>
|
||||
<if test="modedatacreater != null">
|
||||
AND modedatacreater = #{modedatacreater}
|
||||
</if>
|
||||
<if test="modedatacreatertype != null">
|
||||
AND modedatacreatertype = #{modedatacreatertype}
|
||||
</if>
|
||||
<if test="modedatacreatetime != null">
|
||||
AND modedatacreatetime = #{modedatacreatetime}
|
||||
</if>
|
||||
<if test="modedatamodifier != null">
|
||||
AND modedatamodifier = #{modedatamodifier}
|
||||
</if>
|
||||
<if test="modedatamodifydatetime != null">
|
||||
AND modedatamodifydatetime = #{modedatamodifydatetime}
|
||||
</if>
|
||||
<if test="modeuuid != null">
|
||||
AND MODEUUID = #{modeuuid}
|
||||
</if>
|
||||
<if test="mycjkcfy != null">
|
||||
AND mycjkcfy = #{mycjkcfy}
|
||||
</if>
|
||||
<if test="qyztcrycgwkhjb != null">
|
||||
AND qyztcrycgwkhjb = #{qyztcrycgwkhjb}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND requestId = #{requestId}
|
||||
</if>
|
||||
<if test="scfs != null">
|
||||
AND scfs = #{scfs}
|
||||
</if>
|
||||
<if test="syje != null">
|
||||
AND syje = #{syje}
|
||||
</if>
|
||||
<if test="syjsrq != null">
|
||||
AND syjsrq = #{syjsrq}
|
||||
</if>
|
||||
<if test="syksrq != null">
|
||||
AND syksrq = #{syksrq}
|
||||
</if>
|
||||
<if test="xm != null">
|
||||
AND xm = #{xm}
|
||||
</if>
|
||||
<if test="ycq != null">
|
||||
AND ycq = #{ycq}
|
||||
</if>
|
||||
<if test="zjgzjcyx != null">
|
||||
AND zjgzjcyx = #{zjgzjcyx}
|
||||
</if>
|
||||
<if test="zngz != null">
|
||||
AND zngz = #{zngz}
|
||||
</if>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<select id="listBycjkcyf" resultType="com.engine.salary.entity.salaryacct.po.UfCjfykctzPO">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM uf_cjfykctz t
|
||||
WHERE #{salaryMonth} <![CDATA[ <= ]]> cjkcyf
|
||||
AND xm IN
|
||||
<foreach collection="empIdList" open="(" item="empId" separator="," close=")">
|
||||
#{empId}
|
||||
</foreach>
|
||||
AND xm not in (select distinct xm from uf_cjfykctz where kczt=1)
|
||||
</select>
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salaryacct.po.UfCjfykctzPO">
|
||||
INSERT INTO uf_cjfykctz
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="bm != null">
|
||||
bm,
|
||||
</if>
|
||||
<if test="bz != null">
|
||||
bz,
|
||||
</if>
|
||||
<if test="cjdkcfy != null">
|
||||
cjdkcfy,
|
||||
</if>
|
||||
<if test="cjfykc != null">
|
||||
cjfykc,
|
||||
</if>
|
||||
<if test="cjjsrq != null">
|
||||
cjjsrq,
|
||||
</if>
|
||||
<if test="cjkcjsts != null">
|
||||
cjkcjsts,
|
||||
</if>
|
||||
<if test="cjkcssyf != null">
|
||||
cjkcssyf,
|
||||
</if>
|
||||
<if test="cjkcyf != null">
|
||||
cjkcyf,
|
||||
</if>
|
||||
<if test="cjkczje != null">
|
||||
cjkczje,
|
||||
</if>
|
||||
<if test="cjksrq != null">
|
||||
cjksrq,
|
||||
</if>
|
||||
<if test="formBizId != null">
|
||||
form_biz_id,
|
||||
</if>
|
||||
<if test="formmodeid != null">
|
||||
formmodeid,
|
||||
</if>
|
||||
<if test="gh != null">
|
||||
gh,
|
||||
</if>
|
||||
<if test="hzcsrq != null">
|
||||
hzcsrq,
|
||||
</if>
|
||||
<if test="kczt != null">
|
||||
kczt,
|
||||
</if>
|
||||
<if test="ljkcje != null">
|
||||
ljkcje,
|
||||
</if>
|
||||
<if test="modedatacreatedate != null">
|
||||
modedatacreatedate,
|
||||
</if>
|
||||
<if test="modedatacreater != null">
|
||||
modedatacreater,
|
||||
</if>
|
||||
<if test="modedatacreatertype != null">
|
||||
modedatacreatertype,
|
||||
</if>
|
||||
<if test="modedatacreatetime != null">
|
||||
modedatacreatetime,
|
||||
</if>
|
||||
<if test="modedatamodifier != null">
|
||||
modedatamodifier,
|
||||
</if>
|
||||
<if test="modedatamodifydatetime != null">
|
||||
modedatamodifydatetime,
|
||||
</if>
|
||||
<if test="modeuuid != null">
|
||||
MODEUUID,
|
||||
</if>
|
||||
<if test="mycjkcfy != null">
|
||||
mycjkcfy,
|
||||
</if>
|
||||
<if test="qyztcrycgwkhjb != null">
|
||||
qyztcrycgwkhjb,
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
requestId,
|
||||
</if>
|
||||
<if test="scfs != null">
|
||||
scfs,
|
||||
</if>
|
||||
<if test="syje != null">
|
||||
syje,
|
||||
</if>
|
||||
<if test="syjsrq != null">
|
||||
syjsrq,
|
||||
</if>
|
||||
<if test="syksrq != null">
|
||||
syksrq,
|
||||
</if>
|
||||
<if test="xm != null">
|
||||
xm,
|
||||
</if>
|
||||
<if test="ycq != null">
|
||||
ycq,
|
||||
</if>
|
||||
<if test="zjgzjcyx != null">
|
||||
zjgzjcyx,
|
||||
</if>
|
||||
<if test="zngz != null">
|
||||
zngz,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="bm != null" >
|
||||
#{bm},
|
||||
</if>
|
||||
<if test="bz != null" >
|
||||
#{bz},
|
||||
</if>
|
||||
<if test="cjdkcfy != null" >
|
||||
#{cjdkcfy},
|
||||
</if>
|
||||
<if test="cjfykc != null" >
|
||||
#{cjfykc},
|
||||
</if>
|
||||
<if test="cjjsrq != null" >
|
||||
#{cjjsrq},
|
||||
</if>
|
||||
<if test="cjkcjsts != null" >
|
||||
#{cjkcjsts},
|
||||
</if>
|
||||
<if test="cjkcssyf != null" >
|
||||
#{cjkcssyf},
|
||||
</if>
|
||||
<if test="cjkcyf != null" >
|
||||
#{cjkcyf},
|
||||
</if>
|
||||
<if test="cjkczje != null" >
|
||||
#{cjkczje},
|
||||
</if>
|
||||
<if test="cjksrq != null" >
|
||||
#{cjksrq},
|
||||
</if>
|
||||
<if test="formBizId != null" >
|
||||
#{formBizId},
|
||||
</if>
|
||||
<if test="formmodeid != null" >
|
||||
#{formmodeid},
|
||||
</if>
|
||||
<if test="gh != null" >
|
||||
#{gh},
|
||||
</if>
|
||||
<if test="hzcsrq != null" >
|
||||
#{hzcsrq},
|
||||
</if>
|
||||
<if test="kczt != null" >
|
||||
#{kczt},
|
||||
</if>
|
||||
<if test="ljkcje != null" >
|
||||
#{ljkcje},
|
||||
</if>
|
||||
<if test="modedatacreatedate != null" >
|
||||
#{modedatacreatedate},
|
||||
</if>
|
||||
<if test="modedatacreater != null" >
|
||||
#{modedatacreater},
|
||||
</if>
|
||||
<if test="modedatacreatertype != null" >
|
||||
#{modedatacreatertype},
|
||||
</if>
|
||||
<if test="modedatacreatetime != null" >
|
||||
#{modedatacreatetime},
|
||||
</if>
|
||||
<if test="modedatamodifier != null" >
|
||||
#{modedatamodifier},
|
||||
</if>
|
||||
<if test="modedatamodifydatetime != null" >
|
||||
#{modedatamodifydatetime},
|
||||
</if>
|
||||
<if test="modeuuid != null" >
|
||||
#{modeuuid},
|
||||
</if>
|
||||
<if test="mycjkcfy != null" >
|
||||
#{mycjkcfy},
|
||||
</if>
|
||||
<if test="qyztcrycgwkhjb != null" >
|
||||
#{qyztcrycgwkhjb},
|
||||
</if>
|
||||
<if test="requestId != null" >
|
||||
#{requestId},
|
||||
</if>
|
||||
<if test="scfs != null" >
|
||||
#{scfs},
|
||||
</if>
|
||||
<if test="syje != null" >
|
||||
#{syje},
|
||||
</if>
|
||||
<if test="syjsrq != null" >
|
||||
#{syjsrq},
|
||||
</if>
|
||||
<if test="syksrq != null" >
|
||||
#{syksrq},
|
||||
</if>
|
||||
<if test="xm != null" >
|
||||
#{xm},
|
||||
</if>
|
||||
<if test="ycq != null" >
|
||||
#{ycq},
|
||||
</if>
|
||||
<if test="zjgzjcyx != null" >
|
||||
#{zjgzjcyx},
|
||||
</if>
|
||||
<if test="zngz != null" >
|
||||
#{zngz},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salaryacct.po.UfCjfykctzPO">
|
||||
UPDATE uf_cjfykctz
|
||||
<set>
|
||||
bm=#{bm},
|
||||
bz=#{bz},
|
||||
cjdkcfy=#{cjdkcfy},
|
||||
cjfykc=#{cjfykc},
|
||||
cjjsrq=#{cjjsrq},
|
||||
cjkcjsts=#{cjkcjsts},
|
||||
cjkcssyf=#{cjkcssyf},
|
||||
cjkcyf=#{cjkcyf},
|
||||
cjkczje=#{cjkczje},
|
||||
cjksrq=#{cjksrq},
|
||||
form_biz_id=#{formBizId},
|
||||
formmodeid=#{formmodeid},
|
||||
gh=#{gh},
|
||||
hzcsrq=#{hzcsrq},
|
||||
kczt=#{kczt},
|
||||
ljkcje=#{ljkcje},
|
||||
modedatacreatedate=#{modedatacreatedate},
|
||||
modedatacreater=#{modedatacreater},
|
||||
modedatacreatertype=#{modedatacreatertype},
|
||||
modedatacreatetime=#{modedatacreatetime},
|
||||
modedatamodifier=#{modedatamodifier},
|
||||
modedatamodifydatetime=#{modedatamodifydatetime},
|
||||
MODEUUID=#{modeuuid},
|
||||
mycjkcfy=#{mycjkcfy},
|
||||
qyztcrycgwkhjb=#{qyztcrycgwkhjb},
|
||||
requestId=#{requestId},
|
||||
scfs=#{scfs},
|
||||
syje=#{syje},
|
||||
syjsrq=#{syjsrq},
|
||||
syksrq=#{syksrq},
|
||||
xm=#{xm},
|
||||
ycq=#{ycq},
|
||||
zjgzjcyx=#{zjgzjcyx},
|
||||
zngz=#{zngz},
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryacct.po.UfCjfykctzPO">
|
||||
UPDATE uf_cjfykctz
|
||||
<set>
|
||||
<if test="bm != null" >
|
||||
bm=#{bm},
|
||||
</if>
|
||||
<if test="bz != null" >
|
||||
bz=#{bz},
|
||||
</if>
|
||||
<if test="cjdkcfy != null" >
|
||||
cjdkcfy=#{cjdkcfy},
|
||||
</if>
|
||||
<if test="cjfykc != null" >
|
||||
cjfykc=#{cjfykc},
|
||||
</if>
|
||||
<if test="cjjsrq != null" >
|
||||
cjjsrq=#{cjjsrq},
|
||||
</if>
|
||||
<if test="cjkcjsts != null" >
|
||||
cjkcjsts=#{cjkcjsts},
|
||||
</if>
|
||||
<if test="cjkcssyf != null" >
|
||||
cjkcssyf=#{cjkcssyf},
|
||||
</if>
|
||||
<if test="cjkcyf != null" >
|
||||
cjkcyf=#{cjkcyf},
|
||||
</if>
|
||||
<if test="cjkczje != null" >
|
||||
cjkczje=#{cjkczje},
|
||||
</if>
|
||||
<if test="cjksrq != null" >
|
||||
cjksrq=#{cjksrq},
|
||||
</if>
|
||||
<if test="formBizId != null" >
|
||||
form_biz_id=#{formBizId},
|
||||
</if>
|
||||
<if test="formmodeid != null" >
|
||||
formmodeid=#{formmodeid},
|
||||
</if>
|
||||
<if test="gh != null" >
|
||||
gh=#{gh},
|
||||
</if>
|
||||
<if test="hzcsrq != null" >
|
||||
hzcsrq=#{hzcsrq},
|
||||
</if>
|
||||
<if test="kczt != null" >
|
||||
kczt=#{kczt},
|
||||
</if>
|
||||
<if test="ljkcje != null" >
|
||||
ljkcje=#{ljkcje},
|
||||
</if>
|
||||
<if test="modedatacreatedate != null" >
|
||||
modedatacreatedate=#{modedatacreatedate},
|
||||
</if>
|
||||
<if test="modedatacreater != null" >
|
||||
modedatacreater=#{modedatacreater},
|
||||
</if>
|
||||
<if test="modedatacreatertype != null" >
|
||||
modedatacreatertype=#{modedatacreatertype},
|
||||
</if>
|
||||
<if test="modedatacreatetime != null" >
|
||||
modedatacreatetime=#{modedatacreatetime},
|
||||
</if>
|
||||
<if test="modedatamodifier != null" >
|
||||
modedatamodifier=#{modedatamodifier},
|
||||
</if>
|
||||
<if test="modedatamodifydatetime != null" >
|
||||
modedatamodifydatetime=#{modedatamodifydatetime},
|
||||
</if>
|
||||
<if test="modeuuid != null" >
|
||||
MODEUUID=#{modeuuid},
|
||||
</if>
|
||||
<if test="mycjkcfy != null" >
|
||||
mycjkcfy=#{mycjkcfy},
|
||||
</if>
|
||||
<if test="qyztcrycgwkhjb != null" >
|
||||
qyztcrycgwkhjb=#{qyztcrycgwkhjb},
|
||||
</if>
|
||||
<if test="requestId != null" >
|
||||
requestId=#{requestId},
|
||||
</if>
|
||||
<if test="scfs != null" >
|
||||
scfs=#{scfs},
|
||||
</if>
|
||||
<if test="syje != null" >
|
||||
syje=#{syje},
|
||||
</if>
|
||||
<if test="syjsrq != null" >
|
||||
syjsrq=#{syjsrq},
|
||||
</if>
|
||||
<if test="syksrq != null" >
|
||||
syksrq=#{syksrq},
|
||||
</if>
|
||||
<if test="xm != null" >
|
||||
xm=#{xm},
|
||||
</if>
|
||||
<if test="ycq != null" >
|
||||
ycq=#{ycq},
|
||||
</if>
|
||||
<if test="zjgzjcyx != null" >
|
||||
zjgzjcyx=#{zjgzjcyx},
|
||||
</if>
|
||||
<if test="zngz != null" >
|
||||
zngz=#{zngz},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -567,6 +567,20 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
getSalaryCacheService(user).remove(SalaryCacheKey.SALARY_REPORT_IDS);
|
||||
}
|
||||
|
||||
// 清除欧姆龙报表缓存
|
||||
String omlReportYearStr = Utils.null2String(getSalaryCacheService(user).get(SalaryCacheKey.OML_REPORT_YEARS));
|
||||
if (StringUtils.isNotBlank(omlReportYearStr)) {
|
||||
Arrays.asList(omlReportYearStr.split(",")).forEach(year -> {
|
||||
if (StringUtils.isNotBlank(year)) {
|
||||
//报表下数据
|
||||
Object omlReportData = getSalaryCacheService(user).get(SalaryCacheKey.OML_REPORT_DATA +"_"+ year);
|
||||
if (omlReportData != null) {
|
||||
getSalaryCacheService(user).remove(SalaryCacheKey.OML_REPORT_DATA +"_"+ year);
|
||||
}
|
||||
}
|
||||
});
|
||||
getSalaryCacheService(user).remove(SalaryCacheKey.OML_REPORT_YEARS);
|
||||
}
|
||||
}
|
||||
|
||||
public List getReportCache() {
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ public interface SalaryAcctResultService {
|
|||
* @param salaryItemIds 薪资项目id
|
||||
* @return
|
||||
*/
|
||||
List<SalaryAcctResultPO> listBySalaryAcctRecordIdsAndSalaryItemIds(Collection<Long> salaryAcctRecordIds, Collection<Long> salaryItemIds);
|
||||
List<SalaryAcctResultPO> listBySalaryAcctRecordIdsAndSalaryItemIds(List<Long> salaryAcctRecordIds, Collection<Long> salaryItemIds);
|
||||
|
||||
/**
|
||||
* @description 根据薪资核算人员id、薪资项目id获取薪资核算结果
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.po.UfCjfykctzPO;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName UfCjfykctzService
|
||||
* @date 2024/12/17 16:09
|
||||
* @description 欧姆龙 产假建模
|
||||
*/
|
||||
public interface UfCjfykctzService {
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<UfCjfykctzPO> listAll();
|
||||
|
||||
|
||||
List<UfCjfykctzPO> listAll(UfCjfykctzPO ufCjfykctz);
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
UfCjfykctzPO getById(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param ufCjfykctz 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(UfCjfykctzPO ufCjfykctz);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param ufCjfykctz 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(UfCjfykctzPO ufCjfykctz);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param ufCjfykctz 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(UfCjfykctzPO ufCjfykctz);
|
||||
|
||||
|
||||
/**
|
||||
* 获取建模中满足条件需要推送的数据
|
||||
* @param salaryMonth
|
||||
* @return
|
||||
*/
|
||||
List<UfCjfykctzPO> listNeedPushData(Date salaryMonth, List<Long> empIdList);
|
||||
}
|
||||
|
|
@ -3,16 +3,19 @@ package com.engine.salary.service.impl;
|
|||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO;
|
||||
import com.engine.salary.entity.salaryacct.dto.OMLSalary2ModeInfo;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryacct.po.UfCjfykctzPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
|
|
@ -27,6 +30,7 @@ import com.engine.salary.service.*;
|
|||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
|
@ -34,11 +38,17 @@ import com.engine.salary.util.db.MapperProxyFactory;
|
|||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.weaver.general.TimeUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -112,6 +122,14 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryItemService getSalaryItemService(User user) {
|
||||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private UfCjfykctzService getUfCjfykctzService(User user) {
|
||||
return ServiceUtil.getService(UfCjfykctzServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SalaryAcctRecordPO getById(Long id) {
|
||||
|
|
@ -572,6 +590,9 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
//删除报表缓存
|
||||
getSalaryStatisticsReportService(user).removeReportCache();
|
||||
|
||||
// 欧姆龙二开 - 产假数据推送至建模
|
||||
handelOMLPushData(salaryAcctRecordPO);
|
||||
|
||||
|
||||
// 记录日志
|
||||
String targetName = getLogTargetNameById(salaryAcctRecordId);
|
||||
|
|
@ -586,6 +607,169 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* 欧姆龙二开 - 产假数据推送至建模
|
||||
*
|
||||
* @param salaryAcctRecordPO
|
||||
*/
|
||||
private void handelOMLPushData(SalaryAcctRecordPO salaryAcctRecordPO) {
|
||||
BaseBean baseBean = new BaseBean();
|
||||
RecordSet recordSet = new RecordSet();
|
||||
String formModeId = baseBean.getPropValue("omlSalaryReport", "cj_form_mode_id");
|
||||
Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log"));
|
||||
// 获取薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId());
|
||||
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listAll();
|
||||
Map<String, Long> allSalaryItemMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getName, SalaryItemPO::getId);
|
||||
|
||||
String currDate = TimeUtil.getCurrentDateString();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
||||
String currTime = sdf.format(new Date());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOS)) {
|
||||
String formatYearMonth = SalaryDateUtil.getFormatYearMonth(salaryAcctRecordPO.getSalaryMonth());
|
||||
// 获取同步薪资项目信息
|
||||
String syncSetting = baseBean.getPropValue("omlSalaryReport", "syncInfo");
|
||||
try {
|
||||
syncSetting = new String(syncSetting.getBytes("ISO-8859-1"), "UTF-8");
|
||||
} catch (Exception e) {
|
||||
baseBean.writeLog("字符转换有误" + e.getMessage());
|
||||
}
|
||||
List<OMLSalary2ModeInfo> omlSyncInfo = JsonUtil.parseList(syncSetting, OMLSalary2ModeInfo.class);
|
||||
List<String> salaryItemNames = omlSyncInfo.stream().map(OMLSalary2ModeInfo::getSalaryItemName).collect(Collectors.toList());
|
||||
salaryItemPOList = salaryItemPOList.stream().filter(item -> salaryItemNames.contains(item.getName())).collect(Collectors.toList());
|
||||
if (isLog) {
|
||||
baseBean.writeLog("欧姆龙薪酬转建模 薪资项目" + salaryItemPOList.toString());
|
||||
}
|
||||
|
||||
// 获取建模中满足条件需要推送的数据
|
||||
List<Long> empIdList = salaryAcctEmployeePOS.stream().map(SalaryAcctEmployeePO::getEmployeeId).collect(Collectors.toList());
|
||||
List<UfCjfykctzPO> needPushList = getUfCjfykctzService(user).listNeedPushData(salaryAcctRecordPO.getSalaryMonth(), empIdList);
|
||||
Map<Long, List<UfCjfykctzPO>> pushPOGroupByXm = SalaryEntityUtil.group2Map(needPushList, po -> Long.valueOf(po.getXm()));
|
||||
// 获取薪资核算数据
|
||||
List<SalaryAcctEmployeePO> needPushSalaryAcctEmpList = salaryAcctEmployeePOS.stream().filter(acctEmp -> pushPOGroupByXm.keySet().contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
||||
List<Long> salaryAcctEmpIds = needPushSalaryAcctEmpList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
List<Long> salaryItemIds = salaryItemPOList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
List<SalaryAcctResultPO> resultPOList = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, salaryItemIds);
|
||||
Map<Long, List<SalaryAcctResultPO>> resultGroupByEmp = SalaryEntityUtil.group2Map(resultPOList, SalaryAcctResultPO::getEmployeeId);
|
||||
String salaryAcctRecordStr = salaryAcctRecordPO.getId().toString();
|
||||
|
||||
for (Map.Entry<Long, List<UfCjfykctzPO>> entry : pushPOGroupByXm.entrySet()) {
|
||||
List<UfCjfykctzPO> existDataList = entry.getValue();
|
||||
Long empId = entry.getKey();
|
||||
int mainId = 0;
|
||||
// 获取本次薪资核算数据
|
||||
List<SalaryAcctResultPO> acctResultPOList = resultGroupByEmp.getOrDefault(empId, Collections.emptyList());
|
||||
Map<Long, String> acctResultMap = SalaryEntityUtil.convert2Map(acctResultPOList, SalaryAcctResultPO::getSalaryItemId, result -> Util.null2String(result.getResultValue()));
|
||||
// 是否是该核算记录的重新归档
|
||||
Optional<UfCjfykctzPO> reFileOptional = existDataList.stream().filter(existData -> StringUtils.isNotBlank(existData.getHsjlid()) && existData.getHsjlid().equals(salaryAcctRecordStr)).findFirst();
|
||||
if (existDataList.size() == 1 || reFileOptional.isPresent()) {
|
||||
UfCjfykctzPO existData;
|
||||
if (reFileOptional.isPresent()) {
|
||||
existData = reFileOptional.get();
|
||||
} else {
|
||||
existData = existDataList.get(0);
|
||||
}
|
||||
mainId = existData.getId();
|
||||
if (StringUtils.isBlank(existData.getCjkcssyf()) || reFileOptional.isPresent()) {
|
||||
// 如果该员工只有一条数据,且产假扣除所属月份没有值,则执行更新
|
||||
StringBuilder updateSql = new StringBuilder("update uf_cjfykctz set cjkcssyf = '" + formatYearMonth + "',hsjlid="+salaryAcctRecordPO.getId());
|
||||
for (OMLSalary2ModeInfo syncInfo : omlSyncInfo) {
|
||||
Long salaryItemId = allSalaryItemMap.getOrDefault(syncInfo.getSalaryItemName(), 0L);
|
||||
String value = Util.null2String(acctResultMap.get(salaryItemId));
|
||||
// 获取建模中字段类型
|
||||
if (syncInfo.getType().equals("int")) {
|
||||
updateSql.append("," + syncInfo.getModeName() + "=" + (StringUtils.isEmpty(value) ? 0 : value));
|
||||
} else if (syncInfo.getType().equals("bigDecimal")) {
|
||||
updateSql.append("," + syncInfo.getModeName() + "=" + (StringUtils.isEmpty(value) || !NumberUtils.isCreatable(value.trim().toString()) ? 0.00 : value.trim()));
|
||||
} else {
|
||||
updateSql.append("," + syncInfo.getModeName() + "=" + (StringUtils.isEmpty(value) ? "''" : "'" + value + "'"));
|
||||
}
|
||||
}
|
||||
updateSql.append("where id ="+mainId);
|
||||
if (isLog) {
|
||||
baseBean.writeLog("欧姆龙薪酬转建模 该员工只有一条数据" + updateSql.toString());
|
||||
}
|
||||
recordSet.execute(updateSql.toString());
|
||||
} else {
|
||||
// 如果该员工只有一条数据,但是产假扣除所属月份有值,则执行新增
|
||||
StringBuilder insertSql = new StringBuilder("insert into uf_cjfykctz (hsjlid,formmodeid,modedatacreater,modedatacreatertype,modedatacreatedate,modedatacreatetime,cjkcyf,xm,gh,bm,")
|
||||
.append("cjfykc,bz,ycq,hzcsrq,cjksrq,cjjsrq,syksrq,syjsrq,scfs,cjkcjsts,zjgzjcyx,zngz,qyztcrycgwkhjb,cjkcssyf,")
|
||||
.append(omlSyncInfo.stream().map(OMLSalary2ModeInfo::getModeName).collect(Collectors.joining(",")))
|
||||
.append(") VALUES (" +salaryAcctRecordPO.getId() + ","+ formModeId + ",1,0,'" + currDate + "','" + currTime+"','"+existData.getCjkcyf()+"',"+existData.getXm())
|
||||
.append(",'"+existData.getGh()+"',"+existData.getBm()+","+existData.getCjfykc()+",'"+existData.getBz()+"','"+existData.getYcq()+"'")
|
||||
.append(",'"+existData.getHzcsrq()+"','"+existData.getCjksrq()+"','"+existData.getCjjsrq()+"','"+existData.getSyksrq()+"','"+existData.getSyjsrq()+"'")
|
||||
.append(","+existData.getScfs()+","+existData.getCjkcjsts()+","+existData.getZjgzjcyx()+","+existData.getZngz()+","+existData.getQyztcrycgwkhjb())
|
||||
.append(",'"+formatYearMonth+"'");
|
||||
// 动态推送列
|
||||
for(int i = 0; i < omlSyncInfo.size(); i++) {
|
||||
OMLSalary2ModeInfo syncInfo = omlSyncInfo.get(i);
|
||||
Long salaryItemId = allSalaryItemMap.getOrDefault(syncInfo.getSalaryItemName(), 0L);
|
||||
String value = Util.null2String(acctResultMap.get(salaryItemId));
|
||||
if (syncInfo.getType().equals("int")) {
|
||||
insertSql.append("," + (StringUtils.isEmpty(value) ? 0 : value));
|
||||
} else if (syncInfo.getType().equals("bigDecimal")) {
|
||||
insertSql.append("," + (StringUtils.isEmpty(value) || !NumberUtils.isCreatable(value.trim().toString()) ? 0.00 : value.trim()));
|
||||
} else {
|
||||
insertSql.append("," + (StringUtils.isEmpty(value) ? "''" : "'" + value + "'"));
|
||||
}
|
||||
}
|
||||
insertSql.append(")");
|
||||
recordSet.execute(insertSql.toString());
|
||||
if (isLog) {
|
||||
baseBean.writeLog("该员工只有一条数据,但是产假扣除所属月份有值" + insertSql.toString());
|
||||
}
|
||||
recordSet.execute("select max(id) as max from uf_cjfykctz");
|
||||
if (recordSet.next()) {
|
||||
mainId = recordSet.getInt("max");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 如果该员工不止一条数据,则执行新增
|
||||
Optional<UfCjfykctzPO> existDataOptional = existDataList.stream().filter(po -> StringUtils.isNotBlank(po.getCjkcssyf())).findFirst();
|
||||
if (existDataOptional.isPresent()) {
|
||||
UfCjfykctzPO existData = existDataOptional.get();
|
||||
StringBuilder insertSql = new StringBuilder("insert into uf_cjfykctz (hsjlid,formmodeid,modedatacreater,modedatacreatertype,modedatacreatedate,modedatacreatetime,cjkcyf,xm,gh,bm,")
|
||||
.append("cjfykc,bz,ycq,hzcsrq,cjksrq,cjjsrq,syksrq,syjsrq,scfs,cjkcjsts,zjgzjcyx,zngz,qyztcrycgwkhjb,cjkcssyf,")
|
||||
.append(omlSyncInfo.stream().map(OMLSalary2ModeInfo::getModeName).collect(Collectors.joining(",")))
|
||||
.append(") VALUES (" +salaryAcctRecordPO.getId() + "," + formModeId + ",1,0,'" + currDate + "','" + currTime+"','"+existData.getCjkcyf()+"',"+existData.getXm())
|
||||
.append(",'"+existData.getGh()+"',"+existData.getBm()+","+existData.getCjfykc()+",'"+existData.getBz()+"','"+existData.getYcq()+"'")
|
||||
.append(",'"+existData.getHzcsrq()+"','"+existData.getCjksrq()+"','"+existData.getCjjsrq()+"','"+existData.getSyksrq()+"','"+existData.getSyjsrq()+"'")
|
||||
.append(","+existData.getScfs()+","+existData.getCjkcjsts()+","+existData.getZjgzjcyx()+","+existData.getZngz()+","+existData.getQyztcrycgwkhjb())
|
||||
.append(",'"+formatYearMonth+"'");
|
||||
// 动态推送列
|
||||
for(int i = 0; i < omlSyncInfo.size(); i++) {
|
||||
OMLSalary2ModeInfo syncInfo = omlSyncInfo.get(i);
|
||||
Long salaryItemId = allSalaryItemMap.getOrDefault(syncInfo.getSalaryItemName(), 0L);
|
||||
String value = Util.null2String(acctResultMap.get(salaryItemId));
|
||||
if (syncInfo.getType().equals("int")) {
|
||||
insertSql.append("," + (StringUtils.isEmpty(value) ? 0 : value));
|
||||
} else if (syncInfo.getType().equals("bigDecimal")) {
|
||||
insertSql.append("," + (StringUtils.isEmpty(value) || !NumberUtils.isCreatable(value.trim().toString()) ? 0.00 : value.trim()));
|
||||
} else {
|
||||
insertSql.append("," + (StringUtils.isEmpty(value) ? "''" : "'" + value + "'"));
|
||||
}
|
||||
}
|
||||
insertSql.append(")");
|
||||
recordSet.execute(insertSql.toString());
|
||||
if (isLog) {
|
||||
baseBean.writeLog("该员工不止一条数据" + insertSql.toString());
|
||||
}
|
||||
recordSet.execute("select max(id) as max from uf_cjfykctz");
|
||||
if (recordSet.next()) {
|
||||
mainId = recordSet.getInt("max");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 权限重构
|
||||
ModeRightInfo ModeRightInfo = new ModeRightInfo();
|
||||
ModeRightInfo.setNewRight(true);
|
||||
ModeRightInfo.editModeDataShare(1, Integer.valueOf(formModeId), mainId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculate(Long salaryAcctRecordId) {
|
||||
// 查询薪资核算记录
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
|||
import org.springframework.util.StopWatch;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.hrm.User;
|
||||
import weaver.wechat.util.Utils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -209,6 +210,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
return ServiceUtil.getService(SalaryAcctSobConfigServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryCacheService getSalaryCacheService(User user) {
|
||||
return ServiceUtil.getService(SalaryCacheServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctResultPO> listBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctRecordIds)) {
|
||||
|
|
@ -1082,13 +1087,18 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctResultPO> listBySalaryAcctRecordIdsAndSalaryItemIds(Collection<Long> salaryAcctRecordIds, Collection<Long> salaryItemIds) {
|
||||
public List<SalaryAcctResultPO> listBySalaryAcctRecordIdsAndSalaryItemIds(List<Long> salaryAcctRecordIds, Collection<Long> salaryItemIds) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctRecordIds) || CollectionUtils.isEmpty(salaryItemIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<SalaryAcctResultPO> list = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctRecordIds(salaryAcctRecordIds).salaryItemIds(salaryItemIds).build());
|
||||
return encryptUtil.decryptList(list, SalaryAcctResultPO.class);
|
||||
|
||||
List<SalaryAcctResultPO> resultList = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition(salaryAcctRecordIds, 10);
|
||||
partition.forEach(part -> {
|
||||
List<SalaryAcctResultPO> list = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctRecordIds(part).salaryItemIds(salaryItemIds).build());
|
||||
encryptUtil.decryptList(list, SalaryAcctResultPO.class);
|
||||
resultList.addAll(list);
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -1276,15 +1286,34 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
Map<String, SalaryItemPO> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItemList, SalaryItemPO::getName);
|
||||
BaseBean baseBean = new BaseBean();
|
||||
String itemStr = baseBean.getPropValue("omlSalaryReport", "ydxzhbtj_item");
|
||||
|
||||
List<SalaryItemPO> itemList = new ArrayList<>();
|
||||
try {
|
||||
itemList = Arrays.stream(new String(itemStr.getBytes("ISO-8859-1"), "utf-8").split(","))
|
||||
itemStr = new String(itemStr.getBytes("ISO-8859-1"), "utf-8");
|
||||
itemList = Arrays.stream(itemStr.split(","))
|
||||
.map(itemName -> salaryItemMap.get(itemName))
|
||||
.filter(item -> item != null)
|
||||
.collect(Collectors.toList());
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
// 已缓存的报表年份
|
||||
String omlReportCacheYears = Utils.null2String(getSalaryCacheService(user).get(SalaryCacheKey.OML_REPORT_YEARS));
|
||||
if (omlReportCacheYears.contains(year)) {
|
||||
Map<String, Object> omlCacheResultMap = getSalaryCacheService(user).get(SalaryCacheKey.OML_REPORT_DATA+"_"+year);
|
||||
// 获取薪资项目设置是否一致
|
||||
if (omlCacheResultMap != null && omlCacheResultMap.get("itemStr") != null) {
|
||||
String cacheItemStr = omlCacheResultMap.get("itemStr").toString();
|
||||
if (cacheItemStr.equals(itemStr)) {
|
||||
return omlCacheResultMap;
|
||||
} else {
|
||||
getSalaryCacheService(user).remove(SalaryCacheKey.OML_REPORT_DATA+"_"+year);
|
||||
}
|
||||
}
|
||||
getSalaryCacheService(user).remove(SalaryCacheKey.OML_REPORT_YEARS);
|
||||
}
|
||||
|
||||
// 查询薪资核算结果
|
||||
List<Long> itemIdList = itemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
List<SalaryAcctResultPO> resultPOList = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndSalaryItemIds(salaryAcctRecordIds, itemIdList);
|
||||
|
|
@ -1292,7 +1321,6 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// 核算记录id根据薪资所属月份分组
|
||||
Map<String, Set<Long>> salaryAcctRecordMapByMonth = SalaryEntityUtil.group2Map(salaryAcctRecordPOS, record -> SalaryDateUtil.getFormatYearMonth(record.getSalaryMonth()), SalaryAcctRecordPO::getId);
|
||||
List<String> sortedDateList = salaryAcctRecordMapByMonth.keySet().stream().sorted((k1, k2) -> k1.compareTo(k2)).collect(Collectors.toList());
|
||||
|
||||
// 构建表头
|
||||
List<WeaTableColumn> columns = new ArrayList<>();
|
||||
columns.add(new WeaTableColumn("150px", "项目(单位-万元)", "salaryItemName"));
|
||||
|
|
@ -1325,14 +1353,20 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
if (CollectionUtils.isNotEmpty(sortedDateList) && sortedDateList.size() > 2) {
|
||||
BigDecimal thisMonthValue = (BigDecimal) monthResult.get(sortedDateList.get(sortedDateList.size() - 1));
|
||||
BigDecimal lastMonthValue = (BigDecimal) monthResult.get(sortedDateList.get(sortedDateList.size() - 2));
|
||||
BigDecimal compareValue = (thisMonthValue.subtract(lastMonthValue)).divide(lastMonthValue, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
monthResult.put("compareWithLastMonth", compareValue.toString() + "%");
|
||||
if (lastMonthValue != null && lastMonthValue.compareTo(BigDecimal.ZERO) != 0) {
|
||||
BigDecimal compareValue = (thisMonthValue.subtract(lastMonthValue)).divide(lastMonthValue, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
monthResult.put("compareWithLastMonth", compareValue.toString() + "%");
|
||||
}
|
||||
}
|
||||
monthResult.put("salaryItemName", item.getName());
|
||||
dataList.add(monthResult);
|
||||
}
|
||||
|
||||
resultMap.put("data", dataList);
|
||||
resultMap.put("itemStr", itemStr);
|
||||
|
||||
//设置报表缓存
|
||||
getSalaryCacheService(user).set(SalaryCacheKey.OML_REPORT_YEARS, omlReportCacheYears + "," + year);
|
||||
getSalaryCacheService(user).set(SalaryCacheKey.OML_REPORT_DATA + "_" + year, resultMap);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
SalaryItemPO salaryItem = getSalaryItemService(user).getById(backCalcItemId);
|
||||
if (salaryItem != null && salaryItem.getDataType().equals(SalaryArchiveFieldTypeEnum.NUMBER.getValue())) {
|
||||
// 目前是单个薪资项目
|
||||
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singleton(salaryAccountingId), Collections.singleton(backCalcItemId));
|
||||
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(salaryAccountingId), Collections.singleton(backCalcItemId));
|
||||
Set<Long> salaryAcctEmployeeIds = salaryAcctResultValues.stream()
|
||||
.filter(salaryAcctResultPO -> SalaryEntityUtil.empty2Zero(salaryAcctResultPO.getResultValue()).compareTo(BigDecimal.ZERO)
|
||||
!= 0)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryacct.po.UfCjfykctzPO;
|
||||
import com.engine.salary.mapper.salaryacct.UfCjfykctzMapper;
|
||||
import com.engine.salary.service.UfCjfykctzService;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName UfCjfykctzServiceImpl
|
||||
* @date 2024/12/17 16:10
|
||||
* @description
|
||||
*/
|
||||
public class UfCjfykctzServiceImpl extends Service implements UfCjfykctzService {
|
||||
|
||||
private UfCjfykctzMapper getUfCjfykctzMapper(){
|
||||
return MapperProxyFactory.getProxy(UfCjfykctzMapper.class);
|
||||
}
|
||||
@Override
|
||||
public List<UfCjfykctzPO> listAll() {
|
||||
return getUfCjfykctzMapper().listAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UfCjfykctzPO> listAll(UfCjfykctzPO ufCjfykctz) {
|
||||
return getUfCjfykctzMapper().listSome(ufCjfykctz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UfCjfykctzPO getById(Integer id) {
|
||||
return getUfCjfykctzMapper().getById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int insertIgnoreNull(UfCjfykctzPO ufCjfykctz) {
|
||||
return getUfCjfykctzMapper().insertIgnoreNull(ufCjfykctz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(UfCjfykctzPO ufCjfykctz) {
|
||||
return getUfCjfykctzMapper().update(ufCjfykctz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateIgnoreNull(UfCjfykctzPO ufCjfykctz) {
|
||||
return getUfCjfykctzMapper().updateIgnoreNull(ufCjfykctz);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<UfCjfykctzPO> listNeedPushData(Date salaryMonth, List<Long> empIdList) {
|
||||
if (salaryMonth == null || CollectionUtils.isEmpty(empIdList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 薪资所属月>= 建模中产假扣除月份
|
||||
List<UfCjfykctzPO> resultList = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition(empIdList, 500);
|
||||
partition.forEach(part -> {
|
||||
resultList.addAll(getUfCjfykctzMapper().listBycjkcyf(SalaryDateUtil.getFormatDate(salaryMonth), part));
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
|
|
@ -382,6 +382,9 @@ public class ExcelUtilPlus {
|
|||
//判断是否要调整高度
|
||||
int width = sheet.getColumnWidth(cellIndex) / 256;
|
||||
finalHeight = getFinalHeight(o, width, finalHeight, height);
|
||||
if (finalHeight != 18) {
|
||||
System.out.println("a");
|
||||
}
|
||||
}
|
||||
if (rowIndex == 1) {
|
||||
sheet.addMergedRegion(new CellRangeAddress(1, 1, 1, header.size()-1));
|
||||
|
|
|
|||
Loading…
Reference in New Issue