分解单查询接口 标准评估流程用
This commit is contained in:
+8
@@ -53,6 +53,14 @@ public class SarStandItemsController extends BaseController<SarStandItems> {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分解单查询")
|
||||
@GetMapping("/findItemById")
|
||||
public ResponseMessage findItemById( @RequestParam("type") String type,@RequestParam("ids") String ids){
|
||||
String[] Sids=ids.split(",");
|
||||
List<SarStandItemsDto> ItemDto = ServiceImpl.findItemById(type,Sids);
|
||||
return Result.success("200",ItemDto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "项目评估流程分解单查询")
|
||||
@GetMapping("/workflowFindItems")
|
||||
public ResponseMessage workflowFindItems( @RequestParam("ids") String ids,@RequestParam("types") String types){
|
||||
|
||||
@@ -63,6 +63,8 @@ public interface SarStandItemsDao extends BaseMapper<SarStandItems> {
|
||||
|
||||
List<SarStandItemsDto> selectAllItemsByIds(@Param("type") String type,@Param("ids") String[] ids);
|
||||
|
||||
List<SarStandItemsDto> findItemById(@Param("type") String type,@Param("ids") String[] ids);
|
||||
|
||||
StandsTimeDto selectStandTime(String standId);
|
||||
|
||||
List<StandsTimeDto> selectStandTimeAll();
|
||||
|
||||
+37
@@ -220,6 +220,43 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
||||
}
|
||||
}
|
||||
|
||||
public List<SarStandItemsDto> findItemById(String type,String[] ids){
|
||||
List<SarStandItemsDto> list=dao.findItemById(type,ids);
|
||||
List<SarStandItemsDto> res=new ArrayList<>();
|
||||
List<SarStandItemsDto> chinese=new ArrayList<>();
|
||||
if (null == list || list.isEmpty()){
|
||||
return list;
|
||||
}else {
|
||||
List<Integer> integerList=new ArrayList<>();
|
||||
Map<Integer,List<SarStandItemsDto>> map=new HashMap<>();
|
||||
list.forEach(sarStandItemsDto -> {
|
||||
int a= sarStandItemsDto.getItemsNum().indexOf(".");
|
||||
String mark=sarStandItemsDto.getItemsNum();
|
||||
if (a>0){
|
||||
mark=mark.substring(0,a);
|
||||
}
|
||||
try {
|
||||
if (null != map.get(Integer.valueOf(mark))) {
|
||||
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
|
||||
} else {
|
||||
integerList.add(Integer.valueOf(mark));
|
||||
List<SarStandItemsDto> middle = new ArrayList<>();
|
||||
middle.add(sarStandItemsDto);
|
||||
map.put(Integer.valueOf(mark), middle);
|
||||
}
|
||||
}catch (Exception e){
|
||||
chinese.add(sarStandItemsDto);
|
||||
}
|
||||
});
|
||||
Collections.sort(integerList);
|
||||
integerList.forEach(integer -> {
|
||||
res.addAll(map.get(integer));
|
||||
});
|
||||
res.addAll(chinese);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<SarStandItems> querySarItemAndInterpretation(FindSarItemsPageReqDTO page){
|
||||
//排序
|
||||
|
||||
Reference in New Issue
Block a user