package com.wms_admin.server.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wms_admin.excel.ExcelOrderInformation;
import com.wms_admin.excel.ExcelSendAndStoringUtil;
import com.wms_admin.server.entity.OrderInformation;
import com.wms_admin.server.mapper.OrderInformationMapper;
import com.wms_admin.server.service.OrderInformationService;
import com.wms_admin.server.service.OutProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
*
* 服务实现类
*
*
* @author 江苏鵷雏网络科技有限公司
* @since 2023-05-24
*/
@Service
public class OrderInformationServiceImpl extends ServiceImpl implements OrderInformationService {
@Resource
private OrderInformationMapper mapper;
@Autowired
private OutProductService outProductService;
@Override
public Integer AddOrderInformation(OrderInformation orderInformation) {
int insert = mapper.insert(orderInformation);
// 如果添加成功获取自增ID
if (insert == 1) {
// 前端扫码的编码
for (String code : orderInformation.getListCode()){
outProductService.ListAddOutProduct(orderInformation.getId(), code, orderInformation.getOutPerson());
}
return 1;
}
return 0;
}
@Override
public IPage SelectOutProductPage(String startTime, String endTime, String customerName, Page page) {
return mapper.SelectOutProductPage(startTime, endTime, customerName, page);
}
@Override
public List SelectOutProductExcel(String startTime, String endTime, String customerName) {
return mapper.SelectOutProductExcel(startTime, endTime, customerName);
}
@Override
public IPage