1.add auto-clean
This commit is contained in:
2025-11-05 15:14:21 +08:00
parent 7e339c9dcb
commit bcd2e63d1a
3 changed files with 39 additions and 0 deletions

View File

@@ -155,4 +155,24 @@ public class KioskApiController {
List<PriceListApiVO> list = kioskApiService.priceList(id); List<PriceListApiVO> list = kioskApiService.priceList(id);
return R.data(list); return R.data(list);
} }
/**
* 自动清理时限查询
*
* @return Integer
*/
@GetMapping("/auto-clean-seconds")
@Operation(summary = "价格查询")
public R<Integer> autoCleanSeconds() {
return R.data(kioskApiService.autoCleanSeconds());
}
/**
* 清理照片
*/
@PostMapping("/clean-photos")
@Operation(summary = "清理照片")
public R cleanPhotos() {
return R.status(kioskApiService.cleanPhotos());
}
} }

View File

@@ -33,4 +33,8 @@ public interface IKioskApiService {
List<PriceListApiVO> priceList(Long id); List<PriceListApiVO> priceList(Long id);
Integer autoCleanSeconds();
boolean cleanPhotos();
} }

View File

@@ -17,6 +17,7 @@ import org.springblade.modules.kiosk.service.*;
import org.springblade.modules.system.pojo.entity.User; import org.springblade.modules.system.pojo.entity.User;
import org.springblade.modules.system.service.IDeptService; import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IDictBizService; import org.springblade.modules.system.service.IDictBizService;
import org.springblade.modules.system.service.IParamService;
import org.springblade.modules.system.service.IUserService; import org.springblade.modules.system.service.IUserService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -45,6 +46,8 @@ public class KioskServiceImpl implements IKioskApiService {
private final IDictBizService dictService; private final IDictBizService dictService;
private final IParamService paramService;
private final ICategoryService categoryService; private final ICategoryService categoryService;
private final IPhotoAttachmentService photoAttachmentService; private final IPhotoAttachmentService photoAttachmentService;
@@ -68,6 +71,8 @@ public class KioskServiceImpl implements IKioskApiService {
private static final String categoryType = "category_type"; private static final String categoryType = "category_type";
private static final String autoCleanKey = "kiosk.default.autoCleanSeconds";
private static final Integer taxPercent = 15; private static final Integer taxPercent = 15;
@Override @Override
@@ -322,4 +327,14 @@ public class KioskServiceImpl implements IKioskApiService {
}).toList(); }).toList();
} }
@Override
public Integer autoCleanSeconds() {
String value = paramService.getValue(autoCleanKey);
return Integer.valueOf(value);
}
@Override
public boolean cleanPhotos() {
return photoAttachmentService.update(Wrappers.<PhotoAttachmentEntity>lambdaUpdate().eq(PhotoAttachmentEntity::getCreateUser, AuthUtil.getUserId()).set(PhotoAttachmentEntity::getStatus, 2));
}
} }