|
@@ -6,11 +6,22 @@ import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import com.github.stuxuhai.jpinyin.PinyinException;
|
|
|
+import com.ruoyi.common.sendEmail.IMailService;
|
|
|
+import com.ruoyi.common.thread.furnance.FurnancePressureThread;
|
|
|
+import com.ruoyi.common.thread.furnance.FurnanceTemperatureThread;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
+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.FurnanceSummaryVO;
|
|
|
import com.ruoyi.project.production.controller.vo.FurnanceTemperatureVO;
|
|
|
import com.ruoyi.project.production.domain.TFurnanceTemperature;
|
|
|
import com.ruoyi.project.production.service.ITFurnancePressureService;
|
|
|
+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 org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -45,6 +56,18 @@ public class TFurnanceTemperatureController extends BaseController
|
|
|
@Autowired
|
|
|
private ITFurnancePressureService tFurnancePressureService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysDictTypeService iSysDictTypeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IMailService mailService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITStaffmgrService staffmgrService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 裂解炉测温列表Summary(APP)
|
|
|
*/
|
|
@@ -1318,15 +1341,50 @@ public class TFurnanceTemperatureController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('production:temperature:edit')")
|
|
|
@Log(title = "裂解炉炉管测温", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping("/editWeb")
|
|
|
- public AjaxResult editWeb(@RequestBody TFurnanceTemperature tFurnanceTemperature)
|
|
|
- {
|
|
|
+ public AjaxResult editWeb(@RequestBody TFurnanceTemperature tFurnanceTemperature) throws PinyinException {
|
|
|
String status = tFurnanceTemperature.getStatus();
|
|
|
// 烧焦状态不检查
|
|
|
if (!"2".equals(status)) {
|
|
|
+ String message = "";
|
|
|
+ String furnanceName = tFurnanceTemperature.getFurnanceName();
|
|
|
+ switch (furnanceName) {
|
|
|
+ case "H109":
|
|
|
+ message = this.checkTemperature109(tFurnanceTemperature);
|
|
|
+ break;
|
|
|
+ case "H110":
|
|
|
+ case "H111":
|
|
|
+ case "H112":
|
|
|
+ case "H113":
|
|
|
+ case "H114":
|
|
|
+ case "H115":
|
|
|
+ case "H116":
|
|
|
+ case "H117":
|
|
|
+ case "H118":
|
|
|
+ message = this.checkTemperature10x(tFurnanceTemperature);
|
|
|
+ break;
|
|
|
+ case "H130":
|
|
|
+ message = this.checkTemperature130(tFurnanceTemperature);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (!"".equals(message)) {
|
|
|
+ message = message.substring(0, message.length() - 1);
|
|
|
+ message += "温度>1080,请注意处理。";
|
|
|
+ // 发邮件
|
|
|
+ String mailMsg = furnanceName + message;
|
|
|
+ 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);
|
|
|
+ FurnanceTemperatureThread mailThread = new FurnanceTemperatureThread(mailService, staffmgr, sysUser.getUserName(), mailMsg + ",");
|
|
|
+ Thread thread = new Thread(mailThread);
|
|
|
+ thread.start();
|
|
|
+ }
|
|
|
+ }
|
|
|
// 检查数据是否包含负值或为Null
|
|
|
String msg = this.isNegativeOrNull(tFurnanceTemperature);
|
|
|
if ("".equals(msg)) {
|
|
|
- return toAjax(tFurnanceTemperatureService.updateTFurnanceTemperature(tFurnanceTemperature));
|
|
|
+ return AjaxResult.success(message, tFurnanceTemperatureService.updateTFurnanceTemperature(tFurnanceTemperature));
|
|
|
} else {
|
|
|
return AjaxResult.error("提交失败," + msg + "数据必须>=600,并且<=1300!");
|
|
|
}
|
|
@@ -1335,6 +1393,108 @@ public class TFurnanceTemperatureController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public String checkTemperature10x(TFurnanceTemperature furnanceTemperature) {
|
|
|
+ String msg = "";
|
|
|
+ String pass1 = furnanceTemperature.getPass1();
|
|
|
+ String pass2 = furnanceTemperature.getPass2();
|
|
|
+ String pass3 = furnanceTemperature.getPass3();
|
|
|
+ String pass4 = furnanceTemperature.getPass4();
|
|
|
+ String pass5 = furnanceTemperature.getPass5();
|
|
|
+ String pass6 = furnanceTemperature.getPass6();
|
|
|
+ String pass7 = furnanceTemperature.getPass7();
|
|
|
+ String pass8 = furnanceTemperature.getPass8();
|
|
|
+ if (this.isGreaterThan1080(pass1)) {msg += "PASS1、";}
|
|
|
+ if (this.isGreaterThan1080(pass2)) {msg += "PASS2、";}
|
|
|
+ if (this.isGreaterThan1080(pass3)) {msg += "PASS3、";}
|
|
|
+ if (this.isGreaterThan1080(pass4)) {msg += "PASS4、";}
|
|
|
+ if (this.isGreaterThan1080(pass5)) {msg += "PASS5、";}
|
|
|
+ if (this.isGreaterThan1080(pass6)) {msg += "PASS6、";}
|
|
|
+ if (this.isGreaterThan1080(pass7)) {msg += "PASS7、";}
|
|
|
+ if (this.isGreaterThan1080(pass8)) {msg += "PASS8、";}
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ public String checkTemperature109(TFurnanceTemperature furnanceTemperature) {
|
|
|
+ String msg = "";
|
|
|
+ String pass1 = furnanceTemperature.getPass1();
|
|
|
+ String pass2 = furnanceTemperature.getPass2();
|
|
|
+ String pass3 = furnanceTemperature.getPass3();
|
|
|
+ String pass4 = furnanceTemperature.getPass4();
|
|
|
+ String pass5 = furnanceTemperature.getPass5();
|
|
|
+ String pass6 = furnanceTemperature.getPass6();
|
|
|
+ String pass7 = furnanceTemperature.getPass7();
|
|
|
+ String pass8 = furnanceTemperature.getPass8();
|
|
|
+ String pass9 = furnanceTemperature.getPass9();
|
|
|
+ String pass10 = furnanceTemperature.getPass10();
|
|
|
+ String pass11 = furnanceTemperature.getPass11();
|
|
|
+ String pass12 = furnanceTemperature.getPass12();
|
|
|
+ String pass13 = furnanceTemperature.getPass13();
|
|
|
+ String pass14 = furnanceTemperature.getPass14();
|
|
|
+ String pass15 = furnanceTemperature.getPass15();
|
|
|
+ String pass16 = furnanceTemperature.getPass16();
|
|
|
+ if (this.isGreaterThan1080(pass1)) {msg += "PASS1出口左、";}
|
|
|
+ if (this.isGreaterThan1080(pass2)) {msg += "PASS1出口右、";}
|
|
|
+ if (this.isGreaterThan1080(pass3)) {msg += "PASS2出口左、";}
|
|
|
+ if (this.isGreaterThan1080(pass4)) {msg += "PASS2出口右、";}
|
|
|
+ if (this.isGreaterThan1080(pass5)) {msg += "PASS3出口左、";}
|
|
|
+ if (this.isGreaterThan1080(pass6)) {msg += "PASS3出口右、";}
|
|
|
+ if (this.isGreaterThan1080(pass7)) {msg += "PASS4出口左、";}
|
|
|
+ if (this.isGreaterThan1080(pass8)) {msg += "PASS4出口右、";}
|
|
|
+ if (this.isGreaterThan1080(pass9)) {msg += "PASS5出口左、";}
|
|
|
+ if (this.isGreaterThan1080(pass10)) {msg += "PASS5出口右、";}
|
|
|
+ if (this.isGreaterThan1080(pass11)) {msg += "PASS6出口左、";}
|
|
|
+ if (this.isGreaterThan1080(pass12)) {msg += "PASS6出口右、";}
|
|
|
+ if (this.isGreaterThan1080(pass13)) {msg += "PASS7出口左、";}
|
|
|
+ if (this.isGreaterThan1080(pass14)) {msg += "PASS7出口右、";}
|
|
|
+ if (this.isGreaterThan1080(pass15)) {msg += "PASS8出口左、";}
|
|
|
+ if (this.isGreaterThan1080(pass16)) {msg += "PASS8出口右、";}
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ public String checkTemperature130(TFurnanceTemperature furnanceTemperature) {
|
|
|
+ String msg = "";
|
|
|
+ String pass1 = furnanceTemperature.getPass1();
|
|
|
+ String pass2 = furnanceTemperature.getPass2();
|
|
|
+ String pass3 = furnanceTemperature.getPass3();
|
|
|
+ String pass4 = furnanceTemperature.getPass4();
|
|
|
+ String pass5 = furnanceTemperature.getPass5();
|
|
|
+ String pass6 = furnanceTemperature.getPass6();
|
|
|
+ String pass7 = furnanceTemperature.getPass7();
|
|
|
+ String pass8 = furnanceTemperature.getPass8();
|
|
|
+ String pass9 = furnanceTemperature.getPass9();
|
|
|
+ String pass10 = furnanceTemperature.getPass10();
|
|
|
+ String pass11 = furnanceTemperature.getPass11();
|
|
|
+ String pass12 = furnanceTemperature.getPass12();
|
|
|
+ if (this.isGreaterThan1080(pass1)) {msg += "PASS1、";}
|
|
|
+ if (this.isGreaterThan1080(pass2)) {msg += "PASS2、";}
|
|
|
+ if (this.isGreaterThan1080(pass3)) {msg += "PASS3、";}
|
|
|
+ if (this.isGreaterThan1080(pass4)) {msg += "PASS4、";}
|
|
|
+ if (this.isGreaterThan1080(pass5)) {msg += "PASS5、";}
|
|
|
+ if (this.isGreaterThan1080(pass6)) {msg += "PASS6、";}
|
|
|
+ if (this.isGreaterThan1080(pass7)) {msg += "PASS7、";}
|
|
|
+ if (this.isGreaterThan1080(pass8)) {msg += "PASS8、";}
|
|
|
+ if (this.isGreaterThan1080(pass9)) {msg += "PASS9、";}
|
|
|
+ if (this.isGreaterThan1080(pass10)) {msg += "PASS10、";}
|
|
|
+ if (this.isGreaterThan1080(pass11)) {msg += "PASS11、";}
|
|
|
+ if (this.isGreaterThan1080(pass12)) {msg += "PASS12、";}
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isGreaterThan1080(String pass) {
|
|
|
+ boolean flag = false;
|
|
|
+ if (StringUtils.isNotNull(pass) && StringUtils.isNotEmpty(pass)) {
|
|
|
+ String[] split = pass.split(",");
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ if (!StringUtils.isNull(split[i]) && !StringUtils.isEmpty(split[i])) {
|
|
|
+ int element = Integer.parseInt(split[i]);
|
|
|
+ if (element >= 1080) {
|
|
|
+ flag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
+
|
|
|
public String isNegativeOrNull(TFurnanceTemperature tFurnanceTemperature) {
|
|
|
String pass1 = tFurnanceTemperature.getPass1();
|
|
|
String pass2 = tFurnanceTemperature.getPass2();
|