Bladeren bron

Merge branch 'dev-2.19.2' of province-qinghai/province-all into dev

adminGRP 3 maanden geleden
bovenliggende
commit
fe70db01a0

+ 18 - 35
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsSaleRevenue/controller/FsSaleRevenueController.java

@@ -12,36 +12,30 @@
12 12
  */
13 13
 package com.unis.financialSupervision.modular.fsSaleRevenue.controller;
14 14
 
15
-import cn.dev33.satoken.annotation.SaCheckPermission;
16 15
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
17 16
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
18 17
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
18
+import com.unis.financialSupervision.modular.priceApproval.entity.DataCPZ;
19 19
 import io.swagger.annotations.Api;
20 20
 import io.swagger.annotations.ApiOperation;
21 21
 import org.springframework.validation.annotation.Validated;
22
-import org.springframework.web.bind.annotation.GetMapping;
23
-import org.springframework.web.bind.annotation.PostMapping;
24
-import org.springframework.web.bind.annotation.RequestBody;
25
-import org.springframework.web.bind.annotation.RestController;
22
+import org.springframework.web.bind.annotation.*;
26 23
 import com.unis.common.annotation.CommonLog;
27 24
 import com.unis.common.pojo.CommonResult;
28
-import com.unis.common.pojo.CommonValidList;
29 25
 import com.unis.financialSupervision.modular.fsSaleRevenue.entity.FsSaleRevenue;
30
-import com.unis.financialSupervision.modular.fsSaleRevenue.param.FsSaleRevenueAddParam;
31
-import com.unis.financialSupervision.modular.fsSaleRevenue.param.FsSaleRevenueEditParam;
32 26
 import com.unis.financialSupervision.modular.fsSaleRevenue.param.FsSaleRevenueIdParam;
33 27
 import com.unis.financialSupervision.modular.fsSaleRevenue.param.FsSaleRevenuePageParam;
34 28
 import com.unis.financialSupervision.modular.fsSaleRevenue.service.FsSaleRevenueService;
35 29
 
36 30
 import javax.annotation.Resource;
37 31
 import javax.validation.Valid;
38
-import javax.validation.constraints.NotEmpty;
32
+import java.util.List;
39 33
 
40 34
 /**
41 35
  * 销售收入上缴控制器
42 36
  *
43 37
  * @author QSHan
44
- * @date  2024/07/29 14:04
38
+ * @date 2024/07/29 14:04
45 39
  */
46 40
 @Api(tags = "销售收入上缴控制器")
47 41
 @ApiSupport(author = "UNIS_TEAM", order = 1)
@@ -56,11 +50,11 @@ public class FsSaleRevenueController {
56 50
      * 获取销售收入上缴分页
57 51
      *
58 52
      * @author QSHan
59
-     * @date  2024/07/29 14:04
53
+     * @date 2024/07/29 14:04
60 54
      */
61 55
     @ApiOperationSupport(order = 1)
62 56
     @ApiOperation("获取销售收入上缴分页")
63
-    @SaCheckPermission("/financialSupervision/fsSaleRevenue/page")
57
+//    @SaCheckPermission("/financialSupervision/fsSaleRevenue/page")
64 58
     @GetMapping("/financialSupervision/fsSaleRevenue/page")
65 59
     public CommonResult<Page<FsSaleRevenue>> page(FsSaleRevenuePageParam fsSaleRevenuePageParam) {
66 60
         return CommonResult.data(fsSaleRevenueService.page(fsSaleRevenuePageParam));
@@ -70,32 +64,15 @@ public class FsSaleRevenueController {
70 64
      * 编辑销售收入上缴
71 65
      *
72 66
      * @author QSHan
73
-     * @date  2024/07/29 14:04
67
+     * @date 2024/07/29 14:04
74 68
      */
75 69
     @ApiOperationSupport(order = 3)
76 70
     @ApiOperation("编辑销售收入上缴")
77 71
     @CommonLog("编辑销售收入上缴")
78
-    @SaCheckPermission("/financialSupervision/fsSaleRevenue/edit")
72
+//    @SaCheckPermission("/financialSupervision/fsSaleRevenue/edit")
79 73
     @PostMapping("/financialSupervision/fsSaleRevenue/edit")
80
-    public CommonResult<String> edit(@RequestBody @Valid FsSaleRevenueEditParam fsSaleRevenueEditParam) {
81
-        fsSaleRevenueService.edit(fsSaleRevenueEditParam);
82
-        return CommonResult.ok();
83
-    }
84
-
85
-    /**
86
-     * 删除销售收入上缴
87
-     *
88
-     * @author QSHan
89
-     * @date  2024/07/29 14:04
90
-     */
91
-    @ApiOperationSupport(order = 4)
92
-    @ApiOperation("删除销售收入上缴")
93
-    @CommonLog("删除销售收入上缴")
94
-    @SaCheckPermission("/financialSupervision/fsSaleRevenue/delete")
95
-    @PostMapping("/financialSupervision/fsSaleRevenue/delete")
96
-    public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
97
-                                                   CommonValidList<FsSaleRevenueIdParam> fsSaleRevenueIdParamList) {
98
-        fsSaleRevenueService.delete(fsSaleRevenueIdParamList);
74
+    public CommonResult<String> edit(@RequestBody @Valid FsSaleRevenue param) {
75
+        fsSaleRevenueService.edit(param);
99 76
         return CommonResult.ok();
100 77
     }
101 78
 
@@ -103,13 +80,19 @@ public class FsSaleRevenueController {
103 80
      * 获取销售收入上缴详情
104 81
      *
105 82
      * @author QSHan
106
-     * @date  2024/07/29 14:04
83
+     * @date 2024/07/29 14:04
107 84
      */
108 85
     @ApiOperationSupport(order = 5)
109 86
     @ApiOperation("获取销售收入上缴详情")
110
-    @SaCheckPermission("/financialSupervision/fsSaleRevenue/detail")
87
+//    @SaCheckPermission("/financialSupervision/fsSaleRevenue/detail")
111 88
     @GetMapping("/financialSupervision/fsSaleRevenue/detail")
112 89
     public CommonResult<FsSaleRevenue> detail(@Valid FsSaleRevenueIdParam fsSaleRevenueIdParam) {
113 90
         return CommonResult.data(fsSaleRevenueService.detail(fsSaleRevenueIdParam));
114 91
     }
92
+
93
+    @GetMapping("/financialSupervision/fsSaleRevenue/getOutStorageDetailed/{contractNumber}")
94
+    @ApiOperation(value = "三账一致性-出库明细", notes = "出库明细")
95
+    public CommonResult<List<DataCPZ>> getOutStorageDetailed(@PathVariable("contractNumber") String contractNumber) {
96
+        return CommonResult.data(fsSaleRevenueService.getOutStorageDetailed(contractNumber));
97
+    }
115 98
 }

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

@@ -22,7 +22,8 @@ import com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistenceAccoun
22 22
 import io.swagger.annotations.ApiModelProperty;
23 23
 import lombok.Getter;
24 24
 import lombok.Setter;
25
-import java.math.BigDecimal;
25
+
26
+import java.io.Serializable;
26 27
 import java.util.Date;
27 28
 import java.util.List;
28 29
 
@@ -35,7 +36,8 @@ import java.util.List;
35 36
 @Getter
36 37
 @Setter
37 38
 @TableName("business_fs_sale_revenue")
38
-public class FsSaleRevenue {
39
+public class FsSaleRevenue implements Serializable {
40
+    private static final long serialVersionUID = -3160238445247970639L;
39 41
 
40 42
     /** 主键ID */
41 43
     @TableId
@@ -138,4 +140,9 @@ public class FsSaleRevenue {
138 140
     @ApiModelProperty(value = "库区名称")
139 141
     @TableField(exist = false)
140 142
     private String orgName;
143
+
144
+    @ApiModelProperty(value = "合同附件")
145
+    @TableField(exist = false)
146
+    private String attachment;
147
+
141 148
 }

+ 31 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsSaleRevenue/mapper/FsSaleRevenueMapper.java

@@ -12,18 +12,49 @@
12 12
  */
13 13
 package com.unis.financialSupervision.modular.fsSaleRevenue.mapper;
14 14
 
15
+import com.baomidou.dynamic.datasource.annotation.DS;
15 16
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
16 17
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
17 18
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
19
+import com.unis.common.constant.DBConstant;
20
+import com.unis.financialSupervision.modular.fsSaleRevenue.entity.BusinessContractDetail;
18 21
 import com.unis.financialSupervision.modular.fsSaleRevenue.entity.FsSaleRevenue;
22
+import com.unis.financialSupervision.modular.fsSaleRevenueApprovalPrice.entity.FsSaleRevenueApprovalPrice;
23
+import com.unis.financialSupervision.modular.fsSaleRevenueDiffPrice.entity.FsSaleRevenueDiffPrice;
24
+import com.unis.financialSupervision.modular.fsSaleRevenueInspectionLoss.entity.FsSaleRevenueInspectionLoss;
25
+import com.unis.financialSupervision.modular.fsSaleRevenueSettle.entity.FsSaleRevenueSettle;
26
+import com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistence.entity.FsSaleRevenueThreeConsistence;
27
+import com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistenceAccount.entity.FsSaleRevenueThreeConsistenceAccount;
28
+import com.unis.financialSupervision.modular.priceApproval.entity.DataCPZ;
19 29
 import org.apache.ibatis.annotations.Param;
20 30
 
31
+import java.util.List;
32
+
21 33
 /**
22 34
  * 销售收入上缴Mapper接口
23 35
  *
24 36
  * @author QSHan
25 37
  * @date 2024/07/29 14:04
26 38
  **/
39
+//@DS(DBConstant.DS_DEPOT)
27 40
 public interface FsSaleRevenueMapper extends BaseMapper<FsSaleRevenue> {
28 41
     Page<FsSaleRevenue> pageList(Page<Object> objectPage, @Param("ew") QueryWrapper<FsSaleRevenue> queryWrapper);
42
+
43
+    List<BusinessContractDetail> getContractInfoList(@Param("id") Integer id);
44
+
45
+    List<FsSaleRevenueThreeConsistenceAccount> getConsistenceAccountDetailsInfo(@Param("id") Integer id);
46
+
47
+    List<FsSaleRevenueInspectionLoss> getQualityDetailsInfo(@Param("id") Integer id);
48
+
49
+    List<FsSaleRevenueThreeConsistence> getOutStorageDetailsInfo(@Param("id") Integer id);
50
+
51
+    List<FsSaleRevenueSettle> getSettlementDetailsInfo(@Param("id") Integer id);
52
+
53
+    List<FsSaleRevenueApprovalPrice> getCardDetailsInfo(@Param("id") Integer id);
54
+
55
+    List<FsSaleRevenueDiffPrice> getDiffPriceDetailsInfo(@Param("id") Integer id);
56
+
57
+    List<DataCPZ> getOutStorageDetailed(@Param("contractNumber") String contractNumber);
58
+
59
+    FsSaleRevenue queryEntityById(@Param("id") Integer id);
29 60
 }

+ 192 - 5
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsSaleRevenue/mapper/mapping/FsSaleRevenueMapper.xml

@@ -12,12 +12,199 @@
12 12
             bc.performance_quantity performanceQuantity,
13 13
             sr.createdate,
14 14
             sr.`status`,
15
-            sr.updatedate
15
+            sr.updatedate,
16
+            sr.report_time
16 17
         FROM
17
-            depot_qh.business_fs_sale_revenue sr
18
-        LEFT JOIN depot_qh.business_contract bc ON sr.contract_id = bc.id
19
-        LEFT JOIN depot_qh.org_info oi ON sr.org_id = oi.org_id
20
-        LEFT JOIN biz_unit_info ui ON ui.id = oi.unit_info_id
18
+            business_fs_sale_revenue sr
19
+        LEFT JOIN business_contract bc ON sr.contract_id = bc.id
20
+        LEFT JOIN org_info oi ON sr.org_id = oi.org_id
21
+        LEFT JOIN province_all.biz_unit_info ui ON ui.id = oi.unit_info_id
21 22
         ${ew.customSqlSegment}
22 23
     </select>
24
+    <select id="getContractInfoList" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenue.entity.BusinessContractDetail">
25
+        SELECT
26
+            swd.id,
27
+            bs.storehouse_name houseName,
28
+            bw.warehouse_name warehouseName,
29
+            swd.grain_kind grainKind,
30
+            be.enumname grainKindName,
31
+            swd.in_count inCount,
32
+            swd.in_price inPrice,
33
+            swd.in_detail_total_price inDetailTotalPrice
34
+        FROM
35
+            business_store_ware_detail swd
36
+        LEFT JOIN basic_enum be ON be.enumId = swd.grain_kind
37
+        LEFT JOIN basic_storehouse bs ON swd.house_id = bs.storehouse_id
38
+        LEFT JOIN basic_warehouse bw ON swd.warehouse_id = bw.warehouse_id
39
+        WHERE
40
+            swd.zid = #{id}
41
+    </select>
42
+    <select id="getConsistenceAccountDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistenceAccount.entity.FsSaleRevenueThreeConsistenceAccount">
43
+        SELECT
44
+            tcc.id,
45
+            tcc. YEAR,
46
+            tcc. MONTH,
47
+            tcc.accounting_quantity accountingQuantity,
48
+            tcc.accounting_amount accountingAmount
49
+        FROM
50
+            business_fs_sale_revenue_three_consistence_account tcc
51
+        LEFT JOIN business_fs_sale_revenue sr ON sr.id = tcc.fs_sale_revenue_id
52
+        WHERE
53
+            tcc.fs_sale_revenue_id = #{id}
54
+    </select>
55
+    <select id="getQualityDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueInspectionLoss.entity.FsSaleRevenueInspectionLoss">
56
+        SELECT
57
+            il.id,
58
+            il.qc_quality_inspection_id_out,
59
+            il.qc_quality_inspection_id_in,
60
+            bs.storehouse_name storehouseName,
61
+            bw.warehouse_name warehouseName,
62
+            t1.zzIn,
63
+            t1.sfIn,
64
+            t2.zzOut,
65
+            t2.sfOut,
66
+            il.gslr_loss_collect_id gslrLossCollectId,
67
+            lc.actual_loss_quantity actualLossQuantity,
68
+            (
69
+                lc.natural_loss + lc.moisture_loss + lc.impurity_reduction_quality
70
+            ) quotaLoss,
71
+            lc.natural_loss naturalLoss,
72
+            lc.moisture_loss moistureLoss,
73
+            lc.impurity_reduction_quality impurityReductionQuality,
74
+            lc.excess_loss_quantity excessLossQuantity,
75
+            lc.loss_profit_reason lossProfitReason
76
+        FROM
77
+            business_fs_sale_revenue_inspection_loss il
78
+        LEFT JOIN business_gslr_loss_collect lc ON lc.id = il.gslr_loss_collect_id
79
+        LEFT JOIN basic_storehouse bs ON lc.basic_storehouse_id = bs.storehouse_id
80
+        LEFT JOIN basic_warehouse bw ON lc.warehouse_id = bw.warehouse_id
81
+        LEFT JOIN
82
+        (
83
+        SELECT
84
+            qi.id,
85
+            SUM(CASE WHEN qii.inspection_item_id = 7619 THEN qii.inspection_value ELSE 0 END) zzIn,
86
+          SUM(CASE WHEN qii.inspection_item_id = 9528239 THEN qii.inspection_value ELSE 0 END) sfIn
87
+        FROM
88
+            business_fs_sale_revenue_inspection_loss il
89
+        LEFT JOIN business_qc_quality_inspection qi ON il.qc_quality_inspection_id_out = qi.id
90
+        LEFT JOIN business_qc_quality_inspection_item qii ON qi.id = qii.qc_quality_inspection_id
91
+        ) t1 ON il.qc_quality_inspection_id_in = t1.id
92
+        LEFT JOIN
93
+        (
94
+        SELECT
95
+            qi.id,
96
+            SUM(CASE WHEN qii.inspection_item_id = 7619 THEN qii.inspection_value ELSE 0 END) zzOut,
97
+          SUM(CASE WHEN qii.inspection_item_id = 9528239 THEN qii.inspection_value ELSE 0 END) sfOut
98
+        FROM
99
+            business_fs_sale_revenue_inspection_loss il
100
+        LEFT JOIN business_qc_quality_inspection qi ON il.qc_quality_inspection_id_out = qi.id
101
+        LEFT JOIN business_qc_quality_inspection_item qii ON qi.id = qii.qc_quality_inspection_id
102
+        ) t2 ON il.qc_quality_inspection_id_out = t2.id
103
+        WHERE
104
+            il.fs_sale_revenue_id = #{id}
105
+    </select>
106
+    <select id="getOutStorageDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistence.entity.FsSaleRevenueThreeConsistence">
107
+        SELECT
108
+            tc.id,
109
+            tc.`year`,
110
+            tc.`month`,
111
+            tc.basic_storehouse_id,
112
+            tc.warehouse_id,
113
+            bs.storehouse_name storehouseName,
114
+            bw.warehouse_name warehouseName,
115
+            tc.loss,
116
+            tc.custody_account_quantity,
117
+            tc.statistical_account_quantity,
118
+            tc.complete_time
119
+        FROM
120
+            business_fs_sale_revenue_three_consistence tc
121
+        LEFT JOIN basic_storehouse bs ON tc.basic_storehouse_id = bs.storehouse_id
122
+        LEFT JOIN basic_warehouse bw ON tc.warehouse_id = bw.warehouse_id
123
+        WHERE
124
+            tc.fs_sale_revenue_id = #{id}
125
+    </select>
126
+    <select id="getSettlementDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueSettle.entity.FsSaleRevenueSettle">
127
+        SELECT
128
+            rs.id,
129
+            rs.province_acceptance_unit,
130
+            rs.province_total_settle_quantity,
131
+            rs.province_total_settle_amount,
132
+            rs.province_loan_return_time loanReturnTime,
133
+            rs.province_loan_recovery_unit provinceLoanRecoveryUnit,
134
+            rs.province_loan_recovery_quantity provinceLoanRecoveryQuantity,
135
+            rs.province_loan_recovery_amount provinceLoanRecoveryAmount,
136
+            rs.province_invoice_unit provinceInvoiceUnit,
137
+            rs.province_invoice_quantity provinceInvoiceQuantity,
138
+            rs.province_invoice_unit_price provinceInvoiceUnitPrice,
139
+            rs.province_invoice_amount provinceInvoiceAmount,
140
+            rs.province_loan_return_time provinceLoanReturnTime,
141
+            rs.province_loan_return_amount provinceLoanReturnAmount,
142
+            rs.fs_out_confirm_id fsOutConfirmId
143
+        FROM
144
+            business_fs_sale_revenue_settle rs
145
+        WHERE
146
+            rs.fs_sale_revenue_id = #{id}
147
+    </select>
148
+    <select id="getCardDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueApprovalPrice.entity.FsSaleRevenueApprovalPrice">
149
+        SELECT
150
+            ap.id,
151
+            sc.basic_storehouse_id storehouseId,
152
+            bs.storehouse_name storehouseName,
153
+            sc.warehouse_id warehouseId,
154
+            bw.warehouse_name warehouseName,
155
+            sc.lssl,
156
+            sc.in_financial_verification inNinancialVerification,
157
+            ap.storage_amount storageAmount,
158
+            ap.document_number,
159
+            ap.document_upload,
160
+            ap.grain_situation_card_id,
161
+	        ap.fs_sale_revenue_id
162
+        FROM
163
+            business_fs_sale_revenue_approval_price ap
164
+        LEFT JOIN grain_situation_card sc ON ap.grain_situation_card_id = sc.id
165
+        LEFT JOIN basic_storehouse bs ON sc.basic_storehouse_id = bs.storehouse_id
166
+        LEFT JOIN basic_warehouse bw ON sc.warehouse_id = bw.warehouse_id
167
+        WHERE
168
+            ap.fs_sale_revenue_id = #{id}
169
+    </select>
170
+    <select id="getDiffPriceDetailsInfo" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenueDiffPrice.entity.FsSaleRevenueDiffPrice">
171
+        SELECT
172
+            dp.id,
173
+            dp.project_type projectType,
174
+            dp.total_quantity totalQuantity,
175
+            dp.total_amount totalAmount
176
+        FROM
177
+            business_fs_sale_revenue_diff_price dp
178
+        WHERE
179
+            dp.fs_sale_revenue_id = #{id}
180
+    </select>
181
+    <select id="getOutStorageDetailed" parameterType="string" resultType="com.unis.financialSupervision.modular.priceApproval.entity.DataCPZ">
182
+        SELECT
183
+            cdIn.htbh,
184
+            cdIn2.sjckchmc storehouseName,
185
+            cdIn2.sjhwhmc warehouseName,
186
+            cdIn.cph qcph,
187
+            cdIn2.mz mzzl,
188
+            cdIn3.pz,
189
+            cdIn2.klhjz bzwkl,
190
+            cdIn.djsj cpzsj
191
+        FROM
192
+            data_crkyw_ckrmdj_default cdIn
193
+        LEFT JOIN data_crkyw_ckcmz_default cdIn2 ON cdIn.BizNo = cdIn2.BizNo
194
+        LEFT JOIN data_crkyw_ckcpz_default cdIn3 ON cdIn.BizNo = cdIn3.BizNo
195
+        WHERE
196
+            cdIn.htbh = #{contractNumber}
197
+    </select>
198
+    <select id="queryEntityById" parameterType="integer" resultType="com.unis.financialSupervision.modular.fsSaleRevenue.entity.FsSaleRevenue">
199
+        SELECT
200
+            sr.*, bc.contract_number contractNumber,
201
+            bc.attachment,
202
+	        oi.org_name orgName
203
+        FROM
204
+            business_fs_sale_revenue sr
205
+        LEFT JOIN business_contract bc ON sr.contract_id = bc.id
206
+        LEFT JOIN org_info oi ON oi.org_id = sr.org_id
207
+        WHERE
208
+            sr.id = #{id}
209
+    </select>
23 210
 </mapper>

+ 2 - 1
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsSaleRevenue/param/FsSaleRevenueIdParam.java

@@ -17,6 +17,7 @@ import lombok.Getter;
17 17
 import lombok.Setter;
18 18
 
19 19
 import javax.validation.constraints.NotBlank;
20
+import javax.validation.constraints.NotNull;
20 21
 
21 22
 /**
22 23
  * 销售收入上缴Id参数
@@ -30,6 +31,6 @@ public class FsSaleRevenueIdParam {
30 31
 
31 32
     /** 主键ID */
32 33
     @ApiModelProperty(value = "主键ID", required = true)
33
-    @NotBlank(message = "id不能为空")
34
+    @NotNull(message = "id不能为空")
34 35
     private Integer id;
35 36
 }

+ 7 - 15
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsSaleRevenue/service/FsSaleRevenueService.java

@@ -19,6 +19,7 @@ import com.unis.financialSupervision.modular.fsSaleRevenue.param.FsSaleRevenueAd
19 19
 import com.unis.financialSupervision.modular.fsSaleRevenue.param.FsSaleRevenueEditParam;
20 20
 import com.unis.financialSupervision.modular.fsSaleRevenue.param.FsSaleRevenueIdParam;
21 21
 import com.unis.financialSupervision.modular.fsSaleRevenue.param.FsSaleRevenuePageParam;
22
+import com.unis.financialSupervision.modular.priceApproval.entity.DataCPZ;
22 23
 
23 24
 import java.util.List;
24 25
 
@@ -44,15 +45,7 @@ public interface FsSaleRevenueService extends IService<FsSaleRevenue> {
44 45
      * @author QSHan
45 46
      * @date  2024/07/29 14:04
46 47
      */
47
-    void edit(FsSaleRevenueEditParam fsSaleRevenueEditParam);
48
-
49
-    /**
50
-     * 删除销售收入上缴
51
-     *
52
-     * @author QSHan
53
-     * @date  2024/07/29 14:04
54
-     */
55
-    void delete(List<FsSaleRevenueIdParam> fsSaleRevenueIdParamList);
48
+    void edit(FsSaleRevenue param);
56 49
 
57 50
     /**
58 51
      * 获取销售收入上缴详情
@@ -63,10 +56,9 @@ public interface FsSaleRevenueService extends IService<FsSaleRevenue> {
63 56
     FsSaleRevenue detail(FsSaleRevenueIdParam fsSaleRevenueIdParam);
64 57
 
65 58
     /**
66
-     * 获取销售收入上缴详情
67
-     *
68
-     * @author QSHan
69
-     * @date  2024/07/29 14:04
70
-     **/
71
-    FsSaleRevenue queryEntity(Integer id);
59
+     * 获取出入库明细
60
+     * @param contractNumber 合同编号
61
+     * @return list
62
+     */
63
+    List<DataCPZ> getOutStorageDetailed(String contractNumber);
72 64
 }

+ 136 - 18
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsSaleRevenue/service/impl/FsSaleRevenueServiceImpl.java

@@ -16,10 +16,27 @@ import cn.hutool.core.bean.BeanUtil;
16 16
 import cn.hutool.core.collection.CollStreamUtil;
17 17
 import cn.hutool.core.util.ObjectUtil;
18 18
 import cn.hutool.core.util.StrUtil;
19
+import com.baomidou.dynamic.datasource.annotation.DS;
19 20
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
21
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
20 22
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
21 23
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
22 24
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
25
+import com.unis.common.constant.DBConstant;
26
+import com.unis.financialSupervision.modular.fsSaleRevenue.entity.BusinessContractDetail;
27
+import com.unis.financialSupervision.modular.fsSaleRevenueApprovalPrice.entity.FsSaleRevenueApprovalPrice;
28
+import com.unis.financialSupervision.modular.fsSaleRevenueApprovalPrice.mapper.FsSaleRevenueApprovalPriceMapper;
29
+import com.unis.financialSupervision.modular.fsSaleRevenueDiffPrice.entity.FsSaleRevenueDiffPrice;
30
+import com.unis.financialSupervision.modular.fsSaleRevenueDiffPrice.mapper.FsSaleRevenueDiffPriceMapper;
31
+import com.unis.financialSupervision.modular.fsSaleRevenueInspectionLoss.entity.FsSaleRevenueInspectionLoss;
32
+import com.unis.financialSupervision.modular.fsSaleRevenueInspectionLoss.mapper.FsSaleRevenueInspectionLossMapper;
33
+import com.unis.financialSupervision.modular.fsSaleRevenueSettle.entity.FsSaleRevenueSettle;
34
+import com.unis.financialSupervision.modular.fsSaleRevenueSettle.mapper.FsSaleRevenueSettleMapper;
35
+import com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistence.entity.FsSaleRevenueThreeConsistence;
36
+import com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistence.mapper.FsSaleRevenueThreeConsistenceMapper;
37
+import com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistenceAccount.entity.FsSaleRevenueThreeConsistenceAccount;
38
+import com.unis.financialSupervision.modular.fsSaleRevenueThreeConsistenceAccount.mapper.FsSaleRevenueThreeConsistenceAccountMapper;
39
+import com.unis.financialSupervision.modular.priceApproval.entity.DataCPZ;
23 40
 import org.springframework.stereotype.Service;
24 41
 import org.springframework.transaction.annotation.Transactional;
25 42
 import com.unis.common.enums.CommonSortOrderEnum;
@@ -34,6 +51,7 @@ import com.unis.financialSupervision.modular.fsSaleRevenue.param.FsSaleRevenuePa
34 51
 import com.unis.financialSupervision.modular.fsSaleRevenue.service.FsSaleRevenueService;
35 52
 
36 53
 import javax.annotation.Resource;
54
+import java.math.BigDecimal;
37 55
 import java.util.List;
38 56
 
39 57
 /**
@@ -43,9 +61,22 @@ import java.util.List;
43 61
  * @date  2024/07/29 14:04
44 62
  **/
45 63
 @Service
64
+@DS(DBConstant.DS_DEPOT)
46 65
 public class FsSaleRevenueServiceImpl extends ServiceImpl<FsSaleRevenueMapper, FsSaleRevenue> implements FsSaleRevenueService {
47 66
     @Resource
48
-    private FsSaleRevenueMapper revenueMapper;
67
+    private FsSaleRevenueMapper saleRevenueMapper;
68
+    @Resource
69
+    private FsSaleRevenueInspectionLossMapper saleRevenueInspectionLossMapper;
70
+    @Resource
71
+    private FsSaleRevenueThreeConsistenceAccountMapper threeConsistenceAccountMapper;
72
+    @Resource
73
+    private FsSaleRevenueThreeConsistenceMapper threeConsistenceMapper;
74
+    @Resource
75
+    private FsSaleRevenueSettleMapper settleMapper;
76
+    @Resource
77
+    private FsSaleRevenueApprovalPriceMapper approvalPriceMapper;
78
+    @Resource
79
+    private FsSaleRevenueDiffPriceMapper diffPriceMapper;
49 80
 
50 81
     @Override
51 82
     public Page<FsSaleRevenue> page(FsSaleRevenuePageParam fsSaleRevenuePageParam) {
@@ -65,35 +96,122 @@ public class FsSaleRevenueServiceImpl extends ServiceImpl<FsSaleRevenueMapper, F
65 96
         } else {
66 97
             queryWrapper.lambda().orderByDesc(FsSaleRevenue::getId);
67 98
         }
68
-        return revenueMapper.pageList(CommonPageRequest.defaultPage(), queryWrapper);
99
+        return saleRevenueMapper.pageList(CommonPageRequest.defaultPage(), queryWrapper);
69 100
     }
70 101
 
71 102
     @Transactional(rollbackFor = Exception.class)
72 103
     @Override
73
-    public void edit(FsSaleRevenueEditParam fsSaleRevenueEditParam) {
74
-        FsSaleRevenue fsSaleRevenue = this.queryEntity(fsSaleRevenueEditParam.getId());
75
-        BeanUtil.copyProperties(fsSaleRevenueEditParam, fsSaleRevenue);
76
-        this.updateById(fsSaleRevenue);
77
-    }
104
+    public void edit(FsSaleRevenue param) {
105
+        // 修改主表
106
+        this.updateById(param);
78 107
 
79
-    @Transactional(rollbackFor = Exception.class)
80
-    @Override
81
-    public void delete(List<FsSaleRevenueIdParam> fsSaleRevenueIdParamList) {
82
-        // 执行删除
83
-        this.removeByIds(CollStreamUtil.toList(fsSaleRevenueIdParamList, FsSaleRevenueIdParam::getId));
108
+        // 修改子表-质检损益信息
109
+        this.inspectionLossUpdate(param.getInspectionLossList());
110
+
111
+        // 修改子表-三账一致性-会计账
112
+        this.threeConsistenceAccountUpdate(param.getThreeConsistenceAccountList());
113
+
114
+        // 修改子表-三账一致性-实际出库情况
115
+        this.threeConsistenceUpdate(param.getThreeConsistenceList());
116
+
117
+        // 修改子表-结算信息
118
+        this.revenueSettleUpdate(param.getRevenueSettleList());
119
+
120
+        // 修改子表-原核定入库价格
121
+        this.approvalPriceUpdate(param.getApprovalPriceList());
122
+
123
+        // 修改子表-差价上缴
124
+        this.diffPriceUpdate(param.getDiffPriceList());
84 125
     }
85 126
 
86 127
     @Override
87 128
     public FsSaleRevenue detail(FsSaleRevenueIdParam fsSaleRevenueIdParam) {
88
-        return this.queryEntity(fsSaleRevenueIdParam.getId());
129
+        // 查询主表
130
+        FsSaleRevenue saleRevenue = saleRevenueMapper.queryEntityById(fsSaleRevenueIdParam.getId());
131
+
132
+        // 查询子表-合同信息
133
+        List<BusinessContractDetail> contractInfoList = saleRevenueMapper.getContractInfoList(saleRevenue.getContractId());
134
+        if (CollectionUtils.isNotEmpty(contractInfoList)) {
135
+            saleRevenue.setContractDetails(contractInfoList);
136
+        }
137
+        // 查询子表-质检损益信息
138
+        List<FsSaleRevenueInspectionLoss> inspectionLossList = saleRevenueMapper.getQualityDetailsInfo(fsSaleRevenueIdParam.getId());
139
+        if (CollectionUtils.isNotEmpty(inspectionLossList)) {
140
+            saleRevenue.setInspectionLossList(inspectionLossList);
141
+        }
142
+        // 查询子表-三账一致性-会计账
143
+        List<FsSaleRevenueThreeConsistenceAccount> threeConsistenceList = saleRevenueMapper.getConsistenceAccountDetailsInfo(fsSaleRevenueIdParam.getId());
144
+        if (CollectionUtils.isNotEmpty(threeConsistenceList)) {
145
+            saleRevenue.setThreeConsistenceAccountList(threeConsistenceList);
146
+        }
147
+        // 查询子表-三账一致性-实际出库情况
148
+        List<FsSaleRevenueThreeConsistence> outStorageDetailsInfo = saleRevenueMapper.getOutStorageDetailsInfo(fsSaleRevenueIdParam.getId());
149
+        if (CollectionUtils.isNotEmpty(outStorageDetailsInfo)) {
150
+            saleRevenue.setThreeConsistenceList(outStorageDetailsInfo);
151
+        }
152
+        // 查询子表-结算信息
153
+        List<FsSaleRevenueSettle> revenueSettleList = saleRevenueMapper.getSettlementDetailsInfo(fsSaleRevenueIdParam.getId());
154
+        if (CollectionUtils.isNotEmpty(revenueSettleList)) {
155
+            saleRevenue.setRevenueSettleList(revenueSettleList);
156
+        }
157
+        // 查询子表-原核定入库价格
158
+        List<FsSaleRevenueApprovalPrice> approvalPriceList = saleRevenueMapper.getCardDetailsInfo(fsSaleRevenueIdParam.getId());
159
+        if (CollectionUtils.isNotEmpty(approvalPriceList)) {
160
+            saleRevenue.setApprovalPriceList(approvalPriceList);
161
+        }
162
+        // 查询子表-差价上缴
163
+        List<FsSaleRevenueDiffPrice> DiffPriceList = saleRevenueMapper.getDiffPriceDetailsInfo(fsSaleRevenueIdParam.getId());
164
+        if (CollectionUtils.isNotEmpty(DiffPriceList)) {
165
+            saleRevenue.setDiffPriceList(DiffPriceList);
166
+        }
167
+
168
+        return saleRevenue;
89 169
     }
90 170
 
91 171
     @Override
92
-    public FsSaleRevenue queryEntity(Integer id) {
93
-        FsSaleRevenue fsSaleRevenue = this.getById(id);
94
-        if(ObjectUtil.isEmpty(fsSaleRevenue)) {
95
-            throw new CommonException("销售收入上缴不存在,id值为:{}", id);
172
+    public List<DataCPZ> getOutStorageDetailed(String contractNumber) {
173
+        return saleRevenueMapper.getOutStorageDetailed(contractNumber);
174
+    }
175
+
176
+    // 修改子表-质检损益信息
177
+    private void inspectionLossUpdate(List<FsSaleRevenueInspectionLoss> inspectionLossList) {
178
+        if (CollectionUtils.isNotEmpty(inspectionLossList)) {
179
+            inspectionLossList.forEach(inspectionLoss -> saleRevenueInspectionLossMapper.updateById(inspectionLoss));
180
+        }
181
+    }
182
+
183
+    // 修改子表-三账一致性-会计账
184
+    private void threeConsistenceAccountUpdate(List<FsSaleRevenueThreeConsistenceAccount> threeConsistenceAccountList) {
185
+        if (CollectionUtils.isNotEmpty(threeConsistenceAccountList)) {
186
+            threeConsistenceAccountList.forEach(threeConsistenceAccount -> threeConsistenceAccountMapper.updateById(threeConsistenceAccount));
187
+        }
188
+    }
189
+
190
+    // 修改子表-三账一致性-实际出库情况
191
+    private void threeConsistenceUpdate(List<FsSaleRevenueThreeConsistence> threeConsistenceList) {
192
+        if (CollectionUtils.isNotEmpty(threeConsistenceList)) {
193
+            threeConsistenceList.forEach(threeConsistence -> threeConsistenceMapper.updateById(threeConsistence));
194
+        }
195
+    }
196
+
197
+    // 修改子表-结算信息
198
+    private void revenueSettleUpdate(List<FsSaleRevenueSettle> revenueSettleList) {
199
+        if (CollectionUtils.isNotEmpty(revenueSettleList)) {
200
+            revenueSettleList.forEach(revenueSettle -> settleMapper.updateById(revenueSettle));
201
+        }
202
+    }
203
+
204
+    // 修改子表-原核定入库价格
205
+    private void approvalPriceUpdate(List<FsSaleRevenueApprovalPrice> approvalPriceList) {
206
+        if (CollectionUtils.isNotEmpty(approvalPriceList)) {
207
+            approvalPriceList.forEach(approvalPrice -> approvalPriceMapper.updateById(approvalPrice));
208
+        }
209
+    }
210
+
211
+    // 修改子表-差价上缴
212
+    private void diffPriceUpdate(List<FsSaleRevenueDiffPrice> DiffPriceList) {
213
+        if (CollectionUtils.isNotEmpty(DiffPriceList)) {
214
+            DiffPriceList.forEach(DiffPrice -> diffPriceMapper.updateById(DiffPrice));
96 215
         }
97
-        return fsSaleRevenue;
98 216
     }
99 217
 }

+ 1 - 1
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsSaleRevenueThreeConsistenceAccount/entity/FsSaleRevenueThreeConsistenceAccount.java

@@ -57,7 +57,7 @@ public class FsSaleRevenueThreeConsistenceAccount {
57 57
 
58 58
     /** 年 */
59 59
     @ApiModelProperty(value = "年", position = 7)
60
-    private Date year;
60
+    private Integer year;
61 61
 
62 62
     /** 月份 */
63 63
     @ApiModelProperty(value = "月份", position = 8)