Commit 5fea6b38 authored by wanglong's avatar wanglong

焊接工艺效验

parent a0945dd2
package com.yeejoin.amos.boot.module.ugp.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@Getter
@AllArgsConstructor
public enum VerifyEnum {
未通过("0","未通过"),
已通过("1","已通过");
private String status;
private String name;
public static Map<String,String> getTaskStatus=new HashMap<>();
static {
for (VerifyEnum verifyEnum : VerifyEnum.values()){
getTaskStatus.put(verifyEnum.status, verifyEnum.name);
}
}
}
...@@ -88,6 +88,12 @@ public class Verify extends BaseEntity { ...@@ -88,6 +88,12 @@ public class Verify extends BaseEntity {
@TableField("inspector_id") @TableField("inspector_id")
private Long inspectorId; private Long inspectorId;
@TableField("task_id")
private Long taskId;
/**
* 检验员id
*/
//项目表 //项目表
@TableField(exist = false)
private Project project; private Project project;
} }
package com.yeejoin.amos.boot.module.ugp.biz.controller; package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.dto.*; import com.yeejoin.amos.boot.module.ugp.api.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService; import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -207,6 +208,16 @@ public class VerifyController extends BaseController { ...@@ -207,6 +208,16 @@ public class VerifyController extends BaseController {
return ResponseHelper.buildResponse(verifyServiceImpl.checks(dto)); return ResponseHelper.buildResponse(verifyServiceImpl.checks(dto));
} }
/**
* 焊接工艺效验
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "焊接工艺效验", notes = "焊接工艺效验")
@PostMapping(value = "/weldeffect")
public ResponseModel<String> weldEffect(@RequestBody JSONObject jsonObject){
return ResponseHelper.buildResponse(verifyServiceImpl.weldEffect(jsonObject));
}
} }
package com.yeejoin.amos.boot.module.ugp.biz.service.impl; package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
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.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.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.entity.Verify; 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.mapper.VerifyMapper;
...@@ -21,6 +26,11 @@ import java.util.List; ...@@ -21,6 +26,11 @@ import java.util.List;
*/ */
@Service @Service
public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper> implements IVerifyService { public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper> implements IVerifyService {
@Autowired
InstallNoticeServiceImpl installNoticeService;
@Autowired
VerifyMapper verifyMapper;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -41,8 +51,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -41,8 +51,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
@Autowired
private VerifyMapper verifyMapper;
/** /**
* 智能监检共用查询方法 * 智能监检共用查询方法
* *
...@@ -170,4 +179,33 @@ private VerifyMapper verifyMapper; ...@@ -170,4 +179,33 @@ private VerifyMapper verifyMapper;
} }
/**
* 焊接工艺效验
*/
public String weldEffect(JSONObject jsonObject){
Verify verify = new Verify();
LambdaQueryWrapper<Verify> wrapper=new LambdaQueryWrapper<>();
//筛选出本次任务
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;
if (i) {
verify.setProjectId(jsonObject.getLong("projectId"));
verify.setCode(jsonObject.getString("code"));
verify.setTargetInfo(jsonObject.getString("target_info"));
}
}
save(verify);
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