Compare commits
14 Commits
93e034b162
...
877b518e5d
Author | SHA1 | Date |
---|---|---|
|
877b518e5d | |
|
38986c3364 | |
|
9e089fcb62 | |
|
0698b28d27 | |
|
183eef7073 | |
|
c2c3897979 | |
|
1a26abd93a | |
|
80f4b403f3 | |
|
3711239f55 | |
|
6111c30c7a | |
|
0ec51c4702 | |
|
bd1690cea5 | |
|
8a1947dbd3 | |
|
b5f7a5fede |
src/main
java/com/zcloud
controller
accident
statisticsdata
system
entity
accident
messages
mapper/datasource/messages
service
bus/impl
mkmj/impl
|
@ -1,11 +1,11 @@
|
|||
package com.zcloud.controller.accident;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.accident.AccidentRecords;
|
||||
import com.zcloud.service.accident.AccidentRecordsService;
|
||||
import com.zcloud.util.ObjectExcelView;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
@ -38,7 +38,11 @@ public class AccidentRecordsController extends BaseController {
|
|||
@ResponseBody
|
||||
@RequestMapping(value = "/page")
|
||||
public Map<String, Object> queryPage(Page page, HttpServletRequest request) {
|
||||
page.setPd(new PageData(request));
|
||||
PageData data = new PageData(request);
|
||||
if (ObjectUtil.isEmpty(data.get("type"))) {
|
||||
throw new RuntimeException("type不能为空");
|
||||
}
|
||||
page.setPd(data);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("result", "success");
|
||||
result.put("varList", accidentRecordsService.queryPage(page));
|
||||
|
@ -70,11 +74,7 @@ public class AccidentRecordsController extends BaseController {
|
|||
@ResponseBody
|
||||
@RequestMapping("/save")
|
||||
public Map<String, Object> save(HttpServletRequest request) {
|
||||
PageData pageData = new PageData(request);
|
||||
if (CollUtil.isEmpty(pageData)){
|
||||
throw new RuntimeException("参数不能为空");
|
||||
}
|
||||
accidentRecordsService.save(pageData);
|
||||
accidentRecordsService.save(new AccidentRecords(new PageData(request)));
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("result", "success");
|
||||
return result;
|
||||
|
@ -89,14 +89,11 @@ public class AccidentRecordsController extends BaseController {
|
|||
@ResponseBody
|
||||
@RequestMapping("/update")
|
||||
public Map<String, Object> update(HttpServletRequest request) {
|
||||
PageData pageData = new PageData(request);
|
||||
if (CollUtil.isEmpty(pageData)){
|
||||
throw new RuntimeException("参数不能为空");
|
||||
}
|
||||
if (pageData.get("id") == null) {
|
||||
AccidentRecords accidentRecords = new AccidentRecords(new PageData(request));
|
||||
if (StrUtil.isEmpty(accidentRecords.getId())) {
|
||||
throw new RuntimeException("id不能为空");
|
||||
}
|
||||
accidentRecordsService.update(pageData);
|
||||
accidentRecordsService.update(accidentRecords);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("result", "success");
|
||||
return result;
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
package com.zcloud.controller.app;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.io.File;
|
||||
|
||||
import com.zcloud.controller.bus.HiddenController;
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.bus.*;
|
||||
import com.zcloud.service.hiddenApi.HiddenApiService;
|
||||
import com.zcloud.service.hiddenApi.HiddenCheckApiService;
|
||||
import com.zcloud.service.hiddenApi.HiddenExamineApiService;
|
||||
import com.zcloud.service.inspection.SafetyEnvironmentalService;
|
||||
import com.zcloud.service.system.DepartmentService;
|
||||
import com.zcloud.service.system.FHlogService;
|
||||
import com.zcloud.service.system.UsersService;
|
||||
import com.zcloud.util.*;
|
||||
import com.zcloud.util.event.DeviceHiddenEvent;
|
||||
import com.zcloud.util.message.MessageService;
|
||||
import net.sf.json.JSONArray;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
@ -29,27 +29,12 @@ 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.servlet.ModelAndView;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.fop.fo.flow.PageNumberCitation;
|
||||
import org.apache.fop.render.afp.modca.PageDescriptor;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
|
||||
import net.sf.json.JSONArray;
|
||||
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.system.DepartmentService;
|
||||
import com.zcloud.service.system.UsersService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.tools.Tool;
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 说明:隐患 作者:luoxiaobao 时间:2021-01-04 官网:www.zcloudchina.com
|
||||
|
@ -567,6 +552,7 @@ public class AppHiddenController extends BaseController {
|
|||
}
|
||||
File tempFile = new File(file.getOriginalFilename());
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile);
|
||||
String md5 = DigestUtil.md5Hex(tempFile);
|
||||
if (!FileUpload.isImage(tempFile)) {
|
||||
tempFile.delete();
|
||||
map.put("result", "failed");
|
||||
|
@ -584,8 +570,10 @@ public class AppHiddenController extends BaseController {
|
|||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + ffile);
|
||||
PageData pd = new PageData();
|
||||
pd.put("IMGFILES_ID", this.get32UUID());
|
||||
pd.put("MD5", md5);
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + ffile + "/" + fileName);
|
||||
pd.put("TYPE", TYPE);
|
||||
|
||||
pd.put("FOREIGN_KEY", FOREIGN_KEY);
|
||||
imgFilesService.save(pd);
|
||||
|
||||
|
@ -932,7 +920,6 @@ public class AppHiddenController extends BaseController {
|
|||
hs.put("ISDELETE", "0");
|
||||
hiddenSchemeService.edit(hs);
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.zcloud.controller.app;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.bus.ImgFilesService;
|
||||
import com.zcloud.util.*;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -16,13 +16,12 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.bus.ImgFilesService;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 说明:图片管理
|
||||
|
@ -65,6 +64,7 @@ public class AppImgFilesController extends BaseController {
|
|||
MultipartFile file = files[i];
|
||||
// 保存文件
|
||||
File tempFile = new File(file.getOriginalFilename());
|
||||
String md5 = DigestUtil.md5Hex(tempFile);
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile);
|
||||
if(!FileUpload.isImage(tempFile) && !TYPE.equals("2") && !TYPE.equals("102")) {//四色图改为json文件,不用判断类型
|
||||
tempFile.delete();
|
||||
|
@ -98,6 +98,7 @@ public class AppImgFilesController extends BaseController {
|
|||
pd.put("IMGFILES_ID", this.get32UUID());
|
||||
pd.put("FILEPATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
pd.put("TYPE", TYPE);
|
||||
pd.put("MD5", md5);
|
||||
pd.put("FOREIGN_KEY", FOREIGN_KEY);
|
||||
imgfilesService.save(pd);
|
||||
}
|
||||
|
|
|
@ -1,32 +1,23 @@
|
|||
package com.zcloud.controller.app;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.bus.NoticeCorpService;
|
||||
import com.zcloud.service.bus.NoticeCorpUserService;
|
||||
import com.zcloud.service.bus.NoticeLogService;
|
||||
import com.zcloud.service.bus.ServiceNoticeService;
|
||||
import com.zcloud.service.system.UsersService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import com.zcloud.util.ObjectExcelView;
|
||||
import com.zcloud.util.Tools;
|
||||
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 org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 说明:通知公告
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.zcloud.controller.app.inspection;
|
|||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.hotWorkApplication.Node;
|
||||
import com.zcloud.entity.hotWorkApplication.NodeApp;
|
||||
import com.zcloud.entity.hotWorkApplication.Overseer;
|
||||
import com.zcloud.service.bus.HiddenService;
|
||||
|
@ -14,7 +13,6 @@ import com.zcloud.service.inspection.SafetyEnvironmentalInspectorService;
|
|||
import com.zcloud.service.inspection.SafetyEnvironmentalService;
|
||||
import com.zcloud.service.system.DepartmentService;
|
||||
import com.zcloud.util.*;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -26,9 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 说明:安全环保检查
|
||||
|
@ -40,484 +36,511 @@ import java.util.stream.Collectors;
|
|||
@RequestMapping("/app/safetyenvironmental")
|
||||
public class AppSafetyEnvironmentalController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private SafetyEnvironmentalService safetyenvironmentalService;
|
||||
@Autowired
|
||||
private SafetyEnvironmentalInspectorService safetyEnvironmentalInspectorService;
|
||||
@Autowired
|
||||
private SafetyEnvironmentalExplainService explainService;
|
||||
@Autowired
|
||||
private HiddenService hiddenService;
|
||||
@Autowired
|
||||
private DepartmentService departmentService;
|
||||
@Resource
|
||||
private SafetyEnvironmentalInspectorService inspectorService;
|
||||
@Resource
|
||||
private SafetyEnvironmentalAssessService assessService;
|
||||
@Autowired
|
||||
private NoticeCorpUtil noticeCorpUtil;
|
||||
@Autowired
|
||||
private SafetyEnvironmentalService safetyenvironmentalService;
|
||||
@Autowired
|
||||
private SafetyEnvironmentalInspectorService safetyEnvironmentalInspectorService;
|
||||
@Autowired
|
||||
private SafetyEnvironmentalExplainService explainService;
|
||||
@Autowired
|
||||
private HiddenService hiddenService;
|
||||
@Autowired
|
||||
private DepartmentService departmentService;
|
||||
@Resource
|
||||
private SafetyEnvironmentalInspectorService inspectorService;
|
||||
@Resource
|
||||
private SafetyEnvironmentalAssessService assessService;
|
||||
@Autowired
|
||||
private NoticeCorpUtil noticeCorpUtil;
|
||||
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
@ResponseBody
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalService.list(page); //列出SafetyEnvironmental列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/list")
|
||||
@ResponseBody
|
||||
public Object list(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalService.list(page); //列出SafetyEnvironmental列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**新增
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/add")
|
||||
@ResponseBody
|
||||
public Object add(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("INSPECTION_ID", this.get32UUID()); //主键
|
||||
pd.put("INSPECTION_ORIGINATOR_ID", pd.getString("CREATOR")); //检查发起人
|
||||
pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除)
|
||||
pd.put("CREATOR", pd.getString("CREATOR")); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("OPERATOR", pd.getString("CREATOR")); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); //企业ID
|
||||
pd.put("ACTION_USER", pd.getString("ACTION_USER")); //操作人
|
||||
String ffile = DateUtil.getDays();
|
||||
if (file != null && StringUtils.isNotBlank(pd.getString("INSPECTION_USER_OPINION"))){
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
pd.put("CONFIRM_MESSAGE_SIGN_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
pd.put("CONFIRM_MESSAGE",pd.getString("INSPECTION_USER_OPINION"));
|
||||
pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date()));
|
||||
}
|
||||
List<PageData> hiddenList = safetyenvironmentalService.save(pd);
|
||||
pd.put("hiddenList", hiddenList);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
@ResponseBody
|
||||
public Object add(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("INSPECTION_ID", this.get32UUID()); //主键
|
||||
pd.put("INSPECTION_ORIGINATOR_ID", pd.getString("CREATOR")); //检查发起人
|
||||
pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除)
|
||||
pd.put("CREATOR", pd.getString("CREATOR")); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("OPERATOR", pd.getString("CREATOR")); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); //企业ID
|
||||
pd.put("ACTION_USER", pd.getString("ACTION_USER")); //操作人
|
||||
String ffile = DateUtil.getDays();
|
||||
if (file != null && StringUtils.isNotBlank(pd.getString("INSPECTION_USER_OPINION"))) {
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
pd.put("CONFIRM_MESSAGE_SIGN_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
pd.put("CONFIRM_MESSAGE", pd.getString("INSPECTION_USER_OPINION"));
|
||||
pd.put("CONFIRM_MESSAGE_TIME", DateUtil.date2Str(new Date()));
|
||||
}
|
||||
List<PageData> hiddenList = safetyenvironmentalService.save(pd);
|
||||
pd.put("hiddenList", hiddenList);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goShow")
|
||||
@ResponseBody
|
||||
public Object goShow() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = safetyenvironmentalService.findShowById(pd); //根据ID读取
|
||||
safetyenvironmentalService.departmentUtil(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/goShow")
|
||||
@ResponseBody
|
||||
public Object goShow() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = safetyenvironmentalService.findShowById(pd); //根据ID读取
|
||||
safetyenvironmentalService.departmentUtil(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goEdit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = safetyenvironmentalService.findFormById(pd); //根据ID读取
|
||||
safetyenvironmentalService.departmentUtil(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/goEdit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = safetyenvironmentalService.findFormById(pd); //根据ID读取
|
||||
safetyenvironmentalService.departmentUtil(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/edit")
|
||||
@ResponseBody
|
||||
public Object edit(@RequestParam(value="FFILE",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("INSPECTION_STATUS", "0"); //状态(0.待检查人核实 1.检查人核实中、2.待被检查人确认、3.已归档 -1.检查人核实打回 -2被检查人申辩)
|
||||
pd.put("OPERATOR", pd.getString("OPERATOR")); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("ACTION_USER", pd.getString("ACTION_USER")); //操作人
|
||||
String ffile = DateUtil.getDays();
|
||||
if (file != null && StringUtils.isNotBlank(pd.getString("INSPECTION_USER_OPINION"))){
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
pd.put("CONFIRM_MESSAGE_SIGN_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
pd.put("CONFIRM_MESSAGE",pd.getString("INSPECTION_USER_OPINION"));
|
||||
pd.put("CONFIRM_MESSAGE_TIME",DateUtil.date2Str(new Date()));
|
||||
}
|
||||
List<PageData> hiddenList = safetyenvironmentalService.edit(pd);
|
||||
pd.put("hiddenList", hiddenList);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/edit")
|
||||
@ResponseBody
|
||||
public Object edit(@RequestParam(value = "FFILE", required = false) MultipartFile file) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("INSPECTION_STATUS", "0"); //状态(0.待检查人核实 1.检查人核实中、2.待被检查人确认、3.已归档 -1.检查人核实打回 -2被检查人申辩)
|
||||
pd.put("OPERATOR", pd.getString("OPERATOR")); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("ACTION_USER", pd.getString("ACTION_USER")); //操作人
|
||||
String ffile = DateUtil.getDays();
|
||||
if (file != null && StringUtils.isNotBlank(pd.getString("INSPECTION_USER_OPINION"))) {
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
pd.put("CONFIRM_MESSAGE_SIGN_ROUTE", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
pd.put("CONFIRM_MESSAGE", pd.getString("INSPECTION_USER_OPINION"));
|
||||
pd.put("CONFIRM_MESSAGE_TIME", DateUtil.date2Str(new Date()));
|
||||
}
|
||||
List<PageData> hiddenList = safetyenvironmentalService.edit(pd);
|
||||
pd.put("hiddenList", hiddenList);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/explain")
|
||||
//@RequiresPermissions("safetyenvironmental:edit")
|
||||
@ResponseBody
|
||||
public Object explain(@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();
|
||||
if (files != null && files.length > 0) {
|
||||
MultipartFile file = files[0];
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/explain")
|
||||
//@RequiresPermissions("safetyenvironmental:edit")
|
||||
@ResponseBody
|
||||
public Object explain(@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();
|
||||
if (files != null && files.length > 0) {
|
||||
MultipartFile file = files[0];
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
|
||||
String ffile = DateUtil.getDays();
|
||||
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
String ffile = DateUtil.getDays();
|
||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
|
||||
pd.put("INSPECTION_ORIGINATOR_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
safetyenvironmentalService.explain(pd);
|
||||
pd.put("inspector",pd.getString("OPERATOR"));
|
||||
noticeCorpUtil.FailPleadind(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
pd.put("INSPECTION_ORIGINATOR_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
safetyenvironmentalService.explain(pd);
|
||||
pd.put("inspector", pd.getString("OPERATOR"));
|
||||
noticeCorpUtil.FailPleadind(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/delete")
|
||||
@RequiresPermissions("safetyenvironmental:del")
|
||||
@ResponseBody
|
||||
public Object delete() throws Exception{
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
@RequiresPermissions("safetyenvironmental:del")
|
||||
@ResponseBody
|
||||
public Object delete() throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/deleteAll")
|
||||
@RequiresPermissions("safetyenvironmental:del")
|
||||
@ResponseBody
|
||||
public Object deleteAll() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if(Tools.notEmpty(DATA_IDS)){
|
||||
String[] ArrayDATA_IDS = DATA_IDS.split(",");
|
||||
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
|
||||
safetyenvironmentalService.deleteAll(pd);
|
||||
errInfo = "success";
|
||||
}else{
|
||||
errInfo = "fail";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/deleteAll")
|
||||
@RequiresPermissions("safetyenvironmental:del")
|
||||
@ResponseBody
|
||||
public Object deleteAll() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if (Tools.notEmpty(DATA_IDS)) {
|
||||
String[] ArrayDATA_IDS = DATA_IDS.split(",");
|
||||
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
|
||||
safetyenvironmentalService.deleteAll(pd);
|
||||
errInfo = "success";
|
||||
} else {
|
||||
errInfo = "fail";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**导出到excel
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/excel")
|
||||
@RequiresPermissions("toExcel")
|
||||
public ModelAndView exportExcel() throws Exception{
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String,Object> dataMap = new HashMap<String,Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("检查发起人"); //1
|
||||
titles.add("被检查单位"); //2
|
||||
titles.add("被检查单位现场负责人"); //3
|
||||
titles.add("申辩内容"); //4
|
||||
titles.add("被检查单位现场负责人签字"); //5
|
||||
titles.add("被检查单位现场负责人签字时间"); //6
|
||||
titles.add("检查类型"); //7
|
||||
titles.add("检查场所"); //8
|
||||
titles.add("检查开始时间"); //9
|
||||
titles.add("检查结束时间"); //10
|
||||
titles.add("状态(0.暂存 1.检查人待确认、2.被检查人待确认、3.归档 -1.检查人异议打回 -2被检查人申辩)"); //11
|
||||
titles.add("是否删除(0:有效 1:删除)"); //12
|
||||
titles.add("添加人"); //13
|
||||
titles.add("添加时间"); //14
|
||||
titles.add("修改人"); //15
|
||||
titles.add("修改时间"); //16
|
||||
titles.add("企业ID"); //17
|
||||
dataMap.put("titles", titles);
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
List<PageData> varOList = safetyenvironmentalService.listAll(pd);
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
for(int i=0;i<varOList.size();i++){
|
||||
PageData vpd = new PageData();
|
||||
vpd.put("var1", varOList.get(i).getString("INSPECTION_ORIGINATOR_ID")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("INSPECTED_DEPARTMENT_ID")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("INSPECTED_SITEUSER_ID")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("INSPECTED_EXPLAIN")); //4
|
||||
vpd.put("var5", varOList.get(i).getString("INSPECTED_SITEUSER_SIGN_IMG")); //5
|
||||
vpd.put("var6", varOList.get(i).getString("INSPECTED_SITEUSER_SIGN_TIME")); //6
|
||||
vpd.put("var7", varOList.get(i).getString("INSPECTION_TYPE")); //7
|
||||
vpd.put("var8", varOList.get(i).getString("INSPECTION_PLACE")); //8
|
||||
vpd.put("var9", varOList.get(i).getString("INSPECTION_TIME_START")); //9
|
||||
vpd.put("var10", varOList.get(i).getString("INSPECTION_TIME_END")); //10
|
||||
vpd.put("var11", varOList.get(i).getString("INSPECTION_STATUS")); //11
|
||||
vpd.put("var12", varOList.get(i).getString("ISDELETE")); //12
|
||||
vpd.put("var13", varOList.get(i).getString("CREATOR")); //13
|
||||
vpd.put("var14", varOList.get(i).getString("CREATTIME")); //14
|
||||
vpd.put("var15", varOList.get(i).getString("OPERATOR")); //15
|
||||
vpd.put("var16", varOList.get(i).getString("OPERATTIME")); //16
|
||||
vpd.put("var17", varOList.get(i).getString("CORPINFO_ID")); //17
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv,dataMap);
|
||||
return mv;
|
||||
}
|
||||
/**
|
||||
* 导出到excel
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/excel")
|
||||
@RequiresPermissions("toExcel")
|
||||
public ModelAndView exportExcel() throws Exception {
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String, Object> dataMap = new HashMap<String, Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("检查发起人"); //1
|
||||
titles.add("被检查单位"); //2
|
||||
titles.add("被检查单位现场负责人"); //3
|
||||
titles.add("申辩内容"); //4
|
||||
titles.add("被检查单位现场负责人签字"); //5
|
||||
titles.add("被检查单位现场负责人签字时间"); //6
|
||||
titles.add("检查类型"); //7
|
||||
titles.add("检查场所"); //8
|
||||
titles.add("检查开始时间"); //9
|
||||
titles.add("检查结束时间"); //10
|
||||
titles.add("状态(0.暂存 1.检查人待确认、2.被检查人待确认、3.归档 -1.检查人异议打回 -2被检查人申辩)"); //11
|
||||
titles.add("是否删除(0:有效 1:删除)"); //12
|
||||
titles.add("添加人"); //13
|
||||
titles.add("添加时间"); //14
|
||||
titles.add("修改人"); //15
|
||||
titles.add("修改时间"); //16
|
||||
titles.add("企业ID"); //17
|
||||
dataMap.put("titles", titles);
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
List<PageData> varOList = safetyenvironmentalService.listAll(pd);
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
for (int i = 0; i < varOList.size(); i++) {
|
||||
PageData vpd = new PageData();
|
||||
vpd.put("var1", varOList.get(i).getString("INSPECTION_ORIGINATOR_ID")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("INSPECTED_DEPARTMENT_ID")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("INSPECTED_SITEUSER_ID")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("INSPECTED_EXPLAIN")); //4
|
||||
vpd.put("var5", varOList.get(i).getString("INSPECTED_SITEUSER_SIGN_IMG")); //5
|
||||
vpd.put("var6", varOList.get(i).getString("INSPECTED_SITEUSER_SIGN_TIME")); //6
|
||||
vpd.put("var7", varOList.get(i).getString("INSPECTION_TYPE")); //7
|
||||
vpd.put("var8", varOList.get(i).getString("INSPECTION_PLACE")); //8
|
||||
vpd.put("var9", varOList.get(i).getString("INSPECTION_TIME_START")); //9
|
||||
vpd.put("var10", varOList.get(i).getString("INSPECTION_TIME_END")); //10
|
||||
vpd.put("var11", varOList.get(i).getString("INSPECTION_STATUS")); //11
|
||||
vpd.put("var12", varOList.get(i).getString("ISDELETE")); //12
|
||||
vpd.put("var13", varOList.get(i).getString("CREATOR")); //13
|
||||
vpd.put("var14", varOList.get(i).getString("CREATTIME")); //14
|
||||
vpd.put("var15", varOList.get(i).getString("OPERATOR")); //15
|
||||
vpd.put("var16", varOList.get(i).getString("OPERATTIME")); //16
|
||||
vpd.put("var17", varOList.get(i).getString("CORPINFO_ID")); //17
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv, dataMap);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**安全环保检查待办作业数统计
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/countCheck")
|
||||
@ResponseBody
|
||||
public Object countCheck() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
PageData confirmCount = safetyEnvironmentalInspectorService.confirmCount(pd); //检查人确认数
|
||||
PageData checkedCount = safetyenvironmentalService.checkedCount(pd); //被检查人签字数
|
||||
PageData repulseCount = safetyenvironmentalService.repulseCount(pd); //打回数
|
||||
PageData repulseAndCheckCount = safetyenvironmentalService.repulseAndCheckCountCount(pd); //指派+验收数
|
||||
/**
|
||||
* 安全环保检查待办作业数统计
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/countCheck")
|
||||
@ResponseBody
|
||||
public Object countCheck() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
PageData confirmCount = safetyEnvironmentalInspectorService.confirmCount(pd); //检查人确认数
|
||||
PageData checkedCount = safetyenvironmentalService.checkedCount(pd); //被检查人签字数
|
||||
PageData repulseCount = safetyenvironmentalService.repulseCount(pd); //打回数
|
||||
PageData repulseAndCheckCount = safetyenvironmentalService.repulseAndCheckCountCount(pd); //指派+验收数
|
||||
|
||||
map.put("result", errInfo);
|
||||
map.put("confirmCount", confirmCount);
|
||||
map.put("checkedCount",checkedCount);
|
||||
map.put("repulseCount",repulseCount);
|
||||
map.put("repulseAndCheckCount",repulseAndCheckCount);
|
||||
return map;
|
||||
}
|
||||
map.put("result", errInfo);
|
||||
map.put("confirmCount", confirmCount);
|
||||
map.put("checkedCount", checkedCount);
|
||||
map.put("repulseCount", repulseCount);
|
||||
map.put("repulseAndCheckCount", repulseAndCheckCount);
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/getExplain")
|
||||
@ResponseBody
|
||||
public Object getExplain() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
List<PageData> list = explainService.findExplainById(pd);
|
||||
map.put("list",list);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
@RequestMapping(value = "/getExplain")
|
||||
@ResponseBody
|
||||
public Object getExplain() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
List<PageData> list = explainService.findExplainById(pd);
|
||||
map.put("list", list);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**一公司app首页安全环保检查统计
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/countHome")
|
||||
@ResponseBody
|
||||
public Object countHome() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
PageData count = safetyEnvironmentalInspectorService.countHome(pd); //一公司app首页安全环保检查统计
|
||||
map.put("result", errInfo);
|
||||
map.put("count", count);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 一公司app首页安全环保检查统计
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/countHome")
|
||||
@ResponseBody
|
||||
public Object countHome() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
PageData count = safetyEnvironmentalInspectorService.countHome(pd); //一公司app首页安全环保检查统计
|
||||
map.put("result", errInfo);
|
||||
map.put("count", count);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/pleadList")
|
||||
@ResponseBody
|
||||
public Object pleadList(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalService.pleadList(page); //列出SafetyEnvironmental列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/pleadList")
|
||||
@ResponseBody
|
||||
public Object pleadList(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalService.pleadList(page); //列出SafetyEnvironmental列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**列表
|
||||
* 规则: 如果当前人是,被检查人,检查人,参与人则可以查询到此条数据
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/checkList")
|
||||
@ResponseBody
|
||||
public Object checkList(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
pd.put("waffle",pd.getString("ARCHIVE_USER_ID"));
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表
|
||||
/* 针对验收部分特殊处理 */
|
||||
String user_id = pd.getString("ARCHIVE_USER_ID");
|
||||
for (PageData vector : varList) {
|
||||
if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) &&
|
||||
("6".equals(vector.getString("INSPECTION_STATUS"))
|
||||
|| "5".equals(vector.getString("INSPECTION_STATUS"))
|
||||
|| "7".equals(vector.getString("INSPECTION_STATUS")))
|
||||
) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("FOREIGN_ID",vector.getString("INSPECTION_ID"));
|
||||
List<PageData> waffle = hiddenService.findByKey(condition); //d
|
||||
if (waffle == null || waffle.isEmpty()){
|
||||
continue;
|
||||
}
|
||||
Long number = waffle.stream()
|
||||
.filter(n ->
|
||||
user_id.equals(n.getString("CREATOR"))
|
||||
&& (StringUtils.isNotBlank(n.getString("STATE"))&&(
|
||||
"4".equals(n.getString("STATE"))|| "8".equals(n.getString("STATE"))))
|
||||
/**
|
||||
* 列表
|
||||
* 规则: 如果当前人是,被检查人,检查人,参与人则可以查询到此条数据
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/checkList")
|
||||
@ResponseBody
|
||||
public Object checkList(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
pd.put("waffle", pd.getString("ARCHIVE_USER_ID"));
|
||||
pd.put("loginUserId", Jurisdiction.getUSER_ID());
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表
|
||||
/* 针对验收部分特殊处理 */
|
||||
String user_id = pd.getString("ARCHIVE_USER_ID");
|
||||
for (PageData vector : varList) {
|
||||
if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) &&
|
||||
("6".equals(vector.getString("INSPECTION_STATUS"))
|
||||
|| "5".equals(vector.getString("INSPECTION_STATUS"))
|
||||
|| "7".equals(vector.getString("INSPECTION_STATUS")))
|
||||
) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("FOREIGN_ID", vector.getString("INSPECTION_ID"));
|
||||
List<PageData> waffle = hiddenService.findByKey(condition); //d
|
||||
if (waffle == null || waffle.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
Long number = waffle.stream()
|
||||
.filter(n ->
|
||||
user_id.equals(n.getString("CREATOR"))
|
||||
&& (StringUtils.isNotBlank(n.getString("STATE")) && (
|
||||
"4".equals(n.getString("STATE")) || "8".equals(n.getString("STATE"))))
|
||||
|
||||
|
||||
&&(StringUtils.isBlank(n.getString("FINAL_CHECK"))|| "2".equals(n.getString("FINAL_CHECK")))
|
||||
)
|
||||
.count();
|
||||
if (number >0){
|
||||
vector.put("checkout",1);
|
||||
}
|
||||
}
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
&& (StringUtils.isBlank(n.getString("FINAL_CHECK")) || "2".equals(n.getString("FINAL_CHECK")))
|
||||
)
|
||||
.count();
|
||||
if (number > 0) {
|
||||
vector.put("checkout", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/showFlowChart")
|
||||
@ResponseBody
|
||||
public Object showFlowChart() throws Exception{
|
||||
HashMap<String, Object> response = new HashMap<>();
|
||||
response.put("result","success");
|
||||
PageData condition = this.getPageData();
|
||||
condition.put("INSPECTION_ID",condition.getString("ID"));
|
||||
PageData safety = safetyenvironmentalService.findById(condition);
|
||||
if (safety == null || safety.size() <= 0) {
|
||||
response.put("result", "error");
|
||||
response.put("errorMessage", "数据异常");
|
||||
}
|
||||
// 1、整理基础数据
|
||||
Overseer overseer = new Overseer();
|
||||
List<NodeApp> nodes = overseer.getSafetyAppWorkFlow();
|
||||
// 初始话安全环保发起人、被检查人数据
|
||||
nodes.get(0).safety_order(safety);
|
||||
nodes.stream().forEach(n -> n.safety_creator_util(safety));
|
||||
for (NodeApp nodeApp : nodes) {
|
||||
if (StringUtils.isNotBlank(nodeApp.getActive()))
|
||||
overseer.setSafetyAppVector(nodeApp.getOrder());
|
||||
}
|
||||
// 2、整理特殊数据
|
||||
// 2、1检查人将检查状态
|
||||
if ("2,3,4".contains(safety.getString("order"))) {
|
||||
List<PageData> inspectors = inspectorService.listAll(condition);
|
||||
nodes.stream()
|
||||
.filter(n -> "1".equals(n.getOrder()))
|
||||
.forEach(n -> n.safety_inspector_util(inspectors));
|
||||
}
|
||||
@RequestMapping(value = "/showFlowChart")
|
||||
@ResponseBody
|
||||
public Object showFlowChart() throws Exception {
|
||||
HashMap<String, Object> response = new HashMap<>();
|
||||
response.put("result", "success");
|
||||
PageData condition = this.getPageData();
|
||||
condition.put("INSPECTION_ID", condition.getString("ID"));
|
||||
PageData safety = safetyenvironmentalService.findById(condition);
|
||||
if (safety == null || safety.size() <= 0) {
|
||||
response.put("result", "error");
|
||||
response.put("errorMessage", "数据异常");
|
||||
}
|
||||
// 1、整理基础数据
|
||||
Overseer overseer = new Overseer();
|
||||
List<NodeApp> nodes = overseer.getSafetyAppWorkFlow();
|
||||
// 初始话安全环保发起人、被检查人数据
|
||||
nodes.get(0).safety_order(safety);
|
||||
nodes.stream().forEach(n -> n.safety_creator_util(safety));
|
||||
for (NodeApp nodeApp : nodes) {
|
||||
if (StringUtils.isNotBlank(nodeApp.getActive()))
|
||||
overseer.setSafetyAppVector(nodeApp.getOrder());
|
||||
}
|
||||
// 2、整理特殊数据
|
||||
// 2、1检查人将检查状态
|
||||
if ("2,3,4".contains(safety.getString("order"))) {
|
||||
List<PageData> inspectors = inspectorService.listAll(condition);
|
||||
nodes.stream()
|
||||
.filter(n -> "1".equals(n.getOrder()))
|
||||
.forEach(n -> n.safety_inspector_util(inspectors));
|
||||
}
|
||||
|
||||
//隐患指派流程
|
||||
if ("3,4".contains(safety.getString("order"))) {
|
||||
List<PageData> hiddenz = safetyenvironmentalService.findByyin(condition);
|
||||
if (hiddenz != null && hiddenz.size() > 0) {
|
||||
nodes.stream()
|
||||
.filter(n -> "3".equals(n.getOrder()))
|
||||
.forEach(n -> n.safety_hiddenz(hiddenz));
|
||||
}
|
||||
}
|
||||
if ("4".equals(safety.getString("order"))) {
|
||||
// 2、2 隐患发现人状态
|
||||
condition.put("FOREIGN_ID", condition.getString("INSPECTION_ID"));
|
||||
List<PageData> hiddens = hiddenService.findByKey(condition);
|
||||
nodes.stream()
|
||||
.filter(n -> "4".equals(n.getOrder()))
|
||||
.forEach(n -> n.safety_hiddenCreator_util(hiddens));
|
||||
}
|
||||
// 2、3 考评人
|
||||
//隐患指派流程
|
||||
if ("3,4".contains(safety.getString("order"))) {
|
||||
List<PageData> hiddenz = safetyenvironmentalService.findByyin(condition);
|
||||
if (hiddenz != null && hiddenz.size() > 0) {
|
||||
nodes.stream()
|
||||
.filter(n -> "3".equals(n.getOrder()))
|
||||
.forEach(n -> n.safety_hiddenz(hiddenz));
|
||||
}
|
||||
}
|
||||
if ("4".equals(safety.getString("order"))) {
|
||||
// 2、2 隐患发现人状态
|
||||
condition.put("FOREIGN_ID", condition.getString("INSPECTION_ID"));
|
||||
List<PageData> hiddens = hiddenService.findByKey(condition);
|
||||
nodes.stream()
|
||||
.filter(n -> "4".equals(n.getOrder()))
|
||||
.forEach(n -> n.safety_hiddenCreator_util(hiddens));
|
||||
}
|
||||
// 2、3 考评人
|
||||
// List<PageData> assess = assessService.findByMainId(condition);
|
||||
// if (assess != null && assess.size() > 0) {
|
||||
// nodes.stream()
|
||||
// .filter(n -> "5".equals(n.getOrder()))
|
||||
// .forEach(n -> n.safety_assessor_util(assess));
|
||||
// }
|
||||
response.put("varList", nodes);
|
||||
response.put("active" ,overseer.getSafetyAppVector());
|
||||
return response;
|
||||
}
|
||||
response.put("varList", nodes);
|
||||
response.put("active", overseer.getSafetyAppVector());
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package com.zcloud.controller.bus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.bus.VideoService;
|
||||
import com.zcloud.util.*;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
@ -16,18 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.bus.VideoService;
|
||||
import com.zcloud.util.Const;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.FileUpload;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import com.zcloud.util.ObjectExcelView;
|
||||
import com.zcloud.util.PathUtil;
|
||||
import com.zcloud.util.Smb;
|
||||
import com.zcloud.util.Tools;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 说明:视频管理
|
||||
|
@ -155,7 +143,7 @@ public class VideoController extends BaseController {
|
|||
@RequiresPermissions("video:edit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
|
|
|
@ -3,11 +3,8 @@ package com.zcloud.controller.inspection;
|
|||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.hotWorkApplication.Color;
|
||||
import com.zcloud.entity.hotWorkApplication.Node;
|
||||
import com.zcloud.entity.hotWorkApplication.Overseer;
|
||||
import com.zcloud.entity.system.Department;
|
||||
import com.zcloud.entity.system.User;
|
||||
import com.zcloud.service.bus.HiddenCheckService;
|
||||
import com.zcloud.service.bus.HiddenService;
|
||||
import com.zcloud.service.bus.NoticeCorpService;
|
||||
|
@ -21,8 +18,6 @@ import com.zcloud.service.system.UsersService;
|
|||
import com.zcloud.util.*;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.session.Session;
|
||||
import org.apache.xmlgraphics.xmp.schemas.pdf.PDFAAdapter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@ -34,7 +29,6 @@ import org.springframework.web.servlet.ModelAndView;
|
|||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 说明:安全环保检查
|
||||
|
@ -211,11 +205,11 @@ public class SafetyEnvironmentalController extends BaseController {
|
|||
@RequiresPermissions("safetyenvironmental:list")
|
||||
@ResponseBody
|
||||
public Object list(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
pd.put("KEYWORDS", Tools.notEmpty(KEYWORDS) ? KEYWORDS.trim() : "");
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
// PageData userInfo = new PageData();
|
||||
// userInfo.put("USER_ID",pd.getString("INSPECTION_ORIGINATOR_ID"));
|
||||
|
@ -740,33 +734,38 @@ public class SafetyEnvironmentalController extends BaseController {
|
|||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
pd.put("waffle", Jurisdiction.getUSER_ID());
|
||||
page.setPd(pd);
|
||||
pd.put("loginUserId", Jurisdiction.getUSER_ID());
|
||||
List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表
|
||||
/* 针对验收部分特殊处理 */
|
||||
for (PageData vector : varList) {
|
||||
if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) &&
|
||||
("6".equals(vector.getString("INSPECTION_STATUS"))
|
||||
|| "5".equals(vector.getString("INSPECTION_STATUS"))
|
||||
// || "7".equals(vector.getString("INSPECTION_STATUS"))
|
||||
)
|
||||
) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("FOREIGN_ID", vector.getString("INSPECTION_ID"));
|
||||
List<PageData> waffle = hiddenService.findByKey(condition);
|
||||
if (waffle == null || waffle.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
Long number = waffle.stream()
|
||||
.filter(n ->
|
||||
Jurisdiction.getUSER_ID().equals(n.getString("CREATOR")) &&
|
||||
(StringUtils.isNotBlank(n.getString("STATE")) && ("4".equals(n.getString("STATE")) || "8".equals(n.getString("STATE")))) &&
|
||||
(StringUtils.isBlank(n.getString("FINAL_CHECK")) || "2".equals(n.getString("FINAL_CHECK")))
|
||||
)
|
||||
.count();
|
||||
if (number > 0) {
|
||||
vector.put("checkout", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (PageData vector : varList) {
|
||||
// if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) &&
|
||||
// ("6".equals(vector.getString("INSPECTION_STATUS"))
|
||||
// || "5".equals(vector.getString("INSPECTION_STATUS"))
|
||||
//// || "7".equals(vector.getString("INSPECTION_STATUS"))
|
||||
// )
|
||||
// ) {
|
||||
// PageData condition = new PageData();
|
||||
// condition.put("FOREIGN_ID", vector.getString("INSPECTION_ID"));
|
||||
// List<PageData> waffle = hiddenService.findByKey(condition);
|
||||
// if (waffle == null || waffle.isEmpty()) {
|
||||
// continue;
|
||||
// }
|
||||
// Long number = waffle.stream()
|
||||
// .filter(n -> Jurisdiction.getUSER_ID().equals(n.getString("CREATOR")) &&
|
||||
// (StringUtils.isNotBlank(n.getString("STATE")) &&
|
||||
// ("4".equals(n.getString("STATE")) ||
|
||||
// "8".equals(n.getString("STATE")))) &&
|
||||
// (StringUtils.isBlank(n.getString("FINAL_CHECK")) ||
|
||||
// "2".equals(n.getString("FINAL_CHECK")))
|
||||
// )
|
||||
// .count();
|
||||
// if (number > 0) {
|
||||
// vector.put("checkout", 1);
|
||||
// } else {
|
||||
// vector.put("checkout", 0);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
|
|
|
@ -8,7 +8,6 @@ import com.zcloud.service.bus.NoticeCorpUtil;
|
|||
import com.zcloud.service.inspection.SafetyEnvironmentalExplainService;
|
||||
import com.zcloud.service.system.DepartmentService;
|
||||
import com.zcloud.util.*;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -33,39 +32,42 @@ import java.util.stream.Collectors;
|
|||
@RequestMapping("/safetyenvironmentalexplain")
|
||||
public class SafetyEnvironmentalExplainController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private SafetyEnvironmentalExplainService safetyenvironmentalexplainService;
|
||||
@Autowired
|
||||
private HiddenService hiddenService;
|
||||
@Autowired
|
||||
private SafetyEnvironmentalExplainService safetyenvironmentalexplainService;
|
||||
@Autowired
|
||||
private HiddenService hiddenService;
|
||||
|
||||
@Autowired
|
||||
private DepartmentService departmentService;
|
||||
@Resource
|
||||
private NoticeCorpUtil noticeCorpUtil;
|
||||
@Autowired
|
||||
private DepartmentService departmentService;
|
||||
@Resource
|
||||
private NoticeCorpUtil noticeCorpUtil;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:list")
|
||||
@ResponseBody
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/list")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:list")
|
||||
@ResponseBody
|
||||
public Object list(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
// pd.put("INSPECTED_SITEUSER_ID", Jurisdiction.getUSER_ID()); //被检查单位现场负责人
|
||||
pd = Jurisdiction.getUserDataJurisdiction(pd);
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalexplainService.list(page); //列出SafetyEnvironmentalExplain列表
|
||||
for (PageData vector: varList) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("DEPARTMENT_ID",vector.getString("INSPECTED_DEPARTMENT_ID"));
|
||||
List<PageData> parent_list = departmentService.getGenealogy(condition);
|
||||
String corp_infos = "";
|
||||
pd = Jurisdiction.getUserDataJurisdiction(pd);
|
||||
pd.put("loginUserId", Jurisdiction.getUSER_ID());
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalexplainService.list(page); //列出SafetyEnvironmentalExplain列表
|
||||
for (PageData vector : varList) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("DEPARTMENT_ID", vector.getString("INSPECTED_DEPARTMENT_ID"));
|
||||
List<PageData> parent_list = departmentService.getGenealogy(condition);
|
||||
String corp_infos = "";
|
||||
/*for(PageData pageData:parent_list){
|
||||
for(Object key:pageData.keySet()){
|
||||
if(StringUtils.equals("NAME",key.toString())&&StringUtils.isBlank(pageData.getString(key))){
|
||||
|
@ -80,223 +82,237 @@ public class SafetyEnvironmentalExplainController extends BaseController {
|
|||
}
|
||||
|
||||
}*/
|
||||
if(!Tools.isEmpty(parent_list)){
|
||||
corp_infos = parent_list.stream().filter(n->StringUtils.isNotBlank(n.getString("NAME"))).map(n -> n.getString("NAME")).collect(Collectors.joining("-"));
|
||||
}
|
||||
vector.put("INSPECTED_DEPARTMENT_NAMES",corp_infos);
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
if (!Tools.isEmpty(parent_list)) {
|
||||
corp_infos = parent_list.stream().filter(n -> StringUtils.isNotBlank(n.getString("NAME"))).map(n -> n.getString("NAME")).collect(Collectors.joining("-"));
|
||||
}
|
||||
vector.put("INSPECTED_DEPARTMENT_NAMES", corp_infos);
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**新增
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/add")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:add")
|
||||
@ResponseBody
|
||||
public Object add(@RequestParam(value="file",required=false) MultipartFile file) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("INSPECTION_EXPLAIN_ID", this.get32UUID()); //主键
|
||||
pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除)
|
||||
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
pd.put("ACTION_USER", Jurisdiction.getName()); //操作人
|
||||
pd.put("VALID","1");
|
||||
pd.put("ISPASS","0");
|
||||
if (StringUtils.isNotBlank(pd.getString("INSPECTED_SITEUSER_SIGN_IMG"))) {
|
||||
MultipartFile img = BASE64DecodedMultipartFile.base64ToMultipart(pd.getString("INSPECTED_SITEUSER_SIGN_IMG"));
|
||||
String suffixName = img.getOriginalFilename().substring(img.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String ffile = DateUtil.getDays();
|
||||
String fileName = this.get32UUID()+img.getOriginalFilename().substring(img.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(img, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:add")
|
||||
@ResponseBody
|
||||
public Object add(@RequestParam(value = "file", required = false) MultipartFile file) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("INSPECTION_EXPLAIN_ID", this.get32UUID()); //主键
|
||||
pd.put("ISDELETE", "0"); //是否删除(0:有效 1:删除)
|
||||
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
pd.put("ACTION_USER", Jurisdiction.getName()); //操作人
|
||||
pd.put("VALID", "1");
|
||||
pd.put("ISPASS", "0");
|
||||
if (StringUtils.isNotBlank(pd.getString("INSPECTED_SITEUSER_SIGN_IMG"))) {
|
||||
MultipartFile img = BASE64DecodedMultipartFile.base64ToMultipart(pd.getString("INSPECTED_SITEUSER_SIGN_IMG"));
|
||||
String suffixName = img.getOriginalFilename().substring(img.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String ffile = DateUtil.getDays();
|
||||
String fileName = this.get32UUID() + img.getOriginalFilename().substring(img.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(img, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
|
||||
pd.put("INSPECTED_SITEUSER_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
if (null != file && !file.isEmpty()) {
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String ffile = DateUtil.getDays();
|
||||
//服务器
|
||||
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("INSPECTED_EXPLAIN_FILENAME", file.getOriginalFilename());
|
||||
pd.put("INSPECTED_EXPLAIN_FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
safetyenvironmentalexplainService.save(pd);
|
||||
pd.put("INSPECTED_SITEUSER_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
if (null != file && !file.isEmpty()) {
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String ffile = DateUtil.getDays();
|
||||
//服务器
|
||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile);
|
||||
pd.put("INSPECTED_EXPLAIN_FILENAME", file.getOriginalFilename());
|
||||
pd.put("INSPECTED_EXPLAIN_FILEPATH", Const.FILEPATHFILE + Jurisdiction.getCORPINFO_ID() + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
safetyenvironmentalexplainService.save(pd);
|
||||
|
||||
noticeCorpUtil.SE_PleadingStepUtil(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
noticeCorpUtil.SE_PleadingStepUtil(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/delete")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:del")
|
||||
@ResponseBody
|
||||
public Object delete() throws Exception{
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalexplainService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:del")
|
||||
@ResponseBody
|
||||
public Object delete() throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalexplainService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/edit")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:edit")
|
||||
@ResponseBody
|
||||
public Object edit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalexplainService.edit(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/edit")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:edit")
|
||||
@ResponseBody
|
||||
public Object edit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalexplainService.edit(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goEdit")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:edit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = safetyenvironmentalexplainService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/goEdit")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:edit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = safetyenvironmentalexplainService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/deleteAll")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:del")
|
||||
@ResponseBody
|
||||
public Object deleteAll() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if(Tools.notEmpty(DATA_IDS)){
|
||||
String[] ArrayDATA_IDS = DATA_IDS.split(",");
|
||||
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
|
||||
safetyenvironmentalexplainService.deleteAll(pd);
|
||||
errInfo = "success";
|
||||
}else{
|
||||
errInfo = "fail";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/deleteAll")
|
||||
@RequiresPermissions("safetyenvironmentalexplain:del")
|
||||
@ResponseBody
|
||||
public Object deleteAll() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if (Tools.notEmpty(DATA_IDS)) {
|
||||
String[] ArrayDATA_IDS = DATA_IDS.split(",");
|
||||
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
|
||||
safetyenvironmentalexplainService.deleteAll(pd);
|
||||
errInfo = "success";
|
||||
} else {
|
||||
errInfo = "fail";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**导出到excel
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/excel")
|
||||
@RequiresPermissions("toExcel")
|
||||
public ModelAndView exportExcel() throws Exception{
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String,Object> dataMap = new HashMap<String,Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("安全环保检查ID"); //1
|
||||
titles.add("申辩内容"); //2
|
||||
titles.add("是否删除(0:有效 1:删除)"); //3
|
||||
titles.add("添加人"); //4
|
||||
titles.add("添加时间"); //5
|
||||
titles.add("修改人"); //6
|
||||
titles.add("修改时间"); //7
|
||||
titles.add("企业ID"); //8
|
||||
dataMap.put("titles", titles);
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
List<PageData> varOList = safetyenvironmentalexplainService.listAll(pd);
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
for(int i=0;i<varOList.size();i++){
|
||||
PageData vpd = new PageData();
|
||||
vpd.put("var1", varOList.get(i).getString("INSPECTION_ID")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("INSPECTED_EXPLAIN")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("ISDELETE")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("CREATOR")); //4
|
||||
vpd.put("var5", varOList.get(i).getString("CREATTIME")); //5
|
||||
vpd.put("var6", varOList.get(i).getString("OPERATOR")); //6
|
||||
vpd.put("var7", varOList.get(i).getString("OPERATTIME")); //7
|
||||
vpd.put("var8", varOList.get(i).getString("CORPINFO_ID")); //8
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv,dataMap);
|
||||
return mv;
|
||||
}
|
||||
/**
|
||||
* 导出到excel
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/excel")
|
||||
@RequiresPermissions("toExcel")
|
||||
public ModelAndView exportExcel() throws Exception {
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String, Object> dataMap = new HashMap<String, Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("安全环保检查ID"); //1
|
||||
titles.add("申辩内容"); //2
|
||||
titles.add("是否删除(0:有效 1:删除)"); //3
|
||||
titles.add("添加人"); //4
|
||||
titles.add("添加时间"); //5
|
||||
titles.add("修改人"); //6
|
||||
titles.add("修改时间"); //7
|
||||
titles.add("企业ID"); //8
|
||||
dataMap.put("titles", titles);
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
List<PageData> varOList = safetyenvironmentalexplainService.listAll(pd);
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
for (int i = 0; i < varOList.size(); i++) {
|
||||
PageData vpd = new PageData();
|
||||
vpd.put("var1", varOList.get(i).getString("INSPECTION_ID")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("INSPECTED_EXPLAIN")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("ISDELETE")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("CREATOR")); //4
|
||||
vpd.put("var5", varOList.get(i).getString("CREATTIME")); //5
|
||||
vpd.put("var6", varOList.get(i).getString("OPERATOR")); //6
|
||||
vpd.put("var7", varOList.get(i).getString("OPERATTIME")); //7
|
||||
vpd.put("var8", varOList.get(i).getString("CORPINFO_ID")); //8
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv, dataMap);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**查询安环检查是否有隐患
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/hiddencount")
|
||||
@ResponseBody
|
||||
public Object hiddencount() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
List<PageData> hiddenlist = hiddenService.findByInspectionId(pd); //根据ID读取
|
||||
if(hiddenlist.size()>0){
|
||||
map.put("hiddencount",'1');
|
||||
} else {
|
||||
map.put("hiddencount",'0');
|
||||
}
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 查询安环检查是否有隐患
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/hiddencount")
|
||||
@ResponseBody
|
||||
public Object hiddencount() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
List<PageData> hiddenlist = hiddenService.findByInspectionId(pd); //根据ID读取
|
||||
if (hiddenlist.size() > 0) {
|
||||
map.put("hiddencount", '1');
|
||||
} else {
|
||||
map.put("hiddencount", '0');
|
||||
}
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,262 +30,269 @@ import java.util.stream.Collectors;
|
|||
@RequestMapping("/safetyenvironmentalinspector")
|
||||
public class SafetyEnvironmentalInspectorController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private SafetyEnvironmentalInspectorService safetyenvironmentalinspectorService;
|
||||
@Autowired
|
||||
private SafetyEnvironmentalInspectorService safetyenvironmentalinspectorService;
|
||||
|
||||
@Autowired
|
||||
private DepartmentService departmentService;
|
||||
@Autowired
|
||||
private DepartmentService departmentService;
|
||||
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/list")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:list")
|
||||
@ResponseBody
|
||||
public Object list(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
pd.put("INSPECTION_USER_ID", Jurisdiction.getUSER_ID()); //检查人ID
|
||||
Session session = Jurisdiction.getSession();
|
||||
User loginUser = (User)session.getAttribute(Const.SESSION_USER);
|
||||
if(null != loginUser){
|
||||
pd.put("supDeparIds",loginUser.getSuperviseDepartId());
|
||||
pd.put("roleLevel",loginUser.getRoleLevel());
|
||||
pd.put("loginUserId",loginUser.getUSER_ID());
|
||||
}
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/list")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:list")
|
||||
@ResponseBody
|
||||
public Object list(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
pd.put("INSPECTION_USER_ID", Jurisdiction.getUSER_ID()); //检查人ID
|
||||
Session session = Jurisdiction.getSession();
|
||||
User loginUser = (User) session.getAttribute(Const.SESSION_USER);
|
||||
if (null != loginUser) {
|
||||
pd.put("supDeparIds", loginUser.getSuperviseDepartId());
|
||||
pd.put("roleLevel", loginUser.getRoleLevel());
|
||||
pd.put("loginUserId", loginUser.getUSER_ID());
|
||||
}
|
||||
pd.put("loginUserId", Jurisdiction.getUSER_ID());
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalinspectorService.list(page); //列出SafetyEnvironmentalInspector列表
|
||||
for (PageData vector : varList) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("DEPARTMENT_ID", vector.getString("INSPECTED_DEPARTMENT_ID"));
|
||||
List<PageData> parent_list = departmentService.getGenealogy(condition);
|
||||
if (parent_list == null || parent_list.size() < 1) {
|
||||
String corp_infos = "";
|
||||
vector.put("INSPECTED_DEPARTMENT_NAMES", corp_infos);
|
||||
} else {
|
||||
String corp_infos = parent_list.stream().map(n -> n.getString("NAME")).collect(Collectors.joining("-"));
|
||||
vector.put("INSPECTED_DEPARTMENT_NAMES", corp_infos);
|
||||
}
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = safetyenvironmentalinspectorService.list(page); //列出SafetyEnvironmentalInspector列表
|
||||
for (PageData vector: varList) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("DEPARTMENT_ID",vector.getString("INSPECTED_DEPARTMENT_ID"));
|
||||
List<PageData> parent_list = departmentService.getGenealogy(condition);
|
||||
if (parent_list == null || parent_list.size() < 1) {
|
||||
String corp_infos = "";
|
||||
vector.put("INSPECTED_DEPARTMENT_NAMES", corp_infos);
|
||||
} else {
|
||||
String corp_infos = parent_list.stream().map(n -> n.getString("NAME")).collect(Collectors.joining("-"));
|
||||
vector.put("INSPECTED_DEPARTMENT_NAMES",corp_infos);
|
||||
}
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 检查人核实
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/verify")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:add")
|
||||
@ResponseBody
|
||||
public Object verify() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
PageData uBean = safetyenvironmentalinspectorService.findById(pd);
|
||||
uBean.put("INSPECTION_USER_OPINION", pd.getString("INSPECTION_USER_OPINION"));
|
||||
uBean.put("INSPECTION_USER_SIGN_TIME", DateUtil.date2Str(new Date()));
|
||||
uBean.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
uBean.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
uBean.put("INSPECTION_STATUS", pd.getString("INSPECTION_STATUS")); //检查进度状态
|
||||
uBean.put("ACTION_USER", Jurisdiction.getName()); //检查进度状态
|
||||
|
||||
/**检查人核实
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/verify")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:add")
|
||||
@ResponseBody
|
||||
public Object verify() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
PageData uBean= safetyenvironmentalinspectorService.findById(pd);
|
||||
uBean.put("INSPECTION_USER_OPINION", pd.getString("INSPECTION_USER_OPINION"));
|
||||
uBean.put("INSPECTION_USER_SIGN_TIME", DateUtil.date2Str(new Date()));
|
||||
uBean.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
uBean.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
uBean.put("INSPECTION_STATUS", pd.getString("INSPECTION_STATUS")); //检查进度状态
|
||||
uBean.put("ACTION_USER", Jurisdiction.getName()); //检查进度状态
|
||||
if (StringUtils.isNotBlank(pd.getString("INSPECTION_USER_SIGN_IMG"))) {
|
||||
MultipartFile file = BASE64DecodedMultipartFile.base64ToMultipart(pd.getString("INSPECTION_USER_SIGN_IMG"));
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String ffile = DateUtil.getDays();
|
||||
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
|
||||
if (StringUtils.isNotBlank(pd.getString("INSPECTION_USER_SIGN_IMG"))) {
|
||||
MultipartFile file = BASE64DecodedMultipartFile.base64ToMultipart(pd.getString("INSPECTION_USER_SIGN_IMG"));
|
||||
String suffixName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1).toLowerCase();
|
||||
if (!"pdf".equals(suffixName) && !"jpg".equals(suffixName) && !"jpeg".equals(suffixName) && !"png".equals(suffixName) && !"mp4".equals(suffixName)) {
|
||||
errInfo = "fail";
|
||||
map.put("result", errInfo);
|
||||
map.put("msg", "文件格式不正确!");
|
||||
return map;
|
||||
}
|
||||
String ffile = DateUtil.getDays();
|
||||
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
|
||||
|
||||
uBean.put("INSPECTION_USER_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
safetyenvironmentalinspectorService.verify(uBean);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
uBean.put("INSPECTION_USER_SIGN_IMG", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
|
||||
}
|
||||
safetyenvironmentalinspectorService.verify(uBean);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:add")
|
||||
@ResponseBody
|
||||
public Object add() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("INSPECTION_INSPECTOR_ID", this.get32UUID()); //主键
|
||||
pd.put("ISDELETE", ""); //是否删除(0:有效 1:删除)
|
||||
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
safetyenvironmentalinspectorService.save(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:del")
|
||||
@ResponseBody
|
||||
public Object delete() throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalinspectorService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/edit")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:edit")
|
||||
@ResponseBody
|
||||
public Object edit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalinspectorService.edit(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/goEdit")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:edit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = safetyenvironmentalinspectorService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/deleteAll")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:del")
|
||||
@ResponseBody
|
||||
public Object deleteAll() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if (Tools.notEmpty(DATA_IDS)) {
|
||||
String[] ArrayDATA_IDS = DATA_IDS.split(",");
|
||||
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
|
||||
safetyenvironmentalinspectorService.deleteAll(pd);
|
||||
errInfo = "success";
|
||||
} else {
|
||||
errInfo = "fail";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**新增
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/add")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:add")
|
||||
@ResponseBody
|
||||
public Object add() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("INSPECTION_INSPECTOR_ID", this.get32UUID()); //主键
|
||||
pd.put("ISDELETE", ""); //是否删除(0:有效 1:删除)
|
||||
pd.put("CREATOR", Jurisdiction.getUSER_ID()); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
safetyenvironmentalinspectorService.save(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/delete")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:del")
|
||||
@ResponseBody
|
||||
public Object delete() throws Exception{
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalinspectorService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/edit")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:edit")
|
||||
@ResponseBody
|
||||
public Object edit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
safetyenvironmentalinspectorService.edit(pd);
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**去修改页面获取数据
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/goEdit")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:edit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = safetyenvironmentalinspectorService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/deleteAll")
|
||||
@RequiresPermissions("safetyenvironmentalinspector:del")
|
||||
@ResponseBody
|
||||
public Object deleteAll() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("OPERATOR", Jurisdiction.getUSER_ID()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if(Tools.notEmpty(DATA_IDS)){
|
||||
String[] ArrayDATA_IDS = DATA_IDS.split(",");
|
||||
pd.put("ArrayDATA_IDS", ArrayDATA_IDS); //待删除ids
|
||||
safetyenvironmentalinspectorService.deleteAll(pd);
|
||||
errInfo = "success";
|
||||
}else{
|
||||
errInfo = "fail";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**导出到excel
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/excel")
|
||||
@RequiresPermissions("toExcel")
|
||||
public ModelAndView exportExcel() throws Exception{
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String,Object> dataMap = new HashMap<String,Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("安全环保检查ID"); //1
|
||||
titles.add("检查人"); //2
|
||||
titles.add("检查人意见(有异议时必填)"); //3
|
||||
titles.add("检查人签字"); //4
|
||||
titles.add("检查人签字时间"); //5
|
||||
titles.add("是否删除(0:有效 1:删除)"); //6
|
||||
titles.add("添加人"); //7
|
||||
titles.add("添加时间"); //8
|
||||
titles.add("修改人"); //9
|
||||
titles.add("修改时间"); //10
|
||||
titles.add("企业ID"); //11
|
||||
dataMap.put("titles", titles);
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
List<PageData> varOList = safetyenvironmentalinspectorService.listAll(pd);
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
for(int i=0;i<varOList.size();i++){
|
||||
PageData vpd = new PageData();
|
||||
vpd.put("var1", varOList.get(i).getString("INSPECTION_ID")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("INSPECTION_USER_ID")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("INSPECTION_USER_OPINION")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("INSPECTION_USER_SIGN_IMG")); //4
|
||||
vpd.put("var5", varOList.get(i).getString("INSPECTION_USER_SIGN_TIME")); //5
|
||||
vpd.put("var6", varOList.get(i).getString("ISDELETE")); //6
|
||||
vpd.put("var7", varOList.get(i).getString("CREATOR")); //7
|
||||
vpd.put("var8", varOList.get(i).getString("CREATTIME")); //8
|
||||
vpd.put("var9", varOList.get(i).getString("OPERATOR")); //9
|
||||
vpd.put("var10", varOList.get(i).getString("OPERATTIME")); //10
|
||||
vpd.put("var11", varOList.get(i).getString("CORPINFO_ID")); //11
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv,dataMap);
|
||||
return mv;
|
||||
}
|
||||
/**
|
||||
* 导出到excel
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/excel")
|
||||
@RequiresPermissions("toExcel")
|
||||
public ModelAndView exportExcel() throws Exception {
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String, Object> dataMap = new HashMap<String, Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("安全环保检查ID"); //1
|
||||
titles.add("检查人"); //2
|
||||
titles.add("检查人意见(有异议时必填)"); //3
|
||||
titles.add("检查人签字"); //4
|
||||
titles.add("检查人签字时间"); //5
|
||||
titles.add("是否删除(0:有效 1:删除)"); //6
|
||||
titles.add("添加人"); //7
|
||||
titles.add("添加时间"); //8
|
||||
titles.add("修改人"); //9
|
||||
titles.add("修改时间"); //10
|
||||
titles.add("企业ID"); //11
|
||||
dataMap.put("titles", titles);
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID
|
||||
List<PageData> varOList = safetyenvironmentalinspectorService.listAll(pd);
|
||||
List<PageData> varList = new ArrayList<PageData>();
|
||||
for (int i = 0; i < varOList.size(); i++) {
|
||||
PageData vpd = new PageData();
|
||||
vpd.put("var1", varOList.get(i).getString("INSPECTION_ID")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("INSPECTION_USER_ID")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("INSPECTION_USER_OPINION")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("INSPECTION_USER_SIGN_IMG")); //4
|
||||
vpd.put("var5", varOList.get(i).getString("INSPECTION_USER_SIGN_TIME")); //5
|
||||
vpd.put("var6", varOList.get(i).getString("ISDELETE")); //6
|
||||
vpd.put("var7", varOList.get(i).getString("CREATOR")); //7
|
||||
vpd.put("var8", varOList.get(i).getString("CREATTIME")); //8
|
||||
vpd.put("var9", varOList.get(i).getString("OPERATOR")); //9
|
||||
vpd.put("var10", varOList.get(i).getString("OPERATTIME")); //10
|
||||
vpd.put("var11", varOList.get(i).getString("CORPINFO_ID")); //11
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv, dataMap);
|
||||
return mv;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package com.zcloud.controller.messages;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.crypto.asymmetric.KeyType;
|
||||
import cn.hutool.crypto.asymmetric.RSA;
|
||||
import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
|
||||
import cn.hutool.crypto.symmetric.SymmetricCrypto;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.zcloud.entity.messages.PushRecords;
|
||||
import com.zcloud.service.messages.MessagesService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
import javax.validation.Validator;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/messages")
|
||||
public class MessagesController {
|
||||
|
||||
private static final String privateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAI/0e9Q2v5Hi9j2BRHz2U/0skmjTX" +
|
||||
"iqNsl/hEylAZdfA4vTdFT9VSf9Pl91MqTAVi1rTojLEQV/QLdGuqY/6bHyb0PL0A/4Lx0ddVRs3hNPmX32JD8HgPiRIxdXyzKkZHskvUg6gPYYPgzv" +
|
||||
"OPWjxeVZz8QA4bDYUKr+X7WrEyu+bAgMBAAECgYAITF9Z0uDrmUoSyC5foIvwtsHAq2df8me7cWXIEkj5c7DBmjMDQevjloqz4s6H+CrFDOXqbkTK4" +
|
||||
"xAytUWO1RbgaGhEJpVGHxxzml+npbI4KGbs11IVcaH70FJcL44gYyX+G+2aj372aykldUH56IwPO7Z8cV0WTTZaIel3D5NDKQJBAKN90RJ1dpiMROg" +
|
||||
"qGChoshstpkEgRRdFBA26hmIeMaQZyrgzLGvcjEETo5zbzcwvSi5jMLK8FhlAquof3db8sBMCQQDhaMIaKfSmghrl3eBf7PxoXvmBNqWy7ZpmOWcA0" +
|
||||
"GfvNdHc1NAsSw272CFl7cSwdI6DW9vu1ULZy5Iw6rJuyINZAkACzxiWfpopCM/uRTrhBtt4iBJBMDK/sZneOoQwj2A+94p6G7b5q3Jlc9btzQD+Lxn" +
|
||||
"RLjcZ+w1OJcRJ/X4sQW8tAkEAvrSZ2/b5NNLInQguKBphppAL+iVY5VwfEDOqkMbB2GGpb3NhuMe7E90UzJ7wlPXYCQzzs0oc6BVSVy6Jzi646QJAP" +
|
||||
"4uFZIPgEAGi4iw4uvio1URXVVwqTgIaqiQ/cJ8rpV2txiSdbEsGrR9V8QYPyxS//rVSK8JJAHVJGWRiuxZ24A==";
|
||||
|
||||
private final MessagesService service;
|
||||
private final Validator validator;
|
||||
|
||||
@PostMapping(value = "/push")
|
||||
public Map<String, Object> push(@RequestBody Map<String, Object> body) throws Exception {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
if (body == null || !body.containsKey("key") || !body.containsKey("value")) {
|
||||
throw new RuntimeException("参数为空");
|
||||
}
|
||||
PushRecords pushRecords = JSON.parseObject(decrypt(body), PushRecords.class);
|
||||
Set<ConstraintViolation<PushRecords>> validate = validator.validate(pushRecords);
|
||||
if (!validate.isEmpty()) {
|
||||
throw new ConstraintViolationException(validate);
|
||||
}
|
||||
// 校验 发送时间 距离当前时间不能超过6 秒
|
||||
// if (DateUtil.betweenMs(DateUtil.parseDateTime(pushRecords.getSendTime()), new Date()) > 6000) {
|
||||
// throw new RuntimeException("发送时间距离当前时间不能超过10 秒");
|
||||
// }
|
||||
service.push(pushRecords);
|
||||
result.put("code", 0);
|
||||
result.put("msg", "成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
private String decrypt(Map<String, Object> body) {
|
||||
try {
|
||||
RSA rsa = new RSA(MessagesController.privateKey, null);
|
||||
byte[] aesKey = rsa.decrypt(Convert.toStr(body.get("key")), KeyType.PrivateKey);
|
||||
SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, aesKey);
|
||||
return aes.decryptStr(Convert.toStr(body.get("value")), StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
log.error("对接消息接口解密失败", e);
|
||||
throw new RuntimeException("解密失败");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.zcloud.controller.messages;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.messaging.handler.annotation.support.MethodArgumentNotValidException;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.FieldError;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
import javax.validation.ConstraintViolationException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestControllerAdvice(assignableTypes = MessagesController.class)
|
||||
public class MessagesControllerExceptionHandler {
|
||||
|
||||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||
public Map<String, Object> handleMethodArgumentNotValidException(MethodArgumentNotValidException ex) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
BindingResult bindingResult = ex.getBindingResult();
|
||||
StringBuilder sb = new StringBuilder("校验失败:");
|
||||
for (FieldError fieldError : bindingResult.getFieldErrors()) {
|
||||
sb.append(fieldError.getField()).append(":").append(fieldError.getDefaultMessage()).append(", ");
|
||||
}
|
||||
result.put("msg", sb.toString());
|
||||
result.put("code", 500);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ExceptionHandler(ConstraintViolationException.class)
|
||||
public Map<String, Object> handleConstraintViolationException(ConstraintViolationException ex) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("msg", ex.getMessage());
|
||||
result.put("code", 500);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ExceptionHandler(RuntimeException.class)
|
||||
public Map<String, Object> handleRuntimeException(RuntimeException ex) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("msg", ex.getMessage());
|
||||
result.put("code", 500);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public Map<String, Object> handleRuntimeException(Exception ex) {
|
||||
log.error("系统异常,请稍后重试", ex);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("msg", ex.getMessage());
|
||||
result.put("code", 500);
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -92,16 +92,16 @@ public class StatisticsDataController extends BaseController {
|
|||
Map<String, Object> corp = new HashMap<>();
|
||||
//部门
|
||||
List<PageData> userCount = usersService.statisticsByCorp(pd);
|
||||
corp.put("USERCOUNT", userCount.get(0).get("COUNT")); //人员总数
|
||||
corp.put("USERCHECKCOUNT", userCount.get(1).get("COUNT")); //人员总数
|
||||
corp.put("USERCOUNT", userCount.get(0).get("COUNT")); //人员总数
|
||||
corp.put("USERCHECKCOUNT", userCount.get(1).get("COUNT")); //人员总数
|
||||
//部门
|
||||
List<PageData> deptCount = departmentService.statisticsByCorp(pd);
|
||||
corp.put("DEPTCOUNT", deptCount.get(0).get("COUNT")); //人员总数
|
||||
corp.put("DEPTCHECKCOUNT", deptCount.get(1).get("COUNT")); //人员总数
|
||||
List<PageData> deptCount = departmentService.statisticsByCorp(pd);
|
||||
corp.put("DEPTCOUNT", deptCount.get(0).get("COUNT")); //人员总数
|
||||
corp.put("DEPTCHECKCOUNT", deptCount.get(1).get("COUNT")); //人员总数
|
||||
//清单
|
||||
List<PageData> listCount = listmanagerService.statisticsByCorp(pd); //列出ListManager列表
|
||||
corp.put("LISTCOUNT", listCount.get(0).get("COUNT")); //人员总数
|
||||
corp.put("LISTCHECKCOUNT", listCount.get(1).get("COUNT")); //人员总数
|
||||
List<PageData> listCount = listmanagerService.statisticsByCorp(pd); //列出ListManager列表
|
||||
corp.put("LISTCOUNT", listCount.get(0).get("COUNT")); //人员总数
|
||||
corp.put("LISTCHECKCOUNT", listCount.get(1).get("COUNT")); //人员总数
|
||||
map.put("corp", corp);
|
||||
|
||||
map.put("result", errInfo);
|
||||
|
@ -120,7 +120,7 @@ public class StatisticsDataController extends BaseController {
|
|||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID",CORPINFO_ID);
|
||||
pd.put("CORPINFO_ID", CORPINFO_ID);
|
||||
|
||||
//清单类型占比统计
|
||||
List<PageData> chartData = listmanagerService.statisticsGroupType(pd);
|
||||
|
@ -151,9 +151,9 @@ public class StatisticsDataController extends BaseController {
|
|||
for (int i = 0; i < legendData.size(); i++) {
|
||||
PageData pd = new PageData();
|
||||
pd.put("CORPINFO_ID", CORPINFO_ID);
|
||||
pd.put("STATENAME",legendData.get(i));
|
||||
pd.put("STATENAME", legendData.get(i));
|
||||
List data = new ArrayList();
|
||||
List<PageData> hdRecChart = hiddenService.statisticsGroupMonthByState(pd); //根据状态按时间分组统计隐患数据
|
||||
List<PageData> hdRecChart = hiddenService.statisticsGroupMonthByState(pd); //根据状态按时间分组统计隐患数据
|
||||
for (int j = 0; j < halfYearMonth.size(); j++) {
|
||||
boolean flag = true;
|
||||
for (int k = 0; k < hdRecChart.size(); k++) {
|
||||
|
@ -191,18 +191,18 @@ public class StatisticsDataController extends BaseController {
|
|||
PageData pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", CORPINFO_ID);
|
||||
Map<String, Object> chartData = new HashMap<String, Object>();
|
||||
List<PageData> deptList = riskpointService.listDeptByPoint(pd);
|
||||
List<PageData> deptList = riskpointService.listDeptByPoint(pd);
|
||||
List<String> yAxisData = new ArrayList<String>();
|
||||
for(PageData d :deptList){
|
||||
for (PageData d : deptList) {
|
||||
PageData pdf = new PageData();
|
||||
yAxisData.add(d.getString("DEPT_NAME"));
|
||||
}
|
||||
chartData.put("yAxisData", yAxisData);
|
||||
|
||||
List<Dictionaries> varList = dictionariesService.listSubDictByParentId("5a81e63ec0e94d919b3138bc01dbef6b");
|
||||
List<Dictionaries> varList = dictionariesService.listSubDictByParentId("5a81e63ec0e94d919b3138bc01dbef6b");
|
||||
List<String> legendData = new ArrayList<String>();
|
||||
List seriesData = new ArrayList();
|
||||
for(Dictionaries d :varList){
|
||||
for (Dictionaries d : varList) {
|
||||
PageData pdf = new PageData();
|
||||
legendData.add(d.getNAME());
|
||||
seriesData.add(new ArrayList());
|
||||
|
@ -211,8 +211,8 @@ public class StatisticsDataController extends BaseController {
|
|||
//隐患整改趋势(近半年)
|
||||
for (int i = 0; i < deptList.size(); i++) {
|
||||
PageData dept = new PageData();
|
||||
dept.put("DEPARTMENT_ID",deptList.get(i).getString("DEPARTMENT_ID"));
|
||||
List<PageData> dataChart = riskpointService.statisticsGroupLevelByDept(dept); //按照级别分类统计各部门风险管控数据
|
||||
dept.put("DEPARTMENT_ID", deptList.get(i).getString("DEPARTMENT_ID"));
|
||||
List<PageData> dataChart = riskpointService.statisticsGroupLevelByDept(dept); //按照级别分类统计各部门风险管控数据
|
||||
for (int j = 0; j < varList.size(); j++) {
|
||||
List secondList = (List) seriesData.get(j);
|
||||
secondList.add(i, dataChart.get(j).getString("COUNT"));
|
||||
|
@ -294,7 +294,7 @@ public class StatisticsDataController extends BaseController {
|
|||
List seriesData2 = new ArrayList();
|
||||
List seriesData3 = new ArrayList();
|
||||
|
||||
List<PageData> disposalChart = majordangersourceDisposalService.statisticsGroupMajordangersource(pd); //根据重大危险源分组统计报警处置情况
|
||||
List<PageData> disposalChart = majordangersourceDisposalService.statisticsGroupMajordangersource(pd); //根据重大危险源分组统计报警处置情况
|
||||
List seriesData = new ArrayList();
|
||||
for (PageData data : disposalChart) {
|
||||
xAxisData.add(data.getString("MAJORDANGERSOURCE_NAME"));
|
||||
|
@ -330,7 +330,7 @@ public class StatisticsDataController extends BaseController {
|
|||
Map<String, Object> chartData = new HashMap<String, Object>();
|
||||
List<String> legendData = Arrays.asList(new String[]{"动火作业", "临时用电作业", "盲板作业", "高处作业", "有限空间作业", "吊装作业"});
|
||||
|
||||
List<PageData> workChart = highworkService.statisticsAllHighRiskWork(pd); //统计高危作业里各作业数
|
||||
List<PageData> workChart = highworkService.statisticsAllHighRiskWork(pd); //统计高危作业里各作业数
|
||||
List seriesData = new ArrayList();
|
||||
for (int i = 0; i < legendData.size(); i++) {
|
||||
PageData pie = new PageData();
|
||||
|
@ -345,27 +345,29 @@ public class StatisticsDataController extends BaseController {
|
|||
return map;
|
||||
}
|
||||
|
||||
/**数据可视化平台首页获取
|
||||
/**
|
||||
* 数据可视化平台首页获取
|
||||
* 1.获取企业的置顶视频
|
||||
* 2.获取管理的置顶视频
|
||||
* 3.没有视频或者没有置顶视频
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/getObjectForBiLogin")
|
||||
@RequestMapping(value = "/getObjectForBiLogin")
|
||||
@ResponseBody
|
||||
public Object getObjectForBiLogin() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
public Object getObjectForBiLogin() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd.put("TYPE", "1");
|
||||
pd.put("CORPINFO_TYPE", "1");
|
||||
pd.put("CORPINFO_ID", CORPINFO_ID);
|
||||
List<PageData> cpvarList = videoService.listAll(pd); //企业视频
|
||||
List<PageData> cpvarList = videoService.listAll(pd); //企业视频
|
||||
pd = new PageData();
|
||||
pd.put("CORPINFO_TYPE", "2");
|
||||
pd.put("TYPE", "1");
|
||||
List<PageData> ptVarList = videoService.listAll(pd); //平台视频
|
||||
List<PageData> ptVarList = videoService.listAll(pd); //平台视频
|
||||
|
||||
map.put("ptVarList", ptVarList);
|
||||
map.put("cpvarList", cpvarList);
|
||||
|
@ -373,17 +375,19 @@ public class StatisticsDataController extends BaseController {
|
|||
return map;
|
||||
}
|
||||
|
||||
/**获取重大危险源数据
|
||||
/**
|
||||
* 获取重大危险源数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/findValidateData")
|
||||
@RequestMapping(value = "/findValidateData")
|
||||
@ResponseBody
|
||||
public Object findValidateData() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
public Object findValidateData() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
List<PageData> varList = majordangersourcedisposalService.listAll(pd); //根据ID读取
|
||||
List<PageData> varList = majordangersourcedisposalService.listAll(pd); //根据ID读取
|
||||
map.put("varList", varList);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
|
@ -654,17 +658,19 @@ public class StatisticsDataController extends BaseController {
|
|||
return lastDayOfMonth;
|
||||
}
|
||||
|
||||
/**首页 获取折线图
|
||||
/**
|
||||
* 首页 获取折线图
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/listmanagerIndexCount")
|
||||
@RequestMapping(value = "/listmanagerIndexCount")
|
||||
@ResponseBody
|
||||
public Object listmanagerIndexCount() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
public Object listmanagerIndexCount() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", CORPINFO_ID); //企业
|
||||
pd.put("CORPINFO_ID", CORPINFO_ID); //企业
|
||||
List<PageData> valList = listmanagerService.goIndexCount(pd);
|
||||
List valList1 = new ArrayList();
|
||||
|
||||
|
@ -672,30 +678,30 @@ public class StatisticsDataController extends BaseController {
|
|||
// {months: "2022-06", count: 0, screenType: "riskChecklistType0001"}
|
||||
// 6 * 3 近6個月 ,3 三种类型
|
||||
|
||||
Map<String,String> monSCrMap = new HashMap<>();
|
||||
for (PageData pageData : valList){
|
||||
String key = pageData.getString("months")+"*"+pageData.getString("screenType");
|
||||
monSCrMap.put(key,pageData.getString("count"));
|
||||
Map<String, String> monSCrMap = new HashMap<>();
|
||||
for (PageData pageData : valList) {
|
||||
String key = pageData.getString("months") + "*" + pageData.getString("screenType");
|
||||
monSCrMap.put(key, pageData.getString("count"));
|
||||
}
|
||||
|
||||
|
||||
List<String> halfYearMonth = DateUtil.getHalfYearMonth(true);
|
||||
String [] typeAll = new String[]{"riskChecklistType0001","riskChecklistType0002","zhqd03"};
|
||||
String[] typeAll = new String[]{"riskChecklistType0001", "riskChecklistType0002", "zhqd03"};
|
||||
|
||||
|
||||
List<Map<String,Object>> list = new ArrayList<>(); // 整理完成的数据 size 6 * 3
|
||||
for(String month : halfYearMonth){
|
||||
for (String type : typeAll){
|
||||
List<Map<String, Object>> list = new ArrayList<>(); // 整理完成的数据 size 6 * 3
|
||||
for (String month : halfYearMonth) {
|
||||
for (String type : typeAll) {
|
||||
String count = "0";
|
||||
|
||||
String key = month +"*" + type;
|
||||
if (monSCrMap.containsKey(key)){
|
||||
String key = month + "*" + type;
|
||||
if (monSCrMap.containsKey(key)) {
|
||||
count = monSCrMap.get(key);
|
||||
}
|
||||
Map<String,Object> monAndType = new HashMap<>();
|
||||
monAndType.put("months",month);
|
||||
monAndType.put("screenType",type);
|
||||
monAndType.put("count",count);
|
||||
Map<String, Object> monAndType = new HashMap<>();
|
||||
monAndType.put("months", month);
|
||||
monAndType.put("screenType", type);
|
||||
monAndType.put("count", count);
|
||||
list.add(monAndType);
|
||||
}
|
||||
}
|
||||
|
@ -867,20 +873,22 @@ public class StatisticsDataController extends BaseController {
|
|||
return map;
|
||||
}
|
||||
|
||||
/**平台公告
|
||||
/**
|
||||
* 平台公告
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/listByIndex")
|
||||
@RequestMapping(value = "/listByIndex")
|
||||
@ResponseBody
|
||||
public Object listByIndex(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
public Object listByIndex(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
//获取发布给这个企业的信息
|
||||
pd.put("CORP_INFO_ID", CORPINFO_ID);
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = noticeService.getNotAndCorpByCorpId(page);
|
||||
List<PageData> varList = noticeService.getNotAndCorpByCorpId(page);
|
||||
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
|
@ -888,21 +896,23 @@ public class StatisticsDataController extends BaseController {
|
|||
return map;
|
||||
}
|
||||
|
||||
/**企业公告
|
||||
/**
|
||||
* 企业公告
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/enterpriseListByIndex")
|
||||
@RequestMapping(value = "/enterpriseListByIndex")
|
||||
@ResponseBody
|
||||
public Object enterpriseListByIndex(Page page) throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
public Object enterpriseListByIndex(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
pd.put("USER_ID", USER_ID);
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = noticecorpService.listByIndex(page); //列出NOTICECORP列表
|
||||
List<PageData> varList = noticecorpService.listByIndex(page); //列出NOTICECORP列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
|
@ -910,35 +920,37 @@ public class StatisticsDataController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**清單列表
|
||||
/**
|
||||
* 清單列表
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/checkListIndex")
|
||||
@RequestMapping(value = "/checkListIndex")
|
||||
@ResponseBody
|
||||
public Object checkListIndex() throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
public Object checkListIndex() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd.put("CORPINFO_ID", CORPINFO_ID); //企业
|
||||
pd.put("USER_ID",USER_ID);
|
||||
pd.put("CORPINFO_ID", CORPINFO_ID); //企业
|
||||
pd.put("USER_ID", USER_ID);
|
||||
pd.put("DEPARTMENT_ID", DEPT_ID);
|
||||
|
||||
pd.put("USER_ID","");
|
||||
List<PageData> varList = listmanagerService.listAll(pd); //列出ListManager列表
|
||||
pd.put("USER_ID", "");
|
||||
List<PageData> varList = listmanagerService.listAll(pd); //列出ListManager列表
|
||||
int wjcNum = 0;
|
||||
int yjcNum = 0;
|
||||
for (PageData list : varList) {
|
||||
if(list.getString("TYPE").equals("listType0005")) {
|
||||
if(Integer.parseInt(list.get("checkCount").toString()) > 0) {
|
||||
if (list.getString("TYPE").equals("listType0005")) {
|
||||
if (Integer.parseInt(list.get("checkCount").toString()) > 0) {
|
||||
yjcNum++;
|
||||
} else {
|
||||
wjcNum++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if(Integer.parseInt(list.get("checkCount").toString()) > 0) {
|
||||
if (Integer.parseInt(list.get("checkCount").toString()) > 0) {
|
||||
yjcNum++;
|
||||
} else {
|
||||
wjcNum++;
|
||||
|
|
|
@ -1,50 +1,26 @@
|
|||
package com.zcloud.controller.system;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.system.User;
|
||||
import com.zcloud.service.bus.CorpInfoService;
|
||||
import com.zcloud.service.bus.OffDutyService;
|
||||
import com.zcloud.service.system.*;
|
||||
import com.zcloud.util.*;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.protocol.HTTP;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.DisabledAccountException;
|
||||
import org.apache.shiro.authc.ExcessiveAttemptsException;
|
||||
import org.apache.shiro.authc.IncorrectCredentialsException;
|
||||
import org.apache.shiro.authc.LockedAccountException;
|
||||
import org.apache.shiro.authc.UnknownAccountException;
|
||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||
import org.apache.shiro.authc.*;
|
||||
import org.apache.shiro.crypto.hash.SimpleHash;
|
||||
import org.apache.shiro.session.Session;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
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 com.alibaba.fastjson.JSON;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.system.Role;
|
||||
import com.zcloud.entity.system.User;
|
||||
import com.zcloud.service.bus.CorpInfoService;
|
||||
import com.zcloud.service.bus.OffDutyService;
|
||||
|
||||
import net.sf.json.JSONObject;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 说明:登录处理类
|
||||
|
@ -177,6 +153,7 @@ public class LoginController extends BaseController {
|
|||
} catch (AuthenticationException ae) {
|
||||
errInfo = "usererror";
|
||||
}
|
||||
Integer port = SpringUtil.getApplicationContext().getEnvironment().getProperty("server.port", Integer.class);
|
||||
if (subject.isAuthenticated()) { //验证是否登录成功
|
||||
removeSession(USERNAME);
|
||||
|
||||
|
@ -201,7 +178,8 @@ public class LoginController extends BaseController {
|
|||
if (backEndPath.get("result").toString().equals("success")) {
|
||||
backEndPath.put("baseImgPath",map.get("baseImgPath").toString());
|
||||
backEndPath.put("USER_IDENTITY",map.get("USER_IDENTITY").toString());
|
||||
backEndPath.put("BACKENDADDR", map.get("BACKENDADDR").toString());
|
||||
|
||||
backEndPath.put("BACKENDADDR", "http://" + ip + ":" + port + "/");
|
||||
System.out.println("登录返回参数:" + backEndPath);
|
||||
return backEndPath;
|
||||
} else {
|
||||
|
@ -212,6 +190,7 @@ public class LoginController extends BaseController {
|
|||
return map;
|
||||
}
|
||||
}
|
||||
map.put("BACKENDADDR", "http://" + ip + ":" + port + "/");
|
||||
if ("99".equals(pd.getString("STATUS"))) {
|
||||
errInfo = "userlock";
|
||||
map.put("result", "fail");
|
||||
|
|
|
@ -1,30 +1,25 @@
|
|||
package com.zcloud.controller.xgf;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.service.bus.CorpInfoService;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.system.DepartmentService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.HttpClientService;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import com.zcloud.util.ObjectExcelView;
|
||||
import net.sf.json.JSONArray;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.HttpClientService;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/xgf/corp")
|
||||
|
@ -62,7 +57,7 @@ public class XgfCorpController extends BaseController {
|
|||
}
|
||||
}
|
||||
Map result = HttpClientService.doPost(url + "/api/corpinfo/JiTuanTeShulist", pd);
|
||||
// created by liu jun (为了不在相关方连表查询,只能在这里这么写,兼容老数据)
|
||||
// created by liu jun (为了不在相关方连表查询,只能在这里这么写,兼容老数据)
|
||||
List<HashMap> list = (List<HashMap> )result.get("varList");
|
||||
for (HashMap x : list) {
|
||||
if (x.get("MAIN_DEPARTMENT") != null && x.get("MAIN_DEPARTMENT").toString().contains("]")) {
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package com.zcloud.entity.accident;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.zcloud.entity.PageData;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -35,6 +39,11 @@ public class AccidentRecords implements Serializable {
|
|||
@Size(max = 100, message = "事故名称最大长度要小于 100")
|
||||
private String incidentName;
|
||||
|
||||
/**
|
||||
* 1事件/2事故
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 事故类型
|
||||
*/
|
||||
|
@ -106,6 +115,11 @@ public class AccidentRecords implements Serializable {
|
|||
*/
|
||||
private String photos;
|
||||
|
||||
/**
|
||||
* 附件地址
|
||||
*/
|
||||
private String attachmentAddress;
|
||||
|
||||
/**
|
||||
* 原因分析及责任认定
|
||||
*/
|
||||
|
@ -162,6 +176,37 @@ public class AccidentRecords implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AccidentRecords(PageData data) {
|
||||
setIncidentNumber(data.getString("incidentNumber"));
|
||||
setId(data.getString("id"));
|
||||
setIncidentName(data.getString("incidentName"));
|
||||
setIncidentType(data.getString("incidentType"));
|
||||
setIncidentLevel(data.getString("incidentLevel"));
|
||||
setLocation(data.getString("location"));
|
||||
setFatalities(toInt(data.get("fatalities")));
|
||||
DateTime time = DateUtil.parse(data.getString("incidentDate"), "yyyy-MM-dd HH:mm:ss");
|
||||
setIncidentDate(time);
|
||||
DateTime time1 = DateUtil.parse(data.getString("incidentDate"), "yyyy-MM-dd HH:mm:ss");
|
||||
setReportDate(time1);
|
||||
setDirectLoss(toInt(data.get("directLoss")));
|
||||
setInjured(toInt(data.get("injured")));
|
||||
setSeriouslyInjured(toInt(data.get("seriouslyInjured")));
|
||||
setCause(data.getString("cause"));
|
||||
setSummary(data.getString("summary"));
|
||||
setAnalysis(data.getString("analysis"));
|
||||
setAttachmentAddress(data.getString("attachmentAddress"));
|
||||
setType(data.getString("type"));
|
||||
setSuggestions(data.getString("suggestions"));
|
||||
setMeasures(data.getString("measures"));
|
||||
setCreator(data.getString("creator"));
|
||||
setPhotos(data.getString("photos"));
|
||||
}
|
||||
|
||||
private Integer toInt(Object object) {
|
||||
Integer i = Convert.toInt(object);
|
||||
return i == null ? 0 : i;
|
||||
}
|
||||
|
||||
// public AccidentRecords(AccidentRecordsExcel reader, DictionariesService service) throws Exception {
|
||||
// this.id = IdUtil.getSnowflake(1, 1).nextId();
|
||||
// this.corpinfoId = reader.getCompanyName();
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package com.zcloud.entity.messages;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class PushRecords implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
@NotBlank(message = "要发送人的手机号不能为空")
|
||||
@Length(min = 1, max = 12, message = "手机号长度为1-11位")
|
||||
private String phone;
|
||||
|
||||
@Length(max = 255, message = "消息标题长度不能大于255")
|
||||
private String messageTitle;
|
||||
|
||||
@NotBlank(message = "消息内容不能为空")
|
||||
@Length(max = 255, message = "消息内容长度不能大于255")
|
||||
private String messageContent;
|
||||
|
||||
@NotNull(message = "消息类型不能为空")
|
||||
@Range(min = 1, max = 3, message = "消息类型只能是1或2或3")
|
||||
private Integer messageType;
|
||||
|
||||
@NotBlank(message = "发送时间不能为空")
|
||||
private String sendTime;
|
||||
|
||||
private Integer state;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.zcloud.mapper.datasource.messages;
|
||||
|
||||
import com.zcloud.entity.messages.PushRecords;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface MessagesMapper {
|
||||
void install(PushRecords pushRecords);
|
||||
|
||||
String findUserIdByPhone(@Param("phone") String phone);
|
||||
|
||||
void updateById(PushRecords pushRecords);
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.zcloud.service.accident;
|
|||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.accident.AccidentRecords;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -28,16 +29,16 @@ public interface AccidentRecordsService {
|
|||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pageData 要保存的实体
|
||||
* @param accidentRecords 要保存的实体
|
||||
*/
|
||||
void save(PageData pageData);
|
||||
void save(AccidentRecords accidentRecords);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param bean 要修改的实体
|
||||
* @param accidentRecords 要修改的实体
|
||||
*/
|
||||
void update(PageData pageData);
|
||||
void update(AccidentRecords accidentRecords);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package com.zcloud.service.accident.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
|
@ -59,69 +57,23 @@ public class AccidentRecordsServiceImpl implements AccidentRecordsService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(PageData pageData) {
|
||||
AccidentRecords accidentRecords = new AccidentRecords();
|
||||
public void save(AccidentRecords accidentRecords) {
|
||||
accidentRecords.setId(IdUtil.fastSimpleUUID());
|
||||
accidentRecords.setCreatedBy(Jurisdiction.getUsername());
|
||||
|
||||
accidentRecords.setIsDeleted(0);
|
||||
String corpinfoId = StrUtil.isEmpty(accidentRecords.getCorpinfoId()) ? Jurisdiction.getCORPINFO_ID() : accidentRecords.getCorpinfoId();
|
||||
accidentRecords.setCorpinfoId(corpinfoId);
|
||||
accidentRecords.setIncidentNumber(pageData.getString("incidentNumber"));
|
||||
accidentRecords.setIncidentName(pageData.getString("incidentName"));
|
||||
accidentRecords.setIncidentType(pageData.getString("incidentType"));
|
||||
accidentRecords.setIncidentLevel(pageData.getString("incidentLevel"));
|
||||
accidentRecords.setLocation(pageData.getString("location"));
|
||||
accidentRecords.setFatalities(Convert.toInt(pageData.get("fatalities")));
|
||||
|
||||
DateTime time = DateUtil.parse(pageData.getString("incidentDate"), "yyyy-MM-dd HH:mm:ss");
|
||||
accidentRecords.setIncidentDate(time);
|
||||
DateTime time1 = DateUtil.parse(pageData.getString("incidentDate"), "yyyy-MM-dd HH:mm:ss");
|
||||
accidentRecords.setReportDate(time1);
|
||||
|
||||
accidentRecords.setDirectLoss(Convert.toInt(pageData.get("directLoss")));
|
||||
accidentRecords.setInjured(Convert.toInt(pageData.get("injured")));
|
||||
accidentRecords.setSeriouslyInjured(Convert.toInt(pageData.get("seriouslyInjured")));
|
||||
accidentRecords.setCause(pageData.getString("cause"));
|
||||
accidentRecords.setSummary(pageData.getString("summary"));
|
||||
accidentRecords.setAnalysis(pageData.getString("analysis"));
|
||||
accidentRecords.setSuggestions(pageData.getString("suggestions"));
|
||||
accidentRecords.setMeasures(pageData.getString("measures"));
|
||||
accidentRecords.setCreator(pageData.getString("creator"));
|
||||
accidentRecords.setPhotos(pageData.getString("photos"));
|
||||
accidentRecords.setCreatedTime(new Date());
|
||||
Assert.isTrue(accidentRecordsMapper.save(accidentRecords) == 1, "新增事故记录失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(PageData pageData) {
|
||||
AccidentRecords accidentRecords = new AccidentRecords();
|
||||
accidentRecords.setIncidentNumber(pageData.getString("incidentNumber"));
|
||||
accidentRecords.setId(pageData.getString("id"));
|
||||
accidentRecords.setIncidentName(pageData.getString("incidentName"));
|
||||
accidentRecords.setIncidentType(pageData.getString("incidentType"));
|
||||
accidentRecords.setIncidentLevel(pageData.getString("incidentLevel"));
|
||||
accidentRecords.setLocation(pageData.getString("location"));
|
||||
accidentRecords.setFatalities(Convert.toInt(pageData.get("fatalities")));
|
||||
|
||||
DateTime time = DateUtil.parse(pageData.getString("incidentDate"), "yyyy-MM-dd HH:mm:ss");
|
||||
accidentRecords.setIncidentDate(time);
|
||||
DateTime time1 = DateUtil.parse(pageData.getString("incidentDate"), "yyyy-MM-dd HH:mm:ss");
|
||||
accidentRecords.setReportDate(time1);
|
||||
|
||||
accidentRecords.setDirectLoss(Convert.toInt(pageData.get("directLoss")));
|
||||
accidentRecords.setInjured(Convert.toInt(pageData.get("injured")));
|
||||
accidentRecords.setSeriouslyInjured(Convert.toInt(pageData.get("seriouslyInjured")));
|
||||
accidentRecords.setCause(pageData.getString("cause"));
|
||||
accidentRecords.setSummary(pageData.getString("summary"));
|
||||
accidentRecords.setAnalysis(pageData.getString("analysis"));
|
||||
accidentRecords.setSuggestions(pageData.getString("suggestions"));
|
||||
accidentRecords.setMeasures(pageData.getString("measures"));
|
||||
accidentRecords.setCreator(pageData.getString("creator"));
|
||||
accidentRecords.setPhotos(pageData.getString("creator"));
|
||||
public void update(AccidentRecords accidentRecords) {
|
||||
accidentRecords.setUpdatedBy(Jurisdiction.getUsername());
|
||||
accidentRecords.setUpdatedTime(new Date());
|
||||
accidentRecords.setPhotos(pageData.getString("photos") == null ? null : pageData.getString("photos"));
|
||||
// 不支持修改类型
|
||||
accidentRecords.setType(null);
|
||||
String corpinfoId = StrUtil.isEmpty(accidentRecords.getCorpinfoId()) ? Jurisdiction.getCORPINFO_ID() : accidentRecords.getCorpinfoId();
|
||||
accidentRecords.setCorpinfoId(corpinfoId);
|
||||
Assert.isTrue(accidentRecordsMapper.updateById(accidentRecords) == 1, "更新事故记录失败");
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package com.zcloud.service.bus.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.bus.CorpInfoMapper;
|
||||
import com.zcloud.service.bus.CorpInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:企业管理
|
||||
|
@ -83,7 +84,7 @@ public class CorpInfoServiceImpl implements CorpInfoService{
|
|||
*/
|
||||
public PageData findById(PageData pd)throws Exception{
|
||||
PageData byId = corpinfoMapper.findById(pd);
|
||||
if (byId.get("FOURTYPE") != null) {
|
||||
if (byId != null && byId.get("FOURTYPE") != null) {
|
||||
String fourtype = byId.get("FOURTYPE").toString();
|
||||
byId.put("FOURTYPE", fourtype);
|
||||
}
|
||||
|
|
|
@ -11,158 +11,193 @@ import java.util.List;
|
|||
* 时间:2022-06-08
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface SafetyEnvironmentalService{
|
||||
List<PageData> getHiddenCountByDepat (PageData pd) throws Exception;
|
||||
List<PageData> getHiddenCountByUser (PageData pd) throws Exception;
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> save(PageData pd)throws Exception;
|
||||
public interface SafetyEnvironmentalService {
|
||||
List<PageData> getHiddenCountByDepat(PageData pd) throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
List<PageData> getHiddenCountByUser(PageData pd) throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> edit(PageData pd)throws Exception;
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> save(PageData pd) throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edieditsttust(PageData pd)throws Exception; //执行考评方法时,将检查状态改成已归档,因为bug6535提出,要是隐患考评完毕,状态应该是8已归档
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd) throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> edit(PageData pd) throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edieditsttust(PageData pd) throws Exception; //执行考评方法时,将检查状态改成已归档,因为bug6535提出,要是隐患考评完毕,状态应该是8已归档
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> findByyin(PageData pd)throws Exception;
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page 分页数据和条件
|
||||
* @throws Exception 可能存在的异常
|
||||
*/
|
||||
List<PageData> list(Page page) throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(PageData pd)throws Exception;
|
||||
/**
|
||||
* 列表(全部)
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd) throws Exception;
|
||||
|
||||
/**列表(根据所选ID获取数据)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> findByIds(PageData pd)throws Exception;
|
||||
/**
|
||||
* 列表(全部)
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> findByyin(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 更新检查进度状态
|
||||
* @param pd
|
||||
*/
|
||||
void editStatus(PageData pd)throws Exception;
|
||||
/**
|
||||
* 通过id获取数据
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd) throws Exception;
|
||||
|
||||
PageData findShowById(PageData pd)throws Exception;
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取检查所有相关信息
|
||||
* @param pd
|
||||
* @return
|
||||
*/
|
||||
PageData findFormById(PageData pd)throws Exception;
|
||||
/**
|
||||
* 列表(根据所选ID获取数据)
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> findByIds(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 申辩不成立时归档
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void explain(PageData pd)throws Exception;
|
||||
/**
|
||||
* 更新检查进度状态
|
||||
*
|
||||
* @param pd
|
||||
*/
|
||||
void editStatus(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 分公司安全环保检查考核分数统计
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData statisticsBranch(PageData pd)throws Exception;
|
||||
PageData findShowById(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 列表(股份公司安全环保检查考核分数统计)
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> statisticsJointStock(PageData pd) throws Exception;
|
||||
/**
|
||||
* 获取检查所有相关信息
|
||||
*
|
||||
* @param pd
|
||||
* @return
|
||||
*/
|
||||
PageData findFormById(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 被检查人签字/申辩数
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData checkedCount (PageData pd)throws Exception;
|
||||
/**
|
||||
* 申辩不成立时归档
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void explain(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 打回数
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData repulseCount (PageData pd)throws Exception;
|
||||
/**
|
||||
* 分公司安全环保检查考核分数统计
|
||||
*
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData statisticsBranch(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* 指派+验收数
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData repulseAndCheckCountCount (PageData pd)throws Exception;
|
||||
/**
|
||||
* 列表(股份公司安全环保检查考核分数统计)
|
||||
*
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> statisticsJointStock(PageData pd) throws Exception;
|
||||
|
||||
List<PageData> pleadList(Page page) throws Exception;
|
||||
/**
|
||||
* 被检查人签字/申辩数
|
||||
*
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData checkedCount(PageData pd) throws Exception;
|
||||
|
||||
List<PageData> checkList(Page page) ;
|
||||
/**
|
||||
* 打回数
|
||||
*
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData repulseCount(PageData pd) throws Exception;
|
||||
|
||||
/**
|
||||
* description: 公司层级工具类
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData departmentUtil(PageData data) throws Exception;
|
||||
/**
|
||||
* 获取所有的安全环保信息
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> statisticsBranchGroupDept(PageData pd) throws Exception;
|
||||
/**
|
||||
* 指派+验收数
|
||||
*
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData repulseAndCheckCountCount(PageData pd) throws Exception;
|
||||
|
||||
String getHiddenTotal(Page page);
|
||||
/**
|
||||
* 指派+验收数 验收数据错误,原来可以查询已经验收数据
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData repulseAndCheckCountCountV2 (PageData pd)throws Exception;
|
||||
List<PageData> pleadList(Page page) throws Exception;
|
||||
|
||||
List<PageData> checkList(Page page);
|
||||
|
||||
/**
|
||||
* description: 公司层级工具类
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData departmentUtil(PageData data) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取所有的安全环保信息
|
||||
*
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> statisticsBranchGroupDept(PageData pd) throws Exception;
|
||||
|
||||
String getHiddenTotal(Page page);
|
||||
|
||||
/**
|
||||
* 指派+验收数 验收数据错误,原来可以查询已经验收数据
|
||||
*
|
||||
* @param pd
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData repulseAndCheckCountCountV2(PageData pd) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -466,9 +466,11 @@ public class SafetyEnvironmentalServiceImpl implements SafetyEnvironmentalServic
|
|||
return hiddenList;
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page 分页数据和条件
|
||||
* @throws Exception 可能存在的异常
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception{
|
||||
return safetyenvironmentalMapper.datalistPage(page);
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package com.zcloud.service.messages;
|
||||
|
||||
import com.zcloud.entity.messages.PushRecords;
|
||||
|
||||
public interface MessagesService {
|
||||
|
||||
void push(PushRecords pushRecords) throws Exception;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.zcloud.service.messages;
|
||||
|
||||
import com.zcloud.entity.messages.PushRecords;
|
||||
|
||||
/**
|
||||
* 发送消息接口
|
||||
*/
|
||||
public interface PushMessages {
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
*
|
||||
* @param pushRecords 消息实体
|
||||
* @param userId 用户id
|
||||
*/
|
||||
void push(PushRecords pushRecords, String userId) throws Exception;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.zcloud.service.messages.impl;
|
||||
|
||||
import com.zcloud.entity.messages.PushRecords;
|
||||
import com.zcloud.service.messages.PushMessages;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 发送站内信
|
||||
*/
|
||||
@Component("messages3")
|
||||
@AllArgsConstructor
|
||||
public class AllMessagesImpl implements PushMessages {
|
||||
|
||||
private final InsideMessagesImpl insideMessages;
|
||||
private final SmsMessagesImpl smsMessages;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void push(PushRecords pushRecords, String userId) throws Exception {
|
||||
insideMessages.push(pushRecords, userId);
|
||||
smsMessages.push(pushRecords, userId);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.zcloud.service.messages.impl;
|
||||
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.entity.messages.PushRecords;
|
||||
import com.zcloud.service.bus.NoticeCorpService;
|
||||
import com.zcloud.service.messages.PushMessages;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 发送站内信
|
||||
*/
|
||||
@Component("messages2")
|
||||
@AllArgsConstructor
|
||||
public class InsideMessagesImpl implements PushMessages {
|
||||
|
||||
private final NoticeCorpService noticeCorpService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void push(PushRecords pushRecords, String userId) throws Exception {
|
||||
PageData mes = new PageData();
|
||||
mes.put("BIANMA", "PUSH_RECORDS");
|
||||
mes.put("SENDER_ID", "九公司应急管理");
|
||||
mes.put("SENDER_NAME", "九公司应急管理");
|
||||
mes.put("SYNOPSIS", pushRecords.getMessageTitle());
|
||||
mes.put("CORPINFO_ID", "48a8ca9815814c979814ddcf041c5cd5");
|
||||
mes.put("RECEIVER_ID", userId);
|
||||
PageData content = new PageData();
|
||||
content.put("msg", pushRecords.getMessageContent());
|
||||
mes.put("CONTENT", content);// 站内信内容
|
||||
noticeCorpService.sendNotice(mes);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.zcloud.service.messages.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zcloud.entity.messages.PushRecords;
|
||||
import com.zcloud.mapper.datasource.messages.MessagesMapper;
|
||||
import com.zcloud.service.messages.MessagesService;
|
||||
import com.zcloud.service.messages.PushMessages;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.UuidUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MessagesServiceImpl implements MessagesService {
|
||||
|
||||
private final MessagesMapper mapper;
|
||||
private final Map<String, PushMessages> messages;
|
||||
|
||||
@Override
|
||||
public void push(PushRecords pushRecords) throws Exception {
|
||||
// 先记录数据
|
||||
pushRecords.setId(UuidUtil.get32UUID());
|
||||
pushRecords.setSendTime(DateUtil.getTime());
|
||||
pushRecords.setState(1);
|
||||
mapper.install(pushRecords);
|
||||
// 根据手机号查找用户id
|
||||
String userId = mapper.findUserIdByPhone(pushRecords.getPhone());
|
||||
if (StrUtil.isEmpty(userId)) {
|
||||
throw new RuntimeException("该用户不存在");
|
||||
}
|
||||
// 调用对应消息推送实现
|
||||
Integer type = pushRecords.getMessageType();
|
||||
PushMessages pushMessages = messages.get("messages" + type);
|
||||
pushMessages.push(pushRecords, userId);
|
||||
// 修改状态
|
||||
pushRecords.setState(2);
|
||||
mapper.updateById(pushRecords);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.service.messages.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zcloud.entity.messages.PushRecords;
|
||||
import com.zcloud.service.messages.PushMessages;
|
||||
import com.zcloud.util.SendSmsUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
*/
|
||||
@Component("messages1")
|
||||
@AllArgsConstructor
|
||||
public class SmsMessagesImpl implements PushMessages {
|
||||
|
||||
@Override
|
||||
public void push(PushRecords pushRecords, String userId) throws ParseException {
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("messageContent", pushRecords.getMessageContent());
|
||||
// todo 应该是短信模版tpId 没有 别的OK了
|
||||
if (!SendSmsUtil.sendSms(null, object, pushRecords.getSendTime(), pushRecords.getPhone())) {
|
||||
throw new RuntimeException("系统故障:短信发送失败");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,6 @@ import com.zcloud.entity.Page;
|
|||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.mkmj.MkmjAreaGateMapper;
|
||||
import com.zcloud.mapper.datasource.mkmj.MkmjAreaMapper;
|
||||
import com.zcloud.service.map.util.ReturnMap;
|
||||
import com.zcloud.service.mkmj.MkmjAreaService;
|
||||
import com.zcloud.util.UuidUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -60,7 +59,7 @@ public class MkmjAreaServiceImpl implements MkmjAreaService {
|
|||
* @throws Exception
|
||||
*/
|
||||
public Object delete(PageData pd)throws Exception{
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
String errInfo = "success";
|
||||
//校验区域下是否还存在区域 存在则不让删除
|
||||
List<PageData> childList = mkmjAreaMapper.findByChild(pd);
|
||||
|
|
|
@ -117,9 +117,33 @@ public class AliSmsToolUtil {
|
|||
//发短信
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
map.put("infoDetail", "阿斯顿发");
|
||||
map.put("phone", "18630363710");
|
||||
map.put("phone", "18630387571");
|
||||
map.put("infoType", "阿三地方");
|
||||
map.put("templateCode", "SMS_227260789");
|
||||
List<PageData> paramsList = new ArrayList<PageData>();
|
||||
PageData params1 = new PageData();
|
||||
// 第1个参数
|
||||
params1.put("name", "number");// 存入短信模板中的参数名称
|
||||
params1.put("value", 2);// 存入上面参数名称所传递的值
|
||||
paramsList.add(params1);
|
||||
|
||||
PageData params2 = new PageData();
|
||||
// 第2个参数
|
||||
params2.put("name", "params1");// 存入短信模板中的参数名称
|
||||
params2.put("value", "盲板作业");// 存入上面参数名称所传递的值
|
||||
paramsList.add(params2);
|
||||
|
||||
PageData params3 = new PageData();
|
||||
// 第3个参数
|
||||
params3.put("name", "params2");// 存入短信模板中的参数名称
|
||||
params3.put("value", "生产部门意见");// 存入上面参数名称所传递的值
|
||||
paramsList.add(params3);
|
||||
|
||||
PageData params4 = new PageData();
|
||||
// 第4个参数
|
||||
params4.put("name", "params3");// 存入短信模板中的参数名称
|
||||
params4.put("value", "审核");// 存入上面参数名称所传递的值
|
||||
paramsList.add(params4);
|
||||
SendSmsResponse response = sendSms(map,paramsList);
|
||||
System.out.println("短信接口返回的数据----------------");
|
||||
System.out.println("Code=" + response.getCode());
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package com.zcloud.util;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
|
@ -14,6 +18,7 @@ import java.util.Date;
|
|||
/**
|
||||
* 重点工程发送短信工具类
|
||||
*/
|
||||
@Slf4j
|
||||
public class SendSmsUtil {
|
||||
|
||||
private static String USERNAME = "qhdzyhy";
|
||||
|
@ -27,43 +32,44 @@ public class SendSmsUtil {
|
|||
|
||||
/**
|
||||
* 发送短信
|
||||
*
|
||||
* @param records
|
||||
* @param time 发送时间 为空或小于当前时间则立即发送
|
||||
* records格式实例 records是 JSONArray 里边的内容通过调用下方方法getRecords获取 JSONObject 定义一个JSONArray后 put进去即可
|
||||
* "records":[
|
||||
* {
|
||||
* "mobile":"138****0000",
|
||||
* "tpContent":{
|
||||
* "var1":"变量1",
|
||||
* "var2":"变量2"
|
||||
* }
|
||||
* },
|
||||
* {
|
||||
* "mobile":"138****0001",
|
||||
* "tpContent":{
|
||||
* "var1":"变量2",
|
||||
* "var2":"变量2"
|
||||
* }
|
||||
* }
|
||||
* ]
|
||||
* @param time 发送时间 为空或小于当前时间则立即发送
|
||||
* records格式实例 records是 JSONArray 里边的内容通过调用下方方法getRecords获取 JSONObject 定义一个JSONArray后 put进去即可
|
||||
* "records":[
|
||||
* {
|
||||
* "mobile":"138****0000",
|
||||
* "tpContent":{
|
||||
* "var1":"变量1",
|
||||
* "var2":"变量2"
|
||||
* }
|
||||
* },
|
||||
* {
|
||||
* "mobile":"138****0001",
|
||||
* "tpContent":{
|
||||
* "var1":"变量2",
|
||||
* "var2":"变量2"
|
||||
* }
|
||||
* }
|
||||
* ]
|
||||
*/
|
||||
public static void sendSms(String tpId,JSONArray records ,String time) throws ParseException {
|
||||
public static void sendSms(String tpId, JSONArray records, String time) throws ParseException {
|
||||
JSONObject json = new JSONObject();
|
||||
Long tKey = System.currentTimeMillis()/1000;
|
||||
String passWord = MD5.md5(PASSWORD+tKey);
|
||||
Long tKey = System.currentTimeMillis() / 1000;
|
||||
String passWord = MD5.md5(PASSWORD + tKey);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
//扔参数
|
||||
json.put("username",USERNAME);
|
||||
json.put("password",passWord);
|
||||
json.put("tKey",tKey);
|
||||
json.put("signature",SIGNATURE);
|
||||
json.put("tpId",tpId);
|
||||
if(StringUtils.isNotBlank(time)){
|
||||
if(sdf.parse(time).after(new Date())){
|
||||
json.put("time",time);
|
||||
json.put("username", USERNAME);
|
||||
json.put("password", passWord);
|
||||
json.put("tKey", tKey);
|
||||
json.put("signature", SIGNATURE);
|
||||
json.put("tpId", tpId);
|
||||
if (StringUtils.isNotBlank(time)) {
|
||||
if (sdf.parse(time).after(new Date())) {
|
||||
json.put("time", time);
|
||||
}
|
||||
}
|
||||
json.put("records",records);
|
||||
json.put("records", records);
|
||||
System.out.println(json.toJSONString());
|
||||
String result = HttpRequest.post(URL)
|
||||
.timeout(60000)
|
||||
|
@ -71,45 +77,64 @@ public class SendSmsUtil {
|
|||
System.out.println(result);
|
||||
}
|
||||
|
||||
// {"msg":"template error","tpId":"null","code":4014,"msgId":"172950016144709288961"}
|
||||
// {"msg":"success","tpId":"121487","code":200,"msgId":"172950025828957168641","invalidList":[]}
|
||||
public static boolean sendSms(String tpId, JSONObject records, String time, String phone) throws ParseException {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("username", USERNAME);
|
||||
json.put("tKey", System.currentTimeMillis() / 1000);
|
||||
json.put("password", MD5.md5(PASSWORD + json.getLong("tKey")));
|
||||
json.put("signature", SIGNATURE);
|
||||
json.put("tpId", tpId);
|
||||
if (StringUtils.isNotBlank(time) && DateUtil.parseDateTime(time).after(new Date())) {
|
||||
json.put("time", time);
|
||||
}
|
||||
JSONArray array = new JSONArray();
|
||||
array.add(getRecords(phone, records));
|
||||
json.put("records", array);
|
||||
HttpRequest request = HttpRequest.post(URL)
|
||||
.timeout(60000)
|
||||
.body(json.toJSONString(), MediaType.APPLICATION_JSON_UTF8_VALUE);
|
||||
try (HttpResponse response = request.execute()) {
|
||||
return JSON.parseObject(response.body()).getInteger("code") == 200;
|
||||
} catch (Exception e) {
|
||||
log.error("发送短信异常", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 封装要发送的电话以及要替换的内容
|
||||
* @param mobile 手机号
|
||||
*
|
||||
* @param mobile 手机号
|
||||
* @param tpContent 替换内容
|
||||
* @return
|
||||
* 格式实例 var1表示要替换的内容 与要替换的内容保持一致即可 变量1表示替换的内容
|
||||
* {
|
||||
* "mobile":"138****0000",
|
||||
* "tpContent":{
|
||||
* "var1":"变量1",
|
||||
* "var2":"变量2"
|
||||
* }
|
||||
* }
|
||||
* @return 格式实例 var1表示要替换的内容 与要替换的内容保持一致即可 变量1表示替换的内容
|
||||
* {
|
||||
* "mobile":"138****0000",
|
||||
* "tpContent":{
|
||||
* "var1":"变量1",
|
||||
* "var2":"变量2"
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
public static JSONObject getRecords(String mobile, JSONObject tpContent ){
|
||||
public static JSONObject getRecords(String mobile, JSONObject tpContent) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("mobile",mobile);
|
||||
if(ObjectUtils.hashCode(tpContent)!=0){
|
||||
json.put("tpContent",tpContent);
|
||||
json.put("mobile", mobile);
|
||||
if (ObjectUtils.hashCode(tpContent) != 0) {
|
||||
json.put("tpContent", tpContent);
|
||||
}
|
||||
return json;
|
||||
|
||||
}//d22f8a5d4a35b3761dc9525186e652a0
|
||||
|
||||
//测试接口
|
||||
public static void main(String[] args) throws ParseException {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
|
||||
//接受返回结果
|
||||
JSONObject records = new JSONObject();
|
||||
//定义替换参数
|
||||
//JSONObject tpContent = new JSONObject();
|
||||
//tpContent.put("userName","卓云企业");
|
||||
//tpContent.put("time","2023-09-21 15:56:20");
|
||||
//records = getRecords("18617456701",tpContent);
|
||||
jsonArray.add(records);
|
||||
|
||||
sendSms("null",jsonArray,null);
|
||||
}
|
||||
// public static void main(String[] args) throws ParseException {
|
||||
// //定义替换参数
|
||||
// JSONObject tpContent = new JSONObject();
|
||||
// tpContent.put("HIDDENDESCR", "卓云企业测试");
|
||||
// JSONObject object = sendSms("121487", tpContent, DateUtil.formatDateTime(new Date()), "18630387571");
|
||||
// System.out.println(object.toJSONString());
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ smb.basePath=/mnt/wwag/file/
|
|||
#Mq\u914D\u7F6E
|
||||
rocketmq.consumer.group2=edu-admin-edit
|
||||
rocketmq.consumer.group1=edu-admin-add
|
||||
rocketmq.name-server=172.24.151.22:9876
|
||||
rocketmq.name-server=127.0.0.1:9876
|
||||
rocketmq.producer.group=libmiddle
|
||||
rocketmq.producer.send-message-timeout=3000
|
||||
rocketmq.producer.compress-message-body-threshold=4096
|
||||
|
@ -106,6 +106,7 @@ perLoc.url=http://192.168.210.32:8084
|
|||
perLoc.userName=qaaqadmin
|
||||
perLoc.pwd=Cfd2023@
|
||||
baseimgpath =http://192.168.192.201:8991/file/
|
||||
tongbu.url=http://127.0.0.1:9006/qa-prevention-gwj-tongbu/
|
||||
|
||||
mq.csy.data.topic=csy_docking
|
||||
mq.csy.data.group=scheduled_tasks_csy_docking
|
||||
|
@ -144,10 +145,9 @@ gongJiangXueYuanProdUrl=https://gjxy.bjttsx.com
|
|||
gongJiangXueYuanGetImgUrl=https://wwag.qhdsafety.com/file/
|
||||
|
||||
# \u4E2D\u53F0
|
||||
tongbu.url=http://127.0.0.1:8094
|
||||
# \u6D88\u8D39\u4E2D\u53F0\u901A\u77E5
|
||||
mq.consumer.dataChange.tongbu-data-change.topic=tongbu_dataChange_docking
|
||||
mq.consumer.dataChange.tongbu-data-change.group=tongbu_dataChange_group
|
||||
|
||||
# \u672C\u5730\u6570\u636E\u4FEE\u6539\u540E\u5411\u8FD9\u4E2Atopic\u63A8\u9001\uFF08\u6240\u6709\u7C7B\u578B\u540C\u6B65\u6570\u636E\u516C\u7528\uFF09
|
||||
mq.producer.dataChange.slice-data-change.topic=slice_dataChange_docking
|
||||
mq.producer.dataChange.slice-data-change.topic=slice_dataChange_docking
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
<mapper namespace="com.zcloud.mapper.datasource.accident.AccidentRecordsMapper">
|
||||
|
||||
<select id="listPage" parameterType="com.zcloud.entity.Page" resultType="pd">
|
||||
select ACCIDENT_ID as id, CORP_NAME as companyName, LOCATION as 'location', INCIDENT_DATE as 'incidentDate', INCIDENT_NAME as 'incidentName'
|
||||
select ACCIDENT_ID as id, CORP_NAME as companyName, LOCATION as 'location', INCIDENT_DATE as 'incidentDate', INCIDENT_NAME as 'incidentName',
|
||||
ATTACHMENT_ADDRESS as attachmentAddress
|
||||
from bus_accident as ar
|
||||
left join bus_corp_info as bci on ar.CORPINFO_ID = bci.CORPINFO_ID
|
||||
<where>
|
||||
|
@ -25,6 +26,9 @@
|
|||
<if test="pd.incidentType != null and pd.incidentType != ''">
|
||||
and INCIDENT_TYPE = #{pd.incidentType}
|
||||
</if>
|
||||
<if test="pd.type != null and pd.type != ''">
|
||||
and TYPE = #{pd.type}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
and IS_DELETED = 0
|
||||
</if>
|
||||
|
@ -52,6 +56,8 @@
|
|||
ANALYSIS as analysis,
|
||||
SUGGESTIONS as suggestions,
|
||||
MEASURES as measures,
|
||||
TYPE as type,
|
||||
ATTACHMENT_ADDRESS as attachmentAddress,
|
||||
ar.CREATOR as creator,
|
||||
REPORT_DATE as reportDate
|
||||
from bus_accident as ar
|
||||
|
@ -139,7 +145,13 @@
|
|||
UPDATED_TIME,
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
IS_DELETED
|
||||
IS_DELETED,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
TYPE,
|
||||
</if>
|
||||
<if test="attachmentAddress != null">
|
||||
ATTACHMENT_ADDRESS,
|
||||
</if>
|
||||
</trim>
|
||||
values
|
||||
|
@ -220,7 +232,13 @@
|
|||
#{updatedTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
#{isDeleted}
|
||||
#{isDeleted},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type},
|
||||
</if>
|
||||
<if test="attachmentAddress != null">
|
||||
#{attachmentAddress},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
@ -228,31 +246,33 @@
|
|||
<update id="updateById" parameterType="com.zcloud.entity.accident.AccidentRecords">
|
||||
UPDATE bus_accident
|
||||
<set>
|
||||
<if test="incidentNumber != null">incident_number = #{incidentNumber},</if>
|
||||
<if test="incidentName != null">incident_name = #{incidentName},</if>
|
||||
<if test="incidentType != null">incident_type = #{incidentType},</if>
|
||||
<if test="corpinfoId != null">corpinfo_id = #{corpinfoId},</if>
|
||||
<if test="incidentLevel != null">incident_level = #{incidentLevel},</if>
|
||||
<if test="incidentNature != null">incident_nature = #{incidentNature},</if>
|
||||
<if test="location != null">location = #{location},</if>
|
||||
<if test="incidentDate != null">incident_date = #{incidentDate},</if>
|
||||
<if test="directLoss != null">direct_loss = #{directLoss},</if>
|
||||
<if test="injured != null">injured = #{injured},</if>
|
||||
<if test="fatalities != null">fatalities = #{fatalities},</if>
|
||||
<if test="seriouslyInjured != null">seriously_injured = #{seriouslyInjured},</if>
|
||||
<if test="cause != null">cause = #{cause},</if>
|
||||
<if test="summary != null">summary = #{summary},</if>
|
||||
<if test="photos != null">photos = #{photos},</if>
|
||||
<if test="analysis != null">analysis = #{analysis},</if>
|
||||
<if test="suggestions != null">suggestions = #{suggestions},</if>
|
||||
<if test="measures != null">measures = #{measures},</if>
|
||||
<if test="creator != null">creator = #{creator},</if>
|
||||
<if test="reportDate != null">report_date = #{reportDate},</if>
|
||||
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||||
<if test="createdTime != null">created_time = #{createdTime},</if>
|
||||
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
||||
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
||||
<if test="isDeleted != null">is_deleted = #{isDeleted}</if>
|
||||
<if test="incidentNumber != null">INCIDENT_NUMBER = #{incidentNumber},</if>
|
||||
<if test="incidentName != null">INCIDENT_NAME = #{incidentName},</if>
|
||||
<if test="incidentType != null">INCIDENT_TYPE = #{incidentType},</if>
|
||||
<if test="corpinfoId != null">CORPINFO_ID = #{corpinfoId},</if>
|
||||
<if test="incidentLevel != null">INCIDENT_LEVEL = #{incidentLevel},</if>
|
||||
<if test="incidentNature != null">INCIDENT_NATURE = #{incidentNature},</if>
|
||||
<if test="location != null">LOCATION = #{location},</if>
|
||||
<if test="incidentDate != null">INCIDENT_DATE = #{incidentDate},</if>
|
||||
<if test="directLoss != null">DIRECT_LOSS = #{directLoss},</if>
|
||||
<if test="injured != null">INJURED = #{injured},</if>
|
||||
<if test="fatalities != null">FATALITIES = #{fatalities},</if>
|
||||
<if test="seriouslyInjured != null">SERIOUSLY_INJURED = #{seriouslyInjured},</if>
|
||||
<if test="cause != null">CAUSE = #{cause},</if>
|
||||
<if test="summary != null">SUMMARY = #{summary},</if>
|
||||
<if test="photos != null">PHOTOS = #{photos},</if>
|
||||
<if test="analysis != null">ANALYSIS = #{analysis},</if>
|
||||
<if test="suggestions != null">SUGGESTIONS = #{suggestions},</if>
|
||||
<if test="measures != null">MEASURES = #{measures},</if>
|
||||
<if test="creator != null">CREATOR = #{creator},</if>
|
||||
<if test="reportDate != null">REPORT_DATE = #{reportDate},</if>
|
||||
<if test="createdBy != null">CREATED_BY = #{createdBy},</if>
|
||||
<if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
|
||||
<if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
|
||||
<if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
|
||||
<if test="isDeleted != null">IS_DELETED = #{isDeleted},</if>
|
||||
<if test="attachmentAddress != null">ATTACHMENT_ADDRESS = #{attachmentAddress},</if>
|
||||
<if test="type != null">TYPE = #{type}</if>
|
||||
</set>
|
||||
WHERE accident_id = #{id} and is_deleted = 0
|
||||
</update>
|
||||
|
@ -316,6 +336,9 @@
|
|||
<if test="1 == 1">
|
||||
and is_deleted = 0
|
||||
</if>
|
||||
<if test="pd.type != null and pd.type != ''">
|
||||
and TYPE = #{pd.type}
|
||||
</if>
|
||||
</where>
|
||||
order by incident_date desc, companyName
|
||||
</select>
|
||||
|
|
|
@ -1237,7 +1237,8 @@
|
|||
)
|
||||
</if> -->
|
||||
<if test="SELFUSERID != null and SELFUSERID != ''">
|
||||
and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=f.HIDDEN_ID )>0
|
||||
and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID}
|
||||
and bh.HIDDEN_ID=f.HIDDEN_ID )>0
|
||||
</if>
|
||||
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
||||
and f.CORPINFO_ID =#{CORPINFO_ID}
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
TYPE,
|
||||
FOREIGN_KEY,
|
||||
FILE_NAME,
|
||||
IMGFILES_ID
|
||||
IMGFILES_ID,
|
||||
MD5
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
|
@ -36,7 +37,8 @@
|
|||
#{TYPE},
|
||||
#{FOREIGN_KEY},
|
||||
#{FILE_NAME},
|
||||
#{IMGFILES_ID}
|
||||
#{IMGFILES_ID},
|
||||
#{MD5}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
|
||||
<!-- 列表 -->
|
||||
<select id="listByUserId" parameterType="page" resultType="pd">
|
||||
SELECT
|
||||
SELECT
|
||||
c.*,u.TYPE
|
||||
FROM
|
||||
bus_noticecorpuserid u
|
||||
|
|
|
@ -120,79 +120,96 @@
|
|||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
iou.NAME INSPECTION_ORIGINATOR_NAME,
|
||||
iod.NAME INSPECTION_DEPARTMENT_NAME,
|
||||
isd.NAME INSPECTED_DEPARTMENT_NAME,
|
||||
isu.NAME INSPECTED_SITEUSER_NAME,
|
||||
IFNULL(GROUP_CONCAT(REPLACE(siu.NAME,'/',',')),'') AS INSPECTION_USER_NAME,
|
||||
CASE WHEN IFNULL(se.INSPECTION_TYPE_OTHER, '') = '' THEN d.NAME ELSE se.INSPECTION_TYPE_OTHER END INSPECTION_TYPE_NAME,
|
||||
se.INSPECTION_TIME_START,
|
||||
se.INSPECTION_TIME_END,
|
||||
se.INSPECTION_STATUS,
|
||||
se.INSPECTION_SUBJECT,
|
||||
se.INSPECTED_EXPLAIN,
|
||||
se.INSPECTED_EXPLAIN_FILENAME,
|
||||
se.INSPECTED_EXPLAIN_FILEPATH,
|
||||
se.INSPECTED_SITEUSER_SIGN_IMG,
|
||||
se.INSPECTED_SITEUSER_SIGN_TIME,
|
||||
se.INSPECTION_ID,
|
||||
se.INSPECTED_SITEUSER_ID,
|
||||
se.INSPECTED_DEPARTMENT_ID
|
||||
from BUS_INSPECTION_SAFETYENVIRONMENTAL se
|
||||
LEFT JOIN VI_USER_ALL iou ON iou.USER_ID = se.INSPECTION_ORIGINATOR_ID
|
||||
LEFT JOIN VI_DEPARTMENT_ALL iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID
|
||||
LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = se.INSPECTED_DEPARTMENT_ID
|
||||
LEFT JOIN SYS_USER isu ON isu.USER_ID = se.INSPECTED_SITEUSER_ID
|
||||
LEFT JOIN bus_inspection_safetyenvironmental_inspector si ON si.INSPECTION_ID = se.INSPECTION_ID and si.ISDELETE = '0'
|
||||
LEFT JOIN vi_user_all siu ON siu.USER_ID = si.INSPECTION_USER_ID
|
||||
LEFT JOIN sys_dictionaries d ON d.BIANMA = se.INSPECTION_TYPE
|
||||
where se.ISDELETE = '0' and se.INSPECTION_STATUS = '2'
|
||||
<if test="pd.roleLevel != null and pd.roleLevel != ''"><!-- 权限显示 -->
|
||||
<choose>
|
||||
<when test='pd.roleLevel == "0"'>
|
||||
</when>
|
||||
<when test='pd.roleLevel =="1"'>
|
||||
and siu.DEPARTMENT_ID in (${pd.supDeparIds}) or se.INSPECTED_DEPARTMENT_ID in (${pd.supDeparIds})
|
||||
</when>
|
||||
<when test='pd.roleLevel =="2"'>
|
||||
and siu.USER_ID in (#{pd.loginUserId}) or se.INSPECTED_SITEUSER_ID in (#{pd.loginUserId})
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test='pd.INSPECTED_SITEUSER_ID != null and pd.INSPECTED_SITEUSER_ID != ""'><!-- 被检查单位现场负责人 -->
|
||||
and se.INSPECTED_SITEUSER_ID = #{pd.INSPECTED_SITEUSER_ID}
|
||||
</if>
|
||||
<if test="pd.INSPECTION_SUBJECT != null and pd.INSPECTION_SUBJECT != ''"><!-- 检查题目 -->
|
||||
and se.INSPECTION_SUBJECT = #{pd.INSPECTION_SUBJECT,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="pd.INSPECTED_DEPARTMENT_NAME != null and pd.INSPECTED_DEPARTMENT_NAME != ''"><!-- 被检查单位 -->
|
||||
and isd.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTED_DEPARTMENT_NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_DEPARTMENT_NAME != null and pd.INSPECTION_DEPARTMENT_NAME != ''"><!-- 检查部门 -->
|
||||
and iod.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_DEPARTMENT_NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_ORIGINATOR_NAME != null and pd.INSPECTION_ORIGINATOR_NAME != ''"><!-- 检查发起人 -->
|
||||
and iou.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_ORIGINATOR_NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TYPE != null and pd.INSPECTION_TYPE != ''"><!-- 检查类型 -->
|
||||
and se.INSPECTION_TYPE = #{pd.INSPECTION_TYPE}
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TIME_START != null and pd.INSPECTION_TIME_START != ''"><!-- 检查时间 -->
|
||||
and se.INSPECTION_TIME_START >= CONCAT(#{pd.INSPECTION_TIME_START}, ' 00:00')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TIME_END != null and pd.INSPECTION_TIME_END != ''"><!-- 检查时间 -->
|
||||
and se.INSPECTION_TIME_END <= CONCAT(#{pd.INSPECTION_TIME_END}, ' 23:59')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_STATUS != null and pd.INSPECTION_STATUS != ''"><!-- 检查状态 -->
|
||||
and se.INSPECTION_STATUS = #{pd.INSPECTION_STATUS}
|
||||
</if>
|
||||
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
|
||||
and se.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||
</if>
|
||||
GROUP BY se.INSPECTION_ID
|
||||
ORDER BY se.CREATTIME DESC
|
||||
</select>
|
||||
select iou.NAME INSPECTION_ORIGINATOR_NAME,
|
||||
iod.NAME INSPECTION_DEPARTMENT_NAME,
|
||||
isd.NAME INSPECTED_DEPARTMENT_NAME,
|
||||
isu.NAME INSPECTED_SITEUSER_NAME,
|
||||
IFNULL(GROUP_CONCAT(REPLACE(siu.NAME, '/', ',')), '') AS INSPECTION_USER_NAME,
|
||||
CASE
|
||||
WHEN IFNULL(se.INSPECTION_TYPE_OTHER, '') = '' THEN d.NAME
|
||||
ELSE se.INSPECTION_TYPE_OTHER END INSPECTION_TYPE_NAME,
|
||||
se.INSPECTION_TIME_START,
|
||||
se.INSPECTION_TIME_END,
|
||||
se.INSPECTION_STATUS,
|
||||
se.INSPECTION_SUBJECT,
|
||||
se.INSPECTED_EXPLAIN,
|
||||
se.INSPECTED_EXPLAIN_FILENAME,
|
||||
se.INSPECTED_EXPLAIN_FILEPATH,
|
||||
se.INSPECTED_SITEUSER_SIGN_IMG,
|
||||
se.INSPECTED_SITEUSER_SIGN_TIME,
|
||||
se.INSPECTION_ID,
|
||||
se.INSPECTED_SITEUSER_ID,
|
||||
se.INSPECTED_DEPARTMENT_ID
|
||||
from BUS_INSPECTION_SAFETYENVIRONMENTAL se
|
||||
LEFT JOIN VI_USER_ALL iou ON iou.USER_ID = se.INSPECTION_ORIGINATOR_ID
|
||||
LEFT JOIN VI_DEPARTMENT_ALL iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID
|
||||
LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = se.INSPECTED_DEPARTMENT_ID
|
||||
LEFT JOIN SYS_USER isu ON isu.USER_ID = se.INSPECTED_SITEUSER_ID
|
||||
LEFT JOIN bus_inspection_safetyenvironmental_inspector si
|
||||
ON si.INSPECTION_ID = se.INSPECTION_ID and si.ISDELETE = '0'
|
||||
LEFT JOIN vi_user_all siu ON siu.USER_ID = si.INSPECTION_USER_ID
|
||||
LEFT JOIN sys_dictionaries d ON d.BIANMA = se.INSPECTION_TYPE
|
||||
where se.ISDELETE = '0' and se.INSPECTION_STATUS = '2'
|
||||
<if test="pd.roleLevel != null and pd.roleLevel != ''">
|
||||
<!-- 权限显示 -->
|
||||
<choose>
|
||||
<when test='pd.roleLevel == "0"'>
|
||||
</when>
|
||||
<when test='pd.roleLevel == "1"'>
|
||||
and siu.DEPARTMENT_ID in (${pd.supDeparIds})
|
||||
or se.INSPECTED_DEPARTMENT_ID in (${pd.supDeparIds})
|
||||
</when>
|
||||
<when test='pd.roleLevel == "2"'>
|
||||
and siu.USER_ID in (#{pd.loginUserId})
|
||||
or se.INSPECTED_SITEUSER_ID in (#{pd.loginUserId})
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
<if test='pd.INSPECTED_SITEUSER_ID != null and pd.INSPECTED_SITEUSER_ID != ""'>
|
||||
<!-- 被检查单位现场负责人 -->
|
||||
and se.INSPECTED_SITEUSER_ID = #{pd.INSPECTED_SITEUSER_ID}
|
||||
</if>
|
||||
<if test="pd.INSPECTION_SUBJECT != null and pd.INSPECTION_SUBJECT != ''">
|
||||
<!-- 检查题目 -->
|
||||
and se.INSPECTION_SUBJECT = #{pd.INSPECTION_SUBJECT,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="pd.INSPECTED_DEPARTMENT_NAME != null and pd.INSPECTED_DEPARTMENT_NAME != ''">
|
||||
<!-- 被检查单位 -->
|
||||
and isd.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTED_DEPARTMENT_NAME}), '%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_DEPARTMENT_NAME != null and pd.INSPECTION_DEPARTMENT_NAME != ''">
|
||||
<!-- 检查部门 -->
|
||||
and iod.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_DEPARTMENT_NAME}), '%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_ORIGINATOR_NAME != null and pd.INSPECTION_ORIGINATOR_NAME != ''">
|
||||
<!-- 检查发起人 -->
|
||||
and iou.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_ORIGINATOR_NAME}), '%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TYPE != null and pd.INSPECTION_TYPE != ''">
|
||||
<!-- 检查类型 -->
|
||||
and se.INSPECTION_TYPE = #{pd.INSPECTION_TYPE}
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TIME_START != null and pd.INSPECTION_TIME_START != ''">
|
||||
<!-- 检查时间 -->
|
||||
and se.INSPECTION_TIME_START >= CONCAT(#{pd.INSPECTION_TIME_START}, ' 00:00')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TIME_END != null and pd.INSPECTION_TIME_END != ''">
|
||||
<!-- 检查时间 -->
|
||||
and se.INSPECTION_TIME_END <= CONCAT(#{pd.INSPECTION_TIME_END}, ' 23:59')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_STATUS != null and pd.INSPECTION_STATUS != ''">
|
||||
<!-- 检查状态 -->
|
||||
and se.INSPECTION_STATUS = #{pd.INSPECTION_STATUS}
|
||||
</if>
|
||||
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''">
|
||||
<!-- 关键词检索 -->
|
||||
and se.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||
</if>
|
||||
GROUP BY se.INSPECTION_ID
|
||||
ORDER BY FIELD(se.INSPECTION_STATUS, '2', '1', '0', '3', '4', '5', '6', '7', '8', '-1', '-2'),
|
||||
FIELD(if(se.INSPECTED_SITEUSER_ID = #{pd.loginUserId},se.INSPECTED_SITEUSER_ID,'1'), se.INSPECTED_SITEUSER_ID, '1'),
|
||||
se.INSPECTION_TIME_START DESC
|
||||
</select>
|
||||
|
||||
<!-- 列表(全部) -->
|
||||
<select id="listAll" parameterType="pd" resultType="pd">
|
||||
|
|
|
@ -137,7 +137,7 @@
|
|||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
LEFT JOIN BUS_INSPECTION_SAFETYENVIRONMENTAL se ON se.INSPECTION_ID = f.INSPECTION_ID
|
||||
INNER JOIN BUS_INSPECTION_SAFETYENVIRONMENTAL se ON se.INSPECTION_ID = f.INSPECTION_ID
|
||||
LEFT JOIN VI_USER_ALL iou ON iou.USER_ID = se.INSPECTION_ORIGINATOR_ID
|
||||
LEFT JOIN VI_DEPARTMENT_ALL iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID
|
||||
LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = se.INSPECTED_DEPARTMENT_ID
|
||||
|
@ -194,7 +194,11 @@
|
|||
)
|
||||
</if>
|
||||
GROUP BY f.INSPECTION_ID
|
||||
ORDER BY FIELD (se.INSPECTION_STATUS , '0','1','2','3','4','5','6','7','8','-1','-2') asc, se.INSPECTION_TIME_START DESC , se.INSPECTION_TIME_END DESC
|
||||
ORDER BY
|
||||
FIELD(if(f.INSPECTION_USER_SIGN_TIME is not null,'2','1'), '1','2'),
|
||||
FIELD(if(se.INSPECTED_SITEUSER_ID = #{pd.loginUserId},#{pd.loginUserId},'1'), #{pd.loginUserId}, '1'),
|
||||
FIELD (se.INSPECTION_STATUS , '0','1','2','3','4','5','6','7','8','-1','-2') ,
|
||||
se.INSPECTION_TIME_START DESC , se.INSPECTION_TIME_END DESC
|
||||
</select>
|
||||
|
||||
<!-- 列表(全部) -->
|
||||
|
|
|
@ -240,9 +240,9 @@
|
|||
IFNULL(GROUP_CONCAT(REPLACE(siu.USER_ID,'/',',')),'') AS INSPECTION_USER_ID,
|
||||
IFNULL(GROUP_CONCAT( DISTINCT siu.NAME),'') AS INSPECTION_USER_NAME,
|
||||
CASE WHEN IFNULL(f.INSPECTION_TYPE_OTHER, '') = '' THEN d.NAME ELSE f.INSPECTION_TYPE_OTHER END INSPECTION_TYPE_NAME,
|
||||
<include refid="Field"></include>
|
||||
<include refid="Field"/>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
<include refid="tableName"/> f
|
||||
LEFT JOIN bus_hidden h on h.FOREIGN_ID = f.INSPECTION_ID and h.isdelete ='0'
|
||||
LEFT JOIN vi_user_all iou ON iou.USER_ID = f.INSPECTION_ORIGINATOR_ID
|
||||
LEFT JOIN OA_DEPARTMENT ild ON ild.DEPARTMENT_ID = f.INSPECTION_LEADDEPARTMENT_ID
|
||||
|
@ -639,80 +639,111 @@
|
|||
|
||||
<!-- 列表 -->
|
||||
<select id="checklistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
iou.NAME INSPECTION_ORIGINATOR_NAME,
|
||||
ild.NAME INSPECTION_LEADDEPARTMENT_NAME,
|
||||
iod.NAME INSPECTION_DEPARTMENT_NAME,
|
||||
isd.NAME INSPECTED_DEPARTMENT_NAME,
|
||||
isu.NAME INSPECTED_SITEUSER_NAME,
|
||||
IFNULL(GROUP_CONCAT(REPLACE(siu.USER_ID,'/',',')),'') AS INSPECTION_USER_ID,
|
||||
IFNULL(GROUP_CONCAT(REPLACE(siu.NAME,'/',',')),'') AS INSPECTION_USER_NAME,
|
||||
CASE WHEN IFNULL(f.INSPECTION_TYPE_OTHER, '') = '' THEN d.NAME ELSE f.INSPECTION_TYPE_OTHER END INSPECTION_TYPE_NAME,
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
LEFT JOIN vi_user_all iou ON iou.USER_ID = f.INSPECTION_ORIGINATOR_ID
|
||||
LEFT JOIN OA_DEPARTMENT ild ON ild.DEPARTMENT_ID = f.INSPECTION_LEADDEPARTMENT_ID
|
||||
LEFT JOIN vi_department_all iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID
|
||||
LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = f.INSPECTED_DEPARTMENT_ID
|
||||
LEFT JOIN SYS_USER isu ON isu.USER_ID = f.INSPECTED_SITEUSER_ID
|
||||
LEFT JOIN bus_inspection_safetyenvironmental_inspector si ON si.INSPECTION_ID = f.INSPECTION_ID and si.ISDELETE = '0'
|
||||
LEFT JOIN vi_user_all siu ON siu.USER_ID = si.INSPECTION_USER_ID
|
||||
LEFT JOIN sys_dictionaries d ON d.BIANMA = f.INSPECTION_TYPE
|
||||
where f.ISDELETE = '0'
|
||||
<if test="pd.INSPECTION_ORIGINATOR_ID != null and pd.INSPECTION_ORIGINATOR_ID != ''"><!-- 检查发起人 -->
|
||||
and f.INSPECTION_ORIGINATOR_ID = #{pd.INSPECTION_ORIGINATOR_ID}
|
||||
</if>
|
||||
<if test="pd.ARCHIVE_USER_ID != null and pd.ARCHIVE_USER_ID != ''">
|
||||
and (
|
||||
f.INSPECTION_ORIGINATOR_ID = #{pd.ARCHIVE_USER_ID}
|
||||
OR f.INSPECTED_SITEUSER_ID = #{pd.ARCHIVE_USER_ID}
|
||||
OR EXISTS(select 1 from bus_inspection_safetyenvironmental_inspector sii where sii.INSPECTION_USER_ID = #{pd.ARCHIVE_USER_ID}
|
||||
and sii.INSPECTION_ID = f.INSPECTION_ID)
|
||||
)
|
||||
</if>
|
||||
select iou.NAME INSPECTION_ORIGINATOR_NAME,
|
||||
ild.NAME INSPECTION_LEADDEPARTMENT_NAME,
|
||||
iod.NAME INSPECTION_DEPARTMENT_NAME,
|
||||
isd.NAME INSPECTED_DEPARTMENT_NAME,
|
||||
isu.NAME INSPECTED_SITEUSER_NAME,
|
||||
if(h.`count` > 0, 1, null) as checkout,
|
||||
IFNULL(GROUP_CONCAT(REPLACE(siu.USER_ID, '/', ',')), '') AS INSPECTION_USER_ID,
|
||||
IFNULL(GROUP_CONCAT(REPLACE(siu.NAME, '/', ',')), '') AS INSPECTION_USER_NAME,
|
||||
CASE
|
||||
WHEN IFNULL(f.INSPECTION_TYPE_OTHER, '') = '' THEN d.NAME
|
||||
ELSE f.INSPECTION_TYPE_OTHER END INSPECTION_TYPE_NAME,
|
||||
<include refid="Field">
|
||||
</include>
|
||||
from
|
||||
<include refid="tableName">
|
||||
</include>
|
||||
f
|
||||
LEFT JOIN vi_user_all iou ON iou.USER_ID = f.INSPECTION_ORIGINATOR_ID
|
||||
LEFT JOIN OA_DEPARTMENT ild ON ild.DEPARTMENT_ID = f.INSPECTION_LEADDEPARTMENT_ID
|
||||
LEFT JOIN vi_department_all iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID
|
||||
LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = f.INSPECTED_DEPARTMENT_ID
|
||||
LEFT JOIN SYS_USER isu ON isu.USER_ID = f.INSPECTED_SITEUSER_ID
|
||||
LEFT JOIN bus_inspection_safetyenvironmental_inspector si
|
||||
ON si.INSPECTION_ID = f.INSPECTION_ID and si.ISDELETE = '0'
|
||||
LEFT JOIN vi_user_all siu ON siu.USER_ID = si.INSPECTION_USER_ID
|
||||
LEFT JOIN sys_dictionaries d ON d.BIANMA = f.INSPECTION_TYPE
|
||||
LEFT JOIN (select h.FOREIGN_ID, count(h.HIDDEN_ID) as `count`
|
||||
from BUS_HIDDEN h
|
||||
where h.ISDELETE = 0
|
||||
and h.CREATOR = #{pd.loginUserId}
|
||||
and h.STATE in ('4', '8')
|
||||
and (h.FINAL_CHECK is null or h.FINAL_CHECK = '2')
|
||||
group by h.FOREIGN_ID) h on h.FOREIGN_ID = f.INSPECTION_ID AND f.INSPECTION_STATUS in ('5', '6')
|
||||
where f.ISDELETE = '0'
|
||||
<if test="pd.INSPECTION_ORIGINATOR_ID != null and pd.INSPECTION_ORIGINATOR_ID != ''">
|
||||
<!-- 检查发起人 -->
|
||||
and f.INSPECTION_ORIGINATOR_ID = #{pd.INSPECTION_ORIGINATOR_ID}
|
||||
</if>
|
||||
<if test="pd.ARCHIVE_USER_ID != null and pd.ARCHIVE_USER_ID != ''">
|
||||
and (
|
||||
f.INSPECTION_ORIGINATOR_ID = #{pd.ARCHIVE_USER_ID}
|
||||
OR f.INSPECTED_SITEUSER_ID = #{pd.ARCHIVE_USER_ID}
|
||||
OR EXISTS(select 1
|
||||
from bus_inspection_safetyenvironmental_inspector sii
|
||||
where sii.INSPECTION_USER_ID = #{pd.ARCHIVE_USER_ID}
|
||||
and sii.INSPECTION_ID = f.INSPECTION_ID)
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="pd.INSPECTED_DEPARTMENT_NAME != null and pd.INSPECTED_DEPARTMENT_NAME != ''"><!-- 被检查单位 -->
|
||||
and isd.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTED_DEPARTMENT_NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_DEPARTMENT_NAME != null and pd.INSPECTION_DEPARTMENT_NAME != ''"><!-- 检查部门 -->
|
||||
and iod.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_DEPARTMENT_NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_ORIGINATOR_NAME != null and pd.INSPECTION_ORIGINATOR_NAME != ''"><!-- 检查发起人 -->
|
||||
and iou.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_ORIGINATOR_NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TYPE != null and pd.INSPECTION_TYPE != ''"><!-- 检查类型 -->
|
||||
and f.INSPECTION_TYPE = #{pd.INSPECTION_TYPE}
|
||||
</if>
|
||||
<if test="pd.INSPECTION_SUBJECT != null and pd.INSPECTION_SUBJECT != ''"><!-- 检查题目 -->
|
||||
and f.INSPECTION_SUBJECT = #{pd.INSPECTION_SUBJECT,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TIME_START != null and pd.INSPECTION_TIME_START != ''"><!-- 检查时间 -->
|
||||
and f.INSPECTION_TIME_START >= CONCAT(#{pd.INSPECTION_TIME_START}, ' 00:00')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TIME_END != null and pd.INSPECTION_TIME_END != ''"><!-- 检查时间 -->
|
||||
and f.INSPECTION_TIME_END <= CONCAT(#{pd.INSPECTION_TIME_END}, ' 23:59')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_STATUS != null and pd.INSPECTION_STATUS != ''"><!-- 检查状态 -->
|
||||
<choose>
|
||||
<when test="pd.INSPECTION_STATUS == '3-7'">
|
||||
and f.INSPECTION_STATUS in ('3','4','5','6','7','8')
|
||||
</when>
|
||||
<otherwise>
|
||||
and f.INSPECTION_STATUS = #{pd.INSPECTION_STATUS}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="pd.INSPECTED_DEPARTMENT_NAME != null and pd.INSPECTED_DEPARTMENT_NAME != ''">
|
||||
<!-- 被检查单位 -->
|
||||
and isd.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTED_DEPARTMENT_NAME}), '%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_DEPARTMENT_NAME != null and pd.INSPECTION_DEPARTMENT_NAME != ''">
|
||||
<!-- 检查部门 -->
|
||||
and iod.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_DEPARTMENT_NAME}), '%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_ORIGINATOR_NAME != null and pd.INSPECTION_ORIGINATOR_NAME != ''">
|
||||
<!-- 检查发起人 -->
|
||||
and iou.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_ORIGINATOR_NAME}), '%')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TYPE != null and pd.INSPECTION_TYPE != ''">
|
||||
<!-- 检查类型 -->
|
||||
and f.INSPECTION_TYPE = #{pd.INSPECTION_TYPE}
|
||||
</if>
|
||||
<if test="pd.INSPECTION_SUBJECT != null and pd.INSPECTION_SUBJECT != ''">
|
||||
<!-- 检查题目 -->
|
||||
and f.INSPECTION_SUBJECT = #{pd.INSPECTION_SUBJECT,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TIME_START != null and pd.INSPECTION_TIME_START != ''">
|
||||
<!-- 检查时间 -->
|
||||
and f.INSPECTION_TIME_START >= CONCAT(#{pd.INSPECTION_TIME_START}, ' 00:00')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_TIME_END != null and pd.INSPECTION_TIME_END != ''">
|
||||
<!-- 检查时间 -->
|
||||
and f.INSPECTION_TIME_END <= CONCAT(#{pd.INSPECTION_TIME_END}, ' 23:59')
|
||||
</if>
|
||||
<if test="pd.INSPECTION_STATUS != null and pd.INSPECTION_STATUS != ''">
|
||||
<!-- 检查状态 -->
|
||||
<choose>
|
||||
<when test="pd.INSPECTION_STATUS == '3-7'">
|
||||
and f.INSPECTION_STATUS in ('3', '4', '5', '6', '7', '8')
|
||||
</when>
|
||||
<otherwise>
|
||||
and f.INSPECTION_STATUS = #{pd.INSPECTION_STATUS}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
|
||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 被检查单位 -->
|
||||
and (
|
||||
isd.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
OR iod.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY f.INSPECTION_ID
|
||||
ORDER BY f.CREATTIME DESC
|
||||
</select>
|
||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''">
|
||||
<!-- 被检查单位 -->
|
||||
and (
|
||||
isd.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}), '%')
|
||||
OR iod.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}), '%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY f.INSPECTION_ID
|
||||
ORDER BY CASE
|
||||
WHEN f.INSPECTION_STATUS IN ('3', '4') AND f.INSPECTED_SITEUSER_ID = #{pd.loginUserId} THEN 1
|
||||
WHEN f.INSPECTION_STATUS IN ('5', '6', '7') AND checkout = 1 THEN 2
|
||||
ELSE 3
|
||||
END,
|
||||
field(f.INSPECTION_STATUS, '3', '6', '4', '7', '5', '0', '1', '2', '8', '-1', '-2'),
|
||||
f.INSPECTION_TIME_END DESC
|
||||
</select>
|
||||
|
||||
<select id="statisticsBranchGroupDept" parameterType="pd" resultType="pd">
|
||||
SELECT
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zcloud.mapper.datasource.messages.MessagesMapper">
|
||||
|
||||
<select id="install">
|
||||
insert into push_records
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
ID,
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
PHONE,
|
||||
</if>
|
||||
<if test="messageTitle != null and messageTitle != ''">
|
||||
MESSAGE_TITLE,
|
||||
</if>
|
||||
<if test="messageContent != null and messageContent != ''">
|
||||
MESSAGE_CONTENT,
|
||||
</if>
|
||||
<if test="messageType != null">
|
||||
MESSAGE_TYPE,
|
||||
</if>
|
||||
<if test="sendTime != null and sendTime != ''">
|
||||
SEND_TIME,
|
||||
</if>
|
||||
<if test="state != null">
|
||||
STATE,
|
||||
</if>
|
||||
</trim>
|
||||
values
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
#{phone},
|
||||
</if>
|
||||
<if test="messageTitle != null and messageTitle != ''">
|
||||
#{messageTitle},
|
||||
</if>
|
||||
<if test="messageContent != null and messageContent != ''">
|
||||
#{messageContent},
|
||||
</if>
|
||||
<if test="messageType != null">
|
||||
#{messageType},
|
||||
</if>
|
||||
<if test="sendTime != null and sendTime != ''">
|
||||
#{sendTime},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
#{state},
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<select id="findUserIdByPhone" resultType="java.lang.String">
|
||||
select USER_ID from sys_user where USERNAME = #{phone} and ISDELETE = 0 limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateById">
|
||||
update push_records
|
||||
<set>
|
||||
<if test="phone != null and phone != ''">
|
||||
PHONE = #{phone},
|
||||
</if>
|
||||
<if test="messageTitle != null and messageTitle != ''">
|
||||
MESSAGE_TITLE = #{messageTitle},
|
||||
</if>
|
||||
<if test="messageContent != null and messageContent != ''">
|
||||
MESSAGE_CONTENT = #{messageContent},
|
||||
</if>
|
||||
<if test="messageType != null">
|
||||
MESSAGE_TYPE = #{messageType},
|
||||
</if>
|
||||
<if test="sendTime != null and sendTime != ''">
|
||||
SEND_TIME = #{sendTime},
|
||||
</if>
|
||||
<if test="state != null">
|
||||
STATE = #{state},
|
||||
</if>
|
||||
</set>
|
||||
where ID = #{id}
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue