Forráskód Böngészése

查询提单号及订单号详情 2022年7月12日16点30分

纪新园 3 éve
szülő
commit
d64e785a14

+ 26 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/plugin/CcbController.java

@@ -4,6 +4,7 @@ import com.ruoyi.ccb.domain.*;
 import com.ruoyi.ccb.domain.basic.Page;
 import com.ruoyi.ccb.service.CcbHttpService;
 import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -16,7 +17,9 @@ import org.springframework.web.bind.annotation.*;
 @RequestMapping("/ccb")
 public class CcbController {
 
-    private final CcbHttpService ccbHttpService;
+//    private final CcbHttpService ccbHttpService;
+    @Autowired
+    private CcbHttpService ccbHttpService;
 
     /**
      * 查询保管凭证号
@@ -117,4 +120,26 @@ public class CcbController {
         return ccbHttpService.cancelWrNumber(pledge);
     }
 
+    /**
+     * 提单号
+     *
+     * @param mblno 报文
+     * @return 结果
+     */
+    @PostMapping("/blNumberIsExist")
+    public MblnoR blNumberIsExist(@RequestBody Mblno mblno) {
+        return ccbHttpService.blNumberIsExist(mblno);
+    }
+
+    /**
+     * 提单号详情
+     *
+     * @param mblno 报文
+     * @return 结果
+     */
+    @PostMapping("/blNumberDetile")
+    public MblnoDetailR blNumberDetail(@RequestBody Mblno mblno) {
+        return ccbHttpService.blNumberDetail(mblno);
+    }
+
 }

+ 28 - 0
ruoyi-plugin/src/main/java/com/ruoyi/ccb/domain/Mblno.java

@@ -0,0 +1,28 @@
+package com.ruoyi.ccb.domain;
+
+
+import lombok.Data;
+
+
+/**
+ * 提单号
+ */
+
+@Data
+public class Mblno {
+
+    /**
+     * 提单号
+     */
+    private String blNumber;
+
+    /**
+     * 客户名称
+     */
+    private String userName;
+
+    /**
+     * 统一社会信用代码
+     */
+    private String uscc;
+}

+ 46 - 0
ruoyi-plugin/src/main/java/com/ruoyi/ccb/domain/MblnoDetailR.java

@@ -0,0 +1,46 @@
+package com.ruoyi.ccb.domain;
+
+
+import com.ruoyi.ccb.domain.basic.CargoDetail;
+import lombok.Data;
+
+import java.util.List;
+
+
+/**
+ * 提单号返回
+ */
+
+@Data
+public class MblnoDetailR {
+
+    /**
+     * 提单号
+     */
+    private String blNumber;
+
+    /**
+     * 仓储企业名称
+     */
+    private String storageEnterpriseName;
+
+    /**
+     * 保税状态
+     */
+    private Integer bondedStatus;
+
+    /**
+     * 客户名称
+     */
+    private String userName;
+
+    /**
+     * 统一社会信用代码
+     */
+    private String uscc;
+
+    /**
+     * 货物清单
+     */
+    private List<CargoDetail> cargos;
+}

+ 28 - 0
ruoyi-plugin/src/main/java/com/ruoyi/ccb/domain/MblnoR.java

@@ -0,0 +1,28 @@
+package com.ruoyi.ccb.domain;
+
+
+import lombok.Data;
+
+
+/**
+ * 提单号返回
+ */
+
+@Data
+public class MblnoR {
+
+    /**
+     * 是否存在
+     */
+    private String isExist;
+
+    /**
+     * 货权归属人
+     */
+    private String beLongUser;
+
+    /**
+     * 统一社会信用代码
+     */
+    private String uscc;
+}

+ 15 - 0
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/CcbHttpService.java

@@ -82,4 +82,19 @@ public interface CcbHttpService {
      */
     PledgeR cancelWrNumber(Pledge pledge);
 
+
+    /**
+     * 查询提单号
+     *
+     * @param mblno 报文
+     * @return 结果
+     */
+    MblnoR blNumberIsExist(Mblno mblno);
+
+    /**
+     * 提单号详情
+     * @param mblno
+     * @return
+     */
+    MblnoDetailR blNumberDetail(Mblno mblno);
 }

+ 84 - 0
ruoyi-plugin/src/main/java/com/ruoyi/ccb/service/impl/CcbHttpServiceImpl.java

