|
|
|
@ -158,8 +158,8 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
NegativeWork work = new NegativeWork() |
|
|
|
NegativeWork work = new NegativeWork() |
|
|
|
.setNegativeId(negative.getId()). |
|
|
|
.setNegativeId(negative.getId()) |
|
|
|
setStatus(WorkStatusEnum.todo.name()) |
|
|
|
.setStatus(WorkStatusEnum.todo.name()) |
|
|
|
.setDepartId(AppConstants.ROOT_DEPART_ID) |
|
|
|
.setDepartId(AppConstants.ROOT_DEPART_ID) |
|
|
|
.setDepartName(AppConstants.ROOT_DEPART_NAME) |
|
|
|
.setDepartName(AppConstants.ROOT_DEPART_NAME) |
|
|
|
.setRoleCode(RoleCodeEnum.FIRST_ADMIN.getCode()) |
|
|
|
.setRoleCode(RoleCodeEnum.FIRST_ADMIN.getCode()) |
|
|
|
@ -186,10 +186,13 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> { |
|
|
|
public boolean saveByJwdc(List<NegativeApiDto> list) { |
|
|
|
public boolean saveByJwdc(List<NegativeApiDto> list) { |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
list.forEach(item -> { |
|
|
|
list.forEach(item -> { |
|
|
|
|
|
|
|
if (exists(item.getOriginId())) { |
|
|
|
|
|
|
|
throw new RuntimeException("样本源头编号已存在请核实"); |
|
|
|
|
|
|
|
} |
|
|
|
SupDepart dept = departService.getByJwpyCode(item.getDepartCode()); |
|
|
|
SupDepart dept = departService.getByJwpyCode(item.getDepartCode()); |
|
|
|
Negative negative = new Negative(); |
|
|
|
Negative negative = new Negative(); |
|
|
|
|
|
|
|
BeanUtil.copyProperties(item, negative); |
|
|
|
negative.setId(IdUtil.getSnowflakeNextIdStr()) |
|
|
|
negative |
|
|
|
.setBusinessTypeCode(NegativeApiDto.BusinessType.getCode(item.getBusinessTypeName())) |
|
|
|
.setBusinessTypeCode(NegativeApiDto.BusinessType.getCode(item.getBusinessTypeName())) |
|
|
|
.setPoliceType(NegativeApiDto.BusinessType.getPoliceType(item.getBusinessTypeName())) |
|
|
|
.setPoliceType(NegativeApiDto.BusinessType.getPoliceType(item.getBusinessTypeName())) |
|
|
|
.setPoliceTypeName(NegativeApiDto.BusinessType.getPoliceTypeName(item.getBusinessTypeName())) |
|
|
|
.setPoliceTypeName(NegativeApiDto.BusinessType.getPoliceTypeName(item.getBusinessTypeName())) |
|
|
|
@ -203,6 +206,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> { |
|
|
|
.setMaxExtensionDuration(TimeLimitEnum.WORK_137.getMaxHandleDuration()) |
|
|
|
.setMaxExtensionDuration(TimeLimitEnum.WORK_137.getMaxHandleDuration()) |
|
|
|
.setApprovalFlow(ApprovalFlowEnum.SECOND_APPROVAL.getValue()) |
|
|
|
.setApprovalFlow(ApprovalFlowEnum.SECOND_APPROVAL.getValue()) |
|
|
|
.setFirstDistributeTime(now) |
|
|
|
.setFirstDistributeTime(now) |
|
|
|
|
|
|
|
.setProcessingStatus(ProcessingStatusEnum.signing.name()) |
|
|
|
// 完成状态 0-待完善 1-已完善
|
|
|
|
// 完成状态 0-待完善 1-已完善
|
|
|
|
.setCompleteStatus("0") |
|
|
|
.setCompleteStatus("0") |
|
|
|
.setTaskId("api") |
|
|
|
.setTaskId("api") |
|
|
|
@ -216,35 +220,44 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> { |
|
|
|
involveProblem.put("dictValue", "1"); |
|
|
|
involveProblem.put("dictValue", "1"); |
|
|
|
negative.setInvolveProblem(JSON.toJSONString(Collections.singletonList(involveProblem))); |
|
|
|
negative.setInvolveProblem(JSON.toJSONString(Collections.singletonList(involveProblem))); |
|
|
|
|
|
|
|
|
|
|
|
NegativeWork work = new NegativeWork(); |
|
|
|
|
|
|
|
if (Objects.nonNull(dept)) { |
|
|
|
if (Objects.nonNull(dept)) { |
|
|
|
negative.setInvolveDepartId(dept.getId()) |
|
|
|
negative.setInvolveDepartId(dept.getId()) |
|
|
|
.setInvolveDepartName(dept.getName()) |
|
|
|
.setInvolveDepartName(dept.getShortName()) |
|
|
|
.setFlowKey(FlowNodeEnum.THREE_SIGN.getKey()); |
|
|
|
.setFlowKey(FlowNodeEnum.THREE_SIGN.getKey()); |
|
|
|
work.setNegativeId(negative.getId()) |
|
|
|
} |
|
|
|
.setStatus(WorkStatusEnum.todo.name()) |
|
|
|
save(negative); |
|
|
|
.setDepartId(dept.getId()) |
|
|
|
// 新增work
|
|
|
|
.setDepartName(dept.getName()) |
|
|
|
String departId; |
|
|
|
.setRoleCode(RoleCodeEnum.THREE_ADMIN.getCode()) |
|
|
|
String departName; |
|
|
|
.setProblemSourcesCode(negative.getProblemSourcesCode()) |
|
|
|
String roleCode; |
|
|
|
.setUpdateTime(now) |
|
|
|
if (Objects.nonNull(dept)) { |
|
|
|
.setCreateTime(now); |
|
|
|
departId = dept.getId(); |
|
|
|
|
|
|
|
departName = dept.getShortName(); |
|
|
|
|
|
|
|
roleCode = RoleCodeEnum.THREE_ADMIN.getCode(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
log.error("未匹配上单位:{}, code: {}", item.getDepartName(), item.getDepartCode()); |
|
|
|
log.error("未匹配上单位:{}, code: {}", item.getDepartName(), item.getDepartCode()); |
|
|
|
work.setNegativeId(negative.getId()) |
|
|
|
departId = AppConstants.ROOT_DEPART_ID; |
|
|
|
.setStatus(WorkStatusEnum.todo.name()) |
|
|
|
departName = AppConstants.ROOT_DEPART_NAME; |
|
|
|
.setDepartId(AppConstants.ROOT_DEPART_ID) |
|
|
|
roleCode = RoleCodeEnum.FIRST_ADMIN.getCode(); |
|
|
|
.setDepartName(AppConstants.ROOT_DEPART_NAME) |
|
|
|
|
|
|
|
.setRoleCode(RoleCodeEnum.FIRST_ADMIN.getCode()) |
|
|
|
|
|
|
|
.setUpdateTime(now) |
|
|
|
|
|
|
|
.setCreateTime(now); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
save(negative); |
|
|
|
NegativeWork work = new NegativeWork() |
|
|
|
|
|
|
|
.setNegativeId(negative.getId()) |
|
|
|
|
|
|
|
.setDepartId(departId) |
|
|
|
|
|
|
|
.setDepartName(departName) |
|
|
|
|
|
|
|
.setRoleCode(roleCode) |
|
|
|
|
|
|
|
.setProblemSourcesCode(negative.getProblemSourcesCode()) |
|
|
|
|
|
|
|
.setStatus(WorkStatusEnum.todo.name()) |
|
|
|
|
|
|
|
.setUpdateTime(now) |
|
|
|
|
|
|
|
.setCreateTime(now); |
|
|
|
workService.save(work); |
|
|
|
workService.save(work); |
|
|
|
}); |
|
|
|
}); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean exists(String originId) { |
|
|
|
|
|
|
|
return exists(new LambdaUpdateWrapper<Negative>().eq(Negative::getOriginId, originId)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 生成样本源头编号 |
|
|
|
* 生成样本源头编号 |
|
|
|
* @param problemSourcesCode |
|
|
|
* @param problemSourcesCode |
|
|
|
@ -255,7 +268,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> { |
|
|
|
StrUtil.isBlank(businessTypeCode) ? "" : BusinessTypeEnum.get(businessTypeCode).getKey(), |
|
|
|
StrUtil.isBlank(businessTypeCode) ? "" : BusinessTypeEnum.get(businessTypeCode).getKey(), |
|
|
|
DateUtil.format(new Date(), DatePattern.PURE_DATE_FORMAT), |
|
|
|
DateUtil.format(new Date(), DatePattern.PURE_DATE_FORMAT), |
|
|
|
RandomUtil.randomString(4)); |
|
|
|
RandomUtil.randomString(4)); |
|
|
|
if (exists(new LambdaUpdateWrapper<Negative>().eq(Negative::getOriginId, originId))) { |
|
|
|
if (exists(originId)) { |
|
|
|
return generateOriginId(problemSourcesCode, businessTypeCode); |
|
|
|
return generateOriginId(problemSourcesCode, businessTypeCode); |
|
|
|
} |
|
|
|
} |
|
|
|
return originId; |
|
|
|
return originId; |
|
|
|
|