feat(inventory): 添加库存执行查询功能
- 新增库存执行查询相关接口和页面 - 实现库存执行数据的获取和展示- 添加订单信息查询功能 - 优化订单列表展示,增加签收和签收文件按钮的权限控制dev_1.0.0
parent
12f24d97e7
commit
1d6022c320
|
|
@ -131,7 +131,10 @@
|
|||
<th:block th:include="include :: jquery-cxselect-js"/>
|
||||
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('project:order:edit')}]];
|
||||
const editFlag = [[${@permission.hasPermi('inventory:execution:edit')}]];
|
||||
const signFlag = [[${@permission.hasPermi('inventory:execution:sign')}]];
|
||||
const signdownFlag = [[${@permission.hasPermi('inventory:execution:signdown')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('project:order:remove')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('project:order:remove')}]];
|
||||
var prefix = ctx + "project/order";
|
||||
var executionPrefix = ctx + "inventory/execution";
|
||||
|
|
@ -311,10 +314,10 @@
|
|||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
if (row.signStatus == '0' && row.deliveryStatus=='2') {
|
||||
actions.push(`<a class="btn btn-default btn-xs" href="javascript:void(0)" onclick="signOrder('${row.id}','${row.versionCode}')"><i class="fa fa-archive"></i>签收</a>`);
|
||||
actions.push(`<a class="btn btn-default btn-xs ${signFlag}" href="javascript:void(0)" onclick="signOrder('${row.id}','${row.versionCode}')"><i class="fa fa-archive"></i>签收</a>`);
|
||||
}
|
||||
if (row.signStatus == '1'){
|
||||
actions.push(`<a class="btn btn-default btn-xs" href="javascript:void(0)" onclick="downloadSign('${row.id}','${row.versionCode}')"><i class="fa fa-file"></i>签收文件</a>`);
|
||||
actions.push(`<a class="btn btn-default btn-xs ${signdownFlag}" href="javascript:void(0)" onclick="downloadSign('${row.id}','${row.versionCode}')"><i class="fa fa-file"></i>签收文件</a>`);
|
||||
}
|
||||
|
||||
return actions.join('');
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@
|
|||
//已接收
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
} else {
|
||||
actions.push('<a class="btn btn-default btn-xs " href="javascript:void(0)" onclick="refundable(\'' + row.id + '\')">退回</a> ');
|
||||
actions.push('<a class="btn btn-default btn-xs " href="javascript:void(0)" onclick="received(\'' + row.id + '\')">确认接收</a>');
|
||||
actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="refundable(\'' + row.id + '\')">退回</a> ');
|
||||
actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="received(\'' + row.id + '\')">确认接收</a>');
|
||||
}
|
||||
return actions.join('');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label is-required">合作状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="vendorStatus" class="form-control" th:with="type=${@dict.getType('vendor_status')}">
|
||||
<select name="vendorStatus" class="form-control" required th:with="type=${@dict.getType('vendor_status')}">
|
||||
<option value="">请选择</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
||||
th:value="${dict.dictValue}" th:selected="${vendorInfo.vendorStatus == dict.dictValue}"></option>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.service.IDeliveryListService;
|
||||
import com.ruoyi.sip.service.IInventoryDeliveryService;
|
||||
import com.ruoyi.sip.service.IOrderInfoService;
|
||||
import com.ruoyi.sip.service.IProjectOrderInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -32,6 +34,12 @@ public class ExternalController {
|
|||
private IDeliveryListService deliveryListService;
|
||||
@Autowired
|
||||
private IOrderInfoService orderInfoService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IProjectOrderInfoService projectOrderInfoService;
|
||||
@Autowired
|
||||
private IInventoryDeliveryService deliveryService;
|
||||
private final static String API_KEY = "c7f858d0-30b8-4b7f-9ea1-0ccf5ceb1c54";
|
||||
|
||||
|
||||
|
|
@ -46,7 +54,7 @@ public class ExternalController {
|
|||
if (!API_KEY.equals(apiKey)) {
|
||||
return AjaxResult.error("鉴权失败");
|
||||
}
|
||||
return AjaxResult.success(orderInfoService.getOrderInfo(dto));
|
||||
return AjaxResult.success(projectOrderInfoService.getOrderInfo(dto));
|
||||
}
|
||||
|
||||
@GetMapping("/v1/number/info")
|
||||
|
|
@ -58,6 +66,6 @@ public class ExternalController {
|
|||
if (!API_KEY.equals(apiKey)){
|
||||
return AjaxResult.error("鉴权失败");
|
||||
}
|
||||
return AjaxResult.success(deliveryListService.getNumberInfo(dto));
|
||||
return AjaxResult.success(deliveryService.getNumberInfo(dto));
|
||||
}
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ public class InventoryExecutionController extends BaseController {
|
|||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
@RequiresPermissions("inventory:inner:view")
|
||||
@RequiresPermissions("inventory:execution:view")
|
||||
@GetMapping()
|
||||
public String inner() {
|
||||
return prefix + "/track";
|
||||
|
|
@ -68,6 +68,7 @@ public class InventoryExecutionController extends BaseController {
|
|||
List<ProjectOrderInfo> list = orderInfoService.selectProjectOrderInfoList(projectOrderInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@RequiresPermissions("inventory:execution:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -161,6 +161,9 @@ public class ProjectOrderInfo extends BaseEntity {
|
|||
private Date orderEndTime;
|
||||
private Date orderEndTimeStart;
|
||||
private Date orderEndTimeEnd;
|
||||
private Date updateTimeStart;
|
||||
private Date updateTimeEnd;
|
||||
private String productSn;
|
||||
/**
|
||||
* 公司直发
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -76,5 +76,7 @@ public class ProjectProductInfo extends BaseEntity
|
|||
// @Excel(name = "折扣")
|
||||
private BigDecimal discount;
|
||||
private String type;
|
||||
private String value;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.sip.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.InventoryDelivery;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.vo.DeliveryInfoVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
|
|
@ -63,4 +65,6 @@ public interface InventoryDeliveryMapper
|
|||
|
||||
|
||||
List<InventoryDelivery> selectQuantityByOrderCodeStatus(@Param("orderCode") String orderCode, @Param("status") String code);
|
||||
|
||||
List<DeliveryInfoVo> listSn(ApiDataQueryDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import com.ruoyi.sip.domain.ProjectOrderInfo;
|
||||
import com.ruoyi.sip.dto.HomepageQueryDto;
|
||||
import com.ruoyi.sip.dto.StatisticsDetailDto;
|
||||
import com.ruoyi.sip.vo.OrderInfoVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
|
@ -74,4 +75,6 @@ public interface ProjectOrderInfoMapper
|
|||
int updateProjectOrderInfoByCode(ProjectOrderInfo projectOrderInfo);
|
||||
|
||||
void bakData(ProjectOrderInfo projectOrderInfo);
|
||||
|
||||
List<OrderInfoVo> listOrderInfoVo(ProjectOrderInfo queryParams);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.sip.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.InventoryDelivery;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.vo.DeliveryInfoVo;
|
||||
|
||||
/**
|
||||
* 产品库存Service接口
|
||||
|
|
@ -62,4 +64,6 @@ public interface IInventoryDeliveryService
|
|||
void statusUpdate(InventoryDelivery inventoryDelivery);
|
||||
|
||||
int deleteInventoryOuterById(Long id);
|
||||
|
||||
List<DeliveryInfoVo> getNumberInfo(ApiDataQueryDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package com.ruoyi.sip.service;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.InventoryInfo;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.dto.inventory.ProductWarehouseInfo;
|
||||
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
|
||||
import com.ruoyi.sip.vo.DeliveryInfoVo;
|
||||
|
||||
/**
|
||||
* 产品库存Service接口
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@ import java.util.List;
|
|||
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
import com.ruoyi.sip.domain.ProjectOrderInfo;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.flowable.domain.Todo;
|
||||
import com.ruoyi.sip.dto.HomepageQueryDto;
|
||||
import com.ruoyi.sip.dto.StatisticsDetailDto;
|
||||
import com.ruoyi.sip.vo.OrderInfoVo;
|
||||
|
||||
/**
|
||||
* 订单管理Service接口
|
||||
|
|
@ -86,4 +88,5 @@ public interface IProjectOrderInfoService
|
|||
void sign(ProjectOrderFileLog projectOrderFileLog);
|
||||
|
||||
// Boolean foldOnFold(ProjectOrderInfo info);
|
||||
List<OrderInfoVo> getOrderInfo(ApiDataQueryDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
|
@ -10,9 +8,12 @@ import cn.hutool.core.util.StrUtil;
|
|||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.sip.domain.*;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.mapper.InventoryOuterMapper;
|
||||
import com.ruoyi.sip.service.*;
|
||||
import com.ruoyi.sip.vo.DeliveryInfoVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.InventoryDeliveryMapper;
|
||||
|
|
@ -76,6 +77,9 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
inventoryDelivery.setCreateTime(DateUtils.getNowDate());
|
||||
String currentUserId = ShiroUtils.getUserId().toString();
|
||||
inventoryDelivery.setCreateBy(currentUserId);
|
||||
inventoryDelivery.setCreateTime(DateUtils.getNowDate());
|
||||
inventoryDelivery.setUpdateBy(currentUserId);
|
||||
inventoryDelivery.setUpdateTime(DateUtils.getNowDate());
|
||||
inventoryDelivery.setDeliveryStatus(InventoryDelivery.DeliveryStatusEnum.WAIT_DELIVERY.getCode());
|
||||
//处理库存
|
||||
List<String> productSnList = inventoryDelivery.getProductSnList();
|
||||
|
|
@ -133,6 +137,8 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
public void statusUpdate(InventoryDelivery inventoryDelivery) {
|
||||
//修改发货状态
|
||||
inventoryDelivery.setDeliveryStatus(InventoryDelivery.DeliveryStatusEnum.CONFIRM_DELIVERY.getCode());
|
||||
inventoryDelivery.setUpdateBy(ShiroUtils.getUserId().toString());
|
||||
inventoryDelivery.setUpdateTime(DateUtils.getNowDate());
|
||||
inventoryDeliveryMapper.updateInventoryDelivery(inventoryDelivery);
|
||||
List<ProjectProductInfo> projectProductInfos = projectProductInfoService.listDeliveryProductByOrderCode(Collections.singletonList(inventoryDelivery.getOrderCode()));
|
||||
//软硬件之和
|
||||
|
|
@ -181,4 +187,83 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
}
|
||||
return inventoryDeliveryMapper.deleteInventoryDeliveryById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeliveryInfoVo> getNumberInfo(ApiDataQueryDto dto) {
|
||||
List<DeliveryInfoVo> resultList = inventoryDeliveryMapper.listSn(dto);
|
||||
List<String> orderCodeList = resultList.stream().map(DeliveryInfoVo::getOrderCode).collect(Collectors.toList());
|
||||
// 根据订单ID查询合同信息
|
||||
List<ProjectProductInfo> projectProductInfos = projectProductInfoService.selectProjectProductInfoListByOrderCode(orderCodeList);
|
||||
|
||||
// 构建维护类型与年限的映射
|
||||
|
||||
Map<Long, List<ProjectProductInfo>> maintenanceTypeMap = projectProductInfos.stream().collect(Collectors.groupingBy(ProjectProductInfo::getProjectId));
|
||||
|
||||
// // 查询标准硬件维保的产品信息
|
||||
ProductInfo productInfo = new ProductInfo();
|
||||
productInfo.setType(ProductInfo.ProductTypeEnum.HARDWARE_MAINTENANCE.getType());
|
||||
List<ProductInfo> productInfos = productInfoService.selectProductInfoList(productInfo);
|
||||
// 设置服务等级和服务结束时间
|
||||
for (DeliveryInfoVo deliveryInfoVo : resultList) {
|
||||
updateDeliveryInfoVo(deliveryInfoVo, maintenanceTypeMap, productInfos);
|
||||
}
|
||||
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新 DeliveryInfoVo 的服务等级和服务结束时间
|
||||
*/
|
||||
private void updateDeliveryInfoVo(DeliveryInfoVo deliveryInfoVo, Map<Long, List<ProjectProductInfo>> maintenanceTypeMap, List<ProductInfo> productInfos) {
|
||||
List<ProjectProductInfo> productInfoList = maintenanceTypeMap.get(deliveryInfoVo.getProjectId());
|
||||
List<DeliveryInfoVo.ServiceInfo> serviceInfoList = new ArrayList<>();
|
||||
Date startTime = deliveryInfoVo.getServiceStartTime();
|
||||
if (CollUtil.isNotEmpty(productInfoList)) {
|
||||
if (ProductInfo.ProductTypeEnum.SOFTWARE.getType().equals(deliveryInfoVo.getProductType())) {
|
||||
for (ProjectProductInfo productInfo : productInfoList) {
|
||||
if (ProductInfo.ProductTypeEnum.SOFTWARE_MAINTENANCE.getType().equals(productInfo.getType()) && StringUtils.isNotEmpty(productInfo.getValue())) {
|
||||
startTime = updateStartTimeAndAddList(deliveryInfoVo, productInfo, startTime, serviceInfoList);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
for (ProjectProductInfo productInfo : productInfoList) {
|
||||
if (ProductInfo.ProductTypeEnum.HARDWARE_MAINTENANCE.getType().equals(productInfo.getType()) && StringUtils.isNotEmpty(productInfo.getValue())) {
|
||||
startTime = updateStartTimeAndAddList(deliveryInfoVo, productInfo, startTime, serviceInfoList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CollUtil.isEmpty(serviceInfoList) && ProductInfo.ProductTypeEnum.HARDWARE.getType().equals(deliveryInfoVo.getProductType())
|
||||
&& CollUtil.isNotEmpty(productInfos)) {
|
||||
// 判断是否硬件,如果是硬件取标准维保三年
|
||||
if (StringUtils.isNotEmpty(productInfos.get(0).getValue())) {
|
||||
ProjectProductInfo projectProductInfo = new ProjectProductInfo();
|
||||
projectProductInfo.setProductBomCode(productInfos.get(0).getProductCode());
|
||||
projectProductInfo.setType(productInfos.get(0).getType());
|
||||
projectProductInfo.setValue(productInfos.get(0).getValue());
|
||||
projectProductInfo.setProductDesc(productInfos.get(0).getDescription());
|
||||
startTime = updateStartTimeAndAddList(deliveryInfoVo, projectProductInfo, startTime, serviceInfoList);
|
||||
}
|
||||
}
|
||||
deliveryInfoVo.setServiceInfo(serviceInfoList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private Date updateStartTimeAndAddList(DeliveryInfoVo deliveryInfoVo, ProjectProductInfo productInfo, Date startTime, List<DeliveryInfoVo.ServiceInfo> serviceInfoList) {
|
||||
int year = productInfo.getValue() == null ? 0 : Integer.parseInt(productInfo.getValue());
|
||||
DeliveryInfoVo.ServiceInfo serviceInfo = deliveryInfoVo.new ServiceInfo();
|
||||
serviceInfo.setServiceLevel(productInfo.getProductBomCode());
|
||||
serviceInfo.setServiceDescribe(productInfo.getProductDesc());
|
||||
serviceInfo.setServiceStartTime(startTime);
|
||||
serviceInfo.setServiceEndTime(DateUtils.addYears(startTime, year));
|
||||
startTime = DateUtils.addYears(startTime, year);
|
||||
serviceInfoList.add(serviceInfo);
|
||||
return startTime;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
import com.ruoyi.sip.domain.InventoryInfo;
|
||||
import com.ruoyi.sip.domain.OmsWarehouseInfo;
|
||||
import com.ruoyi.sip.domain.ProductInfo;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.dto.inventory.ProductWarehouseInfo;
|
||||
import com.ruoyi.sip.dto.warehouse.WarehouseInnerExcelDto;
|
||||
import com.ruoyi.sip.mapper.InventoryInfoMapper;
|
||||
|
|
@ -15,6 +16,7 @@ import com.ruoyi.sip.service.IInventoryAuthService;
|
|||
import com.ruoyi.sip.service.IInventoryInfoService;
|
||||
import com.ruoyi.sip.service.IOmsWarehouseInfoService;
|
||||
import com.ruoyi.sip.service.IProductInfoService;
|
||||
import com.ruoyi.sip.vo.DeliveryInfoVo;
|
||||
import liquibase.pro.packaged.O;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
|||
|
|
@ -10,15 +10,12 @@ import com.ruoyi.common.exception.ServiceException;
|
|||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.sip.domain.InventoryInfo;
|
||||
import com.ruoyi.sip.domain.OmsWarehouseInfo;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
import com.ruoyi.sip.domain.*;
|
||||
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
|
||||
import com.ruoyi.sip.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.OmsInventoryInnerMapper;
|
||||
import com.ruoyi.sip.domain.OmsInventoryInner;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -95,12 +92,20 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
omsInventoryInner.setQuantity((long) inventoryInfoList.size());
|
||||
List<String> productCodeList = inventoryInfoList.stream().map(InventoryInfo::getProductCode).distinct().filter(StringUtils::isNotEmpty).collect(Collectors.toList());
|
||||
if (productCodeList.size() != 1) {
|
||||
throw new ServiceException("添加产品信息中产品编码不允许多个");
|
||||
throw new ServiceException("添加产品信息中产品编码不允许多个,导入失败");
|
||||
}
|
||||
omsInventoryInner.setProductCode(productCodeList.get(0));
|
||||
List<ProductInfo> productInfos = productInfoService.selectProductInfoByCodeList(productCodeList);
|
||||
if (CollUtil.isEmpty(productInfos)){
|
||||
throw new ServiceException("添加产品信息中产品编码不存在,导入失败");
|
||||
}
|
||||
String vendorCode = productInfos.get(0).getVendorCode();
|
||||
if (!omsInventoryInner.getVendorCode().equals(vendorCode)) {
|
||||
throw new ServiceException("添加产品信息中产品编码和选择制造商不匹配,导入失败");
|
||||
}
|
||||
List<Long> warehouseIdList = inventoryInfoList.stream().map(InventoryInfo::getWarehouseId).distinct().filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if (warehouseIdList.size() != 1) {
|
||||
throw new ServiceException("添加产品信息中仓库不允许多个");
|
||||
throw new ServiceException("添加产品信息中仓库不允许多个,导入失败");
|
||||
}
|
||||
omsInventoryInner.setWarehouseId(warehouseIdList.get(0));
|
||||
inventoryInfoList.forEach(item->{
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.ruoyi.common.utils.ShiroUtils;
|
|||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.sip.domain.*;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.flowable.domain.Todo;
|
||||
import com.ruoyi.sip.dto.HomepageQueryDto;
|
||||
import com.ruoyi.sip.dto.OrderExcelNumStaticsDto;
|
||||
|
|
@ -37,6 +38,7 @@ import com.ruoyi.sip.flowable.service.DeleteFlowableProcessInstanceCmd;
|
|||
import com.ruoyi.sip.flowable.service.TodoCommonTemplate;
|
||||
import com.ruoyi.sip.flowable.service.TodoService;
|
||||
import com.ruoyi.sip.utils.TemplateMailUtil;
|
||||
import com.ruoyi.sip.vo.OrderInfoVo;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
|
|
@ -225,6 +227,8 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
projectOrderInfo.setOrderCode(orderNumber);
|
||||
projectOrderInfo.setCreateTime(DateUtils.getNowDate());
|
||||
projectOrderInfo.setCreateBy(ShiroUtils.getUserId().toString());
|
||||
projectOrderInfo.setUpdateBy(ShiroUtils.getUserId().toString());
|
||||
projectOrderInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
saveProductInfo(projectOrderInfo, projectOrderInfo.getProjectId());
|
||||
List<ProjectProductInfo> projectProductInfos = productInfoService.selectProjectProductInfoListByProjectId(Collections.singletonList(projectOrderInfo.getProjectId()));
|
||||
BigDecimal bigDecimal = projectProductInfos.stream().map(ProjectProductInfo::getAllPrice).filter(Objects::nonNull).reduce(BigDecimal::add).get();
|
||||
|
|
@ -1068,4 +1072,18 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
TemplateMailUtil.MailTemplate.ORDER_PARTNER,Dict.create());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderInfoVo> getOrderInfo(ApiDataQueryDto dto) {
|
||||
ProjectOrderInfo queryParams = new ProjectOrderInfo();
|
||||
if (dto.getQueryStartTime()!=null) {
|
||||
queryParams.setUpdateTimeStart(dto.getQueryStartTime());
|
||||
}
|
||||
if (dto.getQueryEndTime()!=null) {
|
||||
queryParams.setUpdateTimeEnd(dto.getQueryEndTime());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(dto.getSerialNumber())){
|
||||
queryParams.setProductSn(dto.getSerialNumber());
|
||||
}
|
||||
return projectOrderInfoMapper.listOrderInfoVo(queryParams);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ public class DeliveryInfoVo {
|
|||
|
||||
private Date lastUpdateTime;
|
||||
@JsonIgnore
|
||||
private Long projectId;
|
||||
@JsonIgnore
|
||||
private Long orderId;
|
||||
@JsonIgnore
|
||||
private String productType;
|
||||
|
|
|
|||
|
|
@ -73,6 +73,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectInventoryDeliveryVo"/>
|
||||
where t3.order_code= #{orderCode} and t1.delivery_status = #{status}
|
||||
</select>
|
||||
<select id="listSn" resultType="com.ruoyi.sip.vo.DeliveryInfoVo">
|
||||
SELECT
|
||||
t3.order_code,t5.version_code,t5.project_id ,t2.product_sn as 'serialNumber' ,t2.product_code,t4.description
|
||||
as 'productDescription',t4.type as 'productType',t1.delivery_time as service_start_time,
|
||||
t1.update_time as 'lastUpdateTime'
|
||||
FROM
|
||||
oms_inventory_delivery t1
|
||||
inner JOIN oms_inventory_info t2 ON t1.outer_code = t2.outer_code
|
||||
inner join oms_inventory_outer t3 on t1.outer_code=t3.outer_code
|
||||
inner join product_info t4 on t2.product_code=t4.product_code
|
||||
inner join project_order_info t5 on t3.order_code=t5.order_code
|
||||
WHERE
|
||||
t1.delivery_status = 1
|
||||
<choose>
|
||||
<when test="queryStartTime!=null and queryEndTime!=null">
|
||||
and t1.update_time between #{queryStartTime} and #{queryEndTime}
|
||||
</when>
|
||||
<when test="queryStartTime!=null">
|
||||
and t1.update_time <![CDATA[ >= ]]> #{queryStartTime}
|
||||
</when>
|
||||
<when test="queryEndTime!=null">
|
||||
and t1.update_time <![CDATA[ <= ]]> #{queryEndTime}
|
||||
</when>
|
||||
</choose>
|
||||
<if test="serialNumber!=null and serialNumber!=''">
|
||||
and t2.product_sn = #{serialNumber}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertInventoryDelivery" parameterType="InventoryDelivery" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
|||
|
|
@ -127,6 +127,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
</choose>
|
||||
</if>
|
||||
<if test="updateTimeStart != null or updateTimeEnd != null">
|
||||
<choose>
|
||||
<when test="updateTimeStart != null and updateTimeEnd != null">
|
||||
and t1.update_time between date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00') and
|
||||
date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
<when test="updateTimeStart != null">
|
||||
and t1.update_time <![CDATA[ >= ]]> date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00')
|
||||
</when>
|
||||
<when test="updateTimeEnd != null">
|
||||
and t1.update_time <![CDATA[ <= ]]> date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
|
||||
</choose>
|
||||
</if>
|
||||
<if test="approveTimeStart != null or approveTimeEnd != null">
|
||||
<choose>
|
||||
<when test="approveTimeStart != null and approveTimeEnd != null">
|
||||
|
|
@ -222,6 +237,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectProjectOrderInfoRelationVo"/>
|
||||
where t1.order_code = #{orderCode}
|
||||
</select>
|
||||
<select id="listOrderInfoVo" resultType="com.ruoyi.sip.vo.OrderInfoVo">
|
||||
SELECT
|
||||
t1.order_code,
|
||||
t2.project_name AS 'order_name',
|
||||
t1.version_code,
|
||||
t3.contact_person AS 'sale_name',
|
||||
t3.contact_email AS 'sale_email' ,
|
||||
t4.customer_name as 'customer_name',
|
||||
t4.contact_person,
|
||||
t4.contact_email,
|
||||
t4.contact_phone,
|
||||
t1.update_time as 'last_update_time'
|
||||
FROM
|
||||
project_order_info t1
|
||||
LEFT JOIN project_info t2 ON t1.project_id = t2.id
|
||||
LEFT JOIN agent_info t3 ON t2.agent_code = t3.agent_code
|
||||
LEFT JOIN customer_info t4 ON t2.customer_code = t4.customer_code
|
||||
where t1.update_time between #{updateTimeStart} and #{updateTimeEnd}
|
||||
and t1.order_code in ( select DISTINCT order_code from oms_inventory_outer where outer_code in (SELECT outer_code from oms_inventory_delivery where delivery_status=1)
|
||||
)
|
||||
<if test="productSn!=null and productSn!=''">
|
||||
and t1.order_code in (select select DISTINCT order_code from oms_inventory_outer where outer_code in (select outer_code from oms_inventory_info where product_sn=#{productSn} ) )
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertProjectOrderInfo" parameterType="ProjectOrderInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into project_order_info
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
<sql id="selectProjectProductRelationInfoVo">
|
||||
select t1.id, t1.project_id, t1.product_bom_code, t1.model, t1.product_code, t1.product_desc, t1.quantity, t1.catalogue_price,
|
||||
t1.catalogue_all_price, t1.price, t1.all_price, t1.guidance_discount, t1.discount, t1.remark,t2.type,t2.product_name,t2.vendor_code
|
||||
t1.catalogue_all_price, t1.price, t1.all_price, t1.guidance_discount, t1.discount, t1.remark,t2.type,t2.product_name,t2.vendor_code,t2.value
|
||||
from project_product_info t1
|
||||
left join product_info t2 on t1.product_bom_code = t2.product_code
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue