Commit 2a2ae497 authored by 刘林's avatar 刘林

fix(jg):维修告知bug修改

parent 8cda8fe1
......@@ -13,13 +13,13 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionIn
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProjectContraption;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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 javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
......@@ -276,4 +276,26 @@ public class IdxBizJgProjectContraptionController extends BaseController {
public ResponseModel<List<IdxBizJgProjectContraptionDto>> selectForList() {
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.queryForIdxBizJgProjectContraptionList());
}
/**
* 根据工程装置ID查询设备信息
*
* @param projectContraption
* @param current 当前页
* @param size 大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/getPipelinePageByProjectContraptionSeq")
@ApiOperation(httpMethod = "GET", value = "根据 sequenceNbr 查询管道信息", notes = "管道工程装置表分页查询")
public ResponseModel<Page<Map<String, Object>>> getPipelinePageByProjectContraptionSeq(@RequestParam("projectContraption") String projectContraption,
@RequestParam("number") int current,
@RequestParam("size") int size) {
String sequenceNbr = "";
if (StringUtils.isNotBlank(projectContraption) && projectContraption.contains("_")) {
sequenceNbr = projectContraption.substring(0, projectContraption.indexOf("_"));
}
return ResponseHelper.buildResponse(idxBizJgProjectContraptionServiceImpl.getPipelinePageByProjectContraptionSeq(sequenceNbr, current, size));
}
}
......@@ -209,9 +209,6 @@ public class ChangeEquipImpactCertListener {
case "JG_USAGE_REGISTRATION":// 使用登记
handleUsageRegistration(event);
break;
case "JG_VEHICLE_GAS_APPLICATION":// 车用气瓶登记
handleVehicleRegistration(event);
break;
case "JG_INSTALLATION_NOTIFICATION":// 安装告知
handleInstallationNotice(event);
break;
......@@ -222,12 +219,12 @@ public class ChangeEquipImpactCertListener {
handleNewProjectEdit(event.getData(), event.getBizRelationData().getBizId());
break;
default:
log.warn("未识别的 bizType: {}", event.getBizRelationData().getBizType());
handleDefaultRegistration(event);
break;
}
}
private void handleVehicleRegistration(BaseBizDataChangeEvent event) {
private void handleDefaultRegistration(BaseBizDataChangeEvent event) {
if (event.getBizRelationData().getBizIsFinished()){
JgUseRegistrationManage jgUseRegistrationManage = jgUseRegistrationManageService.lambdaQuery()
.eq(JgUseRegistrationManage::getApplyNo, event.getBizRelationData().getBizId())
......
......@@ -788,4 +788,15 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
result.put("jySeq", info.getSequenceNbr());
return result;
}
public Page<Map<String, Object>> getPipelinePageByProjectContraptionSeq(String sequenceNbr, int current, int size) {
Page<Map<String, Object>> page=new Page<>();
page.setCurrent(current);
page.setSize(size);
page.setRecords(baseMapper.selectPipelineListPage(sequenceNbr, (current - 1) * size, size));
Map<String, Integer> totalMap = baseMapper.selectEquipCount(new ArrayList<>(Collections.singletonList(Long.parseLong(sequenceNbr)))).get(0);
page.setTotal(totalMap.get("count"));
return page;
}
}
\ No newline at end of file
......@@ -31,6 +31,7 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
/**
* 统计设备被引用的次数(只有存在就算引用-作废除外)
*
* @param projectContraptionIdList 设备唯一标识
* @return 被引用次数 > 0 则设备不可删除
*/
......@@ -51,16 +52,18 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
/**
* 统计已纳管设备被引用的次数(只有存在就算引用-作废除外)
*
* @param projectContraptionId 设备唯一标识
* @return 被引用次数 > 0 则设备不可删除
*/
Integer countContraptionInUseTimesForDeleteByIntoManagement(@Param("projectContraptionId")Long projectContraptionId);
Integer countContraptionInUseTimesForDeleteByIntoManagement(@Param("projectContraptionId") Long projectContraptionId);
List<IdxBizJgProjectContraption> selectErrorManagementProject();
/**
* 查询检验的装置
*
* @param page 分页
* @param inspectionType 检验类型
* @param companyCode 公司code
......@@ -71,6 +74,7 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
/**
* 获取管道信息分页
*
* @param sequenceNbr
* @param current
* @param size
......@@ -80,6 +84,7 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
/**
* 获取导出传输/公共管道的信息
*
* @param sequenceNbr
* @return
*/
......@@ -87,8 +92,19 @@ public interface IdxBizJgProjectContraptionMapper extends BaseMapper<IdxBizJgPro
/**
* 统计已纳管设备被引用的次数(只有存在就算引用-作废除外)
*
* @param projectContraptionId 设备唯一标识
* @return 被引用次数 > 0 则设备不可删除
*/
List<Map<String, Integer>> countContraptionInUseTimesForDeleteByIntoManagementBatch(@Param("projectContraptionIdList") List<Long> projectContraptionIdList);
/**
* 获取管道信息分页
*
* @param sequenceNbr
* @param current
* @param size
* @return
*/
List<Map<String, Object>> selectPipelineListPage(@Param("sequenceNbr") String sequenceNbr, @Param("current") int current, @Param("size") int size);
}
\ No newline at end of file
......@@ -206,6 +206,41 @@
limit #{current},#{size}
</select>
<select id="selectPipelineListPage" resultType="java.util.Map">
SELECT
ibjpc.SEQUENCE_NBR,
ibjpc.SEQUENCE_NBR AS PROJECT_CONTRAPTION_ID,
ibjpc.PROJECT_CONTRAPTION,
ibjpc.EQU_LIST_NAME AS EQU_LIST,
ibjpc.EQU_LIST AS EQU_LIST_CODE,
ibjpc.EQU_CATEGORY EQU_CATEGORY_CODE,
ibjpc.EQU_CATEGORY_NAME EQU_CATEGORY,
ibjpc.EQU_DEFINE EQU_DEFINE_CODE,
ibjpc.EQU_DEFINE_NAME EQU_DEFINE,
ibjpc.DATA_SOURCE,
ibjpc.USC_UNIT_CREDIT_CODE,
ibjpc.USE_UNIT_CREDIT_CODE,
ibjpc.USC_UNIT_NAME,
ibjpc.USE_UNIT_NAME,
ibjpc.IS_INTO_MANAGEMENT,
ibjpc.SUPERVISORY_CODE,
ibjpc.USE_REGISTRATION_CODE USE_ORG_CODE,
ibjpc.ADDRESS,
ibjpc.REC_DATE,
ibjpc.ORG_BRANCH_CODE,
ibjpc.ORG_BRANCH_NAME,
ibjpc.EQU_CODE,
ibjui.EQU_STATE,
ibjtpp."PIPE_NAME" AS PRODUCT_NAME,
ibjui.record
FROM IDX_BIZ_JG_PROJECT_CONTRAPTION ibjpc
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjui.PROJECT_CONTRAPTION_ID = ibjpc.SEQUENCE_NBR
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
WHERE ibjpc.SEQUENCE_NBR = #{sequenceNbr}
ORDER BY ibjtpp.REC_DATE ASC
limit #{current},#{size}
</select>
<select id="selectEquipCount" resultType="java.util.Map">
SELECT ibjui.project_contraption_id, CAST(count(1) AS INTEGER) AS count
FROM idx_biz_jg_use_info ibjui
......
......@@ -4,7 +4,8 @@
<select id="getProjectContraption" resultType="java.util.Map">
SELECT
jui.PROJECT_CONTRAPTION AS value
jui.PROJECT_CONTRAPTION AS value,
jui.SEQUENCE_NBR AS sequenceNbr
FROM idx_biz_jg_project_contraption jui
<where>
jui.PROJECT_CONTRAPTION IS NOT NULL
......
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