Commit d564f664 authored by suhuiguang's avatar suhuiguang

1.压力管道新批量开发,使用登记开发提交

parent dd3515bf
......@@ -110,4 +110,11 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
List<Map> stopStateCount(@Param("orgCode") String orgCode);
List<Map> cancelStateCount(@Param("orgCode") String orgCode, @Param("cancelType") int cancelType);
/**
* 查询指定装置下可做使用登记的的管道,样式为汇总表样式
* @param projectContraptionSeq 装置id
* @return List<Map<String, Object>>
*/
List<Map<String, Object>> selectPieLineListByOfCanReg(@Param("projectContraptionSeq") String projectContraptionSeq);
}
......@@ -228,7 +228,7 @@
ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
pp."DEVICE_NAME" deviceName,
pp."DEVICE_NAME" deviceName,z
(select name from cb_data_dictionary where code = pp."DEVICE_LEVEL" and type = 'GBI') deviceLevel,
pp."PIPE_NAME" pipeName,
pp."PIPELINE_NUMBER" pipelineNumber,
......
......@@ -590,11 +590,13 @@
SELECT
ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
ui."PROJECT_CONTRAPTION_ID" as projectContraptionId,
to_char(ui."USE_DATE", 'YYYY-MM') useDate,
(SELECT DESIGN_UNIT_NAME from idx_biz_jg_design_info where "RECORD" = ui."RECORD") designUnitName,
(SELECT USC_UNIT_NAME from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE DESC limit 1) uscUnitName,
to_char((SELECT USC_DATE from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE DESC limit 1), 'YYYY-MM') uscDate,
ui."RECORD" record,
ui.IS_INTO_MANAGEMENT as isIntoManagement,
ri."EQU_CODE" equCode,
ri."EQU_LIST" equList,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
......@@ -607,6 +609,7 @@
ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
ri."USE_ORG_CODE" useOrgCode,
pp."DEVICE_NAME" deviceName,
(select name from cb_data_dictionary where code = pp."DEVICE_LEVEL" and type = 'GBI') deviceLevel,
pp."PIPE_NAME" pipeName,
......@@ -1009,6 +1012,17 @@
GROUP BY
EQU_CATEGORY
</select>
<select id="selectPieLineListByOfCanReg" resultType="java.util.Map">
select * from (
<include refid="page-list-pipeline"/>
WHERE
ri."EQU_CATEGORY" = '8300'
and ui."PROJECT_CONTRAPTION_ID" = #{projectContraptionSeq}
AND ui.IS_INTO_MANAGEMENT = false
AND ri."USE_ORG_CODE" <![CDATA[<>]]> ''
ORDER BY ui.REC_DATE DESC
)
</select>
<sql id="list-cylinder">
SELECT
......
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;
......@@ -8,6 +9,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege;
......@@ -25,6 +27,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
......@@ -341,4 +344,25 @@ public class JgUseRegistrationController extends BaseController {
return ResponseHelper.buildResponse(jgUseRegistrationServiceImpl.updateCylinderCategoryByEquCodeBatch(cylinderCategory, equCodeList));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/jgProjectContraptionPage")
@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);
IPage<IdxBizJgProjectContraption> re = jgUseRegistrationServiceImpl.getJgProjectContraptionPage(useUnitCreditCode, page);
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(jgUseRegistrationServiceImpl.getDeviceListByProjectContraption(projectContraptionSeq));
}
}
......@@ -6,14 +6,18 @@ import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
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.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
......@@ -101,6 +105,7 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toSet;
/**
* 服务实现类
......@@ -184,8 +189,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
private JgUseRegistrationEqServiceImpl jgUseRegistrationEqService;
@Autowired
private IdxBizJgInspectionDetectionInfoServiceImpl idxBizJgInspectionDetectionInfoService;
@Autowired
private JgUseRegistrationMapper jgUseRegistrationMapper;
@Autowired
private ESEquipmentCategory esEquipmentCategory;
......@@ -202,14 +205,23 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
private IdxBizJgConstructionInfoServiceImpl idxBizJgConstructionInfoService;
@Autowired
private JgInstallationNoticeServiceImpl jgInstallationNoticeService;
@Autowired
private IdxBizJgConstructionInfoMapper constructionInfoMapper;
@Autowired
private SuperviseInfoMapper superviseInfoMapper;
@Autowired
SupervisoryCodeInfoMapper supervisoryCodeInfoMapper;
@Autowired
IdxBizJgProjectContraptionServiceImpl jgProjectContraptionService;
@Autowired
IdxBizJgProjectConstructionMapper idxBizJgProjectConstructionMapper;
@Autowired
IdxBizJgProjectInspectionMapper projectInspectionMapper;
/**
......@@ -697,7 +709,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
try {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class);
CompanyBo company = reginParams.getCompany();
String equListCode = String.valueOf(map.get("EQU_LIST_CODE"));
// 压力管道逻辑
// EquipmentClassifityEnum.YLGD.getCode().equals(equListCode)
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) map.get("equipmentLists");
if (CollectionUtils.isEmpty(equipmentLists)) {
throw new BadRequest("请选择设备信息!");
......@@ -718,12 +732,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 提交时进行校验设备是否在流程中使用(并发及同时打开多个相同的页面时才会出现此种情况)
checkForRepeatUsedEquip(map, equipmentLists, company);
List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = idxBizJgInspectionDetectionInfoService.checkInspectionInfo(
equipmentLists.stream()
.map(v -> (String) v.get("record"))
.collect(Collectors.toList())
);
JgUseRegistration useRegistration = JSON.parseObject(JSON.toJSONString(map), JgUseRegistration.class);
useRegistration.setRegDate(new Date());
useRegistration.setCreateDate(new Date());
......@@ -3598,4 +3606,70 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
public IPage<IdxBizJgProjectContraption> getJgProjectContraptionPage(String useUnitCreditCode, Page<IdxBizJgProjectContraption> page) {
// 查询流程中的装置
List<JgUseRegistration> flowIngPros = this.list(new LambdaQueryWrapper<JgUseRegistration>().notIn(JgUseRegistration::getStatus, NOT_FLOWING_STATE).select(BaseEntity::getSequenceNbr, JgUseRegistration::getProjectContraptionId));
Set<String> proIds = flowIngPros.stream().map(JgUseRegistration::getProjectContraptionId).collect(toSet());
proIds.remove(null);
proIds.remove("");
// 查询已纳管且使用登记证编号不为空或者null且非流程中的装置
LambdaQueryWrapper<IdxBizJgProjectContraption> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IdxBizJgProjectContraption::getUseUnitCreditCode,useUnitCreditCode);
wrapper.eq(IdxBizJgProjectContraption::getIsIntoManagement, true);
wrapper.notIn(!proIds.isEmpty(), BaseEntity::getSequenceNbr, proIds);
wrapper.last("and use_registration_code <> ''");
return jgProjectContraptionService.page(page, wrapper);
}
public Map<String, Object> getDeviceListByProjectContraption(String projectContraptionSeq) {
Map<String, Object> re = new HashMap<>();
List<Map<String, Object>> equList = this.getBaseMapper().selectPieLineListByOfCanReg(projectContraptionSeq);
re.put("equipmentLists",equList);
re.put("projectContraption","111111111");
this.setPieLineInspectInfo(projectContraptionSeq, re);
this.setConstructionInfo(projectContraptionSeq, re);
return re;
}
private void setConstructionInfo(String projectContraptionSeq, Map<String, Object> re) {
LambdaQueryWrapper<IdxBizJgProjectConstruction> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IdxBizJgProjectConstruction::getProjectContraptionId, projectContraptionSeq)
.orderByDesc(IdxBizJgProjectConstruction::getUscDate).last("limit 1");
IdxBizJgProjectConstruction construction = idxBizJgProjectConstructionMapper.selectOne(queryWrapper);
if(construction != null){
re.put("installLeaderName", construction.getConstructionLeaderName());
re.put("installLeaderPhone",construction.getConstructionLeaderPhone());
re.put("installStartDate", construction.getUscDate());
re.put("installPropertyUnitName", construction.getConstructionLeaderName());
re.put("installProxyStatementAttachment", JSON.parseObject(construction.getProxyStatementAttachment()));
re.put("installContractAttachment", JSON.parseObject(construction.getConstructionContractAttachment()));
re.put("insOtherAccessories", JSON.parseObject(construction.getConstructionOtherAccessories()));
re.put("installStreet", construction.getStreetName());
re.put("installProvince", construction.getProvinceName());
re.put("installCity", construction.getCityName());
re.put("installCounty", construction.getCountyName());
re.put("uscUnitCreditCode", construction.getUscUnitCreditCode());
re.put("uscUnitName", construction.getUscUnitName());
}
}
private void setPieLineInspectInfo(String projectContraptionSeq, Map<String, Object> re) {
LambdaQueryWrapper<IdxBizJgProjectInspection> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IdxBizJgProjectInspection::getProjectContraptionId, projectContraptionSeq)
.orderByDesc(IdxBizJgProjectInspection::getInspectDate).last("limit 1");
IdxBizJgProjectInspection inspection = projectInspectionMapper.selectOne(queryWrapper);
if(inspection != null){
re.put("inspectOrgCode", inspection.getInspectOrgCode());
re.put("inspectOrgName", inspection.getInspectOrgCode());
re.put("inspectConclusion", inspection.getInspectConclusion());
re.put("inspectType", inspection.getInspectType());
re.put("inspectDate", inspection.getInspectDate());
re.put("inspectStaff", inspection.getInspectStaff());
re.put("nextInspectDate", inspection.getNextInspectDate());
re.put("inspectReport", JSON.parseObject(inspection.getInspectReport()));
re.put("inspectReportNo",inspection.getInspectReportNo());
// 返回代表是系统的数据,前端控制系统的检验信息不让编辑
re.put("jySeq",inspection.getSequenceNbr());
}
}
}
\ No newline at end of file
......@@ -16,10 +16,10 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="IdxBizJgProjectConstructionDto", description="工程装置-施工信息表")
public class IdxBizJgProjectConstructionDto extends BaseDto {
@ApiModel(value = "IdxBizJgProjectConstructionDto", description = "工程装置-施工信息表")
public class IdxBizJgProjectConstructionDto extends BaseDto {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private String record;
......@@ -76,4 +76,28 @@ public class IdxBizJgProjectConstructionDto extends BaseDto {
@ApiModelProperty(value = "关联设备ids")
private String equipRecords;
@ApiModelProperty(value = "工程装置ID")
private String projectContraptionId;
@ApiModelProperty(value = "使用详细地址")
private String address;
@ApiModelProperty(value = "使用地点_省")
private String provinceName;
@ApiModelProperty(value = "使用地点_市")
private String cityName;
@ApiModelProperty(value = "使用地点_区")
private String countyName;
@ApiModelProperty(value = "使用地点_街道")
private String streetName;
}
......@@ -20,7 +20,7 @@ import java.util.Date;
public class IdxBizJgProjectInspectionDto extends BaseDto {
private static final long serialVersionUID = 1L;
private String record;
private Date recDate;
......@@ -76,4 +76,7 @@ public class IdxBizJgProjectInspectionDto extends BaseDto {
@ApiModelProperty(value = "检验申请单编号")
private String inspectApplyNo;
@ApiModelProperty(value = "工程装置ID")
private String projectContraptionId;
}
......@@ -132,4 +132,41 @@ public class IdxBizJgProjectConstruction extends TzsBaseEntity {
@TableField("\"EQUIP_RECORDS\"")
private String equipRecords;
/**
* 工程装置ID
*/
@TableField("\"PROJECT_CONTRAPTION_ID\"")
private String projectContraptionId;
/**
* 使用详细地址
*/
@TableField("\"ADDRESS\"")
private String address;
/**
* 使用地点_省
*/
@TableField("\"PROVINCE_NAME\"")
private String provinceName;
/**
* 使用地点_市
*/
@TableField("\"CITY_NAME\"")
private String cityName;
/**
* 使用地点_区
*/
@TableField("\"COUNTY_NAME\"")
private String countyName;
/**
* 使用地点_街道
*/
@TableField("\"STREET_NAME\"")
private String streetName;
}
......@@ -132,4 +132,11 @@ public class IdxBizJgProjectInspection extends TzsBaseEntity {
@TableField("\"INSPECT_APPLY_NO\"")
private String inspectApplyNo;
/**
* 工程装置ID
*/
@TableField("\"PROJECT_CONTRAPTION_ID\"")
private String projectContraptionId;
}
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