package com.engine.salary.wrapper; import cn.hutool.core.util.ObjectUtil; import com.api.browser.bean.SearchConditionGroup; import com.api.browser.bean.SearchConditionItem; import com.api.browser.bean.SearchConditionOption; import com.api.browser.util.ConditionFactory; import com.api.browser.util.ConditionType; import com.cloudstore.eccom.constant.WeaBoolAttr; import com.cloudstore.eccom.pc.table.WeaTable; import com.cloudstore.eccom.pc.table.WeaTableCheckboxpopedom; 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.constant.SalaryItemConstant; import com.engine.salary.entity.salaryBill.dto.*; import com.engine.salary.entity.salaryBill.param.*; import com.engine.salary.entity.salaryBill.po.SalarySendPO; import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salarybill.SalarySendStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarybill.SalarySendMapper; import com.engine.salary.service.*; import com.engine.salary.service.impl.*; import com.engine.salary.sys.constant.SalarySysConstant; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.enums.PayrollCheckTypeEnum; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.wrapper.proxy.SalarySendWrapperProxy; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.ibatis.session.SqlSession; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.conn.mybatis.MyBatisFactory; import weaver.hrm.User; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; /** * 工资单发放 *

Copyright: Copyright (c) 2022

*

Company: 泛微软件

* * @author qiantao * @version 1.0 **/ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy { private TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } private SalarySendService getSalarySendService(User user) { return ServiceUtil.getService(SalarySendServiceImpl.class, user); } private SalaryBillService getSalaryBillService(User user) { return ServiceUtil.getService(SalaryBillServiceImpl.class, user); } private SalaryTemplateService getSalaryTemplateService(User user) { return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user); } private SalarySobService getSalarySobService(User user) { return ServiceUtil.getService(SalarySobServiceImpl.class, user); } private SalaryAcctRecordService getSalaryAcctRecordService(User user) { return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); } private SalarySysConfService getSalarySysConfService(User user) { return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } /** * 工资单发放列表 * * @param queryParam * @return */ public Map list(SalarySendQueryParam queryParam) { // 处理工资单发放历史数据 getSalarySendService(user).handleHistory(); long currentEmployeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); Map datas = new HashMap<>(16); try { queryParam.setSalaryMonth(queryParam.getSalaryYearMonth().stream().map(e -> e + "-01 00:00:00").collect(Collectors.toList())); queryParam.setSalaryMonthDate(queryParam.getSalaryYearMonth().stream().map(e -> e + "-01 00:00:00").map(SalaryDateUtil::dateStrToLocalTime).collect(Collectors.toList())); //分权,获取当前人员管理的账套 Boolean needAuth = getTaxAgentService(user).isNeedAuth(currentEmployeeId); List list = new ArrayList<>(); if (needAuth) { List salarySobPOS = getSalarySobService(user).listByDisable(NumberUtils.INTEGER_ZERO); Set salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId); if (CollectionUtils.isNotEmpty(salarySobIds)) { queryParam.setSalarySobIds(salarySobIds); SalarySendMapper salarySendMapper = sqlSession.getMapper(SalarySendMapper.class); list = salarySendMapper.list(queryParam); } } else { SalarySendMapper salarySendMapper = sqlSession.getMapper(SalarySendMapper.class); list = salarySendMapper.list(queryParam); } list.stream().forEach(dto -> { // 回算过,但是查看的是普通工资单(不能查看详情);回算过,但是查看的是回算工资单(可以发);记录没回算过(可以发) if(Objects.equals(dto.getSalaryAcctRecordType(), NumberUtils.INTEGER_ONE) && Objects.equals(dto.getSalaryAcctType(),NumberUtils.INTEGER_ZERO)){ dto.setCanSeeDetail(false); }else{ dto.setCanSeeDetail(true); } }); PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, SalarySendListDTO.class); List pageList = pageInfo.getList(); List salarySobIds = pageList.stream().map(SalarySendListDTO::getSalarySobId).distinct().collect(Collectors.toList()); // 获取默认模板 if (salarySobIds.size() > 0) { List salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(salarySobIds); pageList.forEach(e -> { // 已发放 e.setSendSituation(e.getSendNum() + "/" + e.getSendTotal()); // 工资单模板 Optional optional = salaryTemplates.stream().filter(s -> s.getSalarySobId().equals(e.getSalarySobId())).findFirst(); if (optional.isPresent()) { // todo 目前就一个回算,那么没有冻结且是回算,就展示补发名称 e.setTemplate(NumberUtils.INTEGER_ONE.equals(e.getSalaryAcctType()) ? optional.get().getReplenishName() : optional.get().getName()); e.setTemplateId(optional.get().getId()); } // e.setHaveBackCalc(NumberUtils.INTEGER_ZERO); }); } // 薪资核算ID Set salaryAcctIds = SalaryEntityUtil.properties(pageList, SalarySendListDTO::getSalaryAcctId); // 获取是回算的薪资核算ID SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); List salaryAcctRecordPOS = getSalaryAcctRecordService(user).getBackCalcRecordByIds(salaryAcctIds); // 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()))) { // salarySendDTO.setHaveBackCalc(NumberUtils.INTEGER_ONE); // } // }); List columns = buildWeaTableColumns(); WeaTable table = new WeaTable(); table.setColumns(columns); //设置check是否可用 List checkboxpopedomList = new ArrayList<>(); WeaTableCheckboxpopedom checkboxpopedom = new WeaTableCheckboxpopedom(); checkboxpopedom.setPopedompara("column:system_type"); checkboxpopedom.setShowmethod("com.engine.salary.transmethod.TaxRateTransMethod.getCheckBoxPopedom"); checkboxpopedomList.add(checkboxpopedom); table.setCheckboxList(checkboxpopedomList); table.setCheckboxpopedom(null); WeaResultMsg result = new WeaResultMsg(false); result.putAll(table.makeDataResult()); result.success(); datas.put("pageInfo", pageInfo); datas.put("datas", pageList); datas.put("columns", columns); datas.put("dataKey", result.getResultMap()); return datas; } catch (Exception e) { throw new SalaryRunTimeException(e.getMessage()); } finally { sqlSession.close(); } } /** * 创建表展示字段 * * @return */ private List buildWeaTableColumns() { List list = new ArrayList<>(); WeaTableColumn idColumn = new WeaTableColumn("0px", "id", "id"); idColumn.setDisplay(WeaBoolAttr.FALSE); list.add(new WeaTableColumn("10%", "薪资所属月", "salaryYearMonth")); list.add(new WeaTableColumn("35%", "薪资账套", "salarySob")); list.add(new WeaTableColumn("25%", "次数", "acctTimes")); list.add(new WeaTableColumn("25%", "工资单模板", "template")); list.add(new WeaTableColumn("15%", "已发放", "sendSituation")); list.add(new WeaTableColumn("15%", "最后发送时间", "lastSendTime")); return list; } /** * 工资单发放基本信息 * * @param id * @return */ public SalarySendBaseInfoDTO getBaseInfo(Long id) { return getSalarySendService(user).getBaseInfo(id); } /** * 工资单发放信息列表的高级搜索 * * @return */ public Map getInfoSearchCondition() { Map apidatas = new HashMap(); ConditionFactory conditionFactory = new ConditionFactory(user); //条件组 List addGroups = new ArrayList(); List conditionItems = new ArrayList(); //文本输入框 SearchConditionItem username = conditionFactory.createCondition(ConditionType.INPUT, 25034, "username"); username.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 username.setFieldcol(16); //条件输入框所占宽度,默认值18 username.setLabelcol(8); username.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 username.setLabel("姓名"); //设置文本值 这个将覆盖多语言标签的值 username.setInputType(""); conditionItems.add(username); // 个税扣缴义务人 SearchConditionItem taxAgent = conditionFactory.createCondition(ConditionType.SELECT, 25034, "taxAgentId"); taxAgent.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 taxAgent.setFieldcol(16); //条件输入框所占宽度,默认值18 taxAgent.setLabelcol(8); List searchConditionOptions = new ArrayList<>(); Collection taxAgentLists = getTaxAgentService(user).findAll(); taxAgentLists.forEach(e -> searchConditionOptions.add(new SearchConditionOption(e.getId().toString(), e.getName()))); taxAgent.setOptions(searchConditionOptions); taxAgent.setInputType(""); taxAgent.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 taxAgent.setLabel("个税扣缴义务人"); //设置文本值 这个将覆盖多语言标签的值 conditionItems.add(taxAgent); // 部门 SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "departmentIds", "4"); departmentName.setColSpan(2); departmentName.setFieldcol(16); departmentName.setLabelcol(8); departmentName.setViewAttr(2); departmentName.setIsQuickSearch(false); departmentName.setLabel("部门"); departmentName.setInputType(""); conditionItems.add(departmentName); // 岗位 SearchConditionItem position = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "positionIds", "24"); position.setColSpan(2); position.setFieldcol(16); position.setLabelcol(8); position.setViewAttr(2); position.setIsQuickSearch(false); position.setLabel("岗位"); position.setInputType(""); conditionItems.add(position); //状态 SearchConditionItem status = conditionFactory.createCondition(ConditionType.SELECT, 25034, "userstatus"); status.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 status.setFieldcol(16); //条件输入框所占宽度,默认值18 status.setLabelcol(8); List userStatusOptions = new ArrayList<>(); UserStatusEnum.getList().forEach(e -> userStatusOptions.add(new SearchConditionOption(e.get("id"), e.get("content")))); status.setOptions(userStatusOptions); status.setInputType(""); status.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 status.setLabel("状态"); //设置文本值 这个将覆盖多语言标签的值 conditionItems.add(status); //发送状态 SearchConditionItem sendStatus = conditionFactory.createCondition(ConditionType.SELECT, 25034, "sendStatusVal"); sendStatus.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 sendStatus.setFieldcol(16); //条件输入框所占宽度,默认值18 sendStatus.setLabelcol(8); List sendStatusOptions = new ArrayList<>(); Arrays.asList(SalarySendStatusEnum.values()) .forEach(e -> sendStatusOptions.add(new SearchConditionOption(e.getValue().toString(), e.getDefaultLabel()))); sendStatus.setOptions(sendStatusOptions); sendStatus.setInputType(""); sendStatus.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 sendStatus.setLabel("发送状态"); //设置文本值 这个将覆盖多语言标签的值 conditionItems.add(sendStatus); addGroups.add(new SearchConditionGroup("常用条件", true, conditionItems)); apidatas.put("condition", addGroups); return apidatas; } /** * 工资单发放信息列表 * * @param queryParam * @return */ public PageInfo infoList(SalarySendInfoQueryParam queryParam) { SalarySendInfoQueryParam.checkParam(queryParam); // 发送状态 if (queryParam.getSendStatus() != null) { queryParam.setSendStatusVal(queryParam.getSendStatus().getValue()); } PageInfo pageInfo = getSalarySendService(user).salarySendInfoListPage(queryParam); return pageInfo; } /** * 工资单信息列表 * * @return */ private List buildInfoListWeaTableColumns() { List list = new ArrayList<>(); WeaTableColumn idColumn = new WeaTableColumn("0px", "id", "id"); idColumn.setDisplay(WeaBoolAttr.TRUE); list.add(new WeaTableColumn("20%", "姓名", "username")); list.add(new WeaTableColumn("20%", "个税扣缴义务人", "taxAgent")); list.add(new WeaTableColumn("20%", "部门", "department")); list.add(new WeaTableColumn("20%", "手机号", "mobile")); list.add(new WeaTableColumn("20%", "工号", "jobNum")); list.add(new WeaTableColumn("20%", "发送状态", "sendStatus")); list.add(new WeaTableColumn("20%", "操作", "operation")); return list; } /** * 导出-工资单发放信息列表 * * @param queryParam * @return */ public XSSFWorkbook exportInfoList(SalarySendInfoQueryParam queryParam) { return getSalarySendService(user).exportInfoList(queryParam); } /** * 工资单发放 * * @param queryParam * @return */ public Map grant(SalarySendGrantParam queryParam) { return getSalaryBillService(user).grant(queryParam); } /** * 工资单撤回 * * @param queryParam * @return */ public Map withdraw(SalarySendWithdrawParam queryParam) { return getSalarySendService(user).withdraw(queryParam); } /** * 工资单发放详情列表的高级搜索 * * @return */ public Map getDetailSearchCondition() { Map apidatas = new HashMap(); ConditionFactory conditionFactory = new ConditionFactory(user); //条件组 List addGroups = new ArrayList(); List conditionItems = new ArrayList(); //文本输入框 SearchConditionItem username = conditionFactory.createCondition(ConditionType.INPUT, 25034, "username"); username.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 username.setFieldcol(16); //条件输入框所占宽度,默认值18 username.setLabelcol(8); username.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 username.setLabel("姓名"); //设置文本值 这个将覆盖多语言标签的值 username.setInputType(""); conditionItems.add(username); // 个税扣缴义务人 SearchConditionItem taxAgent = conditionFactory.createCondition(ConditionType.SELECT, 25034, "taxAgent"); taxAgent.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 taxAgent.setFieldcol(16); //条件输入框所占宽度,默认值18 taxAgent.setLabelcol(8); List searchConditionOptions = new ArrayList<>(); Collection taxAgentLists = getTaxAgentService(user).findAll(); taxAgentLists.forEach(e -> searchConditionOptions.add(new SearchConditionOption(e.getId().toString(), e.getName()))); taxAgent.setOptions(searchConditionOptions); taxAgent.setInputType(""); taxAgent.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 taxAgent.setLabel("个税扣缴义务人"); //设置文本值 这个将覆盖多语言标签的值 conditionItems.add(taxAgent); // 部门 SearchConditionItem departmentName = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "department", "4"); departmentName.setColSpan(2); departmentName.setFieldcol(16); departmentName.setLabelcol(8); departmentName.setViewAttr(2); departmentName.setInputType(""); departmentName.setIsQuickSearch(false); departmentName.setLabel("部门"); conditionItems.add(departmentName); // 岗位 SearchConditionItem position = conditionFactory.createCondition(ConditionType.BROWSER, 502227, "position", "24"); position.setColSpan(2); position.setFieldcol(16); position.setInputType(""); position.setLabelcol(8); position.setViewAttr(2); position.setIsQuickSearch(false); position.setLabel("岗位"); conditionItems.add(position); //状态 SearchConditionItem status = conditionFactory.createCondition(ConditionType.SELECT, 25034, "userstatus"); status.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 status.setFieldcol(16); //条件输入框所占宽度,默认值18 status.setLabelcol(8); List userStatusOptions = new ArrayList<>(); UserStatusEnum.getList().forEach(e -> userStatusOptions.add(new SearchConditionOption(e.get("id"), e.get("content")))); status.setOptions(userStatusOptions); status.setInputType(""); status.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 status.setLabel("状态"); //设置文本值 这个将覆盖多语言标签的值 conditionItems.add(status); // //入职日期 // SearchConditionItem hiredate = conditionFactory.createCondition(ConditionType.RANGEPICKER, 25034, "hiredate"); // hiredate.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 // hiredate.setFieldcol(16); //条件输入框所占宽度,默认值18 // hiredate.setLabelcol(8); // hiredate.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 // Map otherParams1 = new HashMap(); // otherParams1.put("format", "yyyy-MM-dd"); // hiredate.setOtherParams(otherParams1); // hiredate.setInputType("day"); // hiredate.setMode("day"); // hiredate.setLabel("入职日期"); //设置文本值 这个将覆盖多语言标签的值 // conditionItems.add(hiredate); //合并计税 SearchConditionItem mergeCountTax = conditionFactory.createCondition(ConditionType.CHECKBOX, 25034, "mergeCountTax"); mergeCountTax.setColSpan(2);//定义一行显示条件数,默认值为2,当值为1时标识该条件单独占一行 mergeCountTax.setFieldcol(16); //条件输入框所占宽度,默认值18 mergeCountTax.setLabelcol(8); mergeCountTax.setInputType("switch"); mergeCountTax.setViewAttr(2); // 编辑权限 1:只读,2:可编辑, 3:必填 默认2 mergeCountTax.setLabel("合并计税"); //设置文本值 这个将覆盖多语言标签的值 conditionItems.add(mergeCountTax); addGroups.add(new SearchConditionGroup("常用条件", true, conditionItems)); apidatas.put("condition", addGroups); return apidatas; } /** * 工资单发放详情列表 * * @param queryParam * @return */ public Map detailList(SalarySendDetailQueryParam queryParam) { Map datas = new HashMap<>(); SalarySendDetailQueryParam.checkParam(queryParam); SalarySendPO salarySend = getSalarySendService(user).getById(queryParam.getSalarySendId()); if (salarySend == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100510, "工资发放不存在")); } SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salarySend.getSalaryAccountingId()); boolean isReplenish = salaryAcctRecord != null && Objects.equals(salaryAcctRecord.getBackCalcStatus(), (NumberUtils.INTEGER_ONE)); // 1.根据模板获取薪资项目设置 SalarySobPO salarySob = getSalarySobService(user).getById(salarySend.getSalarySobId()); List salaryTemplates = getSalaryTemplateService(user) .getDefaultTemplates(Arrays.asList(salarySend.getSalarySobId(), salarySob == null ? 0L : salarySob.getId())); List salaryItems = getSalarySendService(user) .getSalaryItemsSetting(CollectionUtils.isNotEmpty(salaryTemplates) ? salaryTemplates.get(0) : null, isReplenish); // 2.获取基本数据 PageInfo pageInfo = getSalarySendService(user).salarySendInfoDetailListPage(queryParam); List records = pageInfo.getList(); // 3.组装详情数据 List> listMaps = getSalarySendService(user).buildDetailList(salaryItems, records, salarySend.getSalaryAccountingId()); List columns = buildDetailListWeaTableColumns(); for (SalaryTemplateSalaryItemListDTO salaryItem : salaryItems) { columns.add(new WeaTableColumn("100px", salaryItem.getName(), salaryItem.getId() + SalaryItemConstant.DYNAMIC_SUFFIX)); } WeaTable table = new WeaTable(); table.setColumns(columns); //设置check是否可用 List checkboxpopedomList = new ArrayList<>(); WeaTableCheckboxpopedom checkboxpopedom = new WeaTableCheckboxpopedom(); checkboxpopedom.setPopedompara("column:system_type"); checkboxpopedom.setShowmethod("com.engine.salary.transmethod.TaxRateTransMethod.getCheckBoxPopedom"); checkboxpopedomList.add(checkboxpopedom); table.setCheckboxList(checkboxpopedomList); table.setCheckboxpopedom(null); WeaResultMsg result = new WeaResultMsg(false); result.putAll(table.makeDataResult()); result.success(); datas.put("pageInfo", pageInfo); datas.put("datas", listMaps); datas.put("columns", columns); datas.put("dataKey", result.getResultMap()); return datas; } private List buildDetailListWeaTableColumns() { List list = new ArrayList<>(); WeaTableColumn idColumn = new WeaTableColumn("0px", "id", "id"); idColumn.setDisplay(WeaBoolAttr.TRUE); list.add(new WeaTableColumn("100px", "姓名", "username")); list.add(new WeaTableColumn("100px", "个税扣缴义务人", "taxAgent")); list.add(new WeaTableColumn("100px", "部门", "department")); list.add(new WeaTableColumn("100px", "手机号", "mobile")); list.add(new WeaTableColumn("100px", "工号", "jobNum")); return list; } /** * 导出-工资单发放详情列表 * * @param queryParam * @return */ public XSSFWorkbook exportDetailList(SalarySendDetailQueryParam queryParam) { // 获取发放详情 SalarySendDetailQueryParam.checkParam(queryParam); SalarySendPO salarySend = getSalarySendService(user).getById(queryParam.getSalarySendId()); if (salarySend == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100512, "工资单发放不存在")); } return getSalarySendService(user).exportDetailList(salarySend, queryParam); } /** * 我的工资单列表 * * @param queryParam * @return */ public Map mySalaryBillList(SalaryBillQueryParam queryParam) { Map datas = new HashMap<>(); queryParam.setEmployeeId((long) user.getUID()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); queryParam.setSalaryMonth( queryParam.getSalaryYearMonth().stream().map(e -> { try { return simpleDateFormat.parse(e + "-01"); } catch (ParseException parseException) { throw new SalaryRunTimeException("日期转换错误"); } }).collect(Collectors.toList())); PageInfo pageInfo = getSalarySendService(user).mySalaryBillListPage(queryParam); List records = pageInfo.getList(); records.forEach(e -> { e.setTaxAgent(StringUtils.isEmpty(e.getTaxAgent()) ? "" : e.getTaxAgent()); e.setAcctTimes(e.getAcctTimes()); }); List columns = buildMySalaryBillListColumns(); WeaTable table = new WeaTable(); table.setColumns(columns); //设置check是否可用 List checkboxpopedomList = new ArrayList<>(); WeaTableCheckboxpopedom checkboxpopedom = new WeaTableCheckboxpopedom(); checkboxpopedom.setPopedompara("column:system_type"); checkboxpopedom.setShowmethod("com.engine.salary.transmethod.TaxRateTransMethod.getCheckBoxPopedom"); checkboxpopedomList.add(checkboxpopedom); table.setCheckboxList(checkboxpopedomList); table.setCheckboxpopedom(null); WeaResultMsg result = new WeaResultMsg(false); result.putAll(table.makeDataResult()); result.success(); datas.put("pageInfo", pageInfo); datas.put("datas", records); datas.put("columns", columns); datas.put("dataKey", result.getResultMap()); return datas; } private List buildMySalaryBillListColumns() { List list = new ArrayList<>(); WeaTableColumn idColumn = new WeaTableColumn("0px", "id", "id"); idColumn.setDisplay(WeaBoolAttr.TRUE); list.add(new WeaTableColumn("20%", "薪资所属月", "salaryYearMonth")); list.add(new WeaTableColumn("40%", "个税扣缴义务人", "taxAgent")); list.add(new WeaTableColumn("40%", "发放时间", "sendTime")); return list; } /** * 我的工资单 * * @param salaryInfoId * @return */ public Map mySalaryBill(Long salaryInfoId) { if (user == null) { throw new SalaryRunTimeException("获取人员信息失败!"); } return getSalarySendService(user).mySalaryBill(salaryInfoId, (long) user.getUID()); } /** * 工资单发放信息合计行 * * @param queryParam * @return */ public Map sumSendResult(SalarySendInfoQueryParam queryParam) { Map datas = new HashMap<>(); //合计 Map sumRow = getSalarySendService(user).sumRow(queryParam); datas.put("sumRow", sumRow); return datas; } /** * 发送短信验证码 * @param param 短信验证码发送参数 */ public void sendMobileCode(SMSCodeSendParam param) { getSalarySendService(user).sendMobileCode(param); } /** * 校验短信验证码 * @param param * @return */ public Boolean checkMobileCode(SMSCodeCheckParam param) { return getSalarySendService(user).checkMobileCode(param); } public PayrollCheckTypeEnum payrollCheckType() { SalarySysConfPO conf = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_PAYROLL_CHECK_TYPE); if(conf == null){ return PayrollCheckTypeEnum.PWD; } return PayrollCheckTypeEnum.parseByValue(conf.getConfValue()); } public void confirmSalaryBill(Long salaryInfoId) { if(ObjectUtil.isNull(salaryInfoId)){ throw new SalaryRunTimeException("工资单id不能为空!"); } getSalaryBillService(user).confirmSalaryBill(salaryInfoId); } }