Commit c77c8816 authored by hongguangwu's avatar hongguangwu

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

薪资报账查询、导出、count等接口,添加工资月范围查询;
详情接口,转化为sql查询;
parent 5996cd1e
......@@ -506,4 +506,15 @@ public class TSalaryAccount extends BaseEntity {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "年终奖单独扣税税费")
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> {
@TableField(exist = false)
private String formType;
/**
* 工资月
*/
@TableField(exist = false)
private String salaryMonth;
}
......@@ -21,6 +21,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
......@@ -395,4 +396,14 @@ public class TSalaryStandard extends BaseEntity {
@ExcelIgnore
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> {
List<TSalaryAccount> noPageDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList") List<String> idList);
List<TSalaryAccount> getAccountListBySalaryId(@Param("searchVo") TSalaryAccountSearchVo searchVo);
/**
* @Description: 根据工资id,返回报账明细(字段较少且有计算,其他地方勿用)
* @Author: hgw
......
......@@ -57,6 +57,15 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
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 settleMonth
......
......@@ -1376,22 +1376,19 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<TSalaryAtta> attaList = null;
if (salary.getType() == null || salary.getType() != CommonConstants.ONE_INT) {
//报账表
TSalaryAccount salaryAccount = new TSalaryAccount();
TSalaryAccountSearchVo salaryAccount = new TSalaryAccountSearchVo();
salaryAccount.setSalaryFormId(salaryFormId);
QueryWrapper<TSalaryAccount> queryWrapperSa = new QueryWrapper<>();
queryWrapperSa.setEntity(salaryAccount);
List<TSalaryAccount> salaryAccountList = tSalaryAccountService.list(queryWrapperSa);
salaryAccount.setSalaryMonthStart(salary.getSalaryMonth());
List<TSalaryAccount> salaryAccountList = tSalaryAccountService.getAccountListBySalaryId(salaryAccount);
//报账表明细
if (salaryAccountList != null && salaryAccountList.size() > CommonConstants.ZERO_INT) {
TSalaryAccountItem item;
QueryWrapper<TSalaryAccountItem> queryWrapperAi;
List<TSalaryAccountItem> itemList;
for (TSalaryAccount a : salaryAccountList) {
item = new TSalaryAccountItem();
item.setSalaryAccountId(a.getId());
queryWrapperAi = new QueryWrapper<>();
queryWrapperAi.setEntity(item);
itemList = tSalaryAccountItemService.list(queryWrapperAi);
item.setSalaryMonth(salary.getSalaryMonth());
itemList = tSalaryAccountItemService.getTSalaryAccountItemNoPage(item);
a.setSaiList(itemList);
}
}
......
......@@ -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.TSalaryAccountSearchVo;
import lombok.extern.log4j.Log4j2;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -151,6 +152,11 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
return baseMapper.noPageDiy(searchVo,searchVo.getIdList());
}
@Override
public List<TSalaryAccount> getAccountListBySalaryId(TSalaryAccountSearchVo searchVo) {
return baseMapper.getAccountListBySalaryId(searchVo);
}
private int noPageCountDiy(TSalaryAccountSearchVo searchVo) {
return baseMapper.noPageCountDiy(searchVo,searchVo.getIdList());
}
......
......@@ -38,7 +38,13 @@
SALARY_MONEY,
TEXT_VALUE,
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>
<if test="tSalaryAccountItem.id != null and tSalaryAccountItem.id.trim() != ''">
AND ID = #{tSalaryAccountItem.id}
......
......@@ -253,6 +253,12 @@
<if test="tSalaryAccount.salaryMonth != null and tSalaryAccount.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{tSalaryAccount.salaryMonth}
</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() != ''">
AND a.EMP_ID = #{tSalaryAccount.empId}
</if>
......@@ -373,7 +379,13 @@
<select id="getTSalaryAccountPage" resultMap="tSalaryAccountMap">
SELECT
<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>
a.DELETE_FLAG = 0
and not EXISTS (
......@@ -605,7 +617,13 @@
<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
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.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
......@@ -624,6 +642,20 @@
</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
......@@ -645,7 +677,13 @@
<select id="noPageCountDiy" resultType="java.lang.Integer">
SELECT
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>
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
......@@ -676,6 +714,12 @@
<if test="searchVo.salaryMonth != null and searchVo.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{searchVo.salaryMonth}
</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() != ''">
AND a.EMP_ID = #{searchVo.empId}
</if>
......
......@@ -169,6 +169,12 @@
<if test="tSalaryStandard.salaryMonth != null and tSalaryStandard.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{tSalaryStandard.salaryMonth}
</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">
AND a.MONEY_FROM = #{tSalaryStandard.moneyFrom}
</if>
......@@ -265,7 +271,13 @@
<select id="getTSalaryStandardPage" resultMap="tSalaryStandardMap">
SELECT
<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
<where>
a.DELETE_FLAG = 0
......@@ -282,7 +294,13 @@
<select id="getTSalaryStandardPageApply" resultMap="tSalaryStandardMap">
SELECT
<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>
a.DELETE_FLAG = 0
<!-- 薪资是否可查看 0 是 1否-->
......@@ -351,7 +369,13 @@
a.SALARY_MONTH,
a.FORM_TYPE,
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
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
......@@ -371,7 +395,13 @@
<select id="getSalaryStandardExportCount" resultType="java.lang.Integer">
SELECT
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
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
......@@ -417,6 +447,12 @@
<if test="searchVo.salaryMonth != null and searchVo.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{searchVo.salaryMonth}
</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">
AND (a.STATUS = 1 OR a.STATUS = 2 OR a.STATUS = 5)
</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