Browse Source

轮换费用补贴清算-v1.1

hanqingsong 3 months ago
parent
commit
539d3c7a41

+ 1 - 1
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsSaleRevenue/entity/FsSaleRevenue.java

@@ -85,7 +85,7 @@ public class FsSaleRevenue implements Serializable {
85
     private String problemFeedback;
85
     private String problemFeedback;
86
 
86
 
87
     /** 状态 0:保存;1:库级系统-上报;2:已核定;3:省级平台-上报; */
87
     /** 状态 0:保存;1:库级系统-上报;2:已核定;3:省级平台-上报; */
88
-    @ApiModelProperty(value = "状态 0:保存;1:库级系统-上报;2:已核定;3:省级平台-上报;", position = 12)
88
+    @ApiModelProperty(value = "状态 0:库级系统-保存;1:库级系统-上报;2:省级平台-已核定;3:省级平台-上报;", position = 12)
89
     private Integer status;
89
     private Integer status;
90
 
90
 
91
     // 只展示不保存
91
     // 只展示不保存

+ 7 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/rotationCostSubsidySettle/controller/RotationCostSubsidySettleController.java

@@ -52,6 +52,13 @@ public class RotationCostSubsidySettleController {
52
     @Resource
52
     @Resource
53
     private RotationCostSubsidySettleService rotationCostSubsidySettleService;
53
     private RotationCostSubsidySettleService rotationCostSubsidySettleService;
54
 
54
 
55
+    /**
56
+     * 分页查询
57
+     *  数据来自定时任务(taskAction)
58
+     *  定时任务设置 dev_job 表,类:com.unis.financialSupervision.modular.rotationCostSubsidySettle.task.RotationCostSubsidyTaskRunner
59
+     * @param planYear
60
+     * @return
61
+     */
55
     @ApiOperationSupport(order = 1)
62
     @ApiOperationSupport(order = 1)
56
     @ApiOperation("获取轮换费用补贴清算列表")
63
     @ApiOperation("获取轮换费用补贴清算列表")
57
 //    @SaCheckPermission("/financialSupervision/rotationCostSubsidySettle/page")
64
 //    @SaCheckPermission("/financialSupervision/rotationCostSubsidySettle/page")

+ 60 - 15
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/rotationCostSubsidySettle/mapper/mapping/RotationCostSubsidySettleMapper.xml

@@ -13,7 +13,7 @@
13
         SELECT
13
         SELECT
14
             t1.orgId,
14
             t1.orgId,
15
             t1.orgName,
15
             t1.orgName,
16
-            t1.outPlanNumber staticRawGrainPlanQuantity,
16
+            t1.plan_quantity staticRawGrainPlanQuantity,
17
             (t1.sealing_quantity + t2.quantity)/(t1.outPlanNumber + t2.inPlanNumber) staticRawGrainCompletionRate,
17
             (t1.sealing_quantity + t2.quantity)/(t1.outPlanNumber + t2.inPlanNumber) staticRawGrainCompletionRate,
18
             t1.standard_value staticRawGrainCostStandard,
18
             t1.standard_value staticRawGrainCostStandard,
19
             (t1.outPlanNumber + t2.inPlanNumber) * t1.standard_value staticRawGrainSubsidy,
19
             (t1.outPlanNumber + t2.inPlanNumber) * t1.standard_value staticRawGrainSubsidy,
@@ -22,7 +22,22 @@
22
             t3.standard_value dynamicRawGrainCostStandard,
22
             t3.standard_value dynamicRawGrainCostStandard,
23
             (t3.outPlanNumber + t4.inPlanNumber) * t3.standard_value dynamicRawGrainSubsidy,
23
             (t3.outPlanNumber + t4.inPlanNumber) * t3.standard_value dynamicRawGrainSubsidy,
24
             t1.planYear,
24
             t1.planYear,
25
-            t1.remarks remark
25
+            t1.remarks remark,
26
+            t5.processedGrainPlanQuantity,
27
+            t5.processedGrainCostStandard,
28
+            t5.processedGrainSubsidy,
29
+            t5.otherSubsidy,
30
+            (
31
+                (
32
+                    (
33
+                        t1.outPlanNumber + t2.inPlanNumber
34
+                    ) * t1.standard_value
35
+                ) + (
36
+                    (
37
+                        t3.outPlanNumber + t4.inPlanNumber
38
+                    ) * t3.standard_value
39
+                ) + t5.processedGrainSubsidy + t5.otherSubsidy
40
+            ) subsidySubtotal
26
         FROM
41
         FROM
27
             (
42
             (
28
                 SELECT
43
                 SELECT
@@ -30,9 +45,9 @@
30
                     oi.org_name orgName,
45
                     oi.org_name orgName,
31
                     bri.plan_number outPlanNumber,
46
                     bri.plan_number outPlanNumber,
32
                     bri.plan_year planYear,
47
                     bri.plan_year planYear,
33
-                    bro.plan_quantity,
34
-                    bro.sealing_quantity,
35
-                    bfcs.standard_value,
48
+                    SUM(bro.plan_quantity) plan_quantity,
49
+                    SUM(bro.sealing_quantity) sealing_quantity,
50
+                    SUM(bfcs.standard_value) standard_value,
36
                     bro.remarks
51
                     bro.remarks
37
                 FROM
52
                 FROM
38
                     biz_rp_issuance bri
53
                     biz_rp_issuance bri
@@ -46,16 +61,18 @@
46
                 AND brr.rotation_year = YEAR (NOW())
61
                 AND brr.rotation_year = YEAR (NOW())
47
                 AND bri.plan_year = YEAR (NOW())
62
                 AND bri.plan_year = YEAR (NOW())
48
                 AND bfcs.standard_type = 1
63
                 AND bfcs.standard_type = 1
64
+                GROUP BY
65
+		          bro.org_id
49
             ) t1
66
             ) t1
50
         LEFT JOIN (
67
         LEFT JOIN (
51
             SELECT
68
             SELECT
52
                 brin.org_id orgId,
69
                 brin.org_id orgId,
53
                 oi.org_name orgName,
70
                 oi.org_name orgName,
54
                 bri.plan_number inPlanNumber,
71
                 bri.plan_number inPlanNumber,
55
-                bfcs.standard_value,
72
+                SUM(bfcs.standard_value) standard_value,
56
                 bri.plan_year planYear,
73
                 bri.plan_year planYear,
57
-                brin.plan_quantity,
58
-                brin.quantity
74
+                SUM(brin.plan_quantity) plan_quantity,
75
+		        SUM(brin.quantity) quantity
59
             FROM
76
             FROM
60
                 biz_rp_issuance bri
77
                 biz_rp_issuance bri
61
             INNER JOIN depot_qh.business_rp_report brr ON bri.rp_report_id = brr.id
78
             INNER JOIN depot_qh.business_rp_report brr ON bri.rp_report_id = brr.id
@@ -68,6 +85,8 @@
68
             AND brr.rotation_year = YEAR (NOW())
85
             AND brr.rotation_year = YEAR (NOW())
69
             AND bri.plan_year = YEAR (NOW())
86
             AND bri.plan_year = YEAR (NOW())
70
             AND bfcs.standard_type = 1
87
             AND bfcs.standard_type = 1
88
+            GROUP BY
89
+		      brin.org_id
71
         ) t2 ON t1.orgId = t2.orgId
90
         ) t2 ON t1.orgId = t2.orgId
72
         LEFT JOIN (
91
         LEFT JOIN (
73
                 SELECT
92
                 SELECT
@@ -75,9 +94,9 @@
75
                     oi.org_name orgName,
94
                     oi.org_name orgName,
76
                     bri.plan_number outPlanNumber,
95
                     bri.plan_number outPlanNumber,
77
                     bri.plan_year planYear,
96
                     bri.plan_year planYear,
78
-                    bro.plan_quantity,
79
-                    bro.sealing_quantity,
80
-                    bfcs.standard_value
97
+                    SUM(bro.plan_quantity) plan_quantity,
98
+                    SUM(bro.sealing_quantity) sealing_quantity,
99
+                    SUM(bfcs.standard_value) standard_value
81
                 FROM
100
                 FROM
82
                     biz_rp_issuance bri
101
                     biz_rp_issuance bri
83
                 INNER JOIN depot_qh.business_rp_report brr ON bri.rp_report_id = brr.id
102
                 INNER JOIN depot_qh.business_rp_report brr ON bri.rp_report_id = brr.id
@@ -90,16 +109,18 @@
90
                 AND brr.rotation_year = YEAR (NOW())
109
                 AND brr.rotation_year = YEAR (NOW())
91
                 AND bri.plan_year = YEAR (NOW())
110
                 AND bri.plan_year = YEAR (NOW())
92
                 AND bfcs.standard_type = 1
111
                 AND bfcs.standard_type = 1
112
+                GROUP BY
113
+		          bro.org_id
93
         ) t3 ON t1.orgId = t2.orgId AND t2.orgId = t3.orgId
114
         ) t3 ON t1.orgId = t2.orgId AND t2.orgId = t3.orgId
94
         LEFT JOIN (
115
         LEFT JOIN (
95
             SELECT
116
             SELECT
96
                 brin.org_id orgId,
117
                 brin.org_id orgId,
97
                 oi.org_name orgName,
118
                 oi.org_name orgName,
98
                 bri.plan_number inPlanNumber,
119
                 bri.plan_number inPlanNumber,
99
-                bfcs.standard_value,
120
+                SUM(bfcs.standard_value) standard_value,
100
                 bri.plan_year planYear,
121
                 bri.plan_year planYear,
101
-                brin.plan_quantity,
102
-                brin.quantity
122
+                SUM(brin.plan_quantity) plan_quantity,
123
+		        SUM(brin.quantity) quantity
103
             FROM
124
             FROM
104
                 biz_rp_issuance bri
125
                 biz_rp_issuance bri
105
             INNER JOIN depot_qh.business_rp_report brr ON bri.rp_report_id = brr.id
126
             INNER JOIN depot_qh.business_rp_report brr ON bri.rp_report_id = brr.id
@@ -112,6 +133,30 @@
112
             AND brr.rotation_year = YEAR (NOW())
133
             AND brr.rotation_year = YEAR (NOW())
113
             AND bri.plan_year = YEAR (NOW())
134
             AND bri.plan_year = YEAR (NOW())
114
             AND bfcs.standard_type = 1
135
             AND bfcs.standard_type = 1
115
-        ) t4 ON t3.orgId = t4.orgId
136
+            GROUP BY
137
+		      brin.org_id
138
+        ) t4 ON t1.orgId = t4.orgId
139
+        LEFT JOIN (
140
+            SELECT
141
+                gp.id,
142
+                gp.org_id,
143
+                gp.plan_quantity processedGrainPlanQuantity,
144
+                (
145
+                    gp.completion_quantity / gp.plan_quantity
146
+                ) * 100 processedGrainCompletionRate,
147
+                cs.standard_value processedGrainCostStandard,
148
+                (
149
+                    gp.plan_quantity * cs.standard_value
150
+                ) processedGrainSubsidy,
151
+                '0' otherSubsidy
152
+            FROM
153
+                depot_qh.business_pg_gops_plan gp
154
+            LEFT JOIN depot_qh.business_fs_cost_standard cs ON gp.org_id = cs.org_id
155
+            WHERE
156
+                gp.plan_type = 1
157
+            AND cs.standard_type = 1
158
+            GROUP BY
159
+                cs.org_id
160
+        ) t5 ON t1.orgId = t5.org_id
116
     </select>
161
     </select>
117
 </mapper>
162
 </mapper>

+ 1 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/rotationCostSubsidySettle/service/impl/RotationCostSubsidySettleServiceImpl.java

@@ -108,6 +108,7 @@ public class RotationCostSubsidySettleServiceImpl extends ServiceImpl<RotationCo
108
     }
108
     }
109
 
109
 
110
     @Override
110
     @Override
111
+    @Transactional(rollbackFor = Exception.class)
111
     public void taskAction() {
112
     public void taskAction() {
112
         List<RotationCostSubsidySettle> chaosData = rotationCostSubsidySettleMapper.selectChaosData();
113
         List<RotationCostSubsidySettle> chaosData = rotationCostSubsidySettleMapper.selectChaosData();
113
         if (CollectionUtils.isNotEmpty(chaosData)) {
114
         if (CollectionUtils.isNotEmpty(chaosData)) {