Browse Source

feat:核对出库明细,不对就删除明细,回滚库存-补充提交

hmc 1 năm trước cách đây
mục cha
commit
bc2a9649ac

+ 6 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/ProductHandsetOutboundRecordMapper.java

@@ -84,4 +84,10 @@ public interface ProductHandsetOutboundRecordMapper
      * @return
      */
     int deleteProductHandsetOutboundRecordByQrCode(String qrCoed);
+
+    /**
+     * 通过码单号修改手持机出库信息
+     * @param productHandsetOutboundRecord
+     */
+    void updateProductHandsetOutboundRecordByRrCode(ProductHandsetOutboundRecord productHandsetOutboundRecord);
 }

+ 8 - 2
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/ProductOutboundRecordServiceImpl.java

@@ -152,11 +152,17 @@ public class ProductOutboundRecordServiceImpl implements IProductOutboundRecordS
         editProductInventory.setUpdateTime(DateUtils.getNowDate());
         productInventoryMapper.updateProductInventory(editProductInventory);
 
-        //手持机日志记录-逻辑删
+        //手持机日志记录-逻辑删--QrCode是不唯一的
         ProductHandsetOutboundRecord productHandsetOutboundRecord=new ProductHandsetOutboundRecord();
         productHandsetOutboundRecord.setQrCode(productOutboundRecord.getQrCode());
+        productHandsetOutboundRecord.setQrCodeId(productOutboundRecord.getQrCodeId());
+        productHandsetOutboundRecord.setProductId(productOutboundRecord.getProductId());
+        productHandsetOutboundRecord.setProductColour(productHandsetOutboundRecord.getProductColour());
+        productHandsetOutboundRecord.setLevels(productHandsetOutboundRecord.getLevels());
+        productHandsetOutboundRecord.setLotNum(productOutboundRecord.getLotNum());
+        productHandsetOutboundRecord.setNoticeNumber(productOutboundRecord.getNoticeNumber());
         productHandsetOutboundRecord.setDelFlag("2");
-        productHandsetOutboundRecordMapper.updateProductHandsetOutboundRecord(productHandsetOutboundRecord);
+        productHandsetOutboundRecordMapper.updateProductHandsetOutboundRecordByRrCode(productHandsetOutboundRecord);
         //pc端日志记录-逻辑删
         ProductOutboundRecord productOutboundRecordUpdate=new ProductOutboundRecord();
         productOutboundRecordUpdate.setId(id);

+ 41 - 0
zkqy-custom-business/src/main/resources/mapper/business/ProductHandsetOutboundRecordMapper.xml

@@ -197,6 +197,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
         where id = #{id}
     </update>
+    <update id="updateProductHandsetOutboundRecordByRrCode">
+        update {DBNAME}.product_handset_outbound_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="qrCode != null">qr_code = #{qrCode},</if>
+            <if test="qrCodeId != null">qr_code_id = #{qrCodeId},</if>
+            <if test="lotNum != null">lot_num = #{lotNum},</if>
+            <if test="productId != null">product_id = #{productId},</if>
+            <if test="levels != null">levels = #{levels},</if>
+            <if test="canisterNum != null">canister_num = #{canisterNum},</if>
+            <if test="boxNum != null">box_num = #{boxNum},</if>
+            <if test="suttle != null">suttle = #{suttle},</if>
+            <if test="productionDate != null">production_date = #{productionDate},</if>
+            <if test="machineTool != null">machine_tool = #{machineTool},</if>
+            <if test="grossWeight != null">gross_weight = #{grossWeight},</if>
+            <if test="packaging != null">packaging = #{packaging},</if>
+            <if test="workShifts != null">work_shifts = #{workShifts},</if>
+            <if test="foreignTradeNumber != null">foreign_trade_number = #{foreignTradeNumber},</if>
+            <if test="canisterWeight != null">canister_weight = #{canisterWeight},</if>
+            <if test="boxWeight != null">box_weight = #{boxWeight},</if>
+            <if test="tubeColor != null">tube_color = #{tubeColor},</if>
+            <if test="comPort != null">com_port = #{comPort},</if>
+            <if test="printFormat != null">print_format = #{printFormat},</if>
+            <if test="packagingType != null">packaging_type = #{packagingType},</if>
+            <if test="storageLocation != null">storage_location = #{storageLocation},</if>
+            <if test="warehouseregionId != null">warehouseregion_id = #{warehouseregionId},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createById != null">create_by_id = #{createById},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateById != null">update_by_id = #{updateById},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="warehousingTime != null">warehousing_time = #{warehousingTime},</if>
+            <if test="depositor != null">depositor = #{depositor},</if>
+            <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
+            <if test="noticeNumber != null">notice_number = #{noticeNumber},</if>
+            <if test="productColour != null">product_colour = #{productColour},</if>
+        </trim>
+        where qr_code = #{qrCode} and qr_code_id = #{qrCodeId} and  product_id = #{productId} and  product_colour = #{productColour} and  levels = #{levels} and lot_num = #{lotNum} and notice_number = #{noticeNumber}
+    </update>
 
     <delete id="deleteProductHandsetOutboundRecordById" parameterType="Long">
         delete from product_handset_outbound_record where id = #{id}

+ 4 - 3
zkqy-custom-business/src/main/resources/mapper/business/ProductOutboundRecordMapper.xml

@@ -243,7 +243,7 @@
     </insert>
 
     <update id="updateProductOutboundRecord" parameterType="com.zkqy.business.domain.ProductOutboundRecord">
-        update product_outbound_record
+        update {DBNAME}.product_outbound_record
         <trim prefix="SET" suffixOverrides=",">
             <if test="qrCode != null">qr_code = #{qrCode},</if>
             <if test="qrCodeId != null">qr_code_id = #{qrCodeId},</if>
@@ -268,6 +268,7 @@
             <if test="storageLocation != null">storage_location = #{storageLocation},</if>
             <if test="warehouseregionId != null">warehouseregion_id = #{warehouseregionId},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateById != null">update_by_id = #{updateById},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
@@ -282,12 +283,12 @@
 
     <delete id="deleteProductOutboundRecordById" parameterType="Long">
         delete
-        from product_outbound_record
+        from  {DBNAME}.product_outbound_record
         where id = #{id}
     </delete>
 
     <delete id="deleteProductOutboundRecordByIds" parameterType="String">
-        delete from product_outbound_record where id in
+        delete from  {DBNAME}.product_outbound_record where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 1 - 1
zkqy-ui/src/api/system/ProductWarehousingRecord.js

@@ -55,7 +55,7 @@ export function ProductOutboundRecord(query) {
 //删除错误的出库记录表
 export function removeErrorOutboundRecord(ids) {
   return request({
-    url: `/system/removeErrorOutboundRecord/${ids}`,
+    url: `/system/ProductOutboundRecord/removeErrorOutboundRecord/${ids}`,
     method: 'delete',
   })
 }