推送记录
This commit is contained in:
parent
035209afa8
commit
74b78a3ab5
|
|
@ -0,0 +1,71 @@
|
|||
package com.engine.salary.enums.push;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 推送记录状态
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum PushRecordDStatusEnum implements BaseEnum<Integer> {
|
||||
PREPARE(0, "准备中", 87625),
|
||||
WAITING(1, "等待中", 87625),
|
||||
PROGRESS(2, "执行中", 85393),
|
||||
success(3, "执行成功", 85393),
|
||||
FAIL(4, "执行失败", 85393);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
PushRecordDStatusEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static PushRecordDStatusEnum parseByValue(int value) {
|
||||
for (PushRecordDStatusEnum salaryDataSourceEnum : PushRecordDStatusEnum.values()) {
|
||||
if (Objects.equals(salaryDataSourceEnum.getValue(), value)) {
|
||||
return salaryDataSourceEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
PushRecordDStatusEnum[] enumAry = PushRecordDStatusEnum.values();
|
||||
for (int i = 0; i < Arrays.asList(enumAry).size(); i++) {
|
||||
if (enumAry[i].getValue().equals(value)) {
|
||||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -14,15 +14,11 @@ import java.util.Objects;
|
|||
* @version 1.0
|
||||
**/
|
||||
public enum PushRecordStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
Waiting(0, "等待中", 87625) {
|
||||
},
|
||||
YEAR(1, "执行中", 85393) {
|
||||
},
|
||||
YEAR_MONTH(2, "执行成功", 85393) {
|
||||
},
|
||||
YEAR_MONTH_DAY(3, "执行失败", 85393) {
|
||||
};
|
||||
PREPARE(0, "准备中", 87625),
|
||||
WAITING(1, "等待中", 87625),
|
||||
PROGRESS(2, "执行中", 85393),
|
||||
success(3, "执行成功", 85393),
|
||||
FAIL(4, "执行失败", 85393);
|
||||
|
||||
private int value;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.salary.entity.push.param.PushSettingItemQueryParam;
|
|||
import com.engine.salary.entity.push.param.PushSettingItemSaveParam;
|
||||
import com.engine.salary.entity.push.param.PushSettingQueryParam;
|
||||
import com.engine.salary.entity.push.param.PushSettingSaveParam;
|
||||
import com.engine.salary.entity.push.po.PushRecordDetailPO;
|
||||
import com.engine.salary.entity.push.po.PushRecordPO;
|
||||
import com.engine.salary.entity.push.po.PushSettingItemPO;
|
||||
import com.engine.salary.entity.push.po.PushSettingPO;
|
||||
|
|
@ -366,7 +367,7 @@ public class PushServiceImpl extends Service implements PushService {
|
|||
.name(po.getName())
|
||||
.settingId(po.getId())
|
||||
.acctRecordId(salaryAcctRecordId)
|
||||
.status(PushRecordStatusEnum.Waiting.getValue())
|
||||
.status(PushRecordStatusEnum.PREPARE.getValue())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.creator((long) user.getUID())
|
||||
|
|
@ -375,6 +376,31 @@ public class PushServiceImpl extends Service implements PushService {
|
|||
.build()
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
pushRecordPOList.forEach(record -> {
|
||||
getPushRecordMapper().insertIgnoreNull(record);
|
||||
|
||||
|
||||
//查询核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId());
|
||||
|
||||
salaryAcctEmployeePOS.stream().map(employee -> PushRecordDetailPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.acctEmpId(employee.getId())
|
||||
.recordId(record.getId())
|
||||
.status(PushRecordDetailStatusEnum.PREPARE.getValue())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.creator((long) user.getUID())
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue