Commit ab861d05 authored by Lambertliu's avatar Lambertliu

Merge branch 'refs/heads/develop_tzs_register_0207' into develop_tzs_bugfix

# Conflicts: # amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
parents 3445b022 3a8bd898
......@@ -30,7 +30,7 @@ public class StringUtils {
* @param map
* @return
*/
public static String transMap2UrlParam(Map<String, Object> map) {
public static String transMap2UrlParam(String url,Map<String, Object> map) {
StringBuilder stringBuilder = new StringBuilder();
for (Map.Entry entry : map.entrySet()) {
......@@ -39,11 +39,12 @@ public class StringUtils {
continue;
try {
stringBuilder.append("&").append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue().toString(), "UTF-8"));
url = url.replaceAll("\\{"+entry.getKey()+"}",entry.getValue()+"");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
return stringBuilder.toString();
return url + stringBuilder.toString();
}
/**
......@@ -52,16 +53,17 @@ public class StringUtils {
* @param list
* @return
*/
public static String transList2UrlParam(List<Map<String, Object>> list) {
public static String transList2UrlParam(String url,List<Map<String, Object>> list) {
StringBuilder stringBuilder = new StringBuilder();
list.forEach(x -> {
Map<String, Object> map = JSONObject.parseObject(JSON.toJSONString(x));
try {
stringBuilder.append("&").append(map.get("key")).append("=").append(URLEncoder.encode(map.get("value").toString(), "UTF-8"));
url.replaceAll("{"+map.get("key")+"}",map.get("value")+"");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
});
return stringBuilder.toString();
return url + stringBuilder.toString();
}
}
......@@ -4,7 +4,7 @@ import lombok.Data;
@Data
public class CylinderFillingRecordStatisticsDto {
private String time;
private String fillingTime;
private String fillingQuantity;
private String offloadingVolume;
}
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import org.apache.ibatis.annotations.Select;
import org.checkerframework.checker.index.qual.SameLen;
import java.util.List;
/**
* 用于业务变更过程中的历史数据处理的mapper层
*/
public interface DataHandlerMapper {
@Select("SELECT ui.\"RECORD\" \n" +
"FROM \"amos_tzs_biz\".\"idx_biz_jg_use_info\" ui \n" +
"INNER JOIN \"amos_tzs_biz\".\"idx_biz_jg_register_info\" ri \n" +
" ON ui.\"RECORD\" = ri.\"RECORD\"\n" +
"WHERE ui.\"DATA_SOURCE\" = 'jg_his' \n" +
"AND ui.\"EQU_STATE\" IS NULL \n" +
"AND ri.\"EQU_CATEGORY\" = '2300' \n" +
"AND NOT EXISTS (\n" +
" SELECT 1 \n" +
" FROM amos_tzs_biz.tzs_jg_scrap_cancel_eq sceq\n" +
" INNER JOIN amos_tzs_biz.tzs_jg_scrap_cancel sc \n" +
" ON sceq.\"equip_transfer_id\" = sc.\"sequence_nbr\"\n" +
" WHERE sc.\"audit_status\" = '已完成' \n" +
" AND sceq.\"equ_id\" = ui.\"RECORD\"\n" +
")\n" +
"AND NOT EXISTS (\n" +
" SELECT 1 \n" +
" FROM amos_tzs_biz.tzs_jg_enable_disable_eq edeq\n" +
" INNER JOIN amos_tzs_biz.tzs_jg_enable_disable ed \n" +
" ON edeq.\"enable_disable_apply_id\" = ed.\"sequence_nbr\"\n" +
" WHERE ed.\"audit_status\" = '已完成' \n" +
" AND edeq.\"equ_id\" = ui.\"RECORD\"\n" +
")")
List<String> selectOrdinaryHisGasCylinder();
@Select("SELECT ui.\"RECORD\" \n" +
"FROM \"amos_tzs_biz\".\"idx_biz_jg_use_info\" ui \n" +
"INNER JOIN \"amos_tzs_biz\".\"idx_biz_jg_register_info\" ri \n" +
" ON ui.\"RECORD\" = ri.\"RECORD\"\n" +
"WHERE ui.\"DATA_SOURCE\" = 'jg' \n" +
"AND ui.\"EQU_STATE\" IS NULL \n" +
"AND ri.\"EQU_CATEGORY\" = '2300' \n" +
"AND NOT EXISTS (\n" +
" SELECT 1 \n" +
" FROM amos_tzs_biz.tzs_jg_use_registration_eq ureq\n" +
" INNER JOIN amos_tzs_biz.tzs_jg_use_registration ur \n" +
" ON ureq.\"equip_transfer_id\" = ur.\"sequence_nbr\"\n" +
" WHERE ur.\"status\" = '已完成' \n" +
" AND ureq.\"equ_id\" = ui.\"RECORD\"\n" +
")")
List<String> selectOrdinaryGasCylinder();
}
......@@ -1271,7 +1271,7 @@
</select>
<select id="countBizFinishedNumForDPList" resultType="java.util.Map">
SELECT * FROM (SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,
receiveOrgName,create_date as createDate,handle_date as handleDate,'azgz' as tplType,'azgz' as bType,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -1292,7 +1292,7 @@
</if>
union all
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,
receiveOrgName,create_date as createDate,handle_date as handleDate,'azgz' as tplType,'azgz' as bType,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status != '6610' and notice_status != '6615' and notice_status != '6617' and notice_status != '6616'
......@@ -1312,7 +1312,7 @@
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,
receiveOrgName,application_date as createDate,accept_date as handleDate,'jdjy' as tplType,'jdjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -1338,7 +1338,7 @@
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,
receiveOrgName,application_date as createDate,accept_date as handleDate,'jdjy' as tplType,'jdjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -1365,7 +1365,7 @@
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'sydj' as bType FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1380,7 +1380,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'vehicle' as bType FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1396,7 +1396,7 @@
)
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'sydj' as bType FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1410,7 +1410,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'vehicle' as bType FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1428,6 +1428,7 @@
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
'dqjy' as tplType,'dqjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -1453,6 +1454,7 @@
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
'dqjy' as tplType,'dqjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -1478,7 +1480,7 @@
</if>
union all
SELECT * FROM (
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status ='已完成'
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status,'bgdj' as tplType,'gm' as bType FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1492,7 +1494,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'gz' as bType FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1506,7 +1508,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'yz' as bType FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1520,7 +1522,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status ='已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'dw' as bType FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1534,7 +1536,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status ='已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'cyqp' as bType FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1550,7 +1552,7 @@
)
union all
select * from (
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status,'bgdj' as tplType,'gm' as bType from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
</if>
......@@ -1564,7 +1566,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'gz' as bType FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1578,7 +1580,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'yz' as bType FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1592,7 +1594,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'dw' as bType FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
......@@ -1607,7 +1609,7 @@
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'cyqp' as bType FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
......@@ -1623,7 +1625,7 @@
)
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status,'zxbf' as tplType,'zxbf' as bType from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1637,7 +1639,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status,'zxbf' as tplType,'zxbf' as bType from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.create_date as date),#{dto.beginDate})
</if>
......@@ -1886,7 +1888,7 @@
</select>
<select id="countBizFinishedNumForDPListAZGZ" resultType="java.util.Map">
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,
receiveOrgName,create_date as createDate,handle_date as handleDate,'azgz' as tplType,'azgz' as bType,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -1907,7 +1909,7 @@
</if>
union all
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,
receiveOrgName,create_date as createDate,handle_date as handleDate,'azgz' as tplType,'azgz' as bType,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status != '6610' and notice_status != '6615' and notice_status != '6617' and notice_status != '6616'
......@@ -1927,7 +1929,7 @@
<select id="countBizFinishedNumForDPListJDJY" resultType="java.util.Map">
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,
receiveOrgName,application_date as createDate,accept_date as handleDate,'jdjy' as tplType,'jdjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -1953,7 +1955,7 @@
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,
receiveOrgName,application_date as createDate,accept_date as handleDate,'jdjy' as tplType,'jdjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -1980,7 +1982,7 @@
</select>
<select id="countBizFinishedNumForDPListSYDJ" resultType="java.util.Map">
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'sydj' as bType FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1995,7 +1997,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'vehicle' as bType FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -2011,7 +2013,7 @@
)
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'sydj' as bType FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -2025,7 +2027,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'vehicle' as bType FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -2043,6 +2045,7 @@
<select id="countBizFinishedNumForDPListDQJY" resultType="java.util.Map">
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
'dqjy' as tplType,'dqjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -2068,6 +2071,7 @@
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
'dqjy' as tplType,'dqjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
......@@ -2094,7 +2098,7 @@
</select>
<select id="countBizFinishedNumForDPListBGDJ" resultType="java.util.Map">
SELECT * FROM (
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status ='已完成'
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status,'bgdj' as tplType,'gm' as bType FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -2108,7 +2112,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'gz' as bType FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -2122,7 +2126,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'yz' as bType FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -2136,7 +2140,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status ='已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'dw' as bType FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -2150,7 +2154,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status ='已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'cyqp' as bType FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status ='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -2166,7 +2170,7 @@
)
union all
select * from (
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status,'bgdj' as tplType,'gm' as bType from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
</if>
......@@ -2180,7 +2184,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'gz' as bType FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -2194,7 +2198,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'yz' as bType FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -2208,7 +2212,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'dw' as bType FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
......@@ -2223,7 +2227,7 @@
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'cyqp' as bType FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
......@@ -2239,7 +2243,7 @@
)
</select>
<select id="countBizFinishedNumForDPListZXBX" resultType="java.util.Map">
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status,'zxbf' as tplType,'zxbf' as bType from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -2253,7 +2257,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status,'zxbf' as tplType,'zxbf' as bType from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.create_date as date),#{dto.beginDate})
</if>
......
......@@ -133,6 +133,9 @@
<if test="dto.cityName != null and dto.cityName != ''">
and tjurm.equ_use_address LIKE CONCAT('%', #{dto.cityName}, '%')
</if>
<if test="dto.carNumber != null and dto.carNumber != ''">
and tjurm.car_number LIKE CONCAT('%', #{dto.carNumber}, '%')
</if>
ORDER BY
<if test="sort != null">
tjurm.${sort.field} ${sort.sortType},
......
......@@ -132,78 +132,226 @@
tzs_jg_use_registration ur
</sql>
<select id="getListPage" resultType="java.util.Map">
select
*
<sql id="page-list-sub-pipline">
select
ur.sequence_nbr as sequenceNbr,
ur.audit_status as auditStatus,
date_format(ur.reg_date,'%Y-%m-%d') as regDate,
ur.use_unit_name as useUnitName,
ur.status,
ur.receive_org_name as receiveOrgName,
ur.use_address as place,
ur.instance_id as instanceId,
ur.apply_no as applyNo,
ur.next_execute_ids as nextExecuteIds,
ur.promoter,
ur.use_registration_code as useRegistrationCode,
date_format(ur.audit_pass_date,'%Y-%m-%d') as auditPassDate,
date_format(ur.create_date,'%Y-%m-%d') as createDate,
ur.receive_org_name as receiveOrgName,
ur.next_execute_user_ids as nextExecuteUserIds,
ur.next_task_id as nextTaskId,
ur.create_user_id as createUserId,
ur.rec_date as recDate,
ur.manage_type as manageType,
ur.reg_type as regType,
ur.is_delete,
ur.create_date,
ur.receive_company_code,
ur.use_unit_credit_code,
ur.transfer_to_user_ids,
ur.supervision_org_code,
ur.use_address as fullAddress,
ur.cancel_reason as cancelReason,
ur.project_contraption_id as projectContraptionId,
(select group_concat(re.equ_id) from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id) as equipId,
(SELECT
ibjpc.supervisory_code
from
idx_biz_jg_project_contraption ibjpc where ibjpc.sequence_nbr = ur.project_contraption_id) as supervisoryCode,
(SELECT
group_concat(DISTINCT other.CODE96333)
from
idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_other_info other on jri.RECORD = other.RECORD where jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as code96333 ,
(SELECT
group_concat(jri.PRODUCT_NAME)
from
idx_biz_jg_register_info jri where jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as productName,
(SELECT
ibjpc.equ_code
from
idx_biz_jg_project_contraption ibjpc where ibjpc.sequence_nbr = ur.project_contraption_id) as equCode,
(SELECT
group_concat(DISTINCT jri.EQU_LIST)
from
idx_biz_jg_register_info jri where jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as equListCode,
(SELECT
group_concat(DISTINCT jri.EQU_CATEGORY)
from
idx_biz_jg_register_info jri where jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as equCategoryCode,
(SELECT
group_concat(DISTINCT jri."EQU_DEFINE")
from
idx_biz_jg_register_info jri where jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as equDefineCode,
(SELECT
group_concat(DISTINCT c.name)
from
idx_biz_jg_register_info jri,tz_equipment_category c where jri.EQU_LIST = c.code and jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as equListName,
(SELECT
group_concat(DISTINCT c.name)
from
idx_biz_jg_register_info jri,tz_equipment_category c where jri.EQU_CATEGORY = c.code and jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as equCategory,
(SELECT
group_concat(DISTINCT c.name)
from
idx_biz_jg_register_info jri,tz_equipment_category c where jri.EQU_DEFINE = c.code and jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as equDefine,
(SELECT
group_concat(DISTINCT ibjsi.ORG_BRANCH_NAME)
from
idx_biz_jg_supervision_info ibjsi where ibjsi.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as orgBranchName
from
(
<include refid="page-list-sub-select"/>
tzs_jg_use_registration ur
</sql>
<select id="getListPage" resultType="java.util.Map">
SELECT * FROM (
-- 查询 equListCode = '8000' 的情况
SELECT *
FROM (
<include refid="page-list-sub-select"/>
)
<where>
is_delete = 0
AND equListCode <![CDATA[<>]]>'8000'
<if test="dto.equList != null and dto.equList != ''">
AND equListCode = #{dto.equList}
</if>
<if test="dto.equCategory != null and dto.equCategory != ''">
AND equCategoryCode = #{dto.equCategory}
</if>
<if test="dto.equDefine != null and dto.equDefine != ''">
AND equDefineCode = #{dto.equDefine}
</if>
<if test="dto.status != null and dto.status != ''">
AND status = #{dto.status}
</if>
<if test="dto.applicationDate != null">
AND create_date LIKE CONCAT('%', DATE_FORMAT(#{dto.applicationDate}, '%Y-%m-%d'), '%')
</if>
<if test="dto.equCode != null and dto.equCode != ''">
AND equCode LIKE CONCAT('%', #{dto.equCode}, '%')
</if>
<if test="dto.code96333 != null and dto.code96333 != ''">
AND code96333 LIKE CONCAT('%', #{dto.code96333}, '%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
AND supervisoryCode LIKE CONCAT('%', #{dto.supervisoryCode}, '%')
</if>
<if test="dto.fullAddress != null and dto.fullAddress != ''">
AND fullAddress LIKE CONCAT('%', #{dto.fullAddress}, '%')
</if>
<if test="dto.useUnitName != null and dto.useUnitName != ''">
AND useUnitName LIKE CONCAT('%', #{dto.useUnitName}, '%')
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
AND applyNo LIKE CONCAT('%', #{dto.applyNo}, '%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND useRegistrationCode LIKE CONCAT('%', #{dto.useRegistrationCode}, '%')
</if>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
AND use_unit_credit_code = #{dto.useUnitCode}
</if>
<if test="dto.auditPassDateStart != null and dto.auditPassDateEnd != null">
AND auditPassDate BETWEEN #{dto.auditPassDateStart} AND #{dto.auditPassDateEnd}
</if>
<if test="dto.dataType == 'supervision' ">
<choose>
<when test="client == 'jgAudit'">
AND (receive_company_code = #{dto.receiveCompanyCode}
OR transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%'))
</when>
<otherwise>
AND supervision_org_code LIKE CONCAT(#{dto.supervisionOrgCode}, '%')
</otherwise>
</choose>
AND status <![CDATA[<>]]> '使用单位待提交'
</if>
<if test="dto.dataType == 'company' ">
AND (use_unit_credit_code = #{dto.unitCode} OR transfer_to_user_ids LIKE CONCAT ('%',#{dto.currentUserId}, '%'))
</if>
</where>
UNION ALL
-- 查询 equListCode != '8000' 的情况
SELECT *
FROM (
<include refid="page-list-sub-pipline"/>
)
<where>
is_delete = 0
AND equListCode = '8000'
<if test="dto.equList != null and dto.equList != ''">
and equListCode= #{dto.equList}
AND #{dto.equList} = ANY(string_to_array(equListCode, ','))
</if>
<if test="dto.equCategory != null and dto.equCategory != ''">
and equCategoryCode = #{dto.equCategory}
AND equCategoryCode = #{dto.equCategory}
</if>
<if test="dto.equDefine != null and dto.equDefine != ''">
and equDefineCode = #{dto.equDefine}
AND equDefineCode = #{dto.equDefine}
</if>
<if test="dto.status != null and dto.status != ''">
and status = #{dto.status}
AND status = #{dto.status}
</if>
<if test="dto.applicationDate != null">
and create_date like concat('%',DATE_FORMAT(#{dto.applicationDate},'%Y-%m-%d'),'%')
AND create_date LIKE CONCAT('%', DATE_FORMAT(#{dto.applicationDate}, '%Y-%m-%d'), '%')
</if>
<if test="dto.equCode != null and dto.equCode != ''">
and equCode like concat('%',#{dto.equCode},'%')
AND equCode LIKE CONCAT('%', #{dto.equCode}, '%')
</if>
<if test="dto.code96333 != null and dto.code96333 != ''">
and code96333 like concat('%',#{dto.code96333},'%')
AND code96333 LIKE CONCAT('%', #{dto.code96333}, '%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
and supervisoryCode like concat('%',#{dto.supervisoryCode},'%')
AND supervisoryCode LIKE CONCAT('%', #{dto.supervisoryCode}, '%')
</if>
<if test="dto.fullAddress != null and dto.fullAddress != ''">
AND fullAddress LIKE CONCAT('%', #{dto.fullAddress}, '%')
AND fullAddress LIKE CONCAT('%', #{dto.fullAddress}, '%')
</if>
<if test="dto.useUnitName != null and dto.useUnitName != ''">
and useUnitName like concat('%',#{dto.useUnitName},'%')
AND useUnitName LIKE CONCAT('%', #{dto.useUnitName}, '%')
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and applyNo like concat('%',#{dto.applyNo},'%')
AND applyNo LIKE CONCAT('%', #{dto.applyNo}, '%')
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
and useRegistrationCode like concat('%',#{dto.useRegistrationCode},'%')
AND useRegistrationCode LIKE CONCAT('%', #{dto.useRegistrationCode}, '%')
</if>
<if test="dto.useUnitCode != null and dto.useUnitCode != ''">
and use_unit_credit_code = #{dto.useUnitCode}
AND use_unit_credit_code = #{dto.useUnitCode}
</if>
<if test="dto.auditPassDateStart != null and dto.auditPassDateEnd != null">
AND auditPassDate BETWEEN #{dto.auditPassDateStart} AND #{dto.auditPassDateEnd}
</if>
<if test="dto.dataType == 'supervision' ">
<choose>
<when test="client == 'jgAudit'">
AND
(
receive_company_code = #{dto.receiveCompanyCode}
OR transfer_to_user_ids LIKE concat ('%',#{dto.currentUserId}, '%')
)
</when>
<otherwise>
and supervision_org_code LIKE concat (#{dto.supervisionOrgCode}, '%')
</otherwise>
</choose>
AND status <![CDATA[<>]]> '使用单位待提交'
<choose>
<when test="client == 'jgAudit'">
AND (receive_company_code = #{dto.receiveCompanyCode}
OR transfer_to_user_ids LIKE CONCAT('%', #{dto.currentUserId}, '%'))
</when>
<otherwise>
AND supervision_org_code LIKE CONCAT(#{dto.supervisionOrgCode}, '%')
</otherwise>
</choose>
AND status <![CDATA[<>]]> '使用单位待提交'
</if>
<if test="dto.dataType == 'company' ">
AND (use_unit_credit_code = #{dto.unitCode} or transfer_to_user_ids LIKE concat ('%',#{dto.currentUserId}, '%'))
AND (use_unit_credit_code = #{dto.unitCode} OR transfer_to_user_ids LIKE CONCAT ('%',#{dto.currentUserId}, '%'))
</if>
</where>
order by
) AS combined_results
ORDER BY
<choose>
<when test="sort != null">
${sort.field} ${sort.sortType}
......
......@@ -136,4 +136,15 @@ public class DataHandlerController extends BaseController {
public ResponseModel<Boolean> writeProjectContraptionIdInJgUseRegistration() {
return ResponseHelper.buildResponse(dataHandlerService.writeProjectContraptionIdInJgUseRegistration());
}
/**
* BUG 26910 【现场需求】登记证管理中,历史设备登记的普通气瓶,状态为空,新增气瓶的状态为在用
* 将历史导入的普通气瓶和正常导入的普通气瓶刷入设备状态
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "将历史导入的普通气瓶和正常导入的普通气瓶刷入设备状态", notes = "将历史导入的普通气瓶和正常导入的普通气瓶刷入设备状态")
@GetMapping(value = "/ordinaryGasCylinder/equState")
public ResponseModel<String> ordinaryGasCylinderWriteEquState() {
return ResponseHelper.buildResponse(dataHandlerService.ordinaryGasCylinderWriteEquState());
}
}
......@@ -130,11 +130,13 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
List<IdxBizJgUseInfo> useInfos = useInfoService.lambdaQuery().select(IdxBizJgUseInfo::getRecord).eq(IdxBizJgUseInfo::getProjectContraptionId, sequenceNbr).list();
// 删除idx设备表信息 + 删除对应es数据
List<String> records = useInfos.stream().map(IdxBizJgUseInfo::getRecord).collect(Collectors.toList());
if (records.isEmpty()) return Boolean.TRUE;
Map<String, Object> map = new HashMap<>();
map.put("recordList", records);
map.put("equList", PipelineEnum.PRESSURE_PIPELINE.getCode());
registerInfoService.batchDeleteByRecord(map);
if (!records.isEmpty()){
Map<String, Object> map = new HashMap<>();
map.put("recordList", records);
map.put("equList", PipelineEnum.PRESSURE_PIPELINE.getCode());
registerInfoService.batchDeleteByRecord(map);
}
// 删除装置表信息
this.removeById(sequenceNbr);
return Boolean.TRUE;
......
......@@ -84,6 +84,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -502,11 +504,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
projectContraption.setEquCategoryName(equCategoryName);
projectContraption.setEquDefineName(equDefineName);
projectContraption.setPipelineLength(
pipelineList.stream()
.map(pipeline -> pipeline.get("pipeLength"))
.filter(Objects::nonNull)
.mapToDouble(pipeLength -> Double.parseDouble(String.valueOf(pipeLength)))
.sum()
BigDecimal.valueOf(pipelineList.stream()
.map(pipeline -> pipeline.get("pipeLength"))
.filter(Objects::nonNull)
.mapToDouble(pipeLength -> Double.parseDouble(String.valueOf(pipeLength)))
.sum())
.setScale(2, RoundingMode.HALF_UP)
.doubleValue()
);
projectContraption.setUscUnitName(companyInfoMap.get("companyName").toString());
......
......@@ -89,6 +89,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -1923,7 +1925,9 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
result.fluentPut("deviceList", deviceList)
.fluentPut("projectContraption", projectContraption.getProjectContraption())
.fluentPut("projectContraptionNo", projectContraption.getProjectContraptionNo())
.fluentPut("pipelineLength", projectContraption.getPipelineLength())
.fluentPut("pipelineLength", BigDecimal.valueOf(projectContraption.getPipelineLength())
.setScale(2, RoundingMode.HALF_UP)
.doubleValue())
.fluentPut("projectContraptionId", projectContraptionSeq);
if (!ValidationUtil.isEmpty(projectContraption.getCity())) {
result.fluentPut("city", projectContraption.getCity() + "_" + projectContraption.getCityName());
......
......@@ -397,6 +397,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
idxBizJgRegisterInfoMapper.updateUseOrgCodeByEquip(String.valueOf(map.get("equipId")), flag ? useRegistrationCode : useOrgCode);
// 生成监管码、96333码(管道合并到有证不生成)
createCode(map, jgUseRegistration, registerInfo, useInfo, otherInfo);
if ("2".equals(jgUseRegistration.getRegType()) && "3000".equals(map.getString("equList"))) {
// 电梯处理维保信息
this.historyEquUpdateMaintenanceInfo(map);
}
}
private void updateOrCreateInspectionDetection(Map<String, Object> equipment, JgUseRegistration jgUseRegistration, IdxBizJgRegisterInfo registerInfo) {
......@@ -530,6 +534,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
IdxBizJgOtherInfo otherInfo = otherInfoMapper.selectOne(otherLambda);
String supervisoryCode = otherInfo.getSupervisoryCode();
jgUseRegistration.setSupervisoryCode(supervisoryCode);
jgUseRegistration.setManageType("set");
if (!ObjectUtils.isEmpty(map.get("otherAccessories"))) {
jgUseRegistration.setOtherAccessories(JSONObject.toJSONString(map.get("otherAccessories")));
......@@ -738,8 +743,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
lambda.select(JgUseRegistrationEq::getEquId);
List<JgUseRegistrationEq> eqList = jgRelationEquipMapper.selectList(lambda);
// 在使用单位待提交、一级受理已驳回、使用单位已撤回后清除关联的设备,保证可以再次新提单子选择相同的设备进行提交及原有单子的提交校验数据准备
if (NOT_FLOWING_STATE.contains(useRegistrationDb.getStatus())) {
if (NOT_FLOWING_STATE.contains(useRegistrationDb.getStatus()) ||
FlowStatusEnum.TO_BE_DISCARD.getName().equals(data.getStatus())) {
List<String> records = eqList.stream().map(JgUseRegistrationEq::getEquId).collect(toList());
//合并的管道只需要子工程装置管道集合
if (Objects.nonNull(data.getOriginProjectContraptionIds()) &&
!data.getOriginProjectContraptionIds().contains(data.getProjectContraptionId())){
List<IdxBizJgUseInfo> useInfoRecords = idxBizJgUseInfoService.lambdaQuery()
.select(IdxBizJgUseInfo::getRecord)
.in(IdxBizJgUseInfo::getProjectContraptionId, Arrays.asList(data.getOriginProjectContraptionIds().split(",")))
.list();
records = useInfoRecords.stream().map(IdxBizJgUseInfo::getRecord).collect(Collectors.toList());
}
EquipUsedCheckStrategyContext.getUsedStrategy(DEFINITION_KEY)
.delDataForCheckEquipRepeatUsed(records, data.getUseUnitCreditCode());
}
......@@ -2066,6 +2081,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jsonObject.put("receiveOrgCode", jgUseRegistration.getReceiveCompanyCode() + "_" + jgUseRegistration.getReceiveOrgName());
jsonObject.put("status", jgUseRegistration.getStatus());
jsonObject.put("applyNo", jgUseRegistration.getApplyNo());
Optional.ofNullable(jsonObject.get("safetyManagerName")).ifPresent(name -> jsonObject.put("maintenanceManagerName", name));
Optional.ofNullable(jsonObject.get("phone")).ifPresent(phone -> jsonObject.put("maintenanceManagerPhone", phone));
jsonObject.remove("submit");
jsonObject.remove("instanceId");
if (!ObjectUtils.isEmpty(jsonObject.get("factoryUseSiteStreet"))) {
......@@ -2451,21 +2468,22 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
throw new BadRequest("没有查询到汇总信息!");
}
JSONArray allEquipment = new JSONArray();
// 用Set存储已添加的equCode,防止重复添加
Set<String> addedEquCodes = new HashSet<>();
registrationHistoryList.forEach(historyList -> {
JSONObject jsonObject = JSONObject.parseObject(historyList.getChangeData());
JSONArray equipmentLists = (JSONArray) jsonObject.get("equipmentLists");
if("安装告知".equals(type)){
equipmentLists =(JSONArray) jsonObject.get("deviceList");
}
// 填充投用年月
String useDateValue = (String) jsonObject.get("useDate");
JSONArray equipmentLists = "安装告知".equals(type)
? (JSONArray) jsonObject.get("deviceList")
: (JSONArray) jsonObject.get("equipmentLists");
final String useDateValue = jsonObject.getString("useDate");
if (CollectionUtils.isNotEmpty(equipmentLists)) {
equipmentLists = equipmentLists.stream()
equipmentLists.stream()
.map(obj -> (JSONObject) obj)
.peek(equipmentItem -> equipmentItem.put("useDate", timeToMonths(useDateValue)))
.filter(equipmentItem -> this.checkEquStatusInUse(equipmentItem.getString("record")))
.collect(Collectors.toCollection(JSONArray::new));
allEquipment.addAll(equipmentLists);
.filter(equipmentItem -> addedEquCodes.add(equipmentItem.getString("equCode")))
.forEach(allEquipment::add);
}
});
total = allEquipment.size();
......@@ -2929,12 +2947,12 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jgUseRegistration.setPromoter("");
List<JgUseRegistrationEq> eqList = getJgUseRegistrationEqs(jgUseRegistration);
List<String> records = eqList.stream().map(JgUseRegistrationEq::getEquId).collect(Collectors.toList());
jgUseRegistration.setStatus(FlowStatusEnum.TO_BE_DISCARD.getName());
// 单位办理
if ("unit".equals(jgUseRegistration.getManageType())){
//单位办理-历史作废
if ("1".equals(jgUseRegistration.getRegType())){
jgUseRegistration.setStatus(FlowStatusEnum.TO_BE_DISCARD.getName());
// 构建设备删除的 DTO 列表
List<ESEquipmentCategoryDto> esDtoList = records.stream().map(v -> {
ESEquipmentCategoryDto esDto = new ESEquipmentCategoryDto();
......@@ -2953,41 +2971,58 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if (!ValidationUtil.isEmpty(jgUseRegistration.getProjectContraptionId())) {
idxBizJgProjectContraptionMapper.delete(new LambdaQueryWrapper<IdxBizJgProjectContraption>().eq(IdxBizJgProjectContraption::getSequenceNbr,jgUseRegistration.getProjectContraptionId()));
}
}
else{
if (jgUseRegistration.getUseRegistrationCode().startsWith("管")) {
} else{
//判断是否管道
if (FlowStatusEnum.TO_BE_FINISHED.getName().equals(oldStatus) &&
jgUseRegistration.getUseRegistrationCode().startsWith("管")) {
JgUseRegistration lastUseRegistration = jgUseRegistrationMapper.selectOne(new LambdaQueryWrapper<JgUseRegistration>()
.select(JgUseRegistration::getApplyNo)
.eq(JgUseRegistration::getProjectContraptionId, jgUseRegistration.getProjectContraptionId())
.ne(JgUseRegistration::getStatus, "已作废")
.eq(JgUseRegistration::getIsDelete, false)
.orderByDesc(JgUseRegistration::getApplyNo)
.last("limit 1"));
if (lastUseRegistration != null && !lastUseRegistration.getApplyNo().equals(jgUseRegistration.getApplyNo())) {
throw new BadRequest("作废失败,该使用登记证下有合并工程装置,请先作废最新单据后再作废此单据!");
}
if (jgUseRegistration.getProjectContraptionId() == null) {
throw new BadRequest("该作废单据没有工程装置,请联系管理员处理此单据:"+ jgUseRegistration.getApplyNo());
}
}
if (jgUseRegistration.getProjectContraptionId() != null) {
//2.合并后作废
if (!jgUseRegistration.getOriginProjectContraptionIds().contains(jgUseRegistration.getProjectContraptionId())){
eqList.forEach(v->{
// 1.根据eq关系表中保存的原工程装置与设备关系还原use_info和ES
esEquipmentCategory.findById(v.getEquId()).ifPresent(equInfoEs -> {
equInfoEs.setProjectContraptionId(v.getOriginProjectContraptionId());
esEquipmentCategory.save(equInfoEs);
});
LambdaQueryWrapper<IdxBizJgUseInfo> lambda = new QueryWrapper<IdxBizJgUseInfo>().lambda();
lambda.eq(IdxBizJgUseInfo::getRecord, String.valueOf(v.getEquId()));
IdxBizJgUseInfo useInfo = useInfoMapper.selectOne(lambda);
useInfo.setProjectContraptionId(v.getOriginProjectContraptionId());
useInfoMapper.updateById(useInfo);
IdxBizJgProjectContraption originProjectContraption = jgProjectContraptionService.getById(v.getOriginProjectContraptionId());
//还原 原工程装置下equCode和监管码
LambdaUpdateWrapper<IdxBizJgRegisterInfo> updateWrapper = new UpdateWrapper<IdxBizJgRegisterInfo>().lambda()
.eq(IdxBizJgRegisterInfo::getRecord, v.getEquId());
IdxBizJgRegisterInfo idxBizJgRegisterInfo = new IdxBizJgRegisterInfo();
idxBizJgRegisterInfo.setEquCode(originProjectContraption.getEquCode());
idxBizJgRegisterInfoMapper.update(idxBizJgRegisterInfo, updateWrapper);
LambdaUpdateWrapper<IdxBizJgOtherInfo> otherInfoLambdaUpdateWrapper = new UpdateWrapper<IdxBizJgOtherInfo>().lambda()
.eq(IdxBizJgOtherInfo::getRecord, v.getEquId());
IdxBizJgOtherInfo idxBizJgOtherInfo = new IdxBizJgOtherInfo();
idxBizJgOtherInfo.setSupervisoryCode(originProjectContraption.getSupervisoryCode());
otherInfoMapper.update(idxBizJgOtherInfo, otherInfoLambdaUpdateWrapper);
});
//2.根据工程装置ID查询工程装置父级,重置工程装置父级为空
eqList.stream()
.filter(v -> jgUseRegistration.getOriginProjectContraptionIds().contains(v.getOriginProjectContraptionId()))
.forEach(v -> esEquipmentCategory.findById(v.getEquId()).ifPresent(equInfoEs -> {
equInfoEs.setProjectContraptionId(v.getOriginProjectContraptionId());
esEquipmentCategory.save(equInfoEs);
LambdaQueryWrapper<IdxBizJgUseInfo> lambda = new QueryWrapper<IdxBizJgUseInfo>().lambda();
lambda.eq(IdxBizJgUseInfo::getRecord, String.valueOf(v.getEquId()));
IdxBizJgUseInfo useInfo = useInfoMapper.selectOne(lambda);
useInfo.setProjectContraptionId(v.getOriginProjectContraptionId());
useInfoMapper.updateById(useInfo);
IdxBizJgProjectContraption originProjectContraption = jgProjectContraptionService.getById(v.getOriginProjectContraptionId());
//还原 原工程装置下equCode和监管码
LambdaUpdateWrapper<IdxBizJgRegisterInfo> updateWrapper = new UpdateWrapper<IdxBizJgRegisterInfo>().lambda()
.eq(IdxBizJgRegisterInfo::getRecord, v.getEquId());
IdxBizJgRegisterInfo idxBizJgRegisterInfo = new IdxBizJgRegisterInfo();
idxBizJgRegisterInfo.setEquCode(originProjectContraption.getEquCode());
idxBizJgRegisterInfoMapper.update(idxBizJgRegisterInfo, updateWrapper);
LambdaUpdateWrapper<IdxBizJgOtherInfo> otherInfoLambdaUpdateWrapper = new UpdateWrapper<IdxBizJgOtherInfo>().lambda()
.eq(IdxBizJgOtherInfo::getRecord, v.getEquId());
IdxBizJgOtherInfo idxBizJgOtherInfo = new IdxBizJgOtherInfo();
idxBizJgOtherInfo.setSupervisoryCode(originProjectContraption.getSupervisoryCode());
otherInfoMapper.update(idxBizJgOtherInfo, otherInfoLambdaUpdateWrapper);
}));
//2.根据工程装置ID查询工程装置父级,重置工程装置父级为空
jgProjectContraptionService.update(
new LambdaUpdateWrapper<IdxBizJgProjectContraption>()
.eq(IdxBizJgProjectContraption::getProjectContraptionParentId, jgUseRegistration.getProjectContraptionId())
.in(BaseEntity::getSequenceNbr, Arrays.asList(jgUseRegistration.getOriginProjectContraptionIds().split(",")))
.set(IdxBizJgProjectContraption::getProjectContraptionParentId, null)
);
JgRegistrationHistory history = jgRegistrationHistoryService.queryLatestRegistrationHistory(Long.valueOf(jgUseRegistration.getProjectContraptionId()));
......@@ -2995,41 +3030,59 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
JSONObject hisJson = JSON.parseObject(history.getChangeData());
boolean isFirstMerge = (boolean) hisJson.get("isFirstMerge");
//合并到无证总工程
IdxBizJgProjectContraption projectContraption = jgProjectContraptionService.getById(jgUseRegistration.getProjectContraptionId());
if (isFirstMerge) {
IdxBizJgProjectContraption projectContraption = jgProjectContraptionService.getById(jgUseRegistration.getProjectContraptionId());
projectContraption.setIsIntoManagement(false);
projectContraption.setIsFirstMerge(true);
projectContraption.setSupervisoryCode(null);
projectContraption.setEquCode(null);
projectContraption.setUseRegistrationCode(null);
jgProjectContraptionService.updateById(projectContraption);
jgUseRegistration.setStatus(FlowStatusEnum.TO_BE_DISCARD.getName());
projectContraption.setPipelineLength(0.0);
// 处理非批量导入数据,更新关联业务状态
processElseDataByStatus(oldStatus, jgUseRegistration);
// 统一处理设备的纳管状态【注册事务提交后的操作】
registerAfterCommitTask(records);
}else{
List<IdxBizJgUseInfo> useInfoRecords = idxBizJgUseInfoService.lambdaQuery()
.select(IdxBizJgUseInfo::getRecord)
.in(IdxBizJgUseInfo::getProjectContraptionId, Arrays.asList(jgUseRegistration.getOriginProjectContraptionIds().split(",")))
// 查询原工程装置及 useInfo 记录
List<String> originProjectContraptionIds = Arrays.asList(jgUseRegistration.getOriginProjectContraptionIds().split(","));
List<IdxBizJgProjectContraption> originProjectContraptionList = jgProjectContraptionService.lambdaQuery()
.in(BaseEntity::getSequenceNbr, originProjectContraptionIds)
.list();
records = useInfoRecords.stream().map(IdxBizJgUseInfo::getRecord).collect(Collectors.toList());
// 统一处理设备的纳管状态【注册事务提交后的操作】
records = idxBizJgUseInfoService.lambdaQuery()
.select(IdxBizJgUseInfo::getRecord)
.in(IdxBizJgUseInfo::getProjectContraptionId, originProjectContraptionIds)
.list()
.stream()
.map(IdxBizJgUseInfo::getRecord)
.collect(Collectors.toList());
// 统一处理设备的纳管状态
registerAfterCommitTask(records);
processElseDataByStatus(oldStatus, jgUseRegistration);
if (FlowStatusEnum.TO_BE_FINISHED.getName().equals(oldStatus)) {
// 计算管道长度并更新
double originPipelineLength = originProjectContraptionList.stream()
.map(IdxBizJgProjectContraption::getPipelineLength)
.filter(Objects::nonNull)
.mapToDouble(Double::doubleValue)
.sum();
projectContraption.setPipelineLength(projectContraption.getPipelineLength() - originPipelineLength);
}
}
jgProjectContraptionService.updateById(projectContraption);
}
}
//1.子工程装置作废,正常逻辑
else {
jgUseRegistration.setStatus(FlowStatusEnum.TO_BE_DISCARD.getName());
// 统一处理设备的纳管状态【注册事务提交后的操作】
registerAfterCommitTask(records);
processElseDataByStatus(oldStatus, jgUseRegistration);
this.rollBackForPieLine(jgUseRegistration);
}
processElseDataByStatus(oldStatus, jgUseRegistration);
}
//气瓶
else {
jgUseRegistration.setStatus(FlowStatusEnum.TO_BE_DISCARD.getName());
// 处理非批量导入数据,更新关联业务状态
processElseDataByStatus(oldStatus, jgUseRegistration);
// 统一处理设备的纳管状态【注册事务提交后的操作】
......@@ -3039,7 +3092,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
//台套办理
else {
jgUseRegistration.setStatus(FlowStatusEnum.TO_BE_DISCARD.getName());
// 处理非批量导入数据,更新关联业务状态
processElseDataByStatus(oldStatus, jgUseRegistration);
// 统一处理设备的纳管状态【注册事务提交后的操作】
......@@ -3064,32 +3116,33 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private void clearUseInfoOfEquip(JgUseRegistration jgUseRegistration) {
List<JgUseRegistrationEq> eqList = getJgUseRegistrationEqs(jgUseRegistration);
// 0.压力管道 清空装置表的使用登记证编号、删除装置的检验信息
this.rollBackForPieLine(jgUseRegistration);
eqList.forEach(e -> {
String record = e.getEquId();
Boolean flag = Boolean.FALSE;
LambdaQueryWrapper<IdxBizJgRegisterInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(IdxBizJgRegisterInfo::getRecord, record);
IdxBizJgRegisterInfo idxBizJgRegisterInfo = idxBizJgRegisterInfoMapper.selectOne(lambdaQueryWrapper);
if (!ObjectUtils.isEmpty(idxBizJgRegisterInfo)) {
String equCategory = idxBizJgRegisterInfo.getEquCategory();
List<String> codes = UseRegisterCancelEquipEnum.getCodes();
if (codes.contains(equCategory)) {
flag = Boolean.TRUE;
//非管道
if(StringUtils.isEmpty(jgUseRegistration.getProjectContraptionId())){
eqList.forEach(e -> {
String record = e.getEquId();
Boolean flag = Boolean.FALSE;
LambdaQueryWrapper<IdxBizJgRegisterInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(IdxBizJgRegisterInfo::getRecord, record);
IdxBizJgRegisterInfo idxBizJgRegisterInfo = idxBizJgRegisterInfoMapper.selectOne(lambdaQueryWrapper);
if (!ObjectUtils.isEmpty(idxBizJgRegisterInfo)) {
String equCategory = idxBizJgRegisterInfo.getEquCategory();
List<String> codes = UseRegisterCancelEquipEnum.getCodes();
if (codes.contains(equCategory)) {
flag = Boolean.TRUE;
}
}
}
// 1.使用信息表部分字段赋空
this.rollBackUseInfo(record, flag);
// 2.回滚更新idx_biz_jg_register_info表
this.rollBackRegisterInfo(record);
// 3.回滚更新idx_biz_jg_supervision_info表
this.rollBackSupervisionInfo(record);
// 4.es的EQU_STATE, USE_ORG_CODE、ORG_BRANCH_CODE、ORG_BRANCH_NAME、STATUS
this.rollBackForEquipEsInfo(record, flag,jgUseRegistration);
// 5.历史设备处理
this.dealHisRegEquipData(jgUseRegistration, record);
});
// 1.使用信息表部分字段赋空
this.rollBackUseInfo(record, flag);
// 2.回滚更新idx_biz_jg_register_info表
this.rollBackRegisterInfo(record);
// 3.回滚更新idx_biz_jg_supervision_info表
this.rollBackSupervisionInfo(record);
// 4.es的EQU_STATE, USE_ORG_CODE、ORG_BRANCH_CODE、ORG_BRANCH_NAME、STATUS
this.rollBackForEquipEsInfo(record, flag,jgUseRegistration);
// 5.历史设备处理
this.dealHisRegEquipData(jgUseRegistration, record);
});
}
Set<String> equipTransferIds = eqList.stream()
.map(JgUseRegistrationEq::getEquipTransferId)
.filter(Objects::nonNull)
......@@ -3107,7 +3160,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
updateWrapper.set(IdxBizJgProjectContraption::getUseRegistrationCode, null);
idxBizJgProjectContraptionMapper.update(null, updateWrapper);
// 删除改装置的检验信息【只有是在使用登记页面新增的才会删除,使用登记终审通过时,插入的检验信息id为使用登记的主键】
projectInspectionMapper.deleteById(jgUseRegistration.getSequenceNbr());
// projectInspectionMapper.deleteById(jgUseRegistration.getSequenceNbr());
}
}
......@@ -4183,9 +4236,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.put("projectContraptionNo", projectContraption.getProjectContraptionNo())
.put("isFirstMerge", projectContraption.getIsFirstMerge())
.put("pipelineLength", totalPipelineLength);
if (Objects.nonNull(projectContraption.getUseRegistrationCode())){
setProjectContraptionInfo(projectContraption, resultBuilder);
}
setProjectContraptionInfo(projectContraption, resultBuilder);
return resultBuilder.build();
}
......@@ -4193,11 +4244,11 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 查询最新的历史记录
JgRegistrationHistory history = jgRegistrationHistoryService.queryLatestRegistrationHistory(projectContraption.getSequenceNbr());
Map<String, Object> fieldMappings = new HashMap<>();
if (history != null && history.getChangeData() != null) {
JSONObject hisJson = JSON.parseObject(history.getChangeData());
Map<String, Object> fieldMappings = new HashMap<>();
fieldMappings.put("useRegistrationCode", projectContraption.getUseRegistrationCode());
fieldMappings.put("safetyManager", hisJson.get("safetyManagerId") + "_" +hisJson.get("safetyManager"));
fieldMappings.put("safetyManager", hisJson.get("safetyManagerId") + "_" + hisJson.get("safetyManager"));
fieldMappings.put("useDate", hisJson.get("useDate"));
fieldMappings.put("otherAccessories", hisJson.get("otherAccessories"));
fieldMappings.put("factoryUseSiteStreet", hisJson.get("factoryUseSiteStreet"));
......@@ -4216,8 +4267,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
hisJson.get("endLatitudeLongitude"));
fieldMappings.put("estateUnitName", hisJson.get("estateUnitName"));
fieldMappings.put("orgBranchCode", hisJson.get("orgBranchCode"));
fieldMappings.forEach(re::put);
} else {
fieldMappings.put("province", projectContraption.getProvince());
fieldMappings.put("city", projectContraption.getCity());
fieldMappings.put("county", projectContraption.getCounty());
fieldMappings.put("factoryUseSiteStreet", projectContraption.getStreet());
fieldMappings.put("address", projectContraption.getAddress());
fieldMappings.put("startLatitudeLongitude", JSON.parseObject(projectContraption.getStartLatitudeLongitude()));
fieldMappings.put("endLatitudeLongitude", JSON.parseObject(projectContraption.getEndLatitudeLongitude()));
fieldMappings.put("orgBranchCode", projectContraption.getOrgCode()+"_"+ projectContraption.getOrgName());
}
fieldMappings.forEach(re::put);
}
private void setConstructionInfo(String projectContraptionSeq, Map<String, Object> re) {
......
......@@ -65,13 +65,14 @@
E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
</select>
<select id="countEnterpriseUsed" resultType="java.lang.Long">
SELECT COUNT
( DISTINCT ( E.app_id ) )
FROM
tz_cylinder_filling_record
T INNER JOIN tz_base_enterprise_info E ON T.app_id = E.app_id and E.unit_type like '%充装单位%'
WHERE
E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
SELECT COUNT(1)
FROM tz_base_enterprise_info E
WHERE E.unit_type LIKE '%充装单位%' AND E.supervise_org_code LIKE concat ( #{orgCode}, '%' )
AND EXISTS (
SELECT 1
FROM tz_cylinder_filling_record T
WHERE T.app_id = E.app_id
)
</select>
<select id="getStationRateSubPage"
resultType="com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto">
......
......@@ -77,6 +77,22 @@ public class DPSubController {
} else if(template.equals("inspection")) { // 报检
template = template + "_" + param.get("equListCode");
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else if(template.equals("sydj")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
if("vehicle".equals(param.get("bType"))){
template = template + "_" + param.get("bType");
}
} else if(template.equals("azgz")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else if(template.equals("jdjy")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else if(template.equals("dqjy")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else if(template.equals("bgdj")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
template = template + "_" + param.get("bType");
} else if(template.equals("zxbf")){
Assert.notNull(param.get("sequenceNbr"), "sequenceNbr不能为空");
} else {
throw new RuntimeException("暂无模板");
}
......
......@@ -445,14 +445,16 @@ public class CylinderDPStatisticsServiceImpl {
fillingRecord = cylinderInfoMapper.queryFillingRecordByOrgCode(orgCode, LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),null);
offloading = cylinderInfoMapper.queryoffloadingByOrgCode(orgCode, LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")),null);
}
Map<String, String> fillingRecordMap = fillingRecord.stream().collect(Collectors.toMap(CylinderFillingRecordStatisticsDto::getTime, CylinderFillingRecordStatisticsDto::getFillingQuantity));
Map<String, String> offloadingMap = offloading.stream().collect(Collectors.toMap(CylinderFillingRecordStatisticsDto::getTime, CylinderFillingRecordStatisticsDto::getOffloadingVolume));
Map<String, String> fillingRecordMap = fillingRecord.stream().collect(Collectors.toMap(CylinderFillingRecordStatisticsDto::getFillingTime, CylinderFillingRecordStatisticsDto::getFillingQuantity));
Map<String, String> offloadingMap = offloading.stream().collect(Collectors.toMap(CylinderFillingRecordStatisticsDto::getFillingTime, CylinderFillingRecordStatisticsDto::getOffloadingVolume));
List<CylinderFillingRecordStatisticsDto> data = new ArrayList<>();
for (String key : times) {
CylinderFillingRecordStatisticsDto dayData = new CylinderFillingRecordStatisticsDto();
dayData.setTime(key);
dayData.setFillingQuantity(fillingRecordMap.getOrDefault(key, "0"));
dayData.setOffloadingVolume(offloadingMap.getOrDefault(key, "0"));
dayData.setFillingTime(key);
String filling = fillingRecordMap.getOrDefault(key, "0");
dayData.setFillingQuantity(filling.equals("0") ? filling : Double.valueOf(filling).toString());
String offloadingRecord = offloadingMap.getOrDefault(key, "0");
dayData.setOffloadingVolume(offloadingRecord.equals("0") ? offloadingRecord : Double.valueOf(offloadingRecord).toString());
data.add(dayData);
}
return data;
......
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -22,6 +23,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.foundation.context.RequestContext;
......@@ -100,9 +102,11 @@ public class DPSubServiceImpl {
Object api = JsonValueUtils.getValueByKey(jsonObject, "dataConfig", "dataConfig.api");
String renderType = jsonObject.getString("renderType");
Object apiResult = null;
ResponseModel responseModel = this.getApiResult((JSONObject) api, !ValidationUtil.isEmpty(resultConvert) ? resultConvert.toString() : null);
ResponseModel responseModel = this.getApiResult((JSONObject) api, !ValidationUtil.isEmpty(resultConvert) ? resultConvert.toString() : null ,null);
if (!ValidationUtil.isEmpty(responseModel.getResult())) {
apiResult = responseModel.getResult();
}else{
apiResult = new JSONObject();
}
if ("timeline".equals(renderType)){
return apiResult;
......@@ -128,6 +132,7 @@ public class DPSubServiceImpl {
String renderType = tab.getString("renderType");
Object resultConvert = JsonValueUtils.getValueByKey(tab, "dataConfig", "dataConfig.resultConvert");
Object api = JsonValueUtils.getValueByKey(tab, "dataConfig", "dataConfig.api");
JSONArray subResultParams = tab.getJSONArray("subResultParams");
tab.put("param", param);
JSONObject map = content.getJSONObject(tab.getString("key"));
......@@ -138,9 +143,21 @@ public class DPSubServiceImpl {
if (!ValidationUtil.isEmpty(api)) {
long s = System.currentTimeMillis();
ResponseModel responseModel = this.getApiResult((JSONObject) api, !ValidationUtil.isEmpty(resultConvert) ? resultConvert.toString() : null);
ResponseModel responseModel = this.getApiResult((JSONObject) api, !ValidationUtil.isEmpty(resultConvert) ? resultConvert.toString() : null,null);
if (!ValidationUtil.isEmpty(responseModel.getResult())) {
apiResult = responseModel.getResult();
if(!CollectionUtils.isEmpty(subResultParams)){
for(Object subParam : subResultParams) {
if(StrUtil.isNotBlank(((JSONObject) apiResult).getString(subParam + ""))) {
String[] s1 = ((JSONObject) apiResult).getString(subParam + "").split("_");
if(s1.length > 1) {
((JSONObject) apiResult).put(subParam + "", s1[1]);
}
}
}
}
}else{
apiResult = new JSONObject();
}
long e = System.currentTimeMillis();
log.info("{}tab页获取详情接口,共耗时:{} 毫秒", tab.get("displayName"), (e - s));
......@@ -329,13 +346,15 @@ public class DPSubServiceImpl {
private JSONArray processShowHideRules(JSONArray children, Object showHideRules, Object apiResult) {
JSONObject result = JSONObject.parseObject(apiResult.toString());
Map<String,String> relationMap = new HashMap<>();
relationMap.put("and","&&");
relationMap.put("or","||");
if (!ValidationUtil.isEmpty(showHideRules)) {
((JSONArray) showHideRules).stream().forEach(x -> {
JSONObject xObj = (JSONObject) x;
boolean hide = true;
JSONArray conditions = xObj.getJSONArray("condition");
String relation = null;
boolean lastConditionResult = false;
String relation = "";
for (int i = 0; i < conditions.size(); i++) {
JSONObject conditionObj = conditions.getJSONObject(i);
String value = conditionObj.getString("value");
......@@ -343,32 +362,26 @@ public class DPSubServiceImpl {
JSONObject item = this.findByEid(children, JsonValueUtils.getValueByKey(conditionObj, "name", "name.key").toString());
Object fieldvalue = result.get(JsonValueUtils.getValueByKey(item, "visualParams", "visualParams.fieldKey"));
if (ValidationUtil.isEmpty(relation)) {
if (condition.equals("notUndefined") && !ValidationUtil.isEmpty(fieldvalue)) {
lastConditionResult = !ValidationUtil.isEmpty(fieldvalue);
hide = false;
} else if (condition.equals("unequal") && !ValidationUtil.isEmpty(fieldvalue) && !fieldvalue.equals(value)) {
lastConditionResult = !fieldvalue.equals(value);
hide = false;
} else if (condition.equals("equal") && !ValidationUtil.isEmpty(fieldvalue) && fieldvalue.equals(value)) {
lastConditionResult = fieldvalue.equals(value);
hide = false;
}
} else {
if (lastConditionResult && condition.equals("notUndefined") && !ValidationUtil.isEmpty(fieldvalue)) {
lastConditionResult = !ValidationUtil.isEmpty(fieldvalue);
hide = false;
} else if (lastConditionResult && condition.equals("unequal") && !ValidationUtil.isEmpty(fieldvalue) && !fieldvalue.equals(value)) {
lastConditionResult = !fieldvalue.equals(value);
hide = false;
} else if (lastConditionResult && condition.equals("equal") && !ValidationUtil.isEmpty(fieldvalue) && fieldvalue.equals(value)) {
lastConditionResult = fieldvalue.equals(value);
hide = false;
} else {
hide = true;
}
if (condition.equals("notUndefined")) {
relation += !ValidationUtil.isEmpty(fieldvalue);
} else if (condition.equals("unequal")) {
relation += !value.equals(fieldvalue);
} else if (condition.equals("equal")) {
relation += value.equals(fieldvalue);
} else if (condition.equals("inList")){
relation += value.contains(fieldvalue+"");
} else if (condition.equals("unList")) {
relation += !value.contains(fieldvalue+"");
}
relation = conditionObj.getString("relation");
relation += relationMap.getOrDefault(conditionObj.getString("relation"),"");
}
// 获取 JavaScript 引擎
ScriptEngine engine = new ScriptEngineManager().getEngineByName("javascript");
try {
// 将结果转换为布尔值
hide = !(Boolean) engine.eval(relation);
} catch (Exception e) {
hide = true;
}
if (hide) {
......@@ -508,12 +521,31 @@ public class DPSubServiceImpl {
Object displayName = JsonValueUtils.getValueByKey(yObj, "visualParams", "visualParams.title");
subObj.put("displayName", displayName);
subObj.put("renderType", "basic");
subObj.put("columns", columnsArray.size());
subObj.put("columns", columnsArray.size()> 4 ? 4 : columnsArray.size());
JSONArray datas = new JSONArray();
mergedArray.stream().forEach(x -> {
Object fieldKey = JsonValueUtils.getValueByKey(x, "visualParams", "visualParams.fieldKey");
if (!ValidationUtil.isEmpty(fieldKey)) {
Object componentKey = JsonValueUtils.getValueByKey(x, "componentKey", null);
if("tableToTable".equals(componentKey+"")){
JSONArray children1 = (JSONArray) JsonValueUtils.getValueByKey(x, "visualParams", "visualParams.tableColumns");
List<JSONObject> columns = children1.stream().map(t -> {
JSONObject xObj = (JSONObject) t;
JSONObject jsonObject = new JSONObject();
jsonObject.put("key", xObj.get("key"));
jsonObject.put("dataIndex", xObj.get("dataIndex"));
jsonObject.put("title", xObj.get("title"));
return jsonObject;
}).collect(Collectors.toList());
subObj.put("renderType", "table");
subObj.put("displayName", JsonValueUtils.getValueByKey(x, "visualParams", "visualParams.label"));
subObj.put("rowKey", "key");
subObj.put("showPage", false);
subObj.put("columns",columns);
Object o = JSONObject.parseObject(apiResult.toString()).get(fieldKey);
subObj.put("dataList",o);
} else if (!ValidationUtil.isEmpty(fieldKey)) {
this.processWidgets(tab, datas, x, displayName, fieldKey.toString(), JSONObject.parseObject(apiResult.toString()), matinfo);
subObj.put("datas", datas);
}
......@@ -613,7 +645,7 @@ public class DPSubServiceImpl {
}
} else if ("attachmentUpload".equals(xObj.getString("componentKey"))) {
JSONArray attachmentUploadDatas = matinfo.getJSONArray("datas");
if (!ValidationUtil.isEmpty(value)) {
if (!ValidationUtil.isEmpty(value) && !"null".equals(value)) {
JSONObject attachmentUploadDatasObj = new JSONObject();
log.info("附件数据:{}", value);
((JSONArray)value).stream().forEach(y -> {
......@@ -667,22 +699,33 @@ public class DPSubServiceImpl {
}
} else if ("checkbox".equals(xObj.getString("componentKey"))) {
ResponseModel checkboxResult = this.getApiResult(visualParams.getJSONObject("api"), null);
if (!ValidationUtil.isEmpty(checkboxResult) && checkboxResult.getStatus() == 200 && !ValidationUtil.isEmpty(value)) {
List<Object> collect = ((JSONArray) checkboxResult.getResult()).stream().filter(y -> ((JSONArray) value).contains(JsonValueUtils.getValueByKey(y, "valueKey", "valueKey"))).collect(Collectors.toList());
String nameKey = collect.stream().map(item -> ((JSONObject) item).getString("nameKey")).collect(Collectors.joining("、"));
jsonObject.put("value", nameKey);
if (!ValidationUtil.isEmpty(visualParams.getJSONObject("api"))){
ResponseModel checkboxResult = this.getApiResult(visualParams.getJSONObject("api"), null,apiResult);
if (!ValidationUtil.isEmpty(checkboxResult) && checkboxResult.getStatus() == 200 && !ValidationUtil.isEmpty(value)) {
List<Object> collect = ((JSONArray) checkboxResult.getResult()).stream().filter(y -> ((JSONArray) value).contains(JsonValueUtils.getValueByKey(y, "valueKey", "valueKey"))).collect(Collectors.toList());
String nameKey = collect.stream().map(item -> ((JSONObject) item).getString("nameKey")).collect(Collectors.joining("、"));
jsonObject.put("value", nameKey);
}
}
} else if ("select".equals(xObj.getString("componentKey"))) {
ResponseModel selectResult = this.getApiResult(visualParams.getJSONObject("api"), null);
if (!ValidationUtil.isEmpty(selectResult) && selectResult.getStatus() == 200 && !ValidationUtil.isEmpty(value)) {
((JSONArray) selectResult.getResult()).stream().filter(y -> value.equals(JsonValueUtils.getValueByKey(y, "valueKey", "valueKey"))).findFirst().ifPresent(z -> {
jsonObject.put("value", ((JSONObject) z).getString("nameKey"));
});
if (!ValidationUtil.isEmpty(visualParams.getJSONObject("api")) && StrUtil.isNotEmpty(visualParams.getJSONObject("api").getString("apiPath"))){
ResponseModel selectResult = this.getApiResult(visualParams.getJSONObject("api"), null,apiResult);
if (!ValidationUtil.isEmpty(selectResult) && selectResult.getStatus() == 200 && !ValidationUtil.isEmpty(value)) {
((JSONArray) selectResult.getResult()).stream().filter(y -> value.equals(JsonValueUtils.getValueByKey(y, "valueKey", "valueKey")+"")).findFirst().ifPresent(z -> {
jsonObject.put("value", ((JSONObject) z).getString("nameKey"));
});
}
} else if(!CollectionUtils.isEmpty(visualParams.getJSONArray("data"))){
for(int i=0;i<visualParams.getJSONArray("data").size();i++){
if(visualParams.getJSONArray("data").getJSONObject(i).getString("value").equals(apiResult.getString(visualParams.getString("fieldKey")))){
jsonObject.put("value",visualParams.getJSONArray("data").getJSONObject(i).getString("name"));
break;
}
}
}
} else if ("radio".equals(xObj.getString("componentKey"))) {
if (!ValidationUtil.isEmpty(visualParams.getJSONObject("api"))){
ResponseModel checkboxResult = this.getApiResult(visualParams.getJSONObject("api"), null);
ResponseModel checkboxResult = this.getApiResult(visualParams.getJSONObject("api"), null,apiResult);
if (!ValidationUtil.isEmpty(checkboxResult) && checkboxResult.getStatus() == 200 && !ValidationUtil.isEmpty(value)) {
List<Object> collect = ((JSONArray) checkboxResult.getResult()).stream().filter(y -> ((JSONArray) value).contains(JsonValueUtils.getValueByKey(y, "valueKey", "valueKey"))).collect(Collectors.toList());
String nameKey = collect.stream().map(item -> ((JSONObject) item).getString("nameKey")).collect(Collectors.joining("、"));
......@@ -698,6 +741,8 @@ public class DPSubServiceImpl {
));
jsonObject.put("value", fieldMap.get(value));
}
} else if("tableToTable".equals(xObj.getString("componentKey"))){
}
}
if (!("upload".equals(xObj.getString("componentKey")) || "attachmentUpload".equals(xObj.getString("componentKey")))){
......@@ -740,8 +785,11 @@ public class DPSubServiceImpl {
return map;
}
public ResponseModel getApiResult(JSONObject apiObj, String resultConvert) {
public ResponseModel getApiResult(JSONObject apiObj, String resultConvert, JSONObject detailResult) {
String url = apiObj.getString("apiPath");
if(ValidationUtil.isEmpty(url)){
return null;
}
String reqType = !ValidationUtil.isEmpty(apiObj.getString("httpMethod")) ? apiObj.getString("httpMethod") : "GET";
Object params = apiObj.get("params");
if (ValidationUtil.isEmpty(params) && !ValidationUtil.isEmpty(apiObj.get("queryParams"))){
......@@ -751,6 +799,8 @@ public class DPSubServiceImpl {
JSONObject xObj = (JSONObject) x;
if ("staticValue".equals(JsonValueUtils.getValueByKey(x, "value", "value.source"))){
queryParam.put(xObj.getString("name"), xObj.getJSONObject("value").getString("value"));
}else if ("sketchProps".equals(JsonValueUtils.getValueByKey(x, "value", "value.source"))){
queryParam.put(xObj.getString("name"), detailResult.getString(xObj.getJSONObject("value").getString("value")));
}
});
if (!ValidationUtil.isEmpty(queryParam)){
......@@ -842,9 +892,9 @@ public class DPSubServiceImpl {
url += "?";
}
if (params instanceof Map) {
url = url + StringUtils.transMap2UrlParam((Map) params);
url = StringUtils.transMap2UrlParam(url, (Map) params);
} else if (params instanceof List) {
url = url + StringUtils.transList2UrlParam((List) params);
url = StringUtils.transList2UrlParam(url, (List) params);
}
return url.replace("?&", "?");
}
......
{
"name": "安装告知",
"tabs": [
{
"key": "basic",
"displayName": "安装告知详情",
"renderType": "basic",
"formSeq": "1734107811517853698",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-installation-notice/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.installationInfo"
}
}
},
"subResultParams": ["province","city","county","orgBranchCode","factoryUseSiteStreet","installLeaderId",
"useUnitCreditCode","propertyUnitName"]
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "车用气瓶变更",
"tabs": [
{
"key": "basic",
"displayName": "车用气瓶变更详情",
"renderType": "basic",
"formSeq": "1811232965410189314",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-vehicle-registration-unit/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
},
"subResultParams": ["useUnitCreditCode","receiveOrgCode","orgBranchCode"]
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "单位变更",
"tabs": [
{
"key": "basic",
"displayName": "单位变更详情",
"renderType": "basic",
"formSeq": "1738022519656443905",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-registration-unit/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.changeRegisInfo"
}
}
},
"subResultParams": ["useUnitCreditCode","receiveOrgCode","newUseUnitName"]
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "更名变更",
"tabs": [
{
"key": "basic",
"displayName": "更名变更详情",
"renderType": "basic",
"formSeq": "1739185443716493313",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-registration-name/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.jgRegistrationInfo"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "改造变更",
"tabs": [
{
"key": "basic",
"displayName": "改造变更详情",
"renderType": "basic",
"formSeq": "1737034262198120450",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-registration-reform/getDetail",
"params": {
"currentDocumentId": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
},
"subResultParams": ["receiveCompanyCode"]
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "移装变更",
"tabs": [
{
"key": "basic",
"displayName": "移装变更详情",
"renderType": "basic",
"formSeq": "1737063574276173826",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-change-registration-transfer/detail",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.changeRegistrationTransfer"
}
}
},
"subResultParams": ["receiveCompanyCode","transferProvince","transferCity","transferCounty","transferStreet",
"orgBranchCode","transferUseInfo","transferSafetyManager"]
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "定期检验",
"tabs": [
{
"key": "basic",
"displayName": "定期检验详情",
"renderType": "basic",
"formSeq": "1735144325639073793",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jyjc/jyjc-inspection-application/{sequenceNbr}",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "监督检验",
"tabs": [
{
"key": "basic",
"displayName": "监督检验详情",
"renderType": "basic",
"formSeq": "1734854656288387074",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jyjc/jyjc-inspection-application/{sequenceNbr}",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "使用登记",
"tabs": [
{
"key": "basic",
"displayName": "使用登记详情",
"renderType": "basic",
"formSeq": "1744311337623777282",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-use-registration/getDetail",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
},
"subResultParams": ["orgBranchCode","receiveOrgCode","estateUnitName"]
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "使用登记",
"tabs": [
{
"key": "basic",
"displayName": "车用气瓶登记详情",
"renderType": "basic",
"formSeq": "1770000499483897858",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-vehicle-information/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
{
"name": "注销报废",
"tabs": [
{
"key": "basic",
"displayName": "注销报废详情",
"renderType": "basic",
"formSeq": "1737366819582275586",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jg/jg-scrap-cancel/details",
"params": {
"sequenceNbr": "{sequenceNbr}"
},
"ruleData": {
"responseSuccess": "data.result.jgScrapCancelAdd"
}
}
}
}
],
"content": {
"basic": {
"columns": 4,
"datas": [],
"subs": []
}
}
}
\ No newline at end of file
......@@ -15,11 +15,15 @@ public class DateUtils {
public static Date calculateEndOfMonth(Date currentDate) {
LocalDateTime localDateTime = toLocalDateTime(currentDate);
LocalDateTime endOfMonth = localDateTime.with(localDateTime.withDayOfMonth(localDateTime.getMonth().maxLength())
// 获取当前月份的实际天数(考虑闰年)
int lastDay = localDateTime.getMonth().length(localDateTime.toLocalDate().isLeapYear());
// 直接设置为本月最后一天 23:59:59.999
LocalDateTime endOfMonth = localDateTime
.withDayOfMonth(lastDay)
.withHour(23)
.withMinute(59)
.withSecond(59)
.withNano(999999999));
.withNano(999_999_999);
return toDate(endOfMonth);
}
......
......@@ -276,110 +276,47 @@
</select>
<select id="countContraptionInUseTimesForDeleteByIntoManagement" resultType="java.lang.Integer">
SELECT
SUM(inUseNumber)
FROM (
SELECT
COUNT(1) 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(1) 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(1) 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(1) 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_change_registration_transfer a
LEFT JOIN tzs_jg_change_registration_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.audit_status != '使用单位已撤回')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_change_registration_name a
LEFT JOIN tzs_jg_change_registration_name_eq b ON b.name_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.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 tzs_jg_maintain_notice a
LEFT JOIN tzs_jg_maintain_notice_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.notice_status != '6617')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_reform_notice a
LEFT JOIN tzs_jg_reform_notice_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.notice_status != '6617')
UNION
SELECT
COUNT(1) AS inUseNumber
FROM tzs_jg_transfer_notice a
LEFT JOIN tzs_jg_transfer_notice_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.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')
)
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>
</mapper>
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