Commit 50ded665 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.5.5' into MVP1.5.5

parents 325bc44b 2f0530d1
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.entity;
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;
......@@ -139,4 +140,30 @@ public class TConfigSalary extends BaseEntity implements Serializable {
@ExcelProperty(value="收入月份")
private Integer incomeMonth;
/**
* 月均发薪次数
*/
@NotNull(message = "月均发薪次数不能为空")
@ExcelAttribute(name = "月均发薪次数", isNotEmpty = true,errorInfo = "月均发薪次数不能为空" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value="月均发薪次数")
private Integer salaryNum;
/**
* @Description: 本结算月发薪次数:0:可以提交; 其他:不可提交
* @Author: hgw
* @Date: 2023/6/25 17:45
* @return:
**/
@TableField(exist = false)
private Integer nowMonthSalaryNum = 0;
/**
* @Description: 本结算年未提交的发薪次数:0:可以提交; 其他:提交时二次确认
* @Author: hgw
* @Date: 2023/6/25 17:45
* @return:
**/
@TableField(exist = false)
private Integer nowYearSalaryNum = 0;
}
package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.DateUtil;
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.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TConfigSalary;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TConfigSalaryService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
......@@ -38,6 +46,8 @@ import java.util.List;
public class TConfigSalaryController {
private final TConfigSalaryService tConfigSalaryService;
private final TSalaryStandardService tSalaryStandardService;
private final TSalaryStandardMapper tSalaryStandardMapper;
private final MenuUtil menuUtil;
/**
* @param settleDepart 结算主体id
......@@ -56,6 +66,20 @@ public class TConfigSalaryController {
QueryWrapper<TConfigSalary> queryWrapperCs = new QueryWrapper<>();
queryWrapperCs.setEntity(configSalary);
List<TConfigSalary> configSalaryList = tConfigSalaryService.list(queryWrapperCs);
if (configSalaryList != null && !configSalaryList.isEmpty()) {
String nowMonth = DateUtil.addMonth(0);
// 当前月 发薪次数
int monthCount = tSalaryStandardService.getNum(settleDepart, nowMonth, null);
String nowYear = DateUtil.getYear(new Date());
// 当前年 未推送或未发放的 发薪次数
int yearCount = tSalaryStandardService.getNum(settleDepart, null, nowYear);
for (TConfigSalary cs : configSalaryList) {
if (cs.getSalaryNum() < monthCount) {
cs.setNowMonthSalaryNum(monthCount);
}
cs.setNowYearSalaryNum(yearCount);
}
}
return new R<>(configSalaryList);
}
......
......@@ -62,4 +62,15 @@ public interface TSalaryStandardMapper extends BaseMapper<TSalaryStandard> {
* @return: java.lang.String
**/
String getMaxSalaryCode();
/**
* @param deptId 项目id
* @param settleMonth 结算月
* @param nowYear 当前结算年
* @Description: 获取薪资条数
* @Author: hgw
* @Date: 2023/6/25 18:04
* @return: int
**/
int getNum(@Param("deptId") String deptId, @Param("settleMonth") String settleMonth, @Param("nowYear") String nowYear);
}
......@@ -133,4 +133,15 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
**/
R<String> doIncome(TSalaryStandard tSalaryStandard);
/**
* @param deptId 项目id
* @param settleMonth 结算月
* @param nowYear 当前结算年
* @Description: 获取薪资条数
* @Author: hgw
* @Date: 2023/6/25 18:04
* @return: int
**/
int getNum(String deptId, String settleMonth, String nowYear);
}
......@@ -1065,4 +1065,18 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
newAccount.setAnnualBonusTax(null);
}
/**
* @param deptId 项目id
* @param settleMonth 结算月
* @param nowYear 当前结算年
* @Description: 获取薪资条数
* @Author: hgw
* @Date: 2023/6/25 18:04
* @return: int
**/
@Override
public int getNum(String deptId, String settleMonth, String nowYear) {
return baseMapper.getNum(deptId,settleMonth,nowYear);
}
}
......@@ -16,6 +16,7 @@
<result property="socialPriority" column="SOCIAL_PRIORITY"/>
<result property="fundPriority" column="FUND_PRIORITY"/>
<result property="grantType" column="GRANT_TYPE"/>
<result property="salaryNum" column="SALARY_NUM"/>
</resultMap>
<!--tConfigSalary简单分页查询-->
......@@ -31,7 +32,8 @@
FUND_MONTH,
SOCIAL_PRIORITY,
FUND_PRIORITY,
GRANT_TYPE
GRANT_TYPE,
SALARY_NUM
FROM t_config_salary a
<where>
1=1
......@@ -68,6 +70,9 @@
<if test="tConfigSalary.grantType != null ">
AND GRANT_TYPE = #{tConfigSalary.grantType}
</if>
<if test="tConfigSalary.salaryNum != null ">
AND SALARY_NUM = #{tConfigSalary.salaryNum}
</if>
<!--数据权限判断-->
<if test="depatIds != null and depatIds.size() > 0">
and DEPART_ID in
......
......@@ -486,4 +486,22 @@
SELECT ifnull(max(right(e.APPLY_NO,4)),0) APPLY_NO FROM t_salary_standard e where e.DELETE_FLAG = 0 and e.CREATE_TIME>DATE_FORMAT(now(),'%Y-%m-%d')
</select>
<!-- 获取薪资条数 -->
<select id="getNum" resultType="java.lang.Integer">
SELECT count(1)
FROM t_salary_standard a
where
a.DELETE_FLAG = 0
<if test="deptId != null and deptId.trim() != ''">
and a.DEPT_ID = #{deptId}
</if>
<if test="settleMonth != null and settleMonth.trim() != ''">
and a.SETTLEMENT_MONTH = #{settleMonth}
</if>
<if test="nowYear != null and nowYear.trim() != ''">
and a.SETTLEMENT_MONTH like concat(#{nowYear},'%')
and a.STATUS not in (3,4)
</if>
</select>
</mapper>
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