editDataCollection-2
This commit is contained in:
parent
7279cfae05
commit
c0bb94bf71
|
|
@ -0,0 +1,26 @@
|
|||
package com.engine.salary.entity.datacollection.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/26 16:38
|
||||
* @description 累计专项附加扣-除删除参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AddUpDeductionRecordDeleteParam {
|
||||
|
||||
// 删除id
|
||||
private List<Long> id;
|
||||
|
||||
// 申报月份
|
||||
private String declareMonth;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.engine.salary.entity.datacollection.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/25 16:26
|
||||
* @description 数据采集-累计专项附加扣除编辑参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AddUpDeductionRecordParam {
|
||||
|
||||
// 主键id
|
||||
private Long id;
|
||||
|
||||
// 员工id
|
||||
private Long employeeId;
|
||||
|
||||
private String username;
|
||||
|
||||
// 申报月份
|
||||
private String declareMonth;
|
||||
|
||||
// 个税扣缴义务人
|
||||
private String taxAgentName;
|
||||
|
||||
// 个税扣缴义务人id
|
||||
private Long taxAgentId;
|
||||
|
||||
|
||||
// 部门
|
||||
private String departmentName;
|
||||
|
||||
// 手机号
|
||||
private String mobile;
|
||||
|
||||
// 工号
|
||||
private String jobNum;
|
||||
|
||||
// 累计子女教育
|
||||
private String addUpChildEducation;
|
||||
|
||||
// 累计继续教育
|
||||
private String addUpContinuingEducation;
|
||||
|
||||
// 累计住房贷款利息
|
||||
private String addUpHousingLoanInterest;
|
||||
|
||||
// 累计住房租金
|
||||
private String addUpHousingRent;
|
||||
|
||||
// 累计赡养老人
|
||||
private String addUpSupportElderly;
|
||||
|
||||
// 累计大病医疗
|
||||
private String addUpIllnessMedical;
|
||||
|
||||
// 累计婴幼儿照护
|
||||
private String addUpInfantCare;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.engine.salary.entity.datacollection.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/26 9:50
|
||||
* @description 数据采集-其他免税扣除 编辑参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OtherDeductionParam {
|
||||
|
||||
// 主键id
|
||||
private Long id;
|
||||
|
||||
// 申报月份
|
||||
private String declareMonth;
|
||||
|
||||
// 员工id
|
||||
private Long employeeId;
|
||||
|
||||
private String username;
|
||||
|
||||
// 个税扣缴义务人
|
||||
private String taxAgentName;
|
||||
|
||||
// 个税扣缴义务人id
|
||||
private Long taxAgentId;
|
||||
|
||||
// 部门
|
||||
private String departmentName;
|
||||
|
||||
// 手机号
|
||||
private String mobile;
|
||||
|
||||
private String idNo;
|
||||
|
||||
// 工号
|
||||
private String jobNum;
|
||||
|
||||
// 商业健康保险
|
||||
private String businessHealthyInsurance;
|
||||
|
||||
// 税延养老保险
|
||||
private String taxDelayEndowmentInsurance;
|
||||
|
||||
// 其他
|
||||
private String otherDeduction;
|
||||
|
||||
// 准予扣除的捐赠额
|
||||
private String deductionAllowedDonation;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -5,6 +5,8 @@ import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
|||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
|
@ -105,4 +107,36 @@ public interface AddUpDeductionService {
|
|||
* @return
|
||||
*/
|
||||
List<SalaryAcctEmployeePO> getAccountedEmployeeData(String yearMonth);
|
||||
|
||||
/**
|
||||
* @description 编辑累计专项附加扣除
|
||||
* @return void
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/25 14:09
|
||||
*/
|
||||
void editAddUpDeduction(AddUpDeductionRecordParam addUpDeduction);
|
||||
|
||||
/**
|
||||
* @description 累计专项附加扣除
|
||||
* @return void
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/26 14:24
|
||||
*/
|
||||
void createAddUpDeduction(AddUpDeductionRecordParam addUpDeductionRecordParam);
|
||||
|
||||
/**
|
||||
* @description 删除所选
|
||||
* @return void
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/26 16:34
|
||||
*/
|
||||
void deleteSelectAddUpDeduction(AddUpDeductionRecordDeleteParam deleteParam);
|
||||
|
||||
/**
|
||||
* @description 一键清空
|
||||
* @return void
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/26 16:35
|
||||
*/
|
||||
void deleteAllAddUpDeduction(String declareMonthStr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.service;
|
|||
import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionParam;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
|
@ -87,5 +88,8 @@ public interface OtherDeductionService {
|
|||
*/
|
||||
List<OtherDeductionPO> getOtherDeductionList(YearMonth declareMonth, List<Long> employeeIds, Long taxAgentId);
|
||||
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*/
|
||||
void editData(OtherDeductionParam otherDeductionParam);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
|||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentBO;
|
||||
|
|
@ -350,8 +352,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
errorSum += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//累计子女教育
|
||||
String addUpChildEducation = dto.getAddUpChildEducation();
|
||||
addUpDeduction.setAddUpChildEducation(Util.null2String(addUpChildEducation));
|
||||
|
|
@ -367,11 +367,8 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
//累计赡养老人
|
||||
String addUpSupportElderly = dto.getAddUpSupportElderly();
|
||||
addUpDeduction.setAddUpSupportElderly(Util.null2String(addUpSupportElderly));
|
||||
|
||||
addUpDeduction.setAddUpIllnessMedical(Util.null2String(dto.getAddUpIllnessMedical()));
|
||||
addUpDeduction.setAddUpInfantCare(Util.null2String(dto.getAddUpInfantCare()));
|
||||
|
||||
|
||||
if (errorSum == 0) {
|
||||
successCount += 1;
|
||||
// 合格数据
|
||||
|
|
@ -381,10 +378,8 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
// 添加错误数据
|
||||
}
|
||||
}
|
||||
|
||||
//入库
|
||||
addUpDeductionBiz.handleImportData(eligibleData);
|
||||
|
||||
apidatas.put("successCount", successCount);
|
||||
apidatas.put("errorCount", errorCount);
|
||||
apidatas.put("errorData", errorData);
|
||||
|
|
@ -396,6 +391,163 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void editAddUpDeduction(AddUpDeductionRecordParam addUpDeduction) {
|
||||
AddUpDeductionBiz addUpDeductionBiz = new AddUpDeductionBiz();
|
||||
String declareMonthStr = addUpDeduction.getDeclareMonth();
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
// 判断是否有核算过
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId()) && f.getTaxAgentId().equals(addUpDeduction.getTaxAgentId())).findFirst();
|
||||
if (optionalAcctEmp.isPresent()) {
|
||||
throw new SalaryRunTimeException("该年月这条数据已经核算过,不可进行编辑!");
|
||||
}else {
|
||||
ArrayList<AddUpDeduction> updateList = new ArrayList<>();
|
||||
AddUpDeduction build = AddUpDeduction.builder().id(addUpDeduction.getId()).addUpChildEducation(addUpDeduction.getAddUpChildEducation()).addUpContinuingEducation(addUpDeduction.getAddUpContinuingEducation()).addUpHousingLoanInterest(addUpDeduction.getAddUpHousingLoanInterest()).addUpHousingRent(addUpDeduction.getAddUpHousingRent()).addUpSupportElderly(addUpDeduction.getAddUpSupportElderly()).addUpIllnessMedical(addUpDeduction.getAddUpIllnessMedical()).addUpInfantCare(addUpDeduction.getAddUpInfantCare()).build();
|
||||
updateList.add(build);
|
||||
addUpDeductionBiz.batchUpdate(updateList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createAddUpDeduction(AddUpDeductionRecordParam addUpDeductionRecordParam) {
|
||||
long currentEmployeeId = user.getUID();
|
||||
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
|
||||
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
EmployBiz employBiz = new EmployBiz();
|
||||
AddUpDeductionBiz addUpDeductionBiz = new AddUpDeductionBiz();
|
||||
|
||||
//税款所属期
|
||||
String declareMonthStr = addUpDeductionRecordParam.getDeclareMonth();
|
||||
if(declareMonthStr == ""){
|
||||
throw new SalaryRunTimeException("税款所属期不能为空!");
|
||||
}
|
||||
// 获取所有个税扣缴义务人
|
||||
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
|
||||
//个税扣缴义务人
|
||||
String taxAgentId = Util.null2String(addUpDeductionRecordParam.getTaxAgentId());
|
||||
// 获取租户下所有的人员
|
||||
List<DataCollectionEmployee> employees = employBiz.listEmployee();
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
// 查询已有数据
|
||||
Date declareMonth = SalaryDateUtil.localDateToDate(LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER));
|
||||
List<AddUpDeduction> list = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(declareMonth).build());
|
||||
|
||||
//查询对于人员信息导入筛选的全局配置
|
||||
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
|
||||
List<AddUpDeduction> insertData = new ArrayList<>();
|
||||
List<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> taxAgentEmployees = Lists.newArrayList();
|
||||
Date now = new Date();
|
||||
//待插入数据库对象
|
||||
AddUpDeduction addUpDeduction = AddUpDeduction.builder()
|
||||
.tenantKey(DEFAULT_TENANT_KEY)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.creator((long) user.getUID())
|
||||
.declareMonth(declareMonth).build();
|
||||
|
||||
//相同的姓名
|
||||
String userName = addUpDeductionRecordParam.getUsername();
|
||||
|
||||
Long employeeId = employees.get(0).getEmployeeId();
|
||||
boolean employeeSameId = employees.stream().anyMatch(e -> e.getEmployeeId() == addUpDeductionRecordParam.getEmployeeId());
|
||||
if (!employeeSameId) {
|
||||
throw new SalaryRunTimeException("员工信息不存在");
|
||||
}
|
||||
addUpDeduction.setEmployeeId(addUpDeductionRecordParam.getEmployeeId());
|
||||
|
||||
String taxAgentName = addUpDeductionRecordParam.getTaxAgentName();
|
||||
if (StringUtils.isBlank(taxAgentName)) {
|
||||
//个税扣缴义务人不能为空
|
||||
throw new SalaryRunTimeException("个税扣缴义务人不能为空");
|
||||
} else {
|
||||
Optional<TaxAgentManageRangeEmployeeDTO> optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst();
|
||||
if (optionalTemp.isPresent()) {
|
||||
addUpDeduction.setTaxAgentId(optionalTemp.get().getTaxAgentId());
|
||||
taxAgentEmployees = optionalTemp.get().getEmployeeList();
|
||||
} else {
|
||||
//个税扣缴义务人不存在或不在权限范围内
|
||||
throw new SalaryRunTimeException("个税扣缴义务人不存在或不在权限范围内");
|
||||
}
|
||||
}
|
||||
|
||||
//fixme 分权判断
|
||||
// if (openDevolution) {
|
||||
// Optional<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee> optionalTaxAgentEmp = taxAgentEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId())).findFirst();
|
||||
// if (!optionalTaxAgentEmp.isPresent()) {
|
||||
// Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
// errorMessageMap.put("message", rowIndex + "该条数据不在个税扣缴义务人人员范围内,不可导入");
|
||||
// errorData.add(errorMessageMap);
|
||||
// errorSum += 1;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 判断是否有核算过
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId()) && f.getTaxAgentId().equals(addUpDeduction.getTaxAgentId())).findFirst();
|
||||
boolean isExist = list.stream().anyMatch(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId()) && f.getTaxAgentId().equals(addUpDeduction.getTaxAgentId()));
|
||||
if (optionalAcctEmp.isPresent() && isExist) {
|
||||
throw new SalaryRunTimeException("该年月这条数据已经核算过,不可导入");
|
||||
}
|
||||
}
|
||||
|
||||
//累计子女教育
|
||||
String addUpChildEducation = addUpDeductionRecordParam.getAddUpChildEducation();
|
||||
addUpDeduction.setAddUpChildEducation(Util.null2String(addUpChildEducation));
|
||||
//累计继续教育
|
||||
String addUpContinuingEducation = addUpDeductionRecordParam.getAddUpContinuingEducation();
|
||||
addUpDeduction.setAddUpContinuingEducation(Util.null2String(addUpContinuingEducation));
|
||||
//累计住房贷款利息
|
||||
String addUpHousingLoanInterest = addUpDeductionRecordParam.getAddUpHousingLoanInterest();
|
||||
addUpDeduction.setAddUpHousingLoanInterest(Util.null2String(addUpHousingLoanInterest));
|
||||
//累计住房租金
|
||||
String addUpHousingRent = addUpDeductionRecordParam.getAddUpHousingRent();
|
||||
addUpDeduction.setAddUpHousingRent(Util.null2String(addUpHousingRent));
|
||||
//累计赡养老人
|
||||
String addUpSupportElderly = addUpDeductionRecordParam.getAddUpSupportElderly();
|
||||
addUpDeduction.setAddUpSupportElderly(Util.null2String(addUpSupportElderly));
|
||||
|
||||
addUpDeduction.setAddUpIllnessMedical(Util.null2String(addUpDeductionRecordParam.getAddUpIllnessMedical()));
|
||||
addUpDeduction.setAddUpInfantCare(Util.null2String(addUpDeductionRecordParam.getAddUpInfantCare()));
|
||||
insertData.add(addUpDeduction);
|
||||
//入库
|
||||
addUpDeductionBiz.handleImportData(insertData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSelectAddUpDeduction(AddUpDeductionRecordDeleteParam deleteParam) {
|
||||
// AddUpDeductionBiz addUpDeductionBiz = new AddUpDeductionBiz();
|
||||
// String declareMonthStr = deleteParam.getDeclareMonth();
|
||||
// // 已经核算过的不可操作
|
||||
// // 获取已经核算的数据
|
||||
// List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
// // 判断是否有核算过
|
||||
// if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
// Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(addUpDeduction.getEmployeeId()) && f.getTaxAgentId().equals(addUpDeduction.getTaxAgentId())).findFirst();
|
||||
// if (optionalAcctEmp.isPresent()) {
|
||||
// throw new SalaryRunTimeException("该年月这条数据已经核算过,不可进行编辑!");
|
||||
// }else {
|
||||
// ArrayList<AddUpDeduction> updateList = new ArrayList<>();
|
||||
// AddUpDeduction build = AddUpDeduction.builder().id(addUpDeduction.getId()).addUpChildEducation(addUpDeduction.getAddUpChildEducation()).addUpContinuingEducation(addUpDeduction.getAddUpContinuingEducation()).addUpHousingLoanInterest(addUpDeduction.getAddUpHousingLoanInterest()).addUpHousingRent(addUpDeduction.getAddUpHousingRent()).addUpSupportElderly(addUpDeduction.getAddUpSupportElderly()).addUpIllnessMedical(addUpDeduction.getAddUpIllnessMedical()).addUpInfantCare(addUpDeduction.getAddUpInfantCare()).build();
|
||||
// updateList.add(build);
|
||||
// addUpDeductionBiz.batchUpdate(updateList);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAllAddUpDeduction(String declareMonthStr) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void checkImportParam(AddUpDeductionImportParam importParam) {
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
|||
import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionParam;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
|
|
@ -20,7 +21,10 @@ import com.engine.salary.enums.UserStatusEnum;
|
|||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.datacollection.OtherDeductionMapper;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.AddUpDeductionService;
|
||||
import com.engine.salary.service.OtherDeductionService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
|
|
@ -551,6 +555,26 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
return OtherDeductionBiz.listSome(OtherDeductionPO.builder().declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentId(taxAgentId).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editData(OtherDeductionParam otherDeductionParam) {
|
||||
String declareMonthStr = otherDeductionParam.getDeclareMonth();
|
||||
OtherDeductionBiz OtherDeductionBiz = new OtherDeductionBiz();
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr);
|
||||
// 判断是否有核算过
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(otherDeductionParam.getEmployeeId()) && f.getTaxAgentId().equals(otherDeductionParam.getTaxAgentId())).findFirst();
|
||||
if (optionalAcctEmp.isPresent()) {
|
||||
throw new SalaryRunTimeException("该年月这条数据已经核算过,不可进行编辑!");
|
||||
}else{
|
||||
ArrayList<OtherDeductionPO> updateList = new ArrayList<>();
|
||||
OtherDeductionPO build = OtherDeductionPO.builder().id(otherDeductionParam.getId()).businessHealthyInsurance(otherDeductionParam.getBusinessHealthyInsurance()).taxDelayEndowmentInsurance(otherDeductionParam.getTaxDelayEndowmentInsurance()).otherDeduction(otherDeductionParam.getOtherDeduction()).deductionAllowedDonation(otherDeductionParam.getDeductionAllowedDonation()).build();
|
||||
updateList.add(build);
|
||||
OtherDeductionBiz.batchUpdate(updateList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam param) {
|
||||
// 1.工作簿名称
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
|||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.AddUpDeductionWrapper;
|
||||
|
|
@ -257,6 +259,64 @@ public class AddUpDeductionController {
|
|||
return new ResponseResult<AddUpDeductionImportParam, Map<String, Object>>(user).run(getAddUpDeductionWrapper(user)::importAddUpDeduction, importParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 新建累计专项附加扣除
|
||||
* @return String
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/26 14:23
|
||||
*/
|
||||
@POST
|
||||
@Path("/createAddUpDeduction")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String createAddUpDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionRecordParam addUpDeduction) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<AddUpDeductionRecordParam, Map<String, Object>>(user).run(getAddUpDeductionWrapper(user)::createAddUpDeduction, addUpDeduction);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 编辑累计专项附加扣除
|
||||
* @return String
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/25 14:08
|
||||
*/
|
||||
@POST
|
||||
@Path("/editAddUpDeduction")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String editAddUpDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionRecordParam addUpDeduction) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<AddUpDeductionRecordParam, Map<String, Object>>(user).run(getAddUpDeductionWrapper(user)::editAddUpDeduction, addUpDeduction);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 累计专项附加扣除-删除所选
|
||||
* @return String
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/25 14:08
|
||||
*/
|
||||
@POST
|
||||
@Path("/deleteSelectAddUpDeduction")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteSelectAddUpDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionRecordDeleteParam deleteParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<AddUpDeductionRecordDeleteParam, Map<String, Object>>(user).run(getAddUpDeductionWrapper(user)::deleteSelectAddUpDeduction, deleteParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 累计专项附加扣除-一键清空
|
||||
* @return String
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/25 14:08
|
||||
*/
|
||||
@POST
|
||||
@Path("/deleteAllAddUpDeduction")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String deleteAllAddUpDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody String declareMonth) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, Map<String, Object>>(user).run(getAddUpDeductionWrapper(user)::deleteAllAddUpDeduction, declareMonth);
|
||||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/getDetailList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionParam;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionQueryParam;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
|
|
@ -32,7 +33,10 @@ import java.net.URLEncoder;
|
|||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -271,5 +275,19 @@ public class OtherDeductionController {
|
|||
return new ResponseResult<OtherDeductionImportParam, Map<String, Object>>(user).run(getOtherDeductionWrapper(user)::importData, importParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 编辑其他免税扣除
|
||||
* @return String
|
||||
* @author Harryxzy
|
||||
* @date 2022/10/26 9:41
|
||||
*/
|
||||
@POST
|
||||
@Path("/editData")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String editOtherDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionParam otherDeductionParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<OtherDeductionParam, Map<String, Object>>(user).run(getOtherDeductionWrapper(user)::editData, otherDeductionParam);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
|
|||
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam;
|
||||
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.AddUpDeductionService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
|
|
@ -140,4 +142,20 @@ public class AddUpDeductionWrapper extends Service {
|
|||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
return getAddUpDeductionService(user).getSearchCondition(params);
|
||||
}
|
||||
|
||||
public void editAddUpDeduction(AddUpDeductionRecordParam addUpDeduction) {
|
||||
getAddUpDeductionService(user).editAddUpDeduction(addUpDeduction);
|
||||
}
|
||||
|
||||
public void createAddUpDeduction(AddUpDeductionRecordParam addUpDeductionRecordParam) {
|
||||
getAddUpDeductionService(user).createAddUpDeduction(addUpDeductionRecordParam);
|
||||
}
|
||||
|
||||
public void deleteSelectAddUpDeduction(AddUpDeductionRecordDeleteParam deleteParam) {
|
||||
getAddUpDeductionService(user).deleteSelectAddUpDeduction(deleteParam);
|
||||
}
|
||||
|
||||
public void deleteAllAddUpDeduction(String declareMonthStr) {
|
||||
getAddUpDeductionService(user).deleteAllAddUpDeduction(declareMonthStr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionParam;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionQueryParam;
|
||||
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -204,4 +205,13 @@ public class OtherDeductionWrapper extends Service {
|
|||
public Map<String, Object> importData(OtherDeductionImportParam importParam){
|
||||
return getOtherDeductionService(user).importData(importParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*/
|
||||
public void editData(OtherDeductionParam otherDeductionParam) {
|
||||
getOtherDeductionService(user).editData(otherDeductionParam);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue