package com.engine.salary.cmd.datacollection; 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.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam; import com.engine.salary.exception.SalaryRunTimeException; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; import java.util.Map; public class AddUpDeductionExportDetailCmd extends AbstractCommonCommand { public AddUpDeductionExportDetailCmd(Map params, User user) { this.user = user; this.params = params; } @Override public BizLogContext getLogContext() { return null; } @Override public XSSFWorkbook execute(CommandContext commandContext) { AddUpDeductionQueryParam queryParam = (AddUpDeductionQueryParam) params.get("addUpDeductionQueryParam"); AddUpDeductionBiz biz = new AddUpDeductionBiz(); Long id = queryParam.getAccumulatedSpecialAdditionalDeductionId(); if (id == null) { throw new SalaryRunTimeException("id不能为空"); } AddUpDeduction po = biz.getById(id); if (po == null) { throw new SalaryRunTimeException(String.format("累计专项附加扣除不存在"+"[id:%s]", id)); } XSSFWorkbook workbook = biz.exportDetail(queryParam); return workbook; } }