Commit ee9ad07e authored by hezhuozhi's avatar hezhuozhi

管道变更/单位变更

parent 521c4103
......@@ -128,6 +128,9 @@ public class JgChangeRegistrationUnitDto extends BaseDto {
@ApiModelProperty(value = "使用登记证列表")
private List<Map<String, Object>> registrationList;
@ApiModelProperty(value = "装置列表")
private List<Map<String, Object>> projectContraptionList;
@ApiModelProperty(value = "设备类别")
private String equType;
......
......@@ -70,4 +70,9 @@ public class JgChangeRegistrationUnitEq extends BaseEntity {
@TableField("create_user_name")
private String createUserName;
/**
* 装置Id
*/
@TableField("project_contraption_id")
private String projectContraptionId;
}
......@@ -4,10 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.vo.IdxBizJgProjectContraptionVO;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.CertificateVo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -37,4 +38,8 @@ public interface JgUseRegistrationManageMapper extends BaseMapper<JgUseRegistrat
List<Map<String, String>> initUseRegistrationCodeIntoRedis(@Param("year") String year);
List<Map<String, String>> initVehicleUseRegCodeIntoRedis(@Param("year") String year);
Page<IdxBizJgProjectContraptionVO> queryForUnitByProjectContraptionPage(@Param("page") Page<IdxBizJgProjectContraptionVO> page,
@Param("dto") Map<String, String> params,
@Param("sort") SortVo sortMap);
}
package com.yeejoin.amos.boot.module.jg.api.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@ApiModel(value = "IdxBizJgProjectContraptionVO", description = "装置VO实体类")
public class IdxBizJgProjectContraptionVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private String sequenceNbr;
@ApiModelProperty(value = "更新时间")
private Date recDate;
@ApiModelProperty(value = "工程装置名称")
private String projectContraption;
@ApiModelProperty(value = "工程装置编号")
private String projectContraptionNo;
@ApiModelProperty(value = "使用单位统一信用代码")
private String useUnitCreditCode;
@ApiModelProperty(value = "使用单位名称")
private String useUnitName;
@ApiModelProperty(value = "施工单位统一信用代码")
private String uscUnitCreditCode;
@ApiModelProperty(value = "施工单位名称")
private String uscUnitName;
@ApiModelProperty(value = "设备种类名称")
private String equListName;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty(value = "设备类别名称")
private String equCategoryName;
@ApiModelProperty(value = "设备代码")
private String equCategory;
@ApiModelProperty(value = "设备品种名称")
private String equDefineName;
@ApiModelProperty(value = "设备品种")
private String equDefine;
@ApiModelProperty(value = "装置管道总长度(m)")
private Double pipelineLength;
@ApiModelProperty(value = "产品照片附件")
private String productPhoto;
@ApiModelProperty(value = "其他附件")
private String otherAccessories;
@ApiModelProperty(value = "属地监管单位代码")
private String orgCode;
@ApiModelProperty(value = "属地监管单位名称")
private String orgName;
@ApiModelProperty(value = "产品质量合格证明")
private String productQualificationCertificate;
@ApiModelProperty(value = "监管码")
private String supervisoryCode;
@ApiModelProperty(value = "使用登记证编号")
private String useRegistrationCode;
@ApiModelProperty(value = "数据来源(新增:0、导入:1、复制:复制数据的id 、jg:从监管加入的设备)")
private String dataSource;
@ApiModelProperty(value = "数据来源名称")
private String dataSourceName;
@ApiModelProperty(value = "使用地址")
private String fullAddress;
@ApiModelProperty(value = "工程装置设备代码")
private String equCode;
@ApiModelProperty(value = "设备使用地址")
private String equUseAddress;
}
......@@ -254,4 +254,183 @@
HAVING code <![CDATA[ <> ]]> '00000'
ORDER BY prefix
</select>
<select id="queryForUnitByProjectContraptionPage"
resultType="com.yeejoin.amos.boot.module.jg.api.vo.IdxBizJgProjectContraptionVO">
SELECT
ibjpc.*,tjurm.equ_use_address
FROM
idx_biz_jg_project_contraption ibjpc
left join tzs_jg_use_registration_manage tjurm ON ibjpc.use_registration_code = tjurm.use_registration_code
WHERE
NOT EXISTS (
SELECT
1
FROM
idx_biz_jg_use_info ibjui
INNER JOIN (
select DISTINCT record from (
select
equ_id as record
from
tzs_jg_use_registration a,
tzs_jg_use_registration_eq b
where
a.sequence_nbr = b.equip_transfer_id
and a.is_delete = 0
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
UNION
select
equ_id as record
from
tzs_jg_change_registration_reform a,
tzs_jg_change_registration_reform_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '一级受理已驳回' and a.audit_status <![CDATA[ <> ]]> '使用单位已撤回' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION
select
equ_id as record
from
tzs_jg_change_registration_transfer a,
tzs_jg_change_registration_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '一级受理已驳回' and a.audit_status <![CDATA[ <> ]]> '使用单位已撤回' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION
select
equ_id as record
from
tzs_jg_change_registration_unit a,
tzs_jg_change_registration_unit_eq b
where
a.sequence_nbr = b.unit_change_registration_id
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
UNION
select
equ_id as record
from
tzs_jg_enable_disable a,
tzs_jg_enable_disable_eq b
where
a.sequence_nbr = b.enable_disable_apply_id
and (a.audit_status <![CDATA[ <> ]]> '已驳回' and a.audit_status <![CDATA[ <> ]]> '已撤回' and a.audit_status <![CDATA[ <> ]]> '待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION
select
equ_id as record
from
tzs_jg_installation_notice a,
tzs_jg_installation_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610' and a.notice_status <![CDATA[ <> ]]> '6617')
UNION
select
equ_id as record
from
tzs_jg_maintain_notice a,
tzs_jg_maintain_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610' and a.notice_status <![CDATA[ <> ]]> '6617')
UNION
select
equ_id as record
from
tzs_jg_maintenance_contract a,
tzs_jg_maintenance_contract_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.status <![CDATA[ <> ]]> '已作废' and a.status <![CDATA[ <> ]]> '维保单位已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '使用单位待提交')
UNION
select
equ_id as record
from
tzs_jg_reform_notice a,
tzs_jg_reform_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610' and a.notice_status <![CDATA[ <> ]]> '6617')
UNION
select
equ_id as record
from
tzs_jg_scrap_cancel a,
tzs_jg_scrap_cancel_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.audit_status <![CDATA[ <> ]]> '使用单位已撤回' and a.audit_status <![CDATA[ <> ]]> '一级受理已驳回' and a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION
select
equ_id as record
from
tzs_jg_transfer_notice a,
tzs_jg_transfer_notice_eq b
where
a.sequence_nbr = b.equip_transfer_id
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610' and a.notice_status <![CDATA[ <> ]]> '6617')
UNION
select
equ_id as record
from
tzs_jg_vehicle_information a,
tzs_jg_vehicle_information_eq b
where
a.sequence_nbr = b.vehicle_id
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
UNION
select
equ_id as record
from
tzs_jg_change_vehicle_registration_unit a,
tzs_jg_change_vehicle_registration_unit_eq b
where
a.sequence_nbr = b.unit_change_id
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
) temp
) a ON ibjui.record = a.record
WHERE
ibjpc.sequence_nbr = ibjui.PROJECT_CONTRAPTION_ID
)
and ibjpc.use_unit_credit_code = #{dto.originalUseUnitCreditCode}
and ibjpc.is_delete = 0
and tjurm.is_delete = 0
and (ibjpc.project_contraption_parent_id is null or ibjpc.project_contraption_parent_id = '')
<if test="dto.equList != null and dto.equList != ''">
and tjurm.equ_list = #{dto.equList}
</if>
<if test="dto.equListCode != null and dto.equListCode != ''">
and tjurm.equ_list_code = #{dto.equListCode}
</if>
<if test="dto.equCategory != null and dto.equCategory != ''">
and tjurm.equ_category = #{dto.equCategory}
</if>
<if test="dto.equCategoryCode != null and dto.equCategoryCode != ''">
and tjurm.equ_category_code = #{dto.equCategoryCode}
</if>
<if test="dto.equDefineCode != null and dto.equDefineCode != ''">
and tjurm.equ_define = #{dto.equDefineCode}
</if>
<if test="dto.equDefineCode != null and dto.equDefineCode != ''">
and tjurm.equ_define_code = #{dto.equDefineCode}
</if>
-- 使用登记证编号
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and tjurm.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="dto.certificateStatus != null and dto.certificateStatus != ''">
and tjurm.certificate_status = #{dto.certificateStatus}
</if>
<if test="dto.projectContraption != null and dto.projectContraption != ''">
and ibjpc.project_contraption like concat('%',#{dto.projectContraption},'%')
</if>
<if test="dto.projectContraptionNo != null and dto.projectContraptionNo != ''">
and ibjpc.project_contraption_no like concat('%', #{dto.projectContraptionNo},'%')
</if>
ORDER BY
<if test="sort != null">
ibjpc.${sort.field} ${sort.sortType},
</if>
ibjpc.rec_date DESC
</select>
</mapper>
......@@ -6,9 +6,12 @@ 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.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.dto.ProjectContraptionChangeDataDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.vo.IdxBizJgProjectContraptionVO;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationManageServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -295,6 +298,22 @@ public class JgUseRegistrationManageController extends BaseController {
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/unitChangeByProjectContraption/page")
@ApiOperation(httpMethod = "GET", value = "单位变更选择工程/装置分页查询", notes = "单位变更选择工程/装置分页查询")
public ResponseModel<Page<IdxBizJgProjectContraptionVO>> queryForUnitByProjectContraptionPage(@RequestParam Map<String, String> params,
@RequestParam(value = "sort", required = false) String sort,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<IdxBizJgProjectContraptionVO> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
if (ValidationUtil.isEmpty(params.get("originalUseUnitCreditCode"))) {
return ResponseHelper.buildResponse(page);
}
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForUnitByProjectContraptionPage(page, params, sort));
}
/**
* 根据sequenceNbr查询---大屏使用
*
......
......@@ -1295,6 +1295,11 @@ public class CommonServiceImpl implements ICommonService {
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
JSONObject jsonObject = new JSONObject(noticeObj);
return jgChangeVehicleRegistrationUnitService.saveMessage(jsonObject, reginParams);
} else if (type.equals(ApplicationFormTypeEnum.DWBG.getBusinessCode()) && !ObjectUtils.isEmpty(noticeObj.get("EQU_CATEGORY_CODE")) && "8300".equals(noticeObj.get("EQU_CATEGORY_CODE").toString())) {
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
provideMap.put(DWBG_PAGE_ID, noticeObj);
JSONObject jsonObject = new JSONObject(provideMap);
return jgChangeRegistrationUnitServiceImpl.saveUnitByProjectContraption(submitType,jsonObject, reginParams);
} else if (type.equals(ApplicationFormTypeEnum.DWBG.getBusinessCode())) {
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
provideMap.put(DWBG_PAGE_ID, noticeObj);
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -14,9 +15,11 @@ import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CertificateStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationManageService;
import com.yeejoin.amos.boot.module.jg.api.vo.IdxBizJgProjectContraptionVO;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.ymt.api.common.StringUtil;
......@@ -25,6 +28,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
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.mapper.IdxBizJgProjectContraptionMapper;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.lucene.queryparser.classic.QueryParser;
......@@ -59,6 +63,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -858,4 +864,27 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
}
return "修复成功!";
}
/**
* 工程/装置分页查询
* @param page
* @param params
* @param sort
* @return
*/
public Page<IdxBizJgProjectContraptionVO> queryForUnitByProjectContraptionPage(Page<IdxBizJgProjectContraptionVO> page, Map<String, String> params, String sort) {
SortVo sortMap = commonServiceImpl.sortFieldConversion(sort);
Page<IdxBizJgProjectContraptionVO> projectContraptionPage = this.baseMapper.queryForUnitByProjectContraptionPage(page, params, sortMap);
List<IdxBizJgProjectContraptionVO> records = projectContraptionPage.getRecords();
if (!ValidationUtil.isEmpty(records)) {
records.forEach(item -> {
BigDecimal pipelineLength = BigDecimal.valueOf(item.getPipelineLength());
BigDecimal roundedValue = pipelineLength.setScale(3, RoundingMode.HALF_UP);
BigDecimal strippedValue = roundedValue.stripTrailingZeros();
item.setPipelineLength(Double.valueOf(strippedValue.toPlainString()));
item.setDataSourceName(EquipSourceEnum.getDataSourceName(item.getDataSource()));
});
}
return projectContraptionPage;
}
}
\ No newline at end of file
......@@ -73,7 +73,8 @@
(select USC_DATE from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."USC_DATE" DESC limit 1) as uscDate,
ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
ibjui."USE_DATE" AS useDate,
ibjui."RECORD" AS record
ibjui."RECORD" AS record,
ibjui.project_contraption_id AS projectContraptionId
FROM idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
LEFT JOIN idx_biz_jg_design_info ibjdi ON ibjui.RECORD = ibjdi.RECORD
......
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