Commit 78eb9f1d69962efb8a9743da6bb59c5e238f3f54
1 parent
30ec44cd
feat:更新邮件编辑配置
Showing
3 changed files
with
32 additions
and
25 deletions
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
... | ... | @@ -27,6 +27,7 @@ import com.order.erp.domain.dto.SystemSettingDO; |
27 | 27 | import com.order.erp.domain.dto.admin.AdminUserDO; |
28 | 28 | import com.order.erp.domain.dto.order.*; |
29 | 29 | import com.order.erp.domain.vo.order.*; |
30 | +import com.order.erp.job.OrderOverTimeEventJob; | |
30 | 31 | import com.order.erp.mapper.order.OrderBaseInfoMapper; |
31 | 32 | import com.order.erp.service.SystemSettingService; |
32 | 33 | import com.order.erp.service.admin.AdminUserService; |
... | ... | @@ -53,6 +54,8 @@ import java.util.*; |
53 | 54 | import java.util.function.Function; |
54 | 55 | import java.util.stream.Collectors; |
55 | 56 | |
57 | +import static com.order.erp.common.utils.DateUtils.DATE; | |
58 | + | |
56 | 59 | /** |
57 | 60 | * 订单基础信息表(OrderBaseInfo)表服务实现类 |
58 | 61 | * |
... | ... | @@ -364,7 +367,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
364 | 367 | try { |
365 | 368 | map.put("生产科拖货时间", StringUtils.isBlank(orderInfoResultVO.getProductionDepartmentConsignTime()) ? |
366 | 369 | orderInfoResultVO.getProductionDepartmentConsignTime() : |
367 | - DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getProductionDepartmentConsignTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
370 | + DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getProductionDepartmentConsignTime(), DateUtils.DATE_TIME), DATE)); | |
368 | 371 | } catch (Exception e) { |
369 | 372 | map.put("生产科拖货时间", orderInfoResultVO.getProductionDepartmentConsignTime()); |
370 | 373 | } |
... | ... | @@ -374,7 +377,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
374 | 377 | try { |
375 | 378 | map.put("订单上HOD时间", StringUtils.isBlank(orderInfoResultVO.getOrderHodTime()) ? |
376 | 379 | orderInfoResultVO.getOrderHodTime() : |
377 | - DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getOrderHodTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
380 | + DateUtils.format(DateUtils.parseDate(orderInfoResultVO.getOrderHodTime(), DateUtils.DATE_TIME), DATE)); | |
378 | 381 | } catch (Exception e) { |
379 | 382 | map.put("订单上HOD时间", orderInfoResultVO.getOrderHodTime()); |
380 | 383 | } |
... | ... | @@ -469,7 +472,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
469 | 472 | try { |
470 | 473 | map.put("pp date", StringUtils.isBlank(trackStageInfo.getPpTime()) ? |
471 | 474 | trackStageInfo.getPpTime() : |
472 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getPpTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
475 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getPpTime(), DateUtils.DATE_TIME), DATE)); | |
473 | 476 | } catch (Exception e) { |
474 | 477 | map.put("pp date", trackStageInfo.getPpTime()); |
475 | 478 | } |
... | ... | @@ -483,7 +486,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
483 | 486 | try { |
484 | 487 | map.put("EXTRA,SHOWROOM,ONLINE sample发送时间", StringUtils.isBlank(trackStageInfo.getEsoSampleSendTime()) ? |
485 | 488 | trackStageInfo.getEsoSampleSendTime() : |
486 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getEsoSampleSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
489 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getEsoSampleSendTime(), DateUtils.DATE_TIME), DATE)); | |
487 | 490 | } catch (Exception e) { |
488 | 491 | map.put("EXTRA,SHOWROOM,ONLINE sample发送时间", trackStageInfo.getEsoSampleSendTime()); |
489 | 492 | } |
... | ... | @@ -493,7 +496,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
493 | 496 | try { |
494 | 497 | map.put("shippment sample 发送时间", StringUtils.isBlank(trackStageInfo.getShippmentSampleSendTime()) ? |
495 | 498 | trackStageInfo.getShippmentSampleSendTime() : |
496 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getShippmentSampleSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
499 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getShippmentSampleSendTime(), DateUtils.DATE_TIME), DATE)); | |
497 | 500 | |
498 | 501 | } catch (Exception e) { |
499 | 502 | map.put("shippment sample 发送时间", trackStageInfo.getShippmentSampleSendTime()); |
... | ... | @@ -509,7 +512,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
509 | 512 | try { |
510 | 513 | map.put("自测通过时间", StringUtils.isBlank(trackStageInfo.getSelfTestPassTime()) ? |
511 | 514 | trackStageInfo.getSelfTestPassTime() : |
512 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getSelfTestPassTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
515 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getSelfTestPassTime(), DateUtils.DATE_TIME), DATE)); | |
513 | 516 | } catch (Exception e) { |
514 | 517 | map.put("自测通过时间", trackStageInfo.getSelfTestPassTime()); |
515 | 518 | } |
... | ... | @@ -519,7 +522,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
519 | 522 | try { |
520 | 523 | map.put("Aitex测试发送时间", StringUtils.isBlank(trackStageInfo.getAitexTestSendTime()) ? |
521 | 524 | trackStageInfo.getAitexTestSendTime() : |
522 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getAitexTestSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
525 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getAitexTestSendTime(), DateUtils.DATE_TIME), DATE)); | |
523 | 526 | } catch (Exception e) { |
524 | 527 | map.put("Aitex测试发送时间", trackStageInfo.getAitexTestSendTime()); |
525 | 528 | } |
... | ... | @@ -533,7 +536,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
533 | 536 | try { |
534 | 537 | map.put("SGS测试发送时间", StringUtils.isBlank(trackStageInfo.getSgsTestSendTime()) ? |
535 | 538 | trackStageInfo.getSgsTestSendTime() : |
536 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getSgsTestSendTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
539 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getSgsTestSendTime(), DateUtils.DATE_TIME), DATE)); | |
537 | 540 | } catch (Exception e) { |
538 | 541 | map.put("SGS测试发送时间", trackStageInfo.getSgsTestSendTime()); |
539 | 542 | } |
... | ... | @@ -547,7 +550,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
547 | 550 | try { |
548 | 551 | map.put("Barcode sticker arrival time", StringUtils.isBlank(trackStageInfo.getBarcodeStickerArrivalTime()) ? |
549 | 552 | trackStageInfo.getBarcodeStickerArrivalTime() : |
550 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getBarcodeStickerArrivalTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
553 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getBarcodeStickerArrivalTime(), DateUtils.DATE_TIME), DATE)); | |
551 | 554 | } catch (Exception e) { |
552 | 555 | map.put("Barcode sticker arrival time", trackStageInfo.getBarcodeStickerArrivalTime()); |
553 | 556 | } |
... | ... | @@ -557,7 +560,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
557 | 560 | try { |
558 | 561 | map.put("最晚包材到货时间", StringUtils.isBlank(trackStageInfo.getLatestArrivalTime()) ? |
559 | 562 | trackStageInfo.getLatestArrivalTime() : |
560 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestArrivalTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
563 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestArrivalTime(), DateUtils.DATE_TIME), DATE)); | |
561 | 564 | } catch (Exception e) { |
562 | 565 | map.put("最晚包材到货时间", trackStageInfo.getLatestArrivalTime()); |
563 | 566 | } |
... | ... | @@ -567,7 +570,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
567 | 570 | try { |
568 | 571 | map.put("最晚订舱+报关资料时间", StringUtils.isBlank(trackStageInfo.getLatestBkTime()) ? |
569 | 572 | trackStageInfo.getLatestBkTime() : |
570 | - DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestBkTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
573 | + DateUtils.format(DateUtils.parseDate(trackStageInfo.getLatestBkTime(), DateUtils.DATE_TIME), DATE)); | |
571 | 574 | } catch (Exception e) { |
572 | 575 | map.put("最晚订舱+报关资料时间", trackStageInfo.getLatestBkTime()); |
573 | 576 | |
... | ... | @@ -582,7 +585,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
582 | 585 | try { |
583 | 586 | map.put("中期验货申请时间", StringUtils.isBlank(inspectionStageInfo.getMidCheckApplyTime()) ? |
584 | 587 | inspectionStageInfo.getMidCheckApplyTime() : |
585 | - DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getMidCheckApplyTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
588 | + DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getMidCheckApplyTime(), DateUtils.DATE_TIME), DATE)); | |
586 | 589 | } catch (Exception e) { |
587 | 590 | map.put("中期验货申请时间", inspectionStageInfo.getMidCheckApplyTime()); |
588 | 591 | } |
... | ... | @@ -600,7 +603,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
600 | 603 | try { |
601 | 604 | map.put("尾期验货申请时间", StringUtils.isBlank(inspectionStageInfo.getEndCheckApplyTime()) ? |
602 | 605 | inspectionStageInfo.getEndCheckApplyTime() : |
603 | - DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getEndCheckApplyTime(), DateUtils.DATE_TIME), DateUtils.DATE)); | |
606 | + DateUtils.format(DateUtils.parseDate(inspectionStageInfo.getEndCheckApplyTime(), DateUtils.DATE_TIME), DATE)); | |
604 | 607 | } catch (Exception e) { |
605 | 608 | map.put("尾期验货申请时间", inspectionStageInfo.getEndCheckApplyTime()); |
606 | 609 | } |
... | ... | @@ -1666,7 +1669,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1666 | 1669 | trackStageDO.setPpTime(trackStageInfo.getPpTime()); |
1667 | 1670 | } |
1668 | 1671 | if (StringUtils.isNotBlank(trackStageInfo.getPpConfirmResult())) { |
1669 | - //由于跟单信息在创建时也是采用edit接口,所以要限制第一次创建时ppconfirmResult为空的情况,这种情况不计算到跟单记录中去。 | |
1672 | + //由于跟单信息在创建时也是采用edit接口,所以要限制第一次创建时ppconfirmResult为空的情况,这种情况要计算到跟单记录中去。 | |
1670 | 1673 | if(!(trackStageInfo.getPpConfirmResult().equals(trackStageDO.getPpConfirmResult())) && |
1671 | 1674 | StringUtils.isNotBlank(trackStageInfo.getPpConfirmResult()) ){ |
1672 | 1675 | //用于在跟单记录中展示。 |
... | ... | @@ -1807,9 +1810,21 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O |
1807 | 1810 | .collect(Collectors.toList()); |
1808 | 1811 | //一旦修改完质检信息就自动发送邮件对应的生产科。多次编辑保存多次发送。 |
1809 | 1812 | if (StringUtils.isNotBlank(inspectionStageInfo.getEndCheckApplyTime())) { |
1813 | + String EndCheckApplyTime= inspectionStageInfo.getEndCheckApplyTime().substring(0, 10); | |
1814 | + String ProductionDepartmentConsignTime =orderBaseInfoDo.getProductionDepartmentConsignTime().substring(0, 10); | |
1815 | + String EndCheckApply = DateUtils.format(DateUtils.parseDate(EndCheckApplyTime, DATE), DATE); | |
1816 | + String ProductionDepartmentConsign = DateUtils.format(DateUtils.parseDate(ProductionDepartmentConsignTime,DATE), DATE); | |
1817 | + orderEventJobVO.getInspectionStageInfo().setEndCheckApplyTime(EndCheckApply); | |
1818 | + orderEventJobVO.getBaseInfo().setProductionDepartmentConsignTime(ProductionDepartmentConsign); | |
1810 | 1819 | //尾期验货报告。 |
1811 | 1820 | emailSendUtils.sendEmail(EmailTemplateEnum.END_CHECK_REPORT_TEMPLATE, emails, orderEventJobVO); |
1812 | 1821 | }else if(StringUtils.isNotBlank(inspectionStageInfo.getMidCheckApplyTime())){ |
1822 | + String MidCheckApplyTime= inspectionStageInfo.getMidCheckApplyTime().substring(0, 10); | |
1823 | + String ProductionDepartmentConsignTime =orderBaseInfoDo.getProductionDepartmentConsignTime().substring(0, 10); | |
1824 | + String MidCheckApply = DateUtils.format(DateUtils.parseDate(MidCheckApplyTime, DATE), DATE); | |
1825 | + String ProductionDepartmentConsign = DateUtils.format(DateUtils.parseDate(ProductionDepartmentConsignTime,DATE), DATE); | |
1826 | + orderEventJobVO.getInspectionStageInfo().setMidCheckApplyTime(MidCheckApply); | |
1827 | + orderEventJobVO.getBaseInfo().setProductionDepartmentConsignTime(ProductionDepartmentConsign); | |
1813 | 1828 | //中期验货报告。 |
1814 | 1829 | emailSendUtils.sendEmail(EmailTemplateEnum.MID_CHECK_REPORT_TEMPLATE, emails, orderEventJobVO); |
1815 | 1830 | } | ... | ... |
src/main/java/com/order/erp/service/order/impl/ReceiveEmailMappingServiceImpl.java
1 | 1 | package com.order.erp.service.order.impl; |
2 | 2 | |
3 | 3 | import cn.hutool.core.bean.BeanUtil; |
4 | -import cn.hutool.core.collection.CollUtil; | |
4 | +import com.alibaba.fastjson.JSON; | |
5 | 5 | import com.alibaba.fastjson.JSONObject; |
6 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
7 | -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
8 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
9 | 6 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
10 | 7 | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
11 | 8 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
12 | 9 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
13 | 10 | import com.order.erp.common.constant.Constant; |
14 | 11 | import com.order.erp.common.constant.ServerResult; |
15 | -import com.order.erp.domain.dto.BaseDO; | |
16 | 12 | import com.order.erp.domain.dto.order.ReceiveEmailMappingDO; |
17 | 13 | import com.order.erp.domain.vo.order.ReceiveEmailMappingQueryVO; |
18 | 14 | import com.order.erp.domain.vo.order.ReceiveEmailMappingVO; |
... | ... | @@ -100,10 +96,6 @@ public class ReceiveEmailMappingServiceImpl extends ServiceImpl<ReceiveEmailMapp |
100 | 96 | if (Objects.isNull(receiveEmailMappingVO.getId())) { |
101 | 97 | return ServerResult.fail("id 不能为空"); |
102 | 98 | } |
103 | - List<ReceiveEmailMappingDO> ReceiveEmailMappingDoList = baseMapper.byTypeValueReceiveEmailMappingDO(receiveEmailMappingVO.getTypeValue()); | |
104 | - if(CollectionUtils.isNotEmpty(ReceiveEmailMappingDoList)){ | |
105 | - return ServerResult.fail("已存在"+receiveEmailMappingVO.getTypeValue()+"客户"); | |
106 | - } | |
107 | 99 | ReceiveEmailMappingDO receiveEmailMappingDo = BeanUtil.copyProperties(receiveEmailMappingVO, ReceiveEmailMappingDO.class); |
108 | 100 | receiveEmailMappingDo.setConfigInfos(JSONObject.toJSONString(receiveEmailMappingVO.getConfigInfos())); |
109 | 101 | updateById(receiveEmailMappingDo); | ... | ... |
src/main/resources/templates/mail.ftl
... | ... | @@ -103,7 +103,7 @@ |
103 | 103 | <#if title=="中期验货报告" > |
104 | 104 | <td>${data.baseInfo.projectNo! " "}</td> |
105 | 105 | <td>${data.baseInfo.productionDepartment! " "}</td> |
106 | - <td>${data.baseInfo.internalNo! " "}</td> | |
106 | + <td>${data.baseInfo.innerNo! " "}</td> | |
107 | 107 | <td>${data.baseInfo.customerPo! " "}</td> |
108 | 108 | <td>${data.baseInfo.customerStyle! " "}</td> |
109 | 109 | <td>${data.baseInfo.poColor! " "}</td> |
... | ... | @@ -118,7 +118,7 @@ |
118 | 118 | <#elseif title=="尾期验货报告"> |
119 | 119 | <td>${data.baseInfo.projectNo! " "}</td> |
120 | 120 | <td>${data.baseInfo.productionDepartment! " "}</td> |
121 | - <td>${data.baseInfo.internalNo! " "}</td> | |
121 | + <td>${data.baseInfo.innerNo! " "}</td> | |
122 | 122 | <td>${data.baseInfo.customerPo! " "}</td> |
123 | 123 | <td>${data.baseInfo.customerStyle! " "}</td> |
124 | 124 | <td>${data.baseInfo.poColor! " "}</td> | ... | ... |