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;
......@@ -57,10 +59,13 @@ public class DataDictionaryController extends BaseController {
@Value("${redis.cache.failure.time}")
private long time;
@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,14 +292,20 @@ 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();
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
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);
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
// 数据字典生成树方法 原先通过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
......
......@@ -30,11 +30,25 @@ public class FormValue implements Serializable{
private String value;
@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;
......
......@@ -51,7 +51,8 @@ public class KeySiteExcleDto implements Serializable {
@ExcelProperty(value = "建筑面积(㎡)", index = 4)
@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,33 +12,40 @@ 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 {
/**
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "参加工作时间")
private Date workingHours;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date workingHours;
@ApiModelProperty(value = "参加消防部门工作时间")
private Date fireWorkingHours;
@ApiModelProperty(value = "参加消防部门工作时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fireWorkingHours;
@ApiModelProperty(value = "人员id")
private Long firefightersId;
@ApiModelProperty(value = "人员id")
private Long firefightersId;
@ApiModelProperty(value = "更新时间")
@TableField(fill=FieldFill.UPDATE)
private Date updateTime;
@ApiModelProperty(value = "更新时间")
@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);
}
......@@ -19,15 +19,15 @@ import java.util.Map;
* @date 2021-06-28
*/
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>
......
<?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.common.api.mapper.FirefightersMapper">
namespace="com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper">
<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>
<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
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>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<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=="0"'>and b.areas_expertise_code is not null</if>
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
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>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<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=="0"'>and b.areas_expertise_code is not null</if>
<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
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>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<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=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date limit #{pageNum},#{pageSize}
</select>
ORDER BY a.rec_date desc
</select>
<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
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>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<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=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date
</select>
<select id="listToSelectById" resultType="Map">
SELECT IFNULL(a.personnel_photos, '') personnelPhotos,
a.sequence_nbr
sequenceNbr,
IFNULL(a.`name`, '无') `name`,
IFNULL(a.job_title, '无')
jobTitle,
IFNULL(b.administrative_position, '无')
administrativePosition,
IFNULL(c.`name`, '无') fireTeamName,
IFNULL(a.state, '无') state,
IFNULL(b.employee_hierarchy, '无')
employeeHierarchy,
IFNULL(b.areas_expertise, '无') areasExpertise,
IFNULL(a.gender, '无') gender,
IFNULL(b.post_qualification, '无')
postQualification, year ( from_days( datediff( now( ),
a.birthday_time))) age
FROM cb_firefighters a LEFT JOIN cb_firefighters_post b
ON a.sequence_nbr
= b.firefighters_id LEFT JOIN cb_fire_team c on
c.sequence_nbr=a.fire_team_id
WHERE a.is_delete =0
and a.sequence_nbr=#{id}
</select>
<select id="listToSelectById" resultType="Map">
SELECT IFNULL(a.personnel_photos, '') personnelPhotos,
a.sequence_nbr
sequenceNbr,
IFNULL(a.`name`, '无') `name`,
IFNULL(a.job_title, '无')
jobTitle,
IFNULL(b.administrative_position, '无')
administrativePosition,
IFNULL(c.`name`, '无') fireTeamName,
IFNULL(a.state, '无') state,
IFNULL(b.employee_hierarchy, '无')
employeeHierarchy,
IFNULL(b.areas_expertise, '无') areasExpertise,
IFNULL(a.gender, '无') gender,
IFNULL(b.post_qualification, '无')
postQualification, year ( from_days( datediff( now( ),
a.birthday_time))) age
FROM cb_firefighters a LEFT JOIN cb_firefighters_post b
ON a.sequence_nbr
= b.firefighters_id LEFT JOIN cb_fire_team c on
c.sequence_nbr=a.fire_team_id
WHERE a.is_delete =0
and a.sequence_nbr=#{id}
</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
where f.is_delete = #{isDelete}
</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,
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>
</mapper>
......@@ -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 != ''">
AND clu.emergency_linkage_unit_code =#{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),
......@@ -64,6 +66,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>();
......
......@@ -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;
}
......@@ -332,14 +340,14 @@ public class InputItem extends BasicEntity {
}
public String getRiskDesc() {
return riskDesc;
}
return riskDesc;
}
public void setRiskDesc(String riskDesc) {
this.riskDesc = riskDesc;
}
public void setRiskDesc(String riskDesc) {
this.riskDesc = riskDesc;
}
public String getItemNo() {
public String getItemNo() {
return itemNo;
}
......@@ -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;
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
@Column(name = "creator_id")
private String creatorId;
/**
* 排序
*/
@Column(name = "order_no")
private int orderNo;
/**
* 巡检点检查项id
*/
@Column(name = "point_input_item_id")
private long pointInputItemId;
/**
* 创建者
*/
@Column(name="creator_id")
private String creatorId;
/**
* 排序
*/
@Column(name="order_no")
private int orderNo;
/**
* 巡检点检查项id
*/
@Column(name="point_input_item_id")
private long pointInputItemId;
/**
* 路线点表id
*/
@Column(name="route_point_id")
private long routePointId;
/**
* 点分类id
*/
@Column(name="point_classify_id")
private Long pointClassifyId;
/**
* 前端标记是否绑定
*/
private boolean isBound = true;
private RoutePoint routePoint;
/**
* 标准依据
*/
@Column(name = "basis_json", columnDefinition = "text COMMENT '标准依据'")
private String basisJson;
private long pointId;
public RoutePointItem() {
}
public String getCreatorId() {
return this.creatorId;
}
public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}
public int getOrderNo() {
return this.orderNo;
}
public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
}
public long getPointInputItemId() {
return this.pointInputItemId;
}
public void setPointInputItemId(long pointInputItemId) {
this.pointInputItemId = pointInputItemId;
}
public long getRoutePointId() {
return this.routePointId;
}
public void setRoutePointId(long routePointId) {
this.routePointId = routePointId;
}
@ManyToOne
@JoinColumn(name = "routePointId", referencedColumnName = "id", updatable = false, insertable = false)
public RoutePoint getRoutePoint() {
return routePoint;
}
@JsonBackReference
public void setRoutePoint(RoutePoint routePoint) {
this.routePoint = routePoint;
}
public Long getPointClassifyId() {
return pointClassifyId;
}
public void setPointClassifyId(Long pointClassifyId) {
this.pointClassifyId = pointClassifyId;
}
public String getBasisJson() {
return basisJson;
}
public void setBasisJson(String basisJson) {
this.basisJson = basisJson;
}
@Transient
public long getPointId() {
return pointId;
}
public void setPointId(long pointId) {
this.pointId = pointId;
}
@Transient
public boolean getIsBound() {
return isBound;
}
public void setIsBound(boolean bound) {
isBound = bound;
}
/**
* 路线点表id
*/
@Column(name = "route_point_id")
private long routePointId;
/**
* 点分类id
*/
@Column(name = "point_classify_id")
private Long pointClassifyId;
/**
* 前端标记是否绑定
*/
private boolean isBound = true;
private RoutePoint routePoint;
/**
* 标准依据
*/
@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() {
}
public String getCreatorId() {
return this.creatorId;
}
public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}
public int getOrderNo() {
return this.orderNo;
}
public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
}
public long getPointInputItemId() {
return this.pointInputItemId;
}
public void setPointInputItemId(long pointInputItemId) {
this.pointInputItemId = pointInputItemId;
}
public long getRoutePointId() {
return this.routePointId;
}
public void setRoutePointId(long routePointId) {
this.routePointId = routePointId;
}
@ManyToOne
@JoinColumn(name = "routePointId", referencedColumnName = "id", updatable = false, insertable = false)
public RoutePoint getRoutePoint() {
return routePoint;
}
@JsonBackReference
public void setRoutePoint(RoutePoint routePoint) {
this.routePoint = routePoint;
}
public Long getPointClassifyId() {
return pointClassifyId;
}
public void setPointClassifyId(Long pointClassifyId) {
this.pointClassifyId = pointClassifyId;
}
public String getBasisJson() {
return basisJson;
}
public void setBasisJson(String basisJson) {
this.basisJson = basisJson;
}
@Transient
public long getPointId() {
return pointId;
}
public void setPointId(long pointId) {
this.pointId = pointId;
}
@Transient
public boolean getIsBound() {
return isBound;
}
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;
/**
* 警情列表
*
......@@ -695,9 +704,71 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(powerTransferService.getPowerCompanyCountDtocount(id));
}
@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>();
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -8,7 +35,24 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.CheckObjectDto;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrzhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.dto.UserUnitDto;
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.MaintenanceCompany;
......@@ -23,24 +67,6 @@ import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.component.emq.EmqKeeper;
import javax.annotation.Resource;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* 机构/部门/人员表 服务实现类
*
......@@ -169,13 +195,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return resultList;
}
@SuppressWarnings("unchecked")
@Override
public List<OrgMenuDto> getSub(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL,
String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName,
String OrgTypeMethodName) throws Exception {
List<OrgMenuDto> childList = new ArrayList<>();
@SuppressWarnings("rawtypes")
Class clazz = Class.forName(packageURL);
Method IDMethodNameme = null;
switch (IDHierarchy) {
......@@ -239,7 +263,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return childList;
}
@Override
public List<Map<String, Object>> returnCompanyPersonMsg(List<Long> ids) throws Exception {
List<Map<String, Object>> companyPersonMsg = new ArrayList<>();
......@@ -350,7 +374,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
pageBean.setTotal(this.baseMapper.selectPersonListCount(map));
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize());
List<Map<String, Object>> list = this.baseMapper.selectPersonList(map);
/*Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束*/
......@@ -361,22 +384,25 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public List<FormValue> getFormValue(Long id) throws Exception {
// 动态表单数据
/*BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 开始 */
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList<>();
for (DynamicFormInstanceDto alertFormValue : list) {
if (alertFormValue.getFieldValueLabel() != null) {
/*修改为动态表单返回的数据参数量 2021-09-08 陈浩 开始 */
// if (alertFormValue.getFieldValueLabel() != null) {
// FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
// alertFormValue.getFieldType(), alertFormValue.getFieldValueLabel(), alertFormValue.getBlock());
// formValue.add(value);
// } else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
alertFormValue.getFieldType(), alertFormValue.getFieldValueLabel(), alertFormValue.getBlock());
alertFormValue.getFieldType(), alertFormValue.getFieldValue(), alertFormValue.getBlock(),alertFormValue.getFieldValueLabel());
formValue.add(value);
} else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
alertFormValue.getFieldType(), alertFormValue.getFieldValue(), alertFormValue.getBlock());
formValue.add(value);
}
/*修改为动态表单返回的数据参数量 2021-09-08 陈浩 结束 */
// }
/*BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 开始 */
}
return formValue;
/*BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 结束 */
}
public List<FormValue> getFormValueDetail(Long id) throws Exception {
......@@ -385,7 +411,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List<FormValue> formValue = new ArrayList<>();
for (DynamicFormInstanceDto alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
alertFormValue.getFieldType(), alertFormValue.getFieldValue(), alertFormValue.getBlock());
alertFormValue.getFieldType(), alertFormValue.getFieldValue(), alertFormValue.getBlock(),alertFormValue.getFieldValueLabel());//陈浩 添加getFieldValueLabel的属性值 2021-09-08
formValue.add(value);
}
return formValue;
......@@ -411,13 +437,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
private void updateChildOrgCode(String oriOrgCode, String targetOrgCode) {
List<OrgUsr> list = queryOrgUsrList(oriOrgCode);
if (ObjectUtils.isEmpty(list)) {
return;
}
if (!ObjectUtils.isEmpty(list)) {
list.forEach(action -> {
action.setBizOrgCode(action.getBizOrgCode().replace(oriOrgCode, targetOrgCode));
updateById(action);
});
}
}
public List<OrgUsr> queryOrgUsrList(String bizOrgCode) {
......@@ -512,8 +537,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 动态表单数据
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id);
Map<String, Object> result = new HashMap<>();
// 机场人员AMOS角色丢失修正, by litw start 2021年9月10日
if(null != orgUsr.getAmosOrgId()) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(orgUsr.getAmosOrgId());
if(null !=result1.getResult()) {
orgUsr.setAmosOrgCode(result1.getResult().getRealName());
}
}
// 机场人员AMOS角色丢失修正, by litw end 2021年9月10日
result = Bean.BeantoMap(orgUsr);
result.put("parenName", getById(orgUsr.getParentId()).getBizOrgName());
// 放入所有动态表单数据
for (DynamicFormColumn alertForm : alertForms) {
result.put(alertForm.getFieldCode(), null);
......@@ -582,11 +617,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setBizOrgCode(getOrgCodeStr());
}
if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
OrgPersonVo.setAmosOrgCode(user.getRealName());
}
saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
}
......@@ -619,6 +649,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgUsrVo, orgUsr);
/*单位编辑后 code值也应做出修改 2021-09-09 陈召 开始 */
OrgUsr parent = getById(OrgUsrVo.getParentId());
if (parent != null){
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
orgUsr.setSequenceNbr(id);
/*单位编辑后 code值也应做出修改 2021-09-09 陈召 结束 */
saveOrgUsr(orgUsr, oriOrgUsr);
// 保存动态表单数据
updateDynamicFormInstance(orgUsr.getSequenceNbr(), OrgUsrVo.getDynamicFormValue());
......@@ -634,16 +671,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setSequenceNbr(id);
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 开始*/
OrgUsr parent = getById(OrgPersonVo.getParentId());
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 开始*/
OrgUsr parent = getById(OrgPersonVo.getParentId());
if (parent != null){
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 结束*/
}
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 结束*/
orgUsr.setSequenceNbr(id);
if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
oriOrgUsr.setAmosOrgCode(user.getRealName());
// oriOrgUsr.setAmosOrgCode(user.getRealName()); 去掉AmosOrgCode by litw 2021年9月10日
oriOrgUsr.setAmosOrgId(user.getUserId());
orgUsr.setAmosOrgCode(user.getRealName());
//orgUsr.setAmosOrgCode(user.getRealName()); 去掉AmosOrgCode by litw 2021年9月10日
orgUsr.setAmosOrgId(user.getUserId());
}
......@@ -772,6 +811,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr);
/*部门编辑后 code值也应做出修改 2021-09-09 陈召 开始 */
OrgUsr parent = getById(OrgDepartmentVo.getParentId());
if (parent != null){
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
orgUsr.setSequenceNbr(id);
/*部门编辑后 code值也应做出修改 2021-09-09 陈召 结束 */
saveOrgUsr(orgUsr, oriOrgUsr);
// 保存动态表单数据
updateDynamicFormInstance(orgUsr.getSequenceNbr(), OrgDepartmentVo.getDynamicFormValue());
......@@ -957,7 +1004,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return null;
}
return ids.stream().map(m -> {
OrgUsr org = getById(m);
// BUG 2740 机场单位主键varchar 导致 通过主键搜索返回多条数据 2021 - 09 - 09by kongfm
OrgUsr org = getById(m.toString());
if (ObjectUtils.isEmpty(org)) {
return null;
}
......@@ -974,6 +1022,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public List<OrgUsrDto> queryForListByParentIdAndOrgType(Long parentId, String bizOrgType, Boolean isDelete) {
return this.queryForList(null, false, parentId, bizOrgType, isDelete);
}
public List<OrgUsrDto> queryForListByParentIdAndOrgType(Long parentId, String bizOrgType) {
return Bean.toModels(this.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete,false).eq(OrgUsr::getParentId,parentId).eq(OrgUsr::getBizOrgType,bizOrgType)), this.getModelClass());
}
public OrgUsrDto getOrg(String amosUserId) {
OrgUsrDto person = queryForListByParentIdAndOrgType(amosUserId);
......@@ -1146,11 +1198,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
Set<Long> set = new HashSet<>();
orgUsrList.forEach(orgUsr -> {
Long parent = ObjectUtils.isEmpty(orgUsr.getParentId()) ? 0L : Long.parseLong(orgUsr.getParentId());
if (set.add(parent)) {
Long companyIdByDto = getCompanyIdByDto(parent, companyList);
List<CheckObjectDto> orgUsrTreeDtoList = this.baseMapper.getCompanyAndKeySite(companyIdByDto);
list.addAll(companyAndKeySiteList(orgUsrTreeDtoList));
if (!StringUtils.isEmpty(orgUsr.getParentId())) {
Long parent = Long.parseLong(orgUsr.getParentId());
if (set.add(parent)) {
Long companyIdByDto = getCompanyIdByDto(parent, companyList);
List<CheckObjectDto> orgUsrTreeDtoList = this.baseMapper.getCompanyAndKeySite(companyIdByDto);
list.addAll(companyAndKeySiteList(orgUsrTreeDtoList));
}
}
});
// 返回所在用户单位列表
......@@ -1170,7 +1224,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) {
return orgUsr.getSequenceNbr();
} else {
pid = getCompanyIdByDto(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList);
if (!StringUtils.isEmpty(orgUsr.getParentId())) {
pid = getCompanyIdByDto(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList);
}
}
}
}
......@@ -1273,8 +1329,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List<OrgMenuDto> treeList = buildTreeParallel(companyDepartmentMsgList);
Set<Long> set = new HashSet<>();
orgUsrList.forEach(orgUsr -> {
Long parentId = Long.parseLong(orgUsr.getParentId());
getTreeChildre(list, treeList, parentId, set, companyDepartmentMsgList);
if (!StringUtils.isEmpty(orgUsr.getParentId())) {
Long parentId = Long.parseLong(orgUsr.getParentId());
getTreeChildre(list, treeList, parentId, set, companyDepartmentMsgList);
}
});
return list;
}
......@@ -1303,7 +1361,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 获取登陆人所在公司
Long pid = getCompanyId(parentId, companyDepartmentMsgList);
if (set.add(pid)) {
List<OrgMenuDto> list1 = treeList.stream().filter(orgMenuDto -> orgMenuDto.getKey().equals(pid)).collect(Collectors.toList());
List<OrgMenuDto> list1 = treeList.stream().filter(orgMenuDto -> !ObjectUtils.isEmpty(orgMenuDto) && pid.equals(orgMenuDto.getKey())).collect(Collectors.toList());
list.addAll(list1);
}
}
......@@ -1318,7 +1376,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) {
return orgUsr.getSequenceNbr();
} else {
pid = getCompanyId(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList);
if (!StringUtils.isEmpty(orgUsr.getParentId())) {
pid = getCompanyId(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList);
}
}
}
}
......@@ -1345,10 +1405,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public List<Map<String, Object>> getLoginUserDetails (AgencyUserModel user) {
public List<Map<String, Object>> getLoginUserDetails (String userId) {
// 获取登陆人关联账号
List<OrgUsr> orgUsrs = orgUsrList(user);
List<OrgUsr> orgUsrs = getUsrList(userId);
List<Map<String, Object>> list = new ArrayList<>();
if (!ObjectUtils.isEmpty(orgUsrs)) {
orgUsrs.forEach(orgUsr -> {
......@@ -1367,6 +1427,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return list;
}
/**
* 获取登陆人关联账号
*/
private List<OrgUsr> getUsrList(String userId) {
// 获取登陆人角色
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.eq(OrgUsr::getAmosOrgId, userId);
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
List<OrgUsr> orgUsrList = this.baseMapper.selectList(wrapper);
return orgUsrList;
}
}
......@@ -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 -> {
set.add(s.getName());
if(!ObjectUtils.isEmpty(s)){
set.add(s.getName());
}
});
List<String> list1 = new ArrayList<>(set);
......
......@@ -41,6 +41,8 @@ public class PushMsgParam {
* jpush发送类型:1:广播;2:标签;3:别名
*/
private String type = "3";
private String relationId;
public String getType() {
return type;
......@@ -90,5 +92,13 @@ public class PushMsgParam {
public void setEmails(String[] emails) {
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<>();
set.add(checkDetailBo.getCheckUserName());
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 -> {
userIds.add(e.get("userID")+"");
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 -> {
set.add(s.getName());
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,37 +66,7 @@ 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);
// }
/**
* 检查消息推送
* @param checkId
......@@ -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;
@Value("${Push.fegin.name}")
private String RPushFeginName;
private static String sendMessage = "/api/user/sendMessage";
// @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;
// }
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;
}
public void sendMessage( String toke,String product,String appKey, List<PushMsgParam> pushMsgParam){
try {
pushMsgParam.forEach(action->{
sendJP(action);
});
} catch (Exception e) {
e.printStackTrace();
}
}
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;
} catch (Exception e) {
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)
......
......@@ -10,6 +10,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.supervision.business.util.*;
import com.yeejoin.amos.supervision.business.vo.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
import com.yeejoin.amos.supervision.business.vo.PointInputItemVo;
......@@ -39,11 +40,6 @@ import com.yeejoin.amos.supervision.business.param.PlanTaskPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.service.intfc.IRouteService;
import com.yeejoin.amos.supervision.business.util.CommonResponse;
import com.yeejoin.amos.supervision.business.util.CommonResponseUtil;
import com.yeejoin.amos.supervision.business.util.FileHelper;
import com.yeejoin.amos.supervision.business.util.PlanTaskPageParamUtil;
import com.yeejoin.amos.supervision.business.util.Toke;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
......@@ -451,35 +447,35 @@ public class PlanTaskController extends AbstractBaseController {
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)", notes = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)")
@RequestMapping(value = "/queryPlanTaskById", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @RequestParam(required = true) Long planTaskId) {
try {
Map<String, Object> response = new HashMap<String, Object>();
Map task = planTaskService.queryPlanTaskById(planTaskId);
if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) {
return CommonResponseUtil.failure("该计划已刷新,请重新选择!!!");
}
List points = planTaskService.getPlanTaskPoints(planTaskId);
// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
// task.put("checkDate", task.get("checkDate").toString());
String[] userIds = task.get("userId").toString().split(",");
for (String userId : userIds) {
task.put("userId", userId);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
task.put("checkDate", sdf.format(task.get("checkDate") != null ? sdf.parse(task.get("checkDate").toString()) : new Date()));
response.put("planTask", task);
response.put("points", points);
return CommonResponseUtil.success(response);
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
}
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(value = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)", notes = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)")
// @RequestMapping(value = "/queryPlanTaskById", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
// public CommonResponse qryPlanTaskById(
// @ApiParam(value = "巡检计划任务ID", required = true) @RequestParam(required = true) Long planTaskId) {
// try {
// Map<String, Object> response = new HashMap<String, Object>();
// Map task = planTaskService.queryPlanTaskById(planTaskId);
// if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) {
// return CommonResponseUtil.failure("该计划已刷新,请重新选择!!!");
// }
// List points = planTaskService.getPlanTaskPoints(planTaskId);
//
//// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
//// task.put("checkDate", task.get("checkDate").toString());
// String[] userIds = task.get("userId").toString().split(",");
// for (String userId : userIds) {
// task.put("userId", userId);
// }
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// task.put("checkDate", sdf.format(task.get("checkDate") != null ? sdf.parse(task.get("checkDate").toString()) : new Date()));
// response.put("planTask", task);
// response.put("points", points);
// return CommonResponseUtil.success(response);
// } catch (Exception e) {
// return CommonResponseUtil.failure(e.getMessage());
// }
//
// }
/**
* 查询任务列表
......@@ -492,10 +488,10 @@ public class PlanTaskController extends AbstractBaseController {
@RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel qryLoginUserPlanTask(
@ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId,
@ApiParam(value = "开始日期") @RequestParam(value = "startTime") String startTime,
@ApiParam(value = "结束日期") @RequestParam(value = "endTime") String endTime,
@ApiParam(value = "开始日期") @RequestParam(value = "startTime", required = false) String startTime,
@ApiParam(value = "结束日期") @RequestParam(value = "endTime", required = false) String endTime,
@ApiParam(value = "检查状态") @RequestParam(value = "finishStatus", required = false) Integer finishStatus,
@ApiParam(value = "排序条件") @RequestParam(value = "orderBy") String orderBy,
@ApiParam(value = "排序条件") @RequestParam(value = "orderBy", defaultValue = "1") String orderBy,
@ApiParam(value = "被检查单位") @RequestParam(value = "companyId", required = false) String companyId,
@ApiParam(value = "检查人员") @RequestParam(value = "executorId", required = false) Long executorId,
@ApiParam(value = "任务类型") @RequestParam(value = "taskType", required = false) String taskType,
......@@ -514,7 +510,6 @@ public class PlanTaskController extends AbstractBaseController {
params.put("endTime", endTime);
params.put("executorId", executorId);
params.put("finishStatus", finishStatus);
params.put("taskType", TaskCheckTypeEnum.getEumByCode(taskType).getName());
params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy());
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return ResponseHelper.buildResponse(planTaskService.getPlanTasks(params, pageable));
......@@ -524,7 +519,18 @@ public class PlanTaskController extends AbstractBaseController {
@ApiOperation(value = "根据检查任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)", notes = "根据检查任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)")
@RequestMapping(value = "/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel qryPlanTaskDetailById(
@ApiParam(value = "检查计划任务ID", required = true) @RequestParam Long planTaskId) {
@ApiParam(value = "检查计划任务ID", required = true) @RequestParam Long planTaskId,
@ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId,
@ApiParam(value = "开始日期") @RequestParam(value = "startTime", required = false) String startTime,
@ApiParam(value = "结束日期") @RequestParam(value = "endTime", required = false) String endTime,
@ApiParam(value = "检查状态") @RequestParam(value = "finishStatus", required = false) Integer finishStatus,
@ApiParam(value = "排序条件") @RequestParam(value = "orderBy", defaultValue = "1") String orderBy,
@ApiParam(value = "被检查单位") @RequestParam(value = "companyId", required = false) String companyId,
@ApiParam(value = "检查人员") @RequestParam(value = "executorId", required = false) Long executorId,
@ApiParam(value = "任务类型") @RequestParam(value = "taskType", required = false) String taskType,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小", required = true) @RequestParam(value = "pageSize") int pageSize
) {
ResponseModel result = null;
try {
Map<String, Object> response = new HashMap<String, Object>();
......@@ -532,13 +538,19 @@ public class PlanTaskController extends AbstractBaseController {
if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) {
result = ResponseHelper.buildResponse("该计划已刷新,请重新选择!!!");
} else {
List points = planTaskService.getPlanTaskPoints(planTaskId);
String[] userIds = task.get("userId").toString().split(",");
for (String userId : userIds) {
task.put("userId", userId);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
task.put("checkDate", sdf.format(task.get("checkDate") != null ? sdf.parse(task.get("checkDate").toString()) : new Date()));
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("userId", userId);
params.put("companyId", companyId);
params.put("orgCode", loginOrgCode);
params.put("taskType", taskType);
params.put("startTime", startTime);
params.put("endTime", endTime);
params.put("executorId", executorId);
params.put("finishStatus", finishStatus);
params.put("planTaskId", planTaskId);
params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy());
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
Page<Map<String, Object>> points = planTaskService.getPlanTaskPoints(params, pageable);
response.put("planTask", task);
response.put("points", points);
result = ResponseHelper.buildResponse(response);
......@@ -714,4 +726,32 @@ public class PlanTaskController extends AbstractBaseController {
return CommonResponseUtil.failure(e.getMessage());
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "防火监督任务排序条件", notes = "防火监督任务排序条件")
@RequestMapping(value = "/orderBy/list", method = RequestMethod.GET)
public ResponseModel getOrderByList() {
return ResponseHelper.buildResponse(OrderByEnum.getEnumList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "防火监督检查类型条件", notes = "防火监督检查类型条件")
@RequestMapping(value = "/checkType/list", method = RequestMethod.GET)
public ResponseModel getCheckTypeList() {
return ResponseHelper.buildResponse(CheckTypeSuEnum.getEnumList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "防火监督检查任务条件", notes = "防火监督检查任务条件")
@RequestMapping(value = "/planTaskFinishStatus/list", method = RequestMethod.GET)
public ResponseModel getPlanTaskFinishStatusList() {
return ResponseHelper.buildResponse(PlanTaskFinishStatusEnum.getEnumList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "防火监督检查任务详情条件", notes = "防火监督检查任务详情条件")
@RequestMapping(value = "/planTaskDetailIsStatus/list", method = RequestMethod.GET)
public ResponseModel getPlanTaskDetailIsStatusList() {
return ResponseHelper.buildResponse(PlanTaskDetailIsFinishEnum.getEnumList());
}
}
......@@ -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);
......
......@@ -12,6 +12,7 @@ import com.yeejoin.amos.supervision.business.param.PlanTaskPageParam;
import com.yeejoin.amos.supervision.business.vo.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.LeavePlanTaskVo;
import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
......@@ -77,10 +78,12 @@ public interface PlanTaskMapper extends BaseMapper {
Map queryPlanTaskById(@Param(value="planTaskId") Long planTaskId);
/**
* 通过计划任务Id获取任务所有点信息
* @param planTaskId
* @param params
* @return
*/
List getPlanTaskPoints(@Param(value="planTaskId") Long planTaskId);
List<Map<String, Object>> getPlanTaskPoints(HashMap<String, Object> params);
long getPlanTaskPointsCount(HashMap<String, Object> params);
/**
* 获取用户当前所有可以做的任务个数
* @param userId
......
......@@ -157,5 +157,10 @@ public interface PointMapper extends BaseMapper {
*/
List<Long> getPointoriginalidbyrouteid(@Param(value = "routeId") Long routeId);
List<Map<String, Object>> queryItemsByPointId(@Param(value = "pointId") Long pointId);
List<Map<String, Object>> queryItemsByPointId(@Param(value = "pointId") Long pointId ,@Param(value = "routeId") Long routeId);
/**
* 查询点id,name
*/
List<Map<String, Object>> getPlanExecuteTeams();
}
......@@ -22,6 +22,9 @@ public interface IInputItemDao extends BaseDao<InputItem, Long> {
@Query(value = "select * from p_input_item where original_id in ?1 and is_delete =0", nativeQuery = true)
List<InputItem> listByOriginalIds(List<String> originalIds);
@Query(value = "select * from p_input_item where id in ?1 and is_delete =0", nativeQuery = true)
List<InputItem> listByIds(List<Long> ids);
@Query(value = "select * from p_input_item where item_no = ?1 and equipment_name = ?2 and is_delete =0", nativeQuery = true)
List<InputItem> findByItemNoAndEquipmentName(String itemNo,String equipmentName);
......
......@@ -23,4 +23,9 @@ public interface IRoutePointItemDao extends BaseDao<RoutePointItem, Long> {
@Transactional
@Query(value = "delete from p_route_point_item WHERE id in (?1)", nativeQuery = true)
void deleteByRoutePointItemId(List<Long> delRoutePointItemIds);
@Modifying
@Transactional
@Query(value = "delete from p_route_point_item WHERE plan_id = ?1", nativeQuery = true)
void deleteByPlanId(Long planId);
}
......@@ -21,9 +21,12 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor {
}
ServletRequestAttributes attributes = (ServletRequestAttributes) requestAttributes;
HttpServletRequest request = attributes.getRequest();
//设置header
String token = request.getHeader("X-Access-Token");
String token = request.getHeader("token");
if (token == null) {
token = request.getHeader("X-Access-Token");
}
String product = request.getHeader("product");
String appKey = request.getHeader("appKey");
template.header("token", token);
......
package com.yeejoin.amos.supervision.business.feign;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
/**
* @author DELL
*/
@FeignClient(name = "${jcs.fegin.name}",configuration = FeignConfiguration.class)
public interface JCSFeignClient {
/**
* 查询用户单位信息
* @param userId 用户id
* @return ResponseModel<ReginParams.PersonIdentity>
*/
@GetMapping(value = "jcs/org-usr/getLoginUserDetails?userId={userId}")
FeignClientResult getUserUnit(@PathVariable String userId);
}
......@@ -11,6 +11,7 @@ public class InputItemPageParam extends CommonPageable{
private String name;
private String level;
private String itemNo;
private String checkTypeId;
/**
* 机构
*/
......@@ -82,4 +83,12 @@ public class InputItemPageParam extends CommonPageable{
public void setCatalogIds(List<Long> catalogIds) {
this.catalogIds = catalogIds;
}
public String getCheckTypeId() {
return checkTypeId;
}
public void setCheckTypeId(String checkTypeId) {
this.checkTypeId = checkTypeId;
}
}
......@@ -939,13 +939,12 @@ public class CheckServiceImpl implements ICheckService {
if (total == 0) {
return new PageImpl<>(content, page, total);
}
map.put("status", PlanTaskFinishStatusEnum.getValue(String.valueOf(map.get("status"))));
map.put("offset", page.getOffset());
map.put("pageSize", page.getPageSize());
content = checkMapper.getCheckItems(map);
content.forEach(c -> {
if (c.containsKey("finishStatus")) {
String finishStatusDesc = PlanTaskFinishStatusEnum.getName(Integer.parseInt(c.get("finishStatus").toString()));
String finishStatusDesc = CheckItemFinishStatusEnum.getName(c.get("finishStatus").toString());
c.put("finishStatus", finishStatusDesc);
}
});
......@@ -953,8 +952,8 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public List<Map<String, String>> getPlanExecuteStates() {
return PlanTaskFinishStatusEnum.getEnumList();
public List<Map<String, Object>> getPlanExecuteStates() {
return CheckItemFinishStatusEnum.getEnumList();
}
@Override
......@@ -1385,12 +1384,11 @@ public class CheckServiceImpl implements ICheckService {
@Transactional
public CheckDto saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception {
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
//执行人-维保人员,非amos 账号
if (ObjectUtils.isEmpty(reginParams.getUserModel()) && ObjectUtils.isEmpty(reginParams.getCompany()) && ObjectUtils.isEmpty(reginParams.getDepartment()) ) {
if (ObjectUtils.isEmpty(reginParams.getUserModel()) && ObjectUtils.isEmpty(reginParams.getCompany()) && ObjectUtils.isEmpty(personIdentity) ) {
throw new RuntimeException("获取用户信息失败");
}
String mtUserSeq = reginParams.getUserModel().getUserId();
String userName = reginParams.getUserModel().getUserName();
String mtUserSeq = personIdentity.getPersonSeq();
String userName = personIdentity.getPersonName();
// String mtUserSeq = personIdentity.getPersonSeq();
PlanTask planTask = planTaskService.selectPlanTaskStatus(recordParam.getPlanTaskId());
Map detail = planTaskDetailMapper.findPlanTaskByTaskIdAndPointId(recordParam.getPlanTaskId(), recordParam.getPointId());
......@@ -1420,11 +1418,11 @@ public class CheckServiceImpl implements ICheckService {
check.setUserId(mtUserSeq);
check.setCheckTime(new Date());
check.setUploadTime(new Date());
check.setUserName(reginParams.getUserModel().getUserName());
check.setUserName(personIdentity.getPersonName());
check.setCompanyId(reginParams.getCompany().getSequenceNbr().toString());
check.setCompanyName(reginParams.getCompany().getCompanyName());
check.setDepId(reginParams.getDepartment().getSequenceNbr().toString());
check.setDepName(reginParams.getDepartment().getDepartmentName());
check.setDepId(personIdentity.getCompanyId());
check.setDepName(personIdentity.getCompanyName());
} else {
// 更新
check = checkByPointId;
......@@ -1446,11 +1444,11 @@ public class CheckServiceImpl implements ICheckService {
if (!companyName.contains(reginParams.getCompany().getCompanyName())) {
check.setCompanyName(companyName+","+reginParams.getCompany().getCompanyName());
}
if (!depId.contains(reginParams.getDepartment().getSequenceNbr().toString())) {
check.setDepId(depId+","+reginParams.getDepartment().getSequenceNbr().toString());
if (!depId.contains(personIdentity.getCompanyId())) {
check.setDepId(depId+","+personIdentity.getCompanyId());
}
if (!depName.contains(reginParams.getDepartment().getDepartmentName())) {
check.setDepName(depName+","+reginParams.getDepartment().getDepartmentName());
if (!depName.contains(personIdentity.getCompanyName())) {
check.setDepName(depName+","+personIdentity.getCompanyName());
}
}
......@@ -1553,7 +1551,13 @@ public class CheckServiceImpl implements ICheckService {
checkShotDao.saveAll(allShot);
}
planTaskDetailMapper.finishTaskDetail(Long.parseLong(detail.get("planTaskDetailId").toString()), recordParam.getPointId(), recordParam.getPlanTaskId(), mtUserSeq, userName);
int size = 0;
if (!ObjectUtils.isEmpty(list)) {
size = list.size();
}
planTaskDetailMapper.finishTaskDetail(Long.parseLong(detail.get("planTaskDetailId").toString()), recordParam.getPointId(),
recordParam.getPlanTaskId(), mtUserSeq, userName, size);
//7.返回不合格记录
return new CheckDto(check.getId(), unqualifiedCheckItemList);
} catch (Exception e) {
......
......@@ -15,6 +15,7 @@ import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone;
import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.dao.entity.*;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import org.apache.commons.lang.StringUtils;
import org.apache.velocity.util.ArrayListWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -150,6 +151,10 @@ public class PlanServiceImpl implements IPlanService {
saveRoute.setName(plan.getName());
saveRoute.setOrgCode(plan.getOrgCode());
saveRoute.setCreatorId(plan.getCreateBy());
if (!ObjectUtils.isEmpty(addPlanRequest.getOwnerId())) {
String ownerId = StringUtils.join(addPlanRequest.getOwnerId().toArray(), ",");
saveRoute.setOwnerId(ownerId);
}
Route route = iRouteDao.save(saveRoute);
if (!ObjectUtils.isEmpty(route.getId())) {
......@@ -166,16 +171,19 @@ public class PlanServiceImpl implements IPlanService {
routePoint.setRouteId(route.getId());
routePoint.setPointId(point);
iRoutePointDao.save(routePoint);
// List<PointInputItem> pointInputItems = pointMapper.getCheckPointById(point);
List<PointInputItem> pointInputItems = iPointInputItemDao.getPointInputItemByPointId(point);
pointMapper.getPointClassInputItemById(point);
if (!ObjectUtils.isEmpty(pointInputItems)) {
pointInputItems.forEach(pointInputItem -> {
RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setRoutePointId(routePoint.getId());
routePointItem.setPointInputItemId(pointInputItem.getId());
iRoutePointItemDao.save(routePointItem);
});
}
});
List<PointInputItem> pointInputItems = pointMapper.getPointRouteItem(pointVos);
if (!ObjectUtils.isEmpty(pointInputItems)) {
pointInputItems.forEach(pointInputItem -> {
RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setRoutePointId(route.getId());
routePointItem.setPointInputItemId(pointInputItem.getId());
iRoutePointItemDao.save(routePointItem);
});
}
}
}
}
......
......@@ -30,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CalDateVo;
import com.yeejoin.amos.supervision.business.vo.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.LeavePlanTaskVo;
import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
import com.yeejoin.amos.supervision.common.enums.PlanTaskDetailIsFinishEnum;
import com.yeejoin.amos.supervision.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone;
......@@ -608,8 +609,23 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
@Override
public List getPlanTaskPoints(Long planTaskId) {
return planTaskMapper.getPlanTaskPoints(planTaskId);
public Page<Map<String, Object>> getPlanTaskPoints(HashMap<String, Object> params, CommonPageable pageable) {
List<Map<String, Object>> content = Lists.newArrayList();
long total = planTaskMapper.getPlanTaskPointsCount(params);
if (total == 0) {
return new PageImpl<>(content, pageable, total);
}
params.put("offset", pageable.getOffset());
params.put("pageSize", pageable.getPageSize());
List<Map<String, Object>> result = planTaskMapper.getPlanTaskPoints(params);
result.forEach(r -> {
if (r.containsKey("finish")) {
String isFinishDesc = PlanTaskDetailIsFinishEnum.getName(Integer.parseInt(r.get("finish").toString()));
r.put("isFinishDesc", isFinishDesc);
}
});
return new PageImpl<>(result, pageable, total);
// return result;
}
@Override
......
......@@ -3,46 +3,25 @@ package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.safety.common.cache.PointStatusCache;
import com.yeejoin.amos.supervision.business.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.PointMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.dao.repository.ICatalogTreeDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanTaskDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanTaskDetailDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPointClassifyDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPointDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPointInputItemDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPointPhotoDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointItemDao;
import com.yeejoin.amos.supervision.business.dto.FormValue;
import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto;
import com.yeejoin.amos.supervision.business.dto.PointDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckPtListBo;
import com.yeejoin.amos.supervision.business.feign.EquipFeign;
import com.yeejoin.amos.supervision.business.param.*;
import com.yeejoin.amos.supervision.business.param.CheckPtListPageParam;
import com.yeejoin.amos.supervision.business.param.MovePointParam;
import com.yeejoin.amos.supervision.business.param.PointImportParam;
import com.yeejoin.amos.supervision.business.param.PointImportQueryParam;
import com.yeejoin.amos.supervision.business.param.PointParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.util.DaoCriteria;
import com.yeejoin.amos.supervision.business.vo.*;
import com.yeejoin.amos.supervision.business.vo.InputItemVo;
import com.yeejoin.amos.supervision.business.vo.LeavelMovePointVo;
import com.yeejoin.amos.supervision.business.vo.MaintenanceResourceData;
import com.yeejoin.amos.supervision.business.vo.PointClassifyVo;
import com.yeejoin.amos.supervision.business.vo.PointInputItemVo;
import com.yeejoin.amos.supervision.business.vo.PointVo;
import com.yeejoin.amos.supervision.common.enums.PointStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.PointResponse;
......@@ -51,19 +30,8 @@ import com.yeejoin.amos.supervision.core.util.query.BaseQuerySpecification;
import com.yeejoin.amos.supervision.dao.entity.*;
import com.yeejoin.amos.supervision.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import com.yeejoin.amos.safety.common.cache.PointStatusCache;
import com.yeejoin.amos.supervision.dao.entity.CatalogTree;
import com.yeejoin.amos.supervision.dao.entity.InputItem;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail;
import com.yeejoin.amos.supervision.dao.entity.Point;
import com.yeejoin.amos.supervision.dao.entity.PointClassify;
import com.yeejoin.amos.supervision.dao.entity.PointInputItem;
import com.yeejoin.amos.supervision.dao.entity.PointPhoto;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.assertj.core.util.Sets;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -141,7 +109,7 @@ public class PointServiceImpl implements IPointService {
Point point = pointParam.getPoint();
point.setIsDelete(false);
iPointDao.saveAndFlush(point);
addClassifyAndInputItem(pointParam, point);
// addClassifyAndInputItem(pointParam, point);
return point;
}
......@@ -1215,8 +1183,8 @@ public class PointServiceImpl implements IPointService {
}
@Override
public List<Map<String, Object>> queryItemDetailByPointId(Long id) {
List<Map<String, Object>> list = pointMapper.queryItemsByPointId(id);
public List<Map<String, Object>> queryItemDetailByPointId(Long id, Long routeId) {
List<Map<String, Object>> list = pointMapper.queryItemsByPointId(id, routeId);
if (0 < list.size()) {
for (Map<String, Object> map : list) {
if (map.containsKey("picJson") && !ObjectUtils.isEmpty(map.get("picJson"))) {
......@@ -1227,4 +1195,9 @@ public class PointServiceImpl implements IPointService {
return list;
}
@Override
public List<Map<String, Object>> getPlanExecuteTeams() {
return pointMapper.getPlanExecuteTeams();
}
}
package com.yeejoin.amos.supervision.business.service.impl;
import com.google.common.collect.Lists;
import com.yeejoin.amos.supervision.business.dao.repository.IInputItemDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointItemDao;
import com.yeejoin.amos.supervision.business.service.intfc.IRoutePointItemService;
import com.yeejoin.amos.supervision.dao.entity.InputItem;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.RoutePoint;
import com.yeejoin.amos.supervision.dao.entity.RoutePointItem;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service("routePointItemService")
public class RoutePointItemServiceImpl implements IRoutePointItemService {
@Autowired
private IRoutePointItemDao routePointItemDao;
@Autowired
private IInputItemDao inputItemDao;
@Autowired
private IRoutePointDao routePointDao;
@Override
public List<RoutePointItem> addRoutePointItemList(Plan plan, List<Long> inputItemIds, String userId) {
Long planId = plan.getId();
Long routeId = plan.getRouteId();
if (CollectionUtils.isNotEmpty(inputItemIds) && routeId != null && planId != null) {
routePointItemDao.deleteByPlanId(planId);
List<InputItem> inputItemList = inputItemDao.listByIds(inputItemIds);
List<RoutePoint> routePointList = routePointDao.findByRouteId(routeId);
if (CollectionUtils.isNotEmpty(inputItemList) && CollectionUtils.isNotEmpty(routePointList)) {
List<RoutePointItem> list = new ArrayList<>();
routePointList.stream().forEach(route->{
Long routePointId = route.getId();
inputItemList.stream().forEach(item->{
RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setInputItemId(item.getId());
routePointItem.setBasisJson(item.getBasisJson());
routePointItem.setOrderNo(item.getOrderNo());
routePointItem.setRoutePointId(routePointId);
routePointItem.setCreatorId(userId);
routePointItem.setCreateDate(new Date());
list.add(routePointItem);
});
});
return routePointItemDao.saveAll(list);
}
}
return Lists.newArrayList();
}
}
......@@ -267,7 +267,7 @@ public interface ICheckService {
Page<HashMap<String, Object>> getPlanExecuteInfo(HashMap<String, Object> map, CommonPageable page);
List<Map<String, String>> getPlanExecuteStates();
List<Map<String, Object>> getPlanExecuteStates();
List<Map<String, Object>> getPlanExecuteTeams();
......
......@@ -91,10 +91,10 @@ public interface IPlanTaskService {
/**
* 根据计划ID获取所有的 任务计划巡检点
* @param planTaskId
* @param params
* @return
*/
List getPlanTaskPoints(Long planTaskId);
Page<Map<String, Object>> getPlanTaskPoints(HashMap<String, Object> params, CommonPageable pageable);
/**
* 获取用户当前所有有的计划任务
......
......@@ -327,6 +327,8 @@ public interface IPointService {
*/
void delPointByPointNo(Long id);
List<Map<String, Object>> queryItemDetailByPointId(Long id);
List<Map<String, Object>> queryItemDetailByPointId(Long id, Long routeId);
List<Map<String, Object>> getPlanExecuteTeams();
}
package com.yeejoin.amos.supervision.business.service.intfc;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.RoutePointItem;
import java.util.List;
public interface IRoutePointItemService {
List<RoutePointItem> addRoutePointItemList(Plan plan, List<Long> inputItemIds, String userId);
}
......@@ -58,6 +58,8 @@ public class InputItemParamUtil {
param.setInputClassify(toString(queryRequests.get(i).getValue()));
} else if ("itemClassify".equals(name)) {
param.setItemClassify(toString(queryRequests.get(i).getValue()));
} else if ("checkTypeId".equals(name)) {
param.setCheckTypeId(toString(queryRequests.get(i).getValue()));
}
}
}
......
......@@ -3,382 +3,402 @@ package com.yeejoin.amos.supervision.business.vo;
import java.util.Date;
public class InputItemVo {
private long id ;
/**
* 分类ID
*/
private long catalogId;
private String catalogName;
/**
private long id;
/**
* 分类ID
*/
private long catalogId;
private String catalogName;
/**
* 创建者
*/
private String createBy;
/**
* 配置JSON
*/
private String dataJson;
/**
* 默认值
*/
private String defaultValue;
/**
* 扩展项json
*/
private String inputJson;
/**
* 是否多选
*/
private String isMultiline;
/**
* 是否必填
*/
private String isMust;
/**
* 是否评分
*/
private String isScore;
/**
* 检查项类型
*/
private String itemType;
/**
* 检查项名称
*/
private String name;
/**
* 排序编码
*/
private int orderNo;
/**
* 组织编码
*/
private String orgCode;
/**
* 拍照配置json
*/
private String pictureJson;
private String remark;
/**
* 是否删除:0表示未删除,1表示已删除
*/
private boolean isDelete;
/**
* 巡检项等级
*/
private String level;
/**
* 巡检项编号s
*/
private String itemNo;
/**
* 风险描述
*/
private String riskDesc;
/**
* 维保项内容
*/
private String maintenanceContent;
/**
* 测试要求
*/
private String testRequirement;
/**
* 维保方法
*/
private String checkMethod;
/**
* 创建时间
*/
private Date createDate;
/**
* 维保项分类
*/
private String inputClassify;
private String checkType;
private String itemParent;
private String itemClassify;
private String itemTypeClassify;
private String itemLevel;
private String itemStart;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getItemParent() {
return itemParent;
}
public void setItemParent(String itemParent) {
this.itemParent = itemParent;
}
public String getItemClassify() {
return itemClassify;
}
public void setItemClassify(String itemClassify) {
this.itemClassify = itemClassify;
}
public String getItemTypeClassify() {
return itemTypeClassify;
}
public void setItemTypeClassify(String itemTypeClassify) {
this.itemTypeClassify = itemTypeClassify;
}
public String getItemLevel() {
return itemLevel;
}
public void setItemLevel(String itemLevel) {
this.itemLevel = itemLevel;
}
public String getItemStart() {
return itemStart;
}
public void setItemStart(String itemStart) {
this.itemStart = itemStart;
}
public String getInputClassify() {
return inputClassify;
}
public void setInputClassify(String inputClassify) {
this.inputClassify = inputClassify;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public void setCheckMethod(String checkMethod) {
this.checkMethod = checkMethod;
}
public String getCheckMethod() {
return checkMethod;
}
public void setMaintenanceContent(String maintenanceContent) {
this.maintenanceContent = maintenanceContent;
}
public void setTestRequirement(String testRequirement) {
this.testRequirement = testRequirement;
}
public String getMaintenanceContent() {
return maintenanceContent;
}
public String getTestRequirement() {
return testRequirement;
}
private String createBy;
/**
* 配置JSON
*/
private String dataJson;
/**
* 默认值
*/
private String defaultValue;
/**
* 扩展项json
*/
private String inputJson;
/**
* 是否多选
*/
private String isMultiline;
/**
* 是否必填
*/
private String isMust;
/**
* 是否评分
*/
private String isScore;
/**
* 检查项类型
*/
private String itemType;
/**
* 检查项名称
*/
private String name;
/**
* 排序编码
*/
private int orderNo;
/**
* 组织编码
*/
private String orgCode;
/**
* 拍照配置json
*/
private String pictureJson;
private String remark;
/**
* 是否删除:0表示未删除,1表示已删除
*/
private boolean isDelete;
/**
* 巡检项等级
*/
private String level;
/**
* 巡检项编号s
*/
private String itemNo;
/**
* 风险描述
*/
private String riskDesc;
/**
* 维保项内容
*/
private String maintenanceContent;
/**
* 测试要求
*/
private String testRequirement;
/**
* 维保方法
*/
private String checkMethod;
/**
* 创建时间
*/
private Date createDate;
/**
* 维保项分类
*/
private String inputClassify;
private String checkTypeId;
private String checkType;
private String itemParent;
private String itemClassify;
private String itemTypeClassify;
private String itemLevel;
private String itemStart;
/**
* 扩展属性
*/
private String ext;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getItemParent() {
return itemParent;
}
public void setItemParent(String itemParent) {
this.itemParent = itemParent;
}
public String getItemClassify() {
return itemClassify;
}
public void setItemClassify(String itemClassify) {
this.itemClassify = itemClassify;
}
public String getItemTypeClassify() {
return itemTypeClassify;
}
public void setItemTypeClassify(String itemTypeClassify) {
this.itemTypeClassify = itemTypeClassify;
}
public String getItemLevel() {
return itemLevel;
}
public void setItemLevel(String itemLevel) {
this.itemLevel = itemLevel;
}
public String getItemStart() {
return itemStart;
}
public void setItemStart(String itemStart) {
this.itemStart = itemStart;
}
public String getInputClassify() {
return inputClassify;
}
public void setInputClassify(String inputClassify) {
this.inputClassify = inputClassify;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public void setCheckMethod(String checkMethod) {
this.checkMethod = checkMethod;
}
public String getCheckMethod() {
return checkMethod;
}
public void setMaintenanceContent(String maintenanceContent) {
this.maintenanceContent = maintenanceContent;
}
public String getItemNo() {
return itemNo;
}
public void setTestRequirement(String testRequirement) {
this.testRequirement = testRequirement;
}
public void setItemNo(String itemNo) {
this.itemNo = itemNo;
}
public String getMaintenanceContent() {
return maintenanceContent;
}
public String getLevel() {
return level;
}
public String getTestRequirement() {
return testRequirement;
}
public void setLevel(String level) {
this.level = level;
}
public String getItemNo() {
return itemNo;
}
public long getId() {
return id;
}
public void setItemNo(String itemNo) {
this.itemNo = itemNo;
}
public void setId(long id) {
this.id = id;
}
public String getLevel() {
return level;
}
public long getCatalogId() {
return catalogId;
}
public void setLevel(String level) {
this.level = level;
}
public void setCatalogId(long catalogId) {
this.catalogId = catalogId;
}
public long getId() {
return id;
}
public String getCreateBy() {
return createBy;
}
public void setId(long id) {
this.id = id;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public long getCatalogId() {
return catalogId;
}
public String getDataJson() {
return dataJson;
}
public void setCatalogId(long catalogId) {
this.catalogId = catalogId;
}
public void setDataJson(String dataJson) {
this.dataJson = dataJson;
}
public String getCreateBy() {
return createBy;
}
public String getDefaultValue() {
return defaultValue;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public String getDataJson() {
return dataJson;
}
public String getInputJson() {
return inputJson;
}
public void setDataJson(String dataJson) {
this.dataJson = dataJson;
}
public void setInputJson(String inputJson) {
this.inputJson = inputJson;
}
public String getDefaultValue() {
return defaultValue;
}
public String getIsMultiline() {
return isMultiline;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public void setIsMultiline(String isMultiline) {
this.isMultiline = isMultiline;
}
public String getInputJson() {
return inputJson;
}
public String getIsMust() {
return isMust;
}
public void setInputJson(String inputJson) {
this.inputJson = inputJson;
}
public void setIsMust(String isMust) {
this.isMust = isMust;
}
public String getIsMultiline() {
return isMultiline;
}
public String getIsScore() {
return isScore;
}
public void setIsMultiline(String isMultiline) {
this.isMultiline = isMultiline;
}
public void setIsScore(String isScore) {
this.isScore = isScore;
}
public String getIsMust() {
return isMust;
}
public String getItemType() {
return itemType;
}
public void setIsMust(String isMust) {
this.isMust = isMust;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getIsScore() {
return isScore;
}
public String getName() {
return name;
}
public void setIsScore(String isScore) {
this.isScore = isScore;
}
public void setName(String name) {
this.name = name;
}
public String getItemType() {
return itemType;
}
public int getOrderNo() {
return orderNo;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
}
public String getName() {
return name;
}
public String getOrgCode() {
return orgCode;
}
public void setName(String name) {
this.name = name;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public int getOrderNo() {
return orderNo;
}
public String getPictureJson() {
return pictureJson;
}
public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
}
public void setPictureJson(String pictureJson) {
this.pictureJson = pictureJson;
}
public String getOrgCode() {
return orgCode;
}
public String getRemark() {
return remark;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getPictureJson() {
return pictureJson;
}
public boolean isDelete() {
return isDelete;
}
public void setPictureJson(String pictureJson) {
this.pictureJson = pictureJson;
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public String getRemark() {
return remark;
}
public String getCatalogName() {
return catalogName;
}
public void setRemark(String remark) {
this.remark = remark;
}
public void setCatalogName(String catalogName) {
this.catalogName = catalogName;
}
public boolean isDelete() {
return isDelete;
}
public InputItemVo() {
super();
// TODO Auto-generated constructor stub
}
public void setDelete(boolean isDelete) {
this.isDelete = isDelete;
}
public String getRiskDesc() {
return riskDesc;
}
public String getCatalogName() {
return catalogName;
}
public void setRiskDesc(String riskDesc) {
this.riskDesc = riskDesc;
}
public void setCatalogName(String catalogName) {
this.catalogName = catalogName;
}
public InputItemVo() {
super();
// TODO Auto-generated constructor stub
}
public String getRiskDesc() {
return riskDesc;
}
public void setRiskDesc(String riskDesc) {
this.riskDesc = riskDesc;
}
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;
}
}
package com.yeejoin.amos.supervision.core.framework;
import java.lang.annotation.*;
/**
* @author DELL
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface PersonIdentify {
/**
* 是否进行人员校验
* @return
*/
boolean isNeedIdentity() default true;
}
package com.yeejoin.amos.supervision.core.framework;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
import com.yeejoin.amos.supervision.exception.PermissionException;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.ResponseBody;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
@Aspect
@Component
@ResponseBody
@Order(value = 1)
public class PersonIdentifyAspect {
@Autowired
RedisUtils redisUtils;
@Autowired
JCSFeignClient jcsFeignClient;
final int HTTP_OK_STATUS = 200;
@Before(value = "@annotation(com.yeejoin.amos.supervision.core.framework.PersonIdentify) && @annotation(permission)")
public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (permission.isNeedIdentity() && reginParam != null) {
//调用jcs,进行人员身份判断,是维保公司人员还是业主单位人员
String userId = reginParam.getUserModel().getUserId();
FeignClientResult responseModel = jcsFeignClient.getUserUnit(userId);
if (ObjectUtils.isEmpty(responseModel.getResult()) || responseModel.getStatus() != HTTP_OK_STATUS) {
throw new RuntimeException(responseModel.getDevMessage());
}
List result = (List)responseModel.getResult();
ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
if (!ObjectUtils.isEmpty(result)) {
Map map = (Map)result.get(0);
Map other = (Map)map.get("other");
Map person = (Map)map.get("PERSON");
if (!ObjectUtils.isEmpty(person)) {
personIdentity.setPersonSeq((String) person.get("sequenceNbr"));
personIdentity.setPersonName((String) person.get("recUserName"));
}
if (!ObjectUtils.isEmpty(other)) {
personIdentity.setCompanyId((String) other.get("sequenceNbr"));
personIdentity.setCompanyName((String) other.get("bizOrgName"));
}
// ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) result.get(0), ReginParams.PersonIdentity.class);
reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
} else {
throw new RuntimeException("人员未绑定!");
}
}
}
}
package com.yeejoin.amos;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -14,16 +16,17 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import java.net.InetAddress;
import java.net.UnknownHostException;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
/**
* <pre>
* 机场服务启动类
* 机场服务启动类
* </pre>
*
*/
......@@ -35,28 +38,48 @@ import java.net.UnknownHostException;
@EnableFeignClients
@EnableAsync
@EnableEurekaClient
@MapperScan({"org.typroject.tyboot.demo.face.orm.dao*",
"org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*",
"org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.*.api.mapper",
"com.yeejoin.amos.boot.biz.common.dao.mapper" })
@MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.*.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper" })
@ComponentScan(basePackages = { "org.typroject", "com.yeejoin.amos" })
public class AmosJcsApplication
{
private static final Logger logger = LoggerFactory.getLogger(AmosJcsApplication.class);
public static void main( String[] args ) throws UnknownHostException
{
ConfigurableApplicationContext context = SpringApplication.run(AmosJcsApplication.class, args);
Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
GlobalExceptionHandler.setAlwaysOk(true);
logger.info("\n----------------------------------------------------------\n\t" +
"Application Amos-Biz-Boot is running! Access URLs:\n\t" +
"Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
"----------------------------------------------------------");
}
public class AmosJcsApplication {
private static final Logger logger = LoggerFactory.getLogger(AmosJcsApplication.class);
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext context = SpringApplication.run(AmosJcsApplication.class, args);
Environment env = context.getEnvironment();
delKey(env, context);// 添加全部清空redis缓存的方法 2021-09-09
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
GlobalExceptionHandler.setAlwaysOk(true);
logger.info("\n----------------------------------------------------------\n\t"
+ "Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port
+ path + "/doc.html\n" + "----------------------------------------------------------");
}
/**
* 清空redis缓存数据
*
* @author 陈浩
* @param env
* @param context
*/
public static void delKey(Environment env, ConfigurableApplicationContext context) {
if (Boolean.parseBoolean(env.getProperty("my.spring.redis.cache.isclean"))) {
@SuppressWarnings("rawtypes")
RedisTemplate redisTemplate = context.getBean("redisTemplate", RedisTemplate.class);
RedisConnection redisConnection = null;
try {
redisConnection = redisTemplate.getConnectionFactory().getConnection();
redisConnection.flushAll();
} catch (Exception e) {
logger.info("删除redis 缓存的key 失败");
} finally {
redisConnection.close();
}
}
}
}
......@@ -50,14 +50,15 @@ spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
#在重启服务的过程中是否清空缓存的标识符 --2021-09-09
my.spring.redis.cache.isclean=false
## mqtt-警情初报消息主题
mqtt.topic.alert.reporting=alertReporting
## 实战指挥新警情�?�报主题
## 实战指挥新警情主题
mqtt.topic.command.alert.notice=alertNotice
## 跑马灯地震天气预警信息
## 跑马灯地震天气预警信息
mqtt.topic.command.meteorological.notice=meteorological
mqtt.topic.command.power.deployment=power
......
......@@ -163,11 +163,7 @@
</changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions>
<comment>add data cb_data_dictionary</comment>
<sql>
......@@ -190,11 +186,7 @@
</changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_alert_form" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions>
<comment>add data jc_alert_form</comment>
<sql>
......@@ -206,11 +198,7 @@
</changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-3">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_alert_form" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions>
<comment>update data jc_alert_form</comment>
<sql>
......@@ -282,7 +270,6 @@
<changeSet author="chenhao" id="2021-09-06-chenhao-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions>
<comment>insert data cb_data_dictionary</comment>
<sql>
......@@ -292,4 +279,37 @@
INSERT INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1171', '1171', '不可用', 'SYZT', NULL, NULL, NULL, NULL, NULL, '\0', '1');
</sql>
</changeSet>
<changeSet author="tb" id="2021-09-08-tb-1">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="jc_transfer_resource_feedback"/>
</not>
</preConditions>
<comment>create table jc_transfer_resource_feedback</comment>
<sql>
CREATE TABLE `jc_transfer_resource_feedback` (
`sequence_nbr` bigint(30) NOT NULL COMMENT '主键',
`transfer_company_resource_id` bigint(30) NOT NULL COMMENT '调派任务id',
`status` varchar(255) NOT NULL COMMENT '反馈调派任务状态(执行中:executing,已完成:finished)',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`rec_user_id` bigint(30) NOT NULL COMMENT '更新人id',
`rec_user_name` varchar(50) NOT NULL COMMENT '更新人名称',
`rec_date` datetime NOT NULL COMMENT '更新时间',
`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(1:删除,0:未删除)',
PRIMARY KEY (`sequence_nbr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='警情调派任务反馈';
</sql>
</changeSet>
<changeSet author="tb" id="2021-09-08-tb-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="jc_power_transfer_company_resources" columnName="status"/>
</not>
</preConditions>
<comment>modify table jc_power_transfer_company_resources add status column</comment>
<sql>
ALTER TABLE `jc_power_transfer_company_resources` ADD status varchar(20) DEFAULT 'executing' COMMENT
'调派任务状态(执行中:executing,已完成:finished)';
</sql>
</changeSet>
</databaseChangeLog>
......@@ -42,7 +42,7 @@
<!-- 日志输出级别 -->
<root level="INFO">
<!--<appender-ref ref="FILE" />-->
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
......
......@@ -84,4 +84,41 @@
MODIFY COLUMN `dep_name` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '执行部门名称';
</sql>
</changeSet>
<changeSet author="tb" id="tb-202109101731-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_latent_danger" columnName="biz_type"/>
</not>
</preConditions>
<comment>p_latent_danger add COLUMN biz_type '业务类型(不同业务创建的隐患以此区分)'</comment>
<sql>
ALTER TABLE p_latent_danger add COLUMN `biz_type` varchar(30) DEFAULT NULL COMMENT '业务类型(不同业务创建的隐患以此区分)' after
`id`;
</sql>
</changeSet>
<changeSet author="tb" id="tb-202109101731-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_latent_danger" columnName="longitude"/>
</not>
</preConditions>
<comment>p_latent_danger add COLUMN longitude '隐患地址经度'</comment>
<sql>
ALTER TABLE p_latent_danger add COLUMN `longitude` varchar(30) DEFAULT NULL COMMENT '隐患地址经度' after
`danger_position`;
</sql>
</changeSet>
<changeSet author="tb" id="tb-202109101731-3">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_latent_danger" columnName="latitude"/>
</not>
</preConditions>
<comment>p_latent_danger add COLUMN latitude '隐患地址纬度'</comment>
<sql>
ALTER TABLE p_latent_danger add COLUMN `latitude` varchar(30) DEFAULT NULL COMMENT '隐患地址纬度' after
`longitude`;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -19,7 +19,7 @@ spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
#DB properties:
spring.jpa.show-sql = true
spring.jpa.hibernate.ddl-auto = none
spring.jpa.hibernate.ddl-auto = none
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.database-platform = org.hibernate.dialect.MySQLDialect
mybatis.mapper-locations = classpath:db/mapper/*.xml
......@@ -35,7 +35,7 @@ equip.fegin.name=AMOS-EQUIPMANAGE
equip.fegin.prefix=/equip
input.custom.prefix = QYZD
input.statute.prefix = FG
jcs.fegin.name=JCS
Security.fegin.name=AMOS-API-PRIVILEGE
......
......@@ -216,4 +216,37 @@
ALTER TABLE `p_check_input` ADD COLUMN `major_danger_num` int(11) DEFAULT NULL COMMENT '重大隐患个数' AFTER `safety_danger_num`;
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="1630567666-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_input_item" columnName="check_type_id"/>
</not>
</preConditions>
<comment>p_input_item ADD COLUMN check_type_id</comment>
<sql>
ALTER TABLE `p_input_item` ADD COLUMN `check_type_id` varchar(32) DEFAULT NULL COMMENT '检查类别字典值';
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="1630567666-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_route_point_item" columnName="input_item_id"/>
</not>
</preConditions>
<comment>p_route_point_item ADD COLUMN input_item_id</comment>
<sql>
ALTER TABLE `p_route_point_item` ADD COLUMN `input_item_id` bigint(20) DEFAULT NULL COMMENT '巡检项id';
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="1630567666-3">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_route_point_item" columnName="plan_id"/>
</not>
</preConditions>
<comment>p_route_point_item ADD COLUMN plan_id</comment>
<sql>
ALTER TABLE `p_route_point_item` ADD COLUMN `plan_id` bigint(20) DEFAULT NULL COMMENT '计划ID';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -1898,54 +1898,69 @@
SELECT
count(1)
FROM
p_check pc, p_check_input pci, p_plan_task_detail pptd
p_input_item pii
LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id
LEFT JOIN p_point pp ON ppi.point_id =pp.id
WHERE
pc.id = pci.check_id
AND pc.plan_task_detail_id = pptd.id
AND pc.plan_id = #{planId}
<if test="pointId != null and pointId != ''">
AND pc.point_id = #{pointId}
</if>
<if test="executeState != null and executeState != ''">
AND pptd.is_finish = #{executeState}
</if>
<!-- <if test="status != null and status != ''">-->
<!-- AND pc.point_id = #{status}-->
<!-- </if>-->
prp.route_id = #{routeId}
<if test="pointId != null and pointId != '' and pointId != -1">
AND ppi.point_id = #{pointId}
</if>
<choose>
<when test="status != null and status != '' and status==0">
AND pci.id IS NULL
</when>
<when test="status != null and status != '' and status==1">
AND pci.id IS NOT NULL
</when>
</choose>
<if test="teamId != null and teamId != ''">
AND pc.company_id = #{teamId}
AND pp.original_id = #{teamId}
</if>
</select>
<select id="getCheckItems" resultType="Map">
SELECT
pc.id checkId,
pci.id checkInputId,
pci.input_name itemName,
pptd.is_finish finishStatus,
ppi.id inputItemId,
pii.name itemName,
pci.id IS NOT NULL finishStatus,
pci.safety_danger_num safetyNum,
pci.major_danger_num majorNum,
DATE_FORMAT(pc.check_time,'%Y-%m-%d %H:%i:%s') checkTime,
pc.user_name executeName,
pc.company_name companyName
DATE_FORMAT(pci.create_date,'%Y-%m-%d %H:%i:%s') checkTime,
pp.name companyName,
pci.user_name executeName
FROM
p_check pc, p_check_input pci, p_plan_task_detail pptd
p_input_item pii
LEFT JOIN p_point_inputitem ppi ON pii.id = ppi.input_item_id
LEFT JOIN p_route_point_item prpi ON prpi.point_input_item_id = ppi.id
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id AND prp.point_id = ppi.point_id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id
LEFT JOIN p_point pp ON ppi.point_id =pp.id
WHERE
pc.id = pci.check_id
AND pc.plan_task_detail_id = pptd.id
AND pc.plan_id = #{planId}
prp.route_id = #{routeId}
<if test="pointId != null and pointId != '' and pointId != -1">
AND pc.point_id = #{pointId}
AND ppi.point_id = #{pointId}
</if>
<if test="status != null and status != ''">
AND pptd.is_finish = #{status}
<choose>
<when test="status != null and status != '' and status==0">
AND pci.id IS NULL
</when>
<when test="status != null and status != '' and status==1">
AND pci.id IS NOT NULL
</when>
</choose>
<if test="teamId != null and teamId != ''">
AND pp.original_id = #{teamId}
</if>
<!-- <if test="status != null and status != ''">-->
<!-- AND pc.point_id = #{status}-->
<!-- </if>-->
<if test="companyName != null and companyName != ''">
AND pc.company_name = #{company_name}
</if>
<!-- <if test="companyName != null and companyName != ''">-->
<!-- AND pc.company_name = #{company_name}-->
<!-- </if>-->
limit #{offset},#{pageSize}
</select>
......
......@@ -66,12 +66,14 @@
<result property="checkMethod" column="check_method" />
<result property="createDate" column="create_date" />
<result property="inputClassify" column="input_classify" />
<result property="checkTypeId" column="check_type_id" />
<result property="checkType" column="check_type" />
<result property="itemParent" column="item_parent" />
<result property="itemClassify" column="item_classify" />
<result property="itemTypeClassify" column="item_type_classify" />
<result property="itemLevel" column="item_level" />
<result property="itemStart" column="item_start" />
<result property="ext" column="ext" />
</resultMap>
<!--统计 -->
<select id="countInputItemInfoData" resultType="long">
......@@ -89,17 +91,17 @@
</select>
<!--查询 -->
<select id="getInputItemInfo" resultMap="inputItemMap">
SELECT
SELECT
a.id,
a.name,
a.NAME,
a.item_no,
a.item_type,
a.is_must,
a.default_value,
a.is_score,
b.name as catalog_name,
b.NAME AS catalog_name,
a.remark,
a.level,
a.LEVEL,
a.risk_desc,
a.maintenance_content,
a.test_requirement,
......@@ -111,14 +113,20 @@
a.item_classify,
a.item_type_classify,
a.item_level,
a.item_start
from
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id
where a.is_delete = '0'
and a.input_type != '1'
a.item_start,
IF
( i.input_item_id IS NULL, 0, 1 ) AS ext
FROM
p_input_item a
LEFT JOIN p_catalog_tree b ON a.catalog_id = b.id
LEFT JOIN p_route_point_item i ON a.id = i.input_item_id
WHERE
a.is_delete = '0'
AND a.input_type != '1'
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="checkTypeId!=null"> and a.check_type_Val = #{checkTypeId} </if>
<!-- <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>-->
<if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if>
order by a.id desc
......
......@@ -179,6 +179,7 @@
pt.org_code orgCode,
p.name taskName,
p.check_type_name checkTypeName,
P.check_type_id checkTypeId,
pt.status,
pt.user_id userId,
date_format(
......@@ -201,14 +202,11 @@
pt.route_id,
pt.user_name userName,
r.owner_id,
R.owner_name as ownerName,
ptd.item_num AS itemNum,
ptd.executor_id AS executorId
r.owner_name as ownerName
FROM
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id
INNER JOIN p_plan_task_detail ptd ON ptd.task_no = pt.id
) a
<include refid="mobile-plan-task-where" />
limit #{offset},#{pageSize}
......@@ -217,8 +215,8 @@
<where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if>
<if test="executorId != null and executorId > 0 "> and find_in_set(#{executorId},a.executorId)>0</if>
<if test="companyId != null"> and a.owner_id = #{companyId}</if>
<if test="taskType != null"> and a.checkTypeName = #{taskType}</if>
<if test="companyId != null"> and find_in_set(#{companyId},a.owner_id)>0</if>
<if test="taskType != null"> and a.checkTypeId = #{taskType}</if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
......@@ -265,13 +263,13 @@
pt.org_code as orgCode,
pt.begin_time as beginTime,
pt.end_time as endTime,
pt.point_num as taskPlanNum,
r.owner_id,
ptd.item_num AS itemNum
P.check_type_id checkTypeId
FROM
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id
INNER JOIN p_plan_task_detail ptd ON ptd.task_no = pt.id
) a
<include refid="mobile-plan-task-where" />
</select>
......@@ -365,17 +363,66 @@
p.is_fixed isFixed,
pt.route_id routeId,
c.id checkId,
prp.order_no orderNo
prp.order_no orderNo,
ptd.item_num itemNum,
ptd.executed_num executedNum,
ptd.safety_danger_num safetyDangerNum,
ptd.major_danger_num majorDangerNum,
ptd.executor_date beginTime,
ptd.item_num taskPlanNum
FROM
p_plan_task_detail ptd
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_point p ON p.id = ptd.point_id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_route_point prp ON prp.point_id = ptd.point_id AND prp.route_id = pt.route_id
LEFT JOIN p_plan ppn ON ppn.id = pt.plan_id
WHERE
p.is_delete = 0
<if test="planTaskId != null and planTaskId > 0 ">and pt.id = #{planTaskId}</if>
ORDER BY orderNo
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},pt.user_id)>0</if>
<if test="executorId != null and executorId > 0 "> and find_in_set(#{executorId},ptd.executor_id)>0</if>
<if test="finishStatus != null and finishStatus!=''"> and ptd.is_finish = #{finishStatus}</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
ptd.executor_date <![CDATA[>=]]> #{startTime}
AND ptd.executor_date <![CDATA[<=]]> #{endTime}
)
)
</if>
<if test="companyId != null and companyId != ''"> and ppn.original_id = #{companyId}</if>
<if test="taskType != null and taskType != ''"> and ppn.check_type_id = #{taskType}</if>
<if test="planTaskId != null and planTaskId > 0 "> and ptd.task_no = #{planTaskId}</if>
<if test="orderBy != null and orderBy != ''"> order by ${orderBy} </if>
limit #{offset},#{pageSize}
</select>
<select id="getPlanTaskPointsCount" resultType="long">
SELECT
count(1)
FROM
p_plan_task_detail ptd
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_point p ON p.id = ptd.point_id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_route_point prp ON prp.point_id = ptd.point_id AND prp.route_id = pt.route_id
LEFT JOIN p_plan ppn ON ppn.id = pt.plan_id
WHERE
p.is_delete = 0
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},pt.user_id)>0</if>
<if test="executorId != null and executorId > 0 "> and find_in_set(#{executorId},ptd.executor_id)>0</if>
<if test="finishStatus != null and finishStatus!=''"> and ptd.is_finish = #{finishStatus}</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND (
(
ptd.executor_date <![CDATA[>=]]> #{startTime}
AND ptd.executor_date <![CDATA[<=]]> #{endTime}
)
)
</if>
<if test="companyId != null and companyId != ''"> and ppn.original_id = #{companyId}</if>
<if test="taskType != null and taskType != ''"> and ppn.check_type_id = #{taskType}</if>
<if test="planTaskId != null and planTaskId > 0 "> and ptd.task_no = #{planTaskId}</if>
</select>
<select id="getCurrentPlanTaskCount" resultType="int" parameterType="long">
......
......@@ -3,7 +3,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper">
<update id="finishTaskDetail">
call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId},#{executorName})
call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId},#{executorName},#{size})
</update>
<select id="findPlanTaskByTaskIdAndPointId" resultType="Map">
......
......@@ -1150,6 +1150,7 @@
pii.data_json dataJson,
pii.remark remark,
pii.picture_json picJson,
prpi.id routePointItemId,
CASE pii.`input_type`
WHEN 0 THEN
'手动录入'
......@@ -1159,8 +1160,20 @@
FROM
p_point_inputitem ppi
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
LEFT JOIN p_route_point pp ON pp.route_id = #{routeId} AND pp.point_id = ppi.point_id
LEFT JOIN p_route_point_item prpi ON prpi.route_point_id = pp.id AND prpi.point_input_item_id = ppi.id
LEFT JOIN p_check_input pci ON pci.route_point_item_id = prpi.id
WHERE
ppi.point_id = #{pointId} AND pii.is_delete = 0
ppi.point_id = #{pointId} AND pii.is_delete = 0 AND pci.route_point_item_id is NULL
ORDER BY pii.order_no
</select>
<select id="getPlanExecuteTeams" resultType="map">
SELECT
original_id id,
`name`
FROM
p_point
</select>
</mapper>
\ No newline at end of file
......@@ -46,7 +46,7 @@
<!-- 日志输出级别 -->
<root level="DEBUG">
<!--<appender-ref ref="FILE" /> -->
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
\ No newline at end of file
......@@ -200,6 +200,16 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId>
<version>${amos.version}</version>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-systemctl</artifactId>
<version>1.6.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.13</version>
......
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