From 457c87c165739e37d72ce5c2b02fd27e05a75d6a Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期四, 18 十二月 2025 11:05:44 +0800
Subject: [PATCH] 数量检测报表提交

---
 fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Quantity.java         |    1 
 fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityData.view.xml        |  239 ++++++++++++++++++++++++++++++++++
 fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityDataPR.java          |   74 ++++++++++
 fzzy-igdss-core/src/main/java/com/fzzy/igds/data/QuantityParam.java      |   32 ++++
 fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/QuantityMapper.java   |   10 +
 fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java |   50 ++++++
 6 files changed, 400 insertions(+), 6 deletions(-)

diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/QuantityParam.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/QuantityParam.java
new file mode 100644
index 0000000..a7c5816
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/data/QuantityParam.java
@@ -0,0 +1,32 @@
+package com.fzzy.igds.data;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+
+
+@Data
+public class QuantityParam {
+
+    private String companyId;
+
+    private String deptId;
+
+    private String title; // 鎶ヨ〃鏍囬
+
+
+    private String depotId;// 浠撳簱缂栫爜
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date start; // 璧峰鏃堕棿
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date end; // 缁撴潫鏃堕棿
+
+    private String createUser; // 鍒涘缓浜�
+
+    private String timeDesc; // 鏃堕棿鎻忚堪
+}
+
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Quantity.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Quantity.java
index d205fea..34ae1ec 100644
--- a/fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Quantity.java
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/Quantity.java
@@ -78,5 +78,6 @@
     private String remark;
 
     @Transient
+    @TableField(exist = false)
     private Depot depotData;
 }
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/QuantityMapper.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/QuantityMapper.java
new file mode 100644
index 0000000..5e6f442
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/QuantityMapper.java
@@ -0,0 +1,10 @@
+package com.fzzy.igds.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fzzy.igds.domain.Quantity;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface QuantityMapper extends BaseMapper<Quantity> {
+
+}
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
index edd1143..7ddcb88 100644
--- a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
@@ -2,14 +2,19 @@
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fzzy.igds.constant.RedisConst;
+import com.fzzy.igds.data.QuantityParam;
+import com.fzzy.igds.domain.Quantity;
 import com.fzzy.igds.domain.QuantityConf;
 import com.fzzy.igds.mapper.QuantityConfMapper;
+import com.fzzy.igds.mapper.QuantityMapper;
 import com.fzzy.igds.utils.ContextUtil;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
+
 import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -29,6 +34,39 @@
     private QuantityConfMapper quantityConfMapper;
     @Resource
     private RedisCache redisCache;
+    @Resource
+    private QuantityMapper  quantityMapper;
+
+
+    /**
+     * 鍒嗛〉鏌ヨ璐ㄩ噺妫�娴嬫暟鎹�
+     *
+     * @author sgj
+     * @date 2025/12/18
+     */
+    public void listPageQuantity(Page<Quantity> page, QuantityParam param) {
+        QueryWrapper<Quantity> queryWrapper = new QueryWrapper<>();
+
+        param.setCompanyId(ContextUtil.getCompanyId());
+        param.setDeptId(ContextUtil.subDeptId(null));
+        queryWrapper.eq("company_id", param.getCompanyId());
+        queryWrapper.eq("dept_id", param.getDeptId());
+
+        //浠撳簱妫�绱�
+        if (StringUtils.isNotBlank(param.getDepotId())) {
+            queryWrapper.eq("depot_id", param.getDepotId());
+        }
+        //鏃堕棿妫�绱�
+        if(param.getStart() != null){
+            queryWrapper.ge("receive_date", param.getStart());
+        }
+        if(param.getEnd() != null){
+            queryWrapper.le("receive_date", param.getEnd());
+        }
+        queryWrapper.orderByAsc("receive_date");
+        quantityMapper.selectPage(page, queryWrapper);
+
+    }
 
     /**
      * 鏌ヨ閰嶇疆淇℃伅锛屾牴鎹簱鍖虹紪鐮佽幏鍙�
@@ -44,10 +82,10 @@
         if (StringUtils.isEmpty(deptId)) {
             deptId = ContextUtil.subDeptId(null);
         }
-        
+
         QueryWrapper<QuantityConf> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("company_id", companyId);
-        if(StringUtils.isNotBlank(deptId)){
+        if (StringUtils.isNotBlank(deptId)) {
             queryWrapper.eq("dept_id", deptId);
         }
         queryWrapper.orderByAsc("order_num");
@@ -56,7 +94,7 @@
     }
 
     /**
-     *  - 鏌ヨ閰嶇疆淇℃伅锛屾牴鎹粍缁囩紪鐮佽幏鍙�
+     * - 鏌ヨ閰嶇疆淇℃伅锛屾牴鎹粍缁囩紪鐮佽幏鍙�
      *
      * @param companyId
      * @return
@@ -70,7 +108,7 @@
     }
 
     /**
-     *  - 鏇存柊淇濆瓨鏁版嵁
+     * - 鏇存柊淇濆瓨鏁版嵁
      *
      * @param conf
      */
@@ -90,7 +128,7 @@
             conf.setUpdateBy(ContextUtil.getLoginUserName());
             conf.setUpdateTime(new Date());
             quantityConfMapper.insert(conf);
-        }else {
+        } else {
             conf.setUpdateBy(ContextUtil.getLoginUserName());
             conf.setUpdateTime(new Date());
             quantityConfMapper.update(conf, new UpdateWrapper<QuantityConf>().eq("depot_id", conf.getDepotId()));
@@ -115,7 +153,7 @@
     }
 
     /**
-     *  - 鍒犻櫎鏁版嵁
+     * - 鍒犻櫎鏁版嵁
      *
      * @param conf
      * @return
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityData.view.xml b/fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityData.view.xml
new file mode 100644
index 0000000..0cf444a
--- /dev/null
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityData.view.xml
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ViewConfig>
+  <Arguments/>
+  <Context/>
+  <Model>
+    <DataType name="dtDataReport">
+      <Property name="creationType">com.fzzy.igds.domain.Quantity</Property>
+      <PropertyDef name="batchId">
+        <Property></Property>
+        <Property name="label">妫�娴嬫壒娆�</Property>
+      </PropertyDef>
+      <PropertyDef name="companyId">
+        <Property></Property>
+        <Property name="label">缁勭粐缂栫爜</Property>
+      </PropertyDef>
+      <PropertyDef name="depotId">
+        <Property></Property>
+        <Property name="label">鎵�灞炰粨搴�</Property>
+        <Property name="mapping">
+          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getAllCache&quot;).getResult()}</Property>
+          <Property name="keyProperty">id</Property>
+          <Property name="valueProperty">name</Property>
+        </Property>
+      </PropertyDef>
+      <PropertyDef name="weight">
+        <Property name="dataType">Double</Property>
+        <Property name="label">閲嶉噺</Property>
+      </PropertyDef>
+      <PropertyDef name="bulk">
+        <Property name="dataType">Double</Property>
+        <Property name="label">浣撶Н</Property>
+      </PropertyDef>
+      <PropertyDef name="receiveDate">
+        <Property name="dataType">Date</Property>
+        <Property name="label">妫�娴嬫椂闂�</Property>
+      </PropertyDef>
+      <PropertyDef name="checkUser">
+        <Property></Property>
+        <Property name="label">妫�娴嬩汉</Property>
+      </PropertyDef>
+      <PropertyDef name="remark">
+        <Property></Property>
+        <Property name="label">澶囨敞淇℃伅</Property>
+      </PropertyDef>
+      <PropertyDef name="points">
+        <Property></Property>
+        <Property name="label">閲囬泦鐐逛俊鎭�</Property>
+      </PropertyDef>
+    </DataType>
+    <DataType name="dataTypeC">
+      <ClientEvent name="onDataChange">var prop = arg.property;&#xD;
+if(prop =='start' || prop == 'end'){&#xD;
+	var entity = arg.entity;&#xD;
+	entity.set(&quot;timeDesc&quot;,entity.get('start').formatDate(&quot;Y-m-d&quot;) +&quot; 鎴嚦锛�&quot;+entity.get('end').formatDate(&quot;Y-m-d&quot;));&#xD;
+}</ClientEvent>
+      <Property name="creationType">com.fzzy.igds.data.QuantityParam</Property>
+      <PropertyDef name="title">
+        <Property name="label"> </Property>
+      </PropertyDef>
+      <PropertyDef name="depotId">
+        <Property></Property>
+        <Property name="label">閫夋嫨浠撳簱</Property>
+        <Property name="mapping">
+          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getAllCache&quot;).getResult()}</Property>
+          <Property name="keyProperty">id</Property>
+          <Property name="valueProperty">name</Property>
+        </Property>
+      </PropertyDef>
+      <PropertyDef name="start">
+        <Property name="dataType">Date</Property>
+        <Property name="label">妫�娴嬫椂闂村紑濮�</Property>
+      </PropertyDef>
+      <PropertyDef name="end">
+        <Property name="dataType">Date</Property>
+        <Property name="label">妫�娴嬫椂闂存埅鑷�</Property>
+      </PropertyDef>
+      <PropertyDef name="createUser">
+        <Property name="label">鍒惰〃浜�</Property>
+      </PropertyDef>
+      <PropertyDef name="timeDesc">
+        <Property name="label">鏃堕棿</Property>
+      </PropertyDef>
+    </DataType>
+  </Model>
+  <View layout="padding:5;regionPadding:5">
+    <Property name="packages">font-awesome,css-common</Property>
+    <Property name="cache">
+      <Property name="mode">clientSide</Property>
+    </Property>
+    <DataSet id="dsMain">
+      <Property name="dataType">[dtDataReport]</Property>
+      <Property name="pageSize">20</Property>
+      <Property name="dataProvider">quantityDataPR#getData</Property>
+      <Property name="loadMode">manual</Property>
+    </DataSet>
+    <DataSet id="dataSetC">
+      <Property name="dataType">dataTypeC</Property>
+      <Property name="dataProvider">quantityDataPR#getQuery</Property>
+    </DataSet>
+    <AutoForm>
+      <Property name="cols">*,*,*,*</Property>
+      <Property name="dataSet">dataSetC</Property>
+      <Property name="labelSeparator">锛�</Property>
+      <Property name="labelAlign">right</Property>
+      <Property name="labelWidth">110</Property>
+      <Property name="exClassName">bg-color</Property>
+      <AutoFormElement>
+        <Property name="name">depotId</Property>
+        <Property name="property">depotId</Property>
+        <Property name="trigger">autoMappingDropDown2</Property>
+        <Editor/>
+      </AutoFormElement>
+      <AutoFormElement>
+        <Property name="name">start</Property>
+        <Property name="property">start</Property>
+        <Editor/>
+      </AutoFormElement>
+      <AutoFormElement>
+        <Property name="name">end</Property>
+        <Property name="property">end</Property>
+        <Editor/>
+      </AutoFormElement>
+      <Container layout="hbox regionPadding:10">
+        <Button>
+          <ClientEvent name="onClick">var param = view.get(&quot;#dataSetC.data&quot;);&#xD;
+view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,param).flushAsync();&#xD;
+&#xD;
+//澶嶅埗鏂囨湰淇℃伅&#xD;
+//var user = &quot;${loginUser.getCname()}&quot;;&#xD;
+//var text = &quot;妫�娴嬪懆鏈燂細&quot;;&#xD;
+//if(param.get(&quot;start&quot;)){&#xD;
+//	text += param.get(&quot;start&quot;).formatDate(&quot;Y-m-d&quot;);&#xD;
+//}else{&#xD;
+//	text += &quot;鏈缃�&quot;;&#xD;
+//}&#xD;
+//if(param.get(&quot;end&quot;)){&#xD;
+//	text += &quot;  鑷�   &quot;+param.get(&quot;end&quot;).formatDate(&quot;Y-m-d&quot;);&#xD;
+//}else{&#xD;
+//	text += &quot;  鑷�   &quot;+new Date().formatDate(&quot;Y-m-d&quot;);&#xD;
+//}&#xD;
+&#xD;
+//view.get(&quot;#labelBillUser&quot;).set(&quot;text&quot;,&quot;鍒惰〃浜猴細&quot;+user);&#xD;
+//view.get(&quot;#labelBillCheckDate&quot;).set(&quot;text&quot;,text);</ClientEvent>
+          <Property name="caption">鏌ヨ</Property>
+          <Property name="iconClass">fa fa-search</Property>
+          <Property name="exClassName">btn1</Property>
+        </Button>
+        <Button>
+          <ClientEvent name="onClick">view.get(&quot;#dataSetC&quot;).flushAsync();</ClientEvent>
+          <Property name="caption">閲嶇疆</Property>
+          <Property name="iconClass">fa fa-refresh</Property>
+          <Property name="exClassName">btn2</Property>
+        </Button>
+      </Container>
+    </AutoForm>
+    <Container layoutConstraint="center">
+      <Property name="exClassName">bg-color</Property>
+      <DataGrid id="dataGrid1" layoutConstraint="center ">
+        <Property name="dataSet">dsMain</Property>
+        <Property name="readOnly">true</Property>
+        <Property name="headerRowHeight">30</Property>
+        <RowNumColumn/>
+        <DataColumn name="batchId">
+          <Property name="property">batchId</Property>
+          <Property name="align">center</Property>
+        </DataColumn>
+        <DataColumn name="depotId">
+          <Property name="property">depotId</Property>
+          <Property name="align">center</Property>
+        </DataColumn>
+        <DataColumn name="weight">
+          <Property name="property">weight</Property>
+          <Property name="align">center</Property>
+        </DataColumn>
+        <DataColumn name="bulk">
+          <Property name="property">bulk</Property>
+          <Property name="align">center</Property>
+        </DataColumn>
+        <DataColumn name="receiveDate">
+          <Property name="property">receiveDate</Property>
+          <Property name="align">center</Property>
+        </DataColumn>
+        <DataColumn name="checkUser">
+          <Property name="property">checkUser</Property>
+          <Property name="align">center</Property>
+          <Property name="visible">false</Property>
+        </DataColumn>
+        <DataColumn name="remark">
+          <Property name="property">remark</Property>
+          <Property name="align">center</Property>
+        </DataColumn>
+      </DataGrid>
+      <AutoForm id="autoForm1" layoutConstraint="top">
+        <Property name="cols">*,*,*</Property>
+        <Property name="dataSet">dataSetC</Property>
+        <Property name="labelAlign">right</Property>
+        <Property name="showHint">false</Property>
+        <AutoFormElement layoutConstraint="colSpan:3">
+          <Property name="name">title</Property>
+          <Property name="property">title</Property>
+          <Property name="showLabel">false</Property>
+          <Property name="editorType">Label</Property>
+          <Property name="style">
+            <Property name="font">bold 30px Georgia, serif;</Property>
+            <Property name="text-align">center</Property>
+          </Property>
+          <Editor/>
+        </AutoFormElement>
+        <AutoFormElement>
+          <Property name="name">timeDesc</Property>
+          <Property name="property">timeDesc</Property>
+          <Property name="editorType">Label</Property>
+          <Editor/>
+        </AutoFormElement>
+        <AutoFormElement>
+          <Property name="name">depotId</Property>
+          <Property name="property">depotId</Property>
+          <Property name="editorType">Label</Property>
+          <Property name="labelWidth">110</Property>
+          <Property name="labelAlign">right</Property>
+          <Editor/>
+        </AutoFormElement>
+        <AutoFormElement>
+          <Property name="name">createUser</Property>
+          <Property name="property">createUser</Property>
+          <Property name="editorType">Label</Property>
+          <Editor/>
+        </AutoFormElement>
+      </AutoForm>
+    </Container>
+    <Container layoutConstraint="bottom">
+      <Property name="exClassName">bg-color</Property>
+      <DataPilot layoutConstraint="right">
+        <Property name="dataSet">dsMain</Property>
+        <Property name="itemCodes">pageSize,pages</Property>
+      </DataPilot>
+    </Container>
+  </View>
+</ViewConfig>
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityDataPR.java b/fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityDataPR.java
new file mode 100644
index 0000000..093e57b
--- /dev/null
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityDataPR.java
@@ -0,0 +1,74 @@
+package com.fzzy.igds;
+
+import com.bstek.dorado.annotation.DataProvider;
+import com.bstek.dorado.data.provider.Page;
+import com.fzzy.igds.data.QuantityParam;
+import com.fzzy.igds.domain.Quantity;
+import com.fzzy.igds.service.QuantityService;
+import com.fzzy.igds.service.SysDeptService;
+import com.fzzy.igds.utils.ContextUtil;
+import com.fzzy.igds.utils.DateUtil;
+import com.ruoyi.common.core.domain.entity.SysDept;
+import org.apache.commons.lang3.time.DateFormatUtils;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.Date;
+
+/**
+ *
+ *
+ * @author sgj
+ * @date 2025/12/18
+
+ */
+@Component
+public class QuantityDataPR {
+
+    @Resource
+    private QuantityService quantityService;
+    @Resource
+    private SysDeptService sysDeptService;
+
+    /**
+     * quantityDataPR#getQuery 鏍规嵁鎶ヨ〃绫诲瀷锛岃幏鍙栭粯璁ゆ煡璇俊鎭紝姣斿琛ㄥご淇℃伅绛�
+     *
+     * @param type
+     * @return
+     */
+    @DataProvider
+    public QuantityParam getQuery(String type) {
+        QuantityParam result = new QuantityParam();
+        SysDept subDept = sysDeptService.getCacheDept(null, ContextUtil.subDeptId(null));
+        result.setTitle("鏁伴噺妫�娴嬫暟鎹�");
+        if (null != subDept) {
+            result.setTitle(subDept.getDeptName() + "鏁伴噺妫�娴嬫暟鎹�");
+            result.setDepotId(String.valueOf(subDept.getDeptId()));
+        }
+        result.setEnd(new Date());
+        Date start = DateUtil.getNewByDay(new Date(), -90);
+        result.setStart(start);
+        result.setTimeDesc(DateFormatUtils.format(start, "yyyy-MM-dd") + "   鎴嚦锛�"
+                + DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
+        result.setCreateUser(ContextUtil.getLoginUserName());
+        return result;
+    }
+
+    /**
+     * quantityDataPR#getData
+     * 鏍规嵁鏉′欢鍒嗛〉鑾峰彇鏁版嵁淇℃伅 QuantityData.view.xml
+     *
+     * @param page
+     * @param param
+     */
+    @DataProvider
+    public void getData(Page<Quantity> page, QuantityParam param) {
+        com.baomidou.mybatisplus.extension.plugins.pagination.Page<Quantity> corePage = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(0, 10000);
+        quantityService.listPageQuantity(corePage, param);
+        // 閲嶆柊灏佽
+        page.setEntities(corePage.getRecords());
+        page.setEntityCount(Integer.parseInt(String.valueOf(corePage.getTotal())));
+
+    }
+
+}

--
Gitblit v1.9.3