Merge remote-tracking branch 'remotes/origin/feature/v3-siFunctionImprove-0112' into release/2.5.3.2301.01

This commit is contained in:
sy 2023-01-12 13:44:30 +08:00
commit 0feacffa11
6 changed files with 108 additions and 9 deletions

View File

@ -1042,6 +1042,10 @@ public class SIArchivesBiz {
list.add(new WeaTableColumn("150px", "手机号", "mobile"));
list.add(new WeaTableColumn("150px", "员工状态", "status"));
list.add(new WeaTableColumn("150px", "工号", "jobNum"));
list.add(new WeaTableColumn("150px", "入职日期", "companystartdate"));
list.add(new WeaTableColumn("150px", "离职日期", "dismissdate"));
list.add(new WeaTableColumn("150px", "社保方案名称", "socialName"));
titleMap.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k)));
list.add(new WeaTableColumn("150px", "社保账号", "socialAccount"));
@ -1215,6 +1219,8 @@ public class SIArchivesBiz {
map.put("departmentName", item.getDepartmentName());
map.put("departmentId", item.getDepartmentId());
map.put("jobNum", item.getJobNum());
map.put("companystartdate", item.getCompanystartdate());
map.put("dismissdate", item.getDimissionDate());
map.put("mobile", item.getTelephone());
map.put("siSchemeId", item.getSiSchemeId());
map.put("fundSchemeId", item.getFundSchemeId());

View File

@ -44,6 +44,14 @@ public class InsuranceArchivesEmployeePO {
private String hiredate;
/**
* 入职日期
*/
private String companystartdate;
/**
* 离职日期
*/
private String dimissionDate;
private Long siSchemeId;

View File

@ -343,7 +343,9 @@
other.otherSchemeId,
social.id AS socialId,
fund.id AS fundId,
other.id AS otherId
other.id AS otherId,
e.companystartdate as companystartdate,
e.enddate as dismissdate
FROM hrsa_insurance_base_info base
LEFT JOIN hrmresource e ON base.employee_id = e.id

View File

@ -15,6 +15,7 @@ import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
@ -61,7 +62,24 @@ public class SIImportServiceImpl extends Service implements SIImportService {
Boolean exportData = param.getExportData();
//工作簿名称
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案"); //表头
String sheetName;
//表头
if (param.getRunStatuses().size() > 0) {
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "在缴员工");
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "停缴员工");
} else {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
}
} else {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
}
List<String> headers = buildHeader();
InsuranceArchivesListParam request = InsuranceArchivesListParam.builder().build();
if (param.getHireDate() != null && param.getHireDate().length == 2) {

View File

@ -356,6 +356,24 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
//工作簿list
String sheetName;
//表头
if (param.getRunStatuses().size() > 0) {
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "在缴员工");
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "停缴员工");
} else {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
}
} else {
sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
}
//工作簿数据
List<List<String>> rows = new LinkedList<>();
List<String> collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList());
@ -385,7 +403,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
// .dataType(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 99915, "档案"))
// .function(exportMap.get("function")).build(), sheetList);
//获取excel
return ExcelUtil.genWorkbook(rows, "福利档案");
return ExcelUtil.genWorkbook(rows, sheetName);
}

View File

@ -8,12 +8,14 @@ import com.engine.salary.entity.sischeme.dto.InsuranceSchemeListDTO;
import com.engine.salary.entity.sischeme.param.InsuranceSchemeParam;
import com.engine.salary.entity.sischeme.param.InsuranceSchemeReqParam;
import com.engine.salary.entity.sischeme.param.SISchemaImportParam;
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.SISchemeService;
import com.engine.salary.service.impl.SIAccountServiceImpl;
import com.engine.salary.service.impl.SISchemeServiceImpl;
import com.engine.salary.util.ResponseResult;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.wrapper.SISchemeWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
@ -181,9 +183,25 @@ public class SISchemeController {
}
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getService(user).export(param);
String fileName = null;
String fileName ;
//表头
if (param.getRunStatuses().size() > 0) {
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "在缴员工");
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出" + "-" + "停缴员工");
} else {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
}
} else {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导出");
}
try {
fileName = URLEncoder.encode("福利档案.xlsx", "UTF-8");
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
@ -220,19 +238,48 @@ public class SISchemeController {
* 导出档案和档案模板
* @return
*/
@POST
@GET
@Path("/template/export")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody InsuranceArchivesListParam param) {
public Response exportTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response) {
InsuranceArchivesListParam param = new InsuranceArchivesListParam();
// String ids = request.getParameter("ids");
// if(StringUtils.isNotBlank(ids)){
// param.setIds( Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()));
// }
String runStatuses = request.getParameter("runStatuses");
if(StringUtils.isNotBlank(runStatuses)){
param.setRunStatuses( Arrays.stream(runStatuses.split(",")).map(String::valueOf).collect(Collectors.toList()));
}
param.setExportData(Boolean.valueOf(request.getParameter("exportData")));
User user = HrmUserVarify.getUser(request, response);
if (param.getInspectAll() != null && param.getInspectAll()) {
List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = getSIAccountService(user).allInspects(param.getIds(), param.getBillMonth());
param.setEmployeeIds(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getEmployeeId).distinct().collect(Collectors.toList()));
}
XSSFWorkbook workbook = getService(user).exportTemplate(param);
String fileName = null;
String fileName;
//表头
if (param.getRunStatuses().size() > 0) {
if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_ADD.getValue()) && param.getRunStatuses().size() == 1) {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_ADD.getDefaultLabel());
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.PAYING.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 2) {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "在缴员工");
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STAY_DEL.getValue()) && param.getRunStatuses().size() == 1) {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + EmployeeStatusEnum.STAY_DEL.getDefaultLabel());
} else if (param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_ADD.getValue()) && param.getRunStatuses().contains(EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()) && param.getRunStatuses().size() == 2) {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板" + "-" + "停缴员工");
} else {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
}
} else {
fileName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案导入模板");
}
try {
fileName = URLEncoder.encode("福利档案模板.xlsx", "UTF-8");
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}