Commit 469ed249 authored by chenhao's avatar chenhao

修改重点部位excle导入和导出,以及机场部位树的数据 by 陈浩

parent c4f1800b
......@@ -30,9 +30,15 @@ public class KeySiteDto extends BaseDto implements Serializable{
@ApiModelProperty(value = "所属单位/部门id")
private Long belongId;
@ApiModelProperty(value = "所属单位/部门名称")
private String belongName;
@ApiModelProperty(value = "所属建筑id")
private Long buildingId;
@ApiModelProperty(value = "所属建筑名称")
private String buildingName;
@ApiModelProperty(value = "位置描述")
private String addressDesc;
......@@ -62,7 +68,7 @@ public class KeySiteDto extends BaseDto implements Serializable{
private String fireFacilitiesInfo;
@ApiModelProperty(value = "防火标志设立情况")
private String firePreventionFlag;
private Boolean firePreventionFlag;
@ApiModelProperty(value = "危险源")
private String hazard;
......@@ -79,9 +85,10 @@ public class KeySiteDto extends BaseDto implements Serializable{
@ApiModelProperty(value = "使用性质名称")
private String useNatureName;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "附件")
private Map<String, List<AttachmentDto>> attachments;
}
......@@ -5,6 +5,7 @@ import java.io.Serializable;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -28,6 +29,7 @@ public class KeySiteExcleDto implements Serializable {
private String name;
@ExcelProperty(value = "所属单位/部门id", index = 1)
@ExplicitConstraint(indexNum = 1, sourceClass = RoleNameExplicitConstraint.class, method = "getCompanyList") //固定下拉内容
@ApiModelProperty(value = "所属单位/部门id")
private String belongName;
......@@ -35,6 +37,7 @@ public class KeySiteExcleDto implements Serializable {
private Long belongId;
@ExcelProperty(value = "所属建筑id", index = 2)
@ExplicitConstraint(indexNum = 2, sourceClass = RoleNameExplicitConstraint.class, method = "getBuildTree") //固定下拉内容
@ApiModelProperty(value = "所属建筑id")
private String buildingName;
......@@ -80,7 +83,7 @@ public class KeySiteExcleDto implements Serializable {
@ExcelProperty(value = "防火标志设立情况", index = 12)
@ApiModelProperty(value = "防火标志设立情况")
private String firePreventionFlag;
private String firePreventionFlagName;
@ExcelProperty(value = "危险源", index = 13)
@ApiModelProperty(value = "危险源")
......
......@@ -26,6 +26,7 @@ public class OrgMenuDto {
private List<OrgMenuDto> children;
private String bizOrgType;
private String bizOrgCode;
private int num;//统计值
public Boolean getLeaf() {
return ObjectUtils.isEmpty(children);
......@@ -52,7 +53,16 @@ public class OrgMenuDto {
this.leaf = leaf;
this.bizOrgCode = bizOrgCode;
}
public OrgMenuDto(Long key, String title, Long parentId, String bizOrgType, boolean leaf, String bizOrgCode,int num) {
super();
this.key = key;
this.title = title;
this.parentId = parentId;
this.bizOrgType = bizOrgType;
this.leaf = leaf;
this.bizOrgCode = bizOrgCode;
this.num=num;
}
public OrgMenuDto(Long key, String title, Long parentId, String bizOrgType, boolean leaf) {
super();
this.key = key;
......
......@@ -34,5 +34,5 @@ public class OrgUsrTreeDto extends BaseDto implements Serializable{
@ApiModelProperty(value = "归属机构")
private String parentId;
@ApiModelProperty(value = "部门数量")
private String num;
private int num;
}
......@@ -4,8 +4,8 @@ import java.util.List;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrTreeDto;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
/**
* 重点部位接口类
......@@ -31,12 +31,12 @@ public KeySiteDto save(KeySiteDto model);
* @param keySite
* @return
*/
public boolean update (KeySite keySite);
public boolean update (KeySiteDto keySite);
/**
* 获取机场单位组织结构树,包含单位下部门数量的统计
* @return
*/
public List<OrgUsrTreeDto> getOrguserTree();
public List<OrgMenuDto> getOrguserTree();
/**
*
* @return
......@@ -52,4 +52,9 @@ public KeySiteDto getSequenceNbr(Long sequenceNbr);
public List<KeySiteExcleDto> exportToExcel();
public boolean saveExcle(List<KeySiteExcleDto> excelDtoList);
/**获取所在建筑的树结构信息
*
* @return
*/
public List<Object> getBuildTree() ;
}
......@@ -9,7 +9,9 @@
SELECT
c.`name` as name,
c.belong_id as belongId,
cou.biz_org_name as belongName,
c.building_id as buildingId,
c.building_name as buildingName,
c.address_desc as addressDesc,
c.building_area as buildingArea,
c.building_height as buildingHeight,
......@@ -49,6 +51,7 @@ LEFT JOIN (
cb_key_site c
LEFT JOIN cb_data_dictionary b ON c.use_nature = b.`code`
) un ON c.use_nature = un.use_nature
left join cb_org_usr cou on c.building_id =cou.sequence_nbr
where c.is_delete=FALSE
<if test="name != null and name != ''">
AND c.`name`=#{name}
......@@ -73,7 +76,9 @@ where c.is_delete=FALSE
SELECT
c.`name` as name,
c.belong_id as belongId,
cou.biz_org_name as belongName,
c.building_id as buildingId,
c.building_name as buildingName,
c.address_desc as addressDesc,
c.building_area as buildingArea,
c.building_height as buildingHeight,
......@@ -113,6 +118,7 @@ LEFT JOIN (
cb_key_site c
LEFT JOIN cb_data_dictionary b ON c.use_nature = b.`code`
) un ON c.use_nature = un.use_nature
left join cb_org_usr cou on c.building_id =cou.sequence_nbr
where c.sequence_nbr=#{sequenceNbr} and c.is_delete=FALSE;
</select>
......@@ -121,7 +127,9 @@ where c.sequence_nbr=#{sequenceNbr} and c.is_delete=FALSE;
SELECT
c.`name` as name,
c.belong_id as belongId,
cou.biz_org_name as belongName,
c.building_id as buildingId,
c.building_name as buildingName,
c.address_desc as addressDesc,
c.building_area as buildingArea,
c.building_height as buildingHeight,
......@@ -161,6 +169,7 @@ LEFT JOIN (
cb_key_site c
LEFT JOIN cb_data_dictionary b ON c.use_nature = b.`code`
) un ON c.use_nature = un.use_nature
left join cb_org_usr cou on c.building_id =cou.sequence_nbr
where c.is_delete=FALSE;
</select>
......
......@@ -15,5 +15,10 @@
<artifactId>amos-boot-module-common-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-jcs-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
</dependencies>
</project>
......@@ -80,7 +80,7 @@ public class KeySiteController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "update/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新重点部位", notes = "根据sequenceNbr更新重点部位")
public ResponseModel<Boolean> updateBySequenceNbrKeySite(@RequestBody KeySite model) {
public ResponseModel<Boolean> updateBySequenceNbrKeySite(@RequestBody KeySiteDto model) {
return ResponseHelper.buildResponse(keySiteService.update(model));
}
......@@ -150,10 +150,7 @@ public class KeySiteController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "机场单位组织结构树", notes = "机场单位组织结构树")
@GetMapping(value = "/getOrguserTree")
public ResponseModel<List<OrgMenuDto>> getOrguserTree() throws Exception{
List<OrgMenuDto> menus = iOrgUsrService.getTree(null,
keySiteService.getOrguserTree(), OrgUsrTreeDto.class.getName(),
"getSequenceNbr", 2, "getBizOrgName", "getParentId", "getNum");
return ResponseHelper.buildResponse(menus);
return ResponseHelper.buildResponse(keySiteService.getOrguserTree());
}
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -11,29 +32,16 @@ import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.DataDictionary;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.ExcelSelectData;
import com.yeejoin.amos.boot.module.common.api.excel.DataSources;
import com.yeejoin.amos.boot.module.common.api.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.feign.EquipFeignClient;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class DataSourcesImpl implements DataSources {
......@@ -55,6 +63,8 @@ public class DataSourcesImpl implements DataSources {
IMaintenanceCompanyService maintenanceCompanyService;
@Autowired
IKeySiteService keySiteService;
@Autowired
private RestTemplate restTemplate;
@Value("${security.systemctl.name}")
......@@ -111,6 +121,10 @@ public class DataSourcesImpl implements DataSources {
break;
case "getCompanyAndDeparementTree":
str= getCompanyAndDeparementTree();
break;
case "getBuildTree":
str=getBuildTree();
break;
}
}
return str;
......@@ -226,4 +240,23 @@ public class DataSourcesImpl implements DataSources {
return str;
}
private String[] getBuildTree() throws Exception {
List<Object> menus = keySiteService.getBuildTree();
List<String> stringList = new ArrayList<String>();
initBuildTreeList(menus, stringList);
String[] str = stringList.toArray(new String[stringList.size()]);
return str;
}
private void initBuildTreeList(List<Object> menus, List<String> stringList) {
for (Object orgMenuDto : menus) {
JSONObject detailObject= JSONObject.parseObject(orgMenuDto.toString());
stringList.add(detailObject.getString("id") + "@" + detailObject.getString("name"));
JSONArray children = detailObject.getJSONArray("children");
if (children != null && children.size() > 0) {
initBuildTreeList(children, stringList);
}
}
}
}
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