home il y a 2 ans
Parent
commit
6adb43f27f

+ 14 - 15
hx-service-api/victoriatourist-api/src/main/java/com/fjhx/entity/apply/ApplyPurchase.java

@@ -50,26 +50,11 @@ public class ApplyPurchase extends BaseEntity {
     private BigDecimal quantity;
 
     /**
-     * 到货数量
-     */
-    private BigDecimal arrivalQuantity;
-
-    /**
      * 单价
      */
     private BigDecimal unitPrice;
 
     /**
-     * 申购金额
-     */
-    private BigDecimal applyPrice;
-
-    /**
-     * 到货金额
-     */
-    private BigDecimal arrivalPrice;
-
-    /**
      * 要求到货时间
      */
     private Date planArrivalTime;
@@ -90,6 +75,16 @@ public class ApplyPurchase extends BaseEntity {
     private String cause;
 
     /**
+     * 入库数量
+     */
+    private BigDecimal receiptQuantity;
+
+    /**
+     * 入库时间
+     */
+    private BigDecimal receiptTime;
+
+    /**
      * 乐观锁
      */
     @TableField(fill = FieldFill.INSERT)
@@ -138,4 +133,8 @@ public class ApplyPurchase extends BaseEntity {
      */
     @TableField(exist = false)
     private String warehouseName;
+
+
+
+
 }

+ 14 - 4
hx-service/victoriatourist/src/main/java/com/fjhx/controller/stock/ApplyInController.java

@@ -1,10 +1,17 @@
 package com.fjhx.controller.stock;
 
-import com.fjhx.service.stock.StockService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.base.Condition;
+import com.fjhx.service.apply.ApplyPurchaseService;
+import org.springblade.core.tool.api.R;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Map;
+
 /**
  * 申购入库
  */
@@ -13,10 +20,13 @@ import org.springframework.web.bind.annotation.RestController;
 public class ApplyInController {
 
     @Autowired
-    private StockService stockService;
-
-
+    private ApplyPurchaseService applyPurchaseService;
 
+    @PostMapping("/page")
+    public R page(@RequestBody Condition condition) {
+        Page<Map<String, Object>> result = applyPurchaseService.applyInPage(condition);
+        return R.success(result);
+    }
 
 
 }

+ 9 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/mapper/apply/ApplyPurchaseMapper.java

@@ -6,6 +6,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fjhx.entity.supplier.SupplierPrice;
 import com.fjhx.utils.wrapperUtil.IWrapper;
 import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.entity.apply.ApplyPurchase;
+import com.fjhx.utils.wrapperUtil.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Map;
 
 /**
  * <p>
@@ -18,4 +24,7 @@ import org.apache.ibatis.annotations.Param;
 public interface ApplyPurchaseMapper extends BaseMapper<ApplyPurchase> {
 
     Page<ApplyPurchase> getPage(@Param("page") Page<ApplyPurchase> page, @Param("ew") IWrapper<ApplyPurchase> wrapper);
+
+    Page<Map<String, Object>> applyInPage(@Param("page") Page<ApplyPurchase> page, @Param("ew") IWrapper<Object> wrapper);
+
 }

+ 42 - 27
hx-service/victoriatourist/src/main/java/com/fjhx/mapper/apply/ApplyPurchaseMapper.xml

@@ -3,32 +3,47 @@
 <mapper namespace="com.fjhx.mapper.apply.ApplyPurchaseMapper">
 
     <select id="getPage" resultType="com.fjhx.entity.apply.ApplyPurchase">
-        SELECT
-            t1.id,
-            t1.`code`,
-            t1.purchase_id,
-            t1.purchase_code,
-            t1.goods_id,
-            t1.quantity,
-            t1.arrival_quantity,
-            t1.unit_price,
-            t1.apply_price,
-            t1.arrival_price,
-            t1.plan_arrival_time,
-            t1.receipt_warehouse_id,
-            t1.`status`,
-            t1.cause,
-            t1.create_user,
-            t1.create_time,
-            t2.`type` goodsType,
-            t2.`code` goodsCode,
-            t2.`name` goodsName,
-            t2.unit goodsUnit,
-	        t3.`name` warehouseName
-        FROM
-            apply_purchase t1
-            LEFT JOIN material t2 ON t1.goods_id = t2.id
-	        LEFT JOIN warehouse t3 ON t1.receipt_warehouse_id = t3.id
-        ${ew.customSqlSegment}
+        SELECT t1.id,
+               t1.`code`,
+               t1.purchase_id,
+               t1.purchase_code,
+               t1.goods_id,
+               t1.quantity,
+               t1.unit_price,
+               t1.plan_arrival_time,
+               t1.receipt_warehouse_id,
+               t1.`status`,
+               t1.cause,
+               t1.create_user,
+               t1.create_time,
+               t2.`type` goodsType,
+               t2.`code` goodsCode,
+               t2.`name` goodsName,
+               t2.unit   goodsUnit,
+               t3.`name` warehouseName
+        FROM apply_purchase t1
+                 LEFT JOIN material t2 ON t1.goods_id = t2.id
+                 LEFT JOIN warehouse t3 ON t1.receipt_warehouse_id = t3.id
+            ${ew.customSqlSegment}
     </select>
+
+    <select id="applyInPage" resultType="java.util.LinkedHashMap">
+        select ap.id,
+               ap.code,
+               pi.code                             productCode,
+               pi.name                             productName,
+               pi.type                             productType,
+               ap.quantity,
+               ap.receipt_quantity,
+               (ap.quantity - ap.receipt_quantity) not_receipt_quantity,
+               w.name                              warehouse_name,
+               receipt_time,
+               ap.create_user,
+               ap.status
+        from apply_purchase ap
+                 left join product_info pi on ap.goods_id = pi.id
+                 LEFT JOIN warehouse w ON ap.receipt_warehouse_id = w.id
+            ${ew.customSqlSegment}
+    </select>
+
 </mapper>

+ 7 - 1
hx-service/victoriatourist/src/main/java/com/fjhx/service/apply/ApplyPurchaseService.java

@@ -1,9 +1,10 @@
 package com.fjhx.service.apply;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.base.BaseService;
+import com.fjhx.base.Condition;
 import com.fjhx.entity.apply.ApplyPurchase;
 import com.fjhx.params.apply.ApplyPurchaseVo;
-import com.fjhx.base.BaseService;
 
 import java.util.List;
 import java.util.Map;
@@ -26,4 +27,9 @@ public interface ApplyPurchaseService extends BaseService<ApplyPurchase> {
 
     void delete(ApplyPurchaseVo applyPurchaseVo);
 
+    /**
+     * 申购入库分页
+     */
+    Page<Map<String, Object>> applyInPage(Condition condition);
+
 }

+ 18 - 0
hx-service/victoriatourist/src/main/java/com/fjhx/service/apply/impl/ApplyPurchaseServiceImpl.java

@@ -2,6 +2,7 @@ package com.fjhx.service.apply.impl;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.base.Condition;
 import com.fjhx.entity.apply.ApplyPurchase;
 import com.fjhx.mapper.apply.ApplyPurchaseMapper;
 import com.fjhx.params.apply.ApplyPurchaseVo;
@@ -103,4 +104,21 @@ public class ApplyPurchaseServiceImpl extends ServiceImpl<ApplyPurchaseMapper, A
         removeById(applyPurchaseVo.getId());
     }
 
+    /**
+     * 申购入库分页
+     */
+    @Override
+    public Page<Map<String, Object>> applyInPage(Condition condition) {
+        IWrapper<Object> wrapper = IWrapper.getWrapper(condition);
+        wrapper.func(q -> {
+//            condition.getLong("")
+
+
+        });
+
+        Page<Map<String, Object>> page = baseMapper.applyInPage(createPage(condition), wrapper);
+        UserClientUtil.setUserName(page.getRecords(), "createUser", "createUserName");
+        return page;
+    }
+
 }