Bladeren bron

新增提单号查询客户列表接口

Sun 3 jaren geleden
bovenliggende
commit
4075fccb6f

+ 13 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/reportManagement/TWhgenlegController.java

@@ -81,12 +81,23 @@ public class TWhgenlegController extends BaseController {
     }
 
     /**
+     * 根据提单号获取客户
+     */
+    @GetMapping("/getCorpsByfMblno")
+    public AjaxResult getCorpsByfMblno(String fMblno) {
+        return AjaxResult.success(tWhgenlegService.getCorpsByfMblno(fMblno));
+    }
+
+    /**
      * 获取单票分析信息
      */
     @GetMapping(value = "/singleAnalysis")
     public AjaxResult singleAnalysis(SingleAnalysisExcel singleAnalysisExcel) {
-        if (StringUtils.isNull(singleAnalysisExcel.getfCorpid()) || StringUtils.isEmpty(singleAnalysisExcel.getfMblno())) {
-            return AjaxResult.error("未找到查询条件");
+        if (StringUtils.isNull(singleAnalysisExcel.getfCorpid())) {
+            return AjaxResult.error("请选择货主");
+        }
+        if (StringUtils.isEmpty(singleAnalysisExcel.getfMblno())) {
+            return AjaxResult.error("请输入提单号");
         }
         List<SingleAnalysisFeesExcel> feesList = tWhgenlegService.selectSingleAnalysisFees(singleAnalysisExcel);
         List<SingleAnalysisExcel> singleAnalysisExcels = tWhgenlegService.selectSingleAnalysis(singleAnalysisExcel);

+ 2 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/mapper/TWhgenlegMapper.java

@@ -102,6 +102,8 @@ public interface TWhgenlegMapper {
 
     List<Map<String, Object>> selectDateFQtyblcListList(@Param("map") Map<String, Object> map);
 
+    List<Map<String, Object>> getCorpsByfMblno(String fMblno);
+
     /**
      * 查询库存总账计算仓储费
      *

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/ITWhgenlegService.java

@@ -107,6 +107,13 @@ public interface ITWhgenlegService {
     Map<String, Object> selectCorpsList(Long fId);
 
     /**
+     * 根据提单号获取客户
+     *
+     * @return
+     */
+    List<Map<String, Object>> getCorpsByfMblno(String fMblno);
+
+    /**
      * 一周库存总量
      *
      * @return

+ 6 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/reportManagement/service/impl/TWhgenlegServiceImpl.java

@@ -409,6 +409,11 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
     }
 
     @Override
+    public List<Map<String, Object>> getCorpsByfMblno(String fMblno) {
+        return tWhgenlegMapper.getCorpsByfMblno(fMblno);
+    }
+
+    @Override
     public List<Map<String, Object>> selectDateFQtyblcListList() {
         // 当天往前推 一周
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd ");
@@ -677,7 +682,7 @@ public class TWhgenlegServiceImpl implements ITWhgenlegService {
         List<Object> quantityList = new ArrayList<>();
         Map<String, Object> weightMap;
 
-        for (int i = -6; i < 0; i++) {
+        for (int i = -5; i <= 0; i++) {
             categories.add(DateUtils.offsetOnlyMonth(i) + "月");
 
             weightMap = tWhgenlegMapper.biWeightInfo(DateUtils.beginOfOffsetMonth(i) + " 00:00:00",

+ 15 - 4
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -561,6 +561,17 @@
             t.f_originalbilldate
     </select>
 
+    <select id="getCorpsByfMblno" parameterType="string" resultType="Map">
+        select
+            tc.f_id as fId,
+            tc.f_name as fName
+        from t_whgenleg tw left join t_corps tc on tw.f_corpid = tc.f_id
+        <where>
+            <if test="fId != null and fId != ''">and tw.f_mblno = #{fMblno}</if>
+        </where>
+        group by tc.f_id, tc.f_name
+    </select>
+
     <select id="selectStorageFeeItemList" parameterType="com.ruoyi.warehouseBusiness.domain.TWarehouseBills" resultType="Map">
         SELECT
             wh.f_id AS fId,
@@ -1219,7 +1230,7 @@
     <select id="biCustomerInfo" resultType="map">
         select
             tc.f_cname as customerName,
-            round(sum(tw.f_grossweightblc) / 1000, 2) as quantity
+            round(ifnull(sum(tw.f_grossweightblc), 0) / 1000, 2) as quantity
         from t_whgenleg tw left join t_corps tc on tw.f_corpid = tc.f_id
         where
             tw.f_qtyD != 0
@@ -1232,7 +1243,7 @@
     <select id="biGoodsInfo" parameterType="long" resultType="map">
         select
             tg.f_name as goodsName,
-            round(sum(tw.f_grossweightblc) / 1000, 2) as quantity
+            round(ifnull(sum(tw.f_grossweightblc), 0) / 1000, 2) as quantity
         from t_whgenleg tw left join t_goods tg on tw.f_goodsid = tg.f_id
         where
             tw.f_qtyD != 0
@@ -1244,8 +1255,8 @@
 
     <select id="biWeightInfo" resultType="map">
         select
-            round(sum(f_grossweightD) / 1000, 2) as quantityIn,
-            round(sum(f_grossweightblc) / 1000, 2) as quantity
+            round(ifnull(sum(f_grossweightD), 0) / 1000, 2) as quantityIn,
+            round(ifnull(sum(f_grossweightblc), 0) / 1000, 2) as quantity
         from t_whgenleg
         where
             f_qtyD != 0