瀏覽代碼

更新联系人、excel

wuweihao 3 年之前
父節點
當前提交
fbf94bf7ad

+ 5 - 2
gis_application/src/main/resources/application-dev.properties

@@ -3,8 +3,11 @@
 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 spring.datasource.druid.username=root
-spring.datasource.druid.url=jdbc:mysql://8.135.106.227:3306/${project.en}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
-spring.datasource.druid.password=4dkk2021testproject%
+#spring.datasource.druid.url=jdbc:mysql://8.135.106.227:3306/${project.en}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+#spring.datasource.druid.password=4dkk2021testproject%
+
+spring.datasource.druid.url=jdbc:mysql://127.0.0.1:3306/${project.en}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.password=root
 
 
 # \u521D\u59CB\u8FDE\u63A5\u6570

+ 19 - 7
gis_cms/src/main/java/com/gis/cms/controller/HotelController.java

@@ -4,6 +4,8 @@ import com.gis.cms.entity.dto.HotelDto;
 import com.gis.cms.entity.dto.HotelPageDto;
 import com.gis.cms.entity.dto.RoomDto;
 import com.gis.cms.entity.po.HotelEntity;
+import com.gis.cms.entity.vo.ContactTypeVo;
+import com.gis.cms.service.ContactService;
 import com.gis.cms.service.HotelService;
 import com.gis.common.base.aop.WebControllerLog;
 import com.gis.common.util.Result;
@@ -17,7 +19,7 @@ import javax.validation.Valid;
 /**
  * Created by owen on 2022/3/24 0008 9:54
  */
-@Api(tags = "v0.2-酒店管理")
+@Api(tags = "v0.3-酒店管理")
 @RestController
 @RequestMapping("/cms/hotel")
 public class HotelController {
@@ -25,6 +27,9 @@ public class HotelController {
     @Autowired
     HotelService entityService;
 
+    @Autowired
+    ContactService contactService;
+
 
     @ApiOperation(value = "列表", notes = "隔离人数共用")
     @PostMapping("list")
@@ -34,22 +39,22 @@ public class HotelController {
 
 
     @WebControllerLog(description = "领导管理-新增/编辑", addDb = true)
-    @ApiOperation(value = "v0.1-新增/编辑")
-    @PostMapping("save")
+    @ApiOperation(value = "v0.3--新增/编辑")
+    @PostMapping("/save")
     public Result save(@Valid @RequestBody HotelDto param) {
         return entityService.saveEntity(param);
     }
 
     @ApiOperation("删除")
-    @GetMapping("remove/{id}")
+    @GetMapping("/remove/{id}")
     public Result remove(@PathVariable Long id) {
         return Result.success(entityService.removeById(id));
     }
 
-    @ApiOperation("详情")
-    @GetMapping("detail/{id}")
+    @ApiOperation("v0.3-详情")
+    @GetMapping("/detail/{id}")
     public Result<HotelEntity> detail(@PathVariable Long id) {
-        return Result.success(entityService.getById(id));
+        return entityService.detail(id);
     }
 
     @ApiOperation(value = "是否显示", notes = "display: 1:显示, 0:不显示")
@@ -73,6 +78,13 @@ public class HotelController {
         return entityService.exportExcel();
     }
 
+    @ApiOperation("v0.3-获取联系人类型")
+    @GetMapping("/getContactType")
+    public Result<ContactTypeVo> getContactType() {
+        return Result.success(contactService.getContactTypes());
+    }
+
+
 
 
 

+ 3 - 3
gis_cms/src/main/java/com/gis/cms/controller/WebController.java

@@ -13,7 +13,7 @@ import javax.validation.Valid;
 /**
  * Created by owen on 2022/3/24 0008 9:54
  */
-@Api(tags = "v0.1-展示端")
+@Api(tags = "v0.3-展示端")
 @RestController
 @RequestMapping("/web")
 public class WebController {
@@ -36,8 +36,8 @@ public class WebController {
     }
 
 
-    @ApiOperation(value = "详情")
-    @GetMapping("detail/{id}")
+    @ApiOperation(value = "v0.3-详情")
+    @GetMapping("/detail/{id}")
     public Result detail(@PathVariable Long id) {
         return entityService.detail(id);
     }

+ 25 - 0
gis_cms/src/main/java/com/gis/cms/entity/dto/ContactDto.java

@@ -0,0 +1,25 @@
+package com.gis.cms.entity.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2022/7/8 0008 9:20
+ */
+@Data
+public class ContactDto {
+
+    @NotBlank(message = "联系人类型不能为空")
+    @ApiModelProperty(value = "类型:联系人类型Id", required = true)
+    private Long contactTypeId;
+
+    @NotBlank(message = "名称不能为空")
+    @ApiModelProperty(value = "名称", required = true)
+    private String name;
+
+    @NotBlank(message = "电话不能为空")
+    @ApiModelProperty(value = "电话", required = true)
+    private String phone;
+}

+ 17 - 1
gis_cms/src/main/java/com/gis/cms/entity/dto/HotelDto.java

@@ -46,8 +46,24 @@ public class HotelDto {
     @ApiModelProperty(value = "备注")
     private String remark;
 
+//    @ApiModelProperty(value = "联系人, 允许多个")
+//    private String contact;
     @ApiModelProperty(value = "联系人, 允许多个")
-    private String contact;
+    private List<ContactDto> contacts;
+
+    @ApiModelProperty(value = "签约情况")
+    private Integer caseSign ;
+
+    @ApiModelProperty(value = "验收情况")
+    private Integer caseAccept ;
+
+
+    @ApiModelProperty(value = "三区两通道搭建情况")
+    private Integer caseBuild ;
+
+
+    @ApiModelProperty(value = "物资情况")
+    private Integer caseSupplies;
 
 
 }

+ 30 - 0
gis_cms/src/main/java/com/gis/cms/entity/po/ContactEntity.java

@@ -0,0 +1,30 @@
+package com.gis.cms.entity.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.gis.common.base.entity.po.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2022/7/8 0008 9:17
+ * 联系人
+ */
+@Data
+@TableName(value = "tb_contact")
+public class ContactEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -9100791278654174939L;
+    @ApiModelProperty(value = "类型:联系人类型Id")
+    private Long contactTypeId;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+    @ApiModelProperty(value = "酒店Id")
+    private Long hotelId;
+}

+ 23 - 3
gis_cms/src/main/java/com/gis/cms/entity/po/HotelEntity.java

@@ -1,11 +1,14 @@
 package com.gis.cms.entity.po;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.gis.cms.entity.vo.ContactVo;
 import com.gis.common.base.entity.po.BaseEntity;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * 酒店
@@ -29,7 +32,6 @@ public class HotelEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "管理单位")
     private String unit;
 
-//    @ApiModelProperty(value = "用途 > local:本土, import:入境, hold:待定")
     @ApiModelProperty(value = "用途 > 1:本土人员-密接, 2:本土人员-次密, 3:入境人员, 4:国内中高风险, 5:其他-海外中高风险, 6:其他-走私偷渡, 7:其他-转运司机, 8:待定")
     private String type;
 
@@ -46,8 +48,8 @@ public class HotelEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "显示:1:显示, 0:不显示(默认)")
     private Integer display;
 
-    @ApiModelProperty(value = "联系人, 允许多个")
-    private String contact;
+//    @ApiModelProperty(value = "联系人, 允许多个")
+//    private String contact;
 
 
     @ApiModelProperty(value = "房间总数")
@@ -84,6 +86,24 @@ public class HotelEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "预订数")
     private Integer book;
 
+    @ApiModelProperty(value = "联系人")
+    @TableField(exist  = false)
+    private List<ContactVo> contacts;
+
+
+    @ApiModelProperty(value = "签约情况")
+    private Integer caseSign ;
+
+    @ApiModelProperty(value = "验收情况")
+    private Integer caseAccept ;
+
+
+    @ApiModelProperty(value = "三区两通道搭建情况")
+    private Integer caseBuild ;
+
+
+    @ApiModelProperty(value = "物资情况")
+    private Integer caseSupplies ;
 
 
 

+ 20 - 0
gis_cms/src/main/java/com/gis/cms/entity/vo/ContactTypeVo.java

@@ -0,0 +1,20 @@
+package com.gis.cms.entity.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * Created by owen on 2022/7/8 0008 9:12
+ * 联系人-字典
+ */
+@Data
+public class ContactTypeVo  {
+
+    @ApiModelProperty(value = "对象ID")
+    private Long id;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+}

+ 25 - 0
gis_cms/src/main/java/com/gis/cms/entity/vo/ContactVo.java

@@ -0,0 +1,25 @@
+package com.gis.cms.entity.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2022/7/8 0008 9:17
+ * 联系人
+ */
+@Data
+public class ContactVo {
+
+    @ApiModelProperty(value = "类型:联系人类型Id")
+    private Long contactTypeId;
+
+    @ApiModelProperty(value = "类型名称")
+    private String contactType;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+}

+ 70 - 2
gis_cms/src/main/java/com/gis/cms/entity/vo/HotelExcel.java

@@ -42,12 +42,80 @@ public class HotelExcel implements Serializable {
     @ApiModelProperty(value = "次密人数数")
     private Integer touchSecond;
 
-    @ApiModelProperty(value = "联系人, 允许多个")
-    private String contact;
+
+
+
+//    @ApiModelProperty(value = "联系人, 允许多个")
+//    private String contact;
 
     @ApiModelProperty(value = "备注")
     private String remark;
 
+    @ApiModelProperty(value = "签约情况")
+    private Integer caseSign ;
+
+    @ApiModelProperty(value = "验收情况")
+    private Integer caseAccept ;
+
+
+    @ApiModelProperty(value = "三区两通道搭建情况")
+    private Integer caseBuild ;
+
+
+    @ApiModelProperty(value = "物资情况")
+    private Integer caseSupplies ;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c1;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c2;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c3;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c4;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c5;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c6;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c7;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c8;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c9;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c10;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c11;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c12;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c13;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c14;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c15;
+
+    @ApiModelProperty(value = "联系人-1")
+    private String c16;
+
+
+
+
 
 
 

+ 31 - 0
gis_cms/src/main/java/com/gis/cms/mapper/ContactMapper.java

@@ -0,0 +1,31 @@
+package com.gis.cms.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gis.cms.entity.po.ContactEntity;
+import com.gis.cms.entity.po.HotelEntity;
+import com.gis.cms.entity.vo.ContactTypeVo;
+import com.gis.cms.entity.vo.ContactVo;
+import com.gis.cms.entity.vo.HotelExcel;
+import com.gis.cms.entity.vo.HotelVo;
+import com.gis.common.base.mapper.provider.BaseProvider;
+import org.apache.ibatis.annotations.*;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+@Component
+@Mapper
+public interface ContactMapper extends BaseMapper<ContactEntity> {
+
+    @Delete("delete from tb_contact where hotel_id = #{hotelId}")
+    void delByHotelId(Long hotelId);
+
+    @Select("select a.*, b.name as contactType from tb_contact a left join tb_contact_type b on b.id=a.contact_type_id where a.is_delete=0 and a.hotel_id=#{hotelId}")
+    List<ContactVo> findByHotelId(Long hotelId);
+
+    @Select("select * from tb_contact_type where is_delete=0")
+    List<ContactTypeVo> getContactTypes();
+}

+ 29 - 0
gis_cms/src/main/java/com/gis/cms/service/ContactService.java

@@ -0,0 +1,29 @@
+package com.gis.cms.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gis.cms.entity.dto.HotelDto;
+import com.gis.cms.entity.dto.HotelPageDto;
+import com.gis.cms.entity.dto.RoomDto;
+import com.gis.cms.entity.po.ContactEntity;
+import com.gis.cms.entity.po.HotelEntity;
+import com.gis.cms.entity.vo.ContactTypeVo;
+import com.gis.cms.entity.vo.ContactVo;
+import com.gis.cms.entity.vo.HotelVo;
+import com.gis.common.util.Result;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2021/12/8 0011 16:14
+ */
+public interface ContactService extends IService<ContactEntity> {
+
+
+    void delByHotelId(Long hotelId);
+
+    List<ContactVo> findByHotelId(Long id);
+
+    List<ContactTypeVo> getContactTypes();
+}

+ 62 - 0
gis_cms/src/main/java/com/gis/cms/service/impl/ContactServiceImpl.java

@@ -0,0 +1,62 @@
+package com.gis.cms.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gis.admin.service.SysRoleService;
+import com.gis.cms.entity.po.ContactEntity;
+import com.gis.cms.entity.vo.ContactTypeVo;
+import com.gis.cms.entity.vo.ContactVo;
+import com.gis.cms.mapper.ContactMapper;
+import com.gis.cms.service.ContactService;
+import com.gis.cms.zhengyuan.ZhengYuanService;
+import com.gis.common.base.service.LogService;
+import com.gis.common.base.service.impl.IBaseService;
+import com.gis.common.constant.ConfigConstant;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class ContactServiceImpl extends ServiceImpl<ContactMapper, ContactEntity> implements ContactService {
+
+
+    @Autowired
+    IBaseService iBaseService;
+
+    @Autowired
+    SysRoleService roleService;
+
+    @Autowired
+    ZhengYuanService zhengYuanService;
+
+    @Autowired
+    ConfigConstant configConstant;
+
+    @Autowired
+    LogService logService;
+
+    @Autowired
+    IBaseService baseService;
+
+
+    @Override
+    public void delByHotelId(Long hotelId) {
+        baseMapper.delByHotelId(hotelId);
+    }
+
+    @Override
+    public List<ContactVo> findByHotelId(Long hotelId) {
+        return baseMapper.findByHotelId(hotelId);
+    }
+
+    @Override
+    public List<ContactTypeVo> getContactTypes() {
+        return baseMapper.getContactTypes();
+    }
+}

+ 153 - 6
gis_cms/src/main/java/com/gis/cms/service/impl/HotelServiceImpl.java

@@ -7,13 +7,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.gis.admin.service.SysRoleService;
+import com.gis.cms.entity.dto.ContactDto;
 import com.gis.cms.entity.dto.HotelDto;
 import com.gis.cms.entity.dto.HotelPageDto;
 import com.gis.cms.entity.dto.RoomDto;
+import com.gis.cms.entity.po.ContactEntity;
 import com.gis.cms.entity.po.HotelEntity;
+import com.gis.cms.entity.vo.ContactTypeVo;
+import com.gis.cms.entity.vo.ContactVo;
 import com.gis.cms.entity.vo.HotelExcel;
 import com.gis.cms.entity.vo.HotelVo;
 import com.gis.cms.mapper.HotelMapper;
+import com.gis.cms.service.ContactService;
 import com.gis.cms.service.HotelService;
 import com.gis.cms.zhengyuan.ZhengYuanService;
 import com.gis.common.base.entity.po.LogEntity;
@@ -32,10 +37,9 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
+import java.util.*;
 import java.util.concurrent.ExecutorService;
+import java.util.stream.Collectors;
 
 
 /**
@@ -64,6 +68,9 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> impl
     @Autowired
     IBaseService baseService;
 
+    @Autowired
+    ContactService contactService;
+
 
 
     @Override
@@ -233,7 +240,11 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> impl
 
     @Override
     public Result detail(Long id) {
-        return Result.success(getById(id));
+        HotelEntity entity = this.getById(id);
+
+        List<ContactVo> contacts = contactService.findByHotelId(id);
+        entity.setContacts(contacts);
+        return Result.success(entity);
     }
 
 
@@ -255,12 +266,42 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> impl
         BeanUtils.copyProperties(param, entity);
         this.saveOrUpdate(entity);
 
+        // 更新联系人
+        this.updateContact(param.getContacts(), id);
         return Result.success();
     }
 
+
+    /**
+     * by owen 2022-07-08
+     * 更新联系人
+     * @param param
+     * @param hotelId
+     */
+    private void updateContact(List<ContactDto> param, Long hotelId){
+        // 先删除、再新添加数据
+        if (param.size() > 0){
+            log.info("需要添加联系人数量: {}", param.size());
+            contactService.delByHotelId(hotelId);
+
+            // 添加数据
+            ArrayList<ContactEntity> list = new ArrayList<>();
+            for (ContactDto dto : param) {
+                ContactEntity entity = new ContactEntity();
+                BeanUtils.copyProperties(dto, entity);
+                entity.setHotelId(hotelId);
+                list.add(entity);
+            }
+            contactService.saveBatch(list);
+
+        }
+
+    }
+
     @Override
     public Result exportExcel(){
-        List<HotelExcel> rows = baseMapper.getExcelList();
+//        List<HotelExcel> rows = baseMapper.getExcelList();
+        List<HotelExcel> rows = getRows();
         String filePath = "/excel/" + DateUtils.getDateTime() +  ".xlsx";
 
         //LinkedHashMap 中的数据是根据put先后顺序来的,HashMap数据时无序的
@@ -275,8 +316,17 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> impl
         rowTitle.put("usable", "房间可用");
         rowTitle.put("touch", "密接人数");
         rowTitle.put("touchSecond", "次密人数数");
-        rowTitle.put("contact", "联系人");
+//        rowTitle.put("contact", "联系人");
         rowTitle.put("remark", "备注");
+        rowTitle.put("caseSign", "签约情况");
+        rowTitle.put("caseAccept", "验收情况");
+        rowTitle.put("caseBuild", "三区两通道搭建情况");
+        rowTitle.put("caseSupplies", "物资情况");
+
+
+        rowTitle.putAll(getContactTypeTitle());
+
+
 
         ExcelUtils.createExcel(rows, configConstant.serverBasePath + filePath, rowTitle);
 
@@ -288,5 +338,102 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, HotelEntity> impl
     }
 
 
+    /**
+     * 封装联系人excel Title
+     * @return
+     */
+    private LinkedHashMap<String, String> getContactTypeTitle(){
+        List<ContactTypeVo> contactTypes = contactService.getContactTypes();
+        // 封装联系人title
+        LinkedHashMap<String, String> rowTitle = new LinkedHashMap<>();
+        for (ContactTypeVo vo : contactTypes) {
+                rowTitle.put("c"+vo.getId(), vo.getName());
+        }
+        return rowTitle;
+    }
+
+
+    /**
+     * 获取酒店行
+     * @return
+     */
+    private List<HotelExcel> getRows(){
+
+        // 获取酒店
+        List<HotelExcel> rows = baseMapper.getExcelList();
+
+        // 所以联系人
+        List<ContactEntity> contacts = contactService.list();
+
+        // 根据酒店id分组, 再根据类型类型进行分组
+        Map<Long, Map<Long, List<ContactEntity>>> group = contacts.stream().collect(Collectors.groupingBy(ContactEntity::getHotelId, Collectors.groupingBy(ContactEntity::getContactTypeId)));
+        HashMap<Long, Map<String, String>> resMap = new HashMap<>();
+        for (Map.Entry<Long, Map<Long, List<ContactEntity>>> entry : group.entrySet()) {
+
+            ContactTypeVo vo = null;
+            // 每一个类型,只有一条数据
+            Map<String, String> resGroupType = new HashMap<>();
+            // 联系类型数据合并
+            Map<Long, List<ContactEntity>> value = entry.getValue();
+            for (Map.Entry<Long, List<ContactEntity>> contactMap : value.entrySet()) {
+                List<ContactEntity> contactList = contactMap.getValue();
+                // 封装统一联系类型 的 联系人信息
+                StringBuilder builder = new StringBuilder();
+                for (ContactEntity entity : contactList) {
+                     builder.append(entity.getName()).append(",");
+                     builder.append(entity.getPhone()).append(";\r\n");
+                }
+
+                // 合并后的联系人信息
+//                vo = new ContactTypeVo();
+//                vo.setId(contactMap.getKey());
+//                vo.setName(builder.toString());
+                resGroupType.put(contactMap.getKey().toString(), builder.toString());
+            }
+            resMap.put(entry.getKey(), resGroupType);
+        }
+
+
+        // 将联系人信息添加到酒店详情
+        List<HotelExcel> newRows = new ArrayList<>();
+        for (HotelExcel row : rows) {
+
+            for (Map.Entry<Long, Map<String, String>> entry : resMap.entrySet()) {
+                if (row.getId().equals(entry.getKey())){
+                    // 类型人类型
+                    Map<String, String> value = entry.getValue();
+//                    System.out.println("==================" + value.get(1));
+//                    System.out.println("==================" + value.get(2));
+                    row.setC1(value.get("1"));
+                    row.setC2(value.get("2"));
+                    row.setC3(value.get("3"));
+                    row.setC4(value.get("4"));
+                    row.setC5(value.get("5"));
+                    row.setC6(value.get("6"));
+                    row.setC7(value.get("7"));
+                    row.setC8(value.get("8"));
+                    row.setC9(value.get("9"));
+                    row.setC10(value.get("10"));
+                    row.setC11(value.get("11"));
+                    row.setC12(value.get("12"));
+                    row.setC13(value.get("13"));
+                    row.setC14(value.get("14"));
+                    row.setC15(value.get("15"));
+                    row.setC16(value.get("16"));
+                }
+            }
+            newRows.add(row);
+        }
+
+
+
+
+    return newRows;
+
+
+
+    }
+
+
 
 }

+ 8 - 0
gis_common/src/main/java/com/gis/common/util/ExcelUtils.java

@@ -26,14 +26,22 @@ public class ExcelUtils {
         ExcelWriter writer = ExcelUtil.getWriter(savePath);
 
         //自定义标题别名
+//        int i = 0;
         if (rowTitle != null) {
             for (Map.Entry<String, String> a : rowTitle.entrySet()) {
                 writer.addHeaderAlias(a.getKey(), a.getValue());
+                // 列宽
+                // writer.setColumnWidth(i, 100);
+//                writer.setRowHeight(i, 100);
+
+//                i ++;
+
             }
         }
 
         // 一次性写出内容,使用默认样式,强制输出标题
         writer.write(rows, true);
+//        writer.setRowHeight(36, 100);
         // 关闭writer,释放内存
         writer.close();
         log.info("excel完成:" +  savePath);