pet
shanao 2024-10-19 17:34:40 +08:00
parent 9e089fcb62
commit 38986c3364
16 changed files with 689 additions and 345 deletions

View File

@ -920,7 +920,6 @@ public class AppHiddenController extends BaseController {
hs.put("ISDELETE", "0");
hiddenSchemeService.edit(hs);
}
return map;
}

View File

@ -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;
/**
*

View File

@ -734,6 +734,7 @@ 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) {

View File

@ -32,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))){
@ -79,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;
}
}

View File

@ -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, privateKey), 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, String privateKey) {
try {
RSA rsa = new RSA(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("解密失败");
}
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,35 @@
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;
}

View File

@ -0,0 +1,10 @@
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);
}

View File

@ -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);
}

View File

@ -0,0 +1,8 @@
package com.zcloud.service.messages;
import com.zcloud.entity.messages.PushRecords;
public interface MessagesService {
void push(PushRecords pushRecords) throws Exception;
}

View File

@ -0,0 +1,85 @@
package com.zcloud.service.messages.impl;
import cn.hutool.core.util.StrUtil;
import com.zcloud.entity.PageData;
import com.zcloud.entity.messages.PushRecords;
import com.zcloud.mapper.datasource.messages.MessagesMapper;
import com.zcloud.service.bus.NoticeCorpService;
import com.zcloud.service.messages.MessagesService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.UuidUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Slf4j
@Service
@RequiredArgsConstructor
public class MessagesServiceImpl implements MessagesService {
private final MessagesMapper mapper;
private final NoticeCorpService noticeCorpService;
@Override
@Transactional(rollbackFor = Exception.class)
public void push(PushRecords pushRecords) throws Exception {
// 先记录数据
pushRecords.setId(UuidUtil.get32UUID());
pushRecords.setSendTime(DateUtil.getTime());
mapper.install(pushRecords);
// 根据手机号查找用户id
String userId = mapper.findUserIdByPhone(pushRecords.getPhone());
if (StrUtil.isEmpty(userId)) {
throw new RuntimeException("该用户不存在");
}
Integer type = pushRecords.getMessageType();
// 1-短信 2-平台信息 3-全发
if (type == 1) {
pushSms(pushRecords);
} else if (type == 2) {
PageData data = pushInfo(pushRecords, userId);
noticeCorpService.sendNotice(data);
} else if (type == 3) {
pushSms(pushRecords);
PageData data = pushInfo(pushRecords, userId);
noticeCorpService.sendNotice(data);
} else {
throw new RuntimeException("消息类型:【" + type + "】错误");
}
}
/**
* ()
* private
*
* @param pushRecords
* @param userId id
*/
private PageData pushInfo(PushRecords pushRecords, String userId) throws Exception {
PageData mes = new PageData();
mes.put("BIANMA", "PUSH_RECORDS");
mes.put("SENDER_ID", "九公司应急管理"); // 发送人员ID
mes.put("SENDER_NAME", "九公司应急管理"); // 发送人员姓名
mes.put("SYNOPSIS", pushRecords.getMessageTitle()); // 站内信标题
//mes.put("WORKURL", "/pages/application/high-risk-work/limited-space/gas-analysis/list?NameLikes=" + pd.getString("WORK_PERMIT_NUMBER")); // 操作链接
mes.put("CORPINFO_ID", "48a8ca9815814c979814ddcf041c5cd5");// 企业id
mes.put("RECEIVER_ID", userId); // 接收人员ID
PageData content = new PageData();
content.put("msg", pushRecords.getMessageContent());// 作业编号
mes.put("CONTENT", content);// 站内信内容
return mes;
}
/**
* ()
* private
*
* @param pushRecords
*/
private void pushSms(PushRecords pushRecords) {
// todo
log.error("===================>推送短信信息");
log.error("消息内容:{}", pushRecords);
}
}

View File

@ -2,16 +2,10 @@ datasource.no1.driver-class-name: com.mysql.cj.jdbc.Driver
datasource.no1.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8
datasource.no1.username=dev
datasource.no1.password=Zykj@dev123456
#datasource.no1.url=jdbc:mysql://127.0.0.1:3306/qa-gwj-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8
#datasource.no1.username=root
#datasource.no1.password=123456
datasource.no2.driver-class-name: com.mysql.cj.jdbc.Driver
datasource.no2.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-regulatory?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8
datasource.no2.username=dev
datasource.no2.password=Zykj@dev123456
#datasource.no2.url=jdbc:mysql://127.0.0.1:3306/qa-gwj-regulatory?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8
#datasource.no2.username=root
#datasource.no2.password=123456
#druid???
@ -112,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
@ -150,7 +145,6 @@ 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

View File

@ -161,7 +161,7 @@
<!-- 列表 -->
<select id="listByUserId" parameterType="page" resultType="pd">
SELECT
SELECT
c.*,u.TYPE
FROM
bus_noticecorpuserid u

View File

@ -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 &gt;= 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 &lt;= 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.INSPECTION_TIME_START 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 &gt;= 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 &lt;= 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">

View File

@ -721,7 +721,9 @@
)
</if>
GROUP BY f.INSPECTION_ID
ORDER BY f.INSPECTION_TIME_END DESC
ORDER BY FIELD(if(f.INSPECTED_SITEUSER_ID = #{pd.loginUserId},f.INSPECTED_SITEUSER_ID,'1'), f.INSPECTED_SITEUSER_ID, '1'),
field(f.INSPECTION_STATUS , '3','4','6','7','5','0','1','2','8','-1','-2'),
f.INSPECTION_TIME_END DESC
</select>
<select id="statisticsBranchGroupDept" parameterType="pd" resultType="pd">

View File

@ -0,0 +1,53 @@
<?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>
</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>
</trim>
</select>
<select id="findUserIdByPhone" resultType="java.lang.String">
select USER_ID from sys_user where USERNAME = #{phone} and ISDELETE = 0 limit 1
</select>
</mapper>