Commit 66132b3a authored by 韩桐桐's avatar 韩桐桐

Merge branch 'refs/heads/develop_tzs_bugfix' into develop_tzs_register

parents 8c52aa8d 6c37dadb
...@@ -31,5 +31,13 @@ public class CommonVideoDto { ...@@ -31,5 +31,13 @@ public class CommonVideoDto {
@JsonIgnore @JsonIgnore
private String parent; private String parent;
/**
* 请判断播放端是否要求播放视频为H265编码格式,1表示需要,0表示不要求
*/
private Integer supportH265;
/**
* 视频清晰度,1-高清(主码流)、2-流畅(子码流)
*/
private Integer quality;
} }
...@@ -11,9 +11,12 @@ import java.util.Date; ...@@ -11,9 +11,12 @@ import java.util.Date;
@ApiModel(value="maintenanceRecordInfo", description="") @ApiModel(value="maintenanceRecordInfo", description="")
public class MaintenanceInfoModelForWX { public class MaintenanceInfoModelForWX {
@ApiModelProperty(value = "最近维保日期") @ApiModelProperty(value = "维保合同开始日期")
private Date informStart; private Date informStart;
@ApiModelProperty(value = "维保合同结束日期")
private Date informEnd;
@ApiModelProperty(value = "维保单位") @ApiModelProperty(value = "维保单位")
private String meUnitName; private String meUnitName;
......
...@@ -64,5 +64,6 @@ public class OtherInfo extends AbstractEquipBaseEntity { ...@@ -64,5 +64,6 @@ public class OtherInfo extends AbstractEquipBaseEntity {
@TableField(value ="\"SUPERVISORY_CODE\"") @TableField(value ="\"SUPERVISORY_CODE\"")
private String supervisoryCode; private String supervisoryCode;
@TableField(value ="\"STATUS\"")
private String status;
} }
...@@ -19,7 +19,6 @@ import com.yeejoin.amos.boot.module.app.api.dto.*; ...@@ -19,7 +19,6 @@ import com.yeejoin.amos.boot.module.app.api.dto.*;
import com.yeejoin.amos.boot.module.app.api.entity.*; import com.yeejoin.amos.boot.module.app.api.entity.*;
import com.yeejoin.amos.boot.module.app.api.enums.EquipmentCategoryEnum; import com.yeejoin.amos.boot.module.app.api.enums.EquipmentCategoryEnum;
import com.yeejoin.amos.boot.module.app.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.app.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.app.api.mapper.AppCommonMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.CategoryOtherInfoMapper; import com.yeejoin.amos.boot.module.app.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.app.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.app.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.app.biz.utils.HttpUtils; import com.yeejoin.amos.boot.module.app.biz.utils.HttpUtils;
...@@ -254,7 +253,7 @@ public class TzsAppService { ...@@ -254,7 +253,7 @@ public class TzsAppService {
otherJsonObject.put("tabValue", otherList); otherJsonObject.put("tabValue", otherList);
jsonArray.add(otherJsonObject); jsonArray.add(otherJsonObject);
map.put("tab", jsonArray); map.put("tab", jsonArray);
map.put("color", this.getQrCodeColor(record));
return map; return map;
} }
...@@ -409,9 +408,19 @@ public class TzsAppService { ...@@ -409,9 +408,19 @@ public class TzsAppService {
jsonArray.add(constructionJsonObject); jsonArray.add(constructionJsonObject);
map.put("tab", jsonArray); map.put("tab", jsonArray);
} }
map.put("color", this.getQrCodeColor(record));
return map; return map;
} }
private String getQrCodeColor(String record) {
// 二维码颜色赋值逻辑
OtherInfo otherInfo = otherInfoService.getOne(new LambdaQueryWrapper<OtherInfo>().eq(OtherInfo::getRecord, record));
if (otherInfo != null) {
return "0".equals(otherInfo.getStatus()) ? "#ff0000" : "#00ff00";
}
return "#f2f2f2";
}
public void getGroupList(HashMap putMap, String record, Class entity, Class dto, BaseService service, List list, boolean isOne, List<DataDictionary> dictionaryList, List<EquipmentCategory> equipmentCategories) { public void getGroupList(HashMap putMap, String record, Class entity, Class dto, BaseService service, List list, boolean isOne, List<DataDictionary> dictionaryList, List<EquipmentCategory> equipmentCategories) {
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""), entity); TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""), entity);
QueryWrapper wrapper = new QueryWrapper(); QueryWrapper wrapper = new QueryWrapper();
......
...@@ -26,10 +26,10 @@ public enum IssueTypeEnum { ...@@ -26,10 +26,10 @@ public enum IssueTypeEnum {
LICENSE_OVERDUE_COMPANY("许可超期","9","2"), LICENSE_OVERDUE_COMPANY("许可超期","9","2"),
//维保备案超期(公司) //维保备案超期(公司)
MAINTENANCE_RECORD_OVERDUE_COMPANY("维保备案超期","10","2"), MAINTENANCE_RECORD_OVERDUE_COMPANY("维保备案超期","10","2"),
//许可临期(个人) //资质临期(个人)
LICENSE_EXPIRY_PERSON("许可临期","11","1"), LICENSE_EXPIRY_PERSON("资质临期","11","1"),
//许可超期(个人) //资质超期(个人)
LICENSE_OVERDUE_PERSON("许可超期","12","1"), LICENSE_OVERDUE_PERSON("资质超期","12","1"),
//操作人员资质超期(气瓶) //操作人员资质超期(气瓶)
OPERATOR_QUALIFICATION_OVERDUE_CYLINDER("操作人员资质超期","13","4"), OPERATOR_QUALIFICATION_OVERDUE_CYLINDER("操作人员资质超期","13","4"),
//充装异常(气瓶) //充装异常(气瓶)
......
...@@ -64,6 +64,8 @@ public class BaseEnterpriseVideoServiceImpl extends BaseService<BaseEnterpriseVi ...@@ -64,6 +64,8 @@ public class BaseEnterpriseVideoServiceImpl extends BaseService<BaseEnterpriseVi
requestVideosInfo.put("deviceSerial", video.getDeviceSerial()); requestVideosInfo.put("deviceSerial", video.getDeviceSerial());
requestVideosInfo.put("channelNo", channelNo.getKey()); requestVideosInfo.put("channelNo", channelNo.getKey());
requestVideosInfo.put("protocol", video.getProtocol()); requestVideosInfo.put("protocol", video.getProtocol());
requestVideosInfo.put("quality", channelNo.getQuality());
requestVideosInfo.put("supportH265", channelNo.getSupportH265());
requestVideosInfo.put("expireTime", video.getExpireTime()); requestVideosInfo.put("expireTime", video.getExpireTime());
log.info("开始获取通道信息:{}", JSONObject.toJSONString(requestVideosInfo)); log.info("开始获取通道信息:{}", JSONObject.toJSONString(requestVideosInfo));
String videoData = HttpUtil.post(video.getUrl(), requestVideosInfo); String videoData = HttpUtil.post(video.getUrl(), requestVideosInfo);
...@@ -80,6 +82,8 @@ public class BaseEnterpriseVideoServiceImpl extends BaseService<BaseEnterpriseVi ...@@ -80,6 +82,8 @@ public class BaseEnterpriseVideoServiceImpl extends BaseService<BaseEnterpriseVi
commonVideoDto.setType(CommonVideoEnum.getEnum(video.getProtocol()).getName()); commonVideoDto.setType(CommonVideoEnum.getEnum(video.getProtocol()).getName());
commonVideoDto.setTitle(channelNo.getTitle()); commonVideoDto.setTitle(channelNo.getTitle());
commonVideoDto.setThumb(channelNo.getThumb()); commonVideoDto.setThumb(channelNo.getThumb());
commonVideoDto.setQuality(channelNo.getQuality());
commonVideoDto.setSupportH265(channelNo.getSupportH265());
result.add(commonVideoDto); result.add(commonVideoDto);
} else { } else {
String errorMsg = "code:" + codeVideo + "msg:" + msgVideo + "appKey:" + video.getAppKey() + "appSecret:" + video.getAppSecret() + "accessToken:" + accessToken; String errorMsg = "code:" + codeVideo + "msg:" + msgVideo + "appKey:" + video.getAppKey() + "appSecret:" + video.getAppSecret() + "accessToken:" + accessToken;
......
...@@ -62,7 +62,7 @@ public class DispatchTask extends BaseEntity { ...@@ -62,7 +62,7 @@ public class DispatchTask extends BaseEntity {
* 响应单位id * 响应单位id
*/ */
@TableField("response_org_id") @TableField("response_org_id")
private Long responseOrgId; private String responseOrgId;
/** /**
* 响应单位名称 * 响应单位名称
......
...@@ -62,7 +62,7 @@ public class DispatchTask extends BaseEntity { ...@@ -62,7 +62,7 @@ public class DispatchTask extends BaseEntity {
* 响应单位id * 响应单位id
*/ */
@TableField("response_org_id") @TableField("response_org_id")
private Long responseOrgId; private String responseOrgId;
/** /**
* 响应单位名称 * 响应单位名称
......
...@@ -6,7 +6,6 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; ...@@ -6,7 +6,6 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
/** /**
...@@ -258,17 +257,15 @@ public class JgTransferNotice extends BaseEntity { ...@@ -258,17 +257,15 @@ public class JgTransferNotice extends BaseEntity {
private String isXixian; private String isXixian;
/** /**
* * 设备使用地点-街道(镇) * 设备使用地点-街道(镇)
* */ */
@TableField(value = "factory_use_site_street")
@TableField(value ="\"factory_use_site_street\"")
private String factoryUseSiteStreet; private String factoryUseSiteStreet;
/** /**
* * 设备使用地点-街道(镇)-名称 * 设备使用地点-街道(镇)-名称
* */ */
@TableField(value = "street_name")
@TableField(value ="\"street_name\"")
private String streetName; private String streetName;
@TableField("county_name") @TableField("county_name")
...@@ -295,18 +292,16 @@ public class JgTransferNotice extends BaseEntity { ...@@ -295,18 +292,16 @@ public class JgTransferNotice extends BaseEntity {
@TableField(value = "handle_date") @TableField(value = "handle_date")
private Date handleDate; private Date handleDate;
@TableField(value = "\"create_user_company_name\"") @TableField(value = "create_user_company_name")
private String createUserCompanyName; private String createUserCompanyName;
//下一步任务ID //下一步任务ID
@TableField(value = "\"next_task_id\"") @TableField(value = "next_task_id")
private String nextTaskId; private String nextTaskId;
@TableField(exist = false) @TableField(exist = false)
private String supervisoryCode; private String supervisoryCode;
@TableField(value = "equ_category") @TableField(value = "equ_category")
private String equCategory; private String equCategory;
...@@ -318,7 +313,7 @@ public class JgTransferNotice extends BaseEntity { ...@@ -318,7 +313,7 @@ public class JgTransferNotice extends BaseEntity {
/** /**
* 下一节点可执行人 * 下一节点可执行人
*/ */
@TableField("\"next_execute_user_ids\"") @TableField("next_execute_user_ids")
private String nextExecuteUserIds; private String nextExecuteUserIds;
@TableField(exist = false) @TableField(exist = false)
...@@ -334,14 +329,12 @@ public class JgTransferNotice extends BaseEntity { ...@@ -334,14 +329,12 @@ public class JgTransferNotice extends BaseEntity {
// @TableField(value = "inform_number") // @TableField(value = "inform_number")
// private String informNumber; // private String informNumber;
/** /**
* 其他附件 * 其他附件
*/ */
@TableField(value = "other_accessories") @TableField(value = "other_accessories")
private String otherAccessories; private String otherAccessories;
/** /**
* 接收机构公司的org_code * 接收机构公司的org_code
*/ */
......
...@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName; ...@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import java.util.Date; import java.util.Date;
......
...@@ -183,5 +183,12 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> { ...@@ -183,5 +183,12 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
Page<Map<String,Object>> countBizFinishedNumForDPListDQJY(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto); Page<Map<String,Object>> countBizFinishedNumForDPListDQJY(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String,Object>> countBizFinishedNumForDPListBGDJ(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto); Page<Map<String,Object>> countBizFinishedNumForDPListBGDJ(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String,Object>> countBizFinishedNumForDPListZXBX(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto); Page<Map<String,Object>> countBizFinishedNumForDPListZXBX(@Param("page") Page<Map<String,Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
/**
* 当前设备在流程中的申请单号
* @param record 设备id
* @return 申请单号
*/
List<String> findEquipInUseService(@Param("record") String record);
} }
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.jg.api.mapper; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo; import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* Mapper 接口 * Mapper 接口
...@@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface JgResumeInfoMapper extends BaseMapper<JgResumeInfo> { public interface JgResumeInfoMapper extends BaseMapper<JgResumeInfo> {
void deleteBatchByBusinessId(@Param("idList") List<String> idList);
} }
...@@ -2,4 +2,10 @@ ...@@ -2,4 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.JgResumeInfoMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.JgResumeInfoMapper">
<delete id="deleteBatchByBusinessId">
delete from tzs_jg_resume_info where "business_id" in
<foreach collection="idList" separator="," item="id" open="(" close=");">
#{id}
</foreach>
</delete>
</mapper> </mapper>
...@@ -74,8 +74,12 @@ ...@@ -74,8 +74,12 @@
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode, ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
ui."USE_UNIT_NAME" useUnitName, ui."USE_UNIT_NAME" useUnitName,
(select name from tz_equipment_category where code = ri."EQU_LIST") equList, (select name from tz_equipment_category where code = ri."EQU_LIST") equList,
( SELECT NAME FROM tz_equipment_category WHERE code = ri."EQU_LIST" ) EQU_LIST,
ri.equ_list AS equListCode, ri.equ_list AS equListCode,
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategory, (select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategory,
( SELECT NAME FROM tz_equipment_category WHERE code = ri."EQU_CATEGORY" ) EQU_CATEGORY,
( SELECT NAME FROM tz_equipment_category WHERE code = ri."EQU_DEFINE" ) EQU_DEFINE,
ri.PRODUCT_NAME,
oi."CODE96333" code96333, oi."CODE96333" code96333,
oi."SUPERVISORY_CODE" supervisoryCode, oi."SUPERVISORY_CODE" supervisoryCode,
oi."STATUS" problemStatus, oi."STATUS" problemStatus,
......
...@@ -323,4 +323,16 @@ public class JgUseRegistrationManageController extends BaseController { ...@@ -323,4 +323,16 @@ public class JgUseRegistrationManageController extends BaseController {
return ResponseHelper.buildResponse("Redis初始化完成!"); return ResponseHelper.buildResponse("Redis初始化完成!");
} }
/**
* 根据sequenceNbr查询---大屏使用
*
* @param applyNo 申请单号
* @return s
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/handleErrorDeviceCode")
@ApiOperation(httpMethod = "GET", value = "根据applyNo查询证管理表", notes = "根据applyNo查询证管理表")
public ResponseModel<Object> handleErrorDeviceCode(@RequestParam(value = "applyNo") String applyNo) {
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.handleErrorDeviceCode(applyNo));
}
} }
...@@ -234,4 +234,20 @@ public class SafetyProblemTracingController extends BaseController { ...@@ -234,4 +234,20 @@ public class SafetyProblemTracingController extends BaseController {
safetyProblemTracingGenService.executeMaintenanceCheck(); safetyProblemTracingGenService.executeMaintenanceCheck();
return ResponseHelper.buildResponse("success"); return ResponseHelper.buildResponse("success");
} }
/**
* update3 -- 修复
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "修改维保超期脏数据 && 修改检验检测超期数据",
notes = "修改维保超期脏数据 && 修改检验检测超期数据")
@GetMapping(value = "/gen/update3")
public ResponseModel<String> update3() {
safetyProblemTracingGenService.update3MaintenanceCheck();
return ResponseHelper.buildResponse("success");
}
} }
package com.yeejoin.amos.boot.module.jg.biz.handler; package com.yeejoin.amos.boot.module.jg.biz.handler;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
...@@ -16,7 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -16,7 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Optional; import java.util.List;
import java.util.stream.Collectors;
/** /**
* WBCQEventHandler 类实现了 SafetyProblemEventHandler 接口, * WBCQEventHandler 类实现了 SafetyProblemEventHandler 接口,
...@@ -48,25 +49,25 @@ public class JYBJEventHandler implements SafetyProblemEventHandler { ...@@ -48,25 +49,25 @@ public class JYBJEventHandler implements SafetyProblemEventHandler {
@Override @Override
public void handle(SafetyProblemEvent event) { public void handle(SafetyProblemEvent event) {
// 此处为处理安全问题事件的逻辑代码 // 此处为处理安全问题事件的逻辑代码
handleInspectionRecord(JSON.parseObject(event.getMessage().toString())); JSONArray jsonArray = JSONObject.parseArray(event.getMessage().toString());
handleInspectionRecord(jsonArray);
} }
private void handleInspectionRecord(JSONObject jsonObject) { private void handleInspectionRecord(JSONArray jsonArray) {
String equipRecord = jsonObject.getString("record"); List<String> equipRecords = jsonArray.stream().map(obj -> JSONObject.parseObject(obj.toString()).getString("record")).collect(Collectors.toList());
if (!ValidationUtil.isEmpty(equipRecord)) { if (!ValidationUtil.isEmpty(equipRecords)) {
safetyProblemTracingService.lambdaUpdate() safetyProblemTracingService.lambdaUpdate()
.set(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.HANDLED.getCode()) .set(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.HANDLED.getCode())
.set(SafetyProblemTracing::getProblemStatus, SafetyProblemStatusEnum.HANDLED.getName()) .set(SafetyProblemTracing::getProblemStatus, SafetyProblemStatusEnum.HANDLED.getName())
.eq(SafetyProblemTracing::getSourceId, equipRecord) .in(SafetyProblemTracing::getSourceId, equipRecords)
.eq(SafetyProblemTracing::getProblemTypeCode, SafetyProblemTypeEnum.JYCQ.getCode()).update(); .eq(SafetyProblemTracing::getProblemTypeCode, SafetyProblemTypeEnum.JYCQ.getCode()).update();
idxBizJgOtherInfoService.lambdaUpdate().set(IdxBizJgOtherInfo::getStatus, SafetyProblemStatusEnum.HANDLED.getCode()) idxBizJgOtherInfoService.lambdaUpdate().set(IdxBizJgOtherInfo::getStatus, SafetyProblemStatusEnum.HANDLED.getCode())
.eq(IdxBizJgOtherInfo::getRecord, equipRecord).update(); .in(IdxBizJgOtherInfo::getRecord, equipRecords).update();
Optional<ESEquipmentCategoryDto> equipEsDto = esEquipmentCategory.findById(equipRecord); Iterable<ESEquipmentCategoryDto> equipEsDtoIter = esEquipmentCategory.findAllById(equipRecords);
if (equipEsDto.isPresent()) { for (ESEquipmentCategoryDto equipEsDto : equipEsDtoIter) {
ESEquipmentCategoryDto equipDto = equipEsDto.get(); equipEsDto.setProblemStatus(SafetyProblemStatusEnum.HANDLED.getCode());
equipDto.setProblemStatus(SafetyProblemStatusEnum.HANDLED.getCode());
esEquipmentCategory.save(equipDto);
} }
esEquipmentCategory.saveAll(equipEsDtoIter);
} }
} }
} }
......
package com.yeejoin.amos.boot.module.jg.biz.handler; package com.yeejoin.amos.boot.module.jg.biz.handler;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent; import com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent;
...@@ -32,12 +33,12 @@ public class JYCQEventHandler implements SafetyProblemEventHandler { ...@@ -32,12 +33,12 @@ public class JYCQEventHandler implements SafetyProblemEventHandler {
@Override @Override
public void handle(SafetyProblemEvent event) { public void handle(SafetyProblemEvent event) {
// 此处为处理安全问题事件的逻辑代码 // 此处为处理安全问题事件的逻辑代码
JSONObject jsonObject = JSONObject.parseObject(event.getMessage().toString()); JSONArray jsonArray = JSONObject.parseArray(event.getMessage().toString());
generateProblem(jsonObject); generateProblem(jsonArray);
} }
private void generateProblem(JSONObject jsonObject) { private void generateProblem(JSONArray jsonArray) {
SafetyProblemTopicMessage.generateProblem(jsonObject, SafetyProblemTypeEnum.JYCQ, safetyProblemTracingService); SafetyProblemTopicMessage.generateProblem(jsonArray, SafetyProblemTypeEnum.JYCQ, safetyProblemTracingService);
} }
} }
...@@ -23,7 +23,7 @@ public class SafetyProblemEventHandlerFactory { ...@@ -23,7 +23,7 @@ public class SafetyProblemEventHandlerFactory {
if (topic.startsWith(SafetyProblemTypeEnum.WBCQ.getTopic())) { if (topic.startsWith(SafetyProblemTypeEnum.WBCQ.getTopic())) {
return new WBCQEventHandler(safetyProblemTracingService); return new WBCQEventHandler(safetyProblemTracingService);
} else if (topic.startsWith(SafetyProblemTypeEnum.WBBA.getTopic())) { } else if (topic.startsWith(SafetyProblemTypeEnum.WBBA.getTopic())) {
return new WBBAEventHandler(); return new WBBAEventHandler(safetyProblemTracingService, idxBizJgOtherInfoService, esEquipmentCategory);
} else if (topic.startsWith(SafetyProblemTypeEnum.JYCQ.getTopic())) { } else if (topic.startsWith(SafetyProblemTypeEnum.JYCQ.getTopic())) {
return new JYCQEventHandler(safetyProblemTracingService); return new JYCQEventHandler(safetyProblemTracingService);
} else if (topic.startsWith(SafetyProblemTypeEnum.JYBJ.getTopic())) { } else if (topic.startsWith(SafetyProblemTypeEnum.JYBJ.getTopic())) {
......
package com.yeejoin.amos.boot.module.jg.biz.handler; package com.yeejoin.amos.boot.module.jg.biz.handler;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.entity.SafetyProblemTracing;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent; import com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent;
import com.yeejoin.amos.boot.module.jg.api.event.handler.SafetyProblemEventHandler; import com.yeejoin.amos.boot.module.jg.api.event.handler.SafetyProblemEventHandler;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.IdxBizJgOtherInfoServiceImpl;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.SafetyProblemTracingServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* WBBAEventHandler 类实现了 SafetyProblemEventHandler 接口, * WBBAEventHandler 类实现了 SafetyProblemEventHandler 接口,
...@@ -12,6 +26,19 @@ import org.springframework.stereotype.Component; ...@@ -12,6 +26,19 @@ import org.springframework.stereotype.Component;
@Component @Component
public class WBBAEventHandler implements SafetyProblemEventHandler { public class WBBAEventHandler implements SafetyProblemEventHandler {
SafetyProblemTracingServiceImpl safetyProblemTracingService;
IdxBizJgOtherInfoServiceImpl idxBizJgOtherInfoService;
ESEquipmentCategory esEquipmentCategory;
@Autowired
public WBBAEventHandler(SafetyProblemTracingServiceImpl safetyProblemTracingService, IdxBizJgOtherInfoServiceImpl idxBizJgOtherInfoService, ESEquipmentCategory esEquipmentCategory) {
this.safetyProblemTracingService = safetyProblemTracingService;
this.idxBizJgOtherInfoService = idxBizJgOtherInfoService;
this.esEquipmentCategory = esEquipmentCategory;
}
/** /**
* 处理安全问题事件。 * 处理安全问题事件。
* *
...@@ -21,11 +48,26 @@ public class WBBAEventHandler implements SafetyProblemEventHandler { ...@@ -21,11 +48,26 @@ public class WBBAEventHandler implements SafetyProblemEventHandler {
@Override @Override
public void handle(SafetyProblemEvent event) { public void handle(SafetyProblemEvent event) {
// 此处为处理安全问题事件的逻辑代码 // 此处为处理安全问题事件的逻辑代码
handleMaintenanceRecord(JSONObject.parseObject(event.getMessage().toString())); JSONArray jsonArray = JSONObject.parseArray(event.getMessage().toString());
handleMaintenanceRecord(jsonArray);
} }
private void handleMaintenanceRecord(JSONObject jsonObject) { private void handleMaintenanceRecord(JSONArray jsonArray) {
// JSONArray maintenanceRecords = JSONArray.parseArray(String.valueOf(jsonObject)); List<String> equipRecords = jsonArray.stream().map(obj -> JSONObject.parseObject(obj.toString()).getString("record")).collect(Collectors.toList());
if (!ValidationUtil.isEmpty(equipRecords)) {
safetyProblemTracingService.lambdaUpdate()
.set(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.HANDLED.getCode())
.set(SafetyProblemTracing::getProblemStatus, SafetyProblemStatusEnum.HANDLED.getName())
.in(SafetyProblemTracing::getSourceId, equipRecords)
.eq(SafetyProblemTracing::getProblemTypeCode, SafetyProblemTypeEnum.WBCQ.getCode()).update();
idxBizJgOtherInfoService.lambdaUpdate().set(IdxBizJgOtherInfo::getStatus, SafetyProblemStatusEnum.HANDLED.getCode())
.in(IdxBizJgOtherInfo::getRecord, equipRecords).update();
Iterable<ESEquipmentCategoryDto> equipEsDtoIter = esEquipmentCategory.findAllById(equipRecords);
for (ESEquipmentCategoryDto equipEsDto : equipEsDtoIter) {
equipEsDto.setProblemStatus(SafetyProblemStatusEnum.HANDLED.getCode());
}
esEquipmentCategory.saveAll(equipEsDtoIter);
}
} }
} }
package com.yeejoin.amos.boot.module.jg.biz.handler; package com.yeejoin.amos.boot.module.jg.biz.handler;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent; import com.yeejoin.amos.boot.module.jg.api.event.SafetyProblemEvent;
...@@ -32,12 +33,12 @@ public class WBCQEventHandler implements SafetyProblemEventHandler { ...@@ -32,12 +33,12 @@ public class WBCQEventHandler implements SafetyProblemEventHandler {
@Override @Override
public void handle(SafetyProblemEvent event) { public void handle(SafetyProblemEvent event) {
// 此处为处理安全问题事件的逻辑代码 // 此处为处理安全问题事件的逻辑代码
JSONObject jsonObject = JSONObject.parseObject(event.getMessage().toString()); JSONArray jsonArray = JSONObject.parseArray(event.getMessage().toString());
generateProblem(jsonObject); generateProblem(jsonArray);
} }
private void generateProblem(JSONObject jsonObject) { private void generateProblem(JSONArray jsonArray) {
SafetyProblemTopicMessage.generateProblem(jsonObject, SafetyProblemTypeEnum.WBCQ, safetyProblemTracingService); SafetyProblemTopicMessage.generateProblem(jsonArray, SafetyProblemTypeEnum.WBCQ, safetyProblemTracingService);
} }
} }
...@@ -81,7 +81,7 @@ public class SafetyProblemTopicMessage extends EmqxListener { ...@@ -81,7 +81,7 @@ public class SafetyProblemTopicMessage extends EmqxListener {
try { try {
while (true) { while (true) {
SafetyProblemEvent safetyProblemMessageEvent = blockingQueue.take(); SafetyProblemEvent safetyProblemMessageEvent = blockingQueue.take();
JSONObject jsonObject = JSON.parseObject(safetyProblemMessageEvent.getMessage().toString()); JSONArray jsonObject = JSON.parseArray(safetyProblemMessageEvent.getMessage().toString());
log.info("接收到问题生产消息:{}", jsonObject); log.info("接收到问题生产消息:{}", jsonObject);
SafetyProblemEventHandler eventHandler = SafetyProblemEventHandlerFactory.createProblemHandler(safetyProblemMessageEvent.getTopic()); SafetyProblemEventHandler eventHandler = SafetyProblemEventHandlerFactory.createProblemHandler(safetyProblemMessageEvent.getTopic());
eventHandler.handle(safetyProblemMessageEvent); eventHandler.handle(safetyProblemMessageEvent);
...@@ -103,13 +103,13 @@ public class SafetyProblemTopicMessage extends EmqxListener { ...@@ -103,13 +103,13 @@ public class SafetyProblemTopicMessage extends EmqxListener {
log.info("接收问题生产消息完成"); log.info("接收问题生产消息完成");
} }
public static void generateProblem(JSONObject jsonObject, SafetyProblemTypeEnum problemTypeEnum, SafetyProblemTracingServiceImpl safetyProblemTracingService) { public static void generateProblem(JSONArray jsonArray, SafetyProblemTypeEnum problemTypeEnum, SafetyProblemTracingServiceImpl safetyProblemTracingService) {
if (jsonObject == null || problemTypeEnum == null) { if (jsonArray == null || problemTypeEnum == null) {
throw new IllegalArgumentException("jsonObject and problemTypeEnum must not be null."); throw new IllegalArgumentException("jsonObject and problemTypeEnum must not be null.");
} }
JSONArray records = jsonObject.getJSONArray(problemTypeEnum.getMsgKey()); // JSONArray records = jsonObject.getJSONArray(problemTypeEnum.getMsgKey());
if (!ValidationUtil.isEmpty(records)) { if (!ValidationUtil.isEmpty(jsonArray)) {
List<SafetyProblemTracing> safetyProblemTracingList = records.stream().map(item -> { List<SafetyProblemTracing> safetyProblemTracingList = jsonArray.stream().map(item -> {
if (!(item instanceof JSONObject)) { if (!(item instanceof JSONObject)) {
throw new IllegalArgumentException("item is not a JSONObject."); throw new IllegalArgumentException("item is not a JSONObject.");
} }
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.yeejoin.amos.boot.module.jg.api.dto.FlowingEquipRedisKeyDTO; import com.yeejoin.amos.boot.module.jg.api.dto.FlowingEquipRedisKeyDTO;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck; import com.yeejoin.amos.boot.module.jg.api.service.IEquipUsedCheck;
import com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext; import com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RBucket; import org.redisson.api.RBucket;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -22,6 +23,8 @@ import java.util.stream.Collectors; ...@@ -22,6 +23,8 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public abstract class BaseEquipUsedCheckService implements IEquipUsedCheck { public abstract class BaseEquipUsedCheckService implements IEquipUsedCheck {
@Autowired
CommonMapper commonMapper;
/** /**
* 并发校验(页面同时提交或者页面同时打开多个时,某些设备都是为使用状态)校验设备流程在用状态及更新不在用为再使用状态 * 并发校验(页面同时提交或者页面同时打开多个时,某些设备都是为使用状态)校验设备流程在用状态及更新不在用为再使用状态
...@@ -40,8 +43,12 @@ public abstract class BaseEquipUsedCheckService implements IEquipUsedCheck { ...@@ -40,8 +43,12 @@ public abstract class BaseEquipUsedCheckService implements IEquipUsedCheck {
} }
RBucket<Set<String>> RBucket = getRedisClient().getBucket(this.getFlowingEquipRedisKey(companyCode, getApplyBizType())); RBucket<Set<String>> RBucket = getRedisClient().getBucket(this.getFlowingEquipRedisKey(companyCode, getApplyBizType()));
Set<String> equipListOfUsed = RBucket.get(); Set<String> equipListOfUsed = RBucket.get();
// 查询当前设备在流程中的申请单号列表
List<String> equipInUseList = commonMapper.findEquipInUseService(record);
if (equipListOfUsed != null && equipListOfUsed.contains(record)) { if (equipListOfUsed != null && equipListOfUsed.contains(record)) {
throw new BadRequest("设备已被其他流程使用,不允许重复提交!"); String joinedEquipInUse = String.join(",", equipInUseList);
log.error("设备已被其他流程使用,不允许重复提交,设备ID:{},在流程中申请单:{}", record, joinedEquipInUse);
throw new BadRequest("设备已被其他流程使用,不允许重复提交!,设备ID: " + record +" ,在流程中申请单:" + joinedEquipInUse + ",请联系管理员!");
} }
if (equipListOfUsed == null || equipListOfUsed.isEmpty()) { if (equipListOfUsed == null || equipListOfUsed.isEmpty()) {
equipListOfUsed = new TreeSet<>(); equipListOfUsed = new TreeSet<>();
...@@ -68,8 +75,12 @@ public abstract class BaseEquipUsedCheckService implements IEquipUsedCheck { ...@@ -68,8 +75,12 @@ public abstract class BaseEquipUsedCheckService implements IEquipUsedCheck {
} }
RBucket<Set<String>> RBucket = getRedisClient().getBucket(this.getFlowingEquipRedisKey(companyCode, getApplyBizType())); RBucket<Set<String>> RBucket = getRedisClient().getBucket(this.getFlowingEquipRedisKey(companyCode, getApplyBizType()));
Set<String> equipListOfUsed = RBucket.get(); Set<String> equipListOfUsed = RBucket.get();
// 查询当前设备在用的申请单号列表
List<String> equipInUseList = commonMapper.findEquipInUseService(record);
if (equipListOfUsed != null && equipListOfUsed.contains(record)) { if (equipListOfUsed != null && equipListOfUsed.contains(record)) {
throw new BadRequest("使用登记证已被其他流程使用,不允许重复提交!"); String joinedEquipInUse = String.join(",", equipInUseList);
log.error("使用登记证已被其他流程使用,不允许重复提交,设备ID:{},在流程中申请单:{}", record, joinedEquipInUse);
throw new BadRequest("使用登记证已被其他流程使用,不允许重复提交!,设备ID: " + record +" ,在流程中申请单:" + joinedEquipInUse + ",请联系管理员!");
} }
if (equipListOfUsed == null || equipListOfUsed.isEmpty()) { if (equipListOfUsed == null || equipListOfUsed.isEmpty()) {
equipListOfUsed = new TreeSet<>(); equipListOfUsed = new TreeSet<>();
......
...@@ -2166,12 +2166,23 @@ public class CommonServiceImpl implements ICommonService { ...@@ -2166,12 +2166,23 @@ public class CommonServiceImpl implements ICommonService {
} catch (ParseException e) { } catch (ParseException e) {
log.error("日期转换失败:", e); log.error("日期转换失败:", e);
} }
String equCode = Optional.ofNullable(equType.get("equCategoryCode")).orElse(equType.get("equDefineCode")); ResponseModel<String> responseModel = null;
if (isValidCreditCode(receiveCompanyCode)) {
String equCode = Optional.ofNullable(equType.get("equDefineCode")).orElse(equType.get("equCategoryCode"));
String registrationCode = equCode + receiveCompanyCode + ym; String registrationCode = equCode + receiveCompanyCode + ym;
ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode); responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode);
}
return responseModel.getResult(); return responseModel.getResult();
} }
// 校验信用代码是否符合要求
public static boolean isValidCreditCode(String creditCode) {
// 检查是否是数字
if (!creditCode.matches("\\d+")) {
throw new BadRequest("接收机构编码错误: " + creditCode + ",请联系管理员!");
}
return true;
}
/** /**
* 获取最新的使用登记证书 * 获取最新的使用登记证书
......
...@@ -1580,6 +1580,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1580,6 +1580,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 历史设备且做过历史登记 // 历史设备且做过历史登记
BoolQueryBuilder hisBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder hisBuilder = QueryBuilders.boolQuery();
hisBuilder.must(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his")); hisBuilder.must(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his"));
hisBuilder.mustNot(QueryBuilders.prefixQuery("DATA_SOURCE", "jg_his_ymt"));//排除一码通设备
hisBuilder.must(QueryBuilders.termQuery("EQU_STATE", EquimentEnum.ZAIYONG.getCode())); hisBuilder.must(QueryBuilders.termQuery("EQU_STATE", EquimentEnum.ZAIYONG.getCode()));
dBuilder.should(hisBuilder); dBuilder.should(hisBuilder);
// 或新设备 // 或新设备
...@@ -3363,7 +3364,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3363,7 +3364,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} catch (ParseException e) { } catch (ParseException e) {
log.error("日期转换失败:", e); log.error("日期转换失败:", e);
} }
String equCode = Optional.ofNullable(dto.getEquCategoryCode()).orElse(dto.getEquDefineCode()); String equCode = Optional.ofNullable(dto.getEquDefineCode()).orElse(dto.getEquCategoryCode());
String registrationCode = equCode + receiveCompanyCode + ym; String registrationCode = equCode + receiveCompanyCode + ym;
ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode); ResponseModel<String> responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode);
return responseModel.getResult(); return responseModel.getResult();
......
...@@ -1206,20 +1206,23 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1206,20 +1206,23 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
changeRecordEq.setEquId(jgRelationEquip.getEquId());//设备主键 changeRecordEq.setEquId(jgRelationEquip.getEquId());//设备主键
changeRecordEq.setProductCode(idxBizJgFactoryInfo.getFactoryNum()); changeRecordEq.setProductCode(idxBizJgFactoryInfo.getFactoryNum());
certificateChangeRecordEqService.save(changeRecordEq); certificateChangeRecordEqService.save(changeRecordEq);
});
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder() // 更新关联设备表
jgInstallationNoticeEqService.updateBatchById(jgRelationEquips);
jgResumeInfoService.saveBatchResume(
jgRelationEquips.stream()
.map(v -> JgResumeInfoDto.builder()
.applyNo(jgInstallationNotice.getApplyNo()) .applyNo(jgInstallationNotice.getApplyNo())
.businessType(BusinessTypeEnum.JG_INSTALLATION_NOTIFICATION.getName()) .businessType(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getName())
.businessId(jgInstallationNotice.getSequenceNbr() + "") .businessId(String.valueOf(jgInstallationNotice.getSequenceNbr()))
.equId(jgRelationEquip.getEquId()) .equId(String.valueOf(v.getEquId()))
.approvalUnit(jgInstallationNotice.getReceiveOrgName()) .approvalUnit(jgInstallationNotice.getReceiveOrgName())
.approvalUnitCode(jgInstallationNotice.getReceiveOrgCreditCode()) .approvalUnitCode(jgInstallationNotice.getReceiveOrgCreditCode())
.status("正常") .status("正常")
.routePath(taskV2Model1.getRoutePath()) .routePath(taskV2Model1.getRoutePath())
.build()); .build())
}); .collect(Collectors.toList())
// 更新关联设备表 );
jgInstallationNoticeEqService.updateBatchById(jgRelationEquips);
} else { } else {
jgInstallationNotice.setNextExecuteIds(workflowResultDto.getNextExecutorRoleIds()); jgInstallationNotice.setNextExecuteIds(workflowResultDto.getNextExecutorRoleIds());
jgInstallationNotice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds()); jgInstallationNotice.setNextExecuteUserIds(workflowResultDto.getNextExecutorUserIds());
...@@ -1616,6 +1619,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN ...@@ -1616,6 +1619,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// 6.es 回退 // 6.es 回退
this.rollBackEsInfo(jgRelationEquip, idxBizJgRegisterInfo); this.rollBackEsInfo(jgRelationEquip, idxBizJgRegisterInfo);
}); });
//删除设备履历信息
List<String> equipTransferIds = jgInstallationNoticeEqs.stream()
.map(JgInstallationNoticeEq::getEquipTransferId)
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (!equipTransferIds.isEmpty()) {
jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds);
}
} }
/** /**
......
...@@ -14,7 +14,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.*; ...@@ -14,7 +14,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.*;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContractEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContractEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory; import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
...@@ -354,23 +353,23 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -354,23 +353,23 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
// 再插入新代办、数据待定 // 再插入新代办、数据待定
commonService.buildTaskModel(Collections.singletonList(modelDto)); commonService.buildTaskModel(Collections.singletonList(modelDto));
// 新增人员履历消息表 // 新增人员履历消息表
LambdaQueryWrapper<JgMaintenanceContractEq> lambda = new QueryWrapper<JgMaintenanceContractEq>().lambda(); //LambdaQueryWrapper<JgMaintenanceContractEq> lambda = new QueryWrapper<JgMaintenanceContractEq>().lambda();
lambda.eq(JgMaintenanceContractEq::getEquipTransferId, contract.getSequenceNbr()); //lambda.eq(JgMaintenanceContractEq::getEquipTransferId, contract.getSequenceNbr());
List<JgMaintenanceContractEq> jgMaintenanceContractEqList = jgMaintenanceContractEqService.getBaseMapper().selectList(lambda); //List<JgMaintenanceContractEq> jgMaintenanceContractEqList = jgMaintenanceContractEqService.getBaseMapper().selectList(lambda);
jgResumeInfoService.saveBatchResume( //jgResumeInfoService.saveBatchResume(
jgMaintenanceContractEqList.stream() // jgMaintenanceContractEqList.stream()
.map(v -> JgResumeInfoDto.builder() // .map(v -> JgResumeInfoDto.builder()
.applyNo(contract.getApplyNo()) // .applyNo(contract.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getName()) // .businessType(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getName())
.businessId(String.valueOf(contract.getSequenceNbr())) // .businessId(String.valueOf(contract.getSequenceNbr()))
.equId(String.valueOf(v.getEquId())) // .equId(String.valueOf(v.getEquId()))
.approvalUnit(contract.getReceiveOrgName()) // .approvalUnit(contract.getReceiveOrgName())
.approvalUnitCode(contract.getReceiveOrgCode()) // .approvalUnitCode(contract.getReceiveOrgCode())
.status("正常") // .status("正常")
.routePath(taskV2Model.getRoutePath()) // .routePath(taskV2Model.getRoutePath())
.build()) // .build())
.collect(Collectors.toList()) // .collect(Collectors.toList())
); //);
} }
...@@ -676,9 +675,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -676,9 +675,9 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
contract.setApplyDate(new Date()); contract.setApplyDate(new Date());
contract.setStatus(taskCode); contract.setStatus(taskCode);
contract.setNextTaskId(null); contract.setNextTaskId(null);
updateTaskModel(contract, "0"); TaskV2Model taskV2Model = updateTaskModel(contract, "0");
// 添加设备维保信息 // 添加设备维保信息
updateEquipMessage(contract.getSequenceNbr()); updateEquipMessage(contract.getSequenceNbr(), taskV2Model);
} }
this.getBaseMapper().updateById(contract); this.getBaseMapper().updateById(contract);
...@@ -692,7 +691,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -692,7 +691,7 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
* @param id * @param id
*/ */
@SneakyThrows @SneakyThrows
private void updateEquipMessage(Long id) { private void updateEquipMessage(Long id, TaskV2Model taskV2Model) {
JgMaintenanceContract jgMaintenanceContract = this.getBaseMapper().selectById(id); JgMaintenanceContract jgMaintenanceContract = this.getBaseMapper().selectById(id);
LambdaQueryWrapper<JgMaintenanceContractEq> lambda = new QueryWrapper<JgMaintenanceContractEq>().lambda(); LambdaQueryWrapper<JgMaintenanceContractEq> lambda = new QueryWrapper<JgMaintenanceContractEq>().lambda();
lambda.eq(JgMaintenanceContractEq::getEquipTransferId, id); lambda.eq(JgMaintenanceContractEq::getEquipTransferId, id);
...@@ -717,7 +716,23 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -717,7 +716,23 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
info.setRepairInform(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceContract()) ? null : jgMaintenanceContract.getMaintenanceContract()); info.setRepairInform(ObjectUtils.isEmpty(jgMaintenanceContract.getMaintenanceContract()) ? null : jgMaintenanceContract.getMaintenanceContract());
maintenanceRecordInfoList.add(info); maintenanceRecordInfoList.add(info);
}); });
jgResumeInfoService.saveBatchResume(
list.stream()
.map(v -> JgResumeInfoDto.builder()
.applyNo(jgMaintenanceContract.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_RECORD.getName())
.businessId(String.valueOf(jgMaintenanceContract.getSequenceNbr()))
.equId(String.valueOf(v.getEquId()))
.approvalUnit(jgMaintenanceContract.getReceiveOrgName())
.approvalUnitCode(jgMaintenanceContract.getReceiveOrgCode())
.status("正常")
.routePath(taskV2Model.getRoutePath())
.build())
.collect(Collectors.toList())
);
idxBizJgMaintenanceRecordInfoService.saveBatch(maintenanceRecordInfoList); idxBizJgMaintenanceRecordInfoService.saveBatch(maintenanceRecordInfoList);
// 维保备案后更新安全追溯对应设备状态
emqKeeper.getMqttClient().publish(SafetyProblemTypeEnum.WBBA.getTopic(), JSON.toJSONBytes(maintenanceRecordInfoList), 2, false); emqKeeper.getMqttClient().publish(SafetyProblemTypeEnum.WBBA.getTopic(), JSON.toJSONBytes(maintenanceRecordInfoList), 2, false);
} }
...@@ -873,6 +888,15 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC ...@@ -873,6 +888,15 @@ public class JgMaintenanceContractServiceImpl extends BaseService<JgMaintenanceC
if (!CollectionUtils.isEmpty(equipmentLists)) { if (!CollectionUtils.isEmpty(equipmentLists)) {
List<String> list = equipmentLists.stream().filter(t -> t.getEquId() != null).map(JgMaintenanceContractEq::getEquId).collect(Collectors.toList()); List<String> list = equipmentLists.stream().filter(t -> t.getEquId() != null).map(JgMaintenanceContractEq::getEquId).collect(Collectors.toList());
maintenanceContractEqMapper.updateIdxBizJgRegisterInfo(list); maintenanceContractEqMapper.updateIdxBizJgRegisterInfo(list);
// 删除批量业务ID信息
List<String> equipTransferIds = equipmentLists.stream()
.map(JgMaintenanceContractEq::getEquipTransferId)
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (!equipTransferIds.isEmpty()) {
jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds);
}
jgResumeInfoService.deleteBatchByBusinessId(equipmentLists.stream().filter(t -> t.getEquipTransferId() != null).map(JgMaintenanceContractEq::getEquId).collect(Collectors.toList()));
} }
} }
// private void delRepeatUseEquipData(JgMaintenanceContract maintenanceContract) { // private void delRepeatUseEquipData(JgMaintenanceContract maintenanceContract) {
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgResumeInfoDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgResumeInfoDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo; import com.yeejoin.amos.boot.module.jg.api.entity.JgResumeInfo;
...@@ -19,7 +20,7 @@ import java.util.stream.Collectors; ...@@ -19,7 +20,7 @@ import java.util.stream.Collectors;
* @date 2024-05-29 * @date 2024-05-29
*/ */
@Service @Service
public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto,JgResumeInfo,JgResumeInfoMapper> implements IJgResumeInfoService { public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto, JgResumeInfo, JgResumeInfoMapper> implements IJgResumeInfoService {
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -31,7 +32,7 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto,JgResum ...@@ -31,7 +32,7 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto,JgResum
* 列表查询 示例 * 列表查询 示例
*/ */
public List<JgResumeInfoDto> queryForJgResumeInfoList() { public List<JgResumeInfoDto> queryForJgResumeInfoList() {
return this.queryForList("" , false); return this.queryForList("", false);
} }
public void saveBatchResume(List<JgResumeInfoDto> jgResumeInfoDtoList) { public void saveBatchResume(List<JgResumeInfoDto> jgResumeInfoDtoList) {
...@@ -44,4 +45,20 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto,JgResum ...@@ -44,4 +45,20 @@ public class JgResumeInfoServiceImpl extends BaseService<JgResumeInfoDto,JgResum
.collect(Collectors.toList()); .collect(Collectors.toList());
this.saveBatch(jgResumeInfoCollection); this.saveBatch(jgResumeInfoCollection);
} }
/**
* 根据业务id进行删除
* @param businessId 业务id
*/
public void deleteByBusinessId(String businessId) {
this.baseMapper.delete(new LambdaQueryWrapper<JgResumeInfo>().eq(JgResumeInfo::getBusinessId, businessId));
}
/**
* 根据业务id进行删除
* @param idList 业务id
*/
public void deleteBatchByBusinessId(List<String> idList) {
this.baseMapper.deleteBatchByBusinessId(idList);
}
} }
\ No newline at end of file
...@@ -305,6 +305,11 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -305,6 +305,11 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
} }
for (Map<String, Object> objectMap : informationList) { for (Map<String, Object> objectMap : informationList) {
List<Map<String, Object>> temp = new ArrayList<>(); List<Map<String, Object>> temp = new ArrayList<>();
objectMap.put("equipProvinceName", objectMap.get("provinceName"));
objectMap.put("equipCityName", objectMap.get("cityName"));
objectMap.put("equipCountyName", objectMap.get("countyName"));
objectMap.put("equipStreetName", objectMap.get("streetName"));
objectMap.put("equipAddress", objectMap.get("address"));
temp.add(objectMap); temp.add(objectMap);
Map<String, Object> placeholders = jgInstallationNoticeService.fullFillTemplateObj(temp, BusinessTypeEnum.JG_ADVICE_REMOVAL.getName().substring(0, 2)); Map<String, Object> placeholders = jgInstallationNoticeService.fullFillTemplateObj(temp, BusinessTypeEnum.JG_ADVICE_REMOVAL.getName().substring(0, 2));
maps.add(placeholders); maps.add(placeholders);
......
...@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl; ...@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue; import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto; 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.dto.UseFlagParamDto;
...@@ -15,6 +17,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.*; ...@@ -15,6 +17,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransferService; 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.service.IJgUseRegistrationManageService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo; import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.ymt.api.common.StringUtil; import com.yeejoin.amos.boot.module.ymt.api.common.StringUtil;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
...@@ -49,18 +52,19 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -49,18 +52,19 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.alibaba.fastjson.JSON.parseArray; import static com.alibaba.fastjson.JSON.parseArray;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.CommonServiceImpl.isValidCreditCode;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl.getAuditPassedDate; import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl.getAuditPassedDate;
/** /**
...@@ -120,6 +124,11 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -120,6 +124,11 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
CommonMapper commonMapper; CommonMapper commonMapper;
@Autowired @Autowired
private RedisTemplate<String, String> redisTemplate; private RedisTemplate<String, String> redisTemplate;
@Autowired
TzsServiceFeignClient tzsServiceFeignClient;
@Autowired
private JgCertificateChangeRecordMapper certificateChangeRecordMapper;
private static final long SCROLL_TIMEOUT = 180000; private static final long SCROLL_TIMEOUT = 180000;
private static final int SIZE = 1000; private static final int SIZE = 1000;
...@@ -759,4 +768,32 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr ...@@ -759,4 +768,32 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
jgUseRegistrationManageMapper.initUseRegistrationCodeIntoRedis(String.valueOf(LocalDate.now().getYear() % 100)) jgUseRegistrationManageMapper.initUseRegistrationCodeIntoRedis(String.valueOf(LocalDate.now().getYear() % 100))
.forEach(resultMap -> redisTemplate.opsForValue().set(resultMap.get("prefix"), resultMap.get("code"))); .forEach(resultMap -> redisTemplate.opsForValue().set(resultMap.get("prefix"), resultMap.get("code")));
} }
public Object handleErrorDeviceCode(String applyNo) {
LambdaQueryWrapper<JgUseRegistrationManage> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgUseRegistrationManage::getApplyNo, applyNo);
JgUseRegistrationManage jgUseRegistrationManage = jgUseRegistrationManageMapper.selectOne(queryWrapper);
if (jgUseRegistrationManage != null) {
String ym = "";
try {
ym = Optional.of(DateUtils.dateFormat(jgUseRegistrationManage.getAuditPassDate(), DateUtils.DATE_PATTERN_MM)).orElse(DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN_MM));
} catch (ParseException e) {
log.error("日期转换失败:", e);
}
ResponseModel<String> responseModel;
if (isValidCreditCode(jgUseRegistrationManage.getReceiveCompanyCode())) {
String equCode = Optional.ofNullable(jgUseRegistrationManage.getEquDefineCode()).orElse(jgUseRegistrationManage.getEquCategoryCode());
String registrationCode = equCode + jgUseRegistrationManage.getReceiveCompanyCode() + ym;
responseModel = tzsServiceFeignClient.deviceRegistrationCode(registrationCode);
jgUseRegistrationManage.setCertificateNo(responseModel.getResult());
jgUseRegistrationManageMapper.updateById(jgUseRegistrationManage);
LambdaUpdateWrapper<JgCertificateChangeRecord> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(JgCertificateChangeRecord::getApplyNo, applyNo);
updateWrapper.set(JgCertificateChangeRecord::getCertificateNo, responseModel.getResult());
certificateChangeRecordMapper.update(null, updateWrapper);
}
}
return "修复成功!";
}
} }
\ No newline at end of file
...@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
...@@ -20,6 +19,7 @@ import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity; ...@@ -20,6 +19,7 @@ import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.dto.*; import com.yeejoin.amos.boot.module.jg.api.dto.*;
...@@ -59,6 +59,7 @@ import com.yeejoin.amos.feign.workflow.model.TaskResultDTO; ...@@ -59,6 +59,7 @@ import com.yeejoin.amos.feign.workflow.model.TaskResultDTO;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
...@@ -1810,9 +1811,23 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1810,9 +1811,23 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
if (!ObjectUtils.isEmpty(detail) && !StringUtils.isEmpty(detail.get("organizationCode")) && !StringUtils.isEmpty(detail.get("organizationName"))) { if (!ObjectUtils.isEmpty(detail) && !StringUtils.isEmpty(detail.get("organizationCode")) && !StringUtils.isEmpty(detail.get("organizationName"))) {
String receiveOrgCode = (String) detail.get("organizationCode"); String receiveOrgCode = (String) detail.get("organizationCode");
String receiveOrgName = (String) detail.get("organizationName");
List<LinkedHashMap> receiveUnitTree = commonServiceImpl.getReceiveUnitTree("register");
List<Map<String, Object>> receiveUnitList = Lists.newArrayList();
if (!receiveUnitTree.isEmpty() && !receiveUnitTree.get(0).isEmpty()) {
convertTreeToListMap(receiveUnitTree.get(0), receiveUnitList);
}
// 查询receiveUnitTree中符合receiveOrgCode的数据
Map<String, Object> resultMap = receiveUnitList.stream().filter(map -> receiveOrgCode.equals(map.get("companyCode"))).findFirst().orElse(null);
if (ValidationUtil.isEmpty(resultMap)) {
detail.put("receiveOrgCode", null);
} else {
String receiveOrgName = (String) resultMap.get("companyName");
detail.put("receiveOrgCode", receiveOrgCode + "_" + receiveOrgName); detail.put("receiveOrgCode", receiveOrgCode + "_" + receiveOrgName);
} }
}
// 监督管理信息 // 监督管理信息
Map<String, Object> supervisionInfo = this.baseMapper.getSupervisionInfoDetail(record); Map<String, Object> supervisionInfo = this.baseMapper.getSupervisionInfoDetail(record);
...@@ -1869,6 +1884,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -1869,6 +1884,17 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return detail; return detail;
} }
private void convertTreeToListMap(LinkedHashMap receiveUnit, List<Map<String, Object>> resultList) {
resultList.add(receiveUnit);
if (receiveUnit.containsKey("children") && !ValidationUtil.isEmpty(receiveUnit.get("children"))) {
List<LinkedHashMap> children = (List<LinkedHashMap>) receiveUnit.get("children");
for (LinkedHashMap child : children) {
convertTreeToListMap(child, resultList);
}
}
}
private String setDefaultRecord(JgUseRegistration jgUseRegistration, String record) { private String setDefaultRecord(JgUseRegistration jgUseRegistration, String record) {
if (StringUtils.isEmpty(record)) { if (StringUtils.isEmpty(record)) {
JgUseRegistrationEq jgUseRegistrationEq = jgUseRegistrationEqService.getOne(new LambdaQueryWrapper<JgUseRegistrationEq>().eq(JgUseRegistrationEq::getEquipTransferId, jgUseRegistration.getSequenceNbr())); JgUseRegistrationEq jgUseRegistrationEq = jgUseRegistrationEqService.getOne(new LambdaQueryWrapper<JgUseRegistrationEq>().eq(JgUseRegistrationEq::getEquipTransferId, jgUseRegistration.getSequenceNbr()));
...@@ -3115,6 +3141,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD ...@@ -3115,6 +3141,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 历史设备 生成证书管理表记录 & 生成安装 维保等操作记录 // 历史设备 生成证书管理表记录 & 生成安装 维保等操作记录
this.historyEquGenManageRelated(map, jgUseRegistration, registerInfo, idxBizJgFactoryInfo); this.historyEquGenManageRelated(map, jgUseRegistration, registerInfo, idxBizJgFactoryInfo);
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder()
.applyNo(jgUseRegistration.getApplyNo())
.businessType(BusinessTypeEnum.JG_HISTORY_USAGE_REGISTRATION.getName())
.businessId(jgUseRegistration.getSequenceNbr() + "")
.equId(String.valueOf(map.get("equipId")))
.approvalUnit(jgUseRegistration.getReceiveOrgName())
.approvalUnitCode(jgUseRegistration.getReceiveOrgCode())
.status("正常")
.build());
} }
return this.baseMapper.getDetailById(jgUseRegistration.getSequenceNbr()); return this.baseMapper.getDetailById(jgUseRegistration.getSequenceNbr());
} catch (BadRequest | LocalBadRequest e) { } catch (BadRequest | LocalBadRequest e) {
......
...@@ -361,15 +361,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -361,15 +361,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
equip.setEquId(String.valueOf(x.get("record"))); equip.setEquId(String.valueOf(x.get("record")));
equip.setVehicleId(vehicleInformation.getSequenceNbr() + ""); equip.setVehicleId(vehicleInformation.getSequenceNbr() + "");
equipList.add(equip); equipList.add(equip);
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder()
.applyNo(vehicleInformation.getApplyNo())
.businessType(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName())
.businessId(vehicleInformation.getSequenceNbr() + "")
.equId(String.valueOf(x.get("record")))
.approvalUnit(vehicleInformation.getReceiveOrgName())
.approvalUnitCode(vehicleInformation.getReceiveOrgCode())
.status("正常")
.build());
}); });
// 保存关联设备信息 // 保存关联设备信息
jgVehicleInformationEqService.saveBatch(equipList); jgVehicleInformationEqService.saveBatch(equipList);
...@@ -1485,6 +1476,13 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1485,6 +1476,13 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 4.es的EQU_STATE, USE_ORG_CODE、ORG_BRANCH_CODE、ORG_BRANCH_NAME、STATUS // 4.es的EQU_STATE, USE_ORG_CODE、ORG_BRANCH_CODE、ORG_BRANCH_NAME、STATUS
this.rollBackForEquipEsInfo(record); this.rollBackForEquipEsInfo(record);
}); });
List<String> equipTransferIds = eqList.stream()
.map(JgVehicleInformationEq::getVehicleId)
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (!equipTransferIds.isEmpty()) {
jgResumeInfoService.deleteBatchByBusinessId(equipTransferIds);
}
} }
private void rollBackForEquipEsInfo(String record) { private void rollBackForEquipEsInfo(String record) {
...@@ -1934,6 +1932,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1934,6 +1932,8 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
equip.setEquId(String.valueOf(x.get("record"))); equip.setEquId(String.valueOf(x.get("record")));
equip.setVehicleId(vehicleInformation.getSequenceNbr() + ""); equip.setVehicleId(vehicleInformation.getSequenceNbr() + "");
equipList.add(equip); equipList.add(equip);
//新增添加设备履历
if (StringUtils.isEmpty(vehicleInfoDto.getSequenceNbr())){
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder() jgResumeInfoService.createWithModel(JgResumeInfoDto.builder()
.applyNo(vehicleInformation.getApplyNo()) .applyNo(vehicleInformation.getApplyNo())
.businessType(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName()) .businessType(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName())
...@@ -1943,7 +1943,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1943,7 +1943,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
.approvalUnitCode(vehicleInformation.getReceiveOrgCode()) .approvalUnitCode(vehicleInformation.getReceiveOrgCode())
.status("正常") .status("正常")
.build()); .build());
}
// 查询注册信息 // 查询注册信息
LambdaQueryWrapper<IdxBizJgRegisterInfo> queryRegisterWrapper = new QueryWrapper<IdxBizJgRegisterInfo>().lambda(); LambdaQueryWrapper<IdxBizJgRegisterInfo> queryRegisterWrapper = new QueryWrapper<IdxBizJgRegisterInfo>().lambda();
queryRegisterWrapper.eq(IdxBizJgRegisterInfo::getRecord, String.valueOf(x.get("record"))); queryRegisterWrapper.eq(IdxBizJgRegisterInfo::getRecord, String.valueOf(x.get("record")));
...@@ -2156,15 +2156,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -2156,15 +2156,6 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
equip.setEquId(String.valueOf(x.get("record"))); equip.setEquId(String.valueOf(x.get("record")));
equip.setVehicleId(vehicleInformation.getSequenceNbr() + ""); equip.setVehicleId(vehicleInformation.getSequenceNbr() + "");
equipList.add(equip); equipList.add(equip);
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder()
.applyNo(vehicleInformation.getApplyNo())
.businessType(BusinessTypeEnum.JG_VEHICLE_GAS_APPLICATION.getName())
.businessId(vehicleInformation.getSequenceNbr() + "")
.equId(String.valueOf(x.get("record")))
.approvalUnit(vehicleInformation.getReceiveOrgName())
.approvalUnitCode(vehicleInformation.getReceiveOrgCode())
.status("正常")
.build());
// 查询注册信息 // 查询注册信息
LambdaQueryWrapper<IdxBizJgRegisterInfo> queryRegisterWrapper = new QueryWrapper<IdxBizJgRegisterInfo>().lambda(); LambdaQueryWrapper<IdxBizJgRegisterInfo> queryRegisterWrapper = new QueryWrapper<IdxBizJgRegisterInfo>().lambda();
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.entity.SafetyProblemTracing;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemStatusEnum; import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum; import com.yeejoin.amos.boot.module.jg.api.enums.SafetyProblemTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.SafetyProblemTracingMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock; import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
...@@ -43,6 +47,9 @@ public class SafetyProblemTracingGenServiceImpl{ ...@@ -43,6 +47,9 @@ public class SafetyProblemTracingGenServiceImpl{
@Autowired @Autowired
EmqKeeper emqKeeper; EmqKeeper emqKeeper;
@Autowired
private SafetyProblemTracingServiceImpl safetyProblemTracingService;
@Scheduled(cron = "0 0 1 * * ?") @Scheduled(cron = "0 0 1 * * ?")
@SchedulerLock(name = "executeSafetyProblemCheck", lockAtMostFor = "PT5H", lockAtLeastFor = "PT10M") @SchedulerLock(name = "executeSafetyProblemCheck", lockAtMostFor = "PT5H", lockAtLeastFor = "PT10M")
public void executeSafetyProblemCheck() { public void executeSafetyProblemCheck() {
...@@ -66,6 +73,39 @@ public class SafetyProblemTracingGenServiceImpl{ ...@@ -66,6 +73,39 @@ public class SafetyProblemTracingGenServiceImpl{
logger.info("维保超期检查结束"); logger.info("维保超期检查结束");
} }
public void update3MaintenanceCheck() {
logger.info("开始修正数据");
List<String> oldAllRecords = idxBizJgOtherInfoService.getBaseMapper()
.selectList(new LambdaQueryWrapper<IdxBizJgOtherInfo>()
.eq(IdxBizJgOtherInfo::getStatus, SafetyProblemStatusEnum.UNHANDLED.getCode()))
.stream()
.map(IdxBizJgOtherInfo::getRecord)
.collect(Collectors.toList());
logger.info("总的旧数据条数:{}",oldAllRecords.size());
List<Map<String, Object>> outOfMaintenanceRecords = commonMapper.queryOutOfMaintenanceRecord();
List<String> realRecordsMain = outOfMaintenanceRecords.stream().map(m -> m.get("RECORD").toString()).collect(Collectors.toList());
List<Map<String, Object>> outOfInspectionRecords = commonMapper.queryOutOfInspectionRecord();
List<String> realRecordsInsp = outOfInspectionRecords.stream().map(m -> m.get("RECORD").toString()).collect(Collectors.toList());
realRecordsMain.addAll(realRecordsInsp);
logger.info("正常数据条数:{}", realRecordsMain.size());
List<String> errorRecord = oldAllRecords.stream().filter(item -> !realRecordsMain.contains(item)).collect(Collectors.toList());
logger.info("异常数据条数---------------:{}",errorRecord.size());
safetyProblemTracingService.lambdaUpdate()
.set(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.HANDLED.getCode())
.set(SafetyProblemTracing::getProblemStatus, SafetyProblemStatusEnum.HANDLED.getName())
.in(SafetyProblemTracing::getSourceId, errorRecord)
.eq(SafetyProblemTracing::getProblemTypeCode, SafetyProblemTypeEnum.WBCQ.getCode())
.eq(SafetyProblemTracing::getIsDelete,Boolean.FALSE)
.update();
idxBizJgOtherInfoService.lambdaUpdate().set(IdxBizJgOtherInfo::getStatus, null)
.in(IdxBizJgOtherInfo::getRecord, errorRecord).update();
Iterable<ESEquipmentCategoryDto> equipEsDtoIter = esEquipmentCategory.findAllById(errorRecord);
for (ESEquipmentCategoryDto equipEsDto : equipEsDtoIter) {
equipEsDto.setProblemStatus(null);
}
esEquipmentCategory.saveAll(equipEsDtoIter);
logger.info("修改正数据条数:{}",errorRecord.size());
}
private void updateEquipAndSendMessage(List<Map<String, Object>> mapList, SafetyProblemTypeEnum safetyProblemTypeEnum) { private void updateEquipAndSendMessage(List<Map<String, Object>> mapList, SafetyProblemTypeEnum safetyProblemTypeEnum) {
List<String> records = mapList.stream().map(m -> m.get("RECORD").toString()).collect(Collectors.toList()); List<String> records = mapList.stream().map(m -> m.get("RECORD").toString()).collect(Collectors.toList());
...@@ -80,10 +120,11 @@ public class SafetyProblemTracingGenServiceImpl{ ...@@ -80,10 +120,11 @@ public class SafetyProblemTracingGenServiceImpl{
esEquipmentCategoryDto.add(equipmentCategoryDto); esEquipmentCategoryDto.add(equipmentCategoryDto);
} }
esEquipmentCategory.saveAll(esEquipmentCategoryDto); esEquipmentCategory.saveAll(esEquipmentCategoryDto);
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put(safetyProblemTypeEnum.getMsgKey(), mapList); // jsonObject.put(safetyProblemTypeEnum.getMsgKey(), mapList);
JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(mapList));
try { try {
emqKeeper.getMqttClient().publish(safetyProblemTypeEnum.getTopic(), jsonObject.toString().getBytes(StandardCharsets.UTF_8), 2, false); emqKeeper.getMqttClient().publish(safetyProblemTypeEnum.getTopic(), jsonArray.toString().getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
logger.error("发送安全追溯问题设备信息消息失败---->{}", e.getMessage()); logger.error("发送安全追溯问题设备信息消息失败---->{}", e.getMessage());
throw new RuntimeException(e); throw new RuntimeException(e);
......
...@@ -79,4 +79,8 @@ public interface AQZSDPStatisticsMapper { ...@@ -79,4 +79,8 @@ public interface AQZSDPStatisticsMapper {
List<CountDto> selectByOrgAndProblemTypeForCy(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<CountDto> selectByOrgAndProblemTypeForCy(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
Page<SafetyProblemTracingDto> queryForSafetyProblemTracingPage(Page<SafetyProblemTracingDto> page, SafetyProblemTracingDto problemModel); Page<SafetyProblemTracingDto> queryForSafetyProblemTracingPage(Page<SafetyProblemTracingDto> page, SafetyProblemTracingDto problemModel);
CountDto selectByOrgAndProblemTypeForWb(@Param("orgCode") String orgCode, @Param("problemTypeCode") String problemTypeCode,
@Param("dto") DPFilterParamDto dpFilterParamDto, @Param("sourceTypeCode") String sourceTypeCode, @Param("equListCode") String equListCode);
} }
...@@ -17,7 +17,6 @@ import org.apache.ibatis.annotations.Param; ...@@ -17,7 +17,6 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* Mapper 接口 * Mapper 接口
...@@ -65,5 +64,5 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> { ...@@ -65,5 +64,5 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
List<AlertPaperInfoDto> getAlertPaperInfoList(@Param("regionCodes") List<String> regionCodes, @Param("isHistory") Boolean isHistory); List<AlertPaperInfoDto> getAlertPaperInfoList(@Param("regionCodes") List<String> regionCodes, @Param("isHistory") Boolean isHistory);
List<JSONObject> getUseUnitByCreditCode(@Param("useUnitCreditCode")Set<String> useUnitCreditCode); List<JSONObject> getKeyMonitorUseUnitByCityCode(@Param("cityCode")String cityCode);
} }
...@@ -109,11 +109,10 @@ ...@@ -109,11 +109,10 @@
tzs_safety_problem_tracing tzs_safety_problem_tracing
WHERE WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' ) governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND problem_level IS NOT NULL
<if test="now != null and now != ''"> <if test="now != null and now != ''">
AND DATE_FORMAT(problem_time,'%Y-%m') &gt;= #{now} AND DATE_FORMAT(problem_time,'%Y-%m') &gt;= #{now}
</if> </if>
<if test="sourceTypeCode !=null and sourceTypeCode !=''"> <if test="sourceTypeCode !=null and sourceTypeCode !='' and sourceTypeCode != 2">
and source_type_code = #{sourceTypeCode} and source_type_code = #{sourceTypeCode}
</if> </if>
</select> </select>
...@@ -193,7 +192,6 @@ ...@@ -193,7 +192,6 @@
WHERE WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' ) governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND DATE_FORMAT ( problem_time, '%Y' ) = #{time} AND DATE_FORMAT ( problem_time, '%Y' ) = #{time}
AND problem_level IS NOT NULL
GROUP BY GROUP BY
principal_unit_code principal_unit_code
ORDER BY ORDER BY
...@@ -373,14 +371,13 @@ ...@@ -373,14 +371,13 @@
from tzs_safety_problem_tracing spt from tzs_safety_problem_tracing spt
<where> <where>
spt.is_delete = false spt.is_delete = false
AND spt.problem_level IS NOT NULL
<if test="problemModel.problemNum != null and problemModel.problemNum != ''"> <if test="problemModel.problemNum != null and problemModel.problemNum != ''">
and spt.problem_num = LIKE CONCAT('%', #{problemModel.problemNum}, '%') and spt.problem_num = LIKE CONCAT('%', #{problemModel.problemNum}, '%')
</if> </if>
<if test="problemModel.problemStatus != null and problemModel.problemStatus != ''"> <if test="problemModel.problemStatus != null and problemModel.problemStatus != ''">
and spt.problem_status = #{problemModel.problemStatus} and spt.problem_status = #{problemModel.problemStatus}
</if> </if>
<if test="problemModel.sourceTypeCode != null and problemModel.sourceTypeCode != ''"> <if test="problemModel.sourceTypeCode != null and problemModel.sourceTypeCode != '' and problemModel.sourceTypeCode != 2">
and spt.source_type_code = #{problemModel.sourceTypeCode} and spt.source_type_code = #{problemModel.sourceTypeCode}
</if> </if>
<if test="problemModel.problemLevelCode != null and problemModel.problemLevelCode != ''"> <if test="problemModel.problemLevelCode != null and problemModel.problemLevelCode != ''">
...@@ -422,6 +419,33 @@ ...@@ -422,6 +419,33 @@
</where> </where>
order by spt.create_date desc order by spt.create_date desc
</select> </select>
<select id="selectByOrgAndProblemTypeForWb" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
COUNT(1) as longValue,
t.problem_type AS keyStr
FROM
(SELECT problem_type FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(problem_time as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(problem_time as date),#{dto.endDate})
</if>
<if test="null != sourceTypeCode">
AND source_type_code = #{sourceTypeCode}
</if>
<if test="null != equListCode">
AND equip_list_code = #{equListCode}
</if>
<if test="null != problemTypeCode">
AND problem_type_code = #{problemTypeCode}
</if>
GROUP BY
principal_unit_code) t
</select>
</mapper> </mapper>
...@@ -449,10 +449,16 @@ ...@@ -449,10 +449,16 @@
</select> </select>
<select id="getUseUnitByCreditCode" resultType="com.alibaba.fastjson.JSONObject"> <select id="getKeyMonitorUseUnitByCityCode" resultType="com.alibaba.fastjson.JSONObject">
select sequence_nbr sequenceNbr, use_unit_code useUnitCode, use_unit useUnit from tz_base_enterprise_info where use_unit_code in SELECT
<foreach collection="useUnitCreditCode" index="index" item="item" open="(" separator="," close=")"> v.region_code,
#{item} v.use_unit_code useUnitCode,
</foreach> (SELECT use_unit FROM tz_base_enterprise_info WHERE use_code = v.use_unit_code) useUnit
FROM
tz_base_enterprise_video v
WHERE
region_code LIKE CONCAT('%', #{cityCode}, '%')
GROUP BY
use_unit_code
</select> </select>
</mapper> </mapper>
...@@ -3,19 +3,26 @@ ...@@ -3,19 +3,26 @@
<mapper namespace="com.yeejoin.amos.boot.module.statistics.api.mapper.DPSubBizMapper"> <mapper namespace="com.yeejoin.amos.boot.module.statistics.api.mapper.DPSubBizMapper">
<select id="equOnJgServiceOperationRecords" resultType="java.util.Map"> <select id="equOnJgServiceOperationRecords" resultType="java.util.Map">
select SELECT
sequence_nbr as sequenceNbr, t.sequence_nbr AS sequenceNbr,
business_type as businessType, t.business_type AS businessType,
apply_no as applyNo, t.apply_no AS applyNo,
rec_User_Id as recUserId, t.rec_user_id AS recUserId,
rec_user_name as recUserName, t.rec_user_name AS recUserName,
DATE_FORMAT(rec_date,'%Y-%m-%d %H:%i:%s') as recDate, DATE_FORMAT(rec_date,'%Y-%m-%d %H:%i:%s') as recDate,
approval_unit as approvalUnit, t.approval_unit AS approvalUnit,
status, t.status,
route_path as routePath t.route_path AS routePath
from tzs_jg_resume_info FROM
where equ_id = #{record} tzs_jg_resume_info t
order by rec_date ASC JOIN (SELECT apply_no, MAX(rec_date) AS max_rec_date
FROM tzs_jg_resume_info
WHERE equ_id = #{record}
GROUP BY apply_no
) AS latest
ON t.apply_no = latest.apply_no AND t.rec_date = latest.max_rec_date
WHERE t.equ_id = #{record}
ORDER BY t.rec_date ASC
</select> </select>
<select id="queryForSafetyProblemTracingList" resultType="java.util.Map"> <select id="queryForSafetyProblemTracingList" resultType="java.util.Map">
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</select> </select>
<select id="queryByUseCode" resultType="com.yeejoin.amos.boot.module.statistics.api.entity.TzBaseEnterpriseInfo"> <select id="queryByUseCode" resultType="com.yeejoin.amos.boot.module.statistics.api.entity.TzBaseEnterpriseInfo">
select * from tz_base_enterprise_info where use_code = #{useCode} select * from tz_base_enterprise_info where use_unit_code = #{useCode}
</select> </select>
......
...@@ -925,6 +925,8 @@ ...@@ -925,6 +925,8 @@
<select id="countBizFinishedNumForDPListSGGZ" resultType="java.util.Map"> <select id="countBizFinishedNumForDPListSGGZ" resultType="java.util.Map">
<if test="treeValue != null or dto.businessTypeCode == 'gz_az'"> <if test="treeValue != null or dto.businessTypeCode == 'gz_az'">
SELECT SELECT
tjin.address,
tjin.install_start_date AS constructionDate,
tjin.sequence_nbr AS sequenceNbr, tjin.sequence_nbr AS sequenceNbr,
'安装告知' AS businessType, '安装告知' AS businessType,
tjin.apply_no AS applyNo, tjin.apply_no AS applyNo,
...@@ -973,6 +975,8 @@ ...@@ -973,6 +975,8 @@
</if> </if>
<if test="treeValue != null or dto.businessTypeCode == 'gz_wx'"> <if test="treeValue != null or dto.businessTypeCode == 'gz_wx'">
SELECT SELECT
tjmn.address,
tjmn.plan_date AS constructionDate,
tjmn.sequence_nbr AS sequenceNbr, tjmn.sequence_nbr AS sequenceNbr,
'维修告知' AS businessType, '维修告知' AS businessType,
tjmn.apply_no AS applyNo, tjmn.apply_no AS applyNo,
...@@ -1021,6 +1025,8 @@ ...@@ -1021,6 +1025,8 @@
</if> </if>
<if test="treeValue != null or dto.businessTypeCode == 'gz_gz'"> <if test="treeValue != null or dto.businessTypeCode == 'gz_gz'">
SELECT SELECT
tjrn.address,
tjrn.plan_date AS constructionDate,
tjrn.sequence_nbr AS sequenceNbr, tjrn.sequence_nbr AS sequenceNbr,
'改造告知' AS businessType, '改造告知' AS businessType,
tjrn.apply_no AS applyNo, tjrn.apply_no AS applyNo,
...@@ -1069,6 +1075,8 @@ ...@@ -1069,6 +1075,8 @@
</if> </if>
<if test="treeValue != null or dto.businessTypeCode == 'gz_yz'"> <if test="treeValue != null or dto.businessTypeCode == 'gz_yz'">
SELECT SELECT
tn.address,
tn.plan_date AS constructionDate,
tn.sequence_nbr AS sequenceNbr, tn.sequence_nbr AS sequenceNbr,
'移装告知' AS businessType, '移装告知' AS businessType,
tn.apply_no AS applyNo, tn.apply_no AS applyNo,
...@@ -1118,28 +1126,34 @@ ...@@ -1118,28 +1126,34 @@
order by createDate desc order by createDate desc
</select> </select>
<select id="countBizFinishedNumForDPListSYDJ" resultType="java.util.Map"> <select id="countBizFinishedNumForDPListSYDJ" resultType="java.util.Map">
WITH equipment_category AS (
SELECT code, name FROM tz_equipment_category
),
filtered_data AS (
<if test="treeValue != null or dto.businessTypeCode == 'sy_dj'"> <if test="treeValue != null or dto.businessTypeCode == 'sy_dj'">
SELECT SELECT
tjur.sequence_nbr AS sequenceNbr, tjur.sequence_nbr AS sequenceNbr,
'使用登记' AS businessType, '使用登记' AS businessType,
tjur.apply_no AS applyNo, tjur.apply_no AS applyNo,
(SELECT tec.name FROM tz_equipment_category tec WHERE tec.code = ri.EQU_LIST ) AS equList, ec_equ_list.name AS equList,
(SELECT tec.name FROM tz_equipment_category tec WHERE tec.code = ri.EQU_CATEGORY ) AS equCategory, ec_equ_category.name AS equCategory,
tjur.use_unit_name AS unitName, tjur.use_unit_name AS unitName,
tjur.receive_org_name AS receiveOrgName, tjur.receive_org_name AS receiveOrgName,
tjur.create_date AS createDate, tjur.create_date AS createDate,
tjur.audit_pass_date AS handleDate, tjur.audit_pass_date AS handleDate,
CASE CASE
WHEN tjur.status = '已完成' THEN WHEN tjur.status = '已完成' THEN '已完成'
'已完成' ELSE'进行中' ELSE '进行中'
END AS status END AS status
FROM FROM tzs_jg_use_registration tjur
tzs_jg_use_registration tjur
LEFT JOIN tzs_jg_use_registration_eq tne ON tjur.sequence_nbr = tne.equip_transfer_id LEFT JOIN tzs_jg_use_registration_eq tne ON tjur.sequence_nbr = tne.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info ri ON tne.equ_id = ri.RECORD LEFT JOIN idx_biz_jg_register_info ri ON tne.equ_id = ri.RECORD
LEFT JOIN equipment_category ec_equ_list ON ec_equ_list.code = ri.EQU_LIST
LEFT JOIN equipment_category ec_equ_category ON ec_equ_category.code = ri.EQU_CATEGORY
WHERE WHERE
receive_company_org_code like CONCAT(#{orgCode}, '%') receive_company_org_code LIKE CONCAT(#{orgCode}, '%')
and tjur.status != '已作废' and tjur.is_delete = 0 AND tjur.status != '已作废'
AND tjur.is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1147,16 +1161,16 @@ ...@@ -1147,16 +1161,16 @@
and date_le(CAST(audit_pass_date as date),#{dto.endDate}) and date_le(CAST(audit_pass_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and tjur.use_unit_name like CONCAT('%', #{dto.companyName}, '%') AND tjur.use_unit_name LIKE CONCAT('%', #{dto.companyName}, '%')
</if> </if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''"> <if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and tjur.receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') AND tjur.receive_org_name LIKE CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
<if test="dto.equListCode != null and dto.equListCode != ''"> <if test="dto.equListCode != null and dto.equListCode != ''">
and ri.EQU_LIST = #{dto.equListCode} AND ri.EQU_LIST = #{dto.equListCode}
</if> </if>
<if test="dto.equCategoryCode != null and dto.equCategoryCode != ''"> <if test="dto.equCategoryCode != null and dto.equCategoryCode != ''">
and ri.EQU_CATEGORY = #{dto.equCategoryCode} AND ri.EQU_CATEGORY = #{dto.equCategoryCode}
</if> </if>
<if test="dto.status != null and dto.status != '' and dto.status != '6616'"> <if test="dto.status != null and dto.status != '' and dto.status != '6616'">
and tjur.status != '已完成' and tjur.status != '已完成'
...@@ -1166,30 +1180,31 @@ ...@@ -1166,30 +1180,31 @@
</if> </if>
</if> </if>
<if test="treeValue != null"> <if test="treeValue != null">
union all UNION ALL
</if> </if>
<if test="treeValue != null or dto.businessTypeCode == 'car_cyl_dj'"> <if test="treeValue != null or dto.businessTypeCode == 'car_cyl_dj'">
SELECT SELECT DISTINCT
tjvi.sequence_nbr AS sequenceNbr, tjvi.sequence_nbr AS sequenceNbr,
'车用气瓶登记' AS businessType, '车用气瓶登记' AS businessType,
tjvi.apply_no AS applyNo, tjvi.apply_no AS applyNo,
(SELECT tec.name FROM tz_equipment_category tec WHERE tec.code = ri.EQU_LIST ) AS equList, ec_equ_list.name AS equList,
(SELECT tec.name FROM tz_equipment_category tec WHERE tec.code = ri.EQU_CATEGORY ) AS equCategory, ec_equ_category.name AS equCategory,
tjvi.install_unit_name AS unitName, tjvi.install_unit_name AS unitName,
tjvi.receive_org_name AS receiveOrgName, tjvi.receive_org_name AS receiveOrgName,
tjvi.create_date AS createDate, tjvi.create_date AS createDate,
tjvi.audit_pass_date AS handleDate, tjvi.audit_pass_date AS handleDate,
CASE CASE
WHEN tjvi.status = '已完成' THEN WHEN tjvi.status = '已完成' THEN '已完成'
'已完成' ELSE'进行中' ELSE '进行中'
END AS status END AS status
FROM FROM tzs_jg_vehicle_information tjvi
tzs_jg_vehicle_information tjvi
LEFT JOIN tzs_jg_vehicle_information_eq tjvie ON tjvi.sequence_nbr = tjvie.vehicle_id LEFT JOIN tzs_jg_vehicle_information_eq tjvie ON tjvi.sequence_nbr = tjvie.vehicle_id
LEFT JOIN idx_biz_jg_register_info ri ON tjvie.equ_id = ri.RECORD LEFT JOIN idx_biz_jg_register_info ri ON tjvie.equ_id = ri.RECORD
LEFT JOIN equipment_category ec_equ_list ON ec_equ_list.code = ri.EQU_LIST
LEFT JOIN equipment_category ec_equ_category ON ec_equ_category.code = ri.EQU_CATEGORY
WHERE WHERE
tjvi.org_branch_code like CONCAT(#{orgCode}, '%') tjvi.org_branch_code LIKE CONCAT(#{orgCode}, '%')
and tjvi.status != '已作废' AND tjvi.status != '已作废'
<if test="dto.beginDate != null and dto.beginDate != ''"> <if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate}) and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if> </if>
...@@ -1197,16 +1212,16 @@ ...@@ -1197,16 +1212,16 @@
and date_le(CAST(audit_pass_date as date),#{dto.endDate}) and date_le(CAST(audit_pass_date as date),#{dto.endDate})
</if> </if>
<if test="dto.companyName != null and dto.companyName != ''"> <if test="dto.companyName != null and dto.companyName != ''">
and tjvi.use_unit_name like CONCAT('%', #{dto.companyName}, '%') AND tjvi.use_unit_name LIKE CONCAT('%', #{dto.companyName}, '%')
</if> </if>
<if test="dto.superviseUnitName != null and dto.superviseUnitName != ''"> <if test="dto.superviseUnitName != null and dto.superviseUnitName != ''">
and tjvi.receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%') AND tjvi.receive_org_name LIKE CONCAT('%', #{dto.superviseUnitName}, '%')
</if> </if>
<if test="dto.equListCode != null and dto.equListCode != ''"> <if test="dto.equListCode != null and dto.equListCode != ''">
and ri.EQU_LIST = #{dto.equListCode} AND ri.EQU_LIST = #{dto.equListCode}
</if> </if>
<if test="dto.equCategoryCode != null and dto.equCategoryCode != ''"> <if test="dto.equCategoryCode != null and dto.equCategoryCode != ''">
and ri.EQU_CATEGORY = #{dto.equCategoryCode} AND ri.EQU_CATEGORY = #{dto.equCategoryCode}
</if> </if>
<if test="dto.status != null and dto.status != '' and dto.status != '6616'"> <if test="dto.status != null and dto.status != '' and dto.status != '6616'">
and tjvi.status != '已完成' and tjvi.status != '已完成'
...@@ -1214,10 +1229,11 @@ ...@@ -1214,10 +1229,11 @@
<if test="dto.status != null and dto.status != '' and dto.status == '6616'"> <if test="dto.status != null and dto.status != '' and dto.status == '6616'">
and tjvi.status = '已完成' and tjvi.status = '已完成'
</if> </if>
GROUP BY tjvi.sequence_nbr
</if> </if>
order by createDate desc )
SELECT * FROM filtered_data ORDER BY createDate DESC
</select> </select>
<select id="countBizFinishedNumForDPListBGDJ" resultType="java.util.Map"> <select id="countBizFinishedNumForDPListBGDJ" resultType="java.util.Map">
<if test="treeValue != null or dto.businessTypeCode == 'dj_gz'"> <if test="treeValue != null or dto.businessTypeCode == 'dj_gz'">
SELECT SELECT
......
...@@ -427,7 +427,10 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -427,7 +427,10 @@ public class AQZSDPStatisticsServiceImpl {
Map<String, Object> dataMap = new HashMap<>(); Map<String, Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>(); List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>(); List<Object> ydata = new ArrayList<>();
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("3"); // 不需要统计资质超期和许可超期数据,2024-11-12日需求修改
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("3").stream()
.filter(item -> !(item.contains("资质超期") || item.contains("许可超期")))
.collect(Collectors.toList());
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if (orgCode != null) { if (orgCode != null) {
List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.EQUIPMENT.getCode(), null); List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.EQUIPMENT.getCode(), null);
...@@ -451,6 +454,9 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -451,6 +454,9 @@ public class AQZSDPStatisticsServiceImpl {
if (orgCode != null) { if (orgCode != null) {
List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.COMPANY.getCode(), null); List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.COMPANY.getCode(), null);
countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue())); countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue()));
// 企业维保合同过期单独查询(企业下有设备维保超期就算)
CountDto wbCountDto = statisticsMapper.selectByOrgAndProblemTypeForWb(orgCode, IssueTypeEnum.MAINTENANCE_OVERDUE_EQUMENT.getCode(), dpFilterParamDto, IssueMainBodyEnum.EQUIPMENT.getCode(), "3000");
dataMap.put(IssueTypeEnum.MAINTENANCE_RECORD_OVERDUE_COMPANY.getName(), wbCountDto == null ? 0 : wbCountDto.getLongValue());
} }
for (int i = 0; i < enumNameList.size(); i++) { for (int i = 0; i < enumNameList.size(); i++) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
...@@ -467,7 +473,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -467,7 +473,7 @@ public class AQZSDPStatisticsServiceImpl {
break; break;
case "维保备案超期": case "维保备案超期":
map.put("key", "maintenanceFilingOverdueNumber"); map.put("key", "maintenanceFilingOverdueNumber");
map.put("label", "维保备案超期数(仅电梯)"); map.put("label", "维保合同备案超期数(仅电梯)");
map.put("value", dataMap.getOrDefault(enumNameList.get(i), "0")); map.put("value", dataMap.getOrDefault(enumNameList.get(i), "0"));
break; break;
default: default:
......
...@@ -16,6 +16,7 @@ import com.yeejoin.amos.feign.morphic.model.FormSceneModel; ...@@ -16,6 +16,7 @@ import com.yeejoin.amos.feign.morphic.model.FormSceneModel;
import jdk.nashorn.api.scripting.ScriptObjectMirror; import jdk.nashorn.api.scripting.ScriptObjectMirror;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -32,6 +33,8 @@ import javax.script.Invocable; ...@@ -32,6 +33,8 @@ import javax.script.Invocable;
import javax.script.ScriptEngine; import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager; import javax.script.ScriptEngineManager;
import java.net.URI; import java.net.URI;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.IntStream; import java.util.stream.IntStream;
...@@ -57,6 +60,9 @@ public class DPSubServiceImpl { ...@@ -57,6 +60,9 @@ public class DPSubServiceImpl {
@Autowired @Autowired
DPSubBizServiceImpl dpSubBizService; DPSubBizServiceImpl dpSubBizService;
@Value("${supervisionCode.prefix:https://sxtzsb.sxsei.com:19435/tzs?code=}")
private String supervisionCodePrefix;
public JSONObject commonQuery(String template, @RequestBody Map<String, Object> param) { public JSONObject commonQuery(String template, @RequestBody Map<String, Object> param) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
String templateJson = DpSubUtils.getFileContent(template + ".json"); String templateJson = DpSubUtils.getFileContent(template + ".json");
...@@ -519,7 +525,7 @@ public class DPSubServiceImpl { ...@@ -519,7 +525,7 @@ public class DPSubServiceImpl {
e.printStackTrace(); e.printStackTrace();
} }
} }
String color = null; String color = "green";
if (!ValidationUtil.isEmpty(problemTime)) { if (!ValidationUtil.isEmpty(problemTime)) {
try { try {
qrcode.put("text", DateUtil.formatDate(DateUtil.smartFormat(problemTime), "yyyy-MM-dd")); qrcode.put("text", DateUtil.formatDate(DateUtil.smartFormat(problemTime), "yyyy-MM-dd"));
...@@ -533,7 +539,12 @@ public class DPSubServiceImpl { ...@@ -533,7 +539,12 @@ public class DPSubServiceImpl {
} else if ("异常".equals(problemStatus) || "未处理".equals(problemStatus)) { } else if ("异常".equals(problemStatus) || "未处理".equals(problemStatus)) {
color = "red"; color = "red";
} }
qrcode.put("value", !ValidationUtil.isEmpty(result.get("SUPERVISORY_CODE")) ? "https://sxtzsb.sxsei.com:9435/tzs/?code=" + result.get("SUPERVISORY_CODE") : result.get("USE_ORG_CODE")); // 处理隐患和企业详情码:改为固定图片。后期待定义二维码及页面内容后再改为二维码
if (!ValidationUtil.isEmpty(qrcode.getString("picUrl"))) {
JSONObject picUrls = qrcode.getJSONObject("picUrl");
qrcode.put("url", picUrls.getString(color));
}
qrcode.put("value", !ValidationUtil.isEmpty(result.get("SUPERVISORY_CODE")) ? supervisionCodePrefix + result.get("SUPERVISORY_CODE") : result.get("USE_ORG_CODE"));
qrcode.put("status", problemStatus); qrcode.put("status", problemStatus);
qrcode.put("color", color); qrcode.put("color", color);
return qrcode; return qrcode;
...@@ -597,13 +608,15 @@ public class DPSubServiceImpl { ...@@ -597,13 +608,15 @@ public class DPSubServiceImpl {
log.info("附件数据:{}", value); log.info("附件数据:{}", value);
((JSONArray)value).stream().forEach(y -> { ((JSONArray)value).stream().forEach(y -> {
JSONObject yObj = (JSONObject) y; JSONObject yObj = (JSONObject) y;
if(!ValidationUtil.isEmpty(yObj.getString("url"))) {
String[] str = yObj.getString("url").split("\\."); String[] str = yObj.getString("url").split("\\.");
if (ValidationUtil.isEmpty(str)){ if (ValidationUtil.isEmpty(str)) {
yObj.put("thumb", yObj.getString("url")); yObj.put("thumb", yObj.getString("url"));
} else { } else {
MatinfoEnum iconUrl = MatinfoEnum.getIconUrl(str[1]); MatinfoEnum iconUrl = MatinfoEnum.getIconUrl(str[1]);
yObj.put("thumb", ValidationUtil.isEmpty(iconUrl) ? yObj.getString("url") : iconUrl.getIcon()); yObj.put("thumb", ValidationUtil.isEmpty(iconUrl) ? yObj.getString("url") : iconUrl.getIcon());
} }
}
}); });
attachmentUploadDatasObj.put("value", value); attachmentUploadDatasObj.put("value", value);
String accept = visualParams.getString("accept"); String accept = visualParams.getString("accept");
...@@ -627,6 +640,21 @@ public class DPSubServiceImpl { ...@@ -627,6 +640,21 @@ public class DPSubServiceImpl {
JSONObject lnglatSelect = (JSONObject) value; JSONObject lnglatSelect = (JSONObject) value;
jsonObject.put("value", (!ValidationUtil.isEmpty(lnglatSelect.getString("latitude")) && !ValidationUtil.isEmpty(lnglatSelect.getString("longitude"))) jsonObject.put("value", (!ValidationUtil.isEmpty(lnglatSelect.getString("latitude")) && !ValidationUtil.isEmpty(lnglatSelect.getString("longitude")))
? String.format("[%s,%s]", lnglatSelect.getString("latitude"), lnglatSelect.getString("longitude")) : lnglatSelect.getString("address")); ? String.format("[%s,%s]", lnglatSelect.getString("latitude"), lnglatSelect.getString("longitude")) : lnglatSelect.getString("address"));
}else if(ValidationUtil.isEmpty(value)){
jsonObject.put("value","");
}
} else if ("dateTime".equals(xObj.getString("componentKey"))) {
if (!ValidationUtil.isEmpty(value)) {
String f = visualParams.getString("format").replace("Y","y").replace("D","d");
SimpleDateFormat sdf = new SimpleDateFormat(f);
Date date = null;
try {
date = sdf.parse(ValidationUtil.validateString(value));
} catch (ParseException e) {
throw new RuntimeException(e);
}
jsonObject.put("value",sdf.format(date));
} }
} else if ("checkbox".equals(xObj.getString("componentKey"))) { } else if ("checkbox".equals(xObj.getString("componentKey"))) {
ResponseModel checkboxResult = this.getApiResult(visualParams.getJSONObject("api"), null); ResponseModel checkboxResult = this.getApiResult(visualParams.getJSONObject("api"), null);
......
...@@ -149,7 +149,9 @@ public class EnterpriseBizByTCMServiceImpl { ...@@ -149,7 +149,9 @@ public class EnterpriseBizByTCMServiceImpl {
public TzBaseEnterpriseInfoDto getInfoByUseCode(String useCode) { public TzBaseEnterpriseInfoDto getInfoByUseCode(String useCode) {
TzBaseEnterpriseInfo tzBaseEnterpriseInfo = enterpriseBizMapper.queryByUseCode(useCode); TzBaseEnterpriseInfo tzBaseEnterpriseInfo = enterpriseBizMapper.queryByUseCode(useCode);
if (ObjectUtils.isEmpty(tzBaseEnterpriseInfo)) {
return null;
}
TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = getDetail(tzBaseEnterpriseInfo); TzBaseEnterpriseInfoDto tzBaseEnterpriseInfoDto = getDetail(tzBaseEnterpriseInfo);
if (!ObjectUtils.isEmpty(tzBaseEnterpriseInfo)){ if (!ObjectUtils.isEmpty(tzBaseEnterpriseInfo)){
LambdaQueryWrapper<TzsBaseInstitution> lambda = new QueryWrapper<TzsBaseInstitution>().lambda(); LambdaQueryWrapper<TzsBaseInstitution> lambda = new QueryWrapper<TzsBaseInstitution>().lambda();
......
...@@ -1112,6 +1112,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -1112,6 +1112,7 @@ public class JGDPStatisticsServiceImpl {
}); });
resultMap.put("xdata", xData); resultMap.put("xdata", xData);
resultMap.put("ydata", yData); resultMap.put("ydata", yData);
resultMap.put("unit", "天");
return resultMap; return resultMap;
} }
...@@ -2443,6 +2444,7 @@ public class JGDPStatisticsServiceImpl { ...@@ -2443,6 +2444,7 @@ public class JGDPStatisticsServiceImpl {
LambdaQueryWrapper<SafetyProblemTracing> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SafetyProblemTracing> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SafetyProblemTracing::getSourceId, record); lambdaQueryWrapper.eq(SafetyProblemTracing::getSourceId, record);
lambdaQueryWrapper.orderByDesc(SafetyProblemTracing::getRecDate); lambdaQueryWrapper.orderByDesc(SafetyProblemTracing::getRecDate);
lambdaQueryWrapper.eq(SafetyProblemTracing::getProblemStatusCode, SafetyProblemStatusEnum.UNHANDLED.getCode());
List<SafetyProblemTracing> safetyProblemTracings = safetyProblemTracingMapper.selectList(lambdaQueryWrapper); List<SafetyProblemTracing> safetyProblemTracings = safetyProblemTracingMapper.selectList(lambdaQueryWrapper);
if (!ObjectUtils.isEmpty(safetyProblemTracings)) { if (!ObjectUtils.isEmpty(safetyProblemTracings)) {
objMap.put("problemStatus", ProblemStatusEnum.getNameByDesc.get(safetyProblemTracings.get(0).getProblemStatus())); objMap.put("problemStatus", ProblemStatusEnum.getNameByDesc.get(safetyProblemTracings.get(0).getProblemStatus()));
......
...@@ -353,6 +353,8 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -353,6 +353,8 @@ public class JYJCDPStatisticsServiceImpl {
legendData.add(map); legendData.add(map);
} }
result.put("legendData", legendData); result.put("legendData", legendData);
result.put("unit", "台套");
return result; return result;
} }
...@@ -493,6 +495,7 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -493,6 +495,7 @@ public class JYJCDPStatisticsServiceImpl {
List<CountDto> countDtos = inspectionApplicationMapper.queryAppByEquListForDP(orgCode, dpFilterParamDto); List<CountDto> countDtos = inspectionApplicationMapper.queryAppByEquListForDP(orgCode, dpFilterParamDto);
Map<String, List<CountDto>> groupByMap = countDtos.stream().collect(Collectors.groupingBy(CountDto::getLabel)); Map<String, List<CountDto>> groupByMap = countDtos.stream().collect(Collectors.groupingBy(CountDto::getLabel));
this.setYDataForInspectionEquipByEquList(result, groupByMap, equipmentCategoryDtos); this.setYDataForInspectionEquipByEquList(result, groupByMap, equipmentCategoryDtos);
result.put("unit", "台套");
return result; return result;
} }
......
...@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Sets;
import com.yeejoin.amos.boot.biz.common.dto.CountDto; import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
...@@ -16,8 +15,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto; ...@@ -16,8 +15,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.common.api.entity.AlertRescueStatistics; import com.yeejoin.amos.boot.module.common.api.entity.AlertRescueStatistics;
import com.yeejoin.amos.boot.module.common.api.entity.AlertUseUnitStatistics; import com.yeejoin.amos.boot.module.common.api.entity.AlertUseUnitStatistics;
import com.yeejoin.amos.boot.module.common.api.enums.AlertCallEnum; import com.yeejoin.amos.boot.module.common.api.enums.AlertCallEnum;
import com.yeejoin.amos.boot.module.common.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jyjc.api.enums.JYJCTypeEnum;
import com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto; import com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto;
import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertRescueStatisticsMapper; import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertRescueStatisticsMapper;
import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertStatisticsMapper; import com.yeejoin.amos.boot.module.statistics.api.mapper.AlertStatisticsMapper;
...@@ -39,12 +36,10 @@ import org.elasticsearch.client.core.CountRequest; ...@@ -39,12 +36,10 @@ import org.elasticsearch.client.core.CountRequest;
import org.elasticsearch.client.core.CountResponse; import org.elasticsearch.client.core.CountResponse;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.terms.Terms; import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil; import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
...@@ -276,6 +271,9 @@ public class YJDPStatisticsServiceImpl { ...@@ -276,6 +271,9 @@ public class YJDPStatisticsServiceImpl {
lambda.eq(AlertUseUnitStatistics::getStatisticsDate, date); lambda.eq(AlertUseUnitStatistics::getStatisticsDate, date);
lambda.isNotNull(AlertUseUnitStatistics::getUseUnitCode); lambda.isNotNull(AlertUseUnitStatistics::getUseUnitCode);
List<AlertUseUnitStatistics> alertUseUnitStatistics = alertUseUnitStatisticsMapper.selectList(lambda); List<AlertUseUnitStatistics> alertUseUnitStatistics = alertUseUnitStatisticsMapper.selectList(lambda);
alertUseUnitStatistics.sort(Comparator.comparing(
(AlertUseUnitStatistics a) -> a.getFaultNum() + a.getTrappedNum()
).reversed());
return Bean.toModels(alertUseUnitStatistics, AlertUseUnitStatisticsDto.class); return Bean.toModels(alertUseUnitStatistics, AlertUseUnitStatisticsDto.class);
} }
...@@ -772,41 +770,11 @@ public class YJDPStatisticsServiceImpl { ...@@ -772,41 +770,11 @@ public class YJDPStatisticsServiceImpl {
} }
public List<JSONObject> getKeyPositionMonitor(DPFilterParamForDetailDto filterParamDto) { public List<JSONObject> getKeyPositionMonitor(DPFilterParamForDetailDto filterParamDto) {
String orgCode = stCommonService.getAndSetOrgCode(filterParamDto.getCityCode()); return getKeyPositionMonitorByES(filterParamDto);
return getKeyPositionMonitorByES(orgCode, filterParamDto);
} }
private List<JSONObject> getKeyPositionMonitorByES(String orgCode, DPFilterParamForDetailDto filterParamDto) { private List<JSONObject> getKeyPositionMonitorByES(DPFilterParamForDetailDto filterParamDto) {
SearchRequest request = new SearchRequest(); return alertStatisticsMapper.getKeyMonitorUseUnitByCityCode(filterParamDto.getCityCode());
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("IS_INTO_MANAGEMENT", Boolean.TRUE));
// 根据设备种类查询重点监控单位
boolMust.must(QueryBuilders.termQuery("EQU_LIST_CODE", filterParamDto.getEquListCode()));
SearchSourceBuilder builder = new SearchSourceBuilder();
builder.query(boolMust);
request.source(builder);
List<JSONObject> list = null;
Set<String> useUnitCreditCodeSet = Sets.newHashSet();
try {
SearchResponse response = restHighLevelClient.search(request, RequestOptions.DEFAULT);
for (SearchHit hit : response.getHits().getHits()) {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(hit);
JSONObject source = jsonObject.getJSONObject("sourceAsMap");
useUnitCreditCodeSet.add(source.getString("USE_UNIT_CREDIT_CODE"));
}
if (!ValidationUtil.isEmpty(useUnitCreditCodeSet)) {
list = alertStatisticsMapper.getUseUnitByCreditCode(useUnitCreditCodeSet);
} }
} catch (IOException e) {
throw new RuntimeException(e);
}
return list;
}
} }
...@@ -706,7 +706,7 @@ public class ZLDPStatisticsServiceImpl { ...@@ -706,7 +706,7 @@ public class ZLDPStatisticsServiceImpl {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
List<Map<String, Object>> legendData = new ArrayList<>(); List<Map<String, Object>> legendData = new ArrayList<>();
legendData.add(createLegend("设备总数", "equipTotal", "bar", "个")); legendData.add(createLegend("设备总数", "equipTotal", "bar", "个"));
legendData.add(createLegend("纳管率", "claimRate", "line", "%")); legendData.add(createLegend("赋码率", "claimRate", "line", "%"));
List<RegionModel> regionList = stCommonService.setRegionIfRootParentAndNoAccessIf3Level("610000"); List<RegionModel> regionList = stCommonService.setRegionIfRootParentAndNoAccessIf3Level("610000");
// 获取区域名称并过滤 // 获取区域名称并过滤
...@@ -793,9 +793,14 @@ public class ZLDPStatisticsServiceImpl { ...@@ -793,9 +793,14 @@ public class ZLDPStatisticsServiceImpl {
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
// 按照管辖机构区域信息模糊查询 // 按照管辖机构区域信息模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*")); boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(orgCode) + "*"));
// 设备类别精确查询气瓶 boolMust.must(QueryBuilders.existsQuery("SUPERVISORY_CODE"));
boolMust.must(QueryBuilders.termQuery("IS_INTO_MANAGEMENT", true)); boolMust.mustNot(QueryBuilders.termQuery("SUPERVISORY_CODE","null"));
String[] status = {"草稿","已拒领","待认领"};
boolMust.mustNot(QueryBuilders.termsQuery("STATUS",Arrays.asList(status)));
String[] equCategoryCode = {"2300"};
boolMust.mustNot(QueryBuilders.termsQuery("EQU_CATEGORY_CODE",Arrays.asList(equCategoryCode)));
String[] equListCode = {"8000"};
boolMust.mustNot(QueryBuilders.termsQuery("EQU_LIST_CODE",Arrays.asList(equListCode)));
if (StringUtils.isNotEmpty(paramDto.getTreeValue())) { if (StringUtils.isNotEmpty(paramDto.getTreeValue())) {
if ("2300".equals(paramDto.getTreeValue())){ if ("2300".equals(paramDto.getTreeValue())){
boolMust.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", QueryParser.escape(paramDto.getTreeValue().toLowerCase()))); boolMust.must(QueryBuilders.termQuery("EQU_CATEGORY_CODE", QueryParser.escape(paramDto.getTreeValue().toLowerCase())));
......
...@@ -78,8 +78,14 @@ ...@@ -78,8 +78,14 @@
"title": "{useUnit}", "title": "{useUnit}",
"status": [], "status": [],
"qrcode": { "qrcode": {
"title": "企业二维码", "title": "",
"problem": [] "problem": [],
"picUrl": {
"red": "/upload/tzs/dpscreen/images/安全守护-红.png",
"grey": "/upload/tzs/dpscreen/images/安全守护-灰.png",
"orange": "/upload/tzs/dpscreen/images/安全守护-橙.png",
"green": "/upload/tzs/dpscreen/images/安全守护-绿.png"
}
}, },
"keyParams": [ "keyParams": [
{ "key": "unitType", "label": "单位类型" }, { "key": "unitType", "label": "单位类型" },
......
...@@ -79,6 +79,10 @@ ...@@ -79,6 +79,10 @@
{ {
"fieldKey": "NAME_OF_PRESSURE_PARTS", "fieldKey": "NAME_OF_PRESSURE_PARTS",
"dictionaryType": "GLBJMC" "dictionaryType": "GLBJMC"
},
{
"fieldKey": "INSPECT_TYPE",
"dictionaryType": "JYJC"
} }
] ]
} }
......
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
{ {
"fieldKey": "INSPECT_CONCLUSION", "fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL" "dictionaryType": "JYJL"
},
{
"fieldKey": "INSPECT_TYPE",
"dictionaryType": "JYJC"
} }
] ]
} }
......
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
{ {
"fieldKey": "INSPECT_CONCLUSION", "fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL" "dictionaryType": "JYJL"
},
{
"fieldKey": "INSPECT_TYPE",
"dictionaryType": "JYJC"
} }
] ]
} }
......
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
{ {
"fieldKey": "INSPECT_CONCLUSION", "fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL" "dictionaryType": "JYJL"
},
{
"fieldKey": "INSPECT_TYPE",
"dictionaryType": "JYJC"
} }
] ]
} }
......
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
{ {
"fieldKey": "INSPECT_CONCLUSION", "fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL" "dictionaryType": "JYJL"
},
{
"fieldKey": "INSPECT_TYPE",
"dictionaryType": "JYJC"
} }
] ]
} }
......
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
{ {
"fieldKey": "INSPECT_CONCLUSION", "fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL" "dictionaryType": "JYJL"
},
{
"fieldKey": "INSPECT_TYPE",
"dictionaryType": "JYJC"
} }
] ]
} }
......
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
{ {
"fieldKey": "INSPECT_CONCLUSION", "fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL" "dictionaryType": "JYJL"
},
{
"fieldKey": "INSPECT_TYPE",
"dictionaryType": "JYJC"
} }
] ]
} }
......
...@@ -47,6 +47,10 @@ ...@@ -47,6 +47,10 @@
{ {
"fieldKey": "INSPECT_CONCLUSION", "fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL" "dictionaryType": "JYJL"
},
{
"fieldKey": "INSPECT_TYPE",
"dictionaryType": "JYJC"
} }
] ]
} }
......
{
"name": "报检模板",
"tabs": [
{
"key": "keyinfo",
"displayName": "基本信息",
"renderType": "keyinfo",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreen/{sequenceNbr}"
}
}
},
{
"key": "devtable",
"displayName": "报检设备",
"renderType": "table",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreenEqu/{sequenceNbr}",
"params": {
"current": 1,
"size": 10
}
}
},
"visualParams": {
"rowKey": "SEQUENCE_NBR",
"columns": [
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CATEGORY","width": 200,"align": "left","title": "设备类别","key": "1"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_DEFINE","width": 180,"align": "left","title": "设备品种","key": "2"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCT_NAME","width": 250,"align": "left","title": "设备名称","key": "3"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCE_UNIT_NAME","width": 150,"align": "left","title": "设备出厂编号","key": "4"},
{"dataRenderingMode": "defaultText","dataIndex": "USE_INNER_CODE","width": 200,"align": "left","title": "单位内部编号","key": "5"},
{"dataRenderingMode": "defaultText","dataIndex": "ADDRESS","width": 250,"align": "left","title": "设备地址","key": "6"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CODE","width": 220,"align": "left","title": "设备代码","key": "7"},
{"dataRenderingMode": "defaultText","dataIndex": "SUPERVISORY_CODE","width": 150,"align": "left","title": "监管码","key": "8"},
{"dataRenderingMode": "actionDetailBtn","dataIndex": "action","width": 60,"align": "left","title": "操作","key": "9", "conf": { "title": "设备详情", "linkModelKey": "equip" }}
]
}
},
{
"key": "basic",
"displayName": "附件",
"renderType": "basic",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"POST",
"apiPath":"/statistics/dp/jy/inspectApplication/matui/{sequenceNbr}",
"body": {
"subs": [
{
"key": "bjmatinfo",
"displayName": "报检附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "gzs", "label": "告知书(加盖受理单位公章)", "type": "file" },
{ "key": "cpzl", "label": "产品质量证明书", "type": "file" },
{ "key": "sgzxbg", "label": "施工自行检查报告", "type": "file" },
{ "key": "sght", "label": "施工合同或证明", "type": "file" },
{ "key": "sgfa", "label": "施工方案/施工设计文件", "type": "file" },
{ "key": "sgdwxk", "label": "施工单位许可证书", "type": "file" }
]
},
{
"key": "qtmatinfo",
"displayName": "其他附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "qtfj", "label": "附件", "type": "file" },
]
}
]
}
}
}
}
],
"content": {
}
}
\ No newline at end of file
{
"name": "报检模板",
"tabs": [
{
"key": "keyinfo",
"displayName": "基本信息",
"renderType": "keyinfo",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreen/{sequenceNbr}"
}
}
},
{
"key": "devtable",
"displayName": "报检设备",
"renderType": "table",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreenEqu/{sequenceNbr}",
"params": {
"current": 1,
"size": 10
}
}
},
"visualParams": {
"rowKey": "SEQUENCE_NBR",
"columns": [
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CATEGORY","width": 200,"align": "left","title": "设备类别","key": "1"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_DEFINE","width": 180,"align": "left","title": "设备品种","key": "2"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCT_NAME","width": 250,"align": "left","title": "设备名称","key": "3"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCE_UNIT_NAME","width": 150,"align": "left","title": "设备出厂编号","key": "4"},
{"dataRenderingMode": "defaultText","dataIndex": "USE_INNER_CODE","width": 200,"align": "left","title": "单位内部编号","key": "5"},
{"dataRenderingMode": "defaultText","dataIndex": "ADDRESS","width": 250,"align": "left","title": "设备地址","key": "6"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CODE","width": 220,"align": "left","title": "设备代码","key": "7"},
{"dataRenderingMode": "defaultText","dataIndex": "SUPERVISORY_CODE","width": 150,"align": "left","title": "监管码","key": "8"},
{"dataRenderingMode": "actionDetailBtn","dataIndex": "action","width": 60,"align": "left","title": "操作","key": "9", "conf": { "title": "设备详情", "linkModelKey": "equip" }}
]
}
},
{
"key": "basic",
"displayName": "附件",
"renderType": "basic",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"POST",
"apiPath":"/statistics/dp/jy/inspectApplication/matui/{sequenceNbr}",
"body": {
"subs": [
{
"key": "bjmatinfo",
"displayName": "报检附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "gzs", "label": "告知书(加盖受理单位公章)", "type": "file" },
{ "key": "cpzl", "label": "产品质量证明书", "type": "file" },
{ "key": "sgzxbg", "label": "施工自行检查报告", "type": "file" },
{ "key": "sght", "label": "施工合同或证明", "type": "file" },
{ "key": "sgfa", "label": "施工方案/施工设计文件", "type": "file" },
{ "key": "sgdwxk", "label": "施工单位许可证书", "type": "file" }
]
},
{
"key": "qtmatinfo",
"displayName": "其他附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "qtfj", "label": "附件", "type": "file" },
]
}
]
}
}
}
}
],
"content": {
}
}
\ No newline at end of file
{
"name": "报检模板",
"tabs": [
{
"key": "keyinfo",
"displayName": "基本信息",
"renderType": "keyinfo",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreen/{sequenceNbr}"
}
}
},
{
"key": "devtable",
"displayName": "报检设备",
"renderType": "table",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreenEqu/{sequenceNbr}",
"params": {
"current": 1,
"size": 10
}
}
},
"visualParams": {
"rowKey": "SEQUENCE_NBR",
"columns": [
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CATEGORY","width": 200,"align": "left","title": "设备类别","key": "1"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_DEFINE","width": 180,"align": "left","title": "设备品种","key": "2"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCT_NAME","width": 250,"align": "left","title": "设备名称","key": "3"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCE_UNIT_NAME","width": 150,"align": "left","title": "设备出厂编号","key": "4"},
{"dataRenderingMode": "defaultText","dataIndex": "USE_INNER_CODE","width": 200,"align": "left","title": "单位内部编号","key": "5"},
{"dataRenderingMode": "defaultText","dataIndex": "ADDRESS","width": 250,"align": "left","title": "设备地址","key": "6"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CODE","width": 220,"align": "left","title": "设备代码","key": "7"},
{"dataRenderingMode": "defaultText","dataIndex": "SUPERVISORY_CODE","width": 150,"align": "left","title": "监管码","key": "8"},
{"dataRenderingMode": "actionDetailBtn","dataIndex": "action","width": 60,"align": "left","title": "操作","key": "9", "conf": { "title": "设备详情", "linkModelKey": "equip" }}
]
}
},
{
"key": "basic",
"displayName": "附件",
"renderType": "basic",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"POST",
"apiPath":"/statistics/dp/jy/inspectApplication/matui/{sequenceNbr}",
"body": {
"subs": [
{
"key": "bjmatinfo",
"displayName": "报检附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "gzs", "label": "告知书(加盖受理单位公章)", "type": "file" },
{ "key": "cpzl", "label": "产品质量证明书", "type": "file" },
{ "key": "sgzxbg", "label": "施工自行检查报告", "type": "file" },
{ "key": "sght", "label": "施工合同或证明", "type": "file" },
{ "key": "sgfa", "label": "施工方案/施工设计文件", "type": "file" },
{ "key": "sgdwxk", "label": "施工单位许可证书", "type": "file" }
]
},
{
"key": "qtmatinfo",
"displayName": "其他附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "qtfj", "label": "附件", "type": "file" },
]
}
]
}
}
}
}
],
"content": {
}
}
\ No newline at end of file
{
"name": "报检模板",
"tabs": [
{
"key": "keyinfo",
"displayName": "基本信息",
"renderType": "keyinfo",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreen/{sequenceNbr}"
}
}
},
{
"key": "devtable",
"displayName": "报检设备",
"renderType": "table",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreenEqu/{sequenceNbr}",
"params": {
"current": 1,
"size": 10
}
}
},
"visualParams": {
"rowKey": "SEQUENCE_NBR",
"columns": [
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CATEGORY","width": 200,"align": "left","title": "设备类别","key": "1"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_DEFINE","width": 180,"align": "left","title": "设备品种","key": "2"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCT_NAME","width": 250,"align": "left","title": "设备名称","key": "3"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCE_UNIT_NAME","width": 150,"align": "left","title": "设备出厂编号","key": "4"},
{"dataRenderingMode": "defaultText","dataIndex": "USE_INNER_CODE","width": 200,"align": "left","title": "单位内部编号","key": "5"},
{"dataRenderingMode": "defaultText","dataIndex": "ADDRESS","width": 250,"align": "left","title": "设备地址","key": "6"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CODE","width": 220,"align": "left","title": "设备代码","key": "7"},
{"dataRenderingMode": "defaultText","dataIndex": "SUPERVISORY_CODE","width": 150,"align": "left","title": "监管码","key": "8"},
{"dataRenderingMode": "actionDetailBtn","dataIndex": "action","width": 60,"align": "left","title": "操作","key": "9", "conf": { "title": "设备详情", "linkModelKey": "equip" }}
]
}
},
{
"key": "basic",
"displayName": "附件",
"renderType": "basic",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"POST",
"apiPath":"/statistics/dp/jy/inspectApplication/matui/{sequenceNbr}",
"body": {
"subs": [
{
"key": "bjmatinfo",
"displayName": "报检附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "gzs", "label": "告知书(加盖受理单位公章)", "type": "file" },
{ "key": "cpzl", "label": "产品质量证明书", "type": "file" },
{ "key": "sgzxbg", "label": "施工自行检查报告", "type": "file" },
{ "key": "sght", "label": "施工合同或证明", "type": "file" },
{ "key": "sgfa", "label": "施工方案/施工设计文件", "type": "file" },
{ "key": "sgdwxk", "label": "施工单位许可证书", "type": "file" }
]
},
{
"key": "qtmatinfo",
"displayName": "其他附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "qtfj", "label": "附件", "type": "file" },
]
}
]
}
}
}
}
],
"content": {
}
}
\ No newline at end of file
{
"name": "报检模板",
"tabs": [
{
"key": "keyinfo",
"displayName": "基本信息",
"renderType": "keyinfo",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreen/{sequenceNbr}"
}
}
},
{
"key": "devtable",
"displayName": "报检设备",
"renderType": "table",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreenEqu/{sequenceNbr}",
"params": {
"current": 1,
"size": 10
}
}
},
"visualParams": {
"rowKey": "SEQUENCE_NBR",
"columns": [
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CATEGORY","width": 200,"align": "left","title": "设备类别","key": "1"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_DEFINE","width": 180,"align": "left","title": "设备品种","key": "2"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCT_NAME","width": 250,"align": "left","title": "设备名称","key": "3"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCE_UNIT_NAME","width": 150,"align": "left","title": "设备出厂编号","key": "4"},
{"dataRenderingMode": "defaultText","dataIndex": "USE_INNER_CODE","width": 200,"align": "left","title": "单位内部编号","key": "5"},
{"dataRenderingMode": "defaultText","dataIndex": "ADDRESS","width": 250,"align": "left","title": "设备地址","key": "6"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CODE","width": 220,"align": "left","title": "设备代码","key": "7"},
{"dataRenderingMode": "defaultText","dataIndex": "SUPERVISORY_CODE","width": 150,"align": "left","title": "监管码","key": "8"},
{"dataRenderingMode": "actionDetailBtn","dataIndex": "action","width": 60,"align": "left","title": "操作","key": "9", "conf": { "title": "设备详情", "linkModelKey": "equip" }}
]
}
},
{
"key": "basic",
"displayName": "附件",
"renderType": "basic",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"POST",
"apiPath":"/statistics/dp/jy/inspectApplication/matui/{sequenceNbr}",
"body": {
"subs": [
{
"key": "bjmatinfo",
"displayName": "报检附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "gzs", "label": "告知书(加盖受理单位公章)", "type": "file" },
{ "key": "cpzl", "label": "产品质量证明书", "type": "file" },
{ "key": "sgzxbg", "label": "施工自行检查报告", "type": "file" },
{ "key": "sght", "label": "施工合同或证明", "type": "file" },
{ "key": "sgfa", "label": "施工方案/施工设计文件", "type": "file" },
{ "key": "sgdwxk", "label": "施工单位许可证书", "type": "file" }
]
},
{
"key": "qtmatinfo",
"displayName": "其他附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "qtfj", "label": "附件", "type": "file" },
]
}
]
}
}
}
}
],
"content": {
}
}
\ No newline at end of file
{
"name": "报检模板",
"tabs": [
{
"key": "keyinfo",
"displayName": "基本信息",
"renderType": "keyinfo",
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreen/{sequenceNbr}"
}
}
},
{
"key": "devtable",
"displayName": "报检设备",
"renderType": "table",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"GET",
"apiPath":"/statistics/dp/biz-inspection/selectOneForBigScreenEqu/{sequenceNbr}",
"params": {
"current": 1,
"size": 10
}
}
},
"visualParams": {
"rowKey": "SEQUENCE_NBR",
"columns": [
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CATEGORY","width": 200,"align": "left","title": "设备类别","key": "1"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_DEFINE","width": 180,"align": "left","title": "设备品种","key": "2"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCT_NAME","width": 250,"align": "left","title": "设备名称","key": "3"},
{"dataRenderingMode": "defaultText","dataIndex": "PRODUCE_UNIT_NAME","width": 150,"align": "left","title": "设备出厂编号","key": "4"},
{"dataRenderingMode": "defaultText","dataIndex": "USE_INNER_CODE","width": 200,"align": "left","title": "单位内部编号","key": "5"},
{"dataRenderingMode": "defaultText","dataIndex": "ADDRESS","width": 250,"align": "left","title": "设备地址","key": "6"},
{"dataRenderingMode": "defaultText","dataIndex": "EQU_CODE","width": 220,"align": "left","title": "设备代码","key": "7"},
{"dataRenderingMode": "defaultText","dataIndex": "SUPERVISORY_CODE","width": 150,"align": "left","title": "监管码","key": "8"},
{"dataRenderingMode": "actionDetailBtn","dataIndex": "action","width": 60,"align": "left","title": "操作","key": "9", "conf": { "title": "设备详情", "linkModelKey": "equip" }}
]
}
},
{
"key": "basic",
"displayName": "附件",
"renderType": "basic",
"useAloneApi": true,
"dataConfig": {
"api": {
"httpMethod":"POST",
"apiPath":"/statistics/dp/jy/inspectApplication/matui/{sequenceNbr}",
"body": {
"subs": [
{
"key": "bjmatinfo",
"displayName": "报检附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "gzs", "label": "告知书(加盖受理单位公章)", "type": "file" },
{ "key": "cpzl", "label": "产品质量证明书", "type": "file" },
{ "key": "sgzxbg", "label": "施工自行检查报告", "type": "file" },
{ "key": "sght", "label": "施工合同或证明", "type": "file" },
{ "key": "sgfa", "label": "施工方案/施工设计文件", "type": "file" },
{ "key": "sgdwxk", "label": "施工单位许可证书", "type": "file" }
]
},
{
"key": "dtmatinfo",
"displayName": "电梯专项要求",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "xssy", "label": "型式试验证书", "type": "file" },
{ "key": "xsqts", "label": "限速器和渐进式安全钳的调试证书", "type": "file" },
{ "key": "tjsm", "label": "土建声明", "type": "file" }
]
},
{
"key": "qtmatinfo",
"displayName": "其他附件",
"renderType": "matui",
"columns": 3,
"datas": [
{ "key": "qtfj", "label": "附件", "type": "file" },
]
}
]
}
}
}
}
],
"content": {
}
}
\ No newline at end of file
...@@ -78,8 +78,14 @@ ...@@ -78,8 +78,14 @@
"keyinfo": { "keyinfo": {
"title": "{principalUnit}", "title": "{principalUnit}",
"qrcode": { "qrcode": {
"title": "监管码", "title": "",
"problem": [] "problem": [],
"picUrl": {
"red": "/upload/tzs/dpscreen/images/安全守护-红.png",
"grey": "/upload/tzs/dpscreen/images/安全守护-灰.png",
"orange": "/upload/tzs/dpscreen/images/安全守护-橙.png",
"green": "/upload/tzs/dpscreen/images/安全守护-绿.png"
}
}, },
"keyParams": [ "keyParams": [
{ "key": "sourceType", "label": "隐患主体类型" }, { "key": "sourceType", "label": "隐患主体类型" },
......
...@@ -62,7 +62,7 @@ public class DispatchTask extends BaseEntity { ...@@ -62,7 +62,7 @@ public class DispatchTask extends BaseEntity {
* 响应单位id * 响应单位id
*/ */
@TableField("response_org_id") @TableField("response_org_id")
private Long responseOrgId; private String responseOrgId;
/** /**
* 响应单位名称 * 响应单位名称
......
...@@ -62,7 +62,7 @@ public class DispatchTask extends BaseEntity { ...@@ -62,7 +62,7 @@ public class DispatchTask extends BaseEntity {
* 响应单位id * 响应单位id
*/ */
@TableField("response_org_id") @TableField("response_org_id")
private Long responseOrgId; private String responseOrgId;
/** /**
* 响应单位名称 * 响应单位名称
......
...@@ -674,7 +674,7 @@ ...@@ -674,7 +674,7 @@
GROUP BY GROUP BY
tafv.field_value tafv.field_value
ORDER BY ORDER BY
longValue ASC longValue DESC
LIMIT 5 LIMIT 5
</select> </select>
<select id="getInstantAlertPage" resultType="java.util.Map"> <select id="getInstantAlertPage" resultType="java.util.Map">
......
...@@ -88,7 +88,11 @@ ...@@ -88,7 +88,11 @@
resultType="com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto"> resultType="com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto">
SELECT SELECT
*, *,
CONCAT(province,'/',city,'/',district) AS region, TRIM(TRAILING '/' FROM CONCAT(
CASE WHEN COALESCE(province, '') <> '' THEN CONCAT(province, '/') ELSE '' END,
CASE WHEN COALESCE(city, '') <> '' THEN CONCAT(city, '/') ELSE '' END,
CASE WHEN COALESCE(district, '') <> '' THEN CONCAT(district, '/') ELSE '' END
)) AS region,
<if test=" tzBaseEnterpriseInfoDto.unitType.indexOf('使用单位')!=-1"> <if test=" tzBaseEnterpriseInfoDto.unitType.indexOf('使用单位')!=-1">
(SELECT cdd.name from amos_tzs_biz.cb_data_dictionary cdd WHERE cdd.code = industry_supervisor and cdd.type = 'HYZGBM') AS industrySupervisorName, (SELECT cdd.name from amos_tzs_biz.cb_data_dictionary cdd WHERE cdd.code = industry_supervisor and cdd.type = 'HYZGBM') AS industrySupervisorName,
</if> </if>
......
...@@ -72,7 +72,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService { ...@@ -72,7 +72,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
*/ */
@Override @Override
public String createDeviceRegistrationCode(String key) { public String createDeviceRegistrationCode(String key) {
return (key.length() == 16) ? generateSequence(key, SEQUENCE_TYPE_DR, LOCK_KEY_DR) : "生成码规则不对!"; return generateSequence(key, SEQUENCE_TYPE_DR, LOCK_KEY_DR);
} }
/** /**
......
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