Browse Source

人房管理代码迁移

feature/codemove
wanggongfeng 3 years ago
parent
commit
7aa911fb46
  1. 94
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/personroom/controller/EpidemicPlotBuildingErrorController.java
  2. 4
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/personroom/service/impl/EpidemicPlotBuildingServiceImpl.java
  3. 14
      epdc-cloud-custom/src/main/resources/mapper/personroom/EpidemicPlotBuildingDao.xml
  4. 6
      epdc-cloud-custom/src/main/resources/mapper/personroom/EpidemicPlotBuildingErrorDao.xml
  5. 2
      epdc-cloud-custom/src/main/resources/mapper/personroom/EpidemicPlotCoordinateDao.xml

94
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/personroom/controller/EpidemicPlotBuildingErrorController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.personroom.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.personroom.EpidemicPlotBuildingErrorDTO;
import com.elink.esua.epdc.modules.personroom.excel.EpidemicPlotBuildingErrorExcel;
import com.elink.esua.epdc.modules.personroom.service.EpidemicPlotBuildingErrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 小区楼栋信息
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2022-04-25
*/
@RestController
@RequestMapping("epidemicplotbuildingerror")
public class EpidemicPlotBuildingErrorController {
@Autowired
private EpidemicPlotBuildingErrorService epidemicPlotBuildingErrorService;
@GetMapping("page")
public Result<PageData<EpidemicPlotBuildingErrorDTO>> page(@RequestParam Map<String, Object> params){
PageData<EpidemicPlotBuildingErrorDTO> page = epidemicPlotBuildingErrorService.page(params);
return new Result<PageData<EpidemicPlotBuildingErrorDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<EpidemicPlotBuildingErrorDTO> get(@PathVariable("id") String id){
EpidemicPlotBuildingErrorDTO data = epidemicPlotBuildingErrorService.get(id);
return new Result<EpidemicPlotBuildingErrorDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody EpidemicPlotBuildingErrorDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
epidemicPlotBuildingErrorService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody EpidemicPlotBuildingErrorDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
epidemicPlotBuildingErrorService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
epidemicPlotBuildingErrorService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<EpidemicPlotBuildingErrorDTO> list = epidemicPlotBuildingErrorService.getErrorExcelList(params);
ExcelUtils.exportExcelToTarget(response, null, list, EpidemicPlotBuildingErrorExcel.class);
}
}

4
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/personroom/service/impl/EpidemicPlotBuildingServiceImpl.java

@ -213,6 +213,7 @@ public class EpidemicPlotBuildingServiceImpl extends CrudServiceImpl<EpidemicPlo
@Override
public Result importBuilding(MultipartFile file) {
log.info("+++++++++++进入导入方法");
// 文件基本信息检查
AllDeptDTO allDeptInfo = checkInfo(file);
@ -223,13 +224,14 @@ public class EpidemicPlotBuildingServiceImpl extends CrudServiceImpl<EpidemicPlo
ImportParams importParams = new ImportParams();
// excel数据
List<EpidemicPlotBuildingImportExcel> recordList = ExcelImportUtil.importExcel(f, EpidemicPlotBuildingImportExcel.class, importParams);
log.info("+++++++++++转成功");
// 未成功匹配数据
List<EpidemicPlotBuildingImportExcel> nonExistInfoList = new ArrayList<>();
//字典类型数据
// 楼栋状态全部取出
List<SysSimpleDictDTO> buildingStateList = adminFeignClient.listSimpleDictInfo("building_state").getData();
log.info("+++++++++++漏洞状态"+buildingStateList.get(0).getDictName());
List<String> buildingStateCodeList = buildingStateList.stream().map(SysSimpleDictDTO::getDictValue).collect(Collectors.toList());
// 楼栋类型全部取出
List<SysSimpleDictDTO> buildingTypeList = adminFeignClient.listSimpleDictInfo("building_type").getData();

14
epdc-cloud-custom/src/main/resources/mapper/personroom/EpidemicPlotBuildingDao.xml

@ -35,11 +35,11 @@
pb.BUILDING_NAME AS dictName
FROM
epidemic_plot_building pb
WHERE
WHERE pb.DEL_FLAG = '0'
<if test="plotId != null and plotId !=''">
PLOT_ID = #{plotId}
and PLOT_ID = #{plotId}
</if>
and pb.DEL_FLAG = '0'
</select>
<select id="selectDetailById" resultType="com.elink.esua.epdc.dto.personroom.result.EpidemicPlotBuildingResultDTO">
@ -93,13 +93,13 @@
b.BUILDING_LATITUDE_DSF,
IF(0 + CAST(IFNULL(b.BUILDING_LONGITUDE_DSF, 0) AS CHAR)=0, 0, b.BUILDING_LONGITUDE_DSF) as buildingLongitudeDsfEx,
IF(0 + CAST(IFNULL(b.BUILDING_LATITUDE_DSF, 0) AS CHAR)=0, 0, b.BUILDING_LATITUDE_DSF) as buildingLatitudeDsfEx,
de.dept_code,
de.area_code as deptCode,
date_format(b.CREATED_TIME ,'%Y-%m-%d %H:%i:%s') as entryTime
FROM epidemic_plot_building b
LEFT JOIN epidemic_plot_coordinate p ON b.PLOT_ID = p.id AND p.DEL_FLAG = '0'
LEFT JOIN sys_dict bs on bs.dict_value = b.building_state and bs.dict_type = 'building_state'
LEFT JOIN sys_dict pn on pn.dict_value = b.plot_nature and pn.dict_type = 'plot_nature'
LEFT JOIN sys_dict bt on bt.dict_value = b.building_type and bt.dict_type = 'building_type'
LEFT JOIN yushan_esua_epdc_admin.sys_dict bs on bs.dict_value = b.building_state and bs.dict_type = 'building_state'
LEFT JOIN yushan_esua_epdc_admin.sys_dict pn on pn.dict_value = b.plot_nature and pn.dict_type = 'plot_nature'
LEFT JOIN yushan_esua_epdc_admin.sys_dict bt on bt.dict_value = b.building_type and bt.dict_type = 'building_type'
left join yushan_esua_epdc_admin.sys_dept de on de.id=b.grid_id
WHERE
b.DEL_FLAG = '0'

6
epdc-cloud-custom/src/main/resources/mapper/personroom/EpidemicPlotBuildingErrorDao.xml

@ -60,9 +60,9 @@
be.EMERGENCY_POSITION,
be.ERROR_INFO
from epidemic_plot_building_error be
LEFT JOIN sys_dict bs on bs.dict_value = be.building_state and bs.dict_type = 'building_state'
LEFT JOIN sys_dict pn on pn.dict_value = be.plot_nature and pn.dict_type = 'plot_nature'
LEFT JOIN sys_dict bt on bt.dict_value = be.building_type and bt.dict_type = 'building_type'
LEFT JOIN yushan_esua_epdc_admin.sys_dict bs on bs.dict_value = be.building_state and bs.dict_type = 'building_state'
LEFT JOIN yushan_esua_epdc_admin.sys_dict pn on pn.dict_value = be.plot_nature and pn.dict_type = 'plot_nature'
LEFT JOIN yushan_esua_epdc_admin.sys_dict bt on bt.dict_value = be.building_type and bt.dict_type = 'building_type'
where error_id=#{errorId}
</select>

2
epdc-cloud-custom/src/main/resources/mapper/personroom/EpidemicPlotCoordinateDao.xml

@ -54,7 +54,7 @@
WHERE
pc.DEL_FLAG = '0'
<if test="plotName != null and plotName != ''">
and pc.plotName like CONCAT('%',#{plotName},'%')
and pc.PLOT_NAME like CONCAT('%',#{plotName},'%')
</if>
<if test="streetId != null and streetId != ''">
and pc.STREET_ID = #{streetId}

Loading…
Cancel
Save