Merge branch '1212-八项作业迁移' into czks1.0

# Conflicts:
#	pom.xml
#	src/main/resources/application-dev.properties
#	src/main/resources/application-master.properties
czks1.0
dearlin 2023-12-19 17:18:35 +08:00
commit 7ca4ab9570
34 changed files with 685 additions and 779 deletions

34
pom.xml
View File

@ -210,19 +210,6 @@
<version>${batik.version}</version>
</dependency>
<!--mq开始-->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client-java</artifactId>
<version>5.0.5</version>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<!--mq结束-->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
@ -474,11 +461,22 @@
<artifactId>hutool-all</artifactId>
<version>5.0.5</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client-java</artifactId>
<version>5.0.5</version>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
<build>
<!-- <finalName>qa-prevention-gwj</finalName>
<plugins>

View File

@ -6,6 +6,7 @@ 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.logs.LogAnno;
import com.zcloud.service.bus.CorpInfoService;
import com.zcloud.service.bus.MSMLoginService;
import com.zcloud.service.bus.NoticeCorpService;
@ -21,9 +22,7 @@ import org.apache.commons.lang.StringUtils;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
@ -58,6 +57,9 @@ public class AppConfinedSpaceController extends BaseController {
@Autowired
private NoticeCorpService noticeCorpService;
@Autowired
private SendMessageUtil sendMessageUtil;
/**
* @param
* @throws Exception
@ -551,4 +553,93 @@ public class AppConfinedSpaceController extends BaseController {
map.put("count", count);
return map;
}
/**
* @param out
* @throws Exception
*/
@PostMapping(value="/cancel")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "受限空间",instructionsOperate = "受限空间",instructionsType = "作废")
public void cancel(@RequestBody PageData pd) throws Exception{
Map<String,String> map = new HashMap<String,String>();
String errInfo = "success";
System.out.println(JSONObject.toJSONString(pd));
PageData cpd = new PageData();
cpd = confinedspaceService.findById(pd);
if(cpd!=null && cpd.size()>0 && cpd.getString("ANALYZE_TIME") != null && cpd.getString("GUARDIAN_USER_SIGNER_TIME") != null){
return;
}else if (cpd!=null && cpd.size()>0 && cpd.getString("ANALYZE_TIME") == null){
pd.put("APPLY_STATUS",-98);
confinedspaceService.cancel(pd);
PageData pd2 = new PageData();
pd2 = confinedspaceService.checkno(pd);
PageData pd3 = new PageData();
pd3.put("CHECK_NO",pd2.getString("CHECK_NO"));
pd3.put("CORPINFO_ID",pd.getString("CORPINFO_ID"));
confinedspaceService.editSpecialwork(pd3);
confinedspaceService.editSpecialwork1(pd3);
confinedspaceService.editSpecialwork2(pd3);
confinedspaceService.editSpecialwork3(pd3);
confinedspaceService.editSpecialwork4(pd3);
confinedspaceService.editSpecialwork5(pd3);
confinedspaceService.editSpecialwork6(pd3);
confinedspaceService.editSpecialwork7(pd3);
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid
mes.put("templateCode", "YX_ZF1");// 短信模板编码
mes.put("SMSCode", "SMS_462060039");// 短信模板编码
mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "params1");// 存入短信模板中的参数名称
params2.put("value", "受限空间作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
}else if (cpd!=null && cpd.size()>0 && cpd.getString("ANALYZE_TIME") != null && cpd.getString("GUARDIAN_USER_SIGNER_TIME") == null){
pd.put("APPLY_STATUS",-99);
confinedspaceService.cancel(pd);
PageData pd2 = new PageData();
pd2 = confinedspaceService.checkno(pd);
PageData pd3 = new PageData();
pd3.put("CHECK_NO",pd2.getString("CHECK_NO"));
pd3.put("CORPINFO_ID",pd.getString("CORPINFO_ID"));
confinedspaceService.editSpecialwork(pd3);
confinedspaceService.editSpecialwork1(pd3);
confinedspaceService.editSpecialwork2(pd3);
confinedspaceService.editSpecialwork3(pd3);
confinedspaceService.editSpecialwork4(pd3);
confinedspaceService.editSpecialwork5(pd3);
confinedspaceService.editSpecialwork6(pd3);
confinedspaceService.editSpecialwork7(pd3);
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid
mes.put("templateCode", "YX_ZF2");// 短信模板编码
mes.put("SMSCode", "SMS_462060039");// 短信模板编码
mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "params1");// 存入短信模板中的参数名称
params2.put("value", "受限空间作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
}
map.put("result", errInfo); //返回结果
return ;
}
}

View File

@ -6,6 +6,7 @@ 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.logs.LogAnno;
import com.zcloud.service.bus.CorpInfoService;
import com.zcloud.service.bus.MSMLoginService;
import com.zcloud.service.bus.NoticeCorpService;
@ -22,12 +23,12 @@ import org.apache.commons.lang.StringUtils;
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.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -60,6 +61,9 @@ public class AppElectricityController extends BaseController {
private NoticeCorpService noticeCorpService;
@Autowired
private DepartmentService departmentService;
@Autowired
private SendMessageUtil sendMessageUtil;
/**
* @param
* @throws Exception
@ -1160,4 +1164,95 @@ public class AppElectricityController extends BaseController {
map.put("count", count);
return map;
}
/**
* @param out
* @throws Exception
*/
@PostMapping(value="/cancel")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "受限空间",instructionsOperate = "受限空间",instructionsType = "作废")
public void cancel(@RequestBody PageData pd) throws Exception{
Map<String,String> map = new HashMap<String,String>();
String errInfo = "success";
System.out.println(JSONObject.toJSONString(pd));
PageData cpd = new PageData();
cpd = electricityService.findById(pd);
if(cpd!=null && cpd.size()>0 && cpd.getString("ANALYZE_TIME") != null){
String WORK_START_DATE = pd.getString("WORK_START_DATE");
String ANALYZE_TIME = cpd.getString("ANALYZE_TIME");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
System.out.println(WORK_START_DATE);
System.out.println(ANALYZE_TIME);
System.out.println("-------------123----------");
try {
Date date1 = format.parse(WORK_START_DATE);
Date date2 = format.parse(ANALYZE_TIME);
long workTime = date1.getTime();
long analyzeTime = date2.getTime();
System.out.println(workTime - analyzeTime);
System.out.println(analyzeTime - workTime);
if (workTime - analyzeTime >= 0) {
return;
} else {
electricityService.cancel(pd);
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid
mes.put("templateCode", "YD_ZF");// 短信模板编码
mes.put("SMSCode", "SMS_462060039");// 短信模板编码
mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "params1");// 存入短信模板中的参数名称
params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
}
} catch (ParseException e) {
e.printStackTrace();
}
}else{
electricityService.cancel(pd);
PageData pd2 = new PageData();
pd2 = electricityService.checkno(pd);
PageData pd3 = new PageData();
pd3.put("CHECK_NO",pd2.getString("CHECK_NO"));
pd3.put("CORPINFO_ID",pd.getString("CORPINFO_ID"));
electricityService.editSpecialwork(pd3);
electricityService.editSpecialwork1(pd3);
electricityService.editSpecialwork2(pd3);
electricityService.editSpecialwork3(pd3);
electricityService.editSpecialwork4(pd3);
electricityService.editSpecialwork5(pd3);
electricityService.editSpecialwork6(pd3);
electricityService.editSpecialwork7(pd3);
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd.get("CONFIRM_USER_ID"));// 收信人userid
mes.put("templateCode", "YD_ZF");// 短信模板编码
mes.put("SMSCode", "SMS_462060039");// 短信模板编码
mes.put("CORPINFO_ID", pd.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "params1");// 存入短信模板中的参数名称
params2.put("value", "临时用电安全作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
sendMessageUtil.sendMessages(mes, paramsList);
}
map.put("result", errInfo); //返回结果
return ;
}
}

View File

