diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java index 18b75c6..38195c7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/business/AccWalletInfoBusiness.java @@ -190,7 +190,7 @@ public class AccWalletInfoBusiness { || walletInfo.getWalletBal().compareTo(BigDecimal.ZERO) < 0 || (walletInfo.getWalletBal().compareTo(operation.getAmount()) < 0)) { log.info("钱包余额:{}", walletInfo.getWalletBal()); - throw new ServiceException("钱包余额不足"); + throw new ServiceException("个人钱包余额不足"); } if(AccTradeTypeEnum.CLEAR.getKey().equals(operation.getOperationType())) { operation.setAmount(walletInfo.getWalletBal()); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/domain/CookDishes.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/domain/CookDishes.java index 5a9d9a2..b1a16a8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/domain/CookDishes.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/domain/CookDishes.java @@ -153,7 +153,7 @@ public class CookDishes extends BaseEntity { @Excel(name = "菜品基础单价(分)") @ApiModelProperty(value = "菜品基础单价(分)") @Max(value = 99999L, message = "菜品价格超过限制") - private Long price; + private BigDecimal price; /** 单位价格 */ @Excel(name = "单位价格") diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookMaterialMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookMaterialMapper.java index ba2833f..f8938dc 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookMaterialMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookMaterialMapper.java @@ -66,7 +66,7 @@ public interface CookMaterialMapper { * @param materialId 其他参数(如原料ID等,用于更新时的校验) * @return 结果 */ - public int checkIsExistByCode(@Param("materialCode") String materialCode,@Param("materialId") Long materialId); + public int checkIsExistByCode(@Param("materialCode") String materialCode,@Param("materialId") Long materialId, @Param("type") Long type); /** * 校验是否存在 @@ -74,7 +74,7 @@ public interface CookMaterialMapper { * @param materialId 其他参数(如原料ID等,用于更新时的校验) * @return 结果 */ - public int checkIsExistByName(@Param("materialName") String materialName,@Param("materialId") Long materialId); + public int checkIsExistByName(@Param("materialName") String materialName,@Param("materialId") Long materialId, @Param("type") Long type); /** * 校验是否被使用 diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeMapper.java index efa7d25..09dfa59 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/mapper/CookRecipeMapper.java @@ -114,6 +114,8 @@ public interface CookRecipeMapper { List selectTmpBetweenDateDetailList(@Param("recipeIds") List recipeIds, @Param("applyStartDate") LocalDate applyStartDate, @Param("applyEndDate") LocalDate applyEndDate); + boolean checkRecipeIfBind(Long recipeIds); + //List selectTmpBetweenDateDetailList(@Param("recipeIds") List recipeIds, @Param("applyStartDate") LocalDate applyStartDate, @Param("applyEndDate") LocalDate applyEndDate); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java index 72c8d67..f9cfec1 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookDishesServiceImpl.java @@ -118,7 +118,7 @@ public class CookDishesServiceImpl implements ICookDishesService { try { checkParam(cookDishes, false); //转换价格金额元->分 - cookDishes.setPrice(Objects.isNull(cookDishes.getPrice()) ? 0L : cookDishes.getPrice() * 100); + cookDishes.setPrice(Objects.isNull(cookDishes.getPrice()) ? BigDecimal.ZERO : cookDishes.getPrice().multiply(BigDecimal.valueOf(100))); cookDishes.setUnitPrice(Objects.isNull(cookDishes.getUnitPrice()) ? 0L : cookDishes.getUnitPrice() * 100); cookDishes.setLargePrice(Objects.isNull(cookDishes.getLargePrice()) ? 0L : cookDishes.getLargePrice() * 100); cookDishes.setLittlePrice(Objects.isNull(cookDishes.getLittlePrice()) ? 0L : cookDishes.getLittlePrice() * 100); @@ -151,7 +151,7 @@ public class CookDishesServiceImpl implements ICookDishesService { try { checkParam(cookDishes, true); //转换价格金额元->分 - cookDishes.setPrice(Objects.isNull(cookDishes.getPrice()) ? 0L : cookDishes.getPrice() * 100); + cookDishes.setPrice(Objects.isNull(cookDishes.getPrice()) ? BigDecimal.ZERO : cookDishes.getPrice().multiply(BigDecimal.valueOf(100))); cookDishes.setUnitPrice(Objects.isNull(cookDishes.getUnitPrice()) ? 0L : cookDishes.getUnitPrice() * 100); cookDishes.setLargePrice(Objects.isNull(cookDishes.getLargePrice()) ? 0L : cookDishes.getLargePrice() * 100); cookDishes.setLittlePrice(Objects.isNull(cookDishes.getLittlePrice()) ? 0L : cookDishes.getLittlePrice() * 100); @@ -187,7 +187,7 @@ public class CookDishesServiceImpl implements ICookDishesService { if (StringUtils.isNull(cookDishes.getTypeId()) || cookDishes.getTypeId() == 0) { throw new ServiceException("菜品分类不能为空"); } - if (StringUtils.isNull(cookDishes.getPrice()) || cookDishes.getPrice() == 0) { + if (StringUtils.isNull(cookDishes.getPrice()) || cookDishes.getPrice().compareTo(BigDecimal.ZERO) < 0) { throw new ServiceException("菜品价格不能为空"); } if (StringUtils.isNull(cookDishes.getWeight()) || cookDishes.getWeight().compareTo(BigDecimal.ZERO) < 0) { @@ -549,7 +549,7 @@ public class CookDishesServiceImpl implements ICookDishesService { dishes.setStallId(menuDishesImportDTO.getStallId() == null ? null : Long.valueOf(menuDishesImportDTO.getStallId())); dishes.setAreaId(menuDishesImportDTO.getAreaId() == null ? null : Long.valueOf(menuDishesImportDTO.getAreaId())); dishes.setDishesName(menuDishesImportDTO.getDishesName()); - dishes.setPrice(menuDishesImportDTO.getPrice() == null ? null : Long.valueOf(String.valueOf(menuDishesImportDTO.getPrice().multiply(BigDecimal.valueOf(100))))); + dishes.setPrice(menuDishesImportDTO.getPrice() == null ? null : menuDishesImportDTO.getPrice().multiply(BigDecimal.valueOf(100))); dishes.setWeight(menuDishesImportDTO.getWeight() == null ? null : menuDishesImportDTO.getWeight()); dishes.setWeightDeviation(BigDecimal.ZERO); dishes.setTypeId(menuDishesImportDTO.getTypeId() == null ? null : Long.valueOf(menuDishesImportDTO.getTypeId())); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookMaterialServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookMaterialServiceImpl.java index 47aaa32..cfe2f0f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookMaterialServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookMaterialServiceImpl.java @@ -88,10 +88,10 @@ public class CookMaterialServiceImpl implements ICookMaterialService { if (cookMaterial.getGoodsType().equals(1L) && (StringUtils.isNull(cookMaterial.getNutritionId()) || cookMaterial.getNutritionId() == 0L)){ throw new ServiceException("请选择营养信息名称"); } - if (cookMaterialMapper.checkIsExistByCode(cookMaterial.getMaterialCode(), null) > 0) { + if (cookMaterialMapper.checkIsExistByCode(cookMaterial.getMaterialCode(), null,cookMaterial.getGoodsType()) > 0) { throw new ServiceException("该原料编码已存在"); } - if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), null) > 0) { + if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), null,cookMaterial.getGoodsType()) > 0) { throw new ServiceException("该原料名称已存在"); } cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? 0L : cookMaterial.getSalePrice() * 100); @@ -127,10 +127,10 @@ public class CookMaterialServiceImpl implements ICookMaterialService { if (cookMaterial.getGoodsType().equals(1L) && (StringUtils.isNull(cookMaterial.getNutritionId()) || cookMaterial.getNutritionId() == 0L)){ throw new ServiceException("请选择营养信息名称"); } - if (cookMaterialMapper.checkIsExistByCode(cookMaterial.getMaterialCode(), cookMaterial.getMaterialId()) > 0) { + if (cookMaterialMapper.checkIsExistByCode(cookMaterial.getMaterialCode(), cookMaterial.getMaterialId(),cookMaterial.getGoodsType()) > 0) { throw new ServiceException("该原料编码已存在"); } - if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), cookMaterial.getMaterialId()) > 0) { + if (cookMaterialMapper.checkIsExistByName(cookMaterial.getMaterialName(), cookMaterial.getMaterialId(),cookMaterial.getGoodsType()) > 0) { throw new ServiceException("该原料名称已存在"); } cookMaterial.setSalePrice(Objects.isNull(cookMaterial.getSalePrice()) ? 0L : cookMaterial.getSalePrice() * 100); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java index 24e2eb3..149b1e2 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/service/impl/CookRecipeServiceImpl.java @@ -499,6 +499,11 @@ public class CookRecipeServiceImpl implements ICookRecipeService { */ @Override public int deleteCookRecipeByRecipeIds(Long[] recipeIds) { + //验证是否存在绑定关系 + boolean exists = cookRecipeMapper.checkRecipeIfBind(recipeIds[0]); + if (exists){ + throw new ServiceException("菜谱已被使用,不能删除!"); + } List cookRecipeDetailIds = cookRecipeDetailMapper.getAllCookRecipeDetailIds(recipeIds); Long[] cookRecipeDetailArray = cookRecipeDetailIds.stream().toArray(Long[]::new); cookRecipeDishesMapper.deleteCookRecipeDishesByCookRecipeDetailIds(cookRecipeDetailArray); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/utils/CookRecipeImportListener.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/utils/CookRecipeImportListener.java index b0b31df..410a71c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/utils/CookRecipeImportListener.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/utils/CookRecipeImportListener.java @@ -122,8 +122,8 @@ public class CookRecipeImportListener extends AnalysisEventListener difference = DifferenceCalculator.calculateDifference(this.dishesNames, cookDishesList); System.out.println("差集结果: " + difference); - if (difference != null && difference.size() > 0) { - throw new ServiceException("以下菜品不存在:" + difference); + if (!difference.isEmpty()) { + throw new ServiceException("以下菜品不存在: " + difference); } Map nameMap = cookDishesList.stream().collect(Collectors.groupingBy(CookDishes::getDishesName, Collectors.collectingAndThen(Collectors.toList(), (list) -> { return list.get(0); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/vo/CookDishesTypeVO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/vo/CookDishesTypeVO.java index 5418a3c..c5fe273 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/vo/CookDishesTypeVO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/cook/vo/CookDishesTypeVO.java @@ -18,4 +18,7 @@ public class CookDishesTypeVO extends BaseTreeNode implements Serializable { @ApiModelProperty(value = "菜品类型名称") private String dishesTypeName; + + @ApiModelProperty(value = "区域ID") + private String areaId; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ImsInventoryController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ImsInventoryController.java index 028cee4..417a815 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ImsInventoryController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/ImsInventoryController.java @@ -1,13 +1,9 @@ package com.bonus.canteen.core.ims.controller; -import java.util.ArrayList; import java.util.Collections; import java.util.List; -import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import cn.hutool.core.util.ObjectUtil; -import com.bonus.canteen.core.ims.domain.param.ImsInventoryAdd; import com.bonus.canteen.core.ims.domain.param.ImsInventoryQuery; import com.bonus.canteen.core.ims.domain.param.ImsInventoryUpdate; import com.bonus.canteen.core.ims.domain.vo.ImsInventoryVO; @@ -15,7 +11,6 @@ import com.bonus.canteen.core.ims.dto.ExpireWarningDTO; import com.bonus.canteen.core.ims.dto.InventoryWarningDTO; import com.bonus.canteen.core.ims.vo.ExpireWarningVO; import com.bonus.canteen.core.ims.vo.InventoryWarningVO; -import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.log.annotation.SysLog; @@ -25,12 +20,10 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.bonus.canteen.core.ims.domain.ImsInventory; import com.bonus.canteen.core.ims.service.IImsInventoryService; import com.bonus.common.core.web.page.TableDataInfo; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/Inquiry.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/Inquiry.java index 69c52b8..10658c8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/Inquiry.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/Inquiry.java @@ -106,7 +106,10 @@ public class Inquiry extends BaseEntity { @Excel(name = "选择的区域") @ApiModelProperty(value = "选择的区域") private String area; + private String bidStatus; + private String quoteAmount; + @Excel(name = "邀请供应商") @ApiModelProperty(value = "邀请供应商") private String inquirySupplierNum; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/InquirySupplierMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/InquirySupplierMapper.java index c41f8a7..0c3c0d7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/InquirySupplierMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/InquirySupplierMapper.java @@ -58,4 +58,6 @@ public interface InquirySupplierMapper { * @return 结果 */ public int deleteInquirySupplierByIds(Long[] ids); + + void updateOtherInquirySupplier(InquirySupplier inquirySupplier); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/WarehouseInfoMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/WarehouseInfoMapper.java index 584ebe1..b5100b0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/WarehouseInfoMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/WarehouseInfoMapper.java @@ -2,6 +2,7 @@ package com.bonus.canteen.core.ims.mapper; import java.util.List; import com.bonus.canteen.core.ims.domain.WarehouseInfo; +import org.apache.ibatis.annotations.Param; /** * 仓库信息Mapper接口 @@ -60,5 +61,7 @@ public interface WarehouseInfoMapper { */ public int deleteImsWarehouseInfoByWarehouseIds(Long[] warehouseIds); - int findWarehouseCode(WarehouseInfo imsWarehouseInfo); + int findWarehouseCode(@Param("bean") WarehouseInfo imsWarehouseInfo,@Param("isAdd") boolean isAdd); + int findWarehouseName(@Param("bean") WarehouseInfo imsWarehouseInfo,@Param("isAdd") boolean isAdd); + } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsInventoryServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsInventoryServiceImpl.java index c9d2c93..d6ac8c7 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsInventoryServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsInventoryServiceImpl.java @@ -67,7 +67,6 @@ public class ImsInventoryServiceImpl implements IImsInventoryService ImsInventory imsInventory = new ImsInventory(); BeanUtils.copyProperties(imsInventoryQuery, imsInventory); List imsInventoryList = imsInventoryMapper.selectImsInventoryList(imsInventory); - List imsInventoryVOList = new ArrayList<>(); if(CollUtil.isNotEmpty(imsInventoryList)) { Map materialIdCountMap = imsInventoryList.stream() .collect(Collectors.groupingBy(ImsInventoryVO::getMaterialId, @@ -80,16 +79,13 @@ public class ImsInventoryServiceImpl implements IImsInventoryService .collect(Collectors.groupingBy(ImsIntoInventoryDetailVO::getInventoryId, Collectors.mapping(detail -> detail.getInventoryNum().multiply(BigDecimal.valueOf(detail.getUnitPrice())), Collectors.reducing(BigDecimal.ZERO, BigDecimal::add)))); - ImsInventoryVO imsInventoryVO = new ImsInventoryVO(); - BeanUtils.copyProperties(inventory, imsInventoryVO); BigDecimal count = materialIdCountMap.get(inventory.getMaterialId()); - imsInventoryVO.setTotalNum(count == null ? BigDecimal.ZERO : count); + inventory.setTotalNum(count == null ? BigDecimal.ZERO : count); BigDecimal totalPrice = inventoryIdToTotalPrice.get(inventory.getInventoryId()); - imsInventoryVO.setTotalPrice(totalPrice == null ? BigDecimal.ZERO : totalPrice); - imsInventoryVOList.add(imsInventoryVO); + inventory.setTotalPrice(totalPrice == null ? BigDecimal.ZERO : totalPrice); } } - return imsInventoryVOList; + return imsInventoryList; } /** diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/InquiryServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/InquiryServiceImpl.java index b02f258..3934d70 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/InquiryServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/InquiryServiceImpl.java @@ -215,7 +215,12 @@ public class InquiryServiceImpl implements IInquiryService { inquirySupplier.setSupplierId(supplier.getSupplierId()); inquirySupplier.setInquiryId(supplier.getInquiryId()); inquirySupplier.setBidStatus(3+""); + //更新中标状态 inquirySupplierMapper.updateInquirySupplier(inquirySupplier); + //更新未中标状态 + inquirySupplier.setBidStatus(4+""); + inquirySupplierMapper.updateOtherInquirySupplier(inquirySupplier); + Inquiry inquiry=new Inquiry(); inquiry.setInquiryId(supplier.getInquiryId()); inquiry.setSupplierId(supplier.getSupplierId()); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/WarehouseInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/WarehouseInfoServiceImpl.java index 415d9b9..093597c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/WarehouseInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/WarehouseInfoServiceImpl.java @@ -53,7 +53,11 @@ public class WarehouseInfoServiceImpl implements IWarehouseInfoService { imsWarehouseInfo.setCreateTime(DateUtils.getNowDate()); try { //检查仓库id是否唯一,唯一的话进行下面,否在返回进行提示 - int warehouseCode = imsWarehouseInfoMapper.findWarehouseCode(imsWarehouseInfo); + int warehouseName = imsWarehouseInfoMapper.findWarehouseName(imsWarehouseInfo,false); + if (warehouseName>0) { + throw new ServiceException("仓库名称已存在"); + } + int warehouseCode = imsWarehouseInfoMapper.findWarehouseCode(imsWarehouseInfo,false); if (warehouseCode>0) { throw new ServiceException("仓库编码已存在"); } @@ -73,7 +77,11 @@ public class WarehouseInfoServiceImpl implements IWarehouseInfoService { public int updateImsWarehouseInfo(WarehouseInfo imsWarehouseInfo) { imsWarehouseInfo.setUpdateTime(DateUtils.getNowDate()); try { - int warehouseCode = imsWarehouseInfoMapper.findWarehouseCode(imsWarehouseInfo); + int warehouseName = imsWarehouseInfoMapper.findWarehouseName(imsWarehouseInfo,true); + if (warehouseName>0) { + throw new ServiceException("仓库名称已存在"); + } + int warehouseCode = imsWarehouseInfoMapper.findWarehouseCode(imsWarehouseInfo,true); if (warehouseCode>0) { throw new ServiceException("仓库编码已存在"); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/domain/KitchenDeviceInfo.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/domain/KitchenDeviceInfo.java index 65dac73..c71585e 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/domain/KitchenDeviceInfo.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/domain/KitchenDeviceInfo.java @@ -111,6 +111,7 @@ public class KitchenDeviceInfo extends Model { private String ip; private Integer channel; + @TableField(exist = false) private KitchenVideoDTO kitchenVideoDTO; } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/mapper/DataScreeningMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/mapper/DataScreeningMapper.java index 9927c81..0621973 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/mapper/DataScreeningMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/mapper/DataScreeningMapper.java @@ -34,9 +34,10 @@ public interface DataScreeningMapper { /** * 获取菜品销量 * @param date 日期 + * @param recipeIds 菜谱ID集合 * @return 菜品销量对象 */ - SingleModelVO selectDish(@Param("date")String date); + SingleModelVO selectDish(@Param("date")String date,@Param("recipeIds") List recipeIds); /** * 获取食堂订单及销量趋势 * @param startDate 开始日期 @@ -66,4 +67,10 @@ public interface DataScreeningMapper { * @return 订单类型占比对象 */ SingleModelVO selectOrderByDate(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("type") int type); + + /** + * 获取所有菜谱id + * @return 菜品ID集合 + */ + List selectAllRecipeIds(); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/service/DataScreeningServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/service/DataScreeningServiceImpl.java index 96ce983..dbfd71f 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/service/DataScreeningServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/screening/service/DataScreeningServiceImpl.java @@ -113,7 +113,9 @@ public class DataScreeningServiceImpl implements DataScreeningService { case PERSON: return mapper.selectPerson(date, orderType); case DISH: - return mapper.selectDish(date); + //查询所有绑定的菜谱 + List recipeIds = mapper.selectAllRecipeIds(); + return mapper.selectDish(date,recipeIds); default: return new SingleModelVO(); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccCardHisMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccCardHisMapper.xml index 476fe27..87b0678 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccCardHisMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/account/AccCardHisMapper.xml @@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ach.create_time BETWEEN #{startDateTime} AND #{endDateTime} + order by ach.create_time desc + - if_enable = '1' and stall_id = #{stallId} and mealtime_type = #{mealtimeType} and mealtime_name like concat('%', #{mealtimeName}, '%') diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookDishesMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookDishesMapper.xml index 7b38485..f5d56cd 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookDishesMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookDishesMapper.xml @@ -318,7 +318,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookMaterialMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookMaterialMapper.xml index 032394b..73bb8d9 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookMaterialMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookMaterialMapper.xml @@ -114,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" material_code = #{materialCode} and material_id != #{materialId} + and goods_type = #{type} @@ -122,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" material_name = #{materialName} and material_id != #{materialId} + and goods_type = #{type} diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeMapper.xml index d8783bb..30b0a24 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/cook/CookRecipeMapper.xml @@ -511,5 +511,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mrd.apply_date between #{applyStartDate} and #{applyEndDate} order by mrd.apply_date + + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/InquirySupplierMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/InquirySupplierMapper.xml index fc0945e..ce965e0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/InquirySupplierMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/InquirySupplierMapper.xml @@ -105,4 +105,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + + update ims_inquiry_supplier + + bid_status = #{bidStatus}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where inquiry_id = #{inquiryId} and supplier_id != #{supplierId} + \ No newline at end of file diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/QuoteMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/QuoteMapper.xml index 2f0f54f..c2906c6 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/QuoteMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/QuoteMapper.xml @@ -23,6 +23,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -207,7 +209,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select * from ( select aa.inquiry_id, aa.area_id, aa.inquiry_code, aa.title, aa.start_time, aa.end_time, aa.status, aa.bid_time, aa.request_arrival_time, aa.inquiry_notes, aa.phone, aa.link_man, aa.address, aa.bid_total_price, aa.supplier_id, - bb.area_name as area, aa.create_by, aa.create_time, aa.update_by, aa.update_time + bb.area_name as area, aa.create_by, aa.create_time, aa.update_by, aa.update_time,cc.bid_status,cc.quote_amount from ims_inquiry aa left join basic_area bb on aa.area_id=bb.area_id LEFT JOIN ims_inquiry_supplier cc on cc.inquiry_id = aa.inquiry_id @@ -222,6 +224,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and (aa.inquiry_code like CONCAT('%',#{searchValue},'%') or aa.title like CONCAT('%',#{searchValue},'%') ) + and cc.bid_status = #{bidStatus} and aa.status = 1 and aa.status = 3 and aa.status = 4 diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ReportPlanMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ReportPlanMapper.xml index 52cd91a..fd2855a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ReportPlanMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/ReportPlanMapper.xml @@ -33,15 +33,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and cd.dishes_name like concat('%', #{dishesName}, '%') - and exists (select 1 from ims_production_plan_detail ippd where - ipp.plan_id = ippd.production_plan_id and ippd.detail_date = ]]> #{startTime} - and ippd.detail_date #{endTime} ) + and ippd.detail_date #{endTime} group by ipp.plan_id, ippd.dishes_id, ippd.detail_date + order by + ippd.detail_date desc select count(1) from ims_warehouse_info - where warehouse_code = #{warehouseCode} and warehouse_id != #{warehouseId} + where warehouse_code = #{bean.warehouseCode} + + and warehouse_id != #{bean.warehouseId} + @@ -173,4 +176,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{warehouseId} + + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/screening/DataScreeningMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/screening/DataScreeningMapper.xml index fc5e122..f9ebadd 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/screening/DataScreeningMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/screening/DataScreeningMapper.xml @@ -58,6 +58,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from cook_recipe_detail mrd left join cook_recipe_dishes mrd2 on mrd.recipe_detail_id = mrd2.recipe_detail_id where mrd.apply_date = #{date} and mrd.detail_type = '2' + + and mrd.recipe_id in + + #{id} + + + + \ No newline at end of file