Commit 1554dd4f authored by Lambertliu's avatar Lambertliu

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

parents 5b7ec4a0 08de6906
......@@ -47,5 +47,5 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat
List<Map<String, Object>> getDeviceListByProjectContraption(@Param("projectContraptionSeq") String projectContraptionSeq);
Map<String, Object> getPipelineEquInfoByRecord(@Param("record") String record);
List<Map<String, Object>> getPipelineEquInfoByRecords(@Param("records") List<String> records);
}
......@@ -228,7 +228,7 @@
ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
pp."DEVICE_NAME" deviceName,z
pp."DEVICE_NAME" deviceName,
(select name from cb_data_dictionary where code = pp."DEVICE_LEVEL" and type = 'GBI') deviceLevel,
pp."PIPE_NAME" pipeName,
pp."PIPELINE_NUMBER" pipelineNumber,
......@@ -293,12 +293,16 @@
</where>
</select>
<select id="getPipelineEquInfoByRecord" resultType="java.util.Map">
<select id="getPipelineEquInfoByRecords" resultType="java.util.Map">
<include refid="page-list-pipeline"/>
<where>
<if test="record != null and record != ''">
and ui."RECORD" = #{record}
<if test="records != null and !records.isEmpty()">
and ui."RECORD" in
<foreach collection="records" item="record" open="(" close=")" separator=",">
#{record}
</foreach>
</if>
</where>
</select>
......
......@@ -1018,8 +1018,8 @@
WHERE
ri."EQU_CATEGORY" = '8300'
and ui."PROJECT_CONTRAPTION_ID" = #{projectContraptionSeq}
AND ui.IS_INTO_MANAGEMENT = false
AND ri."USE_ORG_CODE" <![CDATA[<>]]> ''
AND ui.IS_INTO_MANAGEMENT = true
and (length(ri.USE_ORG_CODE) = 0 or ri.USE_ORG_CODE is null)
ORDER BY ui.REC_DATE DESC
)
</select>
......
......@@ -34,4 +34,11 @@ public class DataHandlerController extends BaseController {
return ResponseHelper.buildResponse(dataHandlerService.deviceListInFormWithInstallNotice());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "向新增的工程装置表刷入数据", notes = "向新增的工程装置表刷入数据")
@GetMapping(value = "/projectContraption/writeData")
public ResponseModel<Boolean> writeData2ProjectContraption() {
return ResponseHelper.buildResponse(dataHandlerService.writeData2ProjectContraption());
}
}
......@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.event.RestEventTrigger;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -167,7 +168,7 @@ public class JgInstallationNoticeController extends BaseController {
notes = "查询工程装置下的所有未做安装告知、不在安装告知流程、安装告知作废的设备")
@GetMapping(value = "/getDeviceListByProjectContraptionSeq")
public ResponseModel<Object> getDeviceListByProjectContraption(@RequestParam Map<String, Object> params) {
String projectContraptionSeq = String.valueOf(params.get("sequenceNbr"));
String projectContraptionSeq = ValidationUtil.isEmpty(params.get("sequenceNbr")) ? String.valueOf(params.get("record")) : params.get("sequenceNbr").toString();
return ResponseHelper.buildResponse(iJgInstallationNoticeService.getDeviceListByProjectContraption(projectContraptionSeq));
}
}
......@@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
......@@ -110,7 +111,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
.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::getEquCategory, equDefine)
.eq(!ValidationUtil.isEmpty(equDefine), IdxBizJgProjectContraption::getEquDefine, equDefine)
.like(!ValidationUtil.isEmpty(projectContraption), IdxBizJgProjectContraption::getProjectContraption, projectContraption)
.like(!ValidationUtil.isEmpty(projectContraptionNo), IdxBizJgProjectContraption::getProjectContraptionNo, projectContraptionNo)
.isNull(!ValidationUtil.isEmpty(regCodeIsNull) && Boolean.TRUE.equals(Boolean.valueOf(regCodeIsNull)), IdxBizJgProjectContraption::getUseRegistrationCode)
......
......@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.util.StringUtil;
import com.google.common.collect.Lists;
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.dao.mapper.DataDictionaryMapper;
......@@ -26,6 +27,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.*;
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.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
......@@ -171,7 +173,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
@Autowired
private IdxBizJgFactoryInfoServiceImpl idxBizJgFactoryInfoService;
@Autowired
private IdxBizJgProjectContraptionServiceImpl projectContraptionService;
@Autowired
private ObjectMapper objectMapper;
......@@ -322,12 +325,21 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private Map<String, Object> setNewEquipData(String companyLevel, Map<String, Object> installationInfo) {
List<Map<String, Object>> equipListMaps = Lists.newArrayList();
String equCategory = (String) installationInfo.get("equCategoryCode");
LambdaQueryWrapper<JgInstallationNoticeEq> lambda = new QueryWrapper<JgInstallationNoticeEq>().lambda();
lambda.eq(JgInstallationNoticeEq::getEquipTransferId, installationInfo.get("sequenceNbr"));
List<JgInstallationNoticeEq> jgInstallationNoticeEqs = jgInstallationNoticeEqMapper.selectList(lambda);
List<String> ids = jgInstallationNoticeEqs.stream().map(item -> item.getEquId()).collect(Collectors.toList());
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids);
List<Map<String, Object>> equipListMaps = getEquipListMaps(equips);
if (!ValidationUtil.isEmpty(jgInstallationNoticeEqs)) {
List<String> ids = jgInstallationNoticeEqs.stream().map(item -> item.getEquId()).collect(Collectors.toList());
// 压力管道从工程装置表查询设备信息
if (PipelineEnum.INDUSTRIAL_PIPELINE.getCode().equals(equCategory)) {
equipListMaps = jgInstallationNoticeMapper.getPipelineEquInfoByRecords(ids);
} else {
Iterable<ESEquipmentCategoryDto> equips = esEquipmentCategory.findAllById(ids);
equipListMaps = getEquipListMaps(equips);
}
}
// Map<String, Object> detail = equipmentInfos.get(0);
// Map<String, Object> equInfo = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(detail.get("equId").toString());
......@@ -1712,8 +1724,16 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
*/
@Override
public Object getDeviceListByProjectContraption(String projectContraptionSeq) {
IdxBizJgProjectContraption projectContraption = projectContraptionService.getById(projectContraptionSeq);
if (ValidationUtil.isEmpty(projectContraption)) {
return null;
}
List<Map<String, Object>> deviceList = this.baseMapper.getDeviceListByProjectContraption(projectContraptionSeq);
return new JSONObject().fluentPut("deviceList", deviceList);
return new JSONObject().fluentPut("deviceList", deviceList)
.fluentPut("projectContraption", projectContraption.getProjectContraption())
.fluentPut("projectContraptionNo", projectContraption.getProjectContraptionNo())
.fluentPut("pipelineLength", projectContraption.getPipelineLength())
.fluentPut("projectContraptionId", projectContraptionSeq);
}
@Override
......
......@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
......@@ -53,18 +52,14 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException;
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 org.typroject.tyboot.core.restful.exception.instance.TooManyRequests;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
......@@ -134,7 +129,7 @@ public class TzBaseEnterpriseInfoServiceImpl
// 使用单位资质
COMPANY_TYPE_CERT_TYPE_MAP.put("使用单位", "1232");
// 检验检测机构资质:细分为1233-1、1233-2
COMPANY_TYPE_CERT_TYPE_MAP.put("检验检测机构", "1233");
COMPANY_TYPE_CERT_TYPE_MAP.put("检验检测机构", "1233-1,1233-2");
// 安装改造维修单位身份资质:充装单位-1231 制造单位-1236 设计单位-1235 安装改造维修单位-1234
COMPANY_TYPE_CERT_TYPE_MAP.put("安装改造维修单位", "1231,1234,1235,1236");
}
......
......@@ -100,4 +100,6 @@ public class IdxBizJgProjectConstructionDto extends BaseDto {
@ApiModelProperty(value = "使用地点_街道")
private String streetName;
@ApiModelProperty(value = "是否西咸:0-否;1-是")
private String isXixian;
}
......@@ -169,4 +169,9 @@ public class IdxBizJgProjectConstruction extends TzsBaseEntity {
@TableField("\"STREET_NAME\"")
private String streetName;
/**
* 是否西咸:0-否;1-是
*/
@TableField("\"IS_XIXIAN\"")
private String isXixian;
}
......@@ -3,8 +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 lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.*;
import lombok.experimental.Accessors;
/**
......@@ -16,6 +15,9 @@ import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("idx_biz_jg_project_contraption")
public class IdxBizJgProjectContraption extends BaseEntity {
......
package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
......
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