Commit f42a3a54 authored by 刘林's avatar 刘林

fix(jg):历史设备添加联想,使用单位

parent 569b33b2
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService;
...@@ -222,11 +223,20 @@ public class IdxBizJqEquipmentRegisterController extends BaseController { ...@@ -222,11 +223,20 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询当前单位下工程装置信息", notes = "查询当前单位下工程装置信息") @ApiOperation(httpMethod = "GET", value = "查询当前单位下工程装置信息", notes = "查询当前单位下工程装置信息")
public ResponseModel<Object> queryEquipCanUsedByVesselPageHistory() { public ResponseModel<Object> queryEquipCanUsedByVesselPageHistory() {
ReginParams info = getSelectedOrgInfo(); ReginParams info = getSelectedOrgInfo();
if (info.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) { CompanyBo companyBo = info.getCompany();
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.getProjectContraption(info.getCompany().getCompanyCode())); // 确保公司级别符合要求
} else { if (!BaseController.COMPANY_TYPE_COMPANY.equals(companyBo.getLevel())) {
return ResponseHelper.buildResponse(new ArrayList<String>()); return ResponseHelper.buildResponse(new ArrayList<String>());
} }
String companyCode = companyBo.getCompanyCode();
String type = companyBo.getCompanyType();
// 根据公司类型设置使用和安装改造维修单位代码
String useUnitCreditCode = type.contains("使用单位") || type.contains("个人主体") ? companyCode : "";
String uscUnitCreditCode = type.contains("安装改造维修单位") ? companyCode : "";
return ResponseHelper.buildResponse(
idxBizJgRegisterInfoService.getProjectContraption(uscUnitCreditCode, useUnitCreditCode)
);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -45,7 +45,7 @@ public interface IIdxBizJgRegisterInfoService { ...@@ -45,7 +45,7 @@ public interface IIdxBizJgRegisterInfoService {
Object savePressureVesselData(Map<String, Object> paramMap); Object savePressureVesselData(Map<String, Object> paramMap);
Object getProjectContraption(String uscUnitCreditCode); Object getProjectContraption(String uscUnitCreditCode, String useUnitCreditCode);
Boolean esSynchronousProjectContraption(); Boolean esSynchronousProjectContraption();
......
...@@ -3130,8 +3130,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3130,8 +3130,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
@Override @Override
public Object getProjectContraption(String uscUnitCreditCode) { public Object getProjectContraption(String uscUnitCreditCode, String useUnitCreditCode) {
return this.baseMapper.getProjectContraption(uscUnitCreditCode); return this.baseMapper.getProjectContraption(uscUnitCreditCode, useUnitCreditCode);
} }
@Override @Override
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
...@@ -25,8 +26,9 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI ...@@ -25,8 +26,9 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI
@Select("select code as dictDataKey,name as dictDataValue from tz_equipment_category where parent_id = ( SELECT sub.id from tz_equipment_category as sub where sub.code = #{equipCode})") @Select("select code as dictDataKey,name as dictDataValue from tz_equipment_category where parent_id = ( SELECT sub.id from tz_equipment_category as sub where sub.code = #{equipCode})")
List<DictionarieValueModel> queryAllEquCategoriesUnderTheEquList(@Param("equipCode") String equipCode); List<DictionarieValueModel> queryAllEquCategoriesUnderTheEquList(@Param("equipCode") String equipCode);
@Select("SELECT jui.PROJECT_CONTRAPTION as value FROM idx_biz_jg_construction_info jci LEFT JOIN idx_biz_jg_use_info jui on jci.RECORD = jui.RECORD where jci.USC_UNIT_CREDIT_CODE = #{uscUnitCreditCode} and jui.PROJECT_CONTRAPTION is not null GROUP BY jui.PROJECT_CONTRAPTION") @MapKey("uscUnitCreditCode")
List<Map<String, Object>> getProjectContraption(@Param("uscUnitCreditCode")String uscUnitCreditCode); List<Map<String, Object>> getProjectContraption(@Param("uscUnitCreditCode") String uscUnitCreditCode,
@Param("useUnitCreditCode") String useUnitCreditCode);
@Select("SELECT SEQUENCE_NBR,REC_DATE,ORG_BRANCH_NAME,ORG_BRANCH_CODE,USE_UNIT_NAME,USE_UNIT_CREDIT_CODE,EQU_LIST_CODE,EQU_LIST,EQU_CATEGORY,EQU_CATEGORY_CODE,USE_ORG_CODE,CODE96333,EQU_CODE,SUPERVISORY_CODE,USE_PLACE,ADDRESS,EQU_STATE,STATUS,USE_INNER_CODE,FACTORY_NUM,PRODUCE_UNIT_NAME,INSPECT_REPORT,NEXT_INSPECT_DATE,CONSTRUCTION_TYPE,USC_UNIT_CREDIT_CODE,USC_UNIT_NAME,EQU_DEFINE,EQU_DEFINE_CODE,PRODUCT_NAME,BRAND_NAME,EQU_TYPE,DATA_SOURCE,IS_INTO_MANAGEMENT,WHETHER_VEHICLE_CYLINDER,WHETHER_SKID_MOUNTED_PRESSURE_VESSEL,DATE_FORMAT(PRODUCE_DATE,'%Y-%m-%d %H:%i:%s')as PRODUCE_DATE,PROJECT_CONTRAPTION from idx_biz_view_jg_all WHERE PROJECT_CONTRAPTION is not null") @Select("SELECT SEQUENCE_NBR,REC_DATE,ORG_BRANCH_NAME,ORG_BRANCH_CODE,USE_UNIT_NAME,USE_UNIT_CREDIT_CODE,EQU_LIST_CODE,EQU_LIST,EQU_CATEGORY,EQU_CATEGORY_CODE,USE_ORG_CODE,CODE96333,EQU_CODE,SUPERVISORY_CODE,USE_PLACE,ADDRESS,EQU_STATE,STATUS,USE_INNER_CODE,FACTORY_NUM,PRODUCE_UNIT_NAME,INSPECT_REPORT,NEXT_INSPECT_DATE,CONSTRUCTION_TYPE,USC_UNIT_CREDIT_CODE,USC_UNIT_NAME,EQU_DEFINE,EQU_DEFINE_CODE,PRODUCT_NAME,BRAND_NAME,EQU_TYPE,DATA_SOURCE,IS_INTO_MANAGEMENT,WHETHER_VEHICLE_CYLINDER,WHETHER_SKID_MOUNTED_PRESSURE_VESSEL,DATE_FORMAT(PRODUCE_DATE,'%Y-%m-%d %H:%i:%s')as PRODUCE_DATE,PROJECT_CONTRAPTION from idx_biz_view_jg_all WHERE PROJECT_CONTRAPTION is not null")
List<Map<String, Object>> esSynchronousProjectContraption(); List<Map<String, Object>> esSynchronousProjectContraption();
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper">
<select id="getProjectContraption" resultType="java.util.Map">
SELECT jui.PROJECT_CONTRAPTION as value
FROM idx_biz_jg_construction_info jci
LEFT JOIN idx_biz_jg_use_info jui ON jci.RECORD = jui.RECORD
<where>
jui.PROJECT_CONTRAPTION IS NOT NULL
<if test="uscUnitCreditCode != null and !uscUnitCreditCode.isEmpty()">
AND jci.USC_UNIT_CREDIT_CODE = #{uscUnitCreditCode}
</if>
<if test="useUnitCreditCode != null and !useUnitCreditCode.isEmpty()">
AND jui.USE_UNIT_CREDIT_CODE = #{useUnitCreditCode}
</if>
</where>
GROUP BY jui.PROJECT_CONTRAPTION
</select>
</mapper>
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