Commit a78651d7 authored by wanglong's avatar wanglong

焊接工艺效验优化

parent 742af5f2
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -54,4 +55,7 @@ public class VerifyDto extends BaseDto {
@ApiModelProperty(value = "检验员id")
private Long inspectorId;
@ApiModelProperty(value = "任务id")
private Long taskId;
}
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.VerifyEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.entity.QualityProblem;
import com.yeejoin.amos.boot.module.ugp.api.entity.Verify;
import com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService;
......@@ -16,6 +17,7 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -31,6 +33,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
@Autowired
VerifyMapper verifyMapper;
@Autowired
QualityProblemServiceImpl qualityProblemService;
/**
* 分页查询
*/
......@@ -182,30 +187,45 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
/**
* 焊接工艺效验
*/
public String weldEffect(JSONObject jsonObject){
private String 效验状态 = "null";
public String weldEffect(JSONObject jsonObject) {
Verify verify = new Verify();
LambdaQueryWrapper<Verify> wrapper=new LambdaQueryWrapper<>();
LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
//筛选出本次任务
wrapper.eq(Verify::getCode,jsonObject.getString("code"));
wrapper.eq(Verify::getCode, jsonObject.getString("code"));
wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
List<Verify> verifies = verifyMapper.selectList(wrapper);
//判断前三次已经入库
if (verifies.stream().count() == 3) {
//获取效验接口
Boolean i=true;
Boolean i = false;
verify.setProjectId(jsonObject.getLong("projectId"));
verify.setCode(jsonObject.getString("code"));
verify.setTargetInfo(jsonObject.getString("target_info"));
verify.setStage(StageEnum.焊接工艺.getName());
if (i) {
verify.setProjectId(jsonObject.getLong("projectId"));
verify.setCode(jsonObject.getString("code"));
verify.setTargetInfo(jsonObject.getString("target_info"));
verify.setStatus(VerifyEnum.已通过.getStatus());
效验状态 = "已通过";
} else {
verify.setStatus(VerifyEnum.未通过.getStatus());
QualityProblem qualityProblem = new QualityProblem();
qualityProblem.setCode("WT" + jsonObject.getString("code"));
qualityProblem.setProjectId(jsonObject.getLong("projectId"));
qualityProblem.setGenerateStage(StageEnum.焊接工艺.getName());
qualityProblem.setSubmitDate(new Date());
qualityProblemService.save(qualityProblem);
效验状态 = "未通过";
}
}
save(verify);
return "效验成功";
return 效验状态;
}
}
\ 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