Commit 02bf4ff2 authored by hongguangwu's avatar hongguangwu

MVP1.7.10-工资条暂时提交

parent 98580dfc
...@@ -227,6 +227,32 @@ public class TSalaryAccountController { ...@@ -227,6 +227,32 @@ public class TSalaryAccountController {
tSalaryAccountService.exportAsso(response, searchVo,CommonConstants.ONE_INT); tSalaryAccountService.exportAsso(response, searchVo,CommonConstants.ONE_INT);
} }
/**
* 获取工资条导出
* @author hgw
* @date 2025-4-21 09:30:56
**/
@Operation(description = "获取工资条导出")
@PostMapping("/getEmpAccountExport")
@SysLog("获取工资条导出")
public void getEmpAccountExport(HttpServletResponse response, @RequestBody TSalaryAccountSearchVo searchVo) {
String empIdCard = searchVo.getEmpIdcard();
String settleDepartId = searchVo.getDeptId();
String settlementMonth = searchVo.getSettlementMonth();
String deptNo = searchVo.getDeptNo();
String empName = searchVo.getEmpName();
if (Common.isEmpty(empIdCard) && Common.isEmpty(settleDepartId) && Common.isEmpty(settlementMonth)
&& Common.isEmpty(deptNo) && Common.isEmpty(empName)) {
tSalaryAccountService.exportError(response, "请输入查询条件");
} else if (Common.isNotNull(settlementMonth) && Common.isEmpty(empIdCard) && Common.isEmpty(settleDepartId)
&& Common.isEmpty(deptNo) && Common.isEmpty(empName)) {
tSalaryAccountService.exportError(response, "结算月需配合其他查询条件一起使用,请输入其他查询条件!");
} else {
tSalaryAccountService.exportAsso(response, searchVo, CommonConstants.TWO_INT);
}
}
/** /**
* @Author fxj * @Author fxj
* @Description 获取工资条 * @Description 获取工资条
...@@ -236,68 +262,22 @@ public class TSalaryAccountController { ...@@ -236,68 +262,22 @@ public class TSalaryAccountController {
**/ **/
@Operation(description = "获取工资条") @Operation(description = "获取工资条")
@GetMapping("/getEmpAccount") @GetMapping("/getEmpAccount")
public R<TSalaryDetailVo> getEmpAccount(String empIdcard, String settleDepartId, String settlementMonth public R<IPage<TSalaryAccount>> getEmpAccount(Page<TSalaryAccount> page, TSalaryAccountSearchVo searchVo) {
, String deptNo, String deptName, String empName) { String empIdCard = searchVo.getEmpIdcard();
TSalaryDetailVo salaryDetailVo = new TSalaryDetailVo(); String settleDepartId = searchVo.getDeptId();
if (Common.isEmpty(empIdcard) && Common.isEmpty(settleDepartId) && Common.isEmpty(settlementMonth) String settlementMonth = searchVo.getSettlementMonth();
&& Common.isEmpty(deptNo) && Common.isEmpty(deptName) && Common.isEmpty(empName)) { String deptNo = searchVo.getDeptNo();
String empName = searchVo.getEmpName();
if (Common.isEmpty(empIdCard) && Common.isEmpty(settleDepartId) && Common.isEmpty(settlementMonth)
&& Common.isEmpty(deptNo) && Common.isEmpty(empName)) {
return R.failed("请输入查询条件"); return R.failed("请输入查询条件");
} }
if (Common.isNotNull(settlementMonth) && Common.isEmpty(empIdcard) && Common.isEmpty(settleDepartId) if (Common.isNotNull(settlementMonth) && Common.isEmpty(empIdCard) && Common.isEmpty(settleDepartId)
&& Common.isEmpty(deptNo) && Common.isEmpty(deptName) && Common.isEmpty(empName)) { && Common.isEmpty(deptNo) && Common.isEmpty(empName)) {
return R.failed("结算月需配合其他查询条件一起使用,请输入其他查询条件!"); return R.failed("结算月需配合其他查询条件一起使用,请输入其他查询条件!");
} }
//报账表 return new R<>(tSalaryAccountService.getEmpAccountPage(page, searchVo));
TSalaryAccount salaryAccount = new TSalaryAccount();
salaryAccount.setDeleteFlag(SalaryConstants.NOT_DELETE);
if (Common.isNotNull(empIdcard)) {
salaryAccount.setEmpIdcard(empIdcard);
}
if (Common.isNotNull(settleDepartId)) {
salaryAccount.setDeptId(settleDepartId);
}
if (Common.isNotNull(settlementMonth) && settlementMonth.length() == 6) {
salaryAccount.setSettlementMonth(settlementMonth);
}
QueryWrapper<TSalaryAccount> queryWrapperSa = new QueryWrapper<>();
queryWrapperSa.setEntity(salaryAccount);
if (Common.isNotNull(empName)) {
queryWrapperSa.eq("EMP_NAME", empName);
}
if (Common.isNotNull(deptNo)) {
queryWrapperSa.eq("DEPT_NO", deptNo);
}
if (Common.isNotNull(settleDepartId)) {
queryWrapperSa.eq("DEPT_ID", settleDepartId);
}
if (Common.isNotNull(settlementMonth) && settlementMonth.length() < 6) {
queryWrapperSa.eq("SETTLEMENT_MONTH", settlementMonth);
}
queryWrapperSa.orderByAsc("SETTLEMENT_MONTH");
List<TSalaryAccount> salaryAccountList = tSalaryAccountService.list(queryWrapperSa);
Map<String, String> accountTitle = new HashMap<>();
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);
if (itemList != null && itemList.size() > CommonConstants.ZERO_INT) {
for (TSalaryAccountItem items : itemList) {
accountTitle.put(items.getCnName(), items.getJavaFiedName());
}
}
a.setSaiList(itemList);
}
}
salaryDetailVo.setSalaryAccountList(salaryAccountList);
salaryDetailVo.setAccountTitle(accountTitle);
return new R<>(salaryDetailVo);
} }
......
...@@ -47,6 +47,12 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> { ...@@ -47,6 +47,12 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
@Param("tSalaryAccount") TSalaryAccount tSalaryAccount, @Param("tSalaryAccount") TSalaryAccount tSalaryAccount,
@Param("deptNos") List<String> deptNos); @Param("deptNos") List<String> deptNos);
IPage<TSalaryAccount> getEmpAccountPage(Page<TSalaryAccount> page, @Param("tSalaryAccount") TSalaryAccount tSalaryAccount);
int getEmpAccountCount(@Param("tSalaryAccount") TSalaryAccount tSalaryAccount);
List<TSalaryAccount> getEmpAccountExport(@Param("tSalaryAccount") TSalaryAccount tSalaryAccount);
List<TSalaryAccount> getTSalaryAccountPageDataByIds(@Param("tSalaryAccount") TSalaryAccount tSalaryAccount, List<TSalaryAccount> getTSalaryAccountPageDataByIds(@Param("tSalaryAccount") TSalaryAccount tSalaryAccount,
@Param("ids") List<String> ids); @Param("ids") List<String> ids);
......
...@@ -44,6 +44,15 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> { ...@@ -44,6 +44,15 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
* @return * @return
*/ */
IPage<TSalaryAccount> getTSalaryAccountPage(Page<TSalaryAccount> page, TSalaryAccountSearchVo tSalaryAccount); IPage<TSalaryAccount> getTSalaryAccountPage(Page<TSalaryAccount> page, TSalaryAccountSearchVo tSalaryAccount);
/**
* @Description: 项目薪酬查询-工资条查询
* @Author: hgw
* @Date: 2025/4/18 14:58
* @return: com.baomidou.mybatisplus.core.metadata.IPage<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount>
**/
IPage<TSalaryAccount> getEmpAccountPage(Page<TSalaryAccount> page, TSalaryAccountSearchVo searchVo);
/** /**
* @Author fxj * @Author fxj
* @Description 薪资报账导出统一导出限制 * @Description 薪资报账导出统一导出限制
......
...@@ -568,6 +568,73 @@ ...@@ -568,6 +568,73 @@
</where> </where>
order by a.CREATE_TIME desc order by a.CREATE_TIME desc
</select> </select>
<!--项目薪酬查询-工资条查询-导出条数-->
<select id="getEmpAccountCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM
<if test="settlementMonth == null or settlementMonth.trim() >= '202201' ">
t_salary_account a
</if>
<if test="settlementMonth != null and settlementMonth.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
where a.DELETE_FLAG = 0
<include refid="tSalaryAccount_where"/>
</select>
<!--项目薪酬查询-工资条查询-导出-->
<select id="getEmpAccountExport" resultMap="tSalaryAccountMap">
SELECT
a.SALARY_MONTH,
if(a.DISTRIBUTION_FLAG='1','发放成功',if(a.DISTRIBUTION_FLAG='2','发放失败','未发放')) DISTRIBUTION_FLAG,
a.SETTLEMENT_MONTH,
a.DEPT_NAME,
a.EMP_NAME,
a.BANK_NO,
a.BANK_NAME,
a.EMP_IDCARD,
if(a.SALARY_STYLE='0','现金',if(a.SALARY_STYLE='1','转账','线下')) SALARY_STYLE,
a.DEDU_SOCIAL_MONTH,
a.DEDU_PROVIDENT_MONTH,
if(a.SOCIAL_PRIORITY='0','生成','缴纳') SOCIAL_PRIORITY,
if(a.FUND_PRIORITY='0','生成','缴纳') FUND_PRIORITY,
if(a.ANNUAL_BONUS_TYPE='0','合并','单独') ANNUAL_BONUS_TYPE,
if(a.IS_DEDUCT_SOCIAL='0','否','是') IS_DEDUCT_SOCIAL,
if(a.IS_DEDUCT_FUND='0','否','是') IS_DEDUCT_FUND
FROM
<if test="settlementMonth == null or settlementMonth.trim() >= '202201' ">
t_salary_account a
</if>
<if test="settlementMonth != null and settlementMonth.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
where a.DELETE_FLAG = 0
<include refid="tSalaryAccount_where"/>
order by a.SETTLEMENT_MONTH asc
<if test="searchVo != null">
<if test="searchVo.limitStart != null">
limit #{searchVo.limitStart},#{searchVo.limitEnd}
</if>
</if>
</select>
<!--项目薪酬查询-工资条查询-->
<select id="getEmpAccountPage" resultMap="tSalaryAccountMap">
SELECT
<include refid="Base_Column_List"/>
FROM
<if test="settlementMonth == null or settlementMonth.trim() >= '202201' ">
t_salary_account a
</if>
<if test="settlementMonth != null and settlementMonth.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
where a.DELETE_FLAG = 0
<include refid="tSalaryAccount_where"/>
order by a.SETTLEMENT_MONTH asc
</select>
<!--tSalaryAccount简单分页查询--> <!--tSalaryAccount简单分页查询-->
<select id="getTSalaryAccountPageDataByIds" resultMap="tSalaryAccountMap"> <select id="getTSalaryAccountPageDataByIds" resultMap="tSalaryAccountMap">
SELECT SELECT
......
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