Commit 7318ca55 authored by tianbo's avatar tianbo

Merge branch 'develop_tzs_bugfix' into develop_tzs_register

parents 6458bc00 65bb2e14
......@@ -77,6 +77,7 @@ public class XiAnDataDockServiceImpl {
* @param equipInfoExcelDtos
*/
public void batchSaveEquipmentData(List<XiAnEquipInfoExcelDto> equipInfoExcelDtos) {
log.info("解析成功,准备上传数据,条数:{}", equipInfoExcelDtos.size());
int batchSize = 1000;
int totalSize = equipInfoExcelDtos.size();
// 主线程中获取登录信息传递到异步线程中
......@@ -183,7 +184,7 @@ public class XiAnDataDockServiceImpl {
ReadRowHolder readRowHolder = context.readRowHolder();
int rowIndex = readRowHolder.getRowIndex() + 1;
StringBuilder rowError = new StringBuilder();
log.info("开始解析数据,第{}条数据", rowIndex);
// 是否起重机械
boolean isQZJX = !ValidationUtil.isEmpty(data.getEquList()) && "4000".equals(data.getEquList());
// 是否场内机动车辆
......@@ -371,7 +372,7 @@ public class XiAnDataDockServiceImpl {
Optional.ofNullable(data.getAppraisalDate()).ifPresent(v -> checkDateFormatCorrect(v, "设计文件鉴定日期格式不正确;", rowError));
// 制造信息
//checkNotBlank(data.getProduceUnitCreditCode(), "制造单位统一社会信用代码不能为空;", rowError);
Optional.ofNullable(data.getProduceUnitCreditCode()).ifPresent(v -> checkCreditCode(v, "制造单位统一社会信用代码格式不正确;", rowError));
//Optional.ofNullable(data.getProduceUnitCreditCode()).ifPresent(v -> checkCreditCode(v, "制造单位统一社会信用代码格式不正确;", rowError));
//checkNotBlank(data.getProduceUnitName(), "制造单位名称不能为空;", rowError);
//checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", rowError);
//checkNotBlank(data.getFactoryNum(), "出厂编号/产品编码不能为空;", rowError);
......@@ -491,10 +492,10 @@ public class XiAnDataDockServiceImpl {
*/
private void YLGDTechnicalParamsCheck(XiAnEquipInfoExcelDto data, StringBuilder rowError) {
//checkNotBlank(data.getWallThickness_YLGD(), "公称壁厚不能为空;", rowError);
checkNotBlank(data.getNominalDiameter(), "公称直径不能为空;", rowError);
//checkNotBlank(data.getNominalDiameter(), "公称直径不能为空;", rowError);
checkNotBlank(data.getPipeLength(), "管道长度不能为空;", rowError);
checkNotBlank(data.getPressure(), "压力不能为空;", rowError);
checkNotBlank(data.getMedium_YLGD(), "介质不能为空;", rowError);
//checkNotBlank(data.getMedium_YLGD(), "介质不能为空;", rowError);
//checkNotBlank(data.getTemperature_YLGD(), "温度不能为空;", rowError);
//checkNotBlank(data.getPipelineNumber(), "管道编号不能为空;", rowError);
//checkNotBlank(data.getDeviceLevel_YLGD(), "管道级别不能为空;", rowError);
......
......@@ -34,4 +34,6 @@ public interface AppCommonMapper {
VehicleInfoForWX queryVehicleBaseInfo(Long seq);
JgUseRegistrationManageDto selectOneCert(String certOrApplyNo);
JgUseRegistrationManageDto searchOneCertByParam(String certNo);
}
......@@ -102,5 +102,14 @@
and (apply_no = #{certOrApplyNo} or certificate_no = #{certOrApplyNo})
ORDER BY rec_date desc limit 1
</select>
<select id="searchOneCertByParam" resultType="com.yeejoin.amos.boot.biz.common.dto.JgUseRegistrationManageDto">
SELECT
*
FROM
tzs_jg_use_registration_manage
WHERE
is_delete = false
and use_registration_code = #{certNo}
ORDER BY rec_date desc limit 1
</select>
</mapper>
......@@ -340,7 +340,6 @@ public class TzsAppController {
return ResponseHelper.buildResponse(tree);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/page", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "企业列表", notes = "企业列表")
......@@ -349,4 +348,19 @@ public class TzsAppController {
return ResponseHelper.buildResponse(iTzBaseEnterpriseInfoService.page(pageParam, tzBaseEnterpriseInfoDto));
}
/**
* 小程序获取证详情-根据登记证编号查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/certInfo/certNo")
@ApiOperation(httpMethod = "POST", value = "小程序获取登记证或者使用标志详情", notes = "小程序获取登记证或者使用标志详情")
public ResponseModel<Map<String, Object>> getCertInfoByCertNoForWX(@Validated @RequestBody CertInfoRequestParam requestParam, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(certDetailService.getCertInfoByCertNoForWX(requestParam));
}
}
......@@ -118,4 +118,17 @@ public class CertDetailServiceImpl {
}
return jgUseRegistrationManage.getManageType() == null ? "set" : jgUseRegistrationManage.getManageType();
}
public Map<String, Object> getCertInfoByCertNoForWX(CertInfoRequestParam requestParam) {
JgUseRegistrationManageDto jgUseRegistrationManage = this.searchCertByParam(requestParam.getCertNo());
return SearchDetailStrategyContext.getHandler(this.getManageType(jgUseRegistrationManage)).handler(jgUseRegistrationManage, "useCert");
}
private JgUseRegistrationManageDto searchCertByParam(String certNo) {
JgUseRegistrationManageDto jgUseRegistrationManage = commonMapper.searchOneCertByParam(certNo);
if (jgUseRegistrationManage == null) {
throw new AuthException("无此证信息!");
}
return jgUseRegistrationManage;
}
}
......@@ -41,10 +41,10 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
@Override
public Map<String, Object> handler(JgUseRegistrationManageDto manageDto, String certType) {
return this.getQueryCarCylinderInfo(manageDto);
return this.getQueryCarCylinderInfo(manageDto, certType);
}
private Map<String, Object> getQueryCarCylinderInfo(JgUseRegistrationManageDto manageDto) {
private Map<String, Object> getQueryCarCylinderInfo(JgUseRegistrationManageDto manageDto, String certType) {
VehicleInfoForWX baseInfo = appCommonMapper.queryVehicleBaseInfo(manageDto.getSequenceNbr());
// 最好改成查询es record再传入进去
List<CylinderInfoForWX> cylinderInfos = appCommonMapper.queryCylinderIfoOfVehicle(manageDto.getApplyNo());
......@@ -55,6 +55,9 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
buildOneItemTypeMap( baseInfo, tabs);
buildManyItemTypeTab(cylinderInfos, tabs);
result.put("tab", tabs);
result.put("certNo", manageDto.getCertificateNo());
result.put("certType", certType);
result.put("version", manageDto.getVersion());
return result;
}
......
......@@ -33,7 +33,7 @@ public class ShCarEquDto {
@TableField("CAR_ID")
private String carId;
@ApiModelProperty(value = "设备号")
@ApiModelProperty(value = "设备号")
@TableField("SEQUENCE_CODE")
private String sequenceCode;
......
......@@ -41,7 +41,7 @@ public class ShCarEqu {
private String carId;
/**
* 设备
* 设备
*/
@TableField(value = "\"SEQUENCE_CODE\"")
private String sequenceCode;
......
......@@ -32,6 +32,11 @@ public class ShCarEquVo {
private String equCode;
/**
* 设备型号
*/
private String equType;
/**
* 制造日期
*/
private Date produceDate;
......
......@@ -294,7 +294,7 @@
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and ( a.status <![CDATA[ <> ]]> '已作废' OR a.status <![CDATA[ <> ]]> '已完成')
and ( a.status <![CDATA[ <> ]]> '已作废' AND a.status <![CDATA[ <> ]]> '已完成')
UNION
select
apply_no
......@@ -304,7 +304,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and ( a.audit_status <![CDATA[ <> ]]> '已作废' OR a.audit_status <![CDATA[ <> ]]> '已完成')
and ( a.audit_status <![CDATA[ <> ]]> '已作废' AND a.audit_status <![CDATA[ <> ]]> '已完成')
UNION
select
apply_no
......@@ -314,7 +314,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '已作废' OR a.audit_status <![CDATA[ <> ]]> '已完成')
and (a.audit_status <![CDATA[ <> ]]> '已作废' AND a.audit_status <![CDATA[ <> ]]> '已完成')
UNION
select
apply_no
......@@ -324,7 +324,7 @@
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '已作废' OR a.status <![CDATA[ <> ]]> '已完成')
and (a.status <![CDATA[ <> ]]> '已作废' AND a.status <![CDATA[ <> ]]> '已完成')
UNION
select
apply_no
......@@ -334,7 +334,7 @@
where
a.sequence_nbr = b.enable_disable_apply_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '已作废' OR a.audit_status <![CDATA[ <> ]]> '已完成')
and (a.audit_status <![CDATA[ <> ]]> '已作废' AND a.audit_status <![CDATA[ <> ]]> '已完成')
UNION
select
apply_no
......@@ -344,7 +344,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status <![CDATA[ <> ]]> '6617' or a.notice_status <![CDATA[ <> ]]> '6616')
and (a.notice_status <![CDATA[ <> ]]> '6617' AND a.notice_status <![CDATA[ <> ]]> '6616')
UNION
select
apply_no
......@@ -354,7 +354,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status <![CDATA[ <> ]]> '6617' or a.notice_status <![CDATA[ <> ]]> '6616')
and (a.notice_status <![CDATA[ <> ]]> '6617' AND a.notice_status <![CDATA[ <> ]]> '6616')
UNION
select
apply_no
......@@ -364,7 +364,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '已作废' OR a.status <![CDATA[ <> ]]> '已完成')
and (a.status <![CDATA[ <> ]]> '已作废' AND a.status <![CDATA[ <> ]]> '已完成')
UNION
select
apply_no
......@@ -374,7 +374,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status <![CDATA[ <> ]]> '6617' or a.notice_status <![CDATA[ <> ]]> '6616')
and (a.notice_status <![CDATA[ <> ]]> '6617' AND a.notice_status <![CDATA[ <> ]]> '6616')
UNION
select
apply_no
......@@ -384,7 +384,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status <![CDATA[ <> ]]> '已作废' OR a.status <![CDATA[ <> ]]> '已完成')
and (a.audit_status <![CDATA[ <> ]]> '已作废' AND a.status <![CDATA[ <> ]]> '已完成')
UNION
select
apply_no
......@@ -394,7 +394,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status <![CDATA[ <> ]]> '6617' or a.notice_status <![CDATA[ <> ]]> '6616')
and (a.notice_status <![CDATA[ <> ]]> '6617' AND a.notice_status <![CDATA[ <> ]]> '6616')
UNION
select
apply_no
......@@ -404,7 +404,7 @@
where
a.sequence_nbr = b.vehicle_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '已作废' OR a.status <![CDATA[ <> ]]> '已完成')
and (a.status <![CDATA[ <> ]]> '已作废' AND a.status <![CDATA[ <> ]]> '已完成')
UNION
select
apply_no
......@@ -414,7 +414,17 @@
where
a.sequence_nbr = b.unit_change_id
and b.equ_id = #{record}
and (a.status <![CDATA[ <> ]]> '已作废' OR a.status <![CDATA[ <> ]]> '已完成')
and (a.status <![CDATA[ <> ]]> '已作废' AND a.status <![CDATA[ <> ]]> '已完成')
UNION
select
apply_no
from
tzs_jg_equip_transfer a,
tzs_jg_equip_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.apply_status <![CDATA[ <> ]]> '6617' AND a.apply_status <![CDATA[ <> ]]> '6616')
)
</select>
......
......@@ -399,7 +399,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 气瓶 校验制造单位统一信用代码与出场编码唯一
checkFactoryNumUniqueWithGasCylinder(equipmentInfoForm, record);
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
checkIsSanHanData(equipmentInfoForm);
// checkIsSanHanData(equipmentInfoForm);
} catch (Exception e) {
handleError(e, null);
}
......
......@@ -37,6 +37,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
import com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO;
import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
......@@ -101,6 +102,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param reginParams redis信息
*/
@Transactional(rollbackFor = {Exception.class, BaseException.class})
@GlobalTransactional(rollbackFor = Exception.class)
public List<JgEquipTransfer> saveTransfer(String submitType, JSONObject jsonObjectMap, ReginParams reginParams) {
JgEquipTransferDto model = JSON.parseObject(JSONObject.toJSONString(jsonObjectMap), JgEquipTransferDto.class);
......@@ -110,6 +112,15 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
throw new BadRequest("请选择设备!");
}
if (SUBMIT_TYPE_FLOW.equals(submitType)) {//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo company = reginParams.getCompany();
deviceList.forEach(device -> EquipUsedCheckStrategyContext.getUsedStrategy(EQUIP_TRANSFER_PROCESS_KEY)
.equipRepeatUsedCheck(String.valueOf(device.get("SEQUENCE_NBR")), CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode()));
}
//获取申请单编号
ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.getCode.get(String.valueOf(jsonObjectMap.get("businessCode"))), deviceList.size());
this.handleResponseModel(listResponseModel, "告知单获取失败: ");
......@@ -154,14 +165,6 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
this.updateRedisBatch(transferList);
// 创建历史数据
this.saveOrUpdateHisDataBatch(jgEquipTransferEqList);
if (SUBMIT_TYPE_FLOW.equals(submitType)) {//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo company = reginParams.getCompany();
jgEquipTransferEqList.forEach(equipTransferEq -> EquipUsedCheckStrategyContext.getUsedStrategy(EQUIP_TRANSFER_PROCESS_KEY)
.equipRepeatUsedCheck(equipTransferEq.getEquId(), CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ?
company.getCompanyCode().split("_")[1] :
company.getCompanyCode()));
}
return transferList;
}
......@@ -324,6 +327,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @return 设备信息
*/
@Transactional(rollbackFor = {Exception.class, BaseException.class})
@GlobalTransactional(rollbackFor = Exception.class)
public JgEquipTransferDto updateEquipTransfer(String submitType, JgEquipTransferDto equipTransferDto, String op, ReginParams reginParams) {
if (Objects.isNull(equipTransferDto) || StringUtils.isEmpty(submitType)) {
throw new IllegalArgumentException("参数不能为空");
......@@ -428,6 +432,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param op 通过或驳回
*/
@Transactional(rollbackFor = Exception.class)
@GlobalTransactional(rollbackFor = Exception.class)
public void accept(JgEquipTransferDto jgEquipTransferDto, String op) {
String instanceId = jgEquipTransferDto.getInstanceId();
String nextTaskId = jgEquipTransferDto.getNextTaskId();
......@@ -538,6 +543,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param equipTransferInfo 设备移交信息
*/
@Transactional(rollbackFor = Exception.class)
@GlobalTransactional(rollbackFor = Exception.class)
public void cancel(JgEquipTransferDto equipTransferInfo) {
String instanceId = equipTransferInfo.getInstanceId();
String nextTaskId = equipTransferInfo.getNextTaskId();
......@@ -803,6 +809,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
}
@Transactional(rollbackFor = Exception.class)
@GlobalTransactional(rollbackFor = Exception.class)
public Boolean deleteForBatch(Long[] ids) {
Collection<JgEquipTransfer> jgEquipTransfers = this.listByIds(Arrays.asList(ids));
for (JgEquipTransfer notice : jgEquipTransfers) {
......
......@@ -2569,8 +2569,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
this.rollBackForEquipEsInfo(record, flag);
// 5.历史设备处理
this.dealHisRegEquipData(jgUseRegistration, record);
});
List<String> equipTransferIds = eqList.stream()
.map(JgUseRegistrationEq::getEquipTransferId)
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (!equipTransferIds.isEmpty()) {
jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds);
}
}
private void dealHisRegEquipData(JgUseRegistration jgUseRegistration, String record) {
......
......@@ -848,6 +848,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 登记证记录主键
Long changeRecordId = sequence.nextId();
List<String> equipIdList = new ArrayList<>();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject mapData = jsonArray.getJSONObject(i);
// 设备ID
......@@ -890,7 +891,9 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
changeRecordEq.setEquId(registerInfo.getRecord());//设备主键
changeRecordEq.setProductCode(idxBizJgFactoryInfo.getFactoryNum());//产品编号
certificateChangeRecordEqService.save(changeRecordEq);
equipIdList.add(equId);
}
// 更新新生成的历史数据的设备代码
jgRegistrationHistory.setChangeData(JSON.toJSONString(jsonArray));
jgRegistrationHistoryService.updateById(jgRegistrationHistory);
......@@ -917,6 +920,21 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord(jgVehicleInformation, registerInfo, changeRecordId, taskV2Model);
jgResumeInfoService.saveBatchResume(
equipIdList.stream()
.map(equipId -> JgResumeInfoDto.builder()
.applyNo(jgVehicleInformation.getApplyNo())
.businessType(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName())
.businessId(String.valueOf(jgVehicleInformation.getSequenceNbr()))
.equId(equipId)
.approvalUnit(jgVehicleInformation.getReceiveOrgName())
.approvalUnitCode(jgVehicleInformation.getReceiveCompanyCode())
.status("正常")
.routePath(taskV2Model.getRoutePath())
.build())
.collect(Collectors.toList())
);
}
this.getBaseMapper().updateById(jgVehicleInformation);
commonService.saveExecuteFlowData2Redis(jgVehicleInformation.getInstanceId(), this.buildInstanceRuntimeData(jgVehicleInformation));
......@@ -1757,7 +1775,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
throw new BadRequest("使用登记证编号已存在!");
}
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
this.checkIsSanSystemHanData(map);
// this.checkIsSanSystemHanData(map);
//使用登记证编号判断是否使用未来系统生成编号
idxBizJgRegisterInfoService.checkUseRegistrationCode(useRegistrationCode1,"vehicle");
......
......@@ -77,7 +77,14 @@ public class ShCarEquServiceImpl extends BaseService<ShCarEqu, ShCarEqu, ShCarEq
queryWrapper.eq(ShCarEqu::getCarId, carId);
List<ShCarEqu> list = this.list(queryWrapper);
// 将设备列表转换为前端可识别bean
List<ShCarEquVo> collect = list.stream().map(shCarEqu -> new ShCarEquVo(shCarEqu)).collect(Collectors.toList());
List<ShCarEquVo> collect = list.stream()
.map(shCarEqu -> {
ShCarEquVo shCarEquVo = new ShCarEquVo(shCarEqu);
shCarEquVo.setUseInnerCode(shCarDto.getCarNumber());
shCarEquVo.setEquType(shCarEqu.getSequenceCode());
return shCarEquVo;
})
.collect(Collectors.toList());
// 封装返回VO
return new CarAndEquVo(shCarDto, collect);
}
......
......@@ -444,7 +444,7 @@
LEFT JOIN tz_jyjc_inspection_application_equip tjiae ON tjia.sequence_nbr = tjiae.application_seq
LEFT JOIN idx_biz_jg_register_info ri ON tjiae.equip_unicode = ri.RECORD
where
tjia.status != '6617' and
tjia.status != '6610' and tjia.status != '6615' and
((tbei.supervise_org_code != '50' and tbei.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or
(tbei.supervise_org_code = '50' and tbei.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
<if test="dto.beginDate != null and dto.beginDate != ''">
......
......@@ -933,6 +933,7 @@ public class AQZSDPStatisticsServiceImpl {
result.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE)).mapToInt(CountDto::getIntValue).sum());
result.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_FILLING)).mapToInt(CountDto::getIntValue).sum());
result.put("companyCount", countDtos.stream().mapToInt(CountDto::getIntValue).sum());
}
private void setDefaultCompanyCountData(Map<String, Object> m) {
......
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.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -134,7 +135,24 @@ public class EnterpriseBizByTCMServiceImpl {
resultMap.remove("regUnitInfoDto");
resultMap.remove("tzsBaseInstitution");
resultMap.put("unitAddress", resultMap.get("province") + "/" + resultMap.get("city") + "/" + resultMap.get("district"));
String unitAddress = "";
if (StrUtil.isNotBlank(resultMap.get("province")+"") && !"null".equals(resultMap.get("province")+"")){
unitAddress += resultMap.get("province");
}
if (StrUtil.isNotBlank(resultMap.get("city")+"") && !"null".equals(resultMap.get("city")+"")){
unitAddress += "/" + resultMap.get("city");
}
if (StrUtil.isNotBlank(resultMap.get("district")+"") && !"null".equals(resultMap.get("district")+"")){
unitAddress += "/" + resultMap.get("district");
}
// 确保不以斜杠开始
if (unitAddress.startsWith("/")) {
unitAddress = unitAddress.substring(1);
}
if(StrUtil.isNotBlank(unitAddress)) {
resultMap.put("unitAddress", unitAddress);
}
Map<String,Object> longitudeLatitudeMap = new HashMap<>();
longitudeLatitudeMap.put("address", resultMap.get("address"));
......
......@@ -1108,7 +1108,11 @@ public class JGDPStatisticsServiceImpl {
regionModels.forEach(r -> {
xData.add(r.getRegionName());
String orgCode = stCommonService.getAndSetOrgCode(r.getRegionCode().toString());
yData.add(this.avgAndSumDealDate(countDtos.stream().filter(c -> c.getKeyStr().contains(orgCode)).collect(Collectors.toList())));
if(!ValidationUtil.isEmpty(orgCode)) {
yData.add(this.avgAndSumDealDate(countDtos.stream().filter(c -> c.getKeyStr().contains(orgCode)).collect(Collectors.toList())));
}else{
yData.add("0");
}
});
resultMap.put("xdata", xData);
resultMap.put("ydata", yData);
......
......@@ -1420,7 +1420,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
dto.setUSE_UNIT_CREDIT_CODE(companyCode);
} else {
// 监管单位
dto.setORG_BRANCH_CODE(orgCode);
dto.setORG_BRANCH_CODE(ObjectUtils.isEmpty(dto.getORG_BRANCH_CODE()) ? orgCode : dto.getORG_BRANCH_CODE());
}
List<EquipExportVo> equipExportData = equipmentCategoryMapper.getEquipExportData(dto);
if (!ObjectUtils.isEmpty(equipExportData)) {
......
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