Commit b7d53a4a authored by 李成龙's avatar 李成龙

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 981393f9 777d2540
......@@ -52,7 +52,9 @@ public class ControllerAop {
@Autowired
private RedisUtils redisUtils;
@Pointcut("execution(public * com.yeejoin.amos.boot.module.*.biz.controller..*(..)) || execution(public * com.yeejoin.amos.*.business.controller..*(..))")
@Pointcut("(execution(public * com.yeejoin.amos.boot.module.*.biz.controller..*(..)) "
+ "|| execution(public * com.yeejoin.amos.*.business.controller..*(..)))"
+ " && !@annotation(org.springframework.scheduling.annotation.Scheduled))")
public void userCache() {
}
......
......@@ -11,6 +11,8 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -61,6 +63,9 @@ public class DataDictionaryController extends BaseController {
@Autowired
DataDictionaryMapper dataDictionaryMapper;
@Autowired
private RedisTemplate redisTemplate;
/**
* 新增数据字典
*
......@@ -112,6 +117,21 @@ public class DataDictionaryController extends BaseController {
}
/**
* 根据id查询
*
* @param code
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/code", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据code查询", notes = "根据code查询")
public DataDictionary selectByCode(HttpServletRequest request, @RequestParam("code") String code,
@RequestParam("type") String type) {
return iDataDictionaryService.getByCode(code, type);
}
/**
* 列表分页查询
*
* @return
......@@ -163,7 +183,9 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/gwmcDataDictionary/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典")
public ResponseModel<Object> gwmcDataDictionary(@PathVariable String type) throws Exception {
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
......@@ -184,7 +206,8 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/dataDictionary", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2")
public ResponseModel<Object> getDictionary(@RequestParam String type) throws Exception {
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
......@@ -205,7 +228,8 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/gwmcDataDictionary/FireChemical/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典")
public ResponseModel<Object> gwmcDataDictionaryFireChemical(@PathVariable String type) throws Exception {
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
......@@ -242,6 +266,9 @@ public class DataDictionaryController extends BaseController {
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<MenuFrom> menus = null;
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE_XIN + type, JSON.toJSON(menus), time);
......@@ -265,13 +292,19 @@ public class DataDictionaryController extends BaseController {
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = null;
List<Menu> menus =null;
List<Menu> menus = null;
if ("YJLDDW".equals(type)) {
list = dataDictionaryMapper.getNoInLinkUnit();
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
null);
} else {
list = iDataDictionaryService.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
null);
}
......@@ -283,4 +316,37 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(menuList);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/cleanRedis", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "清楚redis缓存", notes = "清楚redis缓存")
public ResponseModel<Object> cleanRedis(@RequestParam String type) throws Exception {
type = type.toLowerCase();
if ("all".equals(type)) {
RedisConnection redisConnection = redisTemplate.getConnectionFactory().getConnection();
redisConnection.flushAll();
redisConnection.close();
} else if (RedisKey.FORM_CODE.startsWith(type)) {
redisUtils.del(RedisKey.FORM_CODE);
} else if (RedisKey.DATA_DICTIONARY_CODE.startsWith(type)) {
redisUtils.del(RedisKey.DATA_DICTIONARY_CODE);
} else if (RedisKey.DATA_DICTIONARY_CODE_XIN.startsWith(type)) {
redisUtils.del(RedisKey.DATA_DICTIONARY_CODE_XIN);
} else if (RedisKey.FIREFIGHTERS_ID.startsWith(type)) {
redisUtils.del(RedisKey.FIREFIGHTERS_ID);
} else if (RedisKey.FIREFIGHTERS_LIST_ID.startsWith(type)) {
redisUtils.del(RedisKey.FIREFIGHTERS_LIST_ID);
} else if (RedisKey.EDUCATION_POST_EXPERIENCE_FIREFIGHTERS_ID.startsWith(type)) {
redisUtils.del(RedisKey.EDUCATION_POST_EXPERIENCE_FIREFIGHTERS_ID);
} else if (RedisKey.CONTRACT_ID.startsWith(type)) {
redisUtils.del(RedisKey.CONTRACT_ID);
} else if (RedisKey.THOUGHT_ID.startsWith(type)) {
redisUtils.del(RedisKey.THOUGHT_ID);
} else if (RedisKey.ALERTCALLED_ID.startsWith(type)) {
redisUtils.del(RedisKey.ALERTCALLED_ID);
} else if (RedisKey.TZS_ALERTCALLED_ID.startsWith(type)) {
redisUtils.del(RedisKey.TZS_ALERTCALLED_ID);
}
return ResponseHelper.buildResponse(type);
}
}
......@@ -22,4 +22,10 @@ public interface DataDictionaryMapper extends BaseMapper<DataDictionary> {
* @return
*/
public List<DataDictionary> getNoInLinkUnit();
/**
* 根据code值查询
* @return
*/
public DataDictionary getByCode(String code,String type);
}
package com.yeejoin.amos.boot.biz.common.dto;
import com.yeejoin.amos.feign.privilege.model.PermissionModel;
import lombok.Data;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@Data
public class PermissionModelDto {
private Double value;
private String permissionName;
private Long parentId;
private String permissionType;
private String frontComponent;
private String icon;
private String extraIcon;
private String path;
private String defaultRoute;
private Boolean isRoute;
private Boolean isBlank;
private String authCode;
private String authType;
private Integer sort;
private String menuAgent;
private String agencyCode;
private String appCode;
private String appName;
private Boolean hasPermission;
private Boolean isWarp;
private Boolean fixed;
private String warpProps;
private Long warpGroupSeq;
private java.util.Collection<PermissionModelDto> children;
private Long sequenceNbr;
}
......@@ -37,6 +37,9 @@ public class DataDictionary extends BaseEntity {
@ApiModelProperty(value = "父级")
private Long parent;
@ApiModelProperty(value = "类型说明")
private String typeDesc;
//新加排序字段
@ApiModelProperty(value = "排序字段")
private int sortNum;
......
package com.yeejoin.amos.boot.biz.common.enums;
import lombok.AllArgsConstructor;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@AllArgsConstructor
public enum HomePageEnum {
DISPATCHALARM("dispatchAlarm", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"),
DISPATCHTASK("dispatchTask", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchTaskServiceImpl"),
FIREALARM("fireAlarm", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireAlarmServiceImpl"),
FAULT("fault", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.FaultServiceImpl"),
SHIELD("shield", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.ShieldServiceImpl"),
WARNING("warning", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.WarningServiceImpl"),
NO("no", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.NoServiceImpl"),
YES("yes", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.YesServiceImpl");
private String code;//对应菜单组件名称
private String url;//组件值对应实现类的包名
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public static HomePageEnum statOf(String code) {
for (HomePageEnum state : values())
if (state.getCode().equals(code))
return state;
return null;
}
}
......@@ -24,13 +24,21 @@ public class FeignAuthRequestInterceptor implements RequestInterceptor {
/* Get token from header */
String authToken = StringUtils.isEmpty(request.getHeader("X-Access-Token")) ? request.getHeader("token") : request.getHeader("X-Access-Token");
/* If token not found get it from request parameter */
String appKey = request.getHeader("appKey");
String product = request.getHeader("product");
if (authToken == null) {
authToken = request.getParameter("token");
}
if (appKey == null) {
appKey = request.getParameter("appKey");
}
if (product == null) {
product = request.getParameter("product");
}
template.header("X-Access-Token", authToken);
template.header("token", authToken);
template.header("appKey", request.getHeader("appKey"));
template.header("product", request.getHeader("product"));
template.header("appKey", appKey);
template.header("product", product);
}
}
}
package com.yeejoin.amos.boot.biz.common.service;
/**
*
* 首页实现类
* */
public interface IHomePageService {
/**
* 首页标签统一填充数据接口
*
* ***/
public Object getHomePageData();
}
......@@ -48,6 +48,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return obj;
} else {
Collection<DataDictionary> list = this.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
"getName", "getParent", null);
MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
......@@ -69,6 +71,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return obj;
} else {
Collection<DataDictionary> list = this.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
......@@ -82,12 +86,20 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = this.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent", null);
return menus;
}
public DataDictionary getByCode(String code,String type) {
DataDictionary byCode = dataDictionaryMapper.getByCode(code,type);
return byCode;
}
public List<DataDictionary> getDataDictionaryAndCount(){
List<DataDictionary> list= dataDictionaryMapper.getDataDictionaryListAndCount();
......
......@@ -63,13 +63,13 @@ public class DateUtils {
}
/**
* 获取现在时间字符串
* 获取现在日期字符串
*
* @return返回字符串格式 yyyy-MM-dd HH:mm:ss
* @return返回字符串格式 yyyy-MM-dd
*/
public static String getNowStrLong() {
public static String getDateNowShortStr() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN);
String dateString = formatter.format(currentTime);
return dateString;
}
......
package com.yeejoin.amos.boot.biz.common.utils;
import com.yeejoin.amos.boot.biz.common.dto.PermissionModelDto;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/***
*
*文件类
......@@ -10,4 +13,5 @@ import org.springframework.web.multipart.MultipartFile;
public interface FileService {
String uploadFile(MultipartFile file,String product,String appKey,String token );
List<PermissionModelDto> currentPermissionTree();
}
......@@ -47,4 +47,14 @@ WHERE
cbb.type = 'YJLDDW' and cbb.is_delete = 0
AND elink.count IS NOT NULL
</select>
<select id ="getByCode" resultType="com.yeejoin.amos.boot.biz.common.entity.DataDictionary">
SELECT
*
FROM
cb_data_dictionary cbb
WHERE
cbb.code = #{code} and cbb.is_delete = 0 and cbb.type = #{type}
</select>
</mapper>
......@@ -28,6 +28,7 @@ public class FireTeamDto extends BaseDto {
@ExcelProperty(value = "所属单位", index = 0)
@ApiModelProperty(value = "机构名称")
@ExplicitConstraint(indexNum = 0, sourceClass = RoleNameExplicitConstraint.class,method="getCompanyDetailTree") //动态下拉内容
private String companyName;
@ExcelIgnore
......
......@@ -31,10 +31,24 @@ public class FormValue implements Serializable{
@ApiModelProperty(value = "是否一行显示")
private boolean block;
@ApiModelProperty(value = "value 所对应的字符名称")
private String valueName;
public FormValue() {
}
public FormValue(String key, String label, String type, String value,boolean block,String valueName) {
super();
this.key = key;
this.label = label;
this.type = type;
this.value = value;
this.block = block;
this.valueName =valueName;
}
public FormValue(String key, String label, String type, String value,boolean block) {
super();
this.key = key;
......
......@@ -52,6 +52,7 @@ public class KeySiteExcleDto implements Serializable {
@ApiModelProperty(value = "建筑面积(㎡)")
private String buildingArea;
@ExcelIgnore
@ExcelProperty(value = "建筑高度(m)", index = 5)
@ApiModelProperty(value = "建筑高度(m)")
private String buildingHeight;
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -11,17 +12,20 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 工作经历
*
* @author tb
* @date 2021-06-07
*/
* 工作经历
*
* @author tb
* @date 2021-06-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cb_firefighters_workexperience")
@ApiModel(value="FirefightersWorkexperience对象", description="工作经历")
@ApiModel(value = "FirefightersWorkexperience对象", description = "工作经历")
public class FirefightersWorkexperience extends BaseEntity {
/**
*
......@@ -29,15 +33,19 @@ public class FirefightersWorkexperience extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "参加工作时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date workingHours;
@ApiModelProperty(value = "参加消防部门工作时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fireWorkingHours;
@ApiModelProperty(value = "人员id")
private Long firefightersId;
@ApiModelProperty(value = "更新时间")
@TableField(fill=FieldFill.UPDATE)
@TableField(fill = FieldFill.UPDATE)
private Date updateTime;
}
......@@ -11,6 +11,8 @@ import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import java.util.HashMap;
import java.util.Map;
......@@ -30,7 +32,7 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
/**
* 避免生成的导入模板下拉值获取不到
*/
private static final Integer LIMIT_NUMBER = 10;
private static final Integer LIMIT_NUMBER = 1;
......@@ -88,6 +90,14 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
// 将刚才设置的sheet引用到你的下拉列表中
DataValidationConstraint constraint = helper.createFormulaListConstraint(refers);
DataValidation dataValidation = helper.createValidation(constraint, rangeList);
if(dataValidation instanceof XSSFDataValidation){
dataValidation.setSuppressDropDownArrow(true);
dataValidation.setShowErrorBox(true);
}else{
dataValidation.setSuppressDropDownArrow(false);
}
writeSheetHolder.getSheet().addValidationData(dataValidation);
// 设置存储下拉列值得sheet为隐藏
int hiddenIndex = workbook.getSheetIndex(sheetName);
......@@ -95,17 +105,17 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
workbook.setSheetHidden(hiddenIndex, true);
}
}
// 下拉列表约束数据
DataValidationConstraint constraint = helper.createExplicitListConstraint(v);
// 设置约束
DataValidation validation = helper.createValidation(constraint, rangeList);
// 阻止输入非下拉选项的值
validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
validation.setShowErrorBox(true);
validation.setSuppressDropDownArrow(true);
validation.createErrorBox("提示", "此值与单元格定义格式不一致");
// validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓");
sheet.addValidationData(validation);
// // 下拉列表约束数据
// DataValidationConstraint constraint = helper.createExplicitListConstraint(v);
// // 设置约束
// DataValidation validation = helper.createValidation(constraint, rangeList);
// // 阻止输入非下拉选项的值
// validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
// validation.setShowErrorBox(true);
// validation.setSuppressDropDownArrow(true);
// validation.createErrorBox("提示", "此值与单元格定义格式不一致");
// // validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓");
// sheet.addValidationData(validation);
});
}
......
......@@ -159,5 +159,29 @@ public interface EquipFeignClient {
@RequestMapping(value = "/video/getByid", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getByid( @RequestParam Long id);
/**
*
*获取车辆简要信息
* @param id 消防车id
* @return
*/
@RequestMapping(value = "/car/simple/{id}", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> queryCarSimpleInfoById(@PathVariable Long id);
/**
* 统计
**/
@RequestMapping(value = "/equipSpecificAlarm/getCountAlarm/{type}", method = RequestMethod.GET)
ResponseModel<Integer> getCountAlarm(@PathVariable String type);
/**
* 统计
**/
@RequestMapping(value = "/equipSpecificAlarm/getcountAlarmHandle/{type}", method = RequestMethod.GET)
ResponseModel<Integer> getcountAlarmHandle(@PathVariable String type);
}
......@@ -31,4 +31,7 @@ public interface IotFeignClient {
@RequestMapping(value = "/v1/iot/DynamicFlightInfo/detail/{dynamicFlightId}", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> findImgByDynamicFlightId(@PathVariable String dynamicFlightId);
@RequestMapping(value = "/v1/iot/DynamicFlightInfo/plane/{dynamicFlightId}", method = RequestMethod.GET)
ResponseModel<Object> DynamicFlightInfo(@PathVariable String dynamicFlightId);
}
......@@ -20,14 +20,14 @@ import java.util.Map;
*/
public interface FireStationMapper extends BaseMapper<FireStation> {
// 微型消防站按时间倒叙排列add order by cb_fire_station.rec_date desc 2021-09-08 by kongfm
@Select("<script>"
+ "select * from cb_fire_station where cb_fire_station.is_delete=0 "
+ "<if test='par.name!=null'> and cb_fire_station.name like CONCAT('%',#{par.name},'%') </if>"
+ "<if test='par.bizCompanyId!=null'> and cb_fire_station.biz_company_id = #{par.bizCompanyId} </if>"
+ "<if test='par.bizCompanyCode!=null'> and cb_fire_station.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+"limit #{pageNum},#{pageSize}"
+" order by cb_fire_station.rec_date desc limit #{pageNum},#{pageSize}"
+ "</script>")
List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par);
@Select("<script>"
......
package com.yeejoin.amos.boot.module.common.api.service;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
/**
......@@ -21,4 +22,11 @@ public interface IDutyCarService extends IDutyCommonService {
* @return List<DutyCarDto>
*/
DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto);
/**
* 判断当前登陆人是否是车辆驾驶员
*
* @return
*/
JSONObject isFireCarDriver();
}
......@@ -61,7 +61,7 @@ public interface IDutyCommonService {
* @param instanceId 实例id
* @return Boolean
*/
Boolean deleteDutyData(Long instanceId);
Boolean deleteDutyData(Long instanceId, String startTime, String endTime);
/**
* 查询指定条件的值班人信息
......@@ -79,4 +79,11 @@ public interface IDutyCommonService {
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> listOnDutyPerson();
/**
* 根据当前时间获取值班班次id列表
*
* @return
*/
List<Long> getDutyShiftIdList();
}
......@@ -223,7 +223,7 @@ public interface IOrgUsrService {
/**
* 获取登陆人关联机场单位人员信息,部门信息
*/
List<Map<String, Object>> getLoginUserDetails(AgencyUserModel user);
List<Map<String, Object>> getLoginUserDetails(String userId);
List<OrgUsr> getPersonListByParentId(Long id);
......
......@@ -19,7 +19,7 @@
and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> #{endDate}
and s.app_Key = #{appKey}
GROUP BY s.duty_date
GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 -->
) a) as maxDutyPersonNumDay,
(select
IFNULL(max(num),0)
......
......@@ -28,7 +28,7 @@
</if>
</select>
<!--消防队伍列表按时间倒叙排列order by x.rec_date desc 2021-09-08 by kongfm -->
<select id="getFireTeamForPage" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamCardDto">
SELECT
a.sequence_nbr sequenceNbr,
......@@ -63,6 +63,7 @@
and a.sequence_nbr = #{par.nodeId}
</if>
</if>
order by a.rec_date desc
</select>
<select id="listFireTeamDto" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto">
select t.*, p.name parentName
......@@ -70,13 +71,17 @@
left join cb_fire_team p on t.parent = p.sequence_nbr
where t.is_delete = #{isDelete}
</select>
<!--消防队伍列表按时间倒叙排列order by x.rec_date desc 2021-09-08 by kongfm -->
<!--BUG 2846 最初开发人员在动态语句后加入分号导致错误 2021-09-10 by kongfm -->
<select id="listFireTeamById" resultType="com.yeejoin.amos.boot.module.common.api.entity.FireTeam">
SELECT *
FROM cb_fire_team
WHERE is_delete = 0
<if test="teamId != null">
AND tree_code LIKE CONCAT((SELECT tree_code FROM cb_fire_team WHERE sequence_nbr = #{teamId}),'%');
AND tree_code LIKE CONCAT((SELECT tree_code FROM cb_fire_team WHERE sequence_nbr = #{teamId}),'%')
</if>
order by cb_fire_team.rec_date desc
</select>
......
......@@ -3,16 +3,19 @@
<mapper
namespace="com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper">
<select id="getFirefightersJobTitleCount" resultType="com.yeejoin.amos.boot.biz.common.utils.FirefightersTreeDto">
<select id="getFirefightersJobTitleCount"
resultType="com.yeejoin.amos.boot.biz.common.utils.FirefightersTreeDto">
select COUNT(a.sequence_nbr) num, a.job_title_code jobTitleCode
from cb_firefighters a
where a.is_delete = 0
GROUP BY a.job_title_code
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefighters"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto">
select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code areasExpertiseCode from cb_firefighters a LEFT JOIN cb_firefighters_post b on
select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code
areasExpertiseCode from cb_firefighters a LEFT JOIN
cb_firefighters_post b on
a.sequence_nbr=b.firefighters_id where a.is_delete=0
<if test='par.postQualification!=null'>and b.post_qualification_code = #{par.postQualification}</if>
<if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
......@@ -20,11 +23,12 @@
<if test='par.state!=null'>and a.state_code= #{par.state}</if>
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date limit #{pageNum},#{pageSize}
ORDER BY a.rec_date desc limit #{pageNum},#{pageSize}
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefightersCount" resultType="Map">
select COUNT(a.sequence_nbr) num from cb_firefighters a LEFT JOIN
cb_firefighters_post b on a.sequence_nbr=b.firefighters_id where
......@@ -35,10 +39,11 @@
<if test='par.state!=null'>and a.state_code= #{par.state}</if>
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date
ORDER BY a.rec_date desc
</select>
......@@ -69,13 +74,21 @@
</select>
<!-- BUG3553 BY kongfm 人员关系显示汉字-->
<select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto">
select f.*,
(select cb_fire_team.name from cb_fire_team where cb_fire_team.sequence_nbr=f.fire_team_id) fireTeam,
emergency_contact, (select da.name from cb_data_dictionary da where da.code = fc.relationship) as relationship , emergency_contact_phone
from cb_firefighters f
left join cb_firefighters_contacts fc on f.sequence_nbr = fc.firefighters_id
<!-- BUG3553 BY kongfm 人员关系显示汉字 -->
<select id="exportToExcel"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto">
SELECT
f.*,
( SELECT cb_fire_team.NAME FROM cb_fire_team WHERE
cb_fire_team.sequence_nbr = f.fire_team_id ) fireTeam,
emergency_contact,
da.NAME AS relationship,
emergency_contact_phone
FROM
cb_firefighters f
LEFT JOIN cb_firefighters_contacts fc ON f.sequence_nbr =
fc.firefighters_id
left join cb_data_dictionary da on da.CODE = fc.relationship
where f.is_delete = #{isDelete}
</select>
......
......@@ -130,7 +130,7 @@
b.instance_id=a.instance_id where a.unit_name is not null
</select>
<!--联动单位列表按时间倒叙排列add order by clu.rec_date desc 同时处理单位根节点-1时查询全部数据问题 2021-09-08 by kongfm -->
<select id="getEmergencyLinkageUnitList"
resultType="java.util.Map">
SELECT
......@@ -182,19 +182,22 @@
cb_linkage_unit clu
WHERE clu.is_delete=0
<if test="unitName != null and unitName != ''">
AND clu.unit_name LIKE concat(#{unitName}, '%')
AND clu.unit_name LIKE concat('%',#{unitName}, '%')
</if>
<if
test="linkageUnitType != null and linkageUnitType != ''">
AND clu.linkage_unit_type =#{linkageUnitType}
</if>
<if
test="emergencyLinkageUnitCode != null and emergencyLinkageUnitCode != ''">
test="emergencyLinkageUnitCode != null and emergencyLinkageUnitCode != '' ">
<if test="emergencyLinkageUnitCode != '-1'">
AND clu.emergency_linkage_unit_code =#{emergencyLinkageUnitCode}
</if>
</if>
<if
test="linkageUnitTypeCode != null and linkageUnitTypeCode != ''">
AND clu.linkage_unit_type_code =#{linkageUnitTypeCode}
</if>
order by clu.rec_date desc
</select>
</mapper>
......@@ -52,7 +52,7 @@
</if>
</select>
<!--机场单位人员按时间倒叙排列add order by u.rec_date desc 2021-09-08 by kongfm -->
<select id="selectPersonList" resultType="Map">
select * from (
SELECT
......@@ -86,6 +86,7 @@
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
order by u.rec_date desc
)a where a.sequenceNbr is not null
<if test="map.fieldsValue != null">
<foreach collection="map.fieldsValue.keys" item="item">AND a.${item} = #{map.fieldsValue[${item}]}</foreach>
......@@ -159,6 +160,7 @@
and biz_org_code like concat(#{bizOrgCode}, '%')
</select>
<!--消防队伍列表按时间倒叙排列order by x.rec_date desc 2021-09-08 by kongfm -->
<select id="queryOrgPersonDtoList" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto">
select u.*,
v.person_number,
......@@ -204,6 +206,7 @@
) v
on u.sequence_nbr = v.instance_id
where u.is_delete = #{isDelete}
order by u.rec_date desc
</select>
<select id="listOrgUserById" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
SELECT *
......
......@@ -115,6 +115,7 @@
from cb_water_resource
where is_delete = #{isDelete}
</select>
<!--消防水源按时间倒叙排列add order by cb_water_resource.rec_date desc 2021-09-08 by kongfm -->
<select id="getWaterResourcePageByParams"
resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto">
select * from cb_water_resource where is_delete = 1
......@@ -133,6 +134,7 @@
<if test="belongBuildingId != null and belongBuildingId.size() > 0">
and find_in_set(belong_building_id, #{belongBuildingId}) > 0
</if>
order by cb_water_resource.rec_date desc
</select>
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
*
*
* @author system_generator
* @date 2021-09-08
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertCalledFeedbackDto", description="")
public class AlertCalledFeedbackDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情id")
private Long alertCalledId;
@ApiModelProperty(value = "反馈警情任务状态")
private String status;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "图片附件")
private Map<String, List<AttachmentDto>> attachments;
}
package com.yeejoin.amos.boot.module.jcs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
*
*
* @author system_generator
* @date 2021-09-08
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_alert_called_feedback")
public class AlertCalledFeedback extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 警情id
*/
@TableField("alert_called_id")
private Long alertCalledId;
/**
* 反馈警情状态
*/
@TableField(value = "status")
private String status;
/**
* 备注
*/
@TableField("remark")
private String remark;
}
package com.yeejoin.amos.boot.module.jcs.api.enums;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.List;
import java.util.Map;
/**
*
* <pre>
* 警情反馈状态枚举
* </pre>
*
* @author tb
* @version $Id: AlertStatusEnum.java, v 0.1 2021年6月23日 下午5:11:18 gwb Exp $
*/
@Getter
@AllArgsConstructor
public enum AlertFeedbackStatusEnum {
/**
* 执行中
*/
执行中("executing", "执行中"),
/**
* 已完成
*/
已完成("finished", "已完成");
private String code;
private String name;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static AlertFeedbackStatusEnum getEnum(String code)
{
for (AlertFeedbackStatusEnum status : AlertFeedbackStatusEnum.values())
{
if (status.getCode().equals(code))
{
return status;
}
}
return null;
}
/**
* 枚举转列表
*
* @return
*/
public static List<Map<String, String>> toList() {
List<Map<String, String>> enumList = Lists.newArrayList();
for (AlertFeedbackStatusEnum item : AlertFeedbackStatusEnum.values()) {
Map<String, String> map = Maps.newHashMap();
map.put("key", item.getCode());
map.put("label", item.getName());
enumList.add(map);
}
return enumList;
}
}
......@@ -17,7 +17,7 @@ public enum ExcelEnums {
WXXFZ("微型消防站", "微型消防站", "com.yeejoin.amos.boot.module.common.api.dto.FireStationDto","WXXFZ"),//("WXXFZ","微型消防站")
XFRY ("消防人员", "消防人员", "com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto","XFRY"),//("XFRY","消防人员")
WBRY ("维保人员", "维保人员", "com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto","WBRY"),//("WBRY",维保人员)
KEYSITE ("重點部位", "重點部位", "com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto","KEYSITE"),//{"KEYSITE":重點部位}
KEYSITE ("重点部位", "重点部位", "com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto","KEYSITE"),//{"KEYSITE":重點部位}
CLZQ ("车辆执勤", "车辆执勤", "com.yeejoin.amos.boot.module.common.api.dto.DutyCarExcelDto","CLZQ"),//("CLZQ","车辆执勤")
JCDWRY ("机场单位人员", "机场单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto","JCDWRY"),//("JCDW","机场单位")
LDDW ("联动单位", "联动单位", "com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto","LDDW"),//("JCDW","机场单位")
......
package com.yeejoin.amos.boot.module.jcs.api.enums;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
......@@ -32,4 +37,20 @@ public enum FireCarStatusEnum {
}
return null;
}
/**
* 枚举转列表
*
* @return
*/
public static List<Map<String, String>> toList() {
List<Map<String, String>> enumList = Lists.newArrayList();
for (FireCarStatusEnum item : FireCarStatusEnum.values()) {
Map<String, String> map = Maps.newHashMap();
map.put("key", item.getCode());
map.put("label", item.getName());
enumList.add(map);
}
return enumList;
}
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalledFeedback;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper 接口
*
* @author system_generator
* @date 2021-09-08
*/
public interface AlertCalledFeedbackMapper extends BaseMapper<AlertCalledFeedback> {
}
......@@ -44,4 +44,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
String endTime,
String data,
String lift);
Integer AlertCalledcount(@Param("alertStatus")int alertStatus);
}
package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFeedbackDto;
/**
* 接口类
*
* @author system_generator
* @date 2021-09-08
*/
public interface IAlertCalledFeedbackService {
/**
* app-警情反馈
*
* @param model
* @return true/false
*/
boolean handleFeedback(AlertCalledFeedbackDto model);
}
......@@ -71,4 +71,8 @@ public interface IAlertCalledService {
* @return
*/
Map<String, Object> queryAlertCalledById(Long id);
Integer AlertCalledcount(int type);
}
......@@ -9,9 +9,9 @@ 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.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.PowerTransfer;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
import java.util.List;
import java.util.Map;
......@@ -63,4 +63,18 @@ public interface IPowerTransferService extends IService<PowerTransfer> {
* @return
*/
JSONObject getPowerTransferCarResourceStatistics(Long alertCalledId);
/**
* 获取车辆状态列表
*
* @return
*/
List<Map<String, String>> getFireCarStatusList();
/**
* 获取调派任务状态列表
*
* @return
*/
List<Map<String, String>> getDispatchTaskStatusList();
}
<?xml version="1.0" encoding="UTF-8"?>
<!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.jcs.api.mapper.AlertCalledFeedbackMapper">
</mapper>
......@@ -173,4 +173,18 @@
</select>
<!--统计未结束的警情数量-->
<select id="AlertCalledcount" resultType="Integer">
select COUNT(*) from jc_alert_called where is_delete=0
<if test="alertStatus!= null ">
and alert_status = #{alertStatus}
</if>
</select>
</mapper>
......@@ -39,7 +39,7 @@
SELECT ptcr.resources_id carId
FROM `jc_power_transfer` pt
LEFT JOIN jc_power_transfer_company ptc ON ptc.power_transfer_id = pt.sequence_nbr
LEFT JOIN jc_power_transfer_company_resources ptcr ON ptcr.power_transfer_company_id = ptc.sequence_nbr
RIGHT JOIN jc_power_transfer_company_resources ptcr ON ptcr.power_transfer_company_id = ptc.sequence_nbr
WHERE pt.alert_called_id = #{alertCalledId}
</select>
......
package com.yeejoin.amos.supervision.common.enums;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public enum CheckItemFinishStatusEnum {
TIME_DESC("未执行", "0"),
TIME_ASC("已执行", "1");
/**
* 名字
*/
private String name;
/**
* 编号
*/
private String code;
CheckItemFinishStatusEnum(String name, String code) {
this.name = name;
this.code = code;
}
public static List<Map<String, Object>> getEnumList() {
return Arrays.stream(CheckItemFinishStatusEnum.values()).map(e -> {
Map<String, Object> map = new HashMap<>();
map.put("name", e.getName());
map.put("value", e.getCode());
return map;
}).collect(Collectors.toList());
}
public static String getName(String value) {
for (CheckItemFinishStatusEnum c : CheckItemFinishStatusEnum.values()) {
if (c.getCode().equals(value)) {
return c.name;
}
}
return null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
package com.yeejoin.amos.supervision.common.enums;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public enum CheckTypeSuEnum {
TIME_DESC("日常检查", "1"),
TIME_ASC("专项检查", "2");
/**
* 名字
*/
private String name;
/**
* 编号
*/
private String code;
CheckTypeSuEnum(String name, String code) {
this.name = name;
this.code = code;
}
public static List<Map<String, Object>> getEnumList() {
return Arrays.stream(CheckTypeSuEnum.values()).map(e -> {
Map<String, Object> map = new HashMap<>();
map.put(e.getCode(), e.getName());
return map;
}).collect(Collectors.toList());
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
......@@ -5,21 +5,16 @@ import java.util.stream.Collectors;
/**
* @author DELL
* 维保任务排序
* 防火监督任务排序
*/
public enum OrderByEnum {
/**
* 维保任务排序
* 防火监督任务排序
*/
TIME_DESC("时间倒序", "1", "beginTime desc"),
TIME_ASC("时间正序", "2", "beginTime asc"),
PLAN_TASK_NUM_ASC("检查设施数正序", "3", "taskPlanNum asc"),
PLAN_TASK_NUM_DESC("检查设施数倒序", "4", "taskPlanNum desc"),
FINISH_NUM_DESC("完成数倒序", "5", "finishNum desc"),
FINISH_NUM_ASC("完成数正序", "6", "finishNum asc"),
PLAN_TASK_ITEM_NUM_ASC("检查项正序", "7", "itemNum asc"),
PLAN_TASK_ITEM_NUM_DESC("检查项正序", "8", "itemNum desc");
PLAN_TASK_NUM_ASC("计划检查项数正序", "3", "taskPlanNum asc");
/**
* 名字
......
package com.yeejoin.amos.supervision.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum PlanTaskDetailIsFinishEnum {
UNFINISHED("未开始",0),
......@@ -65,6 +67,17 @@ public enum PlanTaskDetailIsFinishEnum {
return null;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> nameList = new ArrayList<>();
for (PlanTaskDetailIsFinishEnum c: PlanTaskDetailIsFinishEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("name", c.getName());
map.put("value", c.getValue() +"");
nameList.add(map);
}
return nameList;
}
public static List<String> getEnumNameList() {
List<String> nameList = new ArrayList<String>();
for (PlanTaskDetailIsFinishEnum c: PlanTaskDetailIsFinishEnum.values()) {
......
......@@ -7,7 +7,7 @@ import java.util.Map;
public enum PlanTaskFinishStatusEnum {
NOTSTARTED("未开始",0),
UNDERWAY("待执行",1),
UNDERWAY("执行中",1),
FINISHED("已结束",2),
OVERTIME("已超时",3);
......
package com.yeejoin.amos.supervision.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import org.hibernate.annotations.Where;
import javax.persistence.*;
/**
* 检查项
......@@ -183,42 +179,54 @@ public class InputItem extends BasicEntity {
private String testRequirement;
/**
* 检查类型字典值
*/
@Column(name = "check_type_Val")
private String checkTypeId;
/**
* 检查类型
*/
@Column(name="check_type")
@Column(name = "check_type")
private String checkType;
/**
* 父类检查项id
*/
@Column(name="item_parent")
@Column(name = "item_parent")
private String itemParent;
/**
* 检查项分类
*/
@Column(name="item_classify")
@Column(name = "item_classify")
private String itemClassify;
/**
* 适用检查类别
*/
@Lob
@Column(name="item_type_classify")
@Column(name = "item_type_classify")
private String itemTypeClassify;
/**
* 检查项等级
*/
@Column(name="item_level")
@Column(name = "item_level")
private String itemLevel;
/**
* 检查项启用
*/
@Column(name="item_start")
@Column(name = "item_start")
private Integer itemStart;
/**
* 扩展属性
*/
@Transient
private String ext;
public Integer getItemStart() {
return itemStart;
}
......@@ -498,4 +506,20 @@ public class InputItem extends BasicEntity {
public void setBasisJson(String basisJson) {
this.basisJson = basisJson;
}
public String getCheckTypeId() {
return checkTypeId;
}
public void setCheckTypeId(String checkTypeId) {
this.checkTypeId = checkTypeId;
}
public String getExt() {
return ext;
}
public void setExt(String ext) {
this.ext = ext;
}
}
\ No newline at end of file
package com.yeejoin.amos.supervision.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.fasterxml.jackson.annotation.JsonBackReference;
import javax.persistence.*;
/**
* The persistent class for the p_route_point_item database table.
*
*/
@Entity
@Table(name="p_route_point_item")
@NamedQuery(name="RoutePointItem.findAll", query="SELECT r FROM RoutePointItem r")
@Table(name = "p_route_point_item")
@NamedQuery(name = "RoutePointItem.findAll", query = "SELECT r FROM RoutePointItem r")
public class RoutePointItem extends BasicEntity {
private static final long serialVersionUID = 1L;
/**
/**
* 创建者
*/
@Column(name="creator_id")
@Column(name = "creator_id")
private String creatorId;
/**
* 排序
*/
@Column(name="order_no")
@Column(name = "order_no")
private int orderNo;
/**
* 巡检点检查项id
*/
@Column(name="point_input_item_id")
@Column(name = "point_input_item_id")
private long pointInputItemId;
/**
* 路线点表id
*/
@Column(name="route_point_id")
@Column(name = "route_point_id")
private long routePointId;
/**
* 点分类id
*/
@Column(name="point_classify_id")
@Column(name = "point_classify_id")
private Long pointClassifyId;
/**
* 前端标记是否绑定
*/
......@@ -66,7 +58,21 @@ public class RoutePointItem extends BasicEntity {
*/
@Column(name = "basis_json", columnDefinition = "text COMMENT '标准依据'")
private String basisJson;
/**
* 检查项ID
*/
@Column(name = "input_item_id")
private Long inputItemId;
/**
* 计划ID
*/
@Column(name = "plan_id")
private Long planId;
private long pointId;
public RoutePointItem() {
}
......@@ -107,6 +113,7 @@ public class RoutePointItem extends BasicEntity {
public RoutePoint getRoutePoint() {
return routePoint;
}
@JsonBackReference
public void setRoutePoint(RoutePoint routePoint) {
this.routePoint = routePoint;
......@@ -129,6 +136,7 @@ public class RoutePointItem extends BasicEntity {
public void setBasisJson(String basisJson) {
this.basisJson = basisJson;
}
@Transient
public long getPointId() {
return pointId;
......@@ -146,4 +154,20 @@ public class RoutePointItem extends BasicEntity {
public void setIsBound(boolean bound) {
isBound = bound;
}
public Long getInputItemId() {
return inputItemId;
}
public void setInputItemId(Long inputItemId) {
this.inputItemId = inputItemId;
}
public Long getPlanId() {
return planId;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.command.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -7,6 +8,8 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.dto.PermissionModelDto;
import com.yeejoin.amos.boot.biz.common.enums.HomePageEnum;
import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
import com.yeejoin.amos.boot.biz.common.utils.WordConverterUtils;
import com.yeejoin.amos.boot.module.command.api.dao.SeismometeorologyDtoDao;
......@@ -32,6 +35,8 @@ import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceZhDto;
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.feign.IotFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IFireChemicalService;
import com.yeejoin.amos.boot.module.common.api.service.IFireExpertsService;
......@@ -58,6 +63,7 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService;
import com.yeejoin.amos.feign.privilege.model.PermissionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -82,6 +88,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -153,8 +160,10 @@ public class CommandController extends BaseController {
@Autowired
IDutyPersonService iDutyPersonService;
@Autowired
IDutyCarService iDutyCarService;
@Autowired
IotFeignClient iotFeignClient;
/**
* 警情列表
*
......@@ -696,6 +705,68 @@ public class CommandController extends BaseController {
}
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "currentPermissionTree")
@ApiOperation(httpMethod = "GET", value = "用户菜单", notes = "用户菜单")
public ResponseModel<List<PermissionModelDto>> currentPermissionTree() {
//获取用户app 菜单
List<PermissionModelDto> list= remoteSecurityService.currentPermissionTree();
List<PermissionModelDto> listdate= getHomePermissionModel(list);
getPermissionModel(listdate);
return ResponseHelper.buildResponse(listdate);
}
public List<PermissionModelDto> getHomePermissionModel(List<PermissionModelDto> list) {
if(list!=null && !list.isEmpty()){
for (PermissionModelDto itme : list) {
if("Home".equals(itme.getFrontComponent())){
String userStr = JSON.toJSONString(itme.getChildren());
List<PermissionModelDto> userList = JSON.parseArray(userStr, PermissionModelDto.class);
return userList;
}
if(itme.getChildren()!=null&&!itme.getChildren().isEmpty()){
String userStr = JSON.toJSONString(itme.getChildren());
List<PermissionModelDto> userList = JSON.parseArray(userStr, PermissionModelDto.class);
return getHomePermissionModel(userList);
}
}
}
return null;
}
public void getPermissionModel(List<PermissionModelDto> list) {
if(list!=null && !list.isEmpty()){
list.forEach(itme->{
HomePageEnum homePageEnum= HomePageEnum.statOf(itme.getFrontComponent());
if(itme.getFrontComponent()!=null&&homePageEnum !=null){
try {
Class clz = Class.forName(homePageEnum.getUrl());
Object entity = clz.newInstance();
Method repay1 = clz.getDeclaredMethod("getHomePageData");
Object value = repay1.invoke(entity);
itme.setValue(value!=null?Double.valueOf(value.toString()):0);
if(itme.getChildren()!=null&&!itme.getChildren().isEmpty()){
String userStr = JSON.toJSONString(itme.getChildren());
List<PermissionModelDto> userList = JSON.parseArray(userStr, PermissionModelDto.class);
getPermissionModel(userList);
itme.setChildren(userList);
}
} catch (Exception e) {
e.printStackTrace();
}
}else{
if(itme.getChildren()!=null&&!itme.getChildren().isEmpty()){
String userStr = JSON.toJSONString(itme.getChildren());
List<PermissionModelDto> userList = JSON.parseArray(userStr, PermissionModelDto.class);
getPermissionModel(userList);
itme.setChildren(userList);
}
}
});
}
}
/**
......@@ -996,7 +1067,10 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "app-更新车辆状态", notes = "app-更新车辆状态")
@PutMapping(value = "/app/carStatus")
public ResponseModel<Boolean> updateCarStatus(@RequestParam CarStatusInfoDto carStatusInfoDto) {
public ResponseModel<Boolean> updateCarStatus(@RequestParam String carId, @RequestParam String carStatus) {
CarStatusInfoDto carStatusInfoDto = new CarStatusInfoDto();
carStatusInfoDto.setSequenceNbr(carId);
carStatusInfoDto.setStatus(carStatus);
try {
equipFeignClient.updateCarStatus(Lists.newArrayList(carStatusInfoDto));
} catch (Exception e) {
......@@ -1038,4 +1112,66 @@ public class CommandController extends BaseController {
public ResponseModel<Object> statisticsByAlertCalledId(@PathVariable Long alertId) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferCarResourceStatistics(alertId));
}
/**
* app-车辆状态列表
**/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/app/carStatus/list")
@ApiOperation(httpMethod = "GET", value = "app-车辆状态列表", notes = "app-车辆状态列表")
public ResponseModel<Object> carStatusList() {
return ResponseHelper.buildResponse(powerTransferService.getFireCarStatusList());
}
/**
* app-调派任务状态列表
**/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/app/dispatchTaskStatus/list")
@ApiOperation(httpMethod = "GET", value = "app-调派任务状态列表", notes = "app-调派任务状态列表")
public ResponseModel<Object> powerTransferResourceStatusList() {
return ResponseHelper.buildResponse(powerTransferService.getDispatchTaskStatusList());
}
/**
* app-当前登陆人是否是驾驶员
**/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/app/personPost")
@ApiOperation(httpMethod = "GET", value = "app-当前登陆人是否是驾驶员", notes = "app-当前登陆人是否是驾驶员")
public ResponseModel<Object> isFireCarDriver() {
return ResponseHelper.buildResponse(iDutyCarService.isFireCarDriver());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/DynamicFlightInfo/{dynamicFlightId}")
@ApiOperation(httpMethod = "GET", value = "航班信息", notes = "航班信息")
public ResponseModel<Object> DynamicFlightInfo(@PathVariable String dynamicFlightId) {
ResponseModel<Object> dataModel = iotFeignClient.DynamicFlightInfo(dynamicFlightId);
if (dataModel != null) {
return ResponseHelper.buildResponse(dataModel.getResult());
}
return ResponseHelper.buildResponse(null);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.command.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.dto.PermissionModelDto;
import com.yeejoin.amos.boot.biz.common.utils.FileService;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecCVCDSA;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/***
......@@ -46,5 +49,22 @@ public class RemoteSecurityService implements FileService{
}
}
@Override
public List<PermissionModelDto> currentPermissionTree() {
List<Object> dictionarieModel = null;
FeignClientResult feignClientResult;
try {
feignClientResult = Privilege.permissionClient.currentPermissionTree( "APP",null,null,null );
dictionarieModel = (List<Object>) feignClientResult.getResult();
} catch (InnerInvokException e) {
e.printStackTrace();
}
String userStr = JSON.toJSONString(dictionarieModel);
List<PermissionModelDto> userList = JSON.parseArray(userStr, PermissionModelDto.class);
return userList;
}
}
......@@ -11,7 +11,9 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -127,13 +129,21 @@ public class DutyCarController extends BaseController {
* 值班数据删除
*
* @param instanceId 实例id
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}")
@ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除")
public ResponseModel deleteDutyData(@PathVariable Long instanceId) {
return ResponseHelper.buildResponse(iDutyCarService.deleteDutyData(instanceId));
public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) {
if (ValidationUtil.isEmpty(instanceId)
|| ValidationUtil.isEmpty(startTime)
|| ValidationUtil.isEmpty(endTime)){
throw new BadRequest("参数校验失败.");
}
// BUG 2807 删除逻辑缺陷,现在前端后端传入 删除月份 2021-09-10 by kongfm
return ResponseHelper.buildResponse(iDutyCarService.deleteDutyData(instanceId, startTime, endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
......@@ -11,7 +11,9 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -116,13 +118,21 @@ public class DutyPersonController extends BaseController {
* 值班数据删除
*
* @param instanceId 实例id
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}")
@DeleteMapping("/{instanceId}/{startTime}/{endTime}")
@ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除")
public ResponseModel deleteDutyData(@PathVariable Long instanceId) {
return ResponseHelper.buildResponse(iDutyPersonService.deleteDutyData(instanceId));
public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) {
if (ValidationUtil.isEmpty(instanceId)
|| ValidationUtil.isEmpty(startTime)
|| ValidationUtil.isEmpty(endTime)){
throw new BadRequest("参数校验失败.");
}
// BUG 2807 删除逻辑缺陷,现在前端后端传入 删除月份 2021-09-10 by kongfm
return ResponseHelper.buildResponse(iDutyPersonService.deleteDutyData(instanceId, startTime, endTime));
}
/**
......
......@@ -20,7 +20,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit;
import com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl;
......
......@@ -87,7 +87,10 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse("-1");
}
}
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
/*bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 开始*/
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", String.valueOf(id)).set("is_delete", CommonConstant.IS_DELETE_01));
/*bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 结束*/
try {
eSOrgUsrService.deleteById(id);
emqKeeper.getMqttClient().publish(airportDeleteTopic, JSON.toJSONString(id).getBytes(), 2, false);
......@@ -108,6 +111,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo, @PathVariable Long id) throws Exception {
OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id);
return ResponseHelper.buildResponse(null);
......@@ -337,7 +341,7 @@ public class OrgUsrController extends BaseController {
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTreeByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门树", notes = "根据登陆人获取单位部门树")
public ResponseModel<List<OrgMenuDto>> selectCompanyTreeByUser() throws Exception {
......@@ -353,7 +357,7 @@ public class OrgUsrController extends BaseController {
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyUserTreeByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门用户树", notes = "根据登陆人获取单位部门用户树")
public ResponseModel<List<OrgMenuDto>> companyUserTreeByUser() {
......@@ -369,7 +373,7 @@ public class OrgUsrController extends BaseController {
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyListByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位列表", notes = "根据登陆人获取单位列表")
public ResponseModel<List<CheckObjectDto>> companyListByUser() {
......@@ -399,13 +403,16 @@ public class OrgUsrController extends BaseController {
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getLoginUserDetails", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取登陆人绑定的人员关系", notes = "获取登陆人绑定的人员关系")
public ResponseModel<List<Map<String, Object>>> getLoginUserDetails() {
// 获取登陆人角色
public ResponseModel<List<Map<String, Object>>> getLoginUserDetails(@RequestParam(value = "userId", required = false) String userId) {
AgencyUserModel user = getUserInfo();
List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(user);
String userIds = userId;
if (StringUtils.isEmpty(userIds)) {
userIds = user.getUserId();
}
List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds);
return ResponseHelper.buildResponse(loginUserDetails);
}
......
......@@ -31,6 +31,7 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourcePoolSer
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -92,14 +93,13 @@ public class WaterResourceController extends BaseController {
model.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
if(model.getAddress()!=null){
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
/* if(model.getAddress()!=null){
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(address.getString(BizConstant.ADDRESS));
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
}*/
if (!StringUtils.isEmpty(resourceType)) {
switch (resourceType) {
case "hydrant":
......@@ -168,13 +168,13 @@ public class WaterResourceController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<WaterResourceDto> updateBySequenceNbrWaterResource(@RequestBody WaterResourceDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
if (StringUtils.isNotEmpty(model.getAddress())) {
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 173-178行*/
/* if (StringUtils.isNotEmpty(model.getAddress())) {
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(address.getString(BizConstant.ADDRESS));
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
}*/
// 更新基本信息
model.setSequenceNbr(sequenceNbr);
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
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.Firefighters;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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.utils.ResponseModel;
import java.util.ArrayList;
import java.util.List;
......@@ -23,6 +31,17 @@ import java.util.stream.Collectors;
@Service
public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCarService {
@Autowired
DynamicFormInstanceServiceImpl dynamicFormInstanceService;
@Autowired
FirefightersMapper firefightersMapper;
@Autowired
EquipFeignClient equipFeignClient;
String driverPostTypeCode = "5";
@Override
public String getGroupCode() {
return "dutyCar";
......@@ -78,4 +97,49 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, DynamicFormInstance formInstance) {
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
}
@Override
public JSONObject isFireCarDriver() {
JSONObject result = new JSONObject();
result.put("isDriver", false);
result.put("carStatus", "");
result.put("carId", "");
String loginUserId = RequestContext.getExeUserId();
// 根据登陆人id查询对应消防人员
Firefighters firefighters =
firefightersMapper.selectOne(new LambdaQueryWrapper<Firefighters>().eq(Firefighters::getSystemAccount,
loginUserId));
if (ValidationUtil.isEmpty(firefighters)) {
return result;
}
// 消防人员id
Long fighterId = firefighters.getSequenceNbr();
// 当前值班班次id
List<Long> shiftIdList = getDutyShiftIdList();
if (ValidationUtil.isEmpty(shiftIdList)) {
return result;
}
// 当前值班人员-车辆信息
List<Map<String, Object>> personList = dayDutyPersonList(DateUtils.getDateNowShortStr(), shiftIdList.get(0),
driverPostTypeCode);
if (ValidationUtil.isEmpty(personList)) {
return result;
}
personList = personList.stream().filter(m -> fighterId.equals(m.get("userId"))).collect(Collectors.toList());
if (ValidationUtil.isEmpty(personList)) {
return result;
}
result.put("isDriver", true);
result.put("carId", personList.get(0).get("carId"));
ResponseModel<Map<String, Object>> resultModel =
equipFeignClient.queryCarSimpleInfoById((Long) personList.get(0).get("carId"));
Map<String, Object> carInfo = resultModel.getResult();
result.put("carStatus", carInfo.get("carStatus"));
return result;
}
}
......@@ -85,16 +85,43 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException {
// 获取值班的实例id
String instanceId = m.get("instanceId").toString();
// 根据appkey 获取未删除的值班班次
List<DutyShift> dutyShifts = dutyShiftService.list(new LambdaQueryWrapper<DutyShift>()
.eq(BaseEntity::getIsDelete, false).eq(DutyShift::getAppKey, RequestContext.getAppKey()));
// 根据id 保存成key -value
Map<Long, DutyShift> keyNameMap = dutyShifts.stream()
.collect(Collectors.toMap(BaseEntity::getSequenceNbr, Function.identity()));
// 根据时间 查询值班关系表
// BUG 2806 获取月份第一天和最后一天 2021-09-09 by kongfm
if(beginDate != null ) {
Calendar c = Calendar.getInstance();
c.setTime(DateUtils.longStr2Date(beginDate));
c.set(Calendar.DAY_OF_MONTH, 1);
c.set(Calendar.HOUR_OF_DAY,0);
c.set(Calendar.MINUTE,0);
c.set(Calendar.SECOND,0);
beginDate = DateUtils.date2LongStr(c.getTime());
}
if(endDate != null ) {
Calendar c = Calendar.getInstance();
c.setTime(DateUtils.longStr2Date(beginDate));
c.add(Calendar.MONTH, 1);
c.set(Calendar.DAY_OF_MONTH, 1);
c.add(Calendar.DATE, -1);
c.set(Calendar.HOUR_OF_DAY,23);
c.set(Calendar.MINUTE,59);
c.set(Calendar.SECOND,59);
endDate = DateUtils.date2LongStr(c.getTime());
}
List<DutyPersonShiftDto> personShiftList = dutyPersonShiftService
.list(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, instanceId)
.ge(beginDate != null, DutyPersonShift::getDutyDate, beginDate)
.le(endDate != null, DutyPersonShift::getDutyDate, endDate))
.stream().map(e -> {
// 值班关系查询到以后 重新封装
DutyPersonShiftDto dto = new DutyPersonShiftDto();
Bean.copyExistPropertis(e, dto);
// 没值班信息,默认休
......@@ -152,6 +179,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
public List<Map<String, Object>> list(Long teamId, String beginDate, String endDate) throws ParseException {
// 1.已column为准 进行返回
String groupCode = this.getGroupCode();
// 动态表单查询所有值班信息
List<Map<String, Object>> list = dynamicFormInstanceService.listAll(groupCode);
// 2.组织值班数据
......@@ -298,11 +326,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
@Override
public Boolean deleteDutyData(Long instanceId) {
dynamicFormInstanceService.remove(
new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
public Boolean deleteDutyData(Long instanceId, String startTime, String endTime) {
// BUG 2807 删除逻辑缺陷,现在前端后端传入 删除月份 2021-09-10 by kongfm
//dynamicFormInstanceService.remove(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
dutyPersonShiftService
.remove(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, instanceId));
.remove(new LambdaQueryWrapper<DutyPersonShift>().ge(DutyPersonShift::getDutyDate,startTime).le(DutyPersonShift::getDutyDate,endTime).eq(DutyPersonShift::getInstanceId, instanceId));
return true;
}
......@@ -379,4 +407,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return shiftIds;
}
@Override
public List<Long> getDutyShiftIdList() {
return getOnDuty(new DateTime());
}
}
......@@ -29,6 +29,7 @@ public class FireChemicalServiceImpl extends BaseService<FireChemicalDto,FireChe
typeCode = null;
}
// BUG 2123 日常管理>辅助资源>危化品,危化品列表数据按创建时间倒序排列 by litw start
// 危化品按时间倒叙排列add rec_date 2021-09-08 by kongfm
return this.queryForPage(page, "rec_date", false,casNo, formula, name, typeCode, isDelete);
}
......
......@@ -30,7 +30,8 @@ public class FireExpertsServiceImpl extends BaseService<FireExpertsDto, FireExpe
@Condition(Operator.eq) Boolean isDelete,
@Condition(Operator.like) String name,
@Condition(Operator.eq) String expertCode) {
return this.queryForPage(page, null, false, isDelete, name, expertCode);
// 消防专家按时间倒叙排列add rec_date 2021-09-08 by kongfm
return this.queryForPage(page, "rec_date", false, isDelete, name, expertCode);
}
/**
......
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
......@@ -259,16 +260,28 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
}
keySiteDto.setUseNatureName(useNatureArray[0]);
}
if (keySiteExcleDto.getFirePreventionFlagName().equals("有")) {
if ("有".equals(keySiteExcleDto.getFirePreventionFlagName())) {
keySiteDto.setFirePreventionFlag(true);
} else {
keySiteDto.setFirePreventionFlag(false);
}
keySiteDto =Bean.toPo(getCurrentInfo(), keySiteDto);
excelList.add(keySiteDto);
}
return this.saveBatch(excelList);
}
public BaseEntity getCurrentInfo() {
BaseEntity userModel= new BaseEntity();
/* String keyString= RequestContext.getExeUserId();
String token=RequestContext.getToken();
ReginParams params = JSONObject.parseObject(redisUtils
.get(RedisKey.buildReginKey(keyString, token)).toString(),
ReginParams.class);*/
userModel.setRecUserId("3141675");
userModel.setRecUserName("admin_jcs");
userModel.setRecDate( new Date());
return userModel;
}
@Override
public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr) {
LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>();
......
......@@ -90,10 +90,7 @@ public class SourceFileServiceImpl extends BaseService<SourceFileDto, SourceFile
public void saveAttachments(Long sequenceNbr, Map<String, List<AttachmentDto>> attachmentMap) {
if (!ValidationUtil.isEmpty(attachmentMap)) {
List<SourceFile> sourceFiles = Lists.newArrayList();
attachmentMap.entrySet().forEach(entry -> {
List<AttachmentDto> attachments = entry.getValue();
sourceFiles.addAll(attachment2SourceFile(entry.getKey(), attachments));
});
attachmentMap.forEach((key, attachments) -> sourceFiles.addAll(attachment2SourceFile(key, attachments)));
saveSourceFile(sequenceNbr, sourceFiles);
}
}
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledFeedbackServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFeedbackDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 警情反馈
*
* @author system_generator
* @date 2021-09-08
*/
@RestController
@Api(tags = "警情反馈Api")
@RequestMapping(value = "/alert-called-feedback")
public class AlertCalledFeedbackController extends BaseController {
@Autowired
AlertCalledFeedbackServiceImpl alertCalledFeedbackServiceImpl;
/**
* 新增
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<AlertCalledFeedbackDto> save(@RequestBody AlertCalledFeedbackDto model) {
alertCalledFeedbackServiceImpl.handleFeedback(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<AlertCalledFeedbackDto> updateBySequenceNbrAlertCalledFeedback(@RequestBody AlertCalledFeedbackDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(alertCalledFeedbackServiceImpl.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(alertCalledFeedbackServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<AlertCalledFeedbackDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(alertCalledFeedbackServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<AlertCalledFeedbackDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<AlertCalledFeedbackDto> page = new Page<AlertCalledFeedbackDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(alertCalledFeedbackServiceImpl.queryForAlertCalledFeedbackPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<AlertCalledFeedbackDto>> selectForList() {
return ResponseHelper.buildResponse(alertCalledFeedbackServiceImpl.queryForAlertCalledFeedbackList());
}
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -22,20 +18,21 @@ import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
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;
......@@ -91,6 +88,13 @@ public class FireTeamController extends BaseController {
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改消防队伍", notes = "修改消防队伍")
public ResponseModel<Object> updateByIdFireTeam(HttpServletRequest request, @RequestBody FireTeam fireTeam) {
if (ValidationUtil.isEmpty(fireTeam.getSequenceNbr())){
throw new BadRequest("更新消防队伍必须传入主键");
}
// BUG 2842 由 BUG2217 2684 新增业务 需要统计消防队伍旗下所有消防队伍信息导致数据逻辑错误 返回错误提示 2021-09-10 by kongfm
if(fireTeam.getSequenceNbr().equals(fireTeam.getParent())) {
throw new BadRequest("消防队伍上级不可选为自己");
}
return ResponseHelper.buildResponse(iFireTeamService.saveFireTeam(fireTeam));
}
......
......@@ -22,6 +22,7 @@ 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.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -130,7 +131,8 @@ public class FirefightersController extends BaseController {
queryWrapper.eq("is_delete", 0);
List<FirefightersJacket> firefightersJacket = iFirefightersJacketService.list(queryWrapper);
if (firefightersJacket != null && firefightersJacket.size() > 0) {
throw new RuntimeException("该消防还有在装装备!");
// BUG 2222 by litw start 2021年9月10日
throw new BadRequest("该消防还有在装装备!");
}
try {
iFirefightersService.update(new UpdateWrapper<Firefighters>().eq("sequence_nbr", id).set("is_delete", 1));
......
......@@ -165,7 +165,8 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
Boolean isDelete,
@Condition(Operator.like) String aircraftModel,
String engineTypeCode, String fuelTypeCode) {
return this.queryForPage(page, null, false, isDelete, aircraftModel, engineTypeCode, fuelTypeCode);
// 航空器信息按时间倒叙排列add rec_date 2021-09-08 by kongfm
return this.queryForPage(page, "rec_date", false, isDelete, aircraftModel, engineTypeCode, fuelTypeCode);
}
/**
......@@ -302,6 +303,8 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
return map;
}
@Override
public Aircraft queryAircraftInfoByModel(String aircraftModel) {
return this.baseMapper.selectOne(new LambdaQueryWrapper<Aircraft>().eq(Aircraft::getAircraftModel, aircraftModel));
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFeedbackDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalledFeedback;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertCalledFeedbackMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 服务实现类
*
* @author system_generator
* @date 2021-09-08
*/
@Service
public class AlertCalledFeedbackServiceImpl extends BaseService<AlertCalledFeedbackDto, AlertCalledFeedback, AlertCalledFeedbackMapper> implements IAlertCalledFeedbackService {
@Autowired
SourceFileServiceImpl sourceFileService;
@Autowired
PowerTransferMapper powerTransferMapper;
/**
* 分页查询
*/
public Page<AlertCalledFeedbackDto> queryForAlertCalledFeedbackPage(Page<AlertCalledFeedbackDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<AlertCalledFeedbackDto> queryForAlertCalledFeedbackList() {
return this.queryForList("", false);
}
@Override
public boolean handleFeedback(AlertCalledFeedbackDto model) {
Long alertCalledId = model.getAlertCalledId();
// 更新警情调派任务状态
List<String> carIdList = powerTransferMapper.queryTransferCarIdsByAlertCalledId(alertCalledId);
// 保存警情反馈
model = createWithModel(model);
// 保存警情反馈图片
sourceFileService.saveAttachments(model.getSequenceNbr(), model.getAttachments());
return true;
}
}
\ No newline at end of file
......@@ -671,6 +671,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return map;
}
//未结案警情统计
@Override
public Integer AlertCalledcount(int type) {
return alertCalledMapper.AlertCalledcount(1);
}
@Override
public List<JSONObject> queryDisposalObjectList(String alertId) {
AlertCalled alertCalled = this.getById(Long.valueOf(alertId));
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@Service
public class DispatchMapServiceImpl implements IHomePageService {
//实现首页dispatchMap
@Autowired
AlertCalledMapper alertCalledMapper;
private static AlertCalledMapper alertCalledMapper1;
@PostConstruct
public void init(){
alertCalledMapper1= alertCalledMapper;
}
@Override
public Object getHomePageData() {
Integer num= alertCalledMapper1.AlertCalledcount(1);
return num;
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertCalledMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@Service
public class DispatchTaskServiceImpl implements IHomePageService {
//实现首页dispatchMap
@Autowired
AlertCalledMapper alertCalledMapper;
private static AlertCalledMapper alertCalledMapper1;
@PostConstruct
public void init(){
alertCalledMapper1= alertCalledMapper;
}
@Override
public Object getHomePageData() {
Integer num= alertCalledMapper1.AlertCalledcount(1);
return num;
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@Service
public class FaultServiceImpl implements IHomePageService {
@Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
@PostConstruct
public void init(){
quipFeignClient1= quipFeignClient;
}
//火警
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("BREAKDOWN");
return data!=null?data.getResult():0;
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertCalledMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@Service
public class FireAlarmServiceImpl implements IHomePageService {
@Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
@PostConstruct
public void init(){
quipFeignClient1= quipFeignClient;
}
//火警
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("FIREALARM");
return data!=null?data.getResult():0;
}
}
......@@ -200,8 +200,8 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
if(fireTeam.getAddress()!=null){
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(fireTeam.getAddress());
fireTeam.setAddress(address.getString(BizConstant.ADDRESS));
fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
// fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
// fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
if (ValidationUtil.isEmpty(fireTeam.getParent())) {
fireTeam.setTreeCode(TreeParser.genTreeCode());
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@Service
public class NoServiceImpl implements IHomePageService {
@Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
@PostConstruct
public void init(){
quipFeignClient1= quipFeignClient;
}
//火警
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient1.getcountAlarmHandle("no");
return data!=null?data.getResult():0;
}
}
......@@ -6,11 +6,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto;
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.biz.service.impl.DutyShiftServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCarCountDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCompanyCountDto;
......@@ -26,6 +26,7 @@ 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;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
......@@ -42,7 +43,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -98,7 +98,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
private String topic;
@Autowired
private DutyShiftServiceImpl dutyShiftServiceImpl;
private DutyCarServiceImpl dutyCarService;
@Override
public PowerTransferSimpleDto getPowerTransferList(Long alertCalledId) {
......@@ -464,51 +464,92 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
IPage<PowerTransferResourceDto> carResourcePage =
powerTransferMapper.getPowerTransferCarResource(new Page<>(1L, Long.MAX_VALUE),
alertCalledId);
// 调派的车辆id
// 调派的车辆id列表
List<Long> carIdList = Lists.transform(carResourcePage.getRecords(), PowerTransferResourceDto::getSequenceNbr);
// 调派的车辆信息列表
List<Map<String, Object>> totalCarList =
carList.stream().filter(c -> carIdList.contains(c.get("id"))).collect(Collectors.toList());
// TODO 车辆枚举后期修改为已到达状态
carList.stream().filter(c -> carIdList.contains(Long.valueOf((String) c.get("id")))).collect(Collectors.toList());
// TODO 车辆枚举后期修改为已到达状态车辆
List<Map<String, Object>> arrivedCarList =
carList.stream().filter(c -> carIdList.contains(c.get("id")) && FireCarStatusEnum.出动.getCode().equals(c.get(
carList.stream().filter(c -> carIdList.contains(Long.valueOf((String) c.get("id"))) && FireCarStatusEnum.出动.getCode().equals(c.get(
"carState"))).collect(Collectors.toList());
// 车辆统计
Long carTotal = carResourcePage.getTotal();
// 调派-已到达车辆id列表
List<Long> arrivedCarIdList = Lists.newArrayList();
arrivedCarList.forEach(c -> {
if (FireCarStatusEnum.出动.getCode().equals(c.get("carState"))) {
arrivedCarIdList.add(Long.valueOf((String) c.get("id")));
}
});
JSONObject resourceStatistics = new JSONObject();
Long carTotal = carResourcePage.getTotal();
// 车辆统计
carCount(arrivedCarList, resourceStatistics, carTotal, "car");
// 车辆人员统计
dutyPersonCount(carIdList, arrivedCarIdList, resourceStatistics);
// 车载器材统计
fireAgentOnCarCount(totalCarList, arrivedCarList, resourceStatistics, "equipment", "equip");
// TODO 车载水量统计
carCount(arrivedCarList, resourceStatistics, carTotal, "water");
// 车载药剂统计
fireAgentOnCarCount(totalCarList, arrivedCarList, resourceStatistics, "fireAgent", "medicament");
return resourceStatistics;
}
public void carCount(List<Map<String, Object>> arrivedCarList, JSONObject resourceStatistics, Long carTotal, String jsoKey) {
JSONObject car = new JSONObject();
car.put("total", carTotal);
car.put("count", arrivedCarList.size());
car.put("percent", arrivedCarList.size() / carTotal);
resourceStatistics.put("car", car);
resourceStatistics.put(jsoKey, car);
}
// 车辆人员统计
public void dutyPersonCount(List<Long> carIdList, List<Long> arrivedCarIdList, JSONObject resourceStatistics) {
// 当前时间所在班次
List<DutyShiftDto> dutyList = dutyShiftServiceImpl.queryForDutyShiftList(RequestContext.getAppKey(), false);
// 车辆值班
List<Long> shiftIdList = dutyCarService.getDutyShiftIdList();
List<Map<String, Object>> allDutyPersonList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(shiftIdList)) {
// 当前值班车辆-人
allDutyPersonList = dutyCarService.dayDutyPersonList(DateUtils.getDateNowShortStr(),
shiftIdList.get(0), null);
}
// 当前车辆执勤人员
List<Map<String, Object>> allTransferDutyPerson =
allDutyPersonList.stream().filter(c -> carIdList.contains(Long.valueOf((String) c.get("carId")))).collect(Collectors.toList());
// 当前已到达车辆执勤人员
List<Map<String, Object>> allArrivedTransferDutyPerson =
allDutyPersonList.stream().filter(c -> arrivedCarIdList.contains(Long.valueOf((String) c.get("carId")))).collect(Collectors.toList());
JSONObject person = new JSONObject();
person.put("total", carTotal);
person.put("count", arrivedCarList.size());
person.put("percent", arrivedCarList.size() / carTotal);
person.put("total", allTransferDutyPerson.size());
person.put("count", allArrivedTransferDutyPerson.size());
resourceStatistics.put("person", person);
// TODO 车载器材统计
JSONObject equip = new JSONObject();
equip.put("total", carTotal);
equip.put("count", arrivedCarList.size());
equip.put("percent", arrivedCarList.size() / carTotal);
resourceStatistics.put("equip", equip);
// TODO 车载水量统计
JSONObject water = new JSONObject();
water.put("total", carTotal);
water.put("count", arrivedCarList.size());
water.put("percent", arrivedCarList.size() / carTotal);
resourceStatistics.put("water", water);
// TODO 车载药剂统计
JSONObject medicament = new JSONObject();
medicament.put("total", carTotal);
medicament.put("count", arrivedCarList.size());
medicament.put("percent", arrivedCarList.size() / carTotal);
resourceStatistics.put("medicament", medicament);
return resourceStatistics;
}
public void fireAgentOnCarCount(List<Map<String, Object>> totalCarList, List<Map<String, Object>> arrivedCarList,
JSONObject resourceStatistics, String equipType, String jsonKey) {
double agentCountAll = totalCarList.stream().mapToDouble(car -> ((List<Map<String, Object>>) car.get(
"resourceList")).stream().filter(res -> equipType.equals(res.get(
"equipType"))).mapToDouble(c -> (double) c.get("equipCount")).sum()).sum();
double agentCountArrived = arrivedCarList.stream().mapToDouble(car -> ((List<Map<String, Object>>) car.get(
"resourceList")).stream().filter(res -> equipType.equals(res.get(
"equipType"))).mapToDouble(c -> (double) c.get("equipCount")).sum()).sum();
JSONObject jsonObject = new JSONObject();
jsonObject.put("total", agentCountAll);
jsonObject.put("count", agentCountArrived);
resourceStatistics.put(jsonKey, jsonObject);
}
@Override
public List<Map<String, String>> getFireCarStatusList() {
return FireCarStatusEnum.toList();
}
@Override
public List<Map<String, String>> getDispatchTaskStatusList() {
return AlertFeedbackStatusEnum.toList();
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@Service
public class ShieldServiceImpl implements IHomePageService {
@Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
@PostConstruct
public void init(){
quipFeignClient1= quipFeignClient;
}
//火警
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("SHIELD");
return data!=null?data.getResult():0;
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@Service
public class WarningServiceImpl implements IHomePageService {
@Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
@PostConstruct
public void init(){
quipFeignClient1= quipFeignClient;
}
//火警
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("NOTICE");
return data!=null?data.getResult():0;
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct;
/**
* @description:
* @author: tw
* @createDate: 2021/9/8
*/
@Service
public class YesServiceImpl implements IHomePageService {
@Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
@PostConstruct
public void init(){
quipFeignClient1= quipFeignClient;
}
//火警
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient1.getcountAlarmHandle("yes");
return data!=null?data.getResult():0;
}
}
......@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -52,6 +54,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "创建无码无计划隐患", notes = "创建无码无计划隐患")
@PostMapping(value = "/normal/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) {
CommonResponse commonResponse = new CommonResponse();
try {
......@@ -80,6 +83,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "创建巡检隐患", notes = "创建巡检隐患")
@PostMapping(value = "/patrol/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse savePatrol(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerPatrolParam latentDangerPatrolParam) {
try {
AgencyUserModel user = getUserInfo();
......@@ -102,6 +106,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患列表", notes = "隐患列表")
@PostMapping(value = "/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse list(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerListParam latentDangerListParam) {
Date startDate = new Date();
try {
......@@ -124,6 +129,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患详情", notes = "隐患详情")
@GetMapping(value = "/detail")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse detail(@ApiParam(value = "任务Id", required = true) @RequestParam String id,
@ApiParam(value = "是否完成", required = true) @RequestParam boolean isFinish) {
try {
......@@ -140,6 +146,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患执行记录", notes = "隐患执行记录")
@GetMapping(value = "/listFlowRecord")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listFlowRecord(@ApiParam(value = "隐患编号", required = true) @RequestParam Long id) {
try {
AgencyUserModel user = getUserInfo();
......@@ -155,6 +162,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "流程执行", notes = "流程执行")
@PostMapping(value = "/excute")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse excute(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerExcuteParam latentDangerExcuteParam) {
try {
AgencyUserModel user = getUserInfo();
......@@ -186,6 +194,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "根据流程实例编号获取隐患信息", notes = "根据流程实例编号获取隐患信息")
@GetMapping(value = "/getByInstanceId")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getByInstanceId(@ApiParam(value = "流程实例编号", required = true) @RequestParam String instanceId) {
try {
AgencyUserModel user = getUserInfo();
......@@ -201,6 +210,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患按错计划流程执行回调", notes = "隐患按错计划流程执行回调")
@PostMapping(value = "/plan/flow/excuteCallBack")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse excuteCallBack(@ApiParam(value = "隐患按错计划流程执行回调对象") @RequestBody JSONObject json) {
try {
AgencyUserModel user = getUserInfo();
......@@ -231,6 +241,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "获取隐患等级", notes = "获取隐患等级")
@GetMapping(value = "/dangerLevel")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getDangerLevel() {
return CommonResponseUtil.success(iLatentDangerService.getDangerLevel(getToken(), getProduct(), getAppKey(), DictTypeEnum.DANGERLEVEL.getCode()));
}
......@@ -246,6 +257,7 @@ public class LatentDangerController extends AbstractBaseController {
*/
@ApiOperation(value = "隐患清单", notes = "隐患清单")
@PostMapping(value = "/page/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
......@@ -260,6 +272,7 @@ public class LatentDangerController extends AbstractBaseController {
*/
@ApiOperation(value = "导出隐患清单", notes = "导出隐患清单")
@PostMapping(value = "/export")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public void exportDangerList(@ApiParam(value = "查询条件") @RequestBody PageParam pageParam,
HttpServletResponse response) {
AgencyUserModel user = getUserInfo();
......@@ -286,6 +299,7 @@ public class LatentDangerController extends AbstractBaseController {
*/
@ApiOperation(value = "隐患日志", notes = "查询隐患节点信息")
@GetMapping(value = "/listDangerTimeAxis")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listTimeAxis(@ApiParam(value = "时间") @RequestParam(required = false) Integer dateTime) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
......
......@@ -32,6 +32,8 @@ import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -206,6 +208,8 @@ public class PlanTaskController extends AbstractBaseController {
@RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse pushCarData() {
try {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskExecution(null);
return CommonResponseUtil.success();
} catch (Exception e) {
......
......@@ -802,7 +802,9 @@ public class TaskController extends AbstractBaseController{
String userIds="";
Set<String> set = new HashSet<>();
list.forEach(s -> {
if(!ObjectUtils.isEmpty(s)){
set.add(s.getName());
}
});
List<String> list1 = new ArrayList<>(set);
......
......@@ -42,6 +42,8 @@ public class PushMsgParam {
*/
private String type = "3";
private String relationId;
public String getType() {
return type;
}
......@@ -91,4 +93,12 @@ public class PushMsgParam {
this.emails = emails;
}
public String getRelationId() {
return relationId;
}
public void setRelationId(String relationId) {
this.relationId = relationId;
}
}
......@@ -176,7 +176,7 @@ public Page<HashMap<String, Object>> getCatalogTreeInfo(String toke,String produ
String userIds = "";
Set<String> set = new HashSet<>();
content.forEach(s -> {
if (s.containsKey("createBy")) {
if (s.containsKey("createBy") && !ObjectUtils.isEmpty(s.get("createBy"))) {
set.add(s.get("createBy").toString());
}
});
......
......@@ -161,7 +161,7 @@ public class CheckServiceImpl implements ICheckService {
deptIds.remove(null);
String joinUserId="";
for (String userId:userIds) {
if(userId!=null&&!userId.trim().equals("")){
if(!ObjectUtils.isEmpty(userId)){
joinUserId=joinUserId+userId+",";
}
}
......@@ -808,7 +808,7 @@ public class CheckServiceImpl implements ICheckService {
deptIds.remove(null);
String joinUserId="";
for (String userId:userIds) {
if(userId!=null&&!userId.trim().equals("")){
if(!ObjectUtils.isEmpty(userId)){
joinUserId=joinUserId+userId+",";
}
}
......@@ -1194,8 +1194,9 @@ public class CheckServiceImpl implements ICheckService {
//处理用户信息
String userIds="";
Set<String> set = new HashSet<>();
if(!ObjectUtils.isEmpty(checkDetailBo.getCheckUserName())){
set.add(checkDetailBo.getCheckUserName());
}
List<String> list1 = new ArrayList<>(set);
userIds = String.join(",", list1);
List<AgencyUserModel> listd=remoteSecurityService.listUserByUserIds( toke,product,appKey,userIds);
......@@ -1315,7 +1316,9 @@ public class CheckServiceImpl implements ICheckService {
if (!CollectionUtils.isEmpty(content)) {
Set<String> userIds =new HashSet<>();
content.forEach(e -> {
if(!ObjectUtils.isEmpty(e.get("userID"))){
userIds.add(e.get("userID")+"");
}
});
List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds( toke, product, appKey,Joiner.on(",").join(userIds));
Map<String, String> userModelMap = new HashMap<String,String>();
......@@ -1512,7 +1515,9 @@ public class CheckServiceImpl implements ICheckService {
String userIds="";
Set<String> set = new HashSet<>();
checkAnalysisVos.forEach(s -> {
if(!ObjectUtils.isEmpty(s.getName())){
set.add(s.getName());
}
});
List<String> list1 = new ArrayList<>(set);
userIds = String.join(",", list1);
......
......@@ -147,8 +147,16 @@ public class MessageServiceImpl implements IMessageService {
}
}
//获取需要推送的app的用户
List<PushTargetBo> jpushUser = msgMapper.getPushUserBo("app", String.join(",", needUserIds), checkMsgBo.getRouteId(),getAppPushConfig(checkMsgBo.getStatus()));
//获取需要推送的app的用户 手机端暂时无订阅功能,暂时屏蔽
// List<PushTargetBo> jpushUser = msgMapper.getPushUserBo("app", String.join(",", needUserIds), checkMsgBo.getRouteId(),getAppPushConfig(checkMsgBo.getStatus()));
List<PushTargetBo> jpushUser = new ArrayList<>();
needUserIds.stream().forEach(action->{
if(!ObjectUtils.isEmpty(action)){
PushTargetBo pb = new PushTargetBo();
pb.setUserId(action);
jpushUser.add(pb);
}
});
//获取需要推送的email的用户
List<PushTargetBo> emailUser = msgMapper.getPushUserBo("email", String.join(",", needUserIds), checkMsgBo.getRouteId(),getEmailPushConfig(checkMsgBo.getStatus()));
......@@ -157,7 +165,9 @@ public class MessageServiceImpl implements IMessageService {
List<PushTargetBo> tempList = new ArrayList<>();
tempList.addAll(jpushUser);
tempList.addAll(emailUser);
List<String> userIds=tempList.stream().map(PushTargetBo::getUserId).distinct().collect(Collectors.toList());
// 手机端暂时无订阅功能,暂时屏蔽
// List<String> userIds=tempList.stream().map(PushTargetBo::getUserId).distinct().collect(Collectors.toList());
Set<String> userIds = needUserIds;
List<AgencyUserModel> agencyUserModelList=remoteSecurityService.listUserByUserIds( toke,product,appKey,String.join(",", userIds));
try {
pushAppMsg(jpushUser,agencyUserModelList,pushMsgParam,checkMsgBo, toke, product, appKey);
......@@ -223,8 +233,8 @@ public class MessageServiceImpl implements IMessageService {
}
List<String> pushApps = jpushUser.stream()
.filter(bo->StringUtil.isNotEmpty(bo.getUsername()))
.map(PushTargetBo::getUsername).collect(Collectors.toList());
.filter(bo->StringUtil.isNotEmpty(bo.getUserId()))
.map(PushTargetBo::getUserId).collect(Collectors.toList());
pushApps = pushApps.stream().distinct().collect(Collectors.toList());
if(!pushApps.isEmpty()){
List<PushMsgParam> pmps = new ArrayList<PushMsgParam>();
......@@ -234,6 +244,7 @@ public class MessageServiceImpl implements IMessageService {
extras.put("type",MsgTypeEnum.CHECK.getCode());
extras.put("id",checkMsgBo.getCheckId()+"");
pushMsgParam.setExtras(extras);
pushMsgParam.setRelationId(checkMsgBo.getCheckId()+"");
pmps.add(pushMsgParam);
List<Msg> msgList =createMsg(jpushUser,checkMsgBo);
pushFeignServer.sendMessage( toke, product, appKey,pmps);
......@@ -302,13 +313,14 @@ public class MessageServiceImpl implements IMessageService {
}
@Override
public Msg pushMsg(String toke,String product,String appKey,Msg msg) {
public Msg pushMsgAndSave(String toke,String product,String appKey,Msg msg) {
List<PushMsgParam> pmps = new ArrayList<PushMsgParam>();
PushMsgParam pushMsg = new PushMsgParam();
pushMsg.setRecivers(Arrays.asList(msg.getTargetTel()));
pushMsg.setRecivers(Arrays.asList(msg.getUserId()));
pushMsg.setContent(ObjectUtils.isEmpty(msg.getPushBody()) ? msg.getBody() : msg.getPushBody());
pushMsg.setSubject(msg.getTitle());
pushMsg.setType(JPushTypeEnum.ALIAS.getCode());
pushMsg.setRelationId(msg.getRelationId()==null?"0":msg.getRelationId().toString());
Map<String, String> extras = new HashMap<String, String>();
extras.put("type",msg.getMsgType());
extras.put("id",msg.getRelationId()==null?"0":msg.getRelationId().toString());
......@@ -350,7 +362,7 @@ public class MessageServiceImpl implements IMessageService {
msg.setUserId(user.getUserId());
msg.setReciverName(user.getRealName());
if (isImmediately) { //立即发送
msg = pushMsg( toke, product, appKey,msg);
msg = pushMsgAndSave( toke, product, appKey,msg);
} else { //定时发送
msg.setStatus(0);
msg.setFixedTime(notice.getFixedTime());
......@@ -414,9 +426,17 @@ public class MessageServiceImpl implements IMessageService {
msg.setTargetTel(userNames);
msg.setUserId(userIds);
msg.setIsImmediately(isImmediately);
pushMsg( toke, product, appKey,msg);
pushMsgAndSave( toke, product, appKey,msg);
}
}
}
@Override
public void pushMsg(String toke, String product, String appKey, PushMsgParam pmsg) {
// TODO Auto-generated method stub
pushFeignServer.sendMessage( toke, product, appKey,pmsg);
}
}
......@@ -7,6 +7,7 @@ import org.springframework.data.domain.Page;
import com.yeejoin.amos.patrol.business.param.MsgInfoPageParam;
import com.yeejoin.amos.patrol.business.param.NoticePublishParam;
import com.yeejoin.amos.patrol.business.param.PushMsgParam;
import com.yeejoin.amos.patrol.business.vo.MsgVo;
import com.yeejoin.amos.patrol.dao.entity.Check;
import com.yeejoin.amos.patrol.dao.entity.Msg;
......@@ -48,6 +49,8 @@ public interface IMessageService {
* 消息公告推送
* @param msg
*/
public Msg pushMsg(String toke,String product,String appKey,Msg msg);
public Msg pushMsgAndSave(String toke,String product,String appKey,Msg msg);
public void pushMsg(String toke,String product,String appKey,PushMsgParam pmsg);
}
......@@ -66,36 +66,6 @@ public class AsyncTask {
private static final String TAB = "\r\n";
/**
* 邮件发送
* @param msgResponse
* @return
* @throws InterruptedException
*/
// @Async("asyncTaskExecutor")
// public Future<Boolean> sendEmail(PushMsgParam pmp) throws InterruptedException {
// long start = System.currentTimeMillis();
// iEmailService.sendSimpleEmail(pmp.getEmails(), pmp.getSubject(), pmp.getContent());
// long end = System.currentTimeMillis();
// log.info("=====邮件发送耗时:"+(end-start)+"======");
// return new AsyncResult<Boolean>(true);
// }
//
// /**
// * jpush 推送
// * @param pmps
// * @return
// * @throws InterruptedException
// */
// @Async("asyncTaskExecutor")
// public Future<Boolean> sendJpush(List<PushMsgParam> pmps) throws InterruptedException {
// long start = System.currentTimeMillis();
// appMessagePushService.sendMessage(pmps);
// long end = System.currentTimeMillis();
// //返回true,告诉此任务已完成
// log.info("=====Jpush发送耗时:"+(end-start)+"======");
// return new AsyncResult<Boolean>(true);
// }
/**
* 检查消息推送
......@@ -231,6 +201,7 @@ public class AsyncTask {
msg.setIsImmediately(true);
msg.setSendTime(date);
msg.setCreateDate(date);
msg.setTargetTel(user.getString("username"));
msg.setReciverName(user.getString("realName"));
sendUserIds.add(user.getString("userId"));
msgs.add(msg);
......@@ -247,11 +218,12 @@ public class AsyncTask {
pushMsgParam.setContent(body);
pushMsgParam.setRecivers(Lists.newArrayList(sendUserIds));
pushMsgParam.setSubject(title);
pushMsgParam.setRelationId(String.valueOf(relationId));
pushMsgParam.setType(JPushTypeEnum.ALIAS.getCode());
pushMsgParam.setExtras(extras);
iMsgDao.saveAll(msgs);
appMessagePushService.sendMessage(pushMsgParam);
// log.info("极光推送成功====>" + sendUserIds);
Toke toke= remoteSecurityService.getServerToken();
messageService.pushMsg(toke.getToke(),toke.getProduct(),toke.getAppKey(),pushMsgParam);
}
}
......
package com.yeejoin.amos.patrol.feign;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -14,38 +15,57 @@ import com.yeejoin.amos.patrol.business.param.PushMsgParam;
import com.yeejoin.amos.patrol.business.util.CommonResponse;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.core.common.response.TaskInfoRespone;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
@Service("pushFeignServer")
public class PushFeignServer {
@Autowired
private RestTemplate restTemplate;
// @Autowired
// private RestTemplate restTemplate;
//
// @Value("${Push.fegin.name}")
// private String RPushFeginName;
// private static String sendMessage = "/api/user/sendMessage";
//
// public String geturls(String url){
// return "http://"+RPushFeginName+url;
// }
// public HttpHeaders getHeader(String toke,String product,String appKey){
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON);
// headers.set("Content-Type", "application/json");
// headers.set("token", toke);
// headers.set("product",product);
// headers.set("appKey", appKey);
// return headers;
// }
@Value("${Push.fegin.name}")
private String RPushFeginName;
private static String sendMessage = "/api/user/sendMessage";
public String geturls(String url){
return "http://"+RPushFeginName+url;
public void sendMessage( String toke,String product,String appKey, List<PushMsgParam> pushMsgParam){
try {
pushMsgParam.forEach(action->{
sendJP(action);
});
} catch (Exception e) {
e.printStackTrace();
}
public HttpHeaders getHeader(String toke,String product,String appKey){
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Content-Type", "application/json");
headers.set("token", toke);
headers.set("product",product);
headers.set("appKey", appKey);
return headers;
}
public CommonResponse sendMessage( String toke,String product,String appKey, List<PushMsgParam> pushMsgParam){
public void sendMessage( String toke,String product,String appKey, PushMsgParam pushMsgParam){
try {
HttpEntity httpEntity = new HttpEntity<>(pushMsgParam, getHeader( toke, product, appKey));
CommonResponse commonResponse1 = restTemplate.postForObject(geturls(sendMessage),httpEntity, CommonResponse.class);
return commonResponse1;
sendJP(pushMsgParam);
} catch (Exception e) {
e.printStackTrace();
return CommonResponseUtil.failure("发送失败");
}
}
private void sendJP(PushMsgParam pushMsgParam){
MessageModel model = new MessageModel();
model.setRelationId(pushMsgParam.getRelationId());
model.setTitle(pushMsgParam.getSubject());
model.setBody(pushMsgParam.getContent());
model.setMsgType("patrolSystem");
model.setRecivers(pushMsgParam.getRecivers());
model.setExtras(pushMsgParam.getExtras());
Systemctl.messageClient.create(model);
}
}
......@@ -110,17 +110,17 @@ public class AppMessagePushService {
}
public void sendMessage(PushMsgParam response){
try {
if(null!=response && "true".equals(isPush)){
CommonResponse commonResponse = PushFeign.sendMessageone(response);
}
} catch (Exception e) {
log.error(e.getMessage(),e);
e.printStackTrace();
}
}
// public void sendMessage(PushMsgParam response){
//
// try {
// if(null!=response && "true".equals(isPush)){
// CommonResponse commonResponse = PushFeign.sendMessageone(response);
// }
// } catch (Exception e) {
// log.error(e.getMessage(),e);
// e.printStackTrace();
//
// }
// }
}
......@@ -521,7 +521,7 @@ public class JobService implements IJobService {
if (iMsgDao.existsById(msgId)) {
Msg msg = iMsgDao.findById(msgId).get();
Toke toke= remoteSecurityService.getServerToken();
messageService.pushMsg(toke.getToke(), toke.getProduct(), toke.getAppKey(),msg);
messageService.pushMsgAndSave(toke.getToke(), toke.getProduct(), toke.getAppKey(),msg);
}
removeJob(jobName);
}
......
......@@ -95,6 +95,10 @@
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
</dependency>
......
......@@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.supervision.core.enums.QueryOperatorEnum;
import com.yeejoin.amos.supervision.core.util.StringUtil;
import org.springframework.cglib.beans.BeanMap;
......@@ -653,4 +654,7 @@ public abstract class AbstractBaseController extends BaseController{
return map;
}
public ReginParams.PersonIdentity opIdentifyInfo(){
return getSelectedOrgInfo().getPersonIdentity();
}
}
......@@ -22,6 +22,7 @@ import javax.xml.transform.stream.StreamSource;
import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.core.framework.PersonIdentify;
import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.mqtt.WebMqttComponent;
......@@ -543,19 +544,19 @@ public class CheckController extends AbstractBaseController {
@ApiOperation(value = "查询计划执行结果信息", notes = "查询计划执行结果信息")
@GetMapping(value = "/page/list", produces = "application/json;charset=UTF-8")
public ResponseModel getPlanExecuteInfo(
@ApiParam(value = "计划id") @RequestParam(value = "planId") Long planId,
@ApiParam(value = "计划id") @RequestParam(value = "routeId") Long routeId,
@ApiParam(value = "点id") @RequestParam(value = "pointId", required = false) Long pointId,
@ApiParam(value = "执行状态") @RequestParam(value = "executeState", required = false) String executeState,
@ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
@ApiParam(value = "单位id") @RequestParam(value = "companyName", required = false) String companyName,
@ApiParam(value = "单位id") @RequestParam(value = "teamId", required = false) String teamId,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) {
HashMap<String, Object> map = new HashMap<>();
map.put("planId", planId);
map.put("routeId", routeId);
map.put("pointId", pointId);
map.put("executeState", executeState);
map.put("status", status);
map.put("companyName", companyName);
map.put("teamId", teamId);
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return ResponseHelper.buildResponse(checkService.getPlanExecuteInfo(map, pageable));
}
......@@ -567,13 +568,7 @@ public class CheckController extends AbstractBaseController {
return ResponseHelper.buildResponse(checkService.getPlanExecuteStates());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询计划执行所有单位", notes = "查询计划执行所有单位")
@GetMapping(value = "/search/teams", produces = "application/json;charset=UTF-8")
public ResponseModel getPlanExecuteTeams() {
return ResponseHelper.buildResponse(checkService.getPlanExecuteTeams());
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存检查记录", notes = "保存检查记录")
@RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
......
......@@ -809,8 +809,17 @@ public class PointController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询巡检点详情<font color='blue'>手机app</font>)", notes = "查询巡检点详情<font color='blue'>手机app</font>)")
@GetMapping(value = "/detail/item", produces = "application/json;charset=UTF-8")
public ResponseModel queryItemDetailByPointId(@ApiParam(value = "巡检点id", required = true) @RequestParam(name = "pointId") Long id) {
return ResponseHelper.buildResponse(iPointService.queryItemDetailByPointId(id));
public ResponseModel queryItemDetailByPointId(
@ApiParam(value = "路线id", required = true) @RequestParam(name = "routeId") Long routeId,
@ApiParam(value = "巡检点id", required = true) @RequestParam(name = "pointId") Long id) {
return ResponseHelper.buildResponse(iPointService.queryItemDetailByPointId(id, routeId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询计划执行所有单位", notes = "查询计划执行所有单位")
@GetMapping(value = "/search/teams", produces = "application/json;charset=UTF-8")
public ResponseModel getPlanExecuteTeams() {
return ResponseHelper.buildResponse(iPointService.getPlanExecuteTeams());
}
}
package com.yeejoin.amos.supervision.business.controller;
import com.yeejoin.amos.supervision.business.service.intfc.IRoutePointItemService;
import com.yeejoin.amos.supervision.business.util.CommonResponse;
import com.yeejoin.amos.supervision.business.util.CommonResponseUtil;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.RoutePointItem;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.List;
/**
* @author gaojianqiang
* @date 2021/09/10 11:28
*/
@RestController
@RequestMapping(value = "/api/routePointItem")
@Api(tags = "巡检路线点项api")
public class RoutePointItemController extends AbstractBaseController {
private final Logger log = LoggerFactory.getLogger(RoutePointItemController.class);
@Autowired
private IRoutePointItemService routePointItemService;
/**
* 增加巡检路线点项关系
*
* @param plan 巡检计划
* @param inputItemIds 巡检项IDS
* @return CommonResponse
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新增巡检路线点项关系", notes = "新增巡检路线点项关系")
@PostMapping(value = "/addRoutePointItem", produces = "application/json;charset=UTF-8")
public CommonResponse addRoute(@ApiParam(value = "巡检计划", required = true) @RequestBody Plan plan,
@ApiParam(value = "检查项IDS", required = true) @RequestParam List<Long> inputItemIds) {
try {
String userId = getUserId();
if (StringUtils.isNotBlank(userId)) {
List<RoutePointItem> list = routePointItemService.addRoutePointItemList(plan, inputItemIds, userId);
if (CollectionUtils.isNotEmpty(list)) {
return CommonResponseUtil.success();
}
return CommonResponseUtil.failure("路线点或检查项为空!");
}
return CommonResponseUtil.failure("创建用户为空!");
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("巡检路线点项关系新增失败!");
}
}
}
......@@ -11,6 +11,7 @@ import java.util.TreeSet;
import java.util.UUID;
import java.util.stream.Collectors;
import com.yeejoin.amos.supervision.core.framework.PersonIdentify;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import com.yeejoin.amos.supervision.jpush.AppMessagePushService;
import org.slf4j.Logger;
......@@ -846,4 +847,12 @@ public class UserController extends AbstractBaseController {
return CommonResponseUtil.failure(e.getMessage());
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "获取人员身份信息", notes = " 获取人员身份信息")
@GetMapping(value = "/identify")
public CommonResponse personIdentity() {
return CommonResponseUtil.success(opIdentifyInfo());
}
}
......@@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.Param;
public interface PlanTaskDetailMapper extends BaseMapper {
void finishTaskDetail(@Param(value="planTaskDetailId") long planTaskDetailId, @Param(value="pointId") long pointId, @Param(value="planTaskId") long planTaskId
, @Param(value="executorId") String executorId , @Param(value="executorName") String executorName);
, @Param(value="executorId") String executorId , @Param(value="executorName") String executorName , @Param(value="size") int size );
Map findPlanTaskByTaskIdAndPointId(@Param(value="planTaskId") long planTaskId,@Param(value="pointId") long pointId);
......
This diff is collapsed.
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