Commit f8c027c0 authored by limei's avatar limei

Merge branch 'develop_dl_plan6' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6

parents c9f20155 7307a975
......@@ -142,8 +142,8 @@ public class OrgUsrFireExcelDto extends BaseDto {
@ExcelProperty(value = "出生日期", index = 17)
@ApiModelProperty(value = "出生日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
// @DateTimeFormat(pattern = "yyyy-MM-dd") 此注解用于此处不起任何作用 --ky20220918
// @JsonFormat(pattern = "yyyy-MM-dd")
private String birthdayTime;
@ExplicitConstraint(indexNum = 18, sourceClass = CommonExplicitConstraint.class, method = "getMaritalStatus") //固定下拉内容
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsrAgencyUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -18,6 +19,9 @@ public class PeopleInfoDto {
@ApiModelProperty(value = "联系人信息")
private FirefightersContacts firefightersContacts;
@ApiModelProperty(value = "账户信息")
private OrgUsrAgencyUser orgUsrAgencyUser;
@ApiModelProperty(value = "岗位页签")
private FirefightersDataDto postEduDtoObj;
......
......@@ -24,8 +24,9 @@ public class OrgUsrAgencyUser extends BaseEntity {
/**
* 用户名
*/
@TableField("user_name")
private String userName;
@TableField("usr_name")
private String usrName;
/**
* 手机号
......@@ -57,4 +58,10 @@ public class OrgUsrAgencyUser extends BaseEntity {
@TableField("amos_user_id")
private String amosUserId;
@TableField(exist = false)
private String upPassWord;
@TableField(exist = false)
private String upAmosUser;
}
......@@ -50,4 +50,6 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> {
Long sequenceNbr, String equipId,String bizOrgCode, String equipCateGoryCode,List<String> ids);
List<Map<String, Object>> getWaterTypeByBizOrgCode(String bizOrgCode);
}
Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page, @Param("nameOrCode") String nameOrCode, @Param("bizOrgCode") String bizOrgCode);
}
......@@ -407,9 +407,9 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
AND type = 'RYZT'
) AS stateCode,
fp.employee_hierarchy,
cast(b.birthdayTime as datetime) as birthdayTime,
b.*,
fw.*
fw.*,
DATE_FORMAT(b.birthdayTime,'%Y-%m-%d') AS birthdaryTime
from cb_org_usr a LEFT JOIN
(SELECT
instance_id,
......@@ -427,7 +427,7 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
max(case field_code when 'telephone' then field_value end) telephone,
max(case field_code when 'peopleType' then field_value end) peopleType,
max(case field_code when 'nation' then field_value end) nation,
max(case field_code when 'birthdayTime' then field_value end) birthdayTime,
max( CASE field_code WHEN 'birthdayTime' THEN DATE_FORMAT(field_value, '%Y-%m-%d') END ) birthdayTime,
max(case field_code when 'maritalStatus' then field_value end) maritalStatus,
max(case field_code when 'nativePlace' then field_value end) nativePlace,
max(case field_code when 'nativePlaceVal' then field_value end) nativePlaceVal,
......
......@@ -151,6 +151,9 @@
<if test="map.company != null and map.company != '-1'">
AND u.parent_id = #{map.company}
</if>
<if test="map.positionType != null and map.positionType != ''">
AND AND FIND_IN_SET(#{positionType},g.positionType)
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
......
......@@ -180,4 +180,10 @@
</select>
<select id="pageByDefect" resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto">
select * from cb_water_resource where is_delete = 1
<if test="nameOrCode != null and nameOrCode != ''">and (name like concat('%', #{nameOrCode}, '%') or equip_code like concat('%', #{nameOrCode}, '%'))</if>
<if test="bizOrgCode != null and bizOrgCode != ''">and biz_org_code like concat( #{bizOrgCode}, '%')</if>
order by cb_water_resource.rec_date desc
</select>
</mapper>
......@@ -133,4 +133,12 @@ public class FireFightingSystemEntity {
@ApiModelProperty(value = "分析报告统计用参数(为空不统计) ")
private String analysisIndexKey;
@ApiModelProperty(value = "责任单位")
private String designOrg;
@ApiModelProperty(value = "设计单位联系方式")
private String designOrgTelephone;
@ApiModelProperty(value = "主要设计人员")
private String leadDesigner;
}
......@@ -60,4 +60,10 @@ public class EquipTypeAmountPageDTO extends BaseDTO<EquipmentSpecific> {
@ApiModelProperty(value = "是否物联")
private String isIot;
@ApiModelProperty(value = "装备编码或名称")
private String nameOrCode;
@ApiModelProperty(value = "缺陷管理新增页面用,其余地方可忽略 1-是缺陷管理 0-不是")
private Integer isDefect;
}
......@@ -53,4 +53,6 @@ public class EquipTypeImgAmountVO {
@ApiModelProperty(value = "单位部门org")
private String bizOrgCode;
@ApiModelProperty(value = "所在建筑")
private String belongBuildName;
}
......@@ -121,4 +121,6 @@ public class EquipmentManageVo implements Serializable {
private String bizOrgCode;
private String bizOrgName;
private String fullName;
}
......@@ -176,4 +176,16 @@ public class FireFightingSystemVo implements Serializable {
*/
private String bizOrgName;
/**
* 责任单位
*/
private String designOrg;
/**
* 主要设计人员
*/
private String leadDesigner;
private String designOrgTelephone;
}
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireCompanyInfoServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author fengwang
......
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrAgencyUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -36,10 +37,15 @@ public class OrgUsrAgencyUserController extends BaseController {
* @return OrgUsrAgencyUser
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{orgUsrId}/detail", method = RequestMethod.GET)
@RequestMapping(value = "/{orgUsrId}/detail", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "查询关联的amos账号信息", notes = "查询关联的amos账号信息")
public ResponseModel<OrgUsrAgencyUser> getAccountDetail(@PathVariable String orgUsrId) {
OrgUsrAgencyUser orgUsrAgencyUser = new OrgUsrAgencyUser();
OrgUsrAgencyUser agencyUser = orgUsrAgencyUserService.getAccountDetail(orgUsrId);
if (ObjectUtils.isEmpty(agencyUser)) {
orgUsrAgencyUser.setUpAmosUser("0");
return ResponseHelper.buildResponse(orgUsrAgencyUser);
}
return ResponseHelper.buildResponse(agencyUser);
}
}
\ No newline at end of file
......@@ -468,6 +468,31 @@ public class WaterResourceController extends BaseController {
}
/**
* 列表分页查询缺陷模块用
*
* @param pageNum 当前页
* @param pageSize 每页大小
* @return 返回结果
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/pageByDefect")
@ApiOperation(httpMethod = "GET", value = "列表分页查询缺陷模块用", notes = "列表分页查询缺陷模块用")
public ResponseModel<Page<WaterResourceDto>> pageByDefect(@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize,
@RequestParam(value = "nameOrCode", required = false) String nameOrCode,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo();
if (StringUtils.isEmpty(bizOrgCode)) {
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
Page<WaterResourceDto> page = new Page<>();
page.setCurrent(pageNum);
page.setSize(pageSize);
Page<WaterResourceDto> waterResourceDtoPage = waterResourceServiceImpl.pageByDefect(page, nameOrCode, bizOrgCode);
return ResponseHelper.buildResponse(waterResourceDtoPage);
}
/**
* 列表全部数据查询
*
* @return 返回结果
......
......@@ -4,11 +4,13 @@ import com.yeejoin.amos.boot.module.common.biz.listener.AmosMqttListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqKeeper;
/**
* @author Administrator
*/
@Component
public class ApplicationRunnerImpl implements ApplicationRunner {
@Autowired
......
......@@ -6,9 +6,10 @@ import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrAgencyUserMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.component.feign.model.Page;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.ObjectUtils;
......@@ -28,8 +29,6 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
......@@ -61,6 +60,8 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
FirefightersContactsServiceImpl ifirefightersContactsService;
@Autowired
private OrgUsrMapper orgUsrMapper;
@Autowired
OrgUsrAgencyUserMapper orgUsrAgencyUserMapper;
@Override
public List<FirefightersZhDto> getFirefighters(int pageNum, int pageSize, FirefightersDto par) {
......@@ -228,19 +229,64 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Override
@Transactional(rollbackFor = Exception.class)
public PeopleInfoDto updatePeopleById(PeopleInfoDto peopleInfoDto, Long id) {
Map<String, String> map = new HashMap<>();
// 1.动态表单
if(!ValidationUtil.isEmpty(peopleInfoDto.getFirefighters().getAmosUserId())) {
AgencyUserModel amosUser = Privilege.agencyUserClient.queryByUserId(peopleInfoDto.getFirefighters().getAmosUserId()).getResult();
OrgUsr orgUsr = orgUsrService.peopleSaveOrgUsr(peopleInfoDto.getFirefighters());
if(!ValidationUtil.isEmpty(peopleInfoDto.getFirefighters().getAmosUserId()) || "1".equals(peopleInfoDto.getOrgUsrAgencyUser().getUpAmosUser())) {
AgencyUserModel amosUser = null;
if(!ValidationUtil.isEmpty(peopleInfoDto.getFirefighters().getAmosUserId())){
amosUser = Privilege.agencyUserClient.queryByUserId(peopleInfoDto.getFirefighters().getAmosUserId()).getResult();
}
//删除之前所在用户组
OrgUsrAgencyUser orgUsrAgencyUser = orgUsrAgencyUserMapper.selectOne(new QueryWrapper<OrgUsrAgencyUser>().eq("org_usr_id", id));
if (!ValidationUtil.isEmpty(orgUsrAgencyUser) && amosUser != null ) {
String groupIds = orgUsrAgencyUser.getGroupIds();
if (!"".equals(groupIds) && null != groupIds) {
String[] ids = groupIds.split(",");
for (String gId : ids) {
Long groupId = Long.valueOf(gId);
Privilege.groupUserClient.deleteGroupUser(groupId,amosUser.getUserId());
}
}
}
//同步更新或者创建平台用户
if(null == amosUser){
map = orgUsrService.savePlatformUser(orgUsr,peopleInfoDto,"create");
} else {
if("0".equals(peopleInfoDto.getOrgUsrAgencyUser().getUpAmosUser())){
//删除cb_org_usr_agency_user中对应数据
if (!ValidationUtil.isEmpty(orgUsrAgencyUser)) {
orgUsrAgencyUserMapper.delete(new QueryWrapper<OrgUsrAgencyUser>().eq("org_usr_id", id));
}
//删除cb_org_usr相关字段
OrgUsr orgUsr1 = orgUsrMapper.queryBySequenceNbr(id.toString());
orgUsr1.setAmosOrgId("");
orgUsr1.setAmosOrgCode("");
orgUsrMapper.update(orgUsr1,new QueryWrapper<OrgUsr>().eq("sequence_nbr",id));
//删除cb_firefighters相关字段
Firefighters firefighters = firefightersMapper.selectOne(new QueryWrapper<Firefighters>().eq("org_usr_id", id));
firefighters.setAmosUserId("");
firefighters.setAmosName("");
firefightersMapper.update(firefighters,new QueryWrapper<Firefighters>().eq("org_usr_id", id));
Privilege.agencyUserClient.multDeleteUser(orgUsrAgencyUser.getAmosUserId());
} else {
map = orgUsrService.savePlatformUser(orgUsr,peopleInfoDto,"update");
}
}
if(amosUser==null){
peopleInfoDto.getFirefighters().setAmosName(peopleInfoDto.getOrgUsrAgencyUser().getUsrName());
}else {
peopleInfoDto.getFirefighters().setAmosName(amosUser.getRealName());
}
} else {
peopleInfoDto.getFirefighters().setAmosUserId(null);
peopleInfoDto.getFirefighters().setAmosName(null);
}
OrgUsr orgUsr = orgUsrService.peopleSaveOrgUsr(peopleInfoDto.getFirefighters());
OrgPersonDto orgPersonDto = new OrgPersonDto();
BeanUtils.copyProperties(orgUsr, orgPersonDto);
orgPersonDto.setAmosOrgId(map.get("orgId"));
orgPersonDto.setAmosOrgCode(map.get("orgCode"));
List<DynamicFormInstance> dynamicFormInstances = orgUsrService.dynamicFormColumn(peopleInfoDto.getFirefighters(), false);
orgPersonDto.setDynamicFormValue(dynamicFormInstances);
try {
......@@ -270,7 +316,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Override
public void saveFirefightersByUser(PeopleInfoDto firefighters) {
orgUsrService.saveFirefighters(firefighters);
orgUsrService.saveFirefighters(firefighters,new HashMap<>());
}
public Map<String, String> getPersonByCodes(List<String> list) {
......
......@@ -3,14 +3,22 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrAgencyUserDto;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsrAgencyUser;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrAgencyUserMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrAgencyUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -22,6 +30,12 @@ import java.util.stream.Collectors;
@Service
public class OrgUsrAgencyUserServiceImpl extends BaseService<OrgUsrAgencyUserDto, OrgUsrAgencyUser, OrgUsrAgencyUserMapper> implements IOrgUsrAgencyUserService {
@Autowired
OrgUsrAgencyUserMapper orgUsrAgencyUserMapper;
@Autowired
FirefightersMapper firefightersMapper;
@Autowired
OrgUsrMapper orgUsrMapper;
@Override
public OrgUsrAgencyUser getAccountDetail(String orgUsrId) {
......@@ -35,17 +49,52 @@ public class OrgUsrAgencyUserServiceImpl extends BaseService<OrgUsrAgencyUserDto
String userId = jsonObject.getString("userId");
// 平台添加用户
if ("update".equals(methodName)) {
// 更新cb_org_usr_agency_user、cb_org_usr、cb_firefighters
// 更新cb_org_usr_agency_user
JSONObject object = result.getJSONObject("result");
// person.setId(object.getLong("sequenceNbr"));
// person.setAccountName(object.getString("userName"));
// person.setUserId(object.getLong("userId"));
// person.setName(object.getString("realName"));
// person.setPhone(object.getString("mobile"));
OrgUsrAgencyUser orgUsrAgencyUser = orgUsrAgencyUserMapper.selectOne(new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id", object.getString("userId")));
orgUsrAgencyUser.setUsrName(object.getString("userName"));
orgUsrAgencyUser.setMobile(object.getString("mobile"));
orgUsrAgencyUser.setAmosUserId(object.getString("userId"));
orgUsrAgencyUserMapper.update(orgUsrAgencyUser,new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id",object.getString("userId")));
// 更新cb_firefighters
Firefighters firefighter = firefightersMapper.selectOne(new QueryWrapper<Firefighters>().eq("org_usr_id", orgUsrAgencyUser.getOrgUsrId()));
if (!ObjectUtils.isEmpty(firefighter) && !firefighter.getIsDelete()) {
firefighter.setAmosUserId(object.get("userId").toString());
firefighter.setAmosName(object.getString("userName"));
firefightersMapper.update(firefighter, new QueryWrapper<Firefighters>().eq("org_usr_id", orgUsrAgencyUser.getOrgUsrId()));
}
// 更新cb_org_usr
OrgUsr orgUsr1 = orgUsrMapper.selectById(orgUsrAgencyUser.getOrgUsrId());
if (!ObjectUtils.isEmpty(orgUsr1) && !orgUsr1.getIsDelete()) {
orgUsr1.setAmosOrgId(object.get("userId").toString());
List<Map<String, Object>> companys = (List<Map<String, Object>>) object.get("companys");
orgUsr1.setAmosOrgCode(companys.get(0).get("orgCode").toString());
orgUsrMapper.update(orgUsr1,new QueryWrapper<OrgUsr>().eq("sequence_nbr",orgUsrAgencyUser.getOrgUsrId()));
}
} else if ("multDeleteUser".equals(methodName)) {
JSONArray array = result.getJSONArray("result");
List<Object> userIds = array.stream().collect(Collectors.toList());
// 删除cb_org_usr_agency_user、cb_org_usr与用户有关字段、cb_firefighters和用户有关字段
for (Object id : userIds) {
//删除cb_org_usr_agency_user中信息
OrgUsrAgencyUser orgUsrAgencyUser = orgUsrAgencyUserMapper.selectOne(new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id", id));
if (!ObjectUtils.isEmpty(orgUsrAgencyUser)) {
orgUsrAgencyUserMapper.delete(new QueryWrapper<OrgUsrAgencyUser>().eq("amos_user_id", id));
}
// 删除cb_firefighters和用户有关字段
Firefighters firefighter = firefightersMapper.selectOne(new QueryWrapper<Firefighters>().eq("amos_user_id", id));
if (!ObjectUtils.isEmpty(firefighter)) {
firefighter.setAmosUserId("");
firefighter.setAmosName("");
firefightersMapper.update(firefighter, new QueryWrapper<Firefighters>().eq("amos_user_id", id).eq("is_delete", 0));
}
// 删除cb_org_usr与用户有关字段
OrgUsr orgUsr1 = orgUsrMapper.selectOne(new QueryWrapper<OrgUsr>().eq("amos_org_id", id));
if (!ObjectUtils.isEmpty(orgUsr1)) {
orgUsr1.setAmosOrgId("");
orgUsr1.setAmosOrgCode("");
orgUsrMapper.update(orgUsr1,new QueryWrapper<OrgUsr>().eq("amos_org_id",id).eq("is_delete",0));
}
}
}
}
}
\ No newline at end of file
......@@ -93,6 +93,15 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
}
/**
* 分页查询
*/
public Page<WaterResourceDto> pageByDefect(Page<WaterResourceDto> page,
String nameOrCode,
String bizOrgCode) {
return this.waterResourceMapper.pageByDefect(page, nameOrCode, bizOrgCode);
}
/**
* 列表查询 示例
*/
public List<WaterResourceDto> queryForWaterResourceList(@Condition(Operator.eq) Boolean isDelete) {
......
......@@ -4,7 +4,9 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -105,8 +107,20 @@ public class BuildingController extends AbstractBaseController {
@ApiOperation("消防建筑树")
@GetMapping(value = "/tree")
public List<BuildingTreeVo> getBuildingTree() {
return buildService.getBuildingTree();
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.getBuildingTree(bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树带筛选")
@GetMapping(value = "/treeByName")
public List<BuildingTreeVo> treeByName(@RequestParam(required = false) String name) {
ReginParams reginParams = getSelectedOrgInfo();
String bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
return buildService.treeByName(bizOrgCode, name);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防建筑树列表信息")
@GetMapping(value = "/getBuildingList")
......
......@@ -55,9 +55,10 @@ public class EquipmentManageController extends AbstractBaseController{
@RequestParam(value = "maintenance",required = false) String bizOrgCode,
@RequestParam(value = "maintenance",required = false) String formGroupId,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize
@RequestParam(value = "size") int pageSize,
@RequestParam(required = false) String nameOrCode
) {
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize);
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,nameOrCode);
}
@GetMapping(value = "/getUtils")
......
......@@ -49,7 +49,9 @@ import com.yeejoin.equipmanage.service.IManufacturerInfoService;
import com.yeejoin.equipmanage.service.IUploadFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
......@@ -458,6 +460,12 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().substring(0, inhierarchy), equipTypeAmountPage);
} else {
if (null != equipTypeAmountPage.getIsDefect() && 1 == equipTypeAmountPage.getIsDefect()) {
ReginParams reginParams = getSelectedOrgInfo();
if (StringUtils.isEmpty(equipTypeAmountPage.getBizOrgCode())) {
equipTypeAmountPage.setBizOrgCode(reginParams.getPersonIdentity().getBizOrgCode());
}
}
return fireFightingSystemService.getColaCategoryAmountEquList(0, null, equipTypeAmountPage);
}
......@@ -505,12 +513,20 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "formGroupId", required = false) String formGroupId,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize
@RequestParam(value = "size") int pageSize,
@RequestParam(value = "size", required = false) String nameOrCode,
@ApiParam(value = "缺陷管理新增页面用,其余地方可忽略 1-是缺陷管理 0-不是") @RequestParam(required = false) Integer isDefect
) {
if (null != isDefect && 1 == isDefect) {
ReginParams reginParams = getSelectedOrgInfo();
if (StringUtils.isEmpty(bizOrgCode)) {
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
}
if (current > 0){
current = (current - 1) * pageSize;
}
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize);
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize, nameOrCode);
}
/**
......
......@@ -47,7 +47,14 @@ public interface FormInstanceMapper extends BaseMapper<FormInstance> {
* @param parentId
* @return
*/
List<Map<String,Object>> querySpecialChildrenList(String parentId);
List<Map<String,Object>> querySpecialChildrenList(String parentId, String bizOrgCode);
/**
* 查询指定节点的子
* @param parentId
* @return
*/
List<Map<String,Object>> querySpecialChildrenListByName(String parentId, String bizOrgCode, String name);
/**
* 查询指定节点的子
......
......@@ -26,7 +26,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity>
* @param pageSize
* @return
*/
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize);
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String nameOrCode);
/**
* 获取下拉菜单数据
......
......@@ -74,7 +74,7 @@ public interface IBuilldService extends IService<Building> {
*
* @return List<BuildingTreeVo>
*/
List<BuildingTreeVo> getBuildingTree();
List<BuildingTreeVo> getBuildingTree(String bizOrgCode);
/**
* 消防建筑树查询接口(带条件bizOrgCode)
......@@ -339,4 +339,6 @@ public interface IBuilldService extends IService<Building> {
List<BuildingTreeVo> getBuildingTreeInOrgCode(String bizOrgCode);
List<OrgMenuDto> companyTreeByUserAndType();
List<BuildingTreeVo> treeByName(String bizOrgCode, String name);
}
......@@ -40,7 +40,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param pageSize
* @return
*/
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize);
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String nameOrCode);
FireFightingSystemEntity getOneById(Long id);
......
......@@ -70,7 +70,7 @@ public interface IFormInstanceService extends IService<FormInstance> {
* @param parentId 父节点
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> getSpecialChildrenList(String parentId);
List<Map<String, Object>> getSpecialChildrenList(String parentId, String bizOrgCode);
/**
* 查询指定节点的下降
......@@ -164,4 +164,12 @@ public interface IFormInstanceService extends IService<FormInstance> {
List<UnitAreaTreeVo> getValueByColumn(Long instanceId, String bizOrgcode);
List<Map<String, Long>> getBuildVideoCount();
/**
* 查询指定节点的下降
*
* @param parentId 父节点
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name);
}
......@@ -451,8 +451,20 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
}
@Override
public List<BuildingTreeVo> getBuildingTree(String bizOrgCode) {
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, bizOrgCode);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
t.setChildren(this.getChildren(t.getInstanceId(), allListVo));
t.setDetailPaneApi(address);
t.setApiUrl(apiUrl);
return t;
}).collect(Collectors.toList());
}
public List<BuildingTreeVo> getBuildingTree() {
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true);
List<BuildingTreeVo> allListVo = getBuildingTreeVos(true, null);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
......@@ -487,12 +499,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public List<Map<String, Object>> getBuildingDetaiList() {
return iFormInstanceService.getSpecialChildrenList(null);
return iFormInstanceService.getSpecialChildrenList(null, null);
}
private List<BuildingTreeVo> getBuildingTreeVos(Boolean isContainRootNode) {
private List<BuildingTreeVo> getBuildingTreeVos(Boolean isContainRootNode, String bizOrgCode) {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, bizOrgCode);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, isContainRootNode);
Map<Long, String> absolutePositionMap = getBuildingAbsolutePosition(allListVo);
allListVo.forEach(s -> s.setAbsolutePosition(absolutePositionMap.get(s.getId())));
......@@ -502,7 +514,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public List<BuildingTreeVo> getBuildingTierTree(Integer tier) {
if (tier != null) {
List<BuildingTreeVo> list = getBuildingTreeVos(true);
List<BuildingTreeVo> list = getBuildingTreeVos(true, null);
if (!CollectionUtils.isEmpty(list)) {
if (tier == 1) {
List<BuildingTreeVo> collect = list.stream().filter(x -> "-1".equals(x.getParentId()) || "building".equalsIgnoreCase(x.getGroupType())).collect(Collectors.toList());
......@@ -1191,7 +1203,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public Map<Long, String> getBuildingAbsolutePosition() {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, true);
return getBuildingAbsolutePosition(allListVo);
}
......@@ -1199,7 +1211,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override
public Map<String, Long> getBuildingCodeKey() {
Map<String, Long> resMap = new HashMap<>();
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
if (!allList.isEmpty()) {
allList.forEach(map -> resMap.put(String.valueOf(map.get("code")), Long.valueOf(String.valueOf(map.get("id")))));
}
......@@ -1361,7 +1373,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
if (StringUtils.isEmpty(authKey)) {
authKey = this.authKey;
}
List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false);
List<BuildingTreeVo> buildingTreeVos = getBuildingTreeVos(false, null);
// 1.获取公司list
List<OrgUsrDto> orgUsrLists = jcsRemoteService.getCompanyDeptListWithAuth(authKey, "COMPANY");
if(orgUsrLists.isEmpty()){
......@@ -1511,7 +1523,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
//如果传递的为部门bizOrgCode 取其上级单位下的建筑
// ResponseModel<OrgUsrDto> companyByBizOrgCodeList = jcsFeign.getCompanyByBizOrgCodeList(bizOrgCode);
// String resultCode = companyByBizOrgCodeList.getResult().getBizOrgCode();
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true);
List<BuildingTreeVo> buildingTreeVos = this.getBuildingTreeVos(true, null);
List<BuildingTreeVo> orgBuildingTreeVos = buildingTreeVos.stream().filter(b-> b.getBizOrgCode() != null && b.getBizOrgCode().contains(bizOrgCode)).collect(Collectors.toList());
return buildingTreeVos.stream().filter(b -> "-1".equals(b.getParentId())).peek(b -> {
b.setId(0L);
......@@ -1529,4 +1541,26 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
a.setChildren(getCompanyBuildingChildrenTree(a.getId().toString(), all));
}).collect(Collectors.toList());
}
@Override
public List<BuildingTreeVo> treeByName(String bizOrgCode, String name) {
List<BuildingTreeVo> allListVo = getBuildingTreeVosByName(true, bizOrgCode, name);
return allListVo.stream().filter(s -> "-1".equals(s.getParentId())).map(s -> {
BuildingTreeVo t = new BuildingTreeVo();
Bean.copyExistPropertis(s, t);
t.setChildren(this.getChildren(t.getInstanceId(), allListVo));
t.setDetailPaneApi(address);
t.setApiUrl(apiUrl);
return t;
}).collect(Collectors.toList());
}
private List<BuildingTreeVo> getBuildingTreeVosByName(Boolean isContainRootNode, String bizOrgCode, String name) {
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenListByName(null, bizOrgCode, name);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList, isContainRootNode);
Map<Long, String> absolutePositionMap = getBuildingAbsolutePosition(allListVo);
allListVo.forEach(s -> s.setAbsolutePosition(absolutePositionMap.get(s.getId())));
return allListVo;
}
}
......@@ -177,7 +177,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
set(EquipmentSpecific::getRealtimeIotIndexUpdateDate,new Date()).
eq(EquipmentSpecific::getId,alarm.getEquipmentSpecificId());
equipmentSpecificSerivce.update(wrapper);
MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), null, equipmentSpecificAlarmLogService);
MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), null, equipmentSpecificAlarmLogService, true);
}
// 如果是批量确警,先查询,再确警,用于批量消息推送
isBatch = ent.getIsBatch();
......
......@@ -72,7 +72,7 @@ public class DownloadFileService implements IDownloadFileService {
//建筑信息
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null, null);
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList);
appDownload.setBuildTree(allListVo);
......
......@@ -56,7 +56,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance,
String bizOrgCode, String formGroupId, int current, int pageSize) {
String bizOrgCode, String formGroupId, int current, int pageSize, String nameOrCode) {
HttpServletRequest request = null;
Map map = new HashMap<String, Object>();
map.put("equimentName", equimentName);
......@@ -67,6 +67,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
map.put("pageSize", pageSize);
map.put("bizOrgCode", bizOrgCode);
map.put("formGroupId", formGroupId);
map.put("nameOrCode", nameOrCode);
List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map);
Long count = equipmentManageMapper.queryEquipmenCount(map);
map.clear();
......
......@@ -163,9 +163,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction,
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize) {
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String nameOrCode) {
Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode,
construction, maintenance, bizOrgCode, formGroupId, current, pageSize);
construction, maintenance, bizOrgCode, formGroupId, current, pageSize, nameOrCode);
List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList");
StringBuilder stb = new StringBuilder();
dataList.forEach(y -> {
......
......@@ -432,8 +432,8 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
}
@Override
public List<Map<String, Object>> getSpecialChildrenList(String parentId) {
return this.baseMapper.querySpecialChildrenList(parentId);
public List<Map<String, Object>> getSpecialChildrenList(String parentId, String bizOrgCode) {
return this.baseMapper.querySpecialChildrenList(parentId, bizOrgCode);
}
@Override
......@@ -559,4 +559,9 @@ public class FormInstanceServiceImpl extends ServiceImpl<FormInstanceMapper, For
public List<Map<String, Long>> getBuildVideoCount() {
return formInstanceMapper.getBuildVideoCount();
}
@Override
public List<Map<String, Object>> getSpecialChildrenListByName(String parentId, String bizOrgCode, String name) {
return this.baseMapper.querySpecialChildrenListByName(parentId, bizOrgCode, name);
}
}
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mchange.v2.beans.swing.TestBean;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm;
......@@ -57,8 +58,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private static Map<String, TemperatureAlarmDto> temperatureMap = new HashMap<>();
static IEquipmentSpecificIndexService equipmentSpecificIndexService;
@Autowired
IEquipmentSpecificIndexService equipmentSpecificIndexService;
public void setEquipmentSpecificIndexService(IEquipmentSpecificIndexService equipmentSpecificIndexService){
MqttReceiveServiceImpl.equipmentSpecificIndexService = equipmentSpecificIndexService;
}
@Autowired
ICarPropertyService carPropertyService;
......@@ -88,11 +92,18 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired
FireFightingSystemMapper FireFightingSystemMapper;
static IFireFightingSystemService fireFightingSystemService;
@Autowired
IFireFightingSystemService fireFightingSystemService;
public void setFireFightingSystemService(IFireFightingSystemService fireFightingSystemService){
MqttReceiveServiceImpl.fireFightingSystemService = fireFightingSystemService;
}
static MqttSendGateway mqttSendGateway;
@Autowired
MqttSendGateway mqttSendGateway;
public void setMqttSendGateway(MqttSendGateway mqttSendGateway){
MqttReceiveServiceImpl.mqttSendGateway = mqttSendGateway;
}
@Autowired
private RedisUtils redisUtils;
......@@ -133,8 +144,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${mqtt.vehicle.topic}")
private String carTopic;
private static String canvasTopic;
@Value("${equip.point.equipmentdata.topic}")
private String canvasTopic;
public void setCanvasTopic(String canvasTopic){
MqttReceiveServiceImpl.canvasTopic = canvasTopic;
}
@Value("${equip.index.topic}")
private String indexTopic;
......@@ -308,7 +322,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
mqttSendGateway.sendToMqtt(TopicEnum.EQDQR.getTopic(), JSONArray.toJSON(action).toString());
} else {
alarmLogs.addAll(upAlarmLogStatus(action.getIotCode(), action.getEquipmentSpecificIndexKey(), action.getTraceId(),
equipmentSpecificAlarmLogService));
equipmentSpecificAlarmLogService, false));
mqttSendGateway.sendToMqtt(TopicEnum.EQYQR.getTopic(), JSONArray.toJSON(action).toString());
bool = Boolean.TRUE;
}
......@@ -386,7 +400,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
public static List<EquipmentSpecificAlarmLog> upAlarmLogStatus(String iotCode, String equipmentSpecificIndexKey,
String traceId, IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService) {
String traceId, IEquipmentSpecificAlarmLogService equipmentSpecificAlarmLogService, boolean flag) {
LambdaQueryWrapper<EquipmentSpecificAlarmLog> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(EquipmentSpecificAlarmLog::getIotCode, iotCode);
queryWrapper.eq(EquipmentSpecificAlarmLog::getEquipmentSpecificIndexKey, equipmentSpecificIndexKey);
......@@ -403,6 +417,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (!logs.isEmpty()) {
equipmentSpecificAlarmLogService.updateBatchById(logs);
}
if (flag) {
List<EquipmentSpecificIndex> indexList = equipmentSpecificIndexService.getEquipmentSpeIndexBySpeIotCode(iotCode);
publishDataToCanvas(indexList);
}
return logs;
}
......@@ -411,7 +429,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
*
* @param indexList
*/
public void publishDataToCanvas(List<EquipmentSpecificIndex> indexList) {
public static void publishDataToCanvas(List<EquipmentSpecificIndex> indexList) {
if (!ObjectUtils.isEmpty(indexList)) {
EquipmentSpecificIndex index = indexList.stream().filter(x -> x.getUpdateDate() != null)
.sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
......
......@@ -437,7 +437,7 @@ public class FirefightersController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "获取人员详情", notes = "获取人员详情")
public ResponseModel<PeopleInfoDto> updatePeopleById(@RequestBody PeopleInfoDto firefighters, @PathVariable Long id) {
try {
if ("2".equals(firefighters.getFirefighters().getPeopleType())){
if ("1601".equals(firefighters.getFirefighters().getPeopleType())){
PeopleBasicInfoDto peopleBasicInfoDto = firefighters.getFirefighters();
Firefighters firefighter = new Firefighters();
BeanUtils.copyProperties(peopleBasicInfoDto, firefighter);
......
......@@ -208,7 +208,7 @@ public class ExcelServiceImpl {
// authFalg=true;
// }
//效验参数
boolean authFalg=getFlag(par);
boolean authFlag = getFlag(par);
switch (excelDto.getType()) {
......@@ -248,7 +248,7 @@ public class ExcelServiceImpl {
break;
case "SYXX":
// 暂时先还原代码不加 “非” ,为修改bug http://36.46.149.14:5080/zentao/task-view-6974.html 水源导出没有数据问题
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
WaterResourceDto.class, dataSourcesImpl, false);
break;
......@@ -275,7 +275,7 @@ public class ExcelServiceImpl {
AircraftDto.class, dataSourcesImpl, false);
break;
case "XFDW":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
FireTeamDto.class, dataSourcesImpl, false);
break;
......@@ -285,7 +285,7 @@ public class ExcelServiceImpl {
FireTeamDto.class, dataSourcesImpl, false);
break;
case "WXXFZ":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
FireStationDto.class, null, false);
break;
......@@ -301,7 +301,7 @@ public class ExcelServiceImpl {
FireStationDto.class, null, false);
break;
case "XFRY":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
null, FirefightersExcelDto.class, null, false);
break;
......@@ -310,8 +310,8 @@ public class ExcelServiceImpl {
List<OrgUsrFireExcelDto> firefightersExcelDtoList = firefightersService.exportToExcelNew(false, par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, OrgUsrFireExcelDto.class, null, false);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
// ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(),
// firefightersExcelDtoList, FirefightersExcelDto.class, null, false);
break;
case "WBRY":
List<MaintenancePersonExcleDto> maintenancePersonExcelDtoList = maintenanceCompanyService
......@@ -350,7 +350,7 @@ public class ExcelServiceImpl {
signDtos.getRecords(), SignDto.class, null, false);
break;
case "KEYSITE":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
KeySiteExcleDto.class, null, false);
break;
......@@ -370,7 +370,7 @@ public class ExcelServiceImpl {
KeySiteExcleDto.class, null, false);
break;
case "JCDWRY":
if(!authFalg) {
if(!authFlag) {
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), null,
OrgUsrExcelDto.class, null, false);
break;
......
package com.yeejoin.amos.knowledgebase.face.service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
......@@ -255,7 +253,7 @@ public class DocAuditService {
List<ConstantCategoryModel> allCategoryModel = new ArrayList<>();
if (!allPublishedDocIds.isEmpty()) {
while (index < size) {
int num = Math.min(index + 50, size);
int num = Math.min(index + 200, size);
List<Long> curDocIds = allPublishedDocIds.subList(index, index + num);
index += num;
List<KnowledgeDocContentModel> docContentModels = docLibraryService.efficientList(curDocIds);
......@@ -275,6 +273,7 @@ public class DocAuditService {
// 推mq消息给规则服务
try {
emqKeeper.getMqttClient().publish(topic, ClazzUtils.serializableObject(definitionModel), RuleConfig.DEFAULT_QOS, false);
logger.info("知识库服务同步文档至规则消息发送成功 ("+ definitionModel +") " + new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date(System.currentTimeMillis())));
} catch (Exception e) {
logger.fatal("同步文档至规则服务出错", e);
}
......
......@@ -2973,4 +2973,29 @@
END
</sql>
</changeSet>
<changeSet author="zs" id="202209131015-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_fire_fighting_system" columnName="design_org"/>
</not>
</preConditions>
<comment>任务9322 系统基础属性加字段</comment>
<sql>
ALTER TABLE `f_fire_fighting_system` ADD COLUMN `design_org` varchar(255) DEFAULT NULL COMMENT '设计单位',
ADD COLUMN `lead_designer` varchar(255) DEFAULT NULL COMMENT '主要设计人员';
</sql>
</changeSet>
<changeSet author="tianyiming" id="20220922tianyiming">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_fire_fighting_system" columnName="design_org_telephone"/>
</not>
</preConditions>
<comment>f_fire_fighting_system add design_org_telephone</comment>
<sql>
ALTER TABLE `f_fire_fighting_system`
ADD COLUMN `design_org_telephone` varchar(32) NULL COMMENT '设计单位联系方式';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<mapper namespace="com.yeejoin.equipmanage.mapper.EquipmentManageMapper">
<select id="queryEquipmenInfo" resultType="com.yeejoin.equipmanage.common.vo.EquipmentManageVo">
select
id as id,
sys.id as id,
name as name,
code as code,
form_group_id,
......@@ -21,9 +21,14 @@
biz_org_code as bizOrgCode,
biz_org_name as bizOrgName,
scene_id as sceneId,
(select count(1) from `wl_equipment_specific` es where find_in_set(sys.id,es.system_id) and es.single = true ) equipCount
design_org,
lead_designer,
design_org_telephone,
(select count(1) from `wl_equipment_specific` es where find_in_set(sys.id,es.system_id) and es.single = true ) equipCount,
wws.full_name as fullName
from
f_fire_fighting_system as sys
left join wl_warehouse_structure wws on wws.id = sys.contro_box_build
where 1=1
<if test="equimentName != 'null' ">
AND NAME like CONCAT('%',#{equimentName},'%')
......@@ -31,6 +36,9 @@
<if test="equimentCode != 'null' ">
AND CODE like CONCAT('%',#{equimentCode},'%')
</if>
<if test="nameOrCode != null and nameOrCode != ''">
AND (CODE like CONCAT('%',#{nameOrCode},'%') or NAME like CONCAT('%',#{equimentName},'%'))
</if>
<if test="construction != 'all' ">
AND CONSTRUCTION_UNIT = #{construction}
</if>
......@@ -61,6 +69,9 @@
<if test="construction != 'all' ">
AND construction_unit = #{construction}
</if>
<if test="nameOrCode != null and nameOrCode != ''">
AND (CODE like CONCAT('%',#{nameOrCode},'%') or NAME like CONCAT('%',#{equimentName},'%'))
</if>
<if test="maintenance != 'all' ">
AND maintenance_unit = #{maintenance}
</if>
......
......@@ -752,7 +752,7 @@
es.`name`,
es.`name` AS aliasname,
es.`code`,
ed.`name` AS categoryname,
e.`name` AS categoryname,
ed.`code` AS categorycode,
( SELECT GROUP_CONCAT( url ) FROM wl_upload_file WHERE file_type = 'image' AND object_type = 'equipment' AND object_id = ed.id ) AS img,
es.iot_code AS iotcode,
......@@ -774,6 +774,7 @@
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = es.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
LEFT JOIN wl_area a ON es.area_id = a.id
......
......@@ -35,6 +35,7 @@
<result property="eqtype" column="eqtype"></result>
<result property="bizOrgCode" column="bizOrgCode"></result>
<result property="bizOrgName" column="bizOrgName"></result>
<result property="belongBuildName" column="belongBuildName"></result>
</resultMap>
<select id="getEquiplistBySystemId" resultMap="EquiplistBySystemId">
......@@ -99,7 +100,10 @@
factory,
contro_box_address,
biz_org_code,
biz_org_name
biz_org_name,
design_org,
design_org_telephone,
lead_designer
)
VALUES(
#{id},
......@@ -127,7 +131,10 @@
#{factory},
#{controBoxAddress},
#{bizOrgCode},
#{bizOrgName}
#{bizOrgName},
#{designOrg},
#{designOrgTelephone},
#{leadDesigner}
)
</insert>
<insert id="insertFile">
......@@ -174,7 +181,10 @@
form_group_id =#{formGroupId},
contro_box_address = #{controBoxAddress},
biz_org_code=#{bizOrgCode},
biz_org_name=#{bizOrgName}
biz_org_name=#{bizOrgName},
design_org = #{designOrg},
lead_designer = #{leadDesigner},
design_org_telephone = #{designOrgTelephone}
where id = #{id}
</update>
<delete id="deleteFilre">
......@@ -1909,6 +1919,7 @@
wle.img,
wled.NAME equipmentName,
concat_ws('-',wlws.full_name,wled.area) as full_name,
wlws.name as belongBuildName,
wlun.NAME unitName,
(SELECT GROUP_CONCAT(fem.name) FROM `f_fire_fighting_system` fem WHERE find_in_set(fem.id,wles.system_id))
as systemName,
......@@ -1981,6 +1992,9 @@
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
AND wled.name LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
</if>
<if test="equipTypeAmountPage.nameOrCode!=null and equipTypeAmountPage.nameOrCode!=''">
AND (wled.name LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%') or wles.code LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%'))
</if>
<if test="equipTypeAmountPage.code!=null and equipTypeAmountPage.code!=''">
AND wles.code LIKE CONCAT('%',#{equipTypeAmountPage.code},'%')
</if>
......@@ -2195,7 +2209,7 @@
and fs.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
</where>
ORDER BY stateDesc
ORDER BY stateDesc, `fs`.`id`
</select>
<select id="getEquipAlarmInfoNum" resultType="java.util.Map">
......@@ -2623,7 +2637,8 @@
GROUP BY
a.equipmentId
) b
ORDER BY
b.totalNum DESC
</select>
<select id="getPressurePumpInfo" resultType="java.util.Map">
......@@ -3610,6 +3625,7 @@
ifNull( wws.full_name,"") as address,
ifNull(eq.`name`,"") AS equType,
wesp.biz_org_name AS bizOrgName,
wesp.id,
case wsd.status
when '1' then '在位'
......
......@@ -120,8 +120,50 @@
<if test="parentId != null and parentId !=''">
sa.parentId = #{parentId}
</if>
<if test="bizOrgCode != null and bizOrgCode !=''">
sa.bizOrgCode like CONCAT(#{bizOrgCode},'%')
</if>
</where>
</select>
<select id="querySpecialChildrenListByName" resultType="hashmap">
SELECT
*
FROM
(
SELECT
a.instance_id as id,
a.instance_id AS instanceId,
a.group_code AS groupCode,
a.group_type AS groupType,
wlss.scene_id as sceneId,
MAX( CASE WHEN a.field_name = 'parentId' THEN a.field_value END ) AS parentId,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS instanceName,
MAX( CASE WHEN a.field_name = 'name' THEN a.field_value END ) AS name,
MAX( CASE WHEN a.field_name = 'code' THEN a.field_value END ) AS code,
MAX( CASE WHEN a.field_name = 'isRisk' THEN a.field_value END ) AS isRisk,
MAX( CASE WHEN a.field_name = 'address' THEN a.field_value END ) AS address,
MAX( CASE WHEN a.field_name = 'bizOrgCode' THEN a.field_value END ) AS bizOrgCode,
MAX( CASE WHEN a.field_name = 'bizOrgName' THEN a.field_value END ) AS bizOrgName
FROM
`wl_form_instance` a
LEFT JOIN wl_source_scene wlss ON wlss.source_id = a.instance_id
GROUP BY
a.instance_id
) sa
<where>
<if test="parentId != null and parentId !=''">
and sa.parentId = #{parentId}
</if>
<if test="bizOrgCode != null and bizOrgCode !=''">
and sa.bizOrgCode like CONCAT(#{bizOrgCode},'%')
</if>
<if test="name != null and name !=''">
and sa.instanceName like CONCAT('%', #{name}, '%')
</if>
</where>
</select>
<select id="queryPage" resultType="hashmap">
select * from (SELECT
a.instance_id AS instanceId,
......
## DB properties:
spring.datasource.url=jdbc:mysql://172.16.10.211:3306/xiy_bootsystem_jcs_v1.0.0.1_20210729?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url=jdbc:mysql://172.16.11.201:3306/dl_amos_common_biz?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=Yeejoin@2020
## eureka properties:
eureka.client.serviceUrl.defaultZone=http://172.16.10.211:10001/eureka/
eureka.client.serviceUrl.defaultZone=http://172.16.11.201:10001/eureka/
## redis properties:danger/list
spring.redis.database=1
spring.redis.host=172.16.10.211
spring.redis.host=172.16.11.201
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.redis.password=1234560
## ES properties:
biz.elasticsearch.address=172.16.10.211
biz.elasticsearch.address=172.16.11.201
spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes=${biz.elasticsearch.address}:9300
spring.elasticsearch.rest.uris=http://${biz.elasticsearch.address}:9200
......@@ -26,15 +26,15 @@ elasticsearch.password= 123456
## emqx properties:
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.211:2883
emqx.user-name=super
emqx.password=a123456
emqx.broker=tcp://172.16.11.201:1883
emqx.user-name=admin
emqx.password=public
## 规则配置 properties:
## ???? properties:
rule.definition.load=false
rule.definition.model-package=com.yeejoin.amos.boot.module.jcs.api.dto
rule.definition.default-agency=jcs
#rule.definition.local-ip=172.16.10.211
#rule.definition.local-ip=172.16.11.201
## mongodb properties:
#spring.data.mongodb.uri=mongodb://172.16.6.60:27017/command_db
......@@ -45,3 +45,5 @@ file.url=http://39.98.45.134:9000/
video.url=https://11.11.16.4:443/
ifc.url=http://11.11.16.17/IFCInterface
ifc.call-back.localIp=11.11.16.1
personAgencyCode=STATE_GRID
\ No newline at end of file
......@@ -3397,5 +3397,44 @@
</sql>
</changeSet>
<changeSet author="tianyiming" id="2022-09-18-tianyiming">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>add data cb_data_dictionary</comment>
<sql>
INSERT INTO `cb_data_dictionary` VALUES (1600, 'default', '默认角色', 'DEFAULTROLE', NULL, NULL, NULL, NULL, NULL, NULL, b'0', 1);
</sql>
</changeSet>
<changeSet author="tianyiming" id="2022-09-21-tianyiming">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>add data cb_data_dictionary</comment>
<sql>
INSERT INTO `cb_data_dictionary` VALUES (1601, '1601', '驻站消防员', 'DLRYLX', NULL, NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` VALUES (1602, '1602', '运维人员', 'DLRYLX', NULL, NULL, NULL, NULL, NULL, NULL, b'0', 2);
INSERT INTO `cb_data_dictionary` VALUES (1603, '1603', '物业安保人员', 'DLRYLX', NULL, NULL, NULL, NULL, NULL, NULL, b'0', 3);
</sql>
</changeSet>
<changeSet author="tianyiming" id="2022-09-22-tianyiming">
<preConditions onFail="MARK_RAN">
<columnExists tableName="cb_org_usr_agency_user" columnName="user_name"/>
</preConditions>
<comment>cb_org_usr_agency_user CHANGE COLUMN user_name to usr_name</comment>
<sql>
ALTER TABLE `cb_org_usr_agency_user`
CHANGE COLUMN `user_name` `usr_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名' AFTER `sequence_nbr`
</sql>
</changeSet>
</databaseChangeLog>
......@@ -750,7 +750,7 @@
p.route_name routeName,
p.charge_person_id chargePerson,
p.charge_dept_id departmentName,
P.remark
p.remark
FROM
p_point p
<!-- LEFT JOIN s_user u ON u.id = p.charge_person_id
......
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