Commit 82b64ea0 authored by zhangyingbin's avatar zhangyingbin

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

# Conflicts: # amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/InstallNoticeController.java
parents 4a9f6f64 82770fb4
...@@ -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 system_generator
* @date 2022-09-22
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="MaterialDto", description="材料信息表")
public class ProjectMaterialDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "项目id")
private Long companyId;
@ApiModelProperty(value = "管材编号")
private String code;
@ApiModelProperty(value = "管材类别")
private String type;
@ApiModelProperty(value = "管材规格")
private String spec;
@ApiModelProperty(value = "管材壁厚")
private Integer wallThickness;
@ApiModelProperty(value = "生产厂家")
private String manufacturer;
@ApiModelProperty(value = "生产日期")
private Date manufactureDate;
@ApiModelProperty(value = "生产编号")
private String batchNum;
@ApiModelProperty(value = "管道直径")
private Double diameter;
@ApiModelProperty(value = "管道材料")
private String material;
@ApiModelProperty(value = "管道长度")
private Double length;
@ApiModelProperty(value = "厂家所在地")
private String manufactureAddr;
@ApiModelProperty(value = "是否审批通过(1通过,0未通过)")
private Boolean approved;
@ApiModelProperty(value = "单位机构代码")
private String orgCode;
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "项目资源id")
private Long projectResourceId;
}
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;
} }
...@@ -2,9 +2,7 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper; ...@@ -2,9 +2,7 @@ package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
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.InstallNoticeMsgPageDto; import com.yeejoin.amos.boot.module.ugp.api.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Material; import com.yeejoin.amos.boot.module.ugp.api.entity.Material;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource; import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -31,6 +29,8 @@ public interface ProjectResourceMapper extends BaseMapper<ProjectResource> { ...@@ -31,6 +29,8 @@ public interface ProjectResourceMapper extends BaseMapper<ProjectResource> {
WelderEquipmentDto customSelectById(@Param("sequenceNbr") Long sequenceNbr); WelderEquipmentDto customSelectById(@Param("sequenceNbr") Long sequenceNbr);
//管材页面分页,根据名称、编号筛选 //管材页面分页,根据名称、编号筛选
Page<MaterialDto> MaterialPage(IPage<MaterialDto> page ,@Param("name") String name, @Param("code") String code); Page<ProjectMaterialDto> MaterialPage(IPage<ProjectMaterialDto> page ,@Param("name") String name, @Param("code") String code);
//根据resource_id删除项目焊工人员信息
Boolean deleteByResourceId(Long resourceId);
} }
...@@ -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);
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- 查询安装告知申请页面--> <!-- 查询安装告知申请页面-->
<select id="installNoticePage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto"> <select id="installNoticePage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto">
SELECT a.* ,u2.biz_org_name,u1.biz_org_name SELECT a.* ,u2.biz_org_name AS inspectionUnit,u1.biz_org_name AS superviseDept
FROM (SELECT FROM (SELECT
tz_ugp_install_notice.sequence_nbr, tz_ugp_install_notice.sequence_nbr,
tz_ugp_project.`NAME`, tz_ugp_project.`NAME`,
......
...@@ -97,12 +97,18 @@ ...@@ -97,12 +97,18 @@
</select> </select>
<!-- //管材页面分页,根据名称、编号筛选--> <!-- //管材页面分页,根据名称、编号筛选-->
<!-- Page<MaterialDto> MaterialPage(IPage<MaterialDto> page ,@Param("name") String name, @Param("code") String code);--> <select id="MaterialPage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.ProjectMaterialDto">
<select id="MaterialPage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto"> SELECT tz_ugp_material.*,tz_ugp_project.name AS projectName ,tz_ugp_project_resource.sequence_nbr as projectResourceId
SELECT tz_ugp_material.* FROM tz_ugp_material,tz_ugp_project_resource ,tz_ugp_project FROM tz_ugp_project_resource
WHERE tz_ugp_project_resource.project_id=tz_ugp_project.sequence_nbr LEFT JOIN tz_ugp_material ON tz_ugp_project_resource.resource_id=tz_ugp_material.sequence_nbr
AND tz_ugp_project_resource.resource_id=tz_ugp_material.sequence_nbr LEFT JOIN tz_ugp_project ON tz_ugp_project_resource.project_id=tz_ugp_project.sequence_nbr
AND tz_ugp_project_resource.type="material" WHERE tz_ugp_project_resource.type="material"
AND tz_ugp_material.name LIKE '%${name}%' AND tz_ugp_material.code LIKE '%${code}%' AND tz_ugp_material.name LIKE '%${name}%' AND tz_ugp_material.code LIKE '%${code}%'
</select> </select>
<!-- //根据resource_id删除项目焊工人员信息-->
<delete id="deleteByResourceId" >
delete FROM tz_ugp_project_resource where resource_id=#{resourceId}
</delete>
</mapper> </mapper>
...@@ -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>
......
...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller; ...@@ -2,11 +2,13 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.netflix.ribbon.proxy.annotation.Http; import com.netflix.ribbon.proxy.annotation.Http;
import com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto; import com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectMaterialDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource; import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.MaterialServiceImpl;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -44,6 +46,8 @@ public class ProjectResourceController extends BaseController { ...@@ -44,6 +46,8 @@ public class ProjectResourceController extends BaseController {
@Autowired @Autowired
ProjectResourceMapper projectResourceMapper; ProjectResourceMapper projectResourceMapper;
@Autowired
MaterialServiceImpl materialServiceImpl;
/** /**
* 新增项目资源表(包括焊工、管材、设备) * 新增项目资源表(包括焊工、管材、设备)
...@@ -198,15 +202,30 @@ public class ProjectResourceController extends BaseController { ...@@ -198,15 +202,30 @@ public class ProjectResourceController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/materialPage") @GetMapping(value = "/materialPage")
@ApiOperation(httpMethod = "GET", value = "焊机设备分页查询", notes = "焊机设备分页查询") @ApiOperation(httpMethod = "GET", value = "焊机设备分页查询", notes = "焊机设备分页查询")
public ResponseModel<Page<MaterialDto>> queryForMaterialPage( public ResponseModel<Page<ProjectMaterialDto>> queryForMaterialPage(
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "name", required = false) String name,
@RequestParam(value = "code", required = false) String code @RequestParam(value = "code", required = false) String code
) { ) {
Page<MaterialDto> page = new Page<MaterialDto>(); Page<ProjectMaterialDto> page = new Page<ProjectMaterialDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(projectResourceMapper.MaterialPage(page,name,code)); return ResponseHelper.buildResponse(projectResourceMapper.MaterialPage(page,name,code));
} }
/**
* 根据sequenceNbr查询项目材料
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "IM/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询材料和附件", notes = "根据sequenceNbr查询材料和附件")
public ResponseModel<JSONObject> selectIMOne(@PathVariable Long sequenceNbr) {
JSONObject jsonObject = materialServiceImpl.groupBySeq(sequenceNbr);
jsonObject.getLong("sequenceNbr");
return ResponseHelper.buildResponse(materialServiceImpl.groupBySeq(sequenceNbr));
}
} }
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.controller; package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto; import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto; import com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project; import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectResourceServiceImpl;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.WelderServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.WelderServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -22,6 +28,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -22,6 +28,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -44,6 +51,12 @@ public class WelderController extends BaseController { ...@@ -44,6 +51,12 @@ public class WelderController extends BaseController {
@Autowired @Autowired
OrgServiceImpl orgServiceImpl; OrgServiceImpl orgServiceImpl;
@Autowired
ProjectResourceMapper projectResourceMapper;
@Autowired
ProjectResourceServiceImpl projectResourceServiceImpl;
/** /**
* 新增/修改焊工信息 * 新增/修改焊工信息
* *
...@@ -93,6 +106,16 @@ public class WelderController extends BaseController { ...@@ -93,6 +106,16 @@ public class WelderController extends BaseController {
} }
/** /**
* 项目焊工人员删除
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@DeleteMapping(value = "/delWelder/{sequenceNbr}")
@ApiOperation(httpMethod = "Delete", value = "项目焊工人员删除", notes = "项目焊工人员删除")
public ResponseModel<Boolean> deleteByResourceId(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(projectResourceMapper.deleteByResourceId(sequenceNbr));
}
/**
* 当前登陆人所在公司/单位/企业 下的 所有焊工人员分页查询 * 当前登陆人所在公司/单位/企业 下的 所有焊工人员分页查询
* @param current 当前页 * @param current 当前页
* @param current 每页大小 * @param current 每页大小
...@@ -136,4 +159,5 @@ public class WelderController extends BaseController { ...@@ -136,4 +159,5 @@ public class WelderController extends BaseController {
public void deleteOneById(@PathVariable String sequenceNbr) throws Exception { public void deleteOneById(@PathVariable String sequenceNbr) throws Exception {
orgServiceImpl.delectInfo(sequenceNbr); orgServiceImpl.delectInfo(sequenceNbr);
} }
} }
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.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto; import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice; import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice;
import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeService; import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeService;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto; import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; 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 org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.sql.Wrapper; import java.sql.Wrapper;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -28,6 +37,8 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -28,6 +37,8 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
@Autowired @Autowired
InstallNoticeMapper installNoticeMapper; InstallNoticeMapper installNoticeMapper;
@Autowired
ProjectServiceImpl projectServiceImpl;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -68,4 +79,47 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -68,4 +79,47 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
public InstallNoticeDto selectOneById(Long sequenceNbr){ public InstallNoticeDto selectOneById(Long sequenceNbr){
return installNoticeMapper.selectoneById(sequenceNbr); return installNoticeMapper.selectoneById(sequenceNbr);
} }
/**
* 新增安装告知申请,保存/提交
*
* @return
*/
public InstallNoticeDto saveInstallNotice(JSONObject object, String noticeStatus ) {
InstallNoticeDto installNoticeDto = new InstallNoticeDto();
// final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name"));
installNoticeDto.setProjectId(object.getLong("name"));
installNoticeDto.setNoticeStatus(noticeStatus);
installNoticeDto.setNoticeDate(new Date());
installNoticeDto.setApproved(false);
// installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
installNoticeDto.setLicenseNum(object.getString("licenseNum"));
installNoticeDto.setLicenseCompany(object.getString("licenseCompany"));
final JSONArray licenseAttch = object.getJSONArray("licenseAttch");
final JSONArray contractAttch = object.getJSONArray("contractAttch");
installNoticeDto.setLicenseAttch(JSON.toJSONString(licenseAttch));
installNoticeDto.setContractAttch(JSON.toJSONString(contractAttch));
// projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1");
return installNoticeDto;
}
/**
* 根据sequenceNbr查询安装告知信息及附件
*
* @param sequenceNbr 主键
* @return
*/
public JSONObject selectOneBySeq(Long sequenceNbr) {
final InstallNoticeDto installNoticeDto = selectOneById(sequenceNbr);
final ProjectDto projectDto = projectServiceImpl.queryBySeq(installNoticeDto.getProjectId());
JSONObject jsonObject = new JSONObject();
jsonObject.put("name",projectDto.getSequenceNbr());
jsonObject.put("installRegion",projectDto.getInstallRegion());
jsonObject.put("licenseNum",installNoticeDto.getLicenseNum());
jsonObject.put("licenseCompany",installNoticeDto.getLicenseCompany());
jsonObject.put("licenseAttch",JSON.parseArray(installNoticeDto.getLicenseAttch()));
jsonObject.put("contractAttch",JSON.parseArray(installNoticeDto.getContractAttch()));
return jsonObject;
}
} }
\ No newline at end of file
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,136 +61,324 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -62,136 +61,324 @@ 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);//获取焊口编码
}
}
//通过,将数据添加到verity表中,并返回ok qualityProblem.setGenerateStage(verify.getStage());
qualityProblem.setProblemDescribe(verify.getStage()+"不通过");
qualityProblem.setStageVerifyId(verify.getSequenceNbr());
qualityProblemService.save(qualityProblem);
}
//如果不通过,将出现问题的哪一个阶段存入tz_ugp_quality_problem表中,返回失败 /** 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( ));
}
} }
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";
...@@ -199,7 +386,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -199,7 +386,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
* 公共效验接口 * 公共效验接口
*/ */
public String effect(JSONObject jsonObject,Integer 效验数量,Boolean i) { public String effect(JSONObject jsonObject,Integer 效验数量,Boolean i) {
// String 效验状态 = "已存在";
Verify verify = new Verify(); Verify verify = new Verify();
//添加筛选条件 //添加筛选条件
LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
...@@ -240,7 +427,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -240,7 +427,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
效验状态 = "已通过"; 效验状态 = "已通过";
this.save(verify); this.save(verify);
} else { } else {
int math= (int) (Math.random()*10000); int math= (int) ((Math.random() * 9 + 1)*1000);
verify.setStatus(VerifyEnum.未通过.getStatus()); verify.setStatus(VerifyEnum.未通过.getStatus());
this.save(verify); this.save(verify);
LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>(); LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
...@@ -277,7 +464,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -277,7 +464,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
public String weldEffect(JSONObject jsonObject) { public String weldEffect(JSONObject jsonObject) {
effect(jsonObject,焊前效验数量,true);
// Verify verify = new Verify(); // Verify verify = new Verify();
// //添加筛选条件 // //添加筛选条件
...@@ -341,7 +528,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -341,7 +528,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
// //
// } // }
// //
return 效验状态; return effect(jsonObject,焊前效验数量,true);
} }
/** /**
...@@ -349,7 +536,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -349,7 +536,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
*/ */
private final Integer 管道耐压前效验数量 = 4; private final Integer 管道耐压前效验数量 = 4;
public String materialEffect(JSONObject jsonObject){ public String materialEffect(JSONObject jsonObject){
effect(jsonObject,管道耐压前效验数量,true);
// Verify verify = new Verify(); // Verify verify = new Verify();
// //添加筛选条件 // //添加筛选条件
...@@ -410,7 +597,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -410,7 +597,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
// //
// } // }
// //
return 效验状态; return effect(jsonObject,管道耐压前效验数量,true);
} }
/** /**
* 敷设效验 * 敷设效验
...@@ -418,7 +605,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -418,7 +605,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
private final Integer 敷设效验数量 = 5; private final Integer 敷设效验数量 = 5;
public String layEffect(JSONObject jsonObject){ public String layEffect(JSONObject jsonObject){
effect(jsonObject,敷设效验数量,true);
// //
// Verify verify = new Verify(); // Verify verify = new Verify();
// //添加筛选条件 // //添加筛选条件
...@@ -479,7 +666,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -479,7 +666,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
// //
// } // }
return 效验状态; return effect(jsonObject,敷设效验数量,false);
} }
/** /**
...@@ -488,7 +675,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -488,7 +675,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
private final Integer 定位效验数量 = 6; private final Integer 定位效验数量 = 6;
public String positionEffect(JSONObject jsonObject){ public String positionEffect(JSONObject jsonObject){
effect(jsonObject,定位效验数量,true);
// Verify verify = new Verify(); // Verify verify = new Verify();
// //添加筛选条件 // //添加筛选条件
...@@ -550,7 +737,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -550,7 +737,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
// //
// } // }
return 效验状态; return effect(jsonObject,定位效验数量,true);
} }
} }
\ 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