消防资源

pull/14/head
dearlin 2023-12-21 14:18:19 +08:00
parent 5503a64b6d
commit e4a311fdb2
9 changed files with 2100 additions and 1907 deletions

View File

@ -111,6 +111,7 @@ public class AppHiddenController extends BaseController {
private HiddenExamineApiService hiddenExamineApiService; //隐患审核 隐患的审核步骤的人员的信息的记录 private HiddenExamineApiService hiddenExamineApiService; //隐患审核 隐患的审核步骤的人员的信息的记录
@Autowired @Autowired
private MessageService messageService; private MessageService messageService;
/** /**
* app * app
* *
@ -186,8 +187,6 @@ public class AppHiddenController extends BaseController {
} }
List<PageData> creatorHid = hiddenService.getCountByCreatorId(pd); // 根据人员id获取发现隐患信息 List<PageData> creatorHid = hiddenService.getCountByCreatorId(pd); // 根据人员id获取发现隐患信息
for (int i = 0; i < creatorHid.size(); i++) { for (int i = 0; i < creatorHid.size(); i++) {
PageData cre = creatorHid.get(i); PageData cre = creatorHid.get(i);
@ -321,7 +320,8 @@ public class AppHiddenController extends BaseController {
if (Tools.isEmpty(departmentService.findById(userpd).getString("HEADMAN"))) {//判断部门是否有负责人 if (Tools.isEmpty(departmentService.findById(userpd).getString("HEADMAN"))) {//判断部门是否有负责人
map.put("msg", "所在部门未维护部门负责人"); map.put("msg", "所在部门未维护部门负责人");
return map; return map;
}{ }
{
userpd.put("USER_ID", departmentService.findById(userpd).getString("HEADMAN")); userpd.put("USER_ID", departmentService.findById(userpd).getString("HEADMAN"));
userpd.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); userpd.put("CORPINFO_ID", pd.getString("CORPINFO_ID"));
if (Tools.isEmpty(usersService.findById(userpd))) { if (Tools.isEmpty(usersService.findById(userpd))) {
@ -379,6 +379,7 @@ public class AppHiddenController extends BaseController {
*/ */
@RequestMapping(value = "/appAdd") @RequestMapping(value = "/appAdd")
@ResponseBody @ResponseBody
@DockAnnotation(hasAnnex = true)
public Object appAdd() throws Exception { public Object appAdd() throws Exception {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
@ -412,6 +413,9 @@ public class AppHiddenController extends BaseController {
before.put("CREATOR", pd.getString("loginUserId")); before.put("CREATOR", pd.getString("loginUserId"));
before.put("OPERATOR", pd.getString("loginUserId")); before.put("OPERATOR", pd.getString("loginUserId"));
hiddenExamineService.saveApp(before); hiddenExamineService.saveApp(before);
PageData hiddenExaminePageData = new PageData();
hiddenExaminePageData.putAll(before);
if (pd.get("RISKITEM_ID") != null && Tools.notEmpty(pd.get("RISKITEM_ID").toString())) { if (pd.get("RISKITEM_ID") != null && Tools.notEmpty(pd.get("RISKITEM_ID").toString())) {
if ("2".equals(pd.getString("SOURCE"))) { if ("2".equals(pd.getString("SOURCE"))) {
PageData item = new PageData(); PageData item = new PageData();
@ -466,6 +470,7 @@ public class AppHiddenController extends BaseController {
pd.put("STATE", "0"); pd.put("STATE", "0");
} }
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("other").toString()); // 隐患发现人 List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("other").toString()); // 隐患发现人
ArrayList<PageData> hiddenUserList = new ArrayList<>();
for (JSONObject json : list) { for (JSONObject json : list) {
PageData hiddenconUserAdd = new PageData(); PageData hiddenconUserAdd = new PageData();
hiddenconUserAdd.put("HIDDENUSER_ID", UuidUtil.get32UUID()); hiddenconUserAdd.put("HIDDENUSER_ID", UuidUtil.get32UUID());
@ -474,6 +479,7 @@ public class AppHiddenController extends BaseController {
hiddenconUserAdd.put("TYPE", "1"); hiddenconUserAdd.put("TYPE", "1");
hiddenconUserAdd.put("IS_MAIN", "0"); hiddenconUserAdd.put("IS_MAIN", "0");
hiddenUserService.save(hiddenconUserAdd); // 添加隐患发现人 hiddenUserService.save(hiddenconUserAdd); // 添加隐患发现人
hiddenUserList.add(hiddenconUserAdd);
} }
pd.put("ISCONFIRM", "0"); pd.put("ISCONFIRM", "0");
if (pd.getString("HIDDENLEVEL").equals("jdyh001") || pd.getString("HIDDENLEVEL").equals("hiddenLevel2002")) {//判断是否是重大隐患 if (pd.getString("HIDDENLEVEL").equals("jdyh001") || pd.getString("HIDDENLEVEL").equals("hiddenLevel2002")) {//判断是否是重大隐患
@ -497,7 +503,8 @@ public class AppHiddenController extends BaseController {
if (Tools.isEmpty(departmentService.findById(userpd).getString("HEADMAN"))) {//判断部门是否有负责人 if (Tools.isEmpty(departmentService.findById(userpd).getString("HEADMAN"))) {//判断部门是否有负责人
map.put("msg", "所在部门未维护部门负责人"); map.put("msg", "所在部门未维护部门负责人");
return map; return map;
}{ }
{
userpd.put("USER_ID", departmentService.findById(userpd).getString("HEADMAN")); userpd.put("USER_ID", departmentService.findById(userpd).getString("HEADMAN"));
userpd.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); userpd.put("CORPINFO_ID", pd.getString("CORPINFO_ID"));
PageData usersPd = usersService.findById(userpd); PageData usersPd = usersService.findById(userpd);
@ -511,6 +518,10 @@ public class AppHiddenController extends BaseController {
} }
} }
hiddenService.save(pd); hiddenService.save(pd);
PageData dockData = new PageData();
dockData.put("hiddenData", pd);
dockData.put("hiddenExaminePageData", hiddenExaminePageData);
dockData.put("hiddenUserList", hiddenUserList);
// 发送短信 // 发送短信
if (Tools.notEmpty(pd.getString("CONFIRM_USER")) && !pd.getString("STATE").equals("0")) { if (Tools.notEmpty(pd.getString("CONFIRM_USER")) && !pd.getString("STATE").equals("0")) {
messageService.sendMessageByParameter("HIDDEN_MAIL_001", "友情提示:有一条隐患需要确认", pd.getString("CORPINFO_ID"), pd.getString("CONFIRM_USER"), pd.getString("HIDDEN_ID"), messageService.sendMessageByParameter("HIDDEN_MAIL_001", "友情提示:有一条隐患需要确认", pd.getString("CORPINFO_ID"), pd.getString("CONFIRM_USER"), pd.getString("HIDDEN_ID"),
@ -518,6 +529,7 @@ public class AppHiddenController extends BaseController {
} }
map.put("result", errInfo); map.put("result", errInfo);
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", JSON.toJSONString(dockData));
return map; return map;
} }
@ -581,7 +593,9 @@ public class AppHiddenController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -778,21 +792,22 @@ public class AppHiddenController extends BaseController {
*/ */
@RequestMapping(value = "/edit") @RequestMapping(value = "/edit")
@ResponseBody @ResponseBody
@DockAnnotation
public Object edit() throws Exception { public Object edit() throws Exception {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = this.getPageData();
pd = this.getPageData();
hiddenUserService.delete(pd); //删除隐患相关人员 -- 隐患发现人 hiddenUserService.delete(pd); //删除隐患相关人员 -- 隐患发现人
if (pd.getString("STATE").equals("16")) {//如果状态等于16进入此方法肯定是提交过来的赋值给待确认 if (pd.getString("STATE").equals("16")) {//如果状态等于16进入此方法肯定是提交过来的赋值给待确认
pd.put("STATE", "-2"); pd.put("STATE", "-2");
if(Tools.notEmpty(pd.getString("POSITIONDESC"))){hiddenService.editInformation(pd);} if (Tools.notEmpty(pd.getString("POSITIONDESC"))) {
hiddenService.editInformation(pd);
}
hiddenService.editstate(pd); hiddenService.editstate(pd);
} }
hiddenService.editInfo(pd); hiddenService.editInfo(pd);
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("other").toString()); // 隐患发现人 List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("other").toString()); // 隐患发现人
ArrayList<PageData> hiddenUserList = new ArrayList<>();
for (JSONObject json : list) { for (JSONObject json : list) {
PageData hiddenconUserAdd = new PageData(); PageData hiddenconUserAdd = new PageData();
hiddenconUserAdd.put("HIDDENUSER_ID", UuidUtil.get32UUID()); hiddenconUserAdd.put("HIDDENUSER_ID", UuidUtil.get32UUID());
@ -801,14 +816,18 @@ public class AppHiddenController extends BaseController {
hiddenconUserAdd.put("TYPE", "1"); hiddenconUserAdd.put("TYPE", "1");
hiddenconUserAdd.put("IS_MAIN", "0"); hiddenconUserAdd.put("IS_MAIN", "0");
hiddenUserService.save(hiddenconUserAdd); // 添加隐患发现人 hiddenUserService.save(hiddenconUserAdd); // 添加隐患发现人
hiddenUserList.add(hiddenconUserAdd);
} }
PageData dockData = new PageData();
dockData.putAll(pd);
dockData.put("hiddenUserList",hiddenUserList);
map.put("pd", pd); map.put("pd", pd);
map.put("dockData", dockData);
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/** /**
* *
* *
@ -1346,6 +1365,7 @@ public class AppHiddenController extends BaseController {
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/** /**
* *
* *
@ -1364,6 +1384,7 @@ public class AppHiddenController extends BaseController {
map.put("hiddenList", hiddenList); map.put("hiddenList", hiddenList);
return map; return map;
} }
/** /**
* *
* *
@ -1534,6 +1555,7 @@ public class AppHiddenController extends BaseController {
/** /**
* () * ()
*
* @return * @return
*/ */
@RequestMapping(value = "/getTreehiddenRegionListAll") @RequestMapping(value = "/getTreehiddenRegionListAll")
@ -1594,6 +1616,7 @@ public class AppHiddenController extends BaseController {
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/** /**
* *
* *
@ -1707,6 +1730,7 @@ public class AppHiddenController extends BaseController {
/** /**
* *
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -1760,6 +1784,7 @@ public class AppHiddenController extends BaseController {
/** /**
* *
*
* @param * @param
* @throws Exception * @throws Exception
*/ */

View File

@ -7,6 +7,9 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.zcloud.aspect.DockAnnotation;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.service.mq.DockSendMessageService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -36,14 +39,19 @@ public class AppImgFilesController extends BaseController {
@Autowired @Autowired
private ImgFilesService imgfilesService; private ImgFilesService imgfilesService;
@Autowired
private DockSendMessageService dockSendMessageService;
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value = "/add", headers = "content-type=multipart/form-data") @RequestMapping(value = "/add", headers = "content-type=multipart/form-data")
@ResponseBody @ResponseBody
@Transactional @Transactional
@DockAnnotation(hasAnnex = true)
public Object finish( public Object finish(
@RequestParam(value = "FFILE", required = false) MultipartFile[] files, @RequestParam(value = "FFILE", required = false) MultipartFile[] files,
@RequestParam(value = "TYPE", required = false) String TYPE, @RequestParam(value = "TYPE", required = false) String TYPE,
@ -85,6 +93,14 @@ public class AppImgFilesController extends BaseController {
File old = new File(PathUtil.getProjectpath() + pageData.getString("FILEPATH")); File old = new File(PathUtil.getProjectpath() + pageData.getString("FILEPATH"));
old.delete(); old.delete();
imgfilesService.delete(pageData); imgfilesService.delete(pageData);
pageData.put("delete","1");
TenCorpDto tenCorpDto = new TenCorpDto();
tenCorpDto.setMessage("删除文件消息");
tenCorpDto.setId(UuidUtil.get32UUID());
tenCorpDto.setTopic("docking");
tenCorpDto.setProducer_name("qa-prevention-czks");
tenCorpDto.setData(pageData);
dockSendMessageService.sendMessagePictureDelete(tenCorpDto);
} }
} }
PageData pd = new PageData(); PageData pd = new PageData();
@ -93,22 +109,23 @@ public class AppImgFilesController extends BaseController {
// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径 // String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径
// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传 // String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName,Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); String IMGFILES_ID = this.get32UUID();
pd.put("IMGFILES_ID", IMGFILES_ID);
pd.put("IMGFILES_ID", this.get32UUID());
pd.put("FILEPATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); pd.put("FILEPATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd.put("TYPE", TYPE); pd.put("TYPE", TYPE);
pd.put("FOREIGN_KEY", FOREIGN_KEY); pd.put("FOREIGN_KEY", FOREIGN_KEY);
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile, IMGFILES_ID, FOREIGN_KEY, TYPE);
imgfilesService.save(pd); imgfilesService.save(pd);
} }
} }
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -141,7 +158,9 @@ public class AppImgFilesController extends BaseController {
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -208,7 +227,9 @@ public class AppImgFilesController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param out * @param out
* @throws Exception * @throws Exception
*/ */
@ -227,7 +248,9 @@ public class AppImgFilesController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -244,7 +267,9 @@ public class AppImgFilesController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param page * @param page
* @throws Exception * @throws Exception
*/ */
@ -266,7 +291,9 @@ public class AppImgFilesController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -284,7 +311,9 @@ public class AppImgFilesController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -308,7 +337,9 @@ public class AppImgFilesController extends BaseController {
return map; return map;
} }
/**excel /**
* excel
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -340,7 +371,9 @@ public class AppImgFilesController extends BaseController {
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */

View File

@ -118,7 +118,9 @@ public class MfolderController extends BaseController {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业
mfolderService.save(pd); //存入数据库表 mfolderService.save(pd); //存入数据库表
//存自己表里的附件 使用文件全路径加文件名的方式 示例 //存自己表里的附件 使用文件全路径加文件名的方式 示例
// /uploadFiles/yhtp/8415df13cc4c46f0ac32f579462dbb8f/20231215/d3bc85d1bbe84b75b1e6e8b6182dc547.jpg@@d3bc85d1bbe84b75b1e6e8b6182dc547.jpg // /uploadFiles/yhtp/8415df13cc4c46f0ac32f579462dbb8f/20231215/d3bc85d1bbe84b75b1e6e8b6182dc547.jpg
// @@
// d3bc85d1bbe84b75b1e6e8b6182dc547.jpg
pictureList.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName+ pictureList.add(Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName+
"@@" "@@"
+fileName); +fileName);

View File

@ -0,0 +1,95 @@
package com.zcloud.controller.firemanager;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.fireresources.FireResourcesService;
import com.zcloud.util.DateUtil;
import org.springframework.stereotype.Controller;
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.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/fireResources")
public class FireResourcesController extends BaseController {
@Resource
private FireResourcesService fireResourcesService;
@RequestMapping(value = "/list")
@ResponseBody
public Object page(Page page) {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
page.setPd(pd);
//获取当前人的公司id
List<PageData> varList = fireResourcesService.datalistPage(page);
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
@RequestMapping(value = "/getById")
@ResponseBody
public Object getById() {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pddata = this.getPageData();
//获取当前人的公司id
PageData pd = fireResourcesService.getDataById(pddata);
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
@RequestMapping(value = "/add")
@ResponseBody
public Object add(@RequestParam(value="FFILE",required=false) MultipartFile[] files) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
String FIRERESOURCES_ID = this.get32UUID();
pd.put("FIRERESOURCES_ID", FIRERESOURCES_ID);
pd.put("CREATIME", DateUtil.date2Str(new Date()));
pd.put("OPERATIME", DateUtil.date2Str(new Date()));
pd.put("ISDELETE", "0");
fireResourcesService.save(pd,files);
map.put("result", errInfo);
return map;
}
@RequestMapping(value = "/edit")
@ResponseBody
public Object edit(@RequestParam(value="FFILE",required=false) MultipartFile[] files) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("OPERATIME", DateUtil.date2Str(new Date()));
pd.put("ISDELETE", "0");
fireResourcesService.edit(pd,files);
map.put("result", errInfo);
return map;
}
@RequestMapping(value = "/delete")
@ResponseBody
public Object delete(Page page) {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
fireResourcesService.delete(pd);
map.put("result", errInfo);
return map;
}
}

View File

@ -1,12 +1,16 @@
package com.zcloud.controller.firemanager.app; package com.zcloud.controller.firemanager.app;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zcloud.aspect.DockAnnotation;
import com.zcloud.controller.base.BaseController; import com.zcloud.controller.base.BaseController;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.entity.Page; import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.firemanager.FireDeviceMapper; import com.zcloud.mapper.datasource.firemanager.FireDeviceMapper;
import com.zcloud.service.bus.ImgFilesService; import com.zcloud.service.bus.ImgFilesService;
import com.zcloud.service.firemanager.*; import com.zcloud.service.firemanager.*;
import com.zcloud.service.mq.DockSendMessageService;
import com.zcloud.service.mq.SendMessageService;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
import com.zcloud.util.InitPageDataUtil; import com.zcloud.util.InitPageDataUtil;
import com.zcloud.util.Jurisdiction; import com.zcloud.util.Jurisdiction;
@ -35,7 +39,8 @@ public class AppFireRecordController extends BaseController {
@Resource @Resource
private ImgFilesService imgFilesService; private ImgFilesService imgFilesService;
@Resource
private DockSendMessageService dockSendMessageService;
@Resource @Resource
private FireCheckStandardService fireCheckStandardService; private FireCheckStandardService fireCheckStandardService;
@Autowired @Autowired
@ -47,7 +52,6 @@ public class AppFireRecordController extends BaseController {
@Autowired @Autowired
private FirePointService firePointService; private FirePointService firePointService;
@Resource @Resource
private InitPageDataUtil initPageDataUtil; private InitPageDataUtil initPageDataUtil;
@ -134,6 +138,7 @@ public class AppFireRecordController extends BaseController {
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/** /**
* @Description: * @Description:
* @Author: dearLin * @Author: dearLin
@ -173,6 +178,7 @@ public class AppFireRecordController extends BaseController {
map.put("varList", res); map.put("varList", res);
return map; return map;
} }
/** /**
* @Description: * @Description:
* @Author: dearLin * @Author: dearLin
@ -194,6 +200,7 @@ public class AppFireRecordController extends BaseController {
map.put("varList", res); map.put("varList", res);
return map; return map;
} }
/** /**
* @Description: * @Description:
* @Author: dearLin * @Author: dearLin
@ -306,41 +313,41 @@ public class AppFireRecordController extends BaseController {
* @Return: java.lang.Object * @Return: java.lang.Object
*/ */
@RequestMapping("/editDeviceCheck") @RequestMapping("/editDeviceCheck")
@DockAnnotation
public Object editDeviceCheck() throws Exception { public Object editDeviceCheck() throws Exception {
String errInfo = "success"; String errInfo = "success";
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
PageData pd = this.getPageData(); PageData pd = this.getPageData();
List<PageData> list = JSONObject.parseArray(pd.getString("CHECK_DATA"), PageData.class); List<PageData> list = JSONObject.parseArray(pd.getString("CHECK_DATA"), PageData.class);
ArrayList<PageData> dataArrayList = new ArrayList<>();
// 点位下设备检查记录 // 点位下设备检查记录
list.forEach(itemCheck -> { list.forEach(itemCheck -> {
PageData itemCheckData = new PageData(); PageData itemCheckData = new PageData();
itemCheckData.putAll(itemCheck); itemCheckData.putAll(itemCheck);
itemCheckData.put("FOREIGN_KEY", itemCheck.getString("EQUIPMENT_RECORD_ID")); itemCheckData.put("FOREIGN_KEY", itemCheck.getString("EQUIPMENT_RECORD_ID"));
itemCheckData.put("TYPE", "14"); itemCheckData.put("TYPE", "14");
List<PageData> data = null; List<PageData> data = imgFilesService.listAll(itemCheckData);
try {
data = imgFilesService.listAll(itemCheckData);
} catch (Exception e) {
throw new RuntimeException(e);
}
// 不合格 // 不合格
if (!"0".equals(itemCheckData.getString("ISNORMAL"))) { if (!"0".equals(itemCheckData.getString("ISNORMAL"))) {
// 删除合格得照片 // 删除合格得照片
data.forEach(item -> { data.forEach(item -> {
try {
imgFilesService.delete(item); imgFilesService.delete(item);
TenCorpDto tenCorpDto = new TenCorpDto();
tenCorpDto.setData(item);
try {
dockSendMessageService.sendMessagePictureDelete(tenCorpDto);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
}); });
} }
fireRecordService.editDeviceCheckByApp(itemCheckData); fireRecordService.editDeviceCheckByApp(itemCheckData);
dataArrayList.add(itemCheckData);
}); });
// todo 校验一下有没有点位图片
// fireRecordService.modifyPointRecord(pd);
map.put("result", errInfo); map.put("result", errInfo);
pd.put("dataArrayList",dataArrayList);
map.put("dockData", pd);
return map; return map;
} }
@ -352,12 +359,14 @@ public class AppFireRecordController extends BaseController {
* @Return: java.lang.Object * @Return: java.lang.Object
*/ */
@RequestMapping("/editDeviceCheckFine") @RequestMapping("/editDeviceCheckFine")
@DockAnnotation
public Object editDeviceCheckFine() throws Exception { public Object editDeviceCheckFine() throws Exception {
String errInfo = "success"; String errInfo = "success";
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
PageData pd = this.getPageData(); PageData pd = this.getPageData();
fireRecordService.modifyPointRecord(pd); fireRecordService.modifyPointRecord(pd);
map.put("result", errInfo); map.put("result", errInfo);
map.put("dockData", pd);
return map; return map;
} }

View File

@ -23,7 +23,7 @@ public interface ImgFilesService{
* @param pd * @param pd
* @throws Exception * @throws Exception
*/ */
public void delete(PageData pd)throws Exception; public void delete(PageData pd);
/** /**
* @param pd * @param pd
@ -47,7 +47,7 @@ public interface ImgFilesService{
* @param pd * @param pd
* @throws Exception * @throws Exception
*/ */
public List<PageData> listAll(PageData pd)throws Exception; public List<PageData> listAll(PageData pd);
/**id /**id
* @param pd * @param pd

View File

@ -5,6 +5,8 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.service.mq.DockSendMessageService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -28,7 +30,8 @@ public class ImgFilesServiceImpl implements ImgFilesService{
@Autowired @Autowired
private ImgFilesMapper imgfilesMapper; private ImgFilesMapper imgfilesMapper;
@Autowired
private DockSendMessageService dockSendMessageService;
/** /**
* @param pd * @param pd
* @throws Exception * @throws Exception
@ -41,8 +44,10 @@ public class ImgFilesServiceImpl implements ImgFilesService{
* @param pd * @param pd
* @throws Exception * @throws Exception
*/ */
public void delete(PageData pd)throws Exception{ @Override
public void delete(PageData pd){
imgfilesMapper.delete(pd); imgfilesMapper.delete(pd);
} }
/** /**

View File

@ -6,6 +6,7 @@ public interface DockSendMessageService {
void sendMessage(TenCorpDto tenCorpDto) throws Exception; void sendMessage(TenCorpDto tenCorpDto) throws Exception;
void sendMessagePicture(TenCorpDto tenCorpDto) throws Exception; void sendMessagePicture(TenCorpDto tenCorpDto) throws Exception;
void sendMessagePictureDelete(TenCorpDto tenCorpDto) throws Exception;
void SendDelayQueue(TenCorpDto tenCorpDto); void SendDelayQueue(TenCorpDto tenCorpDto);
void SendDelayQueue(String message); void SendDelayQueue(String message);

View File

@ -84,6 +84,29 @@ public class DockSendMessageServiceImpl implements DockSendMessageService {
} }
} }
@Override
public void sendMessagePictureDelete(TenCorpDto tenCorpDto) throws Exception {
try {
PageData log = tenCorpDto.getPd();
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
log.put("CREATE_TIME", DateUtil.getTime());
mqMessageLogMapper.save(log);
System.out.println("生产者:" + tenCorpDto.toString());
SendResult sendResult = rocketMQTemplate.syncSend(this.dockingPicture, tenCorpDto.toString());
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
throw new RuntimeException("产品入栈失败");
}
} catch (Exception e) {
e.printStackTrace();
PageData log = tenCorpDto.getPd();
log.put("MESSAGE_ERROR_LOG_ID", Warden.get32UUID());
log.put("ERROR_MESSAGE", e.getMessage());
log.put("TYPE", "0");
log.put("TIME", DateUtil.getTime());
mqErrorMessageLogMapper.save(log);
}
}
@Override @Override
public void SendDelayQueue(TenCorpDto tenCorpDto) { public void SendDelayQueue(TenCorpDto tenCorpDto) {
PageData log = tenCorpDto.getPd(); PageData log = tenCorpDto.getPd();