Commit 24158764 authored by 曹盼盼's avatar 曹盼盼

人员,设备,管材的校验,以及校验成功公共方法,校验失败的公共方法

parent 9308f482
...@@ -44,4 +44,4 @@ public enum StageEnum { ...@@ -44,4 +44,4 @@ public enum StageEnum {
} }
\ No newline at end of file
...@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* @Author cpp * @Author cpp
* @Description * @Description
...@@ -17,7 +19,64 @@ import lombok.EqualsAndHashCode; ...@@ -17,7 +19,64 @@ import lombok.EqualsAndHashCode;
public class AcceptDto extends BaseDto { public class AcceptDto extends BaseDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
//人员信息
@ApiModelProperty(value = "项目id")
private Long projectId;
@ApiModelProperty(value = "焊口编号")
private String code;
@ApiModelProperty(value = "焊接定位信息")
private String peopleLocation;
@ApiModelProperty(value = "人脸识别图片信息")
private String peoplePhoto;
@ApiModelProperty(value = "人员id")
private String userId;
@ApiModelProperty(value = "阶段检验")
private String stage;
//设备
@ApiModelProperty(value = "设备id")
private String facilityId;
@ApiModelProperty(value = "检定状态")
private String calibrationStatus;
@ApiModelProperty(value = "设备图片")
private String facilityPhoto;
//管材
@ApiModelProperty(value = "管材id")
private String materialId;
@ApiModelProperty(value = "管材图片信息")
private String materialPhoto;
//工艺
@ApiModelProperty(value = "焊接工艺")
private String craft;
@ApiModelProperty(value = "焊机设备id")
private String weldingId;
@ApiModelProperty(value = "工艺图片")
private String craftPhoto;
//埋深
@ApiModelProperty(value = "埋深检测方式")
private String depthType;
@ApiModelProperty(value = "埋深")
private String depth;
@ApiModelProperty(value = "埋深定位信息")
private String depthLocation;
@ApiModelProperty(value = "埋深图片信息")
private String depthPhoto;
//耐压
@ApiModelProperty(value = "耐压设备id")
private String pressureId;
@ApiModelProperty(value = "压力测试")
private String pressureTest;
@ApiModelProperty(value = "耐压测试定位信息")
private String pressureLocation;
@ApiModelProperty(value = "耐压图片信息")
private String pressurePhoto;
//定位
@ApiModelProperty(value = "焊口精确定位方式")
private String locationType;
@ApiModelProperty(value = "图片信息")
private String locationPhoto;
......
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* @Author cpp
* @Description 智能监检列表
* @Date 2022/10/19
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="SmartListDto", description="智能监检列表")
public class SmartListDto extends BaseDto {
@ApiModelProperty(value = "项目id")
private Long projectId;
@ApiModelProperty(value = "项目名称")
private String name;
@ApiModelProperty(value = "项目编号")
private String projectCode;
@ApiModelProperty(value = "检验检测单位")
private String companyName;
@ApiModelProperty(value = "检验负责人")
private String usrName;
@ApiModelProperty(value = "检验员")
private String inspector;
@ApiModelProperty(value = "检验状态")
private String status;
@ApiModelProperty(value = "检验方式")
private String type;
@ApiModelProperty(value = "交检日期")
private Date submitTime;
@ApiModelProperty(value = "检验时间")
private Date verifyTime;
//管材
@ApiModelProperty(value = "焊口编号")
private String code;
@ApiModelProperty(value = "管材厂家")
private String manufacturer;
@ApiModelProperty(value = "管材批号")
private String batchNumber;
@ApiModelProperty(value = "质量许可")
private String permission;
@ApiModelProperty(value = "焊工编号")
private String personWeld;
@ApiModelProperty(value = "管材定位信息")
private String tubularlocatingInformation;
//设备
@ApiModelProperty(value = "焊机编号")
private String facilityNumber;
@ApiModelProperty(value = "焊机名称")
private String facilityName;
@ApiModelProperty(value = "焊机定位信息")
private String facilityLocation;
@ApiModelProperty(value = "检定状态")
private String facilityStatus;
//人员
@ApiModelProperty(value = "焊工姓名")
private String peopleName;
@ApiModelProperty(value = "持证状态")
private String peopleStatus;
@ApiModelProperty(value = "焊接定位信息")
private String peopleLocation;
// 工艺
@ApiModelProperty(value = "焊接工艺")
private String craft;
@ApiModelProperty(value = "焊接时长")
private String duration;
//耐压
@ApiModelProperty(value = "耐压测试编号")
private String pressureNumber;
@ApiModelProperty(value = "耐压设备名称")
private String pressureName;
@ApiModelProperty(value = "耐压设备编码")
private String pressureCode;
@ApiModelProperty(value = "测试压力Mpa")
private String mpa;
@ApiModelProperty(value = "耐压测试定位")
private String pressureLocation;
//敷设位置标定检验
@ApiModelProperty(value = "焊口精确定位方式")
private String preciseWeldingPosition;
@ApiModelProperty(value = "位置标定检验结果")
private String resuts;
@ApiModelProperty(value = "检验检测阶段")
private String stage;
}
...@@ -148,5 +148,4 @@ public class Project extends BaseEntity { ...@@ -148,5 +148,4 @@ public class Project extends BaseEntity {
*/ */
@TableField("remark") @TableField("remark")
private String remark; private String remark;
} }
...@@ -19,4 +19,7 @@ public interface WeldMapper extends BaseMapper<Weld> { ...@@ -19,4 +19,7 @@ public interface WeldMapper extends BaseMapper<Weld> {
@Select ("select project_id,super_inspec_status from tz_ugp_weld where project_id =#{projectId}") @Select ("select project_id,super_inspec_status from tz_ugp_weld where project_id =#{projectId}")
List<WeldDto> select(Long projectId); List<WeldDto> select(Long projectId);
@Select("SELECT * from tz_ugp_weld where code = #{code} and project_id =#{projectId}")
Weld getWeldByCodeAndProjectId(String code,Long projectId);
} }
package com.yeejoin.amos.boot.module.ugp.api.service; package com.yeejoin.amos.boot.module.ugp.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.FacilityDto; import com.yeejoin.amos.boot.module.ugp.api.dto.SmartListDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.IntelligentInspectionDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.TubingDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WorkerDto;
/** /**
* 智能监检管理表接口类 * 智能监检管理表接口类
...@@ -13,9 +10,6 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.WorkerDto; ...@@ -13,9 +10,6 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.WorkerDto;
* @date 2022-09-22 * @date 2022-09-22
*/ */
public interface IVerifyService { public interface IVerifyService {
Page<SmartListDto> commonality(String stage, Page<SmartListDto> page);
Page<TubingDto> selectInspection(Page<TubingDto> page, TubingDto dto);
Page<WorkerDto> selectWorker(Page<WorkerDto> page, WorkerDto dto);
Page<FacilityDto> selectFacility(Page<FacilityDto> page, FacilityDto dto);
} }
...@@ -48,9 +48,10 @@ ...@@ -48,9 +48,10 @@
vf.project_id =pt.sequence_nbr vf.project_id =pt.sequence_nbr
and and
pt.is_delete='0' pt.is_delete='0'
<if test="stage != '' and stage != null">
and and
vf.stage =#{stage} vf.stage =#{stage}
</if>
</select> </select>
</mapper> </mapper>
...@@ -21,6 +21,17 @@ ...@@ -21,6 +21,17 @@
<artifactId>amos-boot-module-common-biz</artifactId> <artifactId>amos-boot-module-common-biz</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-biz-common</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.24</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
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.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum;
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;
...@@ -111,7 +112,7 @@ public class VerifyController extends BaseController { ...@@ -111,7 +112,7 @@ public class VerifyController extends BaseController {
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "智能监检管理表列表全部数据查询", notes = "智能监检管理表列表全部数据查询") @ApiOperation(httpMethod = "GET",value = "智能监检管理表列表全部数据查询", notes = "智能监检管理表列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<VerifyDto>> selectForList() { public ResponseModel<List<VerifyDto>> selectForList() {
...@@ -126,46 +127,42 @@ public class VerifyController extends BaseController { ...@@ -126,46 +127,42 @@ public class VerifyController extends BaseController {
/** cpp /** cpp
* *
*焊接管材检验信息列表 *焊接管材检验信息列表
* @param current * @param current
* @param size * @param size
* @param dto
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectInspection") @GetMapping(value = "/selectTubular")
@ApiOperation(httpMethod = "GET", value = "焊接管材检验信息列表", notes = "焊接管材检验信息列表") @ApiOperation(httpMethod = "GET", value = "焊接管材检验信息列表", notes = "焊接管材检验信息列表")
public ResponseModel<Page<TubingDto>> selectInspection(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<SmartListDto>> selectTubular(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, TubingDto dto) { (value = "size") int size) {
Page<TubingDto> page = new Page<>(); Page<SmartListDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(service.selectInspection(page,dto)); return ResponseHelper.buildResponse(service.commonality(StageEnum.焊前管材质量.getStage(),page));
} }
/** cpp /** cpp
* *
*查询焊接人员检验信息列表 *查询焊接人员检验信息列表
* @param current * @param current
* @param size * @param size
* @param dto * @param
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectWorker") @GetMapping(value = "/selectWorker")
@ApiOperation(httpMethod = "GET", value = "查询焊接人员检验信息列表", notes = "查询焊接人员检验信息列表") @ApiOperation(httpMethod = "GET", value = "查询焊接人员检验信息列表", notes = "查询焊接人员检验信息列表")
public ResponseModel<Page<WorkerDto>> selectWorker(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<SmartListDto>> selectWorker(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, WorkerDto dto) { (value = "size") int size) {
Page<WorkerDto> page = new Page<>(); Page<SmartListDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(service.selectWorker(page,dto)); return ResponseHelper.buildResponse(service.commonality(StageEnum.焊前人员.getStage(),page));
} }
/** cpp /** cpp
...@@ -173,41 +170,104 @@ public class VerifyController extends BaseController { ...@@ -173,41 +170,104 @@ public class VerifyController extends BaseController {
*查询焊接设备检验信息列表 *查询焊接设备检验信息列表
* @param current * @param current
* @param size * @param size
* @param dto
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectFacility") @GetMapping(value = "/selectFacility")
@ApiOperation(httpMethod = "GET", value = "查询焊接设备检验信息列表", notes = "查询焊接设备检验信息列表") @ApiOperation(httpMethod = "GET", value = "查询焊接设备检验信息列表", notes = "查询焊接设备检验信息列表")
public ResponseModel<Page<FacilityDto>> selectFacility(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<SmartListDto>> selectFacility(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, FacilityDto dto) { (value = "size") int size) {
Page<FacilityDto> page = new Page<>(); Page<SmartListDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(service.selectFacility(page,dto)); return ResponseHelper.buildResponse(service.commonality(StageEnum.焊前设备.getStage(),page));
} }
/** cpp
*
*查询焊接工艺检验信息列表
* @param current
* @param size
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectCraft")
@ApiOperation(httpMethod = "GET", value = "查询焊接工艺检验信息列表", notes = "查询焊接工艺检验信息列表")
public ResponseModel<Page<SmartListDto>> selectCraft(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<SmartListDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(service.commonality(StageEnum.焊接工艺.getStage(),page));
}
/** cpp
*
*查询管道耐压检验信息列表
* @param current
* @param size
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectVoltage")
@ApiOperation(httpMethod = "GET", value = "查询管道耐压检验信息列表", notes = "查询管道耐压检验信息列表")
public ResponseModel<Page<SmartListDto>> selectVoltage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<SmartListDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(service.commonality(StageEnum.管道耐压.getStage(),page));
}
/** cpp
*
*敷设位置标定检验列表
* @param current
* @param size
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectLocation")
@ApiOperation(httpMethod = "GET", value = "敷设位置标定检验列表", notes = "敷设位置标定检验列表")
public ResponseModel<Page<SmartListDto>> selectLocation(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<SmartListDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(service.commonality(StageEnum.定位.getStage(),page));
}
/** /**
* cpp * cpp
* * 校验
* 校验
* @param dto * @param dto
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping(value = "/checks") @PostMapping(value = "/checks")
@ApiOperation(httpMethod = "POST", value = "校验app上传数据", notes = "校验app上传数据") @ApiOperation(httpMethod = "POST", value = "校验app上传数据", notes = "校验app上传数据")
public ResponseModel<String> checks(@RequestBody AcceptDto dto) { public ResponseModel<String> checks(@RequestBody AcceptDto dto) {
return ResponseHelper.buildResponse(verifyServiceImpl.checks(dto)); return ResponseHelper.buildResponse(verifyServiceImpl.checks(dto));
} }
/** /**
* 焊接工艺效验 * 焊接工艺效验
*/ */
......
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.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.Enum.VerifyEnum;
...@@ -18,9 +20,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -18,9 +20,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
/** /**
* 智能监检管理表服务实现类 * 智能监检管理表服务实现类
...@@ -48,7 +48,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -48,7 +48,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
public Page<VerifyDto> queryForVerifyPage(Page<VerifyDto> page) { public Page<VerifyDto> queryForVerifyPage(Page<VerifyDto> page) {
return this.queryForPage(page, null, false); return this.queryForPage(page, null, false);
} }
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
...@@ -62,135 +61,323 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -62,135 +61,323 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
/** cpp
/**
* 智能监检共用查询方法 * 智能监检共用查询方法
* * stage 阶段
* page 分页
*/ */
public List<IntelligentInspectionDto> commonality(String stage){ public Page<SmartListDto> commonality(String stage,Page<SmartListDto> page){
List<Verify> commonality = verifyMapper.commonality(stage); List<Verify> commonality = verifyMapper.commonality(stage);
List<IntelligentInspectionDto> dtoList =new ArrayList<>(); List<SmartListDto> dtoList =new ArrayList<>();
//进入焊前 //进入焊前
if (commonality !=null && commonality.size() !=0){ if (commonality !=null && commonality.size() !=0){
for (Verify verify : commonality) { for (Verify verify : commonality) {
IntelligentInspectionDto beforeDto = new IntelligentInspectionDto( ); SmartListDto beforeDto = new SmartListDto( );
beforeDto.setSequenceNbr(verify.getSequenceNbr());//智能监检表id beforeDto.setSequenceNbr(verify.getSequenceNbr());//智能监检表id
beforeDto.setProjectId(verify.getProjectId()); //项目id beforeDto.setProjectId(verify.getProjectId()); //项目id
beforeDto.setName(verify.getProject().getName());//项目名称 beforeDto.setName(verify.getProject().getName());//项目名称
beforeDto.setProjectCode(verify.getProject().getCode());//项目编号 beforeDto.setProjectCode(verify.getProject().getCode());//项目编号
beforeDto.setStatus(verify.getStatus());//检验状态 beforeDto.setStatus(verify.getStatus());//检验状态
beforeDto.setType(verify.getType());//检验方式 beforeDto.setType(verify.getType());//检验方式
beforeDto.setSubmitTime(verify.getVerifyTime());//交检日期 beforeDto.setSubmitTime(verify.getVerifyTime());//交检日期
beforeDto.setVerifyTime(verify.getVerifyTime());//检验时间 beforeDto.setVerifyTime(verify.getVerifyTime());//检验时间
beforeDto.setStage(verify.getStage()); beforeDto.setStage(verify.getStage());
String targetInfo = verify.getTargetInfo();//app上传数据 String targetInfo = verify.getTargetInfo();//app上传数据
beforeDto.setTargetInfo(targetInfo); dtoList.add(beforeDto);
dtoList.add(beforeDto); }
} }
}
return dtoList ;
}
page.setRecords(dtoList);
page.setTotal(dtoList.size());
return page ;
}
/** /** cpp
* 查询焊接管材检验信息列表 * 智能监检校验数据 人员 设备 管材
* @param page
* @param dto * @param dto
* @return * @return
*/ */
@Override private static final String TYPE="智能检验";
public Page<TubingDto> selectInspection(Page<TubingDto> page, TubingDto dto) { public String checks(AcceptDto dto) {
List<IntelligentInspectionDto> commonality = this.commonality(StageEnum.焊前管材质量.getName());
ArrayList<TubingDto> list = new ArrayList<>( ); if (dto == null) {
for (IntelligentInspectionDto intelligentInspectionDto : commonality) { return "数据不存在";
TubingDto tubingDto = new TubingDto( );
BeanUtils.copyProperties(intelligentInspectionDto,tubingDto);
list.add(tubingDto);
} }
page.setRecords(list); Verify verify = new Verify( );
page.setTotal(list.size()); //获取公共属性信息
return page; Long projectId = dto.getProjectId( );//项目id
} String code = dto.getCode( );//焊口编号
String peopleLocation = dto.getPeopleLocation( );//焊接定位信息
String stage = dto.getStage( ); //阶段检验
//获取当前校验时间
Date time = new Date( );
/**
* 查询焊接人员检验信息列表 //人员
* @param page if (stage.equals(StageEnum.焊前人员.getVerifyName())&&dto.getPeoplePhoto() !=null && !dto.getPeoplePhoto().equals("")) {
* @param dto
* @return //获取焊接人员校验信息
*/ String peoplePhoto = dto.getPeoplePhoto( ); //人脸识别图片信息
@Override String userId = dto.getUserId( );//人员id
public Page<WorkerDto> selectWorker(Page<WorkerDto> page, WorkerDto dto) {
HashMap<String, String> map = new HashMap<>( );
List<IntelligentInspectionDto> commonality = this.commonality(StageEnum.焊前人员.getName()); map.put("peoplePhoto",peoplePhoto);
ArrayList<WorkerDto> workerList = new ArrayList<>( ); map.put("code",code);
for (IntelligentInspectionDto intelligentInspectionDto : commonality) { map.put("peopleLocation",peopleLocation);
WorkerDto workerDto = new WorkerDto( ); map.put("userId",userId);
BeanUtils.copyProperties(intelligentInspectionDto,workerDto); String targetInfo= JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); //焊口编号 人脸识别图片信息 焊接定位信息 人员id
workerList.add(workerDto);
verify.setSequenceNbr(new Date().getTime());
verify.setProjectId(projectId);
verify.setStage(StageEnum.焊前人员.getStage()); //阶段
verify.setType(TYPE);
verify.setTargetInfo(targetInfo);
verify.setVerifyTime(time);
//数据校验
Boolean falg =false; /**假设*/
if (!falg) {
/* //校验不通过,存入校验信息,
verify.setStatus(VerifyEnum.未通过.getStatus());
try {
int insert = verifyMapper.insert(verify);
} catch (Exception e) {
e.printStackTrace();
}
//将出现问题的哪一个阶段存入tz_ugp_quality_problem表中,返回失败
QualityProblem qualityProblem = new QualityProblem();
qualityProblem.setSequenceNbr(new Date().getTime());
qualityProblem.setProjectId(projectId);
//随机生成四位数
String s = String.valueOf((int) ((Math.random( ) * 9 + 1) * 1000));
qualityProblem.setCode(code+"-WT"+s);
qualityProblem.setGenerateStage(stage);
qualityProblem.setProblemDescribe(stage+"不通过");
qualityProblem.setStageVerifyId(verify.getSequenceNbr());
qualityProblemService.save(qualityProblem);
return VerifyEnum.未通过.getName();*/
this.addFailData(verify,new QualityProblem());
return VerifyEnum.未通过.getName();
}
//校验通过
/*//这个是判断过后需要存的状态
verify.setStatus(VerifyEnum.已通过.getStatus());
try {
//智能监检管理表添加数据
int insert = verifyMapper.insert(verify);
} catch (Exception e) {
e.printStackTrace( );
}
//焊口表存更改状态
Weld weld = weldMapper.getWeldByCodeAndProjectId(code, projectId);
weld.setSuperInspecStatus(stage);
LambdaQueryWrapper<Weld> wrapper = new LambdaQueryWrapper<>( );
wrapper.eq(Weld::getCode ,weld.getCode());
weldMapper.update(weld,wrapper);*/
this.addSuccessData(verify);
} }
page.setRecords(workerList);
page.setTotal(workerList.size());
return page;
}
/** //设备
* 查询焊接设备检验信息列表 if (stage.equals(StageEnum.焊前设备.getVerifyName())&&dto.getFacilityPhoto() !=null && !dto.getFacilityPhoto().equals("")){
* @param page //获取校验设备信息
* @param dto
* @return
*/ String facilityId = dto.getFacilityId( ); //设备id
@Override String calibrationStatus = dto.getCalibrationStatus( );//检定状态
public Page<FacilityDto> selectFacility(Page<FacilityDto> page, FacilityDto dto) { String facilityPhoto = dto.getFacilityPhoto( );//设备图片
List<IntelligentInspectionDto> commonality = this.commonality(StageEnum.焊前设备.getName()); HashMap<String, String> mapfacilty = new HashMap<>( );
ArrayList<FacilityDto> facilityList = new ArrayList<>( ); mapfacilty.put("code",code);//焊口编号
for (IntelligentInspectionDto intelligentInspectionDto : commonality) { mapfacilty.put("peopleLocation",peopleLocation);//焊接定位信息
FacilityDto facilityDto = new FacilityDto( ); mapfacilty.put("calibrationStatus",calibrationStatus);
BeanUtils.copyProperties(intelligentInspectionDto,facilityDto); mapfacilty.put("facilityPhoto",facilityPhoto);
facilityList.add(facilityDto); mapfacilty.put("facilityId",facilityId);
String targetInfo= JSON.toJSONString(mapfacilty, SerializerFeature.WriteMapNullValue);
verify.setSequenceNbr(new Date().getTime());//主键
verify.setProjectId(projectId);
verify.setStage(StageEnum.焊前设备.getStage());
verify.setTargetInfo(targetInfo);
verify.setType(TYPE);
verify.setVerifyTime(time);
//数据校验
Boolean flag =false;
if (!flag) {
//校验不通过
this.addFailData(verify,new QualityProblem());
return VerifyEnum.未通过.getName();
}
//效验通过
this.addSuccessData(verify);
} }
page.setRecords(facilityList);
page.setTotal(facilityList.size());
return page;
//管材
if (stage.equals(StageEnum.焊前管材质量.getVerifyName())&&dto.getMaterialPhoto() !=null && !dto.getMaterialPhoto().equals("")){
String materialId = dto.getMaterialId( ); //管材id
String materialPhoto = dto.getMaterialPhoto( );//管材图片信息
HashMap<String, String> mapMaterial = new HashMap<>( );
mapMaterial.put("code",code);
mapMaterial.put("materialId",materialId);
mapMaterial.put("materialPhoto",materialPhoto);
mapMaterial.put("peopleLocation",peopleLocation);
String targetInfo= JSON.toJSONString(mapMaterial, SerializerFeature.WriteMapNullValue);
verify.setTargetInfo(targetInfo);
verify.setSequenceNbr(new Date().getTime());
verify.setStage(StageEnum.焊前管材质量.getStage());
verify.setType(TYPE);
verify.setVerifyTime(time);
verify.setProjectId(projectId);
//数据校验
Boolean flag =false;
if (!flag) {
//不通过, 添加数据并返回未通过结果
this.addFailData(verify,new QualityProblem());
return VerifyEnum.未通过.getName();
}
//校验通过
this.addSuccessData(verify);
}
return VerifyEnum.已通过.getName();
} }
/**
* 智能监检校验数据 /** cpp
* @param dto * 校验失败需要添加的数据
* @return * @param verify
* @param qualityProblem
*/ */
public String checks(AcceptDto dto) { public void addFailData(Verify verify,QualityProblem qualityProblem){
if (dto != null) { //校验不通过,存入校验信息,
// 校验数据 verify.setStatus(VerifyEnum.未通过.getStatus());
try {
//调用方法判断 //智能监检管理表添加数据
int insert = verifyMapper.insert(verify);
} catch (Exception e) {
e.printStackTrace();
}
//
//质量问题表添加数据
qualityProblem.setSequenceNbr(new Date().getTime());
qualityProblem.setProjectId(verify.getProjectId());
//随机生成四位数
String s = String.valueOf((int) ((Math.random( ) * 9 + 1) * 1000));
String targetInfo = verify.getTargetInfo( );
Map map = JSON.parseObject(targetInfo, Map.class);
for (Object o:map.keySet()){
if (o.toString().equals("code")) {
String code = (String) map.get(o.toString( ));
qualityProblem.setCode(code+"-WT"+s);//获取焊口编码
}
}
qualityProblem.setGenerateStage(verify.getStage());
qualityProblem.setProblemDescribe(verify.getStage()+"不通过");
qualityProblem.setStageVerifyId(verify.getSequenceNbr());
qualityProblemService.save(qualityProblem);
//通过,将数据添加到verity表中,并返回ok }
/** cpp
* 校验成功需要添加的数据
* @param verify
* @param
*/
public void addSuccessData(Verify verify){
//效验通过状态
verify.setStatus(VerifyEnum.已通过.getStatus());
try {
//智能监检管理表添加数据
int insert = verifyMapper.insert(verify);
} catch (Exception e) {
e.printStackTrace( );
}
//焊口表存更改状态
String targetInfo = verify.getTargetInfo( );
String code =null;
Map map = JSON.parseObject(targetInfo, Map.class);
for (Object o:map.keySet()){
if (o.toString().equals("code")) {
code=(String) map.get(o.toString( ));
//如果不通过,将出现问题的哪一个阶段存入tz_ugp_quality_problem表中,返回失败 }
} }
Weld weld = weldMapper.getWeldByCodeAndProjectId(code, verify.getProjectId());
if (weld != null) {
//判断是哪一个阶段
String stage = verify.getStage( );
Map<String, String> mapEnum = StageEnum.getNameByNameMap;
for (String s:mapEnum.keySet()){
if (stage.equals(s)) {
String name = mapEnum.get(s);//获取监检状态
weld.setSuperInspecStatus(name);
}
}
LambdaQueryWrapper<Weld> wrapper = new LambdaQueryWrapper<>( );
wrapper.eq(Weld::getCode ,weld.getCode()).
eq(Weld::getProjectId,weld.getProjectId());
weldMapper.update(weld,wrapper);
return "ok"; }
} }
private String 效验状态 = "已存在"; private String 效验状态 = "已存在";
private final String 问题编码="-WT"; private final String 问题编码="-WT";
......
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