Przeglądaj źródła

同步优化和小额奖励审批单模版bug修复

wangxx 1 tydzień temu
rodzic
commit
1bc0e93fd9

+ 1 - 1
airport-admin/src/main/java/com/sundot/airport/web/controller/ledger/LedgerTemplateController.java

@@ -128,7 +128,7 @@ public class LedgerTemplateController extends BaseController {
128
 
128
 
129
         // 12. 小额奖励审批单(1行表头)
129
         // 12. 小额奖励审批单(1行表头)
130
         nm.put("rewardApproval", "小额奖励审批单-安检-质控");
130
         nm.put("rewardApproval", "小额奖励审批单-安检-质控");
131
-        hm.put("rewardApproval", 1);
131
+        hm.put("rewardApproval", 2);
132
         cm.put("rewardApproval", new String[]{
132
         cm.put("rewardApproval", new String[]{
133
             "姓名","查获(事件)时间","奖励类别","查获物品","人员类别","主要事由简述","处置结果","证明材料"
133
             "姓名","查获(事件)时间","奖励类别","查获物品","人员类别","主要事由简述","处置结果","证明材料"
134
         });
134
         });

+ 8 - 2
airport-ledger/src/main/java/com/sundot/airport/ledger/service/impl/LedgerSyncServiceImpl.java

@@ -18,6 +18,7 @@ import com.sundot.airport.system.mapper.SysUserMapper;
18
 import com.sundot.airport.system.service.IBasePositionService;
18
 import com.sundot.airport.system.service.IBasePositionService;
19
 import org.springframework.beans.factory.annotation.Autowired;
19
 import org.springframework.beans.factory.annotation.Autowired;
20
 import org.springframework.stereotype.Service;
20
 import org.springframework.stereotype.Service;
21
+import org.springframework.transaction.annotation.Propagation;
21
 import org.springframework.transaction.annotation.Transactional;
22
 import org.springframework.transaction.annotation.Transactional;
22
 import org.springframework.util.StringUtils;
23
 import org.springframework.util.StringUtils;
23
 
24
 
@@ -66,6 +67,7 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
66
     @Autowired private ScoreIndicatorMapper indicatorMapper;
67
     @Autowired private ScoreIndicatorMapper indicatorMapper;
67
     @Autowired private SysDeptMapper sysDeptMapper;
68
     @Autowired private SysDeptMapper sysDeptMapper;
68
     @Autowired private SysUserMapper sysUserMapper;
69
     @Autowired private SysUserMapper sysUserMapper;
70
+    @Autowired private LedgerSyncServiceImpl self;
69
     @Autowired private IBasePositionService basePositionService;
71
     @Autowired private IBasePositionService basePositionService;
70
 
72
 
71
     // ── Dimension ID cache (loaded once) ─────────────────────
73
     // ── Dimension ID cache (loaded once) ─────────────────────
@@ -140,7 +142,7 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
140
                     "supervision_problem", "realtime_interception", "security_test",
142
                     "supervision_problem", "realtime_interception", "security_test",
141
                     "unsafe_event", "seizure_stats", "reward_approval",
143
                     "unsafe_event", "seizure_stats", "reward_approval",
142
                     "service_patrol", "complaint", "terminal_bonus", "exam_score")) {
144
                     "service_patrol", "complaint", "terminal_bonus", "exam_score")) {
143
-                SyncResult r = doSync(type);
145
+                SyncResult r = self.doSyncInNestedTransaction(type);
144
                 sb.append(type).append(":+").append(r.getTotalInserted())
146
                 sb.append(type).append(":+").append(r.getTotalInserted())
145
                   .append("/skip").append(r.getTotalSkipped()).append("  ");
147
                   .append("/skip").append(r.getTotalSkipped()).append("  ");
146
                 totalIns += r.getTotalInserted();
148
                 totalIns += r.getTotalInserted();
@@ -148,7 +150,6 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
148
             }
150
             }
149
             return new SyncResult(totalIns, totalSkip, sb.toString());
151
             return new SyncResult(totalIns, totalSkip, sb.toString());
150
         } finally {
152
         } finally {
151
-            // 同步完成后清除缓存
152
             clearCaches();
153
             clearCaches();
153
         }
154
         }
154
     }
155
     }
@@ -168,6 +169,11 @@ public class LedgerSyncServiceImpl implements ILedgerSyncService {
168
         }
169
         }
169
     }
170
     }
170
 
171
 
172
+    @Transactional(propagation = Propagation.NESTED, rollbackFor = Exception.class)
173
+    public SyncResult doSyncInNestedTransaction(String type) {
174
+        return doSync(type);
175
+    }
176
+
171
     // ═════════════════════════════════════════════════════════
177
     // ═════════════════════════════════════════════════════════
172
     //  Router
178
     //  Router
173
     // ═════════════════════════════════════════════════════════
179
     // ═════════════════════════════════════════════════════════