Commit 62f45d61 authored by 韩桐桐's avatar 韩桐桐

Merge branch 'refs/heads/develop_tzs_bugfix' into develop_tzs_register

parents 1ccf1a7a 586fc150
......@@ -3,11 +3,10 @@ package com.yeejoin.amos.api.openapi.controller;
import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.api.openapi.constant.Constant;
import com.yeejoin.amos.boot.module.cylinder.api.dto.CylinderFillingMessage;
import com.yeejoin.amos.api.openapi.face.model.*;
import com.yeejoin.amos.api.openapi.face.service.*;
import com.yeejoin.amos.boot.module.cylinder.api.dto.CylinderFillingMessage;
import com.yeejoin.amos.boot.module.cylinder.api.dto.CylinderFillingMessageModel;
import com.yeejoin.amos.boot.module.cylinder.api.service.CylinderFillingMessageService;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
......@@ -33,7 +32,9 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping(value = "/cylinder")
......@@ -59,7 +60,7 @@ public class CylinderController {
@Autowired
private CylinderFillingDataValidationService cylinderFillingDataValidationService;
@Autowired
CylinderFillingMessageService cylinderFillingMessageService;
TmCylinderFillingMessageService cylinderFillingMessageService;
@Autowired
private EmqKeeper emqKeeper;
@Autowired
......
......@@ -4,13 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.api.common.restful.utils.ResponseHelper;
import com.yeejoin.amos.api.common.restful.utils.ResponseModel;
import com.yeejoin.amos.boot.module.cylinder.api.dto.CylinderFillingMessageModel;
import com.yeejoin.amos.api.openapi.face.model.CylinderTableModel;
import com.yeejoin.amos.api.openapi.face.model.CylinderUnitTree;
import com.yeejoin.amos.api.openapi.face.orm.entity.OpenapiBizToken;
import com.yeejoin.amos.boot.module.cylinder.api.dto.PageParam;
import com.yeejoin.amos.api.openapi.face.service.*;
import com.yeejoin.amos.boot.module.cylinder.api.service.CylinderFillingMessageService;
import com.yeejoin.amos.boot.module.cylinder.api.dto.CylinderFillingMessageModel;
import com.yeejoin.amos.boot.module.cylinder.api.dto.PageParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.logging.log4j.LogManager;
......@@ -52,7 +51,7 @@ public class CylinderPageController {
@Autowired
private CylinderDateInfoService cylinderDateInfoService;
@Autowired
CylinderFillingMessageService cylinderFillingMessageService;
TmCylinderFillingMessageService cylinderFillingMessageService;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "服务商树")
......
package com.yeejoin.amos.boot.module.cylinder.api.service;
package com.yeejoin.amos.api.openapi.face.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.cylinder.api.dto.CylinderFillingMessageModel;
import com.yeejoin.amos.boot.module.cylinder.api.dto.PageParam;
import com.yeejoin.amos.boot.module.cylinder.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.cylinder.api.mapper.CylinderFillingMessageMapper;
import com.yeejoin.amos.boot.module.cylinder.api.entity.CylinderFillingMessageEntity;
import com.yeejoin.amos.boot.module.cylinder.api.mapper.CylinderFillingMessageMapper;
import com.yeejoin.amos.boot.module.cylinder.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import joptsimple.internal.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.DecimalFormat;
import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component
public class CylinderFillingMessageService extends BaseService<CylinderFillingMessageModel, CylinderFillingMessageEntity, CylinderFillingMessageMapper> {
public class TmCylinderFillingMessageService extends BaseService<CylinderFillingMessageModel, CylinderFillingMessageEntity, CylinderFillingMessageMapper> {
@Autowired
ITzBaseEnterpriseInfoService iTzBaseEnterpriseInfoService;
private final TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
public TmCylinderFillingMessageService(TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper) {
this.tzBaseEnterpriseInfoMapper = tzBaseEnterpriseInfoMapper;
}
public IPage<CylinderFillingMessageModel> getUploadCylinderLogs(PageParam pageParam, String regionCode) {
CompanyModel result = Privilege.companyClient.queryByCompanyCode(regionCode).getResult();
......@@ -36,8 +35,8 @@ public class CylinderFillingMessageService extends BaseService<CylinderFillingMe
if(result != null){
IPage<CylinderFillingMessageModel> uploadCylinderLogsByOrgCode = getUploadCylinderLogsByOrgCode(page, result.getOrgCode());
List<String> appIds = uploadCylinderLogsByOrgCode.getRecords().stream().map(CylinderFillingMessageModel::getAppId).collect(Collectors.toList()).stream().filter(x -> !ValidationUtil.isEmpty(x)).distinct().collect(Collectors.toList());
if(appIds.size() > 0){
List<TzBaseEnterpriseInfoDto> tzBaseEnterpriseInfoDtos = iTzBaseEnterpriseInfoService.queryByAppId(appIds);
if(!appIds.isEmpty()){
List<TzBaseEnterpriseInfoDto> tzBaseEnterpriseInfoDtos = tzBaseEnterpriseInfoMapper.queryByAppId(appIds);
if (!ValidationUtil.isEmpty(tzBaseEnterpriseInfoDtos)){
Map<String, String> map = tzBaseEnterpriseInfoDtos.stream().collect(Collectors.toMap(TzBaseEnterpriseInfoDto::getAppId, TzBaseEnterpriseInfoDto::getUseUnitCode));
uploadCylinderLogsByOrgCode.getRecords().forEach(x -> {
......
......@@ -2,8 +2,6 @@ package com.yeejoin.amos.boot.module.cylinder.flc.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -15,11 +13,6 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.cylinder.api.dto.CylinderFillingMessageModel;
import com.yeejoin.amos.boot.module.cylinder.api.dto.PageParam;
import com.yeejoin.amos.boot.module.cylinder.api.service.CylinderFillingMessageService;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.*;
import com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl.*;
import com.yeejoin.amos.boot.module.cylinder.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.cylinder.api.entity.BaseUnitLicence;
import com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderFillingRecordDto;
......@@ -28,8 +21,10 @@ import com.yeejoin.amos.boot.module.cylinder.api.entity.MsgLog;
import com.yeejoin.amos.boot.module.cylinder.biz.service.impl.BaseUnitLicenceServiceImpl;
import com.yeejoin.amos.boot.module.cylinder.biz.service.impl.ESCylinderServiceImpl;
import com.yeejoin.amos.boot.module.cylinder.biz.service.impl.TzBaseEnterpriseInfoServiceImpl;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.*;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderInfo;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit;
import com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl.*;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -54,7 +49,6 @@ import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 气瓶基本信息
......@@ -106,8 +100,7 @@ public class CylinderInfoController extends BaseController {
@Autowired
private CylinderAreaDataServiceImpl cylinderAreaDataService;
@Autowired
CylinderFillingMessageService cylinderFillingMessageService;
/**
* 新增气瓶基本信息
*
......@@ -1457,14 +1450,7 @@ public class CylinderInfoController extends BaseController {
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "同步气瓶数据日志")
@GetMapping(value = "/logs")
@DS("cyl")
public ResponseModel<IPage<CylinderFillingMessageModel>> getUploadCylinderLogs(PageParam pageParam, String regionCode ) {
IPage<CylinderFillingMessageModel> result = cylinderFillingMessageService.getUploadCylinderLogs(pageParam, regionCode);
return ResponseHelper.buildResponse(result);
}
}
......@@ -145,7 +145,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '一级受理已驳回' and a.audit_status <![CDATA[ <> ]]> '使用单位已撤回')
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '一级受理已驳回' and a.audit_status <![CDATA[ <> ]]> '使用单位已撤回' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION
select
count(1) as inUseNumber
......@@ -155,7 +155,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '一级受理已驳回' and a.audit_status <![CDATA[ <> ]]> '使用单位已撤回')
and (a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '一级受理已驳回' and a.audit_status <![CDATA[ <> ]]> '使用单位已撤回' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION
select
count(1) as inUseNumber
......@@ -165,7 +165,7 @@
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回')
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
UNION
select
count(1) as inUseNumber
......@@ -175,7 +175,7 @@
where
a.sequence_nbr = b.enable_disable_apply_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '已驳回' and a.audit_status <![CDATA[ <> ]]> '已撤回' and a.audit_status <![CDATA[ <> ]]> '待提交')
and (a.audit_status <![CDATA[ <> ]]> '已驳回' and a.audit_status <![CDATA[ <> ]]> '已撤回' and a.audit_status <![CDATA[ <> ]]> '待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION
select
count(1) as inUseNumber
......@@ -185,7 +185,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.apply_status <![CDATA[ <> ]]> '6614' and a.apply_status <![CDATA[ <> ]]> '6615' and a.apply_status <![CDATA[ <> ]]> '6610')
and (a.apply_status <![CDATA[ <> ]]> '6614' and a.apply_status <![CDATA[ <> ]]> '6615' and a.apply_status <![CDATA[ <> ]]> '6610' and a.apply_status <![CDATA[ <> ]]> '6617')
UNION
select
count(1) as inUseNumber
......@@ -205,7 +205,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610')
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610' and a.notice_status <![CDATA[ <> ]]> '6617')
UNION
select
count(1) as inUseNumber
......@@ -215,7 +215,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '维保单位已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '使用单位待提交')
and (a.status <![CDATA[ <> ]]> '已作废' and a.status <![CDATA[ <> ]]> '维保单位已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '使用单位待提交')
UNION
select
count(1) as inUseNumber
......@@ -225,7 +225,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610')
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610' and a.notice_status <![CDATA[ <> ]]> '6617')
UNION
select
count(1) as inUseNumber
......@@ -235,7 +235,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '使用单位已撤回' and a.audit_status <![CDATA[ <> ]]> '一级受理已驳回' and a.audit_status <![CDATA[ <> ]]> '使用单位待提交')
and (a.audit_status <![CDATA[ <> ]]> '使用单位已撤回' and a.audit_status <![CDATA[ <> ]]> '一级受理已驳回' and a.audit_status <![CDATA[ <> ]]> '使用单位待提交' and a.audit_status <![CDATA[ <> ]]> '已作废')
UNION
select
count(1) as inUseNumber
......@@ -245,7 +245,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610')
and (a.notice_status <![CDATA[ <> ]]> '6614' and a.notice_status <![CDATA[ <> ]]> '6615' and a.notice_status <![CDATA[ <> ]]> '6610' and a.notice_status <![CDATA[ <> ]]> '6617')
UNION
select
count(1) as inUseNumber
......@@ -256,6 +256,16 @@
a.sequence_nbr = b.vehicle_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
UNION
select
count(1) as inUseNumber
from
tzs_jg_change_vehicle_registration_unit a,
tzs_jg_change_vehicle_registration_unit_eq b
where
a.sequence_nbr = b.unit_change_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '使用单位待提交' and a.status <![CDATA[ <> ]]> '一级受理已驳回' and a.status <![CDATA[ <> ]]> '使用单位已撤回' and a.status <![CDATA[ <> ]]> '已作废')
)
</select>
<select id="countEquipInUseTimesForDel" resultType="java.lang.Integer">
......@@ -352,6 +362,13 @@
tzs_jg_vehicle_information_eq b
where
b.equ_id = #{record}
UNION
select
count(1) as inUseNumber
from
tzs_jg_change_vehicle_registration_unit_eq b
where
b.equ_id = #{record}
)
</select>
......@@ -875,11 +892,12 @@
<select id="useRegistrationCertificateAccountUnique" resultType="java.lang.Integer">
SELECT COUNT( 1 )
FROM
"amos_tzs_biz"."idx_biz_jg_register_info"
FROM idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_other_info joi ON joi."RECORD" = jri."RECORD"
WHERE
"USE_ORG_CODE" = #{useRegistrationCode}
AND "RECORD" != #{equipId}
jri."USE_ORG_CODE" = #{useRegistrationCode}
AND jri."RECORD" != #{equipId}
AND joi.CLAIM_STATUS = '已认领'
</select>
<select id="queryOutOfMaintenanceRecord" resultType="java.util.Map">
......
......@@ -75,12 +75,6 @@ public class JgTransferNoticeController extends BaseController {
if (Objects.isNull(transferNoticeInfo)) {
throw new IllegalArgumentException("参数transferInfo不能为空");
}
Object o = ((LinkedHashMap<?, ?>) model.get("transferNoticeInfo")).get("proxyStatementAttachmentList");
Object o1 = ((LinkedHashMap<?, ?>) model.get("transferNoticeInfo")).get("installContractAttachmentList");
Object o2 = ((LinkedHashMap<?, ?>) model.get("transferNoticeInfo")).get("otherAccessoriesList");
transferNoticeInfo.setConstructionContractList((List<Map<String, Object>>) o);
transferNoticeInfo.setPowerOfAttorneyList((List<Map<String, Object>>) o1);
transferNoticeInfo.setOtherAccessoriesList((List<Map<String, Object>>) o2);
return ResponseHelper.buildResponse(jgTransferNoticeService.updateTransferNotice(submitType, transferNoticeInfo, op));
}
......
......@@ -1328,8 +1328,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
map1.put("USE_UNIT_NAME", jgInstallationNotice.getUseUnitName());
map1.put("IS_INTO_MANAGEMENT", true);
map1.put("USE_PLACE_CODE", dto.getProvince().split("_")[0] + "#" + dto.getCity().split("_")[0] + "#" + dto.getCounty().split("_")[0] + "#" + dto.getFactoryUseSiteStreet().split("_")[0]);
map1.put("USC_UNIT_CREDIT_CODE", "");
map1.put("USC_UNIT_NAME", "");
map1.put("USC_UNIT_CREDIT_CODE", jgInstallationNotice.getInstallUnitCreditCode());
map1.put("USC_UNIT_NAME", jgInstallationNotice.getInstallUnitName());
map1.put("USE_PLACE", String.format("%s/%s/%s/%s", jgInstallationNotice.getProvinceName(), jgInstallationNotice.getCityName(), jgInstallationNotice.getCountyName(), jgInstallationNotice.getStreetName()));
map1.put("ADDRESS", jgInstallationNotice.getAddress());
objMap.put(tzsJgOtherInfo.getRecord(), map1);
......
......@@ -803,8 +803,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
if ( WorkFlowStatusEnum.MAIN_SUBMIT.getPass().contains(status)) {
return FlowStatusEnum.TO_BE_SUBMITTED;
}
if ( WorkFlowStatusEnum.MAIN_PRELIMINARY.getPass().contains(status)) {
if ( FlowStatusEnum.TO_BE_FINISHED.getName().equals(status)) {
return FlowStatusEnum.TO_BE_FINISHED;
}
return FlowStatusEnum.TO_BE_PROCESSED;
......
......@@ -698,6 +698,8 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
if (!ValidationUtil.isEmpty(model.getOtherAccessoriesList())) {
model.setOtherAccessories(JSON.toJSONString(model.getOtherAccessoriesList()));
} else {
model.setOtherAccessories("");
}
// 分割省市区字段
String province = model.getProvince();
......
......@@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
......@@ -191,6 +192,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
private IdxBizJgConstructionInfoServiceImpl idxBizJgConstructionInfoService;
@Autowired
private JgInstallationNoticeServiceImpl jgInstallationNoticeService;
@Autowired
private IdxBizJgConstructionInfoMapper constructionInfoMapper;
/**
* @param auditPassDate 通过时间
......@@ -1402,6 +1405,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param.put("USE_SITE_CODE", String.valueOf(jsonObject.get("usePlace")));
param.put("ORG_BRANCH_CODE", split[0]);
param.put("ORG_BRANCH_NAME", split[1]);
param.put("USC_UNIT_CREDIT_CODE", "");
param.put("USC_UNIT_NAME", "");
param.put("EQU_CODE", dataMap.get("equCode"));
param.put("USE_ORG_CODE", jgUseRegistration.getUseRegistrationCode());
objMap.put((String) dataMap.get("equipId"), param);
......@@ -2383,6 +2388,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
private void rollBackForEquipEsInfo(String record, Boolean flag) {
LambdaQueryWrapper<IdxBizJgConstructionInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.select(IdxBizJgConstructionInfo::getUscUnitCreditCode,
IdxBizJgConstructionInfo::getUscUnitName,
IdxBizJgConstructionInfo::getInformCode,
IdxBizJgConstructionInfo::getInformFilePath)
.eq(IdxBizJgConstructionInfo::getRecord, record)
.orderByDesc(TzsBaseEntity::getRecDate)
.last("limit 1");
IdxBizJgConstructionInfo jgConstructionInfo = constructionInfoMapper.selectOne(wrapper);
Optional<ESEquipmentCategoryDto> optional = esEquipmentCategory.findById(record);
if (optional.isPresent()) {
ESEquipmentCategoryDto esEquipmentCategoryDto = optional.get();
......@@ -2391,6 +2405,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
esEquipmentCategoryDto.setEQU_STATE(null);
esEquipmentCategoryDto.setORG_BRANCH_CODE(null);
esEquipmentCategoryDto.setORG_BRANCH_NAME(null);
if (jgConstructionInfo != null){
esEquipmentCategoryDto.setUSC_UNIT_NAME(jgConstructionInfo.getUscUnitName());
esEquipmentCategoryDto.setUSC_UNIT_CREDIT_CODE(jgConstructionInfo.getUscUnitCreditCode());
}
if (flag) {
esEquipmentCategoryDto.setIS_INTO_MANAGEMENT(Boolean.FALSE);
}
......
......@@ -1332,7 +1332,7 @@
<w:vertAlign w:val="baseline"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr>
<w:t>${(equipCode)!''}</w:t>
<w:t>${(useInnerCode)!''}</w:t>
</w:r>
</w:p>
</w:tc>
......@@ -1486,7 +1486,7 @@
<w:vertAlign w:val="baseline"/>
<w:lang w:val="EN-US" w:fareast="ZH-CN"/>
</w:rPr>
<w:t>${(useInnerCode)!''}</w:t>
<w:t>${(equipCode)!''}</w:t>
</w:r>
</w:p>
</w:tc>
......
package com.yeejoin.amos.boot.module.statistics.api.dto;
import lombok.Data;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
@Data
public class CylinderFillingMessageModel extends BaseModel {
private String time;
private String fillingCompanyName;
private Integer cylinderNumber;
private String message;
private String appId;
private String orgCode;
private String useUnitCode;
}
package com.yeejoin.amos.boot.module.statistics.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.statistics.api.dto.CylinderFillingMessageModel;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -39,4 +40,6 @@ public interface CylinderStatisticsMapper {
IPage<TzBaseEnterpriseInfoDto> getStationRateSubPage(IPage<TzBaseEnterpriseInfoDto> page,
@Param("companyName") String companyName,
@Param("orgCode") String orgCode);
IPage<CylinderFillingMessageModel> getUploadCylinderLogsPage(IPage<CylinderFillingMessageModel> page,
@Param("orgCode") String orgCode);
}
......@@ -91,5 +91,13 @@
order by rec_date desc
</select>
<select id="getUploadCylinderLogsPage"
resultType="com.yeejoin.amos.boot.module.statistics.api.dto.CylinderFillingMessageModel">
select * from iot_cylinder_filling_logs
<where>
<if test="orgCode != null and orgCode != '' ">
and org_code like CONCAT(#{orgCode},'%')
</if>
</where>
</select>
</mapper>
......@@ -7,9 +7,11 @@ import com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisti
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.CylinderDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistics.api.dto.CylinderFillingMessageModel;
import com.yeejoin.amos.boot.module.statistics.api.dto.SubTreeDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.ESCylinderFillingRecordDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.PageParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.ObjectUtils;
......@@ -171,7 +173,6 @@ public class CylinderDPStatisticsController extends BaseController {
return ResponseHelper.buildResponse(dpStatisticsService.getStationRateSubChart(dpFilterParamForDetailDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "区域气站对接率下钻列表")
@PostMapping(value = "/getStationRateSubPage")
......@@ -179,7 +180,11 @@ public class CylinderDPStatisticsController extends BaseController {
return ResponseHelper.buildResponse(dpStatisticsService.getStationRateSubPage(dpFilterParamForDetailDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "同步气瓶数据日志")
@GetMapping(value = "/logs")
public ResponseModel<IPage<CylinderFillingMessageModel>> getUploadCylinderLogs(PageParam pageParam, String regionCode ) {
IPage<CylinderFillingMessageModel> result = dpStatisticsService.getUploadCylinderLogs(pageParam, regionCode);
return ResponseHelper.buildResponse(result);
}
}
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.CylinderFillingRecordStatisti
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum;
import com.yeejoin.amos.boot.module.statistics.api.dto.CylinderFillingMessageModel;
import com.yeejoin.amos.boot.module.statistics.api.dto.SecurityIndexCountItemDto;
import com.yeejoin.amos.boot.module.statistics.api.dto.SubTreeDto;
import com.yeejoin.amos.boot.module.statistics.api.enums.AnomalyTypeEnum;
......@@ -18,10 +19,13 @@ import com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper
import com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderStatisticsMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.ESCylinderFillingRecordDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.PageParam;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.flc.api.mapper.CylinderAreaDataMapper;
import com.yeejoin.amos.boot.module.ymt.flc.api.mapper.CylinderInfoMapper;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -43,6 +47,7 @@ import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.io.IOException;
import java.math.BigDecimal;
......@@ -54,6 +59,7 @@ import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* 气瓶区域统计表服务实现类
*
......@@ -80,12 +86,16 @@ public class CylinderDPStatisticsServiceImpl {
@Autowired
private AQZSDPStatisticsServiceImpl statisticsService;
private final TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper;
private final CylinderOpenApiServiceImpl cylinderOpenApiService;
/**
* 气瓶图列换算单位上限
*/
private final static Long CYLINDER_LEGEND_UPPER_LIMIT = 100000L;
public CylinderDPStatisticsServiceImpl(StCommonServiceImpl stCommonService, RestHighLevelClient restHighLevelClient, TzBaseEnterpriseInfoMapper baseEnterpriseInfoMapper, CylinderAreaDataMapper cylinderAreaDataMapper, CylinderStatisticsMapper cylinderStatisticsMapper, CylinderInfoMapper cylinderInfoMapper,AQZSDPStatisticsMapper statisticsMapper) {
public CylinderDPStatisticsServiceImpl(StCommonServiceImpl stCommonService, RestHighLevelClient restHighLevelClient, TzBaseEnterpriseInfoMapper baseEnterpriseInfoMapper, CylinderAreaDataMapper cylinderAreaDataMapper, CylinderStatisticsMapper cylinderStatisticsMapper, CylinderInfoMapper cylinderInfoMapper, AQZSDPStatisticsMapper statisticsMapper, TzBaseEnterpriseInfoMapper tzBaseEnterpriseInfoMapper, CylinderOpenApiServiceImpl cylinderOpenApiService) {
this.stCommonService = stCommonService;
this.restHighLevelClient = restHighLevelClient;
this.baseEnterpriseInfoMapper = baseEnterpriseInfoMapper;
......@@ -93,6 +103,8 @@ public class CylinderDPStatisticsServiceImpl {
this.cylinderStatisticsMapper = cylinderStatisticsMapper;
this.cylinderInfoMapper = cylinderInfoMapper;
this.statisticsMapper = statisticsMapper;
this.tzBaseEnterpriseInfoMapper = tzBaseEnterpriseInfoMapper;
this.cylinderOpenApiService = cylinderOpenApiService;
}
......@@ -840,7 +852,26 @@ public class CylinderDPStatisticsServiceImpl {
if(ObjectUtils.isEmpty(orgCode)){
return null;
}
IPage<TzBaseEnterpriseInfoDto> result = cylinderStatisticsMapper.getStationRateSubPage(page, dpFilterParamForDetailDto.getCompanyName(), orgCode);
return result;
return cylinderStatisticsMapper.getStationRateSubPage(page, dpFilterParamForDetailDto.getCompanyName(), orgCode);
}
public IPage<CylinderFillingMessageModel> getUploadCylinderLogs(PageParam pageParam, String regionCode) {
CompanyModel result = Privilege.companyClient.queryByCompanyCode(regionCode).getResult();
Page<CylinderFillingMessageModel> page = new Page<>(pageParam.getCurrent(), pageParam.getSize());
if(result != null){
IPage<CylinderFillingMessageModel> uploadCylinderLogsByOrgCode = cylinderOpenApiService.getUploadCylinderLogsByOrgCode(page, result.getOrgCode());
List<String> appIds = uploadCylinderLogsByOrgCode.getRecords().stream().map(CylinderFillingMessageModel::getAppId).collect(Collectors.toList()).stream().filter(x -> !ValidationUtil.isEmpty(x)).distinct().collect(Collectors.toList());
if(!appIds.isEmpty()){
List<TzBaseEnterpriseInfo> tzBaseEnterpriseInfoList = tzBaseEnterpriseInfoMapper.selectList(new LambdaQueryWrapper<TzBaseEnterpriseInfo>().in(TzBaseEnterpriseInfo::getAppId, appIds));
if (!ValidationUtil.isEmpty(tzBaseEnterpriseInfoList)){
Map<String, String> map = tzBaseEnterpriseInfoList.stream().collect(Collectors.toMap(TzBaseEnterpriseInfo::getAppId, TzBaseEnterpriseInfo::getUseUnitCode));
uploadCylinderLogsByOrgCode.getRecords().forEach(x -> {
x.setUseUnitCode(map.get(x.getAppId()));
});
}
}
}
return page;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.statistics.api.dto.CylinderFillingMessageModel;
import com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderStatisticsMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
@DS("cyl")
@Service
public class CylinderOpenApiServiceImpl {
private final CylinderStatisticsMapper cylinderStatisticsMapper;
public CylinderOpenApiServiceImpl(CylinderStatisticsMapper cylinderStatisticsMapper) {
this.cylinderStatisticsMapper = cylinderStatisticsMapper;
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public IPage<CylinderFillingMessageModel> getUploadCylinderLogsByOrgCode(Page<CylinderFillingMessageModel> page, @Condition(Operator.likeRight) String orgCode) {
return cylinderStatisticsMapper.getUploadCylinderLogsPage(page, orgCode);
}
}
......@@ -7,7 +7,7 @@
FROM idx_biz_jg_construction_info jci
LEFT JOIN idx_biz_jg_use_info jui ON jci.RECORD = jui.RECORD
<where>
jui.PROJECT_CONTRAPTION IS NOT NULL
jui.PROJECT_CONTRAPTION IS NOT NULL AND TRIM ( jui.PROJECT_CONTRAPTION ) <![CDATA[ <> ]]> ''
<if test="uscUnitCreditCode != null and !uscUnitCreditCode.isEmpty()">
AND jci.USC_UNIT_CREDIT_CODE = #{uscUnitCreditCode}
</if>
......
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