Selaa lähdekoodia

待创建产品问题处理

yzc 1 vuosi sitten
vanhempi
commit
15b1bdf116

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/entity/ext/po/ExtQuotation.java

@@ -135,4 +135,9 @@ public class ExtQuotation extends BasePo {
      * 归属部门id
      */
     private Long ofDeptId;
+
+    /**
+     * 生成待创建产品时间
+     */
+    private Long waitProductTime;
 }

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

@@ -5,6 +5,7 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -69,4 +70,9 @@ public class ExtQuotationProductVo extends ExtQuotationProduct {
      */
     private String rawMaterialNetWeight;
 
+    /**
+     * 待创建产品生成时间
+     */
+    private Date waitProductTime;
+
 }

+ 5 - 0
hx-sale/src/main/java/com/fjhx/sale/service/ext/impl/ExtQuotationProductServiceImpl.java

@@ -30,6 +30,7 @@ import com.fjhx.sale.service.ext.ExtQuotationService;
 import com.ruoyi.common.core.domain.BasePo;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.ruoyi.common.utils.wrapper.SqlField;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -67,6 +68,10 @@ public class ExtQuotationProductServiceImpl extends ServiceImpl<ExtQuotationProd
         //过滤待创建产品数据
         wrapper.eq("eq.create_product_status", 1);
         wrapper.isNull("eqp.product_id");
+        wrapper.orderByDesc("eq.wait_product_time");
+
+        wrapper.keyword(dto.getKeyword(), new SqlField("eq.code"));
+
         Page<ExtQuotationProductVo> page = baseMapper.waitCreateProductPage(dto.getPage(), wrapper);
         List<ExtQuotationProductVo> records = page.getRecords();
         if (ObjectUtil.isEmpty(records)) {

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

@@ -490,6 +490,7 @@ public class ExtQuotationServiceImpl extends ServiceImpl<ExtQuotationMapper, Ext
         this.update(q -> q
                 .eq(ExtQuotation::getId, id)
                 .set(ExtQuotation::getCreateProductStatus, 1)
+                .set(ExtQuotation::getWaitProductTime, new Date())
                 .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
                 .set(BasePo::getUpdateTime, new Date())
         );

+ 3 - 2
hx-sale/src/main/resources/mapper/ext/ExtQuotationProductMapper.xml

@@ -3,9 +3,10 @@
 <mapper namespace="com.fjhx.sale.mapper.ext.ExtQuotationProductMapper">
     <select id="waitCreateProductPage" resultType="com.fjhx.sale.entity.ext.vo.ExtQuotationProductVo">
         SELECT eqp.*,
-               eq.code as extQuotationCode
+               eq.code as extQuotationCode,
+               eq.wait_product_time
         FROM ext_quotation_product eqp
-                 JOIN ext_quotation eq
+                 JOIN ext_quotation eq ON eqp.sale_quotation_id = eq.id
             ${ew.customSqlSegment}
     </select>
 </mapper>