Merge remote-tracking branch 'origin/dev' into dev

pull/4/head
chenxinying 2024-01-30 08:54:20 +08:00
commit 336ccfa0c5
26 changed files with 6839 additions and 953 deletions

View File

@ -0,0 +1,196 @@
package com.zcloud.controller.mapApi;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.system.UsersService;
import com.zcloud.service.video.VideoManagerService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.PLSUtil;
import com.zcloud.util.ReturnMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* TODO
* wangxuan
* www.zcloudchina.com
*/
@Controller
@RequestMapping("/map")
public class MapController extends BaseController {
@Autowired
private UsersService usersService;
@Autowired
private VideoManagerService videomanagerService;
// ----------人员定位相关-------------//
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/26/026 16:42
* @Param: [] []
* @Return: java.lang.String
*/
@RequestMapping(value = "/getPersonnelTypeCount")
@ResponseBody
public ReturnMap getPersonnelTypeCount() throws Exception {
PageData pageData = getPageData();
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
int userCount = usersService.getUserCount(pageData);
return ReturnMap.ok().put("userCount", userCount);
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/26/026 16:43
* @Param: [] []
* @Return: com.zcloud.util.ReturnMap
*/
@RequestMapping(value = "/getAlarmTypeCount")
@ResponseBody
public ReturnMap getAlarmTypeCount() throws Exception {
return ReturnMap.ok().put("data", PLSUtil.getAlarmTypeCount(Jurisdiction.getCORPINFO_ID()));
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/26/026 16:43
* @Param: [] []
* @Return: com.zcloud.util.ReturnMap
*/
@RequestMapping(value = "/getPersonnelPositioningCount")
@ResponseBody
public ReturnMap getPersonnelPositioningCount(Page page) throws Exception {
JSONObject personnelPositioningCount = PLSUtil.getPersonnelPositioningCount(Jurisdiction.getCORPINFO_ID(), page.getCurrentPage(), page.getShowCount());
return ReturnMap.ok().put("data", personnelPositioningCount);
}
// ----------摄像头相关-------------//
// 摄像头告警数 disposed
@RequestMapping(value = "/getCameraTopToShow")
@ResponseBody
public ReturnMap getCameraTopToShow() {
PageData pageData = getPageData();
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
PageData cameraCount = videomanagerService.getCameraTopToShow(pageData);
return ReturnMap.ok().put("pd", cameraCount);
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/29/029 15:35
* @Param: [] []
* @Return: com.zcloud.util.ReturnMap
*/
@RequestMapping(value = "/getCameraAlarmCount")
@ResponseBody
public ReturnMap getCameraAlarmCount() {
PageData pageData = getPageData();
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<PageData> cameraCount = videomanagerService.getCameraAlarmCount(pageData);
return ReturnMap.ok().put("CameraAlarmCount", cameraCount);
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/29/029 10:52
* @Param: [] []
* @Return: com.zcloud.util.ReturnMap
*/
@RequestMapping(value = "/getCameraAlarmTypeCount")
@ResponseBody
public ReturnMap getCameraAlarmTypeCount() {
PageData pageData = getPageData();
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<PageData> cameraCount = videomanagerService.getCameraAlarmTypeCount(pageData);
return ReturnMap.ok().put("varList", cameraCount);
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/29/029 10:51
* @Param: [] []
* @Return: com.zcloud.util.ReturnMap
*/
@RequestMapping(value = "/getCameraAlarmTimeCount")
@ResponseBody
public ReturnMap getCameraAlarmTimeCount() throws Exception {
PageData pageData = getPageData();
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<Map<String, String>> generateTimeArraySevenMonth = DateUtil.generateTimeArraySevenMonth(6);
pageData.put("generateTimeArray", generateTimeArraySevenMonth);
return ReturnMap.ok().put("varList", videomanagerService.getCameraAlarmTimeCount(pageData));
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/29/029 10:51
* @Param: [] []
* @Return: com.zcloud.util.ReturnMap
*/
@RequestMapping(value = "/getCameraAlarmSourceCount")
@ResponseBody
public ReturnMap getCameraAlarmSourceCount() throws Exception {
PageData pageData = getPageData();
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
int cameraCount = usersService.getUserCount(pageData);
return ReturnMap.ok().put("cameraCount", cameraCount);
}
// -----------------------//
public static List<Map<String, String>> generateTimeArray() {
List<Map<String, String>> timeArray = new ArrayList<>();
Calendar calendar = Calendar.getInstance();
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
for (int i = 6; i >= 0; i--) {
Map<String, String> monthInfo = new HashMap<>();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
String monthString = String.format(year+"-%02d", month);
String firstDayOfMonth = String.format("%04d-%02d-01 00:00:00", year, month);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
String lastDayOfMonth = dateFormat.format(calendar.getTime());
monthInfo.put("month", monthString);
monthInfo.put("dateBegin", firstDayOfMonth);
monthInfo.put("dateEnd", lastDayOfMonth);
timeArray.add(monthInfo);
calendar.add(Calendar.MONTH, -1); // Go to the previous month
}
// Reverse the timeArray to have the order from past to present
Collections.reverse(timeArray);
return timeArray;
}
public static void main(String[] args) {
List<Map<String, String>> timeArray = generateTimeArray();
for (Map<String, String> monthInfo : timeArray) {
System.out.println(monthInfo);
}
}
}

View File

@ -0,0 +1,115 @@
package com.zcloud.controller.mapApi;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.map.MapEightService;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.ReturnMap;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
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.client.RestTemplate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* www.zcloudchina.com
*/
@Controller
@RequestMapping("/map/Eight")
public class MapEightController extends BaseController {
@Autowired
private MapEightService mapEightService;
/**
* @return
* @throws Exception
*/
@RequestMapping(value = "/getEcharts")
@ResponseBody
public Object getEcharts() throws Exception {
PageData pd = new PageData();
pd = this.getPageData();
return mapEightService.getEchartsOrder(pd);
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/findFormCount")
@ResponseBody
public Object findFormCount() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
PageData data = mapEightService.statisticsHighRiskWorkByStateOrder(pd);
map.put("pd", data);
map.put("result", errInfo);
return map;
}
/**
* 18
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/listHighRiskWork")
@ResponseBody
public Object listHighRiskWork(Page page) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> varList = new ArrayList<>();
//根据条件增加参数或减少参数 都没有 直接返回空
page.setPd(pd);
varList = mapEightService.listHighRiskWorkOrder(page);
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/listAllHighRiskWorkLocation")
@ResponseBody
public Object listAllHighRiskWorkLocation(@RequestParam(value = "CORPINFO_ID") String CORPINFO_ID, @RequestParam("TYPE") String type, @RequestParam("GANGKOU") String GANGKOU, @RequestParam("AREA") String AREA) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
//pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
List<PageData> varList = new ArrayList<>();
//根据条件增加参数或减少参数 都没有 直接返回空
varList = mapEightService.listAllHighRiskWorkLocationOrder(pd);
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
}

View File

@ -167,7 +167,9 @@ public class HeadController extends BaseController {
Session session = Jurisdiction.getSession();
Collection<String> shiroSet = (Collection<String>)session.getAttribute(Jurisdiction.getUsername() + Const.SHIROSET);
for(String key : keys){
map.put(key.replace(":", "fhadmin"), shiroSet.contains(key));
// todo 强制修改为所有的按钮都显示
// map.put(key.replace(":", "fhadmin"), shiroSet.contains(key));
map.put(key.replace(":", "fhadmin"), "true");
}
//企业主账号可以删除隐患
pd.put("USER_ID", Jurisdiction.getUSER_ID());

View File

@ -72,6 +72,21 @@ public class UsersController extends BaseController {
@Autowired
private ImgFilesService imgfilesService;
/**
*
*
* @param page
* @return
* @throws Exception
*/
@RequestMapping("/getUserByCardNo")
@ResponseBody
public Object getUserByCardNo() {
PageData pageData = getPageData();
pageData.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
return ReturnMap.ok().put("pd",usersService.getUserByCardNo(pageData));
}
/**
*
*
@ -572,7 +587,7 @@ public class UsersController extends BaseController {
map.put("result", errInfo);
} else {
map.put("result", "errInfo");
map.put("msg", "人员定位系统修改失败");
map.put("msg", "人员定位系统修改失败,请联系管理员");
}
return map;
}
@ -804,19 +819,14 @@ public class UsersController extends BaseController {
@LogAnno(menuType = "双重预防", menuServer = "企业管理", instructionsOperate = "用户管理", instructionsType = "保存用户")
public Object saveUser() throws Exception {
Map<String, Object> map = new HashMap<>();
String errInfo = "success";
PageData pd = this.getPageData();
try {
usersService.saveUserNew(pd);
return usersService.saveUserNew(pd);
// 调用 Service 层保存用户
} catch (Exception e) {
errInfo = "error";
map.put("msg", e.getMessage());
throw e;
}
map.put("result", errInfo);
map.put("USER_ID", pd.getString("USER_ID"));
return map;
}
/**
@ -1433,7 +1443,9 @@ public class UsersController extends BaseController {
String postId = "";
if (postValMap != null) {
PageData o = (PageData) postValMap.get(postName);
postId = o.getString("POST_ID");
if (o != null) {
postId = o.getString("POST_ID");
}
}
/** 岗位 结束**/
@ -1667,27 +1679,27 @@ public class UsersController extends BaseController {
for (PageData pageData : editUserList) {
String msg = usersService.changeOrUpdUserCardNo(pageData);
if (!msg.equals(Const.CAN_CHENG_USER)) {
errorStr.append("第" + number + "行,");
errorStr.append(msg+"\n");
errorStr.append("第" + number + "行,");
errorStr.append(msg + "\n");
}
}
for (PageData pageData : addUserList) {
if (PLSUtil.saveUser(pageData)) {
PageData cardNumberPeople = PLSUtil.getCardNumberPeople(pageData);
pageData.put("PLS_ID", cardNumberPeople.getString("psnId"));
}else {
errorStr.append("第" + number + "行,");
errorStr.append("人员定位系统用户添加失败,请联系管理员。"+"\n");
}
PageData response = PLSUtil.saveUser(pageData);
if ("200".equals(response.getString("code"))) {
pageData.put("PLS_ID", response.getString("data"));
} else {
errorStr.append("第" + number + "行,");
errorStr.append("人员定位系统用户添加失败,请联系管理员。" + "\n");
}
}
if (Tools.isEmpty(errorStr.toString())) {
for (PageData pageData : addUserList) {
usersService.saveUser(pageData);
}
for (PageData pageData : editUserList) {
if (PLSUtil.editUser(pageData)) {
usersService.editUser(pageData);
}
if (PLSUtil.editUser(pageData)) {
usersService.editUser(pageData);
}
}
errorStr.append("成功导入" + addUserList.size() + "条数据!");
errorStr.append("成功修改" + editUserList.size() + "条数据!");

View File

@ -1,19 +1,26 @@
package com.zcloud.controller.video;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.video.AIWarningService;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.Tools;
import com.zcloud.service.video.VideoManagerService;
import com.zcloud.util.*;
import org.apache.commons.fileupload.disk.DiskFileItem;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
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 org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.*;
import java.util.*;
/**
* AI
@ -25,6 +32,215 @@ public class AIWarningController extends BaseController {
@Autowired
private AIWarningService aiwarningService;
@Autowired
private VideoManagerService videoManagerService;
@Autowired
private Smb smb;
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/getAlarmInfo",headers = "content-type=multipart/form-data")
@ResponseBody
public Object getAlarmInfo(
@RequestParam(value = "resultVideo", required = false) MultipartFile resultVideo, @RequestParam("resultMsg") String resultMsg) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
if(resultMsg!=null && !resultMsg.equals("")) {
JSONObject json = JSONObject.parseObject(resultMsg);
PageData pd = new PageData();
pd.put("AIWARNING_ID", this.get32UUID()); //主键
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ISDELETE", 0); //是否删除
pd.put("TYPE", Const.WARNING_TYPE_MAP.get(json.get("algType"))); //类型
pd.put("WARNING_TIME", DateUtil.date2Str(new Date(Long.parseLong(json.getString("createTime").substring(0,json.getString("createTime").length()-3))))); //报警时间
File img = base64ToFile(json.getString("resultImg"));
MultipartFile file = getMultipartFile(img);
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + "/" + ffile);
img.delete();
pd.put("IMG_PATH", Const.FILEPATHFILE + "/" + ffile + "/" + fileName);
String ffile1 = DateUtil.getDays();
File video = File.createTempFile(resultVideo.getOriginalFilename(), ".mp4");
resultVideo.transferTo(video);
MultipartFile mvideo = getMultipartFile(video);
String fileName1 = mvideo.getOriginalFilename();
smb.sshSftp(mvideo, fileName1, Const.FILEPATHFILE + "/" + ffile1);
video.delete();
pd.put("VIDEO_PATH", Const.FILEPATHFILE + "/" + ffile1 + "/" + fileName1);
PageData videoPd = new PageData();
videoPd.put("CODE", json.get("cameraCode"));
videoPd = videoManagerService.findByCode(videoPd);
if(videoPd != null){
pd.put("VIDEOMANAGER_ID", videoPd.get("VIDEOMANAGER_ID")); //视频ID
pd.put("VIDEOMANAGER_NAME", videoPd.get("VIDEONAME")); //视频名称
pd.put("OUTSOURCED_ID", videoPd.get("OUTSOURCED_ID")); //重点工程id
}
pd.put("STATUS", 0); //状态0未处置
pd.put("ISTRUE", 3); //状态3未审核
aiwarningService.save(pd);
map.put("result", errInfo);
}else{
map.put("result", "faild");
map.put("msg", "报警信息为空");
}
return map;
}
@RequestMapping(value="/getAlarmInfo2",headers = "content-type=multipart/form-data")
@ResponseBody
public Object getAlarmInfo2(
@RequestParam(value = "resultVideo", required = false) MultipartFile resultVideo, @RequestParam("resultMsg") String resultMsg) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
System.out.println(resultMsg);
if(resultMsg!=null && !resultMsg.equals("")) {
JSONObject json = JSONObject.parseObject(resultMsg);
PageData pd = new PageData();
pd.put("AIWARNING_ID", this.get32UUID()); //主键
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ISDELETE", 0); //是否删除
pd.put("TYPE",Const.WARNING_TYPE_MAP.get(json.get("algType"))); //类型
pd.put("WARNING_TIME", DateUtil.date2Str(new Date(Long.parseLong(json.getString("createTime").substring(0,json.getString("createTime").length()-3))))); //报警时间
File img = base64ToFile(json.getString("sourceImgBase64"));
MultipartFile file = getMultipartFile(img);
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + "/" + ffile);
img.delete();
pd.put("IMG_PATH", Const.FILEPATHFILE + "/" + ffile + "/" + fileName);
String ffile1 = DateUtil.getDays();
File video = File.createTempFile(resultVideo.getOriginalFilename(), ".mp4");
resultVideo.transferTo(video);
MultipartFile mvideo = getMultipartFile(video);
String fileName1 = mvideo.getOriginalFilename();
smb.sshSftp(mvideo, fileName1, Const.FILEPATHFILE + "/" + ffile1);
video.delete();
pd.put("VIDEO_PATH", Const.FILEPATHFILE + "/" + ffile1 + "/" + fileName1);
PageData videoPd = new PageData();
videoPd.put("CODE", json.get("cameraCode"));
videoPd = videoManagerService.findByCode(videoPd);
if(videoPd != null){
pd.put("VIDEOMANAGER_ID", videoPd.get("VIDEOMANAGER_ID")); //视频ID
pd.put("VIDEOMANAGER_NAME", videoPd.get("VIDEONAME")); //视频名称
pd.put("OUTSOURCED_ID", videoPd.get("OUTSOURCED_ID")); //重点工程id
}
pd.put("STATUS", 0); //状态0未处置
pd.put("ISTRUE", 3); //状态3未审核
aiwarningService.save(pd);
map.put("result", errInfo);
}else{
map.put("result", "faild");
map.put("msg", "报警信息为空");
}
return map;
}
@RequestMapping(value="/getAlarmInfo3")
@ResponseBody
public Object getAlarmInfo3(@RequestBody String resultMsg) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
if(resultMsg!=null && !resultMsg.equals("")) {
JSONObject json = JSONObject.parseObject(resultMsg);
PageData pd = new PageData();
pd.put("AIWARNING_ID", this.get32UUID()); //主键
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ISDELETE", 0); //是否删除
pd.put("TYPE",Const.WARNING_TYPE_MAP.get(json.get("algType"))); //类型
pd.put("WARNING_TIME", DateUtil.date2Str(new Date(Long.parseLong(json.getString("createTime").substring(0,json.getString("createTime").length()-3))))); //报警时间
File img = base64ToFile(json.getString("sourceImgBase64"));
MultipartFile file = getMultipartFile(img);
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
smb.sshSftp(file, fileName, Const.FILEPATHFILE + "/" + ffile);
img.delete();
pd.put("IMG_PATH", Const.FILEPATHFILE + "/" + ffile + "/" + fileName);
PageData videoPd = new PageData();
videoPd.put("CODE", json.get("cameraCode"));
videoPd = videoManagerService.findByCode(videoPd);
if(videoPd != null){
pd.put("VIDEOMANAGER_ID", videoPd.get("VIDEOMANAGER_ID")); //视频ID
pd.put("VIDEOMANAGER_NAME", videoPd.get("VIDEONAME")); //视频名称
pd.put("OUTSOURCED_ID", videoPd.get("OUTSOURCED_ID")); //重点工程id
}
pd.put("STATUS", 0); //状态0未处置
pd.put("ISTRUE", 3); //状态3未审核
aiwarningService.save(pd);
map.put("result", errInfo);
}else{
map.put("result", "faild");
map.put("msg", "报警信息为空");
}
return map;
}
private File base64ToFile(String base64) throws IOException {
if(base64.contains("data:image")){
base64 = base64.substring(base64.indexOf(",")+1);
}
base64 = base64.toString().replace("\r\n", "");
//创建文件目录
String prefix=".jpg";
File file = File.createTempFile(get32UUID(), prefix);
BufferedOutputStream bos = null;
FileOutputStream fos = null;
try {
byte[] bytes = Base64.getDecoder().decode(base64);
fos = new FileOutputStream(file);
bos = new BufferedOutputStream(fos);
bos.write(bytes);
}finally {
if (bos != null) {
try {
bos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return file;
}
public static MultipartFile getMultipartFile(File file) {
DiskFileItem item = new DiskFileItem("file"
, MediaType.MULTIPART_FORM_DATA_VALUE
, true
, file.getName()
, (int)file.length()
, file.getParentFile());
try {
OutputStream os = item.getOutputStream();
os.write(FileUtils.readFileToByteArray(file));
} catch (IOException e) {
e.printStackTrace();
}
return new CommonsMultipartFile(item);
}
/**
* @param page
* @throws Exception
@ -63,5 +279,35 @@ public class AIWarningController extends BaseController {
map.put("result", errInfo);
return map;
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/26/026 15:27
* @Param: [] []
* @Return: java.lang.Object
*/
@RequestMapping(value="/edit")
@ResponseBody
public Object edit() throws Exception{
PageData pd = this.getPageData();
pd.put("OPERATOR",Jurisdiction.getUSER_ID());
pd.put("OPERATTIME",DateUtil.date2Str(new Date()));
aiwarningService.edit(pd); //根据ID读取
return ReturnMap.ok();
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/26/026 15:27
* @Param: [] []
* @Return: java.lang.Object
*/
@RequestMapping(value="/removeByIds")
@ResponseBody
public Object removeByIds() throws Exception{
PageData pd = this.getPageData();
String[] aiwarningIds = pd.getString("AIWARNING_IDS").split(",");
aiwarningService.deleteAll(aiwarningIds); //根据ID读取
return ReturnMap.ok();
}
}

View File

@ -1,15 +1,13 @@
package com.zcloud.controller.video;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.logs.LogAnno;
import com.zcloud.service.video.TokenService;
import com.zcloud.service.video.VideoManagerService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Jurisdiction;
import com.zcloud.util.ObjectExcelView;
import com.zcloud.util.Tools;
import com.zcloud.util.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -51,6 +49,11 @@ public class VideoManagerController extends BaseController {
pd.put("OPDATE", DateUtil.date2Str(new Date())); //操作日期
pd.put("OPUSER", Jurisdiction.getUsername()); //操作人
pd.put("ISDELETE", "0"); //是否删除
JSONObject jsonObject = PLSUtil.saveCamera(Jurisdiction.getCORPINFO_ID(), pd);
if (!"200".equals(jsonObject.getString("code"))) {
return ReturnMap.error("三方系统摄像头对接失败");
}
pd.put("PLS_ID", jsonObject.get("data"));
videomanagerService.save(pd);
map.put("result", errInfo);
return map;
@ -69,6 +72,10 @@ public class VideoManagerController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
JSONObject jsonObject = PLSUtil.removeCamera(Jurisdiction.getCORPINFO_ID(), pd);
if (!"200".equals(jsonObject.getString("code"))) {
return ReturnMap.error("三方系统摄像头对接失败");
}
videomanagerService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
@ -85,18 +92,9 @@ public class VideoManagerController extends BaseController {
public Object editZhiding() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
if(Tools.isEmpty(Jurisdiction.getCORPINFO_ID())) {
pd.put("CORPINFO_TYPE", "2");
}else {
pd.put("CORPINFO_TYPE", "1");
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
}
pd.put("ISSHOW", "0");//重置置顶信息。把所有的数据全部取消置顶
videomanagerService.editZhiding(pd);
pd = new PageData();
pd = this.getPageData();
PageData pd = this.getPageData();
pd.put("ISSHOW", "1");
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
videomanagerService.editZhiding(pd);//置顶信息
map.put("pd", pd);
map.put("result", errInfo);
@ -116,6 +114,10 @@ public class VideoManagerController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
JSONObject jsonObject = PLSUtil.editCamera(Jurisdiction.getCORPINFO_ID(), pd);
if (!"200".equals(jsonObject.getString("code"))) {
return ReturnMap.error("三方系统摄像头对接失败,禁止修改");
}
videomanagerService.edit(pd);
map.put("result", errInfo);
return map;

View File

@ -0,0 +1,441 @@
package com.zcloud.mapper.datasource.map;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
import java.util.Map;
/**
*
* luoxiaobao
* 2022-09-21
* www.zcloudchina.com
*/
public interface MapEightMapper {
List<String> getCorpinfoIds(String[] ArrayDATA_IDS);
/**
*
* @param pd
* @return
*/
List<Map<String,Object>> getEcharts(PageData pd);
/**
* [COUNTAPPLY][COUNTAPPROVE][COUNTARCHIVE]
* @param pd
* @return
* @throws Exception
*/
PageData statisticsHighRiskWorkByState(PageData pd);
/**
*
* @param page
* @return
* @throws Exception
*/
List<PageData> realTimeHighRiskWorklistPage(Page page);
/**
* @param pd
* @throws Exception
*/
List<PageData> getHOTWORKHighRiskWorkLocation(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getELECTRICITYHighRiskWorkLocation(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getBLINDBOARDHighRiskWorkLocation(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getHIGHWORKHighRiskWorkLocation(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getCONFINEDSPACEHighRiskWorkLocation(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getHOISTINGHighRiskWorkLocation(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdHOTWORK(PageData pd);
/**
*
* @param pd
* @return
*/
List<PageData> listAlldelayed(PageData pd);
/**
*
* @param pd
* @return
*/
List<PageData> listAllcuoshiHOTWORK(PageData pd);
/**
* @param pd
* @return
*/
List<PageData> listAllMeasuresHOTWORK(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getList(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasures(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllHOTWORK(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdELECTRICITY(PageData pd);
/**
* @param pd
* @return
*/
List<PageData> listAllMeasuresELECTRICITY(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdBLINDBOARD(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findByIdJWD(PageData pd);
/**
* @param pd
* @return
*/
List<PageData> listAllBLINDBOARD(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdHIGHWORK(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasuresHIGHWORK(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdCONFINEDSPACE(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasuresCONFINEDSPACE(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllCONFINEDSPACE(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdHOISTING(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasuresHOISTING(PageData pd);
/**
*
* @param pd
* @return
*/
List<Map<String,Object>> getEchartsOrder(PageData pd);
/**
* [COUNTAPPLY][COUNTAPPROVE][COUNTARCHIVE]
* @param pd
* @return
* @throws Exception
*/
PageData statisticsHighRiskWorkByStateOrder(PageData pd);
/**
*
* @param page
* @return
* @throws Exception
*/
List<PageData> realTimeHighRiskWorklistPageOrder(Page page);
/**
* @param pd
* @throws Exception
*/
List<PageData> getELECTRICITYHighRiskWorkLocationOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getBLINDBOARDHighRiskWorkLocationOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getHIGHWORKHighRiskWorkLocationOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getCONFINEDSPACEHighRiskWorkLocationOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getHOISTINGHighRiskWorkLocationOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getBREAKGROUNDHighRiskWorkLocationOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> getCUTROADHighRiskWorkLocationOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdELECTRICITYOrder(PageData pd);
/**
* @param pd
* @return
*/
List<PageData> listAllMeasuresELECTRICITYOrder(PageData pd);
List<PageData> listAllGasELECTRICTITYOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdBLINDBOARDOrder(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findByIdJWDOrder(PageData pd);
/**
*
* @param pd
* @return
*/
List<PageData> listAllMeasuresBLINDBOARDOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdHIGHWORKOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasuresHIGHWORKOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdHOISTINGOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasuresHOISTINGOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdBREAKGROUNDOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasuresBREAKGROUNDOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdCUTROADOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasuresCUTROADOrder(PageData pd);
/**
*
* @param shuzu
* @return
*/
List<String> getListDongHuo(List<String> shuzu);
/**
* cfd
* @param pd
* @return
*/
List<PageData> getHOTWORKHighRiskWorkLocationCfd(PageData pd);
List<PageData> findByELECTRICTITYAcceptuserId(PageData pd);
List<PageData> findByELECTRICTITYAcceptuserIds(PageData pd);
List<PageData> findByBLINDBOARDAcceptuserId(PageData pd);
List<PageData> findByBLINDBOARDAcceptuserIds(PageData pd);
List<PageData> findByCUTROADAcceptuserId(PageData pd);
List<PageData> findByCUTROADAcceptuserIds(PageData pd);
List<PageData> findByBREAKGROUNDAcceptuserId(PageData pd);
List<PageData> findByBREAKGROUNDAcceptuserIds(PageData pd);
List<PageData> findByHIGHWORKAcceptuserId(PageData pd);
List<PageData> findByHIGHWORKAcceptuserIds(PageData pd);
List<PageData> findByHOISTINGAcceptuserId(PageData pd);
List<PageData> findByHOISTINGAcceptuserIds(PageData pd);
/**
* @param pd
* @throws Exception
*/
PageData findByIdCONFINEDSPACEOrder(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasuresCONFINEDSPACEOrder(PageData pd);
/**
*
* @param pd
* @return
*/
List<PageData> listAllCONFINEDSPACEOrder(PageData pd);
/**
*
* @param pd
* @return
*/
List<PageData> findByIdCONFINEDSPACEAcceptuser(PageData pd);
/**
*
* @param pd
* @return
*/
List<PageData> findByIdCONFINEDSPACEAcceptusers(PageData pd);
/**
*
* @param pd
* @return
*/
PageData findByIdCONFINEDSPACEGasWH(PageData pd);
}

View File

@ -255,4 +255,6 @@ public interface UsersMapper {
PageData findByCardNo(PageData getCordNo);
List<PageData> getUserCardNoAll(PageData departPd);
PageData getUserByCardNo(PageData pageData);
}

View File

@ -33,5 +33,10 @@ public interface AIWarningMapper {
*/
PageData findById(PageData pd);
void save(PageData pd);
void edit(PageData pd);
void deleteAll(String[] aiwarningIds);
}

View File

@ -65,5 +65,14 @@ public interface VideoManagerMapper {
*/
void deleteAll(String[] ArrayDATA_IDS);
PageData findByCode(PageData videoPd);
List<PageData> getCameraAlarmCount(PageData pageData);
List<PageData> getCameraAlarmTypeCount(PageData pageData);
List<PageData> getCameraAlarmTimeCount(PageData pageData);
PageData getCameraTopToShow(PageData pageData);
}

View File

@ -0,0 +1,99 @@
package com.zcloud.service.map;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
import java.util.Map;
/**
*
* luoxiaobao
* 2022-09-21
* www.zcloudchina.com
*/
public interface MapEightService {
List<String> getCorpinfoIds(PageData pd);
Object getEcharts(PageData pd);
PageData statisticsHighRiskWorkByState(PageData pd)throws Exception;
/**
*
* @param page
* @return
* @throws Exception
*/
List<PageData> listHighRiskWork(Page page)throws Exception;
/**
*
* @param pd
* @return
* @throws Exception
*/
List<PageData> listAllHighRiskWorkLocation(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**
* @param pd
* @throws Exception
*/
List<PageData> listAllMeasures(PageData pd);
/**
* id
* @param pd
* @return
*/
Map<String,Object> getById (PageData pd);
/**
*
* @param pd
* @return
*/
Object getEchartsOrder(PageData pd);
/**
*
* @param pd
* @return
* @throws Exception
*/
PageData statisticsHighRiskWorkByStateOrder(PageData pd)throws Exception;
/**
*
* @param page
* @return
* @throws Exception
*/
List<PageData> listHighRiskWorkOrder(Page page)throws Exception;
/**
*
* @param pd
* @return
* @throws Exception
*/
List<PageData> listAllHighRiskWorkLocationOrder(PageData pd)throws Exception;
/**
*
* @param pd
* @return
*/
Map<String, Object> getByIdOrder(PageData pd);
}

View File

@ -0,0 +1,576 @@
package com.zcloud.service.map.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.map.MapEightMapper;
import com.zcloud.service.map.MapEightService;
import com.zcloud.util.Tools;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
/**
*
* luoxiaobao
* 2022-09-21
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class MapEightServiceImpl implements MapEightService {
@Autowired
private MapEightMapper mapEightMapper;
@Override
public List<String> getCorpinfoIds(PageData pd) {
String area = pd.getString("AREA");
if (StringUtils.isNotBlank(area)) {
String[] ArrayDATA_IDS = area.split(",");
return mapEightMapper.getCorpinfoIds(ArrayDATA_IDS);
}
String gangkou = pd.getString("GANGKOU");
if (StringUtils.equals("00003", gangkou)) {
String[] ArrayDATA_IDS = new String[]{"1", "2"};
return mapEightMapper.getCorpinfoIds(ArrayDATA_IDS);
}
return new ArrayList<>();
}
@Override
public Object getEcharts(PageData pd) {
Map<String, Object> returnMap = new HashMap<>();
String errInfo = "success";
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
calendar.add(Calendar.DAY_OF_MONTH, -4);
String dateStr = sdf.format(calendar.getTime());
List<Map<String, Object>> list = mapEightMapper.getEcharts(pd);
List<String> clickDate = new ArrayList<>();
List<String> dhzyCount = new ArrayList<>();
List<String> dbzyCount = new ArrayList<>();
List<String> yxgjzyCount = new ArrayList<>();
List<String> gczyCount = new ArrayList<>();
List<String> dzzyCount = new ArrayList<>();
List<String> lsydCount = new ArrayList<>();
//用于排序,并整理数据
for (int i = 0; i < 5; i++) {
for (Map<String, Object> map : list) {
if (StringUtils.equals(dateStr, map.get("clickDate").toString())) {
clickDate.add(map.get("clickDate").toString());
dhzyCount.add(map.get("dhzyCount").toString());
dbzyCount.add(map.get("dbzyCount").toString());
yxgjzyCount.add(map.get("yxgjzyCount").toString());
gczyCount.add(map.get("gczyCount").toString());
dzzyCount.add(map.get("dzzyCount").toString());
lsydCount.add(map.get("lsydCount").toString());
}
}
calendar.add(Calendar.DAY_OF_MONTH, +1);
dateStr = sdf.format(calendar.getTime());
}
List<String> name = new ArrayList<>();
List<List<String>> date = new ArrayList<>();
name.add("动火作业");
date.add(dhzyCount);
name.add("盲板作业");
date.add(dbzyCount);
name.add("有限空间作业");
date.add(yxgjzyCount);
name.add("高处作业");
date.add(gczyCount);
name.add("吊装作业");
date.add(dzzyCount);
name.add("临时用电");
date.add(lsydCount);
returnMap.put("clickDate", clickDate);
returnMap.put("name", name);
returnMap.put("date", date);
returnMap.put("result", errInfo);
return returnMap;
}
@Override
public PageData statisticsHighRiskWorkByState(PageData pd) throws Exception {
return mapEightMapper.statisticsHighRiskWorkByState(pd);
}
@Override
public List<PageData> listHighRiskWork(Page page) throws Exception {
return mapEightMapper.realTimeHighRiskWorklistPage(page);
}
@Override
public List<PageData> listAllHighRiskWorkLocation(PageData pd) throws Exception {
List<PageData> r = new ArrayList<>();
String typeStr = pd.getString("TYPE");
//动火
if (StringUtils.equals(typeStr, "HOTWORK")) {
// r = mapEightMapper.getHOTWORKHighRiskWorkLocation(pd);
r = mapEightMapper.getHOTWORKHighRiskWorkLocationCfd(pd);
//临时用电
} else if (StringUtils.equals(typeStr, "ELECTRICITY")) {
r = mapEightMapper.getELECTRICITYHighRiskWorkLocationOrder(pd);
//盲板
} else if (StringUtils.equals(typeStr, "BLINDBOARD")) {
r = mapEightMapper.getBLINDBOARDHighRiskWorkLocationOrder(pd);
// 高处
} else if (StringUtils.equals(typeStr, "HIGHWORK")) {
r = mapEightMapper.getHIGHWORKHighRiskWorkLocationOrder(pd);
//有限空间
} else if (StringUtils.equals(typeStr, "CONFINEDSPACE")) {
r = mapEightMapper.getCONFINEDSPACEHighRiskWorkLocationOrder(pd);
//吊装
} else if (StringUtils.equals(typeStr, "HOISTING")) {
r = mapEightMapper.getHOISTINGHighRiskWorkLocationOrder(pd);
}
return r;
}
@Override
public List<PageData> listAll(PageData pd) {
return mapEightMapper.listAll(pd);
}
@Override
public List<PageData> listAllMeasures(PageData pd) {
return mapEightMapper.listAllMeasures(pd);
}
@Override
public Map<String, Object> getById(PageData pd) {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
String typeStr = pd.getString("TYPE");
String idStr = pd.getString("id");
List<PageData> pageDataList = new ArrayList<>();
if (StringUtils.equals(typeStr, "HOTWORK")) {
pd.put("HOTWORKAPPLICATION_ID", idStr);
pd = mapEightMapper.findByIdHOTWORK(pd);
pd = dianhuo(pd);
List<PageData> list = mapEightMapper.getList(pd);
//这里封装前台要的参数
pd = shenpi(pd, list);
map.put("measuresList", mapEightMapper.listAllMeasuresHOTWORK(pd));
map.put("gasList", mapEightMapper.listAllHOTWORK(pd));
List<PageData> safetymethodrecordList = mapEightMapper.listAllcuoshiHOTWORK(pd);//其它安全措施明细集合
map.put("safetymethodrecordList", safetymethodrecordList);
List<PageData> delayedList = mapEightMapper.listAlldelayed(pd);
map.put("delayedList", delayedList);
} else if (StringUtils.equals(typeStr, "ELECTRICITY")) {
pd.put("ELECTRICITY_ID", idStr);
pd = mapEightMapper.findByIdELECTRICITY(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresELECTRICITY(pd));
} else if (StringUtils.equals(typeStr, "BLINDBOARD")) {
pd.put("BLINDBOARD_ID", idStr);
pd = mapEightMapper.findByIdBLINDBOARD(pd);
PageData Info = mapEightMapper.findByIdJWD(pd);
pd.put("TYPE", 105);//盲板位置图
pd.put("FOREIGN_KEY", pd.getString("BLINDBOARD_ID"));
List<PageData> ImgList = mapEightMapper.listAllBLINDBOARD(pd);
map.put("Info", Info);//获取经纬度
map.put("ImgList", ImgList);
} else if (StringUtils.equals(typeStr, "HIGHWORK")) {
pd.put("HIGHWORK_ID", idStr);
pd = mapEightMapper.findByIdHIGHWORK(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresHIGHWORK(pd));
} else if (StringUtils.equals(typeStr, "CONFINEDSPACE")) {
pd.put("CONFINEDSPACE_ID", idStr);
pd = mapEightMapper.findByIdCONFINEDSPACE(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresCONFINEDSPACE(pd));
map.put("gasList", mapEightMapper.listAllCONFINEDSPACE(pd));
} else if (StringUtils.equals(typeStr, "HOISTING")) {
pd.put("HOISTING_ID", idStr);
pd = mapEightMapper.findByIdHOISTING(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresHOISTING(pd));
}
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
@Override
public Object getEchartsOrder(PageData pd) {
Map<String, Object> returnMap = new HashMap<>();
String errInfo = "success";
//根据条件增加参数或减少参数 都没有 直接返回空
if (StringUtils.isBlank(pd.getString("CORPINFO_ID"))) {
List<String> ArrayDATA_IDS = getCorpinfoIds(pd);
if (ArrayDATA_IDS.size() == 0) {
returnMap.put("result", errInfo);
return returnMap;
} else {
pd.put("ids", ArrayDATA_IDS);
pd.remove("CORPINFO_ID");
}
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
calendar.add(Calendar.DAY_OF_MONTH, -4);
String dateStr = sdf.format(calendar.getTime());
List<Map<String, Object>> list = mapEightMapper.getEchartsOrder(pd);
List<String> clickDate = new ArrayList<>();
List<String> dhzyCount = new ArrayList<>();
List<String> dbzyCount = new ArrayList<>();
List<String> yxgjzyCount = new ArrayList<>();
List<String> gczyCount = new ArrayList<>();
List<String> dzzyCount = new ArrayList<>();
List<String> lsydCount = new ArrayList<>();
List<String> dtzyCount = new ArrayList<>();
List<String> dlzyCount = new ArrayList<>();
//用于排序,并整理数据
for (int i = 0; i < 5; i++) {
for (Map<String, Object> map : list) {
if (StringUtils.equals(dateStr, map.get("clickDate").toString())) {
clickDate.add(map.get("clickDate").toString());
dhzyCount.add(map.get("dhzyCount").toString());
dbzyCount.add(map.get("dbzyCount").toString());
yxgjzyCount.add(map.get("yxgjzyCount").toString());
gczyCount.add(map.get("gczyCount").toString());
dzzyCount.add(map.get("dzzyCount").toString());
lsydCount.add(map.get("lsydCount").toString());
dtzyCount.add(map.get("dtzyCount").toString());
dlzyCount.add(map.get("dlzyCount").toString());
}
}
calendar.add(Calendar.DAY_OF_MONTH, +1);
dateStr = sdf.format(calendar.getTime());
}
List<String> name = new ArrayList<>();
List<List<String>> date = new ArrayList<>();
name.add("动火作业");
date.add(dhzyCount);
name.add("盲板作业");
date.add(dbzyCount);
name.add("有限空间作业");
date.add(yxgjzyCount);
name.add("高处作业");
date.add(gczyCount);
name.add("吊装作业");
date.add(dzzyCount);
name.add("临时用电");
date.add(lsydCount);
name.add("动土作业");
date.add(dtzyCount);
name.add("断路作业");
date.add(dlzyCount);
returnMap.put("clickDate", clickDate);
returnMap.put("name", name);
returnMap.put("date", date);
returnMap.put("result", errInfo);
return returnMap;
}
@Override
public PageData statisticsHighRiskWorkByStateOrder(PageData pd) throws Exception {
//根据条件增加参数或减少参数 都没有 直接返回空
return mapEightMapper.statisticsHighRiskWorkByStateOrder(pd);
}
@Override
public List<PageData> listHighRiskWorkOrder(Page page) throws Exception {
return mapEightMapper.realTimeHighRiskWorklistPageOrder(page);
}
@Override
public List<PageData> listAllHighRiskWorkLocationOrder(PageData pd) throws Exception {
List<PageData> r = new ArrayList<>();
String typeStr = pd.getString("TYPE");
//动火
if (StringUtils.equals(typeStr, "HOTWORK")) {
r = mapEightMapper.getHOTWORKHighRiskWorkLocation(pd);
//临时用电
} else if (StringUtils.equals(typeStr, "ELECTRICITY")) {
r = mapEightMapper.getELECTRICITYHighRiskWorkLocationOrder(pd);
//盲板
} else if (StringUtils.equals(typeStr, "BLINDBOARD")) {
r = mapEightMapper.getBLINDBOARDHighRiskWorkLocationOrder(pd);
// 高处
} else if (StringUtils.equals(typeStr, "HIGHWORK")) {
r = mapEightMapper.getHIGHWORKHighRiskWorkLocationOrder(pd);
//有限空间
} else if (StringUtils.equals(typeStr, "CONFINEDSPACE")) {
r = mapEightMapper.getCONFINEDSPACEHighRiskWorkLocationOrder(pd);
//吊装
} else if (StringUtils.equals(typeStr, "HOISTING")) {
r = mapEightMapper.getHOISTINGHighRiskWorkLocationOrder(pd);
//动土
} else if (StringUtils.equals(typeStr, "BREAKGROUND")) {
r = mapEightMapper.getBREAKGROUNDHighRiskWorkLocationOrder(pd);
//断路
} else if (StringUtils.equals(typeStr, "CUTROAD")) {
r = mapEightMapper.getCUTROADHighRiskWorkLocationOrder(pd);
}
return r;
}
@Override
public Map<String, Object> getByIdOrder(PageData pd) {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
String typeStr = pd.getString("TYPE");
String idStr = pd.getString("id");
List<PageData> pageDataList = new ArrayList<>();
if (StringUtils.equals(typeStr, "HOTWORK")) {
pd.put("HOTWORKAPPLICATION_ID", idStr);
pd = mapEightMapper.findByIdHOTWORK(pd);
pd = dianhuo(pd);
List<PageData> list = mapEightMapper.getList(pd);
//这里封装前台要的参数
pd = shenpi(pd, list);
map.put("measuresList", mapEightMapper.listAllMeasuresHOTWORK(pd));
map.put("gasList", mapEightMapper.listAllHOTWORK(pd));
} else if (StringUtils.equals(typeStr, "ELECTRICITY")) {
pd.put("ELECTRICITY_ID", idStr);
pd = mapEightMapper.findByIdELECTRICITYOrder(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresELECTRICITYOrder(pd));
map.put("gasList", mapEightMapper.listAllGasELECTRICTITYOrder(pd));
map.put("imgList1", mapEightMapper.findByELECTRICTITYAcceptuserId(pd));
map.put("imgList", mapEightMapper.findByELECTRICTITYAcceptuserIds(pd));
} else if (StringUtils.equals(typeStr, "BLINDBOARD")) {
pd.put("BLINDBOARD_ID", idStr);
pd = mapEightMapper.findByIdBLINDBOARDOrder(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresBLINDBOARDOrder(pd));
PageData Info = mapEightMapper.findByIdJWDOrder(pd);
pd.put("TYPE", 105);//盲板位置图
pd.put("FOREIGN_KEY", pd.getString("BLINDBOARD_ID"));
List<PageData> ImgList = mapEightMapper.listAllBLINDBOARD(pd);
map.put("Info", Info);//获取经纬度
map.put("ImgList", ImgList);
map.put("imgList1", mapEightMapper.findByBLINDBOARDAcceptuserId(pd));
map.put("imgList", mapEightMapper.findByBLINDBOARDAcceptuserIds(pd));
} else if (StringUtils.equals(typeStr, "HIGHWORK")) {
pd.put("HIGHWORK_ID", idStr);
pd = mapEightMapper.findByIdHIGHWORKOrder(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresHIGHWORKOrder(pd));
map.put("imgList1", mapEightMapper.findByHIGHWORKAcceptuserId(pd));
map.put("imgList", mapEightMapper.findByHIGHWORKAcceptuserIds(pd));
} else if (StringUtils.equals(typeStr, "CONFINEDSPACE")) {
pd.put("CONFINEDSPACE_ID", idStr);
pd = mapEightMapper.findByIdCONFINEDSPACEOrder(pd); //根据ID读取
map.put("measuresList", mapEightMapper.listAllMeasuresCONFINEDSPACEOrder(pd));
map.put("gasList", mapEightMapper.listAllCONFINEDSPACEOrder(pd));
map.put("gas", mapEightMapper.findByIdCONFINEDSPACEGasWH(pd));
map.put("imgList", mapEightMapper.findByIdCONFINEDSPACEAcceptusers(pd));
map.put("imgList1", mapEightMapper.findByIdCONFINEDSPACEAcceptuser(pd));
} else if (StringUtils.equals(typeStr, "HOISTING")) {
pd.put("HOISTING_ID", idStr);
pd = mapEightMapper.findByIdHOISTINGOrder(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresHOISTINGOrder(pd));
map.put("imgList1", mapEightMapper.findByHOISTINGAcceptuserId(pd));
map.put("imgList", mapEightMapper.findByHOISTINGAcceptuserIds(pd));
} else if (StringUtils.equals(typeStr, "BREAKGROUND")) {
pd.put("BREAKGROUND_ID", idStr);
pd = mapEightMapper.findByIdBREAKGROUNDOrder(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresBREAKGROUNDOrder(pd));
map.put("imgList1", mapEightMapper.findByBREAKGROUNDAcceptuserId(pd));
map.put("imgList", mapEightMapper.findByBREAKGROUNDAcceptuserIds(pd));
} else if (StringUtils.equals(typeStr, "CUTROAD")) {
pd.put("CUTROAD_ID", idStr);
pd = mapEightMapper.findByIdCUTROADOrder(pd);
map.put("measuresList", mapEightMapper.listAllMeasuresCUTROADOrder(pd));
map.put("imgList1", mapEightMapper.findByCUTROADAcceptuserId(pd));
map.put("imgList", mapEightMapper.findByCUTROADAcceptuserIds(pd));
}
map.put("pd", pd);
map.put("result", errInfo);
return map;
}
private PageData shenpi(PageData pd, List<PageData> list) {
List<PageData> specialUserList = new ArrayList<>();
for (PageData userPageData : list) {
String type = userPageData.get("STATE").toString();
if ("0".equals(type)) { // 申请办理人
pd.put("APPLY_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("APPLY_USER_NAME", userPageData.getString("userName"));
pd.put("APPLY_USER_ID", userPageData.getString("USER_ID"));
} else if ("1".equals(type)) { // 动火单位确认人
pd.put("HOT_WORK_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("HOT_WORK_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("HOT_WORK_USER_ID", userPageData.getString("USER_ID"));
pd.put("HOT_WORK_USER_NAME", userPageData.getString("userName"));
pd.put("HOT_WORK_USER_PHONE", userPageData.getString("userPhone"));
pd.put("HOT_WORK_USER_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("HOT_WORK_USER_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("2".equals(type)) { // 项目发包单位
pd.put("PROJECT_UNIT_LEADER_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("PROJECT_UNIT_LEADER_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("PROJECT_UNIT_LEADER_ID", userPageData.getString("USER_ID"));
pd.put("PROJECT_UNIT_LEADER_NAME", userPageData.getString("userName"));
pd.put("PROJECT_UNIT_LEADER_PHONE", userPageData.getString("userPhone"));
pd.put("PROJECT_UNIT_LEADER_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("PROJECT_UNIT_LEADER_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("3".equals(type)) { // 现场管辖单位负责人
pd.put("UNIT_LEADER_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("UNIT_LEADER_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("UNIT_LEADER_ID", userPageData.getString("USER_ID"));
pd.put("UNIT_LEADER_NAME", userPageData.getString("userName"));
pd.put("UNIT_LEADER_PHONE", userPageData.getString("userPhone"));
pd.put("UNIT_LEADER_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("UNIT_LEADER_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("4".equals(type)) { //动火许可签发单位负责人
pd.put("ISSUING_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("ISSUING_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("ISSUING_USER_ID", userPageData.getString("USER_ID"));
pd.put("ISSUING_USER_NAME", userPageData.getString("userName"));
pd.put("ISSUING_USER_PHONE", userPageData.getString("userPhone"));
pd.put("ISSUING_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("ISSUING_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("5".equals(type)) { // 安全总监审批
pd.put("SAFETY_DIRECTOR_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("SAFETY_DIRECTOR_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("SAFETY_DIRECTOR_USER_ID", userPageData.getString("USER_ID"));
pd.put("SAFETY_DIRECTOR_USER_NAME", userPageData.getString("userName"));
pd.put("SAFETY_DIRECTOR_PHONE", userPageData.getString("userPhone"));
pd.put("SAFETY_DIRECTOR_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("SAFETY_DIRECTOR_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("6".equals(type)) { // 现场负责人接收
pd.put("SITE_LEADER_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("SITE_LEADER_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("SITE_LEADER_ID", userPageData.getString("USER_ID"));
pd.put("SITE_LEADER_NAME", userPageData.getString("userName"));
pd.put("SITE_LEADER_PHONE", userPageData.getString("userPhone"));
pd.put("SITE_DIRECTOR_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("SITE_DIRECTOR_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("7".equals(type)) { // 动火前
pd.put("HOT_WORK_PERSON_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("HOT_WORK_PERSON_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("HOT_WORK_PERSON_USER_NAME", userPageData.getString("userName"));
pd.put("HOT_WORK_PERSON_PHONE", userPageData.getString("userPhone"));
pd.put("HOT_WORK_PERSON_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("HOT_WORK_PERSON_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("8".equals(type)) { // 现在负责人
pd.put("PERSON_CONFIRM_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("PERSON_CONFIRM_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("PERSON_CONFIRM_USER_NAME", userPageData.getString("userName"));
pd.put("PERSON_CONFIRM_PHONE", userPageData.getString("userPhone"));
pd.put("PERSON_CONFIRM_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("PERSON_CONFIRM_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("9".equals(type)) { // 动火后
pd.put("HOT_WORK_AFTER_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("HOT_WORK_AFTER_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("HOT_WORK_AFTER_USER_NAME", userPageData.getString("userName"));
pd.put("HOT_WORK_AFTER_PHONE", userPageData.getString("userPhone"));
pd.put("HOT_WORK_AFTER_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("HOT_WORK_AFTER_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("10".equals(type)) { // 延时监火
pd.put("TIME_LAPSE_FIREMAN_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("TIME_LAPSE_FIREMAN_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("TIME_LAPSE_FIREMAN_NAME", userPageData.getString("userName"));
pd.put("TIME_LAPSE_FIREMAN_PHONE", userPageData.getString("userPhone"));
pd.put("TIME_LAPSE_FIREMAN_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("TIME_LAPSE_FIREMAN_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("21".equals(type)) { // 动火操作人
String userName = userPageData.getString("userName2") + ",";
String oldName = Tools.isEmpty(pd.get("HOT_WORK_OPERATOR_NAME")) ? "" : pd.get("HOT_WORK_OPERATOR_NAME").toString();
pd.put("HOT_WORK_OPERATOR_NAME", oldName + userName);
} else if ("22".equals(type)) { // 动火操作人
pd.put("SUPERVISOR_OF_HOT_WORK_UNIT", userPageData.getString("USER_ID"));
String userName = userPageData.getString("userName2") + ",";
String oldName = Tools.isEmpty(pd.get("HOT_WORK_OPERATOR_NAME")) ? "" : pd.get("HOT_WORK_OPERATOR_NAME").toString();
pd.put("SUPERVISOR_OF_HOT_WORK_UNIT_NAME", oldName + userName);
} else if ("24".equals(type)) { // 需要气体检测
pd.put("GAS_TESTING_DEPARTMENT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("GAS_TESTING_DEPARTMENT_NAME", userPageData.getString("deptName"));
pd.put("GAS_TESTING_USER_ID", userPageData.getString("USER_ID"));
pd.put("GAS_TESTING_USER_NAME", userPageData.getString("userName"));
pd.put("GAS_TESTING_USER_PHONE", userPageData.getString("userPhone"));
pd.put("GAS_TESTING_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("GAS_TESTING_PRINCIPAL_TIME", userPageData.getString("OPERATTIME"));
} else if ("30".equals(type)) { // 特级动火 动火负责人确认
pd.put("projectCompetent_DEPT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("projectCompetent_DEPT_NAME", userPageData.getString("deptName"));
pd.put("projectCompetent_USER_NAME", userPageData.getString("userName"));
pd.put("projectCompetent_USER_ID", userPageData.getString("USER_ID"));
pd.put("projectCompetent_PHONE", userPageData.getString("userPhone"));
pd.put("projectCompetent_OPERATTIME", userPageData.getString("OPERATTIME"));
pd.put("projectCompetent_TYPE", userPageData.getString("TYPE"));
// APP回显使用
pd.put("CHARGECONFIRM_DEPT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("CHARGECONFIRM_DEPT_NAME", userPageData.getString("deptName"));
pd.put("CHARGECONFIRM_USER_ID", userPageData.getString("USER_ID"));
pd.put("CHARGECONFIRM_USER_NAME", userPageData.getString("userName"));
pd.put("CHARGECONFIRM_USER_PHONE", userPageData.getString("userPhone"));
} else if ("31".equals(type)) { // 特级动火 动火负责人确认
pd.put("projectSupervisor_DEPT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("projectSupervisor_DEPT_NAME", userPageData.getString("deptName"));
pd.put("projectSupervisor_USER_NAME", userPageData.getString("userName"));
pd.put("projectSupervisor_PHONE", userPageData.getString("userPhone"));
pd.put("projectCompetent_OPERATTIME", userPageData.getString("OPERATTIME"));
pd.put("projectSupervisor_TYPE", userPageData.getString("TYPE"));
} else if ("32".equals(type)) { // 特级动火 动火负责人确认
pd.put("projectPreliminarily_DEPT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("projectPreliminarily_DEPT_NAME", userPageData.getString("deptName"));
pd.put("projectPreliminarily_USER_NAME", userPageData.getString("userName"));
pd.put("projectPreliminarily_PHONE", userPageData.getString("userPhone"));
pd.put("projectPreliminarily_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("projectPreliminarily_OPERATTIME", userPageData.getString("OPERATTIME"));
pd.put("projectPreliminarily_TYPE", userPageData.getString("TYPE"));
} else if ("33".equals(type)) { // 特级动火 动火负责人确认
pd.put("inspectorGeneral_DEPT_ID", userPageData.getString("DEPARTMENT_ID"));
pd.put("inspectorGeneral_DEPT_NAME", userPageData.getString("deptName"));
pd.put("inspectorGeneral_USER_NAME", userPageData.getString("userName"));
pd.put("inspectorGeneral_PHONE", userPageData.getString("userPhone"));
pd.put("inspectorGeneral_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("inspectorGeneral_OPERATTIME", userPageData.getString("OPERATTIME"));
pd.put("inspectorGeneral_TYPE", userPageData.getString("TYPE"));
} else if ("34".equals(type)) { //分公司主要负责人
pd.put("OFFICE_RESPOMSIBLE_DEPT_NAME", userPageData.getString("REGULATORY_DEPT_NAME"));
pd.put("OFFICE_RESPOMSIBLE_USER_NAME", userPageData.getString("REGULATORY_USER_NAME"));
pd.put("OFFICE_RESPOMSIBLE_PHONE", userPageData.getString("userPhone"));
pd.put("OFFICE_RESPOMSIBLE_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("OFFICE_RESPOMSIBLE_OPERATTIME", userPageData.getString("OPERATTIME"));
pd.put("OFFICE_RESPOMSIBLE_TYPE", userPageData.getString("TYPE"));
} else if ("35".equals(type)) { // 特级动火 安全监督部初审
pd.put("SUPERVISION_DEPARTMENT_DEPT_NAME", userPageData.getString("REGULATORY_DEPT_NAME"));
pd.put("SUPERVISION_DEPARTMENT_USER_NAME", userPageData.getString("REGULATORY_USER_NAME"));
pd.put("SUPERVISION_DEPARTMENT_PHONE", userPageData.getString("userPhone"));
pd.put("SUPERVISION_DEPARTMENT_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("SUPERVISION_DEPARTMENT_OPERATTIME", userPageData.getString("OPERATTIME"));
pd.put("SUPERVISION_DEPARTMENT_TYPE", userPageData.getString("TYPE"));
} else if ("36".equals(type)) { // 特级动火 安委会办公室审批
pd.put("SECURITY_COMMITTEE_DEPT_NAME", userPageData.getString("REGULATORY_DEPT_NAME"));
pd.put("SECURITY_COMMITTEE_USER_NAME", userPageData.getString("REGULATORY_USER_NAME"));
pd.put("SECURITY_COMMITTEE_PHONE", userPageData.getString("userPhone"));
pd.put("SECURITY_COMMITTEE_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("SECURITY_COMMITTEE_OPERATTIME", userPageData.getString("OPERATTIME"));
pd.put("SECURITY_COMMITTEE_TYPE", userPageData.getString("TYPE"));
} else if ("37".equals(type)) { // 特级动火 安全总监签批
pd.put("SAFETY_DIRECTOR_DEPT_NAME", userPageData.getString("REGULATORY_DEPT_NAME"));
pd.put("SAFETY_DIRECTOR_USER_NAME", userPageData.getString("REGULATORY_USER_NAME"));
pd.put("SAFETY_DIRECTOR_PHONE", userPageData.getString("userPhone"));
pd.put("SAFETY_DIRECTOR_PRINCIPAL", userPageData.getString("AUTOGRAPH"));
pd.put("SAFETY_DIRECTOR_OPERATTIME", userPageData.getString("OPERATTIME"));
pd.put("SAFETY_DIRECTOR_TYPE", userPageData.getString("TYPE"));
}
}
pd.put("specialUserList", specialUserList);
return pd;
}
private PageData dianhuo(PageData pd) {
if (StringUtils.isBlank(pd.getString("HOT_WORK_METHOD_NAME"))) {
String zidian = pd.getString("HOT_WORK_METHOD_ID");
List<String> shuzu = Arrays.asList(zidian.split(","));
List<String> wenzi = mapEightMapper.getListDongHuo(shuzu);
String pinjie = String.join(",", wenzi);
pd.put("HOT_WORK_METHOD_NAME", pinjie);
}
return pd;
}
}

View File

@ -3,6 +3,7 @@ package com.zcloud.service.system;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.entity.system.User;
import com.zcloud.util.ReturnMap;
import java.io.IOException;
import java.util.List;
@ -266,7 +267,7 @@ public interface UsersService {
void editUserState(PageData pageData)throws Exception;
void saveUserNew(PageData pd) throws Exception;
ReturnMap saveUserNew(PageData pd) throws Exception;
/**USERID
* @param pd
@ -291,4 +292,13 @@ public interface UsersService {
String changeOrUpdUserCardNo(PageData pd) throws Exception;
List<PageData> getUserCardNoAll(PageData departPd);
/**
* @Description: id
* @Author: dearLin
* @Date: 2024/1/29/029 9:05
* @Param: [com.zcloud.entity.PageData] [pageData]
* @Return: com.zcloud.entity.PageData
*/
PageData getUserByCardNo(PageData pageData);
}

View File

@ -250,23 +250,24 @@ public class UsersServiceImpl implements UsersService {
@Override
public String changeOrUpdUserCardNo(PageData nowuser) throws Exception {
PageData oldUser = usersMapper.findById(nowuser);
// 此人原来无卡号
// 先判断人员新的定位卡号是否有变化,没变化直接可以修改
if (oldUser.getString("CARDNO") == null || oldUser.getOrDefault("CARDNO","").equals(nowuser.getString("CARDNO"))) {
if (oldUser.getString("CARDNO") != null && oldUser.getOrDefault("CARDNO", "").equals(nowuser.getString("CARDNO"))) {
return Const.CAN_CHENG_USER;
}
// 有变化看库里是否有人在用这个新卡号
PageData getCordNo = new PageData();
getCordNo.putAll(nowuser);
getCordNo.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
getCordNo.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
PageData usedCardNo = usersMapper.findByCardNo(getCordNo);
// 卡号被本系统中他人使用了
if (usedCardNo != null) {
return Const.CARD_ALREADY_BEEN_USED+usedCardNo.getString("NAME");
return Const.CARD_ALREADY_BEEN_USED + usedCardNo.getString("NAME");
}
PageData cardNumberPeople = PLSUtil.getCardNumberPeople(nowuser);
// 这个新卡号其他系统中绑定人了
if (cardNumberPeople != null) {
return "人员定位系统中"+Const.CARD_ALREADY_BEEN_USED+cardNumberPeople.getString("name");
return "人员定位系统中" + Const.CARD_ALREADY_BEEN_USED + cardNumberPeople.getString("name");
}
return Const.CAN_CHENG_USER;
}
@ -277,14 +278,19 @@ public class UsersServiceImpl implements UsersService {
}
@Override
public void saveUserNew(PageData pd) throws Exception {
public PageData getUserByCardNo(PageData pageData) {
return usersMapper.getUserByCardNo(pageData);
}
@Override
public ReturnMap saveUserNew(PageData pd) throws Exception {
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
pd.put("WORKSTATUS", "1");
pd.put("WORKPERIOD", "1");
pd.put("RIGHTS", "788664966448");
// 先判断这个人定位卡号与姓名是否对的上
if (!PLSUtil.hasCardNumber(pd)) {
throw new Exception(pd.getString("CARDNO") + "定位卡已经存在");
return ReturnMap.error(pd.getString("CARDNO") + "定位卡已经存在");
}
if (pd.get("USERAVATARURL") != null && !pd.getString("USERAVATARURL").equals("")) {
@ -310,7 +316,7 @@ public class UsersServiceImpl implements UsersService {
pd.put("SKIN", "pcoded-navbar navbar-image-3, navbar pcoded-header navbar-expand-lg navbar-light header-dark");
pd.put("PASSWORD", new SimpleHash("SHA-1", pd.getString("USERNAME"), "666666").toString());
if (usersMapper.findByUsername(pd) == null && PLSUtil.saveUser(pd)) {
if (usersMapper.findByUsername(pd) == null) {
if ("true".equals(pd.getString("ISSTUDENT"))) {
if ("select".equals(pd.getString("letDutiesType"))) {
pd.put("DUTIES", pd.getString("DUTIES"));
@ -344,13 +350,19 @@ public class UsersServiceImpl implements UsersService {
}
userInfoService.save(pd);
}
PageData cardNumberPeople = PLSUtil.getCardNumberPeople(pd);
pd.put("PLS_ID", cardNumberPeople.getString("psnId"));
usersMapper.saveUser(pd);
FHLOG.save(Jurisdiction.getUsername(), "新增用户:" + pd.getString("USERNAME"));
} else {
throw new Exception("请检查定位卡号与用户名是否重复");
PageData response = PLSUtil.saveUser(pd);
if ("200".equals(response.getString("code"))) {
pd.put("PLS_ID", response.getString("data"));
usersMapper.saveUser(pd);
FHLOG.save(Jurisdiction.getUsername(), "新增用户:" + pd.getString("USERNAME"));
return ReturnMap.ok();
}
return ReturnMap.error(response.getString("msg"));
}
return ReturnMap.error("保存失败");
// PageData cardNumberPeople = PLSUtil.getCardNumberPeople(pd);
// pd.put("PLS_ID", cardNumberPeople.getString("psnId"));
// usersMapper.saveUser(pd);
}

View File

@ -32,5 +32,10 @@ public interface AIWarningService {
*/
public PageData findById(PageData pd)throws Exception;
void save(PageData pd);
void edit(PageData pd);
void deleteAll(String[] aiwarningIds);
}

View File

@ -4,6 +4,7 @@ import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
import java.util.Map;
/**
*
@ -65,5 +66,14 @@ public interface VideoManagerService {
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
PageData findByCode(PageData videoPd);
List<PageData> getCameraAlarmCount(PageData pageData);
List<PageData> getCameraAlarmTypeCount(PageData pageData);
PageData getCameraAlarmTimeCount(PageData pageData);
PageData getCameraTopToShow(PageData pageData);
}

View File

@ -47,5 +47,20 @@ public class AIWarningServiceImpl implements AIWarningService {
public PageData findById(PageData pd)throws Exception{
return aiwarningMapper.findById(pd);
}
@Override
public void save(PageData pd) {
aiwarningMapper.save(pd);
}
@Override
public void edit(PageData pd) {
aiwarningMapper.edit(pd);
}
@Override
public void deleteAll(String[] aiwarningIds) {
aiwarningMapper.deleteAll(aiwarningIds);
}
}

View File

@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
@ -94,5 +95,48 @@ public class VideoManagerServiceImpl implements VideoManagerService {
videomanagerMapper.deleteAll(ArrayDATA_IDS);
}
@Override
public PageData findByCode(PageData videoPd) {
return videomanagerMapper.findByCode(videoPd);
}
@Override
public List<PageData> getCameraAlarmCount(PageData pageData) {
return videomanagerMapper.getCameraAlarmCount(pageData);
}
@Override
public List<PageData> getCameraAlarmTypeCount(PageData pageData) {
return videomanagerMapper.getCameraAlarmTypeCount(pageData);
}
@Override
public PageData getCameraAlarmTimeCount(PageData pageData) {
List<PageData> cameraAlarmTimeCount = videomanagerMapper.getCameraAlarmTimeCount(pageData);
int leijicont = 0;
// 月份集合
List<String> monthStrList = new ArrayList<>();
// 当月数据
List<Integer> monthList = new ArrayList<>();
// 累计数据
List<Integer> accumulatedList = new ArrayList<>();
for (PageData item : cameraAlarmTimeCount) {
monthStrList.add(item.getString("MONTH"));
monthList.add(Integer.parseInt(item.getString("MONTH_COUNT")));
leijicont += Integer.parseInt(item.getString("MONTH_COUNT"));
accumulatedList.add(leijicont);
}
PageData valuePd = new PageData();
valuePd.put("monthStrList",monthStrList);
valuePd.put("monthList",monthList);
valuePd.put("accumulatedList",accumulatedList);
return valuePd;
}
@Override
public PageData getCameraTopToShow(PageData pageData) {
return videomanagerMapper.getCameraTopToShow(pageData);
}
}

View File

@ -1,5 +1,8 @@
package com.zcloud.util;
import java.util.HashMap;
import java.util.Map;
/**
*
* luoxiaobao
@ -73,4 +76,35 @@ public class Const {
// 修改用户相关
public static final String CAN_CHENG_USER="SUCCEEDS";
public static final String CARD_ALREADY_BEEN_USED="当前卡号已经被使用。使用人:";
public static final Map<String,String> WARNING_TYPE_MAP = new HashMap() {{
put("blockingmonitoring", "占道");
put("chefhatmonitoring", "厨师帽检测");
put("chefuniformmonitoring", "厨师服检测");
put("elevatorebikemonitoring", "电摩入梯");
put("empty", "空算法");
put("example", "示例算法");
put("facemaskmonitoring", "口罩检测");
put("faceset", "人脸识别(人脸库)");
put("fireextinguisherdetection", "灭火器");
put("gluedtophonemonitoring", "玩手机检测");
put("helmetwearingmonitoring", "安全帽");
put("intrusionmonitoring", "入侵检测(越界)");
put("intrusionmonitoringplus", "陌生人入侵");
put("mnpmonitoring", "机非人");
put("mousedetection", "老鼠检测");
put("nlprdetection", "车牌检测(车牌库)");
put("ondutymonitoring", "离岗检测");
put("peoplecountingcrossing", "过线人数统计");
put("peoplecrossingmonitoring", "过线检测");
put("peopledensitydetection", "人员密度检测");
put("peoplefalldetection", "人员跌倒检测");
put("peoplequeuemonitoring", "排队长度检测(排队统计)");
put("safetyvestmonitoring", "反光衣检测");
put("sleepingondutymonitoring", "睡岗");
put("smokefiremonitoring", "烟火检测");
put("smokingcallmonitoring", "抽烟打电话");
put("uniformnn", "工服(工服库)");
put("wastebinmonitoring", "垃圾桶检测");
}};
}

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,6 @@
package com.zcloud.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.entity.Camera;
import com.zcloud.entity.Card;
import com.zcloud.entity.EmployeeData;
import com.zcloud.entity.PageData;
import com.zcloud.service.corp.CorpPlsInfoService;
import com.zcloud.service.system.UsersService;
@ -12,17 +8,17 @@ import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
@Component
@ -35,6 +31,19 @@ public class PLSUtil {
public static HashMap<String, String> BAKEADDR = new HashMap<>();
private static RestTemplate restTemplate;
public static JSONObject getPersonnelPositioningCount(String CORPINFO_ID, Integer currentPage, Integer showCount) throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
ResponseEntity<JSONObject> exchange = restTemplate.exchange(
PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/deploy/card/list?sortThePowerLevel=1&pageNum=" +
currentPage +
"&pageSize=" + showCount,
HttpMethod.GET, httpEntity,
JSONObject.class);
return exchange.getBody();
}
@Autowired
public void setCorpplsinfoService(CorpPlsInfoService corpplsinfoServicebean, UsersService usersServicebean, RestTemplate restTemplatebean) {
corpplsinfoService = corpplsinfoServicebean;
@ -42,6 +51,98 @@ public class PLSUtil {
restTemplate = restTemplatebean;
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/25/025 14:37
* @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount]
* @Return: com.alibaba.fastjson.JSONObject
*/
public static JSONObject getAlarmTypeCount(String CORPINFO_ID) throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
ResponseEntity<JSONObject> exchange = restTemplate.exchange(
PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/region/alarm/alarmStatistics?type=day",
HttpMethod.GET, httpEntity,
JSONObject.class);
return exchange.getBody();
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/25/025 14:37
* @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount]
* @Return: com.alibaba.fastjson.JSONObject
*/
public static JSONObject saveCamera(String CORPINFO_ID, PageData camera) throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID));
headers.setContentType(org.springframework.http.MediaType.valueOf("application/json"));
JSONObject uriVariables = new JSONObject();
uriVariables.put("camNo", camera.getString("CODE"));
uriVariables.put("camName", camera.getString("VIDEONAME"));
uriVariables.put("camIp", "127.0.0.1");
uriVariables.put("type", "0");
uriVariables.put("port", "");
uriVariables.put("camUserName", "1");
uriVariables.put("camPassword", "1");
uriVariables.put("lon", "");
uriVariables.put("lat", "");
uriVariables.put("alt", "");
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers);
// HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables,headers);
// ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.postForEntity(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera",
// httpEntity, JSONObject.class);
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera",
HttpMethod.POST,
httpEntity,
JSONObject.class);
return exchange.getBody();
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/25/025 14:37
* @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount]
* @Return: com.alibaba.fastjson.JSONObject
*/
public static JSONObject editCamera(String CORPINFO_ID, PageData camera) throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID));
headers.setContentType(org.springframework.http.MediaType.valueOf("application/json"));
JSONObject uriVariables = new JSONObject();
uriVariables.put("camNo", camera.getString("CODE"));
uriVariables.put("camName", camera.getString("VIDEONAME"));
uriVariables.put("camId", camera.getString("PLS_ID"));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(uriVariables, headers);
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera",
HttpMethod.PUT, httpEntity,
JSONObject.class, uriVariables);
return exchange.getBody();
}
/**
* @Description:
* @Author: dearLin
* @Date: 2024/1/25/025 14:37
* @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount]
* @Return: com.alibaba.fastjson.JSONObject
*/
public static JSONObject removeCamera(String CORPINFO_ID, PageData camera) throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", getToken(CORPINFO_ID));
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera/" + Integer.parseInt(camera.getString("PLS_ID")), HttpMethod.DELETE, httpEntity, JSONObject.class);
return exchange.getBody();
}
/**
* @Description:
* @Author: dearLin
@ -175,7 +276,7 @@ public class PLSUtil {
* @Param: [com.zcloud.entity.PageData] [user]
* @Return: void
*/
public static boolean saveUser(PageData user) throws Exception {
public static PageData saveUser(PageData user) throws Exception {
String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/psnmgt/insertPsnIfon";
JSONObject loginPayload = new JSONObject();
loginPayload.put("name", user.getString("NAME"));
@ -197,8 +298,8 @@ public class PLSUtil {
loginPayload.put("deptName", "");
loginPayload.put("deptId", "");
loginPayload.put("avatar", "");
PageData response = sendPostHttpRequest(url, loginPayload.toJSONString(), getToken(Jurisdiction.getCORPINFO_ID()));
return "200".equals(response.getString("code"));
return sendPostHttpRequest(url, loginPayload.toJSONString(), getToken(Jurisdiction.getCORPINFO_ID()));
}
/**
@ -209,6 +310,15 @@ public class PLSUtil {
* @Return: void
*/
public static boolean editUser(PageData user) throws Exception {
// 这个人没有卡号与人id的话
if (!Tools.notEmpty(user.getString("PLS_ID"))) {
PageData response = saveUser(user);
if ("200".equals(response.getString("code"))) {
user.put("PLS_ID", response.getString("data"));
return true;
}
return false;
}
String url = BAKEADDR.get(Jurisdiction.getCORPINFO_ID()) + "/deploy/psnmgt/updPsnInfoById";
JSONObject loginPayload = new JSONObject();
loginPayload.put("name", user.getString("NAME"));

View File

@ -23,7 +23,7 @@ public class RegexPatterns {
* , 6
*/
public static final String VERIFY_CODE_REGEX = "^[a-zA-Z\\d]{6}$";
public static final String VERIFY_CARDNO_REGEX = "^[0-9]{4}$";
public static final String VERIFY_CARDNO_REGEX = "^[0-9]{5}$";
/**
* , 1518
*/

File diff suppressed because it is too large Load Diff

View File

@ -213,7 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join OA_DEPARTMENT d on d.DEPARTMENT_ID=f.DEPARTMENT_ID
left join SYS_POST p on p.POST_ID=f.POST_ID
where
USER_ID = #{USER_ID}
USER_ID = #{USER_ID} and f.ISDELETE = 0
</select>
<!-- 通过邮箱获取数据 -->
@ -1394,5 +1394,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="tableName"></include>
where CORPINFO_ID = #{CORPINFO_ID} and ISDELETE = 0
</select>
<select id="getUserByCardNo" resultType="com.zcloud.entity.PageData">
select u.*,
r.ROLE_ID,
r.ROLE_NAME,
d.NAME as DEPARTMENT_NAME,
p.NAME AS POST_NAME
from <include refid="tableName"></include> u
left join SYS_ROLE r on u.ROLE_ID = r.ROLE_ID
left join OA_DEPARTMENT d on d.DEPARTMENT_ID=u.DEPARTMENT_ID
left join SYS_POST p on p.POST_ID=u.POST_ID
u.CARDNO = #{CARDNO} and u.ISDELETE = 0
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
and u.CORPINFO_ID = #{CORPINFO_ID}
</if>
</select>
</mapper>

View File

@ -65,13 +65,44 @@
#{HASHIDDEN},
#{AIWARNING_ID}
</sql>
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<update id="edit">
update
<include refid="tableName"></include>
set
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME},
STATUS = #{STATUS},
ISTRUE = #{ISTRUE},
HASHIDDEN = #{HASHIDDEN}
where
AIWARNING_ID = #{AIWARNING_ID}
</update>
<update id="deleteAll">
update
<include refid="tableName"></include>
set ISDELETE = '1'
where
AIWARNING_ID in
<foreach collection="array" item="str" open="(" separator="," close=")">
#{str}
</foreach>
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>,
v.VIDEONAME,
v.CODE,
c.CORP_NAME
from
BUS_AIWARNING f
@ -86,6 +117,7 @@
select
f.*,
v.VIDEONAME,
v.CODE,
c.CORP_NAME
from
BUS_AIWARNING f
@ -103,8 +135,11 @@
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and c.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.ISTRUE != null and pd.ISTRUE !=''" >
and f.ISTRUE = #{pd.ISTRUE}
</if>
<if test="pd.STATUS != null and pd.STATUS !=''" >
and f.STATUS = #{STATUS}
and f.STATUS = #{pd.STATUS}
</if>
<if test="pd.START_TIME != null and pd.START_TIME !=''" >
and DATE_FORMAT(f.CREATTIME,'%Y-%m-%d %H:%i')

View File

@ -2,19 +2,22 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.video.VideoManagerMapper">
<!--表名 -->
<sql id="tableName">
BUS_VIDEOMANAGER
</sql>
<!--表名 -->
<sql id="tableName">
BUS_VIDEOMANAGER
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.CORPINFO_ID,
<!-- 字段 -->
<sql id="Field">
f
.
CORPINFO_ID
,
f.VIDEONAME,
f.VIDEOURL,
f.OPDATE,
@ -25,11 +28,12 @@
f.VIDEOMANAGER_ID,
f.PLS_ID,
f.CODE
</sql>
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
CORPINFO_ID,
<!-- 字段用于新增 -->
<sql id="Field2">
CORPINFO_ID
,
VIDEONAME,
VIDEOURL,
OPDATE,
@ -39,175 +43,218 @@
VIDEOMANAGER_ID,
PLS_ID,
CODE
</sql>
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CORPINFO_ID},
#{VIDEONAME},
#{VIDEOURL},
#{OPDATE},
#{OPUSER},
#{ISDELETE},
#{ISSHOW},
#{VIDEOMANAGER_ID},
#{PLS_ID},
#{CODE}
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CORPINFO_ID}
,
#{VIDEONAME},
#{VIDEOURL},
#{OPDATE},
#{OPUSER},
#{ISDELETE},
#{ISSHOW},
#{VIDEOMANAGER_ID},
#{PLS_ID},
#{CODE}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
VIDEOMANAGER_ID = #{VIDEOMANAGER_ID}
</delete>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
VIDEOMANAGER_ID = #{VIDEOMANAGER_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
CORPINFO_ID = #{CORPINFO_ID},
</if>
<if test="VIDEONAME != null and VIDEONAME != ''"><!-- 关键词检索 -->
VIDEONAME = #{VIDEONAME},
</if>
<if test="VIDEOURL != null and VIDEOURL != ''"><!-- 关键词检索 -->
VIDEOURL = #{VIDEOURL},
</if>
<if test="ISSHOW != null and ISSHOW != ''"><!-- 关键词检索 -->
ISSHOW = #{ISSHOW},
</if>
<if test="CODE != null and CODE != ''"><!-- 关键词检索 -->
CODE = #{CODE},
</if>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
CORPINFO_ID = #{CORPINFO_ID},
</if>
<if test="VIDEONAME != null and VIDEONAME != ''"><!-- 关键词检索 -->
VIDEONAME = #{VIDEONAME},
</if>
<if test="VIDEOURL != null and VIDEOURL != ''"><!-- 关键词检索 -->
VIDEOURL = #{VIDEOURL},
</if>
<if test="ISSHOW != null and ISSHOW != ''"><!-- 关键词检索 -->
ISSHOW = #{ISSHOW},
</if>
<if test="CODE != null and CODE != ''"><!-- 关键词检索 -->
CODE = #{CODE},
</if>
VIDEOMANAGER_ID = VIDEOMANAGER_ID
where
VIDEOMANAGER_ID = #{VIDEOMANAGER_ID}
</update>
VIDEOMANAGER_ID = VIDEOMANAGER_ID
where
VIDEOMANAGER_ID = #{VIDEOMANAGER_ID}
</update>
<!-- 修改 -->
<update id="editPls" parameterType="pd">
update
<include refid="tableName"></include>
set
PLS_ID = #{PLS_ID}
where
VIDEOMANAGER_ID = #{VIDEOMANAGER_ID}
</update>
<!-- 修改 -->
<update id="editPls" parameterType="pd">
update
<include refid="tableName"></include>
set
PLS_ID = #{PLS_ID}
where
VIDEOMANAGER_ID = #{VIDEOMANAGER_ID}
</update>
<update id="editIsShowBycorpinfoid" parameterType="pd">
update
<include refid="tableName"></include>
set ISSHOW= #{ISSHOW}
where
CORPINFO_ID = #{CORPINFO_ID}
</update>
<update id="editIsShow" parameterType="pd">
update
<include refid="tableName"></include>
set ISSHOW= #{ISSHOW}
where
VIDEOMANAGER_ID = #{VIDEOMANAGER_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.VIDEOMANAGER_ID = #{VIDEOMANAGER_ID} and
f.ISDELETE = '0'
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID=#{CORPINFO_ID}
</if>
<!-- <if test="ISSHOW != null and ISSHOW != ''">&lt;!&ndash; 关键词检索 &ndash;&gt;-->
<!-- and f.ISSHOW=#{ISSHOW}-->
<!-- </if>-->
</select>
<update id="editIsShowBycorpinfoid" parameterType="pd">
update
<include refid="tableName"></include>
set ISSHOW= #{ISSHOW}
where
CORPINFO_ID = #{CORPINFO_ID}
</update>
<update id="editIsShow" parameterType="pd">
update
<include refid="tableName"></include>
set ISSHOW= #{ISSHOW}
where
VIDEOMANAGER_ID = #{VIDEOMANAGER_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where
f.VIDEOMANAGER_ID = #{VIDEOMANAGER_ID} and
f.ISDELETE = '0'
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID=#{CORPINFO_ID}
</if>
<!-- <if test="ISSHOW != null and ISSHOW != ''">&lt;!&ndash; 关键词检索 &ndash;&gt;-->
<!-- and f.ISSHOW=#{ISSHOW}-->
<!-- </if>-->
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
c.CORP_NAME
from
<include refid="tableName"></include> f left join bus_CORP_INFO c on f.CORPINFO_ID=c.CORPINFO_ID
where f.ISDELETE = '0'
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID=#{pd.CORPINFO_ID}
</if>
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
VIDEONAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
<!-- 根据需求自己加检索条件
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
c.CORP_NAME
from
<include refid="tableName"></include>
f left join bus_CORP_INFO c on f.CORPINFO_ID=c.CORPINFO_ID
where f.ISDELETE = '0'
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID=#{pd.CORPINFO_ID}
</if>
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
VIDEONAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
<!-- 根据需求自己加检索条件
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
order by f.ISSHOW desc
</select>
)
</if>
order by f.ISSHOW desc
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID=#{CORPINFO_ID}
</if>
<if test="ISSHOW != null and ISSHOW != ''"><!-- 关键词检索 -->
and f.ISSHOW=#{ISSHOW}
</if>
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where f.ISDELETE = '0'
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID=#{CORPINFO_ID}
</if>
<if test="ISSHOW != null and ISSHOW != ''"><!-- 关键词检索 -->
and f.ISSHOW=#{ISSHOW}
</if>
</select>
<select id="findByCode" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where
f.CODE=#{CODE}
</select>
<select id="getCameraAlarmCount" resultType="com.zcloud.entity.PageData">
SELECT COUNT(1) count,
a.ISTRUE type
FROM
bus_aiwarning a
WHERE
a.ISDELETE = 0
AND a.CORPINFO_ID = #{CORPINFO_ID}
GROUP BY
a.ISTRUE
</select>
<select id="getCameraAlarmTypeCount" resultType="com.zcloud.entity.PageData">
SELECT ROUND((COUNT(a.TYPE) / (SELECT COUNT(*)
FROM bus_aiwarning
WHERE CORPINFO_ID =
#{CORPINFO_ID}
AND ISDELETE = 0)) * 100, 2) AS PERCENTAGE,
a.TYPE
FROM bus_aiwarning a
WHERE a.ISDELETE = 0
AND a.CORPINFO_ID = #{CORPINFO_ID}
GROUP BY a.TYPE;
</select>
<select id="getCameraAlarmTimeCount" resultType="com.zcloud.entity.PageData">
<foreach item="item" index="index" collection="generateTimeArray" separator="UNION">
SELECT
count( 1 ) MONTH_COUNT,
#{item.month} MONTH
FROM
bus_aiwarning a
WHERE
a.ISDELETE = 0
AND a.CORPINFO_ID = #{CORPINFO_ID}
AND WARNING_TIME BETWEEN #{item.dateBegin}
AND #{item.dateEnd}
</foreach>
</select>
<select id="getCameraTopToShow" resultType="com.zcloud.entity.PageData">
select * from bus_videomanager where ISSHOW = 1 and CORPINFO_ID = #{CORPINFO_ID} and ISDELETE = 0
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
VIDEOMANAGER_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 修改 -->
<update id="editZhiding" parameterType="pd">
update
<include refid="tableName"></include>
set
ISSHOW = #{ISSHOW}
where
1=1
<if test="VIDEOMANAGER_ID != null and VIDEOMANAGER_ID != ''">
and VIDEOMANAGER_ID = #{VIDEOMANAGER_ID}
</if>
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
and CORPINFO_ID = #{CORPINFO_ID}
</if>
</update>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
VIDEOMANAGER_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 修改 -->
<update id="editZhiding" parameterType="pd">
UPDATE bus_videomanager
SET ISSHOW = (CASE WHEN VIDEOMANAGER_ID = #{VIDEOMANAGER_ID} THEN 1 ELSE 0 END)
where CORPINFO_ID = #{CORPINFO_ID}
</update>
</mapper>