钱智社保报表

This commit is contained in:
钱涛 2025-12-01 11:35:41 +08:00
parent 55238f1dfe
commit c3b2dc2982
2 changed files with 35 additions and 5 deletions

View File

@ -0,0 +1,3 @@
# ?????
actualWorkplaceField=field64

View File

@ -17,6 +17,7 @@ import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.siaccount.BillStatusEnum;
import com.engine.salary.enums.siaccount.ResourceFromEnum;
import com.engine.salary.enums.sicategory.PaymentScopeEnum;
import com.engine.salary.mapper.SQLMapper;
import com.engine.salary.mapper.datacollection.EmployMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
@ -34,6 +35,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.hrm.company.DepartmentComInfo;
@ -76,6 +78,10 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
}
private SQLMapper getSQLMapper() {
return MapperProxyFactory.getProxy(SQLMapper.class);
}
@Override
public List<Map<String, Object>> buildCommonRecords(List<InsuranceAccountDetailPO> list, Long employeeId, boolean dynamicEmpInfo) {
// boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
@ -531,18 +537,39 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
List<Long> employeeIds = list.stream().map(item -> item.getEmployeeId()).distinct().collect(Collectors.toList());
List<DataCollectionEmployee> employeeByIds = new ArrayList<>();
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
Map<Long,String> map = new HashMap<>();
BaseBean bb = new BaseBean();
String actualWorkplaceField = bb.getPropValue("hrmSalaryQZ", "actualWorkplaceField");
Map<Long, String> actualWorkplaceMap = new HashMap<>();
for (List<Long> ids : partition) {
employeeByIds.addAll(getSalaryEmployeeService(user).getEmployeeByIdsAll(ids));
//获取实际工作地
RecordSet rs = new RecordSet();
String sql =String.format("select id ,field64 from cus_fielddata where scopeid =3 and id in(%s)",ids.stream().map(Object::toString).collect(Collectors.joining(","))) ;
String sql = String.format("select id ,%s from cus_fielddata where scopeid =3 and id in(%s)", actualWorkplaceField, ids.stream().map(Object::toString).collect(Collectors.joining(",")));
rs.executeQuery(sql);
while (rs.next()) {
String processField = rs.getString("id");
String salaryName = rs.getString("field64");
String actualWorkplace = rs.getString(actualWorkplaceField);
actualWorkplaceMap.put(Long.parseLong(processField), actualWorkplace);
}
}
Map<Long, String> laborWorkplaceMap = new HashMap<>();
for (List<Long> ids : partition) {
//劳动关系地
RecordSet rs = new RecordSet();
String sql = String.format("select a.ygxm,b.ztmc from uf_htxy a left join uf_htzt b on a.htgsmc = b.id where a.htlx=0 and a.ygxm in (%s) ORDER BY a.htqsrq desc", ids.stream().map(Object::toString).collect(Collectors.joining(",")));
rs.executeQuery(sql);
while (rs.next()) {
String processField = rs.getString("ygxm");
String laborWorkplace = rs.getString("ztmc");
if (!laborWorkplaceMap.containsKey(Long.parseLong(processField))) {
laborWorkplaceMap.put(Long.parseLong(processField), laborWorkplace);
}
}
}
if (CollectionUtils.isEmpty(employeeByIds)) {
return result;
}
@ -554,8 +581,6 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
list.forEach(item -> {
Map<String, Object> record = new HashMap<>();
DataCollectionEmployee simpleEmployee = collect.get(item.getEmployeeId());
@ -563,6 +588,8 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ
record.put("paymentOrganizationName", paymentMap.get(item.getSocialPayOrg()) == null ? "" : paymentMap.get(item.getSocialPayOrg()).getName());
record.put("workcode", StringUtils.isBlank(simpleEmployee.getWorkcode()) ? "" : simpleEmployee.getWorkcode());
record.put("userName", simpleEmployee.getUsername());
record.put("actualWorkplace", actualWorkplaceMap.getOrDefault(item.getEmployeeId(), ""));
record.put("laborWorkplace", laborWorkplaceMap.getOrDefault(item.getEmployeeId(), ""));
String[] depList = new String[0];
try {
depList = departmentComInfo.getDepartmentRealPath(simpleEmployee.getDepartmentId().toString(), ",", "").split(",");