Commit fb6e4b32 authored by tianyiming's avatar tianyiming

Merge branch 'develop_tzs_register' into develop_tzs_new_patrol

# Conflicts: # amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/pom.xml # amos-boot-system-tzs/amos-boot-module-tzspatrol/amos-boot-module-tzspatrol-biz/src/main/java/com/yeejoin/amos/patrol/quartz/QuartzManager.java
parents afc9e3c1 432c65c6
......@@ -2,17 +2,55 @@ package com.yeejoin.amos.api.openapi.controller;
import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.api.openapi.face.model.*;
import com.yeejoin.amos.api.openapi.face.orm.entity.*;
import com.yeejoin.amos.api.openapi.face.service.*;
import com.yeejoin.amos.api.openapi.face.dto.EquipmentInfoDto;
import com.yeejoin.amos.api.openapi.face.model.ElevatorTechInfoModel;
import com.yeejoin.amos.api.openapi.face.model.EnterpriseInfoModel;
import com.yeejoin.amos.api.openapi.face.model.InspectionDetectionInfoModel;
import com.yeejoin.amos.api.openapi.face.model.InspectionInfoModel;
import com.yeejoin.amos.api.openapi.face.model.ProduceInfoModel;
import com.yeejoin.amos.api.openapi.face.model.RegistrationInfoModel;
import com.yeejoin.amos.api.openapi.face.model.StaffQualifInfoModel;
import com.yeejoin.amos.api.openapi.face.model.UnitLicenceModel;
import com.yeejoin.amos.api.openapi.face.orm.entity.ConstructionInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.DesignInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.EnclosureInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.MaintenanceInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.OtherInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.StaffBaseInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.SuperviseInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.UseInfo;
import com.yeejoin.amos.api.openapi.face.service.ConstructionInfoService;
import com.yeejoin.amos.api.openapi.face.service.CreateCodeService;
import com.yeejoin.amos.api.openapi.face.service.DesignInfoService;
import com.yeejoin.amos.api.openapi.face.service.ElevatorTechInfoService;
import com.yeejoin.amos.api.openapi.face.service.EnclosureInfoService;
import com.yeejoin.amos.api.openapi.face.service.EnterpriseInfoService;
import com.yeejoin.amos.api.openapi.face.service.InspectionInfoService;
import com.yeejoin.amos.api.openapi.face.service.MaintenanceInfoService;
import com.yeejoin.amos.api.openapi.face.service.OtherInfoService;
import com.yeejoin.amos.api.openapi.face.service.ProduceInfoService;
import com.yeejoin.amos.api.openapi.face.service.RegistrationInfoService;
import com.yeejoin.amos.api.openapi.face.service.StaffBaseInfoService;
import com.yeejoin.amos.api.openapi.face.service.StaffQualifInfoService;
import com.yeejoin.amos.api.openapi.face.service.SuperviseInfoService;
import com.yeejoin.amos.api.openapi.face.service.TechInfoService;
import com.yeejoin.amos.api.openapi.face.service.UnitLicenceService;
import com.yeejoin.amos.api.openapi.face.service.UseInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.List;
import java.util.Map;
......@@ -98,8 +136,11 @@ public class SuperviseController {
@ApiOperation(value = "新增施工信息")
@PostMapping(value = "/constructionInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveConstructionInfo(@RequestBody List<ConstructionInfo> constructionInfo) throws Exception {
return ResponseHelper.buildResponse(constructionInfoService.saveConstructionInfo(constructionInfo));
public ResponseModel<String> saveConstructionInfo(@RequestBody List<ConstructionInfo> constructionInfoList) {
if (ValidationUtil.isEmpty(constructionInfoList)) {
throw new BadRequest("上送数据为空");
}
return ResponseHelper.buildResponse(constructionInfoService.saveConstructionInfo(constructionInfoList.get(0)));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......@@ -122,8 +163,11 @@ public class SuperviseController {
@ApiOperation(value = "新增维保单位信息")
@PostMapping(value = "/maintenanceInfo")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveMaintenanceInfo(@RequestBody List<MaintenanceInfoModel> maintenanceInfo) throws Exception {
return ResponseHelper.buildResponse(maintenanceInfoService.saveMaintenanceInfo(maintenanceInfo));
public ResponseModel<String> saveMaintenanceInfo(@RequestBody List<MaintenanceInfo> maintenanceInfoList) {
if (ValidationUtil.isEmpty(maintenanceInfoList)) {
throw new BadRequest("上送数据为空");
}
return ResponseHelper.buildResponse(maintenanceInfoService.saveMaintenanceInfo(maintenanceInfoList.get(0)));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......@@ -230,4 +274,17 @@ public class SuperviseController {
public ResponseModel<InspectionDetectionInfoModel> selectInspect(@RequestParam String superviseCode) {
return ResponseHelper.buildResponse(inspectionInfoService.selectInspect(superviseCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "监管设备信息")
@PostMapping(value = "/equipment/info")
@RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveEquipmentInfo(@RequestBody EquipmentInfoDto equipmentInfoDto) {
String supervisoryCode = equipmentInfoDto.getSupervisoryCode();
if (ValidationUtil.isEmpty(supervisoryCode)) {
throw new BadRequest("监管码信息不存在");
}
return ResponseHelper.buildResponse(useInfoService.saveEquipmentInfo(equipmentInfoDto));
}
}
package com.yeejoin.amos.api.openapi.face.dto;
import com.yeejoin.amos.api.openapi.face.orm.entity.DesignInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.MainParts;
import com.yeejoin.amos.api.openapi.face.orm.entity.MaintenanceInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.OtherInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.ProduceInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.ProtectionDevices;
import com.yeejoin.amos.api.openapi.face.orm.entity.RegistrationInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.SuperviseInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.UseInfo;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* 监管设备信息
* */
@Data
public class EquipmentInfoDto {
/**
* 使用信息
*/
private UseInfo useInfo;
/**
* 设计制造
*/
private DesignInfo designInfo;
/**
* 制造信息
*/
private ProduceInfo factoryInfo;
/**
* 监管信息
*/
private SuperviseInfo supervisionInfo;
/**
* 注册登记
*/
private RegistrationInfo registerInfo;
/**
* 维保备案
*/
private MaintenanceInfo maintenanceRecordInfo;
/**
* 其他信息
*/
private OtherInfo otherInfo;
/**
* 主要零部件
*/
private List<MainParts> mainParts;
/**
* 保护装置
*/
private List<ProtectionDevices> protectionDevices;
/**
* 设备参数信息
*/
private Map<String, Object> params;
/**
* 操作类型 1 新增 0 修改
*/
private Integer saveStatus;
/**
* 监管码
*/
private String supervisoryCode;
}
......@@ -21,6 +21,9 @@ public class ConstructionInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
@TableField("\"RECORD\"")
private String record;
/**
* * 监管码
* */
......@@ -75,4 +78,6 @@ public class ConstructionInfo extends AbstractEquipBaseEntity {
@TableField(value ="\"USC_INFORM_ID\"")
private String uscInformId;
@TableField("\"SEQUENCE_CODE\"")
private String sequenceCode;
}
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
import java.util.Date;
/**
* 安全追溯-设计信息表
*
......@@ -24,6 +20,7 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
public class DesignInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
private String record;
/**
* * $column.comments
......
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
import java.math.BigDecimal;
/**
* 安全追溯-电梯
*
......@@ -25,6 +20,7 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
public class EquipTechParamElevator extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
private String record;
/**
* * $column.comments
......
package com.yeejoin.amos.api.openapi.face.orm.entity;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*
......@@ -30,6 +24,8 @@ public class MainParts extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
private String record;
@TableField("\"SUPERVISORY_CODE\"")
private String supervisoryCode;
......
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
import java.util.Date;
/**
* 安全追溯-维保备案信息表
*
......@@ -24,6 +20,7 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
public class MaintenanceInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
private String record;
/**
* * $column.comments
......
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
/**
* ${comments}
*
......@@ -24,6 +18,15 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
public class OtherInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
private String record;
@TableField("\"INSTANCE_ID\"")
private String instanceId;
/**
*
*/
private String status;
/**
* * 保险机构
......
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
import java.util.Date;
/**
* 安全追溯-制造信息
*
......@@ -24,7 +20,7 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
public class ProduceInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
private String record;
@TableField(value ="\"SUPERVISORY_CODE\"")
private String supervisoryCode;
......
package com.yeejoin.amos.api.openapi.face.orm.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import java.util.Date;
/**
*
*
......@@ -29,6 +23,7 @@ public class ProtectionDevices extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
private String record;
@TableField("\"SUPERVISORY_CODE\"")
private String supervisoryCode;
......
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
import java.math.BigDecimal;
/**
* 注册登记信息表
*
......@@ -25,6 +20,7 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
public class RegistrationInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
private String record;
/**
* * $column.comments
......@@ -32,9 +28,6 @@ public class RegistrationInfo extends AbstractEquipBaseEntity {
@TableField(value ="\"SUPERVISORY_CODE\"")
private String supervisoryCode;
/**
* * $column.comments
* */
/**
......
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
/**
* 监督管理信息表
*
......@@ -24,6 +18,7 @@ import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
public class SuperviseInfo extends AbstractEquipBaseEntity {
private static final long serialVersionUID = 1L;
private String record;
/**
* * $column.comments
......
package com.yeejoin.amos.api.openapi.face.orm.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity;
import com.yeejoin.amos.api.openapi.face.orm.entity.AbstractBaseEntity;
import java.util.Date;
/**
* 使用信息表
*
......@@ -188,5 +185,28 @@ public class UseInfo extends AbstractEquipBaseEntity {
@TableField(value ="\"COUNTY_NAME\"")
private String countyName;
/**
* 是否西咸(0不是,1是)
*/
private String isXiXian;
/**
* 是否在es(0不是,1是)
*/
private String isEs;
/**
* 创建时间
* */
private Date createDate;
/**
* 认领时间
* */
private Date claimDate;
/**
* 数据来源(新增:0、导入:1、复制:复制数据的id )
* */
private Date dataSource;
}
......@@ -3,6 +3,10 @@ package com.yeejoin.amos.api.openapi.face.service;
import com.yeejoin.amos.api.openapi.face.model.ConstructionInfoModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.ConstructionInfoMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.ConstructionInfo;
import com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -19,6 +23,24 @@ import java.util.List;
*/
@Component
public class ConstructionInfoService extends AppBaseService<ConstructionInfoModel, ConstructionInfo, ConstructionInfoMapper> {
private static final Logger logger = LogManager.getLogger(ConstructionInfoService.class);
@Autowired
TzsServiceFeignClient tzsServiceFeignClient;
/**
* @param constructionInfo 施工信息
* @return "OK"
*/
public String saveConstructionInfo(ConstructionInfo constructionInfo) {
try {
tzsServiceFeignClient.saveConstructionInfo(constructionInfo);
} catch (Exception e) {
logger.error("施工信息保存失败--->{}", e.getMessage());
e.printStackTrace();
}
return "OK";
}
/**
......
package com.yeejoin.amos.api.openapi.face.service;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.api.openapi.enums.JgFileAttributeEnum;
import com.yeejoin.amos.api.openapi.enums.JgFileObjectEnum;
import com.yeejoin.amos.api.openapi.face.model.MaintenanceInfoModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.MaintenanceInfoMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.*;
import com.yeejoin.amos.api.openapi.face.orm.entity.MaintenanceInfo;
import com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -26,32 +26,53 @@ import java.util.List;
@Component
public class MaintenanceInfoService extends AppBaseService<MaintenanceInfoModel, MaintenanceInfo, MaintenanceInfoMapper> {
@Autowired
private JgFileService fileService;
private static final Logger logger = LogManager.getLogger(ConstructionInfoService.class);
/**
*
* 新增维保备案信息
*
* @param model 维保备案信息实体类集合
* @return 成功返回“OK”
*/
@Transactional(rollbackFor= {Exception.class})
public String saveMaintenanceInfo(List<MaintenanceInfoModel> model) {
// TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) {
throw new BadRequest("维保备案信息为空.");
}
@Autowired
TzsServiceFeignClient tzsServiceFeignClient;
List<MaintenanceInfo> mainList = new ArrayList<>();
@Autowired
private JgFileService fileService;
/**
* 新增维保备案信息
*
* @param maintenanceInfo 维保备案信息
* @return 成功返回“OK”
*/
@Transactional(rollbackFor = {Exception.class})
public String saveMaintenanceInfo(MaintenanceInfo maintenanceInfo) {
try {
tzsServiceFeignClient.saveMaintenanceRecordInfo(maintenanceInfo);
} catch (Exception e) {
logger.error("维保备案信息保存失败--->{}", e.getMessage());
e.printStackTrace();
}
return "OK";
}
/**
* 新增维保备案信息
*
* @param model 维保备案信息实体类集合
* @return 成功返回“OK”
*/
@Transactional(rollbackFor = {Exception.class})
public String saveMaintenanceInfo(List<MaintenanceInfoModel> model) {
// TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) {
throw new BadRequest("维保备案信息为空.");
}
List<MaintenanceInfo> mainList = new ArrayList<>();
// List<JgFile> fileList = new ArrayList<>();
// List<JgFile> repairInformList;
for (MaintenanceInfoModel models : model) {
MaintenanceInfo maintenanceInfo = new MaintenanceInfo();
for (MaintenanceInfoModel models : model) {
MaintenanceInfo maintenanceInfo = new MaintenanceInfo();
// checkModel(models);
models.setRecDate(new Date());
models.setAppId(getAppId());
models.setRecDate(new Date());
models.setAppId(getAppId());
// repairInformList = JSONObject.parseArray(JSONObject.toJSONString(models.getRepairInform()), JgFile.class);
//
......@@ -67,19 +88,19 @@ public class MaintenanceInfoService extends AppBaseService<MaintenanceInfoModel,
// file.setRecDate(new Date());
// fileList.add(file);
// }
BeanUtils.copyProperties(models,maintenanceInfo);
mainList.add(maintenanceInfo);
}
this.saveBatch(mainList);
BeanUtils.copyProperties(models, maintenanceInfo);
mainList.add(maintenanceInfo);
}
this.saveBatch(mainList);
// fileService.saveBatch(fileList);
return "OK";
}
return "OK";
}
/**
* 信息校验
*
* @param models
*/
/**
* 信息校验
*
* @param models
*/
// private static void checkModel(MaintenanceInfoModel models) {
// if(ValidationUtil.isEmpty(models.getSequenceCode())) {
// throw new BadRequest("设备唯一标识码不能为空!");
......
package com.yeejoin.amos.api.openapi.face.service;
import com.yeejoin.amos.api.openapi.face.dto.EquipmentInfoDto;
import com.yeejoin.amos.api.openapi.face.model.UseInfoModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.UseInfoMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.UseInfo;
import com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient;
import feign.FeignException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Date;
import java.util.List;
......@@ -20,34 +27,41 @@ import java.util.List;
@Component
public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInfoMapper> {
/**
*
* 新增使用信息
*
* @param model 使用信息实体类集合
* @return 成功返回“OK”
*/
@Transactional(rollbackFor= {Exception.class})
public String saveUseInfo(List<UseInfo> model) {
// TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) {
throw new BadRequest("使用信息为空.");
}
private static final Logger logger = LogManager.getLogger(UseInfoService.class);
for (UseInfo models : model) {
@Autowired
TzsServiceFeignClient tzsServiceFeignClient;
// @Autowired
// AmosRequestContext amosRequestContext;
/**
* 新增使用信息
*
* @param model 使用信息实体类集合
* @return 成功返回“OK”
*/
@Transactional(rollbackFor = {Exception.class})
public String saveUseInfo(List<UseInfo> model) {
// TODO Auto-generated method stub
if (ValidationUtil.isEmpty(model)) {
throw new BadRequest("使用信息为空.");
}
for (UseInfo models : model) {
// checkModel(models);
models.setRecDate(new Date());
models.setAppId(getAppId());
}
this.saveBatch(model);
return "OK";
}
models.setRecDate(new Date());
models.setAppId(getAppId());
}
this.saveBatch(model);
return "OK";
}
/**
* 信息校验
*
* @param models
*/
// /**
// * 信息校验
// *
// * @param models
// */
// private static void checkModel(UseInfo models) {
// if(ValidationUtil.isEmpty(models.getSequenceCode())) {
// throw new BadRequest("设备唯一标识码不能为空!");
......@@ -104,5 +118,24 @@ public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInf
// throw new BadRequest("设备标识码为:"+models.getSequenceCode()+"的设备,"+"同步状态不能为空!");
// }
// }
public String saveEquipmentInfo(EquipmentInfoDto equipmentInfoDto) {
String supervisoryCode = equipmentInfoDto.getSupervisoryCode();
try {
logger.info("supervisoryCode--->" + supervisoryCode);
ResponseModel<Boolean> responseModel = tzsServiceFeignClient.saveEquipmentInfo(equipmentInfoDto);
if (responseModel.getResult()) {
return supervisoryCode;
}
} catch (FeignException e) {
tzsServiceFeignClient.deleteEquipmentInfo(supervisoryCode);
logger.error("监管数据远程调用保存失败--->", e);
e.printStackTrace();
} catch (Exception e) {
logger.error("监管数据保存失败--->", e);
e.printStackTrace();
}
return null;
}
}
......@@ -2,8 +2,11 @@ package com.yeejoin.amos.api.openapi.feign;
import com.yeejoin.amos.api.openapi.config.MultipartSupportConfig;
import com.yeejoin.amos.api.openapi.face.dto.EquipmentInfoDto;
import com.yeejoin.amos.api.openapi.face.model.InspectionDetectionInfoModel;
import com.yeejoin.amos.api.openapi.face.model.UnitLicenceModel;
import com.yeejoin.amos.api.openapi.face.orm.entity.ConstructionInfo;
import com.yeejoin.amos.api.openapi.face.orm.entity.MaintenanceInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -55,4 +58,41 @@ public interface TzsServiceFeignClient {
*/
@RequestMapping(value = "/api/inspectiondetectioninfo/selectInspect", method = RequestMethod.GET)
ResponseModel<InspectionDetectionInfoModel> selectInspect(@RequestParam String superviseCode);
/**
* 保存监管设备数据
*
* @param equipmentInfoDto 请求体
* @return
*/
@RequestMapping(value = "/equipment-category/saveSupervisoryData", method = RequestMethod.POST)
ResponseModel<Boolean> saveEquipmentInfo(@RequestBody EquipmentInfoDto equipmentInfoDto);
/**
* 保存监管设备施工数据
*
* @param constructionInfo 请求体
* @return
*/
@RequestMapping(value = "/equipment-category/saveConstructionInfoData", method = RequestMethod.POST)
ResponseModel<Boolean> saveConstructionInfo(@RequestBody ConstructionInfo constructionInfo);
/**
* 保存监管维保数据
*
* @param maintenanceInfo 请求体
* @return
*/
@RequestMapping(value = "/equipment-category/saveMaintenanceRecordInfoData", method = RequestMethod.POST)
ResponseModel<Boolean> saveMaintenanceRecordInfo(@RequestBody MaintenanceInfo maintenanceInfo);
/**
* 删除监管设备数据
*
* @param record
* @return
*/
@RequestMapping(value = "/equipment-category/deleteByRecord", method = RequestMethod.POST)
ResponseModel<Boolean> deleteEquipmentInfo(@RequestParam String record);
}
spring.application.name=AMOS-API-OPENAPI
spring.application.name=AMOS-API-OPENAPI-tb
server.servlet.context-path=/openapi
server.port=11001
# jdbc_config
spring.datasource.driver-class-name=cn.com.vastbase.Driver
spring.datasource.url=jdbc:vastbase://36.46.137.116:5432/per_tzs_amos_tzs_biz?currentSchema=amos_openapi_cyl
spring.datasource.url=jdbc:vastbase://36.46.151.113:5432/tzs_amos_tzs_biz_test?currentSchema=amos_openapi_cyl
spring.datasource.username=admin
spring.datasource.password=Yeejoin@2023
......@@ -19,7 +19,7 @@ spring.datasource.hikari.connection-test-query=SELECT 1
# REDIS (RedisProperties)
spring.redis.database=1
spring.redis.host=172.16.10.210
spring.redis.host=36.46.151.113
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.redis.lettuce.pool.max-active=200
......@@ -29,20 +29,20 @@ spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
#注册中心地址
eureka.client.service-url.defaultZone =http://admin:a1234560@172.16.10.210:10001/eureka/
eureka.client.service-url.defaultZone =http://admin:a1234560@36.46.151.113:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.10.210:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.10.210:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.10.210:${server.port}${server.servlet.context-path}/swagger-ui.html
eureka.instance.ip-address = 172.16.3.34
eureka.instance.status-page-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.89:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address = 172.16.3.89
##emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.210:1883
emqx.broker=tcp://36.46.151.113:1883
emqx.client-user-name=super
emqx.client-password=123456
......
package com.yeejoin.amos;
import java.text.ParseException;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.component.emq.EmqKeeper;
import com.yeejoin.precontrol.common.listener.mqtt.AmosMqTtlListener;
import com.yeejoin.precontrol.common.listener.mqtt.ExamMqTtRecordListener;
import com.yeejoin.precontrol.common.listener.mqtt.ExamMqTtlListener;
import com.yeejoin.precontrol.common.start.StartPlatformTokenService;
import com.yeejoin.precontrol.common.start.StartRiskService;
import lombok.extern.slf4j.Slf4j;
/**
* @Description: 服务启动类
* @Author: duanwei
* @Date: 2020/8/18
*/
@SpringBootApplication(scanBasePackages = { "com.yeejoin.precontrol", "com.yeejoin.amos",
"com.yeejoin.amos.component.rule", "org.typroject.tyboot.component.emq", "org.typroject.tyboot.component.cache",
"org.typroject.tyboot.core.auth", "org.typroject.tyboot.core.foundation","com.yeejoin.precontrol.common.feign", })
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.yeejoin.precontrol.common.feign","com.yeejoin.amos.boot.module.common.api.feign"
,"com.yeejoin.amos.boot.biz.common.workflow.feign"})
@EnableEurekaClient
//@EnableWebSocket
@EnableAsync
@MapperScan({ "com.yeejoin.precontrol.common.mapper", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao", "org.typroject.tyboot.component.*.face.orm.dao*"
,"com.yeejoin.amos.boot.module.common.api.mapper"
,"com.yeejoin.amos.boot.biz.common.dao.mapper" })
@Slf4j
public class StartPrecontrolService {
@Autowired
private EmqKeeper emqKeeper;
@Autowired
private AmosMqTtlListener amosMqTtlListener;
@Autowired
private ExamMqTtlListener examMqTtlListener;
@Autowired
private ExamMqTtRecordListener examMqTtRecordListener;
@Autowired
private StartPlatformTokenService startPlatformTokenService;
@Autowired
private StartRiskService startRiskService;
public static void main(String[] args) {
SpringApplication.run(StartPrecontrolService.class, args).getEnvironment();
log.info("swagger:--->http://localhost:8060/precontrol/swagger-ui.html");
}
/**
* 使用 websockt注解的时候,使用@EnableScheduling注解后,即开启定时任务 启动的时候一直报错,增加这个bean 则报错解决。
*
* @throws ParseException
*/
@Bean
public TaskScheduler taskScheduler() throws ParseException {
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.setPoolSize(10);
taskScheduler.initialize();
return taskScheduler;
}
/**
* 添加ribbon负载均衡支持
*/
@Bean
@LoadBalanced
RestTemplate initRestTemplate() {
return new RestTemplate();
}
/**
* 初始化MQTT
*
* @throws MqttException
*/
@Bean
void initMqtt() throws MqttException {
emqKeeper.getMqttClient().subscribe("/amos/operation/log", 1, amosMqTtlListener);
emqKeeper.getMqttClient().subscribe("topic_mqtt_exam", 1, examMqTtlListener);
emqKeeper.getMqttClient().subscribe("topic_mqtt_exam_record", 1, examMqTtRecordListener);
}
// /**
// * 如果直接使用springboot的内置容器,而不是使用独立的servlet容器,就要注入ServerEndpointExporter,外部容器则不需要。
// */
// @Bean
// public ServerEndpointExporter serverEndpointExporter() {
// return new ServerEndpointExporter();
// }
@Bean
public void initToken() {
startPlatformTokenService.getToken();
}
@Bean
public void initTask() {
startRiskService.doTimerTask();
}
}
//package com.yeejoin.amos;
//
//import java.text.ParseException;
//
//import org.eclipse.paho.client.mqttv3.MqttException;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.SpringApplication;
//import org.springframework.boot.autoconfigure.SpringBootApplication;
//import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
//import org.springframework.cloud.client.loadbalancer.LoadBalanced;
//import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
//import org.springframework.cloud.openfeign.EnableFeignClients;
//import org.springframework.context.annotation.Bean;
//import org.springframework.scheduling.TaskScheduler;
//import org.springframework.scheduling.annotation.EnableAsync;
//import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
//import org.springframework.web.client.RestTemplate;
//import org.typroject.tyboot.component.emq.EmqKeeper;
//
//import com.yeejoin.precontrol.common.listener.mqtt.AmosMqTtlListener;
//import com.yeejoin.precontrol.common.listener.mqtt.ExamMqTtRecordListener;
//import com.yeejoin.precontrol.common.listener.mqtt.ExamMqTtlListener;
//import com.yeejoin.precontrol.common.start.StartPlatformTokenService;
//import com.yeejoin.precontrol.common.start.StartRiskService;
//
//import lombok.extern.slf4j.Slf4j;
//
///**
// * @Description: 服务启动类
// * @Author: duanwei
// * @Date: 2020/8/18
// */
//@SpringBootApplication(scanBasePackages = { "com.yeejoin.precontrol", "com.yeejoin.amos",
// "com.yeejoin.amos.component.rule", "org.typroject.tyboot.component.emq", "org.typroject.tyboot.component.cache",
// "org.typroject.tyboot.core.auth", "org.typroject.tyboot.core.foundation","com.yeejoin.precontrol.common.feign", })
//@EnableDiscoveryClient
//@EnableFeignClients(basePackages = {"com.yeejoin.precontrol.common.feign","com.yeejoin.amos.boot.module.common.api.feign"
// ,"com.yeejoin.amos.boot.biz.common.workflow.feign"})
//@EnableEurekaClient
////@EnableWebSocket
//@EnableAsync
//@MapperScan({ "com.yeejoin.precontrol.common.mapper", "org.typroject.tyboot.face.*.orm.dao*",
// "org.typroject.tyboot.core.auth.face.orm.dao", "org.typroject.tyboot.component.*.face.orm.dao*"
// ,"com.yeejoin.amos.boot.module.common.api.mapper"
// ,"com.yeejoin.amos.boot.biz.common.dao.mapper" })
//@Slf4j
//public class StartPrecontrolService {
//
// @Autowired
// private EmqKeeper emqKeeper;
//
// @Autowired
// private AmosMqTtlListener amosMqTtlListener;
//
// @Autowired
// private ExamMqTtlListener examMqTtlListener;
//
// @Autowired
// private ExamMqTtRecordListener examMqTtRecordListener;
//
// @Autowired
// private StartPlatformTokenService startPlatformTokenService;
//
// @Autowired
// private StartRiskService startRiskService;
//
// public static void main(String[] args) {
// SpringApplication.run(StartPrecontrolService.class, args).getEnvironment();
// log.info("swagger:--->http://localhost:8060/precontrol/swagger-ui.html");
// }
//
// /**
// * 使用 websockt注解的时候,使用@EnableScheduling注解后,即开启定时任务 启动的时候一直报错,增加这个bean 则报错解决。
// *
// * @throws ParseException
// */
// @Bean
// public TaskScheduler taskScheduler() throws ParseException {
// ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
// taskScheduler.setPoolSize(10);
// taskScheduler.initialize();
// return taskScheduler;
// }
//
// /**
// * 添加ribbon负载均衡支持
// */
// @Bean
// @LoadBalanced
// RestTemplate initRestTemplate() {
// return new RestTemplate();
// }
//
// /**
// * 初始化MQTT
// *
// * @throws MqttException
// */
// @Bean
// void initMqtt() throws MqttException {
// emqKeeper.getMqttClient().subscribe("/amos/operation/log", 1, amosMqTtlListener);
// emqKeeper.getMqttClient().subscribe("topic_mqtt_exam", 1, examMqTtlListener);
// emqKeeper.getMqttClient().subscribe("topic_mqtt_exam_record", 1, examMqTtRecordListener);
// }
//
//// /**
//// * 如果直接使用springboot的内置容器,而不是使用独立的servlet容器,就要注入ServerEndpointExporter,外部容器则不需要。
//// */
//// @Bean
//// public ServerEndpointExporter serverEndpointExporter() {
//// return new ServerEndpointExporter();
//// }
//
// @Bean
// public void initToken() {
// startPlatformTokenService.getToken();
// }
//
// @Bean
// public void initTask() {
// startRiskService.doTimerTask();
// }
//
//}
......@@ -9,5 +9,7 @@ import java.util.Map;
public interface ViewJgClaimMapper {
String supervisoryCode(String code);
Map<String,String> getDetialByCode(String code);
List<Map<String, Object>> getDetialMapList(String record);
}
......@@ -8,6 +8,10 @@
</select>
<select id="getDetialByCode" resultType="java.util.Map">
SELECT * FROM idx_biz_view_jg_claim WHERE SEQUENCE_NBR=#{code}
</select>
<select id="getDetialMapList" resultType="java.util.Map">
SELECT
......
package com.yeejoin.amos.boot.module.app.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.app.api.common.MobileLoginParam;
import com.yeejoin.amos.boot.module.app.api.dto.TzBaseEnterpriseInfoDto;
......@@ -23,6 +27,7 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.robot.AmosRequestContext;
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.PermissionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -37,6 +42,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -57,6 +63,9 @@ import java.util.stream.Collectors;
public class TzsAppController {
@Autowired
private RedisUtils redisUtils;
@Autowired
TzsAppService appService;
@Autowired
private RegUnitInfoMapper regUnitInfoMapper;
......@@ -86,7 +95,27 @@ public class TzsAppController {
@GetMapping(value = "/equipmentInfo")
@ApiOperation(httpMethod = "GET", value = "小程序获取设备详情", notes = "小程序获取设备详情")
public ResponseModel<Object> getEquipmentInfo(String record) {
return ResponseHelper.buildResponse(appService.getEquipmentInfo(record));
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
CompanyModel companys = reginParams.getUserModel().getCompanys().get(0);
Map<String, String> detial = viewJgClaimMapper.getDetialByCode(record);
Map<String, Object> equipmentInfo;
//判断是否有权限查看全部信息
if (LEVEL.equals(companys.getLevel())) {
//企业
if (detial.get("USE_UNIT_CREDIT_CODE").equals(companys.getCompanyCode())) {
equipmentInfo = appService.getEquipmentInfo(record);
} else {
equipmentInfo = appService.getEquipmentInfoWX(record);
}
} else {
//监管
if (detial.get("ORG_BRANCH_CODE").contains(companys.getOrgCode())) {
equipmentInfo = appService.getEquipmentInfo(record);
} else {
equipmentInfo = appService.getEquipmentInfoWX(record);
}
}
return ResponseHelper.buildResponse(equipmentInfo);
}
/**
......
......@@ -29,5 +29,5 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
List<String> selectUserIds();
List<GroupAndPersonInfoDto> getUnitInfoByUserIds(@Param("userIds")List<String> userIds);
List<GroupAndPersonInfoDto> getUnitInfoByUserId(Long groupId);
}
......@@ -8,12 +8,15 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.VerifyCodeAuthModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Collection;
@FeignClient(value = "AMOS-API-PRIVILEGE", configuration = {FeignConfiguration.class})
public interface PrivilegeFeginService {
......@@ -24,6 +27,9 @@ public interface PrivilegeFeginService {
@RequestMapping(value = "/privilege/v1/company/tree", method = RequestMethod.GET)
FeignClientResult tree(@RequestHeader("token") String token, @RequestHeader("appKey") String appKey, @RequestHeader("product") String product);
@RequestMapping(value = {"/privilege/v1/company/tree/cache"}, method = {RequestMethod.GET})
FeignClientResult queryAgencyTreeForCache(@RequestHeader("token") String token, @RequestHeader("appKey") String appKey, @RequestHeader("product") String product) throws InnerInvokException;
//获取省级行政区划
@RequestMapping(value = "systemctl/v1/region/level", method = RequestMethod.GET)
FeignClientResult getProvince(@RequestParam String level);
......
......@@ -180,26 +180,28 @@
GROUP BY tui.amos_user_id
</select>
<select id="getUnitInfoByUserIds" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto">
<select id="getUnitInfoByUserId" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto">
SELECT
${groupId} groupId,
tui.amos_user_id userId,
tui.amos_user_name userName,
tui.unit_name,
tui.unit_code,
replace(tzei.unit_type,'#', ',') unitType,
tzei.equip_category
REPLACE ( tzei.unit_type, '#', ',' ) unitType,
tzei.equip_category,
pc.org_code unitOrgCode
FROM
tzs_user_info tui
LEFT JOIN tz_base_enterprise_info tzei ON tui.unit_code = tzei.use_code
<where>
tzei.equip_category is not null
and tzei.is_delete = '0'
<if test="userIds != null and userIds.size() > 0">
and amos_user_id in
<foreach item="item" collection="userIds" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
</where>
LEFT JOIN privilege_company pc ON tui.unit_code = pc.company_code
WHERE
tzei.equip_category IS NOT NULL
AND tui.userId IS NOT NULL
AND tui.unit_code IS NOT NULL
AND pc.org_code IS NOT NULL
AND tzei.is_delete = '0'
AND pc.is_deleted = 'f'
AND tzei.unit_type <![CDATA[<>]]> '检验检测机构'
AND tui.amos_user_id IN (SELECT USER_ID FROM privilege_group_user WHERE GROUP_SEQ = #{groupId})
</select>
</mapper>
\ No newline at end of file
......@@ -23,6 +23,7 @@ import com.yeejoin.amos.boot.module.tcm.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.tcm.flc.api.feign.IdxFeignService;
import com.yeejoin.amos.boot.module.tcm.flc.api.feign.PrivilegeFeginService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.search.SearchRequest;
......@@ -290,7 +291,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Override
public List<LinkedHashMap> creatTree() {
FeignClientResult tree = privilegeFeginService.tree(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
FeignClientResult tree = privilegeFeginService.queryAgencyTreeForCache(RequestContext.getToken(), RequestContext.getAppKey(), RequestContext.getProduct());
List<LinkedHashMap> result = (List<LinkedHashMap>) tree.getResult();
List<LinkedHashMap> treeData = deleteRegulatorTreeData(result);
List<LinkedHashMap> supervisionTree = treeData.stream().filter(e -> code.equals(e.get("orgCode"))).collect(Collectors.toList());
......
......@@ -457,28 +457,12 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override
public List<GroupAndPersonInfoDto> getGroupAndPersonInfo(Long groupId) {
RequestContext.setProduct(amosRequestContext.getProduct());
RequestContext.setAppKey(amosRequestContext.getAppKey());
RequestContext.setToken(amosRequestContext.getToken());
List<GroupAndPersonInfoDto> result = new ArrayList<>();
List<AgencyUserModel> agencyUserModelList = Privilege.groupUserClient.queryForList(groupId).getResult();
List<CompanyModel> companyModelList = Privilege.companyClient.queryForCompanyList(null, "company").getResult();
HashMap<String,Object> companyMap = new HashMap<>();
for (CompanyModel companyModel : companyModelList) {
companyMap.put(companyModel.getCompanyCode(), companyModel.getOrgCode());
}
StopWatch stopWatch = new StopWatch();
stopWatch.start();
List<String> UserIds = agencyUserModelList.stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
List<GroupAndPersonInfoDto> groupAndPersonInfoDtoList = tzsUserInfoMapper.getUnitInfoByUserIds(UserIds);
List<GroupAndPersonInfoDto> groupAndPersonInfoDtoList = tzsUserInfoMapper.getUnitInfoByUserId(groupId);
DataDictionary dataDictionary = iDataDictionaryService.getByExtend(groupId.toString(), QYRYGW);
for (GroupAndPersonInfoDto groupAndPersonInfoDto : groupAndPersonInfoDtoList) {
if (!ObjectUtils.isEmpty(groupAndPersonInfoDto)) {
groupAndPersonInfoDto.setGroupId(groupId);
groupAndPersonInfoDto.setGroupName(ObjectUtils.isEmpty(dataDictionary) ? null : dataDictionary.getName());
String unitOrgCode = String.valueOf(companyMap.get(groupAndPersonInfoDto.getUnitCode()));
groupAndPersonInfoDto.setUnitOrgCode("null".equals(unitOrgCode)? null: unitOrgCode);
String[] UnitType = groupAndPersonInfoDto.getUnitType().split(",");
if (UnitType.length > 0) {
StringBuilder unitTypeCode = new StringBuilder();
......@@ -516,8 +500,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
result.add(groupAndPersonInfoDto);
}
}
stopWatch.stop();
System.out.printf("组装数据耗时%f秒/n", stopWatch.getTotalTimeSeconds());
return result;
}
......
......@@ -7,11 +7,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.210:10001/eureka/
eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=*
eureka.instance.health-check-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url=http://172.16.3.17:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.17:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.17
eureka.instance.status-page-url=http://172.16.3.89:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.89:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.89
## ES properties:
elasticsearch.username=elastic
elasticsearch.password=a123456
......
spring.application.name=TZS-COMMON
spring.application.name=TZS-COMMON-tb
server.servlet.context-path=/tcm
server.port=11002
spring.profiles.active=dev
......
......@@ -39,6 +39,12 @@
<artifactId>jsoup</artifactId>
<version>1.11.2</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>4.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
......@@ -162,6 +162,12 @@
<artifactId>vastbase-jdbc</artifactId>
<version>2.7v</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>4.0.0</version>
<scope>compile</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.shardingsphere</groupId>-->
<!-- <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
......
package com.yeejoin.amos.patrol.business.vo;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
@Data
public class PlanTaskVo {
private long id;
@Excel(name = "计划批号", orderNum = "0")
@Excel(name = "计划批号", orderNum = "0", width = 30)
private String batchNo;
@Excel(name = "计划名称", orderNum = "1")
@Excel(name = "计划名称", orderNum = "1", width = 30)
private String planName;
private long planId;
@Excel(name = "巡检路线", orderNum = "2")
@Excel(name = "巡检路线", orderNum = "2", width = 20)
private String routeName;
@Excel(name = "点编号", orderNum = "3")
private String pointNo;
@Excel(name = "点名称", orderNum = "4")
@Excel(name = "点名称", orderNum = "4", width = 30)
private String pointName;
@Excel(name = "开始时间", orderNum = "5")
@Excel(name = "开始时间", orderNum = "5", width = 20)
private String beginTime;
@Excel(name = "结束时间", orderNum = "6")
@Excel(name = "结束时间", orderNum = "6", width = 20)
private String endTime;
@Excel(name = "执行情况", replace = {"尚未巡检_0", "按时完成_1", "超时漏检_2"}, orderNum = "7")
private String status;
@Excel(name = "巡检人员", orderNum = "8")
@Excel(name = "巡检人员", orderNum = "8", width = 20)
private String userName;
private long deptId;
@Excel(name = "巡检部门", orderNum = "9")
@Excel(name = "巡检部门", orderNum = "9", width = 30)
private String deptName;
@Excel(name = "备注说明", orderNum = "10")
private String remark;
......
package com.yeejoin.amos.boot.module.ymt.api.dto;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import lombok.Data;
import java.util.Map;
@Data
public class EquipmentMessageDto {
/**
* 使用信息
*/
private IdxBizJgUseInfo useInfo;
/**
* 设计制造
*/
private IdxBizJgDesignInfo designInfo;
/**
* 制造信息
*/
private IdxBizJgFactoryInfo factoryInfo;
// /**
// * 施工信息
// */
// private List<IdxBizJgConstructionInfo> constructionInfo;
/**
* 注册登记
*/
private IdxBizJgRegisterInfo registerInfo;
/**
* 维保备案
*/
private IdxBizJgMaintenanceRecordInfo maintenanceRecordInfo;
/**
* 监管信息
*/
private IdxBizJgSupervisionInfo supervisionInfo;
/**
* 其他信息
*/
private IdxBizJgOtherInfo otherInfo;
// /**
// * 检验检测
// */
// private List<IdxBizJgInspectionDetectionInfo> idxBizJgInspectionDetectionInfo;
// /**
// * 主要零部件
// */
// private List<IdxBizJgMainParts> mainParts;
// /**
// * 保护装置
// */
// private List<IdxBizJgProtectionDevices> protectionDevices;
/**
* 设备参数信息
*/
private Map<String, Object> params;
/**
* 操作类型 1 新增 0 修改
*/
private Integer saveStatus;
/**
* 监管码
*/
private String supervisoryCode;
}
......@@ -71,4 +71,7 @@ public class IdxBizJgConstructionInfo extends TzsBaseEntity {
@TableField("\"SEQUENCE_CODE\"")
private String sequenceCode;
@TableField(exist = false)
private String supervisoryCode;
}
......@@ -101,4 +101,6 @@ public class IdxBizJgInspectionDetectionInfo extends TzsBaseEntity {
@TableField("\"SEQUENCE_CODE\"")
private String sequenceCode;
@TableField(exist = false)
private String supervisoryCode;
}
......@@ -115,4 +115,6 @@ public class IdxBizJgMaintenanceRecordInfo extends TzsBaseEntity {
@TableField("\"SEQUENCE_CODE\"")
private String sequenceCode;
@TableField(exist = false)
private String supervisoryCode;
}
......@@ -3,18 +3,11 @@
<mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper">
<select id="selectInspection" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo">
SELECT
*
FROM
idx_biz_jg_inspection_detection_info
WHERE
"RECORD" = ( SELECT "RECORD" FROM "idx_biz_jg_other_info" WHERE "SUPERVISORY_CODE" = #{superviseCode} )
ORDER BY
"INSPECT_DATE" DESC
LIMIT 1
SELECT *
FROM idx_biz_jg_inspection_detection_info
WHERE "RECORD" = (SELECT "RECORD" FROM "idx_biz_jg_other_info" WHERE "SUPERVISORY_CODE" = #{superviseCode})
ORDER BY "INSPECT_DATE" DESC
LIMIT 1
</select>
</mapper>
\ No newline at end of file
......@@ -9,10 +9,13 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.ymt.api.common.CommonException;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipExportDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentMessageDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ImageSizeEnums;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
......@@ -29,7 +32,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -41,7 +52,12 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -544,5 +560,36 @@ public class EquipmentCategoryController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/saveSupervisoryData")
@ApiOperation(httpMethod = "POST", value = "监管设备数据保存", notes = "监管设备保存")
public ResponseModel<Boolean> saveSupervisoryData(@RequestBody EquipmentMessageDto data) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveSupervisoryData(data));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/saveConstructionInfoData")
@ApiOperation(httpMethod = "POST", value = "监管设备施工数据保存", notes = "监管设备施工数据保存")
public ResponseModel<Boolean> saveConstructionInfoData(@RequestBody IdxBizJgConstructionInfo data) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveConstructionInfoData(data));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/saveMaintenanceRecordInfoData")
@ApiOperation(httpMethod = "POST", value = "监管设备维保数据保存", notes = "监管设备维保数据保存")
public ResponseModel<Boolean> saveMaintenanceRecordInfoData(@RequestBody IdxBizJgMaintenanceRecordInfo data) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveMaintenanceRecordInfoData(data));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/saveDetectionInfoData")
@ApiOperation(httpMethod = "POST", value = "监管设备检验检测数据保存", notes = "监管设备检验检测数据保存")
public ResponseModel<Boolean> saveDetectionInfoData(@RequestBody IdxBizJgInspectionDetectionInfo data) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveDetectionInfoData(data));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/deleteByRecord")
@ApiOperation(httpMethod = "POST", value = "数据异常回滚", notes = "数据异常回滚")
public ResponseModel<Boolean> saveDetectionInfoData(@RequestParam("record") String record) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.deleteByRecord(record));
}
}
package com.yeejoin.amos.boot.module.ymt.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -10,15 +11,53 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipExportDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentMessageDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.entity.EsElevator;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgFactoryInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMainParts;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProtectionDevices;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgSupervisionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsBoiler;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsElevator;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsLifting;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsPipeline;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsRides;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsRopeway;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsVehicle;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgTechParamsVessel;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.SupervisoryCodeInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentCategoryEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryDataMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgFactoryInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgMainPartsMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProtectionDevicesMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsBoilerMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsElevatorMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsLiftingMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsPipelineMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsRidesMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsRopewayMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsVehicleMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsVesselMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.SupervisoryCodeInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.service.IEquipmentCategoryService;
import com.yeejoin.amos.boot.module.ymt.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.ymt.biz.dao.ESElavtorRepository;
......@@ -69,7 +108,19 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.StringJoiner;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
......@@ -445,17 +496,10 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
isNotXiXian = "null".equals(String.valueOf(map.get("isXiXian"))) ? "0" : "1";
//生成码
EquipmentCategoryServiceImpl categoryService = (EquipmentCategoryServiceImpl) AopContext.currentProxy();
Map<String, String> codeMap = categoryService.creatCode(isNotXiXian, city, county, equipCategory, null, null);
Map<String, String> codeMap = creatCode(isNotXiXian, city, county, equipCategory, "null", "null");
if (ObjectUtils.isEmpty(codeMap)) {
throw new BadRequest("该请求参数未生成监管码或96333码,请核对参数");
}
String equState = EquipmentCategoryEnum.CSZT.getCode();
SupervisoryCodeInfo supervisoryCodeInfo = new SupervisoryCodeInfo();
supervisoryCodeInfo.setCode96333(codeMap.get("code96333"));
supervisoryCodeInfo.setSupervisoryCode(codeMap.get("superviseCode"));
supervisoryCodeInfo.setStatus(equState);
supervisoryCodeInfoMapper.insert(supervisoryCodeInfo);
return codeMap;
}
......@@ -2171,4 +2215,231 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
return totle;
}
@Transactional
public Boolean saveSupervisoryData(EquipmentMessageDto data) {
if (ObjectUtils.isEmpty(data) || ObjectUtils.isEmpty(data.getSupervisoryCode())) {
return false;
}
Date date = new Date();
String supervisoryCode = data.getSupervisoryCode();
Integer saveStatus = data.getSaveStatus();
Integer alias = 0;
// 使用信息
if (!ObjectUtils.isEmpty(data.getUseInfo())) {
IdxBizJgUseInfo useInfo = data.getUseInfo();
useInfo.setRecDate(date);
if (saveStatus == 1) {
useInfo.setRecord(supervisoryCode);
useInfo.setClaimDate(date);
useInfo.setCreateDate(date);
useInfo.setDataSource("1");
idxBizJgUseInfoService.save(useInfo);
} else {
LambdaQueryWrapper<IdxBizJgUseInfo> lambda = new QueryWrapper<IdxBizJgUseInfo>().lambda();
lambda.eq(IdxBizJgUseInfo::getRecord, supervisoryCode);
idxBizJgUseInfoService.update(data.getUseInfo(), lambda);
}
}
// 设计信息
if (!ObjectUtils.isEmpty(data.getDesignInfo())) {
IdxBizJgDesignInfo designInfo = data.getDesignInfo();
designInfo.setRecDate(date);
if (saveStatus == 1) {
designInfo.setRecord(supervisoryCode);
idxBizJgDesignInfoService.save(designInfo);
} else {
LambdaQueryWrapper<IdxBizJgDesignInfo> lambda = new QueryWrapper<IdxBizJgDesignInfo>().lambda();
lambda.eq(IdxBizJgDesignInfo::getRecord, supervisoryCode);
idxBizJgDesignInfoService.update(designInfo, lambda);
}
}
// 制造信息
if (!ObjectUtils.isEmpty(data.getFactoryInfo())) {
IdxBizJgFactoryInfo factoryInfo = data.getFactoryInfo();
factoryInfo.setRecDate(date);
if (saveStatus == 1) {
factoryInfo.setRecord(supervisoryCode);
idxBizJgFactoryInfoService.save(factoryInfo);
} else {
LambdaQueryWrapper<IdxBizJgFactoryInfo> lambda = new QueryWrapper<IdxBizJgFactoryInfo>().lambda();
lambda.eq(IdxBizJgFactoryInfo::getRecord, supervisoryCode);
idxBizJgFactoryInfoService.update(factoryInfo, lambda);
}
}
// 注册登记
if (!ObjectUtils.isEmpty(data.getRegisterInfo())) {
IdxBizJgRegisterInfo registerInfo = data.getRegisterInfo();
registerInfo.setRecDate(date);
if (saveStatus == 1) {
registerInfo.setRecord(supervisoryCode);
alias = Integer.parseInt(String.valueOf(ValidationUtil.isEmpty(registerInfo.getEquList()) ? 3000 :
registerInfo.getEquList()));
registerInfo.setEquList("3000");
idxBizJgRegisterInfoService.save(registerInfo);
} else {
LambdaQueryWrapper<IdxBizJgRegisterInfo> lambda = new QueryWrapper<IdxBizJgRegisterInfo>().lambda();
lambda.eq(IdxBizJgRegisterInfo::getRecord, supervisoryCode);
idxBizJgRegisterInfoService.update(registerInfo, lambda);
}
}
// 维保信息
if (!ObjectUtils.isEmpty(data.getMaintenanceRecordInfo())) {
IdxBizJgMaintenanceRecordInfo maintenanceRecordInfo = data.getMaintenanceRecordInfo();
maintenanceRecordInfo.setRecDate(date);
if (saveStatus == 1) {
maintenanceRecordInfo.setRecord(supervisoryCode);
idxBizJgMaintenanceRecordInfoService.save(maintenanceRecordInfo);
} else {
LambdaQueryWrapper<IdxBizJgMaintenanceRecordInfo> lambda = new QueryWrapper<IdxBizJgMaintenanceRecordInfo>().lambda();
lambda.eq(IdxBizJgMaintenanceRecordInfo::getRecord, supervisoryCode);
idxBizJgMaintenanceRecordInfoService.update(maintenanceRecordInfo, lambda);
}
}
// 其他信息
if (!ObjectUtils.isEmpty(data.getOtherInfo())) {
IdxBizJgOtherInfo otherInfo = data.getOtherInfo();
otherInfo.setRecDate(date);
if (saveStatus == 1) {
otherInfo.setRecord(supervisoryCode);
otherInfo.setClaimStatus("已认领");
otherInfo.setAlias(alias);
idxBizJgOtherInfoService.save(otherInfo);
} else {
LambdaQueryWrapper<IdxBizJgOtherInfo> lambda = new QueryWrapper<IdxBizJgOtherInfo>().lambda();
lambda.eq(IdxBizJgOtherInfo::getRecord, supervisoryCode);
idxBizJgOtherInfoService.update(otherInfo, lambda);
}
}
// 监管信息
if (!ObjectUtils.isEmpty(data.getSupervisionInfo())) {
IdxBizJgSupervisionInfo supervisionInfo = data.getSupervisionInfo();
supervisionInfo.setRecDate(date);
if (saveStatus == 1) {
supervisionInfo.setRecord(supervisoryCode);
idxBizJgSupervisionInfoService.save(supervisionInfo);
} else {
LambdaQueryWrapper<IdxBizJgSupervisionInfo> lambda = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda();
lambda.eq(IdxBizJgSupervisionInfo::getRecord, supervisoryCode);
idxBizJgSupervisionInfoService.update(supervisionInfo, lambda);
}
}
// 参数信息
if (!ObjectUtils.isEmpty(data.getParams())) {
Map<String, Object> params = data.getParams();
IdxBizJgTechParamsElevator idxBizJgTechParamsElevator = new IdxBizJgTechParamsElevator();
BeanUtil.copyProperties(params, idxBizJgTechParamsElevator);
idxBizJgTechParamsElevator.setRecDate(date);
if (saveStatus == 1) {
idxBizJgTechParamsElevator.setRecord(supervisoryCode);
idxBizJgTechParamsElevatorService.save(idxBizJgTechParamsElevator);
} else {
LambdaQueryWrapper<IdxBizJgTechParamsElevator> lambda = new QueryWrapper<IdxBizJgTechParamsElevator>().lambda();
lambda.eq(IdxBizJgTechParamsElevator::getRecord, supervisoryCode);
idxBizJgTechParamsElevatorService.update(idxBizJgTechParamsElevator, lambda);
}
}
checkEsData(supervisoryCode);
return true;
}
@Transactional
public Boolean saveConstructionInfoData(IdxBizJgConstructionInfo data) {
if (!ObjectUtils.isEmpty(data) && !ObjectUtils.isEmpty(data.getSupervisoryCode())){
String supervisoryCode = data.getSupervisoryCode();
data.setRecDate(new Date());
if (!ObjectUtils.isEmpty(data.getSequenceNbr())){
idxBizJgConstructionInfoService.updateById(data);
}else {
data.setRecord(supervisoryCode);
idxBizJgConstructionInfoService.save(data);
}
}else {
return false;
}
return true;
}
@Transactional
public Boolean saveMaintenanceRecordInfoData(IdxBizJgMaintenanceRecordInfo data) {
if (!ObjectUtils.isEmpty(data) && !ObjectUtils.isEmpty(data.getSupervisoryCode())){
String supervisoryCode = data.getSupervisoryCode();
data.setRecDate(new Date());
if (!ObjectUtils.isEmpty(data.getSequenceNbr())){
idxBizJgMaintenanceRecordInfoService.updateById(data);
}else {
data.setRecord(supervisoryCode);
idxBizJgMaintenanceRecordInfoService.save(data);
}
}else {
return false;
}
return true;
}
@Transactional
public Boolean saveDetectionInfoData(IdxBizJgInspectionDetectionInfo data) {
if (!ObjectUtils.isEmpty(data) && !ObjectUtils.isEmpty(data.getSupervisoryCode())){
String supervisoryCode = data.getSupervisoryCode();
data.setRecDate(new Date());
if (!ObjectUtils.isEmpty(data.getSequenceNbr())){
idxBizJgInspectionDetectionInfoService.updateById(data);
}else {
data.setRecord(supervisoryCode);
idxBizJgInspectionDetectionInfoService.save(data);
}
}else {
return false;
}
return true;
}
public Boolean deleteByRecord(String record) {
if (!ObjectUtils.isEmpty(record)){
// 使用信息删除
LambdaQueryWrapper<IdxBizJgUseInfo> lambda = new QueryWrapper<IdxBizJgUseInfo>().lambda();
lambda.eq(IdxBizJgUseInfo::getRecord, record);
idxBizJgUseInfoService.getBaseMapper().delete(lambda);
// 设计信息删除
LambdaQueryWrapper<IdxBizJgDesignInfo> lambdaDes = new QueryWrapper<IdxBizJgDesignInfo>().lambda();
lambdaDes.eq(IdxBizJgDesignInfo::getRecord, record);
idxBizJgDesignInfoService.getBaseMapper().delete(lambdaDes);
// 制造信息删除
LambdaQueryWrapper<IdxBizJgFactoryInfo> lambdaFac = new QueryWrapper<IdxBizJgFactoryInfo>().lambda();
lambdaFac.eq(IdxBizJgFactoryInfo::getRecord, record);
idxBizJgFactoryInfoService.getBaseMapper().delete(lambdaFac);
// 施工信息删除
LambdaQueryWrapper<IdxBizJgConstructionInfo> lambdaCon = new QueryWrapper<IdxBizJgConstructionInfo>().lambda();
lambdaCon.eq(IdxBizJgConstructionInfo::getRecord, record);
idxBizJgConstructionInfoService.getBaseMapper().delete(lambdaCon);
// 注册信息删除
LambdaQueryWrapper<IdxBizJgRegisterInfo> lambdaReg = new QueryWrapper<IdxBizJgRegisterInfo>().lambda();
lambdaReg.eq(IdxBizJgRegisterInfo::getRecord, record);
idxBizJgRegisterInfoService.getBaseMapper().delete(lambdaReg);
// 维保信息删除
LambdaQueryWrapper<IdxBizJgMaintenanceRecordInfo> lambdaMain = new QueryWrapper<IdxBizJgMaintenanceRecordInfo>().lambda();
lambdaMain.eq(IdxBizJgMaintenanceRecordInfo::getRecord, record);
idxBizJgMaintenanceRecordInfoService.getBaseMapper().delete(lambdaMain);
// 监督信息删除
LambdaQueryWrapper<IdxBizJgSupervisionInfo> lambdaSup = new QueryWrapper<IdxBizJgSupervisionInfo>().lambda();
lambdaSup.eq(IdxBizJgSupervisionInfo::getRecord, record);
idxBizJgSupervisionInfoService.getBaseMapper().delete(lambdaSup);
// 其他信息删除
LambdaQueryWrapper<IdxBizJgOtherInfo> lambdaOth = new QueryWrapper<IdxBizJgOtherInfo>().lambda();
lambdaOth.eq(IdxBizJgOtherInfo::getRecord, record);
idxBizJgOtherInfoService.getBaseMapper().delete(lambdaOth);
// 检验检测信息删除
LambdaQueryWrapper<IdxBizJgInspectionDetectionInfo> lambdaIns = new QueryWrapper<IdxBizJgInspectionDetectionInfo>().lambda();
lambdaIns.eq(IdxBizJgInspectionDetectionInfo::getRecord, record);
idxBizJgInspectionDetectionInfoService.getBaseMapper().delete(lambdaIns);
// 参数删除
LambdaQueryWrapper<IdxBizJgTechParamsElevator> lambdaPar = new QueryWrapper<IdxBizJgTechParamsElevator>().lambda();
lambdaPar.eq(IdxBizJgTechParamsElevator::getRecord, record);
idxBizJgTechParamsElevatorService.getBaseMapper().delete(lambdaPar);
}else {
return false;
}
return true;
}
}
\ No newline at end of file
......@@ -20,16 +20,17 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class InspectionDetectionInfoServiceImpl extends BaseService<InspectionDetectionInfoModel, InspectionDetectionInfo, InspectionDetectionInfoMapper> implements InspectionDetectionInfoService {
@Autowired
private InspectionDetectionInfoMapper inspectionDetectionInfo;
public InspectionDetectionInfoModel selectInspect(String superviseCode) {
InspectionDetectionInfoModel inspectionDetectionInfoDto = new InspectionDetectionInfoModel();
if (ValidationUtil.isEmpty(superviseCode)) {
return inspectionDetectionInfoDto;
}
InspectionDetectionInfo inspectionDetectionInfo = this.inspectionDetectionInfo.selectInspection(superviseCode);
BeanUtils.copyProperties(inspectionDetectionInfo,inspectionDetectionInfoDto);
inspectionDetectionInfoDto.setSuperviseCode(superviseCode);
return inspectionDetectionInfoDto;
}
@Autowired
private InspectionDetectionInfoMapper inspectionDetectionInfo;
public InspectionDetectionInfoModel selectInspect(String superviseCode) {
InspectionDetectionInfoModel inspectionDetectionInfoDto = new InspectionDetectionInfoModel();
if (ValidationUtil.isEmpty(superviseCode)) {
return inspectionDetectionInfoDto;
}
InspectionDetectionInfo inspectionDetectionInfo = this.inspectionDetectionInfo.selectInspection(superviseCode);
BeanUtils.copyProperties(inspectionDetectionInfo, inspectionDetectionInfoDto);
inspectionDetectionInfoDto.setSuperviseCode(superviseCode);
return inspectionDetectionInfoDto;
}
}
\ No newline at end of file
......@@ -316,27 +316,27 @@
</repositories>
<modules>
<module>amos-boot-module</module>
<!-- <module>amos-boot-module</module>-->
<module>amos-boot-biz-common</module>
<module>amos-boot-system-tzs</module>
<module>amos-boot-system-jcs</module>
<module>amos-boot-system-knowledgebase</module>
<module>amos-boot-system-fas</module>
<module>amos-boot-system-patrol</module>
<module>amos-boot-system-maintenance</module>
<module>amos-boot-system-supervision</module>
<module>amos-boot-system-equip</module>
<!-- <module>amos-boot-system-jcs</module>-->
<!-- <module>amos-boot-system-knowledgebase</module>-->
<!-- <module>amos-boot-system-fas</module>-->
<!-- <module>amos-boot-system-patrol</module>-->
<!-- <module>amos-boot-system-maintenance</module>-->
<!-- <module>amos-boot-system-supervision</module>-->
<!-- <module>amos-boot-system-equip</module>-->
<module>amos-boot-core</module>
<module>amos-boot-utils</module>
<module>amos-boot-system-latentdanger</module>
<module>amos-boot-system-ccs</module>
<!-- <module>amos-boot-system-latentdanger</module>-->
<!-- <module>amos-boot-system-ccs</module>-->
<module>amos-boot-data</module>
<module>amos-boot-system-precontrol</module>
<module>amos-boot-system-cas</module>
<module>amos-boot-system-ugp</module>
<module>amos-boot-system-tdc</module>
<module>amos-boot-system-kgd</module>
<module>amos-boot-system-file</module>
<module>amos-boot-system-jxiop</module>
<!-- <module>amos-boot-system-precontrol</module>-->
<!-- <module>amos-boot-system-cas</module>-->
<!-- <module>amos-boot-system-ugp</module>-->
<!-- <module>amos-boot-system-tdc</module>-->
<!-- <module>amos-boot-system-kgd</module>-->
<!-- <module>amos-boot-system-file</module>-->
<!-- <module>amos-boot-system-jxiop</module>-->
</modules>
</project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment