Commit f5558362 authored by wanglong's avatar wanglong

完善焊接工艺监检 优化代码

parent f33f9195
......@@ -15,26 +15,27 @@ import java.util.Map;
@AllArgsConstructor
public enum StageEnum {
焊前人员("0","STAFF"),
焊前设备("1","EQUIPMENT"),
焊前管材质量("2","BEFORE-WELDING"),
焊接工艺("3","CRAFT"),
管道耐压("4","VOLTAGE"),
敷设质量("5","LAY"),
焊口定位("6","LOTCATION");
private String status;
焊前人员("人员确定","STAFF"),
焊前设备("设备确定","EQUIPMENT"),
焊前管材质量("管材确定","BEFORE-WELDING"),
焊接工艺("工艺确定","CRAFT"),
管道耐压("耐压确定","VOLTAGE"),
敷设质量("敷设确定","LAY"),
定位("定位确定","LOTCATION");
private String name;
private String stage;
public static Map<String,String> getNameByStatusMap = new HashMap<String,String>();
public static Map<String,String> getStatusByNameMap = new HashMap<String,String>();
public static Map<String,String> getNameByStatusMap = new HashMap<>();
public static Map<String,String> getStatusByNameMap = new HashMap<>();
static {
for(StageEnum enums:StageEnum.values()){
getNameByStatusMap.put(enums.status,enums.name);
getStatusByNameMap.put(enums.name, enums.status);
getNameByStatusMap.put(enums.stage,enums.name);
getStatusByNameMap.put(enums.name, enums.stage);
}
}
......
package com.yeejoin.amos.boot.module.ugp.api.Enum;
import java.security.PublicKey;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
/**
* 焊口编码赋码状态
* 焊口编码赋码状态赋码方式
*/
@Getter
@AllArgsConstructor
public enum WeldCodeEnum {
赋值状态1("未赋值","0","codingStatus"),
赋值状态2("已赋值","1","codingStatus");
//焊口编码赋码状态
未赋值("未赋值","0"),
已赋值("已赋值","1"),
/**
* 焊口编码赋码方式
*/
自动赋码("自动赋码", "0"),
手动赋码("手动赋码", "1");
private String status;
private String name;
private String state;
private String IState;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getIState() {
return IState;
}
public void setIState(String IState) {
this.IState = IState;
}
WeldCodeEnum(String status, String state, String IState) {
this.status = status;
this.state = state;
this.IState = IState;
}
public static final Map<String,String> map=new HashMap<>();
static{
for (WeldCodeEnum weldCodeEnum:WeldCodeEnum.values()){
map.put(weldCodeEnum.getState(),weldCodeEnum.getStatus());
map.put(weldCodeEnum.getState(),weldCodeEnum.getName());
}
}
......
package com.yeejoin.amos.boot.module.ugp.api.Enum;
import java.util.HashMap;
import java.util.Map;
/**
* 焊口编码赋码方式
*/
public enum WeldMethodEnum {
赋码方式1("自动赋码", "0", "codingMethod"),
赋码方式2("手动赋码", "1", "codingMethod");
private String status;
private String state;
private String IState;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getIState() {
return IState;
}
public void setIState(String IState) {
this.IState = IState;
}
WeldMethodEnum(String status, String state, String IState) {
this.status = status;
this.state = state;
this.IState = IState;
}
public static final Map<String, String> map = new HashMap<>();
static {
for (WeldMethodEnum weldMethodEnum : WeldMethodEnum.values()) {
map.put(weldMethodEnum.getState(), weldMethodEnum.getStatus());
}
}
}
......@@ -211,10 +211,10 @@ public class VerifyController extends BaseController {
/**
* 焊接工艺效验
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "焊接工艺效验", notes = "焊接工艺效验")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "焊接工艺效验", notes = "焊接工艺效验")
@PostMapping(value = "/weldeffect")
public ResponseModel<String> weldEffect(@RequestBody JSONObject jsonObject){
public ResponseModel<String> weldEffect(@RequestBody JSONObject jsonObject) {
return ResponseHelper.buildResponse(verifyServiceImpl.weldEffect(jsonObject));
}
......
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.VerifyEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WeldCodeEnum;
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.entity.Weld;
import com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -30,6 +31,10 @@ import java.util.List;
public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper> implements IVerifyService {
@Autowired
InstallNoticeServiceImpl installNoticeService;
@Autowired
WeldServiceImpl weldService;
@Autowired
WeldMapper weldMapper;
@Autowired
VerifyMapper verifyMapper;
......@@ -201,15 +206,23 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
//判断前三次已经入库
if (verifies.stream().count() == 3) {
//获取效验接口
Boolean i = false;
Boolean i = true;
verify.setProjectId(jsonObject.getLong("projectId"));
verify.setCode(jsonObject.getString("code"));
verify.setTargetInfo(jsonObject.getString("target_info"));
verify.setStage(StageEnum.焊接工艺.getName());
verify.setStage(StageEnum.焊接工艺.getStage());
if (i) {
verify.setStatus(VerifyEnum.已通过.getStatus());
LambdaQueryWrapper<Weld> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Weld::getCode,jsonObject.getString("code"));
Weld weld = weldMapper.selectOne(wrapper1);
weld.setSuperInspecStatus(StageEnum.焊接工艺.getStage());
weldService.updateById(weld);
效验状态 = "已通过";
} else {
verify.setStatus(VerifyEnum.未通过.getStatus());
......
......@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WeldCodeEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WeldMethodEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule;
......@@ -16,13 +15,11 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IWeldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
......@@ -162,8 +159,8 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
weld.setInstallCompany(project.getInstallationUnitId());
weld.setCode(code);
weld.setRegion(project.getAddress());
weld.setCodingMethod(WeldMethodEnum.赋码方式1.getState());
weld.setCodingStatus(WeldCodeEnum.赋值状态2.getState());
weld.setCodingMethod(WeldCodeEnum.自动赋码.getState());
weld.setCodingStatus(WeldCodeEnum.已赋值.getState());
weld.setCodingDate(new Date());
welds.add(weld);
}
......
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