认证清单-认证工程师保存接口对接。

This commit is contained in:
wangzhijiang
2023-03-08 13:44:07 +08:00
parent b4b6d3c78d
commit 9239de718e
4 changed files with 16 additions and 4 deletions
@@ -217,7 +217,7 @@ public class ProjectCertificationInventoryEOController extends JeroController<Pr
@AutoLog(value = "项目库-认证清单表-批量保存")
@ApiOperation(value="项目库-认证清单表-批量保存", notes="项目库-认证清单表-批量保存")
@PostMapping(value = "/saveBatch")
public Result<?> saveBatch(@RequestBody List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList) {
return this.projectCertificationInventoryEOService.saveBatch(projectCertificationInventoryEOList);
public Result<?> saveBatch(@RequestBody JSONObject json) {
return this.projectCertificationInventoryEOService.saveBatch(json);
}
}
@@ -12,6 +12,7 @@ public enum CertificationFlowNodeEnum {
RZGCSJSRW ("rzgcsjsrw","认证工程师接受任务","Certified engineers accept tasks"),
RZGCSTHRW ("rzgcsthrw","认证工程师退回至studio任务","Certified engineer returns to studio task"),
ZRRJSRW ("zrrjsrw","责任人接受任务","The responsible person accepts the task"),
ZRRJJRW ("zrrjjrw","责任人拒绝任务","The person in charge refused the assignment"),
ZRRTJRW ("zrrtjrw","责任人提交任务","The responsible person submits the task"),
RZGCSSC ("rzgcssc","认证工程师审查","Certified engineer review"),
;
@@ -134,5 +134,5 @@ public interface IProjectCertificationInventoryEOService extends IService<Projec
* @param projectCertificationInventoryEOList
* @return
*/
Result<?> saveBatch(List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList);
Result<?> saveBatch(JSONObject json);
}
@@ -3,6 +3,7 @@ package com.jero.modules.project.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
@@ -817,7 +818,17 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
@Override
public Result<?> saveBatch(List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList) {
public Result<?> saveBatch(JSONObject json) {
if (!json.containsKey("dataList")) {
throw new JeroBootException("无法获取需要保存的数据,请检查!");
}
JSONArray dataList = json.getJSONArray("dataList");
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = new ArrayList<>();
ProjectCertificationInventoryEO projectCertificationInventoryEO = null;
for (Object data : dataList) {
projectCertificationInventoryEO = JSONObject.parseObject(JSONObject.toJSONString(data),ProjectCertificationInventoryEO.class);
projectCertificationInventoryEOList.add(projectCertificationInventoryEO);
}
if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){
throw new JeroBootException("无法获取需要保存的数据,请检查!");
}