工资单发放-引包修改

This commit is contained in:
MustangDeng 2022-04-14 09:08:04 +08:00
parent 50c03b19e0
commit 87ef976b7c
9 changed files with 212 additions and 9 deletions

View File

@ -11,6 +11,7 @@ import lombok.NoArgsConstructor;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @Description: 工资单发放
@ -108,5 +109,5 @@ public class SalarySendListDTO {
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
// 最后发送时间
@SalaryTableColumn(text = "最后发送时间", width = "15%", column = "lastSendTime")
private LocalDateTime lastSendTime;
private Date lastSendTime;
}

View File

@ -1,6 +1,6 @@
package com.engine.salary.entity.salaryBill.param;
import com.engine.salary.entity.base.BaseQueryParam;
import com.engine.salary.common.BaseQueryParam;
import com.engine.salary.exception.SalaryRunTimeException;
import lombok.AllArgsConstructor;
import lombok.Builder;

View File

@ -1,6 +1,6 @@
package com.engine.salary.entity.salaryBill.param;
import com.engine.salary.entity.base.BaseQueryParam;
import com.engine.salary.common.BaseQueryParam;
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import lombok.AllArgsConstructor;

View File

@ -30,7 +30,7 @@ public class SalarySendPO {
* 薪资所属月
*/
// @ElogTransform(name = "薪资所属月")
private LocalDate salaryMonth;
private Date salaryMonth;
/**
* 薪资核算id

View File

@ -56,4 +56,5 @@ ADD COLUMN `sorted_index` int(0) NOT NULL COMMENT '显示顺序' AFTER `sob_defa
-- 工资单发放
alter table hrsa_salary_template modify id bigint auto_increment;
ALTER TABLE hrsa_salary_template MODIFY background varchar(2000);

View File

@ -2,7 +2,6 @@ package com.engine.salary.mapper.salarybill;
import com.engine.salary.entity.salaryBill.dto.SalarySendListDTO;
import com.engine.salary.entity.salaryBill.param.SalarySendQueryParam;
import com.engine.salary.entity.salaryBill.po.SalarySendInfoPO;
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

View File

@ -0,0 +1,202 @@
<?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.salarybill.SalarySendMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryBill.po.SalarySendPO">
<result column="id" property="id"/>
<result column="salary_month" property="salaryMonth"/>
<result column="salary_accounting_id" property="salaryAccountingId"/>
<result column="salary_sob_id" property="salarySobId"/>
<result column="send_num" property="sendNum"/>
<result column="send_total" property="sendTotal"/>
<result column="last_send_time" property="lastSendTime"/>
<result column="creator" property="creator"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<sql id="salarySendPOColumn">
id,
salary_month,
salary_accounting_id,
salary_sob_id,
send_num,
send_total,
last_send_time,
creator,
create_time,
update_time,
delete_type,
tenant_key
</sql>
<sql id="salarySendColumn">
t1.id,
t2.salary_month AS salaryYearMonth,
t3.name AS salarySob,
t3.id AS salarySobId,
t1.send_num,
t1.send_total,
t1.last_send_time,
t2.acct_times
</sql>
<sql id="paramSql">
<!-- 薪资所属月 -->
<if test="param.salaryMonth != null">
<if test="param.salaryMonth.size() == 1">
AND t2.salary_month = #{param.salaryMonth[0]}
</if>
<if test="param.salaryMonth.size() == 2">
AND (t2.salary_month BETWEEN #{param.salaryMonth[0]} AND #{param.salaryMonth[1]})
</if>
</if>
</sql>
<select id="list" resultType="com.engine.salary.entity.salaryBill.dto.SalarySendListDTO">
SELECT
<include refid="salarySendColumn"/>
FROM
hrsa_salary_send t1
LEFT JOIN hrsa_salary_acct_record t2 ON t2.id = t1.salary_accounting_id
LEFT JOIN hrsa_salary_sob t3 ON t3.id = t2.salary_sob_id
WHERE
t1.delete_type = 0
AND t2.delete_type = 0
<include refid="paramSql"/>
ORDER BY t1.id DESC
</select>
<select id="getById" resultType="com.engine.salary.entity.salaryBill.po.SalarySendPO">
SELECT
id,
salary_month,
salary_accounting_id,
salary_sob_id,
send_num,
send_total,
last_send_time
FROM hrsa_salary_send
WHERE delete_type = 0
AND id = #{id}
</select>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryBill.po.SalarySendPO">
UPDATE hrsa_salary_send_info
<set>
<if test="salaryMonth != null">
salary_month=#{salaryMonth},
</if>
<if test="salaryAccountingId != null">
salary_accounting_id=#{salaryAccountingId},
</if>
<if test="salarySobId != null">
salary_sob_id=#{salarySobId},
</if>
<if test="sendNum != null">
send_num=#{sendNum},
</if>
<if test="sendTotal != null">
send_total=#{sendTotal},
</if>
<if test="lastSendTime != null">
last_send_time=#{lastSendTime},
</if>
<if test="creator != null">
creator=#{creator},
</if>
<if test="createTime != null">
create_time=#{createTime},
</if>
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="deleteType != null">
delete_type=#{deleteType},
</if>
<if test="tenantKey != null">
tenant_key=#{tenantKey},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<select id="listSomeWithCondition" resultMap="BaseResultMap">
SELECT
<include refid="salarySendPOColumn"/>
FROM
hrsa_salary_send t1
WHERE
t1.delete_type = 0
<if test="param.sendNum != null and param.sendNum != ''">
AND t1.send_num = #{param.sendNum}
</if>
<if test="param.sendNum != null and param.sendNum != ''">
AND t1.send_num = #{param.sendNum}
</if>
<if test="param.salaryAccountingIds != null and param.salaryAccountingIds != ''">
AND t1.salary_sob_id IN
<foreach collection="param.salaryAccountingIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY t1.id DESC
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.salaryBill.po.SalarySendPO">
SELECT
<include refid="salarySendPOColumn" />
FROM hrsa_salary_send t
WHERE delete_type = 0
<if test="id != null and id != ''">
AND id = #{id}
</if>
<if test="salaryMonth != null and salaryMonth != ''">
AND salary_month = #{salaryMonth}
</if>
<if test="salaryAccountingId != null and salaryAccountingId != ''">
AND salary_accounting_id = #{salaryAccountingId}
</if>
<if test="salaryAcctRecordId != null and salaryAcctRecordId != ''">
AND salary_acct_record_id = #{salaryAcctRecordId}
</if>
<if test="salarySobId != null and salarySobId != ''">
AND salary_sob_id = #{salarySobId}
</if>
<if test="sendNum != null and sendNum != ''">
AND send_num = #{sendNum}
</if>
<if test="sendTotal != null and sendTotal != ''">
AND send_total = #{sendTotal}
</if>
<if test="lastSendTime != null and lastSendTime != ''">
AND last_send_time = #{lastSendTime}
</if>
<if test="creator != null and creator != ''">
AND creator = #{creator}
</if>
<if test="createTime != null and createTime != ''">
AND createTime = #{createTime}
</if>
<if test="updateTime != null and updateTime != ''">
AND update_time = #{updateTime}
</if>
<if test="deleteType != null and deleteType != ''">
AND delete_type = #{deleteType}
</if>
<if test="tenantKey != null and tenantKey != ''">
AND tenant_key = #{tenantKey}
</if>
ORDER BY id DESC
</select>
</mapper>

View File

@ -3,6 +3,7 @@ package com.engine.salary.service.impl;
import cn.hutool.core.codec.Base64Encoder;
import cn.weaver.ecology.framework.rpc.annotation.RpcReference;
import com.alibaba.fastjson.JSONArray;
import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SalarySendBiz;
@ -37,7 +38,6 @@ import com.engine.salary.service.TaxAgentService;
import com.engine.salary.util.JsonUtil;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.SqlProxyHandle;
import com.engine.salary.util.page.PageInfo;
import dm.jdbc.util.IdGenerator;
import org.apache.commons.beanutils.BeanUtils;
@ -333,7 +333,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100512, "工资单发放不存在"));
}
SalarySendPO salarySend = salarySends.get(0);
LocalDate salaryMonth = salarySend.getSalaryMonth();
Date salaryMonth = salarySend.getSalaryMonth();
// 获取模板
String salaryTemplateContent = salarySendInfo.getSalaryTemplate();
if (StringUtils.isBlank(salaryTemplateContent)) {

View File

@ -59,11 +59,11 @@ public class SalaryTemplateWrapper extends Service {
String fields = " t.id" +
" , t.name" +
" , t.salary_sob_id as salarySob" +
" , s.name as salarySob" +
" , t.use_type as useType" +
" , t.description";
String from = " from hrsa_salary_template t";
String from = " from hrsa_salary_template t left join hrsa_salary_sob s on t.salary_sob_id = s.id ";
table.setBackfields(fields);
table.setSqlform(from);