双屏机代码处理优化
This commit is contained in:
parent
b5388e9510
commit
2b0d7169e3
|
|
@ -4,16 +4,16 @@ import cn.hutool.core.util.ObjectUtil;
|
|||
import com.bonus.canteen.core.android.dto.AppDTO;
|
||||
import com.bonus.canteen.core.android.service.DeviceService;
|
||||
import com.bonus.canteen.core.android.vo.CookRecipeCompressVO;
|
||||
import com.bonus.canteen.core.android.vo.DviceTimeIntervalVO;
|
||||
import com.bonus.canteen.core.android.vo.DeviceTimeIntervalVO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.houqin.utils.HeaderFetchUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ import java.util.Map;
|
|||
@RestController
|
||||
@RequestMapping("/api/android/device")
|
||||
public class DeviceController extends BaseController {
|
||||
@Autowired
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ public class DeviceController extends BaseController {
|
|||
|
||||
@PostMapping({"/getMealTimeBySn"})
|
||||
@ApiOperation("根据sn码获餐次信息")
|
||||
public DviceTimeIntervalVO intervalConfig(@RequestHeader Map<String, String> headers) {
|
||||
public DeviceTimeIntervalVO intervalConfig(@RequestHeader Map<String, String> headers) {
|
||||
return this.deviceService.intervalConfig(HeaderFetchUtil.getMachineSn(headers));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@ import com.bonus.common.core.exception.ServiceException;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
|
|
@ -18,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RestController
|
||||
@RequestMapping("/api/android/face")
|
||||
public class FaceController {
|
||||
@Autowired
|
||||
@Resource
|
||||
private FaceService faceService;
|
||||
|
||||
@ApiOperation("获取人脸特征值")
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@ import com.bonus.common.core.exception.ServiceException;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
|
|
@ -18,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RestController
|
||||
@RequestMapping("/api/android/user")
|
||||
public class UserController {
|
||||
@Autowired
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@ApiOperation("获取人员信息")
|
||||
|
|
|
|||
|
|
@ -38,17 +38,59 @@ public interface DeviceMapper {
|
|||
*/
|
||||
List<ParamVO> getParamInfo();
|
||||
|
||||
/**
|
||||
* 根据设备SN获取菜谱菜品信息
|
||||
*
|
||||
* @param machineSn 设备SN
|
||||
* @return 菜谱菜品信息
|
||||
*/
|
||||
Long getRecipeIdBySn(String machineSn);
|
||||
|
||||
/**
|
||||
* 获取设备时间间隔配置
|
||||
*
|
||||
* @param recipeId 菜谱ID
|
||||
* @return 时间间隔配置
|
||||
*/
|
||||
CookRecipe getOneById(Long recipeId);
|
||||
|
||||
/**
|
||||
* 获取菜谱菜品信息
|
||||
*
|
||||
* @param recipeId 菜谱ID
|
||||
* @return 菜谱菜品信息
|
||||
*/
|
||||
List<CookMenuAndroidRecipeDetailVO> selectMenuRecipeDetailLists(Long recipeId);
|
||||
|
||||
/**
|
||||
* 获取菜谱菜品信息
|
||||
*
|
||||
* @param detailIds 菜谱详情ID列表
|
||||
* @return 菜谱菜品信息
|
||||
*/
|
||||
List<CookRecipeDetailCompressVO> selectRecipeDishList(@Param("detailIds") List<Long> detailIds);
|
||||
|
||||
/**
|
||||
* 获取菜谱菜品信息
|
||||
*
|
||||
* @param dishesIds 菜品ID列表
|
||||
* @return 菜谱菜品信息
|
||||
*/
|
||||
List<CookRecipeMealCompressVO> getMenuRecipeListByDishesIds(@Param("dishesIds")List<Long> dishesIds);
|
||||
|
||||
/**
|
||||
* 获取设备时间间隔配置
|
||||
*
|
||||
* @param stallId 档口ID
|
||||
* @return 时间间隔配置
|
||||
*/
|
||||
List<CookMealTimeVO> getMealTimeList(@Param("stallId")Long stallId);
|
||||
|
||||
/**
|
||||
* 获取设备时间间隔配置
|
||||
*
|
||||
* @param stallId 档口ID
|
||||
* @return 时间间隔配置
|
||||
*/
|
||||
List<DeviceMealtimeVO> getBasicsTimeIntervals(@Param("stallId")Long stallId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.bonus.canteen.core.android.service;
|
|||
|
||||
import com.bonus.canteen.core.android.dto.AppDTO;
|
||||
import com.bonus.canteen.core.android.vo.CookRecipeCompressVO;
|
||||
import com.bonus.canteen.core.android.vo.DviceTimeIntervalVO;
|
||||
import com.bonus.canteen.core.android.vo.DeviceTimeIntervalVO;
|
||||
import com.bonus.canteen.core.android.vo.ParamSettingVO;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
||||
|
|
@ -33,7 +33,19 @@ public interface DeviceService {
|
|||
*/
|
||||
ParamSettingVO getParamInfo();
|
||||
|
||||
/**
|
||||
* 根据设备SN获取菜谱菜品信息
|
||||
*
|
||||
* @param machineSn 设备SN
|
||||
* @return 菜谱菜品信息
|
||||
*/
|
||||
CookRecipeCompressVO getMenuInfoBySn(String machineSn);
|
||||
|
||||
DviceTimeIntervalVO intervalConfig(String machineSn);
|
||||
/**
|
||||
* 获取设备时间间隔配置
|
||||
*
|
||||
* @param machineSn 设备SN
|
||||
* @return 时间间隔配置
|
||||
*/
|
||||
DeviceTimeIntervalVO intervalConfig(String machineSn);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,10 +8,12 @@ import com.bonus.canteen.core.android.vo.*;
|
|||
import com.bonus.canteen.core.cook.domain.CookRecipe;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.houqin.constant.GlobalConstants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
|
|
@ -24,9 +26,10 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@Service
|
||||
public class DeviceServiceImpl implements DeviceService {
|
||||
@Autowired
|
||||
@Resource
|
||||
private DeviceMapper mapper;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
|
||||
|
||||
@Value("${face.android.appId}")
|
||||
private String appId;
|
||||
|
|
@ -115,15 +118,22 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
CookRecipe menuRecipe = mapper.getOneById(recipeId);
|
||||
//查询所有的detailsId
|
||||
List<CookMenuAndroidRecipeDetailVO> menuRecipeDetailList = mapper.selectMenuRecipeDetailLists(recipeId);
|
||||
if (ObjectUtil.isEmpty(menuRecipeDetailList)){
|
||||
return issueRecipe;
|
||||
}
|
||||
List<Long> detailIds = menuRecipeDetailList.stream().map(CookMenuAndroidRecipeDetailVO::getDetailId).collect(Collectors.toList());
|
||||
if (ObjectUtil.isEmpty(detailIds)){
|
||||
return issueRecipe;
|
||||
}
|
||||
//查询所有的dishesId
|
||||
List<CookRecipeDetailCompressVO> recipeDishList = mapper.selectRecipeDishList(detailIds);
|
||||
if (ObjectUtil.isEmpty(recipeDishList)){
|
||||
return issueRecipe;
|
||||
}
|
||||
List<Long> dishesIds = recipeDishList.stream().map(CookRecipeDetailCompressVO::getDishesId).collect(Collectors.toList());
|
||||
//查询菜品
|
||||
List<CookRecipeMealCompressVO> menuList = mapper.getMenuRecipeListByDishesIds(dishesIds);
|
||||
//菜品应用日期列表
|
||||
List<LocalDate> applyDateList = menuRecipeDetailList.stream().map(CookMenuAndroidRecipeDetailVO::getApplyData).collect(Collectors.toList());
|
||||
applyDateList = applyDateList.stream().distinct().collect(Collectors.toList());
|
||||
//查询所有的餐次
|
||||
|
|
@ -151,7 +161,7 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
dateCompressVO.setIntervalList(intervalList);
|
||||
dateList.add(dateCompressVO);
|
||||
}
|
||||
System.out.println("menuRecipe = " + menuRecipe);
|
||||
logger.info("menuRecipe : {} ", menuRecipe);
|
||||
|
||||
if(menuRecipe.getRecipeType() !=null){
|
||||
issueRecipe.setRecipeType(Integer.valueOf(menuRecipe.getRecipeType()+""));
|
||||
|
|
@ -172,23 +182,23 @@ public class DeviceServiceImpl implements DeviceService {
|
|||
|
||||
|
||||
@Override
|
||||
public DviceTimeIntervalVO intervalConfig(String machineSn) {
|
||||
DviceTimeIntervalVO dviceTimeIntervalVO = new DviceTimeIntervalVO();
|
||||
dviceTimeIntervalVO.setLevel(2);
|
||||
public DeviceTimeIntervalVO intervalConfig(String machineSn) {
|
||||
DeviceTimeIntervalVO deviceTimeIntervalVO = new DeviceTimeIntervalVO();
|
||||
deviceTimeIntervalVO.setLevel(2);
|
||||
Long recipeId = mapper.getRecipeIdBySn(machineSn);
|
||||
if (recipeId == 0){
|
||||
return new DviceTimeIntervalVO();
|
||||
return new DeviceTimeIntervalVO();
|
||||
}
|
||||
//查询菜谱信息
|
||||
CookRecipe menuRecipe = mapper.getOneById(recipeId);
|
||||
if (menuRecipe == null){
|
||||
return new DviceTimeIntervalVO();
|
||||
return new DeviceTimeIntervalVO();
|
||||
}
|
||||
List<DeviceMealtimeVO> basicsTimeIntervals = mapper.getBasicsTimeIntervals(menuRecipe.getStallId());
|
||||
if (basicsTimeIntervals == null || basicsTimeIntervals.isEmpty()){
|
||||
basicsTimeIntervals = new ArrayList<>();
|
||||
}
|
||||
dviceTimeIntervalVO.setBasicsTimeIntervals(basicsTimeIntervals);
|
||||
return dviceTimeIntervalVO;
|
||||
deviceTimeIntervalVO.setBasicsTimeIntervals(basicsTimeIntervals);
|
||||
return deviceTimeIntervalVO;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import com.bonus.canteen.core.android.mapper.FaceMapper;
|
|||
import com.bonus.canteen.core.android.service.FaceService;
|
||||
import com.bonus.canteen.core.user.domain.UserFace;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ import java.util.List;
|
|||
*/
|
||||
@Service
|
||||
public class FaceServiceImpl implements FaceService {
|
||||
@Autowired
|
||||
@Resource
|
||||
private FaceMapper mapper;
|
||||
@Override
|
||||
public AjaxResult getFaceFeatureList(AppDTO dto) {
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import com.bonus.canteen.core.android.service.UserService;
|
|||
import com.bonus.canteen.core.android.vo.UserInfoVo;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.houqin.utils.SM4EncryptUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -19,7 +19,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@Service
|
||||
public class UserServiceImpl implements UserService {
|
||||
@Autowired
|
||||
@Resource
|
||||
private UserMapper mapper;
|
||||
|
||||
private static final int PHONE_LENGTH = 11;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ package com.bonus.canteen.core.android.vo;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
@Data
|
||||
public class CookMealTimeVO {
|
||||
@ApiModelProperty(value = "餐次类型")
|
||||
|
|
|
|||
|
|
@ -2,11 +2,21 @@ package com.bonus.canteen.core.android.vo;
|
|||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 餐次时段Model
|
||||
*
|
||||
* @author 19814
|
||||
*/
|
||||
|
||||
@ApiModel("餐次时段Model")
|
||||
@ToString
|
||||
@Data
|
||||
public class CookMealtimeModelVO {
|
||||
@ApiModelProperty("餐次id")
|
||||
private Long mealtimeId;
|
||||
|
|
@ -42,153 +52,4 @@ public class CookMealtimeModelVO {
|
|||
@ApiModelProperty("是否启用")
|
||||
private Integer ifUse;
|
||||
|
||||
public Long getMealtimeId() {
|
||||
return this.mealtimeId;
|
||||
}
|
||||
|
||||
public String getMealtimeName() {
|
||||
return this.mealtimeName;
|
||||
}
|
||||
|
||||
public Long getCanteenId() {
|
||||
return this.canteenId;
|
||||
}
|
||||
|
||||
public Long getStallId() {
|
||||
return this.stallId;
|
||||
}
|
||||
|
||||
public Integer getMealtimeType() {
|
||||
return this.mealtimeType;
|
||||
}
|
||||
|
||||
public LocalTime getStartTime() {
|
||||
return this.startTime;
|
||||
}
|
||||
|
||||
public LocalTime getEndTime() {
|
||||
return this.endTime;
|
||||
}
|
||||
|
||||
public LocalTime getReserveStartTime() {
|
||||
return this.reserveStartTime;
|
||||
}
|
||||
|
||||
public LocalTime getReserveEndTime() {
|
||||
return this.reserveEndTime;
|
||||
}
|
||||
|
||||
public LocalTime getReserveRefundDeadline() {
|
||||
return this.reserveRefundDeadline;
|
||||
}
|
||||
|
||||
public LocalTime getReservePrintTime() {
|
||||
return this.reservePrintTime;
|
||||
}
|
||||
|
||||
public LocalTime getCurrStartTime() {
|
||||
return this.currStartTime;
|
||||
}
|
||||
|
||||
public LocalTime getCurrEndTime() {
|
||||
return this.currEndTime;
|
||||
}
|
||||
|
||||
public LocalTime getCurrRefundDeadline() {
|
||||
return this.currRefundDeadline;
|
||||
}
|
||||
|
||||
public LocalTime getBookCurrDeadline() {
|
||||
return this.bookCurrDeadline;
|
||||
}
|
||||
|
||||
public LocalTime getBookRefundDeadline() {
|
||||
return this.bookRefundDeadline;
|
||||
}
|
||||
|
||||
public BigDecimal getBookAmount() {
|
||||
return this.bookAmount;
|
||||
}
|
||||
|
||||
public Integer getIfUse() {
|
||||
return this.ifUse;
|
||||
}
|
||||
|
||||
public void setMealtimeId(final Long mealtimeId) {
|
||||
this.mealtimeId = mealtimeId;
|
||||
}
|
||||
|
||||
public void setMealtimeName(final String mealtimeName) {
|
||||
this.mealtimeName = mealtimeName;
|
||||
}
|
||||
|
||||
public void setCanteenId(final Long canteenId) {
|
||||
this.canteenId = canteenId;
|
||||
}
|
||||
|
||||
public void setStallId(final Long stallId) {
|
||||
this.stallId = stallId;
|
||||
}
|
||||
|
||||
public void setMealtimeType(final Integer mealtimeType) {
|
||||
this.mealtimeType = mealtimeType;
|
||||
}
|
||||
|
||||
public void setStartTime(final LocalTime startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public void setEndTime(final LocalTime endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public void setReserveStartTime(final LocalTime reserveStartTime) {
|
||||
this.reserveStartTime = reserveStartTime;
|
||||
}
|
||||
|
||||
public void setReserveEndTime(final LocalTime reserveEndTime) {
|
||||
this.reserveEndTime = reserveEndTime;
|
||||
}
|
||||
|
||||
public void setReserveRefundDeadline(final LocalTime reserveRefundDeadline) {
|
||||
this.reserveRefundDeadline = reserveRefundDeadline;
|
||||
}
|
||||
|
||||
public void setReservePrintTime(final LocalTime reservePrintTime) {
|
||||
this.reservePrintTime = reservePrintTime;
|
||||
}
|
||||
|
||||
public void setCurrStartTime(final LocalTime currStartTime) {
|
||||
this.currStartTime = currStartTime;
|
||||
}
|
||||
|
||||
public void setCurrEndTime(final LocalTime currEndTime) {
|
||||
this.currEndTime = currEndTime;
|
||||
}
|
||||
|
||||
public void setCurrRefundDeadline(final LocalTime currRefundDeadline) {
|
||||
this.currRefundDeadline = currRefundDeadline;
|
||||
}
|
||||
|
||||
public void setBookCurrDeadline(final LocalTime bookCurrDeadline) {
|
||||
this.bookCurrDeadline = bookCurrDeadline;
|
||||
}
|
||||
|
||||
public void setBookRefundDeadline(final LocalTime bookRefundDeadline) {
|
||||
this.bookRefundDeadline = bookRefundDeadline;
|
||||
}
|
||||
|
||||
public void setBookAmount(final BigDecimal bookAmount) {
|
||||
this.bookAmount = bookAmount;
|
||||
}
|
||||
|
||||
public void setIfUse(final Integer ifUse) {
|
||||
this.ifUse = ifUse;
|
||||
}
|
||||
|
||||
protected boolean canEqual(final Object other) {
|
||||
return other instanceof CookMealtimeModelVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,30 @@
|
|||
package com.bonus.canteen.core.android.vo;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
@Getter
|
||||
public enum CookMealtimeTypeEnum {
|
||||
// 餐次类型
|
||||
MEALTIME_BREAKFAST(1, "早餐"),
|
||||
MEALTIME_LUNCH(2, "午餐"),
|
||||
MEALTIME_AFTERNOON_TEA(3, "下午茶"),
|
||||
MEALTIME_DINNER(4, "晚餐"),
|
||||
MEALTIME_MIDNIGHT_SNACK(5, "夜宵");
|
||||
|
||||
/**
|
||||
* 早餐
|
||||
*/
|
||||
private final Integer key;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String desc;
|
||||
|
||||
private CookMealtimeTypeEnum(Integer key, String desc) {
|
||||
|
|
@ -21,44 +34,35 @@ public enum CookMealtimeTypeEnum {
|
|||
|
||||
public static CookMealtimeTypeEnum getTypeEnum(Integer key) {
|
||||
CookMealtimeTypeEnum[] var1 = values();
|
||||
int var2 = var1.length;
|
||||
|
||||
for(int var3 = 0; var3 < var2; ++var3) {
|
||||
CookMealtimeTypeEnum typeEnum = var1[var3];
|
||||
if (typeEnum.getKey().equals(key)) {
|
||||
return typeEnum;
|
||||
}
|
||||
}
|
||||
for (CookMealtimeTypeEnum typeEnum : var1) {
|
||||
if (typeEnum.getKey().equals(key)) {
|
||||
return typeEnum;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDescByKey(Integer key) {
|
||||
CookMealtimeTypeEnum[] enums = values();
|
||||
CookMealtimeTypeEnum[] var2 = enums;
|
||||
int var3 = enums.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
CookMealtimeTypeEnum anEnum = var2[var4];
|
||||
if (anEnum.getKey().equals(key)) {
|
||||
return anEnum.getDesc();
|
||||
}
|
||||
}
|
||||
for (CookMealtimeTypeEnum anEnum : enums) {
|
||||
if (anEnum.getKey().equals(key)) {
|
||||
return anEnum.getDesc();
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static Integer getKeyByDesc(String desc) {
|
||||
CookMealtimeTypeEnum[] enums = values();
|
||||
CookMealtimeTypeEnum[] var2 = enums;
|
||||
int var3 = enums.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
CookMealtimeTypeEnum anEnum = var2[var4];
|
||||
if (anEnum.getDesc().equals(desc)) {
|
||||
return anEnum.getKey();
|
||||
}
|
||||
}
|
||||
for (CookMealtimeTypeEnum anEnum : enums) {
|
||||
if (anEnum.getDesc().equals(desc)) {
|
||||
return anEnum.getKey();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
@ -67,22 +71,4 @@ public enum CookMealtimeTypeEnum {
|
|||
return ListUtil.toList(new Integer[]{MEALTIME_BREAKFAST.getKey(), MEALTIME_LUNCH.getKey(), MEALTIME_AFTERNOON_TEA.getKey(), MEALTIME_DINNER.getKey(), MEALTIME_MIDNIGHT_SNACK.getKey()});
|
||||
}
|
||||
|
||||
public Integer getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
// $FF: synthetic method
|
||||
private static CookMealtimeTypeEnum[] $values() {
|
||||
return new CookMealtimeTypeEnum[]{MEALTIME_BREAKFAST, MEALTIME_LUNCH, MEALTIME_AFTERNOON_TEA, MEALTIME_DINNER, MEALTIME_MIDNIGHT_SNACK};
|
||||
}
|
||||
//
|
||||
// public static class ExcelConvertor extends LeExcelFieldConvertor<AllocMealtimeTypeEnum> {
|
||||
// public ExcelConvertor() {
|
||||
// super(AllocMealtimeTypeEnum.class);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import lombok.Data;
|
|||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
@Data
|
||||
public class CookMenuAndroidRecipeDetailVO {
|
||||
@ApiModelProperty("菜谱详情id")
|
||||
|
|
|
|||
|
|
@ -7,12 +7,20 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
|||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("下发菜谱")
|
||||
@ToString
|
||||
public class CookRecipeCompressVO implements Serializable {
|
||||
@ApiModelProperty("菜谱id")
|
||||
private Long recipeId;
|
||||
|
|
@ -35,34 +43,6 @@ public class CookRecipeCompressVO implements Serializable {
|
|||
@ApiModelProperty("所有菜品列表")
|
||||
private List<CookRecipeMealCompressVO> mealList;
|
||||
|
||||
public Long getRecipeId() {
|
||||
return this.recipeId;
|
||||
}
|
||||
|
||||
public Integer getRecipeType() {
|
||||
return this.recipeType;
|
||||
}
|
||||
|
||||
public LocalDateTime getUptime() {
|
||||
return this.uptime;
|
||||
}
|
||||
|
||||
public List<CookRecipeDateCompressVO> getDateList() {
|
||||
return this.dateList;
|
||||
}
|
||||
|
||||
public List<CookRecipeMealCompressVO> getMealList() {
|
||||
return this.mealList;
|
||||
}
|
||||
|
||||
public void setRecipeId(final Long recipeId) {
|
||||
this.recipeId = recipeId;
|
||||
}
|
||||
|
||||
public void setRecipeType(final Integer recipeType) {
|
||||
this.recipeType = recipeType;
|
||||
}
|
||||
|
||||
@JsonFormat(
|
||||
pattern = "yyyy-MM-dd HH:mm:ss",
|
||||
timezone = "GMT+8"
|
||||
|
|
@ -74,12 +54,4 @@ public class CookRecipeCompressVO implements Serializable {
|
|||
this.uptime = uptime;
|
||||
}
|
||||
|
||||
public void setDateList(final List<CookRecipeDateCompressVO> dateList) {
|
||||
this.dateList = dateList;
|
||||
}
|
||||
|
||||
public void setMealList(final List<CookRecipeMealCompressVO> mealList) {
|
||||
this.mealList = mealList;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,18 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
|||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel("下发菜谱")
|
||||
public class CookRecipeDateCompressVO implements Serializable {
|
||||
@ApiModelProperty("启用日期")
|
||||
|
|
@ -28,14 +35,6 @@ public class CookRecipeDateCompressVO implements Serializable {
|
|||
@ApiModelProperty("餐次列表")
|
||||
private List<CookRecipeIntervalCompressVO> intervalList;
|
||||
|
||||
public LocalDate getApplyDate() {
|
||||
return this.applyDate;
|
||||
}
|
||||
|
||||
public List<CookRecipeIntervalCompressVO> getIntervalList() {
|
||||
return this.intervalList;
|
||||
}
|
||||
|
||||
@JsonFormat(
|
||||
pattern = "yyyy-MM-dd"
|
||||
)
|
||||
|
|
@ -45,8 +44,4 @@ public class CookRecipeDateCompressVO implements Serializable {
|
|||
public void setApplyDate(final LocalDate applyDate) {
|
||||
this.applyDate = applyDate;
|
||||
}
|
||||
|
||||
public void setIntervalList(final List<CookRecipeIntervalCompressVO> intervalList) {
|
||||
this.intervalList = intervalList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,15 @@ package com.bonus.canteen.core.android.vo;
|
|||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel("下发菜谱详情")
|
||||
public class CookRecipeDetailCompressVO implements Serializable {
|
||||
@ApiModelProperty("菜谱详情id")
|
||||
|
|
@ -21,60 +27,4 @@ public class CookRecipeDetailCompressVO implements Serializable {
|
|||
private Integer surplusNum;
|
||||
@ApiModelProperty("个人限购数量")
|
||||
private Integer restrictNum;
|
||||
|
||||
public Long getDetailId() {
|
||||
return this.detailId;
|
||||
}
|
||||
|
||||
public Long getDishesId() {
|
||||
return this.dishesId;
|
||||
}
|
||||
|
||||
public Integer getPrefPrice() {
|
||||
return this.prefPrice;
|
||||
}
|
||||
|
||||
public Integer getSalePrice() {
|
||||
return this.salePrice;
|
||||
}
|
||||
|
||||
public void setDetailId(final Long detailId) {
|
||||
this.detailId = detailId;
|
||||
}
|
||||
|
||||
public void setDishesId(final Long dishesId) {
|
||||
this.dishesId = dishesId;
|
||||
}
|
||||
|
||||
public void setPrefPrice(final Integer prefPrice) {
|
||||
this.prefPrice = prefPrice;
|
||||
}
|
||||
|
||||
public void setSalePrice(final Integer salePrice) {
|
||||
this.salePrice = salePrice;
|
||||
}
|
||||
|
||||
public Integer getSupplyNum() {
|
||||
return supplyNum;
|
||||
}
|
||||
|
||||
public void setSupplyNum(Integer supplyNum) {
|
||||
this.supplyNum = supplyNum;
|
||||
}
|
||||
|
||||
public Integer getSurplusNum() {
|
||||
return surplusNum;
|
||||
}
|
||||
|
||||
public void setSurplusNum(Integer surplusNum) {
|
||||
this.surplusNum = surplusNum;
|
||||
}
|
||||
|
||||
public Integer getRestrictNum() {
|
||||
return restrictNum;
|
||||
}
|
||||
|
||||
public void setRestrictNum(Integer restrictNum) {
|
||||
this.restrictNum = restrictNum;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,18 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
|
|||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel("下发菜谱详情")
|
||||
public class CookRecipeIntervalCompressVO implements Serializable {
|
||||
@ApiModelProperty("餐次id")
|
||||
|
|
@ -47,30 +54,6 @@ public class CookRecipeIntervalCompressVO implements Serializable {
|
|||
return CookMealtimeTypeEnum.getDescByKey(this.intervalId.intValue());
|
||||
}
|
||||
|
||||
public Long getIntervalId() {
|
||||
return this.intervalId;
|
||||
}
|
||||
|
||||
public LocalTime getStartTime() {
|
||||
return this.startTime;
|
||||
}
|
||||
|
||||
public LocalTime getEndTime() {
|
||||
return this.endTime;
|
||||
}
|
||||
|
||||
public List<CookRecipeDetailCompressVO> getProductList() {
|
||||
return this.productList;
|
||||
}
|
||||
|
||||
public void setIntervalId(final Long intervalId) {
|
||||
this.intervalId = intervalId;
|
||||
}
|
||||
|
||||
public void setIntervalName(final String intervalName) {
|
||||
this.intervalName = intervalName;
|
||||
}
|
||||
|
||||
@JsonFormat(
|
||||
pattern = "HH:mm:ss"
|
||||
)
|
||||
|
|
@ -90,8 +73,4 @@ public class CookRecipeIntervalCompressVO implements Serializable {
|
|||
public void setEndTime(final LocalTime endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public void setProductList(final List<CookRecipeDetailCompressVO> productList) {
|
||||
this.productList = productList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import cn.hutool.core.util.ObjectUtil;
|
|||
import com.bonus.canteen.core.common.utils.FileUrlUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -12,6 +14,11 @@ import java.math.RoundingMode;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel("下发菜谱")
|
||||
public class CookRecipeMealCompressVO implements Serializable {
|
||||
@ApiModelProperty("菜品id")
|
||||
|
|
@ -91,6 +98,9 @@ public class CookRecipeMealCompressVO implements Serializable {
|
|||
@ApiModelProperty("好评率")
|
||||
private BigDecimal goodProbability;
|
||||
|
||||
private String salesMode;
|
||||
|
||||
|
||||
public String getFoodImage() {
|
||||
return FileUrlUtil.getFileUrl(this.foodImage);
|
||||
}
|
||||
|
|
@ -142,256 +152,4 @@ public class CookRecipeMealCompressVO implements Serializable {
|
|||
public BigDecimal getGoodProbability() {
|
||||
return (BigDecimal)Optional.ofNullable(this.goodProbability).orElse(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
public Long getDishesId() {
|
||||
return this.dishesId;
|
||||
}
|
||||
|
||||
public Integer getCustomId() {
|
||||
return this.customId;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return this.productName;
|
||||
}
|
||||
|
||||
public Integer getOriginalPrice() {
|
||||
return this.originalPrice;
|
||||
}
|
||||
|
||||
public Integer getSalseMode() {
|
||||
return this.salseMode;
|
||||
}
|
||||
|
||||
public Long getTypeId() {
|
||||
return this.typeId;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return this.typeName;
|
||||
}
|
||||
|
||||
public String getPinyinInitials() {
|
||||
return this.pinyinInitials;
|
||||
}
|
||||
|
||||
public String getPinyinFull() {
|
||||
return this.pinyinFull;
|
||||
}
|
||||
|
||||
public BigDecimal getPurine() {
|
||||
return this.purine;
|
||||
}
|
||||
|
||||
public BigDecimal getIodine() {
|
||||
return this.iodine;
|
||||
}
|
||||
|
||||
public Integer getInitialScore() {
|
||||
return this.initialScore;
|
||||
}
|
||||
|
||||
public BigDecimal getCalories() {
|
||||
return this.calories;
|
||||
}
|
||||
|
||||
public BigDecimal getProtein() {
|
||||
return this.protein;
|
||||
}
|
||||
|
||||
public BigDecimal getFat() {
|
||||
return this.fat;
|
||||
}
|
||||
|
||||
public BigDecimal getCarbohydrate() {
|
||||
return this.carbohydrate;
|
||||
}
|
||||
|
||||
public BigDecimal getDietaryFiber() {
|
||||
return this.dietaryFiber;
|
||||
}
|
||||
|
||||
public BigDecimal getCholesterol() {
|
||||
return this.cholesterol;
|
||||
}
|
||||
|
||||
public BigDecimal getCalcium() {
|
||||
return this.calcium;
|
||||
}
|
||||
|
||||
public BigDecimal getSodium() {
|
||||
return this.sodium;
|
||||
}
|
||||
|
||||
public String getIntro() {
|
||||
return this.intro;
|
||||
}
|
||||
|
||||
public List<String> getLabelList() {
|
||||
return this.labelList;
|
||||
}
|
||||
|
||||
public List<String> getMainList() {
|
||||
return this.mainList;
|
||||
}
|
||||
|
||||
public List<String> getAuxList() {
|
||||
return this.auxList;
|
||||
}
|
||||
|
||||
public List<String> getDosList() {
|
||||
return this.dosList;
|
||||
}
|
||||
|
||||
public void setDishesId(final Long dishesId) {
|
||||
this.dishesId = dishesId;
|
||||
}
|
||||
|
||||
public void setCustomId(final Integer customId) {
|
||||
this.customId = customId;
|
||||
}
|
||||
|
||||
public void setProductName(final String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public void setOriginalPrice(final Integer originalPrice) {
|
||||
this.originalPrice = originalPrice;
|
||||
}
|
||||
|
||||
public void setSalseMode(final Integer salseMode) {
|
||||
this.salseMode = salseMode;
|
||||
}
|
||||
|
||||
public void setWeightDeviation(final BigDecimal weightDeviation) {
|
||||
this.weightDeviation = weightDeviation;
|
||||
}
|
||||
|
||||
public void setWeight(final BigDecimal weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setTypeId(final Long typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public void setTypeName(final String typeName) {
|
||||
this.typeName = typeName;
|
||||
}
|
||||
|
||||
public void setPinyinInitials(final String pinyinInitials) {
|
||||
this.pinyinInitials = pinyinInitials;
|
||||
}
|
||||
|
||||
public void setPinyinFull(final String pinyinFull) {
|
||||
this.pinyinFull = pinyinFull;
|
||||
}
|
||||
|
||||
public void setPurine(final BigDecimal purine) {
|
||||
this.purine = purine;
|
||||
}
|
||||
|
||||
public void setIodine(final BigDecimal iodine) {
|
||||
this.iodine = iodine;
|
||||
}
|
||||
|
||||
public void setInitialScore(final Integer initialScore) {
|
||||
this.initialScore = initialScore;
|
||||
}
|
||||
|
||||
public void setCalories(final BigDecimal calories) {
|
||||
this.calories = calories;
|
||||
}
|
||||
|
||||
public void setProtein(final BigDecimal protein) {
|
||||
this.protein = protein;
|
||||
}
|
||||
|
||||
public void setFat(final BigDecimal fat) {
|
||||
this.fat = fat;
|
||||
}
|
||||
|
||||
public void setCarbohydrate(final BigDecimal carbohydrate) {
|
||||
this.carbohydrate = carbohydrate;
|
||||
}
|
||||
|
||||
public void setDietaryFiber(final BigDecimal dietaryFiber) {
|
||||
this.dietaryFiber = dietaryFiber;
|
||||
}
|
||||
|
||||
public void setCholesterol(final BigDecimal cholesterol) {
|
||||
this.cholesterol = cholesterol;
|
||||
}
|
||||
|
||||
public void setCalcium(final BigDecimal calcium) {
|
||||
this.calcium = calcium;
|
||||
}
|
||||
|
||||
public void setSodium(final BigDecimal sodium) {
|
||||
this.sodium = sodium;
|
||||
}
|
||||
|
||||
public void setCaloriesNrv(final BigDecimal caloriesNrv) {
|
||||
this.caloriesNrv = caloriesNrv;
|
||||
}
|
||||
|
||||
public void setProteinNrv(final BigDecimal proteinNrv) {
|
||||
this.proteinNrv = proteinNrv;
|
||||
}
|
||||
|
||||
public void setFatNrv(final BigDecimal fatNrv) {
|
||||
this.fatNrv = fatNrv;
|
||||
}
|
||||
|
||||
public void setCarbohydrateNrv(final BigDecimal carbohydrateNrv) {
|
||||
this.carbohydrateNrv = carbohydrateNrv;
|
||||
}
|
||||
|
||||
public void setDietaryFiberNrv(final BigDecimal dietaryFiberNrv) {
|
||||
this.dietaryFiberNrv = dietaryFiberNrv;
|
||||
}
|
||||
|
||||
public void setCholesterolNrv(final BigDecimal cholesterolNrv) {
|
||||
this.cholesterolNrv = cholesterolNrv;
|
||||
}
|
||||
|
||||
public void setCalciumNrv(final BigDecimal calciumNrv) {
|
||||
this.calciumNrv = calciumNrv;
|
||||
}
|
||||
|
||||
public void setSodiumNrv(final BigDecimal sodiumNrv) {
|
||||
this.sodiumNrv = sodiumNrv;
|
||||
}
|
||||
|
||||
public void setFoodImage(final String foodImage) {
|
||||
this.foodImage = foodImage;
|
||||
}
|
||||
|
||||
public void setIntro(final String intro) {
|
||||
this.intro = intro;
|
||||
}
|
||||
|
||||
public void setLabelList(final List<String> labelList) {
|
||||
this.labelList = labelList;
|
||||
}
|
||||
|
||||
public void setMainList(final List<String> mainList) {
|
||||
this.mainList = mainList;
|
||||
}
|
||||
|
||||
public void setAuxList(final List<String> auxList) {
|
||||
this.auxList = auxList;
|
||||
}
|
||||
|
||||
public void setDosList(final List<String> dosList) {
|
||||
this.dosList = dosList;
|
||||
}
|
||||
|
||||
public void setMonthlySales(final Integer monthlySales) {
|
||||
this.monthlySales = monthlySales;
|
||||
}
|
||||
|
||||
public void setGoodProbability(final BigDecimal goodProbability) {
|
||||
this.goodProbability = goodProbability;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,4 +24,5 @@ public class DeviceInfoVo {
|
|||
private String deviceNum;
|
||||
private String deviceName;
|
||||
private String devicePwd;
|
||||
private String recipeName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,16 @@ import com.bonus.common.houqin.constant.LeConstants;
|
|||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalTime;
|
||||
|
||||
/**
|
||||
* 餐次时段VO
|
||||
* @author 19814
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel("餐次时段VO")
|
||||
public class DeviceMealtimeVO {
|
||||
@ApiModelProperty("餐次id")
|
||||
|
|
@ -34,34 +41,6 @@ public class DeviceMealtimeVO {
|
|||
this.ifUse = LeConstants.COMMON_YES;
|
||||
}
|
||||
|
||||
public Long getIntervalId() {
|
||||
return this.intervalId;
|
||||
}
|
||||
|
||||
public String getIntervalName() {
|
||||
return this.intervalName;
|
||||
}
|
||||
|
||||
public LocalTime getStartTime() {
|
||||
return this.startTime;
|
||||
}
|
||||
|
||||
public LocalTime getEndTime() {
|
||||
return this.endTime;
|
||||
}
|
||||
|
||||
public Integer getIfUse() {
|
||||
return this.ifUse;
|
||||
}
|
||||
|
||||
public void setIntervalId(final Long intervalId) {
|
||||
this.intervalId = intervalId;
|
||||
}
|
||||
|
||||
public void setIntervalName(final String intervalName) {
|
||||
this.intervalName = intervalName;
|
||||
}
|
||||
|
||||
@JsonFormat(
|
||||
pattern = "HH:mm:ss"
|
||||
)
|
||||
|
|
@ -76,8 +55,4 @@ public class DeviceMealtimeVO {
|
|||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public void setIfUse(final Integer ifUse) {
|
||||
this.ifUse = ifUse;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.canteen.core.android.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 设备餐次信息返回
|
||||
*
|
||||
* @author 19814
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ApiModel("设备餐次信息返回")
|
||||
public class DeviceTimeIntervalVO {
|
||||
@ApiModelProperty("-1商户 1食堂 2档口")
|
||||
private Integer level;
|
||||
@ApiModelProperty("餐次时段信息")
|
||||
private List<DeviceMealtimeVO> basicsTimeIntervals;
|
||||
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package com.bonus.canteen.core.android.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel("设备餐次信息返回")
|
||||
public class DviceTimeIntervalVO {
|
||||
@ApiModelProperty("-1商户 1食堂 2档口")
|
||||
private Integer level;
|
||||
@ApiModelProperty("餐次时段信息")
|
||||
private List<DeviceMealtimeVO> basicsTimeIntervals;
|
||||
|
||||
public Integer getLevel() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
public List<DeviceMealtimeVO> getBasicsTimeIntervals() {
|
||||
return this.basicsTimeIntervals;
|
||||
}
|
||||
|
||||
public void setLevel(final Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public void setBasicsTimeIntervals(final List<DeviceMealtimeVO> basicsTimeIntervals) {
|
||||
this.basicsTimeIntervals = basicsTimeIntervals;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,8 @@ package com.bonus.canteen.core.android.vo;
|
|||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author 19814
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import com.bonus.canteen.core.device.domain.DeviceInfo;
|
|||
import com.bonus.canteen.core.device.service.IDeviceInfoService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 设备资料Service业务层处理
|
||||
*
|
||||
|
|
@ -20,9 +22,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
*/
|
||||
@Service
|
||||
public class DeviceInfoServiceImpl implements IDeviceInfoService {
|
||||
@Autowired
|
||||
@Resource
|
||||
private DeviceInfoMapper deviceInfoMapper;
|
||||
|
||||
private static final Long DEVICE_TYPE_STALL = 20L;
|
||||
|
||||
/**
|
||||
* 查询设备资料
|
||||
*
|
||||
|
|
@ -85,46 +89,53 @@ public class DeviceInfoServiceImpl implements IDeviceInfoService {
|
|||
}
|
||||
}
|
||||
|
||||
private void checkParam(DeviceInfo deviceInfo, boolean isUpdate) throws Exception {
|
||||
private void checkParam(DeviceInfo deviceInfo, boolean isUpdate){
|
||||
deviceInfo.setTenantId(GlobalConstants.TENANT_ID);
|
||||
if (isUpdate){
|
||||
if (deviceInfo.getDeviceId() == null) {
|
||||
throw new Exception("设备ID不能为空");
|
||||
}
|
||||
|
||||
if (isUpdate && deviceInfo.getDeviceId() == null) {
|
||||
throw new ServiceException("设备ID不能为空");
|
||||
}
|
||||
if (deviceInfo.getDeviceType() == null) {
|
||||
throw new Exception("设备类型不能为空");
|
||||
throw new ServiceException("设备类型不能为空");
|
||||
}
|
||||
if (deviceInfo.getDeviceType() == 1L){
|
||||
if (deviceInfo.getAreaId() == null || StringUtils.isBlank(deviceInfo.getAreaId())) {
|
||||
throw new Exception("区域不能为空");
|
||||
}
|
||||
if (deviceInfo.getCanteenId() == null || StringUtils.isBlank(deviceInfo.getCanteenId())) {
|
||||
throw new Exception("食堂不能为空");
|
||||
}
|
||||
if (deviceInfo.getStallId() == null || StringUtils.isBlank(deviceInfo.getStallId())) {
|
||||
throw new Exception("档口不能为空");
|
||||
}
|
||||
if (deviceInfo.getDeviceType().equals(DEVICE_TYPE_STALL)) {
|
||||
checkStallRelated(deviceInfo);
|
||||
}
|
||||
if (deviceInfo.getDeviceName() == null || StringUtils.isBlank(deviceInfo.getDeviceName())) {
|
||||
throw new Exception("设备名称不能为空");
|
||||
if (StringUtils.isBlank(deviceInfo.getDeviceName())) {
|
||||
throw new ServiceException("设备名称不能为空");
|
||||
}
|
||||
if (deviceInfo.getDeviceNumber() == null || StringUtils.isBlank(deviceInfo.getDeviceNumber())) {
|
||||
throw new Exception("设备编号不能为空");
|
||||
if (StringUtils.isBlank(deviceInfo.getDeviceNumber())) {
|
||||
throw new ServiceException("设备编号不能为空");
|
||||
}
|
||||
checkDeviceUnique(deviceInfo);
|
||||
// 查询是否档口已经绑定菜谱
|
||||
String recipeId = deviceInfoMapper.selectDeviceRecipeBinding(deviceInfo);
|
||||
if (StringUtils.isNotBlank(recipeId)) {
|
||||
deviceInfo.setRecipeId(recipeId);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkStallRelated(DeviceInfo deviceInfo){
|
||||
if (StringUtils.isBlank(deviceInfo.getAreaId())) {
|
||||
throw new ServiceException("区域不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(deviceInfo.getCanteenId())) {
|
||||
throw new ServiceException("食堂不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(deviceInfo.getStallId())) {
|
||||
throw new ServiceException("档口不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
private void checkDeviceUnique(DeviceInfo deviceInfo){
|
||||
if (deviceInfoMapper.checkDeviceNameUnique(deviceInfo) > 0) {
|
||||
throw new Exception("设备名称已存在");
|
||||
throw new ServiceException("设备名称已存在");
|
||||
}
|
||||
if (deviceInfoMapper.checkDeviceNumberUnique(deviceInfo) > 0) {
|
||||
throw new Exception("设备编号已存在");
|
||||
throw new ServiceException("设备编号已存在");
|
||||
}
|
||||
if (deviceInfoMapper.checkDeviceSnUnique(deviceInfo) > 0) {
|
||||
throw new Exception("设备SN已存在");
|
||||
}
|
||||
//查询是否档口已经绑定菜谱
|
||||
String recipeId = deviceInfoMapper.selectDeviceRecipeBinding(deviceInfo);
|
||||
if (StringUtils.isNotBlank(recipeId)){
|
||||
deviceInfo.setRecipeId(recipeId);
|
||||
throw new ServiceException("设备SN已存在");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +173,7 @@ public class DeviceInfoServiceImpl implements IDeviceInfoService {
|
|||
public void updateTimeBySn(String sn) {
|
||||
int code = deviceInfoMapper.updateTimeBySn(sn);
|
||||
if (code == 0) {
|
||||
throw new RuntimeException("更新时间失败");
|
||||
throw new ServiceException("更新时间失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue