Browse Source

修改逻辑

master
郑贵龙 1 year ago
parent
commit
157ed0a96e
2 changed files with 20 additions and 8 deletions
  1. +2
    -2
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java
  2. +18
    -6
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java

+ 2
- 2
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/StaffEntity.java View File

@ -48,11 +48,11 @@ public class StaffEntity extends BaseMgrEntity<StaffEntity>
/** 状态 */
@SerializedName("status")
private Integer status = 1;
private Integer status;
/** 数据状态 */
@SerializedName("tab_status")
private Integer tabStatus = 0;
private Integer tabStatus;
/** 报道日期 */
@SerializedName("register_date")


+ 18
- 6
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/staff/StaffUpdateEAIService.java View File

@ -50,25 +50,37 @@ public class StaffUpdateEAIService extends AbsEAIService {
String option = request.getObject("option", String.class);
List<StaffEntity> staffList = request.getObject("wait_register_personnel", StaffUtil.LIST_ENTITY_STAFF);
//界面
if (StringUtils.isEmpty(option)){
if (StringUtils.isEmpty(option)) {
if (!CollectionUtils.isEmpty(staffList)){
staffList.forEach(item ->{
item.setStatus(1);
item.setTabStatus(0);
});
staffService.saveBatch(staffList);
}
} else if (OptionEnums.BASIC.getValue().equals(option)) {
if (!CollectionUtils.isEmpty(staffList)) {
//区分是否有id没有则新增
Map<Boolean, List<StaffEntity>> collect = staffList.stream().collect(Collectors.groupingBy(item -> StringUtils.isEmpty(item.getId())));
List<StaffEntity> insert = collect.get(true);
insert.forEach(item ->{
item.setStatus(1);
item.setTabStatus(0);
});
staffService.saveBatch(insert);
List<StaffEntity> update = collect.get(false);
staffRepository.updateStaffList(update, SecurityUtil.getUserProfile().getTenantSid());
}
}else if (OptionEnums.TASK.getValue().equals(option)){
if (!CollectionUtils.isEmpty(staffList)){
staffRepository.updateStatusAndDate(staffList,SecurityUtil.getUserProfile().getTenantSid());
} else if (OptionEnums.TASK.getValue().equals(option)) {
if (!CollectionUtils.isEmpty(staffList)) {
staffRepository.updateStatusAndDate(staffList, SecurityUtil.getUserProfile().getTenantSid());
}
}else if (OptionEnums.FLOW.getValue().equals(option)){
} else if (OptionEnums.FLOW.getValue().equals(option)) {
List<Long> idList = staffList.stream().map(StaffEntity::getId).collect(Collectors.toList());
LambdaUpdateWrapper<StaffEntity> lmu = new LambdaUpdateWrapper<>();
lmu.set(StaffEntity::getStatus, StatusEnums.REPORTED.getValue());
lmu.set(StaffEntity::getTabStatus, TabStatusEnums.COMPLETED.getValue());
lmu.in(StaffEntity::getId,idList);
lmu.in(StaffEntity::getId, idList);
staffService.update(lmu);
}
List<StaffEntity> collect = staffList.stream().map(item -> new StaffEntity(item.getId())).collect(Collectors.toList());


Loading…
Cancel
Save