diff --git a/src/main/java/com/huaheng/pc/config/alarmLevel/controller/AlarmLevelController.java b/src/main/java/com/huaheng/pc/config/alarmLevel/controller/AlarmLevelController.java index 5af1815..39f802c 100644 --- a/src/main/java/com/huaheng/pc/config/alarmLevel/controller/AlarmLevelController.java +++ b/src/main/java/com/huaheng/pc/config/alarmLevel/controller/AlarmLevelController.java @@ -68,9 +68,7 @@ public class AlarmLevelController extends BaseController { .orderByAsc(AlarmLevel::getId); if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ - /** - * 使用分页查询 - */ + //使用分页查询 Page<AlarmLevel> page = new Page<>(pageNum, pageSize); IPage<AlarmLevel> iPage = alarmLevelService.page(page, lambdaQueryWrapper); return getMpDataTable(iPage.getRecords(),iPage.getTotal()); @@ -102,8 +100,7 @@ public class AlarmLevelController extends BaseController { lambdaQueryWrapper.eq(AlarmLevel::getLevel, alarmLevel.getLevel()) .eq(AlarmLevel::getCompanyCode, alarmLevel.getCompanyCode()) .eq(AlarmLevel::getWarehouseCode, alarmLevel.getWarehouseCode()); - AlarmLevel alarmLevel1 = alarmLevelService.getOne(lambdaQueryWrapper); - if (alarmLevel != null){ + if (alarmLevelService.getOne(lambdaQueryWrapper) != null){ return AjaxResult.error("该记录已存在"); } alarmLevel.setCreatedBy(ShiroUtils.getLoginName()); diff --git a/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java b/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java index 8f5e5b6..e23766b 100644 --- a/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java +++ b/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java @@ -14,8 +14,6 @@ import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.framework.web.page.PageDomain; import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; -import com.huaheng.pc.config.materialUnit.domain.MaterialUnit; -import com.huaheng.pc.config.materialUnit.service.MaterialUnitService; import com.huaheng.pc.config.material.domain.Material; import com.huaheng.pc.config.material.service.MaterialService; import io.swagger.annotations.Api; @@ -29,7 +27,6 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.List; -import java.util.Map; @Api(tags={"物料控制类"}) @Controller @@ -41,9 +38,6 @@ public class MaterialController extends BaseController { @Resource private MaterialService materialService; - @Resource - private MaterialUnitService materialUnitService; - @RequiresPermissions("config:material:view") @GetMapping() public String material() { @@ -155,8 +149,7 @@ public class MaterialController extends BaseController { ExcelUtil<Material> util = new ExcelUtil<>(Material.class); List<Material> materialList = util.importExcel(file.getInputStream()); String operName = ShiroUtils.getLoginName(); - Boolean updateSupport = false; - String message = materialService.importMaterial(materialList, updateSupport, operName); + String message = materialService.importMaterial(materialList, false, operName); return AjaxResult.success(message); } diff --git a/src/main/java/com/huaheng/pc/config/sendMail/domain/SendMailText.java b/src/main/java/com/huaheng/pc/config/sendMail/domain/SendMailText.java new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/sendMail/domain/SendMailText.java diff --git a/src/main/java/com/huaheng/pc/config/sendMail/service/MailService.java b/src/main/java/com/huaheng/pc/config/sendMail/service/MailService.java new file mode 100644 index 0000000..39bc97d --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/sendMail/service/MailService.java @@ -0,0 +1,44 @@ +package com.huaheng.pc.config.sendMail.service; + +/** + * Created by Enzo Cotter on 2019/9/6. + */ + +public interface MailService { + + /** + * 发送普通文本邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + * @param cc 抄送 + */ + Boolean sendSimpleMail(String[] to, String subject, String content, String[] cc); + /** + * 发送HTML邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 内容(可以包含<html>等标签) + * @param cc 抄送 + */ + Boolean sendHtmlMail(String[] to, String subject, String content, String[] cc); + /** + * 发送带附件的邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 内容 + * @param filePath 附件路径 + * @param cc 抄送 + */ + Boolean sendAttachmentMail(String[] to, String subject, String content, String filePath, String[] cc); + /** + * 发送带图片的邮件 + * @param to 收件人 + * @param subject 主题 + * @param content 文本 + * @param rscPath 图片路径 + * @param rscId 图片ID,用于在<img>标签中使用,从而显示图片 + * @param cc 抄送邮箱 + */ + Boolean sendInlineResourceMail(String[] to, String subject, String content, String rscPath, String rscId, String[] cc); +} diff --git a/src/main/java/com/huaheng/pc/config/sendMail/service/MailServiceImpl.java b/src/main/java/com/huaheng/pc/config/sendMail/service/MailServiceImpl.java new file mode 100644 index 0000000..1746728 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/sendMail/service/MailServiceImpl.java @@ -0,0 +1,120 @@ +package com.huaheng.pc.config.sendMail.service; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.FileSystemResource; +import org.springframework.mail.MailException; +import org.springframework.mail.SimpleMailMessage; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.mail.MessagingException; +import javax.mail.internet.MimeMessage; +import java.io.File; + +/** + * Created by Enzo Cotter on 2019/9/6. + */ +@Service +public class MailServiceImpl implements MailService { + + private final Logger logger = LoggerFactory.getLogger(MailServiceImpl.class); + + @Value("${spring.mail.username}") + private String from; + + @Resource + private JavaMailSender mailSender; + + @Override + public Boolean sendSimpleMail(String[] to, String subject, String content, String[] cc) { + SimpleMailMessage message = new SimpleMailMessage(); + message.setTo(to);//收信人 + message.setSubject(subject);//主题 + message.setText(content);//内容 + message.setFrom(from);//发信人 + if (cc.length != 0){ + message.setCc(cc); + } + try { + mailSender.send(message); + return true; + } catch (MailException me){ + return false; + } + } + + @Override + public Boolean sendHtmlMail(String[] to, String subject, String content, String[] cc) { + logger.info("发送HTML邮件开始:{},{},{}", to, subject, content); + MimeMessage message = mailSender.createMimeMessage(); + + MimeMessageHelper helper; + try { + helper = new MimeMessageHelper(message, true); + helper.setFrom(from); + helper.setTo(to); + helper.setSubject(subject); + helper.setText(content, true);//true代表支持html + if (cc.length != 0){ + helper.setCc(cc); + } + mailSender.send(message); + logger.info("发送HTML邮件成功"); + return true; + } catch (MessagingException e) { + logger.error("发送HTML邮件失败:", e); + return false; + } + } + + @Override + public Boolean sendAttachmentMail(String[] to, String subject, String content, String filePath, String[] cc) { + logger.info("发送带附件邮件开始:{},{},{},{}", to, subject, content, filePath); + MimeMessage message = mailSender.createMimeMessage(); + + MimeMessageHelper helper; + try { + helper = new MimeMessageHelper(message, true); + helper.setFrom(from); + helper.setTo(to); + helper.setSubject(subject); + helper.setText(content, true); + FileSystemResource file = new FileSystemResource(new File(filePath)); + String fileName = file.getFilename(); + helper.addAttachment(fileName, file);//添加附件,可多次调用该方法添加多个附件 + mailSender.send(message); + logger.info("发送带附件邮件成功"); + return true; + } catch (MessagingException e) { + logger.error("发送带附件邮件失败", e); + return false; + } + } + + @Override + public Boolean sendInlineResourceMail(String[] to, String subject, String content, String rscPath, String rscId, String[] cc) { + logger.info("发送带图片邮件开始:{},{},{},{},{},{}", to, subject, content, rscPath, rscId, cc); + MimeMessage message = mailSender.createMimeMessage(); + + MimeMessageHelper helper; + try { + helper = new MimeMessageHelper(message, true); + helper.setFrom(from); + helper.setTo(to); + helper.setSubject(subject); + helper.setText(content, true); + FileSystemResource res = new FileSystemResource(new File(rscPath)); + helper.addInline(rscId, res);//重复使用添加多个图片 + mailSender.send(message); + logger.info("发送带图片邮件成功"); + return true; + } catch (MessagingException e) { + logger.error("发送带图片邮件失败", e); + return false; + } + } +} diff --git a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/domain/ReceiptContainerDetail.java b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/domain/ReceiptContainerDetail.java index b1b8b54..5af580f 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/domain/ReceiptContainerDetail.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/domain/ReceiptContainerDetail.java @@ -6,11 +6,14 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + import java.io.Serializable; import java.util.Date; @ApiModel(value="com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail") @TableName(value = "receipt_container_detail") +@Data public class ReceiptContainerDetail implements Serializable { /** * ID @@ -342,942 +345,4 @@ public class ReceiptContainerDetail implements Serializable { private String processStamp; private static final long serialVersionUID = 1L; - - public static final String COL_RECEIPTCONTAINERID = "receiptContainerId"; - - public static final String COL_WAREHOUSECODE = "warehouseCode"; - - public static final String COL_RECEIPTID = "receiptId"; - - public static final String COL_RECEIPTDETAILID = "receiptDetailId"; - - public static final String COL_RECEIPTCODE = "receiptCode"; - - public static final String COL_RECEIPTTYPE = "receiptType"; - - public static final String COL_CONTAINERCODE = "containerCode"; - - public static final String COL_CONTAINERTYPE = "containerType"; - - public static final String COL_COMPANYCODE = "companyCode"; - - public static final String COL_MATERIALCODE = "materialCode"; - - public static final String COL_MATERIALNAME = "materialName"; - - public static final String COL_MATERIALSPEC = "materialSpec"; - - public static final String COL_MATERIALUNIT = "materialUnit"; - - public static final String COL_QTY = "qty"; - - public static final String COL_STATUS = "status"; - - public static final String COL_ATTRIBUTEID = "attributeId"; - - public static final String COL_ATTRIBUTE1 = "attribute1"; - - public static final String COL_ATTRIBUTE2 = "attribute2"; - - public static final String COL_ATTRIBUTE3 = "attribute3"; - - public static final String COL_ATTRIBUTE4 = "attribute4"; - - public static final String COL_SUPPLIERCODE = "supplierCode"; - - public static final String COL_BATCH = "batch"; - - public static final String COL_LOT = "lot"; - - public static final String COL_PROJECTNO = "projectNo"; - - public static final String COL_WEIGHT = "weight"; - - public static final String COL_MANUFACTUREDATE = "manufactureDate"; - - public static final String COL_EXPIRATIONDATE = "expirationDate"; - - public static final String COL_AGINGDATE = "agingDate"; - - public static final String COL_INVENTORYSTS = "inventorySts"; - - public static final String COL_TASKCREATED = "taskCreated"; - - public static final String COL_CONVERTEDQTY = "convertedQty"; - - public static final String COL_CONVERTEDQTYUNIT = "convertedQtyUnit"; - - public static final String COL_CREATED = "created"; - - public static final String COL_CREATEDBY = "createdBy"; - - public static final String COL_LASTUPDATED = "lastUpdated"; - - public static final String COL_LASTUPDATEDBY = "lastUpdatedBy"; - - public static final String COL_VERSION = "version"; - - public static final String COL_USERDEF1 = "userDef1"; - - public static final String COL_USERDEF2 = "userDef2"; - - public static final String COL_USERDEF3 = "userDef3"; - - public static final String COL_USERDEF4 = "userDef4"; - - public static final String COL_USERDEF5 = "userDef5"; - - public static final String COL_USERDEF6 = "userDef6"; - - public static final String COL_USERDEF7 = "userDef7"; - - public static final String COL_USERDEF8 = "userDef8"; - - public static final String COL_PROCESSSTAMP = "processStamp"; - - /** - * 获取ID - * - * @return id - ID - */ - public Integer getId() { - return id; - } - - /** - * 设置ID - * - * @param id ID - */ - public void setId(Integer id) { - this.id = id; - } - - /** - * 获取主表标识 - * - * @return receiptContainerId - 主表标识 - */ - public Integer getReceiptContainerId() { - return receiptContainerId; - } - - /** - * 设置主表标识 - * - * @param receiptContainerId 主表标识 - */ - public void setReceiptContainerId(Integer receiptContainerId) { - this.receiptContainerId = receiptContainerId; - } - - /** - * 获取仓库 - * - * @return warehouseCode - 仓库 - */ - public String getWarehouseCode() { - return warehouseCode; - } - - /** - * 设置仓库 - * - * @param warehouseCode 仓库 - */ - public void setWarehouseCode(String warehouseCode) { - this.warehouseCode = warehouseCode; - } - - /** - * 获取入库单内部号 - * - * @return receiptId - 入库单内部号 - */ - public Integer getReceiptId() { - return receiptId; - } - - /** - * 设置入库单内部号 - * - * @param receiptId 入库单内部号 - */ - public void setReceiptId(Integer receiptId) { - this.receiptId = receiptId; - } - - /** - * 获取入库单明细行号 - * - * @return receiptDetailId - 入库单明细行号 - */ - public Integer getReceiptDetailId() { - return receiptDetailId; - } - - /** - * 设置入库单明细行号 - * - * @param receiptDetailId 入库单明细行号 - */ - public void setReceiptDetailId(Integer receiptDetailId) { - this.receiptDetailId = receiptDetailId; - } - - /** - * 获取入库单编码 - * - * @return receiptCode - 入库单编码 - */ - public String getReceiptCode() { - return receiptCode; - } - - /** - * 设置入库单编码 - * - * @param receiptCode 入库单编码 - */ - public void setReceiptCode(String receiptCode) { - this.receiptCode = receiptCode; - } - - /** - * 获取入库单类型 - * - * @return receiptType - 入库单类型 - */ - public String getReceiptType() { - return receiptType; - } - - /** - * 设置入库单类型 - * - * @param receiptType 入库单类型 - */ - public void setReceiptType(String receiptType) { - this.receiptType = receiptType; - } - - /** - * 获取货箱号 - * - * @return containerCode - 货箱号 - */ - public String getContainerCode() { - return containerCode; - } - - /** - * 设置货箱号 - * - * @param containerCode 货箱号 - */ - public void setContainerCode(String containerCode) { - this.containerCode = containerCode; - } - - /** - * 获取货箱类型 - * - * @return containerType - 货箱类型 - */ - public String getContainerType() { - return containerType; - } - - /** - * 设置货箱类型 - * - * @param containerType 货箱类型 - */ - public void setContainerType(String containerType) { - this.containerType = containerType; - } - - /** - * 获取货主 - * - * @return companyCode - 货主 - */ - public String getCompanyCode() { - return companyCode; - } - - /** - * 设置货主 - * - * @param companyCode 货主 - */ - public void setCompanyCode(String companyCode) { - this.companyCode = companyCode; - } - - /** - * 获取物料 - * - * @return materialCode - 物料 - */ - public String getMaterialCode() { - return materialCode; - } - - /** - * 设置物料 - * - * @param materialCode 物料 - */ - public void setMaterialCode(String materialCode) { - this.materialCode = materialCode; - } - - /** - * 获取物料名称 - * - * @return materialName - 物料名称 - */ - public String getMaterialName() { - return materialName; - } - - /** - * 设置物料名称 - * - * @param materialName 物料名称 - */ - public void setMaterialName(String materialName) { - this.materialName = materialName; - } - - /** - * 获取物料规格 - * - * @return materialSpec - 物料规格 - */ - public String getMaterialSpec() { - return materialSpec; - } - - /** - * 设置物料规格 - * - * @param materialSpec 物料规格 - */ - public void setMaterialSpec(String materialSpec) { - this.materialSpec = materialSpec; - } - - /** - * 获取物料单位 - * - * @return materialUnit - 物料单位 - */ - public String getMaterialUnit() { - return materialUnit; - } - - /** - * 设置物料单位 - * - * @param materialUnit 物料单位 - */ - public void setMaterialUnit(String materialUnit) { - this.materialUnit = materialUnit; - } - - /** - * 获取数量 - * - * @return qty - 数量 - */ - public Integer getQty() { - return qty; - } - - /** - * 设置数量 - * - * @param qty 数量 - */ - public void setQty(Integer qty) { - this.qty = qty; - } - - /** - * 获取状态 - * - * @return status - 状态 - */ - public Integer getStatus() { - return status; - } - - /** - * 设置状态 - * - * @param status 状态 - */ - public void setStatus(Integer status) { - this.status = status; - } - - /** - * 获取属性号 - * - * @return attributeId - 属性号 - */ - public Integer getAttributeId() { - return attributeId; - } - - /** - * 设置属性号 - * - * @param attributeId 属性号 - */ - public void setAttributeId(Integer attributeId) { - this.attributeId = attributeId; - } - - /** - * 获取属性1 - * - * @return attribute1 - 属性1 - */ - public String getAttribute1() { - return attribute1; - } - - /** - * 设置属性1 - * - * @param attribute1 属性1 - */ - public void setAttribute1(String attribute1) { - this.attribute1 = attribute1; - } - - /** - * 获取属性2 - * - * @return attribute2 - 属性2 - */ - public String getAttribute2() { - return attribute2; - } - - /** - * 设置属性2 - * - * @param attribute2 属性2 - */ - public void setAttribute2(String attribute2) { - this.attribute2 = attribute2; - } - - /** - * 获取属性3 - * - * @return attribute3 - 属性3 - */ - public String getAttribute3() { - return attribute3; - } - - /** - * 设置属性3 - * - * @param attribute3 属性3 - */ - public void setAttribute3(String attribute3) { - this.attribute3 = attribute3; - } - - /** - * 获取属性4 - * - * @return attribute4 - 属性4 - */ - public String getAttribute4() { - return attribute4; - } - - /** - * 设置属性4 - * - * @param attribute4 属性4 - */ - public void setAttribute4(String attribute4) { - this.attribute4 = attribute4; - } - - /** - * 获取供应商编码 - * - * @return supplierCode - 供应商编码 - */ - public String getSupplierCode() { - return supplierCode; - } - - /** - * 设置供应商编码 - * - * @param supplierCode 供应商编码 - */ - public void setSupplierCode(String supplierCode) { - this.supplierCode = supplierCode; - } - - /** - * 获取批次 - * - * @return batch - 批次 - */ - public String getBatch() { - return batch; - } - - /** - * 设置批次 - * - * @param batch 批次 - */ - public void setBatch(String batch) { - this.batch = batch; - } - - /** - * 获取批号 - * - * @return lot - 批号 - */ - public String getLot() { - return lot; - } - - /** - * 设置批号 - * - * @param lot 批号 - */ - public void setLot(String lot) { - this.lot = lot; - } - - /** - * 获取项目号 - * - * @return projectNo - 项目号 - */ - public String getProjectNo() { - return projectNo; - } - - /** - * 设置项目号 - * - * @param projectNo 项目号 - */ - public void setProjectNo(String projectNo) { - this.projectNo = projectNo; - } - - /** - * 获取重量 - * - * @return weight - 重量 - */ - public String getWeight() { - return weight; - } - - /** - * 设置重量 - * - * @param weight 重量 - */ - public void setWeight(String weight) { - this.weight = weight; - } - - /** - * 获取生产日期 - * - * @return manufactureDate - 生产日期 - */ - public Date getManufactureDate() { - return manufactureDate; - } - - /** - * 设置生产日期 - * - * @param manufactureDate 生产日期 - */ - public void setManufactureDate(Date manufactureDate) { - this.manufactureDate = manufactureDate; - } - - /** - * 获取失效日期 - * - * @return expirationDate - 失效日期 - */ - public Date getExpirationDate() { - return expirationDate; - } - - /** - * 设置失效日期 - * - * @param expirationDate 失效日期 - */ - public void setExpirationDate(Date expirationDate) { - this.expirationDate = expirationDate; - } - - /** - * 获取入库日期 - * - * @return agingDate - 入库日期 - */ - public Date getAgingDate() { - return agingDate; - } - - /** - * 设置入库日期 - * - * @param agingDate 入库日期 - */ - public void setAgingDate(Date agingDate) { - this.agingDate = agingDate; - } - - /** - * 获取库存状态 - * - * @return inventorySts - 库存状态 - */ - public String getInventorySts() { - return inventorySts; - } - - /** - * 设置库存状态 - * - * @param inventorySts 库存状态 - */ - public void setInventorySts(String inventorySts) { - this.inventorySts = inventorySts; - } - - /** - * 获取任务已创建 - * - * @return taskCreated - 任务已创建 - */ - public Integer getTaskCreated() { - return taskCreated; - } - - /** - * 设置任务已创建 - * - * @param taskCreated 任务已创建 - */ - public void setTaskCreated(Integer taskCreated) { - this.taskCreated = taskCreated; - } - - /** - * 获取换算数量 - * - * @return convertedQty - 换算数量 - */ - public Integer getConvertedQty() { - return convertedQty; - } - - /** - * 设置换算数量 - * - * @param convertedQty 换算数量 - */ - public void setConvertedQty(Integer convertedQty) { - this.convertedQty = convertedQty; - } - - /** - * 获取换算单位 - * - * @return convertedQtyUnit - 换算单位 - */ - public String getConvertedQtyUnit() { - return convertedQtyUnit; - } - - /** - * 设置换算单位 - * - * @param convertedQtyUnit 换算单位 - */ - public void setConvertedQtyUnit(String convertedQtyUnit) { - this.convertedQtyUnit = convertedQtyUnit; - } - - /** - * 获取创建时间 - * - * @return created - 创建时间 - */ - public Date getCreated() { - return created; - } - - /** - * 设置创建时间 - * - * @param created 创建时间 - */ - public void setCreated(Date created) { - this.created = created; - } - - /** - * 获取创建用户 - * - * @return createdBy - 创建用户 - */ - public String getCreatedBy() { - return createdBy; - } - - /** - * 设置创建用户 - * - * @param createdBy 创建用户 - */ - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - /** - * 获取创建时间 - * - * @return lastUpdated - 创建时间 - */ - public Date getLastUpdated() { - return lastUpdated; - } - - /** - * 设置创建时间 - * - * @param lastUpdated 创建时间 - */ - public void setLastUpdated(Date lastUpdated) { - this.lastUpdated = lastUpdated; - } - - /** - * 获取更新用户 - * - * @return lastUpdatedBy - 更新用户 - */ - public String getLastUpdatedBy() { - return lastUpdatedBy; - } - - /** - * 设置更新用户 - * - * @param lastUpdatedBy 更新用户 - */ - public void setLastUpdatedBy(String lastUpdatedBy) { - this.lastUpdatedBy = lastUpdatedBy; - } - - /** - * 获取数据版本 - * - * @return version - 数据版本 - */ - public Integer getVersion() { - return version; - } - - /** - * 设置数据版本 - * - * @param version 数据版本 - */ - public void setVersion(Integer version) { - this.version = version; - } - - /** - * 获取自定义字段1 - * - * @return userDef1 - 自定义字段1 - */ - public String getUserDef1() { - return userDef1; - } - - /** - * 设置自定义字段1 - * - * @param userDef1 自定义字段1 - */ - public void setUserDef1(String userDef1) { - this.userDef1 = userDef1; - } - - /** - * 获取自定义字段2 - * - * @return userDef2 - 自定义字段2 - */ - public String getUserDef2() { - return userDef2; - } - - /** - * 设置自定义字段2 - * - * @param userDef2 自定义字段2 - */ - public void setUserDef2(String userDef2) { - this.userDef2 = userDef2; - } - - /** - * 获取自定义字段3 - * - * @return userDef3 - 自定义字段3 - */ - public String getUserDef3() { - return userDef3; - } - - /** - * 设置自定义字段3 - * - * @param userDef3 自定义字段3 - */ - public void setUserDef3(String userDef3) { - this.userDef3 = userDef3; - } - - /** - * 获取自定义字段4 - * - * @return userDef4 - 自定义字段4 - */ - public String getUserDef4() { - return userDef4; - } - - /** - * 设置自定义字段4 - * - * @param userDef4 自定义字段4 - */ - public void setUserDef4(String userDef4) { - this.userDef4 = userDef4; - } - - /** - * 获取自定义字段5 - * - * @return userDef5 - 自定义字段5 - */ - public String getUserDef5() { - return userDef5; - } - - /** - * 设置自定义字段5 - * - * @param userDef5 自定义字段5 - */ - public void setUserDef5(String userDef5) { - this.userDef5 = userDef5; - } - - /** - * 获取自定义字段6 - * - * @return userDef6 - 自定义字段6 - */ - public String getUserDef6() { - return userDef6; - } - - /** - * 设置自定义字段6 - * - * @param userDef6 自定义字段6 - */ - public void setUserDef6(String userDef6) { - this.userDef6 = userDef6; - } - - /** - * 获取自定义字段7 - * - * @return userDef7 - 自定义字段7 - */ - public String getUserDef7() { - return userDef7; - } - - /** - * 设置自定义字段7 - * - * @param userDef7 自定义字段7 - */ - public void setUserDef7(String userDef7) { - this.userDef7 = userDef7; - } - - /** - * 获取自定义字段8 - * - * @return userDef8 - 自定义字段8 - */ - public String getUserDef8() { - return userDef8; - } - - /** - * 设置自定义字段8 - * - * @param userDef8 自定义字段8 - */ - public void setUserDef8(String userDef8) { - this.userDef8 = userDef8; - } - - /** - * 获取处理标记 - * - * @return processStamp - 处理标记 - */ - public String getProcessStamp() { - return processStamp; - } - - /** - * 设置处理标记 - * - * @param processStamp 处理标记 - */ - public void setProcessStamp(String processStamp) { - this.processStamp = processStamp; - } } \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java index d4b73e8..814dfed 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java @@ -26,8 +26,8 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai private ReceiptHeaderService receiptHeaderService; /** * 根据入库单编码查询入库组盘明细 - * @param receiptCode - * @return + * @param receiptCode 入库单编码 + * @return AjaxResult */ @Override public AjaxResult<List<Map<String, Object>>> getReceiptInfoByBill(String receiptCode) { @@ -57,7 +57,6 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai //查询入库头表 LambdaQueryWrapper<ReceiptContainerDetail> containerDetailLambda = Wrappers.lambdaQuery(); - containerDetailLambda = Wrappers.lambdaQuery(); containerDetailLambda.eq(ReceiptContainerDetail::getReceiptId, receiptContainerDetail.getReceiptId()); List<ReceiptContainerDetail> containerDetailList = this.list(containerDetailLambda); //如果入库组盘没有该入库单的组盘信息,回滚入库单状态 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 26b3a45..5354a21 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -72,6 +72,16 @@ spring: restart: # 热部署开关 enabled: true + # 邮箱配置 + mail: + # 邮箱服务器 + host: smtp.qq.com + # 邮箱账号 + username: 752432958@qq.com + # 邮箱密码 + password: owobzjvlgsxrbdfe + # 编码类型 + default-encoding: utf-8 mybatis-plus: mapper-locations: classpath:mybatis/**/*.xml @@ -136,7 +146,4 @@ gen: # 自动去除表前缀,默认是true autoRemovePre: false # 表前缀(类名不会包含表前缀) - gen.tablePrefix: sys_ - - - + gen.tablePrefix: sys_ \ No newline at end of file diff --git a/src/test/java/com.huaheng.test/ServiceTest.java b/src/test/java/com.huaheng.test/ServiceTest.java new file mode 100644 index 0000000..306b6ab --- /dev/null +++ b/src/test/java/com.huaheng.test/ServiceTest.java @@ -0,0 +1,67 @@ +package com.huaheng.test; + +import com.huaheng.pc.config.sendMail.service.MailService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; + +/** + * Created by Enzo Cotter on 2019/9/6. + */ +@RunWith(SpringRunner.class) +@SpringBootTest +public class ServiceTest { + + @Resource + private MailService mailService; + + /** + * 发送简单纯文本邮件 + */ + @Test + public void sendSimpleMail() { + String[] to = {"752432958@qq.com"}; + String[] cc = {}; + mailService.sendSimpleMail(to, "发送邮件测试", "大家好,这是我用springboot进行发送邮件测试",cc); + } + + /** + * 发送HTML邮件 + */ + @Test + public void sendHtmlMail() { + String[] to = {"752432958@qq.com"}; + String[] cc = {}; + String content = "<html><body><h3><font color=\"red\">" + "大家好,这是springboot发送的HTML邮件" + "</font></h3></body></html>"; + mailService.sendHtmlMail(to, "发送邮件测试", content, cc); + } + + /** + * 发送带附件的邮件 + */ + @Test + public void sendAttachmentMail() { + String[] to = {"752432958@qq.com"}; + String[] cc = {}; + String content = "<html><body><h3><font color=\"red\">" + "大家好,这是springboot发送的HTML邮件,有附件哦" + "</font></h3></body></html>"; + String filePath = "your file path"; + mailService.sendAttachmentMail(to, "发送邮件测试", content, filePath, cc); + } + + /** + * 发送带图片的邮件 + */ + @Test + public void sendInlineResourceMail() { + String[] to = {"752432958@qq.com"}; + String[] cc = {}; + String rscPath = "your picture path"; + String rscId = "skill001"; + String content = "<html><body><h3><font color=\"red\">" + "大家好,这是springboot发送的HTML邮件,有图片哦" + "</font></h3>" + + "<img src=\'cid:" + rscId + "\'></body></html>"; + mailService.sendInlineResourceMail(to, "发送邮件测试", content, rscPath, rscId, cc); + } +}