Commit 4aae199e authored by 刘林's avatar 刘林

Merge branch 'develop_tzs_main' into develop_tzs_test

parents 2055ee50 90a78eaf
......@@ -124,41 +124,22 @@
LEFT JOIN idx_biz_jg_use_info use on jede.equ_id = use.RECORD
where jed.sequence_nbr = #{sequenceNbr}
</select>
<select id="queryStoppedDeviceStaticListData"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
select
c.equ_list,
c.equ_category,
c.equ_define,
count(1) as num
from
(SELECT
ri.equ_list,
ri.equ_category,
ri.equ_define,
concat(u.PROVINCE,'#', u.CITY,'#', u.COUNTY) as areaCode
FROM
"tzs_jg_enable_disable_eq" ae,
tzs_jg_enable_disable a,
"idx_biz_jg_use_info" u,
idx_biz_jg_register_info ri
where
a.sequence_nbr = ae.enable_disable_apply_id
and ae.equ_id = u."RECORD"
and u."RECORD" = ri."RECORD"
and (a.audit_pass_date between #{beginDate} and #{endDate})
and a.apply_type ='SB_TY'
and a.audit_status='已完成'
and u."PROVINCE" <![CDATA[<>]]> ''
and u."CITY" <![CDATA[<>]]> ''
and u."COUNTY" <![CDATA[<>]]> ''
) c
where
c.areaCode like concat('%',#{cityCode}, '%')
group by
c.equ_list,
c.equ_category,
c.equ_define
<select id="queryStoppedDeviceStaticListData" resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
SELECT COUNT(1) AS num,
jri.equ_list AS equList,
jri.equ_category AS equCategory
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_enable_disable tjed ON tjed.use_unit_credit_code = bi.use_unit_code
AND tjed.audit_status = '已完成' and tjed.apply_type ='SB_TY'
INNER JOIN tzs_jg_enable_disable_eq tjede ON tjede.enable_disable_apply_id = tjed.sequence_nbr
INNER JOIN idx_biz_jg_register_info jri ON tjede.equ_id = jri.record
WHERE pc.company_code = #{cityCode}
AND ( tjed.audit_pass_date BETWEEN #{ beginDate } AND #{ endDate } )
AND tjed.is_delete = 0
GROUP BY jri.equ_category
</select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
......
......@@ -256,42 +256,23 @@
WHERE ur.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select>
<select id="queryScrappedDeviceStaticListData"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
select
c.equ_list,
c.equ_category,
c.equ_define,
count(1) as num
from
(SELECT
ri.equ_list,
ri.equ_category,
ri.equ_define,
concat(u.PROVINCE,'#', u.CITY,'#', u.COUNTY) as areaCode
FROM
"tzs_jg_scrap_cancel_eq" ae,
tzs_jg_scrap_cancel a,
"idx_biz_jg_use_info" u,
idx_biz_jg_register_info ri
where
a.sequence_nbr = ae.equip_transfer_id
and ae.equ_id = u."RECORD"
and u."RECORD" = ri."RECORD"
and (a.audit_pass_date between #{beginDate} and #{endDate})
and a.cancel_type ='1'
and a.audit_status='已完成'
and u."PROVINCE" <![CDATA[<>]]> ''
and u."CITY" <![CDATA[<>]]> ''
and u."COUNTY" <![CDATA[<>]]> ''
) c
where
c.areaCode like concat('%',#{cityCode}, '%')
group by
c.equ_list,
c.equ_category,
c.equ_define
<select id="queryScrappedDeviceStaticListData" resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
SELECT COUNT(1) AS num,
jri.equ_list AS equList,
jri.equ_category AS equCategory
FROM privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_scrap_cancel tjsc ON tjsc.use_unit_code = bi.use_unit_code
AND tjsc.audit_status = '已完成' and tjsc.cancel_type ='1'
INNER JOIN tzs_jg_scrap_cancel_eq tjsce ON tjsce.equip_transfer_id = tjsc.sequence_nbr
INNER JOIN idx_biz_jg_register_info jri ON tjsce.equ_id = jri.record
WHERE pc.company_code = #{cityCode}
AND ( tjsc.audit_pass_date BETWEEN #{ beginDate } AND #{ endDate } )
AND tjsc.is_delete = 0
GROUP BY jri.equ_category
</select>
<select id="getScrappedDeviceCount" resultType="java.util.Map">
select
count(1) as num,c.time
......
......@@ -1487,42 +1487,24 @@
LEFT JOIN idx_biz_jg_register_info jri ON re.equ_id = jri.RECORD
where ur.sequence_nbr = #{sequenceNbr}
</select>
<select id="queryNewDeviceStaticListData"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
select
c.equ_list,
c.equ_category,
c.equ_define,
count(1) as num
from
(SELECT
ri.equ_list,
ri.equ_category,
ri.equ_define,
concat(u.PROVINCE,'#', u.CITY,'#', u.COUNTY) as areaCode
FROM
"tzs_jg_use_registration_eq" ae,
tzs_jg_use_registration a,
"idx_biz_jg_use_info" u,
idx_biz_jg_register_info ri
where
ae.equ_id = u."RECORD"
and a.sequence_nbr = ae.equip_transfer_id
and u."RECORD" = ri."RECORD"
and (a.audit_pass_date between #{beginDate} and #{endDate})
and a.status='已完成'
and a.is_delete = 0
and u."PROVINCE" <![CDATA[<>]]> ''
and u."CITY" <![CDATA[<>]]> ''
and u."COUNTY" <![CDATA[<>]]> ''
) c
where
c.areaCode like concat('%',#{cityCode}, '%')
group by
c.equ_list,
c.equ_category,
c.equ_define
<select id="queryNewDeviceStaticListData" resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
SELECT COUNT ( 1 ) as num,
jri.equ_list AS equList,
jri.equ_category AS equCategory
FROM
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_use_registration tjur ON tjur.use_unit_credit_code = bi.use_unit_code
AND tjur.status = '已完成'
INNER JOIN tzs_jg_use_registration_eq tjure ON tjure.equip_transfer_id = tjur.sequence_nbr
INNER JOIN idx_biz_jg_register_info jri ON tjure.equ_id = jri.record
WHERE pc.company_code = #{cityCode}
and (tjur.audit_pass_date between #{beginDate} and #{endDate})
and tjur.is_delete = 0
GROUP BY jri.equ_category
</select>
<select id="getUseRegisterCount" resultType="java.util.Map">
SELECT COUNT(1) AS num,C.time
FROM
......@@ -1534,8 +1516,7 @@
tzs_jg_use_registration A,
"idx_biz_jg_use_info" u,
idx_biz_jg_register_info ri
WHERE
ae.equ_id = u."RECORD"
WHERE ae.equ_id = u."RECORD"
AND ri.EQU_CATEGORY = '2300'
AND A.sequence_nbr = ae.equip_transfer_id
AND u."RECORD" = ri."RECORD"
......
......@@ -652,7 +652,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
*/
@Override
@ResultFieldMapping({
@ResultFieldMapping.ResultFieldMap(sourceField = "changeRegistrationTransfer.estateUnitCode",
@ResultFieldMapping.ResultFieldMap(sourceField = "changeRegistrationTransfer.transferUseInfo",
targetField = "changeRegistrationTransfer.estateUnitSeq",
serviceClass = CommonServiceImpl.class,
queryMethod = "queryTcmUnitSeqByCreditCode",
......
......@@ -4070,10 +4070,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
workflowResultDto.setNextTaskCode("已完成");
workflowResultDto.setNextTaskId(jgUseRegistration.getNextTaskId());
workflowResultDto.setNextExecutorUserIds(jgUseRegistration.getNextExecuteUserIds());
JSONObject jsonObject = Optional.ofNullable(jgRegistrationHistoryService.queryLatestRegistrationHistory(jgUseRegistration.getSequenceNbr()))
.map(JgRegistrationHistory::getChangeData)
.map(JSON::parseObject)
.orElse(new JSONObject());
if (jgUseRegistration.getManageType().equals("unit")) {
this.updateUseRegUnitData(jgUseRegistration.getSequenceNbr(), "0", workflowResultDto, false, null);
this.updateUseRegUnitData(jgUseRegistration.getSequenceNbr(), "0", workflowResultDto, false, jsonObject);
} else {
this.updateData(jgUseRegistration.getSequenceNbr(), "0", workflowResultDto, null, false, null);
this.updateData(jgUseRegistration.getSequenceNbr(), "0", workflowResultDto, null, false, jsonObject);
}
});
}
......
package com.yeejoin.amos.boot.module.jyjc.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
......@@ -9,28 +10,38 @@ import java.util.Optional;
* @author Administrator
*/
@Getter
@AllArgsConstructor
public enum OpenBizTypeEnumV2 {
/**
* 业务类型
*/
JY("jy", "检验机构", "检验业务"),
JC("jc", "检测机构", "检测业务"),
SYDW("jc-sydw", "使用单位", "使用单位电梯检测"),
AGW("jc-agw", "安装改造维修单位", "安改维电梯检测");
JY("jy", "检验机构", "检验业务", true),
JC("jc", "检测机构", "检测业务", true),
SYDW("jc-sydw", "使用单位", "使用单位电梯检测", false),
AGW("jc-agw", "安装改造维修单位", "安改维电梯检测", false);
/**
* 唯一标识
*/
private final String code;
/**
* 单位类型
*/
private final String unitType;
/**
* 描述
*/
private final String description;
/**
* 是否需要资质
*/
private final boolean needSaveLicense;
OpenBizTypeEnumV2(String code, String unitType, String description) {
this.code = code;
this.unitType = unitType;
this.description = description;
}
public static OpenBizTypeEnumV2 getOneByCode(String code) {
Optional<OpenBizTypeEnumV2> op = Arrays.stream(OpenBizTypeEnumV2.values()).filter(e -> e.getCode().equals(code)).findFirst();
......
......@@ -116,6 +116,12 @@ public class RuleActionHandler {
unitDto.setSort(0);
continue;
}
if(unitDto.getAgencyClassify() == null){
unitDto.setSort(2);
continue;
}
if(unitDto.getAgencyClassify().contains(JyAgencyClassifyEnum.SBGY.getCode())){
unitDto.setSort(-1);
continue;
......@@ -124,6 +130,7 @@ public class RuleActionHandler {
unitDto.setSort(1);
}
}
// 升序
return units.stream().sorted(Comparator.comparing(RuleInspectUnitIndoDto::getSort, Comparator.nullsLast(Integer::compareTo))).collect(Collectors.toList());
}
......
......@@ -39,8 +39,8 @@ import com.yeejoin.amos.boot.module.jyjc.api.model.*;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcOpeningApplicationService;
import com.yeejoin.amos.boot.module.jyjc.api.vo.JyjcOpeningApplicationVo;
import com.yeejoin.amos.boot.module.jyjc.biz.config.BaseException;
import com.yeejoin.amos.boot.module.jyjc.biz.message.factoty.OpenAppMsgFactory;
import com.yeejoin.amos.boot.module.jyjc.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jyjc.biz.message.factoty.OpenAppMsgFactory;
import com.yeejoin.amos.boot.module.jyjc.biz.service.TaskModelServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.BaseUnitLicence;
......@@ -151,7 +151,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
private SnowflakeIdUtil sequence;
@Resource
private OpenAppMsgFactory openAppMsgFactory;
private OpenAppMsgFactory openAppMsgFactory;
/**
* 编辑、工作台暂存逻辑
......@@ -341,7 +341,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
// 将历史同单位类型+同机构类别的开通申请作废掉
for (Long id : ids) {
JyjcInspectionHistory historyOpened = inspectionHistoryService.getBySSeq(id);
if(historyOpened != null){
if (historyOpened != null) {
JSONObject hisDataOpened = historyOpened.getHistoryData();
List<BaseEnterpriseCertDto> certOpened = hisDataOpened.getJSONArray(BizCommonConstant.UNIT_LICENCE_KEY).toJavaList(BaseEnterpriseCertDto.class);
boolean matchHisOpened = certOpened.stream().anyMatch(c -> agencyTypeLast.contains(c.getAgencyType()));
......@@ -472,7 +472,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
applyStartTime = date + " 00:00:00";
applyEndTime = date + " 23:59:59";
}
Page<JyjcOpeningApplicationModel> result = jyjcOpeningApplicationMapper.selectJyjcOpeningApplicationList(page, dto, applyStartTime, currentUserId, applyEndTime,orgCode);
Page<JyjcOpeningApplicationModel> result = jyjcOpeningApplicationMapper.selectJyjcOpeningApplicationList(page, dto, applyStartTime, currentUserId, applyEndTime, orgCode);
for (JyjcOpeningApplicationModel openingApplicationModel : result.getRecords()) {
openingApplicationModel.setIdentityType(dto.getType());
openingApplicationModel.setOpenBizTypeName(this.getOpenBizTypeName(openingApplicationModel.getOpenBizType()));
......@@ -547,7 +547,6 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
}
private String getOpenBizTypeByIdentity(String unitType) {
OpenBizTypeEnumV2 bizTypeEnumV2 = OpenBizTypeEnumV2.getOneByUnitType(unitType);
if (bizTypeEnumV2 == null) {
......@@ -849,7 +848,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
// 更新json
commonService.saveOrUpdateHistory(jyjcOpeningApplication.getOpenBizType(), JSONObject.parseObject(JSONObject.toJSONString(params)), jyjcOpeningApplication.getSequenceNbr());
// 将审批通过的资质信息写入到企业资质表
this.saveLicenseData2Company(jyjcOpeningApplication);
this.processApplication(jyjcOpeningApplication);
}
jyjcOpeningApplicationMapper.updateById(jyjcOpeningApplication);
// 已完成 作废逻辑
......@@ -895,6 +894,16 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
return Optional.ofNullable(OpenBizTypeEnumV2.getOneByCode(openBizType)).map(OpenBizTypeEnumV2::getUnitType).orElse(null);
}
/**
* 需要资质的才进行进行记录资质
*
* @param application 开通申请
*/
private void processApplication(JyjcOpeningApplication application) {
Optional.ofNullable(OpenBizTypeEnumV2.getOneByCode(application.getOpenBizType()))
.filter(OpenBizTypeEnumV2::isNeedSaveLicense).ifPresent(o -> saveLicenseData2Company(application));
}
private void saveLicenseData2Company(JyjcOpeningApplication jyjcOpeningApplication) {
JyjcInspectionHistory history = inspectionHistoryService.getBySSeq(jyjcOpeningApplication.getSequenceNbr());
JSONObject hisData = history.getHistoryData();
......@@ -933,7 +942,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
licence.setAgencyTypeName(commonService.getDictName(Arrays.asList("1233-1", "1233-2"), licence.getAgencyType()));
licence.setUnitCode(jyjcOpeningApplication.getUnitCode());
licence.setUnitName(jyjcOpeningApplication.getUnitCodeName());
licence.setLicenceType( LicenceTypeEnum.JY_JC.getCode());
licence.setLicenceType(LicenceTypeEnum.JY_JC.getCode());
licence.setEnterpriseCertSeq(cert.getSequenceNbr().toString());
licences.add(licence);
});
......
......@@ -147,8 +147,13 @@
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND DATE_FORMAT ( problem_time, '%Y-%m-%d' ) &gt;= #{time}
is_delete = '0'
AND problem_status = '未处理'
AND governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND problem_time &gt;= #{time}
order by
problem_time
LIMIT 30
</select>
<select id="cylinderIssueMonthList" resultType="java.util.Map">
......@@ -205,11 +210,15 @@
FROM
tzs_safety_problem_tracing
WHERE
DATE_FORMAT(problem_time,'%Y') &gt;= #{now}
AND
<foreach collection="orgCodes" item="orgCode" separator="OR" open="(" close=")">
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
</foreach>
problem_time &gt;= #{now}
<if test="orgCodes != null">
AND
governing_body_org_code LIKE any(array[
<foreach collection="orgCodes" item="orgCode" separator=",">
#{orgCode}
</foreach>
])
</if>
<if test="null != status">
AND problem_status_code = #{status}
</if>
......
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -784,8 +785,8 @@ public class AQZSDPStatisticsServiceImpl {
orgCodeAndCompanyCodesByCompanyCodes.forEach(t -> {
orgCodeAndCompanyCodesMap.put(t.get("companyCode"), t.get("orgCode"));
});
List<Map<String, Object>> allIssueCount = statisticsMapper.issueChildrenCityCountTop(orgCodes, now, null);
List<Map<String, Object>> endIssueCount = statisticsMapper.issueChildrenCityCountTop(orgCodes, now, "1");
List<Map<String, Object>> allIssueCount = statisticsMapper.issueChildrenCityCountTop(orgCodes, DateUtil.beginOfYear(new Date()).toDateStr(), null);
List<Map<String, Object>> endIssueCount = statisticsMapper.issueChildrenCityCountTop(orgCodes, DateUtil.beginOfYear(new Date()).toDateStr(), "1");
Map<String, Object> allIssuedataMap = new HashMap<>();
Map<String, Object> endIssuedataMap = new HashMap<>();
allIssueCount.forEach(t -> {
......
......@@ -1168,9 +1168,9 @@ public class JGDPStatisticsServiceImpl {
//停用
List<Map> stopList = useRegistrationMapper.stopStateCount(orgCode);
//注销
List<Map> cancelList = useRegistrationMapper.cancelStateCount(orgCode, 1);
List<Map> cancelList = useRegistrationMapper.cancelStateCount(orgCode, 2);
//报废
List<Map> scrapList = useRegistrationMapper.cancelStateCount(orgCode, 2);
List<Map> scrapList = useRegistrationMapper.cancelStateCount(orgCode, 1);
Map<String, Long> stopMap = new HashMap<>();
Map<String, Long> cancelMap = new HashMap<>();
......
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