2023-11-07 09:32:12 +08:00
|
|
|
|
package com.zcloud.controller.firemanager;
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
2023-12-21 14:32:23 +08:00
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.zcloud.aspect.DockAnnotation;
|
2023-11-07 09:32:12 +08:00
|
|
|
|
import com.zcloud.entity.system.Dictionaries;
|
|
|
|
|
import com.zcloud.service.bus.ImgFilesService;
|
|
|
|
|
import com.zcloud.service.system.DepartmentService;
|
|
|
|
|
import com.zcloud.service.system.DictionariesService;
|
|
|
|
|
import com.zcloud.service.system.UsersService;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import com.zcloud.controller.base.BaseController;
|
|
|
|
|
import com.zcloud.entity.Page;
|
|
|
|
|
import com.zcloud.entity.PageData;
|
|
|
|
|
import com.zcloud.service.firemanager.FireDeviceService;
|
|
|
|
|
import com.zcloud.util.*;
|
|
|
|
|
import com.zcloud.util.logAop.LogOperation;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 说明:消防器材管理 作者:wangxuan 官网:www.zcloudchina.com
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/fireDevice")
|
|
|
|
|
public class FireDeviceController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private FireDeviceService fireDeviceService;
|
|
|
|
|
@Resource
|
|
|
|
|
private ImgFilesService imgFilesService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private UsersService usersService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private DictionariesService dictionariesService;
|
|
|
|
|
@Resource
|
|
|
|
|
private DepartmentService departmentService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 消防设备列表
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2023/2/9
|
|
|
|
|
* @Param: [com.zcloud.entity.Page] [page]
|
|
|
|
|
* @Return: java.lang.Object
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/list")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object page(Page page) {
|
|
|
|
|
// 查询条件
|
|
|
|
|
// 区域名称(关键字查询)、编码(关键字查询)
|
|
|
|
|
// Object keywords = pageData.get("KEYWORDS");
|
|
|
|
|
// 企业ID
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
// 获取当前人的公司id
|
|
|
|
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
page.setPd(pd);
|
|
|
|
|
List<PageData> varList = fireDeviceService.list(page);
|
|
|
|
|
map.put("varList", varList);
|
|
|
|
|
map.put("page", page);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 消防设备单个信息
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2023/2/9/
|
|
|
|
|
* @Return: java.lang.Object
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/getFireDeviceInfo")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object info() {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = getPageData();
|
|
|
|
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
PageData resdata = fireDeviceService.findById(pd);
|
|
|
|
|
map.put("res", resdata);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 修改消防设备
|
|
|
|
|
* @Author: Dear lin
|
|
|
|
|
* @Date: 2023/2/10 13:12
|
|
|
|
|
* @Param: []
|
|
|
|
|
* @Return: java.lang.Object
|
|
|
|
|
*/
|
|
|
|
|
@LogOperation(value = "修改消防设备成功", exceptionInformation = "修改消防设备失败", isUpdate = true, updateId = "FIRE_DEVICE_ID")
|
|
|
|
|
@RequestMapping("/updFireDeviceById")
|
|
|
|
|
@ResponseBody
|
2023-12-21 14:32:23 +08:00
|
|
|
|
@DockAnnotation
|
2023-11-07 09:32:12 +08:00
|
|
|
|
public Object updFirePointById() {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = getPageData();
|
|
|
|
|
pd.put("OPERATOR", Jurisdiction.getUSER_ID());
|
|
|
|
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));
|
|
|
|
|
fireDeviceService.updFireDeviceById(pd);
|
|
|
|
|
map.put("result", errInfo);
|
2023-12-29 17:36:09 +08:00
|
|
|
|
map.put("dockData",JSON.toJSONString(pd));
|
2023-11-07 09:32:12 +08:00
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 删除
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2023/9/13/013 16:48
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: java.lang.Object
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/removeFireDeviceByIds")
|
|
|
|
|
@ResponseBody
|
2023-12-21 14:32:23 +08:00
|
|
|
|
@DockAnnotation
|
2023-11-07 09:32:12 +08:00
|
|
|
|
public Object removeFireDeviceByIds() {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = getPageData();
|
|
|
|
|
pd.put("OPERATOR", Jurisdiction.getUsername());
|
|
|
|
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));
|
|
|
|
|
fireDeviceService.removeFireDeviceByIds(pd);
|
|
|
|
|
map.put("result", errInfo);
|
2023-12-29 17:36:09 +08:00
|
|
|
|
map.put("dockData",JSON.toJSONString(pd));
|
2023-11-07 09:32:12 +08:00
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 根据器材id删除
|
|
|
|
|
* @Author: Dear lin
|
|
|
|
|
* @Date: 2023/2/21 20:49
|
|
|
|
|
* @Param: []
|
|
|
|
|
* @Return: java.lang.Object
|
|
|
|
|
*/
|
|
|
|
|
@LogOperation(value = "删除消防器材成功", exceptionInformation = "删除消防器材失败", isDelete = true)
|
|
|
|
|
@RequestMapping("/delFireDeviceByIds")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object delFireRegionByIds() {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = getPageData();
|
|
|
|
|
pd.put("OPERATOR", Jurisdiction.getUsername());
|
|
|
|
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));
|
|
|
|
|
if (fireDeviceService.delFireDeviceByIds(pd)) {
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
} else {
|
|
|
|
|
map.put("result", "error");
|
|
|
|
|
map.put("msg", "检查表中还有用此设备禁止删除");
|
|
|
|
|
}
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 新增消防器材
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2023/3/8/008 17:23
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: java.lang.Object
|
|
|
|
|
*/
|
|
|
|
|
@LogOperation(value = "新增消防器材成功", exceptionInformation = "新增消防器材失败")
|
|
|
|
|
@RequestMapping(value = "/saveDeviceInfo")
|
|
|
|
|
@ResponseBody
|
2023-12-21 14:32:23 +08:00
|
|
|
|
@DockAnnotation(isAdd = true)
|
2023-11-07 09:32:12 +08:00
|
|
|
|
public Object saveInfo() {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = getPageData();
|
|
|
|
|
pd.put("FIRE_DEVICE_ID", this.get32UUID());
|
|
|
|
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
pd.put("CREATOR", Jurisdiction.getUSER_ID());
|
|
|
|
|
pd.put("OPERATOR", Jurisdiction.getUSER_ID());
|
|
|
|
|
pd.put("CREATTIME", DateUtil.date2Str(new Date()));
|
|
|
|
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date()));
|
|
|
|
|
fireDeviceService.saveDeviceInfo(pd);
|
|
|
|
|
map.put("result", errInfo);
|
2023-12-21 14:32:23 +08:00
|
|
|
|
map.put("dockData", JSON.toJSONString(pd));
|
2023-11-07 09:32:12 +08:00
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ---------------------------------//
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 根据点位获取设备
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2023/2/10
|
|
|
|
|
* @Param: varList => 点位下所有器材,PointCode => 联动
|
|
|
|
|
* @Return: java.lang.Object
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/getDeviceByPointId")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object getDeviceByPointId() {
|
|
|
|
|
PageData pageData = this.getPageData();
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
PageData parameter = new PageData();
|
|
|
|
|
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
parameter.put("FIRE_POINT_ID", pageData.get("FIRE_POINT_ID"));
|
|
|
|
|
// 获取所有设备
|
|
|
|
|
List<PageData> resdata = fireDeviceService.getDeviceListByPointId(pageData);
|
|
|
|
|
parameter.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
// 根据点位获取 点位编码 人员部门,岗位,姓名
|
|
|
|
|
PageData pointCode = fireDeviceService.getPointCode(parameter);
|
|
|
|
|
map.put("varList", resdata);
|
|
|
|
|
map.put("pointCode", pointCode.get("FIRE_POINT_CODE"));
|
|
|
|
|
// 用户名
|
|
|
|
|
map.put("USERNAME", pointCode.get("USERNAME"));
|
|
|
|
|
// 岗位名
|
|
|
|
|
map.put("POSTNAME", pointCode.get("POSTNAME"));
|
|
|
|
|
// 部门名字
|
|
|
|
|
map.put("DEPARTMENTNAME", pointCode.get("DEPARTMENTNAME"));
|
|
|
|
|
map.put("result", "success");
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
// @RequestMapping(value="/readExcel")
|
2024-01-09 10:58:26 +08:00
|
|
|
|
// // @RequiresPermissions("fromExcel")
|
2023-11-07 09:32:12 +08:00
|
|
|
|
// @SuppressWarnings("unchecked")
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
// public Object readExcel(@RequestParam(value="excel",required=false) MultipartFile file) throws Exception {
|
|
|
|
|
|
|
|
|
|
@LogOperation(value = "导入消防器材检查标准成功", exceptionInformation = "导入消防器材检查标准失败")
|
|
|
|
|
@RequestMapping(value = "/readExcel")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object readExcel(@RequestParam(name = "FFILE", required = false) MultipartFile file) throws Exception {
|
|
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
if (null != file && !file.isEmpty()) {
|
|
|
|
|
String suffixName =
|
|
|
|
|
file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
|
|
|
|
|
if (!"xls".equals(suffixName)) {
|
|
|
|
|
errInfo = "fail";
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
map.put("msg", "文件格式不正确!");
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + "user/"; // 文件上传路径
|
|
|
|
|
String fileName = FileUpload.fileUp(file, filePath, "device"); // 执行上传
|
|
|
|
|
/** 获取Excel的内容信息 **/
|
|
|
|
|
List<PageData> listPd = (List) ObjectExcelRead.readExcel(filePath, fileName, 1, 0, 0);
|
|
|
|
|
|
|
|
|
|
Map<String, Integer> cordMap = new HashMap<>();
|
|
|
|
|
Map<String, Integer> corpAllMap = fireDeviceService.getcodeByCorp(pd);
|
|
|
|
|
Map<String, Dictionaries> getDicMap = dictionariesService.getMapByParId("249151f04fd64132a949fdd430a7b9c5");
|
|
|
|
|
Map<String, String> getCorpDepartAllMap = departmentService.getDepartMapFroExcel(pd); // 这个企业的所有部门
|
|
|
|
|
Map<String, String> getCorpUserAllMap = usersService.getUserMapFroExcel(pd); // 这个企业的所有人员
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuffer message = new StringBuffer();
|
|
|
|
|
Integer count = 1;
|
|
|
|
|
for (PageData lpd : listPd) { // 判断必填 等信息 ,如果这里的信息通过,就要 新增信息
|
|
|
|
|
count++;
|
|
|
|
|
String xfqyName = Tools.isEmpty(lpd.get("var1")) ? "" : Tools.excelHandle(lpd.get("var1"));
|
|
|
|
|
String xfqyBianma = Tools.isEmpty(lpd.get("var2")) ? "" : Tools.excelHandle(lpd.get("var2"));
|
|
|
|
|
String dwName = Tools.isEmpty(lpd.get("var3")) ? "" : Tools.excelHandle(lpd.get("var3"));
|
|
|
|
|
String dwBianma = Tools.isEmpty(lpd.get("var4")) ? "" : Tools.excelHandle(lpd.get("var4"));
|
|
|
|
|
String departName = Tools.isEmpty(lpd.get("var5")) ? "" : Tools.excelHandle(lpd.get("var5"));
|
|
|
|
|
String userName = Tools.isEmpty(lpd.get("var6")) ? "" : Tools.excelHandle(lpd.get("var6"));
|
|
|
|
|
String xfLxName = Tools.isEmpty(lpd.get("var7")) ? "" : Tools.excelHandle(lpd.get("var7"));
|
|
|
|
|
String code = Tools.isEmpty(lpd.get("var8")) ? "" : Tools.excelHandle(lpd.get("var8"));
|
|
|
|
|
String startTime = Tools.isEmpty(lpd.get("var9")) ? "" : Tools.excelHandle(lpd.get("var9"));
|
|
|
|
|
String endTime = Tools.isEmpty(lpd.get("var10")) ? "" : Tools.excelHandle(lpd.get("var10"));
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (!Tools.isEmpty(startTime)) {
|
|
|
|
|
Calendar calendar = new GregorianCalendar(1900, 0, -1);
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
|
|
|
|
|
int intDay = Integer.parseInt(startTime);
|
|
|
|
|
Date ENTRY_DATE_date = DateUtils.addDays(calendar.getTime(), intDay); //对日期格式化操作
|
|
|
|
|
simpleDateFormat.format(ENTRY_DATE_date);
|
|
|
|
|
}
|
|
|
|
|
if (!Tools.isEmpty(endTime)) {
|
|
|
|
|
Calendar calendar = new GregorianCalendar(1900, 0, -1);
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
|
|
|
|
|
int intDay = Integer.parseInt(endTime);
|
|
|
|
|
Date ENTRY_DATE_date = DateUtils.addDays(calendar.getTime(), intDay); //对日期格式化操作
|
|
|
|
|
simpleDateFormat.format(ENTRY_DATE_date);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
message.append("第" + count + "行的" + "时间格式填写错误,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Tools.isEmpty(xfqyName)) {
|
|
|
|
|
message.append("第" + count + "行的" + "消防区域名称" + "是必填项,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (Tools.isEmpty(xfqyBianma)) {
|
|
|
|
|
message.append("第" + count + "行的" + "消防区域编码" + "是必填项,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (Tools.isEmpty(dwName)) {
|
|
|
|
|
message.append("第" + count + "行的" + "消防点位名称" + "是必填项,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (Tools.isEmpty(dwBianma)) {
|
|
|
|
|
message.append("第" + count + "行的" + "消防点位编码" + "是必填项,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (Tools.isEmpty(xfLxName)) {
|
|
|
|
|
message.append("第" + count + "行的" + "消防器材类型" + "是必填项,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (Tools.isEmpty(code)) {
|
|
|
|
|
message.append("第" + count + "行的" + "消防器材编码" + "是必填项,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (cordMap.containsKey(code)) {
|
|
|
|
|
message.append("第" + count + "行的" + "消防器材编码" + "重复,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (corpAllMap.containsKey(code)) {
|
|
|
|
|
message.append("第" + count + "行的" + "消防器材编码" + "已经存在重复,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (!getCorpDepartAllMap.containsKey(departName)) {
|
|
|
|
|
message.append("第" + count + "行的" + "负责部门未找到" + ",请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (!getCorpUserAllMap.containsKey(userName)) {
|
|
|
|
|
message.append("第" + count + "行的" + "负责人员未找到" + ",请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
if (getCorpDepartAllMap.containsKey(departName)) {
|
|
|
|
|
String departId = getCorpDepartAllMap.get(departName);
|
|
|
|
|
if ("-1".equals(departId)) {
|
|
|
|
|
message.append("第").append(count).append("行的").append("负责部门重复").append(",请修改组织机构中的部门名称和模板名称;");
|
|
|
|
|
}
|
|
|
|
|
// 判断部门下是否有这个人
|
|
|
|
|
if (getCorpUserAllMap.containsKey(userName)) {
|
|
|
|
|
String userDept = getCorpUserAllMap.get(getCorpUserAllMap.get(userName));
|
|
|
|
|
if (!userDept.equals(departId)) {
|
|
|
|
|
message.append("第").append(count).append("行的").append("负责人不在").append(departName).append("此部门下").append(",请修改模板中负责人;");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (getDicMap.get(xfLxName) == null) {
|
|
|
|
|
message.append("第").append(count).append("行的").append(xfLxName).append(",该消防器材类型").append("不存在,请重新填写;");
|
|
|
|
|
}
|
|
|
|
|
cordMap.put(code, 0);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (Tools.isEmpty(message.toString())) {
|
|
|
|
|
fireDeviceService.saveToExcel(listPd);
|
|
|
|
|
errInfo = "success";
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
map.put("msg", "导入成功!导入" + listPd.size() + "条");
|
|
|
|
|
return map;
|
|
|
|
|
} else {
|
|
|
|
|
errInfo = "fail";
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
map.put("msg", message.toString());
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
errInfo = "fail";
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
map.put("msg", "");
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/downExcel")
|
|
|
|
|
public void downExcel(HttpServletResponse response) throws Exception {
|
|
|
|
|
FileDownload.fileDownload(response, PathUtil.getProjectpath() + Const.FILEPATHFILE + "fireDevice.xls", "消防器材导入模板.xls");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 新增消防器材
|
|
|
|
|
* @Author: dearLin
|
|
|
|
|
* @Date: 2023/3/8/008 17:23
|
|
|
|
|
* @Param: [] []
|
|
|
|
|
* @Return: java.lang.Object
|
|
|
|
|
*/
|
|
|
|
|
@LogOperation(value = "判断消防器材编码重复成功", exceptionInformation = "判断消防器材编码重复失败")
|
|
|
|
|
@RequestMapping(value = "/hasFireDeviceCode")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object hasFireDeviceCode() throws Exception {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = getPageData();
|
|
|
|
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
PageData varList = fireDeviceService.hasFireDeviceCode(pd);
|
|
|
|
|
if (!Tools.isEmpty(varList) && !"0".equals(varList.getString("DEVICE_CODE_NUM"))) {
|
|
|
|
|
errInfo = "fail";
|
|
|
|
|
map.put("msg", "消防器材编码重复");
|
|
|
|
|
}
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
}
|