|
@@ -9,12 +9,17 @@ import java.util.*;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.github.stuxuhai.jpinyin.PinyinException;
|
|
|
+import com.ruoyi.common.sendEmail.IMailService;
|
|
|
+import com.ruoyi.common.thread.furnance.FurnancePressureThread;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
import com.ruoyi.framework.config.RuoYiConfig;
|
|
|
import com.ruoyi.framework.task.FurnanceTask;
|
|
|
import com.ruoyi.project.common.domain.TCommonfile;
|
|
|
import com.ruoyi.project.common.service.ITCommonfileService;
|
|
|
+import com.ruoyi.project.plant.domain.TStaffmgr;
|
|
|
+import com.ruoyi.project.plant.service.ITStaffmgrService;
|
|
|
import com.ruoyi.project.production.controller.vo.FurnancePressureFvpVO;
|
|
|
import com.ruoyi.project.production.controller.vo.FurnancePressureVO;
|
|
|
import com.ruoyi.project.production.controller.vo.FurnanceSummaryVO;
|
|
@@ -22,6 +27,10 @@ import com.ruoyi.project.production.controller.vo.FvpAnalysisQueryVO;
|
|
|
import com.ruoyi.project.production.domain.TFurnanceTemperature;
|
|
|
import com.ruoyi.project.production.mapper.TFurnancePressureMapper;
|
|
|
import com.ruoyi.project.production.service.ITFurnanceTemperatureService;
|
|
|
+import com.ruoyi.project.system.domain.SysDictData;
|
|
|
+import com.ruoyi.project.system.domain.SysUser;
|
|
|
+import com.ruoyi.project.system.service.ISysDictTypeService;
|
|
|
+import com.ruoyi.project.system.service.ISysUserService;
|
|
|
import net.sf.jsqlparser.statement.select.ExceptOp;
|
|
|
import org.apache.http.HttpEntity;
|
|
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
@@ -74,6 +83,18 @@ public class TFurnancePressureController extends BaseController {
|
|
|
@Autowired
|
|
|
private RuoYiConfig ruoyiConfig;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysDictTypeService iSysDictTypeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IMailService mailService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITStaffmgrService staffmgrService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 删除裂解炉Pass图片(APP)
|
|
|
*/
|
|
@@ -3543,7 +3564,7 @@ public class TFurnancePressureController extends BaseController {
|
|
|
@PreAuthorize("@ss.hasPermi('production:pressure:edit')")
|
|
|
@Log(title = "裂解炉炉管测压", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping("/editWeb")
|
|
|
- public AjaxResult editWeb(@RequestBody TFurnancePressure tFurnancePressure) {
|
|
|
+ public AjaxResult editWeb(@RequestBody TFurnancePressure tFurnancePressure) throws PinyinException {
|
|
|
// 检查数据是否包含负值或为Null
|
|
|
if (!this.isNegativeOrNull(tFurnancePressure)) {
|
|
|
//更新
|
|
@@ -3600,12 +3621,23 @@ public class TFurnancePressureController extends BaseController {
|
|
|
break;
|
|
|
case "H130":
|
|
|
FurnancePressureFvpVO furnancePressureFvpVO130 = this.calcRatio130(list);
|
|
|
- msg = this.checkRatio(furnancePressureFvpVO130, pressure);
|
|
|
+ msg = this.checkRatio130(furnancePressureFvpVO130, pressure);
|
|
|
break;
|
|
|
}
|
|
|
if (!"".equals(msg)) {
|
|
|
msg = msg.substring(0, msg.length() - 1);
|
|
|
- msg += "压差过高,请注意处理。";
|
|
|
+ msg += "压差<0.45或>0.9,请注意处理。";
|
|
|
+ // 发邮件
|
|
|
+ String mailMsg = furnanceName + msg;
|
|
|
+ List<SysDictData> furnanceRecipientDict = iSysDictTypeService.selectDictDataByType("FURNANCE_RECIPIENT");
|
|
|
+ for (SysDictData sysDictData : furnanceRecipientDict) {
|
|
|
+ String dictValue = sysDictData.getDictValue();
|
|
|
+ TStaffmgr staffmgr = staffmgrService.selectTStaffmgrByStaffId(dictValue);
|
|
|
+ SysUser sysUser = userService.selectUserByStaffId(dictValue);
|
|
|
+ FurnancePressureThread mailThread = new FurnancePressureThread(mailService, staffmgr, sysUser.getUserName(), mailMsg);
|
|
|
+ Thread thread = new Thread(mailThread);
|
|
|
+ thread.start();
|
|
|
+ }
|
|
|
}
|
|
|
//更新
|
|
|
int result = tFurnancePressureService.updateTFurnancePressure(pressure);
|
|
@@ -3625,49 +3657,49 @@ public class TFurnancePressureController extends BaseController {
|
|
|
double pass6Ratio = vo.getPass6Ratio();
|
|
|
double pass7Ratio = vo.getPass7Ratio();
|
|
|
double pass8Ratio = vo.getPass8Ratio();
|
|
|
- if (pass1Ratio > 0.9) {
|
|
|
+ if (pass1Ratio > 0.9 || pass1Ratio < 0.45) {
|
|
|
pressure.setPass1RatioExceeded(true);
|
|
|
msg += "PASS 1、";
|
|
|
} else {
|
|
|
pressure.setPass1RatioExceeded(false);
|
|
|
}
|
|
|
- if (pass2Ratio > 0.9) {
|
|
|
+ if (pass2Ratio > 0.9 || pass2Ratio < 0.45) {
|
|
|
pressure.setPass2RatioExceeded(true);
|
|
|
msg += "PASS 2、";
|
|
|
} else {
|
|
|
pressure.setPass2RatioExceeded(false);
|
|
|
}
|
|
|
- if (pass3Ratio > 0.9) {
|
|
|
+ if (pass3Ratio > 0.9 || pass3Ratio < 0.45) {
|
|
|
msg += "PASS 3、";
|
|
|
pressure.setPass3RatioExceeded(true);
|
|
|
} else {
|
|
|
pressure.setPass3RatioExceeded(false);
|
|
|
}
|
|
|
- if (pass4Ratio > 0.9) {
|
|
|
+ if (pass4Ratio > 0.9 || pass4Ratio < 0.45) {
|
|
|
msg += "PASS 4、";
|
|
|
pressure.setPass4RatioExceeded(true);
|
|
|
} else {
|
|
|
pressure.setPass4RatioExceeded(false);
|
|
|
}
|
|
|
- if (pass5Ratio > 0.9) {
|
|
|
+ if (pass5Ratio > 0.9 || pass5Ratio < 0.45) {
|
|
|
msg += "PASS 5、";
|
|
|
pressure.setPass5RatioExceeded(true);
|
|
|
} else {
|
|
|
pressure.setPass5RatioExceeded(false);
|
|
|
}
|
|
|
- if (pass6Ratio > 0.9) {
|
|
|
+ if (pass6Ratio > 0.9 || pass6Ratio < 0.45) {
|
|
|
msg += "PASS 6、";
|
|
|
pressure.setPass6RatioExceeded(true);
|
|
|
} else {
|
|
|
pressure.setPass6RatioExceeded(false);
|
|
|
}
|
|
|
- if (pass7Ratio > 0.9) {
|
|
|
+ if (pass7Ratio > 0.9 || pass7Ratio < 0.45) {
|
|
|
msg += "PASS 7、";
|
|
|
pressure.setPass7RatioExceeded(true);
|
|
|
} else {
|
|
|
pressure.setPass7RatioExceeded(false);
|
|
|
}
|
|
|
- if (pass8Ratio > 0.9) {
|
|
|
+ if (pass8Ratio > 0.9 || pass8Ratio < 0.45) {
|
|
|
msg += "PASS 8、";
|
|
|
pressure.setPass8RatioExceeded(true);
|
|
|
} else {
|
|
@@ -3676,6 +3708,39 @@ public class TFurnancePressureController extends BaseController {
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
|
+ public String checkRatio130(FurnancePressureFvpVO vo, TFurnancePressure pressure) {
|
|
|
+ String msg = "";
|
|
|
+ double pass1Ratio = vo.getPass1Ratio();
|
|
|
+ double pass2Ratio = vo.getPass2Ratio();
|
|
|
+ double pass3Ratio = vo.getPass3Ratio();
|
|
|
+ double pass4Ratio = vo.getPass4Ratio();
|
|
|
+ if (pass1Ratio > 0.9 || pass1Ratio < 0.45) {
|
|
|
+ pressure.setPass1RatioExceeded(true);
|
|
|
+ msg += "PASS 1、";
|
|
|
+ } else {
|
|
|
+ pressure.setPass1RatioExceeded(false);
|
|
|
+ }
|
|
|
+ if (pass2Ratio > 0.9 || pass2Ratio < 0.45) {
|
|
|
+ pressure.setPass2RatioExceeded(true);
|
|
|
+ msg += "PASS 2、";
|
|
|
+ } else {
|
|
|
+ pressure.setPass2RatioExceeded(false);
|
|
|
+ }
|
|
|
+ if (pass3Ratio > 0.9 || pass3Ratio < 0.45) {
|
|
|
+ msg += "PASS 3、";
|
|
|
+ pressure.setPass3RatioExceeded(true);
|
|
|
+ } else {
|
|
|
+ pressure.setPass3RatioExceeded(false);
|
|
|
+ }
|
|
|
+ if (pass4Ratio > 0.9 || pass4Ratio < 0.45) {
|
|
|
+ msg += "PASS 4、";
|
|
|
+ pressure.setPass4RatioExceeded(true);
|
|
|
+ } else {
|
|
|
+ pressure.setPass4RatioExceeded(false);
|
|
|
+ }
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 删除裂解炉炉管测压
|
|
|
*/
|