فهرست منبع

Merge branch 'master' of http://114.55.67.98:8070/Natural_p1/zjugis_OA

songxy 11 ماه پیش
والد
کامیت
2a8b802b28

+ 8 - 8
zjugis-business/src/main/java/com/zjugis/business/flow/travelcost/service/TravelCostServiceImpl.java

@@ -217,22 +217,22 @@ public class TravelCostServiceImpl implements TravelCostService {
         // 更新
         TravelCostDO updateObj = TravelCostConvert.INSTANCE.convert(updateReqVO);
         travelCostDao.updateById(updateObj);
+        Set<String> idList = convertSet(travelCostBoatCarService.getListByTravelCostId(updateObj.getId()), TravelCostBoatCarDO::getId);
+        if (CollectionUtil.isNotEmpty(idList)) {
+            travelCostBoatCarDao.deleteBatchIds(idList);
+        }
         if (CollectionUtil.isNotEmpty(updateReqVO.getBoatCarList())) {
-            Set<String> idList = convertSet(travelCostBoatCarService.getListByTravelCostId(updateObj.getId()), TravelCostBoatCarDO::getId);
-            if (CollectionUtil.isNotEmpty(idList)) {
-                travelCostBoatCarDao.deleteBatchIds(idList);
-            }
             List<TravelCostBoatCarDO> boatCarList = updateReqVO.getBoatCarList();
             boatCarList.forEach(boatCarDO -> {
                 boatCarDO.setTravelCostId(updateObj.getId());
             });
             travelCostBoatCarDao.insertBatch(boatCarList);
         }
+        Set<String> otherIdList = convertSet(travelCostOtherService.getListByTravelCostId(updateObj.getId()), TravelCostOtherDO::getId);
+        if (CollectionUtil.isNotEmpty(otherIdList)) {
+            travelCostOtherDao.deleteBatchIds(otherIdList);
+        }
         if (CollectionUtil.isNotEmpty(updateReqVO.getOtherList())) {
-            Set<String> idList = convertSet(travelCostOtherService.getListByTravelCostId(updateObj.getId()), TravelCostOtherDO::getId);
-            if (CollectionUtil.isNotEmpty(idList)) {
-                travelCostOtherDao.deleteBatchIds(idList);
-            }
             List<TravelCostOtherDO> otherList = updateReqVO.getOtherList();
             otherList.forEach(otherDO -> {
                 otherDO.setTravelCostId(updateObj.getId());