bug 食堂修改
This commit is contained in:
parent
cbb28cd249
commit
5ecfa7ab36
|
|
@ -4,6 +4,7 @@ import com.bonus.common.houqin.constant.GlobalConstants;
|
|||
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -23,7 +24,10 @@ public class DateUtil {
|
|||
}
|
||||
return objects;
|
||||
}
|
||||
|
||||
public static String parseLocalDateTimeToStr(LocalDateTime time) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
return time.format(formatter);
|
||||
}
|
||||
public static List<LocalDate> getLastWeek() {
|
||||
List<LocalDate> dates = new ArrayList<>();
|
||||
LocalDate now = LocalDate.now();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import javax.validation.constraints.Max;
|
|||
|
||||
/**
|
||||
* 菜品信息对象 cook_dishes
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
|
|
@ -392,6 +392,7 @@ public class CookDishes extends BaseEntity {
|
|||
private String salesNum;
|
||||
@ApiModelProperty(value = "胡萝卜素(μg/100g)")
|
||||
private BigDecimal carotene;
|
||||
private String hasInventory;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -649,7 +649,7 @@ public class CookDishesServiceImpl implements ICookDishesService {
|
|||
}
|
||||
List<CookDishesMaterialModel> cookDishesMaterialModelList = this.cookDishesMapper.listDishesMaterial(dishesIdList);
|
||||
if (CollectionUtils.isEmpty(cookDishesMaterialModelList)) {
|
||||
throw new ServiceException("原料列表不能为空");
|
||||
throw new ServiceException("菜品缺少组成原料信息,无法生成采购计划");
|
||||
}
|
||||
Iterator ite10 = cookDishesMaterialModelList.iterator();
|
||||
while(true) {
|
||||
|
|
|
|||
|
|
@ -190,4 +190,6 @@ public class OrderGoods extends BaseEntity {
|
|||
@ApiModelProperty(value = "是否全部验货 1是2否")
|
||||
private String isInspect ;
|
||||
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import java.util.Date;
|
|||
|
||||
/**
|
||||
* 生产计划主对象 ims_production_plan
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-14
|
||||
*/
|
||||
|
|
@ -50,4 +50,7 @@ public class ReportProductionPlanQuery implements Serializable {
|
|||
@ApiModelProperty("结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endDateTime;
|
||||
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.canteen.core.ims.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -9,6 +11,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.bonus.canteen.core.common.utils.DateUtil;
|
||||
import com.bonus.canteen.core.ims.domain.OrderGoodsDetail;
|
||||
import com.bonus.canteen.core.ims.domain.OrderGoodsPayStyle;
|
||||
import com.bonus.canteen.core.ims.domain.ProductionPurchaseOrder;
|
||||
|
|
@ -157,6 +160,15 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService {
|
|||
*/
|
||||
@Override
|
||||
public List<OrderGoodsVO> selectOrderGoodsList(OrderGoods orderGoods) {
|
||||
LocalDateTime startDateTime = orderGoods.getStartDateTime();
|
||||
LocalDateTime endDateTime = orderGoods.getEndDateTime();
|
||||
if(startDateTime != null && endDateTime != null) {
|
||||
//获取时间字符串格式
|
||||
String startTime = DateUtil.parseLocalDateTimeToStr(startDateTime);
|
||||
String endTime = DateUtil.parseLocalDateTimeToStr(endDateTime);
|
||||
orderGoods.setStartTime(startTime);
|
||||
orderGoods.setEndTime(endTime);
|
||||
}
|
||||
List<OrderGoodsVO> purchasePlanVOList = orderGoodsMapper.selectOrderGoodsList(orderGoods);
|
||||
if(CollUtil.isNotEmpty(purchasePlanVOList)) {
|
||||
for(OrderGoodsVO orderGoodsVO : purchasePlanVOList) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.canteen.core.ims.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.canteen.core.common.utils.DateUtil;
|
||||
import com.bonus.canteen.core.ims.domain.OrderGoods;
|
||||
import com.bonus.canteen.core.ims.domain.ProductionPurchaseOrder;
|
||||
import com.bonus.canteen.core.ims.domain.PurchasePlan;
|
||||
|
|
@ -14,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
@ -21,7 +24,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
/**
|
||||
* 生产计划主Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-14
|
||||
*/
|
||||
|
|
@ -45,9 +48,20 @@ public class ReportPlanServiceImpl implements IReportPlanService {
|
|||
|
||||
@Override
|
||||
public List<ReportProductionPlanVO> selectProductionPlanList(ReportProductionPlanQuery productionPlan) {
|
||||
LocalDateTime startDateTime = productionPlan.getStartDateTime();
|
||||
LocalDateTime endDateTime = productionPlan.getEndDateTime();
|
||||
if (startDateTime != null && endDateTime != null) {
|
||||
// 转换为字符串格式
|
||||
String startStr = DateUtil.parseLocalDateTimeToStr(startDateTime);
|
||||
String endStr = DateUtil.parseLocalDateTimeToStr(endDateTime);
|
||||
// 可选:设置回 query 中的 String 字段用于 Mapper(如果你有 String 类型的字段)
|
||||
productionPlan.setStartTime(startStr);
|
||||
productionPlan.setEndTime(endStr);
|
||||
}
|
||||
return reportPlanMapper.selectProductionPlanList(productionPlan);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ReportPurchasePlanVO> selectPurchasePlanList(ReportPurchasePlanQuery productionPlan) {
|
||||
return reportPlanMapper.selectPurchasePlanList(productionPlan);
|
||||
|
|
|
|||
|
|
@ -94,10 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and iog.total_num <![CDATA[ > ]]> iog.totalIntoNum
|
||||
</if>
|
||||
<if test="startDateTime != null">
|
||||
and iog.create_time <![CDATA[ >= ]]> #{startDateTime}
|
||||
and iog.request_arrival_time <![CDATA[ >= ]]> #{startTime}
|
||||
</if>
|
||||
<if test="endDateTime != null">
|
||||
and iog.create_time <![CDATA[ <= ]]> #{endDateTime}
|
||||
and iog.request_arrival_time <![CDATA[ <= ]]> #{endTime}
|
||||
</if>
|
||||
<if test="orderGoodsCodeList != null and orderGoodsCodeList.size() > 0">
|
||||
and iog.order_goods_code in
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="startDateTime != null and endDateTime != null">
|
||||
and exists (select 1 from ims_production_plan_detail ippd where
|
||||
ipp.plan_id = ippd.production_plan_id
|
||||
and ippd.detail_date <![CDATA[ >= ]]> #{startDateTime}
|
||||
and ippd.detail_date <![CDATA[ <= ]]> #{endDateTime} )
|
||||
and ippd.detail_date <![CDATA[ >= ]]> #{startTime}
|
||||
and ippd.detail_date <![CDATA[ <= ]]> #{endTime} )
|
||||
</if>
|
||||
group by
|
||||
ipp.plan_id,
|
||||
|
|
@ -160,4 +160,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue