Commit a150a913 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.6.3' into develop

# Conflicts:
#	yifu-salary/yifu-salary-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/salary/service/impl/TSalaryStandardOriginalServiceImpl.java
parents 1a8ca625 58dd59d5
......@@ -26,4 +26,8 @@ public class EmpDispatchAddVo implements Serializable {
* 员工项目档案
**/
Map<String,EmpProjectDispatchVo> projectsMap;
/**
* 员工项目档案更新 岗位等信息
**/
Map<String,EmpProjectDispatchVo> projectsUpdateMap;
}
......@@ -197,4 +197,10 @@ public class EmpProjectDispatchVo implements Serializable {
*/
@Schema(description ="试用期(单位月)")
private String tryPeriod;
/**
* 是否更新岗位信息
*/
@Schema(description ="是否更新岗位信息")
private Boolean postUpdate;
}
......@@ -116,4 +116,6 @@ public interface TEmployeeProjectMapper extends BaseMapper<TEmployeeProject> {
int updateChangeById(@Param("project")TEmployeeProject project);
void updateContractStatus(@Param("empId") String empId, @Param("deptId") String deptId, @Param("status")int status);
int updatePostByEmpDeptNo(@Param("deptNo")String deptNo, @Param("post")String post,@Param("empIdcard")String empIdcard);
}
......@@ -26,7 +26,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
......@@ -261,4 +260,6 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
void updateChangeById(TEmployeeProject oldEmpProject);
void updateContractStatus(String empId, String deptId, int status);
void updatePostByEmpDeptNo(String deptNo, String post, String empIdcard);
}
......@@ -2182,8 +2182,12 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
Map<String, EmpContractDispatchVo> contractsMap = addVo.getContractsMap();
//员工项目档案
Map<String, EmpProjectDispatchVo> projectsMap = addVo.getProjectsMap();
//员工项目档案更新岗位等信息
Map<String, EmpProjectDispatchVo> projectsUpdateMap = addVo.getProjectsUpdateMap();
// 新增档案
saveEmp(empAddsMap);
// 更新项目档案的岗位信息
updateProjectPost(projectsUpdateMap);
// 新增项目档案不需要返回ID
saveProject(empAddsMap, projectsMap);
// 新增合同
......@@ -2429,6 +2433,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
EmpAddDispatchVo emp;
for (Map.Entry<String, EmpProjectDispatchVo> entry : projectsMap.entrySet()) {
projectAdd = entry.getValue();
if (Common.isNotNull(projectAdd.getPostUpdate()) && projectAdd.getPostUpdate()){
continue;
}
try {
if (Common.isNotNull(projectAdd)) {
project = new TEmployeeProject();
......@@ -2470,6 +2477,17 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
}
private void updateProjectPost(Map<String, EmpProjectDispatchVo> projectsMap) {
if (Common.isNotNull(projectsMap)) {
EmpProjectDispatchVo projectAdd;
for (Map.Entry<String, EmpProjectDispatchVo> entry : projectsMap.entrySet()) {
projectAdd = entry.getValue();
if (Common.isNotNull(projectAdd.getPostUpdate()) && projectAdd.getPostUpdate()) {
tEmployeeProjectService.updatePostByEmpDeptNo(projectAdd.getDeptNo(), projectAdd.getPost(), projectAdd.getEmpIdcard());
}
}
}
}
/**
* @Description: 更新人员档案的商险状态
......
......@@ -1861,6 +1861,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
baseMapper.updateContractStatus(empId,deptId,status);
}
@Override
public void updatePostByEmpDeptNo(String deptNo, String post, String empIdcard) {
baseMapper.updatePostByEmpDeptNo(deptNo,post,empIdcard);
}
/**
* @param tEmployeeContractInfo
* @Description: 保存审核操作记录
......
......@@ -1067,4 +1067,9 @@
set CONTRACT_STATUS = #{status}
WHERE a.EMP_ID=#{empId} and a.DEPT_ID=#{deptId}
</update>
<update id="updatePostByEmpDeptNo" >
update t_employee_project a
set a.POST = #{post}
WHERE a.DEPT_NO=#{deptNo} and a.EMP_IDCARD=#{empIdcard} and a.DELETE_FLAG ='0'
</update>
</mapper>
......@@ -599,4 +599,12 @@ public class TSalaryAccount extends BaseEntity {
@ExcelProperty(value = "导入行号")
private Integer rowIndex;
// 额外给前端导出使用的
@TableField(exist = false)
@ExcelProperty("企业(职业)年金")
private String enterpriseAnnuity;
@TableField(exist = false)
@ExcelProperty("个人代扣金额")
private String pdeductionMoney;
}
......@@ -103,7 +103,9 @@ public class TSalaryAtta extends BaseEntity {
@ExcelProperty("链接ID")
private String linkId;
/**
* 类型:0工资;1工程工资;2暂停发;3自定义项暂停发;4打印记录;5核准表打印记录;6:非扣税项;8自有员工附件;9财务回执附件;10换人换卡;11薪资原表;12劳务费或稿酬已有发薪记录;13薪资特殊值(3500、5000)
* 类型:0工资;1工程工资;2暂停发;3自定义项暂停发;4打印记录;5核准表打印记录;6:非扣税项;8自有员工附件
* ;9财务回执附件;10换人换卡;11薪资原表;12劳务费或稿酬已有发薪记录;13薪资特殊值(3500、5000)
* 14:薪资详情导出组装的附件
*/
@ExcelAttribute(name = "类型")
@HeadFontStyle(fontHeightInPoints = 11)
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* 薪资详情里的报账导出-EKP附件专用
* 薪资详情里的报账导出,是前端导出,此处后端导出,给EKP项目订单获取附件使用的
*
* @author hgw
* @date 2024-4-18 17:04:21
*/
@Data
@Schema(description = "薪资详情里的报账导出-EKP附件专用")
@HeadFontStyle(fontHeightInPoints = 11)
public class TSalaryAccountExportByEkpVo {
// 薪酬状态,项目名称,项目编码,发放月份,薪酬月份,员工姓名,身份证号,手机号码,银行卡号,开户行总行
// ,应发工资,个人社保,个人公积金,个税,年终奖单独扣税税费,企业(职业)年金,个人代扣金额,个人实发合计,单位社保,单位公积金
// ,减除费用,累计子女教育,累计继续教育,累计住房贷款利息,累计住房租金,累计赡养老人,累计3岁以下婴幼儿照护,累计个人养老金,年终奖扣税方案,开户行省
// ,开户行市,开户行支行,工资发放方式,工资发放时间,社保缴纳月份,公积金缴纳月份,社保优先级,公积金优先级,是否扣除社保,是否扣除公积金
// ,本月是否重复金额,是否自有员工,是否薪资特殊值,支出结算状态
@ExcelProperty("薪酬状态")
private String status;
@ExcelProperty("项目名称")
private String deptName;
@ExcelProperty("项目编码")
private String deptNo;
@ExcelProperty("发放月份")
private String settlementMonth;
@ExcelProperty("薪酬月份")
private String salaryMonth;
@ExcelProperty("员工姓名")
private String empName;
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelProperty("手机号码")
private String empPhone;
// 银行卡号
@ExcelProperty("银行卡号")
private String bankNo;
// 开户行总行
@ExcelProperty("开户行总行")
private String bankName;
// ,应发工资,个人社保,个人公积金,个税,年终奖单独扣税税费,企业(职业)年金,个人代扣金额,个人实发合计,单位社保,单位公积金
@ExcelProperty("应发工资")
private BigDecimal relaySalary;
@ExcelProperty("个人社保")
private BigDecimal personSocial;
@ExcelProperty("个人公积金")
private BigDecimal personFund;
@ExcelProperty("个税")
private BigDecimal salaryTax;
@ExcelProperty(value = "年终奖单独扣税税费")
private BigDecimal annualBonusTax;
@ExcelProperty("企业(职业)年金")
private BigDecimal enterpriseAnnuity;
@ExcelProperty("个人代扣金额")
private String pdeductionMoney;
@ExcelProperty("个人实发合计")
private BigDecimal actualSalary;
@ExcelProperty("单位社保")
private BigDecimal unitSocial;
@ExcelProperty("单位公积金")
private BigDecimal unitFund;
// ,减除费用,累计子女教育,累计继续教育,累计住房贷款利息,累计住房租金,累计赡养老人,累计3岁以下婴幼儿照护,累计个人养老金,年终奖扣税方案,开户行省
@ExcelProperty("减除费用")
private BigDecimal costReduction;
@ExcelProperty(value = "累计子女教育")
private BigDecimal sumChildEduMoney;
@ExcelProperty(value = "累计继续教育")
private BigDecimal sumContinuingEducationMoney;
@ExcelProperty(value = "累计住房贷款利息")
private BigDecimal sumHousingLoanMoney;
@ExcelProperty(value = "累计住房租金")
private BigDecimal sumHousingRentMoney;
@ExcelProperty(value = "累计赡养老人")
private BigDecimal sumSupportElderlyMoney;
@ExcelProperty(value = "累计3岁以下婴幼儿照护")
private BigDecimal sumBabyMoney;
@ExcelProperty(value = "累计个人养老金")
private BigDecimal sumPrivatePension;
// 年终奖扣税方案0:合并;1:单独
@ExcelProperty("年终奖扣税方案")
private String annualBonusType;
// 开户行省
@ExcelProperty("开户行省")
private String bankProvince;
// ,开户行市,开户行支行,工资发放方式,工资发放时间,社保缴纳月份,公积金缴纳月份,社保优先级,公积金优先级,是否扣除社保,是否扣除公积金
// 开户行市
@ExcelProperty("开户行市")
private String bankCity;
// 开户行支行
@ExcelProperty("开户行支行")
private String bankSubName;
// 工资发放方式(0现金/1银行)/2线下
@ExcelProperty("工资发放方式")
private String salaryStyle;
// 工资发放时间(0立即发、1暂停发)
@ExcelProperty("工资发放时间")
private String salaryGiveTime;
// 社保缴纳月份
@ExcelProperty("社保缴纳月份")
private String deduSocialMonth;
// 公积金缴纳月份
@ExcelProperty("公积金缴纳月份")
private String deduProvidentMonth;
// 社保优先级0:生成月;1:缴纳月
@ExcelProperty("社保优先级")
private String socialPriority;
// 公积金优先级0:生成月;1:缴纳月
@ExcelProperty("公积金优先级")
private String fundPriority;
// 是否扣除社保 0:否,1:是
@ExcelProperty("是否扣除社保")
private String isDeductSocial;
// 是否扣除公积金 0:否,1:是
@ExcelProperty("是否扣除公积金")
private String isDeductFund;
// ,本月是否重复金额,是否自有员工,是否薪资特殊值,支出结算状态
// 本月是否重复金额0:否;1:是重复导入的
@ExcelProperty("本月是否重复金额")
private String isRepeat;
// 是否自有员工0:否;1:是自有员工
@ExcelProperty("是否自有员工")
private String ownFlag;
// 是否含有特殊金额
@ExcelProperty("是否薪资特殊值")
private String haveSpecialFlag;
@ExcelProperty("支出结算状态")
private String paySettleFlag;
/*@ExcelProperty("免个税个人代扣")
private BigDecimal exemptionPersionTax;
@ExcelProperty("是否劳务费")
private String formType;
@ExcelProperty("计税月份")
private String taxMonth;
@ExcelProperty("出账单位")
private String invoiceTitle;
@ExcelProperty("业务类型分类")
private String businessPrimaryType;
@ExcelProperty("业务类型二级分类")
private String businessSecondType;
@ExcelProperty("业务类型三级分类")
private String businessThirdType;
@ExcelProperty("年终奖")
private BigDecimal annualBonus;
@ExcelProperty("通讯补贴(不计税)")
private BigDecimal phoneSubsidy;
@ExcelProperty("表单上传人")
private String createName;
@ExcelProperty("个人代扣明细")
private String pdeductionDetail;
@ExcelProperty("结算单位")
private String unitName;
@ExcelProperty("结算单位编码")
private String unitNo;*/
}
......@@ -17,11 +17,14 @@
package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAtta;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAttaService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -49,7 +52,7 @@ public class TSalaryAttaController {
private final TSalaryAttaService tSalaryAttaService;
private OSSUtil ossUtil;
private final OSSUtil ossUtil;
/**
* @param recordId 工程薪资暂停发发放记录的id
......@@ -149,4 +152,33 @@ public class TSalaryAttaController {
return R.ok("删除失败!");
}
/**
* 获取附件
* @author hgw
* @return R
*/
@Operation(summary = "获取薪资原表附件--EKP调用接口", description = "获取薪资原表附件--EKP调用接口")
@SysLog("获取薪资原表附件--EKP调用接口")
@GetMapping("/getFileByApplyNo")
public R<SalaryAttaVo> getFileByApplyNo(@RequestParam String applyNo) {
// * linkType 类型:0工资;1工程工资;2暂停发;3自定义项暂停发;4打印记录;5核准表打印记录;6:非扣税项;8自有员工附件
// * ;9财务回执附件;10换人换卡;11薪资原表;12劳务费或稿酬已有发薪记录;13薪资特殊值(3500、5000)
// * 14:薪资详情导出组装的附件
List<TSalaryAtta> attaList = tSalaryAttaService.list(Wrappers.<TSalaryAtta>query().lambda()
.eq(TSalaryAtta::getLinkType,14)
.eq(TSalaryAtta::getLinkId, applyNo));
SalaryAttaVo vo = new SalaryAttaVo();
if (attaList != null && !attaList.isEmpty()) {
URL url;
TSalaryAtta a = attaList.get(0);
url = ossUtil.getObjectUrl(null, a.getAttaSrc());
vo.setAttaName(a.getAttaName());
vo.setAttaUrl(url.toString().replace("http","https"));
} else {
// 获取薪资报账,转化为excel,上传到系统,然后将附件名称与地址返回
vo = tSalaryAttaService.getSalaryAccountToExcel(applyNo);
}
return R.ok(vo);
}
}
......@@ -113,6 +113,9 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
List<TSalaryAccount> getAccountListBySalaryId(@Param("searchVo") TSalaryAccountSearchVo searchVo);
// 导出报账专用hgw
List<TSalaryAccountExportByEkpVo> getAccountListByApplyNo(@Param("applyNo") String applyNo);
/**
* @Description: 根据工资id,返回报账明细(字段较少且有计算,其他地方勿用)
* @Author: hgw
......
......@@ -24,10 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAccountAndItemVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SettlementFormVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSumVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
......@@ -78,6 +75,15 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
**/
List<TSalaryAccount> getAccountListBySalaryId(TSalaryAccountSearchVo searchVo);
/**
* @param applyNo 薪酬申请编号
* @Description: 导出报账专用hgw
* @Author: hgw
* @Date: 2024/4/18 11:00
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount>
**/
List<TSalaryAccountExportByEkpVo> getAccountListByApplyNo(String applyNo);
/**
* @param settleId
* @param settleMonth
......
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAtta;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
......@@ -98,4 +99,14 @@ public interface TSalaryAttaService extends IService<TSalaryAtta> {
void updateAttaByLinkId(List<String> salaryAttaIds, String linkId);
void setSrc(List<TSalaryAtta> attaList);
/**
* @param applyNo
* @Description: 获取薪资报账,转化为excel,上传到系统,然后将附件名称与地址返回
* @Author: hgw
* @Date: 2024/4/18 10:26
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo
**/
SalaryAttaVo getSalaryAccountToExcel(String applyNo);
}
......@@ -198,6 +198,18 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
return baseMapper.getAccountListBySalaryId(searchVo);
}
/**
* @param applyNo
* @Description: 导出报账专用hgw
* @Author: hgw
* @Date: 2024/4/18 11:00
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount>
**/
@Override
public List<TSalaryAccountExportByEkpVo> getAccountListByApplyNo(String applyNo) {
return baseMapper.getAccountListByApplyNo(applyNo);
}
private int noPageCountDiy(TSalaryAccountSearchVo searchVo) {
return baseMapper.noPageCountDiy(searchVo,searchVo.getIdList());
}
......
......@@ -16,37 +16,39 @@
*/
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.alibaba.excel.EasyExcelFactory;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
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.TSalaryAtta;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAttaMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAttaService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import io.swagger.v3.oas.annotations.Operation;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountExportByEkpVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -63,6 +65,7 @@ public class TSalaryAttaServiceImpl extends ServiceImpl<TSalaryAttaMapper, TSala
private final OSSUtil ossUtil;
private final TSalaryStandardService tSalaryStandardService;
private final TSalaryAccountService tSalaryAccountService;
/**
* 薪资结算附件表简单分页查询
......@@ -281,4 +284,53 @@ public class TSalaryAttaServiceImpl extends ServiceImpl<TSalaryAttaMapper, TSala
}
}
/**
* @param applyNo
* @Description: 获取薪资报账,转化为excel,上传到系统,然后将附件名称与地址返回
* @Author: hgw
* @Date: 2024/4/18 17:05
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAttaVo
**/
@Override
public synchronized SalaryAttaVo getSalaryAccountToExcel(String applyNo) {
SalaryAttaVo returnVo = new SalaryAttaVo();
List<TSalaryAccountExportByEkpVo> accountList = tSalaryAccountService.getAccountListByApplyNo(applyNo);
if (accountList != null) {
String filePath = "salaryAccountFile";
String fileName = "薪资报表"+ applyNo + DateUtil.getThisTime() + CommonConstants.XLSX;
String key = filePath + "/" + fileName;
EasyExcelFactory.write(filePath, TSalaryAccountExportByEkpVo.class).sheet("薪资报表生成").doWrite(accountList);
try {
File file = new File(filePath);
InputStream inputStream = new FileInputStream(file);
// 调用上传服务
boolean flag = ossUtil.uploadFileByStream(inputStream, key,null);
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
TSalaryAtta salaryAtta = this.saveTSalaryAtta(fileName, key, file.length(), applyNo, 14, null, null, null);
try {
this.save(salaryAtta);
} catch (Exception e) {
log.error("OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
}
URL url = ossUtil.getObjectUrl(null, salaryAtta.getAttaSrc());
returnVo.setAttaUrl(url.toString());
returnVo.setAttaName(salaryAtta.getAttaName());
return returnVo;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
//删除临时文件
try {
org.apache.commons.io.FileUtils.forceDelete(new File(filePath));
} catch (IOException e) {
e.printStackTrace();
}
}
}
return returnVo;
}
}
......@@ -102,6 +102,87 @@
<result property="isDiff" column="IS_DIFF"/>
</resultMap>
<resultMap id="tSalaryAccountWebExportMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
<id property="id" column="ID"/>
<result property="invoiceTitle" column="INVOICE_TITLE"/>
<result property="salaryFormId" column="SALARY_FORM_ID"/>
<result property="salaryMonth" column="SALARY_MONTH"/>
<result property="empId" column="EMP_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="bankNo" column="BANK_NO"/>
<result property="bankName" column="BANK_NAME"/>
<result property="deptId" column="DEPT_ID"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="unitId" column="UNIT_ID"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="salaryStyle" column="SALARY_STYLE"/>
<result property="salaryGiveTime" column="SALARY_GIVE_TIME"/>
<result property="distributionFlag" column="DISTRIBUTION_FLAG"/>
<result property="deduSocialMonth" column="DEDU_SOCIAL_MONTH"/>
<result property="deduProvidentMonth" column="DEDU_PROVIDENT_MONTH"/>
<result property="formType" column="FORM_TYPE"/>
<result property="settlementMonth" column="SETTLEMENT_MONTH"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="socialPriority" column="SOCIAL_PRIORITY"/>
<result property="fundPriority" column="FUND_PRIORITY"/>
<result property="annualBonusType" column="ANNUAL_BONUS_TYPE"/>
<result property="taxMonth" column="TAX_MONTH"/>
<result property="isDeductSocial" column="IS_DEDUCT_SOCIAL"/>
<result property="isDeductFund" column="IS_DEDUCT_FUND"/>
<result property="province" column="PROVINCE"/>
<result property="city" column="CITY"/>
<result property="town" column="TOWN"/>
<result property="empPhone" column="EMP_PHONE"/>
<result property="ownFlag" column="OWN_FLAG"/>
<result property="isRepeat" column="IS_REPEAT"/>
<result property="bankSubName" column="BANK_SUB_NAME"/>
<result property="bankProvince" column="BANK_PROVINCE"/>
<result property="bankCity" column="BANK_CITY"/>
<result property="isPersonTax" column="IS_PERSON_TAX"/>
<result property="relaySalary" column="RELAY_SALARY"/>
<result property="actualSalary" column="ACTUAL_SALARY"/>
<result property="salaryTax" column="SALARY_TAX"/>
<result property="relaySalaryUnit" column="RELAY_SALARY_UNIT"/>
<result property="salaryTaxUnit" column="SALARY_TAX_UNIT"/>
<result property="haveSalaryFlag" column="HAVE_SALARY_FLAG"/>
<result property="haveSpecialFlag" column="HAVE_SPECIAL_FLAG"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="sendStatus" column="SEND_STATUS"/>
<result property="sendTime" column="SEND_TIME"/>
<result property="sendUser" column="SEND_USER"/>
<result property="sendUserName" column="SEND_USER_NAME"/>
<result property="sendMonth" column="SEND_MONTH"/>
<result property="orderId" column="ORDER_ID"/>
<result property="unitSocial" column="UNIT_SOCIAL"/>
<result property="personSocial" column="PERSON_SOCIAL"/>
<result property="unitFund" column="UNIT_FUND"/>
<result property="personFund" column="PERSON_FUND"/>
<result property="costReduction" column="COST_REDUCTION"/>
<result property="annualBonusTax" column="ANNUAL_BONUS_TAX"/>
<result property="sumChildEduMoney" column="SUM_CHILD_EDU_MONEY"/>
<result property="sumHousingLoanMoney" column="SUM_HOUSING_LOAN_MONEY"/>
<result property="sumHousingRentMoney" column="SUM_HOUSING_RENT_MONEY"/>
<result property="sumSupportElderlyMoney" column="SUM_SUPPORT_ELDERLY_MONEY"/>
<result property="sumContinuingEducationMoney" column="SUM_CONTINUING_EDUCATION_MONEY"/>
<result property="sumBabyMoney" column="SUM_BABY_MONEY"/>
<result property="sumPrivatePension" column="SUM_PRIVATE_PENSION"/>
<result property="incomeSettleFlag" column="INCOME_SETTLE_FLAG"/>
<result property="incomeCollectFlag" column="INCOME_COLLECT_FLAG"/>
<result property="paySettleFlag" column="PAY_SETTLE_FLAG"/>
<result property="payCollectFlag" column="PAY_COLLECT_FLAG"/>
<result property="isDiff" column="IS_DIFF"/>
<result property="enterpriseAnnuity" column="ENTERPRISE_ANNUITY"/>
<result property="pdeductionMoney" column="PDEDUCTION_MONEY"/>
</resultMap>
<!-- B端薪酬第一个统计列表 -->
<resultMap id="settlementFormVoMap" type="com.yifu.cloud.plus.v1.yifu.salary.vo.SettlementFormVo">
<result property="salaryMonth" column="SALARY_MONTH"/>
......@@ -871,18 +952,84 @@
</select>
<select id="getAccountListBySalaryId" resultMap="tSalaryAccountMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
<select id="getAccountListBySalaryId" resultMap="tSalaryAccountWebExportMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
SELECT
<include refid="Base_Column_List"/>
,enterpriseAnnuity.SALARY_MONEY as ENTERPRISE_ANNUITY
,sum(ifnull(pdeduction.SALARY_MONEY,0)) PDEDUCTION_MONEY
FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201'">
t_salary_account a
left join t_salary_account_item enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
left join t_salary_account_item_hro_2021 enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item_hro_2021 pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
</if>
where a.SALARY_FORM_ID = #{searchVo.salaryFormId}
ORDER BY a.ROW_INDEX ASC
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select>
<!-- 导出报账专用hgw -->
<select id="getAccountListByApplyNo" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountExportByEkpVo">
select
a.EMP_PHONE as empPhone,
a.TAX_MONTH as taxMonth,
a.SETTLEMENT_MONTH as settlementMonth,
a.SALARY_MONTH as salaryMonth,
a.DEPT_NAME as deptName,
a.DEPT_NO as deptNo,
a.EMP_NAME as empName,
a.EMP_IDCARD as empIdcard,
if(a.RELAY_SALARY_UNIT is not null and a.RELAY_SALARY_UNIT != 0, a.RELAY_SALARY_UNIT, ifnull(a.RELAY_SALARY,0)) as relaySalary,
a.ACTUAL_SALARY as actualSalary,
ifnull(a.SALARY_TAX,0) + ifnull(a.SALARY_TAX_UNIT,0) as salaryTax,
a.ANNUAL_BONUS_TAX as annualBonusTax,
a.PERSON_SOCIAL as personSocial,
a.PERSON_FUND as personFund,
enterpriseAnnuity.SALARY_MONEY as enterpriseAnnuity,
a.UNIT_SOCIAL as unitSocial,
a.UNIT_FUND as unitFund,
a.SUM_BABY_MONEY as sumBabyMoney,
a.SUM_CHILD_EDU_MONEY as sumChildEduMoney,
a.SUM_CONTINUING_EDUCATION_MONEY as sumContinuingEducationMoney,
a.SUM_HOUSING_LOAN_MONEY as sumHousingLoanMoney,
a.SUM_HOUSING_RENT_MONEY as sumHousingRentMoney,
a.SUM_PRIVATE_PENSION as sumPrivatePension,
a.SUM_SUPPORT_ELDERLY_MONEY as sumSupportElderlyMoney,
a.COST_REDUCTION as costReduction,
sum(ifnull(pdeduction.SALARY_MONEY,0)) pdeductionMoney,
if(a.PAY_SETTLE_FLAG = '0','已结算',if(a.PAY_SETTLE_FLAG = '1','结算中',if(a.PAY_SETTLE_FLAG = '2','未结算','-'))) paySettleFlag,
case s.STATUS when 0 then '待提交' when 1 then '待审核' when 2 then '待推送明细' when 3 then '已推送待发放' when 4 then '已发放' when 5 then '审核不通过' when 6 then '确认不通过' when 7 then '财务退回' when 10 then '推送失败' when 11 then '已审核生成收入中' when 12 then '已审核生成收入失败' else '-' end as status
,a.BANK_NO as bankNo
,a.BANK_NAME as bankName
,if(a.ANNUAL_BONUS_TYPE='1','单独','合并') as annualBonusType
,ap.AREA_NAME as bankProvince
,ac.AREA_NAME as bankCity
,a.BANK_SUB_NAME as bankSubName
,if(a.SALARY_STYLE='0','现金','银行') as salaryStyle
,if(a.SALARY_GIVE_TIME='1','暂停发','立即发') as salaryGiveTime
,a.DEDU_SOCIAL_MONTH as deduSocialMonth
,a.DEDU_PROVIDENT_MONTH as deduProvidentMonth
,if(a.SOCIAL_PRIORITY='1','缴纳月','生成月') as socialPriority
,if(a.FUND_PRIORITY='1','缴纳月','生成月') as fundPriority
,if(a.IS_DEDUCT_SOCIAL='0','否','是') as isDeductSocial
,if(a.IS_DEDUCT_FUND='0','否','是') as isDeductFund
,if(a.IS_REPEAT='0','否','是') as isRepeat
,if(a.OWN_FLAG='0','否','是') as ownFlag
,if(a.HAVE_SPECIAL_FLAG='0','否','是') haveSpecialFlag
from
t_salary_account a
left join t_salary_standard s on a.SALARY_FORM_ID = s.id
left join t_salary_account_item annualBonus on annualBonus.SALARY_ACCOUNT_ID = a.id and annualBonus.JAVA_FIED_NAME = 'annualBonus'
left join t_salary_account_item enterpriseAnnuity on enterpriseAnnuity.SALARY_ACCOUNT_ID = a.id and enterpriseAnnuity.JAVA_FIED_NAME='enterpriseAnnuity'
left join t_salary_account_item pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
left join sys_area ap on ap.id=a.BANK_PROVINCE
left join sys_area ac on ac.id=a.BANK_CITY
where s.APPLY_NO = #{applyNo} and a.DELETE_FLAG = 0
GROUP BY a.id ORDER BY a.ROW_INDEX ASC
</select>
<!-- 计算收入需要的报账明细 -->
......
......@@ -450,6 +450,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Map<String,EmpContractDispatchVo> contractsMap = new HashMap<>();
//员工项目档案
Map<String,EmpProjectDispatchVo> projectsMap = new HashMap<>();
//员工项目档案更新岗位信息
Map<String,EmpProjectDispatchVo> projectsUpdateMap = new HashMap<>();
//新增社保
Map<String,TSocialInfo> socialsMap = new HashMap<>();
//新增公积金
......@@ -578,7 +580,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue;
}
// 初始化新增信息:档案、项目档案、员工合同
initAddInfo(empAddsMap, contractsMap, projectsMap, empVo, excel,user,setInfoVo,socialSet);
initAddInfo(empAddsMap, contractsMap, projectsMap, empVo, excel,user,setInfoVo,socialSet,projectsUpdateMap);
// 新增社保
initSocialAddInfo(socialsMap, empVo, socialSet, excel,socialFundMap,dispatchPart);
// 新增公积金
......@@ -603,6 +605,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
addVo.setEmpAddsMap(empAddsMap);
addVo.setContractsMap(contractsMap);
addVo.setProjectsMap(projectsMap);
addVo.setProjectsUpdateMap(projectsUpdateMap);
R<EmpDispatchAddVo> res = archivesDaprUtil.addDispatchInfo(addVo);
// 开始插入各种数据了
insertAllInfo(excelVOList, errorMessageList, empVoMap,res,socialsMap,fundsMap,socialFundAddMap,dispatchMap,excelVOTemp,dispatchPart,injury);
......@@ -1567,7 +1570,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Map<String, EmpContractDispatchVo> contracts,
Map<String, EmpProjectDispatchVo> projects,
DispatchEmpVo empVo, TDispatchImportVo excel,
YifuUser user, ProjectSetInfoVo setInfoVo, SysBaseSetInfo socialSet) {
YifuUser user, ProjectSetInfoVo setInfoVo, SysBaseSetInfo socialSet,
Map<String, EmpProjectDispatchVo> projectsUpdateMap) {
// 无档案无项目档案无合同无学历
if (Common.isEmpty(empVo) || Common.isEmpty(empVo.getId())) {
// 初始化档案
......@@ -1593,11 +1597,21 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVo)
&& Common.isNotNull(empVo.getDeptNo())
&& Common.isEmpty(empVo.getContractType())) {
// 初始化合同
initContractInfo(contracts, excel, empVo, setInfoVo, user);
}
// 有项目档案但岗位信息为空
if (Common.isNotNull(empVo)
&& Common.isNotNull(empVo.getDeptNo())
&& Common.isEmpty(empVo.getPost())
&& Common.isNotNull(excel.getPost())){
EmpProjectDispatchVo project = new EmpProjectDispatchVo();
project.setDeptNo(empVo.getDeptNo());
project.setPost(excel.getPost());
project.setEmpIdcard(empVo.getEmpIdcard());
project.setPostUpdate(true);
projectsUpdateMap.put(excel.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+excel.getSettleDomainCode(),project);
}
}
private void initSocialAddInfo(Map<String, TSocialInfo> socials,
......@@ -2387,7 +2401,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
excel.setIdCardTown(Common.isNotNullToStr(empVo.getIdCity()));
excel.setEmpNational(empVo.getEmpNational());
excel.setEmpRegisType(empVo.getEmpRegisType());
if (Common.isEmpty(excel.getPost())){
excel.setPost(empVo.getPost());
}
if (Common.isNotNull(empVo.getContractStart())){
excel.setContractStart(empVo.getContractStart());
excel.setContractEnd(empVo.getContractEnd());
......
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