0.0
2 years ago
16 changed files with 809 additions and 184 deletions
@ -1,146 +0,0 @@
|
||||
package com.logpm.warehouse.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* 运单; |
||||
* @author : http://www.chiner.pro
|
||||
* @date : 2023-7-4 |
||||
*/ |
||||
@Data |
||||
@ApiModel(value = "运单",description = "") |
||||
@TableName("logpm_warehouse_waybill") |
||||
public class WarehouseWaybill extends TenantEntity { |
||||
|
||||
/** 运单号 */ |
||||
@ApiModelProperty(name = "运单号",notes = "") |
||||
private String waybillNo ; |
||||
/** 订单自编号 */ |
||||
@ApiModelProperty(name = "订单自编号",notes = "") |
||||
private String orderNo ; |
||||
/** 目的仓 */ |
||||
@ApiModelProperty(name = "目的仓",notes = "") |
||||
private String destinationWarehouse ; |
||||
/** 发站仓 */ |
||||
@ApiModelProperty(name = "发站仓",notes = "") |
||||
private String departureWarehouse ; |
||||
/** 客户车次 */ |
||||
@ApiModelProperty(name = "客户车次",notes = "") |
||||
private String customerTrain ; |
||||
/** 品牌 */ |
||||
@ApiModelProperty(name = "品牌",notes = "") |
||||
private String brand ; |
||||
/** 发货单位id */ |
||||
@ApiModelProperty(name = "发货单位id",notes = "") |
||||
private Long shipperId ; |
||||
/** 发货单位 */ |
||||
@ApiModelProperty(name = "发货单位",notes = "") |
||||
private String shipper ; |
||||
/** 发货人 */ |
||||
@ApiModelProperty(name = "发货人",notes = "") |
||||
private String shipperName ; |
||||
/** 发货方手机号 */ |
||||
@ApiModelProperty(name = "发货方手机号",notes = "") |
||||
private String shipperMobile ; |
||||
/** 发货方地址 */ |
||||
@ApiModelProperty(name = "发货方地址",notes = "") |
||||
private String shipperAddress ; |
||||
/** 收货单位id */ |
||||
@ApiModelProperty(name = "收货单位id",notes = "") |
||||
private Long consigneeId ; |
||||
/** 收货单位 */ |
||||
@ApiModelProperty(name = "收货单位",notes = "") |
||||
private String consignee ; |
||||
/** 收货人 */ |
||||
@ApiModelProperty(name = "收货人",notes = "") |
||||
private String consigneeName ; |
||||
/** 收货方手机号 */ |
||||
@ApiModelProperty(name = "收货方手机号",notes = "") |
||||
private String consigneeMobile ; |
||||
/** 收货方地址 */ |
||||
@ApiModelProperty(name = "收货方地址",notes = "") |
||||
private String consigneeAddress ; |
||||
/** 到站 */ |
||||
@ApiModelProperty(name = "到站",notes = "") |
||||
private String destination ; |
||||
/** 货物名称 */ |
||||
@ApiModelProperty(name = "货物名称",notes = "") |
||||
private String goodsName ; |
||||
/** 总数 */ |
||||
@ApiModelProperty(name = "总数",notes = "") |
||||
private Integer totalCount ; |
||||
/** 在库数 */ |
||||
@ApiModelProperty(name = "在库数",notes = "") |
||||
private Integer stockCount ; |
||||
/** 总重量 */ |
||||
@ApiModelProperty(name = "总重量",notes = "") |
||||
private BigDecimal totalWeight ; |
||||
/** 总体积 */ |
||||
@ApiModelProperty(name = "总体积",notes = "") |
||||
private BigDecimal totalVolume ; |
||||
/** 送货方式 */ |
||||
@ApiModelProperty(name = "送货方式",notes = "") |
||||
private Integer deliveryMethod ; |
||||
/** 紧急度 */ |
||||
@ApiModelProperty(name = "紧急度",notes = "") |
||||
private Integer urgency ; |
||||
/** 回单数 */ |
||||
@ApiModelProperty(name = "回单数",notes = "") |
||||
private Integer receiptCount ; |
||||
/** 回单要求 */ |
||||
@ApiModelProperty(name = "回单要求",notes = "") |
||||
private String receiptRequirement ; |
||||
/** 经办人 */ |
||||
@ApiModelProperty(name = "经办人",notes = "") |
||||
private String agent ; |
||||
/** 经办人id */ |
||||
@ApiModelProperty(name = "经办人id",notes = "") |
||||
private Long agentId ; |
||||
/** 发展仓id */ |
||||
@ApiModelProperty(name = "发展仓id",notes = "") |
||||
private Long departureWarehouseId ; |
||||
/** 目的仓id */ |
||||
@ApiModelProperty(name = "目的仓id",notes = "") |
||||
private Long destinationWarehouseId ; |
||||
/** 制单时间 */ |
||||
@ApiModelProperty(name = "制单时间",notes = "") |
||||
private Date documentMakingTime ; |
||||
/** 备注 */ |
||||
@ApiModelProperty(name = "备注",notes = "") |
||||
private String remark ; |
||||
/** 批次号 */ |
||||
@ApiModelProperty(name = "批次号",notes = "") |
||||
private String batchNo ; |
||||
/** 服务类型 */ |
||||
@ApiModelProperty(name = "服务类型",notes = "") |
||||
private Integer serviceType ; |
||||
/** 服务号 */ |
||||
@ApiModelProperty(name = "服务号",notes = "") |
||||
private String serviceNo ; |
||||
/** 冻结状态 */ |
||||
@ApiModelProperty(name = "冻结状态",notes = "") |
||||
private Integer freezeStatus ; |
||||
/** 预留1 */ |
||||
@ApiModelProperty(name = "预留1",notes = "") |
||||
private String reserve1 ; |
||||
/** 预留2 */ |
||||
@ApiModelProperty(name = "预留2",notes = "") |
||||
private String reserve2 ; |
||||
/** 预留3 */ |
||||
@ApiModelProperty(name = "预留3",notes = "") |
||||
private String reserve3 ; |
||||
/** 预留4 */ |
||||
@ApiModelProperty(name = "预留4",notes = "") |
||||
private String reserve4 ; |
||||
/** 预留5 */ |
||||
@ApiModelProperty(name = "预留5",notes = "") |
||||
private String reserve5 ; |
||||
|
||||
} |
@ -0,0 +1,247 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.warehouse.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* 运单表 实体类 |
||||
* |
||||
* @author zhy |
||||
* @since 2023-07-10 |
||||
*/ |
||||
@Data |
||||
@TableName("logpm_warehouse_waybill") |
||||
@ApiModel(value = "WarehouseWaybill对象", description = "运单表") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class WarehouseWaybillEntity extends TenantEntity { |
||||
|
||||
/** |
||||
* 运单号 |
||||
*/ |
||||
@ApiModelProperty(value = "运单号") |
||||
private String waybillNo; |
||||
/** |
||||
* 订单自编号 |
||||
*/ |
||||
@ApiModelProperty(value = "订单自编号") |
||||
private String orderNo; |
||||
/** |
||||
* 目的仓 |
||||
*/ |
||||
@ApiModelProperty(value = "目的仓") |
||||
private String destinationWarehouse; |
||||
/** |
||||
* 发站仓 |
||||
*/ |
||||
@ApiModelProperty(value = "发站仓") |
||||
private String departureWarehouse; |
||||
/** |
||||
* 客户车次 |
||||
*/ |
||||
@ApiModelProperty(value = "客户车次") |
||||
private String customerTrain; |
||||
/** |
||||
* 品牌 |
||||
*/ |
||||
@ApiModelProperty(value = "品牌") |
||||
private String brand; |
||||
/** |
||||
* 发货单位 |
||||
*/ |
||||
@ApiModelProperty(value = "发货单位") |
||||
private String shipper; |
||||
/** |
||||
* 发货人 |
||||
*/ |
||||
@ApiModelProperty(value = "发货人") |
||||
private String shipperName; |
||||
/** |
||||
* 发货方手机号 |
||||
*/ |
||||
@ApiModelProperty(value = "发货方手机号") |
||||
private String shipperMobile; |
||||
/** |
||||
* 发货方地址 |
||||
*/ |
||||
@ApiModelProperty(value = "发货方地址") |
||||
private String shipperAddress; |
||||
/** |
||||
* 收货单位 |
||||
*/ |
||||
@ApiModelProperty(value = "收货单位") |
||||
private String consignee; |
||||
/** |
||||
* 收货人 |
||||
*/ |
||||
@ApiModelProperty(value = "收货人") |
||||
private String consigneeName; |
||||
/** |
||||
* 收货方手机号 |
||||
*/ |
||||
@ApiModelProperty(value = "收货方手机号") |
||||
private String consigneeMobile; |
||||
/** |
||||
* 收货方地址 |
||||
*/ |
||||
@ApiModelProperty(value = "收货方地址") |
||||
private String consigneeAddress; |
||||
/** |
||||
* 到站 |
||||
*/ |
||||
@ApiModelProperty(value = "到站") |
||||
private String destination; |
||||
/** |
||||
* 货物名称 |
||||
*/ |
||||
@ApiModelProperty(value = "货物名称") |
||||
private String goodsName; |
||||
/** |
||||
* 总数 |
||||
*/ |
||||
@ApiModelProperty(value = "总数") |
||||
private Integer totalCount; |
||||
/** |
||||
* 在库数 |
||||
*/ |
||||
@ApiModelProperty(value = "在库数") |
||||
private Integer stockCount; |
||||
/** |
||||
* 总重量 |
||||
*/ |
||||
@ApiModelProperty(value = "总重量") |
||||
private BigDecimal totalWeight; |
||||
/** |
||||
* 总体积 |
||||
*/ |
||||
@ApiModelProperty(value = "总体积") |
||||
private BigDecimal totalVolume; |
||||
/** |
||||
* 送货方式 |
||||
*/ |
||||
@ApiModelProperty(value = "送货方式") |
||||
private Integer deliveryMethod; |
||||
/** |
||||
* 紧急度 |
||||
*/ |
||||
@ApiModelProperty(value = "紧急度") |
||||
private Integer urgency; |
||||
/** |
||||
* 回单数 |
||||
*/ |
||||
@ApiModelProperty(value = "回单数") |
||||
private Integer receiptCount; |
||||
/** |
||||
* 回单要求 |
||||
*/ |
||||
@ApiModelProperty(value = "回单要求") |
||||
private String receiptRequirement; |
||||
/** |
||||
* 经办人 |
||||
*/ |
||||
@ApiModelProperty(value = "经办人") |
||||
private String agent; |
||||
/** |
||||
* 经办人id |
||||
*/ |
||||
@ApiModelProperty(value = "经办人id") |
||||
private Long agentId; |
||||
/** |
||||
* 收货单位id |
||||
*/ |
||||
@ApiModelProperty(value = "收货单位id") |
||||
private Long consigneeId; |
||||
/** |
||||
* 发货单位id |
||||
*/ |
||||
@ApiModelProperty(value = "发货单位id") |
||||
private Long shipperId; |
||||
/** |
||||
* 发展仓id |
||||
*/ |
||||
@ApiModelProperty(value = "发展仓id") |
||||
private Long departureWarehouseId; |
||||
/** |
||||
* 目的仓id |
||||
*/ |
||||
@ApiModelProperty(value = "目的仓id") |
||||
private Long destinationWarehouseId; |
||||
/** |
||||
* 制单时间 |
||||
*/ |
||||
@ApiModelProperty(value = "制单时间") |
||||
private Date documentMakingTime; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ApiModelProperty(value = "备注") |
||||
private String remark; |
||||
/** |
||||
* 批次号 |
||||
*/ |
||||
@ApiModelProperty(value = "批次号") |
||||
private String batchNo; |
||||
/** |
||||
* 服务类型 |
||||
*/ |
||||
@ApiModelProperty(value = "服务类型") |
||||
private Integer serviceType; |
||||
/** |
||||
* 服务号 |
||||
*/ |
||||
@ApiModelProperty(value = "服务号") |
||||
private String serviceNo; |
||||
/** |
||||
* 冻结状态 |
||||
*/ |
||||
@ApiModelProperty(value = "冻结状态") |
||||
private Integer freezeStatus; |
||||
/** |
||||
* 预留1 |
||||
*/ |
||||
@ApiModelProperty(value = "预留1") |
||||
private String reserve1; |
||||
/** |
||||
* 预留2 |
||||
*/ |
||||
@ApiModelProperty(value = "预留2") |
||||
private String reserve2; |
||||
/** |
||||
* 预留3 |
||||
*/ |
||||
@ApiModelProperty(value = "预留3") |
||||
private String reserve3; |
||||
/** |
||||
* 预留4 |
||||
*/ |
||||
@ApiModelProperty(value = "预留4") |
||||
private String reserve4; |
||||
/** |
||||
* 预留5 |
||||
*/ |
||||
@ApiModelProperty(value = "预留5") |
||||
private String reserve5; |
||||
|
||||
} |
@ -0,0 +1,35 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.warehouse.vo; |
||||
|
||||
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
||||
import org.springblade.core.tool.node.INode; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 运单表 视图实体类 |
||||
* |
||||
* @author zhy |
||||
* @since 2023-07-10 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class WarehouseWaybillVO extends WarehouseWaybillEntity { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -1,18 +1,204 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.warehouse.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import com.logpm.distribution.entity.DistributionStockArticleEntity; |
||||
import com.logpm.distribution.feign.IDistributionStockArticleClient; |
||||
import com.logpm.warehouse.dto.ProductDTO; |
||||
import com.logpm.warehouse.dto.SplitOrderDTO; |
||||
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
||||
import com.logpm.warehouse.service.IWarehouseWaybillService; |
||||
import com.logpm.warehouse.vo.WarehouseWaybillVO; |
||||
import com.logpm.warehouse.wrapper.WarehouseWaybillWrapper; |
||||
import io.swagger.annotations.Api; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.log4j.Log4j2; |
||||
import org.springblade.common.exception.CustomerException; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import javax.validation.Valid; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 运单;(logpm_mainline_waybill)表控制层 |
||||
* @author : http://www.chiner.pro
|
||||
* @date : 2023-7-4 |
||||
* 运单表 控制器 |
||||
* |
||||
* @author zhy |
||||
* @since 2023-07-10 |
||||
*/ |
||||
@Api(tags = "运单对象功能接口") |
||||
@Log4j2 |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/warehouseWaybill") |
||||
public class WarehouseWaybillController { |
||||
@Api(value = "运单表", tags = "运单表接口") |
||||
public class WarehouseWaybillController extends BladeController { |
||||
|
||||
private final IWarehouseWaybillService warehouseWaybillService; |
||||
|
||||
private final IDistributionStockArticleClient distributionStockArticleClient; |
||||
|
||||
/** |
||||
* 运单表 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入warehouseWaybill") |
||||
public R<WarehouseWaybillVO> detail(WarehouseWaybillEntity warehouseWaybill) { |
||||
WarehouseWaybillEntity detail = warehouseWaybillService.getOne(Condition.getQueryWrapper(warehouseWaybill)); |
||||
return R.data(WarehouseWaybillWrapper.build().entityVO(detail)); |
||||
} |
||||
/** |
||||
* 运单表 分页 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入warehouseWaybill") |
||||
public R<IPage<WarehouseWaybillVO>> list(@ApiIgnore @RequestParam Map<String, Object> warehouseWaybill, Query query) { |
||||
IPage<WarehouseWaybillEntity> pages = warehouseWaybillService.page(Condition.getPage(query), Condition.getQueryWrapper(warehouseWaybill, WarehouseWaybillEntity.class)); |
||||
return R.data(WarehouseWaybillWrapper.build().pageVO(pages)); |
||||
} |
||||
|
||||
/** |
||||
* 运单表 自定义分页 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入warehouseWaybill") |
||||
public R<IPage<WarehouseWaybillVO>> page(WarehouseWaybillVO warehouseWaybill, Query query) { |
||||
IPage<WarehouseWaybillVO> pages = warehouseWaybillService.selectWarehouseWaybillPage(Condition.getPage(query), warehouseWaybill); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 运单表 新增 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入warehouseWaybill") |
||||
public R save(@Valid @RequestBody WarehouseWaybillEntity warehouseWaybill) { |
||||
return R.status(warehouseWaybillService.save(warehouseWaybill)); |
||||
} |
||||
|
||||
/** |
||||
* 运单表 修改 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入warehouseWaybill") |
||||
public R update(@Valid @RequestBody WarehouseWaybillEntity warehouseWaybill) { |
||||
return R.status(warehouseWaybillService.updateById(warehouseWaybill)); |
||||
} |
||||
|
||||
/** |
||||
* 运单表 新增或修改 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入warehouseWaybill") |
||||
public R submit(@Valid @RequestBody WarehouseWaybillEntity warehouseWaybill) { |
||||
return R.status(warehouseWaybillService.saveOrUpdate(warehouseWaybill)); |
||||
} |
||||
|
||||
/** |
||||
* 运单表 删除 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(warehouseWaybillService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
@PostMapping("/splitOrder") |
||||
@ResponseBody |
||||
@ApiOperationSupport(order = 8) |
||||
@ApiOperation(value = "拆单", notes = "传入ids") |
||||
public R splitOrder(@RequestBody List<SplitOrderDTO> splitOrderDTOList) { |
||||
//先查询运单数据
|
||||
if(splitOrderDTOList.size() < 1){ |
||||
log.warn("################splitOrder: 没有拆单数据"); |
||||
return R.fail(405,"没有拆单数据"); |
||||
} |
||||
String waybillNo = splitOrderDTOList.get(0).getWaybillNo();//运单号
|
||||
//查询运单
|
||||
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillService.findByWaybillNo(waybillNo); |
||||
if(Objects.isNull(warehouseWaybillEntity)){ |
||||
log.warn("################splitOrder: 未找到运单信息 waybillNo={}",waybillNo); |
||||
return R.fail(405,"未找到运单信息"); |
||||
} |
||||
Integer totalCount = warehouseWaybillEntity.getTotalCount();//包件总数量
|
||||
Integer stockCount = warehouseWaybillEntity.getStockCount();//包件在库数量
|
||||
//如果在库数量不等总数量 则不能进行拆单
|
||||
if(!totalCount.equals(stockCount)){ |
||||
log.warn("################splitOrder: 在库数量不等于总数量,不能拆单 waybillNo={}",waybillNo); |
||||
return R.fail(405,"在库数量不等于总数量"); |
||||
} |
||||
//判断运单对应的订单是否已经
|
||||
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findByOrderSelfNum(waybillNo); |
||||
if(Objects.isNull(distributionStockArticleEntity)){ |
||||
log.warn("################splitOrder: 当前在库订单已转库存品,不能拆单 waybillNo={}",waybillNo); |
||||
return R.fail(405,"当前在库订单已转库存品"); |
||||
} |
||||
Integer state = distributionStockArticleEntity.getState();//订单状态
|
||||
Long orderId = distributionStockArticleEntity.getId();//订单id
|
||||
if(!state.equals(1)){ |
||||
log.warn("################splitOrder: 当前在库订单已进入配送流程,不能拆单 waybillNo={}",waybillNo); |
||||
return R.fail(405,"当前在库订单已进入配送流程"); |
||||
} |
||||
//判断拆单后的数值是否等于总数量
|
||||
Integer total = new Integer("1"); |
||||
for (SplitOrderDTO splitOrderDTO:splitOrderDTOList){ |
||||
List<ProductDTO> products = splitOrderDTO.getProducts(); |
||||
for (ProductDTO productDTO:products){ |
||||
total = total + productDTO.getNum(); |
||||
} |
||||
} |
||||
if(!totalCount.equals(total)){ |
||||
log.warn("################splitOrder: 拆单数量不等于总数量 waybillNo={}",waybillNo); |
||||
return R.fail(405,"拆单数量不等于总数量"); |
||||
} |
||||
|
||||
try{ |
||||
//拆单操作
|
||||
warehouseWaybillService.splitOrder(splitOrderDTOList,distributionStockArticleEntity); |
||||
//拆单完成去把以前的订单逻辑删除
|
||||
distributionStockArticleClient.deleteById(orderId); |
||||
|
||||
return R.success("拆单成功"); |
||||
}catch (CustomerException e){ |
||||
log.warn(e.message); |
||||
return R.fail(e.code,e.message); |
||||
}catch (Exception e){ |
||||
log.warn("系统出现异常",e); |
||||
return R.fail(500,"系统出现异常"); |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
||||
|
@ -0,0 +1,22 @@
|
||||
package com.logpm.warehouse.dto; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
@Data |
||||
public class SplitOrderDTO implements Serializable { |
||||
|
||||
private String waybillNo; |
||||
|
||||
private String customerPerson; |
||||
|
||||
private String customerMobile; |
||||
|
||||
private String customerAddress; |
||||
|
||||
private List<ProductDTO> products = new ArrayList<>(); |
||||
|
||||
} |
@ -0,0 +1,34 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.warehouse.dto; |
||||
|
||||
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 运单表 数据传输对象实体类 |
||||
* |
||||
* @author zhy |
||||
* @since 2023-07-10 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class WarehouseWaybillDTO extends WarehouseWaybillEntity { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -1,15 +1,43 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.warehouse.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.logpm.warehouse.entity.WarehouseWaybill; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
||||
import com.logpm.warehouse.vo.WarehouseWaybillVO; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 运单;(logpm_mainline_waybill)表数据库访问层 |
||||
* @author : http://www.chiner.pro
|
||||
* @date : 2023-7-4 |
||||
* 运单表 Mapper 接口 |
||||
* |
||||
* @author zhy |
||||
* @since 2023-07-10 |
||||
*/ |
||||
@Mapper |
||||
public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybill>{ |
||||
public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntity> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param warehouseWaybill |
||||
* @return |
||||
*/ |
||||
List<WarehouseWaybillVO> selectWarehouseWaybillPage(IPage page, WarehouseWaybillVO warehouseWaybill); |
||||
|
||||
} |
||||
|
@ -1,17 +1,36 @@
|
||||
package com.logpm.warehouse.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.logpm.distribution.entity.DistributionStockArticleEntity; |
||||
import com.logpm.warehouse.dto.SplitOrderDTO; |
||||
import com.logpm.warehouse.dto.WaybillDTO; |
||||
import com.logpm.warehouse.entity.WarehouseWaybill; |
||||
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
||||
import com.logpm.warehouse.vo.WarehouseWaybillVO; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 运单;(logpm_mainline_waybill)表服务接口 |
||||
* @author : http://www.chiner.pro
|
||||
* @date : 2023-7-4 |
||||
*/ |
||||
public interface IWarehouseWaybillService { |
||||
public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEntity> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param warehouseWaybill |
||||
* @return |
||||
*/ |
||||
IPage<WarehouseWaybillVO> selectWarehouseWaybillPage(IPage<WarehouseWaybillVO> page, WarehouseWaybillVO warehouseWaybill); |
||||
|
||||
|
||||
void waybillDataHandler(WaybillDTO waybillDTO); |
||||
|
||||
WarehouseWaybill findByWaybillNo(String waybillNo); |
||||
WarehouseWaybillEntity findByWaybillNo(String waybillNo); |
||||
|
||||
void splitOrder(List<SplitOrderDTO> splitOrderDTOList, DistributionStockArticleEntity distributionStockArticleEntity); |
||||
|
||||
} |
||||
|
@ -0,0 +1,50 @@
|
||||
/* |
||||
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* Neither the name of the dreamlu.net developer nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* Author: Chill 庄骞 (smallchill@163.com) |
||||
*/ |
||||
package com.logpm.warehouse.wrapper; |
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
||||
import com.logpm.warehouse.vo.WarehouseWaybillVO; |
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 运单表 包装类,返回视图层所需的字段 |
||||
* |
||||
* @author zhy |
||||
* @since 2023-07-10 |
||||
*/ |
||||
public class WarehouseWaybillWrapper extends BaseEntityWrapper<WarehouseWaybillEntity, WarehouseWaybillVO> { |
||||
|
||||
public static WarehouseWaybillWrapper build() { |
||||
return new WarehouseWaybillWrapper(); |
||||
} |
||||
|
||||
@Override |
||||
public WarehouseWaybillVO entityVO(WarehouseWaybillEntity warehouseWaybill) { |
||||
WarehouseWaybillVO warehouseWaybillVO = Objects.requireNonNull(BeanUtil.copy(warehouseWaybill, WarehouseWaybillVO.class)); |
||||
|
||||
//User createUser = UserCache.getUser(warehouseWaybill.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(warehouseWaybill.getUpdateUser());
|
||||
//warehouseWaybillVO.setCreateUserName(createUser.getName());
|
||||
//warehouseWaybillVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return warehouseWaybillVO; |
||||
} |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue