diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index d2672d07c..8a4840abf 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -927,8 +927,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService userIdList.add(employeeId.toString()); String title = billTitle; // 标题 String context = "点击查看详情"; // 内容 - String linkUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=" + id; // PC端链接 - String linkMobileUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?type=phone&id=" + id; // 移动端链接 + // PC端链接 + String linkUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=" + id + "&recipient=" + employeeId; + // 移动端链接 + String linkMobileUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?type=phone&id=" + id + "&recipient=" + employeeId; try { MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl); messageBean.setCreater(user.getUID());// 创建人id @@ -1304,7 +1306,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService Long salarySendId = queryParam.getSalarySendId(); // 获取薪资核算ID SalarySendPO salarySendPO = getById(salarySendId); - if(Objects.isNull(salarySendPO)){ + if (Objects.isNull(salarySendPO)) { throw new SalaryRunTimeException("工资发放记录不存在或已被删除"); } return getSalaryAcctResultService(user).sumRow(SalaryAcctResultQueryParam.builder().salaryAcctRecordId(salarySendPO.getSalaryAccountingId()).build()); diff --git a/src/com/engine/salary/web/SalaryBillController.java b/src/com/engine/salary/web/SalaryBillController.java index deed2d29f..f20567b57 100644 --- a/src/com/engine/salary/web/SalaryBillController.java +++ b/src/com/engine/salary/web/SalaryBillController.java @@ -14,6 +14,7 @@ import io.swagger.v3.oas.annotations.parameters.RequestBody; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.general.BaseBean; import weaver.hrm.HrmUserVarify; @@ -111,7 +112,7 @@ public class SalaryBillController { @Path("/template/getAvailableSalaryGroupSet") @Produces(MediaType.APPLICATION_JSON) public String getAvailableSalaryGroupSet(@Context HttpServletRequest request, @Context HttpServletResponse response, - @RequestBody SalaryBillSalaryGroupQueryParam param) { + @RequestBody SalaryBillSalaryGroupQueryParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>(user) .run(getSalaryTemplateWrapper(user)::getSalaryGroupSet, param); @@ -124,7 +125,7 @@ public class SalaryBillController { @Path("/template/getAvailableSalaryItemSet") @Produces(MediaType.APPLICATION_JSON) public String getAvailableSalaryItemSet(@Context HttpServletRequest request, @Context HttpServletResponse response, - @RequestBody SalaryBillSalaryItemQueryParam param) { + @RequestBody SalaryBillSalaryItemQueryParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>(user) .run(getSalaryTemplateWrapper(user)::getSalaryItemSetGrouped, param); @@ -528,14 +529,18 @@ public class SalaryBillController { @Path("/mySalaryBill") @Produces(MediaType.APPLICATION_JSON) public String mySalaryBill(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryInfoId") Long salaryInfoId) { -// if (StringUtils.isEmpty(token)) { -// throw new SalaryRunTimeException(SalrayCheckSecondAuthConstant.CHECK_SECOND_FAIL_NO_TOKEN); -// } User user = HrmUserVarify.getUser(request, response); - String em_auth_userid = request.getParameter("em_auth_userid"); - if (user == null && StringUtils.isNotBlank(em_auth_userid)) { - user = new User(Integer.parseInt(em_auth_userid)); - log.info("no login em_auth_userid {} user{}", em_auth_userid, user); + if (user == null) { + String recipient = request.getParameter("recipient"); + String em_auth_userid = request.getParameter("em_auth_userid"); + log.info("salary recipient: {} em_auth_userid: {}", recipient, em_auth_userid); + if (StringUtils.isNotBlank(recipient) && NumberUtils.isCreatable(recipient)) { + user = new User(Integer.parseInt(recipient)); + } else { + if (StringUtils.isNotBlank(em_auth_userid) && NumberUtils.isCreatable(em_auth_userid)) { + user = new User(Integer.parseInt(em_auth_userid)); + } + } } return new ResponseResult>(user).run(getSalarySendWrapper(user)::mySalaryBill, salaryInfoId); } diff --git a/src/com/engine/salary/wrapper/SalarySendWrapper.java b/src/com/engine/salary/wrapper/SalarySendWrapper.java index 5f428694b..37896c483 100644 --- a/src/com/engine/salary/wrapper/SalarySendWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySendWrapper.java @@ -133,7 +133,7 @@ public class SalarySendWrapper extends Service { Set backCalcSalarySobs = SalaryEntityUtil.properties(salaryAcctRecordPOS, salaryAcctRecordPO -> salaryAcctRecordPO.getSalarySobId() + "-" + sdf.format(salaryAcctRecordPO.getSalaryMonth())); // 判断是否回算过,haveBackCalc 属性 pageList.stream().forEach(salarySendDTO -> { - if(backCalcSalarySobs.contains(salarySendDTO.getSalarySobId() + "-" + sdf.format(salarySendDTO.getSalaryYearMonth()))){ + if (backCalcSalarySobs.contains(salarySendDTO.getSalarySobId() + "-" + sdf.format(salarySendDTO.getSalaryYearMonth()))) { salarySendDTO.setHaveBackCalc(NumberUtils.INTEGER_ONE); } }); @@ -624,6 +624,9 @@ public class SalarySendWrapper extends Service { * @return */ public Map mySalaryBill(Long salaryInfoId) { + if (user == null) { + throw new SalaryRunTimeException("获取人员信息失败!"); + } return getSalarySendService(user).mySalaryBill(salaryInfoId, (long) user.getUID()); } @@ -633,7 +636,7 @@ public class SalarySendWrapper extends Service { * @param queryParam * @return */ - public Map sumSendResult(SalarySendInfoQueryParam queryParam) { + public Map sumSendResult(SalarySendInfoQueryParam queryParam) { Map datas = new HashMap<>(); //合计 Map sumRow = getSalarySendService(user).sumRow(queryParam);