Commit ca7dc288 authored by limei's avatar limei

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-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/constants/XJConstant.java # amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/CompanyController.java # amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/CompanyServiceImpl.java
parents 18104a35 b259c512
...@@ -32,14 +32,14 @@ public class ReginParams implements Serializable { ...@@ -32,14 +32,14 @@ public class ReginParams implements Serializable {
@Data @Data
public static class BusinessInfo implements Serializable { public static class BusinessInfo implements Serializable {
private Long amosBizCode; private Long amosBizCode; //平台企业code
private String companyName; private String companyName; //公司名称
private Long companySequenceNbr; private Long companySequenceNbr; //公司SequenceNbr(业务)
private String companyType; private String companyType; //公司类型
private Long amosUserCode; private Long amosUserCode;
private String userName; private String userName; //用户名称
private Long userSequenceNbr; private Long userSequenceNbr; //用户sequenceNbr(业务)
private String userType; private String userType; //用户类型
} }
public BusinessInfo getBusinessInfo() { public BusinessInfo getBusinessInfo() {
......
...@@ -8,8 +8,8 @@ import lombok.Getter; ...@@ -8,8 +8,8 @@ import lombok.Getter;
public enum NoticeStatusEnum { public enum NoticeStatusEnum {
已提交("已提交","0"), 已提交("已提交","0"),
已接收("已接收","1"), 已接收("已接收","1"),
已退回("已退回","2"), 已退回("已退回","0"),
已通过("已通过","3"); 已通过("已通过","1");
String name; String name;
String statusId; String statusId;
......
...@@ -11,7 +11,7 @@ import java.util.HashMap; ...@@ -11,7 +11,7 @@ import java.util.HashMap;
public enum OrgEnum { public enum OrgEnum {
公司("COMPANY", "244", "公司",1), 公司("COMPANY", "244", "公司",1),
部门("DEPARTMENT", "245", "部门",2), 部门("DEPARTMENT", "245", "部门",2),
人员("PERSON", "246", "人员",3), 普通人员("PERSON", "246", "普通人员",3),
焊工("WELDER","247","焊工",3), 焊工("WELDER","247","焊工",3),
建设单位负责人("CHARGE","254","建设单位负责人",3), 建设单位负责人("CHARGE","254","建设单位负责人",3),
企业管理员("ADMIN","248","企业管理员",3), 企业管理员("ADMIN","248","企业管理员",3),
...@@ -33,7 +33,7 @@ public enum OrgEnum { ...@@ -33,7 +33,7 @@ public enum OrgEnum {
static { static {
for(OrgPersonEnum orgPersonEnum:OrgPersonEnum.values()){ for(OrgPersonEnum orgPersonEnum:OrgPersonEnum.values()){
map.put(orgPersonEnum.getName(),orgPersonEnum.getKey()); map.put(orgPersonEnum.getKey(),orgPersonEnum.getName());
} }
} }
} }
...@@ -19,7 +19,8 @@ public enum ProblemProcessEnum { ...@@ -19,7 +19,8 @@ public enum ProblemProcessEnum {
超期整改发送短信("超期整改发送短信","8","CQZGFSDX"), 超期整改发送短信("超期整改发送短信","8","CQZGFSDX"),
问题分类("问题分类","9","WTFL"), 问题分类("问题分类","9","WTFL"),
转人工("转人工","10","ZRG"), 转人工("转人工","10","ZRG"),
结束("结束","11","JS"); 结束("结束","11","JS"),
重大问题整改完成发送短信("重大问题整改完成发送短信","12","ZDWTZGWCFSDX");
private String Name; private String Name;
private String key; private String key;
......
package com.yeejoin.amos.boot.module.ugp.api.Enum; package com.yeejoin.amos.boot.module.ugp.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@Getter
@AllArgsConstructor
public enum ProjectInitiationEnum { public enum ProjectInitiationEnum {
项目立项("1","项目立项"), 项目立项("1","项目立项","XMLX"),
平台审核("2","平台审核"), 平台审核("2","平台审核","PTSH"),
告知申请("3","告知申请"), 告知申请("3","告知申请","GZSQ"),
接受告知("4","接受告知"), 接受告知("4","接受告知","JSGZ"),
审查项目("5","审查项目"), 审查项目("5","审查项目","SCXM"),
提交资料("6","提交资料"), 提交资料("6","提交资料","TJZL"),
审批人审批("7","审批人审批"), 审批人审批("7","审批人审批","SPRSP"),
审核人审核("8","审核人审核"), 审核人审核("8","审核人审核","SHRSH"),
监检科室分配("9","监检科室分配"), 监检科室分配("9","监检科室分配","JJKSFP"),
监检员分配("10","监检员分配"), 监检员分配("10","监检员分配","JJYFP"),
监检员审核("11","监检员审核"), 监检员审核("11","监检员审核","JJYSH"),
项目关闭("12","项目关闭"), 项目关闭("12","项目关闭","XMGB"),
接受审查意见("13","接受审查意见"); 接受审查意见("13","接受审查意见","JSSCYJ");
private String status; private String status;
private String name; private String name;
private String code;
public static Map<String,String> getNameByStatusMap = new HashMap<String,String>(); 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> getStatusByNameMap = new HashMap<String,String>();
public static Map<String,String> getCodeByNameMap = new HashMap<String,String>();
static { static {
for(ProjectInitiationEnum projectInitiationEnum:ProjectInitiationEnum.values()){ for(ProjectInitiationEnum projectInitiationEnum:ProjectInitiationEnum.values()){
getNameByStatusMap.put(projectInitiationEnum.status,projectInitiationEnum.name); getNameByStatusMap.put(projectInitiationEnum.status,projectInitiationEnum.name);
getStatusByNameMap.put(projectInitiationEnum.name, projectInitiationEnum.status); getStatusByNameMap.put(projectInitiationEnum.name, projectInitiationEnum.status);
getCodeByNameMap.put(projectInitiationEnum.name,projectInitiationEnum.code);
} }
} }
ProjectInitiationEnum(String status, String name) {
this.status = status;
this.name = name;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
} }
...@@ -10,7 +10,8 @@ public enum SMSEnum { ...@@ -10,7 +10,8 @@ public enum SMSEnum {
项目立项驳回短信("项目立项驳回短信","SMS_UGP_0002"), 项目立项驳回短信("项目立项驳回短信","SMS_UGP_0002"),
质量问题短信("质量问题短信","SMS_UGP_0003"), 质量问题短信("质量问题短信","SMS_UGP_0003"),
重大质量问题短信("重大质量问题短信","SMS_UGP_0004"), 重大质量问题短信("重大质量问题短信","SMS_UGP_0004"),
超期整改短信("超期整改短信","SMS_UGP_0005"); 超期整改短信("超期整改短信","SMS_UGP_0005"),
重大问题整改完成短信("重大问题整改完成短信","SMS_UGP_0006");
private String name; private String name;
......
...@@ -32,12 +32,12 @@ public enum StageEnum { ...@@ -32,12 +32,12 @@ public enum StageEnum {
public static Map<String,String> getNameByStatusMap = new HashMap<>(); public static Map<String,String> getNameByNameMap = new HashMap<>();
public static Map<String,String> getStatusByNameMap = new HashMap<>(); public static Map<String,String> getStatusByVerifyNameMap = new HashMap<>();
static { static {
for(StageEnum enums:StageEnum.values()){ for(StageEnum enums:StageEnum.values()){
getNameByStatusMap.put(enums.stage,enums.name); getNameByNameMap.put(enums.stage,enums.name);
getStatusByNameMap.put(enums.name, enums.stage); getStatusByVerifyNameMap.put(enums.stage, enums.verifyName);
} }
} }
......
...@@ -10,16 +10,20 @@ import java.util.Map; ...@@ -10,16 +10,20 @@ import java.util.Map;
@AllArgsConstructor @AllArgsConstructor
public enum VerifyEnum { public enum VerifyEnum {
未通过("0","未通过"), 未通过("0","未通过","智能检验"),
已通过("1","已通过"); 已通过("1","已通过","人工检验");
private String status; private String status;
private String name; private String name;
public static Map<String,String> getTaskStatus=new HashMap<>(); private String type;
public static Map<String,String> getTaskName=new HashMap<>();
public static Map<String,String> getTaskType=new HashMap<>();
static { static {
for (VerifyEnum verifyEnum : VerifyEnum.values()){ for (VerifyEnum verifyEnum : VerifyEnum.values()){
getTaskStatus.put(verifyEnum.status, verifyEnum.name); getTaskName.put(verifyEnum.status, verifyEnum.name);
getTaskType.put(verifyEnum.status, verifyEnum.type);
} }
} }
......
package com.yeejoin.amos.boot.module.ugp.api.Enum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
@Getter
@AllArgsConstructor
public enum VerifyTypeEnum {
智能检验("0","智能检验"),
人工检验("1","人工检验");
private String status;
private String name;
public static Map<String,String> getVerifyname=new HashMap<>();
static {
for (VerifyTypeEnum verifyTypeEnum:VerifyTypeEnum.values() ){
getVerifyname.put(verifyTypeEnum.status, verifyTypeEnum.name);
}
}
}
...@@ -21,9 +21,16 @@ public class XJConstant { ...@@ -21,9 +21,16 @@ public class XJConstant {
public static final String CHECK_TYPE = "CHECK_TYPE"; public static final String CHECK_TYPE = "CHECK_TYPE";
public static final String DEPT_WF_MAP_DIC_CODE = "DEPT_WF_MAP"; public static final String DEPT_WF_MAP_DIC_CODE = "DEPT_WF_MAP";
/** 企业用户注册前缀 */ /** 企业用户注册前缀 */
public static final String UGP_USER_TEL = "ugp_tel_"; public static final String UGP_USER_TEL = "ugp_tel_";
//审核/审批状态
public static final String PROCESS_PROJECT_STATE="processProjectState";
//监管科室
public static final String INS_DEP = "insDep";
public static final String INS_PRESON = "insPerson";
/** /**
* 构造方法 * 构造方法
*/ */
......
...@@ -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;
......
...@@ -68,4 +68,8 @@ public class InstallNoticePageDto extends BaseDto { ...@@ -68,4 +68,8 @@ public class InstallNoticePageDto extends BaseDto {
@ApiModelProperty(value = "告知申请提交日期") @ApiModelProperty(value = "告知申请提交日期")
private String noticeDate; private String noticeDate;
private Boolean approved;
public String approvedName;
} }
package com.yeejoin.amos.boot.module.ugp.api.dto; package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -85,5 +86,21 @@ public class ProjectDto extends BaseDto { ...@@ -85,5 +86,21 @@ public class ProjectDto extends BaseDto {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
/**
* 监检部门
*/
private String inspectionUnit;
/**
* 监察部门
*/
private String superviseDept;
private JSONArray subForm;
private String examineProjectState;
private String processProjectState;
private String insDep;
private String insPerson;
} }
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;
}
...@@ -26,7 +26,7 @@ public class SuperviseRuleDto extends BaseDto { ...@@ -26,7 +26,7 @@ public class SuperviseRuleDto extends BaseDto {
private String adminRegion; private String adminRegion;
@ApiModelProperty(value = "行政区域代码") @ApiModelProperty(value = "行政区域代码")
private String adminRegionCode; private Integer adminRegionCode;
@ApiModelProperty(value = "监察部门id") @ApiModelProperty(value = "监察部门id")
private Long superviseDeptId; private Long superviseDeptId;
......
...@@ -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;
} }
...@@ -32,7 +32,7 @@ public class SuperviseRule extends BaseEntity { ...@@ -32,7 +32,7 @@ public class SuperviseRule extends BaseEntity {
* 行政区域代码 * 行政区域代码
*/ */
@TableField("admin_region_code") @TableField("admin_region_code")
private String adminRegionCode; private Integer adminRegionCode;
/** /**
* 监察部门id * 监察部门id
......
package com.yeejoin.amos.boot.module.ugp.api.mapper; package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto; import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project; import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
/** /**
* 项目信息表 Mapper 接口 * 项目信息表 Mapper 接口
* *
...@@ -18,4 +21,6 @@ public interface ProjectMapper extends BaseMapper<Project> { ...@@ -18,4 +21,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
//通过name查询一条数据 //通过name查询一条数据
ProjectDto selectOneByName(@RequestParam String name); ProjectDto selectOneByName(@RequestParam String name);
ProjectDto getDetail(Long sequenceNbr);
} }
...@@ -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);
} }
...@@ -9,14 +9,14 @@ import org.aspectj.weaver.ast.Test; ...@@ -9,14 +9,14 @@ import org.aspectj.weaver.ast.Test;
* 项目资源表(包括焊工、管材、设备)接口类 * 项目资源表(包括焊工、管材、设备)接口类
* *
* @author system_generator * @author system_generator
* @date 2022-09-22 * @date 2022-10-21
*/ */
public interface IProjectResourceService { public interface IProjectResourceService {
//焊机设备表 //焊机设备表
Page<WelderEquipmentDto> installNoticeMsgList(Page<WelderEquipmentDto> page, String name, String type); Page<WelderEquipmentDto> installNoticeMsgList(Page<WelderEquipmentDto> page, String name, String type);
//焊机设备页面分页查询 //焊机设备页面分页查询
Page<WelderEquipmentDto> selectByName(Page<WelderEquipmentDto> page, String name ,String unit); WelderEquipmentDto selectByName(Long sequenceNbr);
Page<WelderEquipmentDto> selectByInfo(Page<WelderEquipmentDto> page, Test info , String unit); Page<WelderEquipmentDto> selectByInfo(Page<WelderEquipmentDto> page, Test info , String unit);
//根据sequenceNbr查询列表数据 //根据sequenceNbr查询列表数据
......
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`,
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
supervise_dept_id, supervise_dept_id,
inspection_unit_id, inspection_unit_id,
notice_status, notice_status,
notice_date notice_date,
approved
FROM FROM
tz_ugp_install_notice tz_ugp_install_notice
LEFT JOIN tz_ugp_project ON tz_ugp_install_notice.project_id = tz_ugp_project.sequence_nbr LEFT JOIN tz_ugp_project ON tz_ugp_install_notice.project_id = tz_ugp_project.sequence_nbr
......
...@@ -9,4 +9,12 @@ ...@@ -9,4 +9,12 @@
where name = #{name} where name = #{name}
</select> </select>
<select id="getDetail" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto">
SELECT p.*,ou1.biz_org_name AS inspection_unit,ou2.biz_org_name AS supervise_dept
FROM tz_ugp_project AS p
LEFT JOIN tz_ugp_supervise_rule AS r ON r.admin_region_code = p.install_region_code
LEFT JOIN cb_org_usr AS ou1 ON ou1.sequence_nbr = r.inspection_unit_id
LEFT JOIN cb_org_usr AS ou2 ON ou2.sequence_nbr = r.supervise_dept_id
WHERE p.sequence_nbr = #{sequenceNbr}
</select>
</mapper> </mapper>
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
<mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper">
<select id="WelderEquipment" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto"> <select id="WelderEquipment" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name, SELECT
tz_ugp_project_resource.sequence_nbr,
tz_ugp_equipment.name,
tz_ugp_equipment.code, tz_ugp_equipment.code,
tz_ugp_equipment.type, tz_ugp_equipment.type,
tz_ugp_project.name AS projectName, tz_ugp_project.name AS projectName,
...@@ -14,98 +16,99 @@ ...@@ -14,98 +16,99 @@
tz_ugp_equipment.verify_status, tz_ugp_equipment.verify_status,
info, info,
tz_ugp_project_resource.sequence_nbr as project_resource_id tz_ugp_project_resource.sequence_nbr as project_resource_id
FROM tz_ugp_project FROM tz_ugp_project_resource
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id LEFT JOIN tz_ugp_project ON tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
and tz_ugp_project_resource.type = 'equipment' LEFT JOIN tz_ugp_equipment ON tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr left join tz_ugp_attachment ON tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and WHERE tz_ugp_project_resource.type = 'equipment'
tz_ugp_attachment.type = 'enuipment'
<where>
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and tz_ugp_equipment.name like '%${name}%' and tz_ugp_equipment.name like '%${name}%'
</if> </if>
<if test="type != null and type != ''"> <if test="type != null and type != ''">
and tz_ugp_equipment.type like '%${type}%' and tz_ugp_equipment.type like '%${type}%'
</if> </if>
</where>
</select> </select>
<select id="selectByName" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto"> <select id="selectByName" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name, SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code, tz_ugp_equipment.code,
tz_ugp_equipment.type, tz_ugp_equipment.type,
tz_ugp_project.name as project_Name, tz_ugp_project.name AS projectName,
tz_ugp_project.sequence_nbr AS projectId,
tz_ugp_equipment.manufacturer, tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date, tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life, tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status, tz_ugp_equipment.verify_status,
info info,
FROM tz_ugp_project tz_ugp_project_resource.sequence_nbr as project_resource_id
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id FROM tz_ugp_project_resource
and tz_ugp_project_resource.type = 'equipment' LEFT JOIN tz_ugp_project ON tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr LEFT JOIN tz_ugp_equipment ON tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and left join tz_ugp_attachment ON tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id
tz_ugp_attachment.type = 'enuipment' WHERE tz_ugp_project_resource.type = 'equipment'
<where>
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and tz_ugp_project.name = #{name} and tz_ugp_project.name = #{name}
</if> </if>
<if test="unit != null and unit != ''"> <if test="unit != null and unit != ''">
and tz_ugp_project.construction_unit_id = #{unit} and tz_ugp_project.construction_unit_id = #{unit}
</if> </if>
</where>
</select> </select>
<select id="selectByInfo" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto"> <select id="selectByInfo" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name, SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code, tz_ugp_equipment.code,
tz_ugp_equipment.type, tz_ugp_equipment.type,
tz_ugp_project.name AS project_Name, tz_ugp_project.name AS projectName,
tz_ugp_project.sequence_nbr AS projectId,
tz_ugp_equipment.manufacturer, tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date, tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life, tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status, tz_ugp_equipment.verify_status,
info info,
FROM tz_ugp_project tz_ugp_project_resource.sequence_nbr as project_resource_id
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id FROM tz_ugp_project_resource
and tz_ugp_project_resource.type = 'equipment' LEFT JOIN tz_ugp_project ON tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr LEFT JOIN tz_ugp_equipment ON tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and left join tz_ugp_attachment ON tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id
tz_ugp_attachment.type = 'enuipment' WHERE tz_ugp_project_resource.type = 'equipment'
<where>
<if test="info != null and info != ''"> <if test="info != null and info != ''">
and tz_ugp_attachment.info = #{info} and tz_ugp_attachment.info = #{info}
</if> </if>
<if test="unit != null and unit != ''"> <if test="unit != null and unit != ''">
and tz_ugp_attachment.company_id = #{unit} and tz_ugp_attachment.company_id = #{unit}
</if> </if>
</where>
</select> </select>
<select id="customSelectById" <select id="customSelectById"
resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto"> resultType="com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto">
SELECT tz_ugp_equipment.name, SELECT tz_ugp_equipment.name,
tz_ugp_equipment.code, tz_ugp_equipment.code,
tz_ugp_equipment.type, tz_ugp_equipment.type,
tz_ugp_project.name AS project_Name, tz_ugp_project.name AS projectName,
tz_ugp_project.sequence_nbr AS projectId,
tz_ugp_equipment.manufacturer, tz_ugp_equipment.manufacturer,
tz_ugp_equipment.manufacture_date, tz_ugp_equipment.manufacture_date,
tz_ugp_equipment.service_life, tz_ugp_equipment.service_life,
tz_ugp_equipment.verify_status, tz_ugp_equipment.verify_status,
info info,
FROM tz_ugp_project tz_ugp_project_resource.sequence_nbr as project_resource_id
inner join tz_ugp_project_resource on tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id FROM tz_ugp_project_resource
and tz_ugp_project_resource.type = 'equipment' LEFT JOIN tz_ugp_project ON tz_ugp_project.sequence_nbr = tz_ugp_project_resource.project_id
inner join tz_ugp_equipment on tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr LEFT JOIN tz_ugp_equipment ON tz_ugp_project_resource.resource_id = tz_ugp_equipment.sequence_nbr
left join tz_ugp_attachment on tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id and left join tz_ugp_attachment ON tz_ugp_equipment.sequence_nbr = tz_ugp_attachment.source_id
tz_ugp_attachment.type = 'enuipment' WHERE tz_ugp_project_resource.type = 'equipment' and tz_ugp_project_resource.sequence_nbr = #{sequenceNbr}
where tz_ugp_equipment.sequence_nbr = #{sequenceNbr}
</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>
......
...@@ -24,6 +24,7 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult; ...@@ -24,6 +24,7 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil; import com.yeejoin.amos.feign.privilege.util.DesUtil;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
...@@ -79,6 +80,7 @@ public class CompanyController extends BaseController { ...@@ -79,6 +80,7 @@ public class CompanyController extends BaseController {
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
/** /**
* 新增企业信息表 * 新增企业信息表
* *
...@@ -195,58 +197,12 @@ public class CompanyController extends BaseController { ...@@ -195,58 +197,12 @@ public class CompanyController extends BaseController {
@PostMapping(value = "check") @PostMapping(value = "check")
@ApiOperation(httpMethod = "POST", value = "根据sequenceNbr更新,并创建单位及管理员", notes = "根据sequenceNbr更新,并创建单位及管理员") @ApiOperation(httpMethod = "POST", value = "根据sequenceNbr更新,并创建单位及管理员", notes = "根据sequenceNbr更新,并创建单位及管理员")
public ResponseModel<Boolean> companyCheck(@RequestBody CompanyDto model,Long sequenceNbr,String bizOrgType) throws Exception{ public ResponseModel<Boolean> companyCheck(@RequestBody CompanyDto model,Long sequenceNbr,String bizOrgType) throws Exception{
return ResponseHelper.buildResponse(companyServiceImpl.companyCheck(model,sequenceNbr,bizOrgType));
Company company = companyServiceImpl.getById(sequenceNbr);
company.setApproved(model.getApproved());
if (company.getApproved().equals("已审核")){
final CompanyModel companyModel = new CompanyModel();
AgencyUserModel agencyUserModel = new AgencyUserModel();
//创建平台企业
companyModel.setCompanyName(company.getName());
companyModel.setCompanyCode(company.getCreditCode());
companyModel.setAddress(company.getAddress());
companyModel.setParentId(0L);
companyModel.setLevel("headquarter");
companyModel.setAgencyCode("ugp");
CompanyModel companyModelFeignClient = Privilege.companyClient.create(companyModel).getResult();
//创建平台用户
String adminName = company.getAdminName();
String adminLoginName = company.getAdminLoginName();
String adminPhone = company.getAdminTel();
String adminPassword = company.getAdminLoginPwd();
agencyUserModel.setRealName(adminName);
agencyUserModel.setAgencyCode("ugp");
agencyUserModel.setLockStatus("UNLOCK");
agencyUserModel.setMobile(adminPhone);
agencyUserModel.setCreateTime(new Date());
agencyUserModel.setUserName(adminLoginName);
agencyUserModel.setPassword(DesUtil.encode(adminPassword, secretKey));
agencyUserModel.setRePassword(DesUtil.encode(adminPassword, secretKey));
Privilege.agencyUserClient.create(agencyUserModel);
//企业动态表单存储
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(company));
jsonObject.put("amosOrgId",companyModelFeignClient.getSequenceNbr());
jsonObject.put("amosOrgCode",companyModelFeignClient.getOrgCode());
orgServiceImpl.dataHandling(jsonObject,bizOrgType,null);
//企业管理员人员 动态表单存储
jsonObject = null;
jsonObject.put("name",adminName);
jsonObject.put("phone",adminPhone);
jsonObject.put("amosOrgId",agencyUserModel.getSequenceNbr());
jsonObject.put("amosOrgCode",agencyUserModel.getUserId());
orgServiceImpl.dataHandling(jsonObject, OrgEnum.企业管理员.getKey(),null);
}
return ResponseHelper.buildResponse(companyServiceImpl.updateById(company));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping(value = "test") @PostMapping(value = "test")
@ApiOperation(httpMethod = "Post", value = "根据sequenceNbr更新,并创建单位及管理员", notes = "根据sequenceNbr更新,并创建单位及管理员") @ApiOperation(httpMethod = "Post", value = "(测试)存储动态表单", notes = "(测试)存储动态表单")
public ResponseModel<OrgUsrDto> getInfo(@RequestBody JSONObject jsonObject, String bizOrgType,String sequenceNbr){ public ResponseModel<OrgUsrDto> getInfo(@RequestBody JSONObject jsonObject, String bizOrgType,String sequenceNbr){
return ResponseHelper.buildResponse(orgServiceImpl.dataHandling(jsonObject,bizOrgType,sequenceNbr)); return ResponseHelper.buildResponse(orgServiceImpl.dataHandling(jsonObject,bizOrgType,sequenceNbr));
} }
......
...@@ -197,12 +197,12 @@ public class InstallNoticeController extends BaseController { ...@@ -197,12 +197,12 @@ public class InstallNoticeController extends BaseController {
public ResponseModel<InstallNoticeDto> saveInstallNotice(@RequestBody JSONObject object,@RequestParam(required = false) String noticeStatus ) { public ResponseModel<InstallNoticeDto> saveInstallNotice(@RequestBody JSONObject object,@RequestParam(required = false) String noticeStatus ) {
InstallNoticeDto installNoticeDto = new InstallNoticeDto(); InstallNoticeDto installNoticeDto = new InstallNoticeDto();
// final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name")); final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name"));
installNoticeDto.setProjectId(object.getLong("name")); installNoticeDto.setProjectId(object.getLong("name"));
installNoticeDto.setNoticeStatus(noticeStatus); installNoticeDto.setNoticeStatus(noticeStatus);
installNoticeDto.setNoticeDate(new Date()); installNoticeDto.setNoticeDate(new Date());
installNoticeDto.setApproved(false); installNoticeDto.setApproved(false);
// installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode()); installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
installNoticeDto.setLicenseNum(object.getString("licenseNum")); installNoticeDto.setLicenseNum(object.getString("licenseNum"));
installNoticeDto.setLicenseCompany(object.getString("licenseCompany")); installNoticeDto.setLicenseCompany(object.getString("licenseCompany"));
final JSONArray licenseAttch = object.getJSONArray("licenseAttch"); final JSONArray licenseAttch = object.getJSONArray("licenseAttch");
...@@ -211,7 +211,7 @@ public class InstallNoticeController extends BaseController { ...@@ -211,7 +211,7 @@ public class InstallNoticeController extends BaseController {
installNoticeDto.setLicenseAttch(JSON.toJSONString(licenseAttch)); installNoticeDto.setLicenseAttch(JSON.toJSONString(licenseAttch));
installNoticeDto.setContractAttch(JSON.toJSONString(contractAttch)); installNoticeDto.setContractAttch(JSON.toJSONString(contractAttch));
// projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1"); projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1");
return ResponseHelper.buildResponse(installNoticeServiceImpl.createWithModel(installNoticeDto)); return ResponseHelper.buildResponse(installNoticeServiceImpl.createWithModel(installNoticeDto));
} }
...@@ -284,9 +284,15 @@ public class InstallNoticeController extends BaseController { ...@@ -284,9 +284,15 @@ public class InstallNoticeController extends BaseController {
return null; return null;
} }
/**
* 监察部门接受安装告知
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/acceptNotification") @PostMapping(value = "/acceptNotification")
@ApiOperation(httpMethod = "get", value = "接受告知", notes = "接受告知") @ApiOperation(httpMethod = "get", value = "监察部门接受安装告知", notes = "监察部门接受安装告知")
public ResponseModel<Boolean> acceptNotification(Long sequenceNbr){ public ResponseModel<Boolean> acceptNotification(Long sequenceNbr){
InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr); InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr);
installNotice.setNoticeStatus(NoticeStatusEnum.已接收.getName()); installNotice.setNoticeStatus(NoticeStatusEnum.已接收.getName());
...@@ -294,4 +300,23 @@ public class InstallNoticeController extends BaseController { ...@@ -294,4 +300,23 @@ public class InstallNoticeController extends BaseController {
projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,NoticeStatusEnum.已接收.getStatusId()); projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,NoticeStatusEnum.已接收.getStatusId());
return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice)); return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice));
} }
/**
* 监检部门审查(通过/退回)安装告知
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/inspectNotification")
@ApiOperation(httpMethod = "get", value = "监检部门审查(通过/退回)安装告知", notes = "监检部门审查(通过/退回)安装告知")
public ResponseModel<Boolean> inspectNotification(Long sequenceNbr,String option){
InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr);
installNotice.setApproved(true);
if(NoticeStatusEnum.已退回.equals(option)){
installNotice.setApproved(false);
}
Project project = projectServiceImpl.getById(installNotice.getProjectId());
projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,option);
return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice));
}
} }
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.JSONArray;
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.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
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.WelderEquipmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment;
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.biz.service.impl.OrgServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.*;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.transaction.annotation.Transactional;
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;
...@@ -21,7 +26,6 @@ import java.util.Date; ...@@ -21,7 +26,6 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
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;
...@@ -50,6 +54,11 @@ public class ProjectController extends BaseController { ...@@ -50,6 +54,11 @@ public class ProjectController extends BaseController {
ProjectInitiationServiceImpl projectInitiationService; ProjectInitiationServiceImpl projectInitiationService;
@Autowired @Autowired
OrgServiceImpl orgServiceImpl; OrgServiceImpl orgServiceImpl;
@Autowired
EquipmentServiceImpl equipmentService;
@Autowired
AttachmentServiceImpl attachmentServiceImpl;
/** /**
* 新增项目信息表 * 新增项目信息表
...@@ -199,6 +208,63 @@ public class ProjectController extends BaseController { ...@@ -199,6 +208,63 @@ public class ProjectController extends BaseController {
return ResponseHelper.buildResponse(projectServiceImpl.list(wrapper)); return ResponseHelper.buildResponse(projectServiceImpl.list(wrapper));
} }
/**
* 项目审核
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "项目审核", notes = "项目审核")
@PostMapping(value = "/processProject")
public ResponseModel<String> processProject(String sequenceNbr,@RequestBody JSONObject json){
String option = json.getString(XJConstant.PROCESS_PROJECT_STATE);
Project project = projectServiceImpl.getById(sequenceNbr);
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(project));
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"审核不通过");
if("1".equals(option)){
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"审核通过");
}
projectInitiationService.execute(project.getInstanceId(),jsonObject,option);
return ResponseHelper.buildResponse("ok");
}
/**
* 审核员项目审核
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "审核员项目审核", notes = "审核员项目审核")
@PostMapping(value = "/insProcess")
public ResponseModel<String> insProcess(String sequenceNbr,@RequestBody JSONObject json){
String option = json.getString(XJConstant.PROCESS_PROJECT_STATE);
Project project = projectServiceImpl.getById(sequenceNbr);
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(project));
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"符合");
if("0".equals(option)){
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"不符合且不需要整改");
projectInitiationService.execute(project.getInstanceId(),jsonObject,option);
projectInitiationService.execute(project.getInstanceId(),jsonObject,option);
}else if("2".equals(option)){
jsonObject.put(XJConstant.PROCESS_PROJECT_STATE,"不符合且需要重新提交资料");
}
projectInitiationService.execute(project.getInstanceId(),jsonObject,option);
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "POST", value = "添加附件", notes = "添加附件")
@PostMapping(value = "/saveOrUpdateFile")
public ResponseModel<String> saveOrUpdateFile(@RequestBody JSONObject jsonObject){
return ResponseHelper.buildResponse(projectServiceImpl.saveOrUpdateFile(jsonObject));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "通过sequenceNbr查询项目详情", notes = "通过sequenceNbr查询项目详情")
@GetMapping(value = "/getDetail")
public ResponseModel<ProjectDto> getDetail(Long sequenceNbr){
return ResponseHelper.buildResponse(projectServiceImpl.getDetail(sequenceNbr));
}
} }
package com.yeejoin.amos.boot.module.ugp.biz.controller; package com.yeejoin.amos.boot.module.ugp.biz.controller;
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;
...@@ -43,6 +46,8 @@ public class ProjectResourceController extends BaseController { ...@@ -43,6 +46,8 @@ public class ProjectResourceController extends BaseController {
@Autowired @Autowired
ProjectResourceMapper projectResourceMapper; ProjectResourceMapper projectResourceMapper;
@Autowired
MaterialServiceImpl materialServiceImpl;
/** /**
* 新增项目资源表(包括焊工、管材、设备) * 新增项目资源表(包括焊工、管材、设备)
...@@ -92,9 +97,9 @@ public class ProjectResourceController extends BaseController { ...@@ -92,9 +97,9 @@ public class ProjectResourceController extends BaseController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个项目资源表(包括焊工、管材、设备)", notes = "根据sequenceNbr查询单个项目资源表(包括焊工、管材、设备)") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询焊机设备)", notes = "根据sequenceNbr查询焊机设备")
public ResponseModel<ProjectResourceDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<WelderEquipmentDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(projectResourceServiceImpl.queryBySeq(sequenceNbr)); return ResponseHelper.buildResponse(projectResourceServiceImpl.customSelectById(sequenceNbr));
} }
/** /**
...@@ -149,6 +154,13 @@ public class ProjectResourceController extends BaseController { ...@@ -149,6 +154,13 @@ public class ProjectResourceController extends BaseController {
return ResponseHelper.buildResponse(projectResourceServiceImpl.installNoticeMsgList(page, name, type)); return ResponseHelper.buildResponse(projectResourceServiceImpl.installNoticeMsgList(page, name, type));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/selectByName")
@ApiOperation(httpMethod = "GET", value = "焊机设备分页查询", notes = "焊机设备分页查询")
public ResponseModel<WelderEquipmentDto> selectByName(Long sequenceNbr){
return ResponseHelper.buildResponse(projectResourceServiceImpl.selectByName(sequenceNbr));
}
/** /**
* 项目设备新增 * 项目设备新增
*/ */
...@@ -190,15 +202,30 @@ public class ProjectResourceController extends BaseController { ...@@ -190,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));
}
} }
...@@ -64,7 +64,7 @@ public class SuperviseRuleController extends BaseController { ...@@ -64,7 +64,7 @@ public class SuperviseRuleController extends BaseController {
// getMap(map,result); // getMap(map,result);
// //获取的Map中key是code,value是name // //获取的Map中key是code,value是name
// model.setAdminRegion(map.get(model.getAdminRegionCode())); // model.setAdminRegion(map.get(model.getAdminRegionCode()));
//外网调不到内网 暂时预留 // //外网调不到内网 暂时预留
// OrgUsr orgUsr = orgServiceImpl.getOrgUsr(); // OrgUsr orgUsr = orgServiceImpl.getOrgUsr();
// model.setSequenceNbr(orgUsr.getSequenceNbr()); // model.setSequenceNbr(orgUsr.getSequenceNbr());
model = superviseRuleServiceImpl.createWithModel(model); model = superviseRuleServiceImpl.createWithModel(model);
...@@ -139,7 +139,7 @@ public class SuperviseRuleController extends BaseController { ...@@ -139,7 +139,7 @@ public class SuperviseRuleController extends BaseController {
public ResponseModel<Page<SuperviseRuleDto>> queryForPage( public ResponseModel<Page<SuperviseRuleDto>> queryForPage(
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @RequestParam(value = "size") int size,
@RequestParam(value = "adminRegionCode", required = false) String adminRegionCode, @RequestParam(value = "adminRegionCode", required = false) Integer adminRegionCode,
@RequestParam(value = "superviseDeptId", required = false) Long superviseDeptId, @RequestParam(value = "superviseDeptId", required = false) Long superviseDeptId,
@RequestParam(value = "inspectionUnitId", required = false) Long inspectionUnitId @RequestParam(value = "inspectionUnitId", required = false) Long inspectionUnitId
) { ) {
...@@ -147,7 +147,7 @@ public class SuperviseRuleController extends BaseController { ...@@ -147,7 +147,7 @@ public class SuperviseRuleController extends BaseController {
Page<SuperviseRuleDto> page = new Page<SuperviseRuleDto>(); Page<SuperviseRuleDto> page = new Page<SuperviseRuleDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(superviseRuleServiceImpl.queryForSuperviseRulePage(page, superviseDeptId, inspectionUnitId)); return ResponseHelper.buildResponse(superviseRuleServiceImpl.queryForSuperviseRulePage(page, superviseDeptId, inspectionUnitId,adminRegionCode));
} }
/** /**
......
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;
/** /**
* 新增/修改焊工信息 * 新增/修改焊工信息
* *
...@@ -51,10 +64,10 @@ public class WelderController extends BaseController { ...@@ -51,10 +64,10 @@ public class WelderController extends BaseController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/saveWelder", method = RequestMethod.POST) @RequestMapping(value = "/saveWelder", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增焊工信息", notes = "新增焊工信息") @ApiOperation(httpMethod = "POST", value = "新增人员信息", notes = "新增人员信息")
public ResponseModel<OrgUsrDto> saveWelder(@RequestBody JSONObject jsonObject, @RequestParam String bizOrgType , public ResponseModel<OrgUsrDto> saveWelder(@RequestBody JSONObject jsonObject, @RequestParam String bizOrgType ,
@RequestParam(required = false) String sequenceNbr) { @RequestParam(required = false) String sequenceNbr) {
return ResponseHelper.buildResponse(orgServiceImpl.dataHandling(jsonObject,bizOrgType,sequenceNbr)); return ResponseHelper.buildResponse(welderServiceImpl.savePerson(jsonObject,bizOrgType,sequenceNbr));
} }
/** /**
...@@ -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 每页大小
...@@ -112,28 +135,29 @@ public class WelderController extends BaseController { ...@@ -112,28 +135,29 @@ public class WelderController extends BaseController {
} }
/** /**
* 根据sequenceNbr查询焊工信息 * 根据sequenceNbr查询人员信息
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询项目焊工信息表", notes = "根据sequenceNbr查询项目焊工信息表") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询人员信息", notes = "根据sequenceNbr查询人员信息")
public ResponseModel<Map> selectOneById(@PathVariable String sequenceNbr) { public ResponseModel<Map> selectOneById(@PathVariable String sequenceNbr) {
return ResponseHelper.buildResponse(orgServiceImpl.getdetialInfo(sequenceNbr)); return ResponseHelper.buildResponse(orgServiceImpl.getdetialInfo(sequenceNbr));
} }
/** /**
* 根据sequenceNbr删除焊工信息 * 根据sequenceNbr删除人员信息表
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr删除项目焊工信息表", notes = "根据sequenceNbr删除项目焊工信息表") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr删除人员信息表", notes = "根据sequenceNbr删除人员信息表")
public void deleteOneById(@PathVariable String sequenceNbr) throws Exception { public void deleteOneById(@PathVariable String sequenceNbr) throws Exception {
orgServiceImpl.delectInfo(sequenceNbr); orgServiceImpl.delectInfo(sequenceNbr);
} }
} }
...@@ -5,26 +5,36 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,26 +5,36 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper; import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.ugp.api.Enum.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company; import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.ICompanyService; import com.yeejoin.amos.boot.module.ugp.api.service.ICompanyService;
import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto; import com.yeejoin.amos.boot.module.ugp.api.dto.CompanyDto;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import org.apache.lucene.queryparser.flexible.messages.Message; import org.apache.lucene.queryparser.flexible.messages.Message;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
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.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 javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -41,6 +51,12 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company ...@@ -41,6 +51,12 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
@Autowired @Autowired
ICompanyService iCompanyService; ICompanyService iCompanyService;
@Value("${amos.secret.key}")
String secretKey;
@Autowired
OrgServiceImpl orgServiceImpl;
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
...@@ -68,21 +84,74 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company ...@@ -68,21 +84,74 @@ public class CompanyServiceImpl extends BaseService<CompanyDto, Company, Company
/**
* 企业注册:3、账号信息提交
* @param object
* @return
*/
//
// public String saveInfo(Object object){
// JSONObject obj = JSONObject.parseObject(JSON.toJSONString(object));
// String name = obj.getString("name");
// String creditCode = obj.getString("creditCode");
// String createTime = obj.getString("createTime");
// String unitTel =
//
// return null;
// }
public Boolean companyCheck(CompanyDto model, Long sequenceNbr, String bizOrgType) throws Exception{
Set<String> roleNameSet = new HashSet<>();
List<RoleModel> userRoleList = new ArrayList<>();
List<Long> roleIds = new ArrayList<>();
Map<Long, List<Long>> roleSeqsMap = new HashMap<>();
Map<Long,List<RoleModel>> orgRoles = new HashMap<>();
Company company = this.getById(sequenceNbr);
company.setApproved(model.getApproved());
if (company.getApproved().equals("已审核")){
final CompanyModel companyModel = new CompanyModel();
AgencyUserModel agencyUserModel = new AgencyUserModel();
//创建平台企业
companyModel.setCompanyName(company.getName());
companyModel.setCompanyCode(company.getCreditCode());
companyModel.setAddress(company.getAddress());
companyModel.setParentId(0L);
companyModel.setLevel("headquarter");
companyModel.setAgencyCode("ugp");
CompanyModel companyModelFeignClient = Privilege.companyClient.create(companyModel).getResult();
//创建平台用户
//设置用户角色
List<RoleModel> allRoleList = Privilege.roleClient.queryRoleList(null,null).getResult();
String[] unitTypeCodes = company.getType().split(",");
for(String code : unitTypeCodes) {
roleNameSet.add(OrgEnum.map.get(code));
}
userRoleList = allRoleList.stream().filter(r -> r.getRoleName().equals(roleNameSet)).collect(Collectors.toList());
userRoleList.stream().forEach(r -> {
roleIds.add(r.getSequenceNbr());
});
roleSeqsMap.put(companyModelFeignClient.getSequenceNbr(),roleIds);
orgRoles.put(companyModelFeignClient.getSequenceNbr(),userRoleList);
agencyUserModel.setOrgRoleSeqs(roleSeqsMap);
agencyUserModel.setOrgRoles(orgRoles);
//设置用户信息
String adminName = company.getAdminName();
String adminLoginName = company.getAdminLoginName();
String adminPhone = company.getAdminTel();
String adminPassword = company.getAdminLoginPwd();
agencyUserModel.setRealName(adminName);
agencyUserModel.setAgencyCode("ugp");
agencyUserModel.setLockStatus("UNLOCK");
agencyUserModel.setMobile(adminPhone);
agencyUserModel.setCreateTime(new Date());
agencyUserModel.setUserName(adminLoginName);
agencyUserModel.setPassword(DesUtil.encode(adminPassword, secretKey));
agencyUserModel.setRePassword(DesUtil.encode(adminPassword, secretKey));
Privilege.agencyUserClient.create(agencyUserModel);
//企业动态表单存储
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(company));
jsonObject.put("amosOrgId",companyModelFeignClient.getSequenceNbr());
jsonObject.put("amosOrgCode",companyModelFeignClient.getOrgCode());
orgServiceImpl.dataHandling(jsonObject,bizOrgType,null);
//企业管理员人员 动态表单存储
jsonObject = null;
jsonObject.put("name",adminName);
jsonObject.put("phone",adminPhone);
jsonObject.put("amosOrgId",agencyUserModel.getSequenceNbr());
orgServiceImpl.dataHandling(jsonObject, OrgEnum.企业管理员.getKey(),null);
}
return this.updateById(company);
}
} }
\ 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.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.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;
/** /**
...@@ -27,6 +37,8 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -27,6 +37,8 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
@Autowired @Autowired
InstallNoticeMapper installNoticeMapper; InstallNoticeMapper installNoticeMapper;
@Autowired
ProjectServiceImpl projectServiceImpl;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -45,7 +57,18 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -45,7 +57,18 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
* 安装告知申请分页查询 * 安装告知申请分页查询
*/ */
public Page<InstallNoticePageDto> installNoticePage(Page<InstallNoticePageDto> page,String name,String constructionUnit) { public Page<InstallNoticePageDto> installNoticePage(Page<InstallNoticePageDto> page,String name,String constructionUnit) {
return installNoticeMapper.installNoticePage(page,name,constructionUnit); Page<InstallNoticePageDto> installNoticePage = installNoticeMapper.installNoticePage(page,name,constructionUnit);
List<InstallNoticePageDto> installNoticePageDtos = installNoticePage.getRecords();
for(InstallNoticePageDto installNoticePageDto:installNoticePageDtos){
if(!ValidationUtil.isEmpty(installNoticePageDto.getApproved())){
if(installNoticePageDto.getApproved()){
installNoticePageDto.setApprovedName("通过");
}else{
installNoticePageDto.setApprovedName("不通过");
}
}
}
return installNoticePage;
} }
/** /**
...@@ -56,4 +79,47 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta ...@@ -56,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
...@@ -18,8 +18,10 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnSer ...@@ -18,8 +18,10 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnSer
import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormInstanceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormInstanceServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -129,16 +131,19 @@ public class OrgServiceImpl { ...@@ -129,16 +131,19 @@ public class OrgServiceImpl {
orgUsr.setOrgExpandAttr1(jsonObject.getString("type")); orgUsr.setOrgExpandAttr1(jsonObject.getString("type"));
orgUsr.setBizOrgCode(jsonObject.getString("creditCode")); orgUsr.setBizOrgCode(jsonObject.getString("creditCode"));
} }
if (OrgEnum.人员.getKey().equals(bizOrgType)){ if (OrgEnum.普通人员.getKey().equals(bizOrgType)){
if (1==jsonObject.getInteger("isWelder")) { if (1==jsonObject.getInteger("isWelder")) {
orgUsr.setOrgExpandAttr1(OrgEnum.焊工.getKey()); orgUsr.setOrgExpandAttr1(OrgEnum.焊工.getKey());
orgUsr.setCode(getCode());
} }
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(reginParams.getCompany().getSequenceNbr())); wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(reginParams.getCompany().getSequenceNbr()));
orgUsr.setParentId(String.valueOf(orgUsrServiceImpl.getOne(wrapper).getSequenceNbr())); orgUsr.setParentId(String.valueOf(orgUsrServiceImpl.getOne(wrapper).getSequenceNbr()));
} }
if (OrgEnum.部门.getKey().equals(bizOrgType)) { if (OrgEnum.部门.getKey().equals(bizOrgType)) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(reginParams.getCompany().getSequenceNbr()));
orgUsr.setParentId(String.valueOf(orgUsrServiceImpl.getOne(wrapper).getSequenceNbr()));
} }
//设置bizOrgCode //设置bizOrgCode
if (orgUsr.getParentId() != null) { if (orgUsr.getParentId() != null) {
...@@ -154,6 +159,21 @@ public class OrgServiceImpl { ...@@ -154,6 +159,21 @@ public class OrgServiceImpl {
return orgUsr; return orgUsr;
} }
public String getCode(){
int c;
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(OrgUsr::getCode).eq(OrgUsr::getOrgExpandAttr1,OrgEnum.焊工.getKey());
String code = orgUsrServiceImpl.list(wrapper).iterator().next().getCode();
if(ValidationUtil.isEmpty(code)){
c = 0001;
}else{
c = Integer.parseInt(code)+1;
}
String welderCode = OrgEnum.焊工.getKey() +"-"+ c;
return welderCode;
}
/** /**
* 用户单位信息redis获取 * 用户单位信息redis获取
**/ **/
...@@ -240,7 +260,7 @@ public class OrgServiceImpl { ...@@ -240,7 +260,7 @@ public class OrgServiceImpl {
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr())); wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr()));
LambdaQueryWrapper<OrgUsr> personWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgUsr> personWrapper = new LambdaQueryWrapper<>();
personWrapper.eq(OrgUsr::getParentId,orgUsrServiceImpl.getOne(wrapper).getSequenceNbr()) personWrapper.eq(OrgUsr::getParentId,orgUsrServiceImpl.getOne(wrapper).getSequenceNbr())
.eq(OrgUsr :: getBizOrgType,OrgEnum.人员.getKey()); .eq(OrgUsr :: getBizOrgType,OrgEnum.普通人员.getKey());
return orgUsrServiceImpl.list(personWrapper); return orgUsrServiceImpl.list(personWrapper);
} }
...@@ -286,7 +306,7 @@ public class OrgServiceImpl { ...@@ -286,7 +306,7 @@ public class OrgServiceImpl {
OrgUsr orgUsr = getOrgUsrById(sequenceNbr); OrgUsr orgUsr = getOrgUsrById(sequenceNbr);
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.like(OrgUsr :: getBizOrgCode,orgUsr.getBizOrgCode()) wrapper.like(OrgUsr :: getBizOrgCode,orgUsr.getBizOrgCode())
.eq(OrgUsr::getBizOrgType,OrgEnum.人员.getKey()) .eq(OrgUsr::getBizOrgType,OrgEnum.普通人员.getKey())
.ne(OrgUsr::getOrgExpandAttr1,OrgEnum.焊工.getKey()); .ne(OrgUsr::getOrgExpandAttr1,OrgEnum.焊工.getKey());
List<OrgUsr> orgUsrList = orgUsrServiceImpl.list(wrapper); List<OrgUsr> orgUsrList = orgUsrServiceImpl.list(wrapper);
return orgUsrList; return orgUsrList;
...@@ -300,7 +320,7 @@ public class OrgServiceImpl { ...@@ -300,7 +320,7 @@ public class OrgServiceImpl {
public void delectInfo(String sequencenNbr) throws Exception { public void delectInfo(String sequencenNbr) throws Exception {
OrgUsr orgUsr = getOrgUsrById(sequencenNbr); OrgUsr orgUsr = getOrgUsrById(sequencenNbr);
LambdaQueryWrapper<DynamicFormInstance> dynamicWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DynamicFormInstance> dynamicWrapper = new LambdaQueryWrapper<>();
if(OrgEnum.人员.getKey().equals(orgUsr.getBizOrgType())){ if(OrgEnum.普通人员.getKey().equals(orgUsr.getBizOrgType())){
dynamicWrapper.eq(DynamicFormInstance::getInstanceId,sequencenNbr); dynamicWrapper.eq(DynamicFormInstance::getInstanceId,sequencenNbr);
alertFormValueServiceImpl.remove(dynamicWrapper); alertFormValueServiceImpl.remove(dynamicWrapper);
}else{ }else{
...@@ -314,7 +334,34 @@ public class OrgServiceImpl { ...@@ -314,7 +334,34 @@ public class OrgServiceImpl {
throw new Exception("该企业/部门下还有人员,不可删除!"); throw new Exception("该企业/部门下还有人员,不可删除!");
} }
} }
}
/**
* 获取企业下的人员信息列表
* @param companyId 单位/企业id
* @return
*/
public IPage getPersonInfo(String companyId,IPage page){
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getSequenceNbr ,companyId);
OrgUsr orgUsrCompany = orgUsrServiceImpl.getOne(wrapper);
LambdaQueryWrapper<OrgUsr> welderWrapper = new LambdaQueryWrapper<>();
welderWrapper.likeRight(OrgUsr :: getBizOrgCode,orgUsrCompany.getBizOrgCode()).eq(OrgUsr :: getBizOrgType, OrgEnum.普通人员.getKey());
List<OrgUsr> orgUsrList = new ArrayList<>();
if(ValidationUtil.isEmpty(page)){
orgUsrList = orgUsrServiceImpl.list(welderWrapper);
page = new Page();
}else{
orgUsrList = orgUsrServiceImpl.page(page,welderWrapper).getRecords();
}
List<Map> mapList = new ArrayList<>();
for (OrgUsr orgUsr : orgUsrList) {
Map map = getdetialInfo(String.valueOf(orgUsr.getSequenceNbr()));
mapList.add(map);
}
page.setRecords(mapList);
return page;
} }
} }
...@@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSON; ...@@ -4,13 +4,16 @@ 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.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProblemProcessEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.ProblemProcessEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.SMSEnum;
import com.yeejoin.amos.boot.module.ugp.api.entity.*; import com.yeejoin.amos.boot.module.ugp.api.entity.*;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel; import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel;
import com.yeejoin.amos.feign.workflow.Workflow; import com.yeejoin.amos.feign.workflow.Workflow;
...@@ -54,11 +57,15 @@ public class ProblemInitiationServiceImpl { ...@@ -54,11 +57,15 @@ public class ProblemInitiationServiceImpl {
@Autowired @Autowired
QualityProblemServiceImpl qualityProblemService; QualityProblemServiceImpl qualityProblemService;
private static String SMSCODE = "SMS_UGP_0003";
@Value("${params.work.flow.problemDefinitionKey}") @Value("${params.work.flow.problemDefinitionKey}")
private String problemDefinitionKey; private String problemDefinitionKey;
@Value("supervisionRoleId")
private String supervisionRoleId;
@Value("installationRoleId")
private String installationRoleId;
public String start(QualityProblem qualityProblem) { public String start(QualityProblem qualityProblem) {
String instanceId = null; String instanceId = null;
...@@ -80,6 +87,7 @@ public class ProblemInitiationServiceImpl { ...@@ -80,6 +87,7 @@ public class ProblemInitiationServiceImpl {
qualityProblem.setInstanceId(instanceId); qualityProblem.setInstanceId(instanceId);
qualityProblem.setStatus(projectInitiationService.getFlowTaskName(instanceId)); qualityProblem.setStatus(projectInitiationService.getFlowTaskName(instanceId));
qualityProblemService.updateById(qualityProblem); qualityProblemService.updateById(qualityProblem);
sendSms(JSONObject.parseObject(JSONObject.toJSONString(qualityProblem)), SMSEnum.质量问题短信.getCode());
return instanceId; return instanceId;
} }
...@@ -96,7 +104,19 @@ public class ProblemInitiationServiceImpl { ...@@ -96,7 +104,19 @@ public class ProblemInitiationServiceImpl {
if (ProblemProcessEnum.重大问题发送短信.getName().equals(dataObject.getString("name"))) { if (ProblemProcessEnum.重大问题发送短信.getName().equals(dataObject.getString("name"))) {
if(!ValidationUtil.isEmpty(objectd)) { if(!ValidationUtil.isEmpty(objectd)) {
// sendSms(object); sendSms(object, SMSEnum.重大质量问题短信.getCode());
}
}
if (ProblemProcessEnum.超期整改发送短信.getName().equals(dataObject.getString("name"))) {
if(!ValidationUtil.isEmpty(objectd)) {
sendSms(object, SMSEnum.超期整改短信.getCode());
}
}
if (ProblemProcessEnum.重大问题整改完成发送短信.getName().equals(dataObject.getString("name"))) {
if(!ValidationUtil.isEmpty(objectd)) {
sendSms(object, SMSEnum.重大质量问题短信.getCode());
} }
} }
...@@ -126,35 +146,77 @@ public class ProblemInitiationServiceImpl { ...@@ -126,35 +146,77 @@ public class ProblemInitiationServiceImpl {
} }
public void sendSms(JSONObject object,String smsCode){ public void sendSms(JSONObject object, String smsCode){
Long sequenceNbr = object.getLong("sequenceNbr");
if(SMSEnum.项目安装告知申请.getCode().equals(smsCode)){
//设置短信发送的基本参数 //设置短信发送的基本参数
HashMap<String, String> smsParams = new HashMap(); HashMap<String, String> smsParams = new HashMap();
smsParams.put("smsCode", smsCode); smsParams.put("smsCode", smsCode);
smsParams.put("companyName", object.getString("installationUnit")); smsParams.put("projectName", object.getString("projectName"));
smsParams.put("projectName", object.getString("name")); smsParams.put("problemDesc", object.getString("problemDesc"));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id查找到该部门下的用户List。 //条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id拿到平台的监察部门id
QueryWrapper<SuperviseRule> wrapper = new QueryWrapper<>(); LambdaQueryWrapper<SuperviseRule> wrapper = new LambdaQueryWrapper<>();
wrapper.eq("admin_region_code", projectServiceImpl.getById(object.getLong("projectId")).getInstallRegionCode()); wrapper.eq(SuperviseRule::getAdminRegionCode, projectServiceImpl.getById(object.getLong("projectId")).getInstallRegionCode());
String noticeUnitId = orgUsrServiceImpl.getById(superviseRuleServiceImpl.getOne(wrapper).getSuperviseDeptId()).getAmosOrgId(); String noticeUnitId = orgUsrServiceImpl.getById(superviseRuleServiceImpl.getOne(wrapper).getSuperviseDeptId()).getAmosOrgId();
List<AgencyUserModel> agencyUserModelList = Privilege.agencyUserClient.queryByDepartmentId(Long.valueOf(noticeUnitId), null, null, null).getResult(); sendMessage(sequenceNbr,noticeUnitId,smsParams,smsCode,supervisionRoleId);
}else if(SMSEnum.项目立项驳回短信.getCode().equals(smsCode)) {
//设置短信发送的基本参数
HashMap<String, String> smsParams = new HashMap();
smsParams.put("smsCode", smsCode);
smsParams.put("projectName", object.getString("projectName"));
smsParams.put("reviewInfo", object.getString("reviewInfo"));
//给监察发短信
LambdaQueryWrapper<SuperviseRule> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SuperviseRule::getAdminRegionCode, projectServiceImpl.getById(object.getLong("projectId")).getInstallRegionCode());
String supervisionUnitId = orgUsrServiceImpl.getById(superviseRuleServiceImpl.getOne(wrapper).getSuperviseDeptId()).getAmosOrgId();
sendMessage(sequenceNbr,supervisionUnitId,smsParams,smsCode,supervisionRoleId);
//给安装发短信
String installationUnitId = orgUsrServiceImpl.getById(projectServiceImpl.getById(object.getLong("projectId")).getInstallationUnitId()).getAmosOrgId();
sendMessage(sequenceNbr,installationUnitId,smsParams,smsCode,installationRoleId);
}
}
/**
* 发送短信
* @param sequenceNbr 任务id(项目/问题)
* @param noticeUnitId 平台目标企业id
* @param smsParams 短信参数
* @param smsCode 短信模板
* @param roleId 角色id
*/
public void sendMessage(Long sequenceNbr,String noticeUnitId,HashMap<String, String> smsParams,String smsCode,String roleId){
//向noticeUnitId的部门发送短信
List<AgencyUserModel> agencyUserModelList = Privilege.agencyUserClient.queryByRoleId(roleId,null).getResult();
//遍历用户List,拿到用户手机号、userId,来发短信、存短信日志。 //遍历用户List,拿到用户手机号、userId,来发短信、存短信日志。
for (AgencyUserModel agencyUserModel : agencyUserModelList) { for (AgencyUserModel agencyUserModel : agencyUserModelList) {
boolean bool = false;
List<CompanyModel> companyModelList = agencyUserModel.getCompanys();
for (CompanyModel companyModel : companyModelList) {
bool = companyModel.getSequenceNbr().equals(noticeUnitId);
if(bool){
break;
}
}
if (bool) {
LambdaQueryWrapper<OrgUsr> wrapperQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgUsr> wrapperQueryWrapper = new LambdaQueryWrapper<>();
wrapperQueryWrapper.eq(OrgUsr::getAmosOrgCode,agencyUserModel.getUserId()); wrapperQueryWrapper.eq(OrgUsr::getAmosOrgId,agencyUserModel.getSequenceNbr());
SmsRecordModel smsRecordModel = sendSmsMassage(SMSCODE, agencyUserModel.getMobile(), smsParams); SmsRecordModel smsRecordModel = sendSmsMassage(smsCode, agencyUserModel.getMobile(), smsParams);
RectifyMsg rectifyMsg = new RectifyMsg(); RectifyMsg rectifyMsg = new RectifyMsg();
if (ValidationUtil.isEmpty(smsRecordModel)) { if (ValidationUtil.isEmpty(smsRecordModel)) {
continue; continue;
} }
rectifyMsg.setContent(smsRecordModel.getSmsContent()); rectifyMsg.setContent(smsRecordModel.getSmsContent());
rectifyMsg.setProblemId(object.getLong("sequenceNbr")); rectifyMsg.setProblemId(sequenceNbr);
rectifyMsg.setNoticeUnitId(Long.valueOf(noticeUnitId)); rectifyMsg.setNoticeUnitId(Long.valueOf(noticeUnitId));
rectifyMsg.setMsgReceiver(orgUsrServiceImpl.getOne(wrapperQueryWrapper).getSequenceNbr()); rectifyMsg.setMsgReceiver(orgUsrServiceImpl.getOne(wrapperQueryWrapper).getSequenceNbr());
rectifyMsg.setSendTime(smsRecordModel.getSendTime()); rectifyMsg.setSendTime(smsRecordModel.getSendTime());
rectifyMsgServiceImpl.save(rectifyMsg); rectifyMsgServiceImpl.save(rectifyMsg);
} }
} }
}
public SmsRecordModel sendSmsMassage(String smsCode, String mobile, HashMap<String, String> smsParams){ public SmsRecordModel sendSmsMassage(String smsCode, String mobile, HashMap<String, String> smsParams){
SmsRecordModel smsRecordModel = new SmsRecordModel(); SmsRecordModel smsRecordModel = new SmsRecordModel();
...@@ -167,6 +229,7 @@ public class ProblemInitiationServiceImpl { ...@@ -167,6 +229,7 @@ public class ProblemInitiationServiceImpl {
return smsRecordModel; return smsRecordModel;
} }
public void updateProBlemFlowStatus(String instanceId){ public void updateProBlemFlowStatus(String instanceId){
LambdaQueryWrapper<QualityProblem> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<QualityProblem> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(QualityProblem::getInstanceId,instanceId); wrapper.eq(QualityProblem::getInstanceId,instanceId);
......
...@@ -80,6 +80,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD ...@@ -80,6 +80,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Autowired @Autowired
RectifyMsgServiceImpl rectifyMsgServiceImpl; RectifyMsgServiceImpl rectifyMsgServiceImpl;
@Autowired
ProblemInitiationServiceImpl problemInitiationService;
private final Logger logger = LoggerFactory.getLogger(ProjectInitiationServiceImpl.class); private final Logger logger = LoggerFactory.getLogger(ProjectInitiationServiceImpl.class);
@Value("${params.work.flow.processDefinitionKey}") @Value("${params.work.flow.processDefinitionKey}")
...@@ -140,22 +143,23 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD ...@@ -140,22 +143,23 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
} }
if(ProjectInitiationEnum.接受审查意见.getName().equals(dataObject.getString("name"))){ if(ProjectInitiationEnum.接受审查意见.getName().equals(dataObject.getString("name"))){
projectInitiation.setTaskName(dataObject.getString("name")+"(流程结束!)"); projectInitiation.setTaskName(dataObject.getString("name")+"(流程结束!)");
if(!ValidationUtil.isEmpty(objectd)) {
problemInitiationService.sendSms(object, SMSEnum.项目立项驳回短信.getCode());
}
} }
if (ProjectInitiationEnum.告知申请.getName().equals(dataObject.getString("name"))) { if (ProjectInitiationEnum.告知申请.getName().equals(dataObject.getString("name"))) {
if(!ValidationUtil.isEmpty(objectd)) { if(!ValidationUtil.isEmpty(objectd)) {
sendSms(object, SMSEnum.项目安装告知申请.getCode()); problemInitiationService.sendSms(object, SMSEnum.项目安装告知申请.getCode());
} }
} }
if ("监检科室分配".equals(dataObject.getString("name"))) {
if (ProjectInitiationEnum.项目关闭.getName().equals(dataObject.getString("name"))) {
if(!ValidationUtil.isEmpty(objectd)) {
problemInitiationService.sendSms(object, SMSEnum.项目立项驳回短信.getCode());
} }
if ("监检员分配".equals(dataObject.getString("name"))) {
} }
if ("监检员审核".equals(dataObject.getString("name"))) {
}
try { try {
//组装信息 //组装信息
...@@ -179,18 +183,6 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD ...@@ -179,18 +183,6 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
} }
} }
@Transactional(rollbackFor = Exception.class)
public SmsRecordModel sendSmsMassage(String smsCode, String mobile, HashMap<String, String> smsParams){
SmsRecordModel smsRecordModel = new SmsRecordModel();
if(!ValidationUtil.isEmpty(mobile)){
smsParams.put("smsCode",smsCode);
smsParams.put("mobile",mobile);
smsRecordModel = Systemctl.smsClient.sendCommonSms(smsParams).getResult();
}
return smsRecordModel;
}
/** /**
* 获取流程当前任务名称 * 获取流程当前任务名称
* @param instanceId * @param instanceId
...@@ -209,37 +201,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD ...@@ -209,37 +201,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Project::getInstanceId,instanceId); wrapper.eq(Project::getInstanceId,instanceId);
Project project = projectService.getOne(wrapper); Project project = projectService.getOne(wrapper);
project.setStatus(getFlowTaskName(instanceId)); project.setStatus(ProjectInitiationEnum.getCodeByNameMap.get(getFlowTaskName(instanceId)));
projectService.updateById(project); projectService.updateById(project);
} }
public void sendSms(JSONObject object,String smsCode){
//设置短信发送的基本参数
HashMap<String, String> smsParams = new HashMap();
smsParams.put("smsCode", smsCode);
smsParams.put("companyName", object.getString("installationUnit"));
smsParams.put("projectName", object.getString("name"));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id查找到该部门下的用户List。
QueryWrapper<SuperviseRule> wrapper = new QueryWrapper<>();
wrapper.eq("admin_region_code", projectServiceImpl.getById(object.getLong("projectId")).getInstallRegionCode());
String noticeUnitId = orgUsrServiceImpl.getById(superviseRuleServiceImpl.getOne(wrapper).getSuperviseDeptId()).getAmosOrgId();
List<AgencyUserModel> agencyUserModelList = Privilege.agencyUserClient.queryByDepartmentId(Long.valueOf(noticeUnitId), null, null, null).getResult();
//遍历用户List,拿到用户手机号、userId,来发短信、存短信日志。
for (AgencyUserModel agencyUserModel : agencyUserModelList) {
LambdaQueryWrapper<OrgUsr> wrapperQueryWrapper = new LambdaQueryWrapper<>();
wrapperQueryWrapper.eq(OrgUsr::getAmosOrgCode,agencyUserModel.getUserId());
SmsRecordModel smsRecordModel = sendSmsMassage(smsCode, agencyUserModel.getMobile(), smsParams);
RectifyMsg rectifyMsg = new RectifyMsg();
if (ValidationUtil.isEmpty(smsRecordModel)) {
continue;
}
rectifyMsg.setContent(smsRecordModel.getSmsContent());
rectifyMsg.setProblemId(object.getLong("sequenceNbr"));
rectifyMsg.setNoticeUnitId(Long.valueOf(noticeUnitId));
rectifyMsg.setMsgReceiver(orgUsrServiceImpl.getOne(wrapperQueryWrapper).getSequenceNbr());
rectifyMsg.setSendTime(smsRecordModel.getSendTime());
rectifyMsgServiceImpl.save(rectifyMsg);
}
}
} }
...@@ -62,8 +62,8 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P ...@@ -62,8 +62,8 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
} }
@Override @Override
public Page<WelderEquipmentDto> selectByName(Page<WelderEquipmentDto> page, String name, String unit) { public WelderEquipmentDto selectByName(Long sequenceNbr) {
return null; return this.projectResourceMapper.customSelectById(sequenceNbr);
} }
@Override @Override
......
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.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.MaterialDto; import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto; import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment;
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.entity.ProjectInitiation;
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.service.IProjectService; import com.yeejoin.amos.boot.module.ugp.api.service.IProjectService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
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.typroject.tyboot.core.restful.utils.ResponseHelper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -25,11 +35,45 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -25,11 +35,45 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
@Autowired @Autowired
ProjectMapper projectMapper; ProjectMapper projectMapper;
@Autowired
AttachmentServiceImpl attachmentService;
@Autowired
ProjectInitiationServiceImpl projectInitiationService;
@Autowired
EquipmentServiceImpl equipmentService;
/** /**
* 分页查询 * 分页查询
*/ */
public Page<ProjectDto> queryForProjectPage(Page<ProjectDto> page ,String name,String constructionUnit) { public Page<ProjectDto> queryForProjectPage(Page<ProjectDto> page ,String name,String constructionUnit) {
return this.queryForPage(page, null, false,name,constructionUnit); Page<ProjectDto> projectDtoPage = this.queryForPage(page, null, false,name,constructionUnit);
List<ProjectDto> projects = projectDtoPage.getRecords();
for(ProjectDto project:projects){
getProjectState(project);
}
return projectDtoPage;
}
private void getProjectState(ProjectDto project) {
String state = "",insDep = "",insPerson = "";
LambdaQueryWrapper<ProjectInitiation> lambdaQueryWrap = new LambdaQueryWrapper<>();
lambdaQueryWrap.eq(ProjectInitiation::getInstanceId,project.getInstanceId())
.orderByDesc(ProjectInitiation::getSequenceNbr);
List<ProjectInitiation> projectInitiationList = projectInitiationService.list(lambdaQueryWrap);
if(!ValidationUtil.isEmpty(projectInitiationList)){
ProjectInitiation projectInitiation = projectInitiationList.iterator().next();
JSONObject jsonObject = JSON.parseObject(projectInitiation.getContext());
state = jsonObject.getString(XJConstant.PROCESS_PROJECT_STATE);
insDep = jsonObject.getString(XJConstant.INS_DEP);
insPerson = jsonObject.getString(XJConstant.INS_PRESON);
}
project.setExamineProjectState(state);
project.setInsDep(insDep);
project.setInsPerson(insPerson);
} }
...@@ -64,8 +108,61 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -64,8 +108,61 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
* @return * @return
*/ */
public List<Project> selectByidList(List<Long> ids){ public List<Project> selectByidList(List<Long> ids){
return projectMapper.selectBatchIds(ids); return projectMapper.selectBatchIds(ids);
}
public ProjectDto getDetail(Long sequenceNbr){
ProjectDto project = projectMapper.getDetail(sequenceNbr);
LambdaQueryWrapper<Attachment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Attachment::getSourceId,sequenceNbr);
try{
JSONArray jsonArray = JSON.parseArray(attachmentService.getOne(wrapper).getInfo());
project.setSubForm(jsonArray);
}catch (Exception e) {
System.out.println("该项目暂无附件");
}
project.getInstanceId();
getProjectState(project);
return project;
}
public String saveOrUpdateFile(JSONObject jsonObject){
JSONArray subForm = jsonObject.getJSONArray("subForm");
Long sequenceNbr = jsonObject.getLong("sequenceNbr");
LambdaQueryWrapper<Attachment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Attachment::getSourceId,sequenceNbr);
Attachment attachment = attachmentService.getOne(wrapper);
if(ValidationUtil.isEmpty(attachment)){
equipmentService.saveAttachment(subForm,sequenceNbr);
}else {
attachment.setInfo(JSON.toJSONString(subForm));
attachmentService.updateById(attachment);
}
Project project = this.getById(sequenceNbr);
ProjectDto projectDto = new ProjectDto();
BeanUtils.copyProperties(project,projectDto);
projectDto.setInsDep(jsonObject.getString("insDep"));
projectDto.setInsDep(jsonObject.getString("insPerson"));
projectDto.setProcessProjectState(jsonObject.getString("processProjectState"));
boolean design=false,install=false;
for(Object object:subForm){
JSONObject jo = JSON.parseObject(JSON.toJSONString(object));
String type = jo.getString("type");
if (OrgEnum.设计单位.getKey().equals(type)){
design=true;
}
if (OrgEnum.安装单位.getKey().equals(type)){
design=true;
}
}
if(design && install){
projectInitiationService.execute(project.getInstanceId(),projectDto,"1");
}
this.updateById(project);
return "ok";
} }
} }
\ No newline at end of file
...@@ -20,8 +20,11 @@ public class SuperviseRuleServiceImpl extends BaseService<SuperviseRuleDto,Super ...@@ -20,8 +20,11 @@ public class SuperviseRuleServiceImpl extends BaseService<SuperviseRuleDto,Super
/** /**
* 分页查询 * 分页查询
*/ */
public Page<SuperviseRuleDto> queryForSuperviseRulePage(Page<SuperviseRuleDto> page, Long superviseDeptId, Long inspectionUnitId) { public Page<SuperviseRuleDto> queryForSuperviseRulePage(Page<SuperviseRuleDto> page, Long superviseDeptId, Long inspectionUnitId,Integer adminRegionCode) {
return this.queryForPage(page, null, false, superviseDeptId, inspectionUnitId ); if(610000 == adminRegionCode){
return this.queryForPage(page, null, false, superviseDeptId, inspectionUnitId);
}
return this.queryForPage(page, null, false, superviseDeptId, inspectionUnitId,adminRegionCode );
} }
/** /**
......
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;
import com.yeejoin.amos.boot.module.ugp.api.Enum.VerifyTypeEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WeldCodeEnum; 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.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.entity.QualityProblem; import com.yeejoin.amos.boot.module.ugp.api.entity.QualityProblem;
...@@ -17,9 +20,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -17,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;
/** /**
* 智能监检管理表服务实现类 * 智能监检管理表服务实现类
...@@ -47,7 +48,6 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -47,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);
} }
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
...@@ -61,20 +61,19 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -61,20 +61,19 @@ 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());//项目名称
...@@ -85,303 +84,362 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -85,303 +84,362 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
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);
page.setTotal(list.size());
return page;
} }
Verify verify = new Verify( );
//获取公共属性信息
Long projectId = dto.getProjectId( );//项目id
String code = dto.getCode( );//焊口编号
String peopleLocation = dto.getPeopleLocation( );//焊接定位信息
String stage = dto.getStage( ); //阶段检验
//获取当前校验时间
Date time = new Date( );
/**
* 查询焊接人员检验信息列表
* @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<>( ); if (stage.equals(StageEnum.焊前人员.getVerifyName())&&dto.getPeoplePhoto() !=null && !dto.getPeoplePhoto().equals("")) {
for (IntelligentInspectionDto intelligentInspectionDto : commonality) {
WorkerDto workerDto = new WorkerDto( );
BeanUtils.copyProperties(intelligentInspectionDto,workerDto);
workerList.add(workerDto);
}
page.setRecords(workerList);
page.setTotal(workerList.size());
return page;
}
//获取焊接人员校验信息
String peoplePhoto = dto.getPeoplePhoto( ); //人脸识别图片信息
String userId = dto.getUserId( );//人员id
HashMap<String, String> map = new HashMap<>( );
map.put("peoplePhoto",peoplePhoto);
map.put("code",code);
map.put("peopleLocation",peopleLocation);
map.put("userId",userId);
String targetInfo= JSON.toJSONString(map, SerializerFeature.WriteMapNullValue); //焊口编号 人脸识别图片信息 焊接定位信息 人员id
verify.setSequenceNbr(new Date().getTime());
verify.setProjectId(projectId);
verify.setStage(StageEnum.焊前人员.getStage()); //阶段
verify.setType(TYPE);
verify.setTargetInfo(targetInfo);
verify.setVerifyTime(time);
/** //数据校验
* 查询焊接设备检验信息列表
* @param page
* @param dto
* @return
*/
@Override
public Page<FacilityDto> selectFacility(Page<FacilityDto> page, FacilityDto dto) {
List<IntelligentInspectionDto> commonality = this.commonality(StageEnum.焊前设备.getName()); Boolean falg =false; /**假设*/
ArrayList<FacilityDto> facilityList = new ArrayList<>( );
for (IntelligentInspectionDto intelligentInspectionDto : commonality) {
FacilityDto facilityDto = new FacilityDto( );
BeanUtils.copyProperties(intelligentInspectionDto,facilityDto);
facilityList.add(facilityDto);
if (!falg) {
/* //校验不通过,存入校验信息,
verify.setStatus(VerifyEnum.未通过.getStatus());
try {
int insert = verifyMapper.insert(verify);
} catch (Exception e) {
e.printStackTrace();
} }
page.setRecords(facilityList); //将出现问题的哪一个阶段存入tz_ugp_quality_problem表中,返回失败
page.setTotal(facilityList.size()); QualityProblem qualityProblem = new QualityProblem();
return page; 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();
} }
/** //校验通过
* 智能监检校验数据
* @param dto
* @return
*/
public String checks(AcceptDto dto) {
if (dto != null) {
// 校验数据
//调用方法判断 /*//这个是判断过后需要存的状态
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);
//通过,将数据添加到verity表中,并返回ok }
//如果不通过,将出现问题的哪一个阶段存入tz_ugp_quality_problem表中,返回失败
}
return "ok"; //设备
if (stage.equals(StageEnum.焊前设备.getVerifyName())&&dto.getFacilityPhoto() !=null && !dto.getFacilityPhoto().equals("")){
//获取校验设备信息
} String facilityId = dto.getFacilityId( ); //设备id
/** String calibrationStatus = dto.getCalibrationStatus( );//检定状态
* 焊接工艺效验 String facilityPhoto = dto.getFacilityPhoto( );//设备图片
*/
private String 效验状态 = "复审中";
private final String 问题编码="-WT"; HashMap<String, String> mapfacilty = new HashMap<>( );
private final Integer 焊前效验数量 = 3; mapfacilty.put("code",code);//焊口编号
mapfacilty.put("peopleLocation",peopleLocation);//焊接定位信息
mapfacilty.put("calibrationStatus",calibrationStatus);
mapfacilty.put("facilityPhoto",facilityPhoto);
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);
public String weldEffect(JSONObject jsonObject) {
Verify verify = new Verify(); //数据校验
//添加筛选条件
LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
//筛选出本焊口监检数
wrapper.eq(Verify::getCode, jsonObject.getString("code"));
//改焊口焊前数据
Integer verifyCount = verifyMapper.selectCount(wrapper);
if (verifyCount == 焊前效验数量) {
wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
//该焊口焊前效验通过数据
Integer integer = verifyMapper.selectCount(wrapper);
//判断前三次已经入库
if (integer == 焊前效验数量) {
//获取效验接口
Boolean i = false;
Boolean flag =false;
verify.setProjectId(jsonObject.getLong("projectId"));
verify.setCode(jsonObject.getString("code"));
verify.setTargetInfo(jsonObject.getString("target_info"));
verify.setSubmitTime(new Date());
verify.setStage(StageEnum.焊接工艺.getStage());
if (i) {
verify.setStatus(VerifyEnum.已通过.getStatus());
//添加筛选条件
LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
Weld weld = weldMapper.selectOne(wrapperWeld);
weld.setSuperInspecStatus(StageEnum.焊接工艺.getStage());
weldService.updateById(weld);
效验状态 = "已通过";
this.save(verify);
} else {
int math= (int) (Math.random()*10000);
verify.setStatus(VerifyEnum.未通过.getStatus());
this.save(verify);
LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
wrapperVerify.eq(Verify::getStage,StageEnum.焊接工艺.getStage());
Verify verifyId = verifyMapper.selectOne(wrapperVerify);
QualityProblem qualityProblem = new QualityProblem();
//生成问题编码
qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
qualityProblem.setProjectId(jsonObject.getLong("projectId"));
qualityProblem.setGenerateStage(StageEnum.焊接工艺.getStage());
qualityProblem.setSubmitDate(new Date());
qualityProblemService.save(qualityProblem);
效验状态 = "未通过";
if (!flag) {
//校验不通过
this.addFailData(verify,new QualityProblem());
return VerifyEnum.未通过.getName();
} }
//效验通过
this.addSuccessData(verify);
}
//管材
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 效验状态; return VerifyEnum.已通过.getName();
} }
/**
* 管道耐压效验
/** cpp
* 校验失败需要添加的数据
* @param verify
* @param qualityProblem
*/ */
private final Integer 管道耐压前效验数量 = 4; public void addFailData(Verify verify,QualityProblem qualityProblem){
public String materialEffect(JSONObject jsonObject){ //校验不通过,存入校验信息,
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);//获取焊口编码
}
Verify verify = new Verify(); }
//添加筛选条件
LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
//筛选出本焊口监检数
wrapper.eq(Verify::getCode, jsonObject.getString("code"));
//该焊口焊前数据
Integer verifyCount = verifyMapper.selectCount(wrapper);
if (verifyCount == 管道耐压前效验数量) {
wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
//该焊口焊前效验通过数据
Integer integer = verifyMapper.selectCount(wrapper);
//判断前四次已经入库
if (integer == 管道耐压前效验数量) {
//获取效验接口
Boolean i = true;
qualityProblem.setGenerateStage(verify.getStage());
qualityProblem.setProblemDescribe(verify.getStage()+"不通过");
qualityProblem.setStageVerifyId(verify.getSequenceNbr());
qualityProblemService.save(qualityProblem);
verify.setProjectId(jsonObject.getLong("projectId")); }
verify.setCode(jsonObject.getString("code"));
verify.setTargetInfo(jsonObject.getString("target_info"));
verify.setSubmitTime(new Date());
verify.setStage(StageEnum.焊前管材质量.getStage());
if (i) {
verify.setStatus(VerifyEnum.已通过.getStatus());
//添加筛选条件
LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
Weld weld = weldMapper.selectOne(wrapperWeld);
weld.setSuperInspecStatus(StageEnum.焊前管材质量.getStage());
weldService.updateById(weld); /** cpp
* 校验成功需要添加的数据
* @param verify
* @param
*/
public void addSuccessData(Verify verify){
效验状态 = "已通过"; //效验通过状态
} else { verify.setStatus(VerifyEnum.已通过.getStatus());
int math= (int) (Math.random()*10000); try {
verify.setStatus(VerifyEnum.未通过.getStatus()); //智能监检管理表添加数据
this.save(verify); int insert = verifyMapper.insert(verify);
LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>(); } catch (Exception e) {
wrapperVerify.eq(Verify::getCode,jsonObject.getString("code")); e.printStackTrace( );
wrapperVerify.eq(Verify::getStage,StageEnum.焊前管材质量.getStage()); }
Verify verifyId = verifyMapper.selectOne(wrapperVerify);
QualityProblem qualityProblem = new QualityProblem(); //焊口表存更改状态
//生成问题编码 String targetInfo = verify.getTargetInfo( );
qualityProblem.setStageVerifyId(verifyId.getSequenceNbr()); String code =null;
qualityProblem.setCode(jsonObject.getString("code")+问题编码+math); Map map = JSON.parseObject(targetInfo, Map.class);
qualityProblem.setProjectId(jsonObject.getLong("projectId")); for (Object o:map.keySet()){
qualityProblem.setGenerateStage(StageEnum.焊前管材质量.getStage()); if (o.toString().equals("code")) {
qualityProblem.setSubmitDate(new Date()); code=(String) map.get(o.toString( ));
qualityProblemService.save(qualityProblem);
效验状态 = "未通过";
} }
} }
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);
}
}
save(verify); LambdaQueryWrapper<Weld> wrapper = new LambdaQueryWrapper<>( );
wrapper.eq(Weld::getCode ,weld.getCode()).
eq(Weld::getProjectId,weld.getProjectId());
weldMapper.update(weld,wrapper);
} }
return 效验状态;
} }
private String 效验状态 = "已存在";
private final String 问题编码="-WT";
/** /**
* 敷设效验 * 公共效验接口
*/ */
private final Integer 敷设效验数量 = 5; public String effect(JSONObject jsonObject,Integer 效验数量,Boolean i) {
public String layEffect(JSONObject jsonObject){ // String 效验状态 = "已存在";
Verify verify = new Verify(); Verify verify = new Verify();
//添加筛选条件 //添加筛选条件
LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
//获取target_info
JSONObject targetInfo = jsonObject.getJSONObject("target_info");
String code = targetInfo.getString("code");
//筛选出本焊口监检数 //筛选出本焊口监检数
wrapper.eq(Verify::getCode, jsonObject.getString("code")); wrapper.eq(Verify::getCode, code);
//焊口焊前数据 //焊口焊前数据
Integer verifyCount = verifyMapper.selectCount(wrapper); Integer verifyCount = verifyMapper.selectCount(wrapper);
if (verifyCount == 管道耐压前效验数量) { if (verifyCount == 效验数量) {
wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus()); wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
//该焊口焊前效验通过数据 //该焊口焊前效验通过数据
Integer integer = verifyMapper.selectCount(wrapper); Integer integer = verifyMapper.selectCount(wrapper);
//判断前四次已经入库 //判断入库数量
if (integer == 管道耐压前效验数量) { if (integer == 效验数量) {
//获取效验接口
Boolean i = true;
verify.setProjectId(jsonObject.getLong("projectId")); verify.setProjectId(jsonObject.getLong("projectId"));
verify.setCode(jsonObject.getString("code")); verify.setCode(jsonObject.getString("code"));
verify.setTargetInfo(jsonObject.getString("target_info")); verify.setTargetInfo(jsonObject.getString("target_info"));
verify.setSubmitTime(new Date()); verify.setSubmitTime(new Date());
verify.setStage(StageEnum.敷设质量.getStage()); verify.setVerifyTime(new Date());
verify.setType(VerifyTypeEnum.智能检验.getStatus());
//获取操作阶段
String stage = targetInfo.getString("stage");
verify.setStage(stage);
//获取效验接口
if (i) { if (i) {
verify.setStatus(VerifyEnum.已通过.getStatus()); verify.setStatus(VerifyEnum.已通过.getStatus());
//添加筛选条件 //添加筛选条件
LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
wrapperWeld.eq(Weld::getCode, jsonObject.getString("code")); wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
Weld weld = weldMapper.selectOne(wrapperWeld); Weld weld = weldMapper.selectOne(wrapperWeld);
weld.setSuperInspecStatus(StageEnum.敷设质量.getStage()); weld.setSuperInspecStatus(stage);
weldService.updateById(weld); weldService.updateById(weld);
效验状态 = "已通过"; 效验状态 = "已通过";
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<>();
wrapperVerify.eq(Verify::getCode,jsonObject.getString("code")); wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
wrapperVerify.eq(Verify::getStage,StageEnum.敷设质量.getStage()); wrapperVerify.eq(Verify::getStage,stage);
Verify verifyId = verifyMapper.selectOne(wrapperVerify); Verify verifyId = verifyMapper.selectOne(wrapperVerify);
QualityProblem qualityProblem = new QualityProblem(); QualityProblem qualityProblem = new QualityProblem();
//生成问题编码 //生成问题编码
qualityProblem.setStageVerifyId(verifyId.getSequenceNbr()); qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
qualityProblem.setCode(jsonObject.getString("code")+问题编码+math); qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
qualityProblem.setProjectId(jsonObject.getLong("projectId")); qualityProblem.setProjectId(jsonObject.getLong("projectId"));
qualityProblem.setGenerateStage(StageEnum.敷设质量.getStage()); qualityProblem.setGenerateStage(stage);
qualityProblem.setSubmitDate(new Date()); qualityProblem.setSubmitDate(new Date());
qualityProblemService.save(qualityProblem); qualityProblemService.save(qualityProblem);
效验状态 = "未通过"; 效验状态 = "未通过";
...@@ -390,80 +448,296 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -390,80 +448,296 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
} }
save(verify);
} }
return 效验状态; return 效验状态;
} }
/** /**
* 定位效验 * 焊接工艺效验
*/ */
private final Integer 定位效验数量 = 6;
public String positionEffect(JSONObject jsonObject){
Verify verify = new Verify(); private final Integer 焊前效验数量 = 3;
//添加筛选条件
LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
//筛选出本焊口监检数
wrapper.eq(Verify::getCode, jsonObject.getString("code"));
//该焊口焊前数据
Integer verifyCount = verifyMapper.selectCount(wrapper);
if (verifyCount == 管道耐压前效验数量) {
wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
//该焊口焊前效验通过数据
Integer integer = verifyMapper.selectCount(wrapper);
//判断前四次已经入库
if (integer == 管道耐压前效验数量) {
//获取效验接口
Boolean i = true;
public String weldEffect(JSONObject jsonObject) {
verify.setProjectId(jsonObject.getLong("projectId"));
verify.setCode(jsonObject.getString("code"));
verify.setTargetInfo(jsonObject.getString("target_info"));
verify.setSubmitTime(new Date());
verify.setStage(StageEnum.定位.getStage());
if (i) {
verify.setStatus(VerifyEnum.已通过.getStatus());
//添加筛选条件
LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
Weld weld = weldMapper.selectOne(wrapperWeld);
weld.setSuperInspecStatus(StageEnum.定位.getStage());
weldService.updateById(weld); // Verify verify = new Verify();
// //添加筛选条件
效验状态 = "已通过"; // LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
} else { // JSONObject targetInfo = jsonObject.getJSONObject("target_info");
int math= (int) (Math.random()*10000); // String code = targetInfo.getString("code");
verify.setStatus(VerifyEnum.未通过.getStatus()); // //筛选出本焊口监检数
this.save(verify); // wrapper.eq(Verify::getCode, code);
LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>(); // //改焊口焊前数据
wrapperVerify.eq(Verify::getCode,jsonObject.getString("code")); // Integer verifyCount = verifyMapper.selectCount(wrapper);
wrapperVerify.eq(Verify::getStage,StageEnum.定位.getStage()); // if (verifyCount == 焊前效验数量) {
Verify verifyId = verifyMapper.selectOne(wrapperVerify); // wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
QualityProblem qualityProblem = new QualityProblem(); // //该焊口焊前效验通过数据
//生成问题编码 // Integer integer = verifyMapper.selectCount(wrapper);
qualityProblem.setStageVerifyId(verifyId.getSequenceNbr()); // //判断前三次已经入库
qualityProblem.setCode(jsonObject.getString("code")+问题编码+math); // if (integer == 焊前效验数量) {
qualityProblem.setProjectId(jsonObject.getLong("projectId")); // //获取效验接口
qualityProblem.setGenerateStage(StageEnum.定位.getStage()); // Boolean i = false;
qualityProblem.setSubmitDate(new Date()); //
qualityProblemService.save(qualityProblem); //
效验状态 = "未通过"; // verify.setProjectId(jsonObject.getLong("projectId"));
// verify.setCode(jsonObject.getString("code"));
// verify.setTargetInfo(jsonObject.getString("target_info"));
// verify.setSubmitTime(new Date());
// verify.setStage(StageEnum.焊接工艺.getStage());
// if (i) {
// verify.setStatus(VerifyEnum.已通过.getStatus());
// //添加筛选条件
// LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
// wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
// Weld weld = weldMapper.selectOne(wrapperWeld);
// weld.setSuperInspecStatus(StageEnum.焊接工艺.getStage());
//
// weldService.updateById(weld);
//
// 效验状态 = "已通过";
// this.save(verify);
// } else {
// int math= (int) (Math.random()*10000);
// verify.setStatus(VerifyEnum.未通过.getStatus());
// this.save(verify);
// LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
// wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
// wrapperVerify.eq(Verify::getStage,StageEnum.焊接工艺.getStage());
// Verify verifyId = verifyMapper.selectOne(wrapperVerify);
// QualityProblem qualityProblem = new QualityProblem();
// //生成问题编码
// qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
// qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
// qualityProblem.setProjectId(jsonObject.getLong("projectId"));
// qualityProblem.setGenerateStage(StageEnum.焊接工艺.getStage());
// qualityProblem.setSubmitDate(new Date());
// qualityProblemService.save(qualityProblem);
// 效验状态 = "未通过";
//
// }
//
// }
//
//
//
// }
//
return effect(jsonObject,焊前效验数量,true);
} }
/**
* 管道耐压效验
*/
private final Integer 管道耐压前效验数量 = 4;
public String materialEffect(JSONObject jsonObject){
// Verify verify = new Verify();
// //添加筛选条件
// LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
// //筛选出本焊口监检数
// wrapper.eq(Verify::getCode, jsonObject.getString("code"));
// //该焊口焊前数据
// Integer verifyCount = verifyMapper.selectCount(wrapper);
// if (verifyCount == 管道耐压前效验数量) {
// wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
// //该焊口焊前效验通过数据
// Integer integer = verifyMapper.selectCount(wrapper);
// //判断前四次已经入库
// if (integer == 管道耐压前效验数量) {
// //获取效验接口
// Boolean i = true;
//
//
// verify.setProjectId(jsonObject.getLong("projectId"));
// verify.setCode(jsonObject.getString("code"));
// verify.setTargetInfo(jsonObject.getString("target_info"));
// verify.setSubmitTime(new Date());
// verify.setStage(StageEnum.焊前管材质量.getStage());
// if (i) {
// verify.setStatus(VerifyEnum.已通过.getStatus());
// //添加筛选条件
// LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
// wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
// Weld weld = weldMapper.selectOne(wrapperWeld);
// weld.setSuperInspecStatus(StageEnum.焊前管材质量.getStage());
//
// weldService.updateById(weld);
//
// 效验状态 = "已通过";
// } else {
// int math= (int) (Math.random()*10000);
// verify.setStatus(VerifyEnum.未通过.getStatus());
// this.save(verify);
// LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
// wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
// wrapperVerify.eq(Verify::getStage,StageEnum.焊前管材质量.getStage());
// Verify verifyId = verifyMapper.selectOne(wrapperVerify);
// QualityProblem qualityProblem = new QualityProblem();
// //生成问题编码
// qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
// qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
// qualityProblem.setProjectId(jsonObject.getLong("projectId"));
// qualityProblem.setGenerateStage(StageEnum.焊前管材质量.getStage());
// qualityProblem.setSubmitDate(new Date());
// qualityProblemService.save(qualityProblem);
// 效验状态 = "未通过";
//
// }
//
// }
//
// save(verify);
//
// }
//
return effect(jsonObject,管道耐压前效验数量,true);
} }
/**
* 敷设效验
*/
private final Integer 敷设效验数量 = 5;
public String layEffect(JSONObject jsonObject){
save(verify);
//
// Verify verify = new Verify();
// //添加筛选条件
// LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
// //筛选出本焊口监检数
// wrapper.eq(Verify::getCode, jsonObject.getString("code"));
// //该焊口焊前数据
// Integer verifyCount = verifyMapper.selectCount(wrapper);
// if (verifyCount == 管道耐压前效验数量) {
// wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
// //该焊口焊前效验通过数据
// Integer integer = verifyMapper.selectCount(wrapper);
// //判断前四次已经入库
// if (integer == 管道耐压前效验数量) {
// //获取效验接口
// Boolean i = true;
//
//
// verify.setProjectId(jsonObject.getLong("projectId"));
// verify.setCode(jsonObject.getString("code"));
// verify.setTargetInfo(jsonObject.getString("target_info"));
// verify.setSubmitTime(new Date());
// verify.setStage(StageEnum.敷设质量.getStage());
// if (i) {
// verify.setStatus(VerifyEnum.已通过.getStatus());
// //添加筛选条件
// LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
// wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
// Weld weld = weldMapper.selectOne(wrapperWeld);
// weld.setSuperInspecStatus(StageEnum.敷设质量.getStage());
//
// weldService.updateById(weld);
//
// 效验状态 = "已通过";
// } else {
// int math= (int) (Math.random()*10000);
// verify.setStatus(VerifyEnum.未通过.getStatus());
// this.save(verify);
// LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
// wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
// wrapperVerify.eq(Verify::getStage,StageEnum.敷设质量.getStage());
// Verify verifyId = verifyMapper.selectOne(wrapperVerify);
// QualityProblem qualityProblem = new QualityProblem();
// //生成问题编码
// qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
// qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
// qualityProblem.setProjectId(jsonObject.getLong("projectId"));
// qualityProblem.setGenerateStage(StageEnum.敷设质量.getStage());
// qualityProblem.setSubmitDate(new Date());
// qualityProblemService.save(qualityProblem);
// 效验状态 = "未通过";
//
// }
//
// }
//
// save(verify);
//
// }
return effect(jsonObject,敷设效验数量,false);
} }
return 效验状态; /**
* 定位效验
*/
private final Integer 定位效验数量 = 6;
public String positionEffect(JSONObject jsonObject){
// Verify verify = new Verify();
// //添加筛选条件
// LambdaQueryWrapper<Verify> wrapper = new LambdaQueryWrapper<>();
// //筛选出本焊口监检数
// wrapper.eq(Verify::getCode, jsonObject.getString("code"));
// //该焊口焊前数据
// Integer verifyCount = verifyMapper.selectCount(wrapper);
// if (verifyCount == 管道耐压前效验数量) {
// wrapper.eq(Verify::getStatus, VerifyEnum.已通过.getStatus());
// //该焊口焊前效验通过数据
// Integer integer = verifyMapper.selectCount(wrapper);
// //判断前四次已经入库
// if (integer == 管道耐压前效验数量) {
// //获取效验接口
// Boolean i = true;
//
//
// verify.setProjectId(jsonObject.getLong("projectId"));
// verify.setCode(jsonObject.getString("code"));
// verify.setTargetInfo(jsonObject.getString("target_info"));
// verify.setSubmitTime(new Date());
// verify.setStage(StageEnum.定位.getStage());
// if (i) {
// verify.setStatus(VerifyEnum.已通过.getStatus());
// //添加筛选条件
// LambdaQueryWrapper<Weld> wrapperWeld = new LambdaQueryWrapper<>();
// wrapperWeld.eq(Weld::getCode, jsonObject.getString("code"));
//
// Weld weld = weldMapper.selectOne(wrapperWeld);
// weld.setSuperInspecStatus(StageEnum.定位.getStage());
//
// weldService.updateById(weld);
//
// 效验状态 = "已通过";
// } else {
// int math= (int) (Math.random()*10000);
// verify.setStatus(VerifyEnum.未通过.getStatus());
// this.save(verify);
// LambdaQueryWrapper<Verify> wrapperVerify=new LambdaQueryWrapper<>();
// wrapperVerify.eq(Verify::getCode,jsonObject.getString("code"));
// wrapperVerify.eq(Verify::getStage,StageEnum.定位.getStage());
// Verify verifyId = verifyMapper.selectOne(wrapperVerify);
// QualityProblem qualityProblem = new QualityProblem();
// //生成问题编码
// qualityProblem.setStageVerifyId(verifyId.getSequenceNbr());
// qualityProblem.setCode(jsonObject.getString("code")+问题编码+math);
// qualityProblem.setProjectId(jsonObject.getLong("projectId"));
// qualityProblem.setGenerateStage(StageEnum.定位.getStage());
// qualityProblem.setSubmitDate(new Date());
// qualityProblemService.save(qualityProblem);
// 效验状态 = "未通过";
//
// }
//
// }
//
// save(verify);
//
// }
return effect(jsonObject,定位效验数量,true);
} }
} }
\ 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.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.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum;
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.entity.ProjectResource; import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.List; import java.util.stream.Collectors;
import java.util.Map;
@Service @Service
public class WelderServiceImpl { public class WelderServiceImpl {
...@@ -27,6 +34,10 @@ public class WelderServiceImpl { ...@@ -27,6 +34,10 @@ public class WelderServiceImpl {
@Autowired @Autowired
ProjectResourceServiceImpl projectResourceService; ProjectResourceServiceImpl projectResourceService;
@Value("${amos.secret.key}")
String secretKey;
@BusinessIdentify @BusinessIdentify
public List<Map> getInfo(){ public List<Map> getInfo(){
...@@ -66,4 +77,52 @@ public class WelderServiceImpl { ...@@ -66,4 +77,52 @@ public class WelderServiceImpl {
page.setTotal(getInfo().size()); page.setTotal(getInfo().size());
return page; return page;
} }
/**
* 存人员信息至业务表及平台表
* @param jsonObject
* @param bizOrgType
* @param sequenceNbr
* @return
*/
@BusinessIdentify
public OrgUsrDto savePerson(JSONObject jsonObject, String bizOrgType, String sequenceNbr){
Long companyId = orgService.getReginParams().getCompany().getSequenceNbr();
Set<String> roleNameSet = new HashSet<>();
List<RoleModel> userRoleList = new ArrayList<>();
List<Long> roleIds = new ArrayList<>();
Map<Long, List<Long>> roleSeqsMap = new HashMap<>();
AgencyUserModel agencyUserModel = new AgencyUserModel();
Map<Long,List<RoleModel>> orgRoles = new HashMap<>();
//用户基本信息
agencyUserModel.setRealName(jsonObject.getString("name"));
agencyUserModel.setAgencyCode("ugp");
agencyUserModel.setLockStatus("UNLOCK");
agencyUserModel.setMobile(jsonObject.getString("phone"));
agencyUserModel.setCreateTime(new Date());
agencyUserModel.setUserName(jsonObject.getString("phone"));
agencyUserModel.setPassword(DesUtil.encode(jsonObject.getString("phone"), secretKey));
agencyUserModel.setRePassword(DesUtil.encode(jsonObject.getString("phone"), secretKey));
//用户角色信息
List<RoleModel> allRoleList = Privilege.roleClient.queryRoleList(null,null).getResult();
if(1==jsonObject.getInteger("isWelder")){
roleNameSet.add(OrgEnum.焊工.getName());
} else {
roleNameSet.add(OrgEnum.普通人员.getName());
}
userRoleList = allRoleList.stream().filter(r -> r.getRoleName().equals(roleNameSet)).collect(Collectors.toList());
userRoleList.stream().forEach(r -> {
if (!roleIds.contains(r.getSequenceNbr())) {
roleIds.add(r.getSequenceNbr());
}
});
roleSeqsMap.put(companyId,roleIds);
orgRoles.put(companyId,userRoleList);
agencyUserModel.setOrgRoleSeqs(roleSeqsMap);
agencyUserModel.setOrgRoles(orgRoles);
//创建用户
agencyUserModel = Privilege.agencyUserClient.create(agencyUserModel).getResult();
jsonObject.put("amosOrgId",agencyUserModel.getSequenceNbr());
return orgService.dataHandling(jsonObject,bizOrgType,sequenceNbr);
}
} }
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