|
|
|
@ -1,7 +1,9 @@ |
|
|
|
package com.hxhq.business.controller; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.hxhq.business.domain.MjyJcgj; |
|
|
|
@ -58,9 +60,19 @@ public class StudyController extends BaseController |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private List<StudyListDto> initFormCount(List<StudyListDto> list){ |
|
|
|
for(StudyListDto l : list){ |
|
|
|
l.setFormCount(0); |
|
|
|
l.setFormFinishCount(0); |
|
|
|
if(list.size()>0){ |
|
|
|
List<StudyListDto> countList = studyService.queryFormCountList(list.stream().map(o->o.getId()).collect(Collectors.toList())); |
|
|
|
for(StudyListDto l : list){ |
|
|
|
List<StudyListDto> matchList = countList.stream().filter(o->o.getId().equals(l.getId())).collect(Collectors.toList()); |
|
|
|
if(matchList.size()>0){ |
|
|
|
l.setFormCount(matchList.get(0).getFormCount()); |
|
|
|
l.setFormFinishCount(matchList.get(0).getFormFinishCount()); |
|
|
|
}else{ |
|
|
|
l.setFormCount(0); |
|
|
|
l.setFormFinishCount(0); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
@ -68,6 +80,7 @@ public class StudyController extends BaseController |
|
|
|
/** |
|
|
|
* 获取试验详细信息 |
|
|
|
*/ |
|
|
|
@RequiresPermissions({"business:study:add", "business:study:edit", "business:study:detail"}) |
|
|
|
@GetMapping(value = "/info") |
|
|
|
public AjaxResult getInfo(Long id) |
|
|
|
{ |
|
|
|
@ -76,12 +89,19 @@ public class StudyController extends BaseController |
|
|
|
return AjaxResult.error("信息不存在"); |
|
|
|
} |
|
|
|
StudyListDto info = JSONObject.parseObject(JSONObject.toJSONString(study),StudyListDto.class); |
|
|
|
info.setFormCount(0); |
|
|
|
List<Long> idList = new ArrayList<>(); |
|
|
|
idList.add(info.getId()); |
|
|
|
List<StudyListDto> countList = studyService.queryFormCountList(idList); |
|
|
|
if(countList.size()>0){ |
|
|
|
info.setFormCount(countList.get(0).getFormCount()); |
|
|
|
}else{ |
|
|
|
info.setFormCount(0); |
|
|
|
} |
|
|
|
return AjaxResult.success(info); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增试验信息 |
|
|
|
* 新增/编辑试验信息 |
|
|
|
*/ |
|
|
|
@RequiresPermissions({"business:study:add", "business:study:edit"}) |
|
|
|
@PostMapping("/save") |
|
|
|
@ -110,6 +130,12 @@ public class StudyController extends BaseController |
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 稽查轨迹列表 |
|
|
|
* @param form |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@RequiresPermissions({"business:study:detail"}) |
|
|
|
@GetMapping("/jcgjList") |
|
|
|
public TableDataInfo jcgjList(StudyJcgj form) |
|
|
|
{ |
|
|
|
@ -138,7 +164,9 @@ public class StudyController extends BaseController |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除试验信息 |
|
|
|
* 归档 |
|
|
|
* @param form |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@RequiresPermissions({"business:study:gd"}) |
|
|
|
@PostMapping("/gd") |
|
|
|
@ -157,7 +185,9 @@ public class StudyController extends BaseController |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除试验信息 |
|
|
|
* 解锁 |
|
|
|
* @param form |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@RequiresPermissions({"business:study:js"}) |
|
|
|
@PostMapping("/js") |
|
|
|
@ -176,7 +206,9 @@ public class StudyController extends BaseController |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除试验信息 |
|
|
|
* 解档 |
|
|
|
* @param form |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@RequiresPermissions({"business:study:jd"}) |
|
|
|
@PostMapping("/jd") |
|
|
|
@ -196,6 +228,8 @@ public class StudyController extends BaseController |
|
|
|
|
|
|
|
/** |
|
|
|
* 借阅 |
|
|
|
* @param form |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@RequiresPermissions({"business:study:jy"}) |
|
|
|
@PostMapping("/jy") |
|
|
|
|