Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c8e3ca6f11
|
|
@ -55,6 +55,17 @@ public class KitchenSampleDishesRecordController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询当前档口餐次的所有菜品及其留样特征
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询当前档口餐次的所有菜品及其留样特征")
|
||||||
|
//@RequiresPermissions("kitchen:record:list")
|
||||||
|
@PostMapping("/listDishes")
|
||||||
|
public TableDataInfo listDishes(@RequestBody @Valid KitchenSampleDishesRecord kitchenSampleDishesRecord) {
|
||||||
|
List<KitchenSampleDishesRecord> list = kitchenSampleDishesRecordService.getDishesByStallAndMealtimeType(kitchenSampleDishesRecord);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出留样机留样清单列表
|
* 导出留样机留样清单列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
package com.bonus.canteen.core.kitchen.domain;
|
package com.bonus.canteen.core.kitchen.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.bonus.canteen.core.common.utils.FileUrlUtil;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
@ -176,6 +179,9 @@ public class KitchenSampleDishesRecord extends BaseEntity {
|
||||||
@ApiModelProperty("菜品名称")
|
@ApiModelProperty("菜品名称")
|
||||||
private String dishesName;
|
private String dishesName;
|
||||||
|
|
||||||
|
@ApiModelProperty("菜品图片")
|
||||||
|
private String dishesImgUrl;
|
||||||
|
|
||||||
@ApiModelProperty("设备名称")
|
@ApiModelProperty("设备名称")
|
||||||
private String deviceName;
|
private String deviceName;
|
||||||
|
|
||||||
|
|
@ -183,4 +189,14 @@ public class KitchenSampleDishesRecord extends BaseEntity {
|
||||||
private String staffName;
|
private String staffName;
|
||||||
|
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|
||||||
|
private LocalDate applyDate;
|
||||||
|
|
||||||
|
public String getImageUrl() {
|
||||||
|
return FileUrlUtil.getFileUrl(this.imageUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDishesImgUrl() {
|
||||||
|
return FileUrlUtil.getFileUrl(this.dishesImgUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,4 +64,6 @@ public interface KitchenSampleDishesRecordMapper {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int handleKitchenSampleDishesTimeOut();
|
public int handleKitchenSampleDishesTimeOut();
|
||||||
|
|
||||||
|
public List<KitchenSampleDishesRecord> getDishesByStallAndMealtimeType(KitchenSampleDishesRecord kitchenSampleDishesRecord);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,4 +64,6 @@ public interface IKitchenSampleDishesRecordService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int handleKitchenSampleDishesTimeOut();
|
public int handleKitchenSampleDishesTimeOut();
|
||||||
|
|
||||||
|
public List<KitchenSampleDishesRecord> getDishesByStallAndMealtimeType(KitchenSampleDishesRecord kitchenSampleDishesRecord);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.canteen.core.kitchen.service.impl;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
@ -145,4 +146,21 @@ public class KitchenSampleDishesRecordServiceImpl implements IKitchenSampleDishe
|
||||||
public int handleKitchenSampleDishesTimeOut() {
|
public int handleKitchenSampleDishesTimeOut() {
|
||||||
return kitchenSampleDishesRecordMapper.handleKitchenSampleDishesTimeOut();
|
return kitchenSampleDishesRecordMapper.handleKitchenSampleDishesTimeOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<KitchenSampleDishesRecord> getDishesByStallAndMealtimeType(KitchenSampleDishesRecord kitchenSampleDishesRecord) {
|
||||||
|
kitchenSampleDishesRecord.setApplyDate(LocalDate.now());
|
||||||
|
List<KitchenSampleDishesRecord> fullDishes = kitchenSampleDishesRecordMapper.getDishesByStallAndMealtimeType(kitchenSampleDishesRecord);
|
||||||
|
List<KitchenSampleDishesRecord> sampleDishes = new ArrayList<>();
|
||||||
|
if(kitchenSampleDishesRecord.getSearchType().equals(SampleDishesSearchType.TODAY.getKey())) {
|
||||||
|
kitchenSampleDishesRecord.setStartDateTime(LocalDateTime.of(LocalDate.now(),LocalTime.MIDNIGHT));
|
||||||
|
kitchenSampleDishesRecord.setEndDateTime(LocalDateTime.of(LocalDate.now(),LocalTime.MAX));
|
||||||
|
sampleDishes = kitchenSampleDishesRecordMapper.selectKitchenSampleDishesRecordList(kitchenSampleDishesRecord);
|
||||||
|
}
|
||||||
|
for (KitchenSampleDishesRecord fullRecord : fullDishes) {
|
||||||
|
for (KitchenSampleDishesRecord sampleRecord : sampleDishes) {
|
||||||
|
fullRecord.setSampleSaveTime(sampleRecord.getSampleSaveTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fullDishes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="canteenName" column="canteen_name" />
|
<result property="canteenName" column="canteen_name" />
|
||||||
<result property="stallName" column="stall_name" />
|
<result property="stallName" column="stall_name" />
|
||||||
<result property="dishesName" column="dishes_name" />
|
<result property="dishesName" column="dishes_name" />
|
||||||
|
<result property="dishesImgUrl" column="dishes_img_url" />
|
||||||
<result property="deviceName" column="device_name" />
|
<result property="deviceName" column="device_name" />
|
||||||
<result property="staffName" column="staff_name" />
|
<result property="staffName" column="staff_name" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
@ -219,4 +220,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and enter_cabinet_time <![CDATA[ < ]]> NOW() - INTERVAL 48 HOUR
|
and enter_cabinet_time <![CDATA[ < ]]> NOW() - INTERVAL 48 HOUR
|
||||||
and enter_cabinet_time <![CDATA[ > ]]> NOW() - INTERVAL 72 HOUR
|
and enter_cabinet_time <![CDATA[ > ]]> NOW() - INTERVAL 72 HOUR
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getDishesByStallAndMealtimeType" resultMap="KitchenSampleDishesRecordResult">
|
||||||
|
select
|
||||||
|
crd.mealtime_type,
|
||||||
|
cd.dishes_id,
|
||||||
|
cd.dishes_name,
|
||||||
|
cd.image_url as dishes_img_url,
|
||||||
|
bc.canteen_id,
|
||||||
|
bc.canteen_name,
|
||||||
|
bs.stall_id,
|
||||||
|
bs.stall_name
|
||||||
|
from
|
||||||
|
cook_recipe_detail crd
|
||||||
|
inner join cook_recipe_dishes crdish on crd.recipe_detail_id = crdish.recipe_detail_id
|
||||||
|
inner join cook_dishes cd on crdish.dishes_id = cd.dishes_id
|
||||||
|
inner join cook_dishes_type cdt on cd.type_id = cdt.dishes_type_id
|
||||||
|
inner join cook_recipe cr on crd.recipe_id = cr.recipe_id
|
||||||
|
inner join cook_recipe_bind_app crba on cr.recipe_id = crba.recipe_id and crba.bind_type = 2
|
||||||
|
left join basic_canteen bc on cr.canteen_id = bc.canteen_id
|
||||||
|
left join basic_stall bs on cr.stall_id = bs.stall_id
|
||||||
|
where
|
||||||
|
crd.detail_type = 2 and crd.apply_date = #{applyDate} and bs.stall_id = #{stallId} and crd.mealtime_type = #{mealtimeType}
|
||||||
|
|
||||||
|
UNION
|
||||||
|
|
||||||
|
select
|
||||||
|
crd.mealtime_type,
|
||||||
|
cd.dishes_id,
|
||||||
|
cd.dishes_name,
|
||||||
|
cd.image_url as dishes_img_url,
|
||||||
|
bc.canteen_id,
|
||||||
|
bc.canteen_name,
|
||||||
|
bs.stall_id,
|
||||||
|
bs.stall_name
|
||||||
|
from
|
||||||
|
cook_recipe_detail crd
|
||||||
|
inner join cook_recipe_dishes crdish on crd.recipe_detail_id = crdish.recipe_detail_id
|
||||||
|
inner join cook_dishes cd on crdish.dishes_id = cd.dishes_id
|
||||||
|
inner join cook_dishes_type cdt on cd.type_id = cdt.dishes_type_id
|
||||||
|
inner join cook_recipe cr on crd.recipe_id = cr.recipe_id
|
||||||
|
inner join cook_recipe_bind_device crbd on cr.recipe_id = crbd.recipe_id
|
||||||
|
left join basic_canteen bc on cr.canteen_id = bc.canteen_id
|
||||||
|
left join basic_stall bs on cr.stall_id = bs.stall_id
|
||||||
|
where
|
||||||
|
crd.detail_type = 2 and crd.apply_date = #{applyDate} and bs.stall_id = #{stallId} and crd.mealtime_type = #{mealtimeType}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue