合并线上代码
parent
ab8937ed18
commit
9843400cb3
|
@ -6,6 +6,7 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
||||||
import com.zcloud.controller.base.BaseController;
|
import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.logs.LogAnno;
|
||||||
import com.zcloud.service.bus.CorpInfoService;
|
import com.zcloud.service.bus.CorpInfoService;
|
||||||
import com.zcloud.service.bus.MSMLoginService;
|
import com.zcloud.service.bus.MSMLoginService;
|
||||||
import com.zcloud.service.bus.NoticeCorpService;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -58,6 +57,9 @@ public class AppConfinedSpaceController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private NoticeCorpService noticeCorpService;
|
private NoticeCorpService noticeCorpService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SendMessageUtil sendMessageUtil;
|
||||||
|
|
||||||
/**新增
|
/**新增
|
||||||
* @param
|
* @param
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
@ -551,4 +553,93 @@ public class AppConfinedSpaceController extends BaseController {
|
||||||
map.put("count", count);
|
map.put("count", count);
|
||||||
return map;
|
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 ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
||||||
import com.zcloud.controller.base.BaseController;
|
import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.logs.LogAnno;
|
||||||
import com.zcloud.service.bus.CorpInfoService;
|
import com.zcloud.service.bus.CorpInfoService;
|
||||||
import com.zcloud.service.bus.MSMLoginService;
|
import com.zcloud.service.bus.MSMLoginService;
|
||||||
import com.zcloud.service.bus.NoticeCorpService;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,6 +61,9 @@ public class AppElectricityController extends BaseController {
|
||||||
private NoticeCorpService noticeCorpService;
|
private NoticeCorpService noticeCorpService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private DepartmentService departmentService;
|
private DepartmentService departmentService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SendMessageUtil sendMessageUtil;
|
||||||
/**新增
|
/**新增
|
||||||
* @param
|
* @param
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
@ -1160,4 +1164,95 @@ public class AppElectricityController extends BaseController {
|
||||||
map.put("count", count);
|
map.put("count", count);
|
||||||
return map;
|
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 ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,22 +88,24 @@ public class AppHomeController extends BaseController {
|
||||||
if(!Tools.isEmpty(pd.get("USER_ID"))){
|
if(!Tools.isEmpty(pd.get("USER_ID"))){
|
||||||
varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID"));
|
varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID"));
|
||||||
PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID"));
|
PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID"));
|
||||||
if (varList.size() > 0) {
|
if (Integer.parseInt(delayedCount.getString("count")) != 0) {
|
||||||
boolean isDelayedExist = false;
|
if (varList.size() > 0) {
|
||||||
for (PageData data : varList) {
|
boolean isDelayedExist = false;
|
||||||
if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true;
|
for (PageData data : varList) {
|
||||||
}
|
if (StringUtils.equals(data.getString("STATE"), "10")) isDelayedExist = true;
|
||||||
if (isDelayedExist) {
|
}
|
||||||
for (PageData pageData : varList){
|
if (isDelayedExist) {
|
||||||
if (StringUtils.equals(pageData.getString("STATE"),"10")) {
|
for (PageData pageData : varList) {
|
||||||
pageData.put("count",delayedCount.getString("count"));
|
if (StringUtils.equals(pageData.getString("STATE"), "10")) {
|
||||||
|
pageData.put("count", delayedCount.getString("count"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
varList.add(delayedCount);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
varList.add(delayedCount);
|
varList.add(delayedCount);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
varList.add(delayedCount);
|
|
||||||
}
|
}
|
||||||
myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID"));
|
myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID"));
|
||||||
}
|
}
|
||||||
|
@ -146,22 +148,24 @@ public class AppHomeController extends BaseController {
|
||||||
if(!Tools.isEmpty(pd.get("USER_ID"))){
|
if(!Tools.isEmpty(pd.get("USER_ID"))){
|
||||||
varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID"));
|
varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID"));
|
||||||
PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID"));
|
PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID"));
|
||||||
if (varList.size() > 0) {
|
if (Integer.parseInt(delayedCount.getString("count")) != 0) {
|
||||||
boolean isDelayedExist = false;
|
if (varList.size() > 0) {
|
||||||
for (PageData data : varList) {
|
boolean isDelayedExist = false;
|
||||||
if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true;
|
for (PageData data : varList) {
|
||||||
}
|
if (StringUtils.equals(data.getString("STATE"), "10")) isDelayedExist = true;
|
||||||
if (isDelayedExist) {
|
}
|
||||||
for (PageData pageData : varList){
|
if (isDelayedExist) {
|
||||||
if (StringUtils.equals(pageData.getString("STATE"),"10")) {
|
for (PageData pageData : varList) {
|
||||||
pageData.put("count",delayedCount.getString("count"));
|
if (StringUtils.equals(pageData.getString("STATE"), "10")) {
|
||||||
|
pageData.put("count", delayedCount.getString("count"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
varList.add(delayedCount);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
varList.add(delayedCount);
|
varList.add(delayedCount);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
varList.add(delayedCount);
|
|
||||||
}
|
}
|
||||||
myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID"));
|
myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -746,42 +746,44 @@ public class AppHotWorkApplicationController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PageData hotUser = new PageData();
|
PageData hotUser = new PageData();
|
||||||
hotUser.put("hotIds", hotIds);
|
if (hotIds.size() > 0) {
|
||||||
List<PageData> hotUserAllList = hotWorkApplicationUserService.listAll(hotUser);
|
hotUser.put("hotIds", hotIds);
|
||||||
for (PageData userPageData : hotUserAllList){
|
List<PageData> hotUserAllList = hotWorkApplicationUserService.listAll(hotUser);
|
||||||
String hotAndType = userPageData.getString("FOREIGN_KEY");
|
for (PageData userPageData : hotUserAllList){
|
||||||
if(hotIdKeyMap.containsKey(hotAndType)){
|
String hotAndType = userPageData.getString("FOREIGN_KEY");
|
||||||
PageData hot = varList.get(hotIdKeyMap.get(hotAndType));
|
if(hotIdKeyMap.containsKey(hotAndType)){
|
||||||
String type = userPageData.get("STATE").toString();
|
PageData hot = varList.get(hotIdKeyMap.get(hotAndType));
|
||||||
if("0".equals(type)){ // 申请办理人
|
String type = userPageData.get("STATE").toString();
|
||||||
hot.put("APPLY_DEPARTMENT_NAME",userPageData.getString("deptName"));
|
if("0".equals(type)){ // 申请办理人
|
||||||
hot.put("APPLY_USER_NAME",userPageData.getString("userName"));
|
hot.put("APPLY_DEPARTMENT_NAME",userPageData.getString("deptName"));
|
||||||
hot.put("APPLY_USER_ID",userPageData.getString("USER_ID"));
|
hot.put("APPLY_USER_NAME",userPageData.getString("userName"));
|
||||||
}else if("1".equals(type)){ //动火单位负责人
|
hot.put("APPLY_USER_ID",userPageData.getString("USER_ID"));
|
||||||
hot.put("HOT_WORK_UNIT_LEADER_NAME",userPageData.getString("userName"));
|
}else if("1".equals(type)){ //动火单位负责人
|
||||||
hot.put("HOT_WORK_UNIT_LEADER_ID",userPageData.getString("USER_ID"));
|
hot.put("HOT_WORK_UNIT_LEADER_NAME",userPageData.getString("userName"));
|
||||||
}else if("2".equals(type)){ // 项目发包单位负责人
|
hot.put("HOT_WORK_UNIT_LEADER_ID",userPageData.getString("USER_ID"));
|
||||||
hot.put("PROJECT_UNIT_LEADER_NAME",userPageData.getString("userName"));
|
}else if("2".equals(type)){ // 项目发包单位负责人
|
||||||
hot.put("PROJECT_UNIT_LEADER_ID",userPageData.getString("USER_ID"));
|
hot.put("PROJECT_UNIT_LEADER_NAME",userPageData.getString("userName"));
|
||||||
}else if("3".equals(type)){ // 现场管辖单位负责人
|
hot.put("PROJECT_UNIT_LEADER_ID",userPageData.getString("USER_ID"));
|
||||||
hot.put("UNIT_LEADER_NAME",userPageData.getString("userName"));
|
}else if("3".equals(type)){ // 现场管辖单位负责人
|
||||||
hot.put("UNIT_LEADER_ID",userPageData.getString("USER_ID"));
|
hot.put("UNIT_LEADER_NAME",userPageData.getString("userName"));
|
||||||
}else if("5".equals(type)){ // 动火前 负责人
|
hot.put("UNIT_LEADER_ID",userPageData.getString("USER_ID"));
|
||||||
hot.put("HOT_WORK_BEFORE_UNIT_LEADER",userPageData.getString("userName"));
|
}else if("5".equals(type)){ // 动火前 负责人
|
||||||
}else if("6".equals(type)){ // 现场负责人
|
hot.put("HOT_WORK_BEFORE_UNIT_LEADER",userPageData.getString("userName"));
|
||||||
hot.put("SITE_LEADER_NAME",userPageData.getString("userName"));
|
}else if("6".equals(type)){ // 现场负责人
|
||||||
hot.put("SITE_LEADER_PHONE",userPageData.getString("userPhone"));
|
hot.put("SITE_LEADER_NAME",userPageData.getString("userName"));
|
||||||
}else if("7".equals(type)){ // 动火后 负责人
|
hot.put("SITE_LEADER_PHONE",userPageData.getString("userPhone"));
|
||||||
hot.put("HOT_WORK_AFTER_UNIT_LEADER",userPageData.getString("userName"));
|
}else if("7".equals(type)){ // 动火后 负责人
|
||||||
} else if("11".equals(type)){ // 特级动火 申请人
|
hot.put("HOT_WORK_AFTER_UNIT_LEADER",userPageData.getString("userName"));
|
||||||
hot.put("DEPARTMENT_PERSONNEL_NAME",userPageData.getString("userName"));
|
} else if("11".equals(type)){ // 特级动火 申请人
|
||||||
hot.put("DEPARTMENT_PERSONNEL_ID",userPageData.getString("USER_ID"));
|
hot.put("DEPARTMENT_PERSONNEL_NAME",userPageData.getString("userName"));
|
||||||
}else if("20".equals(type)){ // 特级动火 申请人
|
hot.put("DEPARTMENT_PERSONNEL_ID",userPageData.getString("USER_ID"));
|
||||||
hot.put("SUPERVISOR_OF_HOT_WORK_UNIT",userPageData.getString("USER_ID"));
|
}else if("20".equals(type)){ // 特级动火 申请人
|
||||||
}else if("21".equals(type)){ // 动火后 负责人
|
hot.put("SUPERVISOR_OF_HOT_WORK_UNIT",userPageData.getString("USER_ID"));
|
||||||
String userName = userPageData.getString("userName2") +",";
|
}else if("21".equals(type)){ // 动火后 负责人
|
||||||
String oldName = Tools.isEmpty(pd.get("HOT_WORK_OPERATOR_NAME"))?"":pd.get("HOT_WORK_OPERATOR_NAME").toString();
|
String userName = userPageData.getString("userName2") +",";
|
||||||
hot.put("HOT_WORK_OPERATOR_NAME",oldName + userName);
|
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"))){
|
if(!Tools.isEmpty(pd.get("USER_ID"))){
|
||||||
varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID"));
|
varList = hotworkapplicationService.getCountByMyApproval(pd.getString("USER_ID"));
|
||||||
PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID"));
|
PageData delayedCount = hotworkapplicationService.getCountByMyApprovalForDelayedHotWork(pd.getString("USER_ID"));
|
||||||
if (varList.size() > 0) {
|
if (Integer.parseInt(delayedCount.getString("count")) != 0) {
|
||||||
boolean isDelayedExist = false;
|
if (varList.size() > 0) {
|
||||||
for (PageData data : varList) {
|
boolean isDelayedExist = false;
|
||||||
if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true;
|
for (PageData data : varList) {
|
||||||
}
|
if (StringUtils.equals(data.getString("STATE"),"10")) isDelayedExist = true;
|
||||||
if (isDelayedExist) {
|
}
|
||||||
for (PageData pageData : varList){
|
if (isDelayedExist) {
|
||||||
if (StringUtils.equals(pageData.getString("STATE"),"10")) {
|
for (PageData pageData : varList){
|
||||||
pageData.put("count",delayedCount.getString("count"));
|
if (StringUtils.equals(pageData.getString("STATE"),"10")) {
|
||||||
|
pageData.put("count",delayedCount.getString("count"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
varList.add(delayedCount);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
varList.add(delayedCount);
|
varList.add(delayedCount);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
varList.add(delayedCount);
|
|
||||||
}
|
}
|
||||||
myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID"));
|
myGasAnaly = hotworkapplicationService.getCountByMyGasAnaly(pd.getString("USER_ID"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,12 @@ package com.zcloud.controller.gf;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zcloud.controller.base.BaseController;
|
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.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.mq.util.TenCorpConst;
|
|
||||||
import com.zcloud.service.gf.*;
|
import com.zcloud.service.gf.*;
|
||||||
|
import com.zcloud.service.mq.SendMessageService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.multipart.MultipartRequest;
|
import org.springframework.web.multipart.MultipartRequest;
|
||||||
import com.zcloud.mq.service.SendMessageService;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
|
|
@ -3,12 +3,12 @@ package com.zcloud.controller.gf;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zcloud.controller.base.BaseController;
|
import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.dto.mq.Response;
|
import com.zcloud.dto.TenCorpConst;
|
||||||
import com.zcloud.dto.mq.TenCorpDto;
|
import com.zcloud.dto.TenCorpDto;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.mq.util.TenCorpConst;
|
|
||||||
import com.zcloud.service.gf.*;
|
import com.zcloud.service.gf.*;
|
||||||
|
import com.zcloud.service.mq.SendMessageService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.multipart.MultipartRequest;
|
import org.springframework.web.multipart.MultipartRequest;
|
||||||
import com.zcloud.mq.service.SendMessageService;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
@ -182,8 +181,6 @@ public class AppGFElectricityController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**删除
|
/**删除
|
||||||
* @param out
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/delete")
|
@RequestMapping(value="/delete")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
@ -3,13 +3,12 @@ package com.zcloud.controller.gf;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zcloud.controller.base.BaseController;
|
import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.dto.mq.Response;
|
import com.zcloud.dto.TenCorpConst;
|
||||||
import com.zcloud.dto.mq.TenCorpDto;
|
import com.zcloud.dto.TenCorpDto;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.mq.service.SendMessageService;
|
|
||||||
import com.zcloud.mq.util.TenCorpConst;
|
|
||||||
import com.zcloud.service.gf.*;
|
import com.zcloud.service.gf.*;
|
||||||
|
import com.zcloud.service.mq.SendMessageService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -195,8 +194,6 @@ public class AppGFHotworkController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**修改
|
/**修改
|
||||||
* @param
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/edit")
|
@RequestMapping(value="/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.zcloud.controller.mq;
|
package com.zcloud.controller.mq;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
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.controller.app.highriskwork.AppHotworkCfdController;
|
||||||
import com.zcloud.dto.TenCorpDto;
|
import com.zcloud.dto.TenCorpDto;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
@ -30,10 +32,10 @@ import java.util.Date;
|
||||||
public class EightWorkListener implements RocketMQListener<String> {
|
public class EightWorkListener implements RocketMQListener<String> {
|
||||||
|
|
||||||
|
|
||||||
// @Resource
|
@Resource
|
||||||
// private AppConfinedSpaceController appConfinedSpaceController;
|
private AppConfinedSpaceController appConfinedSpaceController;
|
||||||
// @Resource
|
@Resource
|
||||||
// private AppElectricityController appElectricityController;
|
private AppElectricityController appElectricityController;
|
||||||
@Resource
|
@Resource
|
||||||
private AppHotworkCfdController appHotworkCfdController;
|
private AppHotworkCfdController appHotworkCfdController;
|
||||||
|
|
||||||
|
@ -64,11 +66,11 @@ public class EightWorkListener implements RocketMQListener<String> {
|
||||||
switch (data.getMessage()){
|
switch (data.getMessage()){
|
||||||
case "confined-space":
|
case "confined-space":
|
||||||
System.out.println("受限空间模块消费");
|
System.out.println("受限空间模块消费");
|
||||||
// appConfinedSpaceController.cancel(data.getData());
|
appConfinedSpaceController.cancel(data.getData());
|
||||||
break;
|
break;
|
||||||
case "electricity":
|
case "electricity":
|
||||||
System.out.println("临时用电模块消费");
|
System.out.println("临时用电模块消费");
|
||||||
// appElectricityController.cancel(data.getData());
|
appElectricityController.cancel(data.getData());
|
||||||
break;
|
break;
|
||||||
case "hot-work":
|
case "hot-work":
|
||||||
System.out.println("动火模块消费");
|
System.out.println("动火模块消费");
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -63,5 +63,15 @@ public interface ConfinedSpaceMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PageData countCheck(PageData pd);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,5 +77,16 @@ public interface ElectricityMapper{
|
||||||
*/
|
*/
|
||||||
int numberCheck(PageData pd);
|
int numberCheck(PageData pd);
|
||||||
PageData getCode(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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -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());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -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";
|
|
||||||
}
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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";
|
|
||||||
}
|
|
|
@ -64,5 +64,15 @@ public interface ConfinedSpaceService {
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
PageData countCheck(PageData pd)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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,5 +78,16 @@ public interface ElectricityService{
|
||||||
public int numberCheck(PageData pd)throws Exception;
|
public int numberCheck(PageData pd)throws Exception;
|
||||||
|
|
||||||
PageData getCode(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,5 +118,38 @@ public class ConfinedSpaceServiceImpl implements ConfinedSpaceService {
|
||||||
public PageData countCheck(PageData pd) throws Exception {
|
public PageData countCheck(PageData pd) throws Exception {
|
||||||
return confinedspaceMapper.countCheck(pd);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,5 +231,36 @@ public class ElectricityServiceImpl implements ElectricityService {
|
||||||
public PageData getCode(PageData pd)throws Exception{
|
public PageData getCode(PageData pd)throws Exception{
|
||||||
return electricityMapper.getCode(pd);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,7 @@
|
||||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
and
|
and
|
||||||
(
|
(
|
||||||
|
NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
<!-- 根据需求自己加检索条件
|
<!-- 根据需求自己加检索条件
|
||||||
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
or
|
or
|
||||||
|
|
|
@ -622,4 +622,103 @@
|
||||||
WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
|
WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
|
@ -675,4 +675,102 @@
|
||||||
WHERE f.CORPINFO_ID = #{CORPINFO_ID}
|
WHERE f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
and f.CREATTIME LIKE CONCAT(#{CREATDATE},'%')
|
and f.CREATTIME LIKE CONCAT(#{CREATDATE},'%')
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue