Commit c77c8816 authored by hongguangwu's avatar hongguangwu

项目薪资查询、导出、count等接口,添加工资月范围查询;

薪资报账查询、导出、count等接口,添加工资月范围查询;
详情接口,转化为sql查询;
parent 5996cd1e
...@@ -506,4 +506,15 @@ public class TSalaryAccount extends BaseEntity { ...@@ -506,4 +506,15 @@ public class TSalaryAccount extends BaseEntity {
@HeadFontStyle(fontHeightInPoints = 11) @HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "年终奖单独扣税税费") @ExcelProperty(value = "年终奖单独扣税税费")
private BigDecimal annualBonusTax; private BigDecimal annualBonusTax;
/**
* 工资月份-起
*/
@TableField(exist = false)
private String salaryMonthStart;
/**
* 工资月份-止
*/
@TableField(exist = false)
private String salaryMonthEnd;
} }
...@@ -107,4 +107,10 @@ public class TSalaryAccountItem extends Model<TSalaryAccountItem> { ...@@ -107,4 +107,10 @@ public class TSalaryAccountItem extends Model<TSalaryAccountItem> {
@TableField(exist = false) @TableField(exist = false)
private String formType; private String formType;
/**
* 工资月
*/
@TableField(exist = false)
private String salaryMonth;
} }
...@@ -21,6 +21,7 @@ import com.alibaba.excel.annotation.ExcelIgnore; ...@@ -21,6 +21,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle; import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
...@@ -395,4 +396,14 @@ public class TSalaryStandard extends BaseEntity { ...@@ -395,4 +396,14 @@ public class TSalaryStandard extends BaseEntity {
@ExcelIgnore @ExcelIgnore
private String bpoFlag; private String bpoFlag;
/**
* 工资月份-起
*/
@TableField(exist = false)
private String salaryMonthStart;
/**
* 工资月份-止
*/
@TableField(exist = false)
private String salaryMonthEnd;
} }
...@@ -108,6 +108,8 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> { ...@@ -108,6 +108,8 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
List<TSalaryAccount> noPageDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo, List<TSalaryAccount> noPageDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList") List<String> idList); @Param("idList") List<String> idList);
List<TSalaryAccount> getAccountListBySalaryId(@Param("searchVo") TSalaryAccountSearchVo searchVo);
/** /**
* @Description: 根据工资id,返回报账明细(字段较少且有计算,其他地方勿用) * @Description: 根据工资id,返回报账明细(字段较少且有计算,其他地方勿用)
* @Author: hgw * @Author: hgw
......
...@@ -57,6 +57,15 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> { ...@@ -57,6 +57,15 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
List<TSalaryAccount> noPageDiy(TSalaryAccountSearchVo searchVo); List<TSalaryAccount> noPageDiy(TSalaryAccountSearchVo searchVo);
/**
* @param searchVo
* @Description: 无需权限仅按照工资id查询报账
* @Author: hgw
* @Date: 2022/10/24 16:36
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount>
**/
List<TSalaryAccount> getAccountListBySalaryId(TSalaryAccountSearchVo searchVo);
/** /**
* @param settleId * @param settleId
* @param settleMonth * @param settleMonth
......
...@@ -1376,22 +1376,19 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, ...@@ -1376,22 +1376,19 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<TSalaryAtta> attaList = null; List<TSalaryAtta> attaList = null;
if (salary.getType() == null || salary.getType() != CommonConstants.ONE_INT) { if (salary.getType() == null || salary.getType() != CommonConstants.ONE_INT) {
//报账表 //报账表
TSalaryAccount salaryAccount = new TSalaryAccount(); TSalaryAccountSearchVo salaryAccount = new TSalaryAccountSearchVo();
salaryAccount.setSalaryFormId(salaryFormId); salaryAccount.setSalaryFormId(salaryFormId);
QueryWrapper<TSalaryAccount> queryWrapperSa = new QueryWrapper<>(); salaryAccount.setSalaryMonthStart(salary.getSalaryMonth());
queryWrapperSa.setEntity(salaryAccount); List<TSalaryAccount> salaryAccountList = tSalaryAccountService.getAccountListBySalaryId(salaryAccount);
List<TSalaryAccount> salaryAccountList = tSalaryAccountService.list(queryWrapperSa);
//报账表明细 //报账表明细
if (salaryAccountList != null && salaryAccountList.size() > CommonConstants.ZERO_INT) { if (salaryAccountList != null && salaryAccountList.size() > CommonConstants.ZERO_INT) {
TSalaryAccountItem item; TSalaryAccountItem item;
QueryWrapper<TSalaryAccountItem> queryWrapperAi;
List<TSalaryAccountItem> itemList; List<TSalaryAccountItem> itemList;
for (TSalaryAccount a : salaryAccountList) { for (TSalaryAccount a : salaryAccountList) {
item = new TSalaryAccountItem(); item = new TSalaryAccountItem();
item.setSalaryAccountId(a.getId()); item.setSalaryAccountId(a.getId());
queryWrapperAi = new QueryWrapper<>(); item.setSalaryMonth(salary.getSalaryMonth());
queryWrapperAi.setEntity(item); itemList = tSalaryAccountItemService.getTSalaryAccountItemNoPage(item);
itemList = tSalaryAccountItemService.list(queryWrapperAi);
a.setSaiList(itemList); a.setSaiList(itemList);
} }
} }
......
...@@ -35,6 +35,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService; ...@@ -35,6 +35,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -151,6 +152,11 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper, ...@@ -151,6 +152,11 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
return baseMapper.noPageDiy(searchVo,searchVo.getIdList()); return baseMapper.noPageDiy(searchVo,searchVo.getIdList());
} }
@Override
public List<TSalaryAccount> getAccountListBySalaryId(TSalaryAccountSearchVo searchVo) {
return baseMapper.getAccountListBySalaryId(searchVo);
}
private int noPageCountDiy(TSalaryAccountSearchVo searchVo) { private int noPageCountDiy(TSalaryAccountSearchVo searchVo) {
return baseMapper.noPageCountDiy(searchVo,searchVo.getIdList()); return baseMapper.noPageCountDiy(searchVo,searchVo.getIdList());
} }
......
...@@ -38,7 +38,13 @@ ...@@ -38,7 +38,13 @@
SALARY_MONEY, SALARY_MONEY,
TEXT_VALUE, TEXT_VALUE,
IS_TAX IS_TAX
FROM t_salary_account_item FROM
<if test="tSalaryAccountItem.salaryMonth == null or tSalaryAccountItem.salaryMonth.trim() >= '202201'">
t_salary_account_item a
</if>
<if test="tSalaryAccountItem.salaryMonth != null and tSalaryAccountItem.salaryMonth.trim() &lt; '202201' ">
t_salary_account_item_hro_2021 a
</if>
<where> <where>
<if test="tSalaryAccountItem.id != null and tSalaryAccountItem.id.trim() != ''"> <if test="tSalaryAccountItem.id != null and tSalaryAccountItem.id.trim() != ''">
AND ID = #{tSalaryAccountItem.id} AND ID = #{tSalaryAccountItem.id}
......
...@@ -253,6 +253,12 @@ ...@@ -253,6 +253,12 @@
<if test="tSalaryAccount.salaryMonth != null and tSalaryAccount.salaryMonth.trim() != ''"> <if test="tSalaryAccount.salaryMonth != null and tSalaryAccount.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{tSalaryAccount.salaryMonth} AND a.SALARY_MONTH = #{tSalaryAccount.salaryMonth}
</if> </if>
<if test="tSalaryAccount.salaryMonthStart != null and tSalaryAccount.salaryMonthStart.trim() != ''">
AND a.SALARY_MONTH >= #{tSalaryAccount.salaryMonthStart}
</if>
<if test="tSalaryAccount.salaryMonthEnd != null and tSalaryAccount.salaryMonthEnd.trim() != ''">
AND a.SALARY_MONTH <![CDATA[<=]]> #{tSalaryAccount.salaryMonthEnd}
</if>
<if test="tSalaryAccount.empId != null and tSalaryAccount.empId.trim() != ''"> <if test="tSalaryAccount.empId != null and tSalaryAccount.empId.trim() != ''">
AND a.EMP_ID = #{tSalaryAccount.empId} AND a.EMP_ID = #{tSalaryAccount.empId}
</if> </if>
...@@ -373,7 +379,13 @@ ...@@ -373,7 +379,13 @@
<select id="getTSalaryAccountPage" resultMap="tSalaryAccountMap"> <select id="getTSalaryAccountPage" resultMap="tSalaryAccountMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_salary_account a FROM
<if test="tSalaryAccount.salaryMonthStart == null or tSalaryAccount.salaryMonthStart.trim() >= '202201' ">
t_salary_account a
</if>
<if test="tSalaryAccount.salaryMonthStart != null and tSalaryAccount.salaryMonthStart.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
<where> <where>
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
and not EXISTS ( and not EXISTS (
...@@ -605,7 +617,13 @@ ...@@ -605,7 +617,13 @@
<select id="noPageDiy" resultMap="tSalaryAccountMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount"> <select id="noPageDiy" resultMap="tSalaryAccountMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_salary_account a FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201'">
t_salary_account a
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
<where> <where>
a.DELETE_FLAG = 0 and not EXISTS ( a.DELETE_FLAG = 0 and not EXISTS (
select 1 from t_dept_see d where a.DEPT_NO = d.DEPT_NO and d.CAN_SEE = 1 select 1 from t_dept_see d where a.DEPT_NO = d.DEPT_NO and d.CAN_SEE = 1
...@@ -624,6 +642,20 @@ ...@@ -624,6 +642,20 @@
</select> </select>
<select id="getAccountListBySalaryId" resultMap="tSalaryAccountMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
SELECT
<include refid="Base_Column_List"/>
FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201'">
t_salary_account a
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
where a.SALARY_FORM_ID = #{searchVo.salaryFormId}
ORDER BY a.CREATE_TIME desc
</select>
<!-- 计算收入需要的报账明细 --> <!-- 计算收入需要的报账明细 -->
<select id="getListByIncome" resultMap="tSalaryAccountMap"> <select id="getListByIncome" resultMap="tSalaryAccountMap">
SELECT SELECT
...@@ -645,7 +677,13 @@ ...@@ -645,7 +677,13 @@
<select id="noPageCountDiy" resultType="java.lang.Integer"> <select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT SELECT
count(1) count(1)
FROM t_salary_account a FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201' ">
t_salary_account a
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
<where> <where>
a.DELETE_FLAG = 0 and not EXISTS ( a.DELETE_FLAG = 0 and not EXISTS (
select 1 from t_dept_see d where a.DEPT_NO = d.DEPT_NO and d.CAN_SEE = 1 select 1 from t_dept_see d where a.DEPT_NO = d.DEPT_NO and d.CAN_SEE = 1
...@@ -676,6 +714,12 @@ ...@@ -676,6 +714,12 @@
<if test="searchVo.salaryMonth != null and searchVo.salaryMonth.trim() != ''"> <if test="searchVo.salaryMonth != null and searchVo.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{searchVo.salaryMonth} AND a.SALARY_MONTH = #{searchVo.salaryMonth}
</if> </if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() != ''">
AND a.SALARY_MONTH >= #{searchVo.salaryMonthStart}
</if>
<if test="searchVo.salaryMonthEnd != null and searchVo.salaryMonthEnd.trim() != ''">
AND a.SALARY_MONTH <![CDATA[<=]]> #{searchVo.salaryMonthEnd}
</if>
<if test="searchVo.empId != null and searchVo.empId.trim() != ''"> <if test="searchVo.empId != null and searchVo.empId.trim() != ''">
AND a.EMP_ID = #{searchVo.empId} AND a.EMP_ID = #{searchVo.empId}
</if> </if>
......
...@@ -169,6 +169,12 @@ ...@@ -169,6 +169,12 @@
<if test="tSalaryStandard.salaryMonth != null and tSalaryStandard.salaryMonth.trim() != ''"> <if test="tSalaryStandard.salaryMonth != null and tSalaryStandard.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{tSalaryStandard.salaryMonth} AND a.SALARY_MONTH = #{tSalaryStandard.salaryMonth}
</if> </if>
<if test="tSalaryStandard.salaryMonthStart != null and tSalaryStandard.salaryMonthStart.trim() != ''">
AND a.SALARY_MONTH >= #{tSalaryStandard.salaryMonthStart}
</if>
<if test="tSalaryStandard.salaryMonthEnd != null and tSalaryStandard.salaryMonthEnd.trim() != ''">
AND a.SALARY_MONTH <![CDATA[<=]]> #{tSalaryStandard.salaryMonthEnd}
</if>
<if test="tSalaryStandard.moneyFrom != null"> <if test="tSalaryStandard.moneyFrom != null">
AND a.MONEY_FROM = #{tSalaryStandard.moneyFrom} AND a.MONEY_FROM = #{tSalaryStandard.moneyFrom}
</if> </if>
...@@ -265,7 +271,13 @@ ...@@ -265,7 +271,13 @@
<select id="getTSalaryStandardPage" resultMap="tSalaryStandardMap"> <select id="getTSalaryStandardPage" resultMap="tSalaryStandardMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_salary_standard a FROM
<if test="tSalaryStandard.salaryMonthStart == null or tSalaryStandard.salaryMonthStart.trim() >= '202201' ">
t_salary_standard a
</if>
<if test="tSalaryStandard.salaryMonthStart != null and tSalaryStandard.salaryMonthStart.trim() &lt; '202201' ">
t_salary_standard_hro_2021 a
</if>
left join t_dept_see d on a.DEPT_NO = d.DEPT_NO left join t_dept_see d on a.DEPT_NO = d.DEPT_NO
<where> <where>
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
...@@ -282,7 +294,13 @@ ...@@ -282,7 +294,13 @@
<select id="getTSalaryStandardPageApply" resultMap="tSalaryStandardMap"> <select id="getTSalaryStandardPageApply" resultMap="tSalaryStandardMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_salary_standard a FROM
<if test="tSalaryStandard.salaryMonthStart == null or tSalaryStandard.salaryMonthStart.trim() >= '202201' ">
t_salary_standard a
</if>
<if test="tSalaryStandard.salaryMonthStart != null and tSalaryStandard.salaryMonthStart.trim() &lt; '202201' ">
t_salary_standard_hro_2021 a
</if>
<where> <where>
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
<!-- 薪资是否可查看 0 是 1否--> <!-- 薪资是否可查看 0 是 1否-->
...@@ -351,7 +369,13 @@ ...@@ -351,7 +369,13 @@
a.SALARY_MONTH, a.SALARY_MONTH,
a.FORM_TYPE, a.FORM_TYPE,
a.CREATE_TIME a.CREATE_TIME
FROM t_salary_standard a FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201' ">
t_salary_standard a
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_standard_hro_2021 a
</if>
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where> <where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null) a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
...@@ -371,7 +395,13 @@ ...@@ -371,7 +395,13 @@
<select id="getSalaryStandardExportCount" resultType="java.lang.Integer"> <select id="getSalaryStandardExportCount" resultType="java.lang.Integer">
SELECT SELECT
count(1) count(1)
FROM t_salary_standard a FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201' ">
t_salary_standard a
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_standard_hro_2021 a
</if>
LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO LEFT JOIN t_dept_see d ON a.DEPT_NO = d.DEPT_NO
<where> <where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null) a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
...@@ -417,6 +447,12 @@ ...@@ -417,6 +447,12 @@
<if test="searchVo.salaryMonth != null and searchVo.salaryMonth.trim() != ''"> <if test="searchVo.salaryMonth != null and searchVo.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{searchVo.salaryMonth} AND a.SALARY_MONTH = #{searchVo.salaryMonth}
</if> </if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() != ''">
AND a.SALARY_MONTH >= #{searchVo.salaryMonthStart}
</if>
<if test="searchVo.salaryMonthEnd != null and searchVo.salaryMonthEnd.trim() != ''">
AND a.SALARY_MONTH <![CDATA[<=]]> #{searchVo.salaryMonthEnd}
</if>
<!--<if test="searchVo.status == null"> <!--<if test="searchVo.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>-->
......
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