|
|
@@ -4,9 +4,11 @@ import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.interfaces.domain.MdEstimate;
|
|
|
import com.ruoyi.interfaces.domain.MdModelInfo;
|
|
|
+import com.ruoyi.interfaces.domain.vo.MdEstimateListVo;
|
|
|
import com.ruoyi.interfaces.domain.vo.MdEstimateMdVo;
|
|
|
import com.ruoyi.interfaces.service.IMdEstimateService;
|
|
|
import com.ruoyi.interfaces.service.IMdModelInfoService;
|
|
|
@@ -14,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -33,14 +36,13 @@ public class MdEstimateController extends BaseController {
|
|
|
* 查询模型应用流程列表
|
|
|
*/
|
|
|
@GetMapping("/list")
|
|
|
- public AjaxResult list(MdEstimate mdEstimate)
|
|
|
- {
|
|
|
+ public AjaxResult list(MdEstimate mdEstimate) {
|
|
|
List<MdEstimate> list = mdEstimateService.selectMdEstimateList(mdEstimate);
|
|
|
return success(list);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/mdList")
|
|
|
- public AjaxResult mdList( MdModelInfo mdModelInfo){
|
|
|
+ public AjaxResult mdList(MdModelInfo mdModelInfo) {
|
|
|
ArrayList<MdModelInfo> data = new ArrayList<>();
|
|
|
List<MdModelInfo> mdModelInfos = mdModelInfoService.selectMdModelInfoList(mdModelInfo);
|
|
|
for (MdModelInfo modelInfo : mdModelInfos) {
|
|
|
@@ -56,13 +58,11 @@ public class MdEstimateController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获取模型应用流程详细信息
|
|
|
*/
|
|
|
@GetMapping(value = "/{estimateId}")
|
|
|
- public AjaxResult getInfo(@PathVariable("estimateId") Integer estimateId)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("estimateId") Integer estimateId) {
|
|
|
return success(mdEstimateService.selectMdEstimateByEstimateId(estimateId));
|
|
|
}
|
|
|
|
|
|
@@ -71,33 +71,44 @@ public class MdEstimateController extends BaseController {
|
|
|
*/
|
|
|
@Log(title = "模型应用流程", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody List<MdEstimate> mdEstimates)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody List<MdEstimate> mdEstimates) {
|
|
|
|
|
|
|
|
|
mdEstimates = mdEstimates.stream()
|
|
|
- .filter(p-> StringUtils.isNotNull(p.getMdid()))
|
|
|
- .filter(p-> StringUtils.isNotNull(p.getEstimateScore()))
|
|
|
- .filter(p-> StringUtils.isNotNull(p.getEstimateType()))
|
|
|
- .filter(p-> StringUtils.isNotNull(p.getEstimateTime()))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .filter(p -> StringUtils.isNotNull(p.getMdid()))
|
|
|
+ .filter(p -> StringUtils.isNotNull(p.getEstimateScore()))
|
|
|
+ .filter(p -> StringUtils.isNotNull(p.getEstimateType()))
|
|
|
+ .filter(p -> StringUtils.isNotNull(p.getEstimateTime()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
if (StringUtils.isEmpty(mdEstimates)) {
|
|
|
return AjaxResult.error();
|
|
|
}
|
|
|
MdEstimate mdEstimate = mdEstimates.get(0);
|
|
|
mdEstimateService.deleteMdEstimateByMdidAndEstimateTime(mdEstimate);
|
|
|
+ Date createTime = DateUtils.getDateDD(DateUtils.getNowDate());
|
|
|
+
|
|
|
+ mdEstimates.forEach(
|
|
|
+ p -> {
|
|
|
+ p.setCreateBy(getUsername());
|
|
|
+ p.setCreateTime(createTime);
|
|
|
+ mdEstimateService.insertMdEstimate(p);
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
- mdEstimates.forEach(mdEstimateService::insertMdEstimate);
|
|
|
return toAjax(1);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/getEstimateLog")
|
|
|
+ public AjaxResult getEstimateLog( MdEstimateListVo estimateListVo){
|
|
|
+ return success(mdEstimateService.selectEstimateLog(estimateListVo));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 修改模型应用流程
|
|
|
*/
|
|
|
@Log(title = "模型应用流程", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody MdEstimate mdEstimate)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody MdEstimate mdEstimate) {
|
|
|
return toAjax(mdEstimateService.updateMdEstimate(mdEstimate));
|
|
|
}
|
|
|
|
|
|
@@ -106,8 +117,7 @@ public class MdEstimateController extends BaseController {
|
|
|
*/
|
|
|
@Log(title = "模型应用流程", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{estimateIds}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] estimateIds)
|
|
|
- {
|
|
|
+ public AjaxResult remove(@PathVariable Long[] estimateIds) {
|
|
|
return toAjax(mdEstimateService.deleteMdEstimateByEstimateIds(estimateIds));
|
|
|
}
|
|
|
}
|