Browse Source

问题处理

yzc 11 months ago
parent
commit
b8cc8740fb

+ 6 - 1
hx-common/src/main/java/com/fjhx/common/enums/PushBusinessTypeEnum.java

@@ -56,7 +56,12 @@ public enum PushBusinessTypeEnum {
     /**
      * 客户自动转公海
      */
-    CUSTOMER_AUTO_TRANSFER(12);
+    CUSTOMER_AUTO_TRANSFER(12),
+
+    /**
+     * 产品待建
+     */
+    WAIT_PRODUCT(13);
 
     private final int type;
 

+ 1 - 0
hx-form/src/main/java/com/fjhx/form/service/impl/StatisticsServiceImpl.java

@@ -71,6 +71,7 @@ public class StatisticsServiceImpl implements StatisticsService {
                 .ne(SaleQuotation::getStatus, FlowStatusEnum1.UPDATE.getKey())
                 //子公司
                 .ne(!isHeadOffice, SaleQuotation::getStatus, FlowStatusEnum1.DRAFT.getKey())
+                .ne(SaleQuotation::getQuotationStatus, 2)
         );
         //待投产
         long waitProduceCount = produceOrderService.count(q -> q

+ 3 - 0
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -478,6 +478,9 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
             ProductInfo materialInfo = materialMap.get(materialId);
             Assert.notEmpty(materialInfo, "查询不到物料信息!");
             BigDecimal stockThreshold = materialInfo.getStockThreshold();
+            if (stockThreshold == null) {
+                stockThreshold = BigDecimal.ZERO;
+            }
 
             //获取可用库存
             ProductStockInfo productStockInfo = productStockInfoService.getOne(q -> q

+ 21 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/vo/ExtQuotationProductVo.java

@@ -86,4 +86,25 @@ public class ExtQuotationProductVo extends ExtQuotationProduct {
      */
     private BigDecimal prodPrice;
 
+    private Long productClassifyId;
+    private String productClassifyName;
+
+
+    /**
+     * 正面纹路
+     */
+    private String productFrontalTexture;
+    /**
+     * 反面纹路
+     */
+    private String productReverseTexture;
+    /**
+     * 净重
+     */
+    private BigDecimal productNetWeight;
+    /**
+     * 单位
+     */
+    private String productUnit;
+
 }

+ 1 - 1
hx-sale/src/main/java/com/fjhx/sale/entity/sale/dto/SaleQuotationSelectDto.java

@@ -29,7 +29,7 @@ public class SaleQuotationSelectDto extends BaseSelectDto {
     /**
      * 报价状态 0未报价 1报价中 2已报价
      */
-    private Integer quotationStatus;
+    private String quotationStatus;
 
     /**
      * 归属公司Id

+ 23 - 0
hx-sale/src/main/java/com/fjhx/sale/service/ext/impl/ExtQuotationServiceImpl.java

@@ -10,12 +10,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.area.utils.CustomizeAreaUtil;
 import com.fjhx.common.enums.CodingRuleEnum;
 import com.fjhx.common.enums.FlowStatusEnum1;
+import com.fjhx.common.enums.PushBusinessTypeEnum;
 import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.common.utils.Assert;
 import com.fjhx.common.utils.Utils;
 import com.fjhx.customer.service.customer.CustomerService;
 import com.fjhx.file.entity.FileInfoVo;
 import com.fjhx.file.utils.ObsFileUtil;
+import com.fjhx.item.service.product.ProductClassifyService;
 import com.fjhx.item.service.product.ProductInfoService;
 import com.fjhx.sale.entity.ext.dto.*;
 import com.fjhx.sale.entity.ext.po.*;
@@ -29,6 +31,8 @@ import com.fjhx.sale.mapper.ext.ExtQuotationMapper;
 import com.fjhx.sale.service.ext.*;
 import com.fjhx.sale.service.quotation.QuotationProductService;
 import com.fjhx.sale.service.sale.SaleQuotationService;
+import com.fjhx.socket.core.PushTypeEnum;
+import com.fjhx.socket.core.WebSocketPush;
 import com.ruoyi.common.core.domain.BasePo;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysUser;
@@ -78,6 +82,8 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
     private ExtQuotationProductCustomInfoService quotationProductCustomInfoService;
     @Autowired
     private QuotationProductService quotationProductService;
+    @Autowired
+    private ProductClassifyService productClassifyService;
 
     @Override
     public Page<ExtQuotationVo> getPage(ExtQuotationSelectDto dto) {
@@ -426,6 +432,16 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
             item.setProductWidth(productInfo.getWidth());
             item.setProductHeight(productInfo.getHeight());
             item.setProductColor(productInfo.getColor());
+            item.setProductClassifyId(productInfo.getProductClassifyId());
+
+            item.setProductFrontalTexture(productInfo.getFrontalTexture());
+            item.setProductReverseTexture(productInfo.getReverseTexture());
+            item.setProductNetWeight(productInfo.getNetWeight());
+            item.setProductUnit(productInfo.getUnit());
+        });
+        //赋值产品分类
+        productClassifyService.attributeAssign(quotationProductVos, ExtQuotationProductVo::getProductClassifyId, (item, classify) -> {
+            item.setProductClassifyName(classify.getName());
         });
         //获取配件列表
         List<Long> qpIds = quotationProductVos.stream().map(ExtQuotationProduct::getId).collect(Collectors.toList());
@@ -524,6 +540,13 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
                 .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
                 .set(BasePo::getUpdateTime, new Date())
         );
+        //消息通知给产品维护员
+        List<Long> productManageUserIds = UserUtil.getUserIdsByRoleKey("ProductManage", SecurityUtils.getCompanyId());
+        WebSocketPush.byUsers(PushTypeEnum.MESSAGE,
+                productManageUserIds,
+                "您有新的待建产品需维护,请及时处理!",
+                PushBusinessTypeEnum.WAIT_PRODUCT.getType()
+        );
     }
 
 }

+ 4 - 1
hx-sale/src/main/java/com/fjhx/sale/service/sale/impl/SaleQuotationServiceImpl.java

@@ -140,7 +140,10 @@ public class SaleQuotationServiceImpl extends ServiceImpl<SaleQuotationMapper, S
 
 
         //报价状态
-        wrapper.eq(SaleQuotation::getQuotationStatus, dto.getQuotationStatus());
+        String quotationStatus = dto.getQuotationStatus();
+        if (ObjectUtil.isNotEmpty(quotationStatus)) {
+            wrapper.in(SaleQuotation::getQuotationStatus, quotationStatus.split(","));
+        }
 
         //报价单类型
         wrapper.eq(SaleQuotation::getType, dto.getType());