weaver-hrm-salary/src/com/engine/salary/service/impl/SIAccountServiceImpl.java

115 lines
5.0 KiB
Java
Raw Normal View History

2022-04-11 19:07:35 +08:00
package com.engine.salary.service.impl;
import com.cloudstore.eccom.result.WeaResultMsg;
2022-04-12 10:24:21 +08:00
import com.engine.common.util.ServiceUtil;
2022-04-11 19:07:35 +08:00
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIAccountBiz;
import com.engine.salary.component.SalaryWeaTable;
import com.engine.salary.entity.siaccount.bo.InsuranceAccountBO;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam;
2022-04-12 10:24:21 +08:00
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
2022-04-11 19:07:35 +08:00
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
2022-04-12 10:24:21 +08:00
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.service.RecordsBuildService;
2022-04-11 19:07:35 +08:00
import com.engine.salary.service.SIAccountService;
import java.util.*;
import com.engine.salary.util.page.PageInfo;
2022-04-12 10:24:21 +08:00
import weaver.hrm.User;
2022-04-11 19:07:35 +08:00
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/4/11
* @Version V1.0
**/
public class SIAccountServiceImpl extends Service implements SIAccountService {
private SIAccountBiz siAccountBiz = new SIAccountBiz();
2022-04-12 10:24:21 +08:00
public RecordsBuildService getService(User user) {
return ServiceUtil.getService(RecordsBuildServiceImpl.class,user);
}
2022-04-11 19:07:35 +08:00
@Override
public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) {
Long employeeId = (long)user.getUID();
Map<String,Object> datas = new HashMap<>();
//福利台账列表
PageInfo<InsuranceAccountBatchPO> pageInfo = siAccountBiz.listPage(queryParam,employeeId);
Collection<InsuranceAccountBatchPO> insuranceAccountBatchPOS = pageInfo.getList();
List<InsuranceAccountBatchListDTO> insuranceAccountBatchListDTOS = InsuranceAccountBO.buildAccountBatchDTOList(insuranceAccountBatchPOS);
PageInfo<InsuranceAccountBatchListDTO> pageInfos = new PageInfo<>(insuranceAccountBatchListDTOS,InsuranceAccountBatchListDTO.class);
pageInfos.setTotal(insuranceAccountBatchListDTOS.size());
pageInfos.setPageNum(queryParam.getCurrent());
pageInfos.setPageSize(queryParam.getPageSize());
SalaryWeaTable<InsuranceAccountBatchListDTO> table = new SalaryWeaTable<>(user, InsuranceAccountBatchListDTO.class);
//table.getColumns().get(0).setFixed("left");
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult());
result.success();
datas.put("pageInfo", pageInfos);
//datas.put("dataKey",result.getResultMap());
return datas;
// WeaTable<InsuranceAccountBatchListDTO> resultTable = FormatManager.<InsuranceAccountBatchListDTO>getInstance()
// .genTable(InsuranceAccountBatchListDTO.class, insuranceAccountBatchListDTOPage);
//
// resultTable.getOperates().forEach(e -> {
// if (e.getIndex() == 0) {
// e.setOuter(true);
// }
// });
// for (int i = 0; i < insuranceAccountBatchListDTOPage.getRecords().size(); i++) {
// InsuranceAccountBatchListDTO insuranceAccountBatchListDTO = insuranceAccountBatchListDTOPage.getRecords().get(i);
// if (Objects.equals(insuranceAccountBatchListDTO.getBillStatus(), BillStatusEnum.ARCHIVED.getDefaultLabel())) {
// resultTable.getOperatesPermission().get(i).get(0).setVisible(false);
// resultTable.getOperatesPermission().get(i).get(1).setVisible(false);
// resultTable.getOperatesPermission().get(i).get(2).setVisible(false);
// resultTable.getOperatesPermission().get(i).get(3).setVisible(false);
// resultTable.getOperates().get(4).setOuter(true);
// }
// if (Objects.equals(insuranceAccountBatchListDTO.getBillStatus(), BillStatusEnum.NOT_ARCHIVED.getDefaultLabel())) {
// resultTable.getOperatesPermission().get(i).get(4).setVisible(false);
// List<InsuranceAccountInspectPO> insuranceAccountInspectPOS = siAccountInspectService.listByBillMonth(insuranceAccountBatchListDTO.getBillMonth(), tenantKey);
// if (CollectionUtils.isEmpty(insuranceAccountInspectPOS)) {
// resultTable.getOperatesPermission().get(i).get(2).setVisible(false);
// }
// }
// }
// resultTable.setModule("hrmsalary");
// resultTable.getColumns().get(0).setFixed("left");
// return WeaResult.success(resultTable);
}
@Override
2022-04-12 10:24:21 +08:00
public Map<String, Object> listCommonPage(InsuranceAccountDetailParam queryParam) {
2022-04-11 19:07:35 +08:00
Long employeeId = (long)user.getUID();
Map<String,Object> datas = new HashMap<>();
2022-04-12 10:24:21 +08:00
//正常缴纳列表
PageInfo<InsuranceAccountDetailPO> pageInfo = siAccountBiz.listCommonPage(queryParam);
List<InsuranceAccountDetailPO> insuranceAccountDetailPOS = pageInfo.getList();
//数据组装
List<Map<String, Object>> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId);
return datas;
2022-04-11 19:07:35 +08:00
}
2022-04-12 10:24:21 +08:00
2022-04-11 19:07:35 +08:00
}