认证清单-批量修改配置项接口开发。

This commit is contained in:
wangzhijiang
2023-03-13 09:54:10 +08:00
parent 383f6e2dd1
commit 0e6ae94f81
5 changed files with 44 additions and 0 deletions
@@ -241,4 +241,11 @@ public class ProjectCertificationInventoryEOController extends JeroController<Pr
public Result<?> expediting(@RequestBody JSONObject json) {
return this.projectCertificationInventoryEOService.expediting(json);
}
@AutoLog(value = "项目库-认证清单表-批量修改配置项")
@ApiOperation(value="项目库-认证清单表-批量修改配置项", notes="项目库-认证清单表-批量修改配置项")
@PostMapping(value = "/updateConfigItemBatch")
public Result<?> updateConfigItemBatch(@RequestBody JSONObject json) {
return this.projectCertificationInventoryEOService.updateConfigItemBatch(json);
}
}
@@ -75,6 +75,7 @@ public class ProjectCertificationInventoryEO implements Serializable {
/**配置项*/
@Excel(name = "配置项", width = 15)
@ApiModelProperty(value = "配置项")
@Dict(dicCode = "ren4_zheng4_qing1_dan1_-_pei4_zhi4_xiang4")
private java.lang.String configItem;
/**WVTA ID*/
@@ -160,4 +160,11 @@ public interface IProjectCertificationInventoryEOService extends IService<Projec
Map<String,Object> getCertificationInventoryLinkHrefFeishu(String projectLibraryId,String PRN_CN,String PRN_EN);
Map<String,Object> getStandNameAndItemName(List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList);
/**
* 批量修改配置项
* @param json
* @return
*/
Result<?> updateConfigItemBatch(JSONObject json);
}
@@ -1746,4 +1746,26 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return result;
}
@Override
public Result<?> updateConfigItemBatch(JSONObject json) {
String ids = json.getString("ids");
if(StringUtils.isEmpty(ids)){
throw new JeroBootException("至少选择一条数据进行操作!");
}
String configItem = json.getString("configItem");
if(StringUtils.isEmpty(ids)){
throw new JeroBootException("请选择一个配置!");
}
QueryWrapper<ProjectCertificationInventoryEO> queryWrap = new QueryWrapper<>();
queryWrap.lambda().in(ProjectCertificationInventoryEO::getId,ids.split(","));
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(queryWrap);
projectCertificationInventoryEOList.forEach(certificationInventoryEO -> {
certificationInventoryEO.setConfigItem(configItem);
});
this.updateBatchById(projectCertificationInventoryEOList);
return Result.OK("修改配置成功!");
}
}