Commit 135cebfe authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents bc003539 59d84fc3
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -144,6 +145,7 @@ public class TDepartSettlementInfo extends Model<TDepartSettlementInfo> {
*/
@ExcelAttribute(name = "创建时间")
@Schema(description = "创建时间", name = "createTime")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
private LocalDateTime createTime;
/**
* 最后更新人
......@@ -157,6 +159,7 @@ public class TDepartSettlementInfo extends Model<TDepartSettlementInfo> {
*/
@ExcelAttribute(name = "最后更新时间")
@Schema(description = "最后更新时间", name = "lastUpdateTime")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
private LocalDateTime lastUpdateTime;
/**
* 结算主体ID
......
......@@ -29,6 +29,7 @@ import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
/**
* 项目档案表
......@@ -364,5 +365,8 @@ public class TEmployeeProject extends BaseEntity {
@Schema(description = "员工类型多个")
@TableField(exist = false)
private String[] empNatureArray;
@TableField(exist = false)
@Schema(description = "选中的idList")
private List<String> idList;
}
......@@ -16,10 +16,12 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -328,5 +330,19 @@ public class TSettleDomain extends BaseEntity {
@Schema(description = "回款周期1-12")
private String backPayCycle;
/**
* 社保类型0:缴费库;1:预估库
*/
@ExcelAttribute(name = "社保类型0:缴费库;1:预估库")
@ExcelProperty("社保类型0:缴费库;1:预估库")
@Schema(description = "社保类型0:缴费库;1:预估库")
private String socialType;
/**
* 公积金类型0:缴费库;1:预估库
*/
@ExcelAttribute(name = "公积金类型0:缴费库;1:预估库")
@ExcelProperty("公积金类型0:缴费库;1:预估库")
@Schema(description = "公积金类型0:缴费库;1:预估库")
private String fundType;
}
......@@ -19,8 +19,10 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.Past;
......@@ -428,5 +430,15 @@ public class EmployeeProjectExportVO{
@ExcelProperty(value ="社保所在县")
private String socialTown;
private String[] socialStatusArray;
private String[] fundStatusArray;
private String[] insuranceStatusArray;
private String[] contractStatusArray;
private String[] empNatureArray;
private List<String> idList;
}
......@@ -216,7 +216,7 @@ public class TSettleDomainController {
**/
@Inner
@PostMapping("/inner/getSettleDomainVoById")
public TSettleDomainSelectVo getSettleDomainVoById(String id) {
public TSettleDomainSelectVo getSettleDomainVoById(@RequestBody String id) {
return tSettleDomainService.getSettleDomainVoById(id);
}
......@@ -229,7 +229,7 @@ public class TSettleDomainController {
**/
@Inner
@PostMapping("/inner/getInnerBySettlementId")
public TDepartSettlementInfo getInnerBySettlementId(@RequestParam String deptId) {
public TDepartSettlementInfo getInnerBySettlementId(@RequestBody String deptId) {
TDepartSettlementInfo departSettlementInfo = new TDepartSettlementInfo();
departSettlementInfo.setSettleId(deptId);
QueryWrapper<TDepartSettlementInfo> queryWrapperDs = new QueryWrapper<>();
......
......@@ -89,6 +89,11 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL).eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_INT));
if (Common.isNotNull(updateTEmployeeProject)) {
if (updateTEmployeeProject.getSocialStatus() == CommonConstants.dingleDigitIntArray[1] ||
updateTEmployeeProject.getFundStatus() == CommonConstants.dingleDigitIntArray[1]) {
return R.failed("人员在原项目中存在在途的服务,请先终止后,再进行划转");
}
TSettleDomain tSettleDomain = tSettleDomainMapper.selectOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, tEmpChangeInfo.getDeptNo()).eq(TSettleDomain::getDepartName, tEmpChangeInfo.getNewSettle())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
......@@ -172,6 +177,10 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard()).eq(TEmployeeProject::getDeptNo,excel.getOldSettleCode())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(updateTEmployeePro)) {
if (updateTEmployeePro.getSocialStatus() == CommonConstants.dingleDigitIntArray[1] ||
updateTEmployeePro.getFundStatus() == CommonConstants.dingleDigitIntArray[1]) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.QT_PROJECT_CHANGE_NOT_EXIST, excel.getOldSettleCode()));
}
if (CommonConstants.ONE_INT == updateTEmployeePro.getProjectStatus()) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.PROJECT_PERSON_DELETE_EXIT, excel.getOldSettleCode()));
} else if (Common.isNotNull(tSettleDomain)) {
......
......@@ -188,7 +188,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
check.setBankNo(tEmployeeProject.getBankNo());
check.setIdNum(tEmployeeProject.getEmpIdcard());
check.setName(tEmployeeProject.getEmpName());
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(),
daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
CheckBankNoVo vo = checkListR.getData();
......@@ -209,7 +210,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//获取项目和单位信息
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, tEmployeeProject.getDeptNo()).eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TSettleDomain::getDepartNo, tEmployeeProject.getDeptNo()).eq(TSettleDomain::getDeleteFlag,
CommonConstants.STATUS_NORMAL)
.eq(TSettleDomain::getStopFlag, CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(tSettleDomain)) {
tEmployeeProject.setDeptId(tSettleDomain.getId());
......@@ -230,12 +232,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (CommonConstants.ZERO_STRING.equals(tEmployeeProject.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
} else if (CommonConstants.ONE_STRING.equals(tEmployeeProject.getEmpNatrue()) && !CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) {
} else if (CommonConstants.ONE_STRING.equals(tEmployeeProject.getEmpNatrue()) &&
!CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
}
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfoCompare.getId(), "", tEmployeeInfoCompare, tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0],
tEmployeeInfoCompare.getId(), "", tEmployeeInfoCompare, tEmployeeInfo);
return R.ok();
}
return R.failed("未在人员档案中查到身份信息");
......@@ -292,9 +296,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
tEmployeeInfoMapper.updateById(tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfoCompare.getId(), "", tEmployeeInfoCompare, tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0],
tEmployeeInfoCompare.getId(), "", tEmployeeInfoCompare, tEmployeeInfo);
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProject.getId(), compareProject, newProject);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "",
tEmployeeProject.getId(), compareProject, newProject);
return R.ok(flag);
}
......@@ -306,7 +312,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//对比对象
TEmployeeProject compareProject = this.getById(id);
if (tEmployeeProject.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] || tEmployeeProject.getSocialStatus() != CommonConstants.dingleDigitIntArray[0] ||
if (tEmployeeProject.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] ||
tEmployeeProject.getSocialStatus() != CommonConstants.dingleDigitIntArray[0] ||
tEmployeeProject.getFundStatus() != CommonConstants.dingleDigitIntArray[0]) {
return R.failed("人员在该项目下存在进行中/未完结的服务,禁止删除");
......@@ -317,7 +324,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
baseMapper.updateById(tEmployeeProject);
//更新操作记录
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProject.getId(), compareProject, tEmployeeProject);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "",
tEmployeeProject.getId(), compareProject, tEmployeeProject);
List<TEmployeeInfo> updList = new ArrayList<>();
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
......@@ -347,7 +355,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(empId);
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[0]);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], empId, "", tEmployeeInfoOld, tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], empId,
"", tEmployeeInfoOld, tEmployeeInfo);
} else if (Common.isEmpty(empId) && !Common.isEmpty(empProId)) {
//复项
tEmployeeProjectOld = this.getById(empProId);
......@@ -381,9 +390,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() + CommonConstants.ONE_INT);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(), "", tEmployeeInfoOld, tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0],
tEmployeeInfo.getId(), "", tEmployeeInfoOld, tEmployeeInfo);
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", empProId, tEmployeeProjectOld, tEmployeeProject);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1],
"", empProId, tEmployeeProjectOld, tEmployeeProject);
} else {
tEmployeeInfoOld = tEmployeeInfoMapper.selectById(empId);
tEmployeeProjectOld = this.getById(empProId);
......@@ -391,7 +402,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeProject tEmployeeProject = this.getById(empProId);
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[0]);
this.updateById(tEmployeeProject);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", empProId, tEmployeeProjectOld, tEmployeeProject);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1],
"", empProId, tEmployeeProjectOld, tEmployeeProject);
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(empId);
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[0]);
......@@ -415,7 +427,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
tEmployeeInfo.setProjectNum(CommonConstants.ONE_INT);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], empId, "", tEmployeeInfoOld, tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], empId,
"", tEmployeeInfoOld, tEmployeeInfo);
}
} else {
return R.failed("传参为空!");
......@@ -425,72 +438,72 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
public R deleteEmpPro(TEmployeeProject tEmployeeProject) {
Long count = this.count(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getId, tEmployeeProject.getId())
.eq(TEmployeeProject::getInsuranceStatus, CommonConstants.dingleDigitIntArray[0])
.eq(TEmployeeProject::getSocialStatus, CommonConstants.dingleDigitIntArray[0])
.eq(TEmployeeProject::getFundStatus, CommonConstants.dingleDigitIntArray[0]));
if (count == CommonConstants.ONE_INT) {
if (Common.isNotNull(tEmployeeProject)) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
String code = "";
if (Common.isNotNull(tEmployeeProject)) {
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeProject.setLeaveTime(LocalDateTime.now());
this.updateById(tEmployeeProject);
if (CommonConstants.ONE_INT == tEmployeeProject.getSocialStatus()
|| CommonConstants.ONE_INT == tEmployeeProject.getFundStatus()
|| CommonConstants.ZERO_INT != tEmployeeProject.getInsuranceStatus()) {
return R.failed("人员在该项目下存在进行中/未完结的服务");
}
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeProject.setLeaveTime(LocalDateTime.now());
this.updateById(tEmployeeProject);
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
//查询该人员其他的项目档案
List<TEmployeeProject> list = this.list(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, tEmployeeProject.getEmpIdcard())
.ne(TEmployeeProject::getDeptNo, tEmployeeProject.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT));
//查询该人员其他的项目档案
List<TEmployeeProject> list = this.list(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, tEmployeeProject.getEmpIdcard())
.ne(TEmployeeProject::getDeptNo, tEmployeeProject.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT));
if (tEmployeeProject.getIsLeaveEmployee() == CommonConstants.dingleDigitIntArray[1]) {
if (Common.isNotNull(list)) {
return R.failed("该人员存在其他进行中的项目,禁止同步减档!");
}
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveReason(tEmployeeProject.getLeaveReason());
if (Common.isNotNull(tEmployeeProject.getLeaveRemark())) {
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
}
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
YifuUser user = SecurityUtils.getUser();
tEmployeeInfo.setLeaveUser(user.getId());
tEmployeeInfo.setLeaveUserName(user.getNickname());
code = CommonConstants.ONE_STRING;
} else {
//从剩下的项目档案中查找员工类型并更新
if (Common.isNotNull(list)) {
Set<String> empNatrue = list.stream().map(TEmployeeProject::getEmpNatrue).collect(Collectors.toSet());
if (empNatrue.stream().anyMatch(e -> e.equals(CommonConstants.ZERO_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
} else if (empNatrue.stream().anyMatch(e -> e.equals(CommonConstants.ONE_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
} else {
tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING);
}
}
if (tEmployeeProject.getIsLeaveEmployee() == CommonConstants.dingleDigitIntArray[1]) {
if (Common.isNotNull(list)) {
return R.failed("该人员存在其他进行中的项目,禁止同步减档!");
}
if (tEmployeeInfo.getProjectNum() != CommonConstants.ZERO_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveReason(tEmployeeProject.getLeaveReason());
if (Common.isNotNull(tEmployeeProject.getLeaveRemark())) {
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
}
tEmployeeInfoMapper.updateById(tEmployeeInfo);
TEmployeeProject newInfo = this.getById(tEmployeeProject.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(), "", tEmployeeInfoOld, tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProject.getId(), tEmployeeProjectOld, newInfo);
if (CommonConstants.ONE_STRING.equals(code)) {
return R.ok(null, "减项减档成功");
} else {
return R.ok(null, "减项成功,项目状态已更新为“已减项”");
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
YifuUser user = SecurityUtils.getUser();
tEmployeeInfo.setLeaveUser(user.getId());
tEmployeeInfo.setLeaveUserName(user.getNickname());
code = CommonConstants.ONE_STRING;
} else {
//从剩下的项目档案中查找员工类型并更新
if (Common.isNotNull(list)) {
Set<String> empNatrue = list.stream().map(TEmployeeProject::getEmpNatrue).collect(Collectors.toSet());
if (empNatrue.stream().anyMatch(e -> e.equals(CommonConstants.ZERO_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
} else if (empNatrue.stream().anyMatch(e -> e.equals(CommonConstants.ONE_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
} else {
tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING);
}
}
}
if (tEmployeeInfo.getProjectNum() != CommonConstants.ZERO_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
}
tEmployeeInfoMapper.updateById(tEmployeeInfo);
TEmployeeProject newInfo = this.getById(tEmployeeProject.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "",
tEmployeeProject.getId(), tEmployeeProjectOld, newInfo);
if (CommonConstants.ONE_STRING.equals(code)) {
return R.ok(null, "减项减档成功");
} else {
return R.ok(null, "减项成功,项目状态已更新为“已减项”");
}
}
return R.failed("人员在该项目下存在进行中/未完结的服务");
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
@Override
......@@ -575,7 +588,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 调用字典服务,渲染字典值
R<Map<String, Map<String, Map<String, String>>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
R<Map<String, Map<String, Map<String, String>>>> dictR = HttpDaprUtil.invokeMethodPost(
daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dict/inner/getDictToValue", null, Map.class, SecurityConstants.FROM_IN);
Map<String, Map<String, Map<String, String>>> dictDataMap;
Map<String, Map<String, String>> dictMap;
......@@ -610,9 +624,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
errorMessage = errorMessage.concat(" ").concat(";");
}
if (Common.isNotNull(tEmployeeProject)) {
if (tEmployeeProject.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] || tEmployeeProject.getSocialStatus() != CommonConstants.dingleDigitIntArray[0] ||
tEmployeeProject.getFundStatus() != CommonConstants.dingleDigitIntArray[0]) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessage + MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_CHANGE_NOT_EXIST)));
if (tEmployeeProject.getInsuranceStatus() != CommonConstants.dingleDigitIntArray[0] ||
tEmployeeProject.getSocialStatus() == CommonConstants.dingleDigitIntArray[1] ||
tEmployeeProject.getFundStatus() == CommonConstants.dingleDigitIntArray[1]) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessage +
MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_CHANGE_NOT_EXIST)));
} else {
TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]);
......@@ -633,7 +649,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessage + MsgUtils.getMessage(ErrorCodes.PROJECT_PERSON_SEARCH_EXIT)));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessage +
MsgUtils.getMessage(ErrorCodes.PROJECT_PERSON_SEARCH_EXIT)));
}
}
if (errorMessageList.size() > CommonConstants.ZERO_INT) {
......@@ -1143,7 +1160,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
infoUpdList.add(tEmployeeInfo);
} else {
errorList.add(new ErrorMessage(i, delProject.getEmpName() + ";" + delProject.getEmpIdcard() + ";" + delProject.getDeptNo() + ";" + "项目档案状态为已审核,禁止删除"));
errorList.add(new ErrorMessage(i, delProject.getEmpName() + ";" +
delProject.getEmpIdcard() + ";" + delProject.getDeptNo() + ";" + "项目档案状态为已审核,禁止删除"));
}
} catch (Exception e) {
log.error("项目档案批量删除异常:" + e.getMessage());
......@@ -1295,7 +1313,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
proupdateList.add(tEmployeeProject);
// 记录变更日志
TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProject.getId(), tEmployeeProjectOld, tEmployeeProject);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "",
tEmployeeProject.getId(), tEmployeeProjectOld, tEmployeeProject);
}
/**
......
......@@ -100,7 +100,7 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
@Override
public TSettleDomainSelectVo getSettleDomainVoById(String id) {
return baseMapper.selectSettleDomainSelectVosById(id);
return baseMapper.getSettleDomainVoById(id);
}
@Override
......
......@@ -71,64 +71,65 @@
<result property="exceptionRemark" column="EXCEPTION_REMARK"/>
<result property="existAdvancePayment" column="EXIST_ADVANCE_PAYMENT"/>
<result property="backPayCycle" column="BACK_PAY_CYCLE"/>
<result property="socialType" column="SOCIAL_TYPE"/>
<result property="fundType" column="FUND_TYPE"/>
</resultMap>
<sql id="Base_Column_List">
a
.
ID
,
a.DEPART_NO,
a.DEPART_NAME,
a.IS_NEW,
a.NEW_REMARK,
a.DELETE_FLAG,
a.DP_AUDIT_FLAG,
a.OLD_ID,
a.BELONG_CONTRACT,
a.DP_AUDIT_OPINION,
a.DP_AUDIT_MAN,
a.DP_AUDIT_MAN_NAME,
a.LAST_AUDIT_DATE,
a.SERVER_ITEM,
a.INCOME_BELONG,
a.INCOME_BELONG_SUB,
a.CUSTOMER_ID,
a.CREATE_USER_NAME,
a.COMMIT_USER,
a.COMMIT_USER_NAME,
a.BALANCE,
a.INVOICE_BALANCE,
a.FIRST_PASS_FLAG,
a.FIRST_PASS_TIME,
a.PROVINCE,
a.CITY,
a.TOWN,
a.STOP_FLAG,
a.employee_num,
a.STOP_DATE,
a.STOP_REASON,
a.STOP_USER,
a.STOP_USER_NAME,
a.TYPE,
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
a.MANAGER_AUDIT_OPINION,
a.MANAGER_AUDIT_MAN,
a.MANAGER_AUDIT_MAN_NAME,
a.AUDIT_TIME,
a.MANAGER_AUDIT_TIME,
a.CREATE_TYPE,
a.RELATE_FLAG,
a.EXCEPTION_REMARK,
a.EXIST_ADVANCE_PAYMENT,
a.BACK_PAY_CYCLE,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
a.ID,
a.DEPART_NO,
a.DEPART_NAME,
a.IS_NEW,
a.NEW_REMARK,
a.DELETE_FLAG,
a.DP_AUDIT_FLAG,
a.OLD_ID,
a.BELONG_CONTRACT,
a.DP_AUDIT_OPINION,
a.DP_AUDIT_MAN,
a.DP_AUDIT_MAN_NAME,
a.LAST_AUDIT_DATE,
a.SERVER_ITEM,
a.INCOME_BELONG,
a.INCOME_BELONG_SUB,
a.CUSTOMER_ID,
a.CREATE_USER_NAME,
a.COMMIT_USER,
a.COMMIT_USER_NAME,
a.BALANCE,
a.INVOICE_BALANCE,
a.FIRST_PASS_FLAG,
a.FIRST_PASS_TIME,
a.PROVINCE,
a.CITY,
a.TOWN,
a.STOP_FLAG,
a.employee_num,
a.STOP_DATE,
a.STOP_REASON,
a.STOP_USER,
a.STOP_USER_NAME,
a.TYPE,
a.BUSINESS_PRIMARY_TYPE,
a.BUSINESS_SECOND_TYPE,
a.BUSINESS_THIRD_TYPE,
a.MANAGER_AUDIT_OPINION,
a.MANAGER_AUDIT_MAN,
a.MANAGER_AUDIT_MAN_NAME,
a.AUDIT_TIME,
a.MANAGER_AUDIT_TIME,
a.CREATE_TYPE,
a.RELATE_FLAG,
a.EXCEPTION_REMARK,
a.EXIST_ADVANCE_PAYMENT,
a.BACK_PAY_CYCLE,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.SOCIAL_TYPE,
a.FUND_TYPE
</sql>
<resultMap id="tSettleDomainSelectVoMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo">
......@@ -186,7 +187,8 @@
c.customerId,
c.CUSTOMER_NAME as 'customerName',
c.CUSTOMER_CODE as 'customerCode',
c.INDUSTRY_BELONG as 'industryBelong'
c.INDUSTRY_BELONG as 'industryBelong',
t.COVER_NAME as 'businessSubjectName'
FROM
t_settle_domain a
LEFT JOIN (
......@@ -195,6 +197,7 @@
INDUSTRY_BELONG,
CUSTOMER_CODE from t_customer_info
) c ON a.CUSTOMER_ID = c.customerId
LEFT JOIN t_table_head_salary_cover t on a.id=t.DEPART_ID and t.type = 0
WHERE a.id=#{id} GROUP BY a.id
</select>
......
......@@ -300,7 +300,7 @@ public interface ErrorCodes {
*/
String ARCHIVES_PROJECT_CHANGE_NOT_EXIST = "archives.project.change.not.exist";
/**
* 该人员存在其他进行中的项目,禁止同步减档!
* 人员在原项目中存在在途的服务,请先终止后,再进行划转
*/
String QT_PROJECT_CHANGE_NOT_EXIST = "qt.project.change.not.exist";
/**
......
......@@ -99,7 +99,7 @@ archives.project.change.not.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B
archives.project.emp.lose.fee.not.empty=\u4E0D\u826F\u8BB0\u5F55\u8D39\u7528\u635F\u5931\u548C\u5176\u4ED6\u635F\u5931\u4E0D\u53EF\u540C\u65F6\u4E3A\u7A7A
qt.project.change.not.exist=\u8BE5\u4EBA\u5458\u5B58\u5728\u5176\u4ED6\u8FDB\u884C\u4E2D\u7684\u9879\u76EE\uFF0C\u7981\u6B62\u540C\u6B65\u51CF\u6863
qt.project.change.not.exist=\u4EBA\u5458\u5728\u539F\u9879\u76EE\u4E2D\u5B58\u5728\u5728\u9014\u7684\u670D\u52A1\uFF0C\u8BF7\u5148\u7EC8\u6B62\u540E\uFF0C\u518D\u8FDB\u884C\u5212\u8F6C
project.search.not.exist=\u672A\u627E\u5230\u5BF9\u5E94\u7684\u9879\u76EE\uFF0C\u8BF7\u6838\u5B9E
change.strat.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u4E0D\u80FD\u4E3A\u7A7A
......
......@@ -68,6 +68,12 @@ public class MSalaryEstimate {
@NotBlank(message = "类型:0:社保;1:公积金;不能为空")
@ExcelProperty("类型:0:社保;1:公积金;")
private Integer isSocial;
/**
* 来源类型:0:缴费库;1:预估库;
*/
@ExcelAttribute(name = "来源类型:0:缴费库;1:预估库;", isNotEmpty = true, errorInfo = "来源类型:0:缴费库;1:预估库;不能为空")
@ExcelProperty("来源类型:0:缴费库;1:预估库;")
private Integer type;
/**
* 类型:0:正常扣缴;1:无工资人员;
*/
......
......@@ -207,6 +207,18 @@ public class TSalaryAccount {
@Length(max = 1, message = "公积金优先级0:生成月;1:缴纳月不能超过1个字符")
@ExcelProperty("公积金优先级0:生成月;1:缴纳月")
private String fundPriority;
/**
* 社保类型0:缴费库;1:预估库
*/
@ExcelAttribute(name = "社保类型0:缴费库;1:预估库")
@ExcelProperty("社保类型0:缴费库;1:预估库")
private String socialType;
/**
* 公积金类型0:缴费库;1:预估库
*/
@ExcelAttribute(name = "公积金类型0:缴费库;1:预估库")
@ExcelProperty("公积金类型0:缴费库;1:预估库")
private String fundType;
/**
* 年终奖扣税方案0:合并;1:单独
*/
......
......@@ -97,6 +97,6 @@ public class TSalaryAccountItem extends Model<TSalaryAccountItem> {
* 财务类型0:工资;1:绩效;2:其他;3:劳务费
*/
@TableField(exist = false)
private String salaryType;
private String formType;
}
......@@ -227,6 +227,17 @@ public class TSalaryStandard extends BaseEntity {
@ExcelAttribute(name = "含有特殊金额的强行提交的备注")
private String haveSpecialRemark;
/**
* 本月是否重复金额0:否;1:是重复导入的
*/
@ExcelAttribute(name = "本月是否重复金额0:否;1:是重复导入的")
@ExcelProperty("本月是否重复金额0:否;1:是重复导入的")
private Integer isRepeat;
@Schema(description = "本月重复金额的备注", name = "repeatRemark")
@ExcelAttribute(name = "本月重复金额的备注")
private String repeatRemark;
/**
* 提交备注
*/
......
......@@ -4,8 +4,8 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -13,7 +13,6 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
......@@ -27,7 +26,7 @@ import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = true)
@TableName("t_special_deducation_sum")
@Tag(name = "专项扣除")
public class TSpecialDeducationSum extends Model<TSpecialDeducationSum> {
public class TSpecialDeducationSum extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* id
......@@ -35,21 +34,6 @@ public class TSpecialDeducationSum extends Model<TSpecialDeducationSum> {
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty(value = "id")
private String id;
/**
* 创建人
*/
@NotBlank(message = "创建人不能为空")
@Length(max = 32, message = "创建人不能超过32个字符")
@ExcelAttribute(name = "创建人", isNotEmpty = true, errorInfo = "创建人不能为空", maxLength = 32)
@ExcelProperty(value = "创建人")
private String createUser;
/**
* 创建时间
*/
@NotBlank(message = "创建时间不能为空")
@ExcelAttribute(name = "创建时间", isNotEmpty = true, errorInfo = "创建时间不能为空")
@ExcelProperty(value = "创建时间")
private LocalDateTime createTime;
/**
* 导入月份
*/
......
......@@ -39,9 +39,9 @@ import java.math.BigDecimal;
*/
@Data
@TableName("t_statistics_bonus")
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode()
@Schema(description = "全年一次性奖金申报表")
public class TStatisticsBonus extends BaseEntity {
public class TStatisticsBonus {
/**
* ID
......
......@@ -66,9 +66,9 @@ public class TStatisticsDeclarer {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Length(max = 20, message = "员工姓名不能超过20个字符")
@ExcelProperty("员工姓名")
@ExcelAttribute(name = "姓名", maxLength = 20)
@Length(max = 20, message = "姓名不能超过20个字符")
@ExcelProperty("姓名")
private String empName;
/**
* 身份证号
......@@ -87,14 +87,14 @@ public class TStatisticsDeclarer {
/**
* 人员状态
*/
@ExcelAttribute(name = "人员状态", maxLength = 2)
@ExcelAttribute(name = "人员状态", maxLength = 2,readConverterExp = "0=在职,1=离职")
@Length(max = 2, message = "人员状态不能超过2个字符")
@ExcelProperty("人员状态")
private String empStatus;
/**
* 任职受雇从业类型
*/
@ExcelAttribute(name = "任职受雇从业类型", maxLength = 2)
@ExcelAttribute(name = "任职受雇从业类型", maxLength = 2,readConverterExp = "0=雇员,1=其他")
@Length(max = 2, message = "任职受雇从业类型不能超过2个字符")
@ExcelProperty("任职受雇从业类型")
private String occupationType;
......@@ -108,9 +108,9 @@ public class TStatisticsDeclarer {
/**
* 本月是否申报 0 是 1 否
*/
@ExcelAttribute(name = "本月是否申报", maxLength = 1)
@Length(max = 1, message = "本是否申报不能超过1个字符")
@ExcelProperty("本是否申报")
@ExcelAttribute(name = "本期是否申报", maxLength = 1,readConverterExp = "0=是,1=否")
@Length(max = 1, message = "本是否申报不能超过1个字符")
@ExcelProperty("本是否申报")
private String isDeclare;
/**
* 不申报原因
......
......@@ -75,13 +75,6 @@ public class TStatisticsLabor {
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 工号
*/
@ExcelAttribute(name = "工号", maxLength = 32)
@Length(max = 32, message = "工号不能超过32个字符")
@ExcelProperty("工号")
private String workNo;
/**
* 证件类型
*/
......
......@@ -94,12 +94,5 @@ public class TStatisticsRemuneration {
@ExcelAttribute(name = "个税")
@ExcelProperty("个税")
private BigDecimal personalTax;
/**
* 工号
*/
@ExcelAttribute(name = "工号", maxLength = 32)
@Length(max = 32, message = "工号不能超过32个字符")
@ExcelProperty("工号")
private String workNo;
}
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 工资导入的返回vo
* @Author: hgw
* @Date: 2021/11/2 15:22
* @return:
**/
@Getter
@Setter
@ToString
public class SalaryUploadReturnVo implements Serializable {
/**
* 用于返回错误信息
*/
private List<ErrorMessage> errorInfo;
// 重复数据
private List<ErrorMessage> repeatInfo;
}
......@@ -308,5 +308,9 @@ public class TSalaryAccountVo implements Serializable {
@ExcelProperty("个税-单位承担")
private BigDecimal salaryTaxUnit;
@ExcelAttribute(name = "是否新员工(默认否)")
@ExcelProperty("是否新员工(默认否)")
private String isNewEmployee;
private List<TSalaryAccountItemVo> saiList = new ArrayList<>(); //工资组成部分明细
}
......@@ -43,9 +43,9 @@ public class TStatisticsDeclarerVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 20, isNotEmpty = true)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
@ExcelAttribute(name = "姓名", maxLength = 20, isNotEmpty = true)
@Schema(description = "姓名")
@ExcelProperty("姓名")
private String empName;
/**
* 身份证号
......@@ -57,9 +57,9 @@ public class TStatisticsDeclarerVo extends RowIndex implements Serializable {
/**
* 本月是否申报
*/
@ExcelAttribute(name = "本月是否申报", maxLength = 1, isNotEmpty = true,isDataId = true,readConverterExp = "0=是,1=否")
@Schema(description = "本是否申报")
@ExcelProperty("本是否申报")
@ExcelAttribute(name = "本期是否申报", maxLength = 1, isNotEmpty = true,readConverterExp = "0=是,1=否")
@Schema(description = "本是否申报")
@ExcelProperty("本是否申报")
private String isDeclare;
/**
* 不申报原因
......
......@@ -81,14 +81,6 @@ public class TStatisticsLaborVo extends RowIndex implements Serializable {
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 工号
*/
@Length(max = 32, message = "工号 不能超过32 个字符")
@ExcelAttribute(name = "工号", maxLength = 32)
@Schema(description = "工号")
@ExcelProperty("工号")
private String workNo;
/**
* 证件类型
*/
......
......@@ -103,13 +103,5 @@ public class TStatisticsRemunerationVo extends RowIndex implements Serializable
@Schema(description = "个税")
@ExcelProperty("个税")
private BigDecimal personalTax;
/**
* 工号
*/
@Length(max = 32, message = "工号 不能超过32 个字符")
@ExcelAttribute(name = "工号", maxLength = 32)
@Schema(description = "工号")
@ExcelProperty("工号")
private String workNo;
}
......@@ -4,6 +4,7 @@ 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.service.SalaryUploadService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryDetailVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -31,7 +32,6 @@ public class SalaryUploadController {
* @param settleDepart 结算主体id
* @param configId 配置方案id
* @param salaryType 报表类型id
* @param repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
* @Description:
* @Author: hgw
* @Date: 2019/9/11 15:21
......@@ -40,9 +40,9 @@ public class SalaryUploadController {
@Operation(description = "上传:jsonString:表格json;settleDepart:结算主体id;configId:工资配置结算月等信息的id;salaryType:工资类型")
@SysLog("上传薪资表")
@PostMapping("/upload")
public R upload(@RequestBody String jsonString, @RequestParam String settleDepart, @RequestParam String configId
, @RequestParam String salaryType, @RequestParam int repeatFlag) {
return salaryUploadService.salaryUpload(jsonString, settleDepart, configId, salaryType, repeatFlag);
public R upload(@RequestBody String jsonString, @RequestParam String settleDepart, @RequestParam(required = false) String configId
, @RequestParam String salaryType) {
return salaryUploadService.salaryUpload(jsonString, settleDepart, configId, salaryType);
}
/**
......@@ -59,4 +59,11 @@ public class SalaryUploadController {
return salaryUploadService.saveAndSubmit(savList);
}
@Operation(description = "打开结算单")
@SysLog("打开结算单")
@PostMapping("openBill")
public R<TSalaryDetailVo> openBill(@RequestParam String salaryFormId) {
return salaryUploadService.getBill(salaryFormId);
}
}
......@@ -71,7 +71,7 @@ public class TSalaryAttaController {
* @Date: 2021-12-8 15:36:58
* @return: com.yifu.cloud.v1.common.core.util.R<java.util.List < com.yifu.cloud.v1.hrms.api.entity.TSalaryAtta>>
**/
@Schema(description = "获取list(linkId, linkType链接类型:0工资;1工程工资;2暂停发;3自定义项暂停发;4打印记录;5核准表打印记录6:非扣税 7发放失败 8自有员工附件 9财务回执附件 10换人换卡附件;11薪资原表;12劳务费或稿酬已有发薪记录;13薪资特殊值(3500、5000))")
@Schema(description = "获取list(linkId, linkType链接类型:0工资;1工程工资;2暂停发;3自定义项暂停发;4打印记录;5核准表打印记录6:非扣税 7发放失败 8自有员工附件 9财务回执附件 10换人换卡附件;11薪资原表;12劳务费或稿酬已有发薪记录;13薪资特殊值(3500、5000);14本月重复金额")
@GetMapping("/getTSalaryAttaListByIdType")
public R<List<TSalaryAtta>> getTSalaryAttaListByIdType(@RequestParam String linkId, @RequestParam Integer linkType) {
return new R<>(tSalaryAttaService.getAttaListHaveSrc(linkId, linkType));
......@@ -86,7 +86,7 @@ public class TSalaryAttaController {
* @throws IOException
*/
@SysLog("薪资附件上传")
@Schema(description = "OSS文件上传接口。linkType类型:0工资;1工程工资;2暂停发;3自定义项暂停发;4薪资打印记录;5核准表打印记录;6:非扣税项;8自有员工附件;9:财务回执附件;10换人换卡附件;11薪资原表")
@Schema(description = "OSS文件上传接口。linkType类型:0工资;1工程工资;2暂停发;3自定义项暂停发;4薪资打印记录;5核准表打印记录;6:非扣税项;8自有员工附件;9:财务回执附件;10换人换卡附件;11薪资原表;12劳务费或稿酬已有发薪记录;13薪资特殊值(3500、5000);14本月重复金额")
/*@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "Form文件上传", required = true, dataType = "__file", paramType = "form"),
@ApiImplicitParam(name = "filePath", value = "文件上传路径", dataType = "String", paramType = "form"),
......
......@@ -172,6 +172,7 @@ public class TSalaryStandardController {
tApprovalRecord.setApprovalTime(DateUtil.getCurrentDateTime());
auditLogService.save(tApprovalRecord);
tSalaryStandard.setSubmitTime(new Date());
tSalaryStandard.setStatus(CommonConstants.ONE_INT);
tSalaryStandardService.updateById(tSalaryStandard);
return R.ok("提交成功!");
} else {
......
......@@ -136,7 +136,7 @@ public class TStatisticsBonusController {
@SysLog("批量删除全年一次性奖金申报表")
@PostMapping("/batchDelete")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsbonus_del')")
public R batchDelete(@RequestBody String declareMonth){
public R batchDelete(@RequestParam String declareMonth){
return tStatisticsBonusService.batchDelete(declareMonth);
}
}
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
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.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsDeclarerService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerSearchVo;
......@@ -79,7 +80,7 @@ public class TStatisticsDeclarerController {
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('salary_tstatisticsdeclarer_get')")
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
public R<TStatisticsDeclarer> getById(@PathVariable("id" ) String id) {
return R.ok(tStatisticsDeclarerService.getById(id));
......@@ -140,6 +141,20 @@ public class TStatisticsDeclarerController {
return tStatisticsDeclarerService.importDiy(file.getInputStream());
}
/**
* @param
* @Description: 生成申报人员
* @Author: huyc
* @Date: 2022-08-17 18:17:48
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Inner
@Operation(description = "生成申报人员")
@PostMapping("/inner/doStatisticsTaxDeclarer")
public R doStatisticsTaxDeclarer() {
return tStatisticsDeclarerService.doStatisticsTaxDeclarer();
}
/**
* 申报对象表 批量导出
* @author huyc
......@@ -147,7 +162,7 @@ public class TStatisticsDeclarerController {
**/
@Operation(description = "导出申报对象表 hasPermission('salary_tstatisticsdeclarer-export')")
@PostMapping("/export")
// @PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer-export')")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer-export')")
public void export(HttpServletResponse response, @RequestBody TStatisticsDeclarerSearchVo searchVo) {
tStatisticsDeclarerService.listExport(response,searchVo);
}
......
......@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsLabor;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsLaborService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsLaborSearchVo;
......@@ -36,7 +37,7 @@ import javax.servlet.http.HttpServletResponse;
/**
* 本期劳务费申报表
*
* @author hgw
* @author huyc
* @date 2022-08-05 11:40:14
*/
@RestController
......@@ -90,7 +91,7 @@ public class TStatisticsLaborController {
/**
* 本期劳务费申报表 批量导出
*
* @author hgw
* @author huyc
* @date 2022-08-05 11:40:14
**/
@Operation(description = "导出本期劳务费申报表 hasPermission('salary_tstatisticslabor-export')")
......@@ -99,4 +100,32 @@ public class TStatisticsLaborController {
public void export(HttpServletResponse response, @RequestBody TStatisticsLaborSearchVo searchVo) {
tStatisticsLaborService.listExport(response, searchVo);
}
/**
* 本期劳务费申报表 批量删除
*
* @author huyc
* @date 2022-08-14 21:31:15
**/
@Operation(description = "批量删除本期劳务费申报表 hasPermission('salary_tstatisticslabor_del')")
@SysLog("批量删除本期稿酬申报表")
@PostMapping("/batchDelete")
@PreAuthorize("@pms.hasPermission('salary_tstatisticslabor_del')")
public R batchDelete(@RequestParam String declareMonth){
return tStatisticsLaborService.batchDelete(declareMonth);
}
/**
* @param
* @Description: 生成本期劳务费
* @Author: huyc
* @Date: 2022-08-17 18:17:48
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Inner
@Operation(description = "生成本期劳务费")
@PostMapping("/inner/doStatisticsLabor")
public R doStatisticsLabor() {
return tStatisticsLaborService.doStatisticsLabor();
}
}
......@@ -47,7 +47,6 @@ public class TStatisticsRemunerationController {
private final TStatisticsRemunerationService tStatisticsRemunerationService;
/**
* 简单分页查询
*
......@@ -67,7 +66,7 @@ public class TStatisticsRemunerationController {
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('salary_tstatisticsremuneration_get')")
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<TStatisticsRemuneration> getById(@PathVariable("id") String id) {
return R.ok(tStatisticsRemunerationService.getById(id));
......@@ -99,4 +98,18 @@ public class TStatisticsRemunerationController {
public void export(HttpServletResponse response, @RequestBody TStatisticsRemunerationSearchVo searchVo) {
tStatisticsRemunerationService.listExport(response, searchVo);
}
/**
* 本期稿酬申报表 批量删除
*
* @author huyc
* @date 2022-08-14 21:31:15
**/
@Operation(description = "批量删除本期稿酬申报表 hasPermission('salary_tstatisticsremuneration_del')")
@SysLog("批量删除本期稿酬申报表")
@PostMapping("/batchDelete")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsbonus_del')")
public R batchDelete(@RequestParam String declareMonth){
return tStatisticsRemunerationService.batchDelete(declareMonth);
}
}
......@@ -13,9 +13,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.List;
/**
* 工资报账表附加-工资明细
*
......@@ -27,7 +24,7 @@ public interface TSalaryAccountItemMapper extends BaseMapper<TSalaryAccountItem>
List<TSalaryAccountItem> getTSalaryAccountItemPage(@Param("tSalaryAccountItem") TSalaryAccountItem tSalaryAccountItem);
/**
* @param settleDepartId
* @param deptId
* @param settleMonth
* @param javaFiedName
* @Description: 获取报账详情信息
......@@ -35,7 +32,7 @@ public interface TSalaryAccountItemMapper extends BaseMapper<TSalaryAccountItem>
* @Date: 2019/9/29 18:26
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.TSalaryAccountItem>
**/
List<TSalaryAccountItem> getAllTSalaryAccountItem(@Param("settleDepartId") String settleDepartId,
List<TSalaryAccountItem> getAllTSalaryAccountItem(@Param("deptId") String deptId,
@Param("settleMonth") String settleMonth, @Param("javaFiedName") String javaFiedName,
@Param("finallyYear") String finallyYear, @Param("empIdcard") String empIdcard,
@Param("accountId") String accountId);
......@@ -62,17 +59,17 @@ public interface TSalaryAccountItemMapper extends BaseMapper<TSalaryAccountItem>
List<TSalaryAccountItem> getAllItemVoList(@Param("idCardList") List<String> idCardList, @Param("invoiceTitle") String invoiceTitle);
/**
* @param settleDepartId 结算主体id
* @param deptId 结算主体id
* @param javaFiedName 属性名
* @param salaryDate 工资月
* @param salaryMonth 工资月
* @param empIdcard 身份证
* @Description: 获取前几个月总工资
* @Author: hgw
* @Date: 2019/10/29 16:51
* @return: java.math.BigDecimal
**/
BigDecimal getAllMoney(@Param("settleDepartId") String settleDepartId
, @Param("javaFiedName") String javaFiedName, @Param("salaryDate") String salaryDate
BigDecimal getAllMoney(@Param("deptId") String deptId
, @Param("javaFiedName") String javaFiedName, @Param("salaryMonth") String salaryMonth
, @Param("empIdcard") String empIdcard);
/**
......@@ -97,45 +94,45 @@ public interface TSalaryAccountItemMapper extends BaseMapper<TSalaryAccountItem>
, @Param("javaFiedName") String javaFiedName);
/**
* @param settleDepartId 结算主体id
* @param deptId 结算主体id
* @param javaFiedName 属性名
* @param salaryDate 工资月
* @param salaryMonth 工资月
* @param empIdcard 身份证
* @Description: 获取月份条数(前12个月平均工资,要除以工资月数,这里就是工资月数)
* @Author: hgw
* @Date: 2019/10/29 16:51
* @return: java.long.Integer
**/
Integer getAverageSalaryItemMonthCount(@Param("settleDepartId") String settleDepartId
, @Param("javaFiedName") String javaFiedName, @Param("salaryDate") String salaryDate
Integer getAverageSalaryItemMonthCount(@Param("deptId") String deptId
, @Param("javaFiedName") String javaFiedName, @Param("salaryMonth") String salaryMonth
, @Param("empIdcard") String empIdcard);
/**
* @param settleDepartId 结算主体id
* @param deptId 结算主体id
* @param javaFiedName 属性名
* @param salaryDate 工资月
* @param salaryMonth 工资月
* @param empIdcard 身份证
* @Description: 获取前几个月总工资
* @Author: hgw
* @Date: 2019/10/29 16:51
* @return: java.math.BigDecimal
**/
BigDecimal getEngineerAllMoney(@Param("settleDepartId") String settleDepartId
, @Param("javaFiedName") String javaFiedName, @Param("salaryDate") String salaryDate
BigDecimal getEngineerAllMoney(@Param("deptId") String deptId
, @Param("javaFiedName") String javaFiedName, @Param("salaryMonth") String salaryMonth
, @Param("empIdcard") String empIdcard);
/**
* @param settleDepartId 结算主体id
* @param deptId 结算主体id
* @param javaFiedName 属性名
* @param salaryDate 工资月
* @param salaryMonth 工资月
* @param empIdcard 身份证
* @Description: 获取月份条数(前12个月平均工资,要除以工资月数,这里就是工资月数)
* @Author: hgw
* @Date: 2019/10/29 16:51
* @return: java.long.Integer
**/
Integer getEngineerAverageSalaryItemMonthCount(@Param("settleDepartId") String settleDepartId
, @Param("javaFiedName") String javaFiedName, @Param("salaryDate") String salaryDate
Integer getEngineerAverageSalaryItemMonthCount(@Param("deptId") String deptId
, @Param("javaFiedName") String javaFiedName, @Param("salaryMonth") String salaryMonth
, @Param("empIdcard") String empIdcard);
List<TSalaryAccountItem> getAccountItemList(@Param("tSalaryAccount") TSalaryAccount tSalaryAccount
......
......@@ -24,6 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 申报对象表
*
......@@ -38,4 +40,11 @@ public interface TStatisticsDeclarerMapper extends BaseMapper<TStatisticsDeclare
* @return
*/
IPage<TStatisticsDeclarer> getTStatisticsDeclarerPage(Page<TStatisticsDeclarer> page, @Param("tStatisticsDeclarer") TStatisticsDeclarer tStatisticsDeclarer);
/**
* @param
* @Description: 统计
* @return:
**/
List<TStatisticsDeclarer> doStatisticsTaxDeclarer(@Param("nowMonth") String nowMonth, @Param("lastYear") String lastYear);
}
......@@ -23,6 +23,9 @@ import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 本期劳务费申报表
*
......@@ -37,4 +40,11 @@ public interface TStatisticsLaborMapper extends BaseMapper<TStatisticsLabor> {
* @return
*/
IPage<TStatisticsLabor> getTStatisticsLaborPage(Page<TStatisticsLabor> page, @Param("tStatisticsLabor") TStatisticsLabor tStatisticsLabor);
/**
* @param
* @Description: 统计
* @return:
**/
List<TStatisticsLabor> doStatisticsLabor(@Param("nowMonth") String nowMonth, @Param("lastYear") String lastYear);
}
......@@ -18,13 +18,13 @@ public interface SalaryUploadService extends IService<TSalaryStandard> {
/**
* @param jsonString
* @param repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
*repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
* @Description: 普通工资上传
* @Author: hgw
* @Date: 2019/9/4 15:58
* @return: com.yifu.cloud.v1.common.core.util.R
**/
R salaryUpload(String jsonString, String settleDepart, String configId, String formType, int repeatFlag);
R salaryUpload(String jsonString, String settleDepart, String configId, String formType);
/**
* @param savList
......
......@@ -58,4 +58,11 @@ public interface TStatisticsDeclarerService extends IService<TStatisticsDeclarer
* @return
*/
R updateFlagById(String id, String isDeclare, String undeclareReason);
/**
* @param
* @Description: 生成申报人员
* @return
**/
R doStatisticsTaxDeclarer();
}
......@@ -48,4 +48,17 @@ public interface TStatisticsLaborService extends IService<TStatisticsLabor> {
void listExport(HttpServletResponse response, TStatisticsLaborSearchVo searchVo);
List<TStatisticsLabor> noPageDiy(TStatisticsLaborSearchVo searchVo);
/**
* 批量删除本期劳务费申报表
* @param declareMonth 申报月份
* @return
*/
R batchDelete(String declareMonth);
/** 生成本期劳务费
* @param
* @return
**/
R doStatisticsLabor();
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.salary.entity.TStatisticsRemuneration;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsRemunerationSearchVo;
......@@ -41,4 +42,11 @@ public interface TStatisticsRemunerationService extends IService<TStatisticsRemu
void listExport(HttpServletResponse response, TStatisticsRemunerationSearchVo searchVo);
/**
* 批量删除本期稿酬申报表
* @param declareMonth 申报月份
* @return
*/
R batchDelete(String declareMonth);
}
......@@ -86,15 +86,16 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
/**
* @param jsonString 客户原表数据
* @param repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
* repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
* @Description: 普通工资上传
* @Author: hgw
* @Date: 2019/9/4 15:58
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Override
public R salaryUpload(String jsonString, String settleDepart, String configId, String salaryType, int repeatFlag) {
if (Common.isNotNull(jsonString) && Common.isNotNull(settleDepart) && Common.isNotNull(configId) && Common.isNotNull(salaryType)) {
public R salaryUpload(String jsonString, String settleDepart, String configId, String salaryType) {
if (Common.isNotNull(jsonString) && Common.isNotNull(settleDepart) && Common.isNotNull(salaryType)) {
R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/tsettledomain/inner/getSettleDomainVoById", settleDepart, TSettleDomainSelectVo.class, SecurityConstants.FROM_IN);
// 结算主体
......@@ -102,14 +103,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (sdr != null && sdr.getData() != null) {
dept = sdr.getData();
}
if (dept == null || dept.getId() == null) {
return R.failed("新建工资主表失败-获取结算主体信息为空");
}
// 2020-3-29 11:24:14变更为结算主体的封面抬头
String invoiceTitle = dept.getBusinessSubjectName();
if (Common.isEmpty(invoiceTitle)) {
return R.failed("上传失败-获取结算主体的-封面抬头-信息为空,请去<客户管理-结算主体>模块,编辑封面抬头后再导入");
}
// 薪资识别配置(原表-标准模板)
List<TSalaryConfigStandard> salaryAccountList = tSalaryConfigStandardService.list();
Map<String, TSalaryConfigStandard> salaryConfigMap = new HashMap<>(); //存放所有字段
......@@ -120,68 +114,135 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
isMustMap.put(sc.getDbFiedName(), true);
}
}
// 薪资配置-结算月、社保月等信息
TConfigSalary configSalary = configSalaryService.getById(configId);
if (dept == null || dept.getId() == null) {
return R.failed("新建工资主表失败-获取结算主体信息为空");
}
// 2020-3-29 11:24:14变更为结算主体的封面抬头
String invoiceTitle = dept.getBusinessSubjectName();
if (Common.isEmpty(invoiceTitle)) {
return R.failed("上传失败-获取结算主体的-封面抬头-信息为空,请去<客户管理-结算主体>模块,编辑封面抬头后再导入");
}
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed("获取登录用户信息失败!");
}
try {
jsonString = URLDecoder.decode(jsonString, "UTF-8").replace("=", "");
SalaryAccountUtil util1 = new SalaryAccountUtil();
TSalaryEmployee empSearch = new TSalaryEmployee();
empSearch.setUnitId(dept.getCustomerId());
List<TSalaryEmployee> empList = employeeService.list(Wrappers.<TSalaryEmployee>query().lambda()
.eq(TSalaryEmployee::getUnitId, dept.getCustomerId()));
Map<String, TSalaryEmployee> empIdCardMap = new HashMap<>();
Map<String, TSalaryEmployee> empNameMap = new HashMap<>();
boolean isDuplicateName = false;
if (empList != null) {
TSalaryEmployee es;//筛选人员,添加判断:非在职,或开户行为空,或 结算主体等于选择的结算主体且在职,都可以存入Map优先备用
for (TSalaryEmployee e : empList) {
es = empIdCardMap.get(e.getEmpIdcard());
if (es == null || CommonConstants.ZERO_INT != es.getFileStatus() || Common.isEmpty(es.getBankName())
|| (e.getDeptId().equals(settleDepart) && CommonConstants.ZERO_INT == e.getFileStatus()
&& Common.isNotNull(e.getBankName()))) {
empIdCardMap.put(e.getEmpIdcard(), e);
empNameMap.put(e.getEmpName().replace(" ", ""), e);
//薪资导入
if (CommonConstants.ZERO_STRING.equals(salaryType) && Common.isNotNull(configId)) {
// 薪资配置-结算月、社保月等信息
TConfigSalary configSalary = configSalaryService.getById(configId);
try {
jsonString = URLDecoder.decode(jsonString, "UTF-8").replace("=", "");
SalaryAccountUtil util1 = new SalaryAccountUtil();
TSalaryEmployee empSearch = new TSalaryEmployee();
empSearch.setUnitId(dept.getCustomerId());
List<TSalaryEmployee> empList = employeeService.list(Wrappers.<TSalaryEmployee>query().lambda()
.eq(TSalaryEmployee::getUnitId, dept.getCustomerId()));
Map<String, TSalaryEmployee> empIdCardMap = new HashMap<>();
Map<String, TSalaryEmployee> empNameMap = new HashMap<>();
boolean isDuplicateName = false;
if (empList != null) {
TSalaryEmployee es;//筛选人员,添加判断:非在职,或开户行为空,或 结算主体等于选择的结算主体且在职,都可以存入Map优先备用
for (TSalaryEmployee e : empList) {
es = empIdCardMap.get(e.getEmpIdcard());
if (es == null || CommonConstants.ZERO_INT != es.getFileStatus() || Common.isEmpty(es.getBankName())
|| (e.getDeptId().equals(settleDepart) && CommonConstants.ZERO_INT == e.getFileStatus()
&& Common.isNotNull(e.getBankName()))) {
empIdCardMap.put(e.getEmpIdcard(), e);
empNameMap.put(e.getEmpName().replace(" ", ""), e);
}
}
if (empNameMap.size() == empIdCardMap.size()) {
isDuplicateName = true;
}
}
if (empNameMap.size() == empIdCardMap.size()) {
isDuplicateName = true;
// 自有员工结算主体id,新员工使用
Map<String, Integer> ownDeptMap = tOwnDeptService.getOwnDeptMap();
// 自有员工所在结算主体Map
Map<String, Integer> ownEmployeeMap = tOwnDeptService.getOwnEmpMap();
// 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
Map<String, Integer> checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth()));
util1.getJsonStringToList(user, jsonString,
dept, configSalary, salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName
, salaryType, invoiceTitle, employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
List<TSalaryAccountVo> saList = util1.getEntityList();
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) {
return R.failed(util1.getErrorInfo());
} else {
if (null != saList && !saList.isEmpty()) {
// return R.ok(saList)
return this.saveAndSubmit(saList);
} else {
return R.failed("导入数据不可为空");
}
}
} catch (Exception e) {
log.error(e.getMessage());
return R.failed("数据导入解析失败!");
}
// 自有员工结算主体id,新员工使用
Map<String, Integer> ownDeptMap = tOwnDeptService.getOwnDeptMap();
// 自有员工所在结算主体Map
Map<String, Integer> ownEmployeeMap = tOwnDeptService.getOwnEmpMap();
// 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
Map<String, Integer> checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth()));
util1.getJsonStringToList(user, jsonString,
dept, configSalary, salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName
, salaryType, invoiceTitle, employeeService, checkMap, repeatFlag, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
List<TSalaryAccountVo> saList = util1.getEntityList();
SalaryUploadReturnVo returnVo = new SalaryUploadReturnVo();
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())
|| (null != util1.getRepeatInfo() && !util1.getRepeatInfo().isEmpty())) {
returnVo.setErrorInfo(util1.getErrorInfo());
returnVo.setRepeatInfo(util1.getRepeatInfo());
return R.failed(returnVo);
} else {
if (null != saList && !saList.isEmpty()) {
// return R.ok(saList)
return this.saveAndSubmit(saList);
//劳务费导入
} else if (CommonConstants.THREE_STRING.equals(salaryType)) {
TConfigSalary configSalary = new TConfigSalary();
// 薪资配置-结算月、社保月等信息
configSalary = configSalaryService.getById(CommonConstants.ONE_STRING);
try {
jsonString = URLDecoder.decode(jsonString, "UTF-8").replace("=", "");
SalaryAccountUtil util1 = new SalaryAccountUtil();
List<TSalaryEmployee> empList = employeeService.list(Wrappers.<TSalaryEmployee>query().lambda()
.eq(TSalaryEmployee::getUnitId, dept.getCustomerId()));
Map<String, TSalaryEmployee> empIdCardMap = new HashMap<>();
Map<String, TSalaryEmployee> empNameMap = new HashMap<>();
boolean isDuplicateName = false;
if (empList != null) {
TSalaryEmployee es;//筛选人员,添加判断:非在职,或开户行为空,或 结算主体等于选择的结算主体且在职,都可以存入Map优先备用
for (TSalaryEmployee e : empList) {
es = empIdCardMap.get(e.getEmpIdcard());
if (es == null || CommonConstants.ZERO_INT != es.getFileStatus() || Common.isEmpty(es.getBankName())
|| (e.getDeptId().equals(settleDepart) && CommonConstants.ZERO_INT == e.getFileStatus()
&& Common.isNotNull(e.getBankName()))) {
empIdCardMap.put(e.getEmpIdcard(), e);
empNameMap.put(e.getEmpName().replace(" ", ""), e);
}
}
if (empNameMap.size() == empIdCardMap.size()) {
isDuplicateName = true;
}
}
// 自有员工结算主体id,新员工使用
Map<String, Integer> ownDeptMap = tOwnDeptService.getOwnDeptMap();
// 自有员工所在结算主体Map
Map<String, Integer> ownEmployeeMap = tOwnDeptService.getOwnEmpMap();
// 2.6.6:校验导入数据重复的Map格式:#身份证号_工资月份_报表类型_应发金额
Map<String, Integer> checkMap = new HashMap<>();
if (Common.isNotNull(configSalary)) {
checkMap = tSalaryAccountService.getAccountCheckMap(dept.getId(), DateUtil.addMonth(configSalary.getSalaryMonth()));
}
util1.getJsonStringToList(user, jsonString, dept, !Common.isNotNull(configSalary) ? null: configSalary,
salaryConfigMap, isMustMap, empIdCardMap, empNameMap, isDuplicateName, salaryType,
null, employeeService, checkMap, ownEmployeeMap, ownDeptMap, tSalaryAccountService);
List<TSalaryAccountVo> saList = util1.getEntityList();
if ((null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty())) {
return R.failed(util1.getErrorInfo());
} else {
return R.failed("导入数据不可为空");
if (null != saList && !saList.isEmpty()) {
return this.saveLaborSubmit(saList, dept);
} else {
return R.failed("导入数据不可为空");
}
}
} catch (Exception e) {
log.error(e.getMessage());
return R.failed("数据导入解析失败!");
}
} catch (Exception e) {
log.error(e.getMessage());
return R.failed("数据导入解析失败!");
}
}
return R.failed("导入数据不可为空");
......@@ -246,6 +307,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
s.setDeptId(dept.getId());
s.setDeptName(dept.getDepartName());
s.setDeptNo(dept.getDepartNo());
s.setUnitId(dept.getCustomerId());
s.setUnitName(dept.getCustomerName());
s.setUnitNo(dept.getCustomerCode());
if (dept.getProvince() != null) {
s.setProvince(dept.getProvince());
}
......@@ -292,7 +356,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (Common.isEmpty(invoiceTitle)) {
return R.failed("新建工资主表失败-获取结算主体的-封面抬头-信息为空,请去<客户管理-结算主体>模块,编辑封面抬头后再导入");
}
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()) {
return R.failed("新建工资主表失败-获取登录人信息为空");
......@@ -369,23 +432,25 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
, List<TSalaryAccountItem> saiList, TSalaryAccountItem sai, TSettleDomainSelectVo dept
, String invoiceTitle, YifuUser user, LocalDateTime nowTime, TSalaryStandard salary
, boolean isActual) {
// 社保类型0:缴费库;1:预估库
String socialType = CommonConstants.ZERO_STRING;
if (Common.isNotNull(dept.getSocialType())) {
socialType = dept.getSocialType();
}
// 公积金类型0:缴费库;1:预估库
String fundType = CommonConstants.ZERO_STRING;
if (Common.isNotNull(dept.getFundType())) {
fundType = dept.getFundType();
}
List<TSalaryAccount> aList;
TSalaryAccount a;//定库:
List<TPaymentBySalaryVo> socialEstmateList = null; //社保预估库
List<TPaymentBySalaryVo> fundEstmateList = null; //公积金预估库
List<MSalaryPaymentRes> salaryPaymentList = salaryPaymentResService.list(Wrappers.<MSalaryPaymentRes>query().lambda()
.eq(MSalaryPaymentRes::getDeptId, dept.getId())); //薪资缴费库同步表list
Map<String, MSalaryPaymentRes> salaryPaymentMap = new HashMap<>(); //薪资缴费库同步表Map
List<TPaymentBySalaryVo> noSalarySocialEstmateList = null; //无工资人员-社保预估库
List<TPaymentBySalaryVo> noSalaryFundEstmateList = null; //无工资人员-公积金预估库
List<TPaymentBySalaryVo> noSalarySocialEstmateListCopy; //无工资人员-社保预估库-循环
List<TPaymentBySalaryVo> noSalaryFundEstmateListCopy; //无工资人员-公积金预估库-循环
TSalaryAccount a;
//定库:
List<TPaymentBySalaryVo> socialEstmateList = null; //社保缴费库
List<TPaymentBySalaryVo> fundEstmateList = null; //公积金缴费库
List<TPaymentBySalaryVo> socialForecastList = null; //社保预估库
List<TPaymentBySalaryVo> fundForecastList = null; //公积金预估库
TPaymentBySalaryVo forecast = new TPaymentBySalaryVo();
if (salaryPaymentList != null && !salaryPaymentList.isEmpty()) {
for (MSalaryPaymentRes res : salaryPaymentList) {
salaryPaymentMap.put(res.getId(), res);
}
}
//不扣社保
if (salaryAccountVo != null && !CommonConstants.ZERO_STRING.equals(salaryAccountVo.getIsDeductSocial())) {
forecast.setSettleDomainId(dept.getId());
......@@ -396,25 +461,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
} else {
forecast.setSocialPayMonth(SalaryConstants.PRIORITY_ZERO); //没优先级,则限制住
}
R<TPaymentVo> tPaymentVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/selectTPaymentBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
if (tPaymentVoR != null && tPaymentVoR.getData() != null && tPaymentVoR.getData().getPaymentList() != null) {
socialEstmateList = tPaymentVoR.getData().getPaymentList();
// 新增一步:根据同步表里的数据更新获取到的社保缴费库数据
if (!salaryPaymentMap.isEmpty()) {
MSalaryPaymentRes res;
for (TPaymentBySalaryVo vo : socialEstmateList) {
res = salaryPaymentMap.get(vo.getId());
if (res != null) {
vo.setSalarySocialFlag(res.getSalarySocialFlag());
vo.setSalaryFundFlag(res.getSalaryFundFlag());
}
}
if (CommonConstants.ZERO_STRING.equals(socialType)) {
R<TPaymentVo> tPaymentVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/selectTPaymentBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
if (tPaymentVoR != null && tPaymentVoR.getData() != null && tPaymentVoR.getData().getPaymentList() != null) {
socialEstmateList = tPaymentVoR.getData().getPaymentList();
}
}
if (CommonConstants.ONE_STRING.equals(socialType)) {
// 预估数据
R<TPaymentVo> tForecastVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tforecastlibrary/inner/selectTForecastBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
if (tForecastVoR != null && tForecastVoR.getData() != null && tForecastVoR.getData().getPaymentList() != null) {
socialForecastList = tForecastVoR.getData().getPaymentList();
}
noSalarySocialEstmateList = new ArrayList<>();
noSalarySocialEstmateList.addAll(socialEstmateList);
} else {
// TODO - 预估数据
}
}
if (salaryAccountVo != null && !CommonConstants.ZERO_STRING.equals(salaryAccountVo.getIsDeductFund())) {
......@@ -427,25 +487,20 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
} else {
forecast.setProvidentPayMonth(SalaryConstants.PRIORITY_ZERO); //没优先级,则限制住
}
R<TPaymentVo> tPaymentVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/selectTPaymentBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
if (tPaymentVoR != null && tPaymentVoR.getData() != null && tPaymentVoR.getData().getPaymentList() != null) {
fundEstmateList = tPaymentVoR.getData().getPaymentList();
// 新增一步:根据同步表里的数据更新获取到的社保缴费库数据
if (salaryPaymentMap != null && !salaryPaymentMap.isEmpty()) {
MSalaryPaymentRes res;
for (TPaymentBySalaryVo vo : fundEstmateList) {
res = salaryPaymentMap.get(vo.getId());
if (res != null) {
vo.setSalarySocialFlag(res.getSalarySocialFlag());
vo.setSalaryFundFlag(res.getSalaryFundFlag());
}
}
if (CommonConstants.ZERO_STRING.equals(fundType)) {
R<TPaymentVo> tPaymentVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/selectTPaymentBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
if (tPaymentVoR != null && tPaymentVoR.getData() != null && tPaymentVoR.getData().getPaymentList() != null) {
fundEstmateList = tPaymentVoR.getData().getPaymentList();
}
}
if (CommonConstants.ONE_STRING.equals(fundType)) {
// 预估数据
R<TPaymentVo> tForecastVoR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tforecastlibrary/inner/selectTForecastBySalaryVo", forecast, TPaymentVo.class, SecurityConstants.FROM_IN);
if (tForecastVoR != null && tForecastVoR.getData() != null && tForecastVoR.getData().getPaymentList() != null) {
fundForecastList = tForecastVoR.getData().getPaymentList();
}
noSalaryFundEstmateList = new ArrayList<>();
noSalaryFundEstmateList.addAll(fundEstmateList);
} else {
// TODO - 预估数据
}
}
aList = new ArrayList<>();
......@@ -454,10 +509,12 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
boolean modelPersonFundFlag;
boolean modelUnitSocialFlag;
boolean modelUnitFundFlag;
BigDecimal money = new BigDecimal(CommonConstants.ZERO_STRING); //初始化金额备用
BigDecimal money; //初始化金额备用
Set<String> socialList = new HashSet<>(); //社保需要存储的id
Set<String> fundList = new HashSet<>(); //公积金需要存储的id
Set<String> forecastSocialList = new HashSet<>(); //预估de社保需要存储的id
Set<String> forecastFundList = new HashSet<>(); //预估de公积金需要存储的id
BigDecimal relaySalary; //工资应发
BigDecimal relaySalarySum = BigDecimal.ZERO; //工资应发
BigDecimal personalDebt; //个人社保、公积金欠款
......@@ -497,6 +554,12 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// 年终奖是否已存在 (true:已存在,不可导入)
boolean yearEndError = false;
// 劳务费、稿酬是否含有发薪false:否;true:是
boolean haveSalaryFlag = false;
// 是否含有特殊金额false:否;true:是
boolean haveSpecialFlag = false;
// 是否重复金额false:否;true:是
boolean repeatFlag = false;
// 年终奖错误信息合计:
StringBuilder yearEndInfo = new StringBuilder();
List<String> idCardList = new ArrayList<>();
......@@ -529,30 +592,21 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
annousSai = null;
try {
SalaryAccountUtil.reflectionAttr(savList.get(i), a);
if (!haveSalaryFlag && a.getHaveSalaryFlag() != null && a.getHaveSalaryFlag() == CommonConstants.ONE_INT) {
haveSalaryFlag = true;
}
if (!haveSpecialFlag && a.getHaveSpecialFlag() != null && a.getHaveSpecialFlag() == CommonConstants.ONE_INT) {
haveSpecialFlag = true;
}
if (!repeatFlag && a.getIsRepeat() != null && a.getIsRepeat() == CommonConstants.ONE_INT) {
repeatFlag = true;
}
checkYearFinalStyle = a.getAnnualBonusType();
if (Common.isNotNull(a.getTaxMonth())) {
maxYearMonth = DateUtil.getMaxYearMonth(a.getTaxMonth());
} else if (!isLabor) {
return R.failed("获取计税月错误");
}
if (noSalarySocialEstmateList != null && noSalarySocialEstmateList.size() > CommonConstants.ZERO_INT) {
noSalarySocialEstmateListCopy = new ArrayList<>();
noSalarySocialEstmateListCopy.addAll(noSalarySocialEstmateList);
for (int j = CommonConstants.ZERO_INT; j < noSalarySocialEstmateListCopy.size(); j++) {
if (a.getEmpIdcard().equals(noSalarySocialEstmateListCopy.get(j).getEmpIdcard())) {
noSalarySocialEstmateList.remove(noSalarySocialEstmateListCopy.get(j));
}
}
}
if (noSalaryFundEstmateList != null && noSalaryFundEstmateList.size() > CommonConstants.ZERO_INT) {
noSalaryFundEstmateListCopy = new ArrayList<>();
noSalaryFundEstmateListCopy.addAll(noSalaryFundEstmateList);
for (int j = CommonConstants.ZERO_INT; j < noSalaryFundEstmateListCopy.size(); j++) {
if (a.getEmpIdcard().equals(noSalaryFundEstmateListCopy.get(j).getEmpIdcard())) {
noSalaryFundEstmateList.remove(noSalaryFundEstmateListCopy.get(j));
}
}
}
if (savList.get(i).getSaiList() != null && !savList.get(i).getSaiList().isEmpty()) {
saiList = new ArrayList<>();
annousSai = null;
......@@ -600,30 +654,32 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
if (Common.isEmpty(a.getIsDeductSocial()) || SalaryConstants.IS_DEDUCT_ONE.equals(a.getIsDeductSocial())) {
a.setSocialType(socialType);
a.setIsDeductSocial(SalaryConstants.IS_DEDUCT_ONE);
//社保公积金金额扣缴: true : 从库里扣除社保等;false : 走代扣
if (modelPersonSocialFlag) {
personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.PERSONAL_SOCIAL,
SalaryConstants.PERSONAL_SOCIAL_JAVA,
this.getSocialOrFundMoneyForForecast(deptSet, a.getEmpIdcard(), socialEstmateList, money, true, true, socialList, fundList), CommonConstants.ONE_INT));
this.getSocialOrFundMoneyForForecast(socialType, deptSet, a.getEmpIdcard(), socialEstmateList, socialForecastList, true, true, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ONE_INT));
}
if (modelUnitSocialFlag) {
this.saveNewItems(sai, saiList, SalaryConstants.UNIT_SOCIAL,
SalaryConstants.UNIT_SOCIAL_JAVA,
this.getSocialOrFundMoneyForForecast(deptSet, a.getEmpIdcard(), socialEstmateList, money, true, false, socialList, fundList), CommonConstants.ZERO_INT);
this.getSocialOrFundMoneyForForecast(socialType, deptSet, a.getEmpIdcard(), socialEstmateList, socialForecastList, true, false, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ZERO_INT);
}
}
if (Common.isEmpty(a.getIsDeductFund()) || SalaryConstants.IS_DEDUCT_ONE.equals(a.getIsDeductFund())) {
a.setFundType(fundType);
a.setIsDeductFund(SalaryConstants.IS_DEDUCT_ONE);
if (modelPersonFundFlag) {
personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.PERSONAL_FUND,
SalaryConstants.PERSONAL_FUND_JAVA,
this.getSocialOrFundMoneyForForecast(deptSet, a.getEmpIdcard(), fundEstmateList, money, false, true, socialList, fundList), CommonConstants.ONE_INT));
this.getSocialOrFundMoneyForForecast(fundType, deptSet, a.getEmpIdcard(), fundEstmateList, fundForecastList, false, true, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ONE_INT));
}
if (modelUnitFundFlag) {
this.saveNewItems(sai, saiList, SalaryConstants.UNIT_FUND,
SalaryConstants.UNIT_FUND_JAVA,
this.getSocialOrFundMoneyForForecast(deptSet, a.getEmpIdcard(), fundEstmateList, money, false, false, socialList, fundList), CommonConstants.ZERO_INT);
this.getSocialOrFundMoneyForForecast(fundType, deptSet, a.getEmpIdcard(), fundEstmateList, fundForecastList, false, false, socialList, fundList, forecastSocialList, forecastFundList), CommonConstants.ZERO_INT);
}
}
}
......@@ -695,7 +751,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
//年终奖优化方案 2:自动计算
if (CommonConstants.TWO_STRING.equals(checkYearFinalStyle)) {
checkYearFinalStyle = checkYearFinalStyle(isActual, saiList, checkYearFinalStyle, asList, sdSum
, costReduction, personTax, sai, saiList, relaySalary, annualBonus, annousTax);
, costReduction, personTax, sai, saiList, relaySalary, annualBonus, annousTax, a);
}
//年终奖单独扣税
if (CommonConstants.ONE_STRING.equals(checkYearFinalStyle)) {
......@@ -713,20 +769,19 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
}
}
// 薪资扣税 1:扣税
//if (Common.isNotNull(a.getSalaryTaxFlag()) && CommonConstants.ONE.equals(a.getSalaryTaxFlag())) {
// 应发顺推个税
if (!isActual) {
personalDebt = personalDebt.add(this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculation2PersonSalary(isActual, saiList, checkYearFinalStyle, asList, sdSum
, costReduction, personTax, sai, saiList, relaySalary), CommonConstants.ZERO_INT));
, costReduction, personTax, sai, saiList, relaySalary, a), CommonConstants.ZERO_INT));
} else {
// 实发倒推个税应发
if (!isLabor) {
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculation2PersonSalary(isActual, saiList, checkYearFinalStyle, asList, sdSum
, costReduction, personTax, sai, saiList, relaySalary), CommonConstants.ZERO_INT);
, costReduction, personTax, sai, saiList, relaySalary, a), CommonConstants.ZERO_INT);
} else {
// 实发劳务费,按月累计扣税 2022-3-2 17:32:40 樊青青提的需求
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
......@@ -734,9 +789,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
calculation2Labor(saiList, asList
, saiList), CommonConstants.ZERO_INT);
}
}
//}
if (!isActual) { //导入应发,顺推实发
// 个人实发合计
......@@ -762,88 +815,94 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
salary.setOwnMoney(ownMoney);
TSalaryDetailVo salaryDetailVo = new TSalaryDetailVo();
salaryDetailVo.setSalaryAccountList(aList);
// 版本2.7.3.3 2022-1-13 20:54:34 洪光武变更:不同步缴费库,改为存放在同步表,定时任务更新(或社保服务变更缴费库时更新)
/*String str = SalaryCommonUtil.setToStrEasy(socialList);
if (Common.isNotNull(str)) {
//更新社保状态为-待结算
R<String> socialR = archivesProperties.updatePaymentSocialStatusByIdStr(str, CommonConstants.ONE, SecurityConstants.FROM_IN);
if (socialR == null || socialR.getCode() != CommonConstants.SUCCESS) {
throw new RuntimeException((null == socialR ? "调用社保同步结算中状态服务异常,请重试!" : socialR.getMsg()));
}
}
str = SalaryCommonUtil.setToStrEasy(fundList);
if (Common.isNotNull(str)) {
//更新公积金状态为-待结算
R<String> fundR = archivesProperties.updatePaymentFundStatusByIdStr(str, CommonConstants.ONE, SecurityConstants.FROM_IN);
if (fundR == null || fundR.getCode() != CommonConstants.SUCCESS) {
throw new RuntimeException((null == fundR ? "调用公积金同步结算中状态服务异常,请重试!" : fundR.getMsg()));
}
}*/
salary.setSettlementAmount(relaySalarySum);
salary.setHaveSalaryFlag(CommonConstants.ZERO_INT);
salary.setHaveSpecialFlag(CommonConstants.ZERO_INT);
salary.setIsRepeat(CommonConstants.ZERO_INT);
salary.setStatus(SalaryConstants.AUDIT_STATUS[0]);
if (haveSalaryFlag || haveSpecialFlag || ownNum>0 || repeatFlag) {
if (haveSalaryFlag) {
salary.setHaveSalaryFlag(CommonConstants.ONE_INT);
}
if (haveSpecialFlag) {
salary.setHaveSpecialFlag(CommonConstants.ONE_INT);
}
if (repeatFlag) {
salary.setIsRepeat(CommonConstants.ONE_INT);
}
}
if (!socialList.isEmpty()) {
//更新社保状态为-已结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/updatePaymentSocialStatusToSettle", socialList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
}
if (!fundList.isEmpty()) {
//更新公积金状态为-已结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/updatePaymentFundStatusToSettle", fundList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
}
if (!forecastSocialList.isEmpty()) {
//更新社保状态为-已结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tforecastlibrary/inner/updateForecastSocialStatusToSettle", forecastSocialList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
}
if (!forecastFundList.isEmpty()) {
//更新公积金状态为-已结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tforecastlibrary/inner/updateForecastFundStatusToSettle", forecastFundList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
}
//保存工资表
tSalaryStandardService.save(salary);
// 获取上一个工资条顺序,复制:
tSalaryStandardSetService.copyLastSetByDeptId(salary.getId(), dept.getId(), String.valueOf(user.getId()));
// 保存后,修改结算预警统计中的结算状态
List<String> deptIdList = new ArrayList<>();
deptIdList.add(dept.getId());
salaryDetailVo.setSalary(salary);
MSalaryEstimate se;
// 新增一步:增加同步表
MSalaryPaymentRes res;
Map<String, MSalaryPaymentRes> saveResMap = new HashMap<>();
if (socialList != null && !socialList.isEmpty()) {
if (!socialList.isEmpty()) {
for (String estId : socialList) {
se = new MSalaryEstimate();
se.setSalaryId(salary.getId());
se.setEstimateId(estId);
se.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO);
se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO);
se.setType(CommonConstants.ZERO_INT);
mSalaryEstimateService.save(se);
res = salaryPaymentMap.get(estId);
if (res == null) {
res = new MSalaryPaymentRes();
res.setId(estId);
res.setDeptId(dept.getId());
}
res.setSalarySocialFlag(CommonConstants.ONE_STRING);
saveResMap.put(estId, res);
}
}
if (fundList != null && !fundList.isEmpty()) {
if (!fundList.isEmpty()) {
for (String estId : fundList) {
se = new MSalaryEstimate();
se.setSalaryId(salary.getId());
se.setEstimateId(estId);
se.setIsSocial(SalaryConstants.IS_FUND_ONE);
se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO);
se.setType(CommonConstants.ZERO_INT);
mSalaryEstimateService.save(se);
}
}
if (!forecastSocialList.isEmpty()) {
for (String estId : forecastSocialList) {
se = new MSalaryEstimate();
se.setSalaryId(salary.getId());
se.setEstimateId(estId);
se.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO);
se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO);
se.setType(CommonConstants.ONE_INT);
mSalaryEstimateService.save(se);
res = saveResMap.get(estId);
if (res == null) {
res = salaryPaymentMap.get(estId);
}
if (res == null) {
res = new MSalaryPaymentRes();
res.setId(estId);
res.setDeptId(dept.getId());
}
res.setSalaryFundFlag(CommonConstants.ONE_STRING);
saveResMap.put(estId, res);
}
}
// 开始更新res
if (saveResMap != null && !saveResMap.isEmpty()) {
Iterator<MSalaryPaymentRes> iter = saveResMap.values().iterator();
while (iter.hasNext()) {
res = iter.next();
salaryPaymentResService.saveOrUpdate(res);
if (!forecastFundList.isEmpty()) {
for (String estId : forecastFundList) {
se = new MSalaryEstimate();
se.setSalaryId(salary.getId());
se.setEstimateId(estId);
se.setIsSocial(SalaryConstants.IS_FUND_ONE);
se.setIsNoSalary(SalaryConstants.NOT_IS_NO_SALARY_ZERO);
se.setType(CommonConstants.ONE_INT);
mSalaryEstimateService.save(se);
}
}
TPauseSalary ps;
......@@ -896,7 +955,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<TSalaryAccountItem> backList = new ArrayList<>();
if (itemList != null && !itemList.isEmpty()) {
for (TSalaryAccountItem item : itemList) {
if (!"3".equals(item.getSalaryType()) && Integer.parseInt(item.getSettlementMonth()) >= maxYearMonth) {
if (!"3".equals(item.getFormType()) && Integer.parseInt(item.getSettlementMonth()) >= maxYearMonth) {
backList.add(item);
}
}
......@@ -916,7 +975,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
List<TSalaryAccountItem> backList = new ArrayList<>();
if (itemList != null && !itemList.isEmpty()) {
for (TSalaryAccountItem item : itemList) {
if ("3".equals(item.getSalaryType()) && settleMonth.equals(item.getSettlementMonth())) {
if ("3".equals(item.getFormType()) && settleMonth.equals(item.getSettlementMonth())) {
backList.add(item);
}
}
......@@ -1025,7 +1084,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
/**
* @param estmateList 预估库数据列表
* @param idNumber 身份证
* @param money 金额
* @param isSocial true:社保 false:公积金
* @param isPerson true:个人 false:单位
* @param socialList 预估库id,社保list
......@@ -1035,53 +1093,66 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
* @Date: 2019/9/26 15:38
* @return: java.math.BigDecimal
**/
public BigDecimal getSocialOrFundMoneyForForecast(TDepartSettlementInfo deptSet, String idNumber
, List<TPaymentBySalaryVo> estmateList, BigDecimal money, boolean isSocial, boolean isPerson
, Set<String> socialList, Set<String> fundList) {
money = SalaryConstants.B_ZERO;
public BigDecimal getSocialOrFundMoneyForForecast(String socialFundType, TDepartSettlementInfo deptSet, String idNumber
, List<TPaymentBySalaryVo> estmateList, List<TPaymentBySalaryVo> forecastList, boolean isSocial, boolean isPerson
, Set<String> socialList, Set<String> fundList, Set<String> forecastSocialList, Set<String> forecastFundList) {
BigDecimal money = SalaryConstants.B_ZERO;
BigDecimal sub = SalaryConstants.B_ZERO;
if (isSocial) {
if (deptSet.getUnitSeriousIllnessProp() != null
if (isSocial && deptSet.getUnitSeriousIllnessProp() != null
&& deptSet.getUnitSeriousIllnessProp().compareTo(SalaryConstants.B_ONEHUNDRED) == SalaryConstants.LESS_THAN) {
sub = (new BigDecimal("100").subtract(deptSet.getUnitSeriousIllnessProp()))
.divide(SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
}
//sub = sub.divide(SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)
sub = (new BigDecimal("100").subtract(deptSet.getUnitSeriousIllnessProp()))
.divide(SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
}
if (estmateList != null && estmateList.size() > CommonConstants.ZERO_INT) {
money = money.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
for (TPaymentBySalaryVo m : estmateList) {
if (Common.isNotNull(idNumber) && idNumber.equals(m.getEmpIdcard())) {
//社保
if (isSocial && (!Common.isNotNull(m.getSalarySocialFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalarySocialFlag()))
&& (m.getPersonalSocialSum() != null || m.getUnitSocialSum() != null)) {
if (isPerson && m.getPersonalSocialSum() != null) {
money = money.add(m.getPersonalSocialSum());
if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL
&& m.getUnitBitmailmentFee() != null) {
money = money.add(m.getUnitBitmailmentFee().multiply(sub));
}
}
if (!isPerson && m.getUnitSocialSum() != null) {
money = money.add(m.getUnitSocialSum());
if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL
&& m.getUnitBitmailmentFee() != null) {
money = money.subtract(m.getUnitBitmailmentFee().multiply(sub));
}
if (CommonConstants.ZERO_STRING.equals(socialFundType) && estmateList != null && !estmateList.isEmpty()) {
money = this.getSocialFundMoney(idNumber, estmateList, isSocial, isPerson, socialList, fundList, money, sub);
}
// 缴费库没找到,从预估库找
if (CommonConstants.ONE_STRING.equals(socialFundType) && forecastList != null && !forecastList.isEmpty()) {
money = this.getSocialFundMoney(idNumber, forecastList, isSocial, isPerson, forecastSocialList, forecastFundList, money, sub);
}
return money;
}
/**
* @Description: 按类型拉取社保公积金
* @Author: hgw
* @Date: 2022/8/17 11:38
* @return: java.math.BigDecimal
**/
private BigDecimal getSocialFundMoney(String idNumber, List<TPaymentBySalaryVo> estmateList, boolean isSocial
, boolean isPerson, Set<String> socialList, Set<String> fundList, BigDecimal money, BigDecimal sub) {
money = money.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
for (TPaymentBySalaryVo m : estmateList) {
if (Common.isNotNull(idNumber) && idNumber.equals(m.getEmpIdcard())) {
//社保
if (isSocial && (!Common.isNotNull(m.getSalarySocialFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalarySocialFlag()))
&& (m.getPersonalSocialSum() != null || m.getUnitSocialSum() != null)) {
if (isPerson && m.getPersonalSocialSum() != null) {
money = money.add(m.getPersonalSocialSum());
if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL
&& m.getUnitBitmailmentFee() != null) {
money = money.add(m.getUnitBitmailmentFee().multiply(sub));
}
socialList.add(m.getId());
}
//公积金
if (!isSocial && (!Common.isNotNull(m.getSalaryFundFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalaryFundFlag()))
&& (m.getPersonalFundSum() != null || m.getUnitFundSum() != null)) {
if (isPerson && m.getPersonalFundSum() != null) {
money = money.add(m.getPersonalFundSum());
}
if (!isPerson && m.getUnitFundSum() != null) {
money = money.add(m.getUnitFundSum());
if (!isPerson && m.getUnitSocialSum() != null) {
money = money.add(m.getUnitSocialSum());
if (sub.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.EQUAL
&& m.getUnitBitmailmentFee() != null) {
money = money.subtract(m.getUnitBitmailmentFee().multiply(sub));
}
fundList.add(m.getId());
}
socialList.add(m.getId());
}
//公积金
if (!isSocial && (!Common.isNotNull(m.getSalaryFundFlag()) || CommonConstants.ZERO_STRING.equals(m.getSalaryFundFlag()))
&& (m.getPersonalFundSum() != null || m.getUnitFundSum() != null)) {
if (isPerson && m.getPersonalFundSum() != null) {
money = money.add(m.getPersonalFundSum());
}
if (!isPerson && m.getUnitFundSum() != null) {
money = money.add(m.getUnitFundSum());
}
fundList.add(m.getId());
}
}
}
......@@ -1147,7 +1218,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
private static BigDecimal calculation2PersonSalary(boolean isActual, List<TSalaryAccountItem> itemList
, String checkYearFinalStyle, List<TSalaryAccountItem> itemHistoryList, BigDecimal specialDeductionSum
, BigDecimal costReduction, List<TSalaryTaxConfig> subs, TSalaryAccountItem sai
, List<TSalaryAccountItem> saiList, BigDecimal relaySalary) {
, List<TSalaryAccountItem> saiList, BigDecimal relaySalary, TSalaryAccount a) {
//本次纳税额
BigDecimal res = SalaryConstants.B_ZERO;
BigDecimal annualBonus = SalaryConstants.B_ZERO;
......@@ -1168,9 +1239,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
realDeduSalary = realDeduSalary.add(item.getSalaryMoney());
actualSalarySumNow = actualSalarySumNow.add(item.getSalaryMoney());
}
/*if (SalaryConstants.ANNUAL_BONUS_TAX_JAVA.equals(item.getJavaFiedName())) {
sumTax = sumTax.add(item.getSalaryMoney());
}*/
if (CommonConstants.ONE_INT == item.getIsTax()) {
res = res.subtract(item.getSalaryMoney());
realDeduSalary = realDeduSalary.subtract(item.getSalaryMoney());
......@@ -1186,9 +1254,6 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (SalaryConstants.SALARY_TAX_JAVA.equals(item.getJavaFiedName())) {
sumTax = sumTax.add(item.getSalaryMoney());
}
/*if (SalaryConstants.ANNUAL_BONUS_TAX_JAVA.equals(item.getJavaFiedName())) {
sumTax = sumTax.add(item.getSalaryMoney());
}*/
if (SalaryConstants.RELAY_SALARY_JAVA.equals(item.getJavaFiedName())) {
res = res.add(item.getSalaryMoney());
realSalaryHistory = realSalaryHistory.add(item.getSalaryMoney());
......@@ -1204,18 +1269,12 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (specialDeductionSum != null) {
res = res.subtract(specialDeductionSum);
realDeduSalary = realDeduSalary.subtract(specialDeductionSum);
//addRelaySalary = addRelaySalary.add(specialDeductionSum);
}
if (costReduction != null) {
res = res.subtract(costReduction);
realDeduSalary = realDeduSalary.subtract(costReduction);
addRelaySalary = addRelaySalary.add(costReduction);
}
//不合并年终奖扣税
/*if (CommonConstants.ONE.equals(checkYearFinalStyle)) {
res = res.subtract(annualBonus);
addRelaySalary = addRelaySalary.add(annualBonus);
}*/
if (!isActual) {
for (TSalaryTaxConfig sub : subs) {
if (res.compareTo(sub.getMinIncome()) == SalaryConstants.MORE_THAN
......@@ -1238,7 +1297,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
for (TSalaryTaxConfig sub : subs) {
//res = realDeduSalary / (1- (double) ((sub.getTaxRate() * 1.0) / 100))
// - (sub.getQuick()/ (1- (double) ((sub.getTaxRate() * 1.0) / 100)))
// + addRelaySalary;
// + addRelaySalary
res = realDeduSalary.divide(new BigDecimal("1").subtract(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)), SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)
.subtract(sub.getQuickDeducation().divide(new BigDecimal("1").subtract(new BigDecimal(sub.getWithholdingRate()).divide(
......@@ -1260,8 +1319,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
sai.setIsTax(CommonConstants.ZERO_INT);
if (res.compareTo(SalaryConstants.B_ZERO) != SalaryConstants.MORE_THAN) {
sai.setSalaryMoney(actualSalarySumNow);
a.setRelaySalary(actualSalarySumNow);
} else {
sai.setSalaryMoney(relaySalary);
a.setRelaySalary(relaySalary);
}
saiList.add(sai);
break;
......@@ -1271,7 +1332,9 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (res.compareTo(SalaryConstants.B_ZERO) == SalaryConstants.LESS_THAN) {
return SalaryConstants.B_ZERO;
}
return res.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
res = res.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
a.setSalaryTax(res);
return res;
}
......@@ -1359,9 +1422,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
public static String checkYearFinalStyle(boolean isActual, List<TSalaryAccountItem> itemList
, String checkYearFinalStyle, List<TSalaryAccountItem> asList, BigDecimal sdSum
, BigDecimal costReduction, List<TSalaryTaxConfig> personTax, TSalaryAccountItem sai
, List<TSalaryAccountItem> saiList, BigDecimal relaySalary, BigDecimal annualBonus, List<TSalaryTaxConfig> annousTax) {
, List<TSalaryAccountItem> saiList, BigDecimal relaySalary, BigDecimal annualBonus
, List<TSalaryTaxConfig> annousTax, TSalaryAccount a) {
BigDecimal finalSalaryWithSalary = calculation2PersonSalary(isActual, saiList, checkYearFinalStyle, asList, sdSum
, costReduction, personTax, sai, saiList, relaySalary);
, costReduction, personTax, sai, saiList, relaySalary, a);
BigDecimal finalSalaryNoSalary = calculation2FinalSalary(annualBonus, annousTax);
if (finalSalaryWithSalary.compareTo(finalSalaryNoSalary) == SalaryConstants.MORE_THAN) {
return "1";
......@@ -1415,4 +1479,316 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
return new R<>(salaryDetailVo);
}
/**
* @param savList 报账表Vo
* @Description: 保存并提交
* @Author: huyc
* @Date: 2022/8/16
* @return: com.yifu.cloud.v1.common.core.util.R
**/
public R saveLaborSubmit(List<TSalaryAccountVo> savList, TSettleDomainSelectVo dept) {
if (Common.isNotNull(savList) && !savList.isEmpty()) {
TSalaryAccountVo salaryAccountVo = savList.get(0);
List<TSalaryAccountItem> saiList = null; //报账明细List
TSalaryAccountItem sai = null; //报账明细
YifuUser user = SecurityUtils.getUser();
TSalaryStandard salary;
LocalDateTime nowTime = LocalDateTime.now();
//工资主表
R<TSalaryStandard> sr = this.saveNewTSalary(salaryAccountVo, dept, user, nowTime);
String invoiceTitle = dept.getBusinessSubjectName();
if (sr == null || sr.getCode() == CommonConstants.FAIL) {
return sr;
} else {
salary = sr.getData();
}
boolean isActual = false; //false:应发导入; true:实发 倒推导入
List<TSalaryAccountItemVo> itemList = salaryAccountVo.getSaiList();
for (TSalaryAccountItemVo item : itemList) {
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(item.getJavaFiedName())) {
isActual = true;
break;
}
}
if (salary != null) {
// 薪资导入、删除前加锁:
TSalaryLock lock = salaryLockService.lambdaQuery()
.eq(TSalaryLock::getDeptId, dept.getId())
.eq(TSalaryLock::getDeleteFlag, CommonConstants.ZERO_INT)
.last("limit 1").one();
if (lock != null && Common.isNotNull(lock.getId())) {
return R.failed("当前结算主体已被用户锁定,请稍等!超过10分钟还没释放,请联系管理员!当前时间:" + nowTime);
} else {
lock = new TSalaryLock();
lock.setCreateTime(nowTime);
lock.setDeleteFlag(CommonConstants.ZERO_INT);
lock.setDeptId(dept.getId());
lock.setDeptName(dept.getDepartName());
lock.setSettleMonth(salaryAccountVo.getSettlementMonth());
lock.setType(CommonConstants.ZERO_INT);
salaryLockService.save(lock);
TSalaryLock lockUpdate;
try {
// 薪资核心导入代码
return this.doLaborCoreSalary(savList, salaryAccountVo, saiList, sai, dept, invoiceTitle, user, nowTime, salary, isActual);
} catch (Exception e) {
lockUpdate = new TSalaryLock();
lockUpdate.setId(lock.getId());
lockUpdate.setDeleteFlag(CommonConstants.ONE_INT);
salaryLockService.updateById(lockUpdate);
throw new RuntimeException(e.getMessage() == null ? "薪资导入失败!" : e.getMessage());
} finally {
lockUpdate = new TSalaryLock();
lockUpdate.setId(lock.getId());
lockUpdate.setDeleteFlag(CommonConstants.ONE_INT);
if (Common.isNotNull(salary.getId())) {
lockUpdate.setSalaryId(salary.getId());
lockUpdate.setSettleMoney(salary.getSettlementAmount());
}
salaryLockService.updateById(lockUpdate);
}
}
} else {
return R.failed("新建工资主表失败");
}
}
return R.failed("提交的数据不可为空");
}
/**
* @Description: 劳务费导入核心代码
* @Author: huyc
* @return: com.yifu.cloud.v1.common.core.util.R
**/
public R doLaborCoreSalary(List<TSalaryAccountVo> savList, TSalaryAccountVo salaryAccountVo
, List<TSalaryAccountItem> saiList, TSalaryAccountItem sai, TSettleDomainSelectVo dept
, String invoiceTitle, YifuUser user, LocalDateTime nowTime, TSalaryStandard salary
, boolean isActual) {
List<TSalaryAccount> aList = new ArrayList<>();
TSalaryAccount a;//定库:
BigDecimal money = new BigDecimal(CommonConstants.ZERO_STRING); //初始化金额备用
BigDecimal relaySalarySum = BigDecimal.ZERO; //工资应发
List<TSalaryAccountItem> asList; //累计扣税
// 历史个税合计
BigDecimal sumTax = BigDecimal.ZERO;
int size = savList.size();
// 自有员工人数
int ownNum = 0;
// 自有员工应发金额
BigDecimal ownMoney = BigDecimal.ZERO;
BigDecimal relaySalary; //工资应发
// 劳务费、稿酬是否含有发薪false:否;true:是
boolean haveSalaryFlag = false;
// 是否含有特殊金额false:否;true:是
boolean haveSpecialFlag = false;
// 是否重复金额false:否;true:是
boolean repeatFlag = false;
List<String> idCardList = new ArrayList<>();
for (TSalaryAccountVo vo : savList) {
if (Common.isNotNull(vo.getEmpIdcard())) {
idCardList.add(vo.getEmpIdcard());
}
}
// 工资查询所需的全部list,组装Map来使用
Map<String, List<TSalaryAccountItem>> itemMap = tSalaryAccountItemService.getAllItemVoList(idCardList, invoiceTitle);
for (int i = CommonConstants.ZERO_INT; i < size; i++) {
relaySalary = BigDecimal.ZERO;
a = new TSalaryAccount();
// 本次实发
BigDecimal actualSalarySumNow = BigDecimal.ZERO;
// 当月实发合计
BigDecimal actualSalarySum = BigDecimal.ZERO;
try {
SalaryAccountUtil.reflectionAttr(savList.get(i), a);
if (!haveSalaryFlag && a.getHaveSalaryFlag() != null && a.getHaveSalaryFlag() == CommonConstants.ONE_INT) {
haveSalaryFlag = true;
}
if (!haveSpecialFlag && a.getHaveSpecialFlag() != null && a.getHaveSpecialFlag() == CommonConstants.ONE_INT) {
haveSpecialFlag = true;
}
if (!repeatFlag && a.getIsRepeat() != null && a.getIsRepeat() == CommonConstants.ONE_INT) {
repeatFlag = true;
}
if (savList.get(i).getSaiList() != null && !savList.get(i).getSaiList().isEmpty()) {
saiList = new ArrayList<>();
for (int j = 0; j < savList.get(i).getSaiList().size(); j++) {
sai = new TSalaryAccountItem();
SalaryAccountUtil.reflectionAttr(savList.get(i).getSaiList().get(j), sai);
//工资应发
if (SalaryConstants.RELAY_SALARY_JAVA.equals(sai.getJavaFiedName())) {
relaySalary = sai.getSalaryMoney();
relaySalarySum = relaySalarySum.add(sai.getSalaryMoney());
}
SalaryAccountUtil.reflectionAttr(savList.get(i).getSaiList().get(j), sai);
//个人实发合计
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(sai.getJavaFiedName())) {
actualSalarySum = actualSalarySum.add(sai.getSalaryMoney());
actualSalarySumNow = actualSalarySumNow.add(sai.getSalaryMoney());
}
saiList.add(sai);
}
}
// 自有员工以及自有员工应发金额
if (Common.isNotNull(a.getOwnFlag()) && a.getOwnFlag() == 1) {
ownNum++;
ownMoney = ownMoney.add(relaySalary);
}
//累计扣税list
asList = this.getLaborAsList(itemMap.get(a.getEmpIdcard()), a.getSettlementMonth());
// 实发劳务费,按月累计扣税
this.saveNewItems(sai, saiList, SalaryConstants.SALARY_TAX,
SalaryConstants.SALARY_TAX_JAVA,
calculationLabor(saiList, asList
, saiList,a), CommonConstants.ZERO_INT);
a.setSaiList(saiList);
aList.add(a);
} catch (Exception e) {
e.printStackTrace();
}
}
salary.setOwnNums(ownNum);
salary.setOwnMoney(ownMoney);
TSalaryDetailVo salaryDetailVo = new TSalaryDetailVo();
salaryDetailVo.setSalaryAccountList(aList);
salary.setSettlementAmount(relaySalarySum);
salary.setHaveSalaryFlag(CommonConstants.ZERO_INT);
salary.setHaveSpecialFlag(CommonConstants.ZERO_INT);
salary.setIsRepeat(CommonConstants.ZERO_INT);
salary.setStatus(SalaryConstants.AUDIT_STATUS[0]);
if (haveSalaryFlag || haveSpecialFlag || ownNum>0 || repeatFlag) {
if (haveSalaryFlag) {
salary.setHaveSalaryFlag(CommonConstants.ONE_INT);
}
if (haveSpecialFlag) {
salary.setHaveSpecialFlag(CommonConstants.ONE_INT);
}
if (repeatFlag) {
salary.setIsRepeat(CommonConstants.ONE_INT);
}
}
//保存工资表
tSalaryStandardService.save(salary);
salaryDetailVo.setSalary(salary);
for (TSalaryAccount account : aList) {
saiList = account.getSaiList();
account.setSaiList(null);
account.setSalaryFormId(salary.getId());
tSalaryAccountService.save(account);
money = SalaryConstants.B_ZERO;
for (TSalaryAccountItem item : saiList) {
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(item.getJavaFiedName())) {
money = item.getSalaryMoney();
}
item.setSalaryAccountId(account.getId());
tSalaryAccountItemService.save(item);
}
}
return R.ok(salaryDetailVo);
}
/**
* @param itemList
* @param itemHistoryList
* @param saiList
* @Description: 计算劳务费个税、应发
* @Author: hgw
* @Date: 2022/3/3 11:30
* @return: java.math.BigDecimal
**/
private static BigDecimal calculationLabor(List<TSalaryAccountItem> itemList, List<TSalaryAccountItem> itemHistoryList,
List<TSalaryAccountItem> saiList, TSalaryAccount a) {
// B7 = 当月实发合计
// 税=ROUND(IF(B7<=800,0,IF(B7<=3360,(B7-800)/4,IF(B7<=21000,0.16*B7/0.84,IF(B7<=49500,(0.24*B7-2000)/0.76,(0.32*B7-7000)/0.68)))),2)
// 本次实发
BigDecimal actualSalarySumNow = BigDecimal.ZERO;
// 当月实发合计
BigDecimal actualSalarySum = BigDecimal.ZERO;
// 历史个税合计
BigDecimal sumTax = BigDecimal.ZERO;
// 本次实发
for (TSalaryAccountItem item : itemList) {
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(item.getJavaFiedName())) {
actualSalarySum = actualSalarySum.add(item.getSalaryMoney());
actualSalarySumNow = actualSalarySumNow.add(item.getSalaryMoney());
}
}
// 历史实发、个税
for (TSalaryAccountItem item : itemHistoryList) {
if (SalaryConstants.SALARY_TAX_JAVA.equals(item.getJavaFiedName())) {
sumTax = sumTax.add(item.getSalaryMoney());
}
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(item.getJavaFiedName())) {
actualSalarySum = actualSalarySum.add(item.getSalaryMoney());
}
}
//个人承担部分税费
BigDecimal nowTaxT = BigDecimal.ZERO;
//个人不承担部分税费
BigDecimal nowTaxY = BigDecimal.ZERO;
BigDecimal relaySalary;
if (CommonConstants.ONE_STRING.equals(a.getIsPersonTax())) {
nowTaxT = getNowTax(actualSalarySumNow);
nowTaxY = getNowTax(actualSalarySum);
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
BigDecimal salaryTax = BigDecimalUtils.safeSubtract(nowTaxY,BigDecimalUtils.safeAdd(nowTaxT,sumTax));
a.setSalaryTax(salaryTax);
a.setRelaySalaryUnit(relaySalary);
a.setSalaryTaxUnit(nowTaxT);
a.setActualSalary(BigDecimalUtils.safeSubtract(actualSalarySumNow,salaryTax));
} else {
nowTaxY = getNowTax(actualSalarySum);
if (sumTax.compareTo(BigDecimal.ZERO) != 0) {
nowTaxY = BigDecimalUtils.safeSubtract(nowTaxY, sumTax).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
}
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxY).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
}
// 本次个人应发合计
TSalaryAccountItem sai = new TSalaryAccountItem();
sai.setCnName(SalaryConstants.RELAY_SALARY);
sai.setJavaFiedName(SalaryConstants.RELAY_SALARY_JAVA);
sai.setIsTax(CommonConstants.ZERO_INT);
sai.setSalaryMoney(relaySalary);
saiList.add(sai);
return nowTaxT;
}
public static BigDecimal getNowTax (BigDecimal actualSalarySum) {
BigDecimal nowTax;
// 2022-3-3 11:24:20 运营中心郭华照提供的公式:
// ROUND(IF(B7<=800,0,IF(B7<=3360,(B7-800)/4,IF(B7<=21000,0.16*B7/0.84,IF(B7<=49500,(0.24*B7-2000)/0.76,(0.32*B7-7000)/0.68)))),2)
if (actualSalarySum.compareTo(new BigDecimal("800")) <= 0) {
nowTax = BigDecimal.ZERO;
} else if (actualSalarySum.compareTo(new BigDecimal("3360")) <= 0) {
// (B7-800)/4
nowTax = BigDecimalUtils.safeDivide(BigDecimalUtils.safeSubtract(actualSalarySum, new BigDecimal("800"))
, new BigDecimal("4"));
} else if (actualSalarySum.compareTo(new BigDecimal("21000")) <= 0) {
// 0.16*B7/0.84
nowTax = BigDecimalUtils.safeDivide(BigDecimalUtils.safeMultiply(actualSalarySum, new BigDecimal("0.16"))
, new BigDecimal("0.84"));
} else if (actualSalarySum.compareTo(new BigDecimal("49500")) <= 0) {
// (0.24*B7-2000)/0.76
nowTax = BigDecimalUtils.safeDivide(BigDecimalUtils.safeSubtract(
BigDecimalUtils.safeMultiply(actualSalarySum, new BigDecimal("0.24")), new BigDecimal("2000"))
, new BigDecimal("0.76"));
} else {
nowTax = BigDecimalUtils.safeDivide(BigDecimalUtils.safeSubtract(
BigDecimalUtils.safeMultiply(actualSalarySum, new BigDecimal("0.32")), new BigDecimal("7000"))
, new BigDecimal("0.68"));
}
nowTax = nowTax.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
return nowTax;
}
}
......@@ -28,9 +28,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TDepartSettlementInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.entity.*;
......@@ -41,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -60,6 +66,7 @@ import java.util.*;
*/
@Log4j2
@Service
@EnableConfigurationProperties({DaprSocialProperties.class})
public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMapper, TSalaryStandard> implements TSalaryStandardService {
@Autowired
......@@ -72,8 +79,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
private MSalaryEstimateService mSalaryEstimateService;
@Autowired
private MSalaryPaymentResService salaryPaymentResService;
private DaprSocialProperties socialProperties;
/**
* 标准薪酬工资表简单分页查询
*
......@@ -311,51 +317,64 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
MSalaryEstimate salaryEstimate = new MSalaryEstimate();
salaryEstimate.setSalaryId(id);
salaryEstimate.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO);
salaryEstimate.setType(CommonConstants.ZERO_INT);
QueryWrapper<MSalaryEstimate> salaryEstimateQueryWrapper = new QueryWrapper<>();
salaryEstimateQueryWrapper.setEntity(salaryEstimate);
//社保
//缴费库社保
List<MSalaryEstimate> socialList = mSalaryEstimateService.list(salaryEstimateQueryWrapper);
salaryEstimate.setIsSocial(SalaryConstants.IS_FUND_ONE);
salaryEstimateQueryWrapper.setEntity(salaryEstimate);
//公积金
//缴费库公积金
List<MSalaryEstimate> fundList = mSalaryEstimateService.list(salaryEstimateQueryWrapper);
if ((socialList != null && !socialList.isEmpty())
|| (fundList != null && !fundList.isEmpty())) {
MSalaryPaymentRes res;
Map<String, MSalaryPaymentRes> saveResMap = new HashMap<>();
if (socialList != null && !socialList.isEmpty()) {
for (MSalaryEstimate est : socialList) {
res = saveResMap.get(est.getEstimateId());
if (res == null) {
res = new MSalaryPaymentRes();
res.setId(est.getEstimateId());
res.setDeptId(deptId);
}
res.setSalarySocialFlag(CommonConstants.ZERO_STRING);
saveResMap.put(est.getEstimateId(), res);
}
salaryEstimate.setType(CommonConstants.ONE_INT);
salaryEstimateQueryWrapper.setEntity(salaryEstimate);
//缴费库公积金
List<MSalaryEstimate> forecastFundList = mSalaryEstimateService.list(salaryEstimateQueryWrapper);
salaryEstimate.setIsSocial(SalaryConstants.IS_SOCIAL_ZERO);
salaryEstimateQueryWrapper.setEntity(salaryEstimate);
//缴费库公积金
List<MSalaryEstimate> forecastSocialList = mSalaryEstimateService.list(salaryEstimateQueryWrapper);
List<String> stringList;
if (socialList != null && !socialList.isEmpty()) {
stringList = new ArrayList<>();
for (MSalaryEstimate s : socialList) {
stringList.add(s.getEstimateId());
}
//更新社保状态为-待结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/updatePaymentSocialStatusToNoSettle", stringList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
}
if (fundList != null && !fundList.isEmpty()) {
stringList = new ArrayList<>();
for (MSalaryEstimate s : fundList) {
stringList.add(s.getEstimateId());
}
if (fundList != null && !fundList.isEmpty()) {
for (MSalaryEstimate est : fundList) {
res = saveResMap.get(est.getEstimateId());
if (res == null) {
res = new MSalaryPaymentRes();
res.setId(est.getEstimateId());
res.setDeptId(deptId);
}
res.setSalaryFundFlag(CommonConstants.ZERO_STRING);
saveResMap.put(est.getEstimateId(), res);
}
//更新公积金状态为-待结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tpaymentinfo/inner/updatePaymentFundStatusToNoSettle", stringList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
}
if (forecastSocialList != null && !forecastSocialList.isEmpty()) {
stringList = new ArrayList<>();
for (MSalaryEstimate s : forecastSocialList) {
stringList.add(s.getEstimateId());
}
// 开始更新res
if (!saveResMap.isEmpty()) {
Iterator<MSalaryPaymentRes> iter = saveResMap.values().iterator();
while (iter.hasNext()) {
res = iter.next();
salaryPaymentResService.saveOrUpdate(res);
}
//更新社保状态为-待结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tforecastlibrary/inner/updateForecastSocialStatusToNoSettle", stringList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
}
if (forecastFundList != null && !forecastFundList.isEmpty()) {
stringList = new ArrayList<>();
for (MSalaryEstimate s : forecastFundList) {
stringList.add(s.getEstimateId());
}
//更新公积金状态为-待结算
HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tforecastlibrary/inner/updateForecastFundStatusToNoSettle", stringList, TDepartSettlementInfo.class, SecurityConstants.FROM_IN);
}
}
}
//6:删除工资表
......
......@@ -142,7 +142,7 @@ public class TSpecialDeducationSumServiceImpl extends ServiceImpl<TSpecialDeduca
for (TSpecialDeducationSum s : sdsList) {
s.setCreateMonth(yearMonth);
s.setCreateTime(nowDate);
s.setCreateUser(String.valueOf(user.getId()));
s.setCreateBy(user.getId());
}
return new R<>(this.saveBatch(sdsList));
}
......
......@@ -152,7 +152,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0){
wrapper.last(" limit "+ searchVo.getLimitStart() +","+ searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
......
......@@ -16,14 +16,13 @@
*/
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerVo;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsDeclarerMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsDeclarerService;
import lombok.extern.log4j.Log4j2;
import org.checkerframework.checker.units.qual.C;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -31,7 +30,6 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
......@@ -90,7 +88,7 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsDeclarer.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsDeclarer.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
......@@ -164,6 +162,27 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
@Override
public R doStatisticsTaxDeclarer() {
String nowMonth = DateUtil.addMonth(0); //本月
TStatisticsDeclarer std = new TStatisticsDeclarer();
std.setDeclareMonth(nowMonth);
QueryWrapper<TStatisticsDeclarer> queryWrapperSs = new QueryWrapper<>();
queryWrapperSs.setEntity(std);
long num = this.count(queryWrapperSs);
if (num > 0) {
return R.failed("上月数据已生成,不可重复生成!");
} else {
String lastMonth = DateUtil.addMonth(-1); //上月
String lastYear = lastMonth.substring(0,4);
List<TStatisticsDeclarer> stdvoList = baseMapper.doStatisticsTaxDeclarer(nowMonth,lastYear);
for (TStatisticsDeclarer declarer : stdvoList) {
this.save(declarer);
}
return R.ok();
}
}
private Long noPageCountDiy(TStatisticsDeclarerSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsDeclarer> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......
......@@ -25,6 +25,7 @@ import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
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;
......@@ -46,6 +47,7 @@ import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 本期劳务费申报表
......@@ -74,7 +76,7 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
*/
@Override
public void listExport(HttpServletResponse response, TStatisticsLaborSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "本期劳务费导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TStatisticsLabor> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -85,7 +87,6 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsLabor.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
......@@ -156,6 +157,15 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
private LambdaQueryWrapper buildQueryWrapper(TStatisticsLaborSearchVo entity) {
LambdaQueryWrapper<TStatisticsLabor> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(entity.getDeclareMonth())) {
wrapper.eq(TStatisticsLabor::getDeclareMonth,entity.getDeclareMonth());
}
if (Common.isNotNull(entity.getEmpName())) {
wrapper.eq(TStatisticsLabor::getEmpName,entity.getEmpName());
}
if (Common.isNotNull(entity.getEmpIdcard())) {
wrapper.eq(TStatisticsLabor::getEmpIdcard,entity.getEmpIdcard());
}
return wrapper;
}
......@@ -217,6 +227,42 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
return R.ok(errorMessageList);
}
@Override
public R batchDelete(String declareMonth) {
if (Common.isNotNull(declareMonth)) {
List<TStatisticsLabor> deleteList = baseMapper.selectList(Wrappers.<TStatisticsLabor>query().lambda()
.eq(TStatisticsLabor::getDeclareMonth, declareMonth));
if (Common.isNotNull(deleteList)) {
List<String> idList = deleteList.stream().map(TStatisticsLabor::getId).collect(Collectors.toList());
baseMapper.deleteBatchIds(idList);
return R.ok();
}
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
return null;
}
@Override
public R doStatisticsLabor() {
String nowMonth = DateUtil.addMonth(0); //本月
TStatisticsLabor std = new TStatisticsLabor();
std.setDeclareMonth(nowMonth);
QueryWrapper<TStatisticsLabor> queryWrapperSs = new QueryWrapper<>();
queryWrapperSs.setEntity(std);
long num = this.count(queryWrapperSs);
if (num > 0) {
return R.failed("上月数据已生成,不可重复生成!");
} else {
String lastMonth = DateUtil.addMonth(-1); //上月
String lastYear = lastMonth.substring(0,4);
List<TStatisticsLabor> stdvoList = baseMapper.doStatisticsLabor(nowMonth,lastYear);
for (TStatisticsLabor declarer : stdvoList) {
this.save(declarer);
}
return R.ok();
}
}
private void importTStatisticsLabor(List<TStatisticsLaborVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
......
......@@ -28,6 +28,7 @@ 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.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsRemuneration;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsRemunerationMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsRemunerationService;
......@@ -41,6 +42,7 @@ import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 本期稿酬申报表
......@@ -69,7 +71,7 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
*/
@Override
public void listExport(HttpServletResponse response, TStatisticsRemunerationSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "本期稿酬申报表导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TStatisticsRemuneration> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -80,7 +82,6 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsRemuneration.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
......@@ -127,6 +128,21 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
}
}
@Override
public R batchDelete(String declareMonth) {
if (Common.isNotNull(declareMonth)) {
List<TStatisticsRemuneration> deleteList = baseMapper.selectList(Wrappers.<TStatisticsRemuneration>query().lambda()
.eq(TStatisticsRemuneration::getDeclareMonth, declareMonth));
if (Common.isNotNull(deleteList)) {
List<String> idList = deleteList.stream().map(TStatisticsRemuneration::getId).collect(Collectors.toList());
baseMapper.deleteBatchIds(idList);
return R.ok();
}
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
return null;
}
private List<TStatisticsRemuneration> noPageDiy(TStatisticsRemunerationSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsRemuneration> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......@@ -150,6 +166,15 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
private LambdaQueryWrapper buildQueryWrapper(TStatisticsRemunerationSearchVo entity) {
LambdaQueryWrapper<TStatisticsRemuneration> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(entity.getDeclareMonth())) {
wrapper.eq(TStatisticsRemuneration::getDeclareMonth,entity.getDeclareMonth());
}
if (Common.isNotNull(entity.getEmpName())) {
wrapper.eq(TStatisticsRemuneration::getEmpName,entity.getEmpName());
}
if (Common.isNotNull(entity.getEmpIdcard())) {
wrapper.eq(TStatisticsRemuneration::getEmpIdcard,entity.getEmpIdcard());
}
return wrapper;
}
......
......@@ -49,9 +49,6 @@ public class SalaryAccountUtil implements Serializable {
*/
private List<ErrorMessage> errorInfo;
// 重复数据
private List<ErrorMessage> repeatInfo;
/**
* @param jsonStr 客户原表json内容
* @param dept 项目
......@@ -60,7 +57,7 @@ public class SalaryAccountUtil implements Serializable {
* @param empIdCardMap 当前项目下的员工Map
* @param empNameMap 当前项目下的员工Map
* @param isDuplicateName false:有重名(当前项目下的员工),则不可用姓名查找,必须含有身份证号列
* @param repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
* repeatFlag 默认 0:不允许重复导入已存在系统内的数据;1:允许重复导入
* @param ownEmployeeMap 自有员工所在项目Map
* @Description: 将jsonStr数据源的数据导入到 List<TSalaryAccount>
* @Author: hgw
......@@ -71,12 +68,11 @@ public class SalaryAccountUtil implements Serializable {
, TConfigSalary configSalary, Map<String, TSalaryConfigStandard> salaryConfigMap, Map<String, Boolean> isMustMap
, Map<String, TSalaryEmployee> empIdCardMap, Map<String, TSalaryEmployee> empNameMap, boolean isDuplicateName
, String salaryType, String invoiceTitle, TSalaryEmployeeService tSalaryEmployeeService
, Map<String, Integer> checkMap, int repeatFlag, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> checkMap, Map<String, Integer> ownEmployeeMap
, Map<String, Integer> ownDeptMap, TSalaryAccountService tSalaryAccountService) {
List<TSalaryAccountVo> tList = new ArrayList<>();
List<HashMap> list = JSONObject.parseArray(jsonStr, HashMap.class);
List<ErrorMessage> errorList = new ArrayList<>();
List<ErrorMessage> repeatList = new ArrayList<>();
try {
// 得到数据的条数
int rows = list.size();
......@@ -140,6 +136,7 @@ public class SalaryAccountUtil implements Serializable {
salaryStyle = SalaryConstants.SALARY_STYLE_BANK;
relaySalary = null;
actualSalarySum = null;
entity.setSettlementMonth(nowMonth);
entity.setAnnualBonusType(SalaryConstants.ANNUAL_BONUS_TAX_TYPE_VALUE[0]);
for (Map.Entry<String, TSalaryConfigStandard> entry : salaryConfigMap.entrySet()) {
cellValueObj = getFieldValueByName(entry.getKey(), temp);
......@@ -161,6 +158,12 @@ public class SalaryAccountUtil implements Serializable {
if (SalaryConstants.RELAY_SALARY_JAVA.equals(scs.getJavaFiedName())) {
try {
relaySalary = new BigDecimal(cellValueStr);
sai = new TSalaryAccountItemVo();
sai.setCnName(dbFiedName);
sai.setJavaFiedName(scs.getJavaFiedName());
sai.setIsTax(CommonConstants.ZERO_INT);
sai.setSalaryMoney(relaySalary);
saiList.add(sai);
} catch (Exception e) {
error = "第" + (i + 2) + "行:应发工资:'" + cellValueStr + "'错误,请检查数据";
errorList.add(new ErrorMessage((i + 2), error));
......@@ -170,6 +173,7 @@ public class SalaryAccountUtil implements Serializable {
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(scs.getJavaFiedName())) {
try {
actualSalarySum = new BigDecimal(cellValueStr);
entity.setActualSalary(actualSalarySum);
} catch (Exception e) {
error = "第" + (i + 2) + "行:实发工资:'" + cellValueStr + "'错误,请检查数据";
errorList.add(new ErrorMessage((i + 2), error));
......@@ -193,7 +197,7 @@ public class SalaryAccountUtil implements Serializable {
}
newEmp.setEmpName(empName);
}
if (SalaryConstants.IF_NEW_EMPLOYEE.equals(dbFiedName)
if ((SalaryConstants.IF_NEW_EMPLOYEE.equals(dbFiedName) || SalaryConstants.IS_NEW_EMPLOYEE.equals(dbFiedName))
&& SalaryConstants.IS_NEW.equals(cellValueStr)) {
isNewEmployee = true;
}
......@@ -274,6 +278,11 @@ public class SalaryAccountUtil implements Serializable {
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
if ("4".equals(salaryType) && actualSalarySum == null) {
error = "第" + (i + 2) + "行:【稿酬】列_不可缺少";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
// 应发、实发、实发劳务费不可都为空
if (relaySalary == null && actualSalarySum == null) {
......@@ -287,15 +296,12 @@ public class SalaryAccountUtil implements Serializable {
entity.setIsRepeat(CommonConstants.ZERO_INT);
if (relaySalary != null) {
relaySalary = relaySalary.setScale(2, BigDecimal.ROUND_HALF_UP);
if (checkMap.get(entity.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + DateUtil.addMonth(configSalary.getSalaryMonth())
if (!checkMap.isEmpty() && checkMap.get(entity.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + DateUtil.addMonth(configSalary.getSalaryMonth())
+ CommonConstants.DOWN_LINE_STRING + salaryType + CommonConstants.DOWN_LINE_STRING + relaySalary) != null) {
entity.setIsRepeat(CommonConstants.ONE_INT);
if (repeatFlag == 0) {
repeatList.add(new ErrorMessage((i + 2), "第" + (i + 2) + "行:同一项目、结算月份、报表类型、工资月份、身份证号、应发金额,存在相同数据"));
continue;
}
}
if (new BigDecimal("3500").equals(relaySalary) || new BigDecimal("5000").equals(relaySalary)) {
if (new BigDecimal("3500").compareTo(relaySalary) == CommonConstants.ZERO_INT
|| new BigDecimal("5000").compareTo(relaySalary) == CommonConstants.ZERO_INT) {
entity.setHaveSpecialFlag(CommonConstants.ONE_INT);
}
}
......@@ -589,7 +595,6 @@ public class SalaryAccountUtil implements Serializable {
}
this.setEntityList(tList);
this.setErrorInfo(errorList);
this.setRepeatInfo(repeatList);
}
/**
......
......@@ -89,6 +89,7 @@ public class SalaryConstants {
public static final String IS_MUST = "1";
public static final String EMP_NAME = "姓名";
public static final String IF_NEW_EMPLOYEE = "是否新员工(默认否)";
public static final String IS_NEW_EMPLOYEE = "是否新员工";
public static final String IS_NEW = "是";
public static final String ID_NUMBER = "身份证号";
public static final String CHECK_ID_NUMBER = "身份证号码";
......
......@@ -50,6 +50,6 @@
</select>
<!--获取自有员工身份证-->
<select id="getOwnEmpList" resultType="String">
SELECT EMP_IDCARD FROM view_own_employee
SELECT EMP_IDCARD FROM view_own_employee
</select>
</mapper>
......@@ -25,7 +25,7 @@
<result property="isTax" column="IS_TAX"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="settlementMonth" column="SETTLEMENT_MONTH"/>
<result property="salaryType" column="SALARY_TYPE"/>
<result property="formType" column="FORM_TYPE"/>
</resultMap>
<!--tSalaryAccountItem简单分页查询-->
......@@ -71,8 +71,8 @@
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<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}
......@@ -104,7 +104,7 @@
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0 and a.SALARY_TYPE != 7
a.DELETE_FLAG = 0 and a.FORM_TYPE != 7
<if test="idCard != null and idCard.trim() != ''">
AND a.EMP_IDCARD = #{idCard}
</if>
......@@ -124,14 +124,14 @@
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<if test="deptId != null and deptId.trim() != ''">
AND a.DEPT_ID = #{deptId}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="salaryDate != null and salaryDate.trim() != ''">
AND a.SALARY_DATE > #{salaryDate}
<if test="salaryMonth != null and salaryMonth.trim() != ''">
AND a.SALARY_MONTH > #{salaryMonth}
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
......@@ -150,19 +150,19 @@
<select id="getAverageSalaryItemMonthCount" resultType="Integer">
SELECT
count(DISTINCT a.SALARY_DATE)
count(DISTINCT a.SALARY_MONTH)
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<if test="deptId != null and deptId.trim() != ''">
AND a.DEPT_ID = #{deptId}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="salaryDate != null and salaryDate.trim() != ''">
AND a.SALARY_DATE > #{salaryDate}
<if test="salaryMonth != null and salaryMonth.trim() != ''">
AND a.SALARY_MONTH > #{salaryMonth}
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
......@@ -178,14 +178,14 @@
t_engineer_account_item i left join t_engineer_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<if test="deptId != null and deptId.trim() != ''">
AND a.DEPT_ID = #{deptId}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="salaryDate != null and salaryDate.trim() != ''">
AND a.SALARY_DATE > #{salaryDate}
<if test="salaryMonth != null and salaryMonth.trim() != ''">
AND a.SALARY_MONTH > #{salaryMonth}
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
......@@ -195,19 +195,19 @@
<select id="getEngineerAverageSalaryItemMonthCount" resultType="Integer">
SELECT
count(DISTINCT a.SALARY_DATE)
count(DISTINCT a.SALARY_MONTH)
FROM
t_engineer_account_item i left join t_engineer_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
<if test="deptId != null and deptId.trim() != ''">
AND a.DEPT_ID = #{deptId}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="salaryDate != null and salaryDate.trim() != ''">
AND a.SALARY_DATE > #{salaryDate}
<if test="salaryMonth != null and salaryMonth.trim() != ''">
AND a.SALARY_MONTH > #{salaryMonth}
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
......@@ -272,8 +272,8 @@
<if test="tSalaryAccount.salaryFormId != null and tSalaryAccount.salaryFormId.trim() != ''">
AND a.SALARY_FORM_ID = #{tSalaryAccount.salaryFormId}
</if>
<if test="tSalaryAccount.salaryDate != null and tSalaryAccount.salaryDate.trim() != ''">
AND a.SALARY_DATE = #{tSalaryAccount.salaryDate}
<if test="tSalaryAccount.salaryMonth != null and tSalaryAccount.salaryMonth.trim() != ''">
AND a.SALARY_MONTH = #{tSalaryAccount.salaryMonth}
</if>
<if test="tSalaryAccount.empId != null and tSalaryAccount.empId.trim() != ''">
AND a.EMP_ID = #{tSalaryAccount.empId}
......@@ -284,14 +284,14 @@
<if test="tSalaryAccount.empNo != null and tSalaryAccount.empNo.trim() != ''">
AND a.EMP_NO = #{tSalaryAccount.empNo}
</if>
<if test="tSalaryAccount.settleDepartId != null and tSalaryAccount.settleDepartId.trim() != ''">
AND a.BELONG_DEPART = #{tSalaryAccount.settleDepartId}
<if test="tSalaryAccount.deptId != null and tSalaryAccount.deptId.trim() != ''">
AND a.BELONG_DEPART = #{tSalaryAccount.deptId}
</if>
<if test="tSalaryAccount.settleDepartNo != null and tSalaryAccount.settleDepartNo.trim() != ''">
AND a.SETTLE_DEPART_NO like '%${tSalaryAccount.settleDepartNo}%'
<if test="tSalaryAccount.deptNo != null and tSalaryAccount.deptNo.trim() != ''">
AND a.DEPT_NO like '%${tSalaryAccount.deptNo}%'
</if>
<if test="tSalaryAccount.settleDepartName != null and tSalaryAccount.settleDepartName.trim() != ''">
AND a.SETTLE_DEPART_NAME like '%${tSalaryAccount.settleDepartName}%'
<if test="tSalaryAccount.deptName != null and tSalaryAccount.deptName.trim() != ''">
AND a.DEPT_NAME like '%${tSalaryAccount.deptName}%'
</if>
<if test="tSalaryAccount.empIdcard != null and tSalaryAccount.empIdcard.trim() != ''">
AND a.EMP_IDCARD like '%${tSalaryAccount.empIdcard}%'
......@@ -320,8 +320,8 @@
<if test="tSalaryAccount.deduProvidentMonth != null and tSalaryAccount.deduProvidentMonth.trim() != ''">
AND a.DEDU_PROVIDENT_MONTH = #{tSalaryAccount.deduProvidentMonth}
</if>
<if test="tSalaryAccount.salaryType != null and tSalaryAccount.salaryType.trim() != ''">
AND a.SALARY_TYPE = #{tSalaryAccount.salaryType}
<if test="tSalaryAccount.formType != null and tSalaryAccount.formType.trim() != ''">
AND a.FORM_TYPE = #{tSalaryAccount.formType}
</if>
<if test="tSalaryAccount.salaryTaxFlag != null and tSalaryAccount.salaryTaxFlag.trim() != ''">
AND a.SALARY_TAX_FLAG = #{tSalaryAccount.salaryTaxFlag}
......@@ -392,25 +392,9 @@
</if>
</if>
</sql>
<!--tSalaryAccountItem简单分页查询-->
<select id="getTSalaryAccountItemPage" resultMap="tSalaryAccountItemMap">
SELECT
a.SALARY_ACCOUNT_ID as 'key',
a.SALARY_MONEY as 'value'
FROM
t_salary_account_item a
WHERE
a.SALARY_ACCOUNT_ID IN
<foreach item="item" index="index" collection="account" open="(" separator="," close=")">
#{item.id}
</foreach>
and
a.JAVA_FIED_NAME='actualSalarySum'
</select>
<!-- 获取工资明细 -->
<select id="getItemSet" resultType="java.lang.String">
select
i.cn_name a
from t_salary_account_item i
......@@ -421,70 +405,6 @@
order by i.JAVA_FIED_NAME desc,i.id
</select>
<!-- 获取所有数据,组装map,工资导入使用 -->
<select id="getAllItemVoList" resultMap="itemVoMap">
SELECT
i.ID,
i.SALARY_ACCOUNT_ID,
i.CN_NAME,
i.JAVA_FIED_NAME,
i.SALARY_MONEY,
i.TEXT_VALUE,
i.IS_TAX,
a.EMP_IDCARD,
a.SETTLEMENT_MONTH,
a.SALARY_TYPE
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.SETTLEMENT_MONTH like DATE_FORMAT(now(),"%Y%")
<if test="idCardList != null">
AND a.EMP_IDCARD in
<foreach item="item" index="index" collection="idCardList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="invoiceTitle != null and invoiceTitle.trim() != ''">
AND a.INVOICE_TITLE = #{invoiceTitle}
</if>
AND a.DELETE_FLAG = 0 and a.SALARY_TYPE != 7
</where>
</select>
<select id="getAllTSalaryAccountItem" resultMap="tSalaryAccountItemMap">
SELECT
i.ID,
i.SALARY_ACCOUNT_ID,
i.CN_NAME,
i.JAVA_FIED_NAME,
i.SALARY_MONEY,
i.TEXT_VALUE,
i.IS_TAX
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
a.DELETE_FLAG = 0
<if test="settleDepartId != null and settleDepartId.trim() != ''">
AND a.SETTLE_DEPART_ID = #{settleDepartId}
</if>
<if test="settleMonth != null and settleMonth.trim() != ''">
AND a.SETTLEMENT_MONTH = #{settleMonth}
</if>
<if test="javaFiedName != null and javaFiedName.trim() != ''">
AND i.JAVA_FIED_NAME = #{javaFiedName}
</if>
<if test="finallyYear != null and finallyYear.trim() != ''">
AND a.SETTLEMENT_MONTH like concat(#{finallyYear}, '%')
</if>
<if test="empIdcard != null and empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{empIdcard}
</if>
<if test="accountId != null and accountId.trim() != ''">
AND a.id != #{accountId}
</if>
</where>
</select>
<!-- 获取所有数据,组装map,工资导入使用 -->
<select id="getAllItemVoList" resultMap="itemVoMap">
SELECT
......@@ -497,7 +417,7 @@
i.IS_TAX,
a.EMP_IDCARD,
a.SETTLEMENT_MONTH,
a.SALARY_TYPE
a.FORM_TYPE
FROM
t_salary_account_item i left join t_salary_account a on i.SALARY_ACCOUNT_ID = a.ID
<where>
......@@ -511,7 +431,7 @@
<if test="invoiceTitle != null and invoiceTitle.trim() != ''">
AND a.INVOICE_TITLE = #{invoiceTitle}
</if>
AND a.DELETE_FLAG = 0 and a.SALARY_TYPE != 7
AND a.DELETE_FLAG = 0 and a.FORM_TYPE != 7
</where>
</select>
<select id="getSumByAccountId" resultType="java.util.Map">
......
......@@ -246,25 +246,25 @@
<include refid="Base_Column_List"/>
FROM t_salary_account a
<where>
1=1
<include refid="tSalaryAccount_where"/>
a.DELETE_FLAG = 0
<include refid="tSalaryAccount_where"/>
</where>
</select>
<!-- 获取校验的报账明细 ### 格式:身份证号_工资月份_报表类型_应发金额 -->
<select id="getAccountCheckList" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo">
select
CONCAT(a.EMP_IDCARD,"_",a.SALARY_DATE,"_",a.FORM_TYPE) title,ifnull(ifnull(relaySalary.SALARY_MONEY,actSalary.SALARY_MONEY),0) relaySalary
CONCAT(a.EMP_IDCARD,"_",a.SALARY_MONTH,"_",a.FORM_TYPE) title,ifnull(ifnull(relaySalary.SALARY_MONEY,actSalary.SALARY_MONEY),0) relaySalary
from t_salary_account a
left join t_salary_account_item relaySalary on relaySalary.SALARY_ACCOUNT_ID = a.id and relaySalary.JAVA_FIED_NAME='relaySalary'
left join t_salary_account_item actSalary on actSalary.SALARY_ACCOUNT_ID = a.id and actSalary.JAVA_FIED_NAME='actualSalarySum'
where a.DELETE_FLAG = 0 and a.SETTLE_DEPART_ID = #{settleId} and a.SETTLEMENT_MONTH = #{settleMonth}
where a.DELETE_FLAG = 0 and a.DEPT_ID = #{settleId} and a.SALARY_MONTH = #{settleMonth}
</select>
<!-- 获取当前年最小计税月 -->
<select id="getMinTaxMonthByNowYear" resultType="java.lang.String">
select
min(a.TAX_MONTH - 0)
concat(min(a.TAX_MONTH - 0),'')
from t_salary_account a
where a.EMP_IDCARD = #{empIdCard} and a.DELETE_FLAG = 0 and a.SETTLEMENT_MONTH like concat(#{nowYear},"%")
and a.FORM_TYPE != '3'
......
......@@ -113,7 +113,7 @@
<select id="getTAttaPage" resultMap="tAttaMap">
SELECT
<include refid="selectParams"/>
FROM t_salary_atta
FROM t_salary_atta a
<where>
1=1
<include refid="tSalaryAtta_where"/>
......@@ -125,11 +125,11 @@
<select id="getTAttaList" resultMap="tAttaMap">
SELECT
<include refid="selectParams"/>
FROM t_salary_atta
FROM t_salary_atta a
<where>
1=1
<include refid="tSalaryAtta_where"/>
</where>
order by CREATE_TIME
order by CREATE_TIME desc
</select>
</mapper>
......@@ -218,7 +218,7 @@
<include refid="Base_Column_List"/>
FROM t_salary_standard a
<where>
1=1
a.DELETE_FLAG = 0
<include refid="tSalaryStandard_where"/>
</where>
</select>
......@@ -228,7 +228,7 @@
<include refid="Base_Column_List"/>
FROM t_salary_standard a
<where>
1=1
a.DELETE_FLAG = 0
<include refid="where_page"/>
</where>
order by a.CREATE_TIME desc
......@@ -265,7 +265,7 @@
a.CREATE_TIME
FROM t_salary_standard a
<where>
1=1
a.DELETE_FLAG = 0
<include refid="where_export"/>
<if test="searchVo != null">
<if test="searchVo.limitStart != null">
......@@ -280,7 +280,7 @@
count(1)
FROM t_salary_standard a
<where>
1=1
a.DELETE_FLAG = 0
<include refid="where_export"/>
</where>
</select>
......
......@@ -6,7 +6,7 @@
<resultMap id="tSpecialDeducationSumMap" type="com.yifu.cloud.plus.v1.yifu.salary.entity.TSpecialDeducationSum">
<id property="id" column="id"/>
<result property="createUser" column="CREATE_USER"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="createMonth" column="CREATE_MONTH"/>
<result property="declareTitle" column="DECLARE_TITLE"/>
......@@ -42,7 +42,7 @@
<sql id="Base_Column_List">
id,
CREATE_USER,
CREATE_BY,
CREATE_TIME,
CREATE_MONTH,
DECLARE_TITLE,
......@@ -81,8 +81,8 @@
<if test="tSpecialDeducationSum.id != null and tSpecialDeducationSum.id.trim() != ''">
AND id = #{tSpecialDeducationSum.id}
</if>
<if test="tSpecialDeducationSum.createUser != null and tSpecialDeducationSum.createUser.trim() != ''">
AND CREATE_USER = #{tSpecialDeducationSum.createUser}
<if test="tSpecialDeducationSum.createBy != null and tSpecialDeducationSum.createBy.trim() != ''">
AND CREATE_BY = #{tSpecialDeducationSum.createBy}
</if>
<if test="tSpecialDeducationSum.createTime != null">
AND CREATE_TIME = #{tSpecialDeducationSum.createTime}
......
......@@ -100,5 +100,6 @@
1=1
<include refid="tStatisticsBonus_where"/>
</where>
order by a.DECLARE_MONTH desc
</select>
</mapper>
......@@ -97,4 +97,15 @@
</where>
order by a.DECLARE_MONTH desc
</select>
<!--统计-->
<select id="doStatisticsTaxDeclarer" resultMap="tStatisticsDeclarerMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,b.FILE_STATUS EMP_STATUS,
b.UNIT_NAME DECLARE_UNIT,'雇员' OCCUPATION_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = 0 and a.SETTLEMENT_MONTH like '${lastYear}%'
GROUP BY a.EMP_IDCARD
</select>
</mapper>
......@@ -29,7 +29,6 @@
<result property="declareMonth" column="DECLARE_MONTH"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="workNo" column="WORK_NO"/>
<result property="cardType" column="CARD_TYPE"/>
<result property="income" column="INCOME"/>
<result property="personalTax" column="PERSONAL_TAX"/>
......@@ -41,7 +40,6 @@
a.DECLARE_MONTH,
a.EMP_NAME,
a.EMP_IDCARD,
a.WORK_NO,
a.CARD_TYPE,
a.INCOME,
a.PERSONAL_TAX,
......@@ -64,9 +62,6 @@
<if test="tStatisticsLabor.empIdcard != null and tStatisticsLabor.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tStatisticsLabor.empIdcard}
</if>
<if test="tStatisticsLabor.workNo != null and tStatisticsLabor.workNo.trim() != ''">
AND a.WORK_NO = #{tStatisticsLabor.workNo}
</if>
<if test="tStatisticsLabor.cardType != null and tStatisticsLabor.cardType.trim() != ''">
AND a.CARD_TYPE = #{tStatisticsLabor.cardType}
</if>
......@@ -90,5 +85,18 @@
1=1
<include refid="tStatisticsLabor_where"/>
</where>
group by a.EMP_IDCARD,a.DECLARE_MONTH,a.EMP_NAME
order by a.DECLARE_MONTH desc
</select>
<!--统计-->
<select id="doStatisticsLabor" resultMap="tStatisticsLaborMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,a.SALARY_TAX PERSONAL_TAX,a.ACTUAL_SALARY INCOME,
b.UNIT_NAME DECLARE_UNIT,'一般劳务报酬所得' INCOME_ITEM,'居民身份证' CARD_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = 0 and a.SETTLEMENT_MONTH like '${lastYear}%'
GROUP BY a.EMP_IDCARD
</select>
</mapper>
......@@ -32,7 +32,6 @@
<result property="cardType" column="CARD_TYPE"/>
<result property="income" column="INCOME"/>
<result property="personalTax" column="PERSONAL_TAX"/>
<result property="workNo" column="WORK_NO"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -42,8 +41,7 @@
a.EMP_IDCARD,
a.CARD_TYPE,
a.INCOME,
a.PERSONAL_TAX,
a.WORK_NO
a.PERSONAL_TAX
</sql>
<sql id="tStatisticsRemuneration_where">
<if test="tStatisticsRemuneration != null">
......@@ -71,9 +69,6 @@
<if test="tStatisticsRemuneration.personalTax != null">
AND a.PERSONAL_TAX = #{tStatisticsRemuneration.personalTax}
</if>
<if test="tStatisticsRemuneration.workNo != null and tStatisticsRemuneration.workNo.trim() != ''">
AND a.WORK_NO = #{tStatisticsRemuneration.workNo}
</if>
</if>
</sql>
<!--tStatisticsRemuneration简单分页查询-->
......@@ -85,5 +80,7 @@
1=1
<include refid="tStatisticsRemuneration_where"/>
</where>
group by a.EMP_IDCARD,a.DECLARE_MONTH,a.EMP_NAME
order by a.DECLARE_MONTH desc
</select>
</mapper>
......@@ -514,6 +514,19 @@ public class TForecastLibrary extends BaseEntity {
@ExcelProperty("数据类型:预估/差额")
private String diffType;
/**
* 工资社保结算状态 0: 未结算 1: 待结算 2: 已结算
*/
@ExcelAttribute(name = "工资社保结算状态", maxLength = 1,isDataId = true,dataType = "settlement_flag")
@ExcelProperty("工资社保结算状态")
private String salarySocialFlag;
/**
* 工资公积金结算状态 0: 未结算 1: 待结算 2: 已结算
*/
@ExcelAttribute(name = "工资公积金结算状态", maxLength = 1,isDataId = true,dataType = "settlement_flag")
@ExcelProperty("工资公积金结算状态")
private String salaryFundFlag;
@TableField(exist = false)
private List<String> idList;
......
......@@ -23,6 +23,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
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.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TForecastLibrary;
import com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService;
import io.swagger.v3.oas.annotations.Operation;
......@@ -32,6 +34,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
......@@ -179,5 +182,69 @@ public class TForecastLibraryController {
tForecastLibraryService.everyMonthCreateForecastLibary();
}
/**
* @Description: 薪资获取预估库
* @Author: hgw
* @Date: 2022/8/10 18:06
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo>
**/
@Inner
@PostMapping("/inner/selectTForecastBySalaryVo")
public TPaymentVo selectTForecastBySalaryVo(@RequestBody TPaymentBySalaryVo tPaymentBySalaryVo) {
return tForecastLibraryService.selectTForecastBySalaryVo(tPaymentBySalaryVo);
}
//hgw 以下4个方法,薪资变更缴费库预估库结算状态专用
/**
* @param idList
* @Description: 社保变为结算
* @Author: hgw
* @Date: 2022/8/16 18:22
* @return: int
**/
@Inner
@PostMapping("/inner/updateForecastSocialStatusToSettle")
public int updateForecastSocialStatusToSettle(@RequestBody List<String> idList) {
return tForecastLibraryService.updateForecastSocialStatusToSettle(idList);
}
/**
* @param idList
* @Description: 社保变为未结算
* @Author: hgw
* @Date: 2022/8/16 18:23
* @return: int
**/
@Inner
@PostMapping("/inner/updateForecastSocialStatusToNoSettle")
public int updateForecastSocialStatusToNoSettle(@RequestBody List<String> idList) {
return tForecastLibraryService.updateForecastSocialStatusToNoSettle(idList);
}
/**
* @param idList
* @Description: 公积金变为结算
* @Author: hgw
* @Date: 2022/8/16 18:23
* @return: int
**/
@Inner
@PostMapping("/inner/updateForecastFundStatusToSettle")
public int updateForecastFundStatusToSettle(@RequestBody List<String> idList) {
return tForecastLibraryService.updateForecastFundStatusToSettle(idList);
}
/**
* @param idList
* @Description: 公积金变为未结算
* @Author: hgw
* @Date: 2022/8/16 18:23
* @return: int
**/
@Inner
@PostMapping("/inner/updateForecastFundStatusToNoSettle")
public int updateForecastFundStatusToNoSettle(@RequestBody List<String> idList) {
return tForecastLibraryService.updateForecastFundStatusToNoSettle(idList);
}
}
......@@ -223,4 +223,54 @@ public class TPaymentInfoController {
public TPaymentVo selectTPaymentBySalaryVo(@RequestBody TPaymentBySalaryVo tPaymentBySalaryVo) {
return tPaymentInfoService.selectTPaymentBySalaryVo(tPaymentBySalaryVo);
}
//hgw 以下4个方法,薪资变更缴费库预估库结算状态专用
/**
* @param idList
* @Description: 社保变为结算
* @Author: hgw
* @Date: 2022/8/16 18:22
* @return: int
**/
@Inner
@PostMapping("/inner/updatePaymentSocialStatusToSettle")
public int updatePaymentSocialStatusToSettle(@RequestBody List<String> idList) {
return tPaymentInfoService.updatePaymentSocialStatusToSettle(idList);
}
/**
* @param idList
* @Description: 社保变为结算
* @Author: hgw
* @Date: 2022/8/16 18:22
* @return: int
**/
@Inner
@PostMapping("/inner/updatePaymentSocialStatusToNoSettle")
public int updatePaymentSocialStatusToNoSettle(@RequestBody List<String> idList) {
return tPaymentInfoService.updatePaymentSocialStatusToNoSettle(idList);
}
/**
* @param idList
* @Description: 公积金变为结算
* @Author: hgw
* @Date: 2022/8/16 18:22
* @return: int
**/
@Inner
@PostMapping("/inner/updatePaymentFundStatusToSettle")
public int updatePaymentFundStatusToSettle(@RequestBody List<String> idList) {
return tPaymentInfoService.updatePaymentFundStatusToSettle(idList);
}
/**
* @param idList
* @Description: 公积金变为未结算
* @Author: hgw
* @Date: 2022/8/16 18:22
* @return: int
**/
@Inner
@PostMapping("/inner/updatePaymentFundStatusToNoSettle")
public int updatePaymentFundStatusToNoSettle(@RequestBody List<String> idList) {
return tPaymentInfoService.updatePaymentFundStatusToNoSettle(idList);
}
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TForecastLibrary;
import com.yifu.cloud.plus.v1.yifu.social.vo.TForecastLibraryExportVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -51,4 +52,18 @@ public interface TForecastLibraryMapper extends BaseMapper<TForecastLibrary> {
**/
List<TForecastLibraryExportVo> exportLibrary(@Param("tForecastLibrary") TForecastLibrary tForecastLibrary);
List<TPaymentBySalaryVo> selectTForecastBySalaryVo(@Param("tPaymentInfo") TPaymentBySalaryVo tPaymentInfo);
/**
* 更新社保结算状态
* @Author hgw
* @Date 2020-4-13 16:01:59
* @param idList
* @param status
* @return
**/
int updateForecastSocialStatusByIdList(@Param("idList") List<String> idList, @Param("status") String status);
int updateForecastFundStatusByIdList(@Param("idList")List<String> idList, @Param("status") String status);
}
......@@ -94,4 +94,16 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
**/
List<TPaymentBySalaryVo> selectTPaymentBySalaryVo(@Param("tPaymentInfo") TPaymentBySalaryVo tPaymentInfo);
/**
* 更新社保结算状态
* @Author hgw
* @Date 2020-4-13 16:01:59
* @param idList
* @param status
* @return
**/
int updatePaymentSocialStatusByIdList(@Param("idList") List<String> idList, @Param("status") String status);
int updatePaymentFundStatusByIdList(@Param("idList")List<String> idList, @Param("status") String status);
}
......@@ -21,11 +21,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TForecastLibrary;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 预估费用
......@@ -104,4 +107,19 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
**/
void everyMonthCreateForecastLibary();
/**
* @param tPaymentBySalaryVo
* @Description: 获取预估库数据
* @Author: hgw
* @Date: 2022/8/16 17:46
* @return: com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo
**/
TPaymentVo selectTForecastBySalaryVo(TPaymentBySalaryVo tPaymentBySalaryVo);
// 以下4个方法,薪资变更缴费库预估库结算状态专用
int updateForecastSocialStatusToSettle(List<String> idList);
int updateForecastSocialStatusToNoSettle(List<String> idList);
int updateForecastFundStatusToSettle(List<String> idList);
int updateForecastFundStatusToNoSettle(List<String> idList);
}
......@@ -122,4 +122,11 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
**/
TPaymentVo selectTPaymentBySalaryVo(TPaymentBySalaryVo tPaymentBySalaryVo);
// 以下4个方法,薪资变更缴费库预估库结算状态专用
int updatePaymentSocialStatusToSettle(List<String> idList);
int updatePaymentSocialStatusToNoSettle(List<String> idList);
int updatePaymentFundStatusToSettle(List<String> idList);
int updatePaymentFundStatusToNoSettle(List<String> idList);
}
......@@ -29,6 +29,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAgentConfig;
......@@ -2067,4 +2069,44 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
}
@Override
public TPaymentVo selectTForecastBySalaryVo(TPaymentBySalaryVo tPaymentBySalaryVo) {
List<TPaymentBySalaryVo> list = baseMapper.selectTForecastBySalaryVo(tPaymentBySalaryVo);
TPaymentVo vo = new TPaymentVo();
vo.setPaymentList(list);
return vo;
}
@Override
public int updateForecastSocialStatusToSettle(List<String> idList) {
if (idList != null && !idList.isEmpty()) {
return baseMapper.updateForecastSocialStatusByIdList(idList, CommonConstants.ONE_STRING);
}
return 0;
}
@Override
public int updateForecastSocialStatusToNoSettle(List<String> idList) {
if (idList != null && !idList.isEmpty()) {
return baseMapper.updateForecastSocialStatusByIdList(idList, CommonConstants.ZERO_STRING);
}
return 0;
}
@Override
public int updateForecastFundStatusToSettle(List<String> idList) {
if (idList != null && !idList.isEmpty()) {
return baseMapper.updateForecastFundStatusByIdList(idList, CommonConstants.ONE_STRING);
}
return 0;
}
@Override
public int updateForecastFundStatusToNoSettle(List<String> idList) {
if (idList != null && !idList.isEmpty()) {
return baseMapper.updateForecastFundStatusByIdList(idList, CommonConstants.ZERO_STRING);
}
return 0;
}
}
......@@ -2345,4 +2345,36 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
vo.setPaymentList(list);
return vo;
}
@Override
public int updatePaymentSocialStatusToSettle(List<String> idList) {
if (idList != null && !idList.isEmpty()) {
return baseMapper.updatePaymentSocialStatusByIdList(idList, CommonConstants.ONE_STRING);
}
return 0;
}
@Override
public int updatePaymentSocialStatusToNoSettle(List<String> idList) {
if (idList != null && !idList.isEmpty()) {
return baseMapper.updatePaymentSocialStatusByIdList(idList, CommonConstants.ZERO_STRING);
}
return 0;
}
@Override
public int updatePaymentFundStatusToSettle(List<String> idList) {
if (idList != null && !idList.isEmpty()) {
return baseMapper.updatePaymentFundStatusByIdList(idList, CommonConstants.ONE_STRING);
}
return 0;
}
@Override
public int updatePaymentFundStatusToNoSettle(List<String> idList) {
if (idList != null && !idList.isEmpty()) {
return baseMapper.updatePaymentFundStatusByIdList(idList, CommonConstants.ZERO_STRING);
}
return 0;
}
}
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.archives.config.FddAutoConfigue
\ No newline at end of file
......@@ -102,6 +102,8 @@
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="salarySocialFlag" column="SALARY_SOCIAL_FLAG"/>
<result property="salaryFundFlag" column="SALARY_FUND_FLAG"/>
</resultMap>
<!-- 导出 -->
<resultMap id="exportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TForecastLibraryExportVo">
......@@ -244,6 +246,8 @@
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.SALARY_SOCIAL_FLAG,
a.SALARY_FUND_FLAG,
a.UPDATE_TIME
</sql>
<sql id="tForecastLibrary_where">
......@@ -578,4 +582,84 @@
limit #{tForecastLibrary.limitStart},#{tForecastLibrary.limitEnd}
</if>
</select>
<!--洪光武2022-8-10 18:05:42-->
<resultMap id="tPaymentBySalaryMap" type="com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentBySalaryVo">
<id property="id" column="ID"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="unitBitmailmentFee" column="UNIT_BIGMAILMENT_MONEY"/>
<result property="unitSocialSum" column="UNIT_SOCIAL_SUM"/>
<result property="personalSocialSum" column="SOCIAL_SECURITY_PERSONAL_SUM"/>
<result property="unitFundSum" column="UNIT_PROVIDENT_SUM"/>
<result property="personalFundSum" column="PERSONAL_PROVIDENT_SUM"/>
<result property="salarySocialFlag" column="SALARY_SOCIAL_FLAG"/>
<result property="salaryFundFlag" column="SALARY_FUND_FLAG"/>
<result property="socialPayMonth" column="SOCIAL_PAY_MONTH"/>
<result property="socialCreateMonth" column="SOCIAL_CREATE_MONTH"/>
<result property="providentPayMonth" column="PROVIDENT_PAY_MONTH"/>
<result property="providentCreateMonth" column="PROVIDENT_CREATE_MONTH"/>
<result property="settleDomainId" column="SETTLE_DOMAIN_ID"/>
</resultMap>
<!-- 薪资获取缴费库 -->
<select id="selectTForecastBySalaryVo" resultMap="tPaymentBySalaryMap">
SELECT
a.id,
a.EMP_IDCARD,
sum(ifnull(a.UNIT_BITAILMENT_FEE,0)) UNIT_BIGMAILMENT_MONEY,
sum(ifnull(a.UNIT_SOCIAL_SUM,0)) UNIT_SOCIAL_SUM,
sum(ifnull(a.PERSONAL_SOCIAL_SUM,0)) SOCIAL_SECURITY_PERSONAL_SUM,
sum(ifnull(a.UNIT_FUND_SUM,0)) UNIT_PROVIDENT_SUM,
sum(ifnull(a.PERSONAL_FUND_SUM,0)) PERSONAL_PROVIDENT_SUM,
a.SALARY_SOCIAL_FLAG,
a.SALARY_FUND_FLAG,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.SETTLE_DOMAIN_ID
FROM t_forecast_library a
<where>
1=1
<if test="tPaymentInfo != null">
<if test="tPaymentInfo.socialPayMonth != null and tPaymentInfo.socialPayMonth.trim() != ''">
AND a.SOCIAL_PAY_MONTH = #{tPaymentInfo.socialPayMonth}
</if>
<if test="tPaymentInfo.socialCreateMonth != null and tPaymentInfo.socialCreateMonth.trim() != ''">
AND a.SOCIAL_CREATE_MONTH = #{tPaymentInfo.socialCreateMonth}
</if>
<if test="tPaymentInfo.providentPayMonth != null and tPaymentInfo.providentPayMonth.trim() != ''">
AND a.PROVIDENT_PAY_MONTH = #{tPaymentInfo.providentPayMonth}
</if>
<if test="tPaymentInfo.providentCreateMonth != null and tPaymentInfo.providentCreateMonth.trim() != ''">
AND a.PROVIDENT_CREATE_MONTH = #{tPaymentInfo.providentCreateMonth}
</if>
<if test="tPaymentInfo.settleDomainId != null and tPaymentInfo.settleDomainId.trim() != ''">
AND a.SETTLE_DOMAIN_ID = #{tPaymentInfo.settleDomainId}
</if>
</if>
</where>
GROUP BY a.EMP_IDCARD
</select>
<!-- 更改薪资社保结算状态 -->
<update id="updateForecastSocialStatusByIdList">
update t_forecast_library set SALARY_SOCIAL_FLAG = #{status}
where
ID in
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<!-- 更改薪资公积金结算状态 -->
<update id="updateForecastFundStatusByIdList">
update t_forecast_library set SALARY_FUND_FLAG = #{status}
where
ID in
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper>
......@@ -1032,4 +1032,25 @@
</where>
GROUP BY a.EMP_IDCARD
</select>
<!-- 更改薪资社保结算状态 -->
<update id="updatePaymentSocialStatusByIdList">
update t_payment_info set SALARY_SOCIAL_FLAG = #{status}
where
ID in
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<!-- 更改薪资公积金结算状态 -->
<update id="updatePaymentFundStatusByIdList">
update t_payment_info set SALARY_FUND_FLAG = #{status}
where
ID in
<foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</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