法规清单未匹配上平台件的提示语
This commit is contained in:
+1
-1
@@ -83,7 +83,7 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
|
|||||||
@ApiOperation(value="不勾选法规清单进行关联平台件", notes="不勾选法规清单进行关联平台件")
|
@ApiOperation(value="不勾选法规清单进行关联平台件", notes="不勾选法规清单进行关联平台件")
|
||||||
@PostMapping(value = "/listPlatformAll")
|
@PostMapping(value = "/listPlatformAll")
|
||||||
public Result<?> listPlatformAll(@RequestBody Map<String,Object> params) {
|
public Result<?> listPlatformAll(@RequestBody Map<String,Object> params) {
|
||||||
List<Map<String, Object>> mapList = projectLibraryBaseService.listPlatformAll(params);
|
Map<String, Object> mapList = projectLibraryBaseService.listPlatformAll(params);
|
||||||
return Result.OK(params.get("cut").toString(),mapList);
|
return Result.OK(params.get("cut").toString(),mapList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -98,7 +98,7 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
|
|||||||
* @param params
|
* @param params
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Map<String,Object>> listPlatformAll(Map<String, Object> params);
|
Map<String,Object> listPlatformAll(Map<String, Object> params);
|
||||||
// IPage<ProjectLibraryBase> queryPageList(Map<String, Object> params);
|
// IPage<ProjectLibraryBase> queryPageList(Map<String, Object> params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+43
-24
@@ -1377,6 +1377,35 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
|||||||
mapListOne.add(mapTemp);
|
mapListOne.add(mapTemp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!mapListOne.isEmpty()){
|
||||||
|
//匹配一条平台件时直接新增
|
||||||
|
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS = new ArrayList<>();
|
||||||
|
for (Map<String, Object> map : mapListOne) {
|
||||||
|
LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO();
|
||||||
|
inventoryPlatformEO.setCreateTime(new Date());
|
||||||
|
inventoryPlatformEO.setUpdateTime(new Date());
|
||||||
|
inventoryPlatformEO.setLawsInventoryId((String) map.get("lawsInventoryId"));
|
||||||
|
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = (List<ProjectLawsInventoryEO>) map.get("result");
|
||||||
|
inventoryPlatformEO.setPlatformLawsInventoryId(projectLawsInventoryEOS.get(0).getId());
|
||||||
|
lawsInventoryPlatformEOS.add(inventoryPlatformEO);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!lawsInventoryPlatformEOS.isEmpty()) {
|
||||||
|
lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//法规清单未匹配上平台件的提示语
|
||||||
|
String html = getMsg(cut, sysDictItemList, emptyList);
|
||||||
|
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
map.put("msg",html);
|
||||||
|
map.put("result",mapList);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private String getMsg(String cut, List<SysDictItem> sysDictItemList, List<ProjectLawsInventoryEO> emptyList) {
|
||||||
List<String> msgList = new ArrayList<>();
|
List<String> msgList = new ArrayList<>();
|
||||||
//未匹配上法规清单
|
//未匹配上法规清单
|
||||||
if(ObjectUtils.isNotEmpty(emptyList)){
|
if(ObjectUtils.isNotEmpty(emptyList)){
|
||||||
@@ -1402,35 +1431,16 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
|||||||
for (String s : msgList) {
|
for (String s : msgList) {
|
||||||
html += s + "</br>";
|
html += s + "</br>";
|
||||||
}
|
}
|
||||||
if(!mapListOne.isEmpty()){
|
return html;
|
||||||
//匹配一条平台件时直接新增
|
|
||||||
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOS = new ArrayList<>();
|
|
||||||
for (Map<String, Object> map : mapListOne) {
|
|
||||||
LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO();
|
|
||||||
inventoryPlatformEO.setCreateTime(new Date());
|
|
||||||
inventoryPlatformEO.setUpdateTime(new Date());
|
|
||||||
inventoryPlatformEO.setLawsInventoryId((String) map.get("lawsInventoryId"));
|
|
||||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = (List<ProjectLawsInventoryEO>) map.get("result");
|
|
||||||
inventoryPlatformEO.setPlatformLawsInventoryId(projectLawsInventoryEOS.get(0).getId());
|
|
||||||
lawsInventoryPlatformEOS.add(inventoryPlatformEO);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!lawsInventoryPlatformEOS.isEmpty()) {
|
|
||||||
lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Map<String,Object> map = new HashMap<>();
|
|
||||||
map.put("msg",html);
|
|
||||||
map.put("result",mapList);
|
|
||||||
return map;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不勾选法规清单进行关联平台件
|
* 不勾选法规清单进行关联平台件
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String,Object>> listPlatformAll(Map<String,Object> params) {
|
public Map<String,Object> listPlatformAll(Map<String,Object> params) {
|
||||||
String cut = (String) params.get("cut");//
|
String cut = (String) params.get("cut");//
|
||||||
String projectLibraryIds = (String) params.get("projectLibraryIds");//法规清单id
|
String projectLibraryIds = (String) params.get("projectLibraryIds");//法规清单id
|
||||||
String platformProjectLibraryIds = (String) params.get("platformProjectLibraryIds");//平台件法规id
|
String platformProjectLibraryIds = (String) params.get("platformProjectLibraryIds");//平台件法规id
|
||||||
@@ -1462,7 +1472,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
|||||||
List<SysDictItem> sysDictItemList = sysDictItemMapper.selectItemsByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue());
|
List<SysDictItem> sysDictItemList = sysDictItemMapper.selectItemsByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue());
|
||||||
List<Map<String,Object>> mapList = new ArrayList<>();
|
List<Map<String,Object>> mapList = new ArrayList<>();
|
||||||
List<Map<String,Object>> mapListOne = new ArrayList<>();
|
List<Map<String,Object>> mapListOne = new ArrayList<>();
|
||||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = new ArrayList<>();
|
List<ProjectLawsInventoryEO> emptyList = new ArrayList<>();
|
||||||
for (ProjectLawsInventoryEO projectLawsInventoryEO : lawsInventoryEOList) {
|
for (ProjectLawsInventoryEO projectLawsInventoryEO : lawsInventoryEOList) {
|
||||||
Map<String,Object> map = new HashMap<>();
|
Map<String,Object> map = new HashMap<>();
|
||||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = new ArrayList<>();
|
List<ProjectLawsInventoryEO> projectLawsInventoryEOS = new ArrayList<>();
|
||||||
@@ -1502,6 +1512,9 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
|||||||
projectLawsInventoryEOS.add(lawsInventoryEO);
|
projectLawsInventoryEOS.add(lawsInventoryEO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(ObjectUtils.isEmpty(projectLawsInventoryEOS)){
|
||||||
|
emptyList.add(projectLawsInventoryEO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!projectLawsInventoryEOS.isEmpty() && projectLawsInventoryEOS.size() > 1){
|
if(!projectLawsInventoryEOS.isEmpty() && projectLawsInventoryEOS.size() > 1){
|
||||||
@@ -1533,7 +1546,13 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
|||||||
lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS);
|
lawsInventoryPlatformEOService.saveBatch(lawsInventoryPlatformEOS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mapList;
|
//法规清单未匹配上平台件的提示语
|
||||||
|
String html = getMsg(cut, sysDictItemList, emptyList);
|
||||||
|
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
map.put("msg",html);
|
||||||
|
map.put("result",mapList);
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hearSort(Map<String, Object> params, List<ProjectLibraryBase> resultLast) {
|
private void hearSort(Map<String, Object> params, List<ProjectLibraryBase> resultLast) {
|
||||||
|
|||||||
Reference in New Issue
Block a user