Selaa lähdekoodia

配车出现store.getLockFlag()为空的情况,增加一次赋值操作

Zhangqy 2 kuukautta sitten
vanhempi
commit
e753f2d37a

+ 5
- 1
src/main/java/com/th/demo/service/impl/ware/DistributionServiceImpl.java Näytä tiedosto

108
         Distribution distribution1 = distributionMapper.selectByTruckNo(distribution.getTruckNo(), belongId);
108
         Distribution distribution1 = distributionMapper.selectByTruckNo(distribution.getTruckNo(), belongId);
109
         for (int i = 0; i < list.size(); i++) {
109
         for (int i = 0; i < list.size(); i++) {
110
             Store store = storeMapper.selectByPrimaryKey(list.get(i).getId());
110
             Store store = storeMapper.selectByPrimaryKey(list.get(i).getId());
111
-            if (!store.getLockFlag().equals("1") && distribution1.getId()!= null && !distribution1.getId().equals("")){
111
+            // 存在赋值为空的情况,追加一次赋值
112
+            if (store.getLockFlag() == null || store.getLockFlag() == ""){
113
+                store.setLockFlag("0");
114
+            }
115
+            if (!store.getLockFlag().equals("1") && distribution1.getId() != null && distribution1.getId() != ""){
112
                 list.get(i).setLockFlag("1");
116
                 list.get(i).setLockFlag("1");
113
                 num += storeMapper.updateByPrimaryKey(list.get(i));
117
                 num += storeMapper.updateByPrimaryKey(list.get(i));
114
                 DistributionDetail detail = getDistributionDetail(distribution1, list.get(i), userId, belongId);
118
                 DistributionDetail detail = getDistributionDetail(distribution1, list.get(i), userId, belongId);

Loading…
Peruuta
Tallenna