@ -88,22 +88,24 @@ public class AppHomeController extends BaseController {
if(!Tools.isEmpty(pd.get("USER_ID"))){
varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID"));
PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID"));
if (varList.size() > 0) {
boolean isDelayedExist = false;
for (PageData data : varList) {
if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true;
}
if (isDelayedExist) {
for (PageData pageData : varList){
if (StringUtils.equals(pageData.getString("STATE"),"10")) {
pageData.put("count",delayedCount.getString("count"));
if (Integer.parseInt(delayedCount.getString("count")) != 0) {
if (varList.size() > 0) {
boolean isDelayedExist = false;
for (PageData data : varList) {
if (StringUtils.equals(data.getString("STATE"), "10")) isDelayedExist = true;
}
if (isDelayedExist) {
for (PageData pageData : varList) {
if (StringUtils.equals(pageData.getString("STATE"), "10")) {
pageData.put("count", delayedCount.getString("count"));
}
}
} else {
varList.add(delayedCount);
}
} else {
varList.add(delayedCount);
}
} else {
varList.add(delayedCount);
}
myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID"));
}
@ -146,22 +148,24 @@ public class AppHomeController extends BaseController {
if(!Tools.isEmpty(pd.get("USER_ID"))){
varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID"));
PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID"));
if (varList.size() > 0) {
boolean isDelayedExist = false;
for (PageData data : varList) {
if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true;
}
if (isDelayedExist) {
for (PageData pageData : varList){
if (StringUtils.equals(pageData.getString("STATE"),"10")) {
pageData.put("count",delayedCount.getString("count"));
if (Integer.parseInt(delayedCount.getString("count")) != 0) {
if (varList.size() > 0) {
boolean isDelayedExist = false;
for (PageData data : varList) {
if (StringUtils.equals(data.getString("STATE"), "10")) isDelayedExist = true;
}
if (isDelayedExist) {
for (PageData pageData : varList) {
if (StringUtils.equals(pageData.getString("STATE"), "10")) {
pageData.put("count", delayedCount.getString("count"));
}
}
} else {
varList.add(delayedCount);
}
} else {
varList.add(delayedCount);
}
} else {
varList.add(delayedCount);
}
myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID"));
}

View File

@ -746,42 +746,44 @@ public class AppHotWorkApplicationController extends BaseController {
}
}
PageData hotUser = new PageData();
hotUser.put("hotIds", hotIds);
List<PageData> hotUserAllList = hotWorkApplicationUserService.listAll(hotUser);
for (PageData userPageData : hotUserAllList){
String hotAndType = userPageData.getString("FOREIGN_KEY");
if(hotIdKeyMap.containsKey(hotAndType)){
PageData hot = varList.get(hotIdKeyMap.get(hotAndType));
String type = userPageData.get("STATE").toString();
if("0".equals(type)){ // 申请办理人
hot.put("APPLY_DEPARTMENT_NAME",userPageData.getString("deptName"));
hot.put("APPLY_USER_NAME",userPageData.getString("userName"));
hot.put("APPLY_USER_ID",userPageData.getString("USER_ID"));
}else if("1".equals(type)){ //动火单位负责人
hot.put("HOT_WORK_UNIT_LEADER_NAME",userPageData.getString("userName"));
hot.put("HOT_WORK_UNIT_LEADER_ID",userPageData.getString("USER_ID"));
}else if("2".equals(type)){ // 项目发包单位负责人
hot.put("PROJECT_UNIT_LEADER_NAME",userPageData.getString("userName"));
hot.put("PROJECT_UNIT_LEADER_ID",userPageData.getString("USER_ID"));
}else if("3".equals(type)){ // 现场管辖单位负责人
hot.put("UNIT_LEADER_NAME",userPageData.getString("userName"));
hot.put("UNIT_LEADER_ID",userPageData.getString("USER_ID"));
}else if("5".equals(type)){ // 动火前 负责人
hot.put("HOT_WORK_BEFORE_UNIT_LEADER",userPageData.getString("userName"));
}else if("6".equals(type)){ // 现场负责人
hot.put("SITE_LEADER_NAME",userPageData.getString("userName"));
hot.put("SITE_LEADER_PHONE",userPageData.getString("userPhone"));
}else if("7".equals(type)){ // 动火后 负责人
hot.put("HOT_WORK_AFTER_UNIT_LEADER",userPageData.getString("userName"));
} else if("11".equals(type)){ // 特级动火 申请人
hot.put("DEPARTMENT_PERSONNEL_NAME",userPageData.getString("userName"));
hot.put("DEPARTMENT_PERSONNEL_ID",userPageData.getString("USER_ID"));
}else if("20".equals(type)){ // 特级动火 申请人
hot.put("SUPERVISOR_OF_HOT_WORK_UNIT",userPageData.getString("USER_ID"));
}else if("21".equals(type)){ // 动火后 负责人
String userName = userPageData.getString("userName2") +",";
String oldName = Tools.isEmpty(pd.get("HOT_WORK_OPERATOR_NAME"))?"":pd.get("HOT_WORK_OPERATOR_NAME").toString();
hot.put("HOT_WORK_OPERATOR_NAME",oldName + userName);
if (hotIds.size() > 0) {
hotUser.put("hotIds", hotIds);
List<PageData> hotUserAllList = hotWorkApplicationUserService.listAll(hotUser);
for (PageData userPageData : hotUserAllList){
String hotAndType = userPageData.getString("FOREIGN_KEY");
if(hotIdKeyMap.containsKey(hotAndType)){
PageData hot = varList.get(hotIdKeyMap.get(hotAndType));
String type = userPageData.get("STATE").toString();
if("0".equals(type)){ // 申请办理人
hot.put("APPLY_DEPARTMENT_NAME",userPageData.getString("deptName"));
hot.put("APPLY_USER_NAME",userPageData.getString("userName"));
hot.put("APPLY_USER_ID",userPageData.getString("USER_ID"));
}else if("1".equals(type)){ //动火单位负责人
hot.put("HOT_WORK_UNIT_LEADER_NAME",userPageData.getString("userName"));
hot.put("HOT_WORK_UNIT_LEADER_ID",userPageData.getString("USER_ID"));
}else if("2".equals(type)){ // 项目发包单位负责人
hot.put("PROJECT_UNIT_LEADER_NAME",userPageData.getString("userName"));
hot.put("PROJECT_UNIT_LEADER_ID",userPageData.getString("USER_ID"));
}else if("3".equals(type)){ // 现场管辖单位负责人
hot.put("UNIT_LEADER_NAME",userPageData.getString("userName"));
hot.put("UNIT_LEADER_ID",userPageData.getString("USER_ID"));
}else if("5".equals(type)){ // 动火前 负责人
hot.put("HOT_WORK_BEFORE_UNIT_LEADER",userPageData.getString("userName"));
}else if("6".equals(type)){ // 现场负责人
hot.put("SITE_LEADER_NAME",userPageData.getString("userName"));
hot.put("SITE_LEADER_PHONE",userPageData.getString("userPhone"));
}else if("7".equals(type)){ // 动火后 负责人
hot.put("HOT_WORK_AFTER_UNIT_LEADER",userPageData.getString("userName"));
} else if("11".equals(type)){ // 特级动火 申请人
hot.put("DEPARTMENT_PERSONNEL_NAME",userPageData.getString("userName"));
hot.put("DEPARTMENT_PERSONNEL_ID",userPageData.getString("USER_ID"));
}else if("20".equals(type)){ // 特级动火 申请人
hot.put("SUPERVISOR_OF_HOT_WORK_UNIT",userPageData.getString("USER_ID"));
}else if("21".equals(type)){ // 动火后 负责人
String userName = userPageData.getString("userName2") +",";
String oldName = Tools.isEmpty(pd.get("HOT_WORK_OPERATOR_NAME"))?"":pd.get("HOT_WORK_OPERATOR_NAME").toString();
hot.put("HOT_WORK_OPERATOR_NAME",oldName + userName);
}
}
}
}
@ -1361,22 +1363,24 @@ public class AppHotWorkApplicationController extends BaseController {
if(!Tools.isEmpty(pd.get("USER_ID"))){
varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID"));
PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID"));
if (varList.size() > 0) {
boolean isDelayedExist = false;
for (PageData data : varList) {
if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true;
}
if (isDelayedExist) {
for (PageData pageData : varList){
if (StringUtils.equals(pageData.getString("STATE"),"10")) {
pageData.put("count",delayedCount.getString("count"));
if (Integer.parseInt(delayedCount.getString("count")) != 0) {
if (varList.size() > 0) {
boolean isDelayedExist = false;
for (PageData data : varList) {
if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true;
}
if (isDelayedExist) {
for (PageData pageData : varList){
if (StringUtils.equals(pageData.getString("STATE"),"10")) {
pageData.put("count",delayedCount.getString("count"));
}
}
} else {
varList.add(delayedCount);
}
} else {
varList.add(delayedCount);
}
} else {
varList.add(delayedCount);
}
myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID"));
}

View File

@ -3,11 +3,12 @@ package com.zcloud.controller.gf;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
import com.zcloud.dto.mq.TenCorpDto;
import com.zcloud.dto.TenCorpConst;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mq.util.TenCorpConst;
import com.zcloud.service.gf.*;
import com.zcloud.service.mq.SendMessageService;
import com.zcloud.util.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,7 +17,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;
import com.zcloud.mq.service.SendMessageService;
import javax.annotation.Resource;
import java.text.DecimalFormat;

View File

@ -3,12 +3,12 @@ package com.zcloud.controller.gf;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
import com.zcloud.dto.mq.Response;
import com.zcloud.dto.mq.TenCorpDto;
import com.zcloud.dto.TenCorpConst;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mq.util.TenCorpConst;
import com.zcloud.service.gf.*;
import com.zcloud.service.mq.SendMessageService;
import com.zcloud.util.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,7 +17,6 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;
import com.zcloud.mq.service.SendMessageService;
import javax.annotation.Resource;
import java.text.DecimalFormat;
@ -182,8 +181,6 @@ public class AppGFElectricityController extends BaseController {
}
/**
* @param out
* @throws Exception
*/
@RequestMapping(value="/delete")
@ResponseBody

View File

@ -3,13 +3,12 @@ package com.zcloud.controller.gf;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
import com.zcloud.dto.mq.Response;
import com.zcloud.dto.mq.TenCorpDto;
import com.zcloud.dto.TenCorpConst;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mq.service.SendMessageService;
import com.zcloud.mq.util.TenCorpConst;
import com.zcloud.service.gf.*;
import com.zcloud.service.mq.SendMessageService;
import com.zcloud.util.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -195,8 +194,6 @@ public class AppGFHotworkController extends BaseController {
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/edit")
@ResponseBody

View File

@ -1,6 +1,8 @@
package com.zcloud.controller.mq;
import com.alibaba.fastjson.JSON;
import com.zcloud.controller.app.highriskwork.AppConfinedSpaceController;
import com.zcloud.controller.app.highriskwork.AppElectricityController;
import com.zcloud.controller.app.highriskwork.AppHotworkCfdController;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.entity.PageData;
@ -30,10 +32,10 @@ import java.util.Date;
public class EightWorkListener implements RocketMQListener<String> {
// @Resource
// private AppConfinedSpaceController appConfinedSpaceController;
// @Resource
// private AppElectricityController appElectricityController;
@Resource
private AppConfinedSpaceController appConfinedSpaceController;
@Resource
private AppElectricityController appElectricityController;
@Resource
private AppHotworkCfdController appHotworkCfdController;
@ -64,11 +66,11 @@ public class EightWorkListener implements RocketMQListener<String> {
switch (data.getMessage()){
case "confined-space":
System.out.println("受限空间模块消费");
// appConfinedSpaceController.cancel(data.getData());
appConfinedSpaceController.cancel(data.getData());
break;
case "electricity":
System.out.println("临时用电模块消费");
// appElectricityController.cancel(data.getData());
appElectricityController.cancel(data.getData());
break;
case "hot-work":
System.out.println("动火模块消费");

View File

@ -1,68 +0,0 @@
package com.zcloud.dto.mq;
import com.alibaba.fastjson.JSON;
import lombok.Data;
@Data
public class Response {
private String result;
private String exception;
private String code;
private String message;
public Response Ok() {
this.result = "succeed";
this.code = "0";
return this;
}
public static Response OK() {
Response response = new Response();
response.result = "succeed";
response.code = "0";
return response;
}
public Response Error() {
this.result = "succeed";
this.code = "9999";
this.exception = "系统异常";
return this;
}
public Response Error(String errorMessage) {
this.result = "succeed";
this.code = "9999";
this.exception = errorMessage;
return this;
}
public Response Error(String code, String errorMessage) {
this.result = "succeed";
this.code = code;
this.exception = errorMessage;
return this;
}
public static Response ERROR() {
Response response = new Response();
response.result = "succeed";
response.code = "0";
return response;
}
public static Response ERROR(String errorMessage) {
Response response = new Response();
response.result = "succeed";
response.code = "9999";
response.exception = errorMessage;
return response;
}
public void setMessage(Object obj) {
this.message = JSON.toJSONString(obj);
}
}

View File

@ -1,46 +0,0 @@
package com.zcloud.dto.mq;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.entity.PageData;
import com.zcloud.util.Warden;
import lombok.Data;
@Data
public class TenCorpDto {
// 请秋id
private String id;
// 消息来源名称
private String producer_name;
private String topic;
//印记(方便寻找该条请求)
private String mark;
// 标记名称
private String mark_name;
// 消息发送时间(yyyy-MM-dd HH:mm:ss:SSS)
private String time_stamp;
// 消息体
private String message;
private PageData data;
public TenCorpDto() {
this.id = Warden.get32UUID();
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
public PageData getPd() {
PageData info = new PageData();
info.put("ID", this.id);
info.put("PRODUCER_NAME", this.producer_name);
info.put("MARK", this.mark);
info.put("MARK_NAME", this.mark_name);
info.put("MESSAGE", JSONObject.toJSONString(this.data));
info.put("TOPIC",this.topic);
return info;
}
}

View File

@ -63,5 +63,15 @@ public interface ConfinedSpaceMapper {
* @return
*/
PageData countCheck(PageData pd);
void cancel(PageData pd);
PageData checkno(PageData pd);
void editSpecialwork(PageData pd);
void editSpecialwork1(PageData pd);
void editSpecialwork2(PageData pd);
void editSpecialwork3(PageData pd);
void editSpecialwork4(PageData pd);
void editSpecialwork5(PageData pd);
void editSpecialwork6(PageData pd);
void editSpecialwork7(PageData pd);
}

View File

@ -77,5 +77,16 @@ public interface ElectricityMapper{
*/
int numberCheck(PageData pd);
PageData getCode(PageData pd);
void cancel(PageData pd);
PageData checkno(PageData pd);
void editSpecialwork(PageData pd);
void editSpecialwork1(PageData pd);
void editSpecialwork2(PageData pd);
void editSpecialwork3(PageData pd);
void editSpecialwork4(PageData pd);
void editSpecialwork5(PageData pd);
void editSpecialwork6(PageData pd);
void editSpecialwork7(PageData pd);
}

View File

@ -1,87 +0,0 @@
package com.zcloud.mq.controller;
import com.alibaba.fastjson.JSON;
import com.zcloud.controller.gf.GFEightWorkController;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.mq.MqMessageLogMapper;
import com.zcloud.dto.mq.TenCorpDto;
import com.zcloud.mq.service.LogService;
import com.zcloud.mq.service.SendMessageService;
import com.zcloud.mq.util.MqUtil;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Warden;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
/**
* topic tag DEMO
* wangxuan
* www.zcloudchina.com
*/
@Component
@RocketMQMessageListener(consumerGroup = "${mq.group.eightWork}",
topic = "${mq.topic.eightWork}",
selectorType = SelectorType.TAG)
public class EightWorkListener implements RocketMQListener<String> {
@Resource
private GFEightWorkController eightWorkClient;
@Resource
private SendMessageService sendMessageService;
@Resource
private LogService logService;
@Resource
private MqMessageLogMapper mqMessageLogMapper;
@Override
public void onMessage(String message) {
TenCorpDto data = JSON.parseObject(message, TenCorpDto.class);
PageData log = data.getPd();
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
log.put("CREATE_TIME", DateUtil.getTime());
log.put("PRODUCER_NAME",data.getProducer_name());
log.put("TYPE","1");
try {
System.out.println("消费者:" + data.toString());
Date limit_date = MqUtil.dateFormat(data.getTime_stamp());
if (limit_date.getTime() - new Date().getTime() > 1000) {
sendMessageService.SendDelayQueue(data);
log.put("DIGESTION_FLAG","0");
} else {
switch (data.getMessage()){
case "confined-space":
System.out.println("受限空间模块消费");
// eightWorkClient.confinedSpaceCancel(data.getData());
break;
case "electricity":
System.out.println("临时用电模块消费");
// eightWorkClient.electricityCancel(data.getData());
break;
case "hot-work":
System.out.println("动火模块消费");
// eightWorkClient.hotWorkCancel(data.getData());
break;
default:
System.out.println("异常模块不消费");
throw new RuntimeException("未找到对应的消费者");
}
log.put("DIGESTION_FLAG","1");
}
mqMessageLogMapper.save(log);
} catch (Exception e) {
e.printStackTrace();
logService.saveErrorMessage(log,e.getMessage());
throw new RuntimeException(e);
}
}
}

View File

@ -1,32 +0,0 @@
package com.zcloud.mq.controller;
import com.alibaba.fastjson.JSON;
import com.zcloud.dto.mq.TenCorpDto;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
/**
* topic tag DEMO
* wangxuan
* www.zcloudchina.com
*/
@Component
@RocketMQMessageListener(consumerGroup = "${mq.group.info}",
topic = "${mq.topic.info}",
selectorType = SelectorType.TAG)
public class MqListener implements RocketMQListener<String> {
@Override
public void onMessage(String message) {
TenCorpDto data = JSON.parseObject(message, TenCorpDto.class);
try {
System.out.println("2消费者:" + data.toString());
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
}

View File

@ -1,54 +0,0 @@
package com.zcloud.mq.controller;
import com.zcloud.controller.base.BaseController;
import com.zcloud.dto.mq.Response;
import com.zcloud.dto.mq.TenCorpDto;
import com.zcloud.mq.service.SendMessageService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* TODO
* wangxuan
* www.zcloudchina.com
*/
@RestController
@RequestMapping("/messageQueue")
public class SendController extends BaseController {
@Resource
private SendMessageService sendMessageService;
@RequestMapping("/sendMessage")
public Response sendMessage(@RequestParam("tenCorpDto") TenCorpDto tenCorpDto) throws Exception {
try {
sendMessageService.sendMessage(tenCorpDto);
} catch (Exception e) {
e.printStackTrace();
}
return Response.OK();
}
@PostMapping("SendTimelyQueue")
public Response timelyQueue(@RequestBody TenCorpDto tenCorpDto) throws Exception {
try {
sendMessageService.sendMessage(tenCorpDto);
} catch (Exception e) {
e.printStackTrace();
}
return Response.OK();
}
@PostMapping("/SendDelayQueue")
public Response SendDelayQueue(@RequestBody TenCorpDto tenCorpDto) throws Exception {
try {
sendMessageService.SendDelayQueue(tenCorpDto);
return Response.OK();
} catch (Exception e) {
e.printStackTrace();
return Response.ERROR(e.getMessage());
}
}
}

View File

@ -1,11 +0,0 @@
package com.zcloud.mq.service;
import com.zcloud.entity.PageData;
public interface LogService {
void saveLog(PageData pageData);
void saveLog(PageData pageData,String type);
void saveErrorMessage(PageData pageData,String errorMessage);
}

View File

@ -1,11 +0,0 @@
package com.zcloud.mq.service;
import com.zcloud.dto.mq.TenCorpDto;
public interface SendMessageService {
void sendMessage(TenCorpDto tenCorpDto) throws Exception;
void SendDelayQueue(TenCorpDto tenCorpDto);
void SendDelayQueue(String message);
}

View File

@ -1,43 +0,0 @@
package com.zcloud.mq.service.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.mq.MqErrorMessageLogMapper;
import com.zcloud.mapper.datasource.mq.MqMessageLogMapper;
import com.zcloud.mq.service.LogService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Warden;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class LogServiceImpl implements LogService {
@Resource
private MqErrorMessageLogMapper mqErrorMessageLogMapper;
@Resource
private MqMessageLogMapper mqMessageLogMapper;
@Override
@Async
public void saveLog(PageData pageData) {
this.saveLog(pageData,"0");
}
@Override
public void saveLog(PageData pageData, String type) {
}
@Override
@Async
public void saveErrorMessage(PageData log,String errorMessage) {
log.put("ERROR_MESSAGE", errorMessage);
log.put("MESSAGE_ERROR_LOG_ID", Warden.get32UUID());
log.put("TYPE", "0");
log.put("TIME", DateUtil.getTime());
mqErrorMessageLogMapper.save(log);
}
}

View File

@ -1,129 +0,0 @@
package com.zcloud.mq.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.dto.mq.TenCorpDto;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.mq.MqErrorMessageLogMapper;
import com.zcloud.mapper.datasource.mq.MqMessageLogMapper;
import com.zcloud.mq.service.LogService;
import com.zcloud.mq.service.SendMessageService;
import com.zcloud.mq.util.MqUtil;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Warden;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.SendStatus;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class SendMessageServiceImpl implements SendMessageService {
@Value("${mq.topic.info}")
private String info;
@Resource
private RocketMQTemplate rocketMQTemplate;
@Resource
private MqErrorMessageLogMapper mqErrorMessageLogMapper;
@Resource
private LogService logService;
@Resource
private MqMessageLogMapper mqMessageLogMapper;
public void sendMessage(TenCorpDto tenCorpDto) throws Exception {
try {
PageData log = tenCorpDto.getPd();
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
log.put("CREATE_TIME", DateUtil.getTime());
mqMessageLogMapper.save(log);
System.out.println("生产者:" + tenCorpDto.toString());
SendResult sendResult = rocketMQTemplate.syncSend(this.info, tenCorpDto.toString());
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
throw new RuntimeException("产品入栈失败");
}
} catch (Exception e) {
e.printStackTrace();
PageData log = tenCorpDto.getPd();
log.put("MESSAGE_ERROR_LOG_ID", Warden.get32UUID());
log.put("ERROR_MESSAGE", e.getMessage());
log.put("TYPE", "0");
log.put("TIME", DateUtil.getTime());
mqErrorMessageLogMapper.save(log);
}
}
@Override
public void SendDelayQueue(TenCorpDto tenCorpDto) {
PageData log = tenCorpDto.getPd();
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
try {
log.put("CREATE_TIME", DateUtil.getTime());
log.put("PRODUCER_NAME",tenCorpDto.getProducer_name());
log.put("TYPE","0");
log.put("PLAN_TIME",tenCorpDto.getTime_stamp());
mqMessageLogMapper.save(log);
System.out.println("生产者:" + tenCorpDto.toString());
// 推送消息
SendResult sendResult = rocketMQTemplate.syncSend(
MqUtil.analysistopic(tenCorpDto.getTopic()),
new GenericMessage<>(tenCorpDto.toString()),
3000,
MqUtil.analysisTime(tenCorpDto.getTime_stamp()));
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
throw new RuntimeException("产品入栈失败");
}
} catch (Exception e) {
e.printStackTrace();
log.put("ERROR_MESSAGE", e.getMessage());
log.put("MESSAGE_ERROR_LOG_ID", Warden.get32UUID());
log.put("TYPE", "0");
log.put("TIME", DateUtil.getTime());
mqErrorMessageLogMapper.save(log);
}
}
@Override
public void SendDelayQueue(String message) {
TenCorpDto tenCorpDto = JSONObject.parseObject(message,TenCorpDto.class);
try {
PageData log = tenCorpDto.getPd();
log.put("CREATE_TIME", DateUtil.getTime());
log.put("PRODUCER_NAME",tenCorpDto.getProducer_name());
log.put("MESSAGE_LOG_ID", Warden.get32UUID());
mqMessageLogMapper.save(log);
System.out.println("生产者:" + tenCorpDto.toString());
// 推送消息
SendResult sendResult = rocketMQTemplate.syncSend(
MqUtil.analysistopic(tenCorpDto.getTopic()),
new GenericMessage<>(message),
3000,
MqUtil.analysisTime(tenCorpDto.getTime_stamp()));
if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) {
throw new RuntimeException("产品入栈失败");
}
} catch (Exception e) {
PageData log = tenCorpDto.getPd();
logService.saveErrorMessage(log,e.getMessage());
e.printStackTrace();
}
}
public static void main(String[] args) {
try {
System.out.println(MqUtil.analysisTime("2023-06-30 14:30:00:000"));
}catch (Exception e){
e.printStackTrace();
}
}
}

View File

@ -1,6 +0,0 @@
package com.zcloud.mq.util;
public class Const {
public static final String topic_eightWork="eightWork";
public static final String topic_info="info";
}

View File

@ -1,84 +0,0 @@
package com.zcloud.mq.util;
import java.text.SimpleDateFormat;
import java.util.Date;
public class MqUtil {
private final static SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
public static Integer analysisTime(String time) throws Exception{
Date agreed_date = timeFormat.parse(time);
long time_difference = agreed_date.getTime() - new Date().getTime();
if (time_difference < 0){
return 0;
}
if (time_difference > 2*60*60*1000){
return 18;
}
if (time_difference > 60 * 60 * 1000){
return 17;
}
if (time_difference > 30 * 60 * 1000){
return 16;
}
if (time_difference > 20 * 60 * 1000){
return 15;
}
if (time_difference > 10 * 60 * 1000){
return 14;
}
if (time_difference > 9 * 60 * 1000){
return 13;
}
if (time_difference > 8 * 60 * 1000){
return 12;
}
if (time_difference > 7 * 60 * 1000){
return 11;
}
if (time_difference > 6 * 60 * 1000){
return 10;
}
if (time_difference > 5 * 60 * 1000){
return 9;
}
if (time_difference > 4 * 60 * 1000){
return 8;
}
if (time_difference > 3 * 60 * 1000){
return 7;
}
if (time_difference > 2 * 60 * 1000){
return 6;
}
if (time_difference > 60 * 1000){
return 5;
}
if (time_difference > 30 * 1000){
return 4;
}
if (time_difference > 10 * 1000){
return 3;
}
if (time_difference > 5 * 1000){
return 2;
}
if (time_difference > 1000){
return 1;
}
return 0;
}
public static String analysistopic(String producerName) {
switch (producerName){
case "eightWork" : return Const.topic_eightWork;
case "info" : return Const.topic_info;
default: return "";
}
}
public static Date dateFormat(String date) throws Exception{
return timeFormat.parse(date);
}
}

View File

@ -1,7 +0,0 @@
package com.zcloud.mq.util;
public class TenCorpConst {
public static final String confinedSpace = "confined-space";
public static final String electricity = "electricity";
public static final String hotWork = "hot-work";
}

View File

@ -64,5 +64,15 @@ public interface ConfinedSpaceService {
* @throws Exception
*/
PageData countCheck(PageData pd)throws Exception;
void editSpecialwork(PageData pd)throws Exception;
void editSpecialwork1(PageData pd)throws Exception;
void editSpecialwork2(PageData pd)throws Exception;
void editSpecialwork3(PageData pd)throws Exception;
void editSpecialwork4(PageData pd)throws Exception;
void editSpecialwork5(PageData pd)throws Exception;
void editSpecialwork6(PageData pd)throws Exception;
void editSpecialwork7(PageData pd)throws Exception;
void cancel(PageData pd)throws Exception;
PageData checkno(PageData pd)throws Exception;
}

View File

@ -78,5 +78,16 @@ public interface ElectricityService{
public int numberCheck(PageData pd)throws Exception;
PageData getCode(PageData pd)throws Exception;
void cancel(PageData pd)throws Exception;
PageData checkno(PageData pd)throws Exception;
void editSpecialwork(PageData pd)throws Exception;
void editSpecialwork1(PageData pd)throws Exception;
void editSpecialwork2(PageData pd)throws Exception;
void editSpecialwork3(PageData pd)throws Exception;
void editSpecialwork4(PageData pd)throws Exception;
void editSpecialwork5(PageData pd)throws Exception;
void editSpecialwork6(PageData pd)throws Exception;
void editSpecialwork7(PageData pd)throws Exception;
}

View File

@ -118,5 +118,38 @@ public class ConfinedSpaceServiceImpl implements ConfinedSpaceService {
public PageData countCheck(PageData pd) throws Exception {
return confinedspaceMapper.countCheck(pd);
}
public void cancel(PageData pd)throws Exception{
confinedspaceMapper.cancel(pd);
}
public PageData checkno(PageData pd)throws Exception{
return confinedspaceMapper.checkno(pd);
}
public void editSpecialwork(PageData pd)throws Exception{
confinedspaceMapper.editSpecialwork(pd);
}
public void editSpecialwork1(PageData pd)throws Exception{
confinedspaceMapper.editSpecialwork1(pd);
}
public void editSpecialwork2(PageData pd)throws Exception{
confinedspaceMapper.editSpecialwork2(pd);
}
public void editSpecialwork3(PageData pd)throws Exception{
confinedspaceMapper.editSpecialwork3(pd);
}
public void editSpecialwork4(PageData pd)throws Exception{
confinedspaceMapper.editSpecialwork4(pd);
}
public void editSpecialwork5(PageData pd)throws Exception{
confinedspaceMapper.editSpecialwork5(pd);
}
public void editSpecialwork6(PageData pd)throws Exception{
confinedspaceMapper.editSpecialwork6(pd);
}
public void editSpecialwork7(PageData pd)throws Exception{
confinedspaceMapper.editSpecialwork7(pd);
}
}

View File

@ -231,5 +231,36 @@ public class ElectricityServiceImpl implements ElectricityService {
public PageData getCode(PageData pd)throws Exception{
return electricityMapper.getCode(pd);
}
public void cancel(PageData pd)throws Exception{
electricityMapper.cancel(pd);
}
public PageData checkno(PageData pd)throws Exception{
return electricityMapper.checkno(pd);
}
public void editSpecialwork(PageData pd)throws Exception{
electricityMapper.editSpecialwork(pd);
}
public void editSpecialwork1(PageData pd)throws Exception{
electricityMapper.editSpecialwork1(pd);
}
public void editSpecialwork2(PageData pd)throws Exception{
electricityMapper.editSpecialwork2(pd);
}
public void editSpecialwork3(PageData pd)throws Exception{
electricityMapper.editSpecialwork3(pd);
}
public void editSpecialwork4(PageData pd)throws Exception{
electricityMapper.editSpecialwork4(pd);
}
public void editSpecialwork5(PageData pd)throws Exception{
electricityMapper.editSpecialwork5(pd);
}
public void editSpecialwork6(PageData pd)throws Exception{
electricityMapper.editSpecialwork6(pd);
}
public void editSpecialwork7(PageData pd)throws Exception{
electricityMapper.editSpecialwork7(pd);
}
}

View File

@ -151,6 +151,4 @@ public interface DictionariesService {
*/
public List<PageData> getIdsByParentIds(List<String> parentIds) throws Exception;
public List<PageData> getTreeById(String id) throws Exception;
}

View File

@ -256,16 +256,4 @@ public class DictionariesServiceImpl implements DictionariesService {
return dictionariesMapper.getIdsByParentIds(parentIds);
}
@Override
public List<PageData> getTreeById(String id) throws Exception {
List<Dictionaries> _list = this.listSubDictByParentId(id); //用传过来的ID获取此ID下的子列表数据
return _list.stream().map(n -> {
PageData entity = new PageData();
entity.put("DICTIONARIES_ID", n.getDICTIONARIES_ID());
entity.put("BIANMA", n.getBIANMA());
entity.put("NAME", n.getNAME());
return entity;
}).collect(Collectors.toList());
}
}

View File

@ -1,3 +1,5 @@
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=root
@ -68,15 +70,6 @@ smb.user=root
smb.password=Zcloud@zcloud88888
smb.basePath=/mnt/qgfile/file/
# 沧州矿石用户标识
czks-useridentity=CZKS
czks-baseimgpath=https://qgqy.qhdsafety.com/file/
czks-backendaddr=http://192.168.0.31:7811/qa-prevention-gwj/
# 港务局用户标识
gwj-useridentity=GWJ
gwj-baseimgpath=https://qgqy.qhdsafety.com/file/
gwj-backendaddr=http://192.168.0.31:8991/qa-prevention-gwj/
#Mq\u914D\u7F6E
rocketmq.consumer.group2=edu-admin-edit
rocketmq.consumer.group1=edu-admin-add
@ -91,18 +84,12 @@ rocketmq.producer.retry-times-when-send-failed=3
rocketmq.producer.retry-next-server=true
rocketmq.producer.retry-times-when-send-async-failed=3
## topic \u524D\u7F00
mq.topic.info=info
mq.topic.eightWork=eightWork
mq.group.info=scheduled_tasks
mq.group.eightWork=scheduled_tasks_eightWork
#对接人员定位
perLoc.url=http://192.168.210.32:8084
perLoc.userName=qaaqadmin
perLoc.pwd=Cfd2023@
#数据同步
mq.topic.docking=docking
mq.group.docking=scheduled_tasks_docking
base.info.USER_IDENTITY=GWJ
base.info.baseImgPath=https://qgqy.qhdsafety.com/file/
base.info.BACKENDADDR=http://192.168.0.31:8992/qa-regulatory-gwj/
corp.default.pic-path=https://qgqy.qhdsafety.com/file/
corp.default.back-end-path=https://skqhdg.porthebei.com:9004/file/

View File

@ -64,6 +64,25 @@ smb.port=22
smb.user=root
smb.password=SJSKAQHBGLXT@20220311
smb.basePath=/mnt/qask/file/
#Mq\u914D\u7F6E
rocketmq.consumer.group2=edu-admin-edit
rocketmq.consumer.group1=edu-admin-add
#rocketmq.name-server=10.0.140.141:9876
#rocketmq.name-server=192.168.0.70:9876
rocketmq.name-server=192.168.192.201:9876
rocketmq.producer.group=libmiddle
rocketmq.producer.send-message-timeout=3000
rocketmq.producer.compress-message-body-threshold=4096
rocketmq.producer.max-message-size=4194304
rocketmq.producer.retry-times-when-send-failed=3
rocketmq.producer.retry-next-server=true
rocketmq.producer.retry-times-when-send-async-failed=3
## topic \u524D\u7F00
mq.topic.info=info
mq.topic.eightWork=eightWork
mq.group.info=scheduled_tasks
mq.group.eightWork=scheduled_tasks_eightWork
# 沧州矿石用户标识
czks-useridentity=CZKS

View File

@ -1,65 +1,65 @@
<?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.bus.ShiftWorkRulesMapper">
<!--表名 -->
<sql id="tableName">
BUS_SHIFTWORKRULES
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.NAME,
f.CORPINFO_ID,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.NAME,
f.CORPINFO_ID,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.PARENTID,
f.LEVEL,
f.ISCUSTOM,
f.SHIFTWORKRULES_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
NAME,
CORPINFO_ID,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
NAME,
CORPINFO_ID,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
PARENTID,
LEVEL,
ISCUSTOM,
SHIFTWORKRULES_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{NAME},
#{CORPINFO_ID},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{NAME},
#{CORPINFO_ID},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{PARENTID},
#{LEVEL},
#{ISCUSTOM},
#{SHIFTWORKRULES_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
@ -67,7 +67,7 @@
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
@ -76,10 +76,10 @@
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
where
SHIFTWORKRULES_ID = #{SHIFTWORKRULES_ID}
</delete>
<!-- 删除-->
<delete id="deleteByPar" parameterType="pd">
update
@ -88,15 +88,15 @@
ISDELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
where
PARENTID = #{PARENTID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
set
<if test="NAME != null and NAME != ''"><!-- 关键词检索 -->
NAME = #{NAME},
</if>
@ -109,56 +109,57 @@
<if test="OPERATTIME != null and OPERATTIME != ''"><!-- 关键词检索 -->
OPERATTIME = #{OPERATTIME},
</if>
SHIFTWORKRULES_ID = SHIFTWORKRULES_ID
where
where
SHIFTWORKRULES_ID = #{SHIFTWORKRULES_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
select
<include refid="Field"></include>
from
from
<include refid="tableName"></include> f
where
where
f.SHIFTWORKRULES_ID = #{SHIFTWORKRULES_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
</if>
<if test="pd.PARENTID != null and pd.PARENTID != ''"><!-- 关键词检索 -->
and f.PARENTID = #{pd.PARENTID}
and f.PARENTID = #{pd.PARENTID}
</if>
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.LEVEL != null and pd.LEVEL != ''"><!-- 关键词检索 -->
and f.LEVEL = #{pd.LEVEL}
and f.LEVEL = #{pd.LEVEL}
</if>
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
SELECT
<include refid="Field"></include>
FROM
FROM
<include refid="tableName"></include> f
WHERE f.ISDELETE = '0'
AND f.CORPINFO_ID = #{CORPINFO_ID}
@ -166,21 +167,21 @@
AND f.PARENTID = #{PARENTID}
</if>
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
where
SHIFTWORKRULES_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 排班类型1是否使用 -->
<select id="isUseOne" parameterType="pd" resultType="int">
SELECT COUNT(1) FROM SYS_USER WHERE SHIFTDUTYONE = #{SHIFTWORKRULES_ID}

View File

@ -622,4 +622,103 @@
WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
</select>
<update id="cancel" parameterType="pd">
update
<include refid="tableName"></include>
set
APPLY_STATUS = #{APPLY_STATUS}
where
CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
</update>
<select id="checkno" parameterType="pd" resultType="pd">
SELECT
CONCAT_WS( " ", "受限空间作业", f.CHECK_NO ) AS CHECK_NO,
f.CONFINEDSPACE_ID AS ID
FROM
bus_confinedspace f
WHERE
f.CONFINEDSPACE_ID = #{CONFINEDSPACE_ID}
AND f.ISDELETE = '0'
</select>
<update id="editSpecialwork" parameterType = "pd">
update
bus_confinedspace f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork1" parameterType = "pd">
update
bus_blindboard f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork2" parameterType = "pd">
update
bus_electricity f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork3" parameterType = "pd">
update
bus_hoisting f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork4" parameterType = "pd">
update
bus_breakground f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork5" parameterType = "pd">
update
bus_cutroad f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork6" parameterType = "pd">
update
bus_highwork f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork7" parameterType = "pd">
update
bus_hotwork f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
</mapper>

View File

@ -675,4 +675,102 @@
WHERE f.CORPINFO_ID = #{CORPINFO_ID}
and f.CREATTIME LIKE CONCAT(#{CREATDATE},'%')
</select>
<update id="cancel" parameterType="pd">
update
<include refid="tableName"></include>
set
APPLY_STATUS = '-99'
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</update>
<select id="checkno" parameterType="pd" resultType="pd">
SELECT
CONCAT_WS( " ", "临时用电作业", f.CHECK_NO ) AS CHECK_NO
FROM
bus_electricity f
WHERE
f.ELECTRICITY_ID = #{ELECTRICITY_ID}
AND f.ISDELETE = '0'
</select>
<update id="editSpecialwork" parameterType = "pd">
update
bus_confinedspace f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork1" parameterType = "pd">
update
bus_blindboard f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork2" parameterType = "pd">
update
bus_electricity f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork3" parameterType = "pd">
update
bus_hoisting f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork4" parameterType = "pd">
update
bus_breakground f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork5" parameterType = "pd">
update
bus_cutroad f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork6" parameterType = "pd">
update
bus_highwork f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork7" parameterType = "pd">
update
bus_hotwork f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
</mapper>