diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index ed8d39888..1b4a7aba7 100644 --- a/src/com/engine/salary/service/AddUpDeductionService.java +++ b/src/com/engine/salary/service/AddUpDeductionService.java @@ -139,4 +139,12 @@ public interface AddUpDeductionService { * @date 2022/10/26 16:35 */ void deleteAllAddUpDeduction(AddUpDeductionRecordDeleteParam deleteParam); + + /** + * @description 获取累计专项附加扣除详情 + * @return void + * @author Harryxzy + * @date 2022/10/31 11:33 + */ + AddUpDeductionRecordDTO getAddUpDeduction(AddUpDeductionQueryParam id); } diff --git a/src/com/engine/salary/service/AddUpSituationService.java b/src/com/engine/salary/service/AddUpSituationService.java index 7b34b4f5a..f8c1c65d4 100644 --- a/src/com/engine/salary/service/AddUpSituationService.java +++ b/src/com/engine/salary/service/AddUpSituationService.java @@ -107,4 +107,12 @@ public interface AddUpSituationService { * @date 2022/10/27 22:35 */ void deleteAllAddUpSituation(AddUpDeductionRecordDeleteParam deleteParam); + + /** + * @description 获取往期累计情况 + * @return void + * @author Harryxzy + * @date 2022/10/31 14:00 + */ + AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam); } diff --git a/src/com/engine/salary/service/AttendQuoteDataService.java b/src/com/engine/salary/service/AttendQuoteDataService.java index ca0e605fb..21609dd55 100644 --- a/src/com/engine/salary/service/AttendQuoteDataService.java +++ b/src/com/engine/salary/service/AttendQuoteDataService.java @@ -86,4 +86,10 @@ public interface AttendQuoteDataService { * @param attendQuoteDataEditParam */ void editData(AttendQuoteDataEditParam attendQuoteDataEditParam); + + /** + * 获取数据 + * @param attendQuoteDataEditParam + */ + Map getData(AttendQuoteDataEditParam attendQuoteDataEditParam); } diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index 2cfaa3055..9e691d559 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -108,4 +108,9 @@ public interface OtherDeductionService { * 一键清空数据 */ void deleteAllData(AddUpDeductionRecordDeleteParam deleteParam); + + /** + * 获取数据 + */ + OtherDeductionRecordDTO getOtherDeduction(OtherDeductionParam otherDeductionParam); } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 03dac60c8..e7086f94c 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -609,6 +609,26 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction addUpDeductionBiz.batchDeleteByIDS(deleteIds); } + @Override + public AddUpDeductionRecordDTO getAddUpDeduction(AddUpDeductionQueryParam param) { + long uid = user.getUID(); + // 获取所有个税扣缴义务人 + Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(uid); + List taxAgentNames = taxAgentList.stream().map(TaxAgentManageRangeEmployeeDTO::getTaxAgentName).collect(Collectors.toList()); + ArrayList ids = new ArrayList<>(); + ids.add(param.getId()); + AddUpDeductionQueryParam build = AddUpDeductionQueryParam.builder().ids(ids).build(); + List addUpDeductionRecordDTOS = new AddUpDeductionBiz().recordList(build); + if(addUpDeductionRecordDTOS==null || addUpDeductionRecordDTOS.size()==0){ + throw new SalaryRunTimeException("该数据不存在!"); + } + String taxAgentName = addUpDeductionRecordDTOS.get(0).getTaxAgentName(); + if(!taxAgentNames.contains(taxAgentName)){ + throw new SalaryRunTimeException("您无权查看该数据!"); + } + return addUpDeductionRecordDTOS.get(0); + } + private void checkImportParam(AddUpDeductionImportParam importParam) { diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index f5e668048..45c44dbef 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -1102,6 +1102,26 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation biz.batchDeleteByIDS(deleteIds); } + @Override + public AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam) { + long uid = user.getUID(); + // 获取所有个税扣缴义务人 + Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(uid); + List taxAgentNames = taxAgentList.stream().map(TaxAgentManageRangeEmployeeDTO::getTaxAgentName).collect(Collectors.toList()); + ArrayList ids = new ArrayList<>(); + ids.add(addUpSituationParam.getId()); + AddUpSituationQueryParam build = AddUpSituationQueryParam.builder().ids(ids).build(); + List list = biz.recordList(build); + if(list == null || list.size()==0){ + throw new SalaryRunTimeException("该数据不存在!"); + } + String taxAgentName = list.get(0).getTaxAgentName(); + if(!taxAgentNames.contains(taxAgentName)){ + throw new SalaryRunTimeException("您无权查看该数据!"); + } + return list.get(0); + } + @Override public void batchSave(List list) { if (CollectionUtils.isNotEmpty(list)) { diff --git a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java index 424c020d8..d2865804d 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java @@ -3,6 +3,9 @@ package com.engine.salary.service.impl; import com.alibaba.druid.support.json.JSONUtils; import com.alibaba.fastjson.JSONObject; import com.api.formmode.mybatis.util.SqlProxyHandle; +import com.cloudstore.eccom.pc.table.WeaTable; +import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.*; @@ -810,6 +813,51 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa } } + /** + * @description 获取数据 + * @return void + * @author Harryxzy + * @date 2022/10/31 14:12 + */ + @Override + public Map getData(AttendQuoteDataEditParam attendQuoteDataEditParam) { + ArrayList ids = new ArrayList<>(); + ids.add(attendQuoteDataEditParam.getId()); + AttendQuoteDataQueryParam build = AttendQuoteDataQueryParam.builder().ids(ids).build(); + List list = dataBiz.list(build); + if(list==null || list.size()==0){ + throw new SalaryRunTimeException("该数据不存在!"); + } + // 所有考勤字段 + List attendQuoteFields = getAllAttendQuoteFields(); + // 获取最终结果 + List> listMaps = getListMaps(list); + List columns = new ArrayList<>(); + columns.add(new WeaTableColumn("150", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username")); + columns.add(new WeaTableColumn("150", SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName")); + columns.add(new WeaTableColumn("150", SalaryI18nUtil.getI18nLabel(86186, "手机号"), "mobile")); + columns.add(new WeaTableColumn("150", SalaryI18nUtil.getI18nLabel(86317, "工号"), "jobNum")); + + // 动态列 + if (CollectionUtils.isNotEmpty(listMaps)) { + Map map = listMaps.stream().max(Comparator.comparingInt(m -> m.keySet().size())).get(); + for (AttendQuoteFieldPO attendQuoteField : attendQuoteFields) { + if (map.containsKey(attendQuoteField.getId() + "_attendQuoteData")) { + columns.add(new WeaTableColumn("150", attendQuoteField.getFieldName(), attendQuoteField.getId() + "_attendQuoteData")); + } + } + } + WeaTable weaTable = new WeaTable(); + weaTable.setColumns(columns); + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(weaTable.makeDataResult()); + result.success(); + Map datas = new HashMap<>(); + datas.put("data",listMaps.get(0)); + datas.put("dataKey", result.getResultMap()); + return datas; + } + /** * 获取金额数字值 * diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 2513aacdc..6edd8bddf 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -763,6 +763,28 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction otherDeductionBiz.batchDeleteByIDS(deleteIds); } + @Override + public OtherDeductionRecordDTO getOtherDeduction(OtherDeductionParam otherDeductionParam) { + long uid = user.getUID(); + // 获取所有个税扣缴义务人 + Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(uid); + List taxAgentNames = taxAgentList.stream().map(TaxAgentManageRangeEmployeeDTO::getTaxAgentName).collect(Collectors.toList()); + ArrayList ids = new ArrayList<>(); + ids.add(otherDeductionParam.getId()); + OtherDeductionQueryParam build = OtherDeductionQueryParam.builder().ids(ids).build(); + List list = getOtherDeductionMapper().recordList(build); + OtherDeductionRecordDTOEncrypt.decryptOtherDeductionRecordDTOList(list); + + if(list==null || list.size()==0){ + throw new SalaryRunTimeException("该数据不存在!"); + } + String taxAgentName = list.get(0).getTaxAgentName(); + if(!taxAgentNames.contains(taxAgentName)){ + throw new SalaryRunTimeException("您无权查看该数据!"); + } + return list.get(0); + } + @Override public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam param) { // 1.工作簿名称 diff --git a/src/com/engine/salary/web/AddUpDeductionController.java b/src/com/engine/salary/web/AddUpDeductionController.java index 563157219..894fbc81d 100644 --- a/src/com/engine/salary/web/AddUpDeductionController.java +++ b/src/com/engine/salary/web/AddUpDeductionController.java @@ -273,6 +273,20 @@ public class AddUpDeductionController { return new ResponseResult>(user).run(getAddUpDeductionWrapper(user)::createAddUpDeduction, addUpDeduction); } + /** + * @description 获取累计专项附加扣除信息 + * @return String + * @author Harryxzy + * @date 2022/10/31 11:23 + */ + @POST + @Path("/getAddUpDeduction") + @Produces(MediaType.APPLICATION_JSON) + public String getAddUpDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpDeductionQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getAddUpDeductionWrapper(user)::getAddUpDeduction, param); + } + /** * @description 编辑累计专项附加扣除 diff --git a/src/com/engine/salary/web/AddUpSituationController.java b/src/com/engine/salary/web/AddUpSituationController.java index a0bd97f03..931f26c73 100644 --- a/src/com/engine/salary/web/AddUpSituationController.java +++ b/src/com/engine/salary/web/AddUpSituationController.java @@ -287,6 +287,20 @@ public class AddUpSituationController { return new ResponseResult>(user).run(getAddUpSituationWrapper(user)::editAddUpSituation, addUpSituation); } + /** + * @description 获取往期累计情况 + * @return String + * @author Harryxzy + * @date 2022/10/31 13:59 + */ + @POST + @Path("/getAddUpSituation") + @Produces(MediaType.APPLICATION_JSON) + public String getAddUpSituation(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AddUpSituationParam addUpSituation) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getAddUpSituationWrapper(user)::getAddUpSituation, addUpSituation); + } + /** * @description 新建数据 * @return String diff --git a/src/com/engine/salary/web/AttendQuoteController.java b/src/com/engine/salary/web/AttendQuoteController.java index f8ae2876f..5e0f1464c 100644 --- a/src/com/engine/salary/web/AttendQuoteController.java +++ b/src/com/engine/salary/web/AttendQuoteController.java @@ -208,6 +208,15 @@ public class AttendQuoteController { return new ResponseResult>(user).run(getAttendQuoteDataWrapper(user)::view, queryParam); } + + @POST + @Path("/getData") + @Produces(MediaType.APPLICATION_JSON) + public String getData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AttendQuoteDataEditParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getAttendQuoteDataWrapper(user)::getData, queryParam); + } + /** * 编辑考勤数据 * @@ -344,6 +353,7 @@ public class AttendQuoteController { } + /** * 修改考勤字段 */ diff --git a/src/com/engine/salary/web/OtherDeductionController.java b/src/com/engine/salary/web/OtherDeductionController.java index 535f70839..91a7401a7 100644 --- a/src/com/engine/salary/web/OtherDeductionController.java +++ b/src/com/engine/salary/web/OtherDeductionController.java @@ -290,6 +290,20 @@ public class OtherDeductionController { return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::editData, otherDeductionParam); } + /** + * @description 获取其他免税扣除数据 + * @return String + * @author Harryxzy + * @date 2022/10/31 13:42 + */ + @POST + @Path("/getData") + @Produces(MediaType.APPLICATION_JSON) + public String getOtherDeduction(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionParam otherDeductionParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::getOtherDeduction, otherDeductionParam); + } + /** * @description 新建其他免税扣除 * @return String diff --git a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java index f46e2cc89..bf50b1960 100644 --- a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java @@ -158,4 +158,8 @@ public class AddUpDeductionWrapper extends Service { public void deleteAllAddUpDeduction(AddUpDeductionRecordDeleteParam deleteParam) { getAddUpDeductionService(user).deleteAllAddUpDeduction(deleteParam); } + + public AddUpDeductionRecordDTO getAddUpDeduction(AddUpDeductionQueryParam param) { + return getAddUpDeductionService(user).getAddUpDeduction(param); + } } diff --git a/src/com/engine/salary/wrapper/AddUpSituationWrapper.java b/src/com/engine/salary/wrapper/AddUpSituationWrapper.java index 6cb03376e..036e2c2f5 100644 --- a/src/com/engine/salary/wrapper/AddUpSituationWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpSituationWrapper.java @@ -169,4 +169,14 @@ public class AddUpSituationWrapper extends Service { public void deleteAllAddUpSituation(AddUpDeductionRecordDeleteParam deleteParam) { getAddUpSituationService(user).deleteAllAddUpSituation(deleteParam); } + + /** + * @description 获取往期累计情况 + * @return null + * @author Harryxzy + * @date 2022/10/31 14:00 + */ + public AddUpSituationRecordDTO getAddUpSituation(AddUpSituationParam addUpSituationParam) { + return getAddUpSituationService(user).getAddUpSituation(addUpSituationParam); + } } diff --git a/src/com/engine/salary/wrapper/AttendQuoteDataWrapper.java b/src/com/engine/salary/wrapper/AttendQuoteDataWrapper.java index 0d3e3fc09..f9a394da6 100644 --- a/src/com/engine/salary/wrapper/AttendQuoteDataWrapper.java +++ b/src/com/engine/salary/wrapper/AttendQuoteDataWrapper.java @@ -149,4 +149,11 @@ public class AttendQuoteDataWrapper extends Service { public void editData(AttendQuoteDataEditParam attendQuoteDataEditParam) { getAttendQuoteDataService(user).editData(attendQuoteDataEditParam); } + + /** + * 获取数据 + */ + public Map getData(AttendQuoteDataEditParam attendQuoteDataEditParam) { + return getAttendQuoteDataService(user).getData(attendQuoteDataEditParam); + } } diff --git a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java index eee3cc516..1430e7702 100644 --- a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java @@ -235,4 +235,11 @@ public class OtherDeductionWrapper extends Service { public void deleteAllData(AddUpDeductionRecordDeleteParam deleteParam) { getOtherDeductionService(user).deleteAllData(deleteParam); } + + /** + * 获取数据 + */ + public OtherDeductionRecordDTO getOtherDeduction(OtherDeductionParam otherDeductionParam) { + return getOtherDeductionService(user).getOtherDeduction(otherDeductionParam); + } }