Commit 98bf33dd authored by 韩桐桐's avatar 韩桐桐

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents d69c2841 7492dec9
package com.yeejoin.amos.boot.module.elevator.biz.controller;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -567,7 +568,7 @@ public class AlertCalledController extends BaseController {
/**
* 冻结工单-维修
*
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -603,7 +604,7 @@ public class AlertCalledController extends BaseController {
/**
* 工单结案-投诉
*
*
* @return
*/
@ResubmitCheck
......@@ -785,6 +786,17 @@ public class AlertCalledController extends BaseController {
/**
* 应急大屏使用
*
* @param id 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/detail/{id}")
@ApiOperation(httpMethod = "GET", value = "根据id获取详细信息", notes = "根据id获取详细信息")
public ResponseModel<Object> getDetail(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.getDetail(id));
}
}
......@@ -34,6 +34,7 @@ import com.yeejoin.amos.boot.module.elevator.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.elevator.api.service.TzsAuthService;
import com.yeejoin.amos.boot.module.elevator.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.text.StrBuilder;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.logging.log4j.LogManager;
......@@ -44,12 +45,16 @@ import org.redisson.api.RedissonClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
......@@ -58,6 +63,8 @@ import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
import static com.alibaba.fastjson.JSON.parseArray;
/**
* 警情接警填报记录服务实现类
*
......@@ -127,6 +134,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
private RAtomicLong rAtomicLong;
@Autowired
ElevatorServiceImpl elevatorServiceImpl;
@Value("classpath:/json/emergencyInformation.json")
private Resource emergencyInformation;
public AlertCalledServiceImpl(RedissonClient client){
this.redissonClient = client;
rAtomicLong = redissonClient.getAtomicLong("AUTO_INCR_LONG");
......@@ -944,4 +957,98 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
}
return alertCalledMapper.getCountNum(userName, startTime, endTime, groupCode);
}
public Object getDetail(Long id) {
HashMap<String, Object> map = new HashMap<>();
// 基本信息
Map<String, Object> keyInfo = getKeyInfo(id);
// map.put("keyinfo", keyInfo);
return keyInfo;
}
public Map<String, Object> getKeyInfo(Long id) {
HashMap<String, Object> keyinfoData = new HashMap<>();
// 基本信息
List<FormValue> jsonData = getJsonData(emergencyInformation);
AlertCalledFormDto alertCalledFormVo = getAlertCalledFormDto(id);
Map<String, Object> objectMap = Bean.BeantoMap(alertCalledFormVo.getAlertCalledDto());
List<FormValue> dynamicFormAlert = alertCalledFormVo.getDynamicFormAlert();
jsonData.forEach(f -> {
Object o = objectMap.get(f.getKey());
if (!ObjectUtils.isEmpty(o)) {
f.setValue(o.toString());
}
dynamicFormAlert.add(f);
});
// 使用单位信息
// 获取根据警情获取电梯信息
Map<String, Object> map = elevatorServiceImpl.selectByAlertId(id);
// 根据设备id 获取使用单位信息
Map<String, Object> useUnitMap = elevatorServiceImpl.selectUseUnitByAlertId(String.valueOf(map.get("sequenceNbr")));
if (!ObjectUtils.isEmpty(useUnitMap)) {
jsonData.forEach(f -> {
// 单位名称
if ("useUnitName".equals(f.getKey())) {
f.setValue(ObjectUtils.isEmpty(useUnitMap.get("useUnitName")) ? null : String.valueOf(useUnitMap.get("useUnitName")));
}
// 单位电话
// if ("principalPhone".equals(f.getKey())){
//
// }
// 单位地址
if ("unitAddress".equals(f.getKey())) {
f.setValue(ObjectUtils.isEmpty(useUnitMap.get("address")) ? null : String.valueOf(useUnitMap.get("address")));
}
// 安全管理员
if ("securityAdministrator".equals(f.getKey())) {
f.setValue(ObjectUtils.isEmpty(useUnitMap.get("manager")) ? null : String.valueOf(useUnitMap.get("manager")));
}
// 安全管理员电话
if ("securityAdministratorPhone".equals(f.getKey())) {
f.setValue(ObjectUtils.isEmpty(useUnitMap.get("managerPhone")) ? null : String.valueOf(useUnitMap.get("managerPhone")));
}
});
}
// 处置记录
LambdaQueryWrapper<RepairConsult> queryWrapper = new LambdaQueryWrapper<RepairConsult>();
queryWrapper.eq(RepairConsult::getParentId, id).orderByDesc(RepairConsult::getRecDate);
List<RepairConsult> list = repairConsultServiceImpl.list(queryWrapper);
HashMap<String, Object> datas = new HashMap<>();
ArrayList<Map<String, Object>> records = new ArrayList<>();
list.forEach(r -> {
HashMap<String, Object> data = new HashMap<>();
data.put("label", r.getAlertStatus());
data.put("operatingTime", r.getRecDate());
data.put("operater", r.getDescription());
records.add(data);
});
// 监管码
HashMap<String, Object> qrcode = new HashMap<>();
if (!ObjectUtils.isEmpty(alertCalledFormVo.getAlertCalledDto())) {
qrcode.put("value", alertCalledFormVo.getAlertCalledDto().getRegistrationCode());
}
// 96333码
HashMap<String, Object> qrcode2 = new HashMap<>();
if (!ObjectUtils.isEmpty(alertCalledFormVo.getAlertCalledDto())) {
qrcode2.put("value", alertCalledFormVo.getAlertCalledDto().getDeviceId());
}
datas.put("datas", records);
keyinfoData.put("keyParams", dynamicFormAlert);
keyinfoData.put("infoRecords", datas);
keyinfoData.put("qrcode", qrcode);
keyinfoData.put("qrcode2", qrcode2);
return keyinfoData;
}
private List<FormValue> getJsonData(Resource resource) {
String json;
try {
json = IOUtils.toString(resource.getInputStream(), String.valueOf(StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(e);
}
return parseArray(json, FormValue.class);
}
}
\ No newline at end of file
[
{
"key": "emergencyPerson",
"label": "救援人姓名",
"type": "text"
},
{
"key": "callTime",
"label": "接警时间",
"type": "text"
},
{
"key": "contactPhone",
"label": "联系人电话",
"type": "text"
},
{
"key": "useSiteCategory",
"label": "使用场所分类",
"type": "text"
},
{
"key": "deviceId",
"label": "电梯识别码",
"type": "text"
},
{
"key": "useStatus",
"label": "使用情况",
"type": "text"
},
{
"key": "address",
"label": "地址",
"type": "text"
},
{
"key": "useUnitName",
"label": "单位名称",
"type": "text"
},
{
"key": "principalPhone",
"label": "单位电话",
"type": "text"
},
{
"key": "unitAddress",
"label": "单位地址",
"type": "text"
},
{
"key": "securityAdministrator",
"label": "电梯安全管理员",
"type": "text"
},
{
"key": "securityAdministratorPhone",
"label": "电梯安全管理员电话",
"type": "text"
}
]
\ No newline at end of file
......@@ -30,6 +30,9 @@ public enum DPMapStatisticsItemEnum {
GAS_UNITS("充装单位 (家)", "gasUnits", ""),
OPERATORS("作业人员 (人)", "operators", ""),
DEVICE_COUNT("已纳管设备数", "deviceCount", ""),
PERSON_ISSUES_COUNT("个人问题数", "个人", ""),
COMPANY_ISSUES_COUNT("企业问题数", "企业", ""),
EQU_ISSUES_COUNT("设备数", "设备", ""),
CERTIFICATE_COUNT("登记证总量", "certificateCount", "");
private String label;
private String code;
......
......@@ -930,12 +930,12 @@ public class CommonServiceImpl implements ICommonService {
String docTitle = pdfFile.getName();
FileExporter.exportFile(FileExporter.FileType.valueOf("pdf"), docTitle, bytes, response);
} catch (Exception e) {
log.error("pdf文件转换失败:{}", e);
log.error("pdf文件转换失败", e);
} finally {
try {
Files.deleteIfExists(pdfFile.toPath());
} catch (Exception e) {
log.error("文件找不到,删除失败:{}", e);
log.error("文件找不到,删除失败", e);
}
}
}
......
......@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.ImmutableMap;
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.BaseEntity;
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.enums.ReginStepEnum;
......@@ -59,6 +60,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -66,8 +68,8 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl.getAuditPassedDate;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
/**
* 移装变更登记登记服务实现类
......@@ -207,7 +209,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
throw new BadRequest("区内移装只能选择与设备地址中相同地市进行移装!");
}
});
} else{
} else {
deviceList.forEach(device -> {
String deviceCity = Arrays.stream(((String) device.get("USE_PLACE_CODE")).split("#"))
.skip(1)
......@@ -923,14 +925,13 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
useRegistrationCode.set(commonServiceImpl.generateRegistrationCode(device.getEquId(), supervisoryCode, transfer.getReceiveCompanyCode(), false));
useRegistrationCodeList.add(String.valueOf(useRegistrationCode));
isUpdateRegistrationCode.set(true);
}else{
IdxBizJgUseInfo useInfo = useInfoService.getOneData(device.getEquId());
} else {
JSONObject newPosition = JSON.parseObject(historyData.getChangeData());
String county = newPosition.getString("transferCounty").split("_")[0];
boolean shouldUpdateCode = Arrays.stream(ReginStepEnum.values())
.map(ReginStepEnum::getCode)
.anyMatch(code -> code.equals(county));
if (shouldUpdateCode){
if (shouldUpdateCode) {
Map<String, String> supervisoryCodeMap = this.createSupervisoryCode(historyData);
supervisoryCode = supervisoryCodeMap.get("superviseCode");
code96333 = supervisoryCodeMap.get("code96333");
......@@ -979,6 +980,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
registrationManage.setUseRegistrationCode(useRegistrationCode);
}
registrationManage.setCertificateStatus("已登记");
registrationManage.setApplyNo(transfer.getApplyNo());
});
List<JSONObject> updatedRegistrationList = registrationList.stream()
.map(registrationManage -> {
......@@ -1004,7 +1006,8 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
* @param record 设备Id
* @param newData 设备移装的新数据
*/
public void replacementHistoryData(String record, JgChangeRegistrationTransfer transfer, JgRegistrationHistory newData, String supervisoryCode, String code96333) {
public void replacementHistoryData(String record, JgChangeRegistrationTransfer transfer,
JgRegistrationHistory newData, String supervisoryCode, String code96333) {
if (!ValidationUtil.isEmpty(record) && !ValidationUtil.isEmpty(transfer.getApplyNo())) {
//查询设备旧数据
......@@ -1110,7 +1113,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
}
useInfo.setEquState("1");
useInfoService.saveOrUpdateData(useInfo);
otherInfo.setSupervisoryCode(supervisoryCode);
if (!StringUtils.isEmpty(supervisoryCode)) {
otherInfo.setSupervisoryCode(supervisoryCode);
}
otherInfo.setCode96333(code96333);
otherInfoService.saveOrUpdateData(otherInfo);
}
......@@ -1143,7 +1148,8 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
* @param useRegistrationCode 使用注册登记证编号
* @param isUpdateRegistrationCode 是否更新使用登记证编号
*/
public void updateRegisterInfoAndEsData(String equId, JgRegistrationHistory newData, String useRegistrationCode, String supervisoryCode, String code96333, AtomicBoolean isUpdateRegistrationCode) {
public void updateRegisterInfoAndEsData(String equId, JgRegistrationHistory newData, String useRegistrationCode,
String supervisoryCode, String code96333, AtomicBoolean isUpdateRegistrationCode) {
//更新使用注册登记证编号
if (isUpdateRegistrationCode.get()) {
idxBizJgRegisterInfoMapper.updateUseOrgCodeByEquip(equId, useRegistrationCode);
......@@ -1215,7 +1221,9 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
if (isUpdateRegistrationCode.get()) {
map1.put("EQU_STATE", "1");
map1.put("USE_ORG_CODE", useRegistrationCode);
map1.put("SUPERVISORY_CODE", supervisoryCode);
if (!StringUtils.isEmpty(supervisoryCode)) {
map1.put("SUPERVISORY_CODE", supervisoryCode);
}
map1.put("CODE96333", code96333);
}
resultMap.put(equId, map1);
......
......@@ -944,7 +944,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
useInfo.setUseUnitCreditCode(registration.getNewUseUnitCreditCode());
useInfoMapper.updateById(useInfo);
}
//es中的编号信息
//修改ES中使用单位信息和使用单位代码
Map<String, Map<String, Object>> resultMap = new HashMap<>();
Map<String, Object> map1 = new HashMap<>();
map1.put("USE_UNIT_CREDIT_CODE", registration.getNewUseUnitCreditCode());
......@@ -964,6 +964,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
List<String> ids = historyJson.stream().map(v -> JSON.parseObject(v.toString()).getString("sequenceNbr")).collect(Collectors.toList());
List<JgUseRegistrationManage> list = useRegistrationManageService.lambdaQuery().in(BaseEntity::getSequenceNbr, ids).list();
for (JgUseRegistrationManage registrationManage : list) {
//修改使用登记证管理使用单位地址、使用单位代码、接收机构、接收机构公司代码、办理日期、使用单位地址
registrationManage.setUseUnitName(registration.getNewUseUnitName());
registrationManage.setUseUnitCreditCode(registration.getNewUseUnitCreditCode());
registrationManage.setReceiveOrgName(registration.getReceiveOrgName());
......@@ -973,7 +974,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
TzBaseEnterpriseInfo useCodeResult = tzBaseEnterpriseInfoMapper.selectOne(new QueryWrapper<TzBaseEnterpriseInfo>().eq("use_unit_code", registration.getNewUseUnitCreditCode()));
if (useCodeResult != null) {
registrationManage.setUseUnitAddress(useCodeResult.getAddress());
registrationManage.setEquUseAddress(useCodeResult.getAddress());
}
}
}
......
......@@ -67,7 +67,7 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* 移装告知服务实现类
* 移装告知服务实现类
*
* @author system_generator
* @date 2023-12-19
......@@ -114,6 +114,12 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
private RedissonClient redissonClient;
@Autowired
ESEquipmentCategory esEquipmentCategory;
@Autowired
JgRegistrationHistoryServiceImpl jgRegistrationHistoryService;
@Autowired
JgTransferNoticeEqServiceImpl jgTransferNoticeEqService;
@Autowired
ESElavtorRepository esElavtorRepository;
/**
* 根据sequenceNbr查询
......@@ -450,8 +456,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
}
@Autowired
ESElavtorRepository esElavtorRepository;
/**
* 分页查询
......@@ -828,7 +833,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
// 检查实际状态是否不等于期望状态
commonService.checkExpectedStatus(jgTransferNotice.getNoticeStatus());
// 执行工作流并返回组装好的工作流信息
WorkflowResultDto workflowResultDto = getWorkflowResultDto(op, opinion, jgTransferNotice);
......@@ -848,8 +852,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
jgTransferNotice.setPromoter("");
jgTransferNotice.setHandleDate(new Date());
jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()));
//修改设备ES设备使用场所和设备详细使用地址
Map<String, Map<String, Object>> objMap = new HashMap<>();
for (JgTransferNoticeEq eq : jgTransferNoticeEqs) {
Map<String, Object> map1 = new HashMap<>();
......@@ -966,9 +969,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
}
@Autowired
JgTransferNoticeEqServiceImpl jgTransferNoticeEqService;
private void updateEq(JgTransferNotice jgTransferNotice) {
// 组装设备注册代码
String ym = null;
......@@ -990,9 +990,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
jgTransferNoticeEqService.updateBatchById(eqList);
}
@Autowired
JgRegistrationHistoryServiceImpl jgRegistrationHistoryService;
private void saveHisDataBeforeUpdate(JgTransferNotice jgTransferNotice, List<JgTransferNoticeEq> jgTransferNoticeEqs) {
String seq = jgTransferNotice.getSequenceNbr().toString();
JSONObject json = (JSONObject) JSONObject.toJSON(jgTransferNotice);
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto;
import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CertificateStatusEnum;
......@@ -13,9 +14,11 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationManageMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgVehicleInformationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationManageService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.common.StringUtil;
import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchRequest;
......@@ -41,6 +44,8 @@ import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl.getAuditPassedDate;
/**
* 服务实现类
*
......@@ -81,6 +86,15 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
@Autowired
private JgVehicleInformationServiceImpl jgVehicleInformationService;
@Autowired
private IJgChangeRegistrationTransferService jgChangeRegistrationTransferService;
@Autowired
private CommonServiceImpl commonService;
@Autowired
private IdxBizJgMaintenanceRecordInfoServiceImpl idxBizJgMaintenanceRecordInfoService;
/**
* 将已经通过使用登记审批的证信息录入到 jg-use-registration-manage 表中
*/
......@@ -402,12 +416,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
sequenceNbr = String.valueOf(vehicleInformation.getSequenceNbr());
jgVehicleInformationService.exportVehicleUseRegistrationCertificate(sequenceNbr, response, getPrintTypeCode(printType));
} else if (BusinessTypeEnum.JG_USAGE_REGISTRATION.getName().equals(regType)) {
jgUseRegistrationService.list(
new LambdaQueryWrapper<JgUseRegistration>()
.eq(JgUseRegistration::getUseRegistrationCode, useRegistrationCode)
).stream()
.max(Comparator.comparing(JgUseRegistration::getRecDate))
.ifPresent(useRegistration -> jgUseRegistrationService.exportUseRegistrationCertificate(String.valueOf(useRegistration.getSequenceNbr()), response, getPrintTypeCode(printType)));
this.exportUseRegistrationCertificate(manage, response, getPrintTypeCode(printType));
}
break;
case "exportSummaryTable":// 工业管道和气瓶 汇总表下载
......@@ -436,4 +445,107 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
}
}
public void exportUseRegistrationCertificate(JgUseRegistrationManage manage, HttpServletResponse response, String printType) {
Map<String, Object> exportParamsMap = new HashMap<>();
// 查询使用登记详情
exportParamsMap.put("manageType", manage.getManageType());
List<JSONObject> deviceList = this.queryEquByCertificateSeq(manage.getSequenceNbr());
if (ValidationUtil.isEmpty(manage) || ValidationUtil.isEmpty(deviceList)) {
throw new BadRequest("使用登记证导出失败,请稍后重试!");
}
// 登记机关
if (ValidationUtil.isEmpty(manage.getReceiveOrgName())) {
throw new BadRequest("使用登记证导出失败,登记机关为空!");
}
exportParamsMap.put("receiveOrgName", manage.getReceiveOrgName());
// 使用登记证编号
if (ValidationUtil.isEmpty(manage.getUseRegistrationCode())) {
throw new BadRequest("使用登记证导出失败,使用登记证编号为空!");
}
exportParamsMap.put("useRegistrationCode", manage.getUseRegistrationCode());
// 使用单位名称
if (ValidationUtil.isEmpty(manage.getUseUnitName())) {
throw new BadRequest("使用登记证导出失败,使用单位名称为空!");
}
exportParamsMap.put("useUnitName", manage.getUseUnitName());
// 监管码
if (ValidationUtil.isEmpty(deviceList.get(0))) {
throw new BadRequest("使用登记证导出失败,监管码为空!");
}
exportParamsMap.put("supervisoryCode", deviceList.get(0).get("SUPERVISORY_CODE"));
getAuditPassedDate(manage.getAuditPassDate(), exportParamsMap);
exportParamsMap.put("equList", manage.getEquList());
exportParamsMap.put("equCategory", manage.getEquCategory());
exportParamsMap.put("equDefine", manage.getEquDefine());
exportParamsMap.put("equCode", deviceList.get(0).get("EQU_CODE"));
exportParamsMap.put("fullAddress", manage.getEquUseAddress());
exportParamsMap.put("applyNo", manage.getApplyNo());
exportParamsMap.put("factoryNum", deviceList.get(0).get("FACTORY_NUM"));
exportParamsMap.put("useInnerCode", deviceList.get(0).get("USE_INNER_CODE"));
exportParamsMap.put("carNumber", manage.getCarNumber());
if ("0".equals(printType)) {
// 调用生成使用登记证
commonService.generateCertificateReport(exportParamsMap, response);
} else if ("1".equals(printType)) {
// 套打
commonService.generateCertificateReportDoc(exportParamsMap, response);
} else if ("2".equals(printType)) {
// 使用标志普通打印
commonService.useFlagGenerate(this.buildUseFlagParamDto(deviceList, manage, exportParamsMap), response);
} else if ("3".equals(printType)) {
// 使用标志套打
commonService.fightUseFlagGenerate(this.buildUseFlagParamDto(deviceList, manage, exportParamsMap), response);
}
}
private UseFlagParamDto buildUseFlagParamDto(List<JSONObject> deviceList, JgUseRegistrationManage manage, Map<String, Object> exportParamsMap) {
UseFlagParamDto useFlagParamDto = new UseFlagParamDto();
useFlagParamDto.setReceiveCompanyCode(manage.getReceiveCompanyCode());
useFlagParamDto.setEquList(exportParamsMap.get("equList").toString());
useFlagParamDto.setEquListCode(manage.getEquListCode());
useFlagParamDto.setEquipCode(exportParamsMap.get("equCode").toString());
useFlagParamDto.setEquipCategory(manage.getEquCategory());
useFlagParamDto.setEquipDefine(Optional.ofNullable(exportParamsMap.get("equDefine"))
.orElse(exportParamsMap.get("equCategory").toString())
.toString());
useFlagParamDto.setUseUnitName(exportParamsMap.get("useUnitName").toString());
useFlagParamDto.setUseInnerCode(exportParamsMap.get("useInnerCode").toString());
useFlagParamDto.setReceiveOrgName(manage.getReceiveOrgName());
useFlagParamDto.setUseRegistrationCode(exportParamsMap.get("useRegistrationCode").toString());
useFlagParamDto.setFactoryNumber(exportParamsMap.get("factoryNum").toString());
useFlagParamDto.setCarNumber(manage.getCarNumber());
useFlagParamDto.setApplyNo(manage.getApplyNo());
// 检验信息字段设置
setInspectField((String) deviceList.get(0).get("SEQUENCE_NBR"), useFlagParamDto);
// 电梯维保信息字段设置
setMainInfoField((String) deviceList.get(0).get("SEQUENCE_NBR"), useFlagParamDto);
// 车用气瓶专用字段 暂无数据源 需车用气瓶功能开发完成后进行
useFlagParamDto.setCylinderNumOrVolume("");
useFlagParamDto.setFillingMedium("");
return useFlagParamDto;
}
public void setInspectField(String record, UseFlagParamDto useFlagParamDto) {
Map<String, Object> inspectDetail = jgUseRegistrationMapper.getInspectDetail(record, null);
useFlagParamDto.setInspectionUnitName(inspectDetail.get("inspectOrgName") == null ? "" : inspectDetail.get("inspectOrgName").toString());
useFlagParamDto.setNextInspectionDate(inspectDetail.get("nextInspectDate") == null ? null : (Date) inspectDetail.get("nextInspectDate"));
}
public void setMainInfoField(String record, UseFlagParamDto useFlagParamDto) {
IdxBizJgMaintenanceRecordInfo idxBizJgMaintenanceRecordInfo = idxBizJgMaintenanceRecordInfoService.queryNewestDetailByRecord(record);
useFlagParamDto.setEmergencyTel(this.buildEmergencyTel(idxBizJgMaintenanceRecordInfo));
useFlagParamDto.setMaintenanceUnitName(idxBizJgMaintenanceRecordInfo.getMeUnitName() == null ? "" : idxBizJgMaintenanceRecordInfo.getMeUnitName());
}
private String buildEmergencyTel(IdxBizJgMaintenanceRecordInfo idxBizJgMaintenanceRecordInfo) {
if (StringUtil.isNotEmpty(idxBizJgMaintenanceRecordInfo.getMeMasterPhone()) && StringUtil.isNotEmpty(idxBizJgMaintenanceRecordInfo.getMeMaster1Phone())) {
return idxBizJgMaintenanceRecordInfo.getMeMasterPhone() + "/" + idxBizJgMaintenanceRecordInfo.getMeMaster1Phone();
}
return StringUtil.isNotEmpty(idxBizJgMaintenanceRecordInfo.getMeMasterPhone()) ? idxBizJgMaintenanceRecordInfo.getMeMasterPhone() : StringUtil.isNotEmpty(idxBizJgMaintenanceRecordInfo.getMeMaster1Phone()) ? idxBizJgMaintenanceRecordInfo.getMeMaster1Phone() : "";
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.statistics.api.dto;
import lombok.Data;
/**
* @author Administrator
*/
@Data
public class SecurityIndexCountItemDto {
private String regionCode;
private String regionName;
/**
* 充装检查率
*/
private String czjc;
/**
* 许可有效率
*/
String xuke;
/**
* 使用登记办理率
*/
String shiyongdengji;
/**
* 检验超期率
*/
String jianyanchaoqi;
/**
* 检验合格率
*/
String jianyanhege;
/**
* 充装检查率
*/
String czjchege;
}
......@@ -46,10 +46,10 @@ public interface AQZSDPStatisticsMapper {
/**
* 单位按照资质状态分组下的统计数量
*
* @param regionCode 区域
* @param orgCode 区域
* @return List<KeyValueDto>
*/
List<KeyValueDto> queryLicenseEfficiencyOfRegion(@Param(value = "regionCode") String regionCode);
List<KeyValueDto> queryLicenseEfficiencyOfRegion(@Param(value = "orgCode") String orgCode);
/**
* 查询单个单位的有效期信息
*
......@@ -58,8 +58,9 @@ public interface AQZSDPStatisticsMapper {
*/
KeyValueDto queryLicenseEfficiencyOneCompany(@Param(value = "appId") String appId);
Map<String, Object> getInspectionExpiredRate(@Param(value = "regionCode") String regionCode, @Param(value = "appId") String appId);
Map<String, Object> getInspectionExpiredRate(@Param(value = "orgCode") String orgCode, @Param(value = "appId") String appId);
Map<String, Object> getInspectionResultRate(@Param(value = "regionCode") String regionCode, @Param(value = "appId") String appId);
Map<String, Object> getInspectionResultRate(@Param(value = "orgCode") String orgCode, @Param(value = "appId") String appId);
List<Map<String, Object>> selectByOrg(String orgCode);
}
......@@ -13,4 +13,11 @@ import org.apache.ibatis.annotations.Param;
public interface CylinderStatisticsMapper {
Long countEnterpriseNumForCylinder(@Param("orgCode") String orgCode);
/**
* 按照管辖维度,统计充装单位使用登记证的办理率
* @param orgCode 区域对应的单位orgCode
* @return 办理率*100
*/
String queryUserRegisterCertAppPercent(@Param("orgCode") String orgCode);
}
......@@ -246,8 +246,8 @@
<where>
cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%'
<if test="regionCode != null and regionCode != ''">
and cu.org_code like concat(#{regionCode}, '%')
<if test="orgCode != null and orgCode != ''">
and cu.supervise_org_code like concat(#{orgCode}, '%')
</if>
<if test="appId != null and appId != ''">
and cu.app_id = #{appId}
......@@ -264,8 +264,8 @@
<where>
cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%'
<if test="regionCode != null and regionCode != ''">
and cu.org_code like concat( #{regionCode}, '%')
<if test="orgCode != null and orgCode != ''">
and cu.supervise_org_code like concat( #{orgCode}, '%')
</if>
<if test="appId != null and appId != ''">
and cu.app_id = #{appId}
......@@ -303,9 +303,21 @@
where
cu.data_sources = '陕西省内企业'
AND cu.unit_type LIKE '%充装单位%'
and cu.org_code like concat('%', #{regionCode}, '%')
and cu.supervise_org_code like concat(#{orgCode}, '%')
GROUP BY strKey
</select>
<select id="selectByOrg" resultType="java.util.Map">
SELECT COUNT
( 1 ),
source_type AS sourceType
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
GROUP BY
source_type
</select>
</mapper>
......@@ -10,4 +10,25 @@
unit_type LIKE'%充装单位%'
and supervise_org_code like concat(#{orgCode},'%')
</select>
<select id="queryUserRegisterCertAppPercent" resultType="java.lang.String">
select
case when s2.total= 0 then 0 else round(s1.num/s2.total * 100, 2) end as percent
from
(SELECT
count(DISTINCT(a.use_unit_credit_code)) as num
FROM
"tzs_jg_use_registration_manage" a,
privilege_company c
where
a.receive_company_code = c.company_code
and a.certificate_status='已登记'
and c.org_code like concat(#{orgCode},'%')) s1,
(SELECT
count(1) as total
FROM "tz_base_enterprise_info"
where
unit_type LIKE'%充装单位%'
and supervise_org_code like concat(#{orgCode},'%')
) s2
</select>
</mapper>
......@@ -20,7 +20,7 @@ import java.util.List;
import java.util.Map;
@RestController
@Api(tags = "大屏-安全追溯统计Api")
@Api(tags = "大屏-安全追溯及气瓶统计Api")
@RequestMapping(value = "/dp/aqzs")
public class AQZSDPStatisticsController {
......@@ -33,20 +33,19 @@ public class AQZSDPStatisticsController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "大屏-气瓶-区域安全指数")
@PostMapping(value = "/security-index")
public ResponseModel<Map<String, Object>> getSecurityIndex(@RequestBody Map<String, Object> map) throws Exception {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
public ResponseModel<Map<String, Object>> getSecurityIndex(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult bindingResult) throws Exception {
List<FieldError> fieldErrors = bindingResult.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
Map<String, Object> result = statisticsService.getSecurityIndex(regionCode.toString());
Map<String, Object> result = statisticsService.getSecurityIndex(dpFilterParamDto);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/earlyWarning/child", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "大屏-气瓶-区域安全指数统计")
@RequestMapping(value = "/earlyWarning/child", method = RequestMethod.POST)
public ResponseModel<Map<String, Object>> getChildEarlyWarning(@RequestBody Map<String, Object> map) throws Exception {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
......@@ -244,4 +243,26 @@ public class AQZSDPStatisticsController {
List<Map<String, Object>> result = statisticsService.issueCountTopByProblemType(regionCode.toString());
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-中间地图左右两侧8大类、单位、人员数量、问题数量全局统计", notes = "大屏中间-地图左右两侧8大类、单位、人员数量、问题数量全局统计")
@PostMapping(value = "/center-map/legend")
public ResponseModel<Map<String, Object>> centerMapCountForGlobal(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getCenterMapCountDataForGlobal(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "安全追溯大屏-中间地图地市统计", notes = "安全追溯大屏中间-地图地市统计")
@PostMapping(value = "/center-map/overview")
public ResponseModel<List<Map<String, Object>>> centerMapCountForOverview(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.getCenterMapCountDataForOverview(dpFilterParamDto));
}
}
......@@ -38,7 +38,9 @@ public class DPSubController {
public ResponseModel<JSONObject> commonQuery(@PathVariable String template, @RequestBody Map<String, Object> param) {
if (template.equals("company")) {
Assert.notNull(param.get("useUnitCode"), "企业统一信用代码不能为空");
} else if (template.equals("equip")) {
} else if (template.equals("emergency")){
Assert.notNull(param.get("id"), "id不能为空");
}else if(template.equals("equip")) {
param.put("record", param.get("SEQUENCE_NBR"));
param.put("equList", param.get("EQU_LIST_CODE"));
Assert.notNull(param.get("record"), "设备ID不能为空");
......
package com.yeejoin.amos.boot.module.statistcs.biz.init;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.AQZSDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.JGDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.StCommonServiceImpl;
import com.yeejoin.amos.component.robot.AmosRequestContext;
......@@ -16,14 +17,17 @@ public class DataInitAfterRuning implements ApplicationRunner {
private JGDPStatisticsServiceImpl jgdpStatisticsService;
private AQZSDPStatisticsServiceImpl aqzsdpStatisticsService;
private StCommonServiceImpl stCommonService;
private AmosRequestContext amosRequestContext;
public DataInitAfterRuning(JGDPStatisticsServiceImpl jgdpStatisticsService, StCommonServiceImpl stCommonService, AmosRequestContext amosRequestContext) {
public DataInitAfterRuning(JGDPStatisticsServiceImpl jgdpStatisticsService, StCommonServiceImpl stCommonService, AmosRequestContext amosRequestContext, AQZSDPStatisticsServiceImpl aqzsdpStatisticsService) {
this.jgdpStatisticsService = jgdpStatisticsService;
this.stCommonService = stCommonService;
this.amosRequestContext = amosRequestContext;
this.aqzsdpStatisticsService = aqzsdpStatisticsService;
}
@Override
......@@ -34,5 +38,6 @@ public class DataInitAfterRuning implements ApplicationRunner {
RequestContext.setToken(amosRequestContext.getToken());
jgdpStatisticsService.init();
stCommonService.init();
aqzsdpStatisticsService.init();
}
}
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import cn.hutool.core.date.DateUtil;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.biz.common.dto.KeyValueDto;
import com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.enums.IssueMainBodyEnum;
import com.yeejoin.amos.boot.module.common.api.enums.IssueTypeEnum;
import com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.DPMapStatisticsItemEnum;
import com.yeejoin.amos.boot.module.statistics.api.dto.EquipQuestionNumCountDto;
import com.yeejoin.amos.boot.module.statistics.api.dto.SecurityIndexCountItemDto;
import com.yeejoin.amos.boot.module.statistics.api.mapper.AQZSDPStatisticsMapper;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.statistics.api.mapper.CylinderStatisticsMapper;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.service.ITzBaseEnterpriseInfoService;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipTechParamPipelineMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
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.apache.commons.lang3.StringUtils;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.core.CountRequest;
import org.elasticsearch.client.core.CountResponse;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
......@@ -39,6 +53,8 @@ import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
......@@ -54,18 +70,107 @@ public class AQZSDPStatisticsServiceImpl {
private final static String NO_DATA_STR = "--";
@Autowired
RestHighLevelClient restHighLevelClient;
/**
* 压力容器设备种类
*/
private final static String EQU_LIST_CYLINDER = "2000";
/**
* 气瓶设备类别
*/
private final static String EQU_CATEGORY_CYLINDER = "2300";
/**
* 单位类型-使用单位
*/
private final static String COMPANY_TYPE_USE = "使用单位";
/**
* 单位类型-安装改造维修单位
*/
private final static String COMPANY_TYPE_MAINTENANCE = "安装改造维修单位";
/**
* 单位类型-制造单位
*/
private final static String COMPANY_TYPE_MANUFACTURE = "制造单位";
/**
* 单位类型-充装单位
*/
private final static String COMPANY_TYPE_FILLING = "充装单位";
/**
* 监管-中屏-地图行政区划code
*/
private final static String REGION_CODE = "regionCode";
/**
* 监管-中屏-地图行政区划code
*/
private final static String REGION_NAME = "regionName";
private static List<EquipmentCategoryDto> equipmentCategoryDtos;
private static List<RegionModel> regionModels = new ArrayList<>();
private static Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
@Resource
private RestHighLevelClient restHighLevelClient;
private AQZSDPStatisticsMapper statisticsMapper;
@Autowired
private EquipmentCategoryMapper equipmentCategoryMapper;
@Autowired
private EquipTechParamPipelineMapper techParamsPipelineMapper;
@Autowired
private TzBaseEnterpriseInfoMapper enterpriseInfoMapper;
@Autowired
private TzsUserInfoMapper userInfoMapper;
public void init() {
// 数据不变所以放到内存,提高响应时间
equipmentCategoryDtos = equipmentCategoryMapper.selectClassify();
initReginCode();
}
private void initReginCode() {
Collection<RegionModel> result = Systemctl.regionClient.queryForTree(null).getResult();
result.forEach(r -> {
regionModels.add(r);
this.loopSetChildRegin(regionModels, r.getChildren());
});
}
private void loopSetChildRegin(List<RegionModel> regionModels, Collection<RegionModel> children) {
if (children != null && children.size() > 0) {
children.forEach(c -> {
regionModels.add(c);
this.loopSetChildRegin(regionModels, c.getChildren());
});
}
}
private CylinderStatisticsMapper cylinderStatisticsMapper;
private StCommonServiceImpl stCommonService;
public AQZSDPStatisticsServiceImpl(RestHighLevelClient restHighLevelClient, AQZSDPStatisticsMapper statisticsMapper, CylinderStatisticsMapper cylinderStatisticsMapper, StCommonServiceImpl stCommonService) {
this.restHighLevelClient = restHighLevelClient;
this.statisticsMapper = statisticsMapper;
this.cylinderStatisticsMapper = cylinderStatisticsMapper;
this.stCommonService = stCommonService;
}
private String getLicenseEfficiencyByRegion(String regionCode) {
List<KeyValueDto> keyValueDtos = statisticsMapper.queryLicenseEfficiencyOfRegion(regionCode);
private String getLicenseEfficiencyByRegion(String orgCode) {
List<KeyValueDto> keyValueDtos = statisticsMapper.queryLicenseEfficiencyOfRegion(orgCode);
int totalUnitNumber = keyValueDtos.stream().mapToInt(KeyValueDto::getIValue).sum();
int okUnitNumberNumber = keyValueDtos.stream().filter(k -> k.getStrKey().equals(LICENSE_IS_OK)).mapToInt(KeyValueDto::getIValue).sum();
if (totalUnitNumber == 0) {
......@@ -79,7 +184,6 @@ public class AQZSDPStatisticsServiceImpl {
private long searchEsCount(Boolean checkOk, Boolean resultOk, String regionCode, String appId) {
CountRequest countRequest = new CountRequest("cylinder_filling");
// countRequest.indices("cylinder_filling");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
if (checkOk) {
//匹配充装前检查和充装后检查都有数据
......@@ -119,7 +223,7 @@ public class AQZSDPStatisticsServiceImpl {
}
public Map<String, Object> getChildEarlyWarning(String regionCode) throws Exception {
List<RegionModel> regionModels = this.setRegionIfRootParent(regionCode);
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(regionCode);
List<String> collect = regionModels.stream().map(c -> c.getRegionCode().toString()).collect(Collectors.toList());
List<CompanyModel> companyModelList = Privilege.companyClient.queryListByCompanyCode(Strings.join(collect, ",")).getResult();
Map<String, CompanyModel> companyMap = companyModelList.stream().collect(Collectors.toMap(CompanyModel::getCompanyCode, c -> c));
......@@ -161,15 +265,6 @@ public class AQZSDPStatisticsServiceImpl {
xuke.add(String.format("%.4f", Double.parseDouble(value) / 100.0000));
}
}
if (!ValidationUtil.isEmpty(orgCode) && !isHavingUnitInRegion) {
shiyongdengji.add("0");
jianyanchaoqi.add("0");
jianyanhege.add("0");
shiyongdengji.add("0");
czjc.add("0");
czjchege.add("0");
continue;
}
// 2.使用登记办理率
shiyongdengji.add("1");
// 3.检验超期率
......@@ -206,113 +301,31 @@ public class AQZSDPStatisticsServiceImpl {
return result;
}
private List<RegionModel> setRegionIfRootParent(String regionCode) throws Exception {
List<RegionModel> regionList = Systemctl.regionClient.queryByParentRegionCode(Integer.parseInt(regionCode)).getResult();
// 陕西省时需要在地图返回独立的地级市:韩城、杨凌、西咸
if (regionCode.equals(TZSCommonConstant.SHAN_XI_REGION_CODE)) {
List<RegionModel> independentRegions = ReginStepEnum.enum2RegionList("map");
regionList.addAll(independentRegions);
}
return regionList;
}
public Map<String, Object> getSecurityIndex(String regionCode) throws Exception {
List<RegionModel> regionModels = this.setRegionIfRootParent(regionCode);
List<String> collect = regionModels.stream().map(c -> c.getRegionCode().toString()).collect(Collectors.toList());
List<CompanyModel> companyModelList = Privilege.companyClient.queryListByCompanyCode(Strings.join(collect, ",")).getResult();
Map<String, CompanyModel> companyMap = companyModelList.stream().collect(Collectors.toMap(CompanyModel::getCompanyCode, c -> c));
List<String> xdata = new ArrayList<>();
List<String> xuke = new ArrayList<>();
List<String> shiyongdengji = new ArrayList<>();
List<String> jianyanchaoqi = new ArrayList<>();
List<String> jianyanhege = new ArrayList<>();
List<String> czjc = new ArrayList<>();
List<String> czjchege = new ArrayList<>();
for (RegionModel region : regionModels) {
CompanyModel companyModel = companyMap.get(region.getRegionCode().toString());
if (ObjectUtils.isEmpty(companyModel)) {
continue;
}
// 是否有充装企业在指定区域下
Boolean isHavingUnitInRegion = true;
String orgCode = companyModel.getOrgCode();
xdata.add(region.getRegionName());
// 1.许可有效率
if (!ValidationUtil.isEmpty(companyModel)) {
String value = this.getLicenseEfficiencyByRegion(orgCode);
if (NO_DATA_STR.equals(value)) {
value = "0";
xuke.add(value);
} else {
xuke.add(value);
}
}
if (!ValidationUtil.isEmpty(orgCode) && !isHavingUnitInRegion) {
shiyongdengji.add("0");
jianyanchaoqi.add("0");
jianyanhege.add("0");
shiyongdengji.add("0");
czjc.add("0");
czjchege.add("0");
continue;
}
// 2.使用登记办理率
shiyongdengji.add("100");
// 3.检验超期率
jianyanchaoqi.add(statisticsMapper.getInspectionExpiredRate(orgCode, null).get("expiredRate").toString());
// 4.检验合格率
jianyanhege.add(statisticsMapper.getInspectionResultRate(orgCode, null).get("resultRate").toString());
// 5.充装检查率
long totalAll = searchEsCount(false, false, orgCode, null);
long totalCheck = searchEsCount(true, false, orgCode, null);
long totalResult = searchEsCount(false, true, orgCode, null);
if (totalAll != 0) {
czjc.add(new DecimalFormat("#.00").format(((double) totalCheck / totalAll) * 100));
} else {
czjc.add("0");
}
// 6.充装检查合格率
if (totalAll != 0) {
czjchege.add(new DecimalFormat("#.00").format(((double) totalResult / totalAll) * 100));
} else {
czjchege.add("0");
}
}
Map<String, Object> result = new HashMap<>();
public Map<String, Object> getSecurityIndex(DPFilterParamDto dpFilterParamDto) throws Exception {
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamDto.getCityCode());
Map<String, SecurityIndexCountItemDto> regionCodeSecurityIndexMap = getSecurityIndexCountItemDtoMap(regionModels);
List<Map<String, String>> data = new ArrayList<>();
// List<String> ydata = new ArrayList<>();
for (int i = 0; i < xdata.size(); i++) {
List<Map<String, String>> finalData = data;
regionCodeSecurityIndexMap.forEach((k, v) -> {
Map<String, String> item = new HashMap<>();
item.put("name", xdata.get(i));
item.put("name", v.getRegionName());
// 计算xuke的加权值
double xukeWeighted = Double.parseDouble(xuke.get(i)) * 0.10; // 10%
double xukeWeighted = Double.parseDouble(v.getXuke()) * 0.10;
// 剩余权重平均分配给四个因素,每个因素大约22.5%(但为了简化,我们这里用25%的剩余权重)
double remainingWeightPerFactor = 0.90 / 4; // 简化为每个因素25%的剩余权重
double remainingWeightPerFactor = 0.90 / 4;
// 计算其他四个因素的加权值
double jianyanchaoqiWeighted = Double.parseDouble(jianyanchaoqi.get(i)) * remainingWeightPerFactor;
double jianyanhegeWeighted = Double.parseDouble(jianyanhege.get(i)) * remainingWeightPerFactor;
double czjcWeighted = Double.parseDouble(czjc.get(i)) * remainingWeightPerFactor;
double czjchegeWeighted = Double.parseDouble(czjchege.get(i)) * remainingWeightPerFactor;
double jianyanchaoqiWeighted = Double.parseDouble(v.getJianyanchaoqi()) * remainingWeightPerFactor;
double jianyanhegeWeighted = Double.parseDouble(v.getJianyanhege()) * remainingWeightPerFactor;
double czjcWeighted = Double.parseDouble(v.getCzjc()) * remainingWeightPerFactor;
double czjchegeWeighted = Double.parseDouble(v.getCzjchege()) * remainingWeightPerFactor;
// 计算总指数
double totalIndex = xukeWeighted + jianyanchaoqiWeighted + jianyanhegeWeighted + czjcWeighted + czjchegeWeighted;
item.put("value", String.format("%.2f", totalIndex));
data.add(item);
// ydata.add(String.format("%.2f", totalIndex));
}
data = data.stream()
.filter(map -> map.containsKey("value")) // 确保每个Map都包含指定的键
finalData.add(item);
});
data = finalData.stream()
.filter(map -> map.containsKey("value"))
.sorted(Comparator.comparingDouble(map -> {
// 检查并解析值,如果失败则返回Double.MIN_VALUE(或根据需要处理)
try {
......@@ -324,22 +337,88 @@ public class AQZSDPStatisticsServiceImpl {
}
}))
.collect(Collectors.toList());
Map<String, Object> result = new HashMap<>();
List<String> name = data.stream().map(map -> map.get("name")).collect(Collectors.toList());
Collections.reverse(name);
result.put("xdata", name);
List<String> value = data.stream().map(map -> map.get("value")).collect(Collectors.toList());
Collections.reverse(value);
result.put("ydata", value);
return result;
}
private Map<String, SecurityIndexCountItemDto> getSecurityIndexCountItemDtoMap(List<RegionModel> regionModels) {
List<SecurityIndexCountItemDto> countItemDtoList = getSecurityIndexCountDtoList(regionModels);
return countItemDtoList.stream().collect(Collectors.toMap(SecurityIndexCountItemDto::getRegionCode, Function.identity(), (k1, k2) -> k2));
}
private List<SecurityIndexCountItemDto> getSecurityIndexCountDtoList(List<RegionModel> regionModels) {
return regionModels.parallelStream().map(r -> {
String orgCode = stCommonService.getAndSetOrgCode(r.getRegionCode().toString());
SecurityIndexCountItemDto countItemDto = new SecurityIndexCountItemDto();
countItemDto.setRegionCode(r.getRegionCode().toString());
countItemDto.setRegionName(r.getRegionName());
if (ObjectUtils.isEmpty(orgCode)) {
this.setDefaultZeroData(countItemDto);
} else {
// 1.许可有效率
String value = this.getLicenseEfficiencyByRegion(orgCode);
if (NO_DATA_STR.equals(value)) {
value = "0";
countItemDto.setXuke(value);
} else {
countItemDto.setXuke(value);
}
// 2.使用登记办理率
countItemDto.setShiyongdengji(cylinderStatisticsMapper.queryUserRegisterCertAppPercent(orgCode));
// 3.检验超期率
countItemDto.setJianyanchaoqi(statisticsMapper.getInspectionExpiredRate(orgCode, null).get("expiredRate").toString());
// 4.检验合格率
countItemDto.setJianyanhege(statisticsMapper.getInspectionResultRate(orgCode, null).get("resultRate").toString());
// 5.充装检查率
long totalAll = searchEsCount(false, false, orgCode, null);
long totalCheck = searchEsCount(true, false, orgCode, null);
long totalResult = searchEsCount(false, true, orgCode, null);
if (totalAll != 0) {
countItemDto.setCzjc(new DecimalFormat("#.00").format(((double) totalCheck / totalAll) * 100));
} else {
countItemDto.setCzjc("0");
}
// 6.充装检查合格率
if (totalAll != 0) {
countItemDto.setCzjchege(new DecimalFormat("#.00").format(((double) totalResult / totalAll) * 100));
} else {
countItemDto.setCzjchege("0");
}
}
return countItemDto;
}).collect(Collectors.toList());
}
private void setDefaultZeroData(SecurityIndexCountItemDto countItemDto) {
countItemDto.setXuke("0");
countItemDto.setShiyongdengji("0");
countItemDto.setJianyanhege("0");
countItemDto.setCzjc("0");
countItemDto.setCzjchege("0");
countItemDto.setJianyanchaoqi("0");
}
private void setDefaultZeroData(List<String> xuke, List<String> shiyongdengji, List<String> jianyanchaoqi, List<String> jianyanhege, List<String> czjc, List<String> czjchege) {
xuke.add("0");
shiyongdengji.add("0");
jianyanchaoqi.add("0");
jianyanhege.add("0");
czjc.add("0");
czjchege.add("0");
}
public Map<String, Object> mainBodyCount(String cityCode) {
Map<String, Object> resultMap = new HashMap<>();
Map<String, Object> dataMap = new HashMap<>();
String startDate = LocalDate.now().minusDays(100).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<String> mainBodyNameList = IssueMainBodyEnum.getEnumNameList();
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndMainBody(orgCode, mainBodyNameList, startDate, null);
List<Object> legendDataList = new ArrayList<>();
for (int i = 0; i < 2; i++) {
......@@ -384,23 +463,13 @@ public class AQZSDPStatisticsServiceImpl {
return resultMap;
}
private String getAndSetOrgCode(String cityCode) {
String orgCode = regionCodeOrgCodeMap.get(cityCode);
if (orgCode == null) {
orgCode = statisticsMapper.getOrgCodeByCompanyCode(cityCode);
if (orgCode != null) {
regionCodeOrgCodeMap.put(cityCode, orgCode);
}
}
return orgCode;
}
public Map<String, Object> equipmentCount(String cityCode) {
Map<String, Object> resultMap = new HashMap<>();
Map<String, Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("3");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.EQUIPMENT.getName(), null);
......@@ -419,7 +488,7 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> companyCount(String cityCode) {
List<Map<String, Object>> resultList = new ArrayList<>();
Map<String, Object> dataMap = new HashMap<>();
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("2");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.COMPANY.getName(), null);
......@@ -451,7 +520,7 @@ public class AQZSDPStatisticsServiceImpl {
Map<String, Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("1");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.PERSON.getName(), null);
......@@ -472,7 +541,7 @@ public class AQZSDPStatisticsServiceImpl {
Map<String, Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("4");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.EQUIPMENT.getName(), "2300");
......@@ -503,7 +572,7 @@ public class AQZSDPStatisticsServiceImpl {
legendData.add(map);
}
resultMap.put("legendData", legendData);
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
int year = LocalDate.now().getYear();
List<Map<String, Object>> allIssue = statisticsMapper.getIssueCountByMonth(orgCode, String.valueOf(year), null);
List<Map<String, Object>> endIssue = statisticsMapper.getIssueCountByMonth(orgCode, String.valueOf(year), "1");
......@@ -557,7 +626,7 @@ public class AQZSDPStatisticsServiceImpl {
legendData.add(map);
}
resultMap.put("legendData", legendData);
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String year = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String, Object>> allIssue = statisticsMapper.getIssueCountByDate(orgCode, year, null);
List<Map<String, Object>> endIssue = statisticsMapper.getIssueCountByDate(orgCode, year, "1");
......@@ -597,7 +666,7 @@ public class AQZSDPStatisticsServiceImpl {
}
public Map<String, Object> issueCountByCityCode(String cityCode) {
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String now = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
int count = statisticsMapper.countByOrgCode(orgCode, now);
Map<String, Object> resultMap = new HashMap<>();
......@@ -607,7 +676,7 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> issueChildrenCityCount(String cityCode) throws Exception {
List<RegionModel> regionModels = setRegionIfRootParent(cityCode);
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(cityCode);
List<Integer> regionCodeList = regionModels.stream().map(m -> m.getRegionCode()).collect(Collectors.toList());
List<Map<String, String>> orgCodeAndCompanyCodesByCompanyCodes = statisticsMapper.getOrgCodeAndCompanyCodesByCompanyCodes(regionCodeList);
List<String> orgCodes = orgCodeAndCompanyCodesByCompanyCodes.stream().map(m -> m.get("orgCode")).collect(Collectors.toList());
......@@ -645,7 +714,7 @@ public class AQZSDPStatisticsServiceImpl {
}
public List<Map<String, Object>> issueMonthList(String cityCode) {
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
List<Map<String, Object>> list = statisticsMapper.issueMonthList(orgCode, time);
return list;
......@@ -653,7 +722,7 @@ public class AQZSDPStatisticsServiceImpl {
public Map<String, Object> issueProblemLevelCount(String cityCode) {
Map<String, Object> resultMap = new HashMap<>();
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy"));
List<Map<String, Object>> list = statisticsMapper.issueProblemLevelCount(orgCode, time);
List<Object> xdata = new ArrayList<>();
......@@ -669,7 +738,7 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> issueCompanyTop(String cityCode) {
List<Map<String, Object>> resultList = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
String time = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy"));
List<Map<String, Object>> list = statisticsMapper.issueCompanyTop(orgCode, time);
for (int i = 0; i < list.size(); i++) {
......@@ -684,8 +753,8 @@ public class AQZSDPStatisticsServiceImpl {
}
public List<Map<String, Object>> issueChildrenCityCountTop(String cityCode) throws Exception {
List<RegionModel> regionModels = setRegionIfRootParent(cityCode);
List<Integer> regionCodeList = regionModels.stream().map(m -> m.getRegionCode()).collect(Collectors.toList());
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(cityCode);
List<Integer> regionCodeList = regionModels.stream().map(RegionModel::getRegionCode).collect(Collectors.toList());
List<Map<String, String>> orgCodeAndCompanyCodesByCompanyCodes = statisticsMapper.getOrgCodeAndCompanyCodesByCompanyCodes(regionCodeList);
List<String> orgCodes = orgCodeAndCompanyCodesByCompanyCodes.stream().map(m -> m.get("orgCode")).collect(Collectors.toList());
String now = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy"));
......@@ -745,11 +814,11 @@ public class AQZSDPStatisticsServiceImpl {
}
public List<Map<String, Object>> issueCountTopByProblemType(String cityCode) {
String orgCode = getAndSetOrgCode(cityCode);
String orgCode = stCommonService.getAndSetOrgCode(cityCode);
List<Map<String, Object>> allList = statisticsMapper.issueCountTopByProblemType(orgCode, null);
List<Map<String, Object>> endList = statisticsMapper.issueCountTopByProblemType(orgCode, "1");
Map<String, Object> endIssuedataMap = new HashMap<>();
endList.stream().forEach(t -> {
endList.forEach(t -> {
endIssuedataMap.put(t.get("problemTypeCode").toString(), t.get("count"));
});
List<Map<String, Object>> resultList = new ArrayList<>();
......@@ -768,7 +837,7 @@ public class AQZSDPStatisticsServiceImpl {
public List<Map<String, Object>> getEquipQuestionList(DPFilterParamDto dpFilterParamDto) {
this.setDefaultFilter(dpFilterParamDto);
String orgCode = this.getAndSetOrgCode(dpFilterParamDto.getCityCode());
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if (StringUtils.isEmpty(orgCode)) {
return new ArrayList<>();
}
......@@ -830,5 +899,193 @@ public class AQZSDPStatisticsServiceImpl {
dpFilterParamDto.setEndDate(DateUtil.today());
}
}
public Map<String, Object> getCenterMapCountDataForGlobal(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if (StringUtils.isEmpty(orgCode)) {
return new HashMap<>();
}
// 1.气瓶数量统计
long cylinderNum = this.staticsCenterMapCountDataForCylinder(result, orgCode);
//1.8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
this.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
//2.压力管道长度统计
this.staticsCenterMapCountDataForPipeline(result, orgCode);
//3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode);
//4.人员数量统计
this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto, orgCode);
//5.问题数统计
this.staticsCenterMapCountDataForIssue(result, orgCode);
return result;
}
private void staticsCenterMapCountDataForIssue(Map<String, Object> result, String orgCode) {
List<Map<String, Object>> list = statisticsMapper.selectByOrg(orgCode);
Map<String,Object> dataMap = new HashMap<>();
AtomicReference<Long> issueCount = new AtomicReference<>(0L);
list.stream().forEach(t -> {
dataMap.put(t.get("sourceType").toString(), t.get("count"));
issueCount.updateAndGet(v -> v + Long.parseLong(t.get("count").toString()));
});
result.put("issueCount", issueCount.get());
result.put("deviceIssueCount", dataMap.getOrDefault(DPMapStatisticsItemEnum.EQU_ISSUES_COUNT,0L));
result.put("companyIssueCount", dataMap.getOrDefault(DPMapStatisticsItemEnum.COMPANY_ISSUES_COUNT,0L));
result.put("personIssueCount", dataMap.getOrDefault(DPMapStatisticsItemEnum.PERSON_ISSUES_COUNT,0L));
}
private long staticsCenterMapCountDataForCylinder(Map<String, Object> result, String orgCode) {
long num = 0;
CountRequest request = new CountRequest();
request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 设备类别精确查询气瓶
boolMust.must(QueryBuilders.termsQuery("EQU_CATEGORY_CODE", EQU_CATEGORY_CYLINDER));
// 且在用状态设备
boolMust.must(QueryBuilders.termQuery("EQU_STATE", EquimentEnum.ZAIYONG.getCode()));
request.query(boolMust);
try {
CountResponse response = restHighLevelClient.count(request, RequestOptions.DEFAULT);
num = response.getCount();
} catch (IOException e) {
throw new RuntimeException(e);
}
result.put(DPMapStatisticsItemEnum.GAS.getCode(), num);
return num;
}
private void staticsCenterMapCountDataForEquip(Map<String, Object> result, long cylinderNum, String orgCode) {
SearchRequest request = new SearchRequest();
request.indices("idx_biz_view_jg_all");
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 且在用状态设备
boolMust.must(QueryBuilders.termQuery("EQU_STATE", EquimentEnum.ZAIYONG.getCode()));
SearchSourceBuilder builder = new SearchSourceBuilder();
builder.query(boolMust);
TermsAggregationBuilder aggregationBuilder = AggregationBuilders.terms("count_by_equ_list_code").field("EQU_LIST_CODE");
builder.aggregation(aggregationBuilder);
request.source(builder);
try {
SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT);
Terms terms = response.getAggregations().get("count_by_equ_list_code");
Map<String, Long> countMap = new HashMap<>();
for (Terms.Bucket bucket : terms.getBuckets()) {
// 压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
if (bucket.getKeyAsString().equals(EQU_LIST_CYLINDER)) {
countMap.put(bucket.getKeyAsString(), bucket.getDocCount() - cylinderNum);
} else {
countMap.put(bucket.getKeyAsString(), bucket.getDocCount());
}
}
// 按照8大类枚举,进行加工。目的:固定八大类防止没统计数据导致缺少分类、将设备种类的code换成前端定义的key
equipmentCategoryDtos.forEach(c -> {
result.put(this.castCategoryCode2WebCode(c.getCode()), countMap.getOrDefault(c.getCode(), 0L));
});
result.put(DPMapStatisticsItemEnum.TOTAL.getCode(), countMap.values().stream().mapToLong(e -> e).sum() + cylinderNum);
} catch (IOException e) {
throw new RuntimeException(e);
}
result.remove(DPMapStatisticsItemEnum.PRESSURE_PIPELINES.getCategory());
}
private String castCategoryCode2WebCode(String category) {
DPMapStatisticsItemEnum itemEnum = DPMapStatisticsItemEnum.getInstanceByCategory(category);
return itemEnum.getCode();
}
private void staticsCenterMapCountDataForPipeline(Map<String, Object> result, String orgCode) {
String length = techParamsPipelineMapper.sumPipeLengthByOrgCode(orgCode);
BigDecimal lengthDecimal = new BigDecimal(length);
if (lengthDecimal.compareTo(BigDecimal.ZERO) > 0) {
length = lengthDecimal.divide(new BigDecimal("1000"), 3, RoundingMode.HALF_UP).toPlainString();
}
result.put(DPMapStatisticsItemEnum.PRESSURE_PIPELINES.getCode(), length);
}
private void staticsCenterMapCountDataForCompany(Map<String, Object> result, String orgCode) {
if (orgCode == null) {
setDefaultCompanyCountData(result);
return;
}
List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCode(orgCode);
result.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE)).mapToInt(CountDto::getIntValue).sum());
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());
}
private void setDefaultCompanyCountData(Map<String, Object> m) {
m.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), 0);
m.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), 0);
m.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), 0);
m.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), 0);
}
private void staticsCenterMapCountDataForPerson(Map<String, Object> result, DPFilterParamDto dpFilterParamDto, String orgCode) {
if (orgCode == null) {
result.put(DPMapStatisticsItemEnum.OPERATORS.getCode(), 0);
return;
}
Long num = userInfoMapper.countUserByPostAndAreaCode(orgCode, "6552", dpFilterParamDto.getCityCode());
result.put(DPMapStatisticsItemEnum.OPERATORS.getCode(), num);
}
public List<Map<String, Object>> getCenterMapCountDataForOverview(DPFilterParamDto dpFilterParamDto) throws Exception {
List<RegionModel> regionModels = stCommonService.setRegionIfRootParent(dpFilterParamDto.getCityCode());
List<Map<String, Object>> result = regionModels.parallelStream().map(r -> {
DPFilterParamDto filterParamDto = new DPFilterParamDto();
filterParamDto.setCityCode(r.getRegionCode().toString());
Map<String, Object> itemResult = getCenterMapOverviewData(filterParamDto);
itemResult.put("regionCode", r.getRegionCode());
itemResult.put("regionName", r.getRegionName());
return itemResult;
}).collect(Collectors.toList());
this.setCompanyDataBatch(result);
return result;
}
private void setCompanyDataBatch(List<Map<String, Object>> result) {
List<CountDto> countDtos = enterpriseInfoMapper.countByUnitTypeAndOrgCodeNoParam();
result.forEach(m -> {
String cityCode = m.get("regionCode").toString();
String orgCode = regionCodeOrgCodeMap.get(cityCode);
if (orgCode != null) {
m.put(DPMapStatisticsItemEnum.USERS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_USE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
m.put(DPMapStatisticsItemEnum.CONSTRUCTION_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MAINTENANCE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
m.put(DPMapStatisticsItemEnum.MANUFACTURING_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_MANUFACTURE) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
m.put(DPMapStatisticsItemEnum.GAS_UNITS.getCode(), countDtos.stream().filter(c -> c.getKeyStr().contains(COMPANY_TYPE_FILLING) && c.getLabel().contains(orgCode)).mapToInt(CountDto::getIntValue).sum());
} else {
setDefaultCompanyCountData(m);
}
});
}
private Map<String, Object> getCenterMapOverviewData(DPFilterParamDto dpFilterParamDto) {
Map<String, Object> result = new HashMap<>();
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if (StringUtils.isEmpty(orgCode)) {
return new HashMap<>();
}
// 0. 气瓶数量统计
long cylinderNum = this.staticsCenterMapCountDataForCylinder(result, orgCode);
// 1. 8大类设备数量统计,压力容器里包括气瓶所以需要特殊处理,在统计压力容器时去掉气瓶的数量
this.staticsCenterMapCountDataForEquip(result, cylinderNum, orgCode);
// 2. 压力管道长度统计
this.staticsCenterMapCountDataForPipeline(result, orgCode);
// 3.单位数量统计
this.staticsCenterMapCountDataForCompany(result, orgCode);
// 4. 人员数量统计
this.staticsCenterMapCountDataForPerson(result, dpFilterParamDto, orgCode);
// 5.问题统计
this.staticsCenterMapCountDataForIssue(result, orgCode);
return result;
}
}
\ No newline at end of file
......@@ -165,6 +165,10 @@ public class DPSubServiceImpl {
public JSONObject buildContentKeyinfoData(JSONObject tab, JSONObject content, Object apiResult){
JSONObject result = JSONObject.parseObject(apiResult.toString());
if (tab.getString("template").contains("emergency")){
content.put("keyinfo", result);
return content;
}
JSONObject param = tab.getJSONObject("param");
Object keyParams = JsonValueUtils.getValueByKey(content, "keyinfo", "keyinfo.keyParams");
if (ValidationUtil.isEmpty(keyParams)){
......@@ -190,9 +194,10 @@ public class DPSubServiceImpl {
((JSONArray) keyParams).stream().forEach(x -> {
JSONObject xobj = (JSONObject) x;
xobj.put("type", "text");
xobj.put("value", result.get(xobj.getString("key")));
xobj.put("value", "param".equals(xobj.getString("source")) ? param.get(xobj.getString("key")) : result.get(xobj.getString("key")));
});
this.processQRCodeWidget(content.getJSONObject("keyinfo").getJSONObject("qrcode"), result);
this.processQRCodeWidget(content.getJSONObject("keyinfo").getJSONObject("qrcode"), result);
if (tab.getString("template").contains("equip")){
// 处理问题列表
......
......@@ -8,7 +8,10 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/jczs/baseEnterprise/{sequenceNbr}"
"apiPath":"/tcm/baseEnterprise/getInfoByUseCode/map",
"params": {
"useCode": "{useUnitCode}"
}
}
}
},
......@@ -71,9 +74,15 @@
],
"content": {
"keyinfo": {
"status": [],
"status": [
{ "key": "unitType", "label": "", "icon": "", "value": "success" },
{ "key": "2", "label": "", "icon": "", "value": "success" },
{ "key": "3", "label": "否", "icon": "", "value": "error" },
{ "key": "4", "label": "否", "icon": "", "value": "stop" }
],
"qrcode": {
"title": "监管码"
"title": "监管码",
"problem": []
},
"keyParams": [
{ "key": "unitType", "label": "单位类型" },
......
{
"tabs": [
{
"key": "keyinfo",
"displayName": "基本信息",
"renderType": "keyinfo",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/elevator/alert-called/detail/{id}"
}
}
}
],
"content": {
}
}
......@@ -8,7 +8,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/ymt/equipment-category/getFormRecordById",
"apiPath":"/ymt/equipment-category/getFormRecordById/map",
"params": {
"alias": "{EQU_LIST_CODE}",
"id": "{SEQUENCE_NBR}"
......@@ -122,20 +122,21 @@
"keyinfo": {
"status": [],
"qrcode": {
"title": "监管码"
"title": "监管码",
"problem": []
},
"keyParams": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备种类" },
{ "key": "useUnitCode", "label": "设备类别" },
{ "key": "governingBody", "label": "设备品种" },
{ "key": "governingBody", "label": "单位内编号" },
{ "key": "governingBody", "label": "设备代码" },
{ "key": "governingBody", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_TYPE", "label": "设备种类", "source": "param" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "EQU_CATEGORY", "label": "设备品种", "source": "param" },
{ "key": "USE_INNER_CODE", "label": "单位内编号" },
{ "key": "PRODUCE_UNIT_CREDIT_CODE", "label": "设备代码" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"infoRecords": {
"title": "监管记录",
......
......@@ -8,7 +8,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/ymt/equipment-category/getFormRecordById",
"apiPath":"/ymt/equipment-category/getFormRecordById/map",
"params": {
"alias": "{EQU_LIST_CODE}",
"id": "{SEQUENCE_NBR}"
......@@ -126,43 +126,44 @@
"keyinfo": {
"status": [],
"qrcode": {
"title": "监管码"
"title": "监管码",
"problem": []
},
"keyParams_default": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备种类" },
{ "key": "useUnitCode", "label": "设备类别" },
{ "key": "governingBody", "label": "设备品种" },
{ "key": "governingBody", "label": "单位内编号" },
{ "key": "governingBody", "label": "设备代码" },
{ "key": "governingBody", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_TYPE", "label": "设备种类", "source": "param" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "EQU_CATEGORY", "label": "设备品种", "source": "param" },
{ "key": "USE_INNER_CODE", "label": "单位内编号" },
{ "key": "PRODUCE_UNIT_CREDIT_CODE", "label": "设备代码" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"keyParams_2300_true": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备类别" },
{ "key": "useUnitCode", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"keyParams_2300_false": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "使用单位地址" },
{ "key": "useUnit", "label": "车牌号" },
{ "key": "useUnitCode", "label": "车辆VIN码" },
{ "key": "useUnitCode", "label": "气瓶品种" },
{ "key": "useUnitCode", "label": "产品名称" },
{ "key": "useUnitCode", "label": "气瓶数量" },
{ "key": "useUnitCode", "label": "充装介质" },
{ "key": "useUnitCode", "label": "下次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "CAR_NUMBER", "label": "车牌号" },
{ "key": "IDENTIFICATION_CODE", "label": "车辆VIN码" },
{ "key": "EQU_TYPE", "label": "气瓶品种" },
{ "key": "PRODUCT_NAME", "label": "产品名称" },
{ "key": "GAS_NUM", "label": "气瓶数量" },
{ "key": "FILLING_MEDIUM", "label": "充装介质" },
{ "key": "NEXT_INSPECTION_DATE", "label": "下次检验日期" }
],
"infoRecords": {
"title": "监管记录",
......
......@@ -8,7 +8,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/ymt/equipment-category/getFormRecordById",
"apiPath":"/ymt/equipment-category/getFormRecordById/map",
"params": {
"alias": "{EQU_LIST_CODE}",
"id": "{SEQUENCE_NBR}"
......@@ -122,22 +122,23 @@
"keyinfo": {
"status": [],
"qrcode": {
"title": "监管码"
"title": "监管码",
"problem": []
},
"keyParams": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备种类" },
{ "key": "useUnitCode", "label": "设备类别" },
{ "key": "governingBody", "label": "设备品种" },
{ "key": "governingBody", "label": "单位内编号" },
{ "key": "governingBody", "label": "设备代码" },
{ "key": "governingBody", "label": "维保单位名称" },
{ "key": "governingBody", "label": "维保备案有效期" },
{ "key": "governingBody", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_TYPE", "label": "设备种类", "source": "param" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "EQU_CATEGORY", "label": "设备品种", "source": "param" },
{ "key": "USE_INNER_CODE", "label": "单位内编号" },
{ "key": "PRODUCE_UNIT_CREDIT_CODE", "label": "设备代码" },
{ "key": "ME_UNIT_NAME", "label": "维保单位名称" },
{ "key": "INFORM_END", "label": "维保备案有效期" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"infoRecords": {
"title": "监管记录",
......
......@@ -8,7 +8,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/ymt/equipment-category/getFormRecordById",
"apiPath":"/ymt/equipment-category/getFormRecordById/map",
"params": {
"alias": "{EQU_LIST_CODE}",
"id": "{SEQUENCE_NBR}"
......@@ -118,20 +118,21 @@
"keyinfo": {
"status": [],
"qrcode": {
"title": "监管码"
"title": "监管码",
"problem": []
},
"keyParams": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备种类" },
{ "key": "useUnitCode", "label": "设备类别" },
{ "key": "governingBody", "label": "设备品种" },
{ "key": "governingBody", "label": "单位内编号" },
{ "key": "governingBody", "label": "设备代码" },
{ "key": "governingBody", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_TYPE", "label": "设备种类", "source": "param" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "EQU_CATEGORY", "label": "设备品种", "source": "param" },
{ "key": "USE_INNER_CODE", "label": "单位内编号" },
{ "key": "PRODUCE_UNIT_CREDIT_CODE", "label": "设备代码" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"infoRecords": {
"title": "监管记录",
......
......@@ -8,7 +8,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/ymt/equipment-category/getFormRecordById",
"apiPath":"/ymt/equipment-category/getFormRecordById/map",
"params": {
"alias": "{EQU_LIST_CODE}",
"id": "{SEQUENCE_NBR}"
......@@ -114,20 +114,21 @@
"keyinfo": {
"status": [],
"qrcode": {
"title": "监管码"
"title": "监管码",
"problem": []
},
"keyParams": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备种类" },
{ "key": "useUnitCode", "label": "设备类别" },
{ "key": "governingBody", "label": "设备品种" },
{ "key": "governingBody", "label": "单位内编号" },
{ "key": "governingBody", "label": "设备代码" },
{ "key": "governingBody", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_TYPE", "label": "设备种类", "source": "param" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "EQU_CATEGORY", "label": "设备品种", "source": "param" },
{ "key": "USE_INNER_CODE", "label": "单位内编号" },
{ "key": "PRODUCE_UNIT_CREDIT_CODE", "label": "设备代码" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"infoRecords": {
"title": "监管记录",
......
......@@ -8,7 +8,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/ymt/equipment-category/getFormRecordById",
"apiPath":"/ymt/equipment-category/getFormRecordById/map",
"params": {
"alias": "{EQU_LIST_CODE}",
"id": "{SEQUENCE_NBR}"
......@@ -108,20 +108,21 @@
"keyinfo": {
"status": [],
"qrcode": {
"title": "监管码"
"title": "监管码",
"problem": []
},
"keyParams": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备种类" },
{ "key": "useUnitCode", "label": "设备类别" },
{ "key": "governingBody", "label": "设备品种" },
{ "key": "governingBody", "label": "单位内编号" },
{ "key": "governingBody", "label": "设备代码" },
{ "key": "governingBody", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_TYPE", "label": "设备种类", "source": "param" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "EQU_CATEGORY", "label": "设备品种", "source": "param" },
{ "key": "USE_INNER_CODE", "label": "单位内编号" },
{ "key": "PRODUCE_UNIT_CREDIT_CODE", "label": "设备代码" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"infoRecords": {
"title": "监管记录",
......
......@@ -8,7 +8,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/ymt/equipment-category/getFormRecordById",
"apiPath":"/ymt/equipment-category/getFormRecordById/map",
"params": {
"alias": "{EQU_LIST_CODE}",
"id": "{SEQUENCE_NBR}"
......@@ -114,29 +114,30 @@
"keyinfo": {
"status": [],
"qrcode": {
"title": "监管码"
"title": "监管码",
"problem": []
},
"keyParams_default": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备种类" },
{ "key": "useUnitCode", "label": "设备类别" },
{ "key": "governingBody", "label": "设备品种" },
{ "key": "governingBody", "label": "单位内编号" },
{ "key": "governingBody", "label": "设备代码" },
{ "key": "governingBody", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_TYPE", "label": "设备种类", "source": "param" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "EQU_CATEGORY", "label": "设备品种", "source": "param" },
{ "key": "USE_INNER_CODE", "label": "单位内编号" },
{ "key": "PRODUCE_UNIT_CREDIT_CODE", "label": "设备代码" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"keyParams_8300": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备类别" },
{ "key": "useUnitCode", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"infoRecords": {
"title": "监管记录",
......
......@@ -8,7 +8,7 @@
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/ymt/equipment-category/getFormRecordById",
"apiPath":"/ymt/equipment-category/getFormRecordById/map",
"params": {
"alias": "{EQU_LIST_CODE}",
"id": "{SEQUENCE_NBR}"
......@@ -114,20 +114,21 @@
"keyinfo": {
"status": [],
"qrcode": {
"title": "监管码"
"title": "监管码",
"problem": []
},
"keyParams": [
{ "key": "unitType", "label": "使用登记证编号" },
{ "key": "useUnit", "label": "登记机关" },
{ "key": "useUnitCode", "label": "登记日期" },
{ "key": "governingBody", "label": "使用单位名称" },
{ "key": "unitType", "label": "设备使用地点" },
{ "key": "useUnit", "label": "设备种类" },
{ "key": "useUnitCode", "label": "设备类别" },
{ "key": "governingBody", "label": "设备品种" },
{ "key": "governingBody", "label": "单位内编号" },
{ "key": "governingBody", "label": "设备代码" },
{ "key": "governingBody", "label": "下一次检验日期" }
{ "key": "USE_ORG_CODE", "label": "使用登记证编号" },
{ "key": "ORG_BRANCH_NAME", "label": "登记机关" },
{ "key": "REC_DATE", "label": "登记日期" },
{ "key": "USE_UNIT_NAME", "label": "使用单位名称" },
{ "key": "ADDRESS", "label": "设备使用地点" },
{ "key": "EQU_TYPE", "label": "设备种类", "source": "param" },
{ "key": "EQU_LIST", "label": "设备类别", "source": "param" },
{ "key": "EQU_CATEGORY", "label": "设备品种", "source": "param" },
{ "key": "USE_INNER_CODE", "label": "单位内编号" },
{ "key": "PRODUCE_UNIT_CREDIT_CODE", "label": "设备代码" },
{ "key": "NEXT_INSPECT_DATE", "label": "下一次检验日期" }
],
"infoRecords": {
"title": "监管记录",
......
......@@ -2,8 +2,9 @@ package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipTechParamPipeline;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface EquipTechParamPipelineMapper extends BaseMapper<EquipTechParamPipeline> {
/**
* 在用的最新需求整理的技术参数--需求未出
......
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.UseUnitCreditCodeCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
......@@ -19,6 +20,7 @@ import java.util.Map;
* @author system_generator
* @date 2021-10-20
*/
@Mapper
public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')")
......
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -17,6 +18,7 @@ import java.util.List;
* @author duanwei
* @date 2022-08-10
*/
@Mapper
public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseInfo> {
/**
......
......@@ -4,8 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
Page<TzsUserInfoDto> selectPageMessage(@Param("page") Page<TzsUserInfoDto> page, @Param("dto") TzsUserInfoDto dto);
......
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