Commit 07e45265 authored by hezhuozhi's avatar hezhuozhi

Merge remote-tracking branch 'origin/develop_tzs_register_test' into develop_tzs_register_test

parents 76313e16 45fd03ef
......@@ -26,16 +26,18 @@ spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
localhost=${spring.cloud.client.ip-address}
#注册中心地址
eureka.client.service-url.defaultZone =http://172.16.10.243: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.89:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${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.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}/swagger-ui.html
eureka.instance.ip-address=172.16.3.89
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/swagger-ui.html
eureka.instance.ip-address=${localhost}
eureka.instance.instance-id=${eureka.instance.ip-address}:${server.port}
##emqx
......
package com.yeejoin.amos.boot.module.jg.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -167,4 +168,13 @@ public class JgChangeRegistrationReformDto extends BaseDto {
@ApiModelProperty(value = "作废人员id")
private String cancelUserId;
@ApiModelProperty(value = "工程装置id")
private String projectContraptionId;
@TableField("project_contraption")
@ApiModelProperty(value = "工程装置名称")
private String projectContraption;
}
......@@ -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;
......
package com.yeejoin.amos.boot.module.jg.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -154,4 +155,7 @@ public class JgEquipTransferDto extends BaseDto {
@ApiModelProperty(value = "工作流下一节点任务id")
private String nextTaskId;
@ApiModelProperty(value = "工程装置表seq--压力管道用")
private String projectContraptionSeq;
}
package com.yeejoin.amos.boot.module.jg.api.dto;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -171,11 +172,18 @@ public class JgReformNoticeDto extends BaseDto {
@ApiModelProperty(value = "工程装置名称")
private String projectContraption;
@ApiModelProperty(value = "工程装置id")
private String projectContraptionId;
/* ---------------- -------------- */
@ApiModelProperty (value = "告知设备列表")
private List<Map<String, Object>> deviceList;
@ApiModelProperty(value = "删除的管道列表")
private List<Map<String, Object>> delPipelineList;
@ApiModelProperty (value = "区名字")
private String countyName;
......@@ -278,4 +286,7 @@ public class JgReformNoticeDto extends BaseDto {
@ApiModelProperty("作废人员id")
private String cancelUserId;
@ApiModelProperty("管道改造的长度变化值(正值为增加,负值为减少)-压力管道用")
private String pipeLengthChanged;
}
......@@ -286,4 +286,18 @@ public class JgChangeRegistrationReform extends BaseEntity {
*/
@TableField("cancel_user_name")
private String cancelUserName;
/**
* 工程装置id
*/
@TableField("project_contraption_id")
private String projectContraptionId;
/**
* 工程装置名称
*/
@TableField("project_contraption")
private String projectContraption;
}
......@@ -70,4 +70,9 @@ public class JgChangeRegistrationUnitEq extends BaseEntity {
@TableField("create_user_name")
private String createUserName;
/**
* 装置Id
*/
@TableField("project_contraption_id")
private String projectContraptionId;
}
......@@ -228,4 +228,10 @@ public class JgEquipTransfer extends BaseEntity {
*/
@TableField(value = "equ_list_code")
private String equListCode;
/**
* 工程装置表seq--压力管道用
*/
@TableField(value = "project_contraption_seq")
private String projectContraptionSeq;
}
......@@ -184,6 +184,12 @@ public class JgReformNotice extends BaseEntity {
private String projectContraption;
/**
* 工程装置id
*/
@TableField("project_contraption_id")
private String projectContraptionId;
/**
* 施工负责人手机
*/
@TableField("construction_manager_phone")
......@@ -407,4 +413,10 @@ public class JgReformNotice extends BaseEntity {
*/
@TableField("cancel_user_id")
private String cancelUserId;
/**
* 管道改造的长度变化值(正值为增加,负值为减少)-压力管道用
*/
@TableField("pipe_length_changed")
private String pipeLengthChanged;
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationReformDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationReform;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.ChangeRegistrationReformVo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 改造变更登记 Mapper 接口
......@@ -41,7 +44,22 @@ public interface JgChangeRegistrationReformMapper extends BaseMapper<JgChangeReg
@Select("select name from tz_equipment_category where code=#{code}")
String getEquiplistNameByEquiplist(String code);
List<Map<String, Object>> getDetailById(@Param("id") Long id);
/**
*
* @param id 主键
* @param equListCode 设备种类
* @return 压力管道或者其他详情
*/
List<Map<String, Object>> getDetailById(@Param("id") Long id, @Param("equListCode") String equListCode);
List<CompanyEquipCountDto> queryForFlowingEquipList();
IPage<IdxBizJgProjectContraption> queryJgProjectContraptionPage(Page<IdxBizJgProjectContraption> page,@Param("companyCode") String useUnitCreditCode,@Param("proIds") Set<String> proIds);
/**
* 查询指定装置下的管道,样式为汇总表样式
* @param projectContraptionSeq 装置id
* @return List<Map<String, Object>>
*/
List<Map<String, Object>> selectPieLineListByProjectId(@Param("projectContraptionSeq") String projectContraptionSeq);
}
......@@ -6,8 +6,9 @@ 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.SortVo;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.CertificateVo;
import org.apache.ibatis.annotations.MapKey;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......@@ -37,4 +38,10 @@ 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<IdxBizJgProjectContraption> queryForUnitByProjectContraptionPage(@Param("page") Page<IdxBizJgProjectContraption> page,
@Param("dto") Map<String, String> params,
@Param("sort") SortVo sortMap);
JgUseRegistrationManage getLatestJgUseRegistrationManage(@Param("useUnitCreditCode")String useUnitCreditCode, @Param("equDefineCode")String equDefineCode);
}
......@@ -33,7 +33,7 @@ public interface IJgReformNoticeService extends IService<JgReformNotice> {
* @param noticeDto 改造告知
* @param op 操作类型
*/
JgReformNoticeDto updateInstallationNotice(String submitType, JgReformNoticeDto noticeDto, String op);
JgReformNoticeDto updateNotice(String submitType, Map<String, Object> noticeMap, String op);
/**
* 分页查询
......
......@@ -61,9 +61,11 @@
(select name from tz_equipment_category tec1 where tec1.code = ri."EQU_LIST") AS equList,
(select name from tz_equipment_category tec2 where tec2.code = ri."EQU_CATEGORY") AS equCategory,
(select name from tz_equipment_category tec3 where tec3.code = ri."EQU_DEFINE") AS equDefine
FROM
tzs_jg_equip_transfer jet
LEFT JOIN tzs_jg_equip_transfer_eq ete ON ete.equip_transfer_id = jet.sequence_nbr
FROM tzs_jg_equip_transfer jet
LEFT JOIN (SELECT *,
ROW_NUMBER() OVER (PARTITION BY equip_transfer_id ORDER BY equip_transfer_id) AS rn
FROM tzs_jg_equip_transfer_eq) ete
ON ete.equip_transfer_id = jet.sequence_nbr AND ete.rn = 1
LEFT JOIN idx_biz_jg_register_info ri ON ri.record = ete.equ_id
LEFT JOIN idx_biz_jg_design_info di ON di.record = ete.equ_id
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = ete.equ_id
......@@ -184,6 +186,7 @@
jet.instance_status AS instanceStatus,
jet.accept_date AS acceptDate,
jet.task_name AS taskName,
jet.project_contraption_seq AS projectContraptionSeq,
ri.product_name AS productName,
ri.brand_name AS brandName,
ri.equ_type AS equType,
......@@ -221,9 +224,11 @@
(select name from tz_equipment_category tec WHERE ri."EQU_CATEGORY"::text = tec.code::text) AS equDefine,
(select SUPERVISORY_CODE from idx_biz_jg_other_info oi WHERE ri.RECORD = oi.RECORD) AS supervisoryCode,
ete.equ_id AS equId
FROM
tzs_jg_equip_transfer jet
LEFT JOIN tzs_jg_equip_transfer_eq ete ON ete.equip_transfer_id = jet.sequence_nbr
FROM tzs_jg_equip_transfer jet
LEFT JOIN (SELECT *,
ROW_NUMBER() OVER (PARTITION BY equip_transfer_id ORDER BY equip_transfer_id) AS rn
FROM tzs_jg_equip_transfer_eq) ete
ON ete.equip_transfer_id = jet.sequence_nbr AND ete.rn = 1
LEFT JOIN idx_biz_jg_register_info ri ON ri.record = ete.equ_id
LEFT JOIN idx_biz_jg_design_info di ON di.record = ete.equ_id
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = ete.equ_id
......
......@@ -28,6 +28,7 @@
isn.notice_report_url AS noticeReportUrl,
isn.create_user_id as createUserId,
isn.next_task_id AS nextTaskId,
isn.org_branch_name as orgBranchName,
isn.next_execute_user_ids as nextExecuteUserIds,
(SELECT name from tz_equipment_category where code = isn.equ_list_code) AS equListName,
(SELECT name from tz_equipment_category where code = isn.equ_category_code) AS equList,
......@@ -75,11 +76,11 @@
</if>
<if test="param.orgBranchCode != null and param.orgBranchCode != ''">
<choose>
<when test="client == 'jgAudit'">
AND isn.org_branch_code= #{param.orgBranchCode}
<when test="client == 'jgLook'">
AND isn.org_branch_code LIKE concat(#{param.orgBranchCode},'%')
</when>
<otherwise>
AND isn.org_branch_code LIKE concat(#{param.orgBranchCode},'%')
AND isn.org_branch_code= #{param.orgBranchCode}
</otherwise>
</choose>
</if>
......
......@@ -35,6 +35,7 @@
isn.inform_number AS informNumber,
isn.next_task_id as nextTaskId,
isn.cancel_reason as cancelReason,
isn.project_contraption_id as projectContraptionId,
DATE_FORMAT(isn.plan_date,'%Y-%m-%d') AS planDate,
DATE_FORMAT(isn.notice_date,'%Y-%m-%d') AS noticeDate,
DATE_FORMAT(isn.accept_date,'%Y-%m-%d') AS acceptDate,
......
......@@ -267,13 +267,11 @@
</if>
<if test="dto.orgBranchCode != null and dto.orgBranchCode != ''">
<choose>
<when test="client == 'jgAudit'">
and supervisionOrgCode = #{dto.orgBranchCode}
<when test="client == 'jgLook'">
and supervisionOrgCode like concat(#{dto.orgBranchCode},'%')
</when>
<otherwise>
and supervisionOrgCode like concat(#{dto.orgBranchCode},'%')
and supervisionOrgCode = #{dto.orgBranchCode}
</otherwise>
</choose>
</if>
......@@ -348,6 +346,16 @@
<if test="dto.auditPassDateStart != null and dto.auditPassDateEnd != null">
AND auditPassDate BETWEEN #{dto.auditPassDateStart} AND #{dto.auditPassDateEnd}
</if>
<if test="dto.orgBranchCode != null and dto.orgBranchCode != ''">
<choose>
<when test="client == 'jgLook'">
and supervisionOrgCode like concat(#{dto.orgBranchCode},'%')
</when>
<otherwise>
and supervisionOrgCode = #{dto.orgBranchCode}
</otherwise>
</choose>
</if>
<if test="dto.dataType == 'supervision' ">
<choose>
<when test="client == 'jgAudit'">
......@@ -932,16 +940,24 @@
ri."EQU_CATEGORY" = '2300'
and ui."DATA_SOURCE" like 'jg%'
and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
<if test="jsonObject.DATA_SOURCE != null and jsonObject.DATA_SOURCE != 'jg_his'">
and ui."DATA_SOURCE" like 'jg%'
and ui."DATA_SOURCE" not like 'jg_his%'
</if>
<if test="jsonObject.DATA_SOURCE != null and jsonObject.DATA_SOURCE == 'jg_his'">
and ui."DATA_SOURCE" like 'jg_his%'
</if>
<if test="jsonObject.DATA_SOURCE == null or jsonObject.DATA_SOURCE == ''">
and ui."DATA_SOURCE" like 'jg%'
</if>
<if test="jsonObject.DATA_SOURCE != null">
<choose>
<when test="jsonObject.DATA_SOURCE == 'jg_his_black'">
and ui."DATA_SOURCE" like 'jg_his_black%'
</when>
<when test="jsonObject.DATA_SOURCE == 'jg_his'">
and ui."DATA_SOURCE" like 'jg_his%'
and ui."DATA_SOURCE" not like 'jg_his_black%'
</when>
<otherwise>
and ui."DATA_SOURCE" like 'jg%'
and ui."DATA_SOURCE" not like 'jg_his%'
</otherwise>
</choose>
</if>
-- 保证使用单位选择设备时(record为null) 能选择到本单位的设备 并且 监管单位在查看时(record 不为null)可以匹配到所有的设备
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != '' and jsonObject.record == null">
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
......@@ -1234,7 +1250,7 @@
<foreach collection="projectContraptionSeqList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
AND ui.IS_INTO_MANAGEMENT = true
--AND ui.IS_INTO_MANAGEMENT = true
ORDER BY ui.REC_DATE DESC
)
</select>
......
......@@ -48,9 +48,10 @@
and tjvi.org_branch_code = #{dto.orgBranchCode}
</when>
<otherwise>
and tjvi.org_branch_code LIKE CONCAT(#{dto.orgBranchCode}, '%')
AND tjvi.org_branch_code LIKE CONCAT(#{dto.orgBranchCode}, '%')
</otherwise>
</choose> </if>
</choose>
</if>
</where>
order by
<if test="sort != null">
......@@ -101,7 +102,8 @@
date_format(tjvi.create_date,'%Y-%m-%d') as createDate,
tjvi.cancel_reason as cancelReason,
tjvi.reg_type as regType,
tjvi.org_branch_code as orgBranchCode
tjvi.org_branch_code as orgBranchCode,
tjvi.org_branch_name as orgBranchName
from tzs_jg_vehicle_information tjvi
</sql>
......
......@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.EquipmentClassifyDto;
import com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
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.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
......@@ -446,6 +447,26 @@ public class CommonController extends BaseController {
/**
* 获取当前登录人单位及以下管辖分局树
*
* @return result
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getOrgTreeByCompanyLevel")
@ApiOperation(httpMethod = "GET", value = "按照当前登录人单位类型返回管辖机构树", notes = "按照当前登录人单位类型返回管辖机构树,")
public ResponseModel<Object> getOrgTreeByCompanyLevel() {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = reginParams.getCompany().getOrgCode();
if (reginParams.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) { // 公司类型人员返回全部树
return getCreatTree();
} else { // 监管机构返回当前登录人机构及一下(只考虑非审批机构使用)
return ResponseHelper.buildResponse(commonService.loginUnitAndBelowGetTree(orgCode));
}
}
/**
* 获取管辖分局树
*
* @return
......
......@@ -31,7 +31,8 @@ import java.util.Map;
@Api(tags = "管道工程装置表Api")
@RequestMapping(value = "/idx-biz-jg-project-contraption")
public class IdxBizJgProjectContraptionController extends BaseController {
// 设备基本信息表单id
private static final String EQUIP_INFO_FORM_ID = "equipInfo";
@Autowired
IdxBizJgProjectContraptionServiceImpl idxBizJgProjectContraptionServiceImpl;
......@@ -124,11 +125,28 @@ public class IdxBizJgProjectContraptionController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/details")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个管道工程装置表", notes = "根据sequenceNbr查询单个管道工程装置表")
public ResponseModel<Map<String, Map<String, Object>>> selectOne(@RequestParam("sequenceNbr") String sequenceNbr) {
public ResponseModel<Map<String, Map<String, Object>>> details(@RequestParam("sequenceNbr") String sequenceNbr) {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.details(sequenceNbr));
}
/**
* 根据sequenceNbr查询详情-不包裹设备表单Id
*
* @param sequenceNbr 主键
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/detailsNotFormId")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个管道工程装置表", notes = "根据sequenceNbr查询单个管道工程装置表")
// 传record的原因是前端组件内部写死了,此处是工程装置表seq
public ResponseModel<Object> detailsNotFormId(@RequestParam("record") String sequenceNbr) {
Map<String, Object> objectMap = idxBizJgProjectContraptionServiceImpl.details(sequenceNbr).get(EQUIP_INFO_FORM_ID);
Object pipelineListObj = objectMap.remove("pipelineList");
objectMap.put("deviceList", pipelineListObj);
return ResponseHelper.buildResponse(objectMap);
}
/**
* 根据sequenceNbr分页查询管道信息
*
* @param sequenceNbr
......
......@@ -166,7 +166,7 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
}
// 历史无证设备录入(有证-his,无证-black))
if ( "black".equals(dataSource) && "2000".equals(equList) && "SB_XZ".equals(type) && "0".equals(businessScenarios)) {
dictionarieValueModels = dictionarieValueModels.stream().filter(dictionarieValueModel -> !dictionarieValueModel.getDictDataValue().equals("移动式压力容器") && !dictionarieValueModel.getDictDataValue().equals("气瓶")).collect(Collectors.toList());
dictionarieValueModels = dictionarieValueModels.stream().filter(dictionarieValueModel -> !dictionarieValueModel.getDictDataValue().equals("移动式压力容器")).collect(Collectors.toList());
}
return ResponseHelper.buildResponse(dictionarieValueModels);
}
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject;
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.controller.BaseController;
......@@ -9,6 +10,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationReform;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationReformServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.feign.privilege.model.AgencyModel;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
......@@ -214,4 +216,31 @@ public class JgChangeRegistrationReformController extends BaseController {
JgChangeRegistrationReform result = jgChangeRegistrationReformServiceImpl.cancelApplication(registrationReformDto.getSequenceNbr(), registrationReformDto.getCancelReason(), user.getRealName());
return ResponseHelper.buildResponse(result);
}
/**
* 查询无使用登记证,不在流程中的,已纳管的,装置父ID为空的数据
* @param current 当前页
* @param size 每页数
* @return page
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jgProjectContraptionPage")
@ApiOperation(value = "查询指定使用单位下的可用装置:做过使用登记且做过改造告知", notes = "查询指定使用单位下的可用装置: 做过使用登记且做过改造告知")
public ResponseModel<IPage<IdxBizJgProjectContraption>> getJgProjectContraptionPage(@RequestParam(required = false) String sequenceNbr,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<IdxBizJgProjectContraption> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
IPage<IdxBizJgProjectContraption> re = jgChangeRegistrationReformServiceImpl.getJgProjectContraptionPage(getSelectedOrgInfo().getCompany().getCompanyCode(), page, sequenceNbr);
return ResponseHelper.buildResponse(re);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询工程装置下的所有的管道", notes = "查询工程装置下的所有的管道")
@GetMapping(value = "/getDeviceListByProjectContraptionSeq")
public ResponseModel<Object> getDeviceListByProjectContraption(@RequestParam("record") String projectContraptionSeq) {
return ResponseHelper.buildResponse(jgChangeRegistrationReformServiceImpl.getDeviceListByProjectContraption(projectContraptionSeq));
}
}
......@@ -122,6 +122,20 @@ public class JgChangeRegistrationUnitController extends BaseController {
/**
* 根据sequenceNbr查询详情
*
* @param sequenceNbr 主键
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/projectContraption/details")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个管道工程装置表", notes = "根据sequenceNbr查询单个管道工程装置表")
public ResponseModel<Map<String, Map<String, Object>>> detailsByProjectContraption(@RequestParam("sequenceNbr") String sequenceNbr,
@RequestParam("applyNo")String applyNo) {
return ResponseHelper.buildResponse(jgChangeRegistrationUnitServiceImpl.detailsByProjectContraption(sequenceNbr,applyNo));
}
/**
* 列表分页查询
*
* @param current 当前页
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.api.common.BaseException;
import com.yeejoin.amos.boot.module.jg.api.dto.JgEquipTransferDto;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEquipTransferServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -145,5 +147,26 @@ public class JgEquipTransferController extends BaseController {
}
return ResponseHelper.buildResponse(map);
}
/**
* 查询有使用登记证,不在流程中的,已纳管的,装置父ID为空的数据
*
* @param useUnitCreditCode 使用单位code
* @param current 当前页
* @param size 每页数
* @return page
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/finishSy/proCon")
@ApiOperation(value = "查询指定使用单位下的可用装置,已纳管且使用登记证编号为空或者null", notes = "不包括流程中的")
public ResponseModel<IPage<IdxBizJgProjectContraption>> getJgProjectContraptionPage(@RequestParam String useUnitCreditCode,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<IdxBizJgProjectContraption> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jgEquipTransferServiceImpl.getJgProjectContraptionPage(useUnitCreditCode, page));
}
}
......@@ -65,13 +65,9 @@ public class JgReformNoticeController extends BaseController {
@PutMapping(value = "/update")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新改造告知", notes = "根据sequenceNbr更新改造告知")
public ResponseModel<JgReformNoticeDto> updateBySequenceNbrJgReformNotice(@RequestParam String submitType,
@RequestBody JgReformNoticeDto installationInfo,
@RequestBody Map<String, Object> noticeMap,
@RequestParam(value = "op", required = false) String op) {
if (Objects.isNull(installationInfo)) {
throw new IllegalArgumentException("参数installationInfo不能为空");
}
return ResponseHelper.buildResponse(jgReformNoticeService.updateInstallationNotice(submitType, installationInfo, op));
return ResponseHelper.buildResponse(jgReformNoticeService.updateNotice(submitType, noticeMap, op));
}
/**
......
......@@ -363,13 +363,14 @@ public class JgUseRegistrationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jgProjectContraptionPage")
@ApiOperation(value = "查询指定使用单位下的可用装置,已纳管且使用登记证编号为空或者null", notes = "不包括流程中的")
public ResponseModel<IPage<IdxBizJgProjectContraption>> getJgProjectContraptionPage(@RequestParam String useUnitCreditCode,
public ResponseModel<IPage<IdxBizJgProjectContraption>> getJgProjectContraptionPage(@RequestParam(value = "useUnitCreditCode") String useUnitCreditCode,
@RequestParam(value = "dataSource") String dataSource,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<IdxBizJgProjectContraption> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
IPage<IdxBizJgProjectContraption> re = jgUseRegistrationServiceImpl.getJgProjectContraptionPage(useUnitCreditCode, page);
IPage<IdxBizJgProjectContraption> re = jgUseRegistrationServiceImpl.getJgProjectContraptionPage(useUnitCreditCode, dataSource, page);
return ResponseHelper.buildResponse(re);
}
......
......@@ -6,9 +6,9 @@ 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.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
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;
......@@ -287,14 +287,40 @@ public class JgUseRegistrationManageController extends BaseController {
Page<JgUseRegistrationManageDto> page = new Page<JgUseRegistrationManageDto>();
page.setCurrent(current);
page.setSize(size);
if (!ValidationUtil.isEmpty(dto.getOriginalUseUnitCreditCode())) {
dto.setUseUnitCreditCodeForSearch(dto.getOriginalUseUnitCreditCode());
String originalUseUnitCreditCode = dto.getOriginalUseUnitCreditCode();
if (!ValidationUtil.isEmpty(originalUseUnitCreditCode)) {
if(originalUseUnitCreditCode.contains("_")){
dto.setUseUnitCreditCodeForSearch(originalUseUnitCreditCode.split("_")[0]);
} else {
dto.setUseUnitCreditCodeForSearch(originalUseUnitCreditCode);
}
} else {
return ResponseHelper.buildResponse(page);
}
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForJgUseRegistrationManagePage(page, dto, sort));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/unitChangeByProjectContraption/page")
@ApiOperation(httpMethod = "GET", value = "单位变更选择工程/装置分页查询", notes = "单位变更选择工程/装置分页查询")
public ResponseModel<Page<IdxBizJgProjectContraption>> queryForUnitByProjectContraptionPage(@RequestParam Map<String, String> params,
@RequestParam(value = "sort", required = false) String sort,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page<IdxBizJgProjectContraption> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
String originalUseUnitCreditCode = params.get("originalUseUnitCreditCode");
if (ValidationUtil.isEmpty(originalUseUnitCreditCode)) {
return ResponseHelper.buildResponse(page);
}else {
if(originalUseUnitCreditCode.contains("_")){
params.put("originalUseUnitCreditCode",originalUseUnitCreditCode.split("_")[0]);
}
}
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryForUnitByProjectContraptionPage(page, params, sort));
}
/**
* 根据sequenceNbr查询---大屏使用
*
......
......@@ -144,7 +144,9 @@ public class JgVehicleInformationController extends BaseController {
dto.setDataType(BaseController.COMPANY_TYPE_COMPANY);
} else {
dto.setDataType(BaseController.COMPANY_TYPE_SUPERVISION);
dto.setOrgBranchCode(dto.getOrgBranchCode() != null ? dto.getOrgBranchCode() : info.getCompany().getOrgCode());
if("jgLook".equals(client)){
dto.setOrgBranchCode(dto.getOrgBranchCode() != null ? dto.getOrgBranchCode() : info.getCompany().getOrgCode());
}
}
Page<Map<String, Object>> list = jgVehicleInformationServiceImpl.getPageList(dto,sort, page, dto.getRoleIds(), client);
list.getRecords().forEach(x -> {
......
......@@ -13,6 +13,8 @@ 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.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.EquipSourceEnum;
......@@ -33,11 +35,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
......@@ -116,6 +118,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
private ESEquipmentCategory esEquipmentCategory;
@Autowired
private DataDictionaryServiceImpl dataDictionaryServiceImpl;
@Autowired
private RedisUtils redisUtils;
@Override
public boolean saveOrUpdateData(IdxBizJgProjectContraption projectContraption) {
......@@ -192,14 +196,15 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
.eq(BaseController.COMPANY_TYPE_COMPANY.equals(companyLevel) && CompanyTypeEnum.CONSTRUCTION.getName().equals(companyType), IdxBizJgProjectContraption::getUscUnitCreditCode, companyCode)
.eq(BaseController.COMPANY_TYPE_COMPANY.equals(companyLevel) && CompanyTypeEnum.USE.getName().equals(companyType), IdxBizJgProjectContraption::getUseUnitCreditCode, companyCode)
.eq(BaseController.COMPANY_TYPE_COMPANY.equals(companyLevel) && CompanyTypeEnum.INDIVIDUAL.getName().equals(companyType), IdxBizJgProjectContraption::getUseUnitCreditCode, companyCode.split("_").length > 1 ? companyCode.split("_")[1] : companyCode)
// 监管机构按照属地监管部门orgCode进行过滤
// 监管机构按照属地监管部门orgCode进行过滤【最大数据集合】
.likeRight(ValidationUtil.isEmpty(useRegDetail) && BaseController.COMPANY_TYPE_SUPERVISION.equals(companyLevel), IdxBizJgProjectContraption::getOrgCode, company.getOrgCode())
.eq(!ValidationUtil.isEmpty(params.get(IS_INTO_MANAGEMENT)), IdxBizJgProjectContraption::getIsIntoManagement, isIntoManagement)
.eq(!ValidationUtil.isEmpty(useRegistrationCode), IdxBizJgProjectContraption::getUseRegistrationCode, useRegistrationCode)
.eq(!ValidationUtil.isEmpty(equCategory), IdxBizJgProjectContraption::getEquCategory, equCategory)
.eq(!ValidationUtil.isEmpty(equDefine), IdxBizJgProjectContraption::getEquDefine, equDefine)
.like(!ValidationUtil.isEmpty(projectContraption), IdxBizJgProjectContraption::getProjectContraption, projectContraption)
.eq(!ValidationUtil.isEmpty(orgBranchCode), IdxBizJgProjectContraption::getOrgCode, orgBranchCode)
.eq(!ValidationUtil.isEmpty(orgBranchCode) && BaseController.COMPANY_TYPE_COMPANY.equals(companyLevel), IdxBizJgProjectContraption::getOrgCode, orgBranchCode) // 企业 等于匹配
.likeRight(!ValidationUtil.isEmpty(orgBranchCode) && BaseController.COMPANY_TYPE_SUPERVISION.equals(companyLevel), IdxBizJgProjectContraption::getOrgCode, orgBranchCode) // 监管 右模糊匹配
.like(!ValidationUtil.isEmpty(projectContraptionNo), IdxBizJgProjectContraption::getProjectContraptionNo, projectContraptionNo)
.isNull(!ValidationUtil.isEmpty(regCodeIsNull) && Boolean.TRUE.equals(Boolean.valueOf(regCodeIsNull)), IdxBizJgProjectContraption::getUseRegistrationCode)
.isNotNull(!ValidationUtil.isEmpty(regCodeIsNull) && Boolean.FALSE.equals(Boolean.valueOf(regCodeIsNull)), IdxBizJgProjectContraption::getUseRegistrationCode)
......@@ -222,9 +227,9 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
List<Long> projectContraptionIdList = pageList.getRecords().stream().map(IdxBizJgProjectContraption::getSequenceNbr).collect(Collectors.toList());
Map<String, Boolean> canEditMap = this.checkContraptionIsCanEdit(projectContraptionIdList);
pageList.getRecords().forEach(record -> record.setCanEdit(canEditMap.get(record.getSequenceNbr())));
pageList.getRecords().forEach(record -> record.setCanEdit(canEditMap.get(record.getSequenceNbr()+"")));
Map<String, Boolean> canDeleteMap = this.checkContraptionIsCanDelete(projectContraptionIdList, isIntoManagement);
pageList.getRecords().forEach(record -> record.setCanDelete(canDeleteMap.get(record.getSequenceNbr())));
pageList.getRecords().forEach(record -> record.setCanDelete(canDeleteMap.get(record.getSequenceNbr()+"")));
//判断是否有检验结果录入
judgeCheckResult(pageList.getRecords());
}
......@@ -339,6 +344,8 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
}
public Map<String, Map<String, Object>> details(String sequenceNbr) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class);
CompanyBo company = reginParams.getCompany();
Map<String, Map<String, Object>> resultMap = new HashMap<>();
if (ObjectUtils.isEmpty(sequenceNbr)) {
resultMap.put(EQUIP_INFO_FORM_ID, Collections.emptyMap());
......@@ -348,6 +355,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
Map<String, Object> projectContraptionMap = Optional.ofNullable(baseMapper.getDetail(sequenceNbr))
.map(map -> {
commonServiceImpl.convertStringToJsonobject(map, jsonFields);
map.put("unitType", company.getCompanyType());
map.put("pipelineList", baseMapper.selectEquipList((String) map.get("SEQUENCE_NBR")));
return map;
})
......@@ -667,6 +675,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
result.put("inspectConclusionCode", info.getInspectConclusion());
result.put("inspectConclusion", Optional.ofNullable(dataDictionaryServiceImpl.getByCode(info.getInspectConclusion(), "JYJL"))
.map(DataDictionary::getName).orElse(""));
result.put("jySeq", info.getSequenceNbr());
return result;
}
}
\ No newline at end of file
......@@ -513,8 +513,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.doubleValue()
);
projectContraption.setUscUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUscUnitCreditCode(companyInfoMap.get("creditCode").toString());
// 历史黑设备新增由使用单位新增
if(dataSource.contains("black")){
projectContraption.setUseUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUseUnitCreditCode(companyInfoMap.get("creditCode").toString());
} else {
projectContraption.setUscUnitName(companyInfoMap.get("companyName").toString());
projectContraption.setUscUnitCreditCode(companyInfoMap.get("creditCode").toString());
}
projectContraption.setIsFirstMerge(false);
idxBizJgProjectContraptionService.saveOrUpdateData(projectContraption);
......@@ -685,6 +691,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentDto.setSTATUS("已认领");
esEquipmentDto.setUSC_UNIT_CREDIT_CODE(projectContraption.getUscUnitCreditCode());
esEquipmentDto.setUSC_UNIT_NAME(projectContraption.getUscUnitName());
esEquipmentDto.setUSE_UNIT_CREDIT_CODE(projectContraption.getUseUnitCreditCode());
esEquipmentDto.setUSE_UNIT_NAME(projectContraption.getUseUnitName());
esEquipmentDto.setPROJECT_CONTRAPTION(projectContraption.getProjectContraption());
esEquipmentDto.setPRODUCT_NAME(pipelineInfo.getPipeName());
esEquipmentDto.setProjectContraptionId(String.valueOf(sequenceNbr));
......@@ -1166,7 +1174,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.filter(x -> "8300".equals(x.getDictDataKey()))
.collect(Collectors.toList());
}
if (EquipmentClassifityEnum.YLGD.getCode().equals(equList) && "black".equals(dataSource)) {
if (EquipmentClassifityEnum.YLGD.getCode().equals(equList)) {
return this.baseMapper.queryAllEquCategoriesUnderTheEquList(equList).stream()
.filter(x -> !"8300".equals(x.getDictDataKey()))
.collect(Collectors.toList());
......@@ -2588,7 +2596,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
// 增加监管端查询, 查询规则看到本级及之下的设备
if(!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))){
boolMust.must(QueryBuilders.termQuery("ORG_BRANCH_CODE.keyword", map.getString("ORG_BRANCH_CODE")));
if(companyLevel.equals(BaseController.COMPANY_TYPE_SUPERVISION)) { // 监管 右模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(company.getString("ORG_BRANCH_CODE")) + "*"));
} else { // 企业 等于查询
boolMust.must(QueryBuilders.termQuery("ORG_BRANCH_CODE.keyword", map.getString("ORG_BRANCH_CODE")));
}
}
builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC);
......
......@@ -959,9 +959,9 @@ public class JgChangeRegistrationNameServiceImpl extends BaseService<JgChangeReg
equList.forEach(info -> {
JSONObject equInfo = JSONObject.parseObject(info.toString());
JgCertificateChangeRecordEq jgCertificateChangeRecordEq = new JgCertificateChangeRecordEq();
jgCertificateChangeRecordEq.setEquId(equInfo.get("SEQUENCE_NBR").toString());
jgCertificateChangeRecordEq.setEquId(Objects.isNull(equInfo.get("SEQUENCE_NBR"))? null : equInfo.get("SEQUENCE_NBR").toString());
jgCertificateChangeRecordEq.setChangeRecordId(jgCertificateChangeRecord.getSequenceNbr().toString());
jgCertificateChangeRecordEq.setProductCode(equInfo.get("FACTORY_NUM").toString());
jgCertificateChangeRecordEq.setProductCode(Objects.isNull(equInfo.get("FACTORY_NUM"))? null : equInfo.get("FACTORY_NUM").toString());
jgCertificateChangeRecordEqs.add(jgCertificateChangeRecordEq);
});
}
......
......@@ -306,12 +306,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 兼容老数据
if (hisData == null) {
Map<String, Object> detail = setNewEquipData(companyLevel, installationInfo);
this.fillingEquCategoryNameForHisData(detail, notice);
return new HashMap<String, Map<String, Object>>() {{
this.put("installationInfo", detail);
}};
} else {
hisData.putAll(installationInfo);
CommonServiceImpl.formatTime2StrDateForEquip(hisData);
this.fillingEquCategoryNameForHisData(hisData, notice);
return new HashMap<String, Map<String, Object>>() {{
this.put("installationInfo", hisData);
}};
......@@ -327,6 +329,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
}
/**
* 历史数据填充设备种类、设备类别、设备品种
* @param detail 返回json
* @param notice 当前单据
*/
private void fillingEquCategoryNameForHisData(Map<String, Object> detail, JgInstallationNotice notice) {
if(!StringUtils.isEmpty(notice.getProjectContraptionId())){
LambdaQueryWrapper<IdxBizJgProjectContraption> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BaseEntity::getSequenceNbr, notice.getProjectContraptionId());
queryWrapper.select(IdxBizJgProjectContraption::getEquListName,IdxBizJgProjectContraption::getEquCategoryName,IdxBizJgProjectContraption::getEquDefineName,BaseEntity::getSequenceNbr);
IdxBizJgProjectContraption projectContraption = projectContraptionService.getBaseMapper().selectOne(queryWrapper);
if(projectContraption != null){
detail.put("equListName", projectContraption.getEquListName());
detail.put("equCategoryName", projectContraption.getEquCategoryName());
detail.put("equDefineName", projectContraption.getEquDefineName());
}
}
}
private List<Map<String, Object>> getEquipListMaps(Iterable<ESEquipmentCategoryDto> equips) {
List<Map<String, Object>> arrayList = new ArrayList<>();
equips.forEach(equip -> {
......@@ -362,6 +383,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
installationInfo.put("pipelineLength", projectContraption.getPipelineLength());
installationInfo.put("projectContraptionNo", projectContraption.getProjectContraptionNo());
installationInfo.put("projectContraption", projectContraption.getProjectContraption());
installationInfo.put("equListName", projectContraption.getEquListName());
installationInfo.put("equCategoryName", projectContraption.getEquCategoryName());
installationInfo.put("equDefineName", projectContraption.getEquDefineName());
equipListMaps = projectContraptionService.getBaseMapper().selectEquipList(projectContraptionId);
equipListMaps.forEach(item ->
item.put("deviceLevel", Optional.ofNullable(dataDictionaryMapper.selectById(String.valueOf(item.get("deviceLevel"))))
......@@ -1941,6 +1965,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if (!ValidationUtil.isEmpty(projectContraption.getAddress())) {
result.fluentPut("address", projectContraption.getAddress());
}
result.put("equListName", projectContraption.getEquListName());
result.put("equCategoryName", projectContraption.getEquCategoryName());
result.put("equDefineName", projectContraption.getEquDefineName());
return result;
}
......
......@@ -14,6 +14,7 @@ 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;
......@@ -21,6 +22,7 @@ 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;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
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;
......@@ -59,6 +61,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;
......@@ -68,6 +72,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.alibaba.fastjson.JSON.parseArray;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl.isValidCreditCode;
......@@ -858,4 +863,32 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
}
return "修复成功!";
}
/**
* 工程/装置分页查询
* @param page
* @param params
* @param sort
* @return
*/
public Page<IdxBizJgProjectContraption> queryForUnitByProjectContraptionPage(Page<IdxBizJgProjectContraption> page, Map<String, String> params, String sort) {
SortVo sortMap = commonServiceImpl.sortFieldConversion(sort);
Page<IdxBizJgProjectContraption> projectContraptionPage = this.baseMapper.queryForUnitByProjectContraptionPage(page, params, sortMap);
List<IdxBizJgProjectContraption> 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()));
item.setFullAddress(
Stream.of(item.getProvinceName(), item.getCityName(), item.getCountyName(), item.getStreetName(), item.getAddress())
.map(value -> value == null ? "" : value)
.collect(Collectors.joining())
);
});
}
return projectContraptionPage;
}
}
\ No newline at end of file
......@@ -413,8 +413,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if("unit".equals(jgUseRegistration.getManageType())){
if (registerInfo.getEquList().equals(EquipmentClassifityEnum.YLGD.getCode())){
// 压力管道逻辑,根据设备record + 检验报告编号判定唯一一条检验流水,有进行更新,无则进行插入
String record = equipment.get("record").toString();
String record = (String) equipment.get("record");
inspectionDetectionInfo.setInspectConclusion((String) equipment.get("inspectConclusionCode"));
inspectionDetectionInfo.setSequenceNbr((String) equipment.get("jySeq"));
saveEquipOfPieLineInspectData(record, inspectionDetectionInfo);
}
} else {
......@@ -441,22 +442,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private void saveEquipOfPieLineInspectData(String record, InspectionDetectionInfo inspectionDetectionInfo) {
// 检验机构 + 设备+ 检验报告编号时 , 是唯一的为了防止老数据有重复的,程序健壮,故使用list进行处理
LambdaQueryWrapper<InspectionDetectionInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(AbstractEquipBaseEntity::getRecord, record)
.eq(!StringUtils.isEmpty(inspectionDetectionInfo.getInspectReportNo()), InspectionDetectionInfo::getInspectReportNo, inspectionDetectionInfo.getInspectReportNo())
.eq(InspectionDetectionInfo::getInspectOrgCode, inspectionDetectionInfo.getInspectOrgCode());
List<InspectionDetectionInfo> inspectionDetectionInfos = inspectionDetectionInfoMapper.selectList(wrapper);
if(inspectionDetectionInfos.isEmpty()){
inspectionDetectionInfo.setRecord(record);
inspectionDetectionInfo.setRecDate(new Date());
// LambdaQueryWrapper<InspectionDetectionInfo> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq(AbstractEquipBaseEntity::getRecord, record)
// .eq(!StringUtils.isEmpty(inspectionDetectionInfo.getInspectReportNo()), InspectionDetectionInfo::getInspectReportNo, inspectionDetectionInfo.getInspectReportNo())
// .eq(InspectionDetectionInfo::getInspectOrgCode, inspectionDetectionInfo.getInspectOrgCode());
// List<InspectionDetectionInfo> inspectionDetectionInfos = inspectionDetectionInfoMapper.selectList(wrapper);
inspectionDetectionInfo.setRecDate(new Date());
if (Objects.isNull(inspectionDetectionInfo.getSequenceNbr())) {
inspectionDetectionInfo.setSequenceNbr(sequence.nextId() + "");
inspectionDetectionInfo.setRecord(record);
inspectionDetectionInfoMapper.insert(inspectionDetectionInfo);
} else {
for (InspectionDetectionInfo inspectionDetectionInfo1 : inspectionDetectionInfos) {
Bean.copyExistPropertis(inspectionDetectionInfo, inspectionDetectionInfo1);
inspectionDetectionInfo1.setRecDate(new Date());
inspectionDetectionInfoMapper.updateById(inspectionDetectionInfo1);
}
inspectionDetectionInfoMapper.updateById(inspectionDetectionInfo);
}
}
......@@ -925,6 +922,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useRegistration.setApplyNo(listResponseModel.getResult().get(0));
useRegistration.setAuditStatus("待提交");
useRegistration.setStatus(WorkFlowStatusEnum.USE_SUBMIT.getPass());
useRegistration.setRegType("2".equals(map.get("regType")) ? "2" : "0");
this.save(useRegistration);
} else {
this.updateById(useRegistration);
......@@ -1370,7 +1368,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
LambdaQueryWrapper<JgUseRegistrationManage> queryWrapper = new LambdaQueryWrapper<JgUseRegistrationManage>()
.eq(JgUseRegistrationManage::getUseRegistrationCode, jgUseRegistration.getUseRegistrationCode())
.eq(JgUseRegistrationManage::getIsDelete, 0);
.eq(JgUseRegistrationManage::getIsDelete, 0)
.ne(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIZHUXIAO.getName());
JgUseRegistrationManage jgUseRegistrationManage = jgUseRegistrationManageService.getBaseMapper().selectOne(queryWrapper);
if (!ValidationUtil.isEmpty(jgUseRegistrationManage)) {
......@@ -2104,6 +2103,25 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
});
}
/**
* 历史数据填充 设备种类、设备类别、设备品种名称
* @param detail 返回数据
* @param jgUseRegistration 当前单据
*/
private void fillingEquCategoryNameForHisData(Map<String, Object> detail, JgUseRegistration jgUseRegistration) {
if(!StringUtils.isEmpty(jgUseRegistration.getProjectContraptionId())){
LambdaQueryWrapper<IdxBizJgProjectContraption> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BaseEntity::getSequenceNbr, jgUseRegistration.getProjectContraptionId());
queryWrapper.select(IdxBizJgProjectContraption::getEquListName,IdxBizJgProjectContraption::getEquCategoryName,IdxBizJgProjectContraption::getEquDefineName,BaseEntity::getSequenceNbr);
IdxBizJgProjectContraption projectContraption = jgProjectContraptionService.getBaseMapper().selectOne(queryWrapper);
if(projectContraption != null){
detail.put("equListName", projectContraption.getEquListName());
detail.put("equCategoryName", projectContraption.getEquCategoryName());
detail.put("equDefineName", projectContraption.getEquDefineName());
}
}
}
public Map<String, Object> getDetail(String record, Long sequenceNbr) {
if (!ObjectUtils.isEmpty(sequenceNbr)) {
JgUseRegistration jgUseRegistration = this.getBaseMapper().selectById(sequenceNbr);
......@@ -2168,6 +2186,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jsonObject.put("useRegistrationCode", jgUseRegistration.getUseRegistrationCode());
jsonObject.put("useRegistrationFormUrl", jgUseRegistration.getUseRegistrationFormUrl());
jsonObject.put("useRegistrationFormFile", JSONArray.parseArray(jgUseRegistration.getUseRegistrationFormFile()));
this.fillingEquCategoryNameForHisData(jsonObject, jgUseRegistration);
// 转化 附件 字段
commonServiceImpl.convertStringToJsonobject(jsonObject, jsonFields);
// 结果增强,填充单据是否可变更设备状态,用来控制前端按钮的显示隐藏。
......@@ -4221,7 +4240,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
this.applicationContext = applicationContext;
}
public IPage<IdxBizJgProjectContraption> getJgProjectContraptionPage(String useUnitCreditCode, Page<IdxBizJgProjectContraption> page) {
public IPage<IdxBizJgProjectContraption> getJgProjectContraptionPage(String useUnitCreditCode, String dataSource, Page<IdxBizJgProjectContraption> page) {
// 兼容个人业务
if(useUnitCreditCode.contains("_")){
useUnitCreditCode = useUnitCreditCode.split("_")[1];
......@@ -4234,7 +4253,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 查询已纳管且使用登记证编号不为空且非流程中的装置
LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode,useUnitCreditCode);
wrapper.eq(IdxBizJgProjectContraption::getIsIntoManagement, true);
if (Optional.ofNullable(dataSource).map(ds -> ds.contains("black")).orElse(false)) {
wrapper.eq(IdxBizJgProjectContraption::getDataSource, dataSource);
} else {
wrapper.eq(IdxBizJgProjectContraption::getIsIntoManagement, true);
}
wrapper.eq(IdxBizJgProjectContraption::getEquCategory, "8300");
wrapper.eq(IdxBizJgProjectContraption::getIsFirstMerge, false);
wrapper.notIn(!proIds.isEmpty(), BaseEntity::getSequenceNbr, proIds);
......@@ -4288,7 +4311,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.put("projectContraptionId", projectContraptionSeq)
.put("projectContraptionNo", projectContraption.getProjectContraptionNo())
.put("isFirstMerge", projectContraption.getIsFirstMerge())
.put("pipelineLength", totalPipelineLength);
.put("pipelineLength", totalPipelineLength)
.put("equListName", projectContraption.getEquListName())
.put("equCategoryName", projectContraption.getEquCategoryName())
.put("equDefineName", projectContraption.getEquDefineName());
setProjectContraptionInfo(projectContraption, resultBuilder);
return resultBuilder.build();
}
......
......@@ -15,7 +15,6 @@ import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.eclipse.paho.client.mqttv3.MqttException;
......@@ -58,15 +57,12 @@ public class SafetyProblemTracingGenServiceImpl{
private SafetyProblemTracingServiceImpl safetyProblemTracingService;
@Autowired
TzBaseEnterpriseInfoMapper baseEnterpriseInfoMapper;
@Autowired
TzsUserInfoMapper tzsUserInfoMapper;
@Scheduled(cron = "0 0 1 * * ?")
@SchedulerLock(name = "executeSafetyProblemCheck", lockAtMostFor = "PT5H", lockAtLeastFor = "PT10M")
public void executeSafetyProblemCheck() {
executeMaintenanceCheck();
executeInspectionCheck();
executeEnterpriseQualificationCheck();
}
......
localhost=${spring.cloud.client.ip-address}
#DB properties:
spring.datasource.url=jdbc:postgresql://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.username=admin
......@@ -6,11 +7,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.243: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.6:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${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.6:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.6:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.6
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=${localhost}
## ES properties:
elasticsearch.username=elastic
elasticsearch.password=a123456
......
......@@ -32,7 +32,7 @@ public class MonthCylinderBusinessStatisticsJob {
this.businessStatisticsMapper = businessStatisticsMapper;
}
@Scheduled(cron = "0 */5 * * * ?")
@Scheduled(cron = "0 0 2 * * ?")
@SchedulerLock(name = "cylinderBusinessStatisticsJob", lockAtMostFor = "PT1H")
public void cylinderBusinessStatisticsJob() {
List<Map<String, Object>> useRegisterCountList = useRegistrationMapper.getUseRegisterCountTotal();
......
......@@ -29,16 +29,18 @@ spring.datasource.dynamic.datasource.cyl.hikari.max-lifetime=120000
spring.datasource.dynamic.datasource.cyl.hikari.connection-timeout=30000
spring.datasource.dynamic.datasource.cyl.hikari.connection-test-query=SELECT 1
localhost=${spring.cloud.client.ip-address}
## eureka properties:
eureka.client.service-url.defaultZone=http://172.16.10.243: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.20:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${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.20:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.20:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.20
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=${localhost}
#redis properties:
spring.redis.database=1
......@@ -72,4 +74,6 @@ eureka.instance.metadata-map.user.name=admin
eureka.instance.metadata-map.user.password=a1234560
spring.security.user.name=admin
spring.security.user.password=a1234560
management.security.enabled=true
\ No newline at end of file
management.security.enabled=true
regulatory_code_prefix=https://sxtzsb.sxsei.com:19435/tzs?code=
\ No newline at end of file
......@@ -203,13 +203,13 @@ public class TzBaseEnterpriseInfoServiceImpl
List<BaseUnitLicence> unitLicences = baseUnitLicenceService.list(new LambdaQueryWrapper<BaseUnitLicence>()
.eq(BaseUnitLicence::getUnitCode, tzBaseEnterpriseInfo.getUseCode()));
List<BaseUnitLicenceDto> unitLicenceDtos = new ArrayList<>();
List<BaseUnitLicence> unitLicencesCollect;
if ("监管机构".equals(companyType)) {
unitLicencesCollect = unitLicences;
} else {
// 解决脏数据问题,脏数据不再显示
unitLicencesCollect = unitLicences.stream()
.filter(baseUnitLicence -> baseUnitLicence.getCertTypeCode() != null && COMPANY_TYPE_CERT_TYPE_MAP.get(companyType).contains((baseUnitLicence.getCertTypeCode())))
List<BaseUnitLicence> unitLicencesCollect = Optional.ofNullable(unitLicences).orElse(Collections.emptyList());
if (!"监管机构".equals(companyType)) {
List<String> certTypeList = Arrays.asList(Optional.ofNullable(COMPANY_TYPE_CERT_TYPE_MAP.get(companyType))
.orElse("")
.split(","));
unitLicencesCollect = unitLicencesCollect.stream()
.filter(unit -> unit.getCertTypeCode() != null && certTypeList.contains(unit.getCertTypeCode()))
.collect(Collectors.toList());
}
if (!ValidationUtil.isEmpty(unitLicencesCollect)) {
......
localhost=${spring.cloud.client.ip-address}
#DB properties:
spring.datasource.url=jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.username=admin
......@@ -6,11 +8,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.243: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.20:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${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.20:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.20:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.20
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=${localhost}
## ES properties:
elasticsearch.username=elastic
elasticsearch.password=a123456
......
package com.yeejoin.amos.boot.module.ymt.api.dto;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -133,4 +134,7 @@ public class IdxBizJgProjectContraptionDto extends BaseDto {
@ApiModelProperty("是否首次合并新增")
private Boolean isFirstMerge;
@ApiModelProperty("最新一次管道改造的长度变化值(正值为增加,负值为减少)")
private String pipeLengthChanged;
}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
......@@ -276,8 +277,15 @@ public class IdxBizJgProjectContraption extends BaseEntity {
private Boolean isFirstMerge;
/**
* 最新一次管道改造的长度变化值(正值为增加,负值为减少)
*/
@TableField("pipe_length_changed")
private String pipeLengthChanged;
/**
* 是否禁用打印汇总表按钮
*/
@TableField(exist = false)
private Boolean disableBasicButton;
}
......@@ -23,7 +23,7 @@ public interface IdxBizJgRegisterInfoMapper extends BaseMapper<IdxBizJgRegisterI
@Select("update idx_biz_jg_register_info set \"USE_ORG_CODE\" = #{useOrgCode} where \"RECORD\" = #{equipCode}")
Boolean updateUseOrgCodeByEquip(@Param("equipCode") String equipCode,@Param("useOrgCode") String useOrgCode);
@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}) order by dictDataKey desc")
List<DictionarieValueModel> queryAllEquCategoriesUnderTheEquList(@Param("equipCode") String equipCode);
@MapKey("uscUnitCreditCode")
......
......@@ -5,6 +5,7 @@
<select id="getDetail" resultType="java.util.Map">
SELECT
SEQUENCE_NBR,
SEQUENCE_NBR as projectContraptionId,
USE_UNIT_CREDIT_CODE,
EQU_LIST,
EQU_CATEGORY,
......@@ -73,7 +74,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
......@@ -313,48 +315,96 @@
</select>
<select id="countContraptionInUseTimesForDeleteByIntoManagement" resultType="java.lang.Integer">
SELECT SUM(inUseNumber) FROM (
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_equip_transfer A
LEFT JOIN tzs_jg_equip_transfer_eq b ON b.equip_transfer_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.apply_status != '6617'
UNION
SELECT COUNT(1) AS inUseNumber FROM tzs_jg_use_registration A
WHERE A.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.status != '已作废'
UNION
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_change_registration_unit A
LEFT JOIN tzs_jg_change_registration_unit_eq b ON b.unit_change_registration_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.status != '已作废'
UNION
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_enable_disable A
LEFT JOIN tzs_jg_enable_disable_eq b ON b.enable_disable_apply_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.audit_status != '已作废'
UNION
SELECT COUNT(DISTINCT A.sequence_nbr) AS inUseNumber FROM tzs_jg_scrap_cancel A
LEFT JOIN tzs_jg_scrap_cancel_eq b ON b.equip_transfer_id = A.sequence_nbr
LEFT JOIN idx_biz_jg_use_info C ON b.equ_id = C.record
WHERE C.project_contraption_id = #{projectContraptionId}
AND A.is_delete = 0
AND A.audit_status != '使用单位已撤回'
UNION
SELECT COUNT(1) AS inUseNumber FROM tzs_jg_installation_notice A
WHERE A.project_contraption_id = #{projectContraptionId}
AND A.notice_status != '6617'
UNION
SELECT COUNT(1) AS inUseNumber FROM tz_jyjc_inspection_application A
WHERE A.project_contraption_id = #{projectContraptionId}
AND A.status != '6617'
) AS result
SELECT SUM(inUseNumber)
FROM (
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_equip_transfer a
JOIN tzs_jg_equip_transfer_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.apply_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_use_registration a
WHERE a.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.status != '已作废'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_change_registration_unit a
JOIN tzs_jg_change_registration_unit_eq b ON b.unit_change_registration_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.status != '已作废'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_enable_disable a
JOIN tzs_jg_enable_disable_eq b ON b.enable_disable_apply_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.audit_status != '已作废'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_scrap_cancel a
JOIN tzs_jg_scrap_cancel_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.audit_status != '使用单位已撤回'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_change_registration_transfer a
JOIN tzs_jg_change_registration_transfer_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.audit_status != '使用单位已撤回'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_change_registration_name a
JOIN tzs_jg_change_registration_name_eq b ON b.name_change_registration_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.audit_status != '使用单位已撤回'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_installation_notice a
WHERE a.project_contraption_id = #{projectContraptionId}
AND a.notice_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_maintain_notice a
JOIN tzs_jg_maintain_notice_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.notice_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_reform_notice a
JOIN tzs_jg_reform_notice_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.notice_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tzs_jg_transfer_notice a
JOIN tzs_jg_transfer_notice_eq b ON b.equip_transfer_id = a.sequence_nbr
JOIN idx_biz_jg_use_info c ON b.equ_id = c.record
WHERE c.project_contraption_id = #{projectContraptionId}
AND a.is_delete = 0
AND a.notice_status != '6617'
UNION ALL
SELECT COUNT(*) AS inUseNumber
FROM tz_jyjc_inspection_application a
WHERE a.project_contraption_id = #{projectContraptionId}
AND a.status != '6617'
) AS subquery
</select>
<select id="countContraptionInUseTimesForDeleteByIntoManagementBatch" resultMap="projectContraptionResultMap">
......
......@@ -154,7 +154,7 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "装备分类列表全部数据查询", notes = "装备分类列表全部数据查询")
@GetMapping(value = "/tree")
public ResponseModel<Object> tree(@RequestParam(value = "code", required = false) String code) throws Exception {
public ResponseModel<Object> tree(@RequestParam(value = "code", required = false) String code,@RequestParam(value = "dataSource", required = false) String dataSource) throws Exception {
if (ObjectUtils.isEmpty(code)) {
return ResponseHelper.buildResponse(new ArrayList<>());
}
......@@ -165,6 +165,13 @@ public class EquipmentCategoryController extends BaseController {
Menu menu = new Menu(root.getId(), root.getName(), 0L, 0);
List<Menu> menus = TreeParser.getTree(root.getId(), list, EquipmentCategory.class.getName(), "getId", 0, "getName",
"getParentId", null, "getCode");
if (Objects.nonNull(dataSource)&&"jg_his_black".equals(dataSource)){
for (Menu menu1 : menus) {
if (menu1.getName().equals("特种气瓶")){
menu1.setName("特种气瓶"+"(非车用气瓶)");
}
}
}
menu.setChildren(menus);
List<Menu> tree = new ArrayList<>();
tree.add(menu);
......
localhost=${spring.cloud.client.ip-address}
#DB properties:
spring.datasource.url=jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
spring.datasource.username=admin
......@@ -6,11 +8,11 @@ eureka.client.service-url.defaultZone=http://172.16.10.243: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.68:${server.port}${server.servlet.context-path}/actuator/health
eureka.instance.health-check-url=http://${localhost}:${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.68:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://172.16.3.68:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=172.16.3.68
eureka.instance.status-page-url=http://${localhost}:${server.port}${server.servlet.context-path}/actuator/info
eureka.instance.metadata-map.management.api-docs=http://${localhost}:${server.port}${server.servlet.context-path}/doc.html
eureka.instance.ip-address=${localhost}
## ES properties:
elasticsearch.username=elastic
elasticsearch.password=a123456
......
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