1、修改bug
This commit is contained in:
@@ -260,7 +260,7 @@ public class TemplateInstanceServiceImpl implements TemplateInstanceService {
|
||||
code = TmplStsEnum.STOPPED.getCode();
|
||||
} else if (reqVO.getType().equals("enable")) {
|
||||
// 启用
|
||||
code = TmplStsEnum.START.getCode();
|
||||
code = TmplStsEnum.DRAFT.getCode();
|
||||
}
|
||||
if (code.isEmpty()) {
|
||||
throw exception(ILLEGAL_OPERATION_TYPE);
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.zt.plat.module.contractorder.api;
|
||||
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.contractorder.api.dto.PurchaseOrderWithDetailsDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.order.PurchaseOrderWithDetailsDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO;
|
||||
import com.zt.plat.module.contractorder.api.vo.contract.ContractSaveReqVO;
|
||||
import com.zt.plat.module.contractorder.api.vo.contract.international.ContractRequest;
|
||||
@@ -11,7 +11,6 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zt.plat.module.contractorder.api.dto;
|
||||
package com.zt.plat.module.contractorder.api.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.zt.plat.module.contractorder.api.dto;
|
||||
package com.zt.plat.module.contractorder.api.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -189,5 +189,12 @@ public class PurchaseOrderWithDetailsDTO {
|
||||
* 订单类型
|
||||
*/
|
||||
private String splyBsnTp;
|
||||
private List<PrchOrdDtlDTO> orderDetails;
|
||||
/**
|
||||
* 采购订单明细
|
||||
*/
|
||||
private List<PrchOrdDtlDTO> prchOrdDtlDTOS;
|
||||
/**
|
||||
* 消费订单明细
|
||||
*/
|
||||
private List<SalesOrdDtlDTO> salesOrdDtlDTOS;
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.zt.plat.module.contractorder.api.dto.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@Data
|
||||
public class SalesOrdDtlDTO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 订单主键
|
||||
*/
|
||||
|
||||
private Long orderId;
|
||||
/**
|
||||
* 行项目;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private Long lineNumber;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
|
||||
private String materialName;
|
||||
/**
|
||||
* 物料编码;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String materialNumber;
|
||||
/**
|
||||
* 工厂名称
|
||||
*/
|
||||
|
||||
private String factoryName;
|
||||
/**
|
||||
* 工厂编码;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String factoryNumber;
|
||||
/**
|
||||
* 库位名称
|
||||
*/
|
||||
|
||||
private String warehouseName;
|
||||
/**
|
||||
* 库位编码;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String warehouseNumber;
|
||||
/**
|
||||
* 计量单位;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 开票类型;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String invoiceType;
|
||||
/**
|
||||
* 暂估数量;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private BigDecimal quantity;
|
||||
/**
|
||||
* 稅分类(字典:SALE_TAX);推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String taxAcctasscat;
|
||||
/**
|
||||
* 项目类别;推送ERP
|
||||
*/
|
||||
|
||||
private String projectCategory;
|
||||
/**
|
||||
* 装运地点;推送ERP
|
||||
*/
|
||||
|
||||
private String shippingPlace;
|
||||
/**
|
||||
* 物料科目分配组;推送ERP(必须)
|
||||
*/
|
||||
|
||||
private String metalAcctasscatGroup;
|
||||
/**
|
||||
* 小协议号
|
||||
*/
|
||||
|
||||
private String agreementNumber;
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
|
||||
private BigDecimal gross;
|
||||
/**
|
||||
* 金属元素缩写
|
||||
*/
|
||||
|
||||
private String elementAbbreviation;
|
||||
/**
|
||||
* 金属元素名称
|
||||
*/
|
||||
private String elementName;
|
||||
/**
|
||||
* 金属元素编码
|
||||
*/
|
||||
private String elementNumber;
|
||||
/**
|
||||
* 是否启用;处理明细中多个相同物料,只能允许一种物料启用
|
||||
*/
|
||||
|
||||
private String isEnable;
|
||||
/**
|
||||
* 价格条件详情;推送ERP(必须):JSON
|
||||
*/
|
||||
|
||||
private String priceConditionDetail;
|
||||
/**
|
||||
* 来料加工原料详情;推送ERP:订单类型(JSON)
|
||||
*/
|
||||
|
||||
private String originDetail;
|
||||
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
|
||||
private BigDecimal taxRte;
|
||||
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.zt.plat.module.contractorder.api;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.contractorder.api.dto.PrchOrdDtlDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.PurchaseOrderWithDetailsDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.order.PrchOrdDtlDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.order.PurchaseOrderWithDetailsDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.order.SalesOrdDtlDTO;
|
||||
import com.zt.plat.module.contractorder.api.vo.contract.ContractSaveReqVO;
|
||||
import com.zt.plat.module.contractorder.api.vo.contract.international.*;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderDetailsRespVO;
|
||||
@@ -13,10 +15,15 @@ import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractOtherFieldDO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractOtherFormDO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDetailDO;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.contract.ContractMainMapper;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.contract.ContractOtherFieldMapper;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.contract.ContractOtherFormMapper;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.contract.SystemRelativityMapper;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.salesorder.SalesOrderDetailMapper;
|
||||
import com.zt.plat.module.contractorder.dal.mysql.salesorder.SalesOrderMapper;
|
||||
import com.zt.plat.module.contractorder.enums.contract.DictEnum;
|
||||
import com.zt.plat.module.contractorder.service.contract.ContractService;
|
||||
import com.zt.plat.module.contractorder.service.purchaseorder.PurchaseOrderService;
|
||||
@@ -55,6 +62,7 @@ public class ContractApiImpl implements ContractApi {
|
||||
@Resource
|
||||
private SystemRelativityMapper systemRelativityMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public ContractRespDTO getContractByPaperNumber(String contractPaperNumber) {
|
||||
return contractService.getFormulasByPaperNumber(contractPaperNumber);
|
||||
@@ -67,21 +75,74 @@ public class ContractApiImpl implements ContractApi {
|
||||
|
||||
@Override
|
||||
public CommonResult<List<PurchaseOrderWithDetailsDTO>> getOrderByOrderNo(List<String> orderNoS) {
|
||||
List<PurchaseOrderDO> orderByNos = purchaseOrderService.getOrderByNos(orderNoS);
|
||||
if (orderByNos.isEmpty()) {
|
||||
return success(new ArrayList<>());
|
||||
}
|
||||
List<PurchaseOrderWithDetailsDTO> order = new ArrayList<>();
|
||||
List<String> purchaseOrderNoS = new ArrayList<>();
|
||||
List<String> salesOrdNoS = new ArrayList<>();
|
||||
orderByNos.forEach(f -> {
|
||||
if ("SALE".equals(f.getSplyBsnTp())) {
|
||||
// 销售订单
|
||||
salesOrdNoS.add(f.getSystemOrderNumber());
|
||||
} else {
|
||||
// 非销售订单(采购订单)
|
||||
purchaseOrderNoS.add(f.getSystemOrderNumber());
|
||||
}
|
||||
});
|
||||
|
||||
// 处理采购订单详情
|
||||
List<PurchaseOrderWithDetailsDTO> purchaseOrderDetails = getPurchaseOrderDetails(purchaseOrderNoS);
|
||||
if (!purchaseOrderDetails.isEmpty()) {
|
||||
order.addAll(purchaseOrderDetails);
|
||||
}
|
||||
|
||||
// 处理销售订单详情
|
||||
List<PurchaseOrderWithDetailsDTO> salesOrdDetails = getSalesOrdDetails(salesOrdNoS);
|
||||
if (!salesOrdDetails.isEmpty()) {
|
||||
order.addAll(salesOrdDetails);
|
||||
}
|
||||
return success(order);
|
||||
}
|
||||
|
||||
private List<PurchaseOrderWithDetailsDTO> getSalesOrdDetails(List<String> orderNoS) {
|
||||
if (orderNoS.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
SalesOrderMapper salesOrderMapper = SpringUtil.getBean(SalesOrderMapper.class);
|
||||
SalesOrderDetailMapper salesOrderDetailMapper = SpringUtil.getBean(SalesOrderDetailMapper.class);
|
||||
List<SalesOrderDO> salesOrderDOS = salesOrderMapper.selectList(SalesOrderDO::getSystemOrderNumber, orderNoS);
|
||||
if (salesOrderDOS.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<PurchaseOrderWithDetailsDTO> purchaseOrderWithDetailsDTOS = BeanUtils.toBean(salesOrderDOS, PurchaseOrderWithDetailsDTO.class);
|
||||
purchaseOrderWithDetailsDTOS.forEach(purchaseOrderWithDetailsDTO -> {
|
||||
List<SalesOrderDetailDO> salesOrderDetailDOS = salesOrderDetailMapper.selectList(SalesOrderDetailDO::getOrderId, purchaseOrderWithDetailsDTO.getId());
|
||||
List<SalesOrdDtlDTO> salesOrdDtlDTOS = BeanUtils.toBean(salesOrderDetailDOS, SalesOrdDtlDTO.class);
|
||||
purchaseOrderWithDetailsDTO.setSalesOrdDtlDTOS(salesOrdDtlDTOS);
|
||||
});
|
||||
return purchaseOrderWithDetailsDTOS;
|
||||
}
|
||||
|
||||
private List<PurchaseOrderWithDetailsDTO> getPurchaseOrderDetails(List<String> orderNoS) {
|
||||
if (orderNoS.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<PurchaseOrderWithDetailsDTO> purchaseOrderWithDetailsDTOS = new ArrayList<>();
|
||||
List<PurchaseOrderDetailsRespVO> purchaseOrderWithDetailsVOS = purchaseOrderService.getOrderByOrderNo(orderNoS);
|
||||
purchaseOrderWithDetailsVOS.forEach(purchaseOrderWithDetailsVO -> {
|
||||
if (purchaseOrderWithDetailsVO!= null) {
|
||||
PurchaseOrderWithDetailsDTO purchaseOrderWithDetailsDTO = BeanUtils.toBean(purchaseOrderWithDetailsVO,
|
||||
PurchaseOrderWithDetailsDTO.class);
|
||||
if (purchaseOrderWithDetailsVO != null) {
|
||||
PurchaseOrderWithDetailsDTO purchaseOrderWithDetailsDTO = BeanUtils.toBean(purchaseOrderWithDetailsVO, PurchaseOrderWithDetailsDTO.class);
|
||||
if (purchaseOrderWithDetailsVO.getOrderDetails().isEmpty()) {
|
||||
purchaseOrderWithDetailsDTO.setOrderDetails(new ArrayList<>());
|
||||
purchaseOrderWithDetailsDTO.setPrchOrdDtlDTOS(new ArrayList<>());
|
||||
} else {
|
||||
purchaseOrderWithDetailsDTO.setOrderDetails(BeanUtils.toBean(purchaseOrderWithDetailsVO.getOrderDetails(), PrchOrdDtlDTO.class));
|
||||
purchaseOrderWithDetailsDTO.setPrchOrdDtlDTOS(BeanUtils.toBean(purchaseOrderWithDetailsVO.getOrderDetails(), PrchOrdDtlDTO.class));
|
||||
}
|
||||
purchaseOrderWithDetailsDTOS.add(purchaseOrderWithDetailsDTO);
|
||||
}
|
||||
});
|
||||
return success(purchaseOrderWithDetailsDTOS);
|
||||
return purchaseOrderWithDetailsDTOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,7 +254,8 @@ public class ContractApiImpl implements ContractApi {
|
||||
systemRelativityMapper.insert(saveRelation);
|
||||
}
|
||||
} else if ("D".equals(operateFlag)) {
|
||||
if (systemRelativityDO == null || systemRelativityDO.getDownId() == null) throw exception(CONTRACT_NOT_EXISTS);
|
||||
if (systemRelativityDO == null || systemRelativityDO.getDownId() == null)
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
contractId = systemRelativityDO.getDownId();
|
||||
contractMainMapper.deleteById(contractId);
|
||||
} else {
|
||||
@@ -1666,23 +1728,73 @@ public class ContractApiImpl implements ContractApi {
|
||||
|
||||
@Override
|
||||
public CommonResult<List<PurchaseOrderWithDetailsDTO>> getOrderByOrderIds(List<Long> ids) {
|
||||
if (ids==null||ids.isEmpty()){
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
throw new RuntimeException("订单id为空");
|
||||
}
|
||||
List<PurchaseOrderDO> ordersByIds = purchaseOrderService.getOrdersByIds(ids.stream().map(String::valueOf).toList());
|
||||
List<Long> purchaseOrderIds = new ArrayList<>();
|
||||
List<Long> salesOrderIds = new ArrayList<>();
|
||||
if (ordersByIds.isEmpty()) {
|
||||
return CommonResult.success(new ArrayList<>());
|
||||
}
|
||||
ordersByIds.forEach(o->{
|
||||
if ("SALE".equals(o.getSplyBsnTp())) {
|
||||
// 销售订单
|
||||
salesOrderIds.add(o.getId());
|
||||
} else {
|
||||
// 非销售订单(采购订单)
|
||||
purchaseOrderIds.add(o.getId());
|
||||
}
|
||||
});
|
||||
List<PurchaseOrderWithDetailsDTO> purchaseOrderDetails = getSalesOrdDetailsByIds(purchaseOrderIds);
|
||||
List<PurchaseOrderWithDetailsDTO> salesOrdDetails = getPurchaseOrderDetailsByIds(salesOrderIds);
|
||||
if (!purchaseOrderDetails.isEmpty()) {
|
||||
purchaseOrderDetails.addAll(salesOrdDetails);
|
||||
}
|
||||
if (!salesOrdDetails.isEmpty()) {
|
||||
purchaseOrderDetails.addAll(salesOrdDetails);
|
||||
}
|
||||
return CommonResult.success(purchaseOrderDetails);
|
||||
}
|
||||
|
||||
|
||||
private List<PurchaseOrderWithDetailsDTO> getSalesOrdDetailsByIds(List<Long> ids) {
|
||||
if (ids.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
SalesOrderMapper salesOrderMapper = SpringUtil.getBean(SalesOrderMapper.class);
|
||||
SalesOrderDetailMapper salesOrderDetailMapper = SpringUtil.getBean(SalesOrderDetailMapper.class);
|
||||
List<SalesOrderDO> salesOrderDOS = salesOrderMapper.selectList(SalesOrderDO::getId, ids);
|
||||
if (salesOrderDOS.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<PurchaseOrderWithDetailsDTO> purchaseOrderWithDetailsDTOS = BeanUtils.toBean(salesOrderDOS, PurchaseOrderWithDetailsDTO.class);
|
||||
purchaseOrderWithDetailsDTOS.forEach(purchaseOrderWithDetailsDTO -> {
|
||||
List<SalesOrderDetailDO> salesOrderDetailDOS = salesOrderDetailMapper.selectList(SalesOrderDetailDO::getOrderId, purchaseOrderWithDetailsDTO.getId());
|
||||
List<SalesOrdDtlDTO> salesOrdDtlDTOS = BeanUtils.toBean(salesOrderDetailDOS, SalesOrdDtlDTO.class);
|
||||
purchaseOrderWithDetailsDTO.setSalesOrdDtlDTOS(salesOrdDtlDTOS);
|
||||
});
|
||||
return purchaseOrderWithDetailsDTOS;
|
||||
}
|
||||
|
||||
private List<PurchaseOrderWithDetailsDTO> getPurchaseOrderDetailsByIds(List<Long> ids) {
|
||||
if (ids.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<PurchaseOrderWithDetailsDTO> purchaseOrderWithDetailsDTOS = new ArrayList<>();
|
||||
List<PurchaseOrderDetailsRespVO> purchaseOrderWithDetailsVOS = purchaseOrderService.getOrderByIds(ids);
|
||||
purchaseOrderWithDetailsVOS.forEach(purchaseOrderWithDetailsVO -> {
|
||||
if (purchaseOrderWithDetailsVO!= null) {
|
||||
PurchaseOrderWithDetailsDTO purchaseOrderWithDetailsDTO = BeanUtils.toBean(purchaseOrderWithDetailsVO,
|
||||
PurchaseOrderWithDetailsDTO.class);
|
||||
if (purchaseOrderWithDetailsVO != null) {
|
||||
PurchaseOrderWithDetailsDTO purchaseOrderWithDetailsDTO = BeanUtils.toBean(purchaseOrderWithDetailsVO, PurchaseOrderWithDetailsDTO.class);
|
||||
if (purchaseOrderWithDetailsVO.getOrderDetails().isEmpty()) {
|
||||
purchaseOrderWithDetailsDTO.setOrderDetails(new ArrayList<>());
|
||||
purchaseOrderWithDetailsDTO.setPrchOrdDtlDTOS(new ArrayList<>());
|
||||
} else {
|
||||
purchaseOrderWithDetailsDTO.setOrderDetails(BeanUtils.toBean(purchaseOrderWithDetailsVO.getOrderDetails(), PrchOrdDtlDTO.class));
|
||||
purchaseOrderWithDetailsDTO.setPrchOrdDtlDTOS(BeanUtils.toBean(purchaseOrderWithDetailsVO.getOrderDetails(), PrchOrdDtlDTO.class));
|
||||
}
|
||||
purchaseOrderWithDetailsDTOS.add(purchaseOrderWithDetailsDTO);
|
||||
}
|
||||
});
|
||||
return success(purchaseOrderWithDetailsDTOS);
|
||||
return purchaseOrderWithDetailsDTOS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class PrchOrdDtlDetailsRespVO {
|
||||
* 税码(字典: PRCH_TAX);推送ERP
|
||||
*/
|
||||
|
||||
private BigDecimal taxNum;
|
||||
private String taxNum;
|
||||
/**
|
||||
* 是否基于GR的发票校验;推送ERP
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.contractorder.controller.admin.salesorder;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
@@ -8,7 +9,9 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.contractorder.api.ContractApi;
|
||||
import com.zt.plat.module.contractorder.api.ContractApiImpl;
|
||||
import com.zt.plat.module.contractorder.api.dto.order.PurchaseOrderWithDetailsDTO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
||||
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderPageReqVO;
|
||||
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderRespVO;
|
||||
@@ -26,12 +29,14 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.redisson.api.RObject;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
@@ -85,10 +90,10 @@ public class SalesOrderController implements BusinessControllerMarker {
|
||||
@Operation(summary = "获得销售订单")
|
||||
@Parameter(name = "id", description = "id是订单主键,splyBsnTp是订单类型销售或者是消费", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('base:sales-order:query')")
|
||||
public CommonResult<SalesOrderRespVO> getSalesOrder(@RequestParam("id") Long id,@RequestParam(value = "splyBsnTp",required = false) String splyBsnTp) {
|
||||
public CommonResult<SalesOrderRespVO> getSalesOrder(@RequestParam("id") Long id, @RequestParam(value = "splyBsnTp", required = false) String splyBsnTp) {
|
||||
SalesOrderDO purchaseOrder = salesOrderService.getSalesOrder(id, splyBsnTp);
|
||||
SalesOrderRespVO salesOrderRespVO = BeanUtils.toBean(purchaseOrder, SalesOrderRespVO.class);
|
||||
if (salesOrderRespVO == null){
|
||||
if (salesOrderRespVO == null) {
|
||||
return success(null);
|
||||
}
|
||||
salesOrderService.setSalesOrderDetail(salesOrderRespVO);
|
||||
@@ -101,7 +106,7 @@ public class SalesOrderController implements BusinessControllerMarker {
|
||||
public CommonResult<PageResult<SalesOrderRespVO>> getSalesOrderPage(@Valid SalesOrderPageReqVO pageReqVO) {
|
||||
PageResult<SalesOrderDO> pageResult = salesOrderService.getSalesOrderPage(pageReqVO);
|
||||
PageResult<SalesOrderRespVO> salesOrderRespVOPageResult = BeanUtils.toBean(pageResult, SalesOrderRespVO.class);
|
||||
if (salesOrderRespVOPageResult.getList() != null){
|
||||
if (salesOrderRespVOPageResult.getList() != null) {
|
||||
salesOrderRespVOPageResult.getList().forEach(purchaseOrderRespVO -> salesOrderService.setSalesOrderDetail(purchaseOrderRespVO));
|
||||
}
|
||||
|
||||
@@ -124,14 +129,14 @@ public class SalesOrderController implements BusinessControllerMarker {
|
||||
//推送erp091
|
||||
@PostMapping("/push-erp091")
|
||||
@Operation(summary = "推送erp091")
|
||||
public CommonResult<Boolean> pushErp091(@RequestParam("id")String id ) {
|
||||
public CommonResult<Boolean> pushErp091(@RequestParam("id") String id) {
|
||||
return success(salesOrderService.pushErp091(id));
|
||||
}
|
||||
|
||||
//提交审批
|
||||
@PostMapping("/submit-order")
|
||||
@Operation(summary = "提交审批")
|
||||
public CommonResult<String> submitOrder(@RequestParam("id")String id ) {
|
||||
public CommonResult<String> submitOrder(@RequestParam("id") String id) {
|
||||
return success(salesOrderService.submitOrder(id));
|
||||
}
|
||||
|
||||
@@ -141,6 +146,7 @@ public class SalesOrderController implements BusinessControllerMarker {
|
||||
public CommonResult<Boolean> orderPassReject(@RequestBody SalesOrderReviewReqVO reqVO) {
|
||||
return success(salesOrderService.orderPassReject(reqVO));
|
||||
}
|
||||
|
||||
//关联订单
|
||||
@PostMapping("/link-order")
|
||||
@Operation(summary = "关联订单")
|
||||
@@ -152,7 +158,7 @@ public class SalesOrderController implements BusinessControllerMarker {
|
||||
@PostMapping("/order-by-order-id-and-type")
|
||||
@Operation(summary = "根据订单id和方式获取上或下游订单")
|
||||
public CommonResult<List<DownOrUpOrderRespVO>> getOrderByOrderIdAndType(@RequestBody DownOrUpOrderReqVO reqVO) {
|
||||
return success( salesOrderService.getOrderByOrderIdAndType(reqVO));
|
||||
return success(salesOrderService.getOrderByOrderIdAndType(reqVO));
|
||||
}
|
||||
|
||||
|
||||
@@ -168,5 +174,4 @@ public class SalesOrderController implements BusinessControllerMarker {
|
||||
salesOrderService.updateOrderStatusByIdOrOrderNo(req);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -124,6 +124,25 @@ public interface PurchaseOrderService {
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean linkOrder(@Valid LinkOrderReqVO LinkOrderReqVO);
|
||||
|
||||
/**
|
||||
* 获取订单详情
|
||||
*
|
||||
* @param ids 订单id
|
||||
* @return 订单详情
|
||||
*/
|
||||
List<PurchaseOrderDetailsRespVO> getOrderByIds(List<Long> ids);
|
||||
/**
|
||||
* 获取订单详情
|
||||
*
|
||||
* @param orderNos 订单编号
|
||||
* @return 订单详情
|
||||
*/
|
||||
List<PurchaseOrderDO> getOrderByNos(List<String> orderNos);
|
||||
/**
|
||||
* 获取订单详情
|
||||
*
|
||||
* @param ids 订单id
|
||||
* @return 订单详情
|
||||
*/
|
||||
List<PurchaseOrderDO> getOrdersByIds(List<String> ids);
|
||||
}
|
||||
|
||||
@@ -677,4 +677,14 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
||||
});
|
||||
return purchaseOrderDetailsRespVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PurchaseOrderDO> getOrderByNos(List<String> orderNos) {
|
||||
return purchaseOrderMapper.selectList(PurchaseOrderDO::getSystemOrderNumber, orderNos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PurchaseOrderDO> getOrdersByIds(List<String> ids) {
|
||||
return purchaseOrderMapper.selectByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user