Commit 236b3034 authored by zhangsen's avatar zhangsen

根据批次号获取预案的步骤代码提交

parent 4907e949
package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService;
import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
......@@ -151,13 +152,21 @@ public class PlanVisual3dController extends BaseController {
@ApiOperation(value = "根据批次号获取预案的步骤", notes = "根据批次号获取预案的步骤")
@GetMapping(value = "/plan/getPlanStep/{batchNo}")
public ResponseModel getPlanStep(@PathVariable("batchNo") String batchNo) {
return CommonResponseUtil.successNew(planVisual3dService.getPlanStepByBatchNo(batchNo));
String newestBatchNo = planVisual3dService.getNewestBatchNo();
if (!StringUtil.isNotEmpty(newestBatchNo)) {
return CommonResponseUtil.successNew(null);
}
return CommonResponseUtil.successNew(planVisual3dService.getPlanStepByBatchNo(newestBatchNo));
}
@Permission
@ApiOperation(value = "根据批次号获取预案的记录", notes = "根据R批次号获取预案的记录")
@GetMapping(value = "/plan/getPlaneRecord/{batchNo}")
public ResponseModel getPlaneRecord(@PathVariable("batchNo") String batchNo) {
return CommonResponseUtil.successNew(planVisual3dService.getPlaneRecordByBatchNo(batchNo));
String newestBatchNo = planVisual3dService.getNewestBatchNo();
if (!StringUtil.isNotEmpty(newestBatchNo)) {
return CommonResponseUtil.successNew(null);
}
return CommonResponseUtil.successNew(planVisual3dService.getPlaneRecordByBatchNo(newestBatchNo));
}
}
......@@ -28,4 +28,10 @@ public interface PlanOperationRecordMapper {
* @return 步骤
*/
String getPlanStepByBatchNo(String batchNo);
/**
* 获取batchNo
* @return
*/
String getNewestBatchNo();
}
......@@ -248,6 +248,11 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
}
@Override
public String getNewestBatchNo() {
return planOperationRecordMapper.getNewestBatchNo();
}
@Override
public ToipResponse getPlanStepByBatchNo(String batchNo) {
ToipResponse toipResponse = new ToipResponse();
// 根据批次号查询预案步骤
......
......@@ -43,6 +43,12 @@ public interface IPlanVisual3dService {
void deleteTextPlanFile(Long id);
/**
* 查最新的批次号
* @return
*/
String getNewestBatchNo();
/**
* 根据批次号获取预案步骤
* @param batchNo 批次号
* @return 预案步骤
......
......@@ -115,4 +115,8 @@
WHERE
cpor.batch_no = #{batchNo}
</select>
<select id="getNewestBatchNo" resultType="java.lang.String">
select batch_no as batchNo from c_plan_operation_record where status = 0 and is_delete = 0 order by create_date desc limit 1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment