style: 立项变更代码格式化
This commit is contained in:
+3
-14
@@ -50,8 +50,7 @@ import java.util.stream.Collectors;
|
|||||||
@Service
|
@Service
|
||||||
@Transactional(rollbackFor = JeroBootException.class)
|
@Transactional(rollbackFor = JeroBootException.class)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitChangeMapper, ProcessEsInitChange>
|
public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitChangeMapper, ProcessEsInitChange> implements ProcessEsInitChangeService, ESSequenceNumberProvider {
|
||||||
implements ProcessEsInitChangeService, ESSequenceNumberProvider {
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ActFlowCommonService actFlowCommonService;
|
private ActFlowCommonService actFlowCommonService;
|
||||||
@@ -214,14 +213,6 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
|||||||
String processDefinitionId = actFlowCommonService.getProcessDefId(processInstanceId);
|
String processDefinitionId = actFlowCommonService.getProcessDefId(processInstanceId);
|
||||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||||
String taskName = task.getName();
|
String taskName = task.getName();
|
||||||
// 如果是第一个结点的话需要判断企标编号是否重复
|
|
||||||
if (taskName.equals(EsInitChangeConstant.MAIN_DRAFT_USER_INIT)) {
|
|
||||||
// 校验企标编号是否冲突
|
|
||||||
ProcessEsInitChange initChange = initChangeList.get(0);
|
|
||||||
if (initChange.getProjectType().equals(ESPProjectType.ENACT.getValue())) {
|
|
||||||
this.startRunTask(initChangeDataVO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (pass) {
|
if (pass) {
|
||||||
if (initChangeList != null) {
|
if (initChangeList != null) {
|
||||||
saveOrUpdateBatch(initChangeList);
|
saveOrUpdateBatch(initChangeList);
|
||||||
@@ -288,8 +279,7 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
|||||||
@Override
|
@Override
|
||||||
public void removeByProcessInstanceId(String processInstanceId) {
|
public void removeByProcessInstanceId(String processInstanceId) {
|
||||||
LambdaUpdateWrapper<ProcessEsInitChange> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<ProcessEsInitChange> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId)
|
updateWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId).set(ProcessEsInitChange::getDelFlag, YesOrNoEnum.YES.getValue());
|
||||||
.set(ProcessEsInitChange::getDelFlag, YesOrNoEnum.YES.getValue());
|
|
||||||
update(updateWrapper);
|
update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,8 +293,7 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
|||||||
lambdaQueryWrapper.isNotNull(ProcessEsInitChange::getNewEnStandardNo);
|
lambdaQueryWrapper.isNotNull(ProcessEsInitChange::getNewEnStandardNo);
|
||||||
List<ProcessEsInitChange> list = this.list(lambdaQueryWrapper);
|
List<ProcessEsInitChange> list = this.list(lambdaQueryWrapper);
|
||||||
|
|
||||||
return list.stream().map(ProcessEsInitChange::getNewEnStandardNo)
|
return list.stream().map(ProcessEsInitChange::getNewEnStandardNo).map(EnterpriseStandardUtil::getSequenceNoFromStandardNo).collect(Collectors.toList());
|
||||||
.map(EnterpriseStandardUtil::getSequenceNoFromStandardNo).collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+35
-34
@@ -241,43 +241,44 @@ public class EnterpriseStandardUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验企标编号是否不重复
|
* 校验企标编号是否不重复
|
||||||
* @param StandardNumber
|
*
|
||||||
* @return
|
* @param StandardNumber
|
||||||
*/
|
* @return
|
||||||
public boolean verifyEnStandardNumber (String StandardNumber){
|
*/
|
||||||
List<String> numList = new ArrayList<>();
|
public boolean verifyEnStandardNumber(String StandardNumber) {
|
||||||
// 判断是否和企标库中重复
|
List<String> numList = new ArrayList<>();
|
||||||
numList.addAll(esService.list().stream().map(LawsEnterpriseStandard::getStandardNumber).collect(Collectors.toList()));
|
// 判断是否和企标库中重复
|
||||||
// 判断是否和立项流程中重复
|
numList.addAll(esService.list().stream().map(LawsEnterpriseStandard::getStandardNumber).collect(Collectors.toList()));
|
||||||
numList.addAll(initChangeService.list().stream().map(ProcessEsInitChange::getNewEnStandardNo).collect(Collectors.toList()));
|
// 判断是否和立项流程中重复
|
||||||
return !numList.contains(StandardNumber);
|
numList.addAll(initChangeService.list().stream().map(ProcessEsInitChange::getNewEnStandardNo).collect(Collectors.toList()));
|
||||||
}
|
return !numList.contains(StandardNumber);
|
||||||
|
}
|
||||||
|
|
||||||
// 判断是否是空Excel
|
// 判断是否是空Excel
|
||||||
public void isEmptyExcel (Sheet sheet){
|
public void isEmptyExcel(Sheet sheet) {
|
||||||
// 验证前三行是否有数据
|
// 验证前三行是否有数据
|
||||||
for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
|
for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
|
||||||
Row row = sheet.getRow(rowIndex);
|
Row row = sheet.getRow(rowIndex);
|
||||||
if (row == null) {
|
if (row == null) {
|
||||||
// 如果行对象为null,表示这一行不存在,抛出异常
|
// 如果行对象为null,表示这一行不存在,抛出异常
|
||||||
|
throw new JeroBootException(MessageUtils.getMessage(ResultCommon.IMPORT_TEMPLATE_ERROR));
|
||||||
|
} else {
|
||||||
|
boolean isRowEmpty = true;
|
||||||
|
for (int cellIndex = row.getFirstCellNum(); cellIndex < row.getLastCellNum(); cellIndex++) {
|
||||||
|
Cell cell = row.getCell(cellIndex);
|
||||||
|
if (cell != null && cell.getCellType() != CellType.BLANK) {
|
||||||
|
// 如果找到非空单元格,设置标志为false并跳出循环
|
||||||
|
isRowEmpty = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isRowEmpty) {
|
||||||
|
// 如果行是空的,抛出异常
|
||||||
throw new JeroBootException(MessageUtils.getMessage(ResultCommon.IMPORT_TEMPLATE_ERROR));
|
throw new JeroBootException(MessageUtils.getMessage(ResultCommon.IMPORT_TEMPLATE_ERROR));
|
||||||
} else {
|
|
||||||
boolean isRowEmpty = true;
|
|
||||||
for (int cellIndex = row.getFirstCellNum(); cellIndex < row.getLastCellNum(); cellIndex++) {
|
|
||||||
Cell cell = row.getCell(cellIndex);
|
|
||||||
if (cell != null && cell.getCellType() != CellType.BLANK) {
|
|
||||||
// 如果找到非空单元格,设置标志为false并跳出循环
|
|
||||||
isRowEmpty = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isRowEmpty) {
|
|
||||||
// 如果行是空的,抛出异常
|
|
||||||
throw new JeroBootException(MessageUtils.getMessage(ResultCommon.IMPORT_TEMPLATE_ERROR));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user