diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/config/SchedulingConfig.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/config/SchedulingConfig.java index 591bea1..e060ac8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/config/SchedulingConfig.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/healthmachine/config/SchedulingConfig.java @@ -26,4 +26,4 @@ public class SchedulingConfig { public void scheduledTask() { tcpMonitorService.checkAllDevicesAsyncByScheduled(); } -} \ No newline at end of file +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/PersonSettingController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/PersonSettingController.java index 94381a2..52d0515 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/PersonSettingController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/controller/PersonSettingController.java @@ -22,7 +22,7 @@ public class PersonSettingController extends BaseController { @ApiOperation("供应链人员配置-查询") @GetMapping("/getList") public TableDataInfo getList(PersonSetting dto) { - if("0".equals(dto.getIsPaging())){ + if(dto.getIsPaging() ==0){ startPage(); } return getDataTable(service.getList(dto)); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsIntoInventory.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsIntoInventory.java index 0768fe8..2912650 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsIntoInventory.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsIntoInventory.java @@ -76,6 +76,8 @@ public class ImsIntoInventory extends BaseEntity @Excel(name = "关联采购订单号") private String relateOrderGoodsId; + private Long orderGoodsId; + /** 关联验货单号 */ @ApiModelProperty(value = "关联验货单号") @Excel(name = "关联验货单号") diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsIntoInventoryDetail.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsIntoInventoryDetail.java index 632bd52..4cc3dd2 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsIntoInventoryDetail.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/ImsIntoInventoryDetail.java @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; /** * 入库记录明细对象 ims_into_inventory_detail - * + * * @author gaowdong * @date 2025-07-07 */ @@ -163,4 +163,6 @@ public class ImsIntoInventoryDetail extends BaseEntity @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private LocalDateTime intoDate; + private Long orderGoodsId; + } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/ImsIntoInventoryAdd.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/ImsIntoInventoryAdd.java index dabbd87..55176fe 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/ImsIntoInventoryAdd.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/ImsIntoInventoryAdd.java @@ -77,6 +77,8 @@ public class ImsIntoInventoryAdd implements Serializable @ApiModelProperty(value = "关联采购订单号") private String relateOrderGoodsId; + private Long orderGoodsId; + /** 关联验货单号 */ @ApiModelProperty(value = "关联验货单号") private String relateInspectGoodsId; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/ImsIntoInventoryDetailAdd.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/ImsIntoInventoryDetailAdd.java index 12c791f..c9aa7ec 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/ImsIntoInventoryDetailAdd.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/domain/param/ImsIntoInventoryDetailAdd.java @@ -115,6 +115,8 @@ public class ImsIntoInventoryDetailAdd implements Serializable /** 关联送货单明细id */ @ApiModelProperty(value = "关联送货单明细id") private Long relateDeliveryGoodsDetailId; + + private Long orderGoodsId; // // /** 删除标志(0代表存在 2代表删除) */ // private String delFlag; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/enums/DrpOrderNumAndAmountModel.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/enums/DrpOrderNumAndAmountModel.java new file mode 100644 index 0000000..27b460b --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/enums/DrpOrderNumAndAmountModel.java @@ -0,0 +1,15 @@ +package com.bonus.canteen.core.ims.enums; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.Generated; + +@ApiModel +@Data +public class DrpOrderNumAndAmountModel { + @ApiModelProperty("采购订单数量") + private int orderNum; + @ApiModelProperty("采购订单金额") + private long orderAmount; +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/enums/ImsInquiryStatusEnum.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/enums/ImsInquiryStatusEnum.java new file mode 100644 index 0000000..60b27c7 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/enums/ImsInquiryStatusEnum.java @@ -0,0 +1,67 @@ +package com.bonus.canteen.core.ims.enums; + +import com.google.common.collect.Lists; + +import java.util.List; + +public enum ImsInquiryStatusEnum { + NO_COMMIT(1, "待提交"), + ALREADY_QUOTE(2, "已决标"), + DOING_QUOTE(3, "未决标"), + LOSE_THE_BID(5, "已取消"); + + private final Integer key; + private final String value; + + private ImsInquiryStatusEnum(Integer key, String value) { + this.key = key; + this.value = value; + } + + public static Integer getKey(String value) { + ImsInquiryStatusEnum[] enums = values(); + ImsInquiryStatusEnum[] var2 = enums; + int var3 = enums.length; + + for(int var4 = 0; var4 < var3; ++var4) { + ImsInquiryStatusEnum temp = var2[var4]; + if (temp.value().equals(value)) { + return temp.key(); + } + } + + return null; + } + + public static String getValue(Integer key) { + ImsInquiryStatusEnum[] enums = values(); + ImsInquiryStatusEnum[] var2 = enums; + int var3 = enums.length; + + for(int var4 = 0; var4 < var3; ++var4) { + ImsInquiryStatusEnum temp = var2[var4]; + if (temp.key().equals(key)) { + return temp.value(); + } + } + + return null; + } + + public static List listNotCommitStatus() { + return Lists.newArrayList(new Integer[]{NO_COMMIT.key, LOSE_THE_BID.key}); + } + + public Integer key() { + return this.key; + } + + public String value() { + return this.value; + } + + // $FF: synthetic method + private static ImsInquiryStatusEnum[] $values() { + return new ImsInquiryStatusEnum[]{NO_COMMIT, ALREADY_QUOTE, DOING_QUOTE, LOSE_THE_BID}; + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/SupplierBindMaterialMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/SupplierBindMaterialMapper.java index fa02274..9ee4e45 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/SupplierBindMaterialMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/SupplierBindMaterialMapper.java @@ -75,4 +75,6 @@ public interface SupplierBindMaterialMapper { List selectSupplierBindcategoryList(SupplierBindMaterial supplierBindMaterial); + + int insertSupplierBindMaterialList(@Param("list") List alternativeSuppliers); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/SupplierMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/SupplierMapper.java index ab3a016..81de7e8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/SupplierMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/mapper/SupplierMapper.java @@ -1,5 +1,7 @@ package com.bonus.canteen.core.ims.mapper; +import java.math.BigDecimal; +import java.time.LocalDate; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -7,6 +9,9 @@ import com.bonus.canteen.core.ims.domain.Supplier; import com.bonus.canteen.core.ims.dto.SupplierPageDTO; import com.bonus.canteen.core.ims.dto.SupplierScoreDTO; import com.bonus.canteen.core.ims.dto.SupplyStatisticsPageDTO; +import com.bonus.canteen.core.ims.enums.DrpOrderNumAndAmountModel; +import com.bonus.canteen.core.ims.model.SupplierBidTimesAndAmountModel; +import com.bonus.canteen.core.ims.model.SupplierLastBidInfoModel; import com.bonus.canteen.core.ims.model.SupplierScoreSupplierModel; import com.bonus.canteen.core.ims.vo.SupplierPageVO; import com.bonus.canteen.core.ims.vo.SupplierScoreVO; @@ -78,4 +83,13 @@ public interface SupplierMapper extends BaseMapper { List listSupplierScoreSupplier(@Param("content") SupplierScoreDTO content, @Param("delFlag") Integer delFlag, @Param("mainFlag") Integer mainFlag); + List supplyList(@Param("content")SupplyStatisticsPageDTO supplyStatisticsPageDTO, @Param("delFlag") Integer key); + + SupplierBidTimesAndAmountModel selectBidTimesAndAmount(@Param("supplierId") Long supplierId, @Param("content")SupplyStatisticsPageDTO supplyStatisticsPageDTO); + + SupplierLastBidInfoModel selectLastBidInfo(@Param("supplierId") Long supplierId,@Param("content") SupplyStatisticsPageDTO supplyStatisticsPageDTO, @Param("bidStatus") Integer bidStatus); + + BigDecimal getDeliveryQualifiedRate(@Param("supplierId") Long supplierId, @Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime, @Param("intoStatus") Integer intoStatus); + + DrpOrderNumAndAmountModel selectOrderNumAndAmount(@Param("supplierId") Long supplierId, @Param("content") SupplyStatisticsPageDTO content, @Param("supplierConfirmStatus") Long supplierConfirmStatus); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/model/SupplierBidTimesAndAmountModel.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/model/SupplierBidTimesAndAmountModel.java new file mode 100644 index 0000000..c46ddfc --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/model/SupplierBidTimesAndAmountModel.java @@ -0,0 +1,17 @@ +package com.bonus.canteen.core.ims.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.Generated; + +@ApiModel +@Data +public class SupplierBidTimesAndAmountModel { + @ApiModelProperty("中标次数") + private Integer bidNumbers; + @ApiModelProperty("累计中标金额") + private Long cumulativeBidAmount; + + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/model/SupplierLastBidInfoModel.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/model/SupplierLastBidInfoModel.java new file mode 100644 index 0000000..31f8662 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/model/SupplierLastBidInfoModel.java @@ -0,0 +1,18 @@ +package com.bonus.canteen.core.ims.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.Generated; + +import java.time.LocalDate; + +@ApiModel +@Data +public class SupplierLastBidInfoModel { + @ApiModelProperty("上次中标日期") + private LocalDate lastBidDate; + @ApiModelProperty("上次中标金额") + private Long lastBidAmount; + +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsIntoInventoryServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsIntoInventoryServiceImpl.java index e82d75b..be63384 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsIntoInventoryServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsIntoInventoryServiceImpl.java @@ -274,6 +274,10 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService imsIntoInventoryDetail.setIfFillInventory(CommonFlagEnum.NO.getKey()); } imsIntoInventoryDetail.setDelFlag(String.valueOf(DelFlagEnum.DEL_FALSE.key())); + if(imsIntoInventoryDetailAdd.getOrderGoodsId() !=null){ + imsIntoInventoryDetail.setRelateOrderGoodsDetailId(imsIntoInventoryDetailAdd.getOrderGoodsId()); + } + list.add(imsIntoInventoryDetail); if(Long.valueOf(2).equals(imsIntoInventory.getStatus())) { if(Objects.isNull(imsIntoInventoryDetail.getMaterialId()) @@ -416,7 +420,7 @@ public class ImsIntoInventoryServiceImpl implements IImsIntoInventoryService } OrderGoods orderGoods = new OrderGoods(); orderGoods.setOrderGoodsCode(imsIntoInventory.getRelateOrderGoodsId()); - orderGoods.setOrderStatus(2L); + orderGoods.setOrderStatus(3L); List orderGoodsList = orderGoodsService.selectOrderGoodsList(orderGoods); if(CollUtil.isEmpty(orderGoodsList) || orderGoodsList.size() > 1) { throw new ServiceException("关联采购单错误, 采购单不存在或存在多条相同采购订单"); 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 4d0da3f..6354212 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 @@ -225,7 +225,9 @@ public class ImsInventoryServiceImpl implements IImsInventoryService } }); if(content.getExpireState() !=null){ - List warningList = list.stream().filter(l -> Objects.equals(l.getExpireState(), content.getExpireState())).collect(Collectors.toList()); + List warningList = list.stream().filter(l -> Objects.equals(l.getExpireState(), content.getExpireState())) + .filter(warning -> warning.getExpireState() != 3) + .collect(Collectors.toList()); System.out.println("warningList = " + warningList); System.out.println("warningList.size = " + warningList.size()); return warningList; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java index 81b5f36..113bdd5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/ImsOutInventoryServiceImpl.java @@ -427,7 +427,7 @@ public class ImsOutInventoryServiceImpl implements IImsOutInventoryService if(newOutCount.compareTo(funchNum) < 0){ throw new ServiceException("领取数量大于待领数量,操作失败!"); } - fetchMaterialDetailUpdate.setOutCount(newOutCount); + fetchMaterialDetailUpdate.setOutCount(outCount); fetchMaterialDetailMapper. updateFetchMaterialDetail(fetchMaterialDetailUpdate); totalOutNum = totalOutNum.add(imsOutInventoryDetailAdd.getFetchNum()); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/QuoteServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/QuoteServiceImpl.java index 006f5e5..a76abda 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/QuoteServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/QuoteServiceImpl.java @@ -1,20 +1,26 @@ package com.bonus.canteen.core.ims.service.impl; +import java.util.Date; import java.util.List; import com.bonus.canteen.core.ims.domain.Inquiry; import com.bonus.canteen.core.ims.domain.InquiryDetail; import com.bonus.canteen.core.ims.domain.InquirySupplier; +import com.bonus.canteen.core.ims.mapper.InquiryMapper; import com.bonus.canteen.core.ims.mapper.InquirySupplierMapper; +import com.bonus.canteen.core.ims.mapper.QuoteInquiryPicMapper; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.security.utils.SecurityUtils; +import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.bonus.canteen.core.ims.mapper.QuoteMapper; import com.bonus.canteen.core.ims.domain.Quote; import com.bonus.canteen.core.ims.service.IQuoteService; +import javax.annotation.Resource; + /** * 报价详情Service业务层处理 * @@ -28,6 +34,10 @@ public class QuoteServiceImpl implements IQuoteService { @Autowired private InquirySupplierMapper inquirySupplierMapper; + @Resource + private InquiryMapper inquiryMapper; + + /** * 查询报价详情 * @@ -64,6 +74,16 @@ public class QuoteServiceImpl implements IQuoteService { public int insertQuote(Quote quote) { quote.setCreateTime(DateUtils.getNowDate()); try { + +// Inquiry inquiry = inquiryMapper.selectInquiryByInquiryId(quote.getInquiryId(),null); +// Date startTime = inquiry.getStartTime(); +// Date endTime = inquiry.getEndTime(); +// if (startTime.getTime() > System.currentTimeMillis()) { +// throw new ServiceException("询价单未开始"); +// } +// if (endTime.getTime() < System.currentTimeMillis()) { +// throw new ServiceException("询价单已结束"); +// } return quoteMapper.insertQuote(quote); } catch (Exception e) { throw new ServiceException(e.getMessage()); @@ -79,6 +99,15 @@ public class QuoteServiceImpl implements IQuoteService { @Override public int updateQuote(Inquiry quote) { quote.setUpdateTime(DateUtils.getNowDate()); + Inquiry inquiry = inquiryMapper.selectInquiryByInquiryId(quote.getInquiryId(),null); + Date startTime = inquiry.getStartTime(); + Date endTime = inquiry.getEndTime(); + if (startTime.getTime() > System.currentTimeMillis()) { + throw new ServiceException("询价报价未开始"); + } + if (endTime.getTime() < System.currentTimeMillis()) { + throw new ServiceException("询价报价已结束"); + } try { List list=quote.getDetailList(); InquirySupplier iInquirySupplier=new InquirySupplier(); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/SupplierBindMaterialServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/SupplierBindMaterialServiceImpl.java index b331c63..6b51872 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/SupplierBindMaterialServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/ims/service/impl/SupplierBindMaterialServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.canteen.core.ims.service.impl; +import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -193,14 +194,17 @@ public class SupplierBindMaterialServiceImpl implements ISupplierBindMaterialSer return 1; } int count = 0; + List alternativeSuppliers = new ArrayList<>(); for(int i=0;i alternativeSuppliers = new ArrayList<>(); for(int i=0;i @Override public List supplyStatistics(SupplyStatisticsPageDTO supplyStatisticsPageDTO) { - List pageVOList = supplierMapper.supplyStatistics(supplyStatisticsPageDTO, DelFlagEnum.DEL_FALSE.key()); - //TODO 合格率 - //TODO 订单数量 - - return pageVOList; +// List pageVOList = supplierMapper.supplyStatistics(supplyStatisticsPageDTO, DelFlagEnum.DEL_FALSE.key()); +// //TODO 合格率 +// //TODO 订单数量 + List resultList = supplierMapper.supplyList(supplyStatisticsPageDTO, DelFlagEnum.DEL_FALSE.key()); + Iterator var7 = resultList.iterator(); + while(var7.hasNext()) { + SupplyStatisticsPageVO result = (SupplyStatisticsPageVO)var7.next(); + SupplierBidTimesAndAmountModel supplierBidTimesAndAmountModel = supplierMapper.selectBidTimesAndAmount(result.getSupplierId(), supplyStatisticsPageDTO); + result.setBidNumbers(supplierBidTimesAndAmountModel.getBidNumbers()); + result.setCumulativeBidAmount(supplierBidTimesAndAmountModel.getCumulativeBidAmount()); + SupplierLastBidInfoModel supplierLastBidInfoModel = supplierMapper.selectLastBidInfo(result.getSupplierId(), supplyStatisticsPageDTO, ImsInquiryStatusEnum.ALREADY_QUOTE.key()); + if (ObjectUtil.isNotEmpty(supplierLastBidInfoModel)) { + result.setLastBidDate(supplierLastBidInfoModel.getLastBidDate()); + result.setLastBidAmount(supplierLastBidInfoModel.getLastBidAmount()); + } + BigDecimal deliveryQualifiedRate = supplierMapper.getDeliveryQualifiedRate(result.getSupplierId(), null, null, IntoInventoryStatusEnum.COMMIT.key()); + result.setDeliveryPassRate(deliveryQualifiedRate); + DrpOrderNumAndAmountModel drpOrderNumAndAmountModel = supplierMapper.selectOrderNumAndAmount(result.getSupplierId(), supplyStatisticsPageDTO, DrpCommitStatusEnum.COMMIT.key()); + if (ObjectUtil.isNotEmpty(drpOrderNumAndAmountModel)) { + result.setOrderNum(drpOrderNumAndAmountModel.getOrderNum()); + result.setOrderAmount(drpOrderNumAndAmountModel.getOrderAmount()); + } + } + return resultList; } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceInfoServiceImpl.java index bb56e2d..66fd382 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/kitchen/service/impl/KitchenDeviceInfoServiceImpl.java @@ -104,6 +104,7 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpllambdaQuery() .eq(KitchenDeviceInfo::getDeviceName, kitchenDeviceInfo.getDeviceName()) + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_FALSE.key()) ); if(bean !=null) { throw new ServiceException("设备名称已存在,请检查后重新输入"); @@ -111,6 +112,7 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpllambdaQuery() .eq(KitchenDeviceInfo::getDeviceSn, kitchenDeviceInfo.getDeviceSn()) + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_FALSE.key()) ); if(bean !=null) { throw new ServiceException("设备SN码已存在,请检查后重新输入"); @@ -118,6 +120,7 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpllambdaQuery() .eq(KitchenDeviceInfo::getDeviceName, kitchenDeviceInfo.getDeviceName()) + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_FALSE.key()) ); if(bean !=null) { throw new ServiceException("设备名称已存在,请检查后重新输入"); @@ -139,7 +142,8 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpllambdaQuery() .eq(KitchenDeviceInfo::getDeviceType, kitchenDeviceInfo.getDeviceType()) - .eq(KitchenDeviceInfo::getChannel, kitchenDeviceInfo.getChannel())); + .eq(KitchenDeviceInfo::getChannel, kitchenDeviceInfo.getChannel()) + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_FALSE.key())); if(bean !=null) { throw new ServiceException("改类型设备通道已存在,请检查后重新输入"); } @@ -191,6 +195,7 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpllambdaQuery() .eq(KitchenDeviceInfo::getDeviceName, kitchenDeviceInfo.getDeviceName()) + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_FALSE.key()) .ne(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId()) ); if(bean !=null){ @@ -199,6 +204,7 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpllambdaQuery() .eq(KitchenDeviceInfo::getDeviceSn, kitchenDeviceInfo.getDeviceSn()) + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_FALSE.key()) .ne(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId()) ); if(bean !=null){ @@ -207,6 +213,7 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpllambdaQuery() .eq(KitchenDeviceInfo::getIp, kitchenDeviceInfo.getIp()) + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_FALSE.key()) .ne(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId()) ); if(bean !=null){ @@ -216,6 +223,7 @@ public class KitchenDeviceInfoServiceImpl extends ServiceImpllambdaQuery() .eq(KitchenDeviceInfo::getChannel, kitchenDeviceInfo.getChannel()) .eq(KitchenDeviceInfo::getDeviceType, kitchenDeviceInfo.getDeviceType()) + .eq(KitchenDeviceInfo::getDelFlag, DelFlagEnum.DEL_FALSE.key()) .ne(KitchenDeviceInfo::getDeviceId, kitchenDeviceInfo.getDeviceId()) ); if(bean !=null){ 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 100a083..21c46c3 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 @@ -212,16 +212,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" cd.selenium, cd.carotene, CASE - - WHEN iin.material_num IS NOT NULL - AND iin.material_num > 0 THEN - 1 ELSE 0 - END AS has_inventory + WHEN EXISTS ( + SELECT 1 + FROM cook_dishes_material cdm2 + LEFT JOIN ims_inventory iin2 ON iin2.material_id = cdm2.material_id AND iin2.del_flag = 0 + WHERE cdm2.dishes_id = cd.dishes_id + AND iin2.material_num IS NOT NULL + AND iin2.material_num > 0 + ) THEN 1 + ELSE 0 + END AS has_inventory, + (SELECT iin3.material_id + FROM cook_dishes_material cdm3 + LEFT JOIN ims_inventory iin3 ON iin3.material_id = cdm3.material_id AND iin3.del_flag = 0 + WHERE cdm3.dishes_id = cd.dishes_id + AND iin3.material_num IS NOT NULL + AND iin3.material_num > 0 + LIMIT 1) AS material_id FROM cook_dishes cd - LEFT JOIN cook_dishes_material cdm ON cdm.dishes_id = cd.dishes_id - LEFT JOIN ims_inventory iin ON iin.material_id = cdm.material_id - AND iin.del_flag = 0 LEFT JOIN basic_area ba ON cd.area_id = ba.area_id LEFT JOIN basic_canteen bc ON cd.canteen_id = bc.canteen_id LEFT JOIN basic_stall bs ON cd.shopstall_id = bs.stall_id @@ -230,6 +239,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -506,6 +507,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time between #{param.startDate} and #{param.endDate} + and supplier_id is not null diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/SupplierBindMaterialMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/SupplierBindMaterialMapper.xml index ec94893..e924c50 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/SupplierBindMaterialMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/SupplierBindMaterialMapper.xml @@ -306,4 +306,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + insert into ims_supplier_bind_material(canteen_id, supplier_id, material_id, category_id, alternative_supplier, if_supply, create_by, create_time, update_by, update_time) values + + (#{item.canteenId}, #{item.supplierId}, #{item.materialId}, #{item.categoryId}, #{item.alternativeSupplier}, #{item.ifSupply}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) + + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/SupplierMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/SupplierMapper.xml index 232ed7b..b816592 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/SupplierMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/ims/SupplierMapper.xml @@ -508,4 +508,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.workers_num, a.regist_fund + + + + + + + + + +