Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
589e1ef4d7
|
|
@ -16,6 +16,12 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,92 @@
|
|||
package com.bonus.canteen.core.cook.vo;
|
||||
|
||||
import com.bonus.canteen.core.utils.SysUtil;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel("菜品标签分页返回")
|
||||
public class CookMaterialBaseVO implements Serializable {
|
||||
@ApiModelProperty("食材id")
|
||||
private Long materialId;
|
||||
@ApiModelProperty("食材名称")
|
||||
private String materialName;
|
||||
@ApiModelProperty("原料编号")
|
||||
private String materialCode;
|
||||
@ApiModelProperty("食材重量(g)")
|
||||
private Double weight;
|
||||
@ApiModelProperty("材料类型(1主料,2辅料,3配料)")
|
||||
private Integer materialType;
|
||||
@ApiModelProperty("大类")
|
||||
private String bigType;
|
||||
@ApiModelProperty("小类")
|
||||
private String littleType;
|
||||
@ApiModelProperty("原料图片")
|
||||
private String imageUrl;
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = SysUtil.getCutPath(imageUrl);
|
||||
}
|
||||
|
||||
public String getImageUrl() {
|
||||
return SysUtil.getCutFileUrl(this.imageUrl);
|
||||
}
|
||||
|
||||
public Long getMaterialId() {
|
||||
return this.materialId;
|
||||
}
|
||||
|
||||
public String getMaterialName() {
|
||||
return this.materialName;
|
||||
}
|
||||
|
||||
public String getMaterialCode() {
|
||||
return this.materialCode;
|
||||
}
|
||||
|
||||
public Double getWeight() {
|
||||
return this.weight;
|
||||
}
|
||||
|
||||
public Integer getMaterialType() {
|
||||
return this.materialType;
|
||||
}
|
||||
|
||||
public String getBigType() {
|
||||
return this.bigType;
|
||||
}
|
||||
|
||||
public String getLittleType() {
|
||||
return this.littleType;
|
||||
}
|
||||
|
||||
public void setMaterialId(final Long materialId) {
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public void setMaterialName(final String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public void setMaterialCode(final String materialCode) {
|
||||
this.materialCode = materialCode;
|
||||
}
|
||||
|
||||
public void setWeight(final Double weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setMaterialType(final Integer materialType) {
|
||||
this.materialType = materialType;
|
||||
}
|
||||
|
||||
public void setBigType(final String bigType) {
|
||||
this.bigType = bigType;
|
||||
}
|
||||
|
||||
public void setLittleType(final String littleType) {
|
||||
this.littleType = littleType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.bonus.canteen.core.cook.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/6/9 12:12
|
||||
*/
|
||||
@Data
|
||||
public class MenuMaterialBasVO {
|
||||
private String materialId;
|
||||
private String materialName;
|
||||
private String materialCode;
|
||||
private String weight;
|
||||
private String materialType;
|
||||
private String bigType;
|
||||
private String littleType;
|
||||
private String imageUrl;
|
||||
}
|
||||
|
|
@ -2,6 +2,10 @@ package com.bonus.canteen.core.kitchen.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
//import com.bonus.canteen.core.kitchen.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -26,7 +30,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
|
||||
/**
|
||||
* 厨房设备基础信息Controller
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
|
|
@ -43,9 +47,9 @@ public class KitchenDeviceInfoController extends BaseController {
|
|||
@ApiOperation(value = "查询厨房设备基础信息列表")
|
||||
//@RequiresPermissions("kitchen:info:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(KitchenDeviceInfo kitchenDeviceInfo) {
|
||||
public TableDataInfo list(KitchenDeviceListDTO kitchenDeviceInfo) {
|
||||
startPage();
|
||||
List<KitchenDeviceInfo> list = kitchenDeviceInfoService.selectKitchenDeviceInfoList(kitchenDeviceInfo);
|
||||
List<KitchenDeviceListVO> list = kitchenDeviceInfoService.selectKitchenDeviceInfoList(kitchenDeviceInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -57,9 +61,9 @@ public class KitchenDeviceInfoController extends BaseController {
|
|||
//@RequiresPermissions("kitchen:info:export")
|
||||
@SysLog(title = "厨房设备基础信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出厨房设备基础信息")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, KitchenDeviceInfo kitchenDeviceInfo) {
|
||||
List<KitchenDeviceInfo> list = kitchenDeviceInfoService.selectKitchenDeviceInfoList(kitchenDeviceInfo);
|
||||
ExcelUtil<KitchenDeviceInfo> util = new ExcelUtil<KitchenDeviceInfo>(KitchenDeviceInfo.class);
|
||||
public void export(HttpServletResponse response, KitchenDeviceListDTO kitchenDeviceInfo) {
|
||||
List<KitchenDeviceListVO> list = kitchenDeviceInfoService.selectKitchenDeviceInfoList(kitchenDeviceInfo);
|
||||
ExcelUtil<KitchenDeviceListVO> util = new ExcelUtil<KitchenDeviceListVO>(KitchenDeviceListVO.class);
|
||||
util.exportExcel(response, list, "厨房设备基础信息数据");
|
||||
}
|
||||
|
||||
|
|
@ -68,8 +72,8 @@ public class KitchenDeviceInfoController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "获取厨房设备基础信息详细信息")
|
||||
//@RequiresPermissions("kitchen:info:query")
|
||||
@GetMapping(value = "/{deviceId}")
|
||||
public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId) {
|
||||
@GetMapping(value = "/details")
|
||||
public AjaxResult getInfo(@NotNull Long deviceId) {
|
||||
return success(kitchenDeviceInfoService.selectKitchenDeviceInfoByDeviceId(deviceId));
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +84,7 @@ public class KitchenDeviceInfoController extends BaseController {
|
|||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("kitchen:info:add")
|
||||
@SysLog(title = "厨房设备基础信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增厨房设备基础信息")
|
||||
@PostMapping
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody KitchenDeviceInfo kitchenDeviceInfo) {
|
||||
try {
|
||||
return toAjax(kitchenDeviceInfoService.insertKitchenDeviceInfo(kitchenDeviceInfo));
|
||||
|
|
@ -112,8 +116,8 @@ public class KitchenDeviceInfoController extends BaseController {
|
|||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("kitchen:info:remove")
|
||||
@SysLog(title = "厨房设备基础信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除厨房设备基础信息")
|
||||
@PostMapping("/del/{deviceIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] deviceIds) {
|
||||
@PostMapping("/del")
|
||||
public AjaxResult remove(@RequestBody List<Long> deviceIds) {
|
||||
return toAjax(kitchenDeviceInfoService.deleteKitchenDeviceInfoByDeviceIds(deviceIds));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ package com.bonus.canteen.core.kitchen.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceUsageListVO;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
//import com.bonus.canteen.core.kitchen.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -26,7 +29,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
|
||||
/**
|
||||
* 厨房设备使用记录Controller
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
|
|
@ -43,9 +46,9 @@ public class KitchenDeviceUsageController extends BaseController {
|
|||
@ApiOperation(value = "查询厨房设备使用记录列表")
|
||||
//@RequiresPermissions("kitchen:usage:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(KitchenDeviceUsage kitchenDeviceUsage) {
|
||||
public TableDataInfo list(KitchenDeviceListDTO kitchenDeviceUsage) {
|
||||
startPage();
|
||||
List<KitchenDeviceUsage> list = kitchenDeviceUsageService.selectKitchenDeviceUsageList(kitchenDeviceUsage);
|
||||
List<KitchenDeviceUsageListVO> list = kitchenDeviceUsageService.selectKitchenDeviceUsageList(kitchenDeviceUsage);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -57,9 +60,9 @@ public class KitchenDeviceUsageController extends BaseController {
|
|||
//@RequiresPermissions("kitchen:usage:export")
|
||||
@SysLog(title = "厨房设备使用记录", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出厨房设备使用记录")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, KitchenDeviceUsage kitchenDeviceUsage) {
|
||||
List<KitchenDeviceUsage> list = kitchenDeviceUsageService.selectKitchenDeviceUsageList(kitchenDeviceUsage);
|
||||
ExcelUtil<KitchenDeviceUsage> util = new ExcelUtil<KitchenDeviceUsage>(KitchenDeviceUsage.class);
|
||||
public void export(HttpServletResponse response, KitchenDeviceListDTO kitchenDeviceUsage) {
|
||||
List<KitchenDeviceUsageListVO> list = kitchenDeviceUsageService.selectKitchenDeviceUsageList(kitchenDeviceUsage);
|
||||
ExcelUtil<KitchenDeviceUsageListVO> util = new ExcelUtil<KitchenDeviceUsageListVO>(KitchenDeviceUsageListVO.class);
|
||||
util.exportExcel(response, list, "厨房设备使用记录数据");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package com.bonus.canteen.core.kitchen.controller;
|
||||
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
@Api(tags = "厨房设备基础信息接口")
|
||||
@RestController
|
||||
@RequestMapping("/kitchen_home_page")
|
||||
public class KitchenHomePageController extends BaseController {
|
||||
|
||||
|
||||
@ApiOperation(value = "获取首页信息")
|
||||
//@RequiresPermissions("kitchen:info:list")
|
||||
@GetMapping("/information")
|
||||
public TableDataInfo list(KitchenDeviceListDTO kitchenDeviceInfo) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.bonus.canteen.core.kitchen.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
//import com.bonus.canteen.core.kitchen.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -42,8 +44,8 @@ public class KitchenWasteDealController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "查询厨房废弃物处置列表")
|
||||
//@RequiresPermissions("kitchen:deal:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(KitchenWasteDeal kitchenWasteDeal) {
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody @Valid KitchenWasteDeal kitchenWasteDeal) {
|
||||
startPage();
|
||||
List<KitchenWasteDeal> list = kitchenWasteDealService.selectKitchenWasteDealList(kitchenWasteDeal);
|
||||
return getDataTable(list);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.bonus.canteen.core.kitchen.controller;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
//import com.bonus.canteen.core.kitchen.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -42,8 +44,8 @@ public class KitchenWasteMealController extends BaseController {
|
|||
*/
|
||||
@ApiOperation(value = "查询厨房餐余浪费列表")
|
||||
//@RequiresPermissions("kitchen:meal:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(KitchenWasteMeal kitchenWasteMeal) {
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody @Valid KitchenWasteMeal kitchenWasteMeal) {
|
||||
startPage();
|
||||
List<KitchenWasteMeal> list = kitchenWasteMealService.selectKitchenWasteMealList(kitchenWasteMeal);
|
||||
return getDataTable(list);
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
package com.bonus.canteen.core.kitchen.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息对象 kitchen_device_info
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
|
|
@ -16,7 +20,7 @@ import com.bonus.common.core.web.domain.BaseEntity;
|
|||
|
||||
@Data
|
||||
@ToString
|
||||
public class KitchenDeviceInfo extends BaseEntity {
|
||||
public class KitchenDeviceInfo extends Model<KitchenDeviceInfo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备id */
|
||||
|
|
@ -90,5 +94,12 @@ public class KitchenDeviceInfo extends BaseEntity {
|
|||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
private String createBy;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
@JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.canteen.core.kitchen.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -7,6 +8,7 @@ import java.util.List;
|
|||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
|
@ -84,6 +86,15 @@ public class KitchenDeviceSensorRecord extends BaseEntity {
|
|||
@ApiModelProperty(value = "食堂名称")
|
||||
private String canteenName;
|
||||
|
||||
@ApiModelProperty(value = "测量指标类型")
|
||||
private Integer measureType;
|
||||
|
||||
@ApiModelProperty(value = "测量指标最大值")
|
||||
private BigDecimal measureMaxValue;
|
||||
|
||||
@ApiModelProperty(value = "测量指标最小值")
|
||||
private BigDecimal measureMinValue;
|
||||
|
||||
@ApiModelProperty(value = "测量结果类型")
|
||||
private List<Integer> sensorResultTypeList;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.canteen.core.kitchen.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
|
|
@ -81,5 +82,11 @@ public class KitchenWasteDeal extends BaseEntity {
|
|||
@ApiModelProperty(value = "处理人id")
|
||||
private Long staffId;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime startDateTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime endDateTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.canteen.core.kitchen.domain;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
|
|
@ -50,5 +51,18 @@ public class KitchenWasteMeal extends BaseEntity {
|
|||
@ApiModelProperty(value = "附件")
|
||||
private String fileUrl;
|
||||
|
||||
@ApiModelProperty(value = "食堂名称")
|
||||
private String canteenName;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime startDateTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime endDateTime;
|
||||
|
||||
@Excel(name = "区域Id")
|
||||
@ApiModelProperty(value = "厨余汇总")
|
||||
private Long wasteMealCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package com.bonus.canteen.core.kitchen.domain.constants;
|
||||
|
||||
public enum WasteDealTypeEnum {
|
||||
DISCARD(1, "丢弃"),
|
||||
NEXT_MEAL_USE(2, "下一餐使用"),
|
||||
COLLECT_SELLING(3, "集中售卖");
|
||||
|
||||
private final Integer key;
|
||||
|
||||
private final String desc;
|
||||
|
||||
private WasteDealTypeEnum(Integer key, String desc) {
|
||||
this.key = key;
|
||||
this.desc = desc;
|
||||
}
|
||||
public Integer getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
public static String getDescByKey(Integer targetKey) {
|
||||
for (WasteDealTypeEnum dealTypeEnum : WasteDealTypeEnum.values()) {
|
||||
if (dealTypeEnum.getKey().equals(targetKey)) {
|
||||
return dealTypeEnum.getDesc();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.bonus.canteen.core.kitchen.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息对象 kitchen_device_info
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class KitchenDeviceListDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备id */
|
||||
private Long deviceId;
|
||||
|
||||
/** 设备编号 */
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String deviceNo;
|
||||
|
||||
/** 食堂id */
|
||||
@ApiModelProperty(value = "食堂id")
|
||||
private Long canteenId;
|
||||
|
||||
/** 区域id */
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private Long areaId;
|
||||
|
||||
|
||||
/** 设备类型(1-摄像头 2-传感器 3-门禁 4-仪表 5-仪器, 参考DeviceTypeEnum) */
|
||||
@ApiModelProperty(value = "设备类型(1-摄像头 2-传感器 3-门禁 4-仪表 5-仪器, 参考DeviceTypeEnum)")
|
||||
private Integer deviceType;
|
||||
|
||||
/** 设备类型 */
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private Integer deviceCategory;
|
||||
|
||||
/** 设备型号 */
|
||||
@ApiModelProperty(value = "设备型号")
|
||||
private String deviceSize;
|
||||
|
||||
/** 设备名称 */
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/** 设备sn */
|
||||
@ApiModelProperty(value = "设备sn")
|
||||
private String deviceSn;
|
||||
|
||||
/** 所在位置 */
|
||||
@ApiModelProperty(value = "所在位置")
|
||||
private String subPlace;
|
||||
|
||||
/** 设备是否在线 1 在线 2 离线 */
|
||||
@ApiModelProperty(value = "设备是否在线 1 在线 2 离线")
|
||||
private Integer deviceNetworkState;
|
||||
|
||||
private String areaName;
|
||||
|
||||
private String canteenName;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.bonus.canteen.core.kitchen.dto;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 厨房设备使用记录对象 kitchen_device_usage
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class KitchenDeviceUsageListDTO {
|
||||
|
||||
|
||||
/** 设备编号 */
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String deviceNo;
|
||||
|
||||
@ApiModelProperty(value = "设备SN")
|
||||
private String deviceSn;
|
||||
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/** 设备类型 */
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private Long deviceType;
|
||||
|
||||
/** 区域id */
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private Long areaId;
|
||||
|
||||
|
||||
/** 食堂id */
|
||||
@ApiModelProperty(value = "食堂id")
|
||||
private Long canteenId;
|
||||
|
||||
|
||||
/** 工作状态 */
|
||||
@ApiModelProperty(value = "工作状态")
|
||||
private Long workState;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,34 +1,38 @@
|
|||
package com.bonus.canteen.core.kitchen.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo;
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息Mapper接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
public interface KitchenDeviceInfoMapper {
|
||||
public interface KitchenDeviceInfoMapper extends BaseMapper<KitchenDeviceInfo> {
|
||||
/**
|
||||
* 查询厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param deviceId 厨房设备基础信息主键
|
||||
* @return 厨房设备基础信息
|
||||
*/
|
||||
public KitchenDeviceInfo selectKitchenDeviceInfoByDeviceId(Long deviceId);
|
||||
public KitchenDeviceListVO selectKitchenDeviceInfoByDeviceId(Long deviceId);
|
||||
|
||||
/**
|
||||
* 查询厨房设备基础信息列表
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceInfo 厨房设备基础信息
|
||||
* @return 厨房设备基础信息集合
|
||||
*/
|
||||
public List<KitchenDeviceInfo> selectKitchenDeviceInfoList(KitchenDeviceInfo kitchenDeviceInfo);
|
||||
public List<KitchenDeviceListVO> selectKitchenDeviceInfoList(KitchenDeviceListDTO kitchenDeviceInfo);
|
||||
|
||||
/**
|
||||
* 新增厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceInfo 厨房设备基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +40,7 @@ public interface KitchenDeviceInfoMapper {
|
|||
|
||||
/**
|
||||
* 修改厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceInfo 厨房设备基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +48,7 @@ public interface KitchenDeviceInfoMapper {
|
|||
|
||||
/**
|
||||
* 删除厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param deviceId 厨房设备基础信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,9 +56,9 @@ public interface KitchenDeviceInfoMapper {
|
|||
|
||||
/**
|
||||
* 批量删除厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param deviceIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteKitchenDeviceInfoByDeviceIds(Long[] deviceIds);
|
||||
public int deleteKitchenDeviceInfoByDeviceIds(List<Long> deviceIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,33 +2,35 @@ package com.bonus.canteen.core.kitchen.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceUsage;
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceUsageListVO;
|
||||
|
||||
/**
|
||||
* 厨房设备使用记录Mapper接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
public interface KitchenDeviceUsageMapper {
|
||||
/**
|
||||
* 查询厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param usageId 厨房设备使用记录主键
|
||||
* @return 厨房设备使用记录
|
||||
*/
|
||||
public KitchenDeviceUsage selectKitchenDeviceUsageByUsageId(Long usageId);
|
||||
public KitchenDeviceUsageListVO selectKitchenDeviceUsageByUsageId(Long usageId);
|
||||
|
||||
/**
|
||||
* 查询厨房设备使用记录列表
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceUsage 厨房设备使用记录
|
||||
* @return 厨房设备使用记录集合
|
||||
*/
|
||||
public List<KitchenDeviceUsage> selectKitchenDeviceUsageList(KitchenDeviceUsage kitchenDeviceUsage);
|
||||
public List<KitchenDeviceUsageListVO> selectKitchenDeviceUsageList(KitchenDeviceListDTO kitchenDeviceUsage);
|
||||
|
||||
/**
|
||||
* 新增厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceUsage 厨房设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +38,7 @@ public interface KitchenDeviceUsageMapper {
|
|||
|
||||
/**
|
||||
* 修改厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceUsage 厨房设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +46,7 @@ public interface KitchenDeviceUsageMapper {
|
|||
|
||||
/**
|
||||
* 删除厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param usageId 厨房设备使用记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,7 +54,7 @@ public interface KitchenDeviceUsageMapper {
|
|||
|
||||
/**
|
||||
* 批量删除厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param usageIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.canteen.core.kitchen.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo;
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息Mapper接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
public interface KitchenHomePageMapper {
|
||||
|
||||
}
|
||||
|
|
@ -5,14 +5,14 @@ import com.bonus.canteen.core.kitchen.domain.KitchenWasteMeal;
|
|||
|
||||
/**
|
||||
* 厨房餐余浪费Mapper接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
public interface KitchenWasteMealMapper {
|
||||
/**
|
||||
* 查询厨房餐余浪费
|
||||
*
|
||||
*
|
||||
* @param ledgerId 厨房餐余浪费主键
|
||||
* @return 厨房餐余浪费
|
||||
*/
|
||||
|
|
@ -20,7 +20,7 @@ public interface KitchenWasteMealMapper {
|
|||
|
||||
/**
|
||||
* 查询厨房餐余浪费列表
|
||||
*
|
||||
*
|
||||
* @param kitchenWasteMeal 厨房餐余浪费
|
||||
* @return 厨房餐余浪费集合
|
||||
*/
|
||||
|
|
@ -28,7 +28,7 @@ public interface KitchenWasteMealMapper {
|
|||
|
||||
/**
|
||||
* 新增厨房餐余浪费
|
||||
*
|
||||
*
|
||||
* @param kitchenWasteMeal 厨房餐余浪费
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +36,7 @@ public interface KitchenWasteMealMapper {
|
|||
|
||||
/**
|
||||
* 修改厨房餐余浪费
|
||||
*
|
||||
*
|
||||
* @param kitchenWasteMeal 厨房餐余浪费
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public interface KitchenWasteMealMapper {
|
|||
|
||||
/**
|
||||
* 删除厨房餐余浪费
|
||||
*
|
||||
*
|
||||
* @param ledgerId 厨房餐余浪费主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,9 +52,17 @@ public interface KitchenWasteMealMapper {
|
|||
|
||||
/**
|
||||
* 批量删除厨房餐余浪费
|
||||
*
|
||||
*
|
||||
* @param ledgerIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteKitchenWasteMealByLedgerIds(Long[] ledgerIds);
|
||||
|
||||
/**
|
||||
* 查询厨房餐余浪费汇总
|
||||
*
|
||||
* @param kitchenWasteMeal 厨房餐余浪费
|
||||
* @return 厨房餐余浪费集合
|
||||
*/
|
||||
public List<KitchenWasteMeal> selectKitchenWasteMealListCount(KitchenWasteMeal kitchenWasteMeal);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,38 @@
|
|||
package com.bonus.canteen.core.kitchen.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo;
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息Service接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
public interface IKitchenDeviceInfoService {
|
||||
public interface IKitchenDeviceInfoService extends IService<KitchenDeviceInfo> {
|
||||
/**
|
||||
* 查询厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param deviceId 厨房设备基础信息主键
|
||||
* @return 厨房设备基础信息
|
||||
*/
|
||||
public KitchenDeviceInfo selectKitchenDeviceInfoByDeviceId(Long deviceId);
|
||||
public KitchenDeviceListVO selectKitchenDeviceInfoByDeviceId(Long deviceId);
|
||||
|
||||
/**
|
||||
* 查询厨房设备基础信息列表
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceInfo 厨房设备基础信息
|
||||
* @return 厨房设备基础信息集合
|
||||
*/
|
||||
public List<KitchenDeviceInfo> selectKitchenDeviceInfoList(KitchenDeviceInfo kitchenDeviceInfo);
|
||||
public List<KitchenDeviceListVO> selectKitchenDeviceInfoList(KitchenDeviceListDTO kitchenDeviceInfo);
|
||||
|
||||
/**
|
||||
* 新增厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceInfo 厨房设备基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +40,7 @@ public interface IKitchenDeviceInfoService {
|
|||
|
||||
/**
|
||||
* 修改厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceInfo 厨房设备基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,15 +48,15 @@ public interface IKitchenDeviceInfoService {
|
|||
|
||||
/**
|
||||
* 批量删除厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param deviceIds 需要删除的厨房设备基础信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteKitchenDeviceInfoByDeviceIds(Long[] deviceIds);
|
||||
public int deleteKitchenDeviceInfoByDeviceIds(List<Long> deviceIds);
|
||||
|
||||
/**
|
||||
* 删除厨房设备基础信息信息
|
||||
*
|
||||
*
|
||||
* @param deviceId 厨房设备基础信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,33 +2,35 @@ package com.bonus.canteen.core.kitchen.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceUsage;
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceUsageListVO;
|
||||
|
||||
/**
|
||||
* 厨房设备使用记录Service接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
public interface IKitchenDeviceUsageService {
|
||||
/**
|
||||
* 查询厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param usageId 厨房设备使用记录主键
|
||||
* @return 厨房设备使用记录
|
||||
*/
|
||||
public KitchenDeviceUsage selectKitchenDeviceUsageByUsageId(Long usageId);
|
||||
public KitchenDeviceUsageListVO selectKitchenDeviceUsageByUsageId(Long usageId);
|
||||
|
||||
/**
|
||||
* 查询厨房设备使用记录列表
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceUsage 厨房设备使用记录
|
||||
* @return 厨房设备使用记录集合
|
||||
*/
|
||||
public List<KitchenDeviceUsage> selectKitchenDeviceUsageList(KitchenDeviceUsage kitchenDeviceUsage);
|
||||
public List<KitchenDeviceUsageListVO> selectKitchenDeviceUsageList(KitchenDeviceListDTO kitchenDeviceUsage);
|
||||
|
||||
/**
|
||||
* 新增厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceUsage 厨房设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +38,7 @@ public interface IKitchenDeviceUsageService {
|
|||
|
||||
/**
|
||||
* 修改厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceUsage 厨房设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +46,7 @@ public interface IKitchenDeviceUsageService {
|
|||
|
||||
/**
|
||||
* 批量删除厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param usageIds 需要删除的厨房设备使用记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,7 +54,7 @@ public interface IKitchenDeviceUsageService {
|
|||
|
||||
/**
|
||||
* 删除厨房设备使用记录信息
|
||||
*
|
||||
*
|
||||
* @param usageId 厨房设备使用记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.canteen.core.kitchen.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo;
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息Service接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
public interface IKitchenHomePageService{
|
||||
|
||||
}
|
||||
|
|
@ -1,56 +1,118 @@
|
|||
package com.bonus.canteen.core.kitchen.service.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.hibernate.validator.internal.util.StringHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.kitchen.mapper.KitchenDeviceInfoMapper;
|
||||
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo;
|
||||
import com.bonus.canteen.core.kitchen.service.IKitchenDeviceInfoService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
@Service
|
||||
public class KitchenDeviceInfoServiceImpl implements IKitchenDeviceInfoService {
|
||||
@Autowired
|
||||
public class KitchenDeviceInfoServiceImpl extends ServiceImpl<KitchenDeviceInfoMapper,KitchenDeviceInfo> implements IKitchenDeviceInfoService {
|
||||
@Resource
|
||||
private KitchenDeviceInfoMapper kitchenDeviceInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param deviceId 厨房设备基础信息主键
|
||||
* @return 厨房设备基础信息
|
||||
*/
|
||||
@Override
|
||||
public KitchenDeviceInfo selectKitchenDeviceInfoByDeviceId(Long deviceId) {
|
||||
public KitchenDeviceListVO selectKitchenDeviceInfoByDeviceId(Long deviceId) {
|
||||
return kitchenDeviceInfoMapper.selectKitchenDeviceInfoByDeviceId(deviceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询厨房设备基础信息列表
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceInfo 厨房设备基础信息
|
||||
* @return 厨房设备基础信息
|
||||
*/
|
||||
@Override
|
||||
public List<KitchenDeviceInfo> selectKitchenDeviceInfoList(KitchenDeviceInfo kitchenDeviceInfo) {
|
||||
return kitchenDeviceInfoMapper.selectKitchenDeviceInfoList(kitchenDeviceInfo);
|
||||
public List<KitchenDeviceListVO> selectKitchenDeviceInfoList(KitchenDeviceListDTO kitchenDeviceInfo) {
|
||||
List<KitchenDeviceListVO> list = kitchenDeviceInfoMapper.selectKitchenDeviceInfoList(kitchenDeviceInfo);
|
||||
// 设置设备在线状态 现不确定验证方式 简易版
|
||||
// if(list != null && list.size() >0) {
|
||||
// for (KitchenDeviceListVO vo : list) {
|
||||
// String ip = vo.getIpAddress() ;
|
||||
// boolean tf = isDeviceOnline(ip, 500); // 设置超时时间为500毫秒
|
||||
// vo.setDeviceNetworkState(tf == true ? 1 : 0);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isDeviceOnline(String ipAddress, int timeout) {
|
||||
try {
|
||||
InetAddress address = InetAddress.getByName(ipAddress);
|
||||
return address.isReachable(timeout);
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 新增厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceInfo 厨房设备基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertKitchenDeviceInfo(KitchenDeviceInfo kitchenDeviceInfo) {
|
||||
if(StringHelper.isNullOrEmptyString(kitchenDeviceInfo.getDeviceNo())){
|
||||
throw new ServiceException("编设备编号不能为空");
|
||||
}
|
||||
if(kitchenDeviceInfo.getDeviceType() == null){
|
||||
throw new ServiceException("编设备类型不能为空");
|
||||
}
|
||||
if(StringHelper.isNullOrEmptyString(kitchenDeviceInfo.getDeviceSn())){
|
||||
throw new ServiceException("编设备sn号不能为空");
|
||||
}
|
||||
kitchenDeviceInfo.setDeviceNo(kitchenDeviceInfo.getDeviceNo() == null ? "2" : kitchenDeviceInfo.getDeviceNo().trim());
|
||||
kitchenDeviceInfo.setCreateTime(DateUtils.getNowDate());
|
||||
KitchenDeviceInfo bean;
|
||||
bean = kitchenDeviceInfoMapper.selectOne(
|
||||
Wrappers.<KitchenDeviceInfo>lambdaQuery()
|
||||
.eq(KitchenDeviceInfo::getDeviceName, kitchenDeviceInfo.getDeviceName())
|
||||
);
|
||||
if(bean !=null) {
|
||||
throw new ServiceException("设备编号已存在,请检查后重新输入");
|
||||
}
|
||||
bean = kitchenDeviceInfoMapper.selectOne(
|
||||
Wrappers.<KitchenDeviceInfo>lambdaQuery()
|
||||
.eq(KitchenDeviceInfo::getDeviceSn, kitchenDeviceInfo.getDeviceSn())
|
||||
);
|
||||
if(bean !=null) {
|
||||
throw new ServiceException("设备SN码已存在,请检查后重新输入");
|
||||
}
|
||||
bean = kitchenDeviceInfoMapper.selectOne(
|
||||
Wrappers.<KitchenDeviceInfo>lambdaQuery()
|
||||
.eq(KitchenDeviceInfo::getDeviceName, kitchenDeviceInfo.getDeviceName())
|
||||
);
|
||||
if(bean !=null) {
|
||||
throw new ServiceException("设备名称已存在,请检查后重新输入");
|
||||
}
|
||||
try {
|
||||
return kitchenDeviceInfoMapper.insertKitchenDeviceInfo(kitchenDeviceInfo);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -60,15 +122,54 @@ public class KitchenDeviceInfoServiceImpl implements IKitchenDeviceInfoService {
|
|||
|
||||
/**
|
||||
* 修改厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceInfo 厨房设备基础信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateKitchenDeviceInfo(KitchenDeviceInfo kitchenDeviceInfo) {
|
||||
kitchenDeviceInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
|
||||
if(StringHelper.isNullOrEmptyString(kitchenDeviceInfo.getDeviceNo())){
|
||||
throw new ServiceException("编设备编号不能为空");
|
||||
}
|
||||
if(kitchenDeviceInfo.getDeviceType() == null){
|
||||
throw new ServiceException("编设备类型不能为空");
|
||||
}
|
||||
if(StringHelper.isNullOrEmptyString(kitchenDeviceInfo.getDeviceSn())){
|
||||
throw new ServiceException("编设备sn号不能为空");
|
||||
}
|
||||
|
||||
KitchenDeviceInfo bean;
|
||||
bean = kitchenDeviceInfoMapper.selectOne(
|
||||
Wrappers.<KitchenDeviceInfo>lambdaQuery()
|
||||
.eq(KitchenDeviceInfo::getDeviceName, kitchenDeviceInfo.getDeviceName())
|
||||
.ne(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId())
|
||||
);
|
||||
if(bean !=null){
|
||||
throw new ServiceException("设备名称已存在");
|
||||
}
|
||||
bean = kitchenDeviceInfoMapper.selectOne(
|
||||
Wrappers.<KitchenDeviceInfo>lambdaQuery()
|
||||
.eq(KitchenDeviceInfo::getDeviceSn, kitchenDeviceInfo.getDeviceSn())
|
||||
.ne(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId())
|
||||
);
|
||||
if(bean !=null){
|
||||
throw new ServiceException("编设备sn码已存在");
|
||||
}
|
||||
bean = kitchenDeviceInfoMapper.selectOne(
|
||||
Wrappers.<KitchenDeviceInfo>lambdaQuery()
|
||||
.eq(KitchenDeviceInfo::getDeviceNo, kitchenDeviceInfo.getDeviceNo())
|
||||
.ne(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId())
|
||||
);
|
||||
if(bean !=null){
|
||||
throw new ServiceException("编设备编码已存在");
|
||||
}
|
||||
try {
|
||||
return kitchenDeviceInfoMapper.updateKitchenDeviceInfo(kitchenDeviceInfo);
|
||||
return kitchenDeviceInfoMapper.update(kitchenDeviceInfo,
|
||||
Wrappers.<KitchenDeviceInfo>lambdaUpdate()
|
||||
.eq(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId()));
|
||||
// return kitchenDeviceInfoMapper.updateKitchenDeviceInfo(kitchenDeviceInfo);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
|
|
@ -76,18 +177,18 @@ public class KitchenDeviceInfoServiceImpl implements IKitchenDeviceInfoService {
|
|||
|
||||
/**
|
||||
* 批量删除厨房设备基础信息
|
||||
*
|
||||
*
|
||||
* @param deviceIds 需要删除的厨房设备基础信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteKitchenDeviceInfoByDeviceIds(Long[] deviceIds) {
|
||||
public int deleteKitchenDeviceInfoByDeviceIds(List<Long> deviceIds) {
|
||||
return kitchenDeviceInfoMapper.deleteKitchenDeviceInfoByDeviceIds(deviceIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除厨房设备基础信息信息
|
||||
*
|
||||
*
|
||||
* @param deviceId 厨房设备基础信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
package com.bonus.canteen.core.kitchen.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import com.bonus.canteen.core.kitchen.domain.constants.DeviceSensorResultEnum;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -39,7 +45,39 @@ public class KitchenDeviceSensorRecordServiceImpl implements IKitchenDeviceSenso
|
|||
*/
|
||||
@Override
|
||||
public List<KitchenDeviceSensorRecord> selectKitchenDeviceSensorRecordList(KitchenDeviceSensorRecord kitchenDeviceSensorRecord) {
|
||||
return kitchenDeviceSensorRecordMapper.selectKitchenDeviceSensorRecordList(kitchenDeviceSensorRecord);
|
||||
List<KitchenDeviceSensorRecord> kitchenDeviceSensorRecordList = kitchenDeviceSensorRecordMapper
|
||||
.selectKitchenDeviceSensorRecordList(kitchenDeviceSensorRecord);
|
||||
if(CollUtil.isNotEmpty(kitchenDeviceSensorRecordList)) {
|
||||
kitchenDeviceSensorRecordList.forEach(record -> {
|
||||
if("temperature".equals(record.getMeasureCode()) && StringUtils.isNotBlank(record.getMeasureData())) {
|
||||
if(new BigDecimal(record.getMeasureData()).compareTo(record.getMeasureMaxValue()) > 0) {
|
||||
record.setMeasureData(DeviceSensorResultEnum.TEMPERATURE_HIGH.getDesc());
|
||||
}else if(new BigDecimal(record.getMeasureData()).compareTo(record.getMeasureMaxValue()) < 0) {
|
||||
record.setMeasureData(DeviceSensorResultEnum.TEMPERATURE_LOW.getDesc());
|
||||
} else {
|
||||
record.setMeasureData(DeviceSensorResultEnum.NORMAL.getDesc());
|
||||
}
|
||||
}
|
||||
if("humidity".equals(record.getMeasureCode()) && StringUtils.isNotBlank(record.getMeasureData())) {
|
||||
if(new BigDecimal(record.getMeasureData()).compareTo(record.getMeasureMaxValue()) > 0) {
|
||||
record.setMeasureData(DeviceSensorResultEnum.HUMIDITY_HIGH.getDesc());
|
||||
}else if(new BigDecimal(record.getMeasureData()).compareTo(record.getMeasureMaxValue()) < 0) {
|
||||
record.setMeasureData(DeviceSensorResultEnum.HUMIDITY_LOW.getDesc());
|
||||
} else {
|
||||
record.setMeasureData(DeviceSensorResultEnum.NORMAL.getDesc());
|
||||
}
|
||||
}
|
||||
if("smoke".equals(record.getMeasureCode()) && StringUtils.isNotBlank(record.getMeasureData())) {
|
||||
if(new BigDecimal(record.getMeasureData()).compareTo(record.getMeasureMaxValue()) > 0) {
|
||||
record.setMeasureData(DeviceSensorResultEnum.SMOKE_HIGH.getDesc());
|
||||
} else {
|
||||
record.setMeasureData(DeviceSensorResultEnum.NORMAL.getDesc());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return kitchenDeviceSensorRecordList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.bonus.canteen.core.kitchen.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceUsageListVO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -11,7 +14,7 @@ import com.bonus.canteen.core.kitchen.service.IKitchenDeviceUsageService;
|
|||
|
||||
/**
|
||||
* 厨房设备使用记录Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
|
|
@ -22,29 +25,29 @@ public class KitchenDeviceUsageServiceImpl implements IKitchenDeviceUsageService
|
|||
|
||||
/**
|
||||
* 查询厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param usageId 厨房设备使用记录主键
|
||||
* @return 厨房设备使用记录
|
||||
*/
|
||||
@Override
|
||||
public KitchenDeviceUsage selectKitchenDeviceUsageByUsageId(Long usageId) {
|
||||
public KitchenDeviceUsageListVO selectKitchenDeviceUsageByUsageId(Long usageId) {
|
||||
return kitchenDeviceUsageMapper.selectKitchenDeviceUsageByUsageId(usageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询厨房设备使用记录列表
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceUsage 厨房设备使用记录
|
||||
* @return 厨房设备使用记录
|
||||
*/
|
||||
@Override
|
||||
public List<KitchenDeviceUsage> selectKitchenDeviceUsageList(KitchenDeviceUsage kitchenDeviceUsage) {
|
||||
public List<KitchenDeviceUsageListVO> selectKitchenDeviceUsageList(KitchenDeviceListDTO kitchenDeviceUsage) {
|
||||
return kitchenDeviceUsageMapper.selectKitchenDeviceUsageList(kitchenDeviceUsage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceUsage 厨房设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -60,7 +63,7 @@ public class KitchenDeviceUsageServiceImpl implements IKitchenDeviceUsageService
|
|||
|
||||
/**
|
||||
* 修改厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param kitchenDeviceUsage 厨房设备使用记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -76,7 +79,7 @@ public class KitchenDeviceUsageServiceImpl implements IKitchenDeviceUsageService
|
|||
|
||||
/**
|
||||
* 批量删除厨房设备使用记录
|
||||
*
|
||||
*
|
||||
* @param usageIds 需要删除的厨房设备使用记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -87,7 +90,7 @@ public class KitchenDeviceUsageServiceImpl implements IKitchenDeviceUsageService
|
|||
|
||||
/**
|
||||
* 删除厨房设备使用记录信息
|
||||
*
|
||||
*
|
||||
* @param usageId 厨房设备使用记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package com.bonus.canteen.core.kitchen.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo;
|
||||
import com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO;
|
||||
import com.bonus.canteen.core.kitchen.mapper.KitchenDeviceInfoMapper;
|
||||
import com.bonus.canteen.core.kitchen.mapper.KitchenHomePageMapper;
|
||||
import com.bonus.canteen.core.kitchen.service.IKitchenDeviceInfoService;
|
||||
import com.bonus.canteen.core.kitchen.service.IKitchenHomePageService;
|
||||
import com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.hibernate.validator.internal.util.StringHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息Service业务层处理
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
@Service
|
||||
public class KitchenHomePageerviceImpl implements IKitchenHomePageService {
|
||||
@Resource
|
||||
private KitchenHomePageMapper kitchenHomePageMapper;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.bonus.canteen.core.kitchen.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 厨房设备基础信息对象 kitchen_device_info
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class KitchenDeviceListVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备id */
|
||||
private Long deviceId;
|
||||
|
||||
/** 设备编号 */
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String deviceNo;
|
||||
|
||||
/** 食堂id */
|
||||
@ApiModelProperty(value = "食堂id")
|
||||
private Long canteenId;
|
||||
|
||||
/** 区域id */
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private Long areaId;
|
||||
|
||||
/** 设备密码 */
|
||||
@ApiModelProperty(value = "设备密码")
|
||||
private String devicePwd;
|
||||
|
||||
/** 设备类型(1-摄像头 2-传感器 3-门禁 4-仪表 5-仪器, 参考DeviceTypeEnum) */
|
||||
@ApiModelProperty(value = "设备类型(1-摄像头 2-传感器 3-门禁 4-仪表 5-仪器, 参考DeviceTypeEnum)")
|
||||
private Integer deviceType;
|
||||
|
||||
/** 设备类型 */
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private Integer deviceCategory;
|
||||
|
||||
/** 设备型号 */
|
||||
@ApiModelProperty(value = "设备型号")
|
||||
private String deviceSize;
|
||||
|
||||
/** 设备名称 */
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/** 设备sn */
|
||||
@ApiModelProperty(value = "设备sn")
|
||||
private String deviceSn;
|
||||
|
||||
/** 所在位置 */
|
||||
@ApiModelProperty(value = "所在位置")
|
||||
private String subPlace;
|
||||
|
||||
/** 设备是否在线 1 在线 2 离线 */
|
||||
@ApiModelProperty(value = "设备是否在线 1 在线 2 离线")
|
||||
private Integer deviceNetworkState;
|
||||
|
||||
/** 设备维护周期 1 每月 2 每季度 3 每半年 4 每年 */
|
||||
@ApiModelProperty(value = " 设备维护周期 1 每月 2 每季度 3 每半年 4 每年")
|
||||
private Long deviceRepairPeriod;
|
||||
|
||||
/** 设备扩展信息表 */
|
||||
@ApiModelProperty(value = "设备扩展信息表")
|
||||
private String deviceExtendInfo;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
private String areaName;
|
||||
|
||||
private String canteenName;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.bonus.canteen.core.kitchen.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 厨房设备使用记录对象 kitchen_device_usage
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class KitchenDeviceUsageListVO {
|
||||
|
||||
/** 主键id */
|
||||
private Long usageId;
|
||||
|
||||
/** 设备编号 */
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String deviceNo;
|
||||
|
||||
/** 设备id */
|
||||
@ApiModelProperty(value = "设备id")
|
||||
private Long deviceId;
|
||||
|
||||
/** 设备类型 */
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private Long deviceType;
|
||||
|
||||
/** 区域id */
|
||||
@ApiModelProperty(value = "区域id")
|
||||
private Long areaId;
|
||||
|
||||
@ApiModelProperty(value = "区域名称")
|
||||
private String areaName;
|
||||
|
||||
/** 食堂id */
|
||||
@ApiModelProperty(value = "食堂id")
|
||||
private Long canteenId;
|
||||
|
||||
@ApiModelProperty(value = "食堂名称")
|
||||
private String canteenName;
|
||||
|
||||
/** 工作状态 */
|
||||
@ApiModelProperty(value = "工作状态")
|
||||
private Long workState;
|
||||
|
||||
/** 开始使用时间 */
|
||||
@ApiModelProperty(value = "开始使用时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startUseTime;
|
||||
|
||||
/** 结束使用时间 */
|
||||
@ApiModelProperty(value = "结束使用时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endUseTime;
|
||||
|
||||
/** 使用时长 */
|
||||
@ApiModelProperty(value = "使用时长")
|
||||
private BigDecimal useTime;
|
||||
|
||||
/** 是否结束标志 */
|
||||
@ApiModelProperty(value = "是否结束标志")
|
||||
private Long endTag;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.canteen.core.kitchen.mapper.KitchenDeviceInfoMapper">
|
||||
<resultMap type="com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo" id="KitchenDeviceInfoResult">
|
||||
<resultMap type="com.bonus.canteen.core.kitchen.vo.KitchenDeviceListVO" id="KitchenDeviceInfoResult">
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="deviceNo" column="device_no" />
|
||||
<result property="canteenId" column="canteen_id" />
|
||||
|
|
@ -19,23 +19,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="deviceRepairPeriod" column="device_repair_period" />
|
||||
<result property="deviceExtendInfo" column="device_extend_info" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="areaName" column="areaName" />
|
||||
<result property="canteenName" column="canteenName" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectKitchenDeviceInfoVo">
|
||||
select device_id, device_no, canteen_id, area_id, device_pwd, device_type, device_category, device_size, device_name, device_sn, sub_place, device_network_state, device_repair_period, device_extend_info, del_flag, create_by, create_time, update_by, update_time from kitchen_device_info
|
||||
SELECT
|
||||
device_id,
|
||||
device_no,
|
||||
canteen_id,
|
||||
area_id,
|
||||
device_pwd,
|
||||
device_type,
|
||||
device_category,
|
||||
device_size,
|
||||
device_name,
|
||||
device_sn,
|
||||
sub_place,
|
||||
device_network_state,
|
||||
device_repair_period,
|
||||
device_extend_info,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
vac.vAreaName as areaName,
|
||||
vac.vCanteenName as canteenName
|
||||
FROM
|
||||
kitchen_device_info kit
|
||||
LEFT JOIN v_area_canteen vac on vac.vAreaId = kit.area_id and vac.vCanteenId = kit.canteen_id
|
||||
</sql>
|
||||
|
||||
<select id="selectKitchenDeviceInfoList" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo" resultMap="KitchenDeviceInfoResult">
|
||||
<select id="selectKitchenDeviceInfoList" parameterType="com.bonus.canteen.core.kitchen.dto.KitchenDeviceListDTO" resultMap="KitchenDeviceInfoResult">
|
||||
<include refid="selectKitchenDeviceInfoVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and device_no = #{deviceNo}</if>
|
||||
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
||||
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||
<if test="devicePwd != null and devicePwd != ''"> and device_pwd = #{devicePwd}</if>
|
||||
<if test="deviceType != null "> and device_type = #{deviceType}</if>
|
||||
<if test="deviceCategory != null "> and device_category = #{deviceCategory}</if>
|
||||
<if test="deviceSize != null and deviceSize != ''"> and device_size = #{deviceSize}</if>
|
||||
|
|
@ -43,16 +64,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceSn != null and deviceSn != ''"> and device_sn = #{deviceSn}</if>
|
||||
<if test="subPlace != null and subPlace != ''"> and sub_place = #{subPlace}</if>
|
||||
<if test="deviceNetworkState != null "> and device_network_state = #{deviceNetworkState}</if>
|
||||
<if test="deviceRepairPeriod != null "> and device_repair_period = #{deviceRepairPeriod}</if>
|
||||
<if test="deviceExtendInfo != null and deviceExtendInfo != ''"> and device_extend_info = #{deviceExtendInfo}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectKitchenDeviceInfoByDeviceId" parameterType="Long" resultMap="KitchenDeviceInfoResult">
|
||||
<include refid="selectKitchenDeviceInfoVo"/>
|
||||
where device_id = #{deviceId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertKitchenDeviceInfo" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenDeviceInfo" useGeneratedKeys="true" keyProperty="deviceId">
|
||||
insert into kitchen_device_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -122,14 +141,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where device_id = #{deviceId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteKitchenDeviceInfoByDeviceId" parameterType="Long">
|
||||
delete from kitchen_device_info where device_id = #{deviceId}
|
||||
</delete>
|
||||
<!-- <delete id="deleteKitchenDeviceInfoByDeviceId" parameterType="Long">-->
|
||||
<!-- delete from kitchen_device_info where device_id = #{deviceId}-->
|
||||
<!-- </delete>-->
|
||||
|
||||
<delete id="deleteKitchenDeviceInfoByDeviceIds" parameterType="String">
|
||||
delete from kitchen_device_info where device_id in
|
||||
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
|
||||
<!-- <delete id="deleteKitchenDeviceInfoByDeviceIds" parameterType="String">-->
|
||||
<!-- delete from kitchen_device_info where device_id in -->
|
||||
<!-- <foreach item="deviceId" collection="array" open="(" separator="," close=")">-->
|
||||
<!-- #{deviceId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </delete>-->
|
||||
<update id="deleteKitchenDeviceInfoByDeviceId" parameterType="Long">
|
||||
update kitchen_device_info set del_flag ='2' where device_id = #{deviceId}
|
||||
</update>
|
||||
<update id="deleteKitchenDeviceInfoByDeviceIds" parameterType="String">
|
||||
update kitchen_device_info set del_flag ='2' where device_id in
|
||||
<foreach item="deviceId" collection="list" open="(" separator="," close=")">
|
||||
#{deviceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -21,14 +21,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateTime" column="update_time" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="canteenName" column="canteen_name" />
|
||||
<result property="measureType" column="measure_type" />
|
||||
<result property="measureMaxValue" column="measure_max_value" />
|
||||
<result property="measureMinValue" column="measure_min_value" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectKitchenDeviceSensorRecordVo">
|
||||
select record_id, batch_no, kdsr.device_id, kdsr.device_type, kdsr.measure_code, measure_data,
|
||||
gateway_device_id, device_time, kdsr.sub_place, kdsr.canteen_id, kdsr.area_id, kdsr.create_by,
|
||||
kdsr.create_time, kdsr.update_by, kdsr.update_time, kdi.device_name, bc.canteen_name
|
||||
kdsr.create_time, kdsr.update_by, kdsr.update_time, kdi.device_name, bc.canteen_name,
|
||||
kdsm.measure_type, kdsm.measure_max_value, kdsm.measure_min_value
|
||||
from kitchen_device_sensor_record kdsr
|
||||
left join kitchen_device_sensor_metric kdsm on kdsm.measure_code = kdsr.measure_code
|
||||
left join kitchen_device_sensor_metric kdsm on kdsm.measure_code = kdsr.measure_code and kdsm.device_type = kdsr.device_type
|
||||
left join kitchen_device_info kdi on kdi.device_id = kdsr.device_id
|
||||
left join basic_canteen bc on bc.canteen_id = kdi.canteen_id
|
||||
</sql>
|
||||
|
|
@ -97,10 +101,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
and kdsr.create_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
and kdsr.device_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and kdsr.create_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
and kdsr.device_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.canteen.core.kitchen.mapper.KitchenDeviceUsageMapper">
|
||||
<resultMap type="com.bonus.canteen.core.kitchen.domain.KitchenDeviceUsage" id="KitchenDeviceUsageResult">
|
||||
<resultMap type="com.bonus.canteen.core.kitchen.vo.KitchenDeviceUsageListVO" id="KitchenDeviceUsageResult">
|
||||
<result property="usageId" column="usage_id" />
|
||||
<result property="deviceNo" column="device_no" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
|
|
@ -15,37 +15,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="endUseTime" column="end_use_time" />
|
||||
<result property="useTime" column="use_time" />
|
||||
<result property="endTag" column="end_tag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="areaName" column="areaName" />
|
||||
<result property="canteenName" column="canteenName" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectKitchenDeviceUsageVo">
|
||||
select usage_id, device_no, device_id, device_type, area_id, canteen_id, work_state, start_use_time, end_use_time, use_time, end_tag, create_by, create_time, update_by, update_time from kitchen_device_usage
|
||||
SELECT
|
||||
usage_id,
|
||||
device_no,
|
||||
device_id,
|
||||
device_type,
|
||||
area_id,
|
||||
canteen_id,
|
||||
CASE
|
||||
WHEN kdu.work_state = 1 THEN '工作中'
|
||||
WHEN kdu.work_state = 0 THEN '离线'
|
||||
ELSE '未知状态'
|
||||
END as work_state,
|
||||
start_use_time,
|
||||
end_use_time,
|
||||
use_time,
|
||||
end_tag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
vac.vAreaName as areaName,
|
||||
vac.vCanteenName as canteenName
|
||||
FROM
|
||||
kitchen_device_usage kdu
|
||||
LEFT JOIN v_area_canteen vac on kdu.canteen_id = vac.vCanteenId and kdu.area_id = vac.vAreaId
|
||||
</sql>
|
||||
|
||||
<select id="selectKitchenDeviceUsageList" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenDeviceUsage" resultMap="KitchenDeviceUsageResult">
|
||||
<select id="selectKitchenDeviceUsageList" parameterType="com.bonus.canteen.core.kitchen.dto.KitchenDeviceUsageListDTO" resultMap="KitchenDeviceUsageResult">
|
||||
<include refid="selectKitchenDeviceUsageVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and device_no = #{deviceNo}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="deviceType != null "> and device_type = #{deviceType}</if>
|
||||
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
||||
<if test="workState != null "> and work_state = #{workState}</if>
|
||||
<if test="startUseTime != null "> and start_use_time = #{startUseTime}</if>
|
||||
<if test="endUseTime != null "> and end_use_time = #{endUseTime}</if>
|
||||
<if test="useTime != null "> and use_time = #{useTime}</if>
|
||||
<if test="endTag != null "> and end_tag = #{endTag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectKitchenDeviceUsageByUsageId" parameterType="Long" resultMap="KitchenDeviceUsageResult">
|
||||
<include refid="selectKitchenDeviceUsageVo"/>
|
||||
where usage_id = #{usageId}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertKitchenDeviceUsage" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenDeviceUsage" useGeneratedKeys="true" keyProperty="usageId">
|
||||
insert into kitchen_device_usage
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -108,9 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteKitchenDeviceUsageByUsageIds" parameterType="String">
|
||||
delete from kitchen_device_usage where usage_id in
|
||||
delete from kitchen_device_usage where usage_id in
|
||||
<foreach item="usageId" collection="array" open="(" separator="," close=")">
|
||||
#{usageId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.canteen.core.kitchen.mapper.KitchenHomePageMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -58,10 +58,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
and kscr.create_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
and kscr.operate_date <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and kscr.create_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
and kscr.operate_date <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -86,6 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
or bd.dishes_name like CONCAT('%',#{searchValue},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
and ksdr.sample_save_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and ksdr.sample_save_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -59,10 +59,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
and ksiw.create_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
and ksiw.record_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and ksiw.create_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
and ksiw.record_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
and ksmc.create_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
and ksmc.record_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and ksmc.create_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
and ksmc.record_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectKitchenWasteDealVo">
|
||||
select waste_id, weight, garbage_name, action_date, device_id, mealtime_type, canteen_id, area_id, deal_type, sale_amount, scene_picture, staff_id, create_by, create_time, update_by, update_time from kitchen_waste_deal
|
||||
select waste_id, weight, garbage_name, action_date, device_id, mealtime_type,
|
||||
kwd.canteen_id, kwd.area_id, deal_type, sale_amount, scene_picture, kwd.staff_id,
|
||||
kwd.create_by, kwd.create_time, kwd.update_by, kwd.update_time
|
||||
from kitchen_waste_deal kwd
|
||||
left join basic_canteen bc on kwd.canteen_id = bc.canteen_id
|
||||
left join kitchen_staff_info ksi on kwd.staff_id = ksi.staff_id
|
||||
left join sys_user su on ksi.user_id = su.user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectKitchenWasteDealList" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenWasteDeal" resultMap="KitchenWasteDealResult">
|
||||
|
|
@ -34,12 +40,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="actionDate != null "> and action_date = #{actionDate}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="mealtimeType != null "> and mealtime_type = #{mealtimeType}</if>
|
||||
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
||||
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||
<if test="canteenId != null "> and kwd.canteen_id = #{canteenId}</if>
|
||||
<if test="areaId != null "> and kwd.area_id = #{areaId}</if>
|
||||
<if test="dealType != null "> and deal_type = #{dealType}</if>
|
||||
<if test="saleAmount != null "> and sale_amount = #{saleAmount}</if>
|
||||
<if test="scenePicture != null and scenePicture != ''"> and scene_picture = #{scenePicture}</if>
|
||||
<if test="staffId != null "> and staff_id = #{staffId}</if>
|
||||
<if test="staffId != null "> and kwd.staff_id = #{staffId}</if>
|
||||
<if test="startDateTime != null">
|
||||
and kwd.action_date <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and kwd.action_date <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,10 +15,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="canteenName" column="canteen_name" />
|
||||
<result property="wasteMealCount" column="waste_meal_count" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectKitchenWasteMealVo">
|
||||
select ledger_id, ledger_time, mealtime_type, canteen_id, area_id, file_url, remark, create_by, create_time, update_by, update_time from kitchen_waste_meal
|
||||
select ledger_id, ledger_time, mealtime_type, kwm.canteen_id, kwm.area_id, file_url, remark,
|
||||
kwm.create_by, kwm.create_time, kwm.update_by, kwm.update_time, bc.canteen_name
|
||||
from kitchen_waste_meal kwm
|
||||
left join basic_canteen bc on bc.canteen_id = kwm.canteen_id
|
||||
</sql>
|
||||
|
||||
<select id="selectKitchenWasteMealList" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenWasteMeal" resultMap="KitchenWasteMealResult">
|
||||
|
|
@ -26,9 +31,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<where>
|
||||
<if test="ledgerTime != null "> and ledger_time = #{ledgerTime}</if>
|
||||
<if test="mealtimeType != null "> and mealtime_type = #{mealtimeType}</if>
|
||||
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
||||
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||
<if test="canteenId != null "> and kwm.canteen_id = #{canteenId}</if>
|
||||
<if test="areaId != null "> and kwm.area_id = #{areaId}</if>
|
||||
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||
<if test="startDateTime != null">
|
||||
and kwm.ledger_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and kwm.ledger_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
@ -92,4 +103,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{ledgerId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectKitchenWasteMealListCount" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenWasteMeal" resultMap="KitchenWasteMealResult">
|
||||
select ledger_time, mealtime_type, kwm.canteen_id, bc.canteen_name, count(*) as waste_meal_count
|
||||
from kitchen_waste_meal kwm
|
||||
left join basic_canteen bc on bc.canteen_id = kwm.canteen_id
|
||||
group by kwm.ledger_time, kwm.mealtime_type, kwm.canteen_id
|
||||
<where>
|
||||
<if test="ledgerTime != null "> and ledger_time = #{ledgerTime}</if>
|
||||
<if test="mealtimeType != null "> and mealtime_type = #{mealtimeType}</if>
|
||||
<if test="canteenId != null "> and kwm.canteen_id = #{canteenId}</if>
|
||||
<if test="areaId != null "> and kwm.area_id = #{areaId}</if>
|
||||
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||
<if test="startDateTime != null">
|
||||
and kwm.ledger_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and kwm.ledger_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue