Browse Source

完善代码

yuansh 2 months ago
parent
commit
aa5767189f
29 changed files with 211 additions and 58 deletions
  1. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/baseCode/mapper/xml/BaseApproverHeadMapper.xml
  2. 26 22
      srm-module-code/src/main/java/org/jeecg/modules/baseCode/service/impl/BaseApproverHeadServiceImpl.java
  3. 3 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurInquiryForm.java
  4. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurPurchaseQuotation.java
  5. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurQuotationSelection.java
  6. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurInquiryFormAlert.java
  7. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurInquiryFormPage.java
  8. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurPurchaseQuotationPage.java
  9. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurQuotationSelectionAlert.java
  10. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurQuotationSelectionPage.java
  11. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/SupplierQuotationDetails.java
  12. 17 17
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInquiryFormController.java
  13. 15 9
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleQuotationController.java
  14. 11 5
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInquiryForm.java
  15. 7 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrder.java
  16. 11 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrderHis.java
  17. 7 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotation.java
  18. 6 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationHis.java
  19. 2 2
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleDeliveryServiceImpl.java
  20. 23 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInquiryFormServiceImpl.java
  21. 30 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleOrderServiceImpl.java
  22. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleInquiryFormAlert.java
  23. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleInquiryFormPage.java
  24. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderAlert.java
  25. 5 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderHisPage.java
  26. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderPage.java
  27. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationAlert.java
  28. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationHisPage.java
  29. 4 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationPage.java

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/baseCode/mapper/xml/BaseApproverHeadMapper.xml

@@ -5,7 +5,7 @@
     <delete id="deleteHeadByOrderId">
         update base_approver_head set del_flag = 1 where order_id=#{orderId}
     </delete>
-    <delete id="deleteHeadByOrderId">
+    <delete id="deleteChildByOrderId">
         update base_approver_details set del_flag = 1 where order_id=#{orderId}
     </delete>
 </mapper>

+ 26 - 22
srm-module-code/src/main/java/org/jeecg/modules/baseCode/service/impl/BaseApproverHeadServiceImpl.java

@@ -58,13 +58,13 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
 //		queryWrapper.eq("order_type", "");
         queryWrapper.eq("status", 0);
         queryWrapper.eq("del_flag", 0);
-        List<BaseApproverHead> head = baseApproverHeadMapper.selectList(queryWrapper);
+        List<BaseApproverHead> headList = baseApproverHeadMapper.selectList(queryWrapper);
 
-        if (head.size() == 0) {
+        if (headList.size() == 0) {
             throw new JeecgBootException("该单据无需审批");
         }
-
-        List<BaseApproverDetails> list = baseApproverDetailsMapper.selectByMainId(head.get(0).getId());
+        BaseApproverHead head = headList.get(0);
+        List<BaseApproverDetails> list = baseApproverDetailsMapper.selectByMainId(head.getId());
 
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         String userName = sysUser.getUsername();
@@ -126,7 +126,7 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
         detail.setApproverInfo(approveInfo);
         baseApproverDetailsMapper.updateById(detail);
 
-        List<BaseApproverDetails> list2 = baseApproverDetailsMapper.selectByMainId(head.get(0).getId());
+        List<BaseApproverDetails> list2 = baseApproverDetailsMapper.selectByMainId(head.getId());
         for (BaseApproverDetails o : list2) {
 
             int isEnd = o.getIsEnd() == null ? 0 : o.getIsEnd();//是否即将审批(1-是,0-否)
@@ -140,13 +140,17 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
         }
 
         List<BaseApproverDetails> childListNext = findMinObjects(list2, nextIndex);
+        if(childListNext.size()==0){
+            head.setStatus(approveType);
+            baseApproverHeadMapper.updateById(head);
+        }
         for (BaseApproverDetails o : childListNext) {
             //是否即将审批(1-是,0-否)
             o.setIsEnd(1);
             baseApproverDetailsMapper.updateById(o);
         }
 
-        return "true";
+        return "执行成功";
     }
 
     /**
@@ -155,24 +159,24 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public String submitApproveReturn( String orderId) {
-
-        QueryWrapper<BaseApproverHead> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("order_id", orderId);
-//		queryWrapper.eq("order_type", "");
-        queryWrapper.eq("status", 1);
-        queryWrapper.eq("del_flag", 0);
-        List<BaseApproverHead> head = baseApproverHeadMapper.selectList(queryWrapper);
-
-        if(head.size() > 0){
-
-            return "该订单已审批结束,无法取消";
-
-        }else{
+    public String submitApproveReturn(String orderId) {
+
+//        QueryWrapper<BaseApproverHead> queryWrapper = new QueryWrapper<>();
+//        queryWrapper.eq("order_id", orderId);
+////		queryWrapper.eq("order_type", "");
+//        queryWrapper.eq("status", 1);
+//        queryWrapper.eq("del_flag", 0);
+//        List<BaseApproverHead> head = baseApproverHeadMapper.selectList(queryWrapper);
+//
+//        if(head.size() > 0){
+//
+//            return "该订单已审批结束,无法取消";
+//
+//        }else{
             baseApproverHeadMapper.deleteHeadByOrderId(orderId);
             baseApproverHeadMapper.deleteChildByOrderId(orderId);
             return null;
-        }
+//        }
 
 
     }
@@ -229,7 +233,7 @@ public class BaseApproverHeadServiceImpl extends ServiceImpl<BaseApproverHeadMap
 
             //仅查看(1-是,0-否)
             child.setIsView(o.getIsView());
-            if (o.getIsView() == 0) {
+            if (o.getIsView() == 1) {
                 isView = true;
             }
 

+ 3 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurInquiryForm.java

@@ -171,6 +171,9 @@ public class PurInquiryForm implements Serializable {
     //来源销售询价单文件
     private String saleAttachs;
 
+    //质量等级
+    private String qualityGradeHead;
+
 
     //导出字段使用
     @TableField(exist = false)

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurPurchaseQuotation.java

@@ -172,4 +172,6 @@ public class PurPurchaseQuotation implements Serializable {
     private String deliveryDayHead;
     //订单总金额
     private BigDecimal totalAmount;
+    //质量等级
+    private String qualityGradeHead;
 }

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurQuotationSelection.java

@@ -119,4 +119,6 @@ public class PurQuotationSelection implements Serializable {
 	private BigDecimal totalAmount;
 	//订单总金额(美元)
 	private BigDecimal totalAmountUsd;
+    //质量等级
+    private String qualityGradeHead;
 }

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurInquiryFormAlert.java

@@ -136,6 +136,8 @@ public class PurInquiryFormAlert {
     //来源销售询价单文件
     private String saleAttachs;
 
+    //质量等级
+    private String qualityGradeHead;
 
     /**交期*/
     @Excel(name = "交期", width = 20, format = "yyyy-MM-dd")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurInquiryFormPage.java

@@ -164,6 +164,8 @@ public class PurInquiryFormPage {
 	//来源销售询价单文件
     private String saleAttachs;
 
+	//质量等级
+	private String qualityGradeHead;
 	@ExcelCollection(name="采购询价单子表 - 船明细")
 	@ApiModelProperty(value = "采购询价单子表 - 船明细")
 	private List<PurInquiryFormShip> purInquiryFormShipList;

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurPurchaseQuotationPage.java

@@ -160,6 +160,8 @@ public class PurPurchaseQuotationPage {
 	@ApiModelProperty(value = "来源单号(采购报价单)")
 	private String sourceCode;
 
+	//质量等级
+	private String qualityGradeHead;
 	//订单总金额
 	private BigDecimal totalAmount;
 	@ExcelCollection(name="采购报价单 - 船明细")

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurQuotationSelectionAlert.java

@@ -214,4 +214,6 @@ public class PurQuotationSelectionAlert implements Serializable {
     private java.math.BigDecimal taxAmountUsd;
     @ApiModelProperty(value = "美元汇率")
     private java.math.BigDecimal exchangeRateUsd;
+    //质量等级
+    private String qualityGradeHead;
 }

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurQuotationSelectionPage.java

@@ -111,6 +111,8 @@ public class PurQuotationSelectionPage {
 	private BigDecimal totalAmount;
 	//订单总金额(美元)
 	private BigDecimal totalAmountUsd;
+	//质量等级
+	private String qualityGradeHead;
 
 	@ExcelCollection(name="采购报价选定子表 - 船明细")
 	@ApiModelProperty(value = "采购报价选定子表 - 船明细")

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/SupplierQuotationDetails.java

@@ -9,6 +9,8 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;
+
+//采购报价单弹框
 @Data
 @TableName("SupplierQuotationDetails")
 public class SupplierQuotationDetails {
@@ -146,6 +148,8 @@ public class SupplierQuotationDetails {
     @ApiModelProperty(value = "来源单号(采购报价单)")
     private String sourceCode;
 
+    //质量等级
+    private String qualityGradeHead;
 
     /**交期*/
     @Excel(name = "交期", width = 15, format = "yyyy-MM-dd")

+ 17 - 17
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleInquiryFormController.java

@@ -94,14 +94,14 @@ public class SaleInquiryFormController {
                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                         HttpServletRequest req) {
 
-        String shipName = saleInquiryForm.getShipName();
-//        String imo = saleInquiryForm.getImo();
-
-        QueryWrapper<SaleInquiryFormShip> shipQueryWrapper = new QueryWrapper<>();
-        if(StringUtils.isNotBlank(shipName)){
-            shipQueryWrapper.eq("ship_name", shipName);
-            saleInquiryForm.setShipName(null);
-        }
+//        String shipName = saleInquiryForm.getShipName();
+////        String imo = saleInquiryForm.getImo();
+//
+//        QueryWrapper<SaleInquiryFormShip> shipQueryWrapper = new QueryWrapper<>();
+//        if(StringUtils.isNotBlank(shipName)){
+//            shipQueryWrapper.eq("ship_name", shipName);
+//            saleInquiryForm.setShipName(null);
+//        }
 //        if(StringUtils.isNotBlank(imo)){
 //
 //            shipQueryWrapper.eq("imo", imo);
@@ -110,15 +110,15 @@ public class SaleInquiryFormController {
 
         QueryWrapper<SaleInquiryForm> queryWrapper = QueryGenerator.initQueryWrapper(saleInquiryForm, req.getParameterMap());
 
-        if(StringUtils.isNotBlank(shipName)){
-
-            List<SaleInquiryFormShip> list = saleInquiryFormShipService.list(shipQueryWrapper);
-            if (list.size() > 0) {
-                String[] headId = list.stream().map(SaleInquiryFormShip::getHeadId).toArray(String[]::new);
-                queryWrapper.in("id", headId);
-            }
-
-        }
+//        if(StringUtils.isNotBlank(shipName)){
+//
+//            List<SaleInquiryFormShip> list = saleInquiryFormShipService.list(shipQueryWrapper);
+//            if (list.size() > 0) {
+//                String[] headId = list.stream().map(SaleInquiryFormShip::getHeadId).toArray(String[]::new);
+//                queryWrapper.in("id", headId);
+//            }
+//
+//        }
         Page<SaleInquiryForm> page = new Page<SaleInquiryForm>(pageNo, pageSize);
         IPage<SaleInquiryForm> pageList = saleInquiryFormService.page(page, queryWrapper);
         return Result.OK(pageList);

+ 15 - 9
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleQuotationController.java

@@ -410,11 +410,11 @@ public class SaleQuotationController {
         ent.setConfirmTime(new Date());
         saleQuotationService.update(ent, queryWrapper);
         //String tableId, String orderType, String orderCode, String orderId
-//        for (SaleQuotation o : list) {
-//            String code = o.getBillCode();
-//
-//            approverHeadService.submitApprove("sale_quotation","销售报价单",code,o.getId());
-//        }
+        for (SaleQuotation o : list) {
+            String code = o.getBillCode();
+
+            approverHeadService.submitApprove("sale_quotation","销售报价单",code,o.getId());
+        }
 
         return Result.OK("提交成功!");
     }
@@ -486,14 +486,20 @@ public class SaleQuotationController {
             return Result.error(sb.toString());
         }
 
+        for (SaleQuotation o : list) {
+//            String res =
+              approverHeadService.submitApproveReturn(o.getId());
+//            if(StringUtils.isNotBlank(res)){
+//                String code = o.getBillCode();
+//                sb.append("单号" + code).append("审批已结束,无法取消提交");
+//                continue;
+//            }
+        }
+
         SaleQuotation ent = new SaleQuotation();
         ent.setStatus(0);
         saleQuotationService.update(ent, queryWrapper);
 
-//        for (SaleQuotation o : list) {
-//            approverHeadService.submitApproveReturn(o.getId());
-//        }
-
         return Result.OK("取消提交成功!");
     }
 

+ 11 - 5
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleInquiryForm.java

@@ -170,10 +170,16 @@ public class SaleInquiryForm implements Serializable {
 	//质量等级
     private String qualityGradeHead;
 
-    //子表查询所用
-    @TableField(exist = false)
-    private String shipName;//船名
-//    @TableField(exist = false)
-//    private String imo;//imo号
+
+    //船名称 新增字段
+    private String shipName;
+
+    //船imo 新增字段
+    private String imo;
+
+    //联系人主键
+    private String liaisonId;
+    //联系人信息
+    private String liaisonInfo;
 
 }

+ 7 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrder.java

@@ -276,8 +276,14 @@ public class SaleOrder implements Serializable {
     //船名称 新增字段
     private String shipName;
 
-    @TableField(exist = false)
+    //船imo 新增字段
     private String imo;
+
+    //联系人主键
+    private String liaisonId;
+    //联系人信息
+    private String liaisonInfo;
+
     @TableField(exist = false)
     private String qualityGrade;
     @TableField(exist = false)

+ 11 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrderHis.java

@@ -255,4 +255,15 @@ public class SaleOrderHis implements Serializable {
     private java.math.BigDecimal invoiceMoney;
     //    收款金额(collected money)
     private java.math.BigDecimal collectedMoney;
+
+
+    //船名称 新增字段
+    private String shipName;
+
+    //船imo 新增字段
+    private String imo;
+    //联系人主键
+    private String liaisonId;
+    //联系人信息
+    private String liaisonInfo;
 }

+ 7 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotation.java

@@ -202,6 +202,13 @@ public class SaleQuotation implements Serializable {
     @Excel(name = "销售金额合计", width = 15)
     private BigDecimal saleAmount;
 
+    @ApiModelProperty(value = "整单毛利率(gross margin)")
+    private java.math.BigDecimal grossMarginHead;
+    //联系人主键
+    private String liaisonId;
+    //联系人信息
+    private String liaisonInfo;
+
     //导出字段使用
     @TableField(exist = false)
     private String salesPhone;

+ 6 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotationHis.java

@@ -200,4 +200,10 @@ public class SaleQuotationHis implements Serializable {
     private BigDecimal purchaseAmount;
     @Excel(name = "销售金额合计", width = 15)
     private BigDecimal saleAmount;
+    @ApiModelProperty(value = "整单毛利率(gross margin)")
+    private java.math.BigDecimal grossMargin;
+    //联系人主键
+    private String liaisonId;
+    //联系人信息
+    private String liaisonInfo;
 }

+ 2 - 2
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleDeliveryServiceImpl.java

@@ -172,7 +172,7 @@ public class SaleDeliveryServiceImpl extends ServiceImpl<SaleDeliveryMapper, Sal
                 String sourceId = entity.getSourceId();
                 if (StringUtils.isNotBlank(sourceId)) {
 
-                    BigDecimal deliveryQuantity = entity.getDeliveryQuantity() == null ? BigDecimal.ZERO : entity.getDeliveryQuantity();//入库数量
+                    BigDecimal deliveryQuantity = entity.getQuantity() == null ? BigDecimal.ZERO : entity.getQuantity();//入库数量
                     SaleOrderProduct arrival = saleOrderProductMapper.selectById(sourceId);
 
                     if (arrival != null) {
@@ -215,7 +215,7 @@ public class SaleDeliveryServiceImpl extends ServiceImpl<SaleDeliveryMapper, Sal
                     String sourceId = entity.getSourceId();
                     if (StringUtils.isNotBlank(sourceId)) {
 
-                        BigDecimal deliveryQuantity = entity.getDeliveryQuantity() == null ? BigDecimal.ZERO : entity.getDeliveryQuantity();//入库数量
+                        BigDecimal deliveryQuantity = entity.getQuantity() == null ? BigDecimal.ZERO : entity.getQuantity();//入库数量
                         SaleOrderProduct arrival = saleOrderProductMapper.selectById(sourceId);
 
                         if (arrival != null) {

+ 23 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInquiryFormServiceImpl.java

@@ -3,9 +3,12 @@ package org.jeecg.modules.saleCode.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.baseCode.entity.BaseShipArchive;
+import org.jeecg.modules.baseCode.mapper.BaseShipArchiveMapper;
 import org.jeecg.modules.saleCode.entity.SaleInquiryForm;
 import org.jeecg.modules.saleCode.entity.SaleInquiryFormShip;
 import org.jeecg.modules.saleCode.entity.SaleInquiryFormProduct;
+import org.jeecg.modules.saleCode.entity.SaleOrderShip;
 import org.jeecg.modules.saleCode.mapper.SaleInquiryFormShipMapper;
 import org.jeecg.modules.saleCode.mapper.SaleInquiryFormProductMapper;
 import org.jeecg.modules.saleCode.mapper.SaleInquiryFormMapper;
@@ -18,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.io.Serializable;
 import java.util.List;
 import java.util.Collection;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 销售询价单
@@ -34,6 +38,8 @@ public class SaleInquiryFormServiceImpl extends ServiceImpl<SaleInquiryFormMappe
 	private SaleInquiryFormShipMapper saleInquiryFormShipMapper;
 	@Autowired
 	private SaleInquiryFormProductMapper saleInquiryFormProductMapper;
+	@Autowired
+	private BaseShipArchiveMapper baseShipArchiveMapper;
 
 
 
@@ -45,6 +51,23 @@ public class SaleInquiryFormServiceImpl extends ServiceImpl<SaleInquiryFormMappe
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void saveMain(SaleInquiryForm saleInquiryForm, List<SaleInquiryFormShip> saleInquiryFormShipList, List<SaleInquiryFormProduct> saleInquiryFormProductList) {
+
+		if(saleInquiryFormShipList!=null && saleInquiryFormShipList.size()>0) {
+
+			List<String> shipIds = saleInquiryFormShipList.stream().map(SaleInquiryFormShip::getId).collect(Collectors.toList());
+			QueryWrapper<BaseShipArchive> queryShip = new QueryWrapper<>();
+			queryShip.eq("id",shipIds);
+			queryShip.eq("del_flag",0);
+			List<BaseShipArchive> shipList = baseShipArchiveMapper.selectList(queryShip);
+			if(shipList.size() > 0){
+				String imos = shipList.stream().map(BaseShipArchive::getImo).collect(Collectors.joining(","));
+				saleInquiryForm.setImo(imos);
+			}
+
+			String names = saleInquiryFormShipList.stream().map(SaleInquiryFormShip::getShipName).collect(Collectors.joining(","));
+			saleInquiryForm.setShipName(names);
+		}
+
 		saleInquiryFormMapper.insert(saleInquiryForm);
 		if(saleInquiryFormShipList!=null && saleInquiryFormShipList.size()>0) {
 			for(SaleInquiryFormShip entity:saleInquiryFormShipList) {

+ 30 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleOrderServiceImpl.java

@@ -1,5 +1,8 @@
 package org.jeecg.modules.saleCode.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.jeecg.modules.baseCode.entity.BaseShipArchive;
+import org.jeecg.modules.baseCode.mapper.BaseShipArchiveMapper;
 import org.jeecg.modules.saleCode.entity.SaleOrder;
 import org.jeecg.modules.saleCode.entity.SaleOrderShip;
 import org.jeecg.modules.saleCode.entity.SaleOrderProduct;
@@ -7,6 +10,7 @@ import org.jeecg.modules.saleCode.mapper.SaleOrderShipMapper;
 import org.jeecg.modules.saleCode.mapper.SaleOrderProductMapper;
 import org.jeecg.modules.saleCode.mapper.SaleOrderMapper;
 import org.jeecg.modules.saleCode.service.ISaleOrderService;
+import org.jeecg.modules.system.entity.SysUser;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,12 +35,25 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
 	private SaleOrderShipMapper saleOrderShipMapper;
 	@Autowired
 	private SaleOrderProductMapper saleOrderProductMapper;
-	
+	@Autowired
+	private BaseShipArchiveMapper baseShipArchiveMapper;
+
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void saveMain(SaleOrder saleOrder, List<SaleOrderShip> saleOrderShipList,List<SaleOrderProduct> saleOrderProductList) {
 
 		if(saleOrderShipList!=null && saleOrderShipList.size()>0) {
+
+			List<String> shipIds = saleOrderShipList.stream().map(SaleOrderShip::getId).collect(Collectors.toList());
+			QueryWrapper<BaseShipArchive> queryShip = new QueryWrapper<>();
+			queryShip.eq("id",shipIds);
+			queryShip.eq("del_flag",0);
+			List<BaseShipArchive> shipList = baseShipArchiveMapper.selectList(queryShip);
+			if(shipList.size() > 0){
+				String imos = shipList.stream().map(BaseShipArchive::getImo).collect(Collectors.joining(","));
+				saleOrder.setImo(imos);
+			}
+
 			String names = saleOrderShipList.stream().map(SaleOrderShip::getShipName).collect(Collectors.joining(","));
 			saleOrder.setShipName(names);
 		}
@@ -64,7 +81,19 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
 	@Transactional(rollbackFor = Exception.class)
 	public void updateMain(SaleOrder saleOrder,List<SaleOrderShip> saleOrderShipList,List<SaleOrderProduct> saleOrderProductList) {
 
+
 		if(saleOrderShipList!=null && saleOrderShipList.size()>0) {
+
+			List<String> shipIds = saleOrderShipList.stream().map(SaleOrderShip::getId).collect(Collectors.toList());
+			QueryWrapper<BaseShipArchive> queryShip = new QueryWrapper<>();
+			queryShip.eq("id",shipIds);
+			queryShip.eq("del_flag",0);
+			List<BaseShipArchive> shipList = baseShipArchiveMapper.selectList(queryShip);
+			if(shipList.size() > 0){
+				String imos = shipList.stream().map(BaseShipArchive::getImo).collect(Collectors.joining(","));
+				saleOrder.setImo(imos);
+			}
+
 			String names = saleOrderShipList.stream().map(SaleOrderShip::getShipName).collect(Collectors.joining(","));
 			saleOrder.setShipName(names);
 		}

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleInquiryFormAlert.java

@@ -145,6 +145,11 @@ public class SaleInquiryFormAlert {
     private String inquiryNotes;
 
 
+	//联系人主键
+	private String liaisonId;
+	//联系人信息
+	private String liaisonInfo;
+
 	/**产品id*/
 	@Excel(name = "产品id", width = 15)
 	@ApiModelProperty(value = "产品id")

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleInquiryFormPage.java

@@ -159,6 +159,10 @@ public class SaleInquiryFormPage {
     private String inquiryNotes;
 	//质量等级
 	private String qualityGradeHead;
+	//联系人主键
+	private String liaisonId;
+	//联系人信息
+	private String liaisonInfo;
 
 	@ExcelCollection(name="销售询价单子表 - 船明细")
 	@ApiModelProperty(value = "销售询价单子表 - 船明细")

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderAlert.java

@@ -37,6 +37,10 @@ public class SaleOrderAlert implements Serializable {
     private String organize;
     //协议条款
     private String agreementTerms;
+    //联系人主键
+    private String liaisonId;
+    //联系人信息
+    private String liaisonInfo;
 
 //	/**创建时间*/
 //	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderHisPage.java

@@ -240,6 +240,11 @@ public class SaleOrderHisPage {
 	@ApiModelProperty(value = "版本号")
     private String version;
 
+	//联系人主键
+	private String liaisonId;
+	//联系人信息
+	private String liaisonInfo;
+
 	private String sourceCode;
 	private String sourceCode2;
 	//	/订单金额(order money)

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderPage.java

@@ -50,6 +50,10 @@ public class SaleOrderPage {
 	private String organize;
 	//协议条款
 	private String agreementTerms;
+	//联系人主键
+	private String liaisonId;
+	//联系人信息
+	private String liaisonInfo;
 
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationAlert.java

@@ -36,6 +36,10 @@ public class SaleQuotationAlert {
 	//协议条款
 	private String agreementTerms;
 
+	//联系人主键
+	private String liaisonId;
+	//联系人信息
+	private String liaisonInfo;
 //	/**创建时间*/
 //	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
 //    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationHisPage.java

@@ -50,6 +50,10 @@ public class SaleQuotationHisPage {
 	//协议条款
 	private String agreementTerms;
 
+	//联系人主键
+	private String liaisonId;
+	//联系人信息
+	private String liaisonInfo;
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

+ 4 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationPage.java

@@ -38,6 +38,10 @@ public class SaleQuotationPage {
 	//协议条款
 	private String agreementTerms;
 
+	//联系人主键
+	private String liaisonId;
+	//联系人信息
+	private String liaisonInfo;
 	/**确认人*/
 	@ApiModelProperty(value = "确认人")
 	private String confirmBy;