ZeroLiYi 4 months ago
parent
commit
3863a6ab16

+ 3 - 2
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsinterestsubsidysettle/controller/FsInterestSubsidySettleController.java

@@ -76,8 +76,9 @@ public class FsInterestSubsidySettleController {
76 76
     @ApiOperation("添加财务监管-省级储备粮清算管理-利息补贴清算表")
77 77
     @CommonLog("添加财务监管-省级储备粮清算管理-利息补贴清算表")
78 78
     @PostMapping("/financialSupervision/fsinterestsubsidysettle/add")
79
-    public CommonResult<String> add(@RequestBody @Valid FsInterestSubsidySettleAddParam fsInterestSubsidySettleAddParam) {
80
-        fsInterestSubsidySettleService.add(fsInterestSubsidySettleAddParam);
79
+    public CommonResult<String> add(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
80
+                                                CommonValidList<FsInterestSubsidySettleAddParam> fsInterestSubsidySettleAddParamList) {
81
+        fsInterestSubsidySettleService.add(fsInterestSubsidySettleAddParamList);
81 82
         return CommonResult.ok();
82 83
     }
83 84
 

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

@@ -31,6 +31,8 @@ import java.util.Date;
31 31
 @Setter
32 32
 public class FsInterestSubsidySettleAddParam {
33 33
 
34
+    private String id;
35
+
34 36
     /** 库区;外库depot_qh.org_info的id; */
35 37
     @ApiModelProperty(value = "库区;外库depot_qh.org_info的id;", position = 6)
36 38
     private Integer orgId;

+ 1 - 1
unis-plugin/unis-plugin-biz/src/main/java/com/unis/financialSupervision/modular/fsinterestsubsidysettle/service/FsInterestSubsidySettleService.java

@@ -44,7 +44,7 @@ public interface FsInterestSubsidySettleService extends IService<FsInterestSubsi
44 44
      * @author ZeroLiYi
45 45
      * @date  2024/06/28 17:51
46 46
      */
47
-    void add(FsInterestSubsidySettleAddParam fsInterestSubsidySettleAddParam);
47
+    void add(List<FsInterestSubsidySettleAddParam> fsInterestSubsidySettleAddParamList);
48 48
 
49 49
     /**
50 50
      * 编辑财务监管-省级储备粮清算管理-利息补贴清算表

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

@@ -68,9 +68,19 @@ public class FsInterestSubsidySettleServiceImpl extends ServiceImpl<FsInterestSu
68 68
 
69 69
     @Transactional(rollbackFor = Exception.class)
70 70
     @Override
71
-    public void add(FsInterestSubsidySettleAddParam fsInterestSubsidySettleAddParam) {
72
-        FsInterestSubsidySettle fsInterestSubsidySettle = BeanUtil.toBean(fsInterestSubsidySettleAddParam, FsInterestSubsidySettle.class);
73
-        this.save(fsInterestSubsidySettle);
71
+    public void add(List<FsInterestSubsidySettleAddParam> fsInterestSubsidySettleAddParamList) {
72
+        FsInterestSubsidySettle fsInterestSubsidySettle=new FsInterestSubsidySettle();
73
+        for (FsInterestSubsidySettleAddParam fsInterestSubsidySettleAddParam:fsInterestSubsidySettleAddParamList) {
74
+            if(fsInterestSubsidySettleAddParam.getId()!=null){
75
+                 fsInterestSubsidySettle = BeanUtil.toBean(fsInterestSubsidySettleAddParam, FsInterestSubsidySettle.class);
76
+                this.updateById(fsInterestSubsidySettle);
77
+            }else{
78
+                fsInterestSubsidySettle = BeanUtil.toBean(fsInterestSubsidySettleAddParam, FsInterestSubsidySettle.class);
79
+                this.save(fsInterestSubsidySettle);
80
+            }
81
+
82
+        }
83
+      
74 84
     }
75 85
 
76 86
     @Transactional(rollbackFor = Exception.class)