Quellcode durchsuchen

feat:二维码缩小体积

hmc vor 1 Jahr
Ursprung
Commit
239c8c69b0
15 geänderte Dateien mit 100 neuen und 100 gelöschten Zeilen
  1. 0 74
      zkqy-custom-business/src/main/java/com/zkqy/business/controller/MaterialInventoryController.java
  2. 8 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/DetailsOfTheRefuelingPlanMapper.java
  3. 8 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/InboundRecordsMapper.java
  4. 6 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/MaterialInventoryMapper.java
  5. 6 0
      zkqy-custom-business/src/main/java/com/zkqy/business/mapper/OutboundRecordsMapper.java
  6. 9 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/IInboundRecordsService.java
  7. 5 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/IMaterialInventoryService.java
  8. 7 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/IOutboundRecordsService.java
  9. 6 1
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/InboundRecordsServiceImpl.java
  10. 23 11
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/MaterialInventoryServiceImpl.java
  11. 9 0
      zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/OutboundRecordsServiceImpl.java
  12. 3 0
      zkqy-custom-business/src/main/resources/mapper/business/InboundRecordsMapper.xml
  13. 3 0
      zkqy-custom-business/src/main/resources/mapper/business/MaterialInventoryMapper.xml
  14. 3 0
      zkqy-custom-business/src/main/resources/mapper/business/OutboundRecordsMapper.xml
  15. 4 14
      zkqy-ui/src/views/orderMange/purchase/listInfoTwo.vue

+ 0 - 74
zkqy-custom-business/src/main/java/com/zkqy/business/controller/MaterialInventoryController.java

@@ -172,43 +172,6 @@ public class MaterialInventoryController extends BaseController {
     public AjaxResult deliveryFromStorage(@RequestBody MaterialInventoryVo materialInventoryVo) {
         //入库操作
         return materialInventoryService.outMaterialInventory(materialInventoryVo);
-//        //1、禁止重复入库
-//        InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-//        if (inboundRecords == null) {
-//            return AjaxResult.success("此货品还没有入库,不能出库");
-//        }
-//        //2、是否重复入库
-//        OutboundRecords outboundRecords = outboundRecordsMapper.selectOutboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-//        if (outboundRecords != null) {
-//            return AjaxResult.success("此货品不能重复出库");
-//        }
-//        //3、根据物料编码跟规则查询库存信息
-//        MaterialInventory materialInventory
-//                = materialInventoryService.selectMaterialInventoryByMaterialCodeAndSpecifications(materialInventoryVo.getMaterialCode(), materialInventoryVo.getSpecifications());
-//        //4、出库多少减去这个数量
-//        Double quantityOld = materialInventory.getQuantity();
-//        Double quantity = materialInventoryVo.getQuantity();
-//        Double newQuantity =quantityOld-quantity;
-//        materialInventory.setQuantity(newQuantity);
-//        int count = materialInventoryService.updateMaterialInventory(materialInventory);
-//        if (count > 0) {
-//            OutboundRecords outboundRecords1 = new OutboundRecords();
-//            outboundRecords1.setOutboundTime(new Date());//出库时间
-//            //物料名称需要根据物料编码查询下
-//            Materiel materiel = materielMapper.selectMaterielByMaterielCode(materialInventoryVo.getMaterialCode());
-//            outboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-//            outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
-//            outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
-//            outboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
-//            outboundRecords1.setOutboundUnit(materialInventoryVo.getInboundUnit());//单位
-//            outboundRecords1.setOutboundQuantity(materialInventoryVo.getQuantity().toString());//出库数量
-//            outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
-//            outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
-//            outboundRecords1.setCreateTime(new Date());//创建时间
-//            outboundRecordsMapper.insertOutboundRecords(outboundRecords1); //插出库库日志信息
-//            return AjaxResult.success("出库成功");
-//        }
-//        return AjaxResult.error("出库失败");
     }
 
 
@@ -219,43 +182,6 @@ public class MaterialInventoryController extends BaseController {
     public AjaxResult deliveryFromStorageTwo(@RequestBody List<MaterialInventoryVo> materialInventoryVo) {
         //入库操作
         return materialInventoryService.outMaterialInventoryTwo(materialInventoryVo);
-//        //1、禁止重复入库
-//        InboundRecords inboundRecords = inboundRecordsMapper.selectInboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-//        if (inboundRecords == null) {
-//            return AjaxResult.success("此货品还没有入库,不能出库");
-//        }
-//        //2、是否重复入库
-//        OutboundRecords outboundRecords = outboundRecordsMapper.selectOutboundRecordsByQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-//        if (outboundRecords != null) {
-//            return AjaxResult.success("此货品不能重复出库");
-//        }
-//        //3、根据物料编码跟规则查询库存信息
-//        MaterialInventory materialInventory
-//                = materialInventoryService.selectMaterialInventoryByMaterialCodeAndSpecifications(materialInventoryVo.getMaterialCode(), materialInventoryVo.getSpecifications());
-//        //4、出库多少减去这个数量
-//        Double quantityOld = materialInventory.getQuantity();
-//        Double quantity = materialInventoryVo.getQuantity();
-//        Double newQuantity =quantityOld-quantity;
-//        materialInventory.setQuantity(newQuantity);
-//        int count = materialInventoryService.updateMaterialInventory(materialInventory);
-//        if (count > 0) {
-//            OutboundRecords outboundRecords1 = new OutboundRecords();
-//            outboundRecords1.setOutboundTime(new Date());//出库时间
-//            //物料名称需要根据物料编码查询下
-//            Materiel materiel = materielMapper.selectMaterielByMaterielCode(materialInventoryVo.getMaterialCode());
-//            outboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
-//            outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
-//            outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
-//            outboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
-//            outboundRecords1.setOutboundUnit(materialInventoryVo.getInboundUnit());//单位
-//            outboundRecords1.setOutboundQuantity(materialInventoryVo.getQuantity().toString());//出库数量
-//            outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
-//            outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
-//            outboundRecords1.setCreateTime(new Date());//创建时间
-//            outboundRecordsMapper.insertOutboundRecords(outboundRecords1); //插出库库日志信息
-//            return AjaxResult.success("出库成功");
-//        }
-//        return AjaxResult.error("出库失败");
     }
 
 

+ 8 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/DetailsOfTheRefuelingPlanMapper.java

@@ -29,6 +29,14 @@ public interface DetailsOfTheRefuelingPlanMapper
      */
     public List<DetailsOfTheRefuelingPlan> selectDetailsOfTheRefuelingPlanList(DetailsOfTheRefuelingPlan detailsOfTheRefuelingPlan);
 
+    /**
+     * 查询加弹计划详细信息列表
+     *
+     * @return 加弹计划详细信息集合
+     */
+    public int selectDetailsOfTheRefuelingPlanListCount();
+
+
     /**
      * 修改查询计划信息
      * @param detailsOfTheRefuelingPlan

+ 8 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/InboundRecordsMapper.java

@@ -30,6 +30,14 @@ public interface InboundRecordsMapper
      */
     public InboundRecords selectInboundRecordsByQtCodeNumber(String qtCodeNumber);
 
+
+    /**
+     * 查询入库记录 总数量
+     *
+     * @return 入库记录
+     */
+    public int selectInboundRecordsByQtCodeNumberCount();
+
     /**
      * 查询入库记录列表
      * 

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

@@ -85,4 +85,10 @@ public interface MaterialInventoryMapper
      * @return 物料库存
      */
     MaterialInventory selectMaterialInventoryByMaterialCode(String  materialCode);
+
+    /**
+     * 查询物料的总数量
+     * @return
+     */
+    int selectMaterialInventoryListSum();
 }

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

@@ -21,6 +21,12 @@ public interface OutboundRecordsMapper
      */
     public OutboundRecords selectOutboundRecordsById(Long id);
 
+    /**
+     * 查询入库记录 总数量
+     *
+     * @return 入库记录
+     */
+    public int selectOutboundRecordsCount();
 
     /**
      * 二维码出库编码

+ 9 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/IInboundRecordsService.java

@@ -27,6 +27,15 @@ public interface IInboundRecordsService
      */
     public List<InboundRecords> selectInboundRecordsList(InboundRecords inboundRecords);
 
+
+
+    /**
+     * 查询入库记录 总数量
+     *
+     * @return 入库记录
+     */
+    public int selectInboundRecordsByQtCodeNumberCount();
+
     /**
      * 新增入库记录
      * 

+ 5 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/IMaterialInventoryService.java

@@ -30,6 +30,11 @@ public interface IMaterialInventoryService
      */
     public List<MaterialInventory> selectMaterialInventoryList(MaterialInventory materialInventory);
 
+    /**
+     * 查询总物料数量
+     * @return
+     */
+    public int selectMaterialInventoryListSum();
     /**
      * 入库
      * 

+ 7 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/IOutboundRecordsService.java

@@ -35,6 +35,13 @@ public interface IOutboundRecordsService
      */
     public int insertOutboundRecords(OutboundRecords outboundRecords);
 
+    /**
+     * 查询入库记录 总数量
+     *
+     * @return 入库记录
+     */
+    public int selectOutboundRecordsCount();
+
     /**
      * 修改出库记录
      * 

+ 6 - 1
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/InboundRecordsServiceImpl.java

@@ -17,6 +17,7 @@ import com.zkqy.business.service.IInboundRecordsService;
  */
 @Service
 public class InboundRecordsServiceImpl implements IInboundRecordsService {
+
     @Autowired
     private InboundRecordsMapper inboundRecordsMapper;
 
@@ -39,10 +40,14 @@ public class InboundRecordsServiceImpl implements IInboundRecordsService {
      */
     @Override
     public List<InboundRecords> selectInboundRecordsList(InboundRecords inboundRecords) {
-
         return inboundRecordsMapper.selectInboundRecordsList(inboundRecords);
     }
 
+    @Override
+    public int selectInboundRecordsByQtCodeNumberCount() {
+        return inboundRecordsMapper.selectInboundRecordsByQtCodeNumberCount();
+    }
+
     /**
      * 新增入库记录
      *

+ 23 - 11
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/MaterialInventoryServiceImpl.java

@@ -82,10 +82,11 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
             }
         //没有入过库走新增操作
         }else {
+            Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(materialInventoryVo.getMaterialId()));
             MaterialInventory materialInventoryObj = new MaterialInventory();
             materialInventoryObj.setStockNumber(String.valueOf(new Date().getTime()));//库存编号
             materialInventoryObj.setWarehouseEntryNumber(UUID.randomUUID().toString());//入库单编号
-            materialInventoryObj.setMaterialCode(materialInventoryVo.getMaterialCode());//物料编号
+            materialInventoryObj.setMaterialCode(materiel.getMaterielCode());//物料编号
             materialInventoryObj.setQuantity(materialInventoryVo.getQuantity());//数量
             materialInventoryObj.setCreateById(SecurityUtils.getUserId());
             materialInventoryObj.setLotNumber(materialInventoryVo.getLotNumber());//批号
@@ -99,8 +100,8 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
             //物料名称需要根据物料编码查询下
             Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(materialInventoryVo.getMaterialId()));
             inboundRecords3.setInboundAterialsName(materiel.getMaterielName());//物料名称
-            inboundRecords3.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
-            inboundRecords3.setInboundUnit(materialInventoryVo.getInboundUnit());//单位
+            inboundRecords3.setSpecifications(materiel.getSpecificationModel());//规格代号
+            inboundRecords3.setInboundUnit(materiel.getUnits());//单位
             inboundRecords3.setInboundQuantity(materialInventoryVo.getQuantity().toString());//入库数量
             inboundRecords3.setInboundLeader(SecurityUtils.getUsername());//仓管员
             inboundRecords3.setCreateById(SecurityUtils.getUserId());//创建人
@@ -205,11 +206,10 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
                     outboundRecords1.setOutboundTime(new Date());//出库时间
                     //物料名称需要根据物料编码查询下
                     Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(materialInventoryVo.getMaterialId()));
-                    outboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
                     outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
                     outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
-                    outboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
-                    outboundRecords1.setOutboundUnit(materialInventoryVo.getInboundUnit());//单位
+                    outboundRecords1.setSpecifications(materiel.getSpecificationModel());//规格代号
+                    outboundRecords1.setOutboundUnit(materiel.getUnits());//单位
                     outboundRecords1.setOutboundQuantity(materialInventoryVo.getQuantity().toString());//出库数量
                     outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
                     outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
@@ -265,10 +265,11 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
                     }
                     //没有入过库走新增操作
                 }else {
+                    Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(item.getMaterialId()));
                     MaterialInventory materialInventoryObj = new MaterialInventory();
                     materialInventoryObj.setStockNumber(String.valueOf(new Date().getTime()));//库存编号
                     materialInventoryObj.setWarehouseEntryNumber(UUID.randomUUID().toString());//入库单编号
-                    materialInventoryObj.setMaterialCode(item.getMaterialCode());//物料编号
+                    materialInventoryObj.setMaterialCode(materiel.getMaterielCode());//物料编号
                     materialInventoryObj.setQuantity(item.getQuantity());//数量
                     materialInventoryObj.setCreateById(SecurityUtils.getUserId());
                     materialInventoryObj.setLotNumber(item.getLotNumber());//批号
@@ -282,8 +283,8 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
                     //物料名称需要根据物料编码查询下
                     Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(item.getMaterialId()));
                     inboundRecords3.setInboundAterialsName(materiel.getMaterielName());//物料名称
-                    inboundRecords3.setSpecifications(item.getSpecifications());//规格代号
-                    inboundRecords3.setInboundUnit(item.getInboundUnit());//单位
+                    inboundRecords3.setSpecifications(materiel.getSpecificationModel());//规格代号
+                    inboundRecords3.setInboundUnit(materiel.getUnits());//单位
                     inboundRecords3.setInboundQuantity(item.getQuantity().toString());//入库数量
                     inboundRecords3.setInboundLeader(SecurityUtils.getUsername());//仓管员
                     inboundRecords3.setCreateById(SecurityUtils.getUserId());//创建人
@@ -351,8 +352,8 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
                         outboundRecords1.setQtCodeNumber(item.getQtCodeNumber());
                         outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
                         outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
-                        outboundRecords1.setSpecifications(item.getSpecifications());//规格代号
-                        outboundRecords1.setOutboundUnit(item.getInboundUnit());//单位
+                        outboundRecords1.setSpecifications(materiel.getSpecificationModel());//规格代号
+                        outboundRecords1.setOutboundUnit(materiel.getUnits());//单位
                         outboundRecords1.setOutboundQuantity(item.getQuantity().toString());//出库数量
                         outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
                         outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
@@ -395,6 +396,17 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
         return materialInventoryMapper.selectMaterialInventoryList(materialInventory);
     }
 
+    /**
+     * 查询物料总数量
+     *
+     * @return 物料库存
+     */
+    @Override
+    public int selectMaterialInventoryListSum()
+    {
+        return materialInventoryMapper.selectMaterialInventoryListSum();
+    }
+
 
 
     /**

+ 9 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/OutboundRecordsServiceImpl.java

@@ -17,6 +17,7 @@ import com.zkqy.business.service.IOutboundRecordsService;
 @Service
 public class OutboundRecordsServiceImpl implements IOutboundRecordsService 
 {
+
     @Autowired
     private OutboundRecordsMapper outboundRecordsMapper;
 
@@ -32,6 +33,8 @@ public class OutboundRecordsServiceImpl implements IOutboundRecordsService
         return outboundRecordsMapper.selectOutboundRecordsById(id);
     }
 
+
+
     /**
      * 查询出库记录列表
      * 
@@ -57,6 +60,12 @@ public class OutboundRecordsServiceImpl implements IOutboundRecordsService
         return outboundRecordsMapper.insertOutboundRecords(outboundRecords);
     }
 
+    @Override
+    public int selectOutboundRecordsCount() {
+        return outboundRecordsMapper.selectOutboundRecordsCount();
+    }
+
+
     /**
      * 修改出库记录
      * 

+ 3 - 0
zkqy-custom-business/src/main/resources/mapper/business/InboundRecordsMapper.xml

@@ -81,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectInboundRecordsVo"/>
         where qtCodeNumber = #{qtCodeNumber}
     </select>
+    <select id="selectInboundRecordsByQtCodeNumberCount" resultType="java.lang.Integer">
+        select count(inbound_quantity) from {DBNAME}.inbound_records
+    </select>
 
     <insert id="insertInboundRecords" parameterType="com.zkqy.business.domain.InboundRecords" useGeneratedKeys="true" keyProperty="id">
         insert into {DBNAME}.inbound_records

+ 3 - 0
zkqy-custom-business/src/main/resources/mapper/business/MaterialInventoryMapper.xml

@@ -231,5 +231,8 @@
         <include refid="selectMaterialInventoryVo"/>
         where material_code = #{materialCode}
     </select>
+    <select id="selectMaterialInventoryListSum" resultType="java.lang.Integer">
+        select sum(quantity) from {NAMEDB}.material_inventory
+    </select>
 
 </mapper>

+ 3 - 0
zkqy-custom-business/src/main/resources/mapper/business/OutboundRecordsMapper.xml

@@ -70,6 +70,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectOutboundRecordsVo"/>
         where qtCodeNumber = #{qtCodeNumber}
     </select>
+    <select id="selectOutboundRecordsCount" resultType="java.lang.Integer">
+        select sum(outbound_quantity) from {DBNAME}.outbound_records
+    </select>
 
     <insert id="insertOutboundRecords" parameterType="com.zkqy.business.domain.OutboundRecords" useGeneratedKeys="true" keyProperty="id">
         insert into {DBNAME}.outbound_records

+ 4 - 14
zkqy-ui/src/views/orderMange/purchase/listInfoTwo.vue

@@ -837,25 +837,15 @@ export default {
       let stringInner =this.particularsOfSalesNote.purchaseLotNumber
       let timeCode= new Date().getTime().toString();
       //二维码内容
-      //采购单编号         批号                                         母粒编码                   色号                       规格                       单位              数量         时间戳
-      let codeString=
-        row.purchaseId+"@"+
-        row.materieEncoding+"@"+
-        row.units+"@"+
-        row.quantity+"@"+
-        row.specificationModel+"@"+
-        timeCode+"@"+
-        stringInner +"@"+
-        row.materieColorNumber +"@"+
-        row.materielId
+      //                 时间戳        批号                 母粒id
+      let codeString= timeCode+"@"+ stringInner +"@"+ row.materielId
       // const encodePwd = Base64.encode(codeString);//加密
-      const encodePwd = encodeURIComponent(codeString)
-
+      // const encodePwd = encodeURIComponent(codeString)
       //声明一个数组对象
       let allPringtData = [];
       //添加内容
       allPringtData.push({
-        codeData: encodePwd,
+        codeData: codeString,
         showMsg: [
           {label: "批号", value: stringInner},
           {label: "母粒编码", value: row.materieEncoding},