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 { ...@@ -52,7 +52,9 @@ public class ControllerAop {
@Autowired @Autowired
private RedisUtils redisUtils; 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() { public void userCache() {
} }
......
...@@ -11,6 +11,8 @@ import javax.servlet.http.HttpServletRequest; ...@@ -11,6 +11,8 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -61,6 +63,9 @@ public class DataDictionaryController extends BaseController { ...@@ -61,6 +63,9 @@ public class DataDictionaryController extends BaseController {
@Autowired @Autowired
DataDictionaryMapper dataDictionaryMapper; DataDictionaryMapper dataDictionaryMapper;
@Autowired
private RedisTemplate redisTemplate;
/** /**
* 新增数据字典 * 新增数据字典
* *
...@@ -112,6 +117,21 @@ public class DataDictionaryController extends BaseController { ...@@ -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 * @return
...@@ -163,7 +183,9 @@ public class DataDictionaryController extends BaseController { ...@@ -163,7 +183,9 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/gwmcDataDictionary/{type}", method = RequestMethod.GET) @RequestMapping(value = "/gwmcDataDictionary/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典") @ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典", notes = "根据字典类型查询字典")
public ResponseModel<Object> gwmcDataDictionary(@PathVariable String type) throws Exception { 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<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type); queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num"); queryWrapper.orderByAsc("sort_num");
...@@ -184,7 +206,8 @@ public class DataDictionaryController extends BaseController { ...@@ -184,7 +206,8 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/dataDictionary", method = RequestMethod.GET) @RequestMapping(value = "/dataDictionary", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2") @ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2")
public ResponseModel<Object> getDictionary(@RequestParam String type) throws Exception { 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<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type); queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num"); queryWrapper.orderByAsc("sort_num");
...@@ -205,7 +228,8 @@ public class DataDictionaryController extends BaseController { ...@@ -205,7 +228,8 @@ public class DataDictionaryController extends BaseController {
@RequestMapping(value = "/gwmcDataDictionary/FireChemical/{type}", method = RequestMethod.GET) @RequestMapping(value = "/gwmcDataDictionary/FireChemical/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典") @ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典")
public ResponseModel<Object> gwmcDataDictionaryFireChemical(@PathVariable String type) throws Exception { 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<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type); queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num"); queryWrapper.orderByAsc("sort_num");
...@@ -242,6 +266,9 @@ public class DataDictionaryController extends BaseController { ...@@ -242,6 +266,9 @@ public class DataDictionaryController extends BaseController {
} else { } else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper); Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<MenuFrom> menus = null; 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", menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null); "getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE_XIN + type, JSON.toJSON(menus), time); redisUtils.set(RedisKey.DATA_DICTIONARY_CODE_XIN + type, JSON.toJSON(menus), time);
...@@ -265,13 +292,19 @@ public class DataDictionaryController extends BaseController { ...@@ -265,13 +292,19 @@ public class DataDictionaryController extends BaseController {
queryWrapper.eq("type", type); queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num"); queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = null; Collection<DataDictionary> list = null;
List<Menu> menus =null; List<Menu> menus = null;
if ("YJLDDW".equals(type)) { if ("YJLDDW".equals(type)) {
list = dataDictionaryMapper.getNoInLinkUnit(); 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", menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
null); null);
} else { } else {
list = iDataDictionaryService.list(queryWrapper); list = iDataDictionaryService.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent", menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent",
null); null);
} }
...@@ -283,4 +316,37 @@ public class DataDictionaryController extends BaseController { ...@@ -283,4 +316,37 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(menuList); 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> { ...@@ -22,4 +22,10 @@ public interface DataDictionaryMapper extends BaseMapper<DataDictionary> {
* @return * @return
*/ */
public List<DataDictionary> getNoInLinkUnit(); 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 { ...@@ -37,6 +37,9 @@ public class DataDictionary extends BaseEntity {
@ApiModelProperty(value = "父级") @ApiModelProperty(value = "父级")
private Long parent; private Long parent;
@ApiModelProperty(value = "类型说明")
private String typeDesc;
//新加排序字段 //新加排序字段
@ApiModelProperty(value = "排序字段") @ApiModelProperty(value = "排序字段")
private int sortNum; 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 { ...@@ -24,13 +24,21 @@ public class FeignAuthRequestInterceptor implements RequestInterceptor {
/* Get token from header */ /* Get token from header */
String authToken = StringUtils.isEmpty(request.getHeader("X-Access-Token")) ? request.getHeader("token") : request.getHeader("X-Access-Token"); 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 */ /* If token not found get it from request parameter */
String appKey = request.getHeader("appKey");
String product = request.getHeader("product");
if (authToken == null) { if (authToken == null) {
authToken = request.getParameter("token"); 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("X-Access-Token", authToken);
template.header("token", authToken); template.header("token", authToken);
template.header("appKey", request.getHeader("appKey")); template.header("appKey", appKey);
template.header("product", request.getHeader("product")); 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 ...@@ -48,6 +48,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return obj; return obj;
} else { } else {
Collection<DataDictionary> list = this.list(queryWrapper); 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, List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
"getName", "getParent", null); "getName", "getParent", null);
MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null); MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
...@@ -69,6 +71,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -69,6 +71,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return obj; return obj;
} else { } else {
Collection<DataDictionary> list = this.list(queryWrapper); 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" List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent", null); , "getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time); redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
...@@ -82,12 +86,20 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -82,12 +86,20 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
queryWrapper.orderByAsc("sort_num"); queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = this.list(queryWrapper); 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" List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent", null); , "getParent", null);
return menus; return menus;
} }
public DataDictionary getByCode(String code,String type) {
DataDictionary byCode = dataDictionaryMapper.getByCode(code,type);
return byCode;
}
public List<DataDictionary> getDataDictionaryAndCount(){ public List<DataDictionary> getDataDictionaryAndCount(){
List<DataDictionary> list= dataDictionaryMapper.getDataDictionaryListAndCount(); List<DataDictionary> list= dataDictionaryMapper.getDataDictionaryListAndCount();
......
...@@ -63,13 +63,13 @@ public class DateUtils { ...@@ -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(); 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); String dateString = formatter.format(currentTime);
return dateString; return dateString;
} }
......
package com.yeejoin.amos.boot.biz.common.utils; package com.yeejoin.amos.boot.biz.common.utils;
import com.yeejoin.amos.boot.biz.common.dto.PermissionModelDto;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/*** /***
* *
*文件类 *文件类
...@@ -10,4 +13,5 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -10,4 +13,5 @@ import org.springframework.web.multipart.MultipartFile;
public interface FileService { public interface FileService {
String uploadFile(MultipartFile file,String product,String appKey,String token ); String uploadFile(MultipartFile file,String product,String appKey,String token );
List<PermissionModelDto> currentPermissionTree();
} }
...@@ -47,4 +47,14 @@ WHERE ...@@ -47,4 +47,14 @@ WHERE
cbb.type = 'YJLDDW' and cbb.is_delete = 0 cbb.type = 'YJLDDW' and cbb.is_delete = 0
AND elink.count IS NOT NULL AND elink.count IS NOT NULL
</select> </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> </mapper>
...@@ -28,6 +28,7 @@ public class FireTeamDto extends BaseDto { ...@@ -28,6 +28,7 @@ public class FireTeamDto extends BaseDto {
@ExcelProperty(value = "所属单位", index = 0) @ExcelProperty(value = "所属单位", index = 0)
@ApiModelProperty(value = "机构名称") @ApiModelProperty(value = "机构名称")
@ExplicitConstraint(indexNum = 0, sourceClass = RoleNameExplicitConstraint.class,method="getCompanyDetailTree") //动态下拉内容
private String companyName; private String companyName;
@ExcelIgnore @ExcelIgnore
......
...@@ -31,10 +31,24 @@ public class FormValue implements Serializable{ ...@@ -31,10 +31,24 @@ public class FormValue implements Serializable{
@ApiModelProperty(value = "是否一行显示") @ApiModelProperty(value = "是否一行显示")
private boolean block; private boolean block;
@ApiModelProperty(value = "value 所对应的字符名称")
private String valueName;
public FormValue() { 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) { public FormValue(String key, String label, String type, String value,boolean block) {
super(); super();
this.key = key; this.key = key;
......
...@@ -52,6 +52,7 @@ public class KeySiteExcleDto implements Serializable { ...@@ -52,6 +52,7 @@ public class KeySiteExcleDto implements Serializable {
@ApiModelProperty(value = "建筑面积(㎡)") @ApiModelProperty(value = "建筑面积(㎡)")
private String buildingArea; private String buildingArea;
@ExcelIgnore
@ExcelProperty(value = "建筑高度(m)", index = 5) @ExcelProperty(value = "建筑高度(m)", index = 5)
@ApiModelProperty(value = "建筑高度(m)") @ApiModelProperty(value = "建筑高度(m)")
private String buildingHeight; private String buildingHeight;
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.entity; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.entity;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -11,17 +12,20 @@ import lombok.EqualsAndHashCode; ...@@ -11,17 +12,20 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
/** /**
* 工作经历 * 工作经历
* *
* @author tb * @author tb
* @date 2021-06-07 * @date 2021-06-07
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("cb_firefighters_workexperience") @TableName("cb_firefighters_workexperience")
@ApiModel(value="FirefightersWorkexperience对象", description="工作经历") @ApiModel(value = "FirefightersWorkexperience对象", description = "工作经历")
public class FirefightersWorkexperience extends BaseEntity { public class FirefightersWorkexperience extends BaseEntity {
/** /**
* *
...@@ -29,15 +33,19 @@ public class FirefightersWorkexperience extends BaseEntity { ...@@ -29,15 +33,19 @@ public class FirefightersWorkexperience extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "参加工作时间") @ApiModelProperty(value = "参加工作时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date workingHours; private Date workingHours;
@ApiModelProperty(value = "参加消防部门工作时间") @ApiModelProperty(value = "参加消防部门工作时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fireWorkingHours; private Date fireWorkingHours;
@ApiModelProperty(value = "人员id") @ApiModelProperty(value = "人员id")
private Long firefightersId; private Long firefightersId;
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
@TableField(fill=FieldFill.UPDATE) @TableField(fill = FieldFill.UPDATE)
private Date updateTime; private Date updateTime;
} }
...@@ -11,6 +11,8 @@ import org.apache.poi.ss.usermodel.DataValidation; ...@@ -11,6 +11,8 @@ import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint; import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddressList; import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -30,7 +32,7 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler { ...@@ -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 { ...@@ -88,6 +90,14 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
// 将刚才设置的sheet引用到你的下拉列表中 // 将刚才设置的sheet引用到你的下拉列表中
DataValidationConstraint constraint = helper.createFormulaListConstraint(refers); DataValidationConstraint constraint = helper.createFormulaListConstraint(refers);
DataValidation dataValidation = helper.createValidation(constraint, rangeList); DataValidation dataValidation = helper.createValidation(constraint, rangeList);
if(dataValidation instanceof XSSFDataValidation){
dataValidation.setSuppressDropDownArrow(true);
dataValidation.setShowErrorBox(true);
}else{
dataValidation.setSuppressDropDownArrow(false);
}
writeSheetHolder.getSheet().addValidationData(dataValidation); writeSheetHolder.getSheet().addValidationData(dataValidation);
// 设置存储下拉列值得sheet为隐藏 // 设置存储下拉列值得sheet为隐藏
int hiddenIndex = workbook.getSheetIndex(sheetName); int hiddenIndex = workbook.getSheetIndex(sheetName);
...@@ -95,17 +105,17 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler { ...@@ -95,17 +105,17 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
workbook.setSheetHidden(hiddenIndex, true); workbook.setSheetHidden(hiddenIndex, true);
} }
} }
// 下拉列表约束数据 // // 下拉列表约束数据
DataValidationConstraint constraint = helper.createExplicitListConstraint(v); // DataValidationConstraint constraint = helper.createExplicitListConstraint(v);
// 设置约束 // // 设置约束
DataValidation validation = helper.createValidation(constraint, rangeList); // DataValidation validation = helper.createValidation(constraint, rangeList);
// 阻止输入非下拉选项的值 // // 阻止输入非下拉选项的值
validation.setErrorStyle(DataValidation.ErrorStyle.STOP); // validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
validation.setShowErrorBox(true); // validation.setShowErrorBox(true);
validation.setSuppressDropDownArrow(true); // validation.setSuppressDropDownArrow(true);
validation.createErrorBox("提示", "此值与单元格定义格式不一致"); // validation.createErrorBox("提示", "此值与单元格定义格式不一致");
// validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓"); // // validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓");
sheet.addValidationData(validation); // sheet.addValidationData(validation);
}); });
} }
......
...@@ -159,5 +159,29 @@ public interface EquipFeignClient { ...@@ -159,5 +159,29 @@ public interface EquipFeignClient {
@RequestMapping(value = "/video/getByid", method = RequestMethod.GET) @RequestMapping(value = "/video/getByid", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getByid( @RequestParam Long id); 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 { ...@@ -31,4 +31,7 @@ public interface IotFeignClient {
@RequestMapping(value = "/v1/iot/DynamicFlightInfo/detail/{dynamicFlightId}", method = RequestMethod.GET) @RequestMapping(value = "/v1/iot/DynamicFlightInfo/detail/{dynamicFlightId}", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> findImgByDynamicFlightId(@PathVariable String dynamicFlightId); ResponseModel<Map<String, Object>> findImgByDynamicFlightId(@PathVariable String dynamicFlightId);
@RequestMapping(value = "/v1/iot/DynamicFlightInfo/plane/{dynamicFlightId}", method = RequestMethod.GET)
ResponseModel<Object> DynamicFlightInfo(@PathVariable String dynamicFlightId);
} }
...@@ -20,14 +20,14 @@ import java.util.Map; ...@@ -20,14 +20,14 @@ import java.util.Map;
*/ */
public interface FireStationMapper extends BaseMapper<FireStation> { public interface FireStationMapper extends BaseMapper<FireStation> {
// 微型消防站按时间倒叙排列add order by cb_fire_station.rec_date desc 2021-09-08 by kongfm
@Select("<script>" @Select("<script>"
+ "select * from cb_fire_station where cb_fire_station.is_delete=0 " + "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.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.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>" + "<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>") + "</script>")
List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par); List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par);
@Select("<script>" @Select("<script>"
......
package com.yeejoin.amos.boot.module.common.api.service; package com.yeejoin.amos.boot.module.common.api.service;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
/** /**
...@@ -21,4 +22,11 @@ public interface IDutyCarService extends IDutyCommonService { ...@@ -21,4 +22,11 @@ public interface IDutyCarService extends IDutyCommonService {
* @return List<DutyCarDto> * @return List<DutyCarDto>
*/ */
DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto); DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto);
/**
* 判断当前登陆人是否是车辆驾驶员
*
* @return
*/
JSONObject isFireCarDriver();
} }
...@@ -61,7 +61,7 @@ public interface IDutyCommonService { ...@@ -61,7 +61,7 @@ public interface IDutyCommonService {
* @param instanceId 实例id * @param instanceId 实例id
* @return Boolean * @return Boolean
*/ */
Boolean deleteDutyData(Long instanceId); Boolean deleteDutyData(Long instanceId, String startTime, String endTime);
/** /**
* 查询指定条件的值班人信息 * 查询指定条件的值班人信息
...@@ -79,4 +79,11 @@ public interface IDutyCommonService { ...@@ -79,4 +79,11 @@ public interface IDutyCommonService {
* @return List<Map < String, Object>> * @return List<Map < String, Object>>
*/ */
List<Map<String, Object>> listOnDutyPerson(); List<Map<String, Object>> listOnDutyPerson();
/**
* 根据当前时间获取值班班次id列表
*
* @return
*/
List<Long> getDutyShiftIdList();
} }
...@@ -223,7 +223,7 @@ public interface IOrgUsrService { ...@@ -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); List<OrgUsr> getPersonListByParentId(Long id);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
and s.duty_date >= #{beginDate} and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> #{endDate} and s.duty_date <![CDATA[<=]]> #{endDate}
and s.app_Key = #{appKey} and s.app_Key = #{appKey}
GROUP BY s.duty_date GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 -->
) a) as maxDutyPersonNumDay, ) a) as maxDutyPersonNumDay,
(select (select
IFNULL(max(num),0) IFNULL(max(num),0)
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</if> </if>
</select> </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 id="getFireTeamForPage" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamCardDto">
SELECT SELECT
a.sequence_nbr sequenceNbr, a.sequence_nbr sequenceNbr,
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
and a.sequence_nbr = #{par.nodeId} and a.sequence_nbr = #{par.nodeId}
</if> </if>
</if> </if>
order by a.rec_date desc
</select> </select>
<select id="listFireTeamDto" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto"> <select id="listFireTeamDto" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto">
select t.*, p.name parentName select t.*, p.name parentName
...@@ -70,13 +71,17 @@ ...@@ -70,13 +71,17 @@
left join cb_fire_team p on t.parent = p.sequence_nbr left join cb_fire_team p on t.parent = p.sequence_nbr
where t.is_delete = #{isDelete} where t.is_delete = #{isDelete}
</select> </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 id="listFireTeamById" resultType="com.yeejoin.amos.boot.module.common.api.entity.FireTeam">
SELECT * SELECT *
FROM cb_fire_team FROM cb_fire_team
WHERE is_delete = 0 WHERE is_delete = 0
<if test="teamId != null"> <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> </if>
order by cb_fire_team.rec_date desc
</select> </select>
......
...@@ -3,16 +3,19 @@ ...@@ -3,16 +3,19 @@
<mapper <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 id="getFirefightersJobTitleCount"
resultType="com.yeejoin.amos.boot.biz.common.utils.FirefightersTreeDto">
select COUNT(a.sequence_nbr) num, a.job_title_code jobTitleCode select COUNT(a.sequence_nbr) num, a.job_title_code jobTitleCode
from cb_firefighters a from cb_firefighters a
where a.is_delete = 0 where a.is_delete = 0
GROUP BY a.job_title_code GROUP BY a.job_title_code
</select> </select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefighters" <select id="getFirefighters"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto"> resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto">
select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code areasExpertiseCode from cb_firefighters a LEFT JOIN cb_firefighters_post b on select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code
areasExpertiseCode from cb_firefighters a LEFT JOIN
cb_firefighters_post b on
a.sequence_nbr=b.firefighters_id where a.is_delete=0 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.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.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
...@@ -20,11 +23,12 @@ ...@@ -20,11 +23,12 @@
<if test='par.state!=null'>and a.state_code= #{par.state}</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.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.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if> <if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if> <if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date limit #{pageNum},#{pageSize} ORDER BY a.rec_date desc limit #{pageNum},#{pageSize}
</select> </select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefightersCount" resultType="Map"> <select id="getFirefightersCount" resultType="Map">
select COUNT(a.sequence_nbr) num from cb_firefighters a LEFT JOIN select COUNT(a.sequence_nbr) num from cb_firefighters a LEFT JOIN
cb_firefighters_post b on a.sequence_nbr=b.firefighters_id where cb_firefighters_post b on a.sequence_nbr=b.firefighters_id where
...@@ -35,10 +39,11 @@ ...@@ -35,10 +39,11 @@
<if test='par.state!=null'>and a.state_code= #{par.state}</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.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.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if> <if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code =#{par.areasExpertiseCode}</if>
<if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if> <if test='par.areasExpertiseCode=="0"'>and b.areas_expertise_code is not null</if>
ORDER BY a.rec_date ORDER BY a.rec_date desc
</select> </select>
...@@ -69,13 +74,21 @@ ...@@ -69,13 +74,21 @@
</select> </select>
<!-- BUG3553 BY kongfm 人员关系显示汉字--> <!-- BUG3553 BY kongfm 人员关系显示汉字 -->
<select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto"> <select id="exportToExcel"
select f.*, resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto">
(select cb_fire_team.name from cb_fire_team where cb_fire_team.sequence_nbr=f.fire_team_id) fireTeam, SELECT
emergency_contact, (select da.name from cb_data_dictionary da where da.code = fc.relationship) as relationship , emergency_contact_phone f.*,
from cb_firefighters f ( SELECT cb_fire_team.NAME FROM cb_fire_team WHERE
left join cb_firefighters_contacts fc on f.sequence_nbr = fc.firefighters_id 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} where f.is_delete = #{isDelete}
</select> </select>
......
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
b.instance_id=a.instance_id where a.unit_name is not null b.instance_id=a.instance_id where a.unit_name is not null
</select> </select>
<!--联动单位列表按时间倒叙排列add order by clu.rec_date desc 同时处理单位根节点-1时查询全部数据问题 2021-09-08 by kongfm -->
<select id="getEmergencyLinkageUnitList" <select id="getEmergencyLinkageUnitList"
resultType="java.util.Map"> resultType="java.util.Map">
SELECT SELECT
...@@ -182,19 +182,22 @@ ...@@ -182,19 +182,22 @@
cb_linkage_unit clu cb_linkage_unit clu
WHERE clu.is_delete=0 WHERE clu.is_delete=0
<if test="unitName != null and unitName != ''"> <if test="unitName != null and unitName != ''">
AND clu.unit_name LIKE concat(#{unitName}, '%') AND clu.unit_name LIKE concat('%',#{unitName}, '%')
</if> </if>
<if <if
test="linkageUnitType != null and linkageUnitType != ''"> test="linkageUnitType != null and linkageUnitType != ''">
AND clu.linkage_unit_type =#{linkageUnitType} AND clu.linkage_unit_type =#{linkageUnitType}
</if> </if>
<if <if
test="emergencyLinkageUnitCode != null and emergencyLinkageUnitCode != ''"> test="emergencyLinkageUnitCode != null and emergencyLinkageUnitCode != '' ">
<if test="emergencyLinkageUnitCode != '-1'">
AND clu.emergency_linkage_unit_code =#{emergencyLinkageUnitCode} AND clu.emergency_linkage_unit_code =#{emergencyLinkageUnitCode}
</if> </if>
</if>
<if <if
test="linkageUnitTypeCode != null and linkageUnitTypeCode != ''"> test="linkageUnitTypeCode != null and linkageUnitTypeCode != ''">
AND clu.linkage_unit_type_code =#{linkageUnitTypeCode} AND clu.linkage_unit_type_code =#{linkageUnitTypeCode}
</if> </if>
order by clu.rec_date desc
</select> </select>
</mapper> </mapper>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</if> </if>
</select> </select>
<!--机场单位人员按时间倒叙排列add order by u.rec_date desc 2021-09-08 by kongfm -->
<select id="selectPersonList" resultType="Map"> <select id="selectPersonList" resultType="Map">
select * from ( select * from (
SELECT SELECT
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
u.biz_org_code u.biz_org_code
order by u.rec_date desc
)a where a.sequenceNbr is not null )a where a.sequenceNbr is not null
<if test="map.fieldsValue != null"> <if test="map.fieldsValue != null">
<foreach collection="map.fieldsValue.keys" item="item">AND a.${item} = #{map.fieldsValue[${item}]}</foreach> <foreach collection="map.fieldsValue.keys" item="item">AND a.${item} = #{map.fieldsValue[${item}]}</foreach>
...@@ -159,6 +160,7 @@ ...@@ -159,6 +160,7 @@
and biz_org_code like concat(#{bizOrgCode}, '%') and biz_org_code like concat(#{bizOrgCode}, '%')
</select> </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 id="queryOrgPersonDtoList" resultType="com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto">
select u.*, select u.*,
v.person_number, v.person_number,
...@@ -204,6 +206,7 @@ ...@@ -204,6 +206,7 @@
) v ) v
on u.sequence_nbr = v.instance_id on u.sequence_nbr = v.instance_id
where u.is_delete = #{isDelete} where u.is_delete = #{isDelete}
order by u.rec_date desc
</select> </select>
<select id="listOrgUserById" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr"> <select id="listOrgUserById" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
SELECT * SELECT *
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
from cb_water_resource from cb_water_resource
where is_delete = #{isDelete} where is_delete = #{isDelete}
</select> </select>
<!--消防水源按时间倒叙排列add order by cb_water_resource.rec_date desc 2021-09-08 by kongfm -->
<select id="getWaterResourcePageByParams" <select id="getWaterResourcePageByParams"
resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto"> resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto">
select * from cb_water_resource where is_delete = 1 select * from cb_water_resource where is_delete = 1
...@@ -133,6 +134,7 @@ ...@@ -133,6 +134,7 @@
<if test="belongBuildingId != null and belongBuildingId.size() > 0"> <if test="belongBuildingId != null and belongBuildingId.size() > 0">
and find_in_set(belong_building_id, #{belongBuildingId}) > 0 and find_in_set(belong_building_id, #{belongBuildingId}) > 0
</if> </if>
order by cb_water_resource.rec_date desc
</select> </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 { ...@@ -17,7 +17,7 @@ public enum ExcelEnums {
WXXFZ("微型消防站", "微型消防站", "com.yeejoin.amos.boot.module.common.api.dto.FireStationDto","WXXFZ"),//("WXXFZ","微型消防站") WXXFZ("微型消防站", "微型消防站", "com.yeejoin.amos.boot.module.common.api.dto.FireStationDto","WXXFZ"),//("WXXFZ","微型消防站")
XFRY ("消防人员", "消防人员", "com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto","XFRY"),//("XFRY","消防人员") XFRY ("消防人员", "消防人员", "com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto","XFRY"),//("XFRY","消防人员")
WBRY ("维保人员", "维保人员", "com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto","WBRY"),//("WBRY",维保人员) 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","车辆执勤") CLZQ ("车辆执勤", "车辆执勤", "com.yeejoin.amos.boot.module.common.api.dto.DutyCarExcelDto","CLZQ"),//("CLZQ","车辆执勤")
JCDWRY ("机场单位人员", "机场单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto","JCDWRY"),//("JCDW","机场单位") JCDWRY ("机场单位人员", "机场单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto","JCDWRY"),//("JCDW","机场单位")
LDDW ("联动单位", "联动单位", "com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto","LDDW"),//("JCDW","机场单位") LDDW ("联动单位", "联动单位", "com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto","LDDW"),//("JCDW","机场单位")
......
package com.yeejoin.amos.boot.module.jcs.api.enums; 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.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import java.util.List;
import java.util.Map;
/** /**
* @author DELL * @author DELL
*/ */
...@@ -32,4 +37,20 @@ public enum FireCarStatusEnum { ...@@ -32,4 +37,20 @@ public enum FireCarStatusEnum {
} }
return null; 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> { ...@@ -44,4 +44,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
String endTime, String endTime,
String data, String data,
String lift); 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 { ...@@ -71,4 +71,8 @@ public interface IAlertCalledService {
* @return * @return
*/ */
Map<String, Object> queryAlertCalledById(Long id); Map<String, Object> queryAlertCalledById(Long id);
Integer AlertCalledcount(int type);
} }
...@@ -9,9 +9,9 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCompanyCountDto; ...@@ -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.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto; 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.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.dto.ResourceStatisticsDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer; 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.List;
import java.util.Map; import java.util.Map;
...@@ -63,4 +63,18 @@ public interface IPowerTransferService extends IService<PowerTransfer> { ...@@ -63,4 +63,18 @@ public interface IPowerTransferService extends IService<PowerTransfer> {
* @return * @return
*/ */
JSONObject getPowerTransferCarResourceStatistics(Long alertCalledId); 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 @@ ...@@ -173,4 +173,18 @@
</select> </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> </mapper>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
SELECT ptcr.resources_id carId SELECT ptcr.resources_id carId
FROM `jc_power_transfer` pt 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 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} WHERE pt.alert_called_id = #{alertCalledId}
</select> </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; ...@@ -5,21 +5,16 @@ import java.util.stream.Collectors;
/** /**
* @author DELL * @author DELL
* 维保任务排序 * 防火监督任务排序
*/ */
public enum OrderByEnum { public enum OrderByEnum {
/** /**
* 维保任务排序 * 防火监督任务排序
*/ */
TIME_DESC("时间倒序", "1", "beginTime desc"), TIME_DESC("时间倒序", "1", "beginTime desc"),
TIME_ASC("时间正序", "2", "beginTime asc"), TIME_ASC("时间正序", "2", "beginTime asc"),
PLAN_TASK_NUM_ASC("检查设施数正序", "3", "taskPlanNum 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");
/** /**
* 名字 * 名字
......
package com.yeejoin.amos.supervision.common.enums; package com.yeejoin.amos.supervision.common.enums;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
public enum PlanTaskDetailIsFinishEnum { public enum PlanTaskDetailIsFinishEnum {
UNFINISHED("未开始",0), UNFINISHED("未开始",0),
...@@ -65,6 +67,17 @@ public enum PlanTaskDetailIsFinishEnum { ...@@ -65,6 +67,17 @@ public enum PlanTaskDetailIsFinishEnum {
return null; 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() { public static List<String> getEnumNameList() {
List<String> nameList = new ArrayList<String>(); List<String> nameList = new ArrayList<String>();
for (PlanTaskDetailIsFinishEnum c: PlanTaskDetailIsFinishEnum.values()) { for (PlanTaskDetailIsFinishEnum c: PlanTaskDetailIsFinishEnum.values()) {
......
...@@ -7,7 +7,7 @@ import java.util.Map; ...@@ -7,7 +7,7 @@ import java.util.Map;
public enum PlanTaskFinishStatusEnum { public enum PlanTaskFinishStatusEnum {
NOTSTARTED("未开始",0), NOTSTARTED("未开始",0),
UNDERWAY("待执行",1), UNDERWAY("执行中",1),
FINISHED("已结束",2), FINISHED("已结束",2),
OVERTIME("已超时",3); OVERTIME("已超时",3);
......
package com.yeejoin.amos.supervision.dao.entity; 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 org.hibernate.annotations.Where;
import javax.persistence.*;
/** /**
* 检查项 * 检查项
...@@ -183,42 +179,54 @@ public class InputItem extends BasicEntity { ...@@ -183,42 +179,54 @@ public class InputItem extends BasicEntity {
private String testRequirement; private String testRequirement;
/** /**
* 检查类型字典值
*/
@Column(name = "check_type_Val")
private String checkTypeId;
/**
* 检查类型 * 检查类型
*/ */
@Column(name="check_type") @Column(name = "check_type")
private String checkType; private String checkType;
/** /**
* 父类检查项id * 父类检查项id
*/ */
@Column(name="item_parent") @Column(name = "item_parent")
private String itemParent; private String itemParent;
/** /**
* 检查项分类 * 检查项分类
*/ */
@Column(name="item_classify") @Column(name = "item_classify")
private String itemClassify; private String itemClassify;
/** /**
* 适用检查类别 * 适用检查类别
*/ */
@Lob @Lob
@Column(name="item_type_classify") @Column(name = "item_type_classify")
private String itemTypeClassify; private String itemTypeClassify;
/** /**
* 检查项等级 * 检查项等级
*/ */
@Column(name="item_level") @Column(name = "item_level")
private String itemLevel; private String itemLevel;
/** /**
* 检查项启用 * 检查项启用
*/ */
@Column(name="item_start") @Column(name = "item_start")
private Integer itemStart; private Integer itemStart;
/**
* 扩展属性
*/
@Transient
private String ext;
public Integer getItemStart() { public Integer getItemStart() {
return itemStart; return itemStart;
} }
...@@ -498,4 +506,20 @@ public class InputItem extends BasicEntity { ...@@ -498,4 +506,20 @@ public class InputItem extends BasicEntity {
public void setBasisJson(String basisJson) { public void setBasisJson(String basisJson) {
this.basisJson = 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; 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 com.fasterxml.jackson.annotation.JsonBackReference;
import javax.persistence.*;
/** /**
* The persistent class for the p_route_point_item database table. * The persistent class for the p_route_point_item database table.
*
*/ */
@Entity @Entity
@Table(name="p_route_point_item") @Table(name = "p_route_point_item")
@NamedQuery(name="RoutePointItem.findAll", query="SELECT r FROM RoutePointItem r") @NamedQuery(name = "RoutePointItem.findAll", query = "SELECT r FROM RoutePointItem r")
public class RoutePointItem extends BasicEntity { public class RoutePointItem extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 创建者 * 创建者
*/ */
@Column(name="creator_id") @Column(name = "creator_id")
private String creatorId; private String creatorId;
/** /**
* 排序 * 排序
*/ */
@Column(name="order_no") @Column(name = "order_no")
private int orderNo; private int orderNo;
/** /**
* 巡检点检查项id * 巡检点检查项id
*/ */
@Column(name="point_input_item_id") @Column(name = "point_input_item_id")
private long pointInputItemId; private long pointInputItemId;
/** /**
* 路线点表id * 路线点表id
*/ */
@Column(name="route_point_id") @Column(name = "route_point_id")
private long routePointId; private long routePointId;
/** /**
* 点分类id * 点分类id
*/ */
@Column(name="point_classify_id") @Column(name = "point_classify_id")
private Long pointClassifyId; private Long pointClassifyId;
/** /**
* 前端标记是否绑定 * 前端标记是否绑定
*/ */
...@@ -66,7 +58,21 @@ public class RoutePointItem extends BasicEntity { ...@@ -66,7 +58,21 @@ public class RoutePointItem extends BasicEntity {
*/ */
@Column(name = "basis_json", columnDefinition = "text COMMENT '标准依据'") @Column(name = "basis_json", columnDefinition = "text COMMENT '标准依据'")
private String basisJson; private String basisJson;
/**
* 检查项ID
*/
@Column(name = "input_item_id")
private Long inputItemId;
/**
* 计划ID
*/
@Column(name = "plan_id")
private Long planId;
private long pointId; private long pointId;
public RoutePointItem() { public RoutePointItem() {
} }
...@@ -107,6 +113,7 @@ public class RoutePointItem extends BasicEntity { ...@@ -107,6 +113,7 @@ public class RoutePointItem extends BasicEntity {
public RoutePoint getRoutePoint() { public RoutePoint getRoutePoint() {
return routePoint; return routePoint;
} }
@JsonBackReference @JsonBackReference
public void setRoutePoint(RoutePoint routePoint) { public void setRoutePoint(RoutePoint routePoint) {
this.routePoint = routePoint; this.routePoint = routePoint;
...@@ -129,6 +136,7 @@ public class RoutePointItem extends BasicEntity { ...@@ -129,6 +136,7 @@ public class RoutePointItem extends BasicEntity {
public void setBasisJson(String basisJson) { public void setBasisJson(String basisJson) {
this.basisJson = basisJson; this.basisJson = basisJson;
} }
@Transient @Transient
public long getPointId() { public long getPointId() {
return pointId; return pointId;
...@@ -146,4 +154,20 @@ public class RoutePointItem extends BasicEntity { ...@@ -146,4 +154,20 @@ public class RoutePointItem extends BasicEntity {
public void setIsBound(boolean bound) { public void setIsBound(boolean bound) {
isBound = 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; package com.yeejoin.amos.boot.module.command.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -7,6 +8,8 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem; ...@@ -7,6 +8,8 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; 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.service.IDataDictionaryService;
import com.yeejoin.amos.boot.biz.common.utils.WordConverterUtils; import com.yeejoin.amos.boot.biz.common.utils.WordConverterUtils;
import com.yeejoin.amos.boot.module.command.api.dao.SeismometeorologyDtoDao; import com.yeejoin.amos.boot.module.command.api.dao.SeismometeorologyDtoDao;
...@@ -32,6 +35,8 @@ import com.yeejoin.amos.boot.module.common.api.dto.RequestData; ...@@ -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.dto.WaterResourceZhDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; 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.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.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IFireChemicalService; import com.yeejoin.amos.boot.module.common.api.service.IFireChemicalService;
import com.yeejoin.amos.boot.module.common.api.service.IFireExpertsService; import com.yeejoin.amos.boot.module.common.api.service.IFireExpertsService;
...@@ -58,6 +63,7 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService; ...@@ -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.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyService; import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -82,6 +88,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -82,6 +88,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -153,8 +160,10 @@ public class CommandController extends BaseController { ...@@ -153,8 +160,10 @@ public class CommandController extends BaseController {
@Autowired @Autowired
IDutyPersonService iDutyPersonService; IDutyPersonService iDutyPersonService;
@Autowired
IDutyCarService iDutyCarService;
@Autowired
IotFeignClient iotFeignClient;
/** /**
* 警情列表 * 警情列表
* *
...@@ -696,6 +705,68 @@ public class CommandController extends BaseController { ...@@ -696,6 +705,68 @@ public class CommandController extends BaseController {
} }
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "currentPermissionTree")
@ApiOperation(httpMethod = "GET", value = "用户菜单", notes = "用户菜单")
public ResponseModel<List<PermissionModelDto>> currentPermissionTree() {
//获取用户app 菜单
List<PermissionModelDto> list= remoteSecurityService.currentPermissionTree();
List<PermissionModelDto> listdate= getHomePermissionModel(list);
getPermissionModel(listdate);
return ResponseHelper.buildResponse(listdate);
}
public List<PermissionModelDto> getHomePermissionModel(List<PermissionModelDto> list) {
if(list!=null && !list.isEmpty()){
for (PermissionModelDto itme : list) {
if("Home".equals(itme.getFrontComponent())){
String userStr = JSON.toJSONString(itme.getChildren());
List<PermissionModelDto> userList = JSON.parseArray(userStr, PermissionModelDto.class);
return userList;
}
if(itme.getChildren()!=null&&!itme.getChildren().isEmpty()){
String userStr = JSON.toJSONString(itme.getChildren());
List<PermissionModelDto> userList = JSON.parseArray(userStr, PermissionModelDto.class);
return getHomePermissionModel(userList);
}
}
}
return null;
}
public void getPermissionModel(List<PermissionModelDto> list) {
if(list!=null && !list.isEmpty()){
list.forEach(itme->{
HomePageEnum homePageEnum= HomePageEnum.statOf(itme.getFrontComponent());
if(itme.getFrontComponent()!=null&&homePageEnum !=null){
try {
Class clz = Class.forName(homePageEnum.getUrl());
Object entity = clz.newInstance();
Method repay1 = clz.getDeclaredMethod("getHomePageData");
Object value = repay1.invoke(entity);
itme.setValue(value!=null?Double.valueOf(value.toString()):0);
if(itme.getChildren()!=null&&!itme.getChildren().isEmpty()){
String userStr = JSON.toJSONString(itme.getChildren());
List<PermissionModelDto> userList = JSON.parseArray(userStr, PermissionModelDto.class);
getPermissionModel(userList);
itme.setChildren(userList);
}
} catch (Exception e) {
e.printStackTrace();
}
}else{
if(itme.getChildren()!=null&&!itme.getChildren().isEmpty()){
String userStr = JSON.toJSONString(itme.getChildren());
List<PermissionModelDto> userList = JSON.parseArray(userStr, PermissionModelDto.class);
getPermissionModel(userList);
itme.setChildren(userList);
}
}
});
}
}
/** /**
...@@ -996,7 +1067,10 @@ public class CommandController extends BaseController { ...@@ -996,7 +1067,10 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "app-更新车辆状态", notes = "app-更新车辆状态") @ApiOperation(httpMethod = "PUT", value = "app-更新车辆状态", notes = "app-更新车辆状态")
@PutMapping(value = "/app/carStatus") @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 { try {
equipFeignClient.updateCarStatus(Lists.newArrayList(carStatusInfoDto)); equipFeignClient.updateCarStatus(Lists.newArrayList(carStatusInfoDto));
} catch (Exception e) { } catch (Exception e) {
...@@ -1038,4 +1112,66 @@ public class CommandController extends BaseController { ...@@ -1038,4 +1112,66 @@ public class CommandController extends BaseController {
public ResponseModel<Object> statisticsByAlertCalledId(@PathVariable Long alertId) { public ResponseModel<Object> statisticsByAlertCalledId(@PathVariable Long alertId) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferCarResourceStatistics(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; 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.boot.biz.common.utils.FileService;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecCVCDSA;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
/*** /***
...@@ -46,5 +49,22 @@ public class RemoteSecurityService implements FileService{ ...@@ -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; ...@@ -11,7 +11,9 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; 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.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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -127,13 +129,21 @@ public class DutyCarController extends BaseController { ...@@ -127,13 +129,21 @@ public class DutyCarController extends BaseController {
* 值班数据删除 * 值班数据删除
* *
* @param instanceId 实例id * @param instanceId 实例id
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel * @return ResponseModel
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}") @DeleteMapping("/{instanceId}")
@ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除") @ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除")
public ResponseModel deleteDutyData(@PathVariable Long instanceId) { public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) {
return ResponseHelper.buildResponse(iDutyCarService.deleteDutyData(instanceId)); 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) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -11,7 +11,9 @@ import io.swagger.annotations.ApiParam; ...@@ -11,7 +11,9 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; 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.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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -116,13 +118,21 @@ public class DutyPersonController extends BaseController { ...@@ -116,13 +118,21 @@ public class DutyPersonController extends BaseController {
* 值班数据删除 * 值班数据删除
* *
* @param instanceId 实例id * @param instanceId 实例id
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel * @return ResponseModel
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}") @DeleteMapping("/{instanceId}/{startTime}/{endTime}")
@ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除") @ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除")
public ResponseModel deleteDutyData(@PathVariable Long instanceId) { public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) {
return ResponseHelper.buildResponse(iDutyPersonService.deleteDutyData(instanceId)); 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; ...@@ -20,7 +20,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; 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.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.api.service.ILinkageUnitService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl;
......
...@@ -87,7 +87,10 @@ public class OrgUsrController extends BaseController { ...@@ -87,7 +87,10 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse("-1"); 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 { try {
eSOrgUsrService.deleteById(id); eSOrgUsrService.deleteById(id);
emqKeeper.getMqttClient().publish(airportDeleteTopic, JSON.toJSONString(id).getBytes(), 2, false); emqKeeper.getMqttClient().publish(airportDeleteTopic, JSON.toJSONString(id).getBytes(), 2, false);
...@@ -108,6 +111,7 @@ public class OrgUsrController extends BaseController { ...@@ -108,6 +111,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping(value = "/{id}", method = RequestMethod.PUT) @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据") @ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo, @PathVariable Long id) throws Exception { public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo, @PathVariable Long id) throws Exception {
OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY); OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id); iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
...@@ -337,7 +341,7 @@ public class OrgUsrController extends BaseController { ...@@ -337,7 +341,7 @@ public class OrgUsrController extends BaseController {
* @param * @param
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTreeByUser", method = RequestMethod.GET) @RequestMapping(value = "/companyTreeByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门树", notes = "根据登陆人获取单位部门树") @ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门树", notes = "根据登陆人获取单位部门树")
public ResponseModel<List<OrgMenuDto>> selectCompanyTreeByUser() throws Exception { public ResponseModel<List<OrgMenuDto>> selectCompanyTreeByUser() throws Exception {
...@@ -353,7 +357,7 @@ public class OrgUsrController extends BaseController { ...@@ -353,7 +357,7 @@ public class OrgUsrController extends BaseController {
* @param * @param
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyUserTreeByUser", method = RequestMethod.GET) @RequestMapping(value = "/companyUserTreeByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门用户树", notes = "根据登陆人获取单位部门用户树") @ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门用户树", notes = "根据登陆人获取单位部门用户树")
public ResponseModel<List<OrgMenuDto>> companyUserTreeByUser() { public ResponseModel<List<OrgMenuDto>> companyUserTreeByUser() {
...@@ -369,7 +373,7 @@ public class OrgUsrController extends BaseController { ...@@ -369,7 +373,7 @@ public class OrgUsrController extends BaseController {
* @param * @param
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyListByUser", method = RequestMethod.GET) @RequestMapping(value = "/companyListByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位列表", notes = "根据登陆人获取单位列表") @ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位列表", notes = "根据登陆人获取单位列表")
public ResponseModel<List<CheckObjectDto>> companyListByUser() { public ResponseModel<List<CheckObjectDto>> companyListByUser() {
...@@ -399,13 +403,16 @@ public class OrgUsrController extends BaseController { ...@@ -399,13 +403,16 @@ public class OrgUsrController extends BaseController {
* @param * @param
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getLoginUserDetails", method = RequestMethod.GET) @RequestMapping(value = "/getLoginUserDetails", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取登陆人绑定的人员关系", notes = "获取登陆人绑定的人员关系") @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(); 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); return ResponseHelper.buildResponse(loginUserDetails);
} }
......
...@@ -31,6 +31,7 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourcePoolSer ...@@ -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 com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -92,14 +93,13 @@ public class WaterResourceController extends BaseController { ...@@ -92,14 +93,13 @@ public class WaterResourceController extends BaseController {
model.setResourceTypeName(resourceTypeEnum.get().getName()); model.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList())); model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList())); model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
if(model.getAddress()!=null){ /* if(model.getAddress()!=null){
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress()); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(address.getString(BizConstant.ADDRESS)); model.setAddress(address.getString(BizConstant.ADDRESS));
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE))); model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE))); model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
} }*/
if (!StringUtils.isEmpty(resourceType)) { if (!StringUtils.isEmpty(resourceType)) {
switch (resourceType) { switch (resourceType) {
case "hydrant": case "hydrant":
...@@ -168,13 +168,13 @@ public class WaterResourceController extends BaseController { ...@@ -168,13 +168,13 @@ public class WaterResourceController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<WaterResourceDto> updateBySequenceNbrWaterResource(@RequestBody WaterResourceDto model, public ResponseModel<WaterResourceDto> updateBySequenceNbrWaterResource(@RequestBody WaterResourceDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) { @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()); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(model.getAddress());
model.setAddress(address.getString(BizConstant.ADDRESS)); model.setAddress(address.getString(BizConstant.ADDRESS));
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE))); model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE))); model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
} }*/
// 更新基本信息 // 更新基本信息
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList())); model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; 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.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.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift; 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.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; 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 com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; 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.ArrayList;
import java.util.List; import java.util.List;
...@@ -23,6 +31,17 @@ import java.util.stream.Collectors; ...@@ -23,6 +31,17 @@ import java.util.stream.Collectors;
@Service @Service
public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCarService { public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCarService {
@Autowired
DynamicFormInstanceServiceImpl dynamicFormInstanceService;
@Autowired
FirefightersMapper firefightersMapper;
@Autowired
EquipFeignClient equipFeignClient;
String driverPostTypeCode = "5";
@Override @Override
public String getGroupCode() { public String getGroupCode() {
return "dutyCar"; return "dutyCar";
...@@ -78,4 +97,49 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -78,4 +97,49 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, DynamicFormInstance formInstance) { private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, DynamicFormInstance formInstance) {
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId()); 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 { ...@@ -85,16 +85,43 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException { private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException {
// 获取值班的实例id
String instanceId = m.get("instanceId").toString(); String instanceId = m.get("instanceId").toString();
// 根据appkey 获取未删除的值班班次
List<DutyShift> dutyShifts = dutyShiftService.list(new LambdaQueryWrapper<DutyShift>() List<DutyShift> dutyShifts = dutyShiftService.list(new LambdaQueryWrapper<DutyShift>()
.eq(BaseEntity::getIsDelete, false).eq(DutyShift::getAppKey, RequestContext.getAppKey())); .eq(BaseEntity::getIsDelete, false).eq(DutyShift::getAppKey, RequestContext.getAppKey()));
// 根据id 保存成key -value
Map<Long, DutyShift> keyNameMap = dutyShifts.stream() Map<Long, DutyShift> keyNameMap = dutyShifts.stream()
.collect(Collectors.toMap(BaseEntity::getSequenceNbr, Function.identity())); .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<DutyPersonShiftDto> personShiftList = dutyPersonShiftService
.list(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, instanceId) .list(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, instanceId)
.ge(beginDate != null, DutyPersonShift::getDutyDate, beginDate) .ge(beginDate != null, DutyPersonShift::getDutyDate, beginDate)
.le(endDate != null, DutyPersonShift::getDutyDate, endDate)) .le(endDate != null, DutyPersonShift::getDutyDate, endDate))
.stream().map(e -> { .stream().map(e -> {
// 值班关系查询到以后 重新封装
DutyPersonShiftDto dto = new DutyPersonShiftDto(); DutyPersonShiftDto dto = new DutyPersonShiftDto();
Bean.copyExistPropertis(e, dto); Bean.copyExistPropertis(e, dto);
// 没值班信息,默认休 // 没值班信息,默认休
...@@ -152,6 +179,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -152,6 +179,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
public List<Map<String, Object>> list(Long teamId, String beginDate, String endDate) throws ParseException { public List<Map<String, Object>> list(Long teamId, String beginDate, String endDate) throws ParseException {
// 1.已column为准 进行返回 // 1.已column为准 进行返回
String groupCode = this.getGroupCode(); String groupCode = this.getGroupCode();
// 动态表单查询所有值班信息
List<Map<String, Object>> list = dynamicFormInstanceService.listAll(groupCode); List<Map<String, Object>> list = dynamicFormInstanceService.listAll(groupCode);
// 2.组织值班数据 // 2.组织值班数据
...@@ -298,11 +326,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -298,11 +326,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
@Override @Override
public Boolean deleteDutyData(Long instanceId) { public Boolean deleteDutyData(Long instanceId, String startTime, String endTime) {
dynamicFormInstanceService.remove( // BUG 2807 删除逻辑缺陷,现在前端后端传入 删除月份 2021-09-10 by kongfm
new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId)); //dynamicFormInstanceService.remove(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
dutyPersonShiftService 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; return true;
} }
...@@ -379,4 +407,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -379,4 +407,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return shiftIds; return shiftIds;
} }
@Override
public List<Long> getDutyShiftIdList() {
return getOnDuty(new DateTime());
}
} }
...@@ -29,6 +29,7 @@ public class FireChemicalServiceImpl extends BaseService<FireChemicalDto,FireChe ...@@ -29,6 +29,7 @@ public class FireChemicalServiceImpl extends BaseService<FireChemicalDto,FireChe
typeCode = null; typeCode = null;
} }
// BUG 2123 日常管理>辅助资源>危化品,危化品列表数据按创建时间倒序排列 by litw start // 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); return this.queryForPage(page, "rec_date", false,casNo, formula, name, typeCode, isDelete);
} }
......
...@@ -30,7 +30,8 @@ public class FireExpertsServiceImpl extends BaseService<FireExpertsDto, FireExpe ...@@ -30,7 +30,8 @@ public class FireExpertsServiceImpl extends BaseService<FireExpertsDto, FireExpe
@Condition(Operator.eq) Boolean isDelete, @Condition(Operator.eq) Boolean isDelete,
@Condition(Operator.like) String name, @Condition(Operator.like) String name,
@Condition(Operator.eq) String expertCode) { @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; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; 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.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
...@@ -259,16 +260,28 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -259,16 +260,28 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
} }
keySiteDto.setUseNatureName(useNatureArray[0]); keySiteDto.setUseNatureName(useNatureArray[0]);
} }
if (keySiteExcleDto.getFirePreventionFlagName().equals("有")) { if ("有".equals(keySiteExcleDto.getFirePreventionFlagName())) {
keySiteDto.setFirePreventionFlag(true); keySiteDto.setFirePreventionFlag(true);
} else { } else {
keySiteDto.setFirePreventionFlag(false); keySiteDto.setFirePreventionFlag(false);
} }
keySiteDto =Bean.toPo(getCurrentInfo(), keySiteDto);
excelList.add(keySiteDto); excelList.add(keySiteDto);
} }
return this.saveBatch(excelList); 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 @Override
public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr) { public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr) {
LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>(); LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>();
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; 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.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -8,7 +35,24 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -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.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser; 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.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
...@@ -23,24 +67,6 @@ import com.yeejoin.amos.feign.privilege.Privilege; ...@@ -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.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; 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 ...@@ -169,13 +195,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return resultList; return resultList;
} }
@SuppressWarnings("unchecked")
@Override @Override
public List<OrgMenuDto> getSub(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL, public List<OrgMenuDto> getSub(Long topId, @SuppressWarnings("rawtypes") Collection entityList, String packageURL,
String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName, String IDMethodName, int IDHierarchy, String NAMEMethodName, String PARENTIDMethodName,
String OrgTypeMethodName) throws Exception { String OrgTypeMethodName) throws Exception {
List<OrgMenuDto> childList = new ArrayList<>(); List<OrgMenuDto> childList = new ArrayList<>();
@SuppressWarnings("rawtypes")
Class clazz = Class.forName(packageURL); Class clazz = Class.forName(packageURL);
Method IDMethodNameme = null; Method IDMethodNameme = null;
switch (IDHierarchy) { switch (IDHierarchy) {
...@@ -350,7 +374,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -350,7 +374,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
pageBean.setTotal(this.baseMapper.selectPersonListCount(map)); pageBean.setTotal(this.baseMapper.selectPersonListCount(map));
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize()); map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize()); map.put("pageSize", pageBean.getSize());
List<Map<String, Object>> list = this.baseMapper.selectPersonList(map); List<Map<String, Object>> list = this.baseMapper.selectPersonList(map);
/*Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束*/ /*Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束*/
...@@ -361,22 +384,25 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -361,22 +384,25 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override @Override
public List<FormValue> getFormValue(Long id) throws Exception { public List<FormValue> getFormValue(Long id) throws Exception {
// 动态表单数据 // 动态表单数据
/*BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 开始 */
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id); List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id);
List<FormValue> formValue = new ArrayList<>(); List<FormValue> formValue = new ArrayList<>();
for (DynamicFormInstanceDto alertFormValue : list) { for (DynamicFormInstanceDto alertFormValue : list) {
if (alertFormValue.getFieldValueLabel() != null) { /*修改为动态表单返回的数据参数量 2021-09-08 陈浩 开始 */
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), // if (alertFormValue.getFieldValueLabel() != null) {
alertFormValue.getFieldType(), alertFormValue.getFieldValueLabel(), alertFormValue.getBlock()); // FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
formValue.add(value); // alertFormValue.getFieldType(), alertFormValue.getFieldValueLabel(), alertFormValue.getBlock());
} else { // formValue.add(value);
// } else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
alertFormValue.getFieldType(), alertFormValue.getFieldValue(), alertFormValue.getBlock()); alertFormValue.getFieldType(), alertFormValue.getFieldValue(), alertFormValue.getBlock(),alertFormValue.getFieldValueLabel());
formValue.add(value); formValue.add(value);
} /*修改为动态表单返回的数据参数量 2021-09-08 陈浩 结束 */
// }
/*BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 开始 */
} }
return formValue; return formValue;
/*BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 结束 */
} }
public List<FormValue> getFormValueDetail(Long id) throws Exception { public List<FormValue> getFormValueDetail(Long id) throws Exception {
...@@ -385,7 +411,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -385,7 +411,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List<FormValue> formValue = new ArrayList<>(); List<FormValue> formValue = new ArrayList<>();
for (DynamicFormInstanceDto alertFormValue : list) { for (DynamicFormInstanceDto alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), 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); formValue.add(value);
} }
return formValue; return formValue;
...@@ -411,14 +437,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -411,14 +437,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
private void updateChildOrgCode(String oriOrgCode, String targetOrgCode) { private void updateChildOrgCode(String oriOrgCode, String targetOrgCode) {
List<OrgUsr> list = queryOrgUsrList(oriOrgCode); List<OrgUsr> list = queryOrgUsrList(oriOrgCode);
if (ObjectUtils.isEmpty(list)) { if (!ObjectUtils.isEmpty(list)) {
return;
}
list.forEach(action -> { list.forEach(action -> {
action.setBizOrgCode(action.getBizOrgCode().replace(oriOrgCode, targetOrgCode)); action.setBizOrgCode(action.getBizOrgCode().replace(oriOrgCode, targetOrgCode));
updateById(action); updateById(action);
}); });
} }
}
public List<OrgUsr> queryOrgUsrList(String bizOrgCode) { public List<OrgUsr> queryOrgUsrList(String bizOrgCode) {
return this.baseMapper.queryOrgUsrListByBizOrgCode(bizOrgCode); return this.baseMapper.queryOrgUsrListByBizOrgCode(bizOrgCode);
...@@ -512,8 +537,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -512,8 +537,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 动态表单数据 // 动态表单数据
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id); List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id);
Map<String, Object> result = new HashMap<>(); 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 = Bean.BeantoMap(orgUsr);
result.put("parenName", getById(orgUsr.getParentId()).getBizOrgName()); result.put("parenName", getById(orgUsr.getParentId()).getBizOrgName());
// 放入所有动态表单数据 // 放入所有动态表单数据
for (DynamicFormColumn alertForm : alertForms) { for (DynamicFormColumn alertForm : alertForms) {
result.put(alertForm.getFieldCode(), null); result.put(alertForm.getFieldCode(), null);
...@@ -582,11 +617,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -582,11 +617,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setBizOrgCode(getOrgCodeStr()); orgUsr.setBizOrgCode(getOrgCodeStr());
} }
if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
OrgPersonVo.setAmosOrgCode(user.getRealName());
}
saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue()); saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
} }
...@@ -619,6 +649,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -619,6 +649,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr(); OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id); OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgUsrVo, orgUsr); 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); saveOrgUsr(orgUsr, oriOrgUsr);
// 保存动态表单数据 // 保存动态表单数据
updateDynamicFormInstance(orgUsr.getSequenceNbr(), OrgUsrVo.getDynamicFormValue()); updateDynamicFormInstance(orgUsr.getSequenceNbr(), OrgUsrVo.getDynamicFormValue());
...@@ -634,16 +671,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -634,16 +671,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr(); OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id); OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgPersonVo, orgUsr); BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setSequenceNbr(id); /* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 开始*/
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 开始*/
OrgUsr parent = getById(OrgPersonVo.getParentId()); OrgUsr parent = getById(OrgPersonVo.getParentId());
if (parent != null){
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr()); 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())) { if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult(); 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()); oriOrgUsr.setAmosOrgId(user.getUserId());
orgUsr.setAmosOrgCode(user.getRealName()); //orgUsr.setAmosOrgCode(user.getRealName()); 去掉AmosOrgCode by litw 2021年9月10日
orgUsr.setAmosOrgId(user.getUserId()); orgUsr.setAmosOrgId(user.getUserId());
} }
...@@ -772,6 +811,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -772,6 +811,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr orgUsr = new OrgUsr(); OrgUsr orgUsr = new OrgUsr();
OrgUsr oriOrgUsr = getById(id); OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgDepartmentVo, orgUsr); 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); saveOrgUsr(orgUsr, oriOrgUsr);
// 保存动态表单数据 // 保存动态表单数据
updateDynamicFormInstance(orgUsr.getSequenceNbr(), OrgDepartmentVo.getDynamicFormValue()); updateDynamicFormInstance(orgUsr.getSequenceNbr(), OrgDepartmentVo.getDynamicFormValue());
...@@ -957,7 +1004,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -957,7 +1004,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return null; return null;
} }
return ids.stream().map(m -> { 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)) { if (ObjectUtils.isEmpty(org)) {
return null; return null;
} }
...@@ -975,6 +1023,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -975,6 +1023,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return this.queryForList(null, false, parentId, bizOrgType, 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) { public OrgUsrDto getOrg(String amosUserId) {
OrgUsrDto person = queryForListByParentIdAndOrgType(amosUserId); OrgUsrDto person = queryForListByParentIdAndOrgType(amosUserId);
if (ObjectUtils.isEmpty(person)) { if (ObjectUtils.isEmpty(person)) {
...@@ -1146,12 +1198,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1146,12 +1198,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
Set<Long> set = new HashSet<>(); Set<Long> set = new HashSet<>();
orgUsrList.forEach(orgUsr -> { orgUsrList.forEach(orgUsr -> {
Long parent = ObjectUtils.isEmpty(orgUsr.getParentId()) ? 0L : Long.parseLong(orgUsr.getParentId()); if (!StringUtils.isEmpty(orgUsr.getParentId())) {
Long parent = Long.parseLong(orgUsr.getParentId());
if (set.add(parent)) { if (set.add(parent)) {
Long companyIdByDto = getCompanyIdByDto(parent, companyList); Long companyIdByDto = getCompanyIdByDto(parent, companyList);
List<CheckObjectDto> orgUsrTreeDtoList = this.baseMapper.getCompanyAndKeySite(companyIdByDto); List<CheckObjectDto> orgUsrTreeDtoList = this.baseMapper.getCompanyAndKeySite(companyIdByDto);
list.addAll(companyAndKeySiteList(orgUsrTreeDtoList)); list.addAll(companyAndKeySiteList(orgUsrTreeDtoList));
} }
}
}); });
// 返回所在用户单位列表 // 返回所在用户单位列表
return list.stream().distinct().collect(Collectors.toList()); return list.stream().distinct().collect(Collectors.toList());
...@@ -1170,10 +1224,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1170,10 +1224,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) { if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) {
return orgUsr.getSequenceNbr(); return orgUsr.getSequenceNbr();
} else { } else {
if (!StringUtils.isEmpty(orgUsr.getParentId())) {
pid = getCompanyIdByDto(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList); pid = getCompanyIdByDto(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList);
} }
} }
} }
}
return pid; return pid;
} }
...@@ -1273,8 +1329,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1273,8 +1329,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List<OrgMenuDto> treeList = buildTreeParallel(companyDepartmentMsgList); List<OrgMenuDto> treeList = buildTreeParallel(companyDepartmentMsgList);
Set<Long> set = new HashSet<>(); Set<Long> set = new HashSet<>();
orgUsrList.forEach(orgUsr -> { orgUsrList.forEach(orgUsr -> {
if (!StringUtils.isEmpty(orgUsr.getParentId())) {
Long parentId = Long.parseLong(orgUsr.getParentId()); Long parentId = Long.parseLong(orgUsr.getParentId());
getTreeChildre(list, treeList, parentId, set, companyDepartmentMsgList); getTreeChildre(list, treeList, parentId, set, companyDepartmentMsgList);
}
}); });
return list; return list;
} }
...@@ -1303,7 +1361,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1303,7 +1361,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 获取登陆人所在公司 // 获取登陆人所在公司
Long pid = getCompanyId(parentId, companyDepartmentMsgList); Long pid = getCompanyId(parentId, companyDepartmentMsgList);
if (set.add(pid)) { 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); list.addAll(list1);
} }
} }
...@@ -1318,10 +1376,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1318,10 +1376,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) { if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) {
return orgUsr.getSequenceNbr(); return orgUsr.getSequenceNbr();
} else { } else {
if (!StringUtils.isEmpty(orgUsr.getParentId())) {
pid = getCompanyId(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList); pid = getCompanyId(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList);
} }
} }
} }
}
return pid; return pid;
} }
...@@ -1345,10 +1405,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1345,10 +1405,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override @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<>(); List<Map<String, Object>> list = new ArrayList<>();
if (!ObjectUtils.isEmpty(orgUsrs)) { if (!ObjectUtils.isEmpty(orgUsrs)) {
orgUsrs.forEach(orgUsr -> { orgUsrs.forEach(orgUsr -> {
...@@ -1367,6 +1427,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1367,6 +1427,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return list; 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 ...@@ -90,10 +90,7 @@ public class SourceFileServiceImpl extends BaseService<SourceFileDto, SourceFile
public void saveAttachments(Long sequenceNbr, Map<String, List<AttachmentDto>> attachmentMap) { public void saveAttachments(Long sequenceNbr, Map<String, List<AttachmentDto>> attachmentMap) {
if (!ValidationUtil.isEmpty(attachmentMap)) { if (!ValidationUtil.isEmpty(attachmentMap)) {
List<SourceFile> sourceFiles = Lists.newArrayList(); List<SourceFile> sourceFiles = Lists.newArrayList();
attachmentMap.entrySet().forEach(entry -> { attachmentMap.forEach((key, attachments) -> sourceFiles.addAll(attachment2SourceFile(key, attachments)));
List<AttachmentDto> attachments = entry.getValue();
sourceFiles.addAll(attachment2SourceFile(entry.getKey(), attachments));
});
saveSourceFile(sequenceNbr, sourceFiles); 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; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; 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.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -22,20 +18,21 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -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.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; 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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.Menu; 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.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; 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.FireTeamCardDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto; 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.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
...@@ -91,6 +88,13 @@ public class FireTeamController extends BaseController { ...@@ -91,6 +88,13 @@ public class FireTeamController extends BaseController {
@RequestMapping(value = "/updateById", method = RequestMethod.PUT) @RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改消防队伍", notes = "修改消防队伍") @ApiOperation(httpMethod = "PUT", value = "修改消防队伍", notes = "修改消防队伍")
public ResponseModel<Object> updateByIdFireTeam(HttpServletRequest request, @RequestBody FireTeam fireTeam) { 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)); return ResponseHelper.buildResponse(iFireTeamService.saveFireTeam(fireTeam));
} }
......
...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; 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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -130,7 +131,8 @@ public class FirefightersController extends BaseController { ...@@ -130,7 +131,8 @@ public class FirefightersController extends BaseController {
queryWrapper.eq("is_delete", 0); queryWrapper.eq("is_delete", 0);
List<FirefightersJacket> firefightersJacket = iFirefightersJacketService.list(queryWrapper); List<FirefightersJacket> firefightersJacket = iFirefightersJacketService.list(queryWrapper);
if (firefightersJacket != null && firefightersJacket.size() > 0) { if (firefightersJacket != null && firefightersJacket.size() > 0) {
throw new RuntimeException("该消防还有在装装备!"); // BUG 2222 by litw start 2021年9月10日
throw new BadRequest("该消防还有在装装备!");
} }
try { try {
iFirefightersService.update(new UpdateWrapper<Firefighters>().eq("sequence_nbr", id).set("is_delete", 1)); 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 ...@@ -165,7 +165,8 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
Boolean isDelete, Boolean isDelete,
@Condition(Operator.like) String aircraftModel, @Condition(Operator.like) String aircraftModel,
String engineTypeCode, String fuelTypeCode) { 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 ...@@ -302,6 +303,8 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
return map; return map;
} }
@Override @Override
public Aircraft queryAircraftInfoByModel(String aircraftModel) { public Aircraft queryAircraftInfoByModel(String aircraftModel) {
return this.baseMapper.selectOne(new LambdaQueryWrapper<Aircraft>().eq(Aircraft::getAircraftModel, 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 ...@@ -671,6 +671,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return map; return map;
} }
//未结案警情统计
@Override
public Integer AlertCalledcount(int type) {
return alertCalledMapper.AlertCalledcount(1);
}
@Override @Override
public List<JSONObject> queryDisposalObjectList(String alertId) { public List<JSONObject> queryDisposalObjectList(String alertId) {
AlertCalled alertCalled = this.getById(Long.valueOf(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; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.support.ExcelTypeEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInitDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireChemical; import com.yeejoin.amos.boot.module.common.api.entity.FireChemical;
...@@ -22,37 +73,24 @@ import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; ...@@ -22,37 +73,24 @@ import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService; import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService; import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService; import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*; import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonShiftServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyShiftServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireChemicalServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireExpertsServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.RescueEquipmentServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SpecialPositionStaffServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft; import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.ibatis.annotations.Case;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* @author tb * @author tb
...@@ -63,6 +101,9 @@ public class ExcelServiceImpl { ...@@ -63,6 +101,9 @@ public class ExcelServiceImpl {
private static final String NOT_DUTY = "休班"; private static final String NOT_DUTY = "休班";
private static final String PERSON = "PERSON"; private static final String PERSON = "PERSON";
private static final String MAINTENANCE_PERSON = "maintenancePerson"; private static final String MAINTENANCE_PERSON = "maintenancePerson";
@Autowired
private RedisUtils redisUtils;
@Autowired @Autowired
DataSourcesImpl dataSourcesImpl; DataSourcesImpl dataSourcesImpl;
@Autowired @Autowired
...@@ -107,12 +148,14 @@ public class ExcelServiceImpl { ...@@ -107,12 +148,14 @@ public class ExcelServiceImpl {
SpecialPositionStaffServiceImpl specialPositionStaffServiceImpl; SpecialPositionStaffServiceImpl specialPositionStaffServiceImpl;
@Autowired @Autowired
RescueEquipmentServiceImpl rescueEquipmentServiceImpl; RescueEquipmentServiceImpl rescueEquipmentServiceImpl;
@Autowired
IOrgUsrService orgUsrServer;
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException { public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl(); String url = excelDto.getClassUrl();
Class<?> clz = Class.forName(url); Class<?> clz = Class.forName(url);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null, clz, ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null, clz, dataSourcesImpl,
dataSourcesImpl, true); true);
} }
public void commonExport(HttpServletResponse response, ExcelDto excelDto) { public void commonExport(HttpServletResponse response, ExcelDto excelDto) {
...@@ -125,18 +168,18 @@ public class ExcelServiceImpl { ...@@ -125,18 +168,18 @@ public class ExcelServiceImpl {
break; break;
case "XFZJ": case "XFZJ":
List<FireExpertsDto> fireExpertsDtoList = fireExpertsServiceImpl.queryForFireExpertsList(false); List<FireExpertsDto> fireExpertsDtoList = fireExpertsServiceImpl.queryForFireExpertsList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireExpertsDtoList,
fireExpertsDtoList, FireExpertsDto.class, dataSourcesImpl, false); FireExpertsDto.class, dataSourcesImpl, false);
break; break;
case "SYXX": case "SYXX":
List<WaterResourceDto> waterResourceDtoList = waterResourceServiceImpl.exportToExcel(true); List<WaterResourceDto> waterResourceDtoList = waterResourceServiceImpl.exportToExcel(true);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), waterResourceDtoList,
waterResourceDtoList, WaterResourceDto.class, dataSourcesImpl, false); WaterResourceDto.class, dataSourcesImpl, false);
break; break;
case "HKQ": case "HKQ":
List<AircraftDto> aircraftDtoList = aircraftServiceImpl.queryAircraftDtoForList(false); List<AircraftDto> aircraftDtoList = aircraftServiceImpl.queryAircraftDtoForList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), aircraftDtoList,
aircraftDtoList, AircraftDto.class, dataSourcesImpl, false); AircraftDto.class, dataSourcesImpl, false);
break; break;
case "XFDW": case "XFDW":
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false); List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false);
...@@ -145,8 +188,8 @@ public class ExcelServiceImpl { ...@@ -145,8 +188,8 @@ public class ExcelServiceImpl {
break; break;
case "WXXFZ": case "WXXFZ":
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false); List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireStationDtoList,
fireStationDtoList, FireStationDto.class, null, false); FireStationDto.class, null, false);
break; break;
case "XFRY": case "XFRY":
List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false); List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false);
...@@ -154,27 +197,27 @@ public class ExcelServiceImpl { ...@@ -154,27 +197,27 @@ public class ExcelServiceImpl {
firefightersExcelDtoList, FirefightersExcelDto.class, null, false); firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
break; break;
case "WBRY": case "WBRY":
List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList = List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList = maintenanceCompanyService
maintenanceCompanyService.exportToMaintenancePersonExcel(); .exportToMaintenancePersonExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false); maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false);
break; break;
case "KEYSITE": case "KEYSITE":
List<KeySiteExcleDto> keySiteDtoList = keySiteService.exportToExcel(); List<KeySiteExcleDto> keySiteDtoList = keySiteService.exportToExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), keySiteDtoList,
keySiteDtoList, KeySiteExcleDto.class, null, false); KeySiteExcleDto.class, null, false);
break; break;
case "JCDWRY": case "JCDWRY":
List<OrgUsrExcelDto> orgUsrList = orgUsrService.exportToExcel(); List<OrgUsrExcelDto> orgUsrList = orgUsrService.exportToExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), orgUsrList,
orgUsrList, OrgUsrExcelDto.class, null, false); OrgUsrExcelDto.class, null, false);
break; break;
case "LDDW": case "LDDW":
List<LinkageUnitDto> LinkageUnitDtoList = linkageUnitServiceImpl.exportToExcel(); List<LinkageUnitDto> LinkageUnitDtoList = linkageUnitServiceImpl.exportToExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), LinkageUnitDtoList,
LinkageUnitDtoList, LinkageUnitDto.class, null, false); LinkageUnitDto.class, null, false);
break; break;
default: default:
break; break;
...@@ -235,13 +278,14 @@ public class ExcelServiceImpl { ...@@ -235,13 +278,14 @@ public class ExcelServiceImpl {
} }
private void excelImportLinkageUnitTGRYDto(MultipartFile multipartFile) throws Exception { private void excelImportLinkageUnitTGRYDto(MultipartFile multipartFile) throws Exception {
List<SpecialPositionStaffDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<SpecialPositionStaffDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
SpecialPositionStaffDto.class, 1); SpecialPositionStaffDto.class, 1);
if(excelDtoList!=null&&excelDtoList.size()>0){ if (excelDtoList != null && excelDtoList.size() > 0) {
outer : for(SpecialPositionStaffDto positionStaffDto : excelDtoList) { outer: for (SpecialPositionStaffDto positionStaffDto : excelDtoList) {
String code = ""; String code = "";
if(positionStaffDto.getPositionName()!=null){ if (positionStaffDto.getPositionName() != null) {
String[] certificates = positionStaffDto.getPositionName().split("@"); String[] certificates = positionStaffDto.getPositionName().split("@");
positionStaffDto.setPositionName(certificates[0]); positionStaffDto.setPositionName(certificates[0]);
positionStaffDto.setPositionNameCode(certificates[1]); positionStaffDto.setPositionNameCode(certificates[1]);
...@@ -249,34 +293,36 @@ public class ExcelServiceImpl { ...@@ -249,34 +293,36 @@ public class ExcelServiceImpl {
} else { } else {
continue; continue;
} }
if(positionStaffDto.getCompany()!=null){ if (positionStaffDto.getCompany() != null) {
String[] certificates = positionStaffDto.getCompany().split("@"); String[] certificates = positionStaffDto.getCompany().split("@");
positionStaffDto.setCompany(certificates[0]); positionStaffDto.setCompany(certificates[0]);
positionStaffDto.setCompanyId(Long.parseLong(certificates[1])); positionStaffDto.setCompanyId(Long.parseLong(certificates[1]));
// 获取特岗人员已经存在的岗位 如果存在则不导入 // 获取特岗人员已经存在的岗位 如果存在则不导入
LambdaQueryWrapper<SpecialPositionStaff> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SpecialPositionStaff> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SpecialPositionStaff::getCompanyId,Long.parseLong(certificates[1])).eq(SpecialPositionStaff::getIsDelete,false); queryWrapper.eq(SpecialPositionStaff::getCompanyId, Long.parseLong(certificates[1]))
.eq(SpecialPositionStaff::getIsDelete, false);
List<SpecialPositionStaff> tempList = specialPositionStaffServiceImpl.list(queryWrapper); List<SpecialPositionStaff> tempList = specialPositionStaffServiceImpl.list(queryWrapper);
for(SpecialPositionStaff temp : tempList) { for (SpecialPositionStaff temp : tempList) {
if(temp.getPositionNameCode().equals(code)) { if (temp.getPositionNameCode().equals(code)) {
continue outer; // 已经存在则不导入继续循环 continue outer; // 已经存在则不导入继续循环
} }
} }
} else { } else {
continue; continue;
} }
positionStaffDto = Bean.toPo(getCurrentInfo(),positionStaffDto);
specialPositionStaffServiceImpl.createWithModel(positionStaffDto); specialPositionStaffServiceImpl.createWithModel(positionStaffDto);
} }
} }
} }
private void excelImportLinkageUnitJYZBDto(MultipartFile multipartFile) throws Exception { private void excelImportLinkageUnitJYZBDto(MultipartFile multipartFile) throws Exception {
List<RescueEquipmentDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<RescueEquipmentDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, RescueEquipmentDto.class,
RescueEquipmentDto.class, 1); 1);
if(excelDtoList!=null&&excelDtoList.size()>0){ if (excelDtoList != null && excelDtoList.size() > 0) {
outer : for(RescueEquipmentDto rescueEquipmentDto : excelDtoList ) { outer: for (RescueEquipmentDto rescueEquipmentDto : excelDtoList) {
String code = ""; String code = "";
if(rescueEquipmentDto.getVehicleType()!=null){ if (rescueEquipmentDto.getVehicleType() != null) {
String[] certificates = rescueEquipmentDto.getVehicleType().split("@"); String[] certificates = rescueEquipmentDto.getVehicleType().split("@");
rescueEquipmentDto.setVehicleType(certificates[0]); rescueEquipmentDto.setVehicleType(certificates[0]);
rescueEquipmentDto.setVehicleTypeCode(certificates[1]); rescueEquipmentDto.setVehicleTypeCode(certificates[1]);
...@@ -284,65 +330,59 @@ public class ExcelServiceImpl { ...@@ -284,65 +330,59 @@ public class ExcelServiceImpl {
} else { } else {
continue; continue;
} }
if(rescueEquipmentDto.getCompany()!=null){ if (rescueEquipmentDto.getCompany() != null) {
String[] certificates = rescueEquipmentDto.getCompany().split("@"); String[] certificates = rescueEquipmentDto.getCompany().split("@");
rescueEquipmentDto.setCompany(certificates[0]); rescueEquipmentDto.setCompany(certificates[0]);
rescueEquipmentDto.setCompanyId(Long.parseLong(certificates[1])); rescueEquipmentDto.setCompanyId(Long.parseLong(certificates[1]));
// 获取救援装备已经存在的装备 如果存在则不导入 // 获取救援装备已经存在的装备 如果存在则不导入
LambdaQueryWrapper<RescueEquipment> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<RescueEquipment> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(RescueEquipment::getCompanyId,Long.parseLong(certificates[1])).eq(RescueEquipment::getIsDelete,false); queryWrapper.eq(RescueEquipment::getCompanyId, Long.parseLong(certificates[1]))
.eq(RescueEquipment::getIsDelete, false);
List<RescueEquipment> tempList = rescueEquipmentServiceImpl.list(queryWrapper); List<RescueEquipment> tempList = rescueEquipmentServiceImpl.list(queryWrapper);
for(RescueEquipment temp : tempList) { for (RescueEquipment temp : tempList) {
if(temp.getVehicleTypeCode().equals(code)) { if (temp.getVehicleTypeCode().equals(code)) {
continue outer; // 已经存在则不导入继续循环 continue outer; // 已经存在则不导入继续循环
} }
} }
} else { } else {
continue ; continue;
} }
rescueEquipmentDto = Bean.toPo(getCurrentInfo(),rescueEquipmentDto);
rescueEquipmentServiceImpl.createWithModel(rescueEquipmentDto); rescueEquipmentServiceImpl.createWithModel(rescueEquipmentDto);
} }
} }
} }
private void excelImportLinkageUnitZhDto(MultipartFile multipartFile) throws Exception { private void excelImportLinkageUnitZhDto(MultipartFile multipartFile) throws Exception {
List<LinkageUnitDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<LinkageUnitDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, LinkageUnitDto.class, 1);
LinkageUnitDto.class, 1);
if(excelDtoList!=null&&excelDtoList.size()>0){ if (excelDtoList != null && excelDtoList.size() > 0) {
excelDtoList.forEach(linkageUnitDto->{ excelDtoList.forEach(linkageUnitDto -> {
if(linkageUnitDto.getLinkageUnitType()!=null){ if (linkageUnitDto.getLinkageUnitType() != null) {
String[] certificates = linkageUnitDto.getLinkageUnitType().split("@"); String[] certificates = linkageUnitDto.getLinkageUnitType().split("@");
linkageUnitDto.setLinkageUnitType(certificates[0]); linkageUnitDto.setLinkageUnitType(certificates[0]);
linkageUnitDto.setLinkageUnitTypeCode(certificates[1]); linkageUnitDto.setLinkageUnitTypeCode(certificates[1]);
} }
if(linkageUnitDto.getEmergencyLinkageUnit()!=null){ if (linkageUnitDto.getEmergencyLinkageUnit() != null) {
String[] certificates = linkageUnitDto.getEmergencyLinkageUnit().split("@"); String[] certificates = linkageUnitDto.getEmergencyLinkageUnit().split("@");
linkageUnitDto.setEmergencyLinkageUnit(certificates[0]); linkageUnitDto.setEmergencyLinkageUnit(certificates[0]);
linkageUnitDto.setEmergencyLinkageUnitCode(certificates[1]); linkageUnitDto.setEmergencyLinkageUnitCode(certificates[1]);
} }
linkageUnitDto =Bean.toPo(getCurrentInfo(),linkageUnitDto);
linkageUnitServiceImpl.saveLinkageModel(linkageUnitDto); linkageUnitServiceImpl.saveLinkageModel(linkageUnitDto);
}); });
} }
} }
private void excelImportOrgUsrExcelDto(MultipartFile multipartFile) throws Exception { private void excelImportOrgUsrExcelDto(MultipartFile multipartFile) throws Exception {
List<OrgUsrExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<OrgUsrExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, OrgUsrExcelDto.class, 1);
OrgUsrExcelDto.class, 1);
if(excelDtoList!=null&&excelDtoList.size()>0){ if (excelDtoList != null && excelDtoList.size() > 0) {
excelDtoList.forEach(orgUsrExcelDto->{ excelDtoList.forEach(orgUsrExcelDto -> {
if(orgUsrExcelDto.getParentId()!=null){ if (orgUsrExcelDto.getParentId() != null) {
String[] certificates = orgUsrExcelDto.getParentId().split("@"); String[] certificates = orgUsrExcelDto.getParentId().split("@");
orgUsrExcelDto.setParentId(certificates[1]); orgUsrExcelDto.setParentId(certificates[1]);
} }
...@@ -350,18 +390,18 @@ public class ExcelServiceImpl { ...@@ -350,18 +390,18 @@ public class ExcelServiceImpl {
List<DynamicFormInitDto> dynamicFormColumn = dynamicFormColumnServiceImpl.getFormlist("246"); List<DynamicFormInitDto> dynamicFormColumn = dynamicFormColumnServiceImpl.getFormlist("246");
List<DynamicFormInstanceDto> dynamicFormValue =new ArrayList<>(); List<DynamicFormInstanceDto> dynamicFormValue = new ArrayList<>();
List<DynamicFormInstance> dynamicFormInstancelist =new ArrayList<>(); List<DynamicFormInstance> dynamicFormInstancelist = new ArrayList<>();
dynamicFormColumn.forEach(DynamicFormInitDto->{ dynamicFormColumn.forEach(DynamicFormInitDto -> {
dynamicFormValue.add(DynamicFormInitDto.getFormItemDescr()); dynamicFormValue.add(DynamicFormInitDto.getFormItemDescr());
}); });
dynamicFormValue.forEach(dynamicFormInstanceDto->{ dynamicFormValue.forEach(dynamicFormInstanceDto -> {
switch (dynamicFormInstanceDto.getFieldCode()) { switch (dynamicFormInstanceDto.getFieldCode()) {
case "administrativePositionCode": case "administrativePositionCode":
if(orgUsrExcelDto.getAdministrativePositionCode()!=null){ if (orgUsrExcelDto.getAdministrativePositionCode() != null) {
String[] certificates = orgUsrExcelDto.getAdministrativePositionCode().split("@"); String[] certificates = orgUsrExcelDto.getAdministrativePositionCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
...@@ -369,7 +409,7 @@ public class ExcelServiceImpl { ...@@ -369,7 +409,7 @@ public class ExcelServiceImpl {
} }
break; break;
case "auditCycle": case "auditCycle":
if(orgUsrExcelDto.getAuditCycle()!=null){ if (orgUsrExcelDto.getAuditCycle() != null) {
String[] certificates = orgUsrExcelDto.getAuditCycle().split("@"); String[] certificates = orgUsrExcelDto.getAuditCycle().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
...@@ -380,7 +420,7 @@ public class ExcelServiceImpl { ...@@ -380,7 +420,7 @@ public class ExcelServiceImpl {
dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getCertificatesNumber()); dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getCertificatesNumber());
break; break;
case "certificatesTypeCode": case "certificatesTypeCode":
if(orgUsrExcelDto.getCertificatesTypeCode()!=null){ if (orgUsrExcelDto.getCertificatesTypeCode() != null) {
String[] certificates = orgUsrExcelDto.getCertificatesTypeCode().split("@"); String[] certificates = orgUsrExcelDto.getCertificatesTypeCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
...@@ -388,14 +428,14 @@ public class ExcelServiceImpl { ...@@ -388,14 +428,14 @@ public class ExcelServiceImpl {
} }
break; break;
case "certificateType": case "certificateType":
if(orgUsrExcelDto.getCertificateType()!=null){ if (orgUsrExcelDto.getCertificateType() != null) {
String[] certificates = orgUsrExcelDto.getCertificateType().split("@"); String[] certificates = orgUsrExcelDto.getCertificateType().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
} }
case "fireManagementPostCode": case "fireManagementPostCode":
if(orgUsrExcelDto.getFireManagementPostCode()!=null){ if (orgUsrExcelDto.getFireManagementPostCode() != null) {
String[] certificates = orgUsrExcelDto.getFireManagementPostCode().split("@"); String[] certificates = orgUsrExcelDto.getFireManagementPostCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
...@@ -406,7 +446,7 @@ public class ExcelServiceImpl { ...@@ -406,7 +446,7 @@ public class ExcelServiceImpl {
dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getGender()); dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getGender());
break; break;
case "internalPositionCode": case "internalPositionCode":
if(orgUsrExcelDto.getInternalPositionCode()!=null){ if (orgUsrExcelDto.getInternalPositionCode() != null) {
String[] certificates = orgUsrExcelDto.getInternalPositionCode().split("@"); String[] certificates = orgUsrExcelDto.getInternalPositionCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
...@@ -417,7 +457,7 @@ public class ExcelServiceImpl { ...@@ -417,7 +457,7 @@ public class ExcelServiceImpl {
dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getPersonNumber()); dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getPersonNumber());
break; break;
case "positionType": case "positionType":
if(orgUsrExcelDto.getPositionType()!=null){ if (orgUsrExcelDto.getPositionType() != null) {
String[] certificates = orgUsrExcelDto.getPositionType().split("@"); String[] certificates = orgUsrExcelDto.getPositionType().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
...@@ -425,7 +465,7 @@ public class ExcelServiceImpl { ...@@ -425,7 +465,7 @@ public class ExcelServiceImpl {
} }
break; break;
case "safetyTraining": case "safetyTraining":
if(orgUsrExcelDto.getSafetyTraining()!=null){ if (orgUsrExcelDto.getSafetyTraining() != null) {
String[] certificates = orgUsrExcelDto.getSafetyTraining().split("@"); String[] certificates = orgUsrExcelDto.getSafetyTraining().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
...@@ -433,7 +473,7 @@ public class ExcelServiceImpl { ...@@ -433,7 +473,7 @@ public class ExcelServiceImpl {
} }
break; break;
case "stateCode": case "stateCode":
if(orgUsrExcelDto.getStateCode()!=null){ if (orgUsrExcelDto.getStateCode() != null) {
String[] certificates = orgUsrExcelDto.getStateCode().split("@"); String[] certificates = orgUsrExcelDto.getStateCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
...@@ -446,15 +486,13 @@ public class ExcelServiceImpl { ...@@ -446,15 +486,13 @@ public class ExcelServiceImpl {
} }
DynamicFormInstance dynamicFormInstance=new DynamicFormInstance(); DynamicFormInstance dynamicFormInstance = new DynamicFormInstance();
BeanUtils.copyProperties(dynamicFormInstanceDto, dynamicFormInstance); BeanUtils.copyProperties(dynamicFormInstanceDto, dynamicFormInstance);
dynamicFormInstancelist.add(dynamicFormInstance); dynamicFormInstancelist.add(dynamicFormInstance);
}); });
orgUsrExcelDto.setDynamicFormValue(dynamicFormInstancelist); orgUsrExcelDto.setDynamicFormValue(dynamicFormInstancelist);
Bean.toPo(getCurrentInfo(),orgUsrExcelDto);
try { try {
orgUsrService.saveOrgPersonExcel(orgUsrExcelDto); orgUsrService.saveOrgPersonExcel(orgUsrExcelDto);
} catch (Exception e) { } catch (Exception e) {
...@@ -463,26 +501,16 @@ public class ExcelServiceImpl { ...@@ -463,26 +501,16 @@ public class ExcelServiceImpl {
}); });
} }
} }
private void excelImportFirefighters(MultipartFile multipartFile) throws Exception { private void excelImportFirefighters(MultipartFile multipartFile) throws Exception {
List<FirefightersExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<FirefightersExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
FirefightersExcelDto.class, 1); FirefightersExcelDto.class, 1);
excelDtoList.forEach( excelDtoList.forEach(item -> {
item -> {
Firefighters firefighters = new Firefighters(); Firefighters firefighters = new Firefighters();
FirefightersContacts firefightersContacts = new FirefightersContacts(); FirefightersContacts firefightersContacts = new FirefightersContacts();
firefighters = Bean.toPo(item, firefighters); firefighters = Bean.toPo(item, firefighters);
firefighters = Bean.toPo(getCurrentInfo(), firefighters);
firefightersContacts = Bean.toPo(item, firefightersContacts); firefightersContacts = Bean.toPo(item, firefightersContacts);
if (item.getFireTeam() != null) { if (item.getFireTeam() != null) {
Long fireTeamId = Long.valueOf(item.getFireTeam().split("@")[1]); Long fireTeamId = Long.valueOf(item.getFireTeam().split("@")[1]);
...@@ -507,17 +535,17 @@ public class ExcelServiceImpl { ...@@ -507,17 +535,17 @@ public class ExcelServiceImpl {
String relationship = firefightersContacts.getRelationship().split("@")[1]; String relationship = firefightersContacts.getRelationship().split("@")[1];
firefightersContacts.setRelationship(relationship); firefightersContacts.setRelationship(relationship);
} }
if(firefighters.getCompanyName() != null) { if (firefighters.getCompanyName() != null) {
String[] tempCompany = firefighters.getCompanyName().split("@"); String[] tempCompany = firefighters.getCompanyName().split("@");
firefighters.setCompanyName(tempCompany[0]); firefighters.setCompanyName(tempCompany[0]);
firefighters.setCompany(tempCompany[1]); firefighters.setCompany(tempCompany[1]);
} }
if(firefighters.getNativePlaceValue() != null) { if (firefighters.getNativePlaceValue() != null) {
String[] tempCity = firefighters.getNativePlaceValue().split("@"); String[] tempCity = firefighters.getNativePlaceValue().split("@");
firefighters.setNativePlaceValue(tempCity[0]); firefighters.setNativePlaceValue(tempCity[0]);
firefighters.setNativePlace(tempCity[1]); firefighters.setNativePlace(tempCity[1]);
} }
if(firefighters.getResidence() != null) { if (firefighters.getResidence() != null) {
String[] tempCity = firefighters.getResidence().split("@"); String[] tempCity = firefighters.getResidence().split("@");
firefighters.setResidence(tempCity[0]); firefighters.setResidence(tempCity[0]);
firefighters.setResidenceDetails(tempCity[1]); firefighters.setResidenceDetails(tempCity[1]);
...@@ -525,17 +553,16 @@ public class ExcelServiceImpl { ...@@ -525,17 +553,16 @@ public class ExcelServiceImpl {
// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm // BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
FirefightersInfoDto firefightersInfo = new FirefightersInfoDto(firefighters, firefightersContacts); FirefightersInfoDto firefightersInfo = new FirefightersInfoDto(firefighters, firefightersContacts);
firefightersService.saveFirefighters(firefightersInfo); firefightersService.saveFirefighters(firefightersInfo);
} });
);
} }
private void excelImportFireStation(MultipartFile multipartFile) throws Exception { private void excelImportFireStation(MultipartFile multipartFile) throws Exception {
List<FireStationDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireStationDto.class, 1); List<FireStationDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireStationDto.class, 1);
List<FireStation> excelEntityList = new ArrayList<>(); List<FireStation> excelEntityList = new ArrayList<>();
excelDtoList.forEach( excelDtoList.forEach(item -> {
item -> {
FireStation fireStation = new FireStation(); FireStation fireStation = new FireStation();
fireStation = Bean.toPo(item, fireStation); fireStation = Bean.toPo(item, fireStation);
fireStation = Bean.toPo(getCurrentInfo(), fireStation);
if (fireStation.getWhereBuilding() != null) { if (fireStation.getWhereBuilding() != null) {
String[] whereBuilding = fireStation.getWhereBuilding().split("@"); String[] whereBuilding = fireStation.getWhereBuilding().split("@");
fireStation.setWhereBuilding(whereBuilding[0]); fireStation.setWhereBuilding(whereBuilding[0]);
...@@ -548,18 +575,32 @@ public class ExcelServiceImpl { ...@@ -548,18 +575,32 @@ public class ExcelServiceImpl {
fireStation.setBizCompanyCode(bizCompany[2]); fireStation.setBizCompanyCode(bizCompany[2]);
} }
excelEntityList.add(fireStation); excelEntityList.add(fireStation);
} });
);
fireStationService.saveBatch(excelEntityList); fireStationService.saveBatch(excelEntityList);
} }
private void excelImportFireTeam(MultipartFile multipartFile) throws Exception { private void excelImportFireTeam(MultipartFile multipartFile) throws Exception {
List<FireTeamDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireTeamDto.class, 1); List<FireTeamDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireTeamDto.class, 1);
List<FireTeam> excelEntityList = new ArrayList<>(); List<FireTeam> excelEntityList = new ArrayList<>();
excelDtoList.forEach(
item -> { excelDtoList.forEach(item -> {
FireTeam fireTeam = new FireTeam(); FireTeam fireTeam = new FireTeam();
fireTeam = Bean.toPo(item, fireTeam); fireTeam = Bean.toPo(item, fireTeam);
fireTeam = Bean.toPo(getCurrentInfo(), fireTeam);
/* bug2835 添加获取上级单位的信息方法 陈浩 2021-09-10 --start*/
if(fireTeam.getCompanyName()!=null) {
String[] companyArray = fireTeam.getCompanyName().split("@");
fireTeam.setCompany(Long.parseLong(companyArray[1]));
fireTeam.setCompanyName(companyArray[0]);
try {
OrgUsrFormDto companyDto =orgUsrServer.selectCompanyById(Long.parseLong(companyArray[1]));
fireTeam.setCompanyCode(companyDto.getBizOrgCode());
} catch (Exception e) {
}
}
/* bug2835 添加获取上级单位的信息方法 陈浩 2021-09-10 --end*/
if (fireTeam.getType() != null) { if (fireTeam.getType() != null) {
String[] type = fireTeam.getType().split("@"); String[] type = fireTeam.getType().split("@");
fireTeam.setType(type[0]); fireTeam.setType(type[0]);
...@@ -575,18 +616,17 @@ public class ExcelServiceImpl { ...@@ -575,18 +616,17 @@ public class ExcelServiceImpl {
fireTeam.setParent(Long.valueOf(parentName[1])); fireTeam.setParent(Long.valueOf(parentName[1]));
} }
excelEntityList.add(fireTeam); excelEntityList.add(fireTeam);
} });
);
fireTeamService.saveBatch(excelEntityList); fireTeamService.saveBatch(excelEntityList);
} }
private void excelImportAircraft(MultipartFile multipartFile) throws Exception { private void excelImportAircraft(MultipartFile multipartFile) throws Exception {
List<AircraftDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, AircraftDto.class, 1); List<AircraftDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, AircraftDto.class, 1);
List<Aircraft> excelEntityList = new ArrayList<>(); List<Aircraft> excelEntityList = new ArrayList<>();
excelDtoList.forEach( excelDtoList.forEach(item -> {
item -> {
Aircraft aircraft = new Aircraft(); Aircraft aircraft = new Aircraft();
aircraft = Bean.toPo(item, aircraft); aircraft = Bean.toPo(item, aircraft);
aircraft = Bean.toPo(getCurrentInfo(), aircraft);
if (aircraft.getEngineType() != null) { if (aircraft.getEngineType() != null) {
String[] engineType = aircraft.getEngineType().split("@"); String[] engineType = aircraft.getEngineType().split("@");
aircraft.setEngineType(engineType[0]); aircraft.setEngineType(engineType[0]);
...@@ -598,34 +638,30 @@ public class ExcelServiceImpl { ...@@ -598,34 +638,30 @@ public class ExcelServiceImpl {
aircraft.setFuelTypeCode(fuelType[1]); aircraft.setFuelTypeCode(fuelType[1]);
} }
excelEntityList.add(aircraft); excelEntityList.add(aircraft);
} });
);
aircraftServiceImpl.saveBatch(excelEntityList); aircraftServiceImpl.saveBatch(excelEntityList);
} }
private void excelImportFireChemical(MultipartFile multipartFile) throws Exception { private void excelImportFireChemical(MultipartFile multipartFile) throws Exception {
List<FireChemicalDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireChemicalDto.class, 1); List<FireChemicalDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireChemicalDto.class, 1);
List<FireChemical> excelEntityList = new ArrayList<>(); List<FireChemical> excelEntityList = new ArrayList<>();
excelDtoList.forEach( excelDtoList.forEach(item -> {
item -> {
FireChemical fireChemical = new FireChemical(); FireChemical fireChemical = new FireChemical();
fireChemical = Bean.toPo(item, fireChemical); fireChemical = Bean.toPo(item, fireChemical);
fireChemical = Bean.toPo(getCurrentInfo(), fireChemical);
if (fireChemical.getType() != null) { if (fireChemical.getType() != null) {
String[] type = fireChemical.getType().split("@"); String[] type = fireChemical.getType().split("@");
fireChemical.setType(type[0]); fireChemical.setType(type[0]);
fireChemical.setTypeCode(type[1]); fireChemical.setTypeCode(type[1]);
} }
excelEntityList.add(fireChemical); excelEntityList.add(fireChemical);
} });
);
fireChemicalServiceImpl.saveBatch(excelEntityList); fireChemicalServiceImpl.saveBatch(excelEntityList);
} }
private void excelImportWaterResource(MultipartFile multipartFile) throws Exception { private void excelImportWaterResource(MultipartFile multipartFile) throws Exception {
List<WaterResourceDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<WaterResourceDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, WaterResourceDto.class, 1);
WaterResourceDto.class, 1); excelDtoList.forEach(item -> {
excelDtoList.forEach(
item -> {
if (item.getResourceTypeName() != null) { if (item.getResourceTypeName() != null) {
String[] resourceTypeName = item.getResourceTypeName().split("@"); String[] resourceTypeName = item.getResourceTypeName().split("@");
item.setResourceTypeName(resourceTypeName[0]); item.setResourceTypeName(resourceTypeName[0]);
...@@ -685,19 +721,18 @@ public class ExcelServiceImpl { ...@@ -685,19 +721,18 @@ public class ExcelServiceImpl {
item.setType(type[0]); item.setType(type[0]);
item.setTypeCode(type[1]); item.setTypeCode(type[1]);
} }
item = Bean.toPo(getCurrentInfo(), item);
waterResourceServiceImpl.importByExcel(item); waterResourceServiceImpl.importByExcel(item);
} });
);
} }
private void excelImportFireExperts(MultipartFile multipartFile) throws Exception { private void excelImportFireExperts(MultipartFile multipartFile) throws Exception {
List<FireExpertsDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<FireExpertsDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireExpertsDto.class, 1);
FireExpertsDto.class, 1);
List<FireExperts> excelEntityList = new ArrayList<>(); List<FireExperts> excelEntityList = new ArrayList<>();
excelDtoList.forEach( excelDtoList.forEach(fireExpertsDto -> {
fireExpertsDto -> {
FireExperts fireExperts = new FireExperts(); FireExperts fireExperts = new FireExperts();
fireExperts = Bean.toPo(fireExpertsDto, fireExperts); fireExperts = Bean.toPo(fireExpertsDto, fireExperts);
fireExperts = Bean.toPo(getCurrentInfo(),fireExperts);
if (fireExperts.getCertificatesType() != null) { if (fireExperts.getCertificatesType() != null) {
String[] certificates = fireExperts.getCertificatesType().split("@"); String[] certificates = fireExperts.getCertificatesType().split("@");
fireExperts.setCertificatesType(certificates[0]); fireExperts.setCertificatesType(certificates[0]);
...@@ -718,8 +753,7 @@ public class ExcelServiceImpl { ...@@ -718,8 +753,7 @@ public class ExcelServiceImpl {
fireExperts.setHighestEducation(highestEducation[0]); fireExperts.setHighestEducation(highestEducation[0]);
} }
excelEntityList.add(fireExperts); excelEntityList.add(fireExperts);
} });
);
fireExpertsServiceImpl.saveBatch(excelEntityList); fireExpertsServiceImpl.saveBatch(excelEntityList);
} }
...@@ -729,7 +763,8 @@ public class ExcelServiceImpl { ...@@ -729,7 +763,8 @@ public class ExcelServiceImpl {
if (fileName == null) { if (fileName == null) {
throw new Exception("文件不存在!"); throw new Exception("文件不存在!");
} }
if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue()) && !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) { if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue())
&& !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) {
throw new Exception("文件类型异常!"); throw new Exception("文件类型异常!");
} }
InputStream input = multipartFile.getInputStream(); InputStream input = multipartFile.getInputStream();
...@@ -737,7 +772,7 @@ public class ExcelServiceImpl { ...@@ -737,7 +772,7 @@ public class ExcelServiceImpl {
XSSFSheet sheet = workbook.getSheetAt(0); XSSFSheet sheet = workbook.getSheetAt(0);
List<Map<String, Object>> dataList = new ArrayList<>(); List<Map<String, Object>> dataList = new ArrayList<>();
if (sheet != null) { if (sheet != null) {
//获取表头月份 // 获取表头月份
Row titleRow = sheet.getRow(0); Row titleRow = sheet.getRow(0);
Cell monthCell = titleRow.getCell(5); Cell monthCell = titleRow.getCell(5);
String dateStr = monthCell == null ? "" : monthCell.toString(); String dateStr = monthCell == null ? "" : monthCell.toString();
...@@ -754,10 +789,10 @@ public class ExcelServiceImpl { ...@@ -754,10 +789,10 @@ public class ExcelServiceImpl {
} }
private void initDutyCarData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) { private void initDutyCarData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) {
//遍历行,i = 1,从第二行开始,第一行是表头跳过。 // 遍历行,i = 1,从第二行开始,第一行是表头跳过。
for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) {
DutyCarDto dutyCarDto = new DutyCarDto(); DutyCarDto dutyCarDto = new DutyCarDto();
//row是一行数据,row.getCell(i),代表拿到这一行,第i列数据 // row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row row = sheet.getRow(i); Row row = sheet.getRow(i);
if (row == null) { if (row == null) {
continue; continue;
...@@ -804,10 +839,10 @@ public class ExcelServiceImpl { ...@@ -804,10 +839,10 @@ public class ExcelServiceImpl {
} }
private void initDutyPersonData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) { private void initDutyPersonData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) {
//遍历行,i = 1,从第二行开始,第一行是表头跳过。 // 遍历行,i = 1,从第二行开始,第一行是表头跳过。
for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) { for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) {
DutyPersonDto dutyPersonDto = new DutyPersonDto(); DutyPersonDto dutyPersonDto = new DutyPersonDto();
//row是一行数据,row.getCell(i),代表拿到这一行,第i列数据 // row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row row = sheet.getRow(i); Row row = sheet.getRow(i);
if (row == null) { if (row == null) {
continue; continue;
...@@ -852,8 +887,8 @@ public class ExcelServiceImpl { ...@@ -852,8 +887,8 @@ public class ExcelServiceImpl {
private void excelImportMaintenancePerson(MultipartFile multipartFile) throws Exception { private void excelImportMaintenancePerson(MultipartFile multipartFile) throws Exception {
List<MaintenancePersonExcleDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<MaintenancePersonExcleDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
MaintenancePersonExcleDto.class, 1); MaintenancePersonExcleDto.class, 1);
List<DynamicFormColumn> columns = List<DynamicFormColumn> columns = dynamicFormColumnService.list(
dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, MAINTENANCE_PERSON)); new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, MAINTENANCE_PERSON));
List<MaintenanceCompany> maintenanceCompanyList = new ArrayList<MaintenanceCompany>(); List<MaintenanceCompany> maintenanceCompanyList = new ArrayList<MaintenanceCompany>();
List<DynamicFormInstance> dynamicFormInstanceList = new ArrayList<DynamicFormInstance>(); List<DynamicFormInstance> dynamicFormInstanceList = new ArrayList<DynamicFormInstance>();
for (MaintenancePersonExcleDto maintenancePersonExcleDto : excelDtoList) { for (MaintenancePersonExcleDto maintenancePersonExcleDto : excelDtoList) {
...@@ -861,6 +896,7 @@ public class ExcelServiceImpl { ...@@ -861,6 +896,7 @@ public class ExcelServiceImpl {
// 先填充主表的属性 // 先填充主表的属性
MaintenanceCompany maintenanceCompany = new MaintenanceCompany(); MaintenanceCompany maintenanceCompany = new MaintenanceCompany();
maintenanceCompany = Bean.toPo(maintenancePersonExcleDto, maintenanceCompany); maintenanceCompany = Bean.toPo(maintenancePersonExcleDto, maintenanceCompany);
maintenanceCompany = Bean.toPo(getCurrentInfo(),maintenanceCompany);
maintenanceCompany.setType(PERSON); maintenanceCompany.setType(PERSON);
if (maintenanceCompany.getParentId() != null) { if (maintenanceCompany.getParentId() != null) {
long getParentId = Long.valueOf(maintenancePersonExcleDto.getParentName().split("@")[1]); long getParentId = Long.valueOf(maintenancePersonExcleDto.getParentName().split("@")[1]);
...@@ -882,18 +918,10 @@ public class ExcelServiceImpl { ...@@ -882,18 +918,10 @@ public class ExcelServiceImpl {
} }
private void excelImportKeySite(MultipartFile multipartFile) throws Exception { private void excelImportKeySite(MultipartFile multipartFile) throws Exception {
List<KeySiteExcleDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<KeySiteExcleDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, KeySiteExcleDto.class, 1);
KeySiteExcleDto.class, 1);
keySiteService.saveExcel(excelDtoList); keySiteService.saveExcel(excelDtoList);
} }
public void dutyTemplateExport(HttpServletResponse response, String beginDate, String endDate, ExcelDto excelDto, public void dutyTemplateExport(HttpServletResponse response, String beginDate, String endDate, ExcelDto excelDto,
String ids) { String ids) {
List<List<Object>> data = new ArrayList<>(); List<List<Object>> data = new ArrayList<>();
...@@ -903,17 +931,16 @@ public class ExcelServiceImpl { ...@@ -903,17 +931,16 @@ public class ExcelServiceImpl {
data = initDutyPersonTemplate(ids); data = initDutyPersonTemplate(ids);
} }
// 获取日期 // 获取日期
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
endDate);
List<String> dayByMonth = new ArrayList<>(); List<String> dayByMonth = new ArrayList<>();
rangeDate.forEach(item -> dayByMonth.add((String) item.get("date"))); rangeDate.forEach(item -> dayByMonth.add((String) item.get("date")));
exportDutyTemplate(response, excelDto.getClassUrl(), dayByMonth, excelDto, data, true); exportDutyTemplate(response, excelDto.getClassUrl(), dayByMonth, excelDto, data, true);
} }
public void dutyInfoExport(HttpServletResponse response, String beginDate, String endDate, ExcelDto excelDto) throws ParseException { public void dutyInfoExport(HttpServletResponse response, String beginDate, String endDate, ExcelDto excelDto)
throws ParseException {
// 获取日期 // 获取日期
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
endDate);
List<String> dayByMonth = new ArrayList<>(); List<String> dayByMonth = new ArrayList<>();
rangeDate.forEach(item -> dayByMonth.add((String) item.get("date"))); rangeDate.forEach(item -> dayByMonth.add((String) item.get("date")));
List<List<Object>> data = new ArrayList<>(); List<List<Object>> data = new ArrayList<>();
...@@ -983,14 +1010,16 @@ public class ExcelServiceImpl { ...@@ -983,14 +1010,16 @@ public class ExcelServiceImpl {
return data; return data;
} }
private void exportDutyTemplate(HttpServletResponse response, String classUrl, List<String> dayByMonth, private void exportDutyTemplate(HttpServletResponse response, String classUrl, List<String> dayByMonth,
ExcelDto excelDto, List<? extends Object> data, Boolean flag) { ExcelDto excelDto, List<? extends Object> data, Boolean flag) {
try { try {
// 获取排班类型 // 获取排班类型
String[] dutyNameList = getDutyNameList(); String[] dutyNameList = getDutyNameList();
Class<?> clz = Class.forName(classUrl); Class<?> clz = Class.forName(classUrl);
ExcelUtil.createDutyTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), data, ExcelUtil.createDutyTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), data, clz,
clz, dayByMonth, dutyNameList, dataSourcesImpl, flag); dayByMonth, dutyNameList, dataSourcesImpl, flag);
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -1003,7 +1032,8 @@ public class ExcelServiceImpl { ...@@ -1003,7 +1032,8 @@ public class ExcelServiceImpl {
return dutyShiftList.toArray(new String[dutyShiftList.size()]); return dutyShiftList.toArray(new String[dutyShiftList.size()]);
} }
private List<List<Object>> initDutyCarInfo(String beginDate, String endDate, List<String> dayByMonth) throws ParseException { private List<List<Object>> initDutyCarInfo(String beginDate, String endDate, List<String> dayByMonth)
throws ParseException {
// 查询已值班数据 // 查询已值班数据
List<DutyCarDto> contentList = dutyCarService.downloadList(beginDate, endDate); List<DutyCarDto> contentList = dutyCarService.downloadList(beginDate, endDate);
List<List<Object>> data = new ArrayList<>(); List<List<Object>> data = new ArrayList<>();
...@@ -1041,7 +1071,8 @@ public class ExcelServiceImpl { ...@@ -1041,7 +1071,8 @@ public class ExcelServiceImpl {
} }
} }
private List<List<Object>> initDutyPersonInfo(String beginDate, String endDate, List<String> dayByMonth) throws ParseException { private List<List<Object>> initDutyPersonInfo(String beginDate, String endDate, List<String> dayByMonth)
throws ParseException {
// 查询已值班数据 // 查询已值班数据
List<DutyPersonDto> contentList = iDutyPersonService.downloadList(beginDate, endDate); List<DutyPersonDto> contentList = iDutyPersonService.downloadList(beginDate, endDate);
List<List<Object>> data = new ArrayList<>(); List<List<Object>> data = new ArrayList<>();
...@@ -1065,8 +1096,6 @@ public class ExcelServiceImpl { ...@@ -1065,8 +1096,6 @@ public class ExcelServiceImpl {
return data; return data;
} }
public void exportByParams(HttpServletResponse response, ExcelDto excelDto, String params) { public void exportByParams(HttpServletResponse response, ExcelDto excelDto, String params) {
switch (excelDto.getType()) { switch (excelDto.getType()) {
...@@ -1077,18 +1106,18 @@ public class ExcelServiceImpl { ...@@ -1077,18 +1106,18 @@ public class ExcelServiceImpl {
break; break;
case "XFZJ": case "XFZJ":
List<FireExpertsDto> fireExpertsDtoList = fireExpertsServiceImpl.queryForFireExpertsList(false); List<FireExpertsDto> fireExpertsDtoList = fireExpertsServiceImpl.queryForFireExpertsList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireExpertsDtoList,
fireExpertsDtoList, FireExpertsDto.class, dataSourcesImpl, false); FireExpertsDto.class, dataSourcesImpl, false);
break; break;
case "SYXX": case "SYXX":
List<WaterResourceDto> waterResourceDtoList = waterResourceServiceImpl.exportToExcel(true); List<WaterResourceDto> waterResourceDtoList = waterResourceServiceImpl.exportToExcel(true);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), waterResourceDtoList,
waterResourceDtoList, WaterResourceDto.class, dataSourcesImpl, false); WaterResourceDto.class, dataSourcesImpl, false);
break; break;
case "HKQ": case "HKQ":
List<AircraftDto> aircraftDtoList = aircraftServiceImpl.queryAircraftDtoForList(false); List<AircraftDto> aircraftDtoList = aircraftServiceImpl.queryAircraftDtoForList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), aircraftDtoList,
aircraftDtoList, AircraftDto.class, dataSourcesImpl, false); AircraftDto.class, dataSourcesImpl, false);
break; break;
case "XFDW": case "XFDW":
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false); List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false);
...@@ -1097,8 +1126,8 @@ public class ExcelServiceImpl { ...@@ -1097,8 +1126,8 @@ public class ExcelServiceImpl {
break; break;
case "WXXFZ": case "WXXFZ":
List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false); List<FireStationDto> fireStationDtoList = fireStationService.queryForFireStationList(false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireStationDtoList,
fireStationDtoList, FireStationDto.class, null, false); FireStationDto.class, null, false);
break; break;
case "XFRY": case "XFRY":
List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false); List<FirefightersExcelDto> firefightersExcelDtoList = firefightersService.exportToExcel(false);
...@@ -1106,15 +1135,15 @@ public class ExcelServiceImpl { ...@@ -1106,15 +1135,15 @@ public class ExcelServiceImpl {
firefightersExcelDtoList, FirefightersExcelDto.class, null, false); firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
break; break;
case "WBRY": case "WBRY":
List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList = List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList = maintenanceCompanyService
maintenanceCompanyService.exportToMaintenancePersonExcel(); .exportToMaintenancePersonExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false); maintenancePersonExcelDtoList, MaintenancePersonExcleDto.class, null, false);
break; break;
case "KEYSITE": case "KEYSITE":
List<KeySiteExcleDto> keySiteDtoList = keySiteService.exportToExcel(); List<KeySiteExcleDto> keySiteDtoList = keySiteService.exportToExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), keySiteDtoList,
keySiteDtoList, KeySiteExcleDto.class, null, false); KeySiteExcleDto.class, null, false);
break; break;
case "JCDWRY": case "JCDWRY":
// 机场单位人员参数传递为 parentId = xxxxxxx // 机场单位人员参数传递为 parentId = xxxxxxx
...@@ -1126,17 +1155,30 @@ public class ExcelServiceImpl { ...@@ -1126,17 +1155,30 @@ public class ExcelServiceImpl {
throw new BadRequest("导出机场单位时未传递正确parentId"); throw new BadRequest("导出机场单位时未传递正确parentId");
} }
List<OrgUsrExcelDto> orgUsrList = orgUsrService.exportPersonToExcelByParentId(parentId); List<OrgUsrExcelDto> orgUsrList = orgUsrService.exportPersonToExcelByParentId(parentId);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), orgUsrList,
orgUsrList, OrgUsrExcelDto.class, null, false); OrgUsrExcelDto.class, null, false);
break; break;
case "LDDW": case "LDDW":
List<LinkageUnitDto> LinkageUnitDtoList = linkageUnitServiceImpl.exportToExcel(); List<LinkageUnitDto> LinkageUnitDtoList = linkageUnitServiceImpl.exportToExcel();
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), LinkageUnitDtoList,
LinkageUnitDtoList, LinkageUnitDto.class, null, false); LinkageUnitDto.class, null, false);
break; break;
default: default:
break; break;
} }
} }
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;
}
} }
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 ...@@ -200,8 +200,8 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
if(fireTeam.getAddress()!=null){ if(fireTeam.getAddress()!=null){
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(fireTeam.getAddress()); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(fireTeam.getAddress());
fireTeam.setAddress(address.getString(BizConstant.ADDRESS)); fireTeam.setAddress(address.getString(BizConstant.ADDRESS));
fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE))); // fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE))); // fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
} }
if (ValidationUtil.isEmpty(fireTeam.getParent())) { if (ValidationUtil.isEmpty(fireTeam.getParent())) {
fireTeam.setTreeCode(TreeParser.genTreeCode()); 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; ...@@ -6,11 +6,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; 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.dto.FireBrigadeResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; 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.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.CarStatusInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCarCountDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCarCountDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCompanyCountDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCompanyCountDto;
...@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer; ...@@ -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.PowerTransferCompany;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources; 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.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.DutyInfoEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
...@@ -42,7 +43,6 @@ import org.springframework.stereotype.Service; ...@@ -42,7 +43,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper; 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.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -98,7 +98,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -98,7 +98,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
private String topic; private String topic;
@Autowired @Autowired
private DutyShiftServiceImpl dutyShiftServiceImpl; private DutyCarServiceImpl dutyCarService;
@Override @Override
public PowerTransferSimpleDto getPowerTransferList(Long alertCalledId) { public PowerTransferSimpleDto getPowerTransferList(Long alertCalledId) {
...@@ -464,51 +464,92 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -464,51 +464,92 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
IPage<PowerTransferResourceDto> carResourcePage = IPage<PowerTransferResourceDto> carResourcePage =
powerTransferMapper.getPowerTransferCarResource(new Page<>(1L, Long.MAX_VALUE), powerTransferMapper.getPowerTransferCarResource(new Page<>(1L, Long.MAX_VALUE),
alertCalledId); alertCalledId);
// 调派的车辆id // 调派的车辆id列表
List<Long> carIdList = Lists.transform(carResourcePage.getRecords(), PowerTransferResourceDto::getSequenceNbr); List<Long> carIdList = Lists.transform(carResourcePage.getRecords(), PowerTransferResourceDto::getSequenceNbr);
// 调派的车辆信息列表 // 调派的车辆信息列表
List<Map<String, Object>> totalCarList = List<Map<String, Object>> totalCarList =
carList.stream().filter(c -> carIdList.contains(c.get("id"))).collect(Collectors.toList()); carList.stream().filter(c -> carIdList.contains(Long.valueOf((String) c.get("id")))).collect(Collectors.toList());
// TODO 车辆枚举后期修改为已到达状态 // TODO 车辆枚举后期修改为已到达状态车辆
List<Map<String, Object>> arrivedCarList = 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()); "carState"))).collect(Collectors.toList());
// 车辆统计 // 调派-已到达车辆id列表
Long carTotal = carResourcePage.getTotal(); 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(); 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(); JSONObject car = new JSONObject();
car.put("total", carTotal); car.put("total", carTotal);
car.put("count", arrivedCarList.size()); car.put("count", arrivedCarList.size());
car.put("percent", arrivedCarList.size() / carTotal); resourceStatistics.put(jsoKey, car);
resourceStatistics.put("car", 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(); JSONObject person = new JSONObject();
person.put("total", carTotal); person.put("total", allTransferDutyPerson.size());
person.put("count", arrivedCarList.size()); person.put("count", allArrivedTransferDutyPerson.size());
person.put("percent", arrivedCarList.size() / carTotal);
resourceStatistics.put("person", person); resourceStatistics.put("person", person);
// TODO 车载器材统计 }
JSONObject equip = new JSONObject();
equip.put("total", carTotal); public void fireAgentOnCarCount(List<Map<String, Object>> totalCarList, List<Map<String, Object>> arrivedCarList,
equip.put("count", arrivedCarList.size()); JSONObject resourceStatistics, String equipType, String jsonKey) {
equip.put("percent", arrivedCarList.size() / carTotal); double agentCountAll = totalCarList.stream().mapToDouble(car -> ((List<Map<String, Object>>) car.get(
resourceStatistics.put("equip", equip); "resourceList")).stream().filter(res -> equipType.equals(res.get(
// TODO 车载水量统计 "equipType"))).mapToDouble(c -> (double) c.get("equipCount")).sum()).sum();
JSONObject water = new JSONObject(); double agentCountArrived = arrivedCarList.stream().mapToDouble(car -> ((List<Map<String, Object>>) car.get(
water.put("total", carTotal); "resourceList")).stream().filter(res -> equipType.equals(res.get(
water.put("count", arrivedCarList.size()); "equipType"))).mapToDouble(c -> (double) c.get("equipCount")).sum()).sum();
water.put("percent", arrivedCarList.size() / carTotal); JSONObject jsonObject = new JSONObject();
resourceStatistics.put("water", water); jsonObject.put("total", agentCountAll);
// TODO 车载药剂统计 jsonObject.put("count", agentCountArrived);
JSONObject medicament = new JSONObject(); resourceStatistics.put(jsonKey, jsonObject);
medicament.put("total", carTotal); }
medicament.put("count", arrivedCarList.size());
medicament.put("percent", arrivedCarList.size() / carTotal); @Override
resourceStatistics.put("medicament", medicament); public List<Map<String, String>> getFireCarStatusList() {
return resourceStatistics; 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; ...@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; 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.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -52,6 +54,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -52,6 +54,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "创建无码无计划隐患", notes = "创建无码无计划隐患") @ApiOperation(value = "创建无码无计划隐患", notes = "创建无码无计划隐患")
@PostMapping(value = "/normal/save") @PostMapping(value = "/normal/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) { public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) {
CommonResponse commonResponse = new CommonResponse(); CommonResponse commonResponse = new CommonResponse();
try { try {
...@@ -80,6 +83,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -80,6 +83,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "创建巡检隐患", notes = "创建巡检隐患") @ApiOperation(value = "创建巡检隐患", notes = "创建巡检隐患")
@PostMapping(value = "/patrol/save") @PostMapping(value = "/patrol/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse savePatrol(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerPatrolParam latentDangerPatrolParam) { public CommonResponse savePatrol(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerPatrolParam latentDangerPatrolParam) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -102,6 +106,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -102,6 +106,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患列表", notes = "隐患列表") @ApiOperation(value = "隐患列表", notes = "隐患列表")
@PostMapping(value = "/list") @PostMapping(value = "/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse list(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerListParam latentDangerListParam) { public CommonResponse list(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerListParam latentDangerListParam) {
Date startDate = new Date(); Date startDate = new Date();
try { try {
...@@ -124,6 +129,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -124,6 +129,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患详情", notes = "隐患详情") @ApiOperation(value = "隐患详情", notes = "隐患详情")
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse detail(@ApiParam(value = "任务Id", required = true) @RequestParam String id, public CommonResponse detail(@ApiParam(value = "任务Id", required = true) @RequestParam String id,
@ApiParam(value = "是否完成", required = true) @RequestParam boolean isFinish) { @ApiParam(value = "是否完成", required = true) @RequestParam boolean isFinish) {
try { try {
...@@ -140,6 +146,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -140,6 +146,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患执行记录", notes = "隐患执行记录") @ApiOperation(value = "隐患执行记录", notes = "隐患执行记录")
@GetMapping(value = "/listFlowRecord") @GetMapping(value = "/listFlowRecord")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listFlowRecord(@ApiParam(value = "隐患编号", required = true) @RequestParam Long id) { public CommonResponse listFlowRecord(@ApiParam(value = "隐患编号", required = true) @RequestParam Long id) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -155,6 +162,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -155,6 +162,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "流程执行", notes = "流程执行") @ApiOperation(value = "流程执行", notes = "流程执行")
@PostMapping(value = "/excute") @PostMapping(value = "/excute")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse excute(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerExcuteParam latentDangerExcuteParam) { public CommonResponse excute(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerExcuteParam latentDangerExcuteParam) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -186,6 +194,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -186,6 +194,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "根据流程实例编号获取隐患信息", notes = "根据流程实例编号获取隐患信息") @ApiOperation(value = "根据流程实例编号获取隐患信息", notes = "根据流程实例编号获取隐患信息")
@GetMapping(value = "/getByInstanceId") @GetMapping(value = "/getByInstanceId")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getByInstanceId(@ApiParam(value = "流程实例编号", required = true) @RequestParam String instanceId) { public CommonResponse getByInstanceId(@ApiParam(value = "流程实例编号", required = true) @RequestParam String instanceId) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -201,6 +210,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -201,6 +210,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患按错计划流程执行回调", notes = "隐患按错计划流程执行回调") @ApiOperation(value = "隐患按错计划流程执行回调", notes = "隐患按错计划流程执行回调")
@PostMapping(value = "/plan/flow/excuteCallBack") @PostMapping(value = "/plan/flow/excuteCallBack")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse excuteCallBack(@ApiParam(value = "隐患按错计划流程执行回调对象") @RequestBody JSONObject json) { public CommonResponse excuteCallBack(@ApiParam(value = "隐患按错计划流程执行回调对象") @RequestBody JSONObject json) {
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -231,6 +241,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -231,6 +241,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "获取隐患等级", notes = "获取隐患等级") @ApiOperation(value = "获取隐患等级", notes = "获取隐患等级")
@GetMapping(value = "/dangerLevel") @GetMapping(value = "/dangerLevel")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getDangerLevel() { public CommonResponse getDangerLevel() {
return CommonResponseUtil.success(iLatentDangerService.getDangerLevel(getToken(), getProduct(), getAppKey(), DictTypeEnum.DANGERLEVEL.getCode())); return CommonResponseUtil.success(iLatentDangerService.getDangerLevel(getToken(), getProduct(), getAppKey(), DictTypeEnum.DANGERLEVEL.getCode()));
} }
...@@ -246,6 +257,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -246,6 +257,7 @@ public class LatentDangerController extends AbstractBaseController {
*/ */
@ApiOperation(value = "隐患清单", notes = "隐患清单") @ApiOperation(value = "隐患清单", notes = "隐患清单")
@PostMapping(value = "/page/list") @PostMapping(value = "/page/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) { public CommonResponse listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) { if (ObjectUtils.isEmpty(user)) {
...@@ -260,6 +272,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -260,6 +272,7 @@ public class LatentDangerController extends AbstractBaseController {
*/ */
@ApiOperation(value = "导出隐患清单", notes = "导出隐患清单") @ApiOperation(value = "导出隐患清单", notes = "导出隐患清单")
@PostMapping(value = "/export") @PostMapping(value = "/export")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public void exportDangerList(@ApiParam(value = "查询条件") @RequestBody PageParam pageParam, public void exportDangerList(@ApiParam(value = "查询条件") @RequestBody PageParam pageParam,
HttpServletResponse response) { HttpServletResponse response) {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -286,6 +299,7 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -286,6 +299,7 @@ public class LatentDangerController extends AbstractBaseController {
*/ */
@ApiOperation(value = "隐患日志", notes = "查询隐患节点信息") @ApiOperation(value = "隐患日志", notes = "查询隐患节点信息")
@GetMapping(value = "/listDangerTimeAxis") @GetMapping(value = "/listDangerTimeAxis")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listTimeAxis(@ApiParam(value = "时间") @RequestParam(required = false) Integer dateTime) { public CommonResponse listTimeAxis(@ApiParam(value = "时间") @RequestParam(required = false) Integer dateTime) {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) { if (ObjectUtils.isEmpty(user)) {
......
...@@ -32,6 +32,8 @@ import org.springframework.data.domain.Page; ...@@ -32,6 +32,8 @@ import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; 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.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -206,6 +208,8 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -206,6 +208,8 @@ public class PlanTaskController extends AbstractBaseController {
@RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse pushCarData() { public CommonResponse pushCarData() {
try { try {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskExecution(null); planTaskService.taskExecution(null);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -802,7 +802,9 @@ public class TaskController extends AbstractBaseController{ ...@@ -802,7 +802,9 @@ public class TaskController extends AbstractBaseController{
String userIds=""; String userIds="";
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
list.forEach(s -> { list.forEach(s -> {
if(!ObjectUtils.isEmpty(s)){
set.add(s.getName()); set.add(s.getName());
}
}); });
List<String> list1 = new ArrayList<>(set); List<String> list1 = new ArrayList<>(set);
......
...@@ -42,6 +42,8 @@ public class PushMsgParam { ...@@ -42,6 +42,8 @@ public class PushMsgParam {
*/ */
private String type = "3"; private String type = "3";
private String relationId;
public String getType() { public String getType() {
return type; return type;
} }
...@@ -91,4 +93,12 @@ public class PushMsgParam { ...@@ -91,4 +93,12 @@ public class PushMsgParam {
this.emails = 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 ...@@ -176,7 +176,7 @@ public Page<HashMap<String, Object>> getCatalogTreeInfo(String toke,String produ
String userIds = ""; String userIds = "";
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
content.forEach(s -> { content.forEach(s -> {
if (s.containsKey("createBy")) { if (s.containsKey("createBy") && !ObjectUtils.isEmpty(s.get("createBy"))) {
set.add(s.get("createBy").toString()); set.add(s.get("createBy").toString());
} }
}); });
......
...@@ -161,7 +161,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -161,7 +161,7 @@ public class CheckServiceImpl implements ICheckService {
deptIds.remove(null); deptIds.remove(null);
String joinUserId=""; String joinUserId="";
for (String userId:userIds) { for (String userId:userIds) {
if(userId!=null&&!userId.trim().equals("")){ if(!ObjectUtils.isEmpty(userId)){
joinUserId=joinUserId+userId+","; joinUserId=joinUserId+userId+",";
} }
} }
...@@ -808,7 +808,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -808,7 +808,7 @@ public class CheckServiceImpl implements ICheckService {
deptIds.remove(null); deptIds.remove(null);
String joinUserId=""; String joinUserId="";
for (String userId:userIds) { for (String userId:userIds) {
if(userId!=null&&!userId.trim().equals("")){ if(!ObjectUtils.isEmpty(userId)){
joinUserId=joinUserId+userId+","; joinUserId=joinUserId+userId+",";
} }
} }
...@@ -1194,8 +1194,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1194,8 +1194,9 @@ public class CheckServiceImpl implements ICheckService {
//处理用户信息 //处理用户信息
String userIds=""; String userIds="";
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
if(!ObjectUtils.isEmpty(checkDetailBo.getCheckUserName())){
set.add(checkDetailBo.getCheckUserName()); set.add(checkDetailBo.getCheckUserName());
}
List<String> list1 = new ArrayList<>(set); List<String> list1 = new ArrayList<>(set);
userIds = String.join(",", list1); userIds = String.join(",", list1);
List<AgencyUserModel> listd=remoteSecurityService.listUserByUserIds( toke,product,appKey,userIds); List<AgencyUserModel> listd=remoteSecurityService.listUserByUserIds( toke,product,appKey,userIds);
...@@ -1315,7 +1316,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1315,7 +1316,9 @@ public class CheckServiceImpl implements ICheckService {
if (!CollectionUtils.isEmpty(content)) { if (!CollectionUtils.isEmpty(content)) {
Set<String> userIds =new HashSet<>(); Set<String> userIds =new HashSet<>();
content.forEach(e -> { content.forEach(e -> {
if(!ObjectUtils.isEmpty(e.get("userID"))){
userIds.add(e.get("userID")+""); userIds.add(e.get("userID")+"");
}
}); });
List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds( toke, product, appKey,Joiner.on(",").join(userIds)); List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds( toke, product, appKey,Joiner.on(",").join(userIds));
Map<String, String> userModelMap = new HashMap<String,String>(); Map<String, String> userModelMap = new HashMap<String,String>();
...@@ -1512,7 +1515,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1512,7 +1515,9 @@ public class CheckServiceImpl implements ICheckService {
String userIds=""; String userIds="";
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
checkAnalysisVos.forEach(s -> { checkAnalysisVos.forEach(s -> {
if(!ObjectUtils.isEmpty(s.getName())){
set.add(s.getName()); set.add(s.getName());
}
}); });
List<String> list1 = new ArrayList<>(set); List<String> list1 = new ArrayList<>(set);
userIds = String.join(",", list1); userIds = String.join(",", list1);
......
...@@ -147,8 +147,16 @@ public class MessageServiceImpl implements IMessageService { ...@@ -147,8 +147,16 @@ public class MessageServiceImpl implements IMessageService {
} }
} }
//获取需要推送的app的用户 //获取需要推送的app的用户 手机端暂时无订阅功能,暂时屏蔽
List<PushTargetBo> jpushUser = msgMapper.getPushUserBo("app", String.join(",", needUserIds), checkMsgBo.getRouteId(),getAppPushConfig(checkMsgBo.getStatus())); // 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的用户 //获取需要推送的email的用户
List<PushTargetBo> emailUser = msgMapper.getPushUserBo("email", String.join(",", needUserIds), checkMsgBo.getRouteId(),getEmailPushConfig(checkMsgBo.getStatus())); List<PushTargetBo> emailUser = msgMapper.getPushUserBo("email", String.join(",", needUserIds), checkMsgBo.getRouteId(),getEmailPushConfig(checkMsgBo.getStatus()));
...@@ -157,7 +165,9 @@ public class MessageServiceImpl implements IMessageService { ...@@ -157,7 +165,9 @@ public class MessageServiceImpl implements IMessageService {
List<PushTargetBo> tempList = new ArrayList<>(); List<PushTargetBo> tempList = new ArrayList<>();
tempList.addAll(jpushUser); tempList.addAll(jpushUser);
tempList.addAll(emailUser); 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)); List<AgencyUserModel> agencyUserModelList=remoteSecurityService.listUserByUserIds( toke,product,appKey,String.join(",", userIds));
try { try {
pushAppMsg(jpushUser,agencyUserModelList,pushMsgParam,checkMsgBo, toke, product, appKey); pushAppMsg(jpushUser,agencyUserModelList,pushMsgParam,checkMsgBo, toke, product, appKey);
...@@ -223,8 +233,8 @@ public class MessageServiceImpl implements IMessageService { ...@@ -223,8 +233,8 @@ public class MessageServiceImpl implements IMessageService {
} }
List<String> pushApps = jpushUser.stream() List<String> pushApps = jpushUser.stream()
.filter(bo->StringUtil.isNotEmpty(bo.getUsername())) .filter(bo->StringUtil.isNotEmpty(bo.getUserId()))
.map(PushTargetBo::getUsername).collect(Collectors.toList()); .map(PushTargetBo::getUserId).collect(Collectors.toList());
pushApps = pushApps.stream().distinct().collect(Collectors.toList()); pushApps = pushApps.stream().distinct().collect(Collectors.toList());
if(!pushApps.isEmpty()){ if(!pushApps.isEmpty()){
List<PushMsgParam> pmps = new ArrayList<PushMsgParam>(); List<PushMsgParam> pmps = new ArrayList<PushMsgParam>();
...@@ -234,6 +244,7 @@ public class MessageServiceImpl implements IMessageService { ...@@ -234,6 +244,7 @@ public class MessageServiceImpl implements IMessageService {
extras.put("type",MsgTypeEnum.CHECK.getCode()); extras.put("type",MsgTypeEnum.CHECK.getCode());
extras.put("id",checkMsgBo.getCheckId()+""); extras.put("id",checkMsgBo.getCheckId()+"");
pushMsgParam.setExtras(extras); pushMsgParam.setExtras(extras);
pushMsgParam.setRelationId(checkMsgBo.getCheckId()+"");
pmps.add(pushMsgParam); pmps.add(pushMsgParam);
List<Msg> msgList =createMsg(jpushUser,checkMsgBo); List<Msg> msgList =createMsg(jpushUser,checkMsgBo);
pushFeignServer.sendMessage( toke, product, appKey,pmps); pushFeignServer.sendMessage( toke, product, appKey,pmps);
...@@ -302,13 +313,14 @@ public class MessageServiceImpl implements IMessageService { ...@@ -302,13 +313,14 @@ public class MessageServiceImpl implements IMessageService {
} }
@Override @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>(); List<PushMsgParam> pmps = new ArrayList<PushMsgParam>();
PushMsgParam pushMsg = new 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.setContent(ObjectUtils.isEmpty(msg.getPushBody()) ? msg.getBody() : msg.getPushBody());
pushMsg.setSubject(msg.getTitle()); pushMsg.setSubject(msg.getTitle());
pushMsg.setType(JPushTypeEnum.ALIAS.getCode()); pushMsg.setType(JPushTypeEnum.ALIAS.getCode());
pushMsg.setRelationId(msg.getRelationId()==null?"0":msg.getRelationId().toString());
Map<String, String> extras = new HashMap<String, String>(); Map<String, String> extras = new HashMap<String, String>();
extras.put("type",msg.getMsgType()); extras.put("type",msg.getMsgType());
extras.put("id",msg.getRelationId()==null?"0":msg.getRelationId().toString()); extras.put("id",msg.getRelationId()==null?"0":msg.getRelationId().toString());
...@@ -350,7 +362,7 @@ public class MessageServiceImpl implements IMessageService { ...@@ -350,7 +362,7 @@ public class MessageServiceImpl implements IMessageService {
msg.setUserId(user.getUserId()); msg.setUserId(user.getUserId());
msg.setReciverName(user.getRealName()); msg.setReciverName(user.getRealName());
if (isImmediately) { //立即发送 if (isImmediately) { //立即发送
msg = pushMsg( toke, product, appKey,msg); msg = pushMsgAndSave( toke, product, appKey,msg);
} else { //定时发送 } else { //定时发送
msg.setStatus(0); msg.setStatus(0);
msg.setFixedTime(notice.getFixedTime()); msg.setFixedTime(notice.getFixedTime());
...@@ -414,9 +426,17 @@ public class MessageServiceImpl implements IMessageService { ...@@ -414,9 +426,17 @@ public class MessageServiceImpl implements IMessageService {
msg.setTargetTel(userNames); msg.setTargetTel(userNames);
msg.setUserId(userIds); msg.setUserId(userIds);
msg.setIsImmediately(isImmediately); 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; ...@@ -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.MsgInfoPageParam;
import com.yeejoin.amos.patrol.business.param.NoticePublishParam; 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.business.vo.MsgVo;
import com.yeejoin.amos.patrol.dao.entity.Check; import com.yeejoin.amos.patrol.dao.entity.Check;
import com.yeejoin.amos.patrol.dao.entity.Msg; import com.yeejoin.amos.patrol.dao.entity.Msg;
...@@ -48,6 +49,8 @@ public interface IMessageService { ...@@ -48,6 +49,8 @@ public interface IMessageService {
* 消息公告推送 * 消息公告推送
* @param msg * @param msg
*/ */
public Msg pushMsg(String toke,String product,String appKey,Msg msg); public Msg pushMsgAndSave(String toke,String product,String appKey,Msg msg);
public void pushMsg(String toke,String product,String appKey,PushMsgParam pmsg);
} }
...@@ -66,36 +66,6 @@ public class AsyncTask { ...@@ -66,36 +66,6 @@ public class AsyncTask {
private static final String TAB = "\r\n"; private static final String TAB = "\r\n";
/**
* 邮件发送
* @param msgResponse
* @return
* @throws InterruptedException
*/
// @Async("asyncTaskExecutor")
// public Future<Boolean> sendEmail(PushMsgParam pmp) throws InterruptedException {
// long start = System.currentTimeMillis();
// iEmailService.sendSimpleEmail(pmp.getEmails(), pmp.getSubject(), pmp.getContent());
// long end = System.currentTimeMillis();
// log.info("=====邮件发送耗时:"+(end-start)+"======");
// return new AsyncResult<Boolean>(true);
// }
//
// /**
// * jpush 推送
// * @param pmps
// * @return
// * @throws InterruptedException
// */
// @Async("asyncTaskExecutor")
// public Future<Boolean> sendJpush(List<PushMsgParam> pmps) throws InterruptedException {
// long start = System.currentTimeMillis();
// appMessagePushService.sendMessage(pmps);
// long end = System.currentTimeMillis();
// //返回true,告诉此任务已完成
// log.info("=====Jpush发送耗时:"+(end-start)+"======");
// return new AsyncResult<Boolean>(true);
// }
/** /**
* 检查消息推送 * 检查消息推送
...@@ -231,6 +201,7 @@ public class AsyncTask { ...@@ -231,6 +201,7 @@ public class AsyncTask {
msg.setIsImmediately(true); msg.setIsImmediately(true);
msg.setSendTime(date); msg.setSendTime(date);
msg.setCreateDate(date); msg.setCreateDate(date);
msg.setTargetTel(user.getString("username"));
msg.setReciverName(user.getString("realName")); msg.setReciverName(user.getString("realName"));
sendUserIds.add(user.getString("userId")); sendUserIds.add(user.getString("userId"));
msgs.add(msg); msgs.add(msg);
...@@ -247,11 +218,12 @@ public class AsyncTask { ...@@ -247,11 +218,12 @@ public class AsyncTask {
pushMsgParam.setContent(body); pushMsgParam.setContent(body);
pushMsgParam.setRecivers(Lists.newArrayList(sendUserIds)); pushMsgParam.setRecivers(Lists.newArrayList(sendUserIds));
pushMsgParam.setSubject(title); pushMsgParam.setSubject(title);
pushMsgParam.setRelationId(String.valueOf(relationId));
pushMsgParam.setType(JPushTypeEnum.ALIAS.getCode()); pushMsgParam.setType(JPushTypeEnum.ALIAS.getCode());
pushMsgParam.setExtras(extras); pushMsgParam.setExtras(extras);
iMsgDao.saveAll(msgs); iMsgDao.saveAll(msgs);
appMessagePushService.sendMessage(pushMsgParam); Toke toke= remoteSecurityService.getServerToken();
// log.info("极光推送成功====>" + sendUserIds); messageService.pushMsg(toke.getToke(),toke.getProduct(),toke.getAppKey(),pushMsgParam);
} }
} }
......
package com.yeejoin.amos.patrol.feign; package com.yeejoin.amos.patrol.feign;
import java.util.List; import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -14,38 +15,57 @@ import com.yeejoin.amos.patrol.business.param.PushMsgParam; ...@@ -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.CommonResponse;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil; import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;
import com.yeejoin.amos.patrol.core.common.response.TaskInfoRespone; 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") @Service("pushFeignServer")
public class PushFeignServer { public class PushFeignServer {
@Autowired // @Autowired
private RestTemplate restTemplate; // private RestTemplate restTemplate;
//
// @Value("${Push.fegin.name}")
// private String RPushFeginName;
// private static String sendMessage = "/api/user/sendMessage";
//
// public String geturls(String url){
// return "http://"+RPushFeginName+url;
// }
// public HttpHeaders getHeader(String toke,String product,String appKey){
// HttpHeaders headers = new HttpHeaders();
// headers.setContentType(MediaType.APPLICATION_JSON);
// headers.set("Content-Type", "application/json");
// headers.set("token", toke);
// headers.set("product",product);
// headers.set("appKey", appKey);
// return headers;
// }
@Value("${Push.fegin.name}") public void sendMessage( String toke,String product,String appKey, List<PushMsgParam> pushMsgParam){
private String RPushFeginName; try {
private static String sendMessage = "/api/user/sendMessage"; pushMsgParam.forEach(action->{
sendJP(action);
public String geturls(String url){ });
return "http://"+RPushFeginName+url; } catch (Exception e) {
e.printStackTrace();
} }
public HttpHeaders getHeader(String toke,String product,String appKey){
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Content-Type", "application/json");
headers.set("token", toke);
headers.set("product",product);
headers.set("appKey", appKey);
return headers;
} }
public CommonResponse sendMessage( String toke,String product,String appKey, List<PushMsgParam> pushMsgParam){ public void sendMessage( String toke,String product,String appKey, PushMsgParam pushMsgParam){
try { try {
HttpEntity httpEntity = new HttpEntity<>(pushMsgParam, getHeader( toke, product, appKey)); sendJP(pushMsgParam);
CommonResponse commonResponse1 = restTemplate.postForObject(geturls(sendMessage),httpEntity, CommonResponse.class);
return commonResponse1;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); 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 { ...@@ -110,17 +110,17 @@ public class AppMessagePushService {
} }
public void sendMessage(PushMsgParam response){ // public void sendMessage(PushMsgParam response){
//
try { // try {
if(null!=response && "true".equals(isPush)){ // if(null!=response && "true".equals(isPush)){
CommonResponse commonResponse = PushFeign.sendMessageone(response); // CommonResponse commonResponse = PushFeign.sendMessageone(response);
} // }
} catch (Exception e) { // } catch (Exception e) {
log.error(e.getMessage(),e); // log.error(e.getMessage(),e);
e.printStackTrace(); // e.printStackTrace();
//
} // }
} // }
} }
...@@ -521,7 +521,7 @@ public class JobService implements IJobService { ...@@ -521,7 +521,7 @@ public class JobService implements IJobService {
if (iMsgDao.existsById(msgId)) { if (iMsgDao.existsById(msgId)) {
Msg msg = iMsgDao.findById(msgId).get(); Msg msg = iMsgDao.findById(msgId).get();
Toke toke= remoteSecurityService.getServerToken(); Toke toke= remoteSecurityService.getServerToken();
messageService.pushMsg(toke.getToke(), toke.getProduct(), toke.getAppKey(),msg); messageService.pushMsgAndSave(toke.getToke(), toke.getProduct(), toke.getAppKey(),msg);
} }
removeJob(jobName); removeJob(jobName);
} }
......
...@@ -95,6 +95,10 @@ ...@@ -95,6 +95,10 @@
<artifactId>spring-boot-starter-mail</artifactId> <artifactId>spring-boot-starter-mail</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
<dependency>
<groupId>cn.jpush.api</groupId> <groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId> <artifactId>jpush-client</artifactId>
</dependency> </dependency>
......
...@@ -7,6 +7,7 @@ import java.util.List; ...@@ -7,6 +7,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; 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.enums.QueryOperatorEnum;
import com.yeejoin.amos.supervision.core.util.StringUtil; import com.yeejoin.amos.supervision.core.util.StringUtil;
import org.springframework.cglib.beans.BeanMap; import org.springframework.cglib.beans.BeanMap;
...@@ -653,4 +654,7 @@ public abstract class AbstractBaseController extends BaseController{ ...@@ -653,4 +654,7 @@ public abstract class AbstractBaseController extends BaseController{
return map; return map;
} }
public ReginParams.PersonIdentity opIdentifyInfo(){
return getSelectedOrgInfo().getPersonIdentity();
}
} }
...@@ -22,6 +22,7 @@ import javax.xml.transform.stream.StreamSource; ...@@ -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.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.core.async.AsyncTask; 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.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil; import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.mqtt.WebMqttComponent; import com.yeejoin.amos.supervision.mqtt.WebMqttComponent;
...@@ -543,19 +544,19 @@ public class CheckController extends AbstractBaseController { ...@@ -543,19 +544,19 @@ public class CheckController extends AbstractBaseController {
@ApiOperation(value = "查询计划执行结果信息", notes = "查询计划执行结果信息") @ApiOperation(value = "查询计划执行结果信息", notes = "查询计划执行结果信息")
@GetMapping(value = "/page/list", produces = "application/json;charset=UTF-8") @GetMapping(value = "/page/list", produces = "application/json;charset=UTF-8")
public ResponseModel getPlanExecuteInfo( 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 = "点id") @RequestParam(value = "pointId", required = false) Long pointId,
@ApiParam(value = "执行状态") @RequestParam(value = "executeState", required = false) String executeState, @ApiParam(value = "执行状态") @RequestParam(value = "executeState", required = false) String executeState,
@ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status, @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 = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) { @ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("planId", planId); map.put("routeId", routeId);
map.put("pointId", pointId); map.put("pointId", pointId);
map.put("executeState", executeState); map.put("executeState", executeState);
map.put("status", status); map.put("status", status);
map.put("companyName", companyName); map.put("teamId", teamId);
CommonPageable pageable = new CommonPageable(pageNumber, pageSize); CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return ResponseHelper.buildResponse(checkService.getPlanExecuteInfo(map, pageable)); return ResponseHelper.buildResponse(checkService.getPlanExecuteInfo(map, pageable));
} }
...@@ -567,13 +568,7 @@ public class CheckController extends AbstractBaseController { ...@@ -567,13 +568,7 @@ public class CheckController extends AbstractBaseController {
return ResponseHelper.buildResponse(checkService.getPlanExecuteStates()); return ResponseHelper.buildResponse(checkService.getPlanExecuteStates());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @PersonIdentify
@ApiOperation(value = "查询计划执行所有单位", notes = "查询计划执行所有单位")
@GetMapping(value = "/search/teams", produces = "application/json;charset=UTF-8")
public ResponseModel getPlanExecuteTeams() {
return ResponseHelper.buildResponse(checkService.getPlanExecuteTeams());
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存检查记录", notes = "保存检查记录") @ApiOperation(value = "保存检查记录", notes = "保存检查记录")
@RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
......
...@@ -10,6 +10,7 @@ import java.util.Map; ...@@ -10,6 +10,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse; 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.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.PlanTaskVo; import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
import com.yeejoin.amos.supervision.business.vo.PointInputItemVo; import com.yeejoin.amos.supervision.business.vo.PointInputItemVo;
...@@ -39,11 +40,6 @@ import com.yeejoin.amos.supervision.business.param.PlanTaskPageParam; ...@@ -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.IPlanTaskService;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService; import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.service.intfc.IRouteService; 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.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest; import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone; import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
...@@ -451,35 +447,35 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -451,35 +447,35 @@ public class PlanTaskController extends AbstractBaseController {
} }
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) // @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)", notes = "根据计划任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)") // @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) // @RequestMapping(value = "/queryPlanTaskById", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById( // public CommonResponse qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @RequestParam(required = true) Long planTaskId) { // @ApiParam(value = "巡检计划任务ID", required = true) @RequestParam(required = true) Long planTaskId) {
try { // try {
Map<String, Object> response = new HashMap<String, Object>(); // Map<String, Object> response = new HashMap<String, Object>();
Map task = planTaskService.queryPlanTaskById(planTaskId); // Map task = planTaskService.queryPlanTaskById(planTaskId);
if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) { // if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) {
return CommonResponseUtil.failure("该计划已刷新,请重新选择!!!"); // return CommonResponseUtil.failure("该计划已刷新,请重新选择!!!");
} // }
List points = planTaskService.getPlanTaskPoints(planTaskId); // List points = planTaskService.getPlanTaskPoints(planTaskId);
//
// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); //// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
// task.put("checkDate", task.get("checkDate").toString()); //// task.put("checkDate", task.get("checkDate").toString());
String[] userIds = task.get("userId").toString().split(","); // String[] userIds = task.get("userId").toString().split(",");
for (String userId : userIds) { // for (String userId : userIds) {
task.put("userId", userId); // task.put("userId", userId);
} // }
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
task.put("checkDate", sdf.format(task.get("checkDate") != null ? sdf.parse(task.get("checkDate").toString()) : new Date())); // task.put("checkDate", sdf.format(task.get("checkDate") != null ? sdf.parse(task.get("checkDate").toString()) : new Date()));
response.put("planTask", task); // response.put("planTask", task);
response.put("points", points); // response.put("points", points);
return CommonResponseUtil.success(response); // return CommonResponseUtil.success(response);
} catch (Exception e) { // } catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage()); // return CommonResponseUtil.failure(e.getMessage());
} // }
//
} // }
/** /**
* 查询任务列表 * 查询任务列表
...@@ -492,10 +488,10 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -492,10 +488,10 @@ public class PlanTaskController extends AbstractBaseController {
@RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel qryLoginUserPlanTask( public ResponseModel qryLoginUserPlanTask(
@ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId, @ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId,
@ApiParam(value = "开始日期") @RequestParam(value = "startTime") String startTime, @ApiParam(value = "开始日期") @RequestParam(value = "startTime", required = false) String startTime,
@ApiParam(value = "结束日期") @RequestParam(value = "endTime") String endTime, @ApiParam(value = "结束日期") @RequestParam(value = "endTime", required = false) String endTime,
@ApiParam(value = "检查状态") @RequestParam(value = "finishStatus", required = false) Integer finishStatus, @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 = "companyId", required = false) String companyId,
@ApiParam(value = "检查人员") @RequestParam(value = "executorId", required = false) Long executorId, @ApiParam(value = "检查人员") @RequestParam(value = "executorId", required = false) Long executorId,
@ApiParam(value = "任务类型") @RequestParam(value = "taskType", required = false) String taskType, @ApiParam(value = "任务类型") @RequestParam(value = "taskType", required = false) String taskType,
...@@ -514,7 +510,6 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -514,7 +510,6 @@ public class PlanTaskController extends AbstractBaseController {
params.put("endTime", endTime); params.put("endTime", endTime);
params.put("executorId", executorId); params.put("executorId", executorId);
params.put("finishStatus", finishStatus); params.put("finishStatus", finishStatus);
params.put("taskType", TaskCheckTypeEnum.getEumByCode(taskType).getName());
params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy()); params.put("orderBy", OrderByEnum.getEumByCode(orderBy).getOderBy());
CommonPageable pageable = new CommonPageable(pageNumber, pageSize); CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return ResponseHelper.buildResponse(planTaskService.getPlanTasks(params, pageable)); return ResponseHelper.buildResponse(planTaskService.getPlanTasks(params, pageable));
...@@ -524,7 +519,18 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -524,7 +519,18 @@ public class PlanTaskController extends AbstractBaseController {
@ApiOperation(value = "根据检查任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)", notes = "根据检查任务ID查询计划任务详情和任务点(<font color='blue'>手机app</font>)") @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) @RequestMapping(value = "/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel qryPlanTaskDetailById( 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; ResponseModel result = null;
try { try {
Map<String, Object> response = new HashMap<String, Object>(); Map<String, Object> response = new HashMap<String, Object>();
...@@ -532,13 +538,19 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -532,13 +538,19 @@ public class PlanTaskController extends AbstractBaseController {
if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) { if (ObjectUtils.isEmpty(task) || ObjectUtils.isEmpty(task.get("planTaskId"))) {
result = ResponseHelper.buildResponse("该计划已刷新,请重新选择!!!"); result = ResponseHelper.buildResponse("该计划已刷新,请重新选择!!!");
} else { } else {
List points = planTaskService.getPlanTaskPoints(planTaskId); HashMap<String, Object> params = new HashMap<String, Object>();
String[] userIds = task.get("userId").toString().split(","); params.put("userId", userId);
for (String userId : userIds) { params.put("companyId", companyId);
task.put("userId", userId); params.put("orgCode", loginOrgCode);
} params.put("taskType", taskType);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); params.put("startTime", startTime);
task.put("checkDate", sdf.format(task.get("checkDate") != null ? sdf.parse(task.get("checkDate").toString()) : new Date())); 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("planTask", task);
response.put("points", points); response.put("points", points);
result = ResponseHelper.buildResponse(response); result = ResponseHelper.buildResponse(response);
...@@ -714,4 +726,32 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -714,4 +726,32 @@ public class PlanTaskController extends AbstractBaseController {
return CommonResponseUtil.failure(e.getMessage()); 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 { ...@@ -809,8 +809,17 @@ public class PointController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询巡检点详情<font color='blue'>手机app</font>)", notes = "查询巡检点详情<font color='blue'>手机app</font>)") @ApiOperation(value = "查询巡检点详情<font color='blue'>手机app</font>)", notes = "查询巡检点详情<font color='blue'>手机app</font>)")
@GetMapping(value = "/detail/item", produces = "application/json;charset=UTF-8") @GetMapping(value = "/detail/item", produces = "application/json;charset=UTF-8")
public ResponseModel queryItemDetailByPointId(@ApiParam(value = "巡检点id", required = true) @RequestParam(name = "pointId") Long id) { public ResponseModel queryItemDetailByPointId(
return ResponseHelper.buildResponse(iPointService.queryItemDetailByPointId(id)); @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; ...@@ -11,6 +11,7 @@ import java.util.TreeSet;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors; 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.feign.RemoteSecurityService;
import com.yeejoin.amos.supervision.jpush.AppMessagePushService; import com.yeejoin.amos.supervision.jpush.AppMessagePushService;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -846,4 +847,12 @@ public class UserController extends AbstractBaseController { ...@@ -846,4 +847,12 @@ public class UserController extends AbstractBaseController {
return CommonResponseUtil.failure(e.getMessage()); 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; ...@@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.Param;
public interface PlanTaskDetailMapper extends BaseMapper { public interface PlanTaskDetailMapper extends BaseMapper {
void finishTaskDetail(@Param(value="planTaskDetailId") long planTaskDetailId, @Param(value="pointId") long pointId, @Param(value="planTaskId") long planTaskId 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); Map findPlanTaskByTaskIdAndPointId(@Param(value="planTaskId") long planTaskId,@Param(value="pointId") long pointId);
......
...@@ -12,6 +12,7 @@ import com.yeejoin.amos.supervision.business.param.PlanTaskPageParam; ...@@ -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.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.LeavePlanTaskVo; import com.yeejoin.amos.supervision.business.vo.LeavePlanTaskVo;
import com.yeejoin.amos.supervision.business.vo.PlanTaskVo; import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.supervision.dao.entity.PlanTask; import com.yeejoin.amos.supervision.dao.entity.PlanTask;
...@@ -77,10 +78,12 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -77,10 +78,12 @@ public interface PlanTaskMapper extends BaseMapper {
Map queryPlanTaskById(@Param(value="planTaskId") Long planTaskId); Map queryPlanTaskById(@Param(value="planTaskId") Long planTaskId);
/** /**
* 通过计划任务Id获取任务所有点信息 * 通过计划任务Id获取任务所有点信息
* @param planTaskId * @param params
* @return * @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 * @param userId
......
...@@ -157,5 +157,10 @@ public interface PointMapper extends BaseMapper { ...@@ -157,5 +157,10 @@ public interface PointMapper extends BaseMapper {
*/ */
List<Long> getPointoriginalidbyrouteid(@Param(value = "routeId") Long routeId); 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> { ...@@ -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) @Query(value = "select * from p_input_item where original_id in ?1 and is_delete =0", nativeQuery = true)
List<InputItem> listByOriginalIds(List<String> originalIds); 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) @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); List<InputItem> findByItemNoAndEquipmentName(String itemNo,String equipmentName);
......
...@@ -23,4 +23,9 @@ public interface IRoutePointItemDao extends BaseDao<RoutePointItem, Long> { ...@@ -23,4 +23,9 @@ public interface IRoutePointItemDao extends BaseDao<RoutePointItem, Long> {
@Transactional @Transactional
@Query(value = "delete from p_route_point_item WHERE id in (?1)", nativeQuery = true) @Query(value = "delete from p_route_point_item WHERE id in (?1)", nativeQuery = true)
void deleteByRoutePointItemId(List<Long> delRoutePointItemIds); 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);
} }
...@@ -23,7 +23,10 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor { ...@@ -23,7 +23,10 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor {
HttpServletRequest request = attributes.getRequest(); HttpServletRequest request = attributes.getRequest();
//设置header //设置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 product = request.getHeader("product");
String appKey = request.getHeader("appKey"); String appKey = request.getHeader("appKey");
template.header("token", token); 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{ ...@@ -11,6 +11,7 @@ public class InputItemPageParam extends CommonPageable{
private String name; private String name;
private String level; private String level;
private String itemNo; private String itemNo;
private String checkTypeId;
/** /**
* 机构 * 机构
*/ */
...@@ -82,4 +83,12 @@ public class InputItemPageParam extends CommonPageable{ ...@@ -82,4 +83,12 @@ public class InputItemPageParam extends CommonPageable{
public void setCatalogIds(List<Long> catalogIds) { public void setCatalogIds(List<Long> catalogIds) {
this.catalogIds = 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 { ...@@ -939,13 +939,12 @@ public class CheckServiceImpl implements ICheckService {
if (total == 0) { if (total == 0) {
return new PageImpl<>(content, page, total); return new PageImpl<>(content, page, total);
} }
map.put("status", PlanTaskFinishStatusEnum.getValue(String.valueOf(map.get("status"))));
map.put("offset", page.getOffset()); map.put("offset", page.getOffset());
map.put("pageSize", page.getPageSize()); map.put("pageSize", page.getPageSize());
content = checkMapper.getCheckItems(map); content = checkMapper.getCheckItems(map);
content.forEach(c -> { content.forEach(c -> {
if (c.containsKey("finishStatus")) { 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); c.put("finishStatus", finishStatusDesc);
} }
}); });
...@@ -953,8 +952,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -953,8 +952,8 @@ public class CheckServiceImpl implements ICheckService {
} }
@Override @Override
public List<Map<String, String>> getPlanExecuteStates() { public List<Map<String, Object>> getPlanExecuteStates() {
return PlanTaskFinishStatusEnum.getEnumList(); return CheckItemFinishStatusEnum.getEnumList();
} }
@Override @Override
...@@ -1385,12 +1384,11 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1385,12 +1384,11 @@ public class CheckServiceImpl implements ICheckService {
@Transactional @Transactional
public CheckDto saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception { public CheckDto saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception {
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity(); ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
//执行人-维保人员,非amos 账号 if (ObjectUtils.isEmpty(reginParams.getUserModel()) && ObjectUtils.isEmpty(reginParams.getCompany()) && ObjectUtils.isEmpty(personIdentity) ) {
if (ObjectUtils.isEmpty(reginParams.getUserModel()) && ObjectUtils.isEmpty(reginParams.getCompany()) && ObjectUtils.isEmpty(reginParams.getDepartment()) ) {
throw new RuntimeException("获取用户信息失败"); throw new RuntimeException("获取用户信息失败");
} }
String mtUserSeq = reginParams.getUserModel().getUserId(); String mtUserSeq = personIdentity.getPersonSeq();
String userName = reginParams.getUserModel().getUserName(); String userName = personIdentity.getPersonName();
// String mtUserSeq = personIdentity.getPersonSeq(); // String mtUserSeq = personIdentity.getPersonSeq();
PlanTask planTask = planTaskService.selectPlanTaskStatus(recordParam.getPlanTaskId()); PlanTask planTask = planTaskService.selectPlanTaskStatus(recordParam.getPlanTaskId());
Map detail = planTaskDetailMapper.findPlanTaskByTaskIdAndPointId(recordParam.getPlanTaskId(), recordParam.getPointId()); Map detail = planTaskDetailMapper.findPlanTaskByTaskIdAndPointId(recordParam.getPlanTaskId(), recordParam.getPointId());
...@@ -1420,11 +1418,11 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1420,11 +1418,11 @@ public class CheckServiceImpl implements ICheckService {
check.setUserId(mtUserSeq); check.setUserId(mtUserSeq);
check.setCheckTime(new Date()); check.setCheckTime(new Date());
check.setUploadTime(new Date()); check.setUploadTime(new Date());
check.setUserName(reginParams.getUserModel().getUserName()); check.setUserName(personIdentity.getPersonName());
check.setCompanyId(reginParams.getCompany().getSequenceNbr().toString()); check.setCompanyId(reginParams.getCompany().getSequenceNbr().toString());
check.setCompanyName(reginParams.getCompany().getCompanyName()); check.setCompanyName(reginParams.getCompany().getCompanyName());
check.setDepId(reginParams.getDepartment().getSequenceNbr().toString()); check.setDepId(personIdentity.getCompanyId());
check.setDepName(reginParams.getDepartment().getDepartmentName()); check.setDepName(personIdentity.getCompanyName());
} else { } else {
// 更新 // 更新
check = checkByPointId; check = checkByPointId;
...@@ -1446,11 +1444,11 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1446,11 +1444,11 @@ public class CheckServiceImpl implements ICheckService {
if (!companyName.contains(reginParams.getCompany().getCompanyName())) { if (!companyName.contains(reginParams.getCompany().getCompanyName())) {
check.setCompanyName(companyName+","+reginParams.getCompany().getCompanyName()); check.setCompanyName(companyName+","+reginParams.getCompany().getCompanyName());
} }
if (!depId.contains(reginParams.getDepartment().getSequenceNbr().toString())) { if (!depId.contains(personIdentity.getCompanyId())) {
check.setDepId(depId+","+reginParams.getDepartment().getSequenceNbr().toString()); check.setDepId(depId+","+personIdentity.getCompanyId());
} }
if (!depName.contains(reginParams.getDepartment().getDepartmentName())) { if (!depName.contains(personIdentity.getCompanyName())) {
check.setDepName(depName+","+reginParams.getDepartment().getDepartmentName()); check.setDepName(depName+","+personIdentity.getCompanyName());
} }
} }
...@@ -1553,7 +1551,13 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1553,7 +1551,13 @@ public class CheckServiceImpl implements ICheckService {
checkShotDao.saveAll(allShot); 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.返回不合格记录 //7.返回不合格记录
return new CheckDto(check.getId(), unqualifiedCheckItemList); return new CheckDto(check.getId(), unqualifiedCheckItemList);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -15,6 +15,7 @@ import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone; ...@@ -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.core.util.DateUtil;
import com.yeejoin.amos.supervision.dao.entity.*; import com.yeejoin.amos.supervision.dao.entity.*;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService; import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import org.apache.commons.lang.StringUtils;
import org.apache.velocity.util.ArrayListWrapper; import org.apache.velocity.util.ArrayListWrapper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -150,6 +151,10 @@ public class PlanServiceImpl implements IPlanService { ...@@ -150,6 +151,10 @@ public class PlanServiceImpl implements IPlanService {
saveRoute.setName(plan.getName()); saveRoute.setName(plan.getName());
saveRoute.setOrgCode(plan.getOrgCode()); saveRoute.setOrgCode(plan.getOrgCode());
saveRoute.setCreatorId(plan.getCreateBy()); saveRoute.setCreatorId(plan.getCreateBy());
if (!ObjectUtils.isEmpty(addPlanRequest.getOwnerId())) {
String ownerId = StringUtils.join(addPlanRequest.getOwnerId().toArray(), ",");
saveRoute.setOwnerId(ownerId);
}
Route route = iRouteDao.save(saveRoute); Route route = iRouteDao.save(saveRoute);
if (!ObjectUtils.isEmpty(route.getId())) { if (!ObjectUtils.isEmpty(route.getId())) {
...@@ -166,16 +171,19 @@ public class PlanServiceImpl implements IPlanService { ...@@ -166,16 +171,19 @@ public class PlanServiceImpl implements IPlanService {
routePoint.setRouteId(route.getId()); routePoint.setRouteId(route.getId());
routePoint.setPointId(point); routePoint.setPointId(point);
iRoutePointDao.save(routePoint); iRoutePointDao.save(routePoint);
});
List<PointInputItem> pointInputItems = pointMapper.getPointRouteItem(pointVos); // List<PointInputItem> pointInputItems = pointMapper.getCheckPointById(point);
List<PointInputItem> pointInputItems = iPointInputItemDao.getPointInputItemByPointId(point);
pointMapper.getPointClassInputItemById(point);
if (!ObjectUtils.isEmpty(pointInputItems)) { if (!ObjectUtils.isEmpty(pointInputItems)) {
pointInputItems.forEach(pointInputItem -> { pointInputItems.forEach(pointInputItem -> {
RoutePointItem routePointItem = new RoutePointItem(); RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setRoutePointId(route.getId()); routePointItem.setRoutePointId(routePoint.getId());
routePointItem.setPointInputItemId(pointInputItem.getId()); routePointItem.setPointInputItemId(pointInputItem.getId());
iRoutePointItemDao.save(routePointItem); iRoutePointItemDao.save(routePointItem);
}); });
} }
});
} }
} }
} }
......
...@@ -30,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CalDateVo; ...@@ -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.CodeOrderVo;
import com.yeejoin.amos.supervision.business.vo.LeavePlanTaskVo; import com.yeejoin.amos.supervision.business.vo.LeavePlanTaskVo;
import com.yeejoin.amos.supervision.business.vo.PlanTaskVo; 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.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone; import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone;
...@@ -608,8 +609,23 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -608,8 +609,23 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
@Override @Override
public List getPlanTaskPoints(Long planTaskId) { public Page<Map<String, Object>> getPlanTaskPoints(HashMap<String, Object> params, CommonPageable pageable) {
return planTaskMapper.getPlanTaskPoints(planTaskId); 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 @Override
......
...@@ -3,46 +3,25 @@ package com.yeejoin.amos.supervision.business.service.impl; ...@@ -3,46 +3,25 @@ package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.collect.Lists; 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.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.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dao.mapper.InputItemMapper; 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.PointMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RouteMapper; 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.*;
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.FormValue;
import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto; import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto;
import com.yeejoin.amos.supervision.business.dto.PointDto; import com.yeejoin.amos.supervision.business.dto.PointDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckPtListBo; import com.yeejoin.amos.supervision.business.entity.mybatis.CheckPtListBo;
import com.yeejoin.amos.supervision.business.feign.EquipFeign; import com.yeejoin.amos.supervision.business.feign.EquipFeign;
import com.yeejoin.amos.supervision.business.param.*; 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.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.util.DaoCriteria; import com.yeejoin.amos.supervision.business.util.DaoCriteria;
import com.yeejoin.amos.supervision.business.vo.*; 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.common.enums.PointStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.PointResponse; import com.yeejoin.amos.supervision.core.common.response.PointResponse;
...@@ -51,19 +30,8 @@ import com.yeejoin.amos.supervision.core.util.query.BaseQuerySpecification; ...@@ -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.dao.entity.*;
import com.yeejoin.amos.supervision.exception.YeeException; import com.yeejoin.amos.supervision.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService; 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.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.assertj.core.util.Sets; import org.assertj.core.util.Sets;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -141,7 +109,7 @@ public class PointServiceImpl implements IPointService { ...@@ -141,7 +109,7 @@ public class PointServiceImpl implements IPointService {
Point point = pointParam.getPoint(); Point point = pointParam.getPoint();
point.setIsDelete(false); point.setIsDelete(false);
iPointDao.saveAndFlush(point); iPointDao.saveAndFlush(point);
addClassifyAndInputItem(pointParam, point); // addClassifyAndInputItem(pointParam, point);
return point; return point;
} }
...@@ -1215,8 +1183,8 @@ public class PointServiceImpl implements IPointService { ...@@ -1215,8 +1183,8 @@ public class PointServiceImpl implements IPointService {
} }
@Override @Override
public List<Map<String, Object>> queryItemDetailByPointId(Long id) { public List<Map<String, Object>> queryItemDetailByPointId(Long id, Long routeId) {
List<Map<String, Object>> list = pointMapper.queryItemsByPointId(id); List<Map<String, Object>> list = pointMapper.queryItemsByPointId(id, routeId);
if (0 < list.size()) { if (0 < list.size()) {
for (Map<String, Object> map : list) { for (Map<String, Object> map : list) {
if (map.containsKey("picJson") && !ObjectUtils.isEmpty(map.get("picJson"))) { if (map.containsKey("picJson") && !ObjectUtils.isEmpty(map.get("picJson"))) {
...@@ -1227,4 +1195,9 @@ public class PointServiceImpl implements IPointService { ...@@ -1227,4 +1195,9 @@ public class PointServiceImpl implements IPointService {
return list; 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 { ...@@ -267,7 +267,7 @@ public interface ICheckService {
Page<HashMap<String, Object>> getPlanExecuteInfo(HashMap<String, Object> map, CommonPageable page); 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(); List<Map<String, Object>> getPlanExecuteTeams();
......
...@@ -91,10 +91,10 @@ public interface IPlanTaskService { ...@@ -91,10 +91,10 @@ public interface IPlanTaskService {
/** /**
* 根据计划ID获取所有的 任务计划巡检点 * 根据计划ID获取所有的 任务计划巡检点
* @param planTaskId * @param params
* @return * @return
*/ */
List getPlanTaskPoints(Long planTaskId); Page<Map<String, Object>> getPlanTaskPoints(HashMap<String, Object> params, CommonPageable pageable);
/** /**
* 获取用户当前所有有的计划任务 * 获取用户当前所有有的计划任务
......
...@@ -327,6 +327,8 @@ public interface IPointService { ...@@ -327,6 +327,8 @@ public interface IPointService {
*/ */
void delPointByPointNo(Long id); 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 { ...@@ -58,6 +58,8 @@ public class InputItemParamUtil {
param.setInputClassify(toString(queryRequests.get(i).getValue())); param.setInputClassify(toString(queryRequests.get(i).getValue()));
} else if ("itemClassify".equals(name)) { } else if ("itemClassify".equals(name)) {
param.setItemClassify(toString(queryRequests.get(i).getValue())); param.setItemClassify(toString(queryRequests.get(i).getValue()));
} else if ("checkTypeId".equals(name)) {
param.setCheckTypeId(toString(queryRequests.get(i).getValue()));
} }
} }
} }
......
...@@ -4,7 +4,7 @@ import java.util.Date; ...@@ -4,7 +4,7 @@ import java.util.Date;
public class InputItemVo { public class InputItemVo {
private long id ; private long id;
/** /**
* 分类ID * 分类ID
*/ */
...@@ -121,12 +121,17 @@ public class InputItemVo { ...@@ -121,12 +121,17 @@ public class InputItemVo {
*/ */
private String inputClassify; private String inputClassify;
private String checkTypeId;
private String checkType; private String checkType;
private String itemParent; private String itemParent;
private String itemClassify; private String itemClassify;
private String itemTypeClassify; private String itemTypeClassify;
private String itemLevel; private String itemLevel;
private String itemStart; private String itemStart;
/**
* 扩展属性
*/
private String ext;
public String getCheckType() { public String getCheckType() {
return checkType; return checkType;
...@@ -381,4 +386,19 @@ public class InputItemVo { ...@@ -381,4 +386,19 @@ public class InputItemVo {
this.riskDesc = 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; 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.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -14,12 +16,13 @@ import org.springframework.cloud.openfeign.EnableFeignClients; ...@@ -14,12 +16,13 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment; 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.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler; import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import java.net.InetAddress; import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import java.net.UnknownHostException;
/** /**
* <pre> * <pre>
...@@ -35,28 +38,48 @@ import java.net.UnknownHostException; ...@@ -35,28 +38,48 @@ import java.net.UnknownHostException;
@EnableFeignClients @EnableFeignClients
@EnableAsync @EnableAsync
@EnableEurekaClient @EnableEurekaClient
@MapperScan({"org.typroject.tyboot.demo.face.orm.dao*", @MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.face.*.orm.dao*", "org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "com.yeejoin.amos.boot.module.*.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper" })
"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" }) @ComponentScan(basePackages = { "org.typroject", "com.yeejoin.amos" })
public class AmosJcsApplication public class AmosJcsApplication {
{
private static final Logger logger = LoggerFactory.getLogger(AmosJcsApplication.class); private static final Logger logger = LoggerFactory.getLogger(AmosJcsApplication.class);
public static void main( String[] args ) throws UnknownHostException public static void main(String[] args) throws UnknownHostException {
{
ConfigurableApplicationContext context = SpringApplication.run(AmosJcsApplication.class, args); ConfigurableApplicationContext context = SpringApplication.run(AmosJcsApplication.class, args);
Environment env = context.getEnvironment(); Environment env = context.getEnvironment();
delKey(env, context);// 添加全部清空redis缓存的方法 2021-09-09
String ip = InetAddress.getLocalHost().getHostAddress(); String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port"); String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path")); String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
GlobalExceptionHandler.setAlwaysOk(true); GlobalExceptionHandler.setAlwaysOk(true);
logger.info("\n----------------------------------------------------------\n\t" + logger.info("\n----------------------------------------------------------\n\t"
"Application Amos-Biz-Boot is running! Access URLs:\n\t" + + "Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port
"Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" + + 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 ...@@ -50,14 +50,15 @@ spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10 spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0 spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300 spring.redis.expire.time=300
#在重启服务的过程中是否清空缓存的标识符 --2021-09-09
my.spring.redis.cache.isclean=false
## mqtt-警情初报消息主题 ## mqtt-警情初报消息主题
mqtt.topic.alert.reporting=alertReporting mqtt.topic.alert.reporting=alertReporting
## 实战指挥新警情�?�报主题 ## 实战指挥新警情主题
mqtt.topic.command.alert.notice=alertNotice mqtt.topic.command.alert.notice=alertNotice
## 跑马灯地震天气预警信息 ## 跑马灯地震天气预警信息
mqtt.topic.command.meteorological.notice=meteorological mqtt.topic.command.meteorological.notice=meteorological
mqtt.topic.command.power.deployment=power mqtt.topic.command.power.deployment=power
......
...@@ -163,11 +163,7 @@ ...@@ -163,11 +163,7 @@
</changeSet> </changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-1"> <changeSet author="litengwei" id="2021-09-01-litengwei-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" /> <tableExists tableName="cb_data_dictionary" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions> </preConditions>
<comment>add data cb_data_dictionary</comment> <comment>add data cb_data_dictionary</comment>
<sql> <sql>
...@@ -190,11 +186,7 @@ ...@@ -190,11 +186,7 @@
</changeSet> </changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-2"> <changeSet author="litengwei" id="2021-09-01-litengwei-2">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="jc_alert_form" /> <tableExists tableName="jc_alert_form" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions> </preConditions>
<comment>add data jc_alert_form</comment> <comment>add data jc_alert_form</comment>
<sql> <sql>
...@@ -206,11 +198,7 @@ ...@@ -206,11 +198,7 @@
</changeSet> </changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-3"> <changeSet author="litengwei" id="2021-09-01-litengwei-3">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="jc_alert_form" /> <tableExists tableName="jc_alert_form" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions> </preConditions>
<comment>update data jc_alert_form</comment> <comment>update data jc_alert_form</comment>
<sql> <sql>
...@@ -282,7 +270,6 @@ ...@@ -282,7 +270,6 @@
<changeSet author="chenhao" id="2021-09-06-chenhao-1"> <changeSet author="chenhao" id="2021-09-06-chenhao-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" /> <tableExists tableName="cb_data_dictionary" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions> </preConditions>
<comment>insert data cb_data_dictionary</comment> <comment>insert data cb_data_dictionary</comment>
<sql> <sql>
...@@ -292,4 +279,37 @@ ...@@ -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'); 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> </sql>
</changeSet> </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> </databaseChangeLog>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<!-- 日志输出级别 --> <!-- 日志输出级别 -->
<root level="INFO"> <root level="INFO">
<!--<appender-ref ref="FILE" />--> <appender-ref ref="FILE" />
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />
</root> </root>
......
...@@ -84,4 +84,41 @@ ...@@ -84,4 +84,41 @@
MODIFY COLUMN `dep_name` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '执行部门名称'; MODIFY COLUMN `dep_name` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '执行部门名称';
</sql> </sql>
</changeSet> </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> </databaseChangeLog>
\ No newline at end of file
...@@ -35,7 +35,7 @@ equip.fegin.name=AMOS-EQUIPMANAGE ...@@ -35,7 +35,7 @@ equip.fegin.name=AMOS-EQUIPMANAGE
equip.fegin.prefix=/equip equip.fegin.prefix=/equip
input.custom.prefix = QYZD input.custom.prefix = QYZD
input.statute.prefix = FG input.statute.prefix = FG
jcs.fegin.name=JCS
Security.fegin.name=AMOS-API-PRIVILEGE Security.fegin.name=AMOS-API-PRIVILEGE
......
...@@ -216,4 +216,37 @@ ...@@ -216,4 +216,37 @@
ALTER TABLE `p_check_input` ADD COLUMN `major_danger_num` int(11) DEFAULT NULL COMMENT '重大隐患个数' AFTER `safety_danger_num`; ALTER TABLE `p_check_input` ADD COLUMN `major_danger_num` int(11) DEFAULT NULL COMMENT '重大隐患个数' AFTER `safety_danger_num`;
</sql> </sql>
</changeSet> </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> </databaseChangeLog>
\ No newline at end of file
...@@ -1898,54 +1898,69 @@ ...@@ -1898,54 +1898,69 @@
SELECT SELECT
count(1) count(1)
FROM 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 WHERE
pc.id = pci.check_id prp.route_id = #{routeId}
AND pc.plan_task_detail_id = pptd.id <if test="pointId != null and pointId != '' and pointId != -1">
AND pc.plan_id = #{planId} AND ppi.point_id = #{pointId}
<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>
<!-- <if test="status != null and status != ''">--> <choose>
<!-- AND pc.point_id = #{status}--> <when test="status != null and status != '' and status==0">
<!-- </if>--> 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 != ''"> <if test="teamId != null and teamId != ''">
AND pc.company_id = #{teamId} AND pp.original_id = #{teamId}
</if> </if>
</select> </select>
<select id="getCheckItems" resultType="Map"> <select id="getCheckItems" resultType="Map">
SELECT SELECT
pc.id checkId, ppi.id inputItemId,
pci.id checkInputId, pii.name itemName,
pci.input_name itemName, pci.id IS NOT NULL finishStatus,
pptd.is_finish finishStatus,
pci.safety_danger_num safetyNum, pci.safety_danger_num safetyNum,
pci.major_danger_num majorNum, pci.major_danger_num majorNum,
DATE_FORMAT(pc.check_time,'%Y-%m-%d %H:%i:%s') checkTime, DATE_FORMAT(pci.create_date,'%Y-%m-%d %H:%i:%s') checkTime,
pc.user_name executeName, pp.name companyName,
pc.company_name companyName pci.user_name executeName
FROM 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 WHERE
pc.id = pci.check_id prp.route_id = #{routeId}
AND pc.plan_task_detail_id = pptd.id
AND pc.plan_id = #{planId}
<if test="pointId != null and pointId != '' and pointId != -1"> <if test="pointId != null and pointId != '' and pointId != -1">
AND pc.point_id = #{pointId} AND ppi.point_id = #{pointId}
</if> </if>
<if test="status != null and status != ''"> <choose>
AND pptd.is_finish = #{status} <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>
<!-- <if test="status != null and status != ''">--> <!-- <if test="status != null and status != ''">-->
<!-- AND pc.point_id = #{status}--> <!-- AND pc.point_id = #{status}-->
<!-- </if>--> <!-- </if>-->
<if test="companyName != null and companyName != ''"> <!-- <if test="companyName != null and companyName != ''">-->
AND pc.company_name = #{company_name} <!-- AND pc.company_name = #{company_name}-->
</if> <!-- </if>-->
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</select> </select>
......
...@@ -66,12 +66,14 @@ ...@@ -66,12 +66,14 @@
<result property="checkMethod" column="check_method" /> <result property="checkMethod" column="check_method" />
<result property="createDate" column="create_date" /> <result property="createDate" column="create_date" />
<result property="inputClassify" column="input_classify" /> <result property="inputClassify" column="input_classify" />
<result property="checkTypeId" column="check_type_id" />
<result property="checkType" column="check_type" /> <result property="checkType" column="check_type" />
<result property="itemParent" column="item_parent" /> <result property="itemParent" column="item_parent" />
<result property="itemClassify" column="item_classify" /> <result property="itemClassify" column="item_classify" />
<result property="itemTypeClassify" column="item_type_classify" /> <result property="itemTypeClassify" column="item_type_classify" />
<result property="itemLevel" column="item_level" /> <result property="itemLevel" column="item_level" />
<result property="itemStart" column="item_start" /> <result property="itemStart" column="item_start" />
<result property="ext" column="ext" />
</resultMap> </resultMap>
<!--统计 --> <!--统计 -->
<select id="countInputItemInfoData" resultType="long"> <select id="countInputItemInfoData" resultType="long">
...@@ -91,15 +93,15 @@ ...@@ -91,15 +93,15 @@
<select id="getInputItemInfo" resultMap="inputItemMap"> <select id="getInputItemInfo" resultMap="inputItemMap">
SELECT SELECT
a.id, a.id,
a.name, a.NAME,
a.item_no, a.item_no,
a.item_type, a.item_type,
a.is_must, a.is_must,
a.default_value, a.default_value,
a.is_score, a.is_score,
b.name as catalog_name, b.NAME AS catalog_name,
a.remark, a.remark,
a.level, a.LEVEL,
a.risk_desc, a.risk_desc,
a.maintenance_content, a.maintenance_content,
a.test_requirement, a.test_requirement,
...@@ -111,14 +113,20 @@ ...@@ -111,14 +113,20 @@
a.item_classify, a.item_classify,
a.item_type_classify, a.item_type_classify,
a.item_level, a.item_level,
a.item_start a.item_start,
from IF
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id ( i.input_item_id IS NULL, 0, 1 ) AS ext
where a.is_delete = '0' FROM
and a.input_type != '1' 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="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="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </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="orgCode!=null"> and a.org_Code = #{orgCode}</if>-->
<if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if> <if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if>
order by a.id desc order by a.id desc
......
...@@ -179,6 +179,7 @@ ...@@ -179,6 +179,7 @@
pt.org_code orgCode, pt.org_code orgCode,
p.name taskName, p.name taskName,
p.check_type_name checkTypeName, p.check_type_name checkTypeName,
P.check_type_id checkTypeId,
pt.status, pt.status,
pt.user_id userId, pt.user_id userId,
date_format( date_format(
...@@ -201,14 +202,11 @@ ...@@ -201,14 +202,11 @@
pt.route_id, pt.route_id,
pt.user_name userName, pt.user_name userName,
r.owner_id, r.owner_id,
R.owner_name as ownerName, r.owner_name as ownerName
ptd.item_num AS itemNum,
ptd.executor_id AS executorId
FROM FROM
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id 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_route r on r.id = pt.route_id
INNER JOIN p_plan_task_detail ptd ON ptd.task_no = pt.id
) a ) a
<include refid="mobile-plan-task-where" /> <include refid="mobile-plan-task-where" />
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
...@@ -217,8 +215,8 @@ ...@@ -217,8 +215,8 @@
<where> <where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if> <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="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="companyId != null"> and find_in_set(#{companyId},a.owner_id)>0</if>
<if test="taskType != null"> and a.checkTypeName = #{taskType}</if> <if test="taskType != null"> and a.checkTypeId = #{taskType}</if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if> <if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != '' "> <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
AND ( AND (
...@@ -265,13 +263,13 @@ ...@@ -265,13 +263,13 @@
pt.org_code as orgCode, pt.org_code as orgCode,
pt.begin_time as beginTime, pt.begin_time as beginTime,
pt.end_time as endTime, pt.end_time as endTime,
pt.point_num as taskPlanNum,
r.owner_id, r.owner_id,
ptd.item_num AS itemNum P.check_type_id checkTypeId
FROM FROM
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id 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_route r on r.id = pt.route_id
INNER JOIN p_plan_task_detail ptd ON ptd.task_no = pt.id
) a ) a
<include refid="mobile-plan-task-where" /> <include refid="mobile-plan-task-where" />
</select> </select>
...@@ -365,17 +363,66 @@ ...@@ -365,17 +363,66 @@
p.is_fixed isFixed, p.is_fixed isFixed,
pt.route_id routeId, pt.route_id routeId,
c.id checkId, 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 FROM
p_plan_task_detail ptd p_plan_task_detail ptd
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no 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_point p ON p.id = ptd.point_id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.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_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 WHERE
p.is_delete = 0 p.is_delete = 0
<if test="planTaskId != null and planTaskId > 0 ">and pt.id = #{planTaskId}</if> <if test="userId != null and userId > 0 "> and find_in_set(#{userId},pt.user_id)>0</if>
ORDER BY orderNo <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>
<select id="getCurrentPlanTaskCount" resultType="int" parameterType="long"> <select id="getCurrentPlanTaskCount" resultType="int" parameterType="long">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper"> <mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper">
<update id="finishTaskDetail"> <update id="finishTaskDetail">
call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId},#{executorName}) call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId},#{executorName},#{size})
</update> </update>
<select id="findPlanTaskByTaskIdAndPointId" resultType="Map"> <select id="findPlanTaskByTaskIdAndPointId" resultType="Map">
......
...@@ -1150,6 +1150,7 @@ ...@@ -1150,6 +1150,7 @@
pii.data_json dataJson, pii.data_json dataJson,
pii.remark remark, pii.remark remark,
pii.picture_json picJson, pii.picture_json picJson,
prpi.id routePointItemId,
CASE pii.`input_type` CASE pii.`input_type`
WHEN 0 THEN WHEN 0 THEN
'手动录入' '手动录入'
...@@ -1159,8 +1160,20 @@ ...@@ -1159,8 +1160,20 @@
FROM FROM
p_point_inputitem ppi p_point_inputitem ppi
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id 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 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 ORDER BY pii.order_no
</select> </select>
<select id="getPlanExecuteTeams" resultType="map">
SELECT
original_id id,
`name`
FROM
p_point
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<!-- 日志输出级别 --> <!-- 日志输出级别 -->
<root level="DEBUG"> <root level="DEBUG">
<!--<appender-ref ref="FILE" /> --> <appender-ref ref="FILE" />
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />
</root> </root>
</configuration> </configuration>
\ No newline at end of file
...@@ -200,6 +200,16 @@ ...@@ -200,6 +200,16 @@
</exclusions> </exclusions>
</dependency> </dependency>
<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> <groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<version>1.5.13</version> <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