Commit 95eb629a authored by KeYong's avatar KeYong

更新

parent 49a252d9
package com.yeejoin.amos.boot.module.common.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @author keyong
* @title: CompanyAttachFileDto
* <pre>
* @description: TODO
* </pre>
* @date 2022/4/29 17:20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "CompanyAttachFileDto", description = "文件信息Dto")
public class CompanyAttachFileDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "路径")
private String url;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "类型")
private String type;
}
......@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* @author keyong
......@@ -33,10 +34,10 @@ public class FireCompanyInfoDto extends BaseDto {
private String loadLevel;
@ApiModelProperty(value = "室内管网形式")
private String indoorPipeNetworkType;
private List<String> indoorPipeNetworkType;
@ApiModelProperty(value = "室外管网形式")
private String outdoorPipeNetworkType;
private List<String> outdoorPipeNetworkType;
@ApiModelProperty(value = "安全出口总数")
private String exitNum;
......@@ -57,19 +58,19 @@ public class FireCompanyInfoDto extends BaseDto {
private String positionInfoNorth;
@ApiModelProperty(value = "消防设施平面图")
private String fireEquipFile;
private List<CompanyAttachFileDto> fireEquipFile;
@ApiModelProperty(value = "消防设计审核文件")
private String fireDesignCheckFile;
private List<CompanyAttachFileDto> fireDesignCheckFile;
@ApiModelProperty(value = "消防设计验收文件")
private String fireDesignAcceptanceFile;
private List<CompanyAttachFileDto> fireDesignAcceptanceFile;
@ApiModelProperty(value = "消防安全检查文件")
private String fireSafeCheckFile;
private List<CompanyAttachFileDto> fireSafeCheckFile;
@ApiModelProperty(value = "其他文件")
private String othersFile;
private List<CompanyAttachFileDto> othersFile;
@ApiModelProperty(value = "创建时间")
private Date createDate;
......
......@@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import io.swagger.annotations.ApiModel;
......@@ -92,4 +93,7 @@ public class OrgUsrDto extends BaseDto {
@ApiModelProperty(value = "消防信息")
private FireCompanyInfoDto fireCompanyInfoDto;
@ApiModelProperty(value = "消防信息实体")
private CompanyInfo companyInfo;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -93,6 +95,10 @@ public class OrgUsrFormDto implements Serializable {
@ApiModelProperty(value = "消防安全负责人")
private String xfaq;
@ApiModelProperty(value = "公司消防信息")
@TableField(exist = false)
private CompanyInfo companyInfo;
public void setDynamicFormAlert(List<FormValue> dynamicFormAlert) {
if(dynamicFormAlert!=null) {
dynamicFormAlert.forEach(formValue->{
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyAttachFileDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -10,6 +11,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
/**
* @author keyong
......
......@@ -11,7 +11,9 @@ 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.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.CompanyInfo;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireCompanyInfoServiceImpl;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -86,6 +88,9 @@ public class OrgUsrController extends BaseController {
OrgUsrMapper orgUsrMapper;
@Autowired
FireCompanyInfoServiceImpl fireCompanyInfoServiceImpl;
@Autowired
EmqKeeper emqKeeper;
@Value("${jcs.company.topic.delete:jcs/company/topic/delete}")
private String airportDeleteTopic;
......@@ -124,6 +129,10 @@ public class OrgUsrController extends BaseController {
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public ResponseModel<String> deleteById(HttpServletRequest request, @PathVariable Long id) {
QueryWrapper<CompanyInfo> queryWrapper = new QueryWrapper<>();
CompanyInfo info = fireCompanyInfoServiceImpl.getOne(queryWrapper.eq("instance_id", id));
info.setIsDelete(true);
fireCompanyInfoServiceImpl.updateById(info);
// 删除时,只作逻辑删除
// BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm
// bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start
......
......@@ -102,7 +102,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Autowired
FireStationServiceImpl fireStationServiceImpl;
@Autowired
FireCompanyInfoMapper fireCompanyInfoMapper;
FireCompanyInfoServiceImpl fireCompanyInfoServiceImpl;
@Value("${jcs.company.topic.add:jcs/company/topic/add}")
private String airportAddTopic;
......@@ -698,7 +698,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsrDto orgUsrDto = saveOrgUsrDynamicFormInstance(orgUsr, OrgUsrVo.getDynamicFormValue());
orgUsr.setSequenceNbr(orgUsrDto.getSequenceNbr());
// 储存公司消防信息
saveFireCompanyInfo(orgUsr.getSequenceNbr(), orgUsrDto.getFireCompanyInfoDto());
CompanyInfo info = saveOrUpdateFireCompanyInfo(orgUsr, OrgUsrVo.getFireCompanyInfoDto());
orgUsrDto.setCompanyInfo(info);
/**
* 同步保存ES
*/
......@@ -708,16 +709,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsrDto;
}
public void saveFireCompanyInfo(Long id, FireCompanyInfoDto fireCompanyInfoDto) {
if(ValidationUtil.isEmpty(fireCompanyInfoDto)) {
return;
}
CompanyInfo companyInfo = new CompanyInfo();
BeanUtils.copyProperties(fireCompanyInfoDto, companyInfo);
companyInfo.setInstanceId(id);
fireCompanyInfoMapper.insert(companyInfo);
}
@Override
public OrgUsrDto saveOrgPerson(OrgPersonDto OrgPersonVo) throws Exception {
OrgUsr orgUsr = new OrgUsr();
......@@ -786,7 +777,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
updateById(orgUsr);
// 更新公司消防信息
updateFireCompanyInfo(orgUsr.getSequenceNbr(), orgUsrVo.getFireCompanyInfoDto());
CompanyInfo info = saveOrUpdateFireCompanyInfo(orgUsr, orgUsrVo.getFireCompanyInfoDto());
orgUsrVo.setCompanyInfo(info);
// 保存动态表单数据
updateDynamicFormInstance(orgUsr.getSequenceNbr(), orgUsrVo.getDynamicFormValue());
......@@ -800,14 +792,49 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsrVo;
}
public void updateFireCompanyInfo(Long id, FireCompanyInfoDto fireCompanyInfoDto) {
public CompanyInfo saveOrUpdateFireCompanyInfo(OrgUsr orgUsr, FireCompanyInfoDto fireCompanyInfoDto) {
if (ValidationUtil.isEmpty(fireCompanyInfoDto)) {
return;
return null;
}
CompanyInfo companyInfo = new CompanyInfo();
String indoor = "";
String outdoor = "";
if (!ValidationUtil.isEmpty(fireCompanyInfoDto.getIndoorPipeNetworkType()) && 0 < fireCompanyInfoDto.getIndoorPipeNetworkType().size()) {
indoor = JSON.toJSONString(fireCompanyInfoDto.getIndoorPipeNetworkType());
}
if (!ValidationUtil.isEmpty(fireCompanyInfoDto.getOutdoorPipeNetworkType()) && 0 < fireCompanyInfoDto.getOutdoorPipeNetworkType().size()) {
outdoor = JSON.toJSONString(fireCompanyInfoDto.getOutdoorPipeNetworkType());
}
BeanUtils.copyProperties(fireCompanyInfoDto, companyInfo);
companyInfo.setInstanceId(id);
fireCompanyInfoMapper.updateById(companyInfo);
companyInfo.setIndoorPipeNetworkType(indoor);
companyInfo.setOutdoorPipeNetworkType(outdoor);
if (!ValidationUtil.isEmpty(fireCompanyInfoDto.getFireEquipFile())) {
companyInfo.setFireEquipFile(fireCompanyInfoDto.getFireEquipFile().size() > 0 ?
JSON.toJSONString(fireCompanyInfoDto.getFireEquipFile()) : "");
}
if (!ValidationUtil.isEmpty(fireCompanyInfoDto.getFireDesignCheckFile())) {
companyInfo.setFireDesignCheckFile(fireCompanyInfoDto.getFireDesignCheckFile().size() > 0 ?
JSON.toJSONString(fireCompanyInfoDto.getFireDesignCheckFile()) : "");
}
if (!ValidationUtil.isEmpty(fireCompanyInfoDto.getFireDesignAcceptanceFile())) {
companyInfo.setFireDesignAcceptanceFile(fireCompanyInfoDto.getFireDesignAcceptanceFile().size() > 0 ?
JSON.toJSONString(fireCompanyInfoDto.getFireDesignAcceptanceFile()) : "");
}
if (!ValidationUtil.isEmpty(fireCompanyInfoDto.getFireSafeCheckFile())) {
companyInfo.setFireSafeCheckFile(fireCompanyInfoDto.getFireSafeCheckFile().size() > 0 ?
JSON.toJSONString(fireCompanyInfoDto.getFireSafeCheckFile()) : "");
}
if (!ValidationUtil.isEmpty(fireCompanyInfoDto.getOthersFile())) {
companyInfo.setOthersFile(fireCompanyInfoDto.getOthersFile().size() > 0 ?
JSON.toJSONString(fireCompanyInfoDto.getOthersFile()) : "");
}
companyInfo.setInstanceId(orgUsr.getSequenceNbr());
companyInfo.setRecUserId(String.valueOf(orgUsr.getSequenceNbr()));
companyInfo.setRecUserName(orgUsr.getRecUserName());
companyInfo.setRecDate(new Date());
fireCompanyInfoServiceImpl.saveOrUpdate(companyInfo);
return companyInfo;
}
@Override
......@@ -894,6 +921,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (orgUsr.getParentId() != null) {
orgUsrFormVo.setParentName(getById(orgUsr.getParentId()).getBizOrgName());
}
CompanyInfo info = fireCompanyInfoServiceImpl.getOne(new QueryWrapper<CompanyInfo>().eq("instance_id", id));
orgUsrFormVo.setCompanyInfo(info);
return orgUsrFormVo;
}
......@@ -1696,7 +1725,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
/**
* 查询组织机构下面的人员信息
*
* @param id
* @param ids
* @return
*/
@Override
......
......@@ -2933,6 +2933,9 @@
CREATE TABLE `cb_fire_company_info` (
`sequence_nbr` bigint(22) NOT NULL,
`instance_id` bigint(22) NOT NULL COMMENT '人员部门公司表主键',
`rec_user_id` bigint(30) NOT NULL COMMENT '更新用户id',
`rec_user_name` varchar(30) NOT NULL COMMENT '更新用户名称',
`rec_date` datetime NOT NULL COMMENT '更新日期',
`floor_space` varchar(15) CHARACTER SET utf8 DEFAULT NULL COMMENT '占地面积',
`load_level` varchar(15) CHARACTER SET utf8 DEFAULT NULL COMMENT '负荷等级',
`indoor_pipe_network_type` varchar(15) CHARACTER SET utf8 DEFAULT NULL COMMENT '室内管网形式',
......@@ -2943,12 +2946,11 @@
`position_info_direction_west` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '毗邻单位西',
`position_info_direction_south` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '毗邻单位南',
`position_info_direction_north` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '毗邻单位北',
`rec_date` datetime DEFAULT NULL COMMENT '创建时间',
`fire_equip_file` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '消防设施平面图',
`fire_design_check_file` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '消防设计审核文件',
`fire_design_acceptance_file` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '消防设计验收文件',
`fire_safe_check_file` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '消防安全检查文件',
`others_file` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '其他文件',
`fire_equip_file` text CHARACTER SET utf8 DEFAULT NULL COMMENT '消防设施平面图',
`fire_design_check_file` text CHARACTER SET utf8 DEFAULT NULL COMMENT '消防设计审核文件',
`fire_design_acceptance_file` text CHARACTER SET utf8 DEFAULT NULL COMMENT '消防设计验收文件',
`fire_safe_check_file` text CHARACTER SET utf8 DEFAULT NULL COMMENT '消防安全检查文件',
`others_file` text CHARACTER SET utf8 DEFAULT NULL COMMENT '其他文件',
`is_delete` bit(1) DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`sequence_nbr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司信息表';
......
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