Просмотр исходного кода

Merge remote-tracking branch 'origin/20250121-分批还原,快速报工权限修改等。' into 20250121-分批还原,快速报工权限修改等。

ezhizao_zx 4 месяцев назад
Родитель
Сommit
4f06f7b66f

+ 33 - 0
src/main/java/cn/ezhizao/project/business/controller/BizTaksStockLotController.java

@@ -110,6 +110,39 @@ public class BizTaksStockLotController extends BaseController {
         return success(bizTaksStockLotService.getById(id));
     }
 
+
+    /**
+     * 查询外协未收回批次信息列表
+     */
+    @GetMapping(value = "/outsourceInfo")
+    @Log(title = "查询外协未收回批次信息列表", businessType = BusinessType.SELECT)
+    public TableDataInfo getOutsourceInfo(BizTaksStockLot bizTaksStockLot) {
+        startPage();
+        //查询出未收回的批次信息
+        List<BizTaksStockLot> outsourcedOrderDetailList = bizTaksStockLotService.getOutsourceDetailList(bizTaksStockLot);
+        return getDataTable(outsourcedOrderDetailList);
+    }
+
+
+    /**
+     * 一键盘点未收回批次信息
+     */
+    @PostMapping(value = "/saveOutsourceInfo")
+    @Log(title = "一键盘点未收回批次", businessType = BusinessType.UPDATE)
+    public AjaxResult saveOutsourceInfo(@RequestBody BizTaksStockLot bizTaksStockLot) {
+
+        //查询出未收回的批次信息
+        List<BizTaksStockLot> outsourcedOrderDetailList = bizTaksStockLotService.getOutsourceDetailList(bizTaksStockLot);
+        if(outsourcedOrderDetailList.isEmpty()){
+            return error("没有可盘点的批次");
+        }
+        outsourcedOrderDetailList.forEach(item -> {
+            item.setTaksStockNum(item.getProdNum());
+            item.setIsTaksStock(1);
+        });
+        return success(bizTaksStockLotService.saveOrUpdateBatch(outsourcedOrderDetailList));
+    }
+
     /**
      * 新增盘点批次信息
      */

+ 3 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizOutsourcedOrderDetailMapper.java

@@ -3,6 +3,7 @@ package cn.ezhizao.project.business.mapper;
 import java.util.List;
 
 import cn.ezhizao.project.business.domain.BizReturnReceiptDetail;
+import cn.ezhizao.project.business.domain.BizTaksStockLot;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import cn.ezhizao.project.business.domain.BizOutsourcedOrderDetail;
 
@@ -47,4 +48,6 @@ public interface BizOutsourcedOrderDetailMapper extends BaseMapper<BizOutsourced
     public List<BizOutsourcedOrderDetail> getListForAllReceipt(BizOutsourcedOrderDetail bizOutsourcedOrderDetail);
     public List<BizOutsourcedOrderDetail> getFinishedReturnList(BizOutsourcedOrderDetail bizOutsourcedOrderDetail);
     public List<BizOutsourcedOrderDetail> getFinishedOutsourceDetailList(BizOutsourcedOrderDetail bizOutsourcedOrderDetail);
+
+    List<BizOutsourcedOrderDetail> getOutsourceDetailList(BizTaksStockLot bizTaksStockLot);
 }

+ 4 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizTaksStockLotMapper.java

@@ -31,4 +31,8 @@ public interface BizTaksStockLotMapper extends BaseMapper<BizTaksStockLot>
      * @return 删除结果
     */
     public int physicalDelete(BizTaksStockLot bizTaksStockLot);
+
+    List<BizTaksStockLot> getOutsourceDetailList(BizTaksStockLot bizTaksStockLot);
+
+    String saveOutsourceInfo(BizTaksStockLot bizTaksStockLot);
 }

+ 3 - 0
src/main/java/cn/ezhizao/project/business/service/IBizOutsourcedOrderDetailService.java

@@ -3,6 +3,7 @@ package cn.ezhizao.project.business.service;
 import java.util.List;
 
 import cn.ezhizao.project.business.domain.BizOutsourcedOrder;
+import cn.ezhizao.project.business.domain.BizTaksStockLot;
 import com.baomidou.mybatisplus.extension.service.IService;
 import cn.ezhizao.project.business.domain.BizOutsourcedOrderDetail;
 
@@ -50,4 +51,6 @@ public interface IBizOutsourcedOrderDetailService extends IService<BizOutsourced
     List<BizOutsourcedOrderDetail> getFinishedOutsourceDetailList(BizOutsourcedOrderDetail bizOutsourcedOrderDetail);
 
     int removeByMasterIds(List<Long> ids);
+
+    List<BizOutsourcedOrderDetail> getOutsourceDetailList(BizTaksStockLot bizTaksStockLot);
 }

+ 3 - 0
src/main/java/cn/ezhizao/project/business/service/IBizTaksStockLotService.java

@@ -32,4 +32,7 @@ public interface IBizTaksStockLotService extends IService<BizTaksStockLot>
      */
     public int physicalDelete(BizTaksStockLot bizTaksStockLot);
 
+    List<BizTaksStockLot> getOutsourceDetailList(BizTaksStockLot bizTaksStockLot);
+
+
 }

+ 6 - 0
src/main/java/cn/ezhizao/project/business/service/impl/BizOutsourcedOrderDetailServiceImpl.java

@@ -5,6 +5,7 @@ import javax.annotation.Resource;
 
 import cn.ezhizao.project.business.domain.BizOutsourcedOrder;
 import cn.ezhizao.project.business.domain.BizReturnReceiptDetail;
+import cn.ezhizao.project.business.domain.BizTaksStockLot;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import cn.ezhizao.project.business.mapper.BizOutsourcedOrderDetailMapper;
@@ -115,6 +116,11 @@ public class BizOutsourcedOrderDetailServiceImpl  extends ServiceImpl<BizOutsour
         return bizOutsourcedOrderDetailMapper.removeByMasterIds(ids);
     }
 
+    @Override
+    public List<BizOutsourcedOrderDetail> getOutsourceDetailList(BizTaksStockLot bizTaksStockLot) {
+        return bizOutsourcedOrderDetailMapper.getOutsourceDetailList(bizTaksStockLot);
+    }
+
     @Override
     public List<BizOutsourcedOrderDetail> getFinishedOutsourceDetailList(BizOutsourcedOrderDetail bizOutsourcedOrderDetail)
     {

+ 7 - 1
src/main/java/cn/ezhizao/project/business/service/impl/BizTaksStockLotServiceImpl.java

@@ -56,6 +56,12 @@ public class BizTaksStockLotServiceImpl  extends ServiceImpl<BizTaksStockLotMapp
      * @return 删除结果
      */
     @Override
-    public int physicalDelete(BizTaksStockLot bizTaksStockLot){ return bizTaksStockLotMapper.physicalDelete(bizTaksStockLot); };
+    public int physicalDelete(BizTaksStockLot bizTaksStockLot){ return bizTaksStockLotMapper.physicalDelete(bizTaksStockLot); }
+
+    @Override
+    public List<BizTaksStockLot> getOutsourceDetailList(BizTaksStockLot bizTaksStockLot) {
+        return bizTaksStockLotMapper.getOutsourceDetailList(bizTaksStockLot);
+    }
+
 
 }

+ 16 - 0
src/main/resources/mybatis/business/BizOutsourcedOrderDetailMapper.xml

@@ -276,6 +276,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
         order by t1.create_time desc
     </select>
+
+
+<!-- 根据批次号和发出单号查询biz_outsourced_order_detail表中production_dept_id为0并且根据biz_outsourced_order_detail的id查询biz_return_receipt_detail表中不存或status=0的记录,返回结果集
+-->
+    <select id="getOutsourceDetailList" parameterType="BizOutsourcedOrderDetail" resultMap="BizOutsourcedOrderDetailResult">
+        SELECT t1.*
+        FROM biz_outsourced_order_detail t1 left join biz_return_receipt_detail t2 on t1.id = t2.outsource_detail_id
+        LEFT JOIN  biz_task_stock_lot t3 on t1.lot_id = t3.lot_id
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            t1.deleted = 0 and t1.production_dept_id = 0 and t3.status >2 and t3.deleted = 0 and t3.
+            <if test="outsourceFormNo != null  and outsourceFormNo != ''"> AND t1.form_code = #{outsourceFormNo}</if>
+            <if test="lotCode != null "> AND t1.lot_code like concat('%', #{lotCode}, '%')</if>
+        </trim>
+        order by t1.create_time ASC
+    </select>
+
     <select id="getProcessNames" resultType="String">
         SELECT
         GROUP_CONCAT(t.process_alias order by t.process_step_number asc)

+ 36 - 0
src/main/resources/mybatis/business/BizTaksStockLotMapper.xml

@@ -64,6 +64,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and t1.is_changed = 0 and t1.process_inspection_id = 0
     </select>
 
+
+    <!-- 根据批次号和发出单号查询biz_outsourced_order_detail表中production_dept_id为0并且根据biz_outsourced_order_detail的id查询biz_return_receipt_detail表中不存或status=0的记录,返回结果集
+-->
+<!--    <select id="getOutsourceDetailList" parameterType="BizTaksStockLot" resultMap="BizTaksStockLotResult">-->
+
+<!--        SELECT t1.* FROM biz_taks_stock_lot t1-->
+<!--        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">-->
+
+<!--        </trim>-->
+
+<!--    </select>-->
+
+    <select id="getOutsourceDetailList" parameterType="BizTaksStockLot" resultMap="BizTaksStockLotResult">
+        SELECT t1.*, t2.form_code as outsourceFormNo
+        FROM biz_taks_stock_lot t1
+        INNER JOIN biz_outsourced_order_detail t2 ON t1.lot_id = t2.lot_id
+        LEFT JOIN biz_return_receipt_detail t3 ON t2.id = t3.outsource_detail_id
+        LEFT JOIN biz_outsourced_order t4 ON t2.master_id = t4.id
+        <trim prefix="WHERE" suffixOverrides="AND">
+            t1.deleted = 0
+            AND t1.status &lt; 2
+            AND t1.is_taks_stock = 0
+            AND t1.is_waste = 0
+            AND t4.is_inner_outsource = 0
+            <if test="takeStockPeriodId != null and takeStockPeriodId != ''"> AND t1.take_stock_period_id = #{takeStockPeriodId}</if>
+            <if test="outsourceFormNo != null and outsourceFormNo != ''"> AND t2.form_code = #{outsourceFormNo}</if>
+            <if test="lotCode != null and lotCode != ''"> AND t1.lot_code = #{lotCode}</if>
+            AND t2.production_dept_id = 0
+            AND t2.deleted = 0
+            AND (
+            t3.id IS NULL
+            OR (t3.id IS NOT NULL AND t3.status = 0)
+            )
+        </trim>
+    </select>
+
     <delete id="physicalDelete">
         DELETE FROM biz_taks_stock_lot
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">