陪餐管理,采样管理,餐余垃圾处理,小程序图片适配
This commit is contained in:
@@ -34,6 +34,7 @@ public class AccompanyMealServiceImpl extends ServiceImpl<AccompanyMealMapper, A
|
||||
list.forEach(item -> {
|
||||
String imageStr = item.getAccompanyImageStr();
|
||||
item.setAccompanyImage(ArrayStringUtils.stringToArray(imageStr));
|
||||
item.setWxAccompanyImage(ArrayStringUtils.arrayToWxImgList(item.getAccompanyImage()));
|
||||
});
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -38,6 +38,7 @@ public class FoodSampleServiceImpl extends ServiceImpl<FoodSampleMapper, FoodSam
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(item -> {
|
||||
item.setSaveImg(ArrayStringUtils.stringToArray(item.getSaveImgStr()));
|
||||
item.setWxSaveImage(ArrayStringUtils.arrayToWxImgList(item.getSaveImg()));
|
||||
// FoodBookVO foodBookVO = this.getFoodBookVOById(item.getBookId());
|
||||
// if(foodBookVO != null){
|
||||
// item.setDishNames(foodBookVO.getDishNames());
|
||||
|
||||
@@ -39,6 +39,7 @@ public class RubbishDealServiceImpl extends ServiceImpl<RubbishDealMapper, Rubbi
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(item ->{
|
||||
item.setDealImg(ArrayStringUtils.stringToArray(item.getDealImgStr()));
|
||||
item.setWxDealImage(ArrayStringUtils.arrayToWxImgList(item.getDealImg()));
|
||||
});
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -6,6 +6,10 @@ package com.zf.foodpurchase.fdsafe.utils;
|
||||
*/
|
||||
|
||||
import com.zf.foodpurchase.common.utils.StringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 照片转换处理工具类
|
||||
@@ -38,4 +42,33 @@ public class ArrayStringUtils {
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序组件图片转url字符串数组
|
||||
* @param wxImgList
|
||||
* @return
|
||||
*/
|
||||
public static String[] wxImgToArray(List<WxImg> wxImgList) {
|
||||
if(wxImgList == null || wxImgList.isEmpty()){
|
||||
return new String[0];
|
||||
}
|
||||
String[] strArray = new String[wxImgList.size()];
|
||||
for (int i = 0; i < wxImgList.size(); i++) {
|
||||
strArray[i] = wxImgList.get(i).getUrl();
|
||||
}
|
||||
return strArray;
|
||||
}
|
||||
|
||||
public static List<WxImg> arrayToWxImgList(String[] strArray){
|
||||
if(strArray == null || strArray.length == 0){
|
||||
return null;
|
||||
}
|
||||
List<WxImg> wxImgList = new ArrayList<>();
|
||||
for (int i = 0; i < strArray.length; i++) {
|
||||
WxImg wxImg = new WxImg();
|
||||
wxImg.setUrl(strArray[i]);
|
||||
wxImgList.add(wxImg);
|
||||
}
|
||||
return wxImgList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:lilj
|
||||
@@ -112,4 +113,8 @@ public class AccompanyMealVO extends CommonVO implements Serializable {
|
||||
*/
|
||||
private Date accompanyTime;
|
||||
|
||||
/**
|
||||
* 微信小程序图片上传组件
|
||||
*/
|
||||
private List<WxImg> wxAccompanyImage;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:lilj
|
||||
@@ -71,6 +72,7 @@ public class FoodSampleVO extends CommonVO implements Serializable {
|
||||
@NotEmpty(message = "留样照片不能为空", groups = {UpdateGroup.class, AddGroup.class})
|
||||
private String[] saveImg;
|
||||
private String saveImgStr;
|
||||
private List<WxImg> wxSaveImage;
|
||||
|
||||
/**
|
||||
* 目测状态:0 异常 1 良好
|
||||
|
||||
@@ -13,6 +13,7 @@ import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:lilj
|
||||
@@ -75,6 +76,7 @@ public class RubbishDealVO extends CommonVO implements Serializable {
|
||||
*/
|
||||
private String[] dealImg;
|
||||
private String dealImgStr;
|
||||
private List<WxImg> wxDealImage;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.zf.foodpurchase.fdsafe.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author:lilj
|
||||
* @date:2025/6/23
|
||||
*/
|
||||
@Data
|
||||
public class WxImg {
|
||||
private String url;
|
||||
}
|
||||
Reference in New Issue
Block a user