youercehsi功能上传

This commit is contained in:
lizhenhua 2025-11-13 22:54:09 +08:00
parent 92fae50ff9
commit ac5bde4d3c
6 changed files with 98 additions and 17 deletions

View File

@ -41,6 +41,7 @@ import com.bonus.common.core.utils.StringUtils;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.houqin.constant.DelFlagEnum;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.system.api.RemoteFileService;
import org.codehaus.groovy.tools.StringHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -80,6 +81,9 @@ public class CookDishesServiceImpl implements ICookDishesService {
)
private AsyncTaskExecutor asyncTaskExecutor;
@Autowired
private RemoteFileService remoteFileService;
/**
* 查询菜品信息
*
@ -107,7 +111,7 @@ public class CookDishesServiceImpl implements ICookDishesService {
String imageUrl = dish.getImageUrl();
if (imageUrl != null && !imageUrl.isEmpty()) {
try {
dish.setImageUrl(FileCommonUtils.getFullFileUrl(imageUrl));
dish.setImageUrl( remoteFileService.getFullFileUrl(FileCommonUtils.getFullFileUrl(imageUrl)));
} catch (Exception e) {
// 可以记录日志确保异常不会影响分页
log.warn("处理菜品图片URL失败: {}", imageUrl, e);

View File

@ -12,6 +12,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -34,11 +35,13 @@ import com.bonus.canteen.core.ims.vo.SupplierPageVO;
import com.bonus.canteen.core.ims.vo.SupplierQualificationDetailPageVO;
import com.bonus.canteen.core.ims.vo.SupplyStatisticsPageVO;
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo;
import com.bonus.canteen.core.kitchen.utils.FileCommonUtils;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.common.houqin.constant.DelFlagEnum;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.system.api.RemoteFileService;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -68,6 +71,9 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier>
@Autowired
private ISupplierBindMaterialService supplierBindMaterialService;
@Autowired
private RemoteFileService remoteFileService;
/**
* 查询供应商信息
@ -96,6 +102,21 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier>
while(var4.hasNext()) {
SupplierPageVO item = (SupplierPageVO)var4.next();
//身份证 正反图片 idCardImgZ idCardImgF 两个字段需要调用下面
String idCardImgZ = item.getIdCardImgZ();
if (StrUtil.isNotBlank(idCardImgZ)) { // 非空判断避免空值处理异常
String fullIdCardImgZ = remoteFileService.getFullFileUrl(
FileCommonUtils.getFullFileUrl(idCardImgZ)
);
item.setIdCardImgZ(fullIdCardImgZ); // 回写完整URL到VO返回给前端
}
String idCardImgF = item.getIdCardImgF();
if (StrUtil.isNotBlank(idCardImgF)) { // 非空判断避免空值处理异常
String fullIdCardImgF = remoteFileService.getFullFileUrl(
FileCommonUtils.getFullFileUrl(idCardImgF)
);
item.setIdCardImgF(fullIdCardImgF); // 回写完整URL到VO返回给前端
}
List<CategoryModel> categoryList = supplierCategoryService.selectNameBySupplier(item.getSupplierId());
if (CollUtil.isNotEmpty(categoryList)) {
categoryList = (List)categoryList.stream().filter((a) -> {
@ -111,6 +132,14 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier>
List<SupplierQualification> otherQualificationList = this.supplierQualificationService.selectSupplierQualificationList(supplierQualification);
List<SupplierQualificationDetailPageVO> voList1 = new ArrayList<>();
for (SupplierQualification qualification : qualificationList) {
String originalImgUrl = qualification.getImgUrl();
if (StrUtil.isNotBlank(originalImgUrl)) { // 非空判断避免空值异常
// 同样经过两层URL拼接获取完整可访问地址
String fullImgUrl = remoteFileService.getFullFileUrl(
FileCommonUtils.getFullFileUrl(originalImgUrl)
);
qualification.setImgUrl(fullImgUrl); // 回写完整URL返回给前端
}
SupplierQualificationDetailPageVO vo = new SupplierQualificationDetailPageVO();
BeanUtil.copyProperties(qualification, vo); // 复制同名属性
String expirationDate = qualification.getExpirationDate();
@ -122,6 +151,14 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier>
item.setMainQualificationList(voList1);
List<SupplierQualificationDetailPageVO> voList2 = new ArrayList<>();
for (SupplierQualification qualification : otherQualificationList) {
String originalImgUrl = qualification.getImgUrl();
if (StrUtil.isNotBlank(originalImgUrl)) { // 非空判断避免空值异常
// 同样经过两层URL拼接获取完整可访问地址
String fullImgUrl = remoteFileService.getFullFileUrl(
FileCommonUtils.getFullFileUrl(originalImgUrl)
);
qualification.setImgUrl(fullImgUrl); // 回写完整URL返回给前端
}
SupplierQualificationDetailPageVO vo = new SupplierQualificationDetailPageVO();
BeanUtil.copyProperties(qualification, vo); // 复制同名属性
voList2.add(vo);

View File

@ -15,10 +15,12 @@ import com.bonus.canteen.core.kitchen.domain.constants.CommonFlagEnum;
import com.bonus.canteen.core.kitchen.domain.constants.SampleDishesSaveStatusEnum;
import com.bonus.canteen.core.kitchen.domain.constants.SampleDishesSearchType;
import com.bonus.canteen.core.kitchen.dto.KitchenSampleDishesRecordDTO;
import com.bonus.canteen.core.kitchen.utils.FileCommonUtils;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.system.api.RemoteFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.canteen.core.kitchen.mapper.KitchenSampleDishesRecordMapper;
@ -39,6 +41,9 @@ public class KitchenSampleDishesRecordServiceImpl implements IKitchenSampleDishe
@Autowired
private BasicStallMealtimeMapper basicStallMealtimeMapper;
@Autowired
private RemoteFileService remoteFileService;
/**
* 查询留样机留样清单
*
@ -70,6 +75,7 @@ public class KitchenSampleDishesRecordServiceImpl implements IKitchenSampleDishe
.selectKitchenSampleDishesRecordList(kitchenSampleDishesRecord);
if(CollUtil.isNotEmpty(kitchenSampleDishesRecordList)) {
for (KitchenSampleDishesRecord record : kitchenSampleDishesRecordList) {
record.setImageUrl( remoteFileService.getFullFileUrl(FileCommonUtils.getFullFileUrl(record.getImageUrl())));
record.setSaveStatusName(SampleDishesSaveStatusEnum.getDescByKey(record.getSaveStatus()));
String illegalStatusName = "";
if(CommonFlagEnum.NO.getKey().equals(record.getWeightStandard())) {

View File

@ -11,6 +11,7 @@ import java.util.Date;
import java.util.List;
import java.util.Objects;
import com.bonus.canteen.core.cook.domain.CookDishes;
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo;
import com.bonus.canteen.core.kitchen.domain.KitchenWasteDeal;
import com.bonus.canteen.core.kitchen.domain.constants.ViolationEnum;
@ -18,6 +19,7 @@ import com.bonus.canteen.core.kitchen.dto.VideoPhotoDTO;
import com.bonus.canteen.core.kitchen.feign.FileServiceClient;
import com.bonus.canteen.core.kitchen.mapper.KitchenDeviceInfoMapper;
import com.bonus.canteen.core.kitchen.mapper.KitchenWasteDealMapper;
import com.bonus.canteen.core.kitchen.utils.FileCommonUtils;
import com.bonus.canteen.core.kitchen.utils.TimestampUtils;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
@ -25,6 +27,7 @@ import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.houqin.constant.DeviceTypeEnum;
import com.bonus.common.houqin.utils.SM4EncryptUtils;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.system.api.RemoteFileService;
import com.bonus.system.api.domain.SysFile;
import com.jayway.jsonpath.JsonPath;
import org.apache.commons.fileupload.FileItem;
@ -61,6 +64,9 @@ public class KitchenStaffIllegalWarningServiceImpl implements IKitchenStaffIlleg
@Resource
private KitchenWasteDealMapper kitchenWasteDealMapper;
@Autowired
private RemoteFileService remoteFileService;
/**
* 查询厨房员工违规报警
*
@ -82,7 +88,19 @@ public class KitchenStaffIllegalWarningServiceImpl implements IKitchenStaffIlleg
public List<KitchenStaffIllegalWarning> selectKitchenStaffIllegalWarningList(KitchenStaffIllegalWarning kitchenStaffIllegalWarning) {
String encryptedSearchValue = SM4EncryptUtils.sm4Encrypt(kitchenStaffIllegalWarning.getSearchValue());
kitchenStaffIllegalWarning.setEncryptedSearchValue(encryptedSearchValue);
return kitchenStaffIllegalWarningMapper.selectKitchenStaffIllegalWarningList(kitchenStaffIllegalWarning);
List<KitchenStaffIllegalWarning> kitchenStaffIllegalWarnings = kitchenStaffIllegalWarningMapper.selectKitchenStaffIllegalWarningList(kitchenStaffIllegalWarning);
for (KitchenStaffIllegalWarning dish : kitchenStaffIllegalWarnings) {
String imageUrl = dish.getImgUrl();
if (imageUrl != null && !imageUrl.isEmpty()) {
try {
dish.setImgUrl( remoteFileService.getFullFileUrl(FileCommonUtils.getFullFileUrl(imageUrl)));
} catch (Exception e) {
// 可以记录日志确保异常不会影响分页
e.printStackTrace();
}
}
}
return kitchenStaffIllegalWarnings;
}
/**

View File

@ -7,9 +7,11 @@ import java.util.Objects;
import cn.hutool.core.collection.CollUtil;
import com.bonus.canteen.core.common.utils.FileUrlUtil;
import com.bonus.canteen.core.kitchen.domain.constants.WasteDealTypeEnum;
import com.bonus.canteen.core.kitchen.utils.FileCommonUtils;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.system.api.RemoteFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.canteen.core.kitchen.mapper.KitchenWasteDealMapper;
@ -18,7 +20,7 @@ import com.bonus.canteen.core.kitchen.service.IKitchenWasteDealService;
/**
* 厨房废弃物处置Service业务层处理
*
*
* @author xsheng
* @date 2025-06-16
*/
@ -27,9 +29,12 @@ public class KitchenWasteDealServiceImpl implements IKitchenWasteDealService {
@Autowired
private KitchenWasteDealMapper kitchenWasteDealMapper;
@Autowired
private RemoteFileService remoteFileService;
/**
* 查询厨房废弃物处置
*
*
* @param wasteId 厨房废弃物处置主键
* @return 厨房废弃物处置
*/
@ -40,7 +45,7 @@ public class KitchenWasteDealServiceImpl implements IKitchenWasteDealService {
/**
* 查询厨房废弃物处置列表
*
*
* @param kitchenWasteDeal 厨房废弃物处置
* @return 厨房废弃物处置
*/
@ -49,6 +54,7 @@ public class KitchenWasteDealServiceImpl implements IKitchenWasteDealService {
List<KitchenWasteDeal> list = kitchenWasteDealMapper.selectKitchenWasteDealList(kitchenWasteDeal);
if(CollUtil.isNotEmpty(list)) {
for(KitchenWasteDeal wasteDeal : list) {
wasteDeal.setScenePicture( remoteFileService.getFullFileUrl(FileCommonUtils.getFullFileUrl(wasteDeal.getScenePicture())));
wasteDeal.setDealTypeName(WasteDealTypeEnum.getDescByKey(wasteDeal.getDealType()));
if(StringUtils.isNotBlank(wasteDeal.getScenePicture())) {
List<String> scenePictureList = new ArrayList<>();
@ -68,7 +74,7 @@ public class KitchenWasteDealServiceImpl implements IKitchenWasteDealService {
/**
* 新增厨房废弃物处置
*
*
* @param kitchenWasteDeal 厨房废弃物处置
* @return 结果
*/
@ -85,7 +91,7 @@ public class KitchenWasteDealServiceImpl implements IKitchenWasteDealService {
/**
* 修改厨房废弃物处置
*
*
* @param kitchenWasteDeal 厨房废弃物处置
* @return 结果
*/
@ -101,7 +107,7 @@ public class KitchenWasteDealServiceImpl implements IKitchenWasteDealService {
/**
* 批量删除厨房废弃物处置
*
*
* @param wasteIds 需要删除的厨房废弃物处置主键
* @return 结果
*/
@ -112,7 +118,7 @@ public class KitchenWasteDealServiceImpl implements IKitchenWasteDealService {
/**
* 删除厨房废弃物处置信息
*
*
* @param wasteId 厨房废弃物处置主键
* @return 结果
*/

View File

@ -2,8 +2,11 @@ package com.bonus.canteen.core.kitchen.service.impl;
import java.util.Collections;
import java.util.List;
import com.bonus.canteen.core.kitchen.utils.FileCommonUtils;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.system.api.RemoteFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.canteen.core.kitchen.mapper.KitchenWasteMealMapper;
@ -12,7 +15,7 @@ import com.bonus.canteen.core.kitchen.service.IKitchenWasteMealService;
/**
* 厨房餐余浪费Service业务层处理
*
*
* @author xsheng
* @date 2025-06-16
*/
@ -21,9 +24,11 @@ public class KitchenWasteMealServiceImpl implements IKitchenWasteMealService {
@Autowired
private KitchenWasteMealMapper kitchenWasteMealMapper;
@Autowired
private RemoteFileService remoteFileService;
/**
* 查询厨房餐余浪费
*
*
* @param ledgerId 厨房餐余浪费主键
* @return 厨房餐余浪费
*/
@ -34,18 +39,23 @@ public class KitchenWasteMealServiceImpl implements IKitchenWasteMealService {
/**
* 查询厨房餐余浪费列表
*
*
* @param kitchenWasteMeal 厨房餐余浪费
* @return 厨房餐余浪费
*/
@Override
public List<KitchenWasteMeal> selectKitchenWasteMealList(KitchenWasteMeal kitchenWasteMeal) {
return kitchenWasteMealMapper.selectKitchenWasteMealList(kitchenWasteMeal);
List<KitchenWasteMeal> kitchenWasteMeals = kitchenWasteMealMapper.selectKitchenWasteMealList(kitchenWasteMeal);
for (KitchenWasteMeal item : kitchenWasteMeals) {
item.setFileUrl(remoteFileService.getFullFileUrl(
FileCommonUtils.getFullFileUrl(item.getFileUrl())));
}
return kitchenWasteMeals;
}
/**
* 新增厨房餐余浪费
*
*
* @param kitchenWasteMeal 厨房餐余浪费
* @return 结果
*/
@ -62,7 +72,7 @@ public class KitchenWasteMealServiceImpl implements IKitchenWasteMealService {
/**
* 修改厨房餐余浪费
*
*
* @param kitchenWasteMeal 厨房餐余浪费
* @return 结果
*/
@ -78,7 +88,7 @@ public class KitchenWasteMealServiceImpl implements IKitchenWasteMealService {
/**
* 批量删除厨房餐余浪费
*
*
* @param ledgerIds 需要删除的厨房餐余浪费主键
* @return 结果
*/
@ -89,7 +99,7 @@ public class KitchenWasteMealServiceImpl implements IKitchenWasteMealService {
/**
* 删除厨房餐余浪费信息
*
*
* @param ledgerId 厨房餐余浪费主键
* @return 结果
*/