Bläddra i källkod

利息字段增加

ZeroLiYi 3 månader sedan
förälder
incheckning
06c0797d2b

+ 26 - 18
unis-plugin/unis-plugin-biz/src/main/java/com/unis/emergencySupport/modular/es/controller/EsNetworkEntryController.java

@@ -151,25 +151,33 @@ public class EsNetworkEntryController {
151 151
     })
152 152
     @PostMapping(value= "/emergencySupport/esNetworkEntry/importByEntity", headers= "content-type= multipart/form-data", consumes= "multipart/*")
153 153
     public Map<String,Object> importByEntity(@RequestParam(value= "file", required = true) MultipartFile file) throws Exception {
154
-
155
-        Map<String,Object> map = new HashMap<String,Object>();
156
-        if(file== null){
157
-            map.put("massage","无文件数据");
158
-            map.put("status","500");
159
-            return map;
160
-        }
161
-        //获得文件名
162
-        String fileName = file.getOriginalFilename();
163
-        //判断文件是否是excel文件
164
-        if (!fileName.endsWith("xls") && !fileName.endsWith("xlsx")) {
165
-            map.put("massage","请使用正确的导入模板");
166
-            map.put("status","500");
154
+        Map<String, Object> map = new HashMap<>();
155
+
156
+        try {
157
+            // Check if file is null
158
+            if (file == null) {
159
+                map.put("message", "无文件数据"); // Note: corrected the typo from "massage" to "message"
160
+                map.put("status", "500");
161
+                return map;
162
+            }
163
+
164
+            // Get the file name
165
+            String fileName = file.getOriginalFilename();
166
+
167
+            // Check if the file is an Excel file
168
+            if (fileName == null || (!fileName.endsWith("xls") && !fileName.endsWith("xlsx"))) {
169
+                map.put("message", "请使用正确的导入模板"); // Note: corrected the typo from "massage" to "message"
170
+                map.put("status", "500");
171
+                return map;
172
+            }
173
+
174
+            // Process the file using the service
175
+            return esNetworkEntryService.importByEntityResult(file, map);
176
+        } catch (Exception e) {
177
+            // Handle exceptions
178
+            map.put("message", "文件处理失败: " + e.getMessage());
179
+            map.put("status", "500");
167 180
             return map;
168 181
         }
169
-
170
-        return esNetworkEntryService.importByEntityResult(file,map);
171
-
172 182
     }
173
-
174
-
175 183
 }

+ 9 - 7
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsinterestmaintain/mapper/mapping/BusinessFsInterestMaintainMapper.xml

@@ -5,14 +5,16 @@
5 5
     <select id="finfByYear"
6 6
             resultType="com.unis.financialSupervision.modular.fsinterestsubsidysettle.entity.FsInterestSubsidySettle">
7 7
         SELECT
8
-            org_id,
9
-            year,
10
-            SUM(actual_interest_received) actual_interest_received,
11
-            SUM(other_deduction) other_deduction
8
+            bfm.org_id,
9
+            bfm.year,
10
+            SUM(bfm.actual_interest_received) actual_interest_received,
11
+            SUM(bfm.other_deduction) other_deduction,
12
+            oi.org_name orgName
12 13
         FROM
13
-            business_fs_interest_maintain
14
-        where year=#{planYear}
15
-        GROUP BY org_id
14
+            business_fs_interest_maintain bfm
15
+        left join org_info oi on bfm.org_id =oi.org_id
16
+        where bfm.year=#{planYear}
17
+        GROUP BY bfm.org_id
16 18
 
17 19
     </select>
18 20
 </mapper>

+ 2 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsinterestsubsidysettle/entity/FsInterestSubsidySettle.java

@@ -78,5 +78,7 @@ public class FsInterestSubsidySettle {
78 78
     /** 备注 */
79 79
     @ApiModelProperty(value = "备注", position = 11)
80 80
     private String remark;
81
+    @TableField(exist = false)
82
+    private String orgName;
81 83
 
82 84
 }

+ 4 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsinterestsubsidysettle/mapper/FsInterestSubsidySettleMapper.java

@@ -14,6 +14,9 @@ package com.unis.financialSupervision.modular.fsinterestsubsidysettle.mapper;
14 14
 
