Forráskód Böngészése

修改核销逻辑

QuYueTing 2 hete
szülő
commit
86904163e6

+ 6 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/MealApplicationsServiceImpl.java

@@ -103,7 +103,7 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
         if (mealApplications == null) {
             msg.setError("预定码不存在,无法核销");
             return msg;
-        } else if (mealApplications.getFactoryId().equals(factoryItem.getId())) {
+        } else if (!mealApplications.getFactoryId().equals(factoryItem.getId())) {
             msg.setError("预定码不属于当前厂区,无法核销");
             return msg;
         } else if (!mealApplications.getStatus().equals(0)) {
@@ -122,6 +122,11 @@ public class MealApplicationsServiceImpl extends ServiceImpl<MealApplicationsMap
             mealApplications.setUsedAt(LocalDateTime.now());
             mealApplications.setStatus(1);
             mealApplicationsMapper.updateById(mealApplications);
+            String userId = mealApplications.getUserId();
+            String userName = userMapper.selectById(userId).getName();
+            String mealTypeName = mealTypesMapper.selectById(mealApplications.getMealTypeId()).getName();
+            String content = "已核销"+userName+"预定的"+mealTypeName;
+            msg.setMsg(content);
             return msg;
         }
 

BIN
fhKeeper/formulahousekeeper/management-workshop/workshop_print.2025-11-12.log.gz