Commit e0b7801b authored by maoying's avatar maoying

Merge branch 'developer' into temp

parents 42cd994b 2926a682
......@@ -9,7 +9,8 @@ import java.lang.annotation.Target;
/**
* @author DELL
*
* 注解在mapper方法上
* 注解需要数据权限过滤的mapper。
* interfacePath对应为平台菜单管理中菜单组件(全局唯一)。
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
......@@ -20,6 +21,6 @@ public @interface DataAuth {
* 菜单组件
* @return
*/
String interfacePath() default "";
String interfacePath();
}
......@@ -61,30 +61,39 @@ public class PermissionInterceptor implements Interceptor {
MetaObject metaObject = SystemMetaObject.forObject(statementHandler);
MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement");
// TODO 处理mybatis plus
String dataAuthRule = PermissionInterceptorContext.getDataAuthRule();
// 被拦截方法
Method method = getTargetDataAuthMethod(mappedStatement);
DataAuth dataAuth = getTargetDataAuthAnnotation(mappedStatement);
// 没有DataAuth定义注解的跳过
if (null == dataAuth) {
// 没有DataAuth定义注解的跳过及没有手动指定使用数据规则的跳过
if (null == dataAuth && ValidationUtil.isEmpty(dataAuthRule)) {
PermissionInterceptorContext.clean();
return invocation.proceed();
}
// 接口地址为空返回空数据
if (ValidationUtil.isEmpty(dataAuth.interfacePath())) {
// 数据权限地址为空返回空数据
if (ValidationUtil.isEmpty(dataAuth.interfacePath()) && ValidationUtil.isEmpty(dataAuthRule)) {
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
}
dataAuthRule = ValidationUtil.isEmpty(dataAuth.interfacePath()) ? dataAuthRule : dataAuth.interfacePath();
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId()
, RequestContext.getToken())).toString(), ReginParams.class);
if (ValidationUtil.isEmpty(reginParam) || ValidationUtil.isEmpty(reginParam.getUserModel())) {
// method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
}
// 用户数据权限配置信息
Map<String, List<PermissionDataruleModel>> dataAuthorization = Privilege.permissionDataruleClient.queryByUser(reginParam.getUserModel().getUserId(),
dataAuth.interfacePath()).getResult();
dataAuthRule).getResult();
// 没有数据权限直接返回空数据
if (ValidationUtil.isEmpty(dataAuthorization)) {
PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
}
......@@ -93,6 +102,7 @@ public class PermissionInterceptor implements Interceptor {
// 将权限规则拼接到原始sql
sql = processSelectSql(sql, dataAuthorization, reginParam, boundSql);
metaObject.setValue("delegate.boundSql.sql", sql);
PermissionInterceptorContext.clean();
return invocation.proceed();
}
......
package com.yeejoin.amos.boot.biz.common.interceptors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PermissionInterceptorContext {
private static final Logger logger = LoggerFactory.getLogger(PermissionInterceptorContext.class);
private static ThreadLocal<PermissionInterceptorContextModel> requestContext = ThreadLocal.withInitial(PermissionInterceptorContextModel::new);
private static PermissionInterceptorContextModel getPermissionInterceptorContext() {
return requestContext.get();
}
public static String getDataAuthRule() {
return getPermissionInterceptorContext().getDataAuthRule();
}
public static void setDataAuthRule(String dataAuthRule) {
getPermissionInterceptorContext().setDataAuthRule(dataAuthRule);
}
public static void clean() {
if (requestContext != null) {
logger.info("clean RestThreadLocal......Begin");
requestContext.remove();
logger.info("clean RestThreadLocal......Done");
}
}
}
package com.yeejoin.amos.boot.biz.common.interceptors;
import org.typroject.tyboot.core.foundation.context.RequestContextEntityType;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
public class PermissionInterceptorContextModel implements Serializable {
private static final long serialVersionUID = 1L;
private String dataAuthRule;
public String getDataAuthRule() {
return dataAuthRule;
}
public void setDataAuthRule(String dataAuthRule) {
this.dataAuthRule = dataAuthRule;
}
public void clean() {
this.dataAuthRule = null;
}
}
......@@ -23,6 +23,7 @@ public class MessageAction {
MessageModel messageModel = JSON.parseObject(JSON.toJSONString(msgObj), MessageModel.class);
messageModel.setTitle(title);
messageModel.setBody(RuleUtils.instedParams(content, msgObj));
log.info(String.format("接收规则返回数据: %s", JSON.toJSONString(msgObj)));
if (!ValidationUtil.isEmpty(messageModel)) {
try {
Systemctl.messageClient.create(messageModel);
......
......@@ -46,7 +46,7 @@ public class ContractDto extends BaseDto {
private String contractNo;
@ApiModelProperty(value = "机构代码用于权限过滤")
private Boolean orgCode;
private String orgCode;
@ApiModelProperty(value = "单位名称")
private String company;
......
......@@ -61,7 +61,7 @@ public class Contract extends BaseEntity {
* 机构代码用于权限过滤
*/
@TableField("org_code")
private Boolean orgCode;
private String orgCode;
/**
* 单位名称
*/
......
......@@ -183,7 +183,9 @@ public interface EquipFeignClient {
* @return
*/
@RequestMapping(value = "/building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideo( @RequestParam("current") long current, @RequestParam("size") long size, @RequestParam("buildingId") Long buildingId);
ResponseModel<Page<Map<String, Object>>> getVideo( @RequestParam("current") long current,
@RequestParam("size") long size,
@RequestParam("buildingId") Long buildingId);
@RequestMapping(value = "/building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideopag( @RequestParam("current") String current,
......@@ -203,13 +205,11 @@ public interface EquipFeignClient {
);
@RequestMapping(value = "/confirmAlarm/getDetailsById", method = RequestMethod.GET)
public ResponseModel<Map<String, Object>> getDetailsById(@RequestParam Long alamId, @RequestParam(required = false) Long equipId, @RequestParam(required = false) String type, @RequestParam String area) ;
ResponseModel<Map<String, Object>> getDetailsById(@RequestParam Long alamId,
@RequestParam(required = false) Long equipId,
@RequestParam(required = false) String type,
@RequestParam String area) ;
/**
*
*获取视频列表
......@@ -217,7 +217,11 @@ public interface EquipFeignClient {
* @return
*/
@RequestMapping(value = "/video/pageVideo", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> pageVideo( @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestParam("longitude") Double longitude,@RequestParam("latitude") Double latitude,@RequestParam("distance") Double distance);
ResponseModel<Page<Map<String, Object>>> pageVideo(@RequestParam("pageNum") Integer pageNum,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("longitude") Double longitude,
@RequestParam("latitude") Double latitude,
@RequestParam("distance") Double distance);
@RequestMapping(value = "/video/pageList", method = RequestMethod.GET)
......
......@@ -166,4 +166,8 @@ public interface IMaintenanceCompanyService {
List<MaintenanceCompany> findByInstanceIdAndType(Long instanceId, String type);
List<MaintenanceCompany> findByCodeAndType(String code, String type);
List<MaintenanceCompany> findPersonByAmosOrgId(String code, String userId);
MaintenanceCompany getOne(Long parentId);
}
......@@ -108,8 +108,8 @@ public interface IOrgUsrService {
* @throws Exception
*/
Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception;
Map<String, Object> selectForShowByIduser(OrgUsr orgUsr, Long id) throws Exception;
Map<String, Object> selectForShowByIduser(OrgUsr orgUsr, Long id) throws Exception;
List<OrgUsr> selectCompanyDepartmentMsg();
......@@ -145,7 +145,9 @@ public interface IOrgUsrService {
OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception;
List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception;
List<Map<String, Object>> selectForShowByListIdUser(List<Long> ids) throws Exception;
/**
* * @param null
*
......@@ -185,7 +187,7 @@ public interface IOrgUsrService {
List<Map<String, Object>> getparent();
List<OrgUsrExcelDto> exportToExcel( Map par);
List<OrgUsrExcelDto> exportToExcel(Map par);
UserUnitDto getUserUnit(String userId);
......@@ -226,7 +228,7 @@ public interface IOrgUsrService {
*
* @param orgUserId
* @return
* @exception
* @throws
*/
AgencyUserModel getAmosIdByOrgUserId(String orgUserId) throws Exception;
......@@ -235,12 +237,13 @@ public interface IOrgUsrService {
*
* @param orgUserIds
* @return
* @exception
* @throws
*/
List<String> getAmosIdListByOrgUserId(String orgUserIds) throws Exception;
/**
* 查询目标公司下所有人员的简要信息,数据包含:所在公司id和name ,人员id和name,岗位id和name
*
* @param ids
* @return
*/
......@@ -252,12 +255,12 @@ public interface IOrgUsrService {
OrgUsr selectByAmosOrgId(Long id);
public List<OrgUsr> getPersonListByParentIds(List<String> ids) ;
List<OrgUsr> getPersonListByParentIds(List<String> ids);
List<OrgUsrFormDto> getUnSyncOrgCompanyList(List<Long> companyIdList);
public OrgUsr getDetailById( Long id);
OrgUsr getDetailById(Long id);
/**
......@@ -275,7 +278,7 @@ public interface IOrgUsrService {
* @throws Exception
*/
List<OrgMenuDto> getTreeFlc(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
OrgUsrDto saveOrgPersonFlc(OrgPersonDto OrgPersonDto) throws Exception;
......
......@@ -130,4 +130,22 @@ public class EquipmentInformDto extends BaseDto {
@TableField(exist = false)
private Map<String, List<AttachmentDto>> attachments;
@ApiModelProperty(value = "设备数量")
private Integer equipmentNum;
@ApiModelProperty(value = "开始-施工告知日期")
private String productInformDateStart;
@ApiModelProperty(value = "结束-施工告知日期")
private String productInformDateEnd;
@ApiModelProperty(value = "开始-计划施工日期")
private String planProductDateStart;
@ApiModelProperty(value = "结束-计划施工日期")
private String planProductDateEnd;
@ApiModelProperty(value = "施工区域")
private String productArea;
}
package com.yeejoin.amos.boot.module.tzs.flc.api.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 设备告知单 Mapper 接口
......@@ -11,4 +17,17 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface EquipmentInformMapper extends BaseMapper<EquipmentInform> {
Page<List<EquipmentInformDto>> queryDtoList(Page<EquipmentInformDto> page,
@Param("productCode") String productCode,
@Param("productInformDateStart") String productInformDateStart,
@Param("productInformDateEnd") String productInformDateEnd,
@Param("productUnitId") Long productUnitId,
@Param("regionCode") String regionCode,
@Param("address") String address,
@Param("planProductDateStart") String planProductDateStart,
@Param("planProductDateEnd") String planProductDateEnd,
@Param("acceptUnitId") Long acceptUnitId,
@Param("informStatus") String informStatus,
@Param("sortParam") String sortParam,
@Param("sortRule") String sortRule);
}
......@@ -16,4 +16,6 @@ import java.util.List;
public interface UnitInfoMapper extends BaseMapper<UnitInfo> {
List<UnitInfoDto> getUnitByType(@Param("typeCode") String typeCode);
List<UnitInfoDto> getAllUnit();
}
package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import java.util.List;
/**
* 设备告知单接口类
*
......@@ -13,4 +16,7 @@ public interface IEquipmentInformService {
EquipmentInformDto createEquipmentInform(EquipmentInformDto model);
Page<EquipmentInformDto> queryDtoList(Page<EquipmentInformDto> page, EquipmentInformDto equipmentInformDto, String sortParam, String sortRule);
Boolean batchDelete(List<Long> sequenceNbrList);
}
......@@ -38,4 +38,6 @@ public interface IUnitInfoService {
List<UnitInfoDto> getInspectionUnit();
List<UnitInfoDto> getUseUnit();
List<UnitInfoDto> getAllUnit();
}
......@@ -2,4 +2,69 @@
<!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.tzs.flc.api.mapper.EquipmentInformMapper">
<select id="queryDtoList" resultType="java.util.Map">
SELECT
a.sequence_nbr AS sequenceNbr,
a.product_code AS productCode,
a.product_unit AS productUnit,
CONCAT(a.province,a.city,a.district) AS productArea,
CONCAT(a.stree,a.community,a.address) AS address,
a.plan_product_date AS planProductDate,
a.product_inform_date AS productInformDate,
a.accept_unit AS acceptUnit,
CASE
a.inform_status
WHEN 0 THEN
'暂存'
WHEN 1 THEN
'未接收'
WHEN 9 THEN
'已接收'
ELSE
''
END AS informStatus,
IFNULL(t.equipmentNum, 0) as equipmentNum
FROM
tz_equipment_inform a
LEFT JOIN (select count(e.sequence_nbr) as equipmentNum, e.inform_id from tcb_inform_equipment e GROUP BY e.inform_id ) t on t.inform_id = a.sequence_nbr
WHERE a.is_delete = 0
<if test="productCode != null and productCode != ''">
AND a.product_code like CONCAT('%',#{productCode},'%')
</if>
<if test="productUnitId != null ">
AND a.product_unit_id = #{productUnitId}
</if>
<if test="regionCode != null and regionCode != ''">
AND a.region_code like CONCAT('%',#{regionCode},'%')
</if>
<if test="address != null and address != ''">
AND ( a.stree like CONCAT('%',#{address},'%')
or a.community like CONCAT('%',#{address},'%')
or a.address like CONCAT('%',#{address},'%') )
</if>
<if test="productInformDateStart != null and productInformDateStart != ''">
and #{productInformDateStart} <![CDATA[ <= ]]> a.product_inform_date
</if>
<if test="productInformDateEnd != null and productInformDateEnd != ''">
and a.product_inform_date <![CDATA[ <= ]]> #{productInformDateEnd}
</if>
<if test="planProductDateStart != null and planProductDateStart != ''">
and #{planProductDateStart} <![CDATA[ <= ]]> a.plan_product_date
</if>
<if test="planProductDateEnd != null and planProductDateEnd != ''">
and a.plan_product_date <![CDATA[ <= ]]> #{planProductDateEnd}
</if>
<if test="acceptUnitId != null ">
AND a.accept_unit_id = #{acceptUnitId}
</if>
<if test="informStatus != null and informStatus != ''">
AND a.inform_status = #{informStatus}
</if>
<if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule}
</if>
</select>
</mapper>
......@@ -12,5 +12,14 @@
AND a.unit_type_code LIKE CONCAT('%', #{typeCode}, '%')
</select>
<select id="getAllUnit" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto">
select
a.*
from tz_flc_unit_info a
where a.is_delete = 0
AND
(a.unit_status = '1' or a.is_change = 1)
</select>
</mapper>
package com.yeejoin.amos.boot.module.jcs.biz.controller;
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.util.Arrays;
import java.util.HashMap;
......@@ -34,7 +34,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.FireTeamCardDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -16,29 +36,28 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContract;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersThought;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContactsServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContractServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersEducationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersPostServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersThoughtServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FirefightersJacketServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 消防队员
......
......@@ -22,10 +22,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttPersistenceException;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException;
......@@ -35,14 +79,42 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.*;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallCommandDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallePowerTransferRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledMobDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledPowerInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedExtDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedZHDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.InstructionsZHDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyZHDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PushMessageWebAndAppRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateExtendDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.VoiceRecordFileDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmittedObject;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.*;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSchedulingTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSubmitTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
......@@ -53,32 +125,6 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttPersistenceException;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc.Enum;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.io.*;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
......@@ -485,7 +531,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams.put("feedback", calledRo.getFeedback());
}
// 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息
// 组织短信内容
// 调用短信发送接口
......
......@@ -9,12 +9,6 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -40,15 +34,22 @@ import com.yeejoin.amos.boot.module.common.api.dto.FireTeamCardDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.ExcelSelectData;
import com.yeejoin.amos.boot.module.common.api.excel.DataSources;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
@Service
public class DataSourcesImpl implements DataSources {
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -15,7 +45,33 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInitDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitVo;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireChemical;
......@@ -46,6 +102,7 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormInstanceS
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireChemicalServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireExpertsServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContactsServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersEducationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersPostServiceImpl;
......@@ -64,34 +121,6 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* @author tb
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.*;
import java.util.function.Function;
import java.util.function.IntFunction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
import com.yeejoin.amos.boot.module.jcs.api.dto.*;
import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
......@@ -27,6 +25,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -38,6 +37,26 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCarCountDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCompanyCountDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ResourceStatisticsDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.Controller;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompany;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertFeedbackStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
......
......@@ -1312,7 +1312,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
return executeSubmitDto;
}
AgencyUserModel checkLeader = jcsFeignClient.getAmosIdByUserId(param.getReformLeaderId()).getResult();
JSONObject reformJson = new JSONObject();
JSONObject reformJson = ValidationUtil.isEmpty(latentDanger.getReformJson()) ? new JSONObject() :
latentDanger.getReformJson();
reformJson.put("reformLeaderId", param.getReformLeaderId());
latentDanger.setReformJson(reformJson);
Object result = workflowExecuteService.setTaskAssign(processInstanceId, checkLeader.getUserName());
......
......@@ -9,6 +9,8 @@ import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
......@@ -25,6 +27,8 @@ import java.util.List;
@Component
public class EnumFillAop {
private static final Logger logger = LoggerFactory.getLogger(EnumFillAop.class);
@Autowired
RedisUtils redisUtils;
......@@ -39,19 +43,27 @@ public class EnumFillAop {
@Before("fillEnum()")
public void doBefore(JoinPoint joinPoint) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
// 获取隐患等级枚举
synchronized (this) {
// 获取隐患等级枚举
if (ValidationUtil.isEmpty(LatentDangerLevelEnum.supervisionDangerLevelEnumMap)) {
List<DictionarieValueModel> dicResult =
Systemctl.dictionarieClient.dictValues(bizType + LatentDangerLevelEnum.dictCode).getResult();
dicResult.forEach(dic -> LatentDangerLevelEnum.addEnumDynamic(dic.getDictDataDesc(), dic.getDictDataValue(), dic.getDictDataKey(),
"", dic.getOrderNum()));
try {
List<DictionarieValueModel> dicResult =
Systemctl.dictionarieClient.dictValues(bizType + LatentDangerLevelEnum.dictCode).getResult();
dicResult.forEach(dic -> LatentDangerLevelEnum.addEnumDynamic(dic.getDictDataDesc(), dic.getDictDataValue(), dic.getDictDataKey(),
"", dic.getOrderNum()));
} catch (Exception e) {
logger.debug(e.getMessage());
}
}
// 获取治理方式枚举
if (ValidationUtil.isEmpty(LatentDangerReformTypeEnum.supervisionReformTypeEnumMap)) {
List<DictionarieValueModel> dicResult =
Systemctl.dictionarieClient.dictValues(bizType + LatentDangerReformTypeEnum.dictCode).getResult();
dicResult.forEach(dic -> LatentDangerReformTypeEnum.addEnumDynamic(dic.getDictDataDesc(), dic.getDictDataValue(), dic.getDictDataKey()));
try {
if (ValidationUtil.isEmpty(LatentDangerReformTypeEnum.supervisionReformTypeEnumMap)) {
List<DictionarieValueModel> dicResult =
Systemctl.dictionarieClient.dictValues(bizType + LatentDangerReformTypeEnum.dictCode).getResult();
dicResult.forEach(dic -> LatentDangerReformTypeEnum.addEnumDynamic(dic.getDictDataDesc(), dic.getDictDataValue(), dic.getDictDataKey()));
}
} catch (Exception e) {
logger.debug(e.getMessage());
}
}
// 获取治理状态枚举
......
......@@ -7,7 +7,6 @@ import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.gson.JsonObject;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl;
......@@ -328,7 +327,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
riskSourceId = Long.parseLong(inputCheckDto.getRiskSourceId());
}
LatentDangerBo latentDangerBo = saveLatentDanger("", param.getRemark(), remark, userId, departmentId,
LatentDangerBo latentDangerBo = saveLatentDanger("", "", remark, userId, departmentId,
businessKey, orgCode, dangerName, levelEnum.getCode(),
null, dangerTypeEnum, photoUrls, inputCheckDto.getCheckInputId(), riskSourceId,
position.get(inputCheckDto.getRiskSourceId())==null?"":position.get(inputCheckDto.getRiskSourceId()).toString(), InstanceKeyEnum.PATROL.getCode());
......@@ -1234,7 +1233,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
executeParam.getFlowJson(), executeParam.getDangerId(), role, executeTypeEnum.getName(),executeParam.getRemark());
} else {
if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患评审通过)) {
// 将定的治理人保存在日志记录
// 将定的治理人保存在日志记录
executeParam.getFlowJson().put("governUserId", governUserId);
}
LatentDangerFlowRecordBo flowRecord = saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId,
......@@ -1243,9 +1242,16 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
latentDangerBo.setDangerState(executeTypeEnum.getNextState().getCode().toString());
if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患常规治理)) {
latentDangerBo.setReformType(LatentDangerReformTypeEnum.常规整改.getCode().toString());
latentDangerBo.setReformJson(executeParam.getFlowJson().toJSONString());
JSONObject reformJsonObj = JSONObject.parseObject(latentDangerBo.getReformJson());
if (ValidationUtil.isEmpty(reformJsonObj)) {
reformJsonObj = executeParam.getFlowJson();
} else {
reformJsonObj.putAll(executeParam.getFlowJson());
}
latentDangerBo.setReformJson(reformJsonObj.toJSONString());
latentDangerBo.setInferOtherThings(executeParam.getInferOtherThings());
latentDangerBo.setProblemDescription(executeParam.getRemark());
latentDangerBo.setProblemDescription(ValidationUtil.isEmpty(executeParam.getProblemDescription()) ?
executeParam.getRemark() : executeParam.getProblemDescription());
latentDangerBo.setReasonAnalysis(executeParam.getReasonAnalysis());
} else if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理)) {
latentDangerBo.setReformType(LatentDangerReformTypeEnum.延期治理.getCode().toString());
......@@ -1258,10 +1264,21 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患评审通过)) {
latentDangerBo.setReformLimitDate(DateUtil.str2Date(executeParam.getReformLimitDate(), DateUtil.DATETIME_DEFAULT_FORMAT));
latentDangerBo.setDangerLevel(executeParam.getDangerLevel().toString());
JSONObject reformJsonObject = JSONObject.parseObject(latentDangerBo.getReformJson());
if (ValidationUtil.isEmpty(reformJsonObject)) {
reformJsonObject = new JSONObject();
}
reformJsonObject.put("governUserId", governUserId);
latentDangerBo.setReformJson(reformJsonObject.toJSONString());
// 消防巡查需求:评审通过后定治理人
// 消防巡查需求:评审通过后定治理人
// 2.指定治理执行人
workflowExecuteService.setTaskAssign(latentDangerBo.getInstanceId(), governUserId);
Object result = workflowExecuteService.setTaskAssign(latentDangerBo.getInstanceId(), governUserId);
if (!(Boolean) result) {
executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("设置治理行人失败");
return executeSubmitDto;
}
}
}
if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理车间部门审核通过)) {
......@@ -1269,6 +1286,10 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
if (executeParam.getNeedCompanyVerify() == 0) {
latentDangerBo.setDangerState(LatentDangerStateEnum.延期治理申请.getCode().toString());
latentDangerBo.setReformLimitDate(latentDangerBo.getDelayLimitDate());
if (!assignGovernUser(latentDangerBo, executeSubmitDto)) {
return executeSubmitDto;
}
} else {// 延期治理评审通过且 需要 公司审核
latentDangerBo.setDangerState(LatentDangerStateEnum.延期治理申请待公司审核.getCode().toString());
LatentDangerFlowRecordBo recordBo =
......@@ -1283,15 +1304,16 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
|| LatentDangerExcuteTypeEnum.隐患延期治理公司审核拒绝.equals(executeTypeEnum)
|| LatentDangerExcuteTypeEnum.隐患验证拒绝.equals(executeTypeEnum)) {
latentDangerBo.setDangerState(LatentDangerStateEnum.待治理.getCode().toString());
// 获取第一次评审时选择的治理人
LatentDangerFlowRecordBo record = latentDangerFlowRecordMapper.getByDangerIdAndActionFlag(latentDangerBo.getId(), "隐患评审");
JSONObject recordObj = JSONObject.parseObject(record.getFlowJson());
if (!ValidationUtil.isEmpty(recordObj.get("governUserId"))) {
workflowExecuteService.setTaskAssign(latentDangerBo.getInstanceId(), (String) recordObj.get("governUserId"));
if (!assignGovernUser(latentDangerBo, executeSubmitDto)) {
return executeSubmitDto;
}
} else if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理公司审核通过)) {
latentDangerBo.setDangerState(LatentDangerStateEnum.延期治理申请.getCode().toString());
latentDangerBo.setReformLimitDate(latentDangerBo.getDelayLimitDate());
if (!assignGovernUser(latentDangerBo, executeSubmitDto)) {
return executeSubmitDto;
}
} /**else if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理公司审核拒绝)) {
// TODO 待需求确认是回到部门审核还是回到隐患治理节点
latentDangerBo.setDangerState(LatentDangerStateEnum.延期治理申请待车间部门审核.getCode().toString());
......@@ -1310,6 +1332,29 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
return executeSubmitDto;
}
/**
* 设置治理人到流程执行节点(平台人员用户名)
*
* @param latentDangerBo
* @param executeSubmitDto
* @return
*/
public boolean assignGovernUser(LatentDangerBo latentDangerBo, DangerExecuteSubmitDto executeSubmitDto) {
// 获取最后一次评审时选择的治理人
LatentDangerFlowRecordBo record = latentDangerFlowRecordMapper.getByDangerIdAndActionFlag(latentDangerBo.getId(), "隐患评审");
JSONObject recordObj = JSONObject.parseObject(record.getFlowJson());
if (!ValidationUtil.isEmpty(recordObj.get("governUserId"))) {
Object result = workflowExecuteService.setTaskAssign(latentDangerBo.getInstanceId(),
(String) recordObj.get("governUserId"));
if (!(Boolean) result) {
executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("指定治理人失败");
return false;
}
}
return true;
}
private void sendMessage(LatentDangerBo latentDangerBo, LatentDangerExcuteTypeEnum excuteTypeEnum,
LatentDangerPatrolBo patrolBo, String flowTaskName, String informerList,
String userRealName, String departmentName) {
......
......@@ -7,8 +7,10 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentStatusEnum;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
......@@ -302,4 +304,7 @@ public class BeanDtoVoUtils {
}
});
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -74,25 +82,13 @@ public class EquipmentInformController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@PutMapping(value = "/updateEquipmentInform")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新设备告知单", notes = "根据sequenceNbr更新设备告知单")
public ResponseModel<EquipmentInformDto> updateBySequenceNbrEquipmentInform(@RequestBody EquipmentInformDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(equipmentInformServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除设备告知单", notes = "根据sequenceNbr删除设备告知单")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(equipmentInformServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
......@@ -107,37 +103,59 @@ public class EquipmentInformController extends BaseController {
return ResponseHelper.buildResponse(equipmentInformServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
* 列表分页查询
*
* @param pageNum 当前页
* @param pageSize 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "设备告知单分页查询", notes = "设备告知单分页查询")
public ResponseModel<Page<EquipmentInformDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<EquipmentInformDto> page = new Page<EquipmentInformDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(equipmentInformServiceImpl.queryForEquipmentInformPage(page));
@GetMapping(value = "/list")
@ApiOperation(httpMethod = "GET", value = "告知书列表查询", notes = "告知书列表查询")
public ResponseModel<Page<EquipmentInformDto>> queryForPage(@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize") int pageSize, String sort , EquipmentInformDto equipmentInformDto) {
Page<EquipmentInformDto> page = new Page<EquipmentInformDto>();
page.setCurrent(pageNum);
page.setSize(pageSize);
String sortParam = "";
String sortRule = "";
if(sort!=null) { // 排序失效
String[] date= sort.split(",");
if(date[1].equals("ascend")) {
sortParam = RedisKey.humpToLine(date[0]);
sortRule = "asc";
}else {
sortParam =RedisKey.humpToLine(date[0]);
sortRule = "desc";
}
}else {
sortParam = "rec_date";
sortRule = "desc";
}
Page<EquipmentInformDto> pageBean = equipmentInformServiceImpl.queryDtoList(page,equipmentInformDto,sortParam,sortRule);
Page<EquipmentInformDto> result = new Page<EquipmentInformDto>(pageNum,pageSize);
long totle = pageBean.getTotal();
result.setRecords(pageBean.getRecords());
result.setTotal(totle);
return ResponseHelper.buildResponse(result);
}
/**
* 列表全部数据查询
*
* 根据sequenceNbr删除
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "设备告知单列表全部数据查询", notes = "设备告知单列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<EquipmentInformDto>> selectForList() {
return ResponseHelper.buildResponse(equipmentInformServiceImpl.queryForEquipmentInformList());
@DeleteMapping(value = "/delete_batch")
@ApiOperation(httpMethod = "DELETE", value = "批量删除告知书信息", notes = "批量删除告知书信息")
public ResponseModel<Boolean> deleteBySequenceNbr(@RequestParam(value = "sequenceNbrList") List<Long> sequenceNbrList){
return ResponseHelper.buildResponse(equipmentInformServiceImpl.batchDelete(sequenceNbrList));
}
}
......@@ -470,6 +470,17 @@ public class UnitInfoController extends BaseController {
return ResponseHelper.buildResponse(result);
}
/**
* 获取所有单位列表
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getAllUnit")
@ApiOperation(httpMethod = "GET", value = "获取所有单位列表", notes = "获取所有单位列表")
public ResponseModel<List<UnitInfoDto>> getAllUnit() {
List<UnitInfoDto> result = unitInfoServiceImpl.getAllUnit();
return ResponseHelper.buildResponse(result);
}
}
......@@ -302,8 +302,8 @@ public class UnitPersonController extends BaseController {
/**
* 根据sequenceNbr删除
*
* @return
*/
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/delete_batch")
@ApiOperation(httpMethod = "DELETE", value = "批量删除人员信息", notes = "批量删除人员信息")
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
......@@ -102,8 +105,30 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
return model;
}
@Override
public Page<EquipmentInformDto> queryDtoList(Page<EquipmentInformDto> page, EquipmentInformDto equipmentInformDto, String sortParam, String sortRule) {
Page<List<EquipmentInformDto>>list = baseMapper.queryDtoList(page,equipmentInformDto.getProductCode(),equipmentInformDto.getProductInformDateStart(),equipmentInformDto.getProductInformDateEnd(),
equipmentInformDto.getProductUnitId(),equipmentInformDto.getRegionCode(),equipmentInformDto.getAddress(),equipmentInformDto.getPlanProductDateStart(),equipmentInformDto.getPlanProductDateEnd(),
equipmentInformDto.getAcceptUnitId(),equipmentInformDto.getInformStatus(),sortParam,sortRule);
Page<EquipmentInformDto> page1 = new Page<>();
List<EquipmentInformDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(list.getRecords()),EquipmentInformDto.class);
page1.setCurrent(page.getCurrent());
page1.setSize(page.getSize());
page1.setTotal(list.getTotal());
page1.setRecords(resultDtoList);
return page1;
}
@Transactional
@Override
public Boolean batchDelete(List<Long> sequenceNbrList) {
for(Long sequenceNbr : sequenceNbrList) {
if(! this.update(new LambdaUpdateWrapper<EquipmentInform>().eq(EquipmentInform::getSequenceNbr,sequenceNbr).set(EquipmentInform::getIsDelete,true))) {
throw new BadRequest("删除" + sequenceNbr +"告知书失败");
}
}
return true;
}
// 保存附件信息
public void saveSourceFile(EquipmentInformDto model) {
......
......@@ -556,4 +556,9 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
public List<UnitInfoDto> getUseUnit() {
return baseMapper.getUnitByType(TzsCommonParam.USE_UNIT_CODE);
}
@Override
public List<UnitInfoDto> getAllUnit() {
return baseMapper.getAllUnit();
}
}
\ No newline at end of file
......@@ -734,18 +734,18 @@
</select>
<select id="getEquipSpecificDetail"
resultType="com.yeejoin.equipmanage.common.datasync.entity.FireEquipment">
SELECT
SELECT
es.id,
es.`code` AS mrid,
ed.`name`,
ed.`name` AS aliasname,
es.`name`,
es.`name` AS aliasname,
es.`code`,
e.`name` AS categoryname,
e.`code` AS categorycode,
ed.equipment_name AS categoryname,
ed.`code` AS categorycode,
( SELECT GROUP_CONCAT( url ) FROM wl_upload_file WHERE file_type = 'image' AND object_type = 'equipment' AND object_id = ed.id ) AS img,
es.iot_code AS iotcode,
f.`name` AS stationname,
f.`code` AS stationcode,
'' AS stationname,
'' AS stationcode,
ws.source_id AS buildid,
es.system_id AS fightingsystemids,
TRIM(CONCAT_WS(' ',ws.full_name,sd.description)) AS position,
......@@ -760,11 +760,9 @@
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
LEFT JOIN wl_area a ON es.area_id = a.id,
f_station_info f
LEFT JOIN wl_area a ON es.area_id = a.id
WHERE
es.id = #{id}
</select>
......
......@@ -314,21 +314,14 @@
</if>
wle.latitude
FROM wl_video wle
where wle.longitude is not null and wle.latitude is not null
<if test='distance!=null'>
and Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) &lt;=
#{distance}
<if test='longitude!=null and latitude!=null and distance!=null'>
and distance &lt;= #{distance}
</if>
<if test='longitude!=null and latitude!=null '>
ORDER BY distance
</if>
limit #{pageNum},#{pageSize}
</select>
......
......@@ -2389,5 +2389,14 @@
</sql>
</changeSet>
<changeSet author="helinlin" id="2021-12-23-11-06">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_contract"/>
</preConditions>
<comment>change org_code filed type</comment>
<sql>
ALTER TABLE `cb_contract` MODIFY COLUMN org_code VARCHAR(10) DEFAULT NULL COMMENT '机构代码用于权限过滤';
</sql>
</changeSet>
</databaseChangeLog>
......@@ -71,10 +71,11 @@
p_point_inputitem pi
LEFT JOIN p_input_item ii ON ii.id = pi.input_item_id
LEFT JOIN p_point_classify pc ON FIND_IN_SET(pc.id, pi.classify_ids) > 0
LEFT JOIN p_route_point prp ON prp.point_id = pi.point_id
WHERE
pi.point_id = #{pointId}
AND NOT FIND_IN_SET(pi.id,prp.exclude_items)
AND IF(prp.id, NOT FIND_IN_SET(pi.id,prp.exclude_items),' 1=1 ')
ORDER BY
pi.order_no
</select>
......
spring.application.name=TZS-kfm
spring.application.name=TZS
server.servlet.context-path=/tzs
server.port=11000
spring.profiles.active=jd
......
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