工资单审批
This commit is contained in:
parent
8ff315b341
commit
4f391a2159
|
|
@ -96,6 +96,7 @@ public class SalaryAcctRecordBO {
|
|||
.accountantName(usernameMap.getOrDefault(salaryAcctRecordPO.getCreator(), StringUtils.EMPTY))
|
||||
.updateTime(SalaryDateUtil.getFormatLocalDateTime(salaryAcctRecordPO.getUpdateTime()))
|
||||
.description(salaryAcctRecordPO.getDescription())
|
||||
.approvalStatus(salaryAcctRecordPO.getApprovalStatus())
|
||||
.operate(btnList)
|
||||
.build();
|
||||
}).collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -73,6 +73,9 @@ public class SalaryAcctRecordListDTO {
|
|||
@TableTitle(title = "备注", dataIndex = "description", key = "description")
|
||||
private String description;
|
||||
|
||||
@TableTitle(title = "审批状态", dataIndex = "approvalStatus", key = "approvalStatus")
|
||||
private String approvalStatus;
|
||||
|
||||
@TableTitle(title = "操作", dataIndex = "operate", key = "operate")
|
||||
private List<WeaTableOperate> operate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,4 +64,7 @@ public class SalaryApprovalRulePO {
|
|||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
//薪资账套id集合
|
||||
private Collection<Long> salarySobIds;
|
||||
|
||||
}
|
||||
|
|
@ -35,7 +35,8 @@
|
|||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, t.back_calc_status
|
||||
,t.lock_salary_item_ids
|
||||
, t.lock_salary_item_ids
|
||||
, t.approval_status
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
|
|||
|
|
@ -81,6 +81,12 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="salarySobIds != null and salarySobIds.size()>0">
|
||||
AND salary_sob_id IN
|
||||
<foreach collection="salarySobIds" open="(" item="salarySobId" separator="," close=")">
|
||||
#{salarySobId}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -104,4 +104,6 @@ public interface SalaryApprovalRuleService {
|
|||
void saveApprovalRequestId(ApprovalRequestSaveParam saveParam);
|
||||
|
||||
void deleteBySalarySobIds(Collection<Long> ids);
|
||||
|
||||
List<SalaryApprovalRulePO> listBySalarySobIds(Collection<Long> salarySobIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -201,4 +202,12 @@ public class SalaryApprovalRuleServiceImpl extends Service implements SalaryAppr
|
|||
public void deleteBySalarySobIds(Collection<Long> ids) {
|
||||
ids.stream().forEach(this::deleteBySalarySobId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryApprovalRulePO> listBySalarySobIds(Collection<Long> salarySobIds) {
|
||||
if (CollectionUtils.isEmpty(salarySobIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getSalaryApprovalRuleMapper().listSome(SalaryApprovalRulePO.builder().salarySobIds(salarySobIds).build());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,11 @@ public class PageInfo<T> extends com.engine.salary.component.PageInfo<T> {
|
|||
this.columns.addAll(columns);
|
||||
}
|
||||
|
||||
public void clearAndSetColumns(List<Column> columns) {
|
||||
this.columns.clear();
|
||||
this.columns.addAll(columns);
|
||||
}
|
||||
|
||||
List<Column> columns = new ArrayList<>();
|
||||
List<DataSource> dataSource = new ArrayList<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam;
|
|||
import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalaryApprovalRulePO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -21,6 +22,7 @@ import com.engine.salary.util.SalaryDateUtil;
|
|||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.SalarySobUtil;
|
||||
import com.engine.salary.util.page.Column;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.proxy.SalaryAcctRecordWrapperProxy;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -68,6 +70,10 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
|
|||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
// private ComInfoCache comInfoCache;
|
||||
|
||||
public PageInfo<SalaryAcctRecordListDTO> listPage(SalaryAcctRecordQueryParam queryParam) {
|
||||
|
|
@ -87,6 +93,9 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
|
|||
// 查询薪资账套
|
||||
Set<Long> salarySobIds = SalaryEntityUtil.properties(list, SalaryAcctRecordPO::getSalarySobId);
|
||||
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByIds(salarySobIds);
|
||||
// 获取这些账套中是否有开启薪资审批的
|
||||
List<SalaryApprovalRulePO> salaryApprovalRules = getSalaryApprovalRuleService(user).listBySalarySobIds(salarySobIds);
|
||||
Optional<SalaryApprovalRulePO> existApproval = salaryApprovalRules.stream().filter(po -> po.getOpenApproval().equals(1)).findFirst();
|
||||
// 查询薪资核算记录的创建人员的人员信息
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(list, SalaryAcctRecordPO::getCreator, Collectors.toList());
|
||||
List<DataCollectionEmployee> employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
|
||||
|
|
@ -102,6 +111,12 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord
|
|||
// 转换成列表dto
|
||||
List<SalaryAcctRecordListDTO> salaryAcctRecordListDTOS = SalaryAcctRecordBO.convert2ListDTO(list, salarySobPOS, employeeComInfos, salaryAcctEmployeeCountDTOS, salarySendCheckResult, taxAgentPOS);
|
||||
dtoPage.setList(salaryAcctRecordListDTOS);
|
||||
if (!existApproval.isPresent()) {
|
||||
// 没有开启审批的
|
||||
List<Column> columnList = dtoPage.getColumns().stream().filter(col -> !col.getKey().equals("approvalStatus")).collect(Collectors.toList());
|
||||
dtoPage.clearAndSetColumns(columnList);
|
||||
}
|
||||
|
||||
}
|
||||
// WeaTable<SalaryAcctRecordListDTO> weaTable = SalaryFormatUtil.<SalaryAcctRecordListDTO>getInstance().buildTable(SalaryAcctRecordListDTO.class, dtoPage);
|
||||
// 只有未归档时可以"核算"、"删除"、"归档"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
|
|
@ -15,8 +16,10 @@ import com.engine.salary.entity.salarysob.param.SalaryApprovalQueryParam;
|
|||
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
||||
import com.engine.salary.enums.salaryaccounting.LockStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
|
@ -24,6 +27,7 @@ import com.engine.salary.util.page.SalaryPageUtil;
|
|||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
|
@ -31,6 +35,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_FIXED_COLUMNS;
|
||||
|
||||
/**
|
||||
* 薪资账套的薪资审批
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
|
|
@ -61,6 +67,10 @@ public class SalaryApprovalWrapper extends Service {
|
|||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfMapper getSalarySysConfMapper() {
|
||||
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资账套的薪资审批规则
|
||||
*
|
||||
|
|
@ -129,6 +139,18 @@ public class SalaryApprovalWrapper extends Service {
|
|||
columns.add(weaTableColumnWapper);
|
||||
}
|
||||
|
||||
// 获取固定列头数
|
||||
SalarySysConfPO salaryAcctFixedColumns = getSalarySysConfMapper().getOneByCode(SALARY_ACCT_FIXED_COLUMNS);
|
||||
if (salaryAcctFixedColumns != null) {
|
||||
int fixedNum = NumberUtils.isCreatable(salaryAcctFixedColumns.getConfValue()) ? Integer.valueOf(salaryAcctFixedColumns.getConfValue()) : 3;
|
||||
if (fixedNum == 0) {
|
||||
fixedNum = 3;
|
||||
}
|
||||
for (int i = 0; i < fixedNum; i++) {
|
||||
columns.get(i).setFixed("left");
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
datas.put("pageInfo", page);
|
||||
datas.put("columns", columns);
|
||||
|
|
|
|||
Loading…
Reference in New Issue