联特,cbs推送

This commit is contained in:
Harryxzy 2025-05-14 11:06:07 +08:00
parent 6cfeed52f6
commit e2839767fa
6 changed files with 46 additions and 16 deletions

View File

@ -28,4 +28,6 @@ public class CBSPushParam {
// 姓名
private String username;
private String workcode;
}

View File

@ -81,6 +81,7 @@ public class SalaryCBSInfoQueryParam extends BaseQueryParam {
private String gzkkhh;
private String workcode;
public static String checkParam(SalaryCBSInfoQueryParam saveParam) {
if (saveParam.getSalaryCbsId() == null) {

View File

@ -69,7 +69,7 @@ public interface SalaryCbsInfoMapper {
List<SalaryCBSInfoListDTO> list(@Param("param")SalaryCBSInfoQueryParam queryParam);
List<SalaryCbsInfoPO> listByCbsIdAndIds(@Param("cbsIds")List<Long> salaryCbsIds, @Param("ids")List<Long> part);
List<SalaryCbsInfoPO> listByCbsIdAndIds(@Param("cbsIds")List<Long> salaryCbsIds, @Param("ids")List<Long> part, @Param("workcode") String workcode);
void updatePushStatusByCbsIdsAndEmpIds(@Param("cbsIds")List<Long> cbsIdList, @Param("empIds")List<Long> part, @Param("pushStatus")Integer value);
}

View File

@ -282,6 +282,10 @@
<if test="param.pushStatusVal != null">
AND t1.push_status = #{param.pushStatusVal}
</if>
<!-- 工号 -->
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode = #{param.workcode}
</if>
<!-- 分部 -->
<if test="param.subCompanyIds != null and param.subCompanyIds.size()>0">
@ -312,6 +316,10 @@
AND t1.push_status = #{param.pushStatusVal}
</if>
<!-- 工号 -->
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode = #{param.workcode}
</if>
<!-- 分部 -->
<if test="param.subCompanyIds != null and param.subCompanyIds.size()>0">
AND e.subcompanyid1 IN
@ -340,6 +348,10 @@
<if test="param.pushStatusVal != null">
AND t1.push_status = #{param.pushStatusVal}
</if>
<!-- 工号 -->
<if test="param.workcode != null and param.workcode != ''">
AND e.workcode = #{param.workcode}
</if>
<!-- 分部 -->
<if test="param.subCompanyIds != null and param.subCompanyIds.size()>0">
@ -358,6 +370,7 @@
SELECT
<include refid="baseColumns" />
FROM hrsa_salary_cbs_info t
left join hrmresource h on t.employee_id=h.id
WHERE delete_type = 0
<if test="cbsIds != null and cbsIds.size()>0">
@ -372,6 +385,9 @@
#{id}
</foreach>
</if>
<if test="workcode != null and workcode != ''">
AND h.workcode = #{workcode}
</if>
ORDER BY id DESC
</select>

View File

@ -316,21 +316,31 @@ public class SalaryCbsInfoServiceImpl extends Service implements com.engine.sala
throw new SalaryRunTimeException("无权限");
}
if (StringUtils.isNotBlank(cbsPushParam.getSalaryCbsId()) && NumberUtils.isCreatable(cbsPushParam.getSalaryCbsId())) {
cbsPushParam.setSalaryCbsIds(Collections.singletonList(Long.valueOf(cbsPushParam.getSalaryCbsId())));
}
if (CollectionUtils.isEmpty(cbsPushParam.getIds()) && CollectionUtils.isEmpty(cbsPushParam.getSalaryCbsIds())) {
throw new SalaryRunTimeException("请选择需要推送至CBS的数据");
}
List<SalaryCbsInfoPO> infoList = listByCbsIdsAndIds(cbsPushParam.getSalaryCbsIds(), cbsPushParam.getIds());
// if (StringUtils.isNotBlank(cbsPushParam.getGzkkhh())){
// String gzkkhhField = baseBean.getPropValue("ltSalary", "gzkkhh_field");
// RecordSet rs = new RecordSet();
// rs.execute("select id,"+gzkkhhField+ " from cus_fielddata " +
// "where SCOPE='HrmCustomFieldByInfoType' and scopeid=3 and "+gzkkhhField+" = '" +cbsPushParam.getGzkkhh()+ "'");
// List<Long> empIdsByGzkkhh = new ArrayList<>();
// while (rs.next()) {
// empIdsByGzkkhh.add(Long.valueOf(rs.getInt("id")));
// }
// infoList = infoList.stream().filter(po -> empIdsByGzkkhh.contains(po.getEmployeeId())).collect(Collectors.toList());
// }
List<SalaryCbsInfoPO> infoList = listByCbsIdsAndIds(cbsPushParam.getSalaryCbsIds(), cbsPushParam.getIds(), cbsPushParam.getWorkcode());
// 过滤姓名
if (StringUtils.isNotBlank(cbsPushParam.getUsername())) {
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listByKeyword(cbsPushParam.getUsername());
List<Long> empIdsByName = employeeList.stream().filter(emp -> emp.getUsername().contains(cbsPushParam.getUsername())).map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
infoList = infoList.stream().filter(po -> empIdsByName.contains(po.getEmployeeId())).collect(Collectors.toList());
}
// 过滤工资卡开户行
if (StringUtils.isNotBlank(cbsPushParam.getGzkkhh())){
String gzkkhhField = baseBean.getPropValue("ltSalary", "gzkkhh_field");
RecordSet rs = new RecordSet();
rs.execute("select id,"+gzkkhhField+ " from cus_fielddata " +
"where SCOPE='HrmCustomFieldByInfoType' and scopeid=3 and "+gzkkhhField+" = '" +cbsPushParam.getGzkkhh()+ "'");
List<Long> empIdsByGzkkhh = new ArrayList<>();
while (rs.next()) {
empIdsByGzkkhh.add(Long.valueOf(rs.getInt("id")));
}
infoList = infoList.stream().filter(po -> empIdsByGzkkhh.contains(po.getEmployeeId())).collect(Collectors.toList());
}
// 过滤未推送的
infoList = infoList.stream().filter(info -> info.getPushStatus().equals(CbsPushStatusEnum.NOT_PUSHED.getValue())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(infoList)) {
@ -486,19 +496,19 @@ public class SalaryCbsInfoServiceImpl extends Service implements com.engine.sala
return resultMap;
}
private List<SalaryCbsInfoPO> listByCbsIdsAndIds(List<Long> salaryCbsIds, List<Long> ids) {
private List<SalaryCbsInfoPO> listByCbsIdsAndIds(List<Long> salaryCbsIds, List<Long> ids, String workcode) {
List<SalaryCbsInfoPO> resultList = new ArrayList<>();
if (CollectionUtils.isEmpty(salaryCbsIds) && CollectionUtils.isEmpty(ids)) {
return Collections.emptyList();
}
if (CollectionUtils.isEmpty(ids)) {
List<SalaryCbsInfoPO> salaryCbsInfoPOS = getSalaryCbsInfoMapper().listByCbsIdAndIds(salaryCbsIds, ids);
List<SalaryCbsInfoPO> salaryCbsInfoPOS = getSalaryCbsInfoMapper().listByCbsIdAndIds(salaryCbsIds, ids, workcode);
encryptUtil.decryptList(salaryCbsInfoPOS, SalaryCbsInfoPO.class);
resultList.addAll(salaryCbsInfoPOS);
} else {
List<List<Long>> partition = Lists.partition(ids, 1000);
partition.forEach(part -> {
List<SalaryCbsInfoPO> salaryCbsInfoPOS = getSalaryCbsInfoMapper().listByCbsIdAndIds(salaryCbsIds, part);
List<SalaryCbsInfoPO> salaryCbsInfoPOS = getSalaryCbsInfoMapper().listByCbsIdAndIds(salaryCbsIds, part, workcode);
encryptUtil.decryptList(salaryCbsInfoPOS, SalaryCbsInfoPO.class);
resultList.addAll(salaryCbsInfoPOS);
});

View File

@ -646,6 +646,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
if (openExtEmp) {
result.addAll(getExtEmpService(user).listByKeyword(keyword));
}
SalaryI18nUtil.i18nList(result);
return result;
}