认证清单-调取添加接口

This commit is contained in:
wangzhijiang
2023-03-13 11:24:47 +08:00
parent f1725f92e0
commit f62aecb925
3 changed files with 58 additions and 2 deletions
@@ -248,4 +248,11 @@ public class ProjectCertificationInventoryEOController extends JeroController<Pr
public Result<?> updateConfigItemBatch(@RequestBody JSONObject json) {
return this.projectCertificationInventoryEOService.updateConfigItemBatch(json);
}
@AutoLog(value = "项目库-认证清单表-调取添加")
@ApiOperation(value="项目库-认证清单表-调取添加", notes="项目库-认证清单表-调取添加")
@PostMapping(value = "/callAdd")
public Result<?> callAdd(@RequestBody JSONObject json) {
return this.projectCertificationInventoryEOService.callAdd(json);
}
}
@@ -167,4 +167,11 @@ public interface IProjectCertificationInventoryEOService extends IService<Projec
* @return
*/
Result<?> updateConfigItemBatch(JSONObject json);
/**
* 调取添加
* @param json
* @return
*/
Result<?> callAdd(JSONObject json);
}
@@ -11,6 +11,9 @@ import com.jero.common.constant.enums.CutEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils;
import com.jero.modules.authDummy.entity.AuthDummyInventoryInfoEO;
import com.jero.modules.authDummy.service.IAuthDummyInventoryBaseEOService;
import com.jero.modules.authDummy.service.IAuthDummyInventoryInfoEOService;
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
import com.jero.modules.feishu.service.IFeishuService;
import com.jero.modules.project.entity.ProjectCertificationInventoryEO;
@@ -84,6 +87,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
private SysRoleMapper sysRoleMapper;
@Autowired
private IFeishuService feishuService;
@Autowired
private IAuthDummyInventoryBaseEOService authDummyInventoryBaseEOService;
@Autowired
private IAuthDummyInventoryInfoEOService authDummyInventoryInfoEOService;
@Value(value = "${jero.backUrl}")
@@ -1176,6 +1183,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
});
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue());
}
Map<String, Object> standNameAndItemName = this.getStandNameAndItemName(projectCertificationInventoryEOList);
String standName = (String) standNameAndItemName.get("standName");
String itemName = (String) standNameAndItemName.get("itemName");
@@ -1693,8 +1704,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
StringBuilder standNameSb = new StringBuilder();
StringBuilder itemNameSb = new StringBuilder();
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue());
if(StringUtils.isNotEmpty(projectCertificationInventoryEO.getInspectionItem())){
itemNameSb.append(projectCertificationInventoryEO.getInspectionItem()).append(",");
}
@@ -1768,4 +1777,37 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
this.updateBatchById(projectCertificationInventoryEOList);
return Result.OK("修改配置成功!");
}
@Override
public Result<?> callAdd(JSONObject json) {
String authDummyInventoryBaseId = json.getString("authDummyInventoryBaseId");
if(StringUtils.isEmpty(authDummyInventoryBaseId)){
throw new JeroBootException("请选择一个认证虚拟清单进行操作!");
}
String authDummyInventoryInfoIds = json.getString("authDummyInventoryInfoIds");
if(StringUtils.isEmpty(authDummyInventoryInfoIds)){
throw new JeroBootException("至少选择一条数据进行调取!");
}
String projectLibraryId = json.getString("projectLibraryId");
QueryWrapper<AuthDummyInventoryInfoEO> authDummyInfoQueryWrap = new QueryWrapper<>();
authDummyInfoQueryWrap.lambda().in(AuthDummyInventoryInfoEO::getId,authDummyInventoryInfoIds.split(","));
List<AuthDummyInventoryInfoEO> authDummyInventoryInfoEOList = this.authDummyInventoryInfoEOService.list(authDummyInfoQueryWrap);
if(CollectionUtils.isNotEmpty(authDummyInventoryInfoEOList)){
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = new ArrayList<>();
for (AuthDummyInventoryInfoEO authDummyInventoryInfoEO : authDummyInventoryInfoEOList) {
ProjectCertificationInventoryEO projectCertificationInventoryEOTemp = new ProjectCertificationInventoryEO();
BeanUtils.copyProperties(authDummyInventoryInfoEO,projectCertificationInventoryEOTemp);
projectCertificationInventoryEOTemp.setProjectLibraryId(projectLibraryId);
projectCertificationInventoryEOList.add(projectCertificationInventoryEOTemp);
}
this.saveBatch(projectCertificationInventoryEOList);
}
return Result.OK("调取成功!");
}
}