Commit e1474646 authored by lisong's avatar lisong

监管对接接口添加

parent 1f58784a
...@@ -40,12 +40,7 @@ import io.swagger.annotations.Api; ...@@ -40,12 +40,7 @@ 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.GetMapping; import org.springframework.web.bind.annotation.*;
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.foundation.utils.ValidationUtil;
...@@ -287,4 +282,17 @@ public class SuperviseController { ...@@ -287,4 +282,17 @@ public class SuperviseController {
return ResponseHelper.buildResponse(useInfoService.saveEquipmentInfo(equipmentInfoDto)); return ResponseHelper.buildResponse(useInfoService.saveEquipmentInfo(equipmentInfoDto));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getUnitLicenceMessage", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据统一信用代码查询许可信息", notes = "根据统一信用代码查询许可信息")
public ResponseModel<Object> getUnitLicenceMessage(@RequestParam("unitCode") String unitCode) {
return ResponseHelper.buildResponse(useInfoService.getUnitLicenceMessage(unitCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getBusinessInformation", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据统一信用代码查询工商信息", notes = "根据统一信用代码查询工商信息")
public ResponseModel<Object> getBusinessInformation(@RequestParam("unitCode") String unitCode) {
return ResponseHelper.buildResponse(useInfoService.getBusinessInformation(unitCode));
}
} }
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.dto.EquipmentInfoDto;
import com.yeejoin.amos.api.openapi.face.model.UnitLicenceModel;
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.TzsAccessFeignService;
import com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient; import com.yeejoin.amos.api.openapi.feign.TzsServiceFeignClient;
import com.yeejoin.amos.api.openapi.feign.TzsTcmServiceFeignClient;
import feign.FeignException; import feign.FeignException;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -17,6 +20,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -17,6 +20,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 特种设备基本信息-使用信息 服务类 * 特种设备基本信息-使用信息 服务类
...@@ -32,6 +36,11 @@ public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInf ...@@ -32,6 +36,11 @@ public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInf
@Autowired @Autowired
TzsServiceFeignClient tzsServiceFeignClient; TzsServiceFeignClient tzsServiceFeignClient;
@Autowired
TzsTcmServiceFeignClient tzsTcmServiceFeignClient;
@Autowired
TzsAccessFeignService tzsAccessFeignService;
// @Autowired // @Autowired
// AmosRequestContext amosRequestContext; // AmosRequestContext amosRequestContext;
...@@ -137,5 +146,27 @@ public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInf ...@@ -137,5 +146,27 @@ public class UseInfoService extends AppBaseService<UseInfoModel, UseInfo, UseInf
} }
return null; return null;
} }
public Object getUnitLicenceMessage(String unitCode){
try {
ResponseModel<Object> licenceByUnitCode = tzsTcmServiceFeignClient.getLicenceByUnitCode(unitCode);
return licenceByUnitCode.getResult();
}catch (Exception e){
logger.error("查询许可信息失败--->", e);
e.printStackTrace();
}
return null;
}
public Object getBusinessInformation(String unitCode){
try {
ResponseModel<Map<String, Object>> data = tzsAccessFeignService.getData(unitCode);
return data.getResult();
}catch (Exception e){
logger.error("查询工商信息失败--->", e);
e.printStackTrace();
}
return null;
}
} }
package com.yeejoin.amos.api.openapi.feign;
import com.yeejoin.amos.api.openapi.config.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map;
@FeignClient(name = "AMOS-API-ACCESSAPI", path = "/accessapi" , configuration =
{FeignConfiguration.class})
public interface TzsAccessFeignService {
/**
* 调用accessApi的接口
* @param code
* @return
*/
@RequestMapping("/business/getData")
ResponseModel<Map<String, Object>> getData(@RequestParam String code);
}
package com.yeejoin.amos.api.openapi.feign;
import com.yeejoin.amos.api.openapi.config.FeignConfiguration;
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;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
@FeignClient(name = "TZS-COMMON", path = "/tcm", configuration =
{FeignConfiguration.class})
public interface TzsTcmServiceFeignClient {
/**
* 根据企业统一信用代码询许可信息
*
* @param unitCode 企业唯一编码
* @return
*/
@RequestMapping(value = "/baseEnterprise/getUnitLicenceMessage", method = RequestMethod.GET)
ResponseModel<Object> getLicenceByUnitCode(@RequestParam String unitCode);
}
...@@ -15,7 +15,7 @@ import java.util.Map; ...@@ -15,7 +15,7 @@ import java.util.Map;
public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> { public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto); Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto);
List<Map<String, Object>> getUserType(@Param("unitType")String unitType); List<Map<String, Object>> getUserType(@Param("unitType")String unitType, @Param("install") String install);
Map<String, Integer> getArrangementStatistic(String companyCode); Map<String, Integer> getArrangementStatistic(String companyCode);
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto; import com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.tcm.api.entity.PageParam; import com.yeejoin.amos.boot.module.tcm.api.entity.PageParam;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo;
...@@ -44,4 +45,6 @@ public interface ITzBaseEnterpriseInfoService extends IService<TzBaseEnterpriseI ...@@ -44,4 +45,6 @@ public interface ITzBaseEnterpriseInfoService extends IService<TzBaseEnterpriseI
TzBaseEnterpriseInfoDto getInfoByUseCode(String useCode); TzBaseEnterpriseInfoDto getInfoByUseCode(String useCode);
String setLabel(List<Long> enterpriseIds, List<String> enterpriseLabels); String setLabel(List<Long> enterpriseIds, List<String> enterpriseLabels);
BaseUnitLicence getUnitLicenceMessage(String unitCode);
} }
...@@ -146,9 +146,12 @@ ...@@ -146,9 +146,12 @@
WHERE WHERE
<if test="unitType != null and unitType != ''"> <if test="unitType != null and unitType != ''">
type = 'QYRYGW' or type = #{unitType} type = 'QYRYGW' or type = #{unitType}
<if test="install != null and install != ''">
or type = #{install}
</if>
</if> </if>
<if test="unitType == null or unitType == ''"> <if test="unitType == null or unitType == ''">
type like concat('QYRYGW','%') type like concat('QYRYGW','%') and type != 'QYRYGW-INSTALL'
</if> </if>
</select> </select>
......
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.utils.NameUtils; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto; import com.yeejoin.amos.boot.module.tcm.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.tcm.api.entity.PageParam; import com.yeejoin.amos.boot.module.tcm.api.entity.PageParam;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.tcm.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.tcm.api.enums.EquipmentClassifityEnum;
...@@ -268,4 +269,16 @@ public class TzBaseEnterpriseInfoController { ...@@ -268,4 +269,16 @@ public class TzBaseEnterpriseInfoController {
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory); Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
return ResponseHelper.buildResponse(resourceJson.get(EquipmentClassifityEnum.BDLS.getCode())); return ResponseHelper.buildResponse(resourceJson.get(EquipmentClassifityEnum.BDLS.getCode()));
} }
/**
* 监管对接
* @param unitCode
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getUnitLicenceMessage", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据统一信用代码查询许可信息", notes = "根据统一信用代码查询许可信息")
public ResponseModel<BaseUnitLicence> getUnitLicenceMessage(@RequestParam("unitCode") String unitCode) {
return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.getUnitLicenceMessage(unitCode));
}
} }
...@@ -616,4 +616,14 @@ public class TzBaseEnterpriseInfoServiceImpl ...@@ -616,4 +616,14 @@ public class TzBaseEnterpriseInfoServiceImpl
return map; return map;
} }
@Override
public BaseUnitLicence getUnitLicenceMessage(String unitCode) {
// 许可信息
LambdaQueryWrapper<BaseUnitLicence> lambda = new QueryWrapper<BaseUnitLicence>().lambda();
lambda.eq(BaseUnitLicence::getUnitCode, unitCode);
lambda.orderByDesc(BaseUnitLicence::getExpiryDate);
lambda.last("limit 1");
return baseUnitLicenceService.getBaseMapper().selectOne(lambda);
}
} }
...@@ -366,6 +366,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -366,6 +366,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
result.put("creditCode", companyModels.get(0).getCompanyCode()); result.put("creditCode", companyModels.get(0).getCompanyCode());
boolean productCompany = false; boolean productCompany = false;
boolean useCompany = false; boolean useCompany = false;
boolean installCompany = false;
for (CompanyModel companyModel : companyModels) { for (CompanyModel companyModel : companyModels) {
String companyType = companyModel.getCompanyType(); String companyType = companyModel.getCompanyType();
if (companyType.contains("使用单位") || companyType.contains("个人主体")) { if (companyType.contains("使用单位") || companyType.contains("个人主体")) {
...@@ -374,6 +375,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -374,6 +375,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if (companyType.contains("充装单位") || companyType.contains("安装改造维修单位") || companyType.contains("制造单位") || companyType.contains("设计单位")) { if (companyType.contains("充装单位") || companyType.contains("安装改造维修单位") || companyType.contains("制造单位") || companyType.contains("设计单位")) {
productCompany = true; productCompany = true;
} }
if (companyType.contains("安装改造维修单位")){
installCompany = true;
}
} }
String companyType = null; String companyType = null;
if (useCompany) { if (useCompany) {
...@@ -385,6 +389,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -385,6 +389,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if (useCompany && productCompany) { if (useCompany && productCompany) {
companyType = "useAndPro"; companyType = "useAndPro";
} }
if (installCompany) {
companyType = companyType + "AndInstall";
}
result.put("companyType", companyType); result.put("companyType", companyType);
return result; return result;
} }
...@@ -521,11 +528,15 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -521,11 +528,15 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override @Override
public List<Map<String, Object>> getUserType(String unitType) { public List<Map<String, Object>> getUserType(String unitType) {
if (unitType.equals("pro")) { if (unitType.equals("pro")) {
return tzsUserInfoMapper.getUserType("QYRYGW-SCDW"); return tzsUserInfoMapper.getUserType("QYRYGW-SCDW", null);
} else if (unitType.equals("use")) { } else if (unitType.equals("use")) {
return tzsUserInfoMapper.getUserType("QYRYGW-SYDW"); return tzsUserInfoMapper.getUserType("QYRYGW-SYDW", null);
} else { } else if (unitType.equals("useAndInstall")){
return tzsUserInfoMapper.getUserType(null); return tzsUserInfoMapper.getUserType("QYRYGW-SYDW", "QYRYGW-INSTALL");
} else if (unitType.equals("proAndInstall")){
return tzsUserInfoMapper.getUserType("QYRYGW-SCDW", "QYRYGW-INSTALL");
}else {
return tzsUserInfoMapper.getUserType(null, null);
} }
} }
......
...@@ -2340,10 +2340,20 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -2340,10 +2340,20 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
idxBizJgTechParamsElevatorService.update(idxBizJgTechParamsElevator, lambda); idxBizJgTechParamsElevatorService.update(idxBizJgTechParamsElevator, lambda);
} }
} }
// 同步es
checkEsData(supervisoryCode); checkEsData(supervisoryCode);
// 修改码表状态
updateStatus(supervisoryCode);
return true; return true;
} }
public void updateStatus(String supervisoryCode){
SupervisoryCodeInfo info = new SupervisoryCodeInfo();
info.setStatus("1");
LambdaQueryWrapper<SupervisoryCodeInfo> lambda = new QueryWrapper<SupervisoryCodeInfo>().lambda();
lambda.eq(SupervisoryCodeInfo::getSupervisoryCode, supervisoryCode);
supervisoryCodeInfoMapper.update(info, lambda);
}
@Transactional @Transactional
public Boolean saveConstructionInfoData(IdxBizJgConstructionInfo data) { public Boolean saveConstructionInfoData(IdxBizJgConstructionInfo data) {
......
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