Commit 1db34bb0 authored by 曹盼盼's avatar 曹盼盼

智能检验查询列表

parent ec73d03a
......@@ -15,20 +15,22 @@ import java.util.Map;
@AllArgsConstructor
public enum StageEnum {
焊前(0,"BEFORE-WELDING"),
工艺(1,"CRAFT"),
耐压(2,"VOLTAGE"),
敷设(3,"LAY"),
定位(4,"LOTCATION");
private Integer status;
焊前人员("0","STAFF"),
焊前设备("1","EQUIPMENT"),
焊前管材质量("2","BEFORE-WELDING"),
焊接工艺("3","CRAFT"),
管道耐压("4","VOLTAGE"),
敷设质量("5","LAY"),
焊口定位("6","LOTCATION");
private String status;
private String name;
public static Map<Integer,String> getNameByStatusMap = new HashMap<Integer,String>();
public static Map<String,Integer> getStatusByNameMap = new HashMap<String,Integer>();
public static Map<String,String> getNameByStatusMap = new HashMap<String,String>();
public static Map<String,String> getStatusByNameMap = new HashMap<String,String>();
static {
for(StageEnum enums:StageEnum.values()){
getNameByStatusMap.put(enums.status,enums.name);
......
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;
/**
* @Author cpp
* @Description
* @Date 2022/10/18
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AcceptDto", description="接收App数据")
public class AcceptDto extends BaseDto {
private static final long serialVersionUID = 1L;
}
package com.yeejoin.amos.boot.module.ugp.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @Author cpp
* @Description
* @Date 2022/10/18
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="FacilityDto", description="焊接设备检验信息")
public class FacilityDto extends IntelligentInspectionDto{
}
......@@ -47,36 +47,8 @@ public class IntelligentInspectionDto extends BaseDto {
@ApiModelProperty(value = "app上传的数据")
private String targetInfo;
@ApiModelProperty(value = "检验检测阶段")
private String stage;
}
package com.yeejoin.amos.boot.module.ugp.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @Author cpp
* @Description
* @Date 2022/10/17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="TubingDto", description="焊接管材检验信息")
public class TubingDto extends IntelligentInspectionDto {
}
package com.yeejoin.amos.boot.module.ugp.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @Author cpp
* @Description
* @Date 2022/10/18
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="WorkerDto", description="焊接人员检验信息")
public class WorkerDto extends IntelligentInspectionDto {
}
......@@ -90,5 +90,4 @@ public class Verify extends BaseEntity {
//项目表
private Project project;
}
......@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.yeejoin.amos.boot.module.ugp.api.entity.Verify;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 智能监检管理表 Mapper 接口
......@@ -9,6 +12,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author system_generator
* @date 2022-09-22
*/
@Mapper
public interface VerifyMapper extends BaseMapper<Verify> {
/**
* 公共接口
* @param stage 处于那个检验检测阶段
* @return
*/
List<Verify> commonality(String stage);
}
package com.yeejoin.amos.boot.module.ugp.api.service;
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.IntelligentInspectionDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.TubingDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WorkerDto;
/**
* 智能监检管理表接口类
......@@ -9,4 +14,8 @@ package com.yeejoin.amos.boot.module.ugp.api.service;
*/
public interface IVerifyService {
Page<TubingDto> selectInspection(Page<TubingDto> page, TubingDto dto);
Page<WorkerDto> selectWorker(Page<WorkerDto> page, WorkerDto dto);
Page<FacilityDto> selectFacility(Page<FacilityDto> page, FacilityDto dto);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper">
<resultMap id="resultMap" type="com.yeejoin.amos.boot.module.ugp.api.entity.Verify">
<result property="sequenceNbr" column="sequence_nbr" jdbcType="INTEGER"/>
<result property="projectId" column="project_id" jdbcType="INTEGER"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="stage" column="stage" jdbcType="VARCHAR"/>
<result property="targetInfo" column="target_info" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="VARCHAR"/>
<result property="submitTime" column="submit_time" jdbcType="TIMESTAMP"/>
<result property="verifyTime" column="verify_time" jdbcType="TIMESTAMP"/>
<result property="verifyUnitId" column="verify_unit_id" jdbcType="INTEGER"/>
<result property="chargerPersonId" column="charger_person_id" jdbcType="INTEGER"/>
<result property="inspectorId" column="inspector_id" jdbcType="INTEGER"/>
<association property="project" javaType="com.yeejoin.amos.boot.module.ugp.api.entity.Project">
<result property="name" column="name"></result>
<result property="code" column="code"></result>
</association>
</resultMap>
<select id="commonality" resultMap="resultMap">
select
vf.sequence_nbr,
vf.project_id,
vf.stage,
vf.status,
vf.target_info,
vf.type,
vf.submit_time,
vf.verify_time,
vf.verify_unit_id,
vf.charger_person_id,
vf.inspector_id,
pt.name,
pt.code
from
tz_ugp_verify vf,
tz_ugp_project pt
where
vf.project_id =pt.sequence_nbr
and
pt.is_delete='0'
and
vf.stage =#{stage}
</select>
</mapper>
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.yeejoin.amos.boot.module.ugp.api.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -13,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.VerifyDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -30,6 +31,8 @@ public class VerifyController extends BaseController {
@Autowired
VerifyServiceImpl verifyServiceImpl;
@Autowired
IVerifyService service;
/**
* 新增智能监检管理表
......@@ -113,4 +116,97 @@ public class VerifyController extends BaseController {
public ResponseModel<List<VerifyDto>> selectForList() {
return ResponseHelper.buildResponse(verifyServiceImpl.queryForVerifyList());
}
/** cpp
*
*焊接管材检验信息列表
* @param current
* @param size
* @param dto
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectInspection")
@ApiOperation(httpMethod = "GET", value = "焊接管材检验信息列表", notes = "焊接管材检验信息列表")
public ResponseModel<Page<TubingDto>> selectInspection(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, TubingDto dto) {
Page<TubingDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(service.selectInspection(page,dto));
}
/** cpp
*
*查询焊接人员检验信息列表
* @param current
* @param size
* @param dto
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectWorker")
@ApiOperation(httpMethod = "GET", value = "查询焊接人员检验信息列表", notes = "查询焊接人员检验信息列表")
public ResponseModel<Page<WorkerDto>> selectWorker(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, WorkerDto dto) {
Page<WorkerDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(service.selectWorker(page,dto));
}
/** cpp
*
*查询焊接设备检验信息列表
* @param current
* @param size
* @param dto
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/selectFacility")
@ApiOperation(httpMethod = "GET", value = "查询焊接设备检验信息列表", notes = "查询焊接设备检验信息列表")
public ResponseModel<Page<FacilityDto>> selectFacility(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, FacilityDto dto) {
Page<FacilityDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(service.selectFacility(page,dto));
}
/**
* cpp
*
* 校验
* @param dto
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/checks")
@ApiOperation(httpMethod = "POST", value = "校验app上传数据", notes = "校验app上传数据")
public ResponseModel<String> checks(@RequestBody AcceptDto dto) {
return ResponseHelper.buildResponse(verifyServiceImpl.checks(dto));
}
}
......@@ -135,7 +135,7 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
}
}
return null;
return page;
}
}
......
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
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.entity.Verify;
import com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService;
import com.yeejoin.amos.boot.module.ugp.api.dto.VerifyDto;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -30,4 +34,140 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
public List<VerifyDto> queryForVerifyList() {
return this.queryForList("" , false);
}
@Autowired
private VerifyMapper verifyMapper;
/**
* 智能监检共用查询方法
*
*/
public List<IntelligentInspectionDto> commonality(String stage){
List<Verify> commonality = verifyMapper.commonality(stage);
List<IntelligentInspectionDto> dtoList =new ArrayList<>();
//进入焊前
if (commonality !=null && commonality.size() !=0){
for (Verify verify : commonality) {
IntelligentInspectionDto beforeDto = new IntelligentInspectionDto( );
beforeDto.setSequenceNbr(verify.getSequenceNbr());//智能监检表id
beforeDto.setProjectId(verify.getProjectId()); //项目id
beforeDto.setName(verify.getProject().getName());//项目名称
beforeDto.setProjectCode(verify.getProject().getCode());//项目编号
beforeDto.setStatus(verify.getStatus());//检验状态
beforeDto.setType(verify.getType());//检验方式
beforeDto.setSubmitTime(verify.getVerifyTime());//交检日期
beforeDto.setVerifyTime(verify.getVerifyTime());//检验时间
beforeDto.setStage(verify.getStage());
String targetInfo = verify.getTargetInfo();//app上传数据
beforeDto.setTargetInfo(targetInfo);
dtoList.add(beforeDto);
}
}
return dtoList ;
}
/**
* 查询焊接管材检验信息列表
* @param page
* @param dto
* @return
*/
@Override
public Page<TubingDto> selectInspection(Page<TubingDto> page, TubingDto dto) {
List<IntelligentInspectionDto> commonality = this.commonality(StageEnum.焊前管材质量.getName());
ArrayList<TubingDto> list = new ArrayList<>( );
for (IntelligentInspectionDto intelligentInspectionDto : commonality) {
TubingDto tubingDto = new TubingDto( );
BeanUtils.copyProperties(intelligentInspectionDto,tubingDto);
list.add(tubingDto);
}
page.setRecords(list);
page.setTotal(list.size());
return page;
}
/**
* 查询焊接人员检验信息列表
* @param page
* @param dto
* @return
*/
@Override
public Page<WorkerDto> selectWorker(Page<WorkerDto> page, WorkerDto dto) {
List<IntelligentInspectionDto> commonality = this.commonality(StageEnum.焊前人员.getName());
ArrayList<WorkerDto> workerList = new ArrayList<>( );
for (IntelligentInspectionDto intelligentInspectionDto : commonality) {
WorkerDto workerDto = new WorkerDto( );
BeanUtils.copyProperties(intelligentInspectionDto,workerDto);
workerList.add(workerDto);
}
page.setRecords(workerList);
page.setTotal(workerList.size());
return page;
}
/**
* 查询焊接设备检验信息列表
* @param page
* @param dto
* @return
*/
@Override
public Page<FacilityDto> selectFacility(Page<FacilityDto> page, FacilityDto dto) {
List<IntelligentInspectionDto> commonality = this.commonality(StageEnum.焊前设备.getName());
ArrayList<FacilityDto> facilityList = new ArrayList<>( );
for (IntelligentInspectionDto intelligentInspectionDto : commonality) {
FacilityDto facilityDto = new FacilityDto( );
BeanUtils.copyProperties(intelligentInspectionDto,facilityDto);
facilityList.add(facilityDto);
}
page.setRecords(facilityList);
page.setTotal(facilityList.size());
return page;
}
/**
* 智能监检校验数据
* @param dto
* @return
*/
public String checks(AcceptDto dto) {
if (dto != null) {
// 校验数据
//调用方法判断
//通过,将数据添加到verity表中,并返回ok
//如果不通过,将出现问题的哪一个阶段存入tz_ugp_quality_problem表中,返回失败
}
return "ok";
}
}
\ 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