system:发送邮件完善
jindie:insert syspointrouter完善
master
xs 1 month ago
parent 122ca93cd2
commit 3478123c48

@ -37,6 +37,8 @@ public class SysFileController
SysFile sysFile = new SysFile(); SysFile sysFile = new SysFile();
sysFile.setName(FileUtils.getName(url)); sysFile.setName(FileUtils.getName(url));
sysFile.setUrl(url); sysFile.setUrl(url);
log.info("url:"+url);
log.info("name:"+sysFile.getName());
return R.ok(sysFile); return R.ok(sysFile);
} }
catch (Exception e) catch (Exception e)

@ -1381,8 +1381,9 @@ public class KingdeeErpSyncServiceImpl implements IKingdeeErpSyncService {
toUpdatePurchaseReceiveBillList.add(mesPurchaseReceiveBill); toUpdatePurchaseReceiveBillList.add(mesPurchaseReceiveBill);
} else { } else {
toInsertPurchaseReceiveBillList.add(mesPurchaseReceiveBill); toInsertPurchaseReceiveBillList.add(mesPurchaseReceiveBill);
notifyInfoBuilder.append(materialName).append("|").append(materialSpec).append("|").append(actlandAmount).append("|") notifyInfoBuilder.append("物料名称:").append(materialName).append("|物料规格:").append(materialSpec)
.append(preDeliveryDate).append("|").append(projectName) .append("|实到数量:").append(actlandAmount).append("|预计到货日期:")
.append(preDeliveryDate).append("|项目名称:").append(projectName)
.append(";"); .append(";");
} }
// System.out.println("l:"+resultArray.get(i).toString().length()); // System.out.println("l:"+resultArray.get(i).toString().length());

@ -1,6 +1,7 @@
package com.hw.system.common.service.impl; package com.hw.system.common.service.impl;
import java.rmi.ServerException; import java.rmi.ServerException;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -132,13 +133,11 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
String emailAccountInfo = redisService.getCacheObject(CacheConstants.SYS_EAMIL_ACCOUNT_INFO); String emailAccountInfo = redisService.getCacheObject(CacheConstants.SYS_EAMIL_ACCOUNT_INFO);
String emailAccount = ""; String emailAccount = "";
String emailPassword = ""; String emailPassword = "";
if(StringUtils.isNotEmpty(emailAccountInfo)){ if (StringUtils.isNotEmpty(emailAccountInfo)) {
int splitIndex = emailAccountInfo.indexOf(","); int splitIndex = emailAccountInfo.indexOf(",");
emailAccount = emailAccountInfo.substring(0,splitIndex); emailAccount = emailAccountInfo.substring(0, splitIndex);
emailPassword = emailAccountInfo.substring(splitIndex+1); emailPassword = emailAccountInfo.substring(splitIndex + 1);
} }
System.out.println(emailAccount+"e:"+emailPassword);
SysPointRouter queryPointRouter = new SysPointRouter(); SysPointRouter queryPointRouter = new SysPointRouter();
List<SysPointRouter> sysPointRouterList = sysPointRouterMapper.selectEmailNotifySysPointRouterList(queryPointRouter); List<SysPointRouter> sysPointRouterList = sysPointRouterMapper.selectEmailNotifySysPointRouterList(queryPointRouter);
@ -146,12 +145,31 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
Map<Long, List<SysPointRouter>> sysPointRouterMap = sysPointRouterList.stream() Map<Long, List<SysPointRouter>> sysPointRouterMap = sysPointRouterList.stream()
.filter(spo -> spo.getProcessActivityId() != null).collect(Collectors.groupingBy(SysPointRouter::getProcessActivityId)); .filter(spo -> spo.getProcessActivityId() != null).collect(Collectors.groupingBy(SysPointRouter::getProcessActivityId));
String emailTitle = "";
List<String> emailTitleList = new ArrayList<>();
for (Long processActivityId : sysPointRouterMap.keySet()) { for (Long processActivityId : sysPointRouterMap.keySet()) {
List<SysPointRouter> sysPointRoutersByActivityList = sysPointRouterMap.get(processActivityId); List<SysPointRouter> sysPointRoutersByActivityList = sysPointRouterMap.get(processActivityId);
List<SysUser> sysUsers = sysUserMapper.selectProcessActivityAuthUserList(processActivityId); List<SysUser> sysUsers = sysUserMapper.selectProcessActivityAuthUserList(processActivityId);
String sendMsg = ""; String sendMsg = "";
String colon = "";
for (SysPointRouter sysPointRouter : sysPointRoutersByActivityList) { for (SysPointRouter sysPointRouter : sysPointRoutersByActivityList) {
sendMsg += sysPointRouter.getRemark() + ";"; String remark = sysPointRouter.getRemark();
int colonIndex = remark.indexOf(colon);
if (colonIndex >= 0) {
emailTitle = remark.substring(0, colonIndex);
remark = remark.replaceFirst(colon, "\n\n");
}else{
emailTitle = remark;
}
emailTitle = emailTitle.length() > 30 ? emailTitle.substring(0, 30) : emailTitle;
if (!emailTitleList.contains(emailTitle)) {
emailTitleList.add(emailTitle);
}
remark = remark.replaceAll(";", "\n\n");
sendMsg += remark + "\n\n";
sysPointRouter.setSentEmailFlag("1"); sysPointRouter.setSentEmailFlag("1");
sysPointRouter.setUpdateTime(new Date()); sysPointRouter.setUpdateTime(new Date());
// sysPointRouter.setUpdateBy(SecurityUtils.getLoginUser().getNickname()); // sysPointRouter.setUpdateBy(SecurityUtils.getLoginUser().getNickname());
@ -160,7 +178,7 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService {
for (SysUser sysUser : sysUsers) { for (SysUser sysUser : sysUsers) {
if (StringUtils.isNotEmpty(sysUser.getEmail())) { if (StringUtils.isNotEmpty(sysUser.getEmail())) {
MailUtils.processSendEmail(emailAccount,emailPassword,sysUser.getEmail(), "通知", sendMsg); MailUtils.processSendEmail(emailAccount, emailPassword, sysUser.getEmail(), emailTitleList.toString(), sendMsg);
} }
} }

@ -110,9 +110,9 @@
<el-table-column v-if="temperature!==null" label="触发温度阈值" align="center" prop="temperature" min-width="110"/> <el-table-column v-if="temperature!==null" label="触发温度阈值" align="center" prop="temperature" min-width="110"/>
<el-table-column v-if="!humidity!==null" label="触发湿度阈值" align="center" prop="humidity" min-width="110"/> <el-table-column v-if="!humidity!==null" label="触发湿度阈值" align="center" prop="humidity" min-width="110"/>
<el-table-column v-if="noise!==null" label="触发噪声阈值" align="center" prop="noise" min-width="110"/> <el-table-column v-if="noise!==null" label="触发噪声阈值" align="center" prop="noise" min-width="110"/>
<el-table-column label="触发阈值次数" align="center" prop="triggerNumber" min-width="110"/> <!-- <el-table-column label="触发阈值次数" align="center" prop="triggerNumber" min-width="110"/>-->
<el-table-column label="时间范围(分)" align="center" prop="timeRange" min-width="110"/> <!-- <el-table-column label="时间范围(分)" align="center" prop="timeRange" min-width="110"/>-->
<el-table-column label="设备离线时间(分)" align="center" prop="deviceOfflineTime" min-width="120"/> <!-- <el-table-column label="设备离线时间(分)" align="center" prop="deviceOfflineTime" min-width="120"/>-->
<!-- <el-table-column label="通知用户" align="center" prop="notifyUser" />--> <!-- <el-table-column label="通知用户" align="center" prop="notifyUser" />-->
<el-table-column label="备注" align="center" prop="cause" /> <el-table-column label="备注" align="center" prop="cause" />
@ -200,15 +200,15 @@
<el-form-item label="噪声阈值" prop="noise" v-if="form.energyType==6"> <el-form-item label="噪声阈值" prop="noise" v-if="form.energyType==6">
<el-input-number v-model="form.noise" placeholder="请输入触发阈值" /> <el-input-number v-model="form.noise" placeholder="请输入触发阈值" />
</el-form-item> </el-form-item>
<el-form-item label="触发阈值次数" prop="triggerNumber"> <!-- <el-form-item label="触发阈值次数" prop="triggerNumber">-->
<el-input-number v-model="form.triggerNumber" placeholder="请输入触发阈值次数" /> <!-- <el-input-number v-model="form.triggerNumber" placeholder="请输入触发阈值次数" />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="时间范围(分)" prop="timeRange"> <!-- <el-form-item label="时间范围(分)" prop="timeRange">-->
<el-input-number v-model="form.timeRange" placeholder="请输入时间范围(分)" /> <!-- <el-input-number v-model="form.timeRange" placeholder="请输入时间范围(分)" />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="设备离线时间(分)" prop="deviceOfflineTime"> <!-- <el-form-item label="设备离线时间(分)" prop="deviceOfflineTime">-->
<el-input-number v-model="form.deviceOfflineTime" placeholder="请输入设备离线时间(分)" /> <!-- <el-input-number v-model="form.deviceOfflineTime" placeholder="请输入设备离线时间(分)" />-->
</el-form-item> <!-- </el-form-item>-->
<!-- <el-form-item label="通知用户" prop="notifyUser">--> <!-- <el-form-item label="通知用户" prop="notifyUser">-->
<!-- <el-input v-model="form.notifyUser" placeholder="请输入通知用户" />--> <!-- <el-input v-model="form.notifyUser" placeholder="请输入通知用户" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->

@ -238,7 +238,7 @@
</el-card> </el-card>
<el-dialog <el-dialog
:visible.sync="blueprintModel" :visible.sync="blueprintModel"
title="上传图纸" title="选择图纸"
width="30%" width="30%"
@before-close="blueprintModel = false"> @before-close="blueprintModel = false">
<el-form ref="form"> <el-form ref="form">
@ -309,7 +309,7 @@
<el-dialog <el-dialog
:visible.sync="sopViewModel" :visible.sync="sopViewModel"
title="上传SOP附件" title="选择SOP"
width="30%" width="30%"
@before-close="sopViewModel = false"> @before-close="sopViewModel = false">
<el-form ref="form"> <el-form ref="form">

Loading…
Cancel
Save