Quellcode durchsuchen

销售收入上缴-v1.1

hanqingsong vor 4 Monaten
Ursprung
Commit
f20e0706f3

+ 7 - 1
src/main/java/com/chinaitop/depot/intelligent/priceApproval/controller/BusinessFsSaleRevenueController.java

@@ -54,11 +54,17 @@ public class BusinessFsSaleRevenueController {
54 54
     }
55 55
 
56 56
     @GetMapping("/getOutStorageInfo/{contractNumber}")
57
-    @ApiOperation(value = "三账一致性-实际出库情况*", notes = "实际出库情况")
57
+    @ApiOperation(value = "三账一致性-实际出库情况", notes = "实际出库情况")
58 58
     public ResponseEntity<List<BusinessFsSaleRevenueThreeConsistence>> getOutStorageInfo(@PathVariable("contractNumber") String contractNumber) {
59 59
         return ResponseEntity.ok(saleRevenueService.getOutStorageInfo(contractNumber));
60 60
     }
61 61
 
62
+    @GetMapping("/getOutStorageDetailed/{contractNumber}")
63
+    @ApiOperation(value = "三账一致性-出库明细", notes = "出库明细")
64
+    public ResponseEntity<List<DataCPZ>> getOutStorageDetailed(@PathVariable("contractNumber") String contractNumber) {
65
+        return ResponseEntity.ok(saleRevenueService.getOutStorageDetailed(contractNumber));
66
+    }
67
+
62 68
     @PostMapping("/save")
63 69
     @ApiOperation(value = "销售收入上缴新增*", notes = "新增")
64 70
     public ResponseEntity save(@Validated @RequestBody BusinessFsSaleRevenue param) {

+ 4 - 0
src/main/java/com/chinaitop/depot/intelligent/priceApproval/mapper/BusinessFsSaleRevenueMapper.java

@@ -24,4 +24,8 @@ public interface BusinessFsSaleRevenueMapper extends BaseMapper<BusinessFsSaleRe
24 24
     List<BusinessFsSaleRevenueInspectionLoss> getQualityInfo(Map<String, Object> map);
25 25
 
26 26
     List<BusinessFsSaleRevenueThreeConsistence> getConsistenceAccountInfo(@Param("contractNumber") String contractNumber);
27
+
28
+    List<BusinessFsSaleRevenueThreeConsistence> getOutStorageInfo(@Param("contractNumber") String contractNumber);
29
+
30
+    List<DataCPZ> getOutStorageDetailed(@Param("contractNumber") String contractNumber);
27 31
 }

+ 1 - 1
src/main/java/com/chinaitop/depot/intelligent/priceApproval/model/BusinessFsSaleRevenueThreeConsistence.java

@@ -54,7 +54,7 @@ public class BusinessFsSaleRevenueThreeConsistence implements Serializable {
54 54
 
55 55
     @ApiModelProperty(value = "年")
56 56
     @TableField("year")
57
-    private Date year;
57
+    private Integer year;
58 58
 
59 59
     @ApiModelProperty(value = "月份")
60 60
     @TableField("month")

+ 2 - 0
src/main/java/com/chinaitop/depot/intelligent/priceApproval/service/BusinessFsSaleRevenueService.java

@@ -26,4 +26,6 @@ public interface BusinessFsSaleRevenueService extends IService<BusinessFsSaleRev
26 26
     List<BusinessFsSaleRevenueThreeConsistence> getConsistenceAccountInfo(String contractNumber);
27 27
 
28 28
     List<BusinessFsSaleRevenueThreeConsistence> getOutStorageInfo(String contractNumber);
29
+
30
+    List<DataCPZ> getOutStorageDetailed(String contractNumber);
29 31
 }

+ 6 - 1
src/main/java/com/chinaitop/depot/intelligent/priceApproval/service/impl/BusinessFsSaleRevenueServiceImpl.java

@@ -79,7 +79,12 @@ public class BusinessFsSaleRevenueServiceImpl extends ServiceImpl<BusinessFsSale
79 79
 
80 80
     @Override
81 81
     public List<BusinessFsSaleRevenueThreeConsistence> getOutStorageInfo(String contractNumber) {
82
-        return null;
82
+        return saleRevenueMapper.getOutStorageInfo(contractNumber);
83
+    }
84
+
85
+    @Override
86
+    public List<DataCPZ> getOutStorageDetailed(String contractNumber) {
87
+        return saleRevenueMapper.getOutStorageDetailed(contractNumber);
83 88
     }
84 89
 
85 90
     // 保存子表-质检损益信息

+ 80 - 0
src/main/resources/mapper/priceApproval/BusinessFsSaleRevenueMapper.xml

@@ -151,4 +151,84 @@
151 151
         WHERE
152 152
             contract_number = #{contractNumber}
153 153
     </select>
154
+    <select id="getOutStorageInfo" parameterType="string" resultType="com.chinaitop.depot.intelligent.priceApproval.model.BusinessFsSaleRevenueThreeConsistence">
155
+        SELECT
156
+            YEAR (ci.createdate) `year`,
157
+            MONTH (ci.createdate) `month`,
158
+            ci.basic_storehouse_id basicStorehouseId,
159
+            ci.warehouse_id warehouseId,
160
+            bs.storehouse_name storehouseName,
161
+            bw.warehouse_name warehouseName,
162
+            IFNULL(lc.actual_loss_quantity, 0) loss,
163
+            IFNULL(cd.klhjz, 0) custodyAccountQuantity,
164
+            IFNULL(sa.expenditure_quantity, 0) statisticalAccountQuantity,
165
+            cd.djsj completeTime
166
+        FROM
167
+            business_fs_out_confirm oc
168
+        LEFT JOIN business_fs_out_confirm_contract_item ci ON ci.fs_out_confirm_id = oc.id
169
+        LEFT JOIN business_contract bc ON bc.id = oc.contract_id
170
+        LEFT JOIN basic_storehouse bs ON ci.basic_storehouse_id = bs.storehouse_id
171
+        LEFT JOIN basic_warehouse bw ON ci.warehouse_id = bw.warehouse_id
172
+        LEFT JOIN (
173
+            SELECT
174
+                SUM(lcIn.actual_loss_quantity) actual_loss_quantity,
175
+                YEAR (lcIn.outbound_time) `year`,
176
+                MONTH (lcIn.outbound_time) `month`
177
+            FROM
178
+                business_gslr_loss_collect lcIn
179
+            GROUP BY
180
+                YEAR (lcIn.outbound_time),
181
+                MONTH (lcIn.outbound_time)
182
+        ) lc ON YEAR (ci.createdate) = lc. YEAR
183
+        AND MONTH (ci.createdate) = lc. MONTH
184
+        LEFT JOIN (
185
+            SELECT
186
+                cdIn.htbh,
187
+                cdIn2.klhjz,
188
+                cdIn2.sjhwh,
189
+                cdIn2.xldd,
190
+                cdIn.djsj,
191
+                YEAR (cdIn.djsj) `year`,
192
+                MONTH (cdIn.djsj) `month`
193
+            FROM
194
+                data_crkyw_ckrmdj_default cdIn
195
+            LEFT JOIN data_crkyw_ckcmz_default cdIn2 ON cdIn.BizNo = cdIn2.BizNo
196
+            GROUP BY
197
+                YEAR (cdIn.djsj),
198
+                MONTH (cdIn.djsj)
199
+        ) cd ON YEAR (ci.createdate) = cd. YEAR
200
+        AND MONTH (ci.createdate) = cd. MONTH
201
+        LEFT JOIN (
202
+            SELECT
203
+                SUM(saIn.expenditure_quantity) expenditure_quantity,
204
+                YEAR (saIn.statistical_date) `year`,
205
+                MONTH (saIn.statistical_date) `month`
206
+            FROM
207
+                business_fs_statistical_account saIn
208
+            LEFT JOIN business_contract bcIn ON saIn.contract_id = bcIn.id
209
+            GROUP BY
210
+                YEAR (saIn.statistical_date),
211
+                MONTH (saIn.statistical_date)
212
+        ) sa ON YEAR (ci.createdate) = sa. YEAR
213
+        AND MONTH (ci.createdate) = sa. MONTH
214
+        WHERE
215
+            bc.contract_number = #{contractNumber}
216
+    </select>
217
+    <select id="getOutStorageDetailed" parameterType="string" resultType="com.chinaitop.depot.intelligent.priceApproval.model.DataCPZ">
218
+        SELECT
219
+            cdIn.htbh,
220
+            cdIn2.sjckchmc storehouseName,
221
+            cdIn2.sjhwhmc warehouseName,
222
+            cdIn2.qcph,
223
+            cdIn2.mz mzzl,
224
+            cdIn3.pz,
225
+            cdIn2.klhjz bzwkl,
226
+            cdIn.djsj cpzsj
227
+        FROM
228
+            data_crkyw_ckrmdj_default cdIn
229
+        LEFT JOIN data_crkyw_ckcmz_default cdIn2 ON cdIn.BizNo = cdIn2.BizNo
230
+        LEFT JOIN data_crkyw_ckcpz_default cdIn3 ON cdIn.BizNo = cdIn3.BizNo
231
+        WHERE
232
+            cdIn.htbh = #{contractNumber}
233
+    </select>
154 234
 </mapper>