diff --git a/src/com/engine/salary/cmd/datacollection/AddUpDeductionGetDetailListCmd.java b/src/com/engine/salary/cmd/datacollection/AddUpDeductionGetDetailListCmd.java index 92715a12c..4796b1722 100644 --- a/src/com/engine/salary/cmd/datacollection/AddUpDeductionGetDetailListCmd.java +++ b/src/com/engine/salary/cmd/datacollection/AddUpDeductionGetDetailListCmd.java @@ -5,8 +5,10 @@ import com.engine.common.biz.AbstractCommonCommand; import com.engine.common.entity.BizLogContext; import com.engine.core.interceptor.CommandContext; import com.engine.salary.biz.AddUpDeductionBiz; +import com.engine.salary.biz.EmployBiz; import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.entity.datacollection.AddUpDeduction; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; import com.engine.salary.exception.SalaryRunTimeException; @@ -32,6 +34,7 @@ public class AddUpDeductionGetDetailListCmd extends AbstractCommonCommand execute(CommandContext commandContext) { + EmployBiz employBiz = new EmployBiz(); AddUpDeductionBiz biz = new AddUpDeductionBiz(); AddUpDeductionQueryParam queryParam = (AddUpDeductionQueryParam) params.get("queryParam"); @@ -49,10 +52,10 @@ public class AddUpDeductionGetDetailListCmd extends AbstractCommonCommand employeeList = employeeService.getEmployeeByIds(Collections.singletonList(po.getEmployeeId()), tenantKey); -// if (CollectionUtils.isEmpty(employeeList)) { -// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100340, "员工信息不存在")); -// } + List employeeList = employBiz.getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); + if (CollectionUtils.isEmpty(employeeList)) { + throw new SalaryRunTimeException("员工信息不存在"); + } queryParam.setEmployeeId(po.getEmployeeId()); diff --git a/src/com/engine/salary/cmd/datacollection/AddUpSituationGetDetailListCmd.java b/src/com/engine/salary/cmd/datacollection/AddUpSituationGetDetailListCmd.java index 22ac82f71..f9c42c179 100644 --- a/src/com/engine/salary/cmd/datacollection/AddUpSituationGetDetailListCmd.java +++ b/src/com/engine/salary/cmd/datacollection/AddUpSituationGetDetailListCmd.java @@ -4,9 +4,14 @@ import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.biz.AbstractCommonCommand; import com.engine.common.entity.BizLogContext; import com.engine.core.interceptor.CommandContext; +import com.engine.salary.biz.AddUpSituationBiz; +import com.engine.salary.biz.EmployBiz; import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.entity.datacollection.AddUpSituation; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO; import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam; +import com.engine.salary.exception.SalaryRunTimeException; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; @@ -29,6 +34,30 @@ public class AddUpSituationGetDetailListCmd extends AbstractCommonCommand execute(CommandContext commandContext) { + EmployBiz employBiz = new EmployBiz(); + AddUpSituationBiz biz = new AddUpSituationBiz(); + + AddUpSituationQueryParam queryParam = (AddUpSituationQueryParam) params.get("queryParam"); + if (queryParam == null) { + throw new SalaryRunTimeException("参数异常"); + } + + Long id = queryParam.getAccumulatedSituationId(); + if (id == null) { + throw new SalaryRunTimeException("累计情况id不能为空"); + } + + AddUpSituation po = biz.getById(id); + if (po == null) { + throw new SalaryRunTimeException(String.format("累计情况不存在[id:%s]", id)); + } + + List employeeList = employBiz.getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); + if (CollectionUtils.isEmpty(employeeList)) { + throw new SalaryRunTimeException("员工信息不存在"); + } + + String fields = " t1.id," + " t1.tax_year_month," + " t1.employee_id as employeeId," +