15 15
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
16 16
 import com.unis.financialSupervision.modular.fsinterestsubsidysettle.entity.FsInterestSubsidySettle;
17
+import org.apache.ibatis.annotations.Param;
18
+
19
+import java.util.List;
17 20
 
18 21
 /**
19 22
  * 财务监管-省级储备粮清算管理-利息补贴清算表Mapper接口
@@ -22,4 +25,5 @@ import com.unis.financialSupervision.modular.fsinterestsubsidysettle.entity.FsIn
22 25
  * @date  2024/06/28 17:51
23 26
  **/
24 27
 public interface FsInterestSubsidySettleMapper extends BaseMapper<FsInterestSubsidySettle> {
28
+    List<FsInterestSubsidySettle> selectBylist(@Param("planYear") Integer planYear);
25 29
 }

+ 10 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsinterestsubsidysettle/mapper/mapping/FsInterestSubsidySettleMapper.xml

@@ -2,4 +2,14 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.unis.financialSupervision.modular.fsinterestsubsidysettle.mapper.FsInterestSubsidySettleMapper">
4 4
 
5
+    <select id="selectBylist"
6
+            resultType="com.unis.financialSupervision.modular.fsinterestsubsidysettle.entity.FsInterestSubsidySettle">
7
+        SELECT
8
+            fss.*,
9
+            oi.org_name orgName
10
+        FROM
11
+            biz_fs_interest_subsidy_settle fss
12
+                LEFT JOIN depot_qh.org_info oi ON oi.org_id = fss.org_id
13
+        WHERE fss.`year`=#{planYear}
14
+    </select>
5 15
 </mapper>

+ 5 - 12
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsinterestsubsidysettle/service/impl/FsInterestSubsidySettleServiceImpl.java

@@ -48,23 +48,16 @@ import java.util.List;
48 48
 @Service
49 49
 public class FsInterestSubsidySettleServiceImpl extends ServiceImpl<FsInterestSubsidySettleMapper, FsInterestSubsidySettle> implements FsInterestSubsidySettleService {
50 50
     @Resource
51
+    private FsInterestSubsidySettleMapper fsInterestSubsidySettleMapper;
52
+
53
+    @Resource
51 54
     private BusinessFsInterestMaintainService businessFsInterestMaintainService;
52 55
 
53 56
     @Override
54 57
     public List<FsInterestSubsidySettle> page(FsInterestSubsidySettlePageParam fsInterestSubsidySettlePageParam) {
55 58
         List<FsInterestSubsidySettle> fsInterestSubsidySettleList =new ArrayList<>();
56
-        QueryWrapper<FsInterestSubsidySettle> queryWrapper = new QueryWrapper<>();
57
-        if(ObjectUtil.isNotEmpty(fsInterestSubsidySettlePageParam.getPlanYear())) {
58
-            queryWrapper.lambda().eq(FsInterestSubsidySettle::getYear, fsInterestSubsidySettlePageParam.getPlanYear());
59
-        }
60
-        if(ObjectUtil.isAllNotEmpty(fsInterestSubsidySettlePageParam.getSortField(), fsInterestSubsidySettlePageParam.getSortOrder())) {
61
-            CommonSortOrderEnum.validate(fsInterestSubsidySettlePageParam.getSortOrder());
62
-            queryWrapper.orderBy(true, fsInterestSubsidySettlePageParam.getSortOrder().equals(CommonSortOrderEnum.ASC.getValue()),
63
-                    StrUtil.toUnderlineCase(fsInterestSubsidySettlePageParam.getSortField()));
64
-        } else {
65
-            queryWrapper.lambda().orderByAsc(FsInterestSubsidySettle::getId);
66
-        }
67
-        fsInterestSubsidySettleList = this.list(queryWrapper);
59
+
60
+        fsInterestSubsidySettleList = fsInterestSubsidySettleMapper.selectBylist(fsInterestSubsidySettlePageParam.getPlanYear());
68 61
         if(fsInterestSubsidySettleList.isEmpty()){
69 62
             fsInterestSubsidySettleList=   businessFsInterestMaintainService.finfByYear(fsInterestSubsidySettlePageParam.getPlanYear());
70 63
         }