Commit 7303f189 authored by tianbo's avatar tianbo

监管对接修改

parent 672ce7e8
...@@ -2,17 +2,55 @@ package com.yeejoin.amos.api.openapi.controller; ...@@ -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.ResponseHelper;
import com.yeejoin.amos.api.common.restful.utils.ResponseModel; import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.api.openapi.face.model.*; import com.yeejoin.amos.api.openapi.face.dto.EquipmentInfoDto;
import com.yeejoin.amos.api.openapi.face.orm.entity.*; import com.yeejoin.amos.api.openapi.face.model.ElevatorTechInfoModel;
import com.yeejoin.amos.api.openapi.face.service.*; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; 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.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType; 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.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -98,8 +136,11 @@ public class SuperviseController { ...@@ -98,8 +136,11 @@ public class SuperviseController {
@ApiOperation(value = "新增施工信息") @ApiOperation(value = "新增施工信息")
@PostMapping(value = "/constructionInfo") @PostMapping(value = "/constructionInfo")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveConstructionInfo(@RequestBody List<ConstructionInfo> constructionInfo) throws Exception { public ResponseModel<String> saveConstructionInfo(@RequestBody List<ConstructionInfo> constructionInfoList) {
return ResponseHelper.buildResponse(constructionInfoService.saveConstructionInfo(constructionInfo)); if (ValidationUtil.isEmpty(constructionInfoList)) {
throw new BadRequest("上送数据为空");
}
return ResponseHelper.buildResponse(constructionInfoService.saveConstructionInfo(constructionInfoList.get(0)));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
...@@ -122,8 +163,11 @@ public class SuperviseController { ...@@ -122,8 +163,11 @@ public class SuperviseController {
@ApiOperation(value = "新增维保单位信息") @ApiOperation(value = "新增维保单位信息")
@PostMapping(value = "/maintenanceInfo") @PostMapping(value = "/maintenanceInfo")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
public ResponseModel<String> saveMaintenanceInfo(@RequestBody List<MaintenanceInfoModel> maintenanceInfo) throws Exception { public ResponseModel<String> saveMaintenanceInfo(@RequestBody List<MaintenanceInfo> maintenanceInfoList) {
return ResponseHelper.buildResponse(maintenanceInfoService.saveMaintenanceInfo(maintenanceInfo)); if (ValidationUtil.isEmpty(maintenanceInfoList)) {
throw new BadRequest("上送数据为空");
}
return ResponseHelper.buildResponse(maintenanceInfoService.saveMaintenanceInfo(maintenanceInfoList.get(0)));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
...@@ -207,7 +251,7 @@ public class SuperviseController { ...@@ -207,7 +251,7 @@ public class SuperviseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "赋码") @ApiOperation(value = "赋码")
@PostMapping(value = "/generation/code") @PostMapping(value = "/generation/code")
@RestEventTrigger(value = "openapiLogEventHandler") @RestEventTrigger(value = "openapiLogEventHandler")
...@@ -230,4 +274,17 @@ public class SuperviseController { ...@@ -230,4 +274,17 @@ public class SuperviseController {
public ResponseModel<InspectionDetectionInfoModel> selectInspect(@RequestParam String superviseCode) { public ResponseModel<InspectionDetectionInfoModel> selectInspect(@RequestParam String superviseCode) {
return ResponseHelper.buildResponse(inspectionInfoService.selectInspect(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.getSupervisionInfo().getSupervisoryCode();
if (ValidationUtil.isEmpty(equipmentInfoDto.getSupervisionInfo()) || 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;
}
...@@ -3,6 +3,10 @@ package com.yeejoin.amos.api.openapi.face.service; ...@@ -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.model.ConstructionInfoModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.ConstructionInfoMapper; 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.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.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -19,6 +23,24 @@ import java.util.List; ...@@ -19,6 +23,24 @@ import java.util.List;
*/ */
@Component @Component
public class ConstructionInfoService extends AppBaseService<ConstructionInfoModel, ConstructionInfo, ConstructionInfoMapper> { 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; 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.model.MaintenanceInfoModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.MaintenanceInfoMapper; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -26,32 +26,53 @@ import java.util.List; ...@@ -26,32 +26,53 @@ import java.util.List;
@Component @Component
public class MaintenanceInfoService extends AppBaseService<MaintenanceInfoModel, MaintenanceInfo, MaintenanceInfoMapper> { public class MaintenanceInfoService extends AppBaseService<MaintenanceInfoModel, MaintenanceInfo, MaintenanceInfoMapper> {
@Autowired private static final Logger logger = LogManager.getLogger(ConstructionInfoService.class);
private JgFileService fileService;
/** @Autowired
* TzsServiceFeignClient tzsServiceFeignClient;
* 新增维保备案信息
*
* @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<>(); @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> fileList = new ArrayList<>();
// List<JgFile> repairInformList; // List<JgFile> repairInformList;
for (MaintenanceInfoModel models : model) { for (MaintenanceInfoModel models : model) {
MaintenanceInfo maintenanceInfo = new MaintenanceInfo(); MaintenanceInfo maintenanceInfo = new MaintenanceInfo();
// checkModel(models); // checkModel(models);
models.setRecDate(new Date()); models.setRecDate(new Date());
models.setAppId(getAppId()); models.setAppId(getAppId());
// repairInformList = JSONObject.parseArray(JSONObject.toJSONString(models.getRepairInform()), JgFile.class); // repairInformList = JSONObject.parseArray(JSONObject.toJSONString(models.getRepairInform()), JgFile.class);
// //
...@@ -67,19 +88,19 @@ public class MaintenanceInfoService extends AppBaseService<MaintenanceInfoModel, ...@@ -67,19 +88,19 @@ public class MaintenanceInfoService extends AppBaseService<MaintenanceInfoModel,
// file.setRecDate(new Date()); // file.setRecDate(new Date());
// fileList.add(file); // fileList.add(file);
// } // }
BeanUtils.copyProperties(models,maintenanceInfo); BeanUtils.copyProperties(models, maintenanceInfo);
mainList.add(maintenanceInfo); mainList.add(maintenanceInfo);
} }
this.saveBatch(mainList); this.saveBatch(mainList);
// fileService.saveBatch(fileList); // fileService.saveBatch(fileList);
return "OK"; return "OK";
} }
/** /**
* 信息校验 * 信息校验
* *
* @param models * @param models
*/ */
// private static void checkModel(MaintenanceInfoModel models) { // private static void checkModel(MaintenanceInfoModel models) {
// if(ValidationUtil.isEmpty(models.getSequenceCode())) { // if(ValidationUtil.isEmpty(models.getSequenceCode())) {
// throw new BadRequest("设备唯一标识码不能为空!"); // throw new BadRequest("设备唯一标识码不能为空!");
......
package com.yeejoin.amos.api.openapi.face.service; 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.model.UseInfoModel;
import com.yeejoin.amos.api.openapi.face.orm.dao.UseInfoMapper; 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.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.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -20,34 +27,41 @@ import java.util.List; ...@@ -20,34 +27,41 @@ import java.util.List;
@Component @Component
public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInfoMapper> { public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInfoMapper> {
/** private static final Logger logger = LogManager.getLogger(UseInfoService.class);
*
* 新增使用信息
*
* @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) { @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); // checkModel(models);
models.setRecDate(new Date()); models.setRecDate(new Date());
models.setAppId(getAppId()); models.setAppId(getAppId());
} }
this.saveBatch(model); this.saveBatch(model);
return "OK"; return "OK";
} }
/** // /**
* 信息校验 // * 信息校验
* // *
* @param models // * @param models
*/ // */
// private static void checkModel(UseInfo models) { // private static void checkModel(UseInfo models) {
// if(ValidationUtil.isEmpty(models.getSequenceCode())) { // if(ValidationUtil.isEmpty(models.getSequenceCode())) {
// throw new BadRequest("设备唯一标识码不能为空!"); // throw new BadRequest("设备唯一标识码不能为空!");
...@@ -104,5 +118,24 @@ public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInf ...@@ -104,5 +118,24 @@ public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInf
// throw new BadRequest("设备标识码为:"+models.getSequenceCode()+"的设备,"+"同步状态不能为空!"); // throw new BadRequest("设备标识码为:"+models.getSequenceCode()+"的设备,"+"同步状态不能为空!");
// } // }
// } // }
public String saveEquipmentInfo(EquipmentInfoDto equipmentInfoDto) {
String supervisoryCode = equipmentInfoDto.getSupervisionInfo().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; ...@@ -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.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.InspectionDetectionInfoModel;
import com.yeejoin.amos.api.openapi.face.model.UnitLicenceModel; 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.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -14,7 +17,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -14,7 +17,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@FeignClient(name = "TZS-YMT", url = "http://36.46.151.113:11000", path = "/ymt", configuration = @FeignClient(name = "TZS-YMT", path = "/ymt", configuration =
{MultipartSupportConfig.class}) {MultipartSupportConfig.class})
public interface TzsServiceFeignClient { public interface TzsServiceFeignClient {
...@@ -55,4 +58,41 @@ public interface TzsServiceFeignClient { ...@@ -55,4 +58,41 @@ public interface TzsServiceFeignClient {
*/ */
@RequestMapping(value = "/api/inspectiondetectioninfo/selectInspect", method = RequestMethod.GET) @RequestMapping(value = "/api/inspectiondetectioninfo/selectInspect", method = RequestMethod.GET)
ResponseModel<InspectionDetectionInfoModel> selectInspect(@RequestParam String superviseCode); 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);
} }
...@@ -3,18 +3,11 @@ ...@@ -3,18 +3,11 @@
<mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper"> <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 id="selectInspection" resultType="com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo">
SELECT *
SELECT FROM idx_biz_jg_inspection_detection_info
* WHERE "RECORD" = (SELECT "RECORD" FROM "idx_biz_jg_other_info" WHERE "SUPERVISORY_CODE" = #{superviseCode})
FROM ORDER BY "INSPECT_DATE" DESC
idx_biz_jg_inspection_detection_info LIMIT 1
WHERE
"RECORD" = ( SELECT "RECORD" FROM "idx_biz_jg_other_info" WHERE "SUPERVISORY_CODE" = #{superviseCode} )
ORDER BY
"INSPECT_DATE" DESC
LIMIT 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -9,12 +9,14 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController; ...@@ -9,12 +9,14 @@ 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.excel.ExcelUtil;
import com.yeejoin.amos.boot.biz.common.utils.Menu; import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser; 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.EquipExportDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto; 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.dto.EquipmentMessageDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgConstructionInfoDto; import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.entity.*; 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.enums.ImageSizeEnums;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgOtherInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgOtherInfoMapper;
...@@ -30,7 +32,15 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -30,7 +32,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.util.ObjectUtils; 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.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -42,7 +52,12 @@ import java.io.File; ...@@ -42,7 +52,12 @@ import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; 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; import java.util.stream.Collectors;
/** /**
...@@ -545,33 +560,33 @@ public class EquipmentCategoryController extends BaseController { ...@@ -545,33 +560,33 @@ public class EquipmentCategoryController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/saveSupervisoryData") @PostMapping(value = "/saveSupervisoryData")
@ApiOperation(httpMethod = "POST", value = "监管设备数据保存", notes = "监管设备保存") @ApiOperation(httpMethod = "POST", value = "监管设备数据保存", notes = "监管设备保存")
public ResponseModel<Boolean> saveSupervisoryData(@RequestBody EquipmentMessageDto data) { public ResponseModel<Boolean> saveSupervisoryData(@RequestBody EquipmentMessageDto data) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveSupervisoryData(data)); return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveSupervisoryData(data));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/saveConstructionInfoData") @PostMapping(value = "/saveConstructionInfoData")
@ApiOperation(httpMethod = "POST", value = "监管设备施工数据保存", notes = "监管设备施工数据保存") @ApiOperation(httpMethod = "POST", value = "监管设备施工数据保存", notes = "监管设备施工数据保存")
public ResponseModel<Boolean> saveConstructionInfoData(@RequestBody IdxBizJgConstructionInfo data) { public ResponseModel<Boolean> saveConstructionInfoData(@RequestBody IdxBizJgConstructionInfo data) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveConstructionInfoData(data)); return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveConstructionInfoData(data));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/saveMaintenanceRecordInfoData") @PostMapping(value = "/saveMaintenanceRecordInfoData")
@ApiOperation(httpMethod = "POST", value = "监管设备维保数据保存", notes = "监管设备维保数据保存") @ApiOperation(httpMethod = "POST", value = "监管设备维保数据保存", notes = "监管设备维保数据保存")
public ResponseModel<Boolean> saveMaintenanceRecordInfoData(@RequestBody IdxBizJgMaintenanceRecordInfo data) { public ResponseModel<Boolean> saveMaintenanceRecordInfoData(@RequestBody IdxBizJgMaintenanceRecordInfo data) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveMaintenanceRecordInfoData(data)); return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveMaintenanceRecordInfoData(data));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/saveDetectionInfoData") @PostMapping(value = "/saveDetectionInfoData")
@ApiOperation(httpMethod = "POST", value = "监管设备检验检测数据保存", notes = "监管设备检验检测数据保存") @ApiOperation(httpMethod = "POST", value = "监管设备检验检测数据保存", notes = "监管设备检验检测数据保存")
public ResponseModel<Boolean> saveDetectionInfoData(@RequestBody IdxBizJgInspectionDetectionInfo data) { public ResponseModel<Boolean> saveDetectionInfoData(@RequestBody IdxBizJgInspectionDetectionInfo data) {
return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveDetectionInfoData(data)); return ResponseHelper.buildResponse(equipmentCategoryServiceImpl.saveDetectionInfoData(data));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/deleteByRecord") @PostMapping(value = "/deleteByRecord")
@ApiOperation(httpMethod = "POST", value = "数据异常回滚", notes = "数据异常回滚") @ApiOperation(httpMethod = "POST", value = "数据异常回滚", notes = "数据异常回滚")
public ResponseModel<Boolean> saveDetectionInfoData(@RequestParam("record") String record) { public ResponseModel<Boolean> saveDetectionInfoData(@RequestParam("record") String record) {
......
...@@ -2274,7 +2274,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -2274,7 +2274,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
registerInfo.setRecDate(date); registerInfo.setRecDate(date);
if (saveStatus == 1) { if (saveStatus == 1) {
registerInfo.setRecord(supervisoryCode); registerInfo.setRecord(supervisoryCode);
alias = Integer.parseInt(String.valueOf(registerInfo.getEquList())); alias = Integer.parseInt(String.valueOf(ValidationUtil.isEmpty(registerInfo.getEquList()) ? 3000 :
registerInfo.getEquList()));
registerInfo.setEquList("3000"); registerInfo.setEquList("3000");
idxBizJgRegisterInfoService.save(registerInfo); idxBizJgRegisterInfoService.save(registerInfo);
} else { } else {
......
...@@ -20,16 +20,17 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -20,16 +20,17 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service @Service
public class InspectionDetectionInfoServiceImpl extends BaseService<InspectionDetectionInfoModel, InspectionDetectionInfo, InspectionDetectionInfoMapper> implements InspectionDetectionInfoService { public class InspectionDetectionInfoServiceImpl extends BaseService<InspectionDetectionInfoModel, InspectionDetectionInfo, InspectionDetectionInfoMapper> implements InspectionDetectionInfoService {
@Autowired @Autowired
private InspectionDetectionInfoMapper inspectionDetectionInfo; private InspectionDetectionInfoMapper inspectionDetectionInfo;
public InspectionDetectionInfoModel selectInspect(String superviseCode) {
InspectionDetectionInfoModel inspectionDetectionInfoDto = new InspectionDetectionInfoModel(); public InspectionDetectionInfoModel selectInspect(String superviseCode) {
if (ValidationUtil.isEmpty(superviseCode)) { InspectionDetectionInfoModel inspectionDetectionInfoDto = new InspectionDetectionInfoModel();
return inspectionDetectionInfoDto; if (ValidationUtil.isEmpty(superviseCode)) {
} return inspectionDetectionInfoDto;
InspectionDetectionInfo inspectionDetectionInfo = this.inspectionDetectionInfo.selectInspection(superviseCode); }
BeanUtils.copyProperties(inspectionDetectionInfo,inspectionDetectionInfoDto); InspectionDetectionInfo inspectionDetectionInfo = this.inspectionDetectionInfo.selectInspection(superviseCode);
inspectionDetectionInfoDto.setSuperviseCode(superviseCode); BeanUtils.copyProperties(inspectionDetectionInfo, inspectionDetectionInfoDto);
return inspectionDetectionInfoDto; inspectionDetectionInfoDto.setSuperviseCode(superviseCode);
} return inspectionDetectionInfoDto;
}
} }
\ 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