@@ -254,6 +254,90 @@ public class CcbHttpServiceImpl implements CcbHttpService {
     }
 
     /**
+     * 查询提单号
+     *
+     * @param mblno 报文
+     * @return 结果
+     */
+    @Override
+    public MblnoR blNumberIsExist(Mblno mblno) {
+        // 库存帐查询
+        List<Map<String, Object>> stockList = ccbService.selectBlNumber(mblno.getBlNumber(), mblno.getUserName());
+        //提单号返回信息
+        MblnoR voucherR = new MblnoR();
+        //判断该提单号是否存在
+        if (stockList.size() > 0) {
+            voucherR.setIsExist("Y");
+        } else {
+            voucherR.setIsExist("N");
+        }
+        voucherR.setBeLongUser(mblno.getUserName());
+        voucherR.setUscc(mblno.getUscc());
+        return voucherR;
+    }
+
+
+    /**
+     * 提单号详情
+     * @param mblno
+     * @return
+     */
+    @Override
+    public MblnoDetailR blNumberDetail(Mblno mblno) {
+        // 货物信息集合
+        List<CargoDetail> cargos = new ArrayList<>();
+        //获取库存信息
+        List<Map<String, Object>> stockList = ccbService.getStockList(mblno.getBlNumber(), mblno.getUserName());
+        //遍历库存信息,将拿到的货物信息存入集合中
+        stockList.forEach(map -> {
+            String temp = JSON.toJSONString(map);
+
+            //货物信息
+            CargoDetail detail = JSON.parseObject(temp, CargoDetail.class);
+            detail.setNumberUnit("件");
+            detail.setWeightUnit("千克");
+            detail.setCargoBelong(mblno.getUserName());
+            detail.setInStorageNumber(detail.getTakeVoucher());
+            detail.setRemainNumber(detail.getNumberLeft());
+            detail.setRemainWeight(detail.getWeightLeft());
+            detail.setElectronicTags(ccbService.getLabel(detail.getTakeVoucher()));
+            detail.setBlNumber(mblno.getBlNumber());
+
+            JSONObject object = JSON.parseObject(temp);
+            //判断货物是否为锁定状态
+            if (!"0".equals(object.getString("lockStatus"))) {
+                //货物锁定信息
+                CargoLockInfo lockInfo = new CargoLockInfo();
+                lockInfo.setCargoNo(detail.getCargoNo());
+                lockInfo.setBlNumber(detail.getBlNumber());
+                lockInfo.setCargoBelong(detail.getCargoBelong());
+                lockInfo.setTakeVoucher(detail.getTakeVoucher());
+                lockInfo.setNumber(detail.getNumberLeft());
+                lockInfo.setNumberUnit(detail.getNumberUnit());
+                lockInfo.setWeight(detail.getWeightLeft());
+                lockInfo.setWeightUnit(detail.getWeightUnit());
+                lockInfo.setSpeci(detail.getSpeci());
+                lockInfo.setReasonCode("PLGL");
+                lockInfo.setLockTime(object.getDate("lockTime"));
+                lockInfo.setWrNumber(detail.getWrNumber());
+                lockInfo.setElectronicTags(detail.getElectronicTags());
+                detail.setLockInfo(lockInfo);
+            }
+            cargos.add(detail);
+        });
+
+        //提单号返回信息
+        MblnoDetailR detailR = new MblnoDetailR();
+        detailR.setBlNumber(mblno.getBlNumber());
+        detailR.setStorageEnterpriseName(mblno.getUserName());
+        detailR.setBondedStatus(0);
+        detailR.setUserName(mblno.getUserName());
+        detailR.setUscc(mblno.getUscc());
+        detailR.setCargos(cargos);
+        return detailR;
+    }
+
+    /**
      * 数据转换
      *
      * @param cargos 出入库数据

+ 20 - 10
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java

@@ -152,17 +152,19 @@ public interface TWhgenlegMapper {
      * @param chargedate 校验日期
      * @return
      */
-    int queryChangedByFchargedate(@Param("ids") List<Long> ids, @Param("time")Date chargedate);
+    int queryChangedByFchargedate(@Param("ids") List<Long> ids, @Param("time") Date chargedate);
 
     /**
-     *  库存总帐入库、出库查询来源明细
+     * 库存总帐入库、出库查询来源明细
+     *
      * @param tWhgenleg
      * @return
      */
     List<WhgenlegVO> selectStockDetailsList(TWhgenleg tWhgenleg);
 
     /**
-     *  库存总帐货转、调拨、通关查询来源明细
+     * 库存总帐货转、调拨、通关查询来源明细
+     *
      * @param tWhgenleg
      * @return
      */
@@ -182,13 +184,14 @@ public interface TWhgenlegMapper {
      * 库存Teu统计
      */
     public Map<String, Object> stockTeuStatistics(@Param("beginDate") String beginDate,
-                                               @Param("endDate") String endDate,
-                                               @Param("external") String external,
-                                               @Param("warehouseId") Long warehouseId,
-                                               @Param("customerId") Long customerId);
+                                                  @Param("endDate") String endDate,
+                                                  @Param("external") String external,
+                                                  @Param("warehouseId") Long warehouseId,
+                                                  @Param("customerId") Long customerId);
 
     /**
      * 库龄
+     *
      * @param external 外部用户
      * @return
      */
@@ -228,8 +231,8 @@ public interface TWhgenlegMapper {
      * @return
      */
     public List<Map<String, Object>> biCustomerTeuInfo(@Param("external") String external,
-                                                    @Param("warehouseId") Long warehouseId,
-                                                    @Param("customerId") Long customerId);
+                                                       @Param("warehouseId") Long warehouseId,
+                                                       @Param("customerId") Long customerId);
 
     /**
      * bi大屏仓库概况
@@ -237,7 +240,7 @@ public interface TWhgenlegMapper {
      * @return
      */
     public List<Map<String, Object>> biWarehouseTeuInfo(@Param("external") String external,
-                                                     @Param("customerId") Long customerId);
+                                                        @Param("customerId") Long customerId);
 
     public List<Map<String, Object>> warehouseSupervise(@Param("parent") Integer parent);
 
@@ -245,4 +248,11 @@ public interface TWhgenlegMapper {
 
     public int changeBelongTo(TWhgenleg tWhgenleg);
 
+    /**
+     * 查询提单号是否存在
+     *
+     * @param blNumber 提单号
+     * @return 结果
+     */
+    List<Map<String, Object>> selectBlNumber(@Param("blNumber") String blNumber, @Param("corpId") Long corpId);
 }

+ 9 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/IWarehouseBillsCcbService.java

@@ -1,6 +1,7 @@
 package com.ruoyi.warehouseBusiness.service;
 
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.reportManagement.domain.TWhgenleg;
 import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems;
 
 import java.util.List;
@@ -68,4 +69,12 @@ public interface IWarehouseBillsCcbService {
      */
     List<String> getLabel(String billNo);
 
+    /**
+     * 获取库存
+     *
+     * @param blNumber 提单号
+     * @param corpName 客户名
+     * @return 库存列表
+     */
+    List<Map<String, Object>> selectBlNumber(String blNumber, String corpName);
 }

+ 18 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/WarehouseBillsCcbServiceImpl.java

@@ -246,4 +246,22 @@ public class WarehouseBillsCcbServiceImpl implements IWarehouseBillsCcbService {
         return eLabelMapper.getLabel(billNo);
     }
 
+
+    /**
+     * 获取库存
+     *
+     * @param blNumber 提单号
+     * @param corpName 客户名
+     * @return 库存列表
+     */
+    @Override
+    public List<Map<String, Object>> selectBlNumber(String blNumber, String corpName) {
+        // 获取客户信息
+        TCorps corp = corpMapper.getCorpByName(corpName);
+        //判断该客户是否存在
+        if (ObjectUtil.isNull(corp)) {
+            return Collections.emptyList();
+        }
+        return stockMapper.selectBlNumber(blNumber, corp.getfId());
+    }
 }

+ 39 - 0
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -1432,6 +1432,45 @@
             <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
         </where>
     </select>
+    <select id="selectBlNumber" resultType="java.util.Map">
+        select
+        t3.dict_label as cargoType,
+        t2.f_no as cargoNo,
+        t2.f_name as cargoName,
+        t1.f_qtyD as number,
+        t1.f_qtyblc as numberLeft,
+        t1.f_grossweightD as weight,
+        t1.f_grossweightblc as weightLeft,
+        t6.f_packagespecs as speci,
+        t6.f_sealno as bondedStatus,
+        t4.f_no as shelvesName,
+        t5.f_no as warehouseNo,
+        t5.f_name as warehouseName,
+        t1.f_originalbillno as takeVoucher,
+        date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
+        t1.f_mblno as blNumber,
+        date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
+        t1.lock_status as lockStatus,
+        t1.belong_to as belongTo,
+        t1.lock_time as lockTime,
+        t1.unlock_time as unlockTime,
+        t1.wr_number as wrNumber
+        from t_whgenleg t1
+        left join t_goods t2 on t2.f_id = t1.f_goodsid
+        left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
+        left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
+        left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
+        left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
+        <where>
+            t3.status = '0'
+            and t3.dict_type = 'data_goods_category'
+            and t1.f_qtyD != 0
+            and t1.f_qtyblc &gt; 0
+            and t1.f_grossweightblc &gt; 0
+            <if test="blNumber != null and blNumber != ''">and t1.f_mblno = #{blNumber}</if>
+            <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
+        </where>
+    </select>
 
     <update id="changeBelongTo" parameterType="TWhgenleg">
         update t_whgenleg