Commit 21ac79b6 authored by tangwei's avatar tangwei

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

parents 1f2da0ab a6ccc740
......@@ -52,7 +52,9 @@ public class ControllerAop {
@Autowired
private RedisUtils redisUtils;
@Pointcut("execution(public * com.yeejoin.amos.boot.module.*.biz.controller..*(..)) || execution(public * com.yeejoin.amos.*.business.controller..*(..))")
@Pointcut("(execution(public * com.yeejoin.amos.boot.module.*.biz.controller..*(..)) "
+ "|| execution(public * com.yeejoin.amos.*.business.controller..*(..)))"
+ " && !@annotation(org.springframework.scheduling.annotation.Scheduled))")
public void userCache() {
}
......
......@@ -49,7 +49,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
} else {
Collection<DataDictionary> list = this.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2,
// 数据字典还原 by kongfm 2021-09-09
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
"getName", "getParent", null);
MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
Me.setIsLeaf(false);
......@@ -71,7 +72,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
} else {
Collection<DataDictionary> list = this.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName"
// 数据字典还原 by kongfm 2021-09-09
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return menus;
......@@ -85,7 +87,8 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
Collection<DataDictionary> list = this.list(queryWrapper);
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by kongfm 2021-09-08
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getSequenceNbr", 2, "getName"
// 数据字典还原 by kongfm 2021-09-09
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
, "getParent", null);
return menus;
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -13,17 +14,18 @@ import lombok.experimental.Accessors;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 工作经历
*
* @author tb
* @date 2021-06-07
*/
* 工作经历
*
* @author tb
* @date 2021-06-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cb_firefighters_workexperience")
@ApiModel(value="FirefightersWorkexperience对象", description="工作经历")
@ApiModel(value = "FirefightersWorkexperience对象", description = "工作经历")
public class FirefightersWorkexperience extends BaseEntity {
/**
*
......@@ -32,16 +34,18 @@ public class FirefightersWorkexperience extends BaseEntity {
@ApiModelProperty(value = "参加工作时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date workingHours;
@ApiModelProperty(value = "参加消防部门工作时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fireWorkingHours;
@ApiModelProperty(value = "人员id")
private Long firefightersId;
@ApiModelProperty(value = "更新时间")
@TableField(fill=FieldFill.UPDATE)
@TableField(fill = FieldFill.UPDATE)
private Date updateTime;
}
......@@ -79,7 +79,7 @@ public class OrgPersonController {
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgPersonDto OrgPersonVo,
@PathVariable Long id) throws Exception {
OrgPersonVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
//OrgPersonVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
iOrgUsrService.updateByIdOrgPerson(OrgPersonVo, id);
return ResponseHelper.buildResponse(null);
}
......
......@@ -350,7 +350,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
pageBean.setTotal(this.baseMapper.selectPersonListCount(map));
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize());
List<Map<String, Object>> list = this.baseMapper.selectPersonList(map);
/*Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束*/
......@@ -640,7 +639,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setSequenceNbr(id);
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 开始*/
OrgUsr parent = getById(OrgPersonVo.getParentId());
if (!ObjectUtils.isEmpty(parent)){
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 结束*/
if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
......
......@@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -52,6 +54,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "创建无码无计划隐患", notes = "创建无码无计划隐患")
@PostMapping(value = "/normal/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) {
CommonResponse commonResponse = new CommonResponse();
try {
......@@ -80,6 +83,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "创建巡检隐患", notes = "创建巡检隐患")
@PostMapping(value = "/patrol/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse savePatrol(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerPatrolParam latentDangerPatrolParam) {
try {
AgencyUserModel user = getUserInfo();
......@@ -102,6 +106,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患列表", notes = "隐患列表")
@PostMapping(value = "/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse list(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerListParam latentDangerListParam) {
Date startDate = new Date();
try {
......@@ -124,6 +129,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患详情", notes = "隐患详情")
@GetMapping(value = "/detail")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse detail(@ApiParam(value = "任务Id", required = true) @RequestParam String id,
@ApiParam(value = "是否完成", required = true) @RequestParam boolean isFinish) {
try {
......@@ -140,6 +146,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患执行记录", notes = "隐患执行记录")
@GetMapping(value = "/listFlowRecord")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listFlowRecord(@ApiParam(value = "隐患编号", required = true) @RequestParam Long id) {
try {
AgencyUserModel user = getUserInfo();
......@@ -155,6 +162,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "流程执行", notes = "流程执行")
@PostMapping(value = "/excute")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse excute(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerExcuteParam latentDangerExcuteParam) {
try {
AgencyUserModel user = getUserInfo();
......@@ -186,6 +194,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "根据流程实例编号获取隐患信息", notes = "根据流程实例编号获取隐患信息")
@GetMapping(value = "/getByInstanceId")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getByInstanceId(@ApiParam(value = "流程实例编号", required = true) @RequestParam String instanceId) {
try {
AgencyUserModel user = getUserInfo();
......@@ -201,6 +210,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "隐患按错计划流程执行回调", notes = "隐患按错计划流程执行回调")
@PostMapping(value = "/plan/flow/excuteCallBack")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse excuteCallBack(@ApiParam(value = "隐患按错计划流程执行回调对象") @RequestBody JSONObject json) {
try {
AgencyUserModel user = getUserInfo();
......@@ -231,6 +241,7 @@ public class LatentDangerController extends AbstractBaseController {
@ApiOperation(value = "获取隐患等级", notes = "获取隐患等级")
@GetMapping(value = "/dangerLevel")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getDangerLevel() {
return CommonResponseUtil.success(iLatentDangerService.getDangerLevel(getToken(), getProduct(), getAppKey(), DictTypeEnum.DANGERLEVEL.getCode()));
}
......@@ -246,6 +257,7 @@ public class LatentDangerController extends AbstractBaseController {
*/
@ApiOperation(value = "隐患清单", notes = "隐患清单")
@PostMapping(value = "/page/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
......@@ -260,6 +272,7 @@ public class LatentDangerController extends AbstractBaseController {
*/
@ApiOperation(value = "导出隐患清单", notes = "导出隐患清单")
@PostMapping(value = "/export")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public void exportDangerList(@ApiParam(value = "查询条件") @RequestBody PageParam pageParam,
HttpServletResponse response) {
AgencyUserModel user = getUserInfo();
......@@ -286,6 +299,7 @@ public class LatentDangerController extends AbstractBaseController {
*/
@ApiOperation(value = "隐患日志", notes = "查询隐患节点信息")
@GetMapping(value = "/listDangerTimeAxis")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse listTimeAxis(@ApiParam(value = "时间") @RequestParam(required = false) Integer dateTime) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
......
......@@ -32,6 +32,8 @@ import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -206,6 +208,8 @@ public class PlanTaskController extends AbstractBaseController {
@RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse pushCarData() {
try {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskExecution(null);
return CommonResponseUtil.success();
} catch (Exception e) {
......
......@@ -802,7 +802,9 @@ public class TaskController extends AbstractBaseController{
String userIds="";
Set<String> set = new HashSet<>();
list.forEach(s -> {
if(!ObjectUtils.isEmpty(s)){
set.add(s.getName());
}
});
List<String> list1 = new ArrayList<>(set);
......
......@@ -176,7 +176,7 @@ public Page<HashMap<String, Object>> getCatalogTreeInfo(String toke,String produ
String userIds = "";
Set<String> set = new HashSet<>();
content.forEach(s -> {
if (s.containsKey("createBy")) {
if (s.containsKey("createBy") && !ObjectUtils.isEmpty(s.get("createBy"))) {
set.add(s.get("createBy").toString());
}
});
......
......@@ -161,7 +161,7 @@ public class CheckServiceImpl implements ICheckService {
deptIds.remove(null);
String joinUserId="";
for (String userId:userIds) {
if(userId!=null&&!userId.trim().equals("")){
if(!ObjectUtils.isEmpty(userId)){
joinUserId=joinUserId+userId+",";
}
}
......@@ -808,7 +808,7 @@ public class CheckServiceImpl implements ICheckService {
deptIds.remove(null);
String joinUserId="";
for (String userId:userIds) {
if(userId!=null&&!userId.trim().equals("")){
if(!ObjectUtils.isEmpty(userId)){
joinUserId=joinUserId+userId+",";
}
}
......@@ -1194,8 +1194,9 @@ public class CheckServiceImpl implements ICheckService {
//处理用户信息
String userIds="";
Set<String> set = new HashSet<>();
if(!ObjectUtils.isEmpty(checkDetailBo.getCheckUserName())){
set.add(checkDetailBo.getCheckUserName());
}
List<String> list1 = new ArrayList<>(set);
userIds = String.join(",", list1);
List<AgencyUserModel> listd=remoteSecurityService.listUserByUserIds( toke,product,appKey,userIds);
......@@ -1315,7 +1316,9 @@ public class CheckServiceImpl implements ICheckService {
if (!CollectionUtils.isEmpty(content)) {
Set<String> userIds =new HashSet<>();
content.forEach(e -> {
if(!ObjectUtils.isEmpty(e.get("userID"))){
userIds.add(e.get("userID")+"");
}
});
List<AgencyUserModel> userModels = remoteSecurityService.listUserByUserIds( toke, product, appKey,Joiner.on(",").join(userIds));
Map<String, String> userModelMap = new HashMap<String,String>();
......@@ -1512,7 +1515,9 @@ public class CheckServiceImpl implements ICheckService {
String userIds="";
Set<String> set = new HashSet<>();
checkAnalysisVos.forEach(s -> {
if(!ObjectUtils.isEmpty(s.getName())){
set.add(s.getName());
}
});
List<String> list1 = new ArrayList<>(set);
userIds = String.join(",", list1);
......
......@@ -151,9 +151,11 @@ public class MessageServiceImpl implements IMessageService {
// List<PushTargetBo> jpushUser = msgMapper.getPushUserBo("app", String.join(",", needUserIds), checkMsgBo.getRouteId(),getAppPushConfig(checkMsgBo.getStatus()));
List<PushTargetBo> jpushUser = new ArrayList<>();
needUserIds.stream().forEach(action->{
if(!ObjectUtils.isEmpty(action)){
PushTargetBo pb = new PushTargetBo();
pb.setUserId(action);
jpushUser.add(pb);
}
});
//获取需要推送的email的用户
List<PushTargetBo> emailUser = msgMapper.getPushUserBo("email", String.join(",", needUserIds), checkMsgBo.getRouteId(),getEmailPushConfig(checkMsgBo.getStatus()));
......
package com.yeejoin.amos;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -14,12 +16,13 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import java.net.InetAddress;
import java.net.UnknownHostException;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
/**
* <pre>
......@@ -35,28 +38,48 @@ import java.net.UnknownHostException;
@EnableFeignClients
@EnableAsync
@EnableEurekaClient
@MapperScan({"org.typroject.tyboot.demo.face.orm.dao*",
"org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*",
"org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.*.api.mapper",
"com.yeejoin.amos.boot.biz.common.dao.mapper" })
@MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.*.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper" })
@ComponentScan(basePackages = { "org.typroject", "com.yeejoin.amos" })
public class AmosJcsApplication
{
public class AmosJcsApplication {
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);
Environment env = context.getEnvironment();
delKey(env, context);// 添加全部清空redis缓存的方法 2021-09-09
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
GlobalExceptionHandler.setAlwaysOk(true);
logger.info("\n----------------------------------------------------------\n\t" +
"Application Amos-Biz-Boot is running! Access URLs:\n\t" +
"Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
"----------------------------------------------------------");
logger.info("\n----------------------------------------------------------\n\t"
+ "Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port
+ path + "/doc.html\n" + "----------------------------------------------------------");
}
/**
* 清空redis缓存数据
*
* @author 陈浩
* @param env
* @param context
*/
public static void delKey(Environment env, ConfigurableApplicationContext context) {
if (Boolean.parseBoolean(env.getProperty("my.spring.redis.cache.isclean"))) {
@SuppressWarnings("rawtypes")
RedisTemplate redisTemplate = context.getBean("redisTemplate", RedisTemplate.class);
RedisConnection redisConnection = null;
try {
redisConnection = redisTemplate.getConnectionFactory().getConnection();
redisConnection.flushAll();
} catch (Exception e) {
logger.info("删除redis 缓存的key 失败");
} finally {
redisConnection.close();
}
}
}
}
spring.application.name=JCS
spring.application.name=JCS-chenhao
server.servlet.context-path=/jcs
server.port=11100
spring.profiles.active=dev
......@@ -7,10 +7,10 @@ spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml
## mybatis-plus配置控制台打印完整带参数SQL语句
## mybatis-plus配置控制台打印完整带参数SQL语句
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
## redis失效时间
## redis失效时间
redis.cache.failure.time=10800
## unit(h)
......@@ -50,14 +50,15 @@ spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300
## mqtt-警情初报消息主题
#在重启服务的过程中是否清空缓存的标识符 --2021-09-09
my.spring.redis.cache.isclean=false
## mqtt-警情初报消息主题
mqtt.topic.alert.reporting=alertReporting
## 实战指挥新警情�?�报主题
## 实战指挥新警情�?�报主题
mqtt.topic.command.alert.notice=alertNotice
## 跑马灯地震,天气预警信息
## 跑马灯地震,天气预警信息
mqtt.topic.command.meteorological.notice=meteorological
mqtt.topic.command.power.deployment=power
......@@ -71,8 +72,8 @@ iot.fegin.name=AMOS-API-IOT
equip.fegin.name=AMOS-EQUIPMANAGE
## 设备联动服务(车库门、广播、警铃)
## 设备联动服务(车库门、广播、警铃)
control.fegin.name=JCS-API-CONTROL
## 故障报修流程
## 故障报修流程
failure.work.flow.processDefinitionKey=malfunction_repair
\ No newline at end of file
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