出库接口
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
package com.yxt.warehouse.apiadmin;
|
package com.yxt.warehouse.apiadmin;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.yxt.common.base.utils.ExportExcelUtils;
|
import com.yxt.common.base.utils.ExportExcelUtils;
|
||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
import com.yxt.warehouse.biz.warehouseinventory.*;
|
import com.yxt.warehouse.biz.warehouseinventory.*;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocation;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -29,6 +33,8 @@ public class WarehouseInventoryRest {
|
|||||||
WarehouseInventoryService WarehouseInventoryService;
|
WarehouseInventoryService WarehouseInventoryService;
|
||||||
@Autowired
|
@Autowired
|
||||||
HttpServletResponse response;
|
HttpServletResponse response;
|
||||||
|
@Autowired
|
||||||
|
WarehouseOutLocationService warehouseOutLocationService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -198,4 +204,24 @@ public class WarehouseInventoryRest {
|
|||||||
public GoodsCountVo selCountsBySkuSid(@RequestParam("skuSid") String skuSid) {
|
public GoodsCountVo selCountsBySkuSid(@RequestParam("skuSid") String skuSid) {
|
||||||
return WarehouseInventoryService.selCountsBySkuSid(skuSid);
|
return WarehouseInventoryService.selCountsBySkuSid(skuSid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据skuSid查询商品可用库存")
|
||||||
|
@GetMapping("/selAvailableBySkuSid")
|
||||||
|
public ResultBean<List<AvailableCountVo>> selAvailableBySkuSid(@RequestParam("skuSid") String skuSid,
|
||||||
|
@RequestParam("sourceBillSid") String sourceBillSid,
|
||||||
|
@RequestParam("orgSid") String orgSid) {
|
||||||
|
ResultBean rb =new ResultBean().fail();
|
||||||
|
List<AvailableCountVo> w=WarehouseInventoryService.selAvailableBySkuSid(skuSid,orgSid);
|
||||||
|
for (AvailableCountVo availableCountVo : w) {
|
||||||
|
WarehouseOutLocation warehouseOutLocation=warehouseOutLocationService.getOne(new QueryWrapper<WarehouseOutLocation>()
|
||||||
|
.eq("sourceBillSid",sourceBillSid).eq("inventorySid",availableCountVo.getSid()));
|
||||||
|
if(null!=warehouseOutLocation){
|
||||||
|
availableCountVo.setInitialCount(warehouseOutLocation.getCount());
|
||||||
|
availableCountVo.setCount(warehouseOutLocation.getCount());
|
||||||
|
availableCountVo.setLocationSid(warehouseOutLocation.getSid());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rb.success().setData(w);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.yxt.warehouse.apiadmin;
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoice.WarehouseInvoiceQuery;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutDto;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutQuery;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbill.*;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2024/8/14 14:56
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Api(tags = "发票和出库单关联表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/apiadmin/warehouseinvoiceout")
|
||||||
|
public class WarehouseInvoiceOutRest {
|
||||||
|
@Autowired
|
||||||
|
private WarehouseInvoiceOutService warehouseInvoiceOutService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("详情")
|
||||||
|
@GetMapping("/details")
|
||||||
|
ResultBean<List<WarehouseInvoiceOutVo>> details(@RequestParam("sid") String sid) {
|
||||||
|
return warehouseInvoiceOutService.detailsByInvoiceSid(sid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.yxt.warehouse.apiadmin;
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoice.WarehouseInvoiceDto;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoice.WarehouseInvoiceService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoice.WarehouseInvoiceVo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2024/8/14 14:55
|
||||||
|
*/
|
||||||
|
@Api(tags = "发票信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/apiadmin/warehouseinvoice")
|
||||||
|
public class WarehouseInvoiceRest {
|
||||||
|
@Autowired
|
||||||
|
private WarehouseInvoiceService warehouseInvoiceService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("保存修改")
|
||||||
|
@PostMapping("/saveOrUpdate")
|
||||||
|
ResultBean saveOrUpdate(@RequestBody WarehouseInvoiceDto dto) {
|
||||||
|
return warehouseInvoiceService.saveOrUpdate(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("详情")
|
||||||
|
@GetMapping("/details")
|
||||||
|
ResultBean<WarehouseInvoiceVo> details(@RequestParam("sid") String sid) {
|
||||||
|
return warehouseInvoiceService.details(sid);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,13 +12,15 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangpengfei
|
* @author wangpengfei
|
||||||
* @date 2024/6/7 13:51
|
* @date 2024/6/7 13:51
|
||||||
*/
|
*/
|
||||||
@Api(tags = "出库单据明细")
|
@Api(tags = "出库单据明细")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/apiadmin/wmsoutbilldetail")
|
@RequestMapping("/apiadmin/warehouseoutbilldetail")
|
||||||
public class WarehouseOutBillDetailRest {
|
public class WarehouseOutBillDetailRest {
|
||||||
@Autowired
|
@Autowired
|
||||||
WarehouseOutBillDetailService warehouseOutBillDetailService;
|
WarehouseOutBillDetailService warehouseOutBillDetailService;
|
||||||
@@ -51,4 +53,12 @@ public class WarehouseOutBillDetailRest {
|
|||||||
WarehouseOutBillDetailVo vo = warehouseOutBillDetailService.fetchDetailsVoBySid(sid);
|
WarehouseOutBillDetailVo vo = warehouseOutBillDetailService.fetchDetailsVoBySid(sid);
|
||||||
return rb.success().setData(vo);
|
return rb.success().setData(vo);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("根据SID获取一条记录")
|
||||||
|
@GetMapping("/selectDetailsByBillSid")
|
||||||
|
public ResultBean<List<WarehouseOutBillDetailVo>> selectDetailsByBillSid(@RequestParam("sid") String sid){
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<WarehouseOutBillDetailVo> vo = warehouseOutBillDetailService.selectDetailsByBillSid(sid);
|
||||||
|
return rb.success().setData(vo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.yxt.common.core.query.PagerQuery;
|
|||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
import com.yxt.warehouse.biz.warehouseoutbill.*;
|
import com.yxt.warehouse.biz.warehouseoutbill.*;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -16,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
**/
|
**/
|
||||||
@Api(tags = "出库单据")
|
@Api(tags = "出库单据")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/apiadmin/WmsOutBill")
|
@RequestMapping("/apiadmin/warehouseoutbill")
|
||||||
public class WarehouseOutBillRest {
|
public class WarehouseOutBillRest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -26,8 +27,7 @@ public class WarehouseOutBillRest {
|
|||||||
@PostMapping("/listPage")
|
@PostMapping("/listPage")
|
||||||
ResultBean<PagerVo<WarehouseOutBillVo>> pageList(@RequestBody PagerQuery<WarehouseOutBillQuery> pagerQuery) {
|
ResultBean<PagerVo<WarehouseOutBillVo>> pageList(@RequestBody PagerQuery<WarehouseOutBillQuery> pagerQuery) {
|
||||||
ResultBean<PagerVo<WarehouseOutBillVo>> rb = ResultBean.fireFail();
|
ResultBean<PagerVo<WarehouseOutBillVo>> rb = ResultBean.fireFail();
|
||||||
PagerVo<WarehouseOutBillVo> pv = wmsOutBillService.listPage(pagerQuery);
|
return wmsOutBillService.listPage(pagerQuery);
|
||||||
return rb.success().setData(pv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("出库保存修改")
|
@ApiOperation("出库保存修改")
|
||||||
@@ -35,19 +35,53 @@ public class WarehouseOutBillRest {
|
|||||||
ResultBean saveOrUpdateOutBill(@RequestBody WarehouseOutBillDto dto) {
|
ResultBean saveOrUpdateOutBill(@RequestBody WarehouseOutBillDto dto) {
|
||||||
return wmsOutBillService.saveOrUpdateOutBill(dto);
|
return wmsOutBillService.saveOrUpdateOutBill(dto);
|
||||||
}
|
}
|
||||||
|
// @ApiOperation("收件地址")
|
||||||
|
// @PostMapping("/selectGoodsByBillSid")
|
||||||
|
// ResultBean<PagerVo<WarehouseOutBillDetailsVo>> selectGoodsByBillSid(@RequestBody PagerQuery<WarehouseOutBillQuery> pagerQuery) {
|
||||||
|
// return wmsOutBillService.selectGoodsByBillSid(pagerQuery);
|
||||||
|
// }
|
||||||
@ApiOperation("详情")
|
@ApiOperation("详情")
|
||||||
@GetMapping("/details")
|
@GetMapping("/details")
|
||||||
ResultBean<WarehouseOutBillDetailsVo> details(@RequestParam("sid") String sid) {
|
ResultBean<WarehouseOutBillDetailsVo> details(@RequestParam("sid") String sid) {
|
||||||
return wmsOutBillService.details(sid);
|
return wmsOutBillService.details(sid);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("收件地址")
|
||||||
|
@GetMapping("/getAddresseeBySid")
|
||||||
|
ResultBean<WarehouseOutBillDetailsVo> getAddresseeBySid(@RequestParam("sid") String sid) {
|
||||||
|
return wmsOutBillService.getAddresseeBySid(sid);
|
||||||
|
}
|
||||||
@ApiOperation("选择商品分页列表")
|
@ApiOperation("选择商品分页列表")
|
||||||
@PostMapping("/getInventoryList")
|
@PostMapping("/getInventoryList")
|
||||||
ResultBean<PagerVo<WarehouseOutBillInventoryVo>> getInventoryList(@RequestBody PagerQuery<WarehouseOutBillInventoryQuery> pagerQuery) {
|
ResultBean<PagerVo<WarehouseOutBillDetailVo>> getInventoryList(@RequestBody PagerQuery<WarehouseOutBillGoodsQuery> pagerQuery) {
|
||||||
ResultBean<PagerVo<WarehouseOutBillInventoryVo>> rb = ResultBean.fireFail();
|
ResultBean<PagerVo<WarehouseOutBillDetailVo>> rb = ResultBean.fireFail();
|
||||||
PagerVo<WarehouseOutBillInventoryVo> pv = wmsOutBillService.getInventoryList(pagerQuery);
|
PagerVo<WarehouseOutBillDetailVo> pv = wmsOutBillService.getInventoryList(pagerQuery);
|
||||||
return rb.success().setData(pv);
|
return rb.success().setData(pv);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("修改承运商")
|
||||||
|
@PostMapping("/updateCarrier")
|
||||||
|
public ResultBean updateCarrier(WarehouseOutBillDto dto) {
|
||||||
|
return wmsOutBillService.updateCarrier(dto);
|
||||||
|
}
|
||||||
|
@ApiOperation("修改运单号")
|
||||||
|
@PostMapping("/updateWaybillNumber")
|
||||||
|
public ResultBean updateWaybillNumber(WarehouseOutBillDto dto) {
|
||||||
|
return wmsOutBillService.updateWaybillNumber(dto);
|
||||||
|
}
|
||||||
|
@ApiOperation("待分配-->打到零拣")
|
||||||
|
@PostMapping("/toBePickOut")
|
||||||
|
ResultBean toBePickOut(@RequestBody WarehouseOutStateQuery query) {
|
||||||
|
return wmsOutBillService.toBePickOut(query);
|
||||||
|
}
|
||||||
|
@ApiOperation("零拣打单 --> 待出库")
|
||||||
|
@PostMapping("/toBeOutbound")
|
||||||
|
ResultBean toBeOutbound(@RequestBody WarehouseOutStateQuery query) {
|
||||||
|
return wmsOutBillService.toBeOutbound(query);
|
||||||
|
}
|
||||||
|
@ApiOperation("零拣打单--->待分配")
|
||||||
|
@PostMapping("/toBeAllocated")
|
||||||
|
ResultBean toBeAllocated(@RequestBody WarehouseOutStateQuery query) {
|
||||||
|
return wmsOutBillService.toBeAllocated(query);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("确认")
|
@ApiOperation("确认")
|
||||||
@PostMapping("/confirm")
|
@PostMapping("/confirm")
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.yxt.warehouse.apiadmin;
|
||||||
|
|
||||||
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoice.WarehouseInvoiceDto;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoice.WarehouseInvoiceVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationDto;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationVo;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2024/8/15 10:09
|
||||||
|
*/
|
||||||
|
@Api(tags = "出库库位分配")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/apiadmin/warehouseoutlocation")
|
||||||
|
public class WarehouseOutLocationRest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
WarehouseOutLocationService warehouseOutLocationService;
|
||||||
|
|
||||||
|
@ApiOperation("保存修改")
|
||||||
|
@PostMapping("/save")
|
||||||
|
ResultBean saveOrUpdate(@RequestBody List<WarehouseOutLocationDto> dtos) {
|
||||||
|
return warehouseOutLocationService.save(dtos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("详情")
|
||||||
|
@GetMapping("/details")
|
||||||
|
ResultBean<List<WarehouseOutLocationVo>> details(@RequestParam("sid") String sid) {
|
||||||
|
return warehouseOutLocationService.details(sid);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -154,8 +154,10 @@ public class WarehouseAnsBillService extends MybatisBaseService<WarehouseAnsBill
|
|||||||
IPage<WarehouseAnsBillVo> pagging = baseMapper.listPages(page, qw);
|
IPage<WarehouseAnsBillVo> pagging = baseMapper.listPages(page, qw);
|
||||||
for (WarehouseAnsBillVo record : pagging.getRecords()) {
|
for (WarehouseAnsBillVo record : pagging.getRecords()) {
|
||||||
WarehouseRack warehouseRack=warehouseRackService.getOne(new QueryWrapper<WarehouseRack>().eq("sid",record.getWarehouseRackSid()));
|
WarehouseRack warehouseRack=warehouseRackService.getOne(new QueryWrapper<WarehouseRack>().eq("sid",record.getWarehouseRackSid()));
|
||||||
|
if(null!=warehouseRack){
|
||||||
record.setWarehouseRackCode(warehouseRack.getRackCode());
|
record.setWarehouseRackCode(warehouseRack.getRackCode());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
PagerVo<WarehouseAnsBillVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<WarehouseAnsBillVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<delete id="deleteDetails">
|
<delete id="deleteDetails">
|
||||||
delete
|
delete
|
||||||
from warehouse_ans_bill_detail
|
from warehouse_ans_bill_detail
|
||||||
where billSid = #{sid}
|
where sourceBillSid = #{sid}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectByBillSid" resultType="com.yxt.warehouse.biz.warehouseansbilldetail.WarehouseAnsListDetailsVo">
|
<select id="selectByBillSid" resultType="com.yxt.warehouse.biz.warehouseansbilldetail.WarehouseAnsListDetailsVo">
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinventory;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2024/8/15 11:23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AvailableCountVo {
|
||||||
|
private String sid;
|
||||||
|
private String locationSid;//分配明细sid
|
||||||
|
private String goodsSkuSid;
|
||||||
|
private String goodsSpuName;
|
||||||
|
private String warehouseName;
|
||||||
|
private String areaName;
|
||||||
|
private String rackSid;
|
||||||
|
private String rackName;
|
||||||
|
private String rackCode;
|
||||||
|
private BigDecimal useCount;
|
||||||
|
private BigDecimal initialCount=new BigDecimal(0);//原分配数
|
||||||
|
private BigDecimal count=new BigDecimal(0);//分配数
|
||||||
|
}
|
||||||
@@ -55,4 +55,6 @@ public interface WarehouseInventoryMapper extends BaseMapper<WarehouseInventory>
|
|||||||
String selInventoryCountBySkuSid(@Param("skuSid") String skuSid);
|
String selInventoryCountBySkuSid(@Param("skuSid") String skuSid);
|
||||||
|
|
||||||
GoodsCountVo selCountsBySkuSid(@Param("skuSid") String skuSid);
|
GoodsCountVo selCountsBySkuSid(@Param("skuSid") String skuSid);
|
||||||
|
List<AvailableCountVo> selAvailableBySkuSid(@Param("skuSid") String skuSid,@Param("orgSid") String orgSid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,4 +306,21 @@
|
|||||||
WHERE
|
WHERE
|
||||||
goodsSkuSid = #{skuSid}
|
goodsSkuSid = #{skuSid}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selAvailableBySkuSid" resultType="com.yxt.warehouse.biz.warehouseinventory.AvailableCountVo">
|
||||||
|
SELECT
|
||||||
|
a.warehouseName,
|
||||||
|
c.areaName,
|
||||||
|
b.rackName,
|
||||||
|
b.rackCode,
|
||||||
|
a.count - a.allocateCount AS useCount
|
||||||
|
FROM
|
||||||
|
warehouse_inventory a
|
||||||
|
LEFT JOIN warehouse_rack b ON a.warehouseRackSid = b.sid
|
||||||
|
LEFT JOIN warehouse_area c ON c.sid = b.locationSid
|
||||||
|
WHERE
|
||||||
|
a.goodsSkuSid = #{skuSid} and
|
||||||
|
a.useOrgSid=#{orgSid}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -459,4 +459,7 @@ public class WarehouseInventoryService extends MybatisBaseService<WarehouseInven
|
|||||||
public GoodsCountVo selCountsBySkuSid(String skuSid) {
|
public GoodsCountVo selCountsBySkuSid(String skuSid) {
|
||||||
return baseMapper.selCountsBySkuSid(skuSid);
|
return baseMapper.selCountsBySkuSid(skuSid);
|
||||||
}
|
}
|
||||||
|
public List<AvailableCountVo> selAvailableBySkuSid(String skuSid,String orgSid) {
|
||||||
|
return baseMapper.selAvailableBySkuSid(skuSid,orgSid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoice;
|
||||||
|
|
||||||
|
import com.yxt.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseInvoice extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("单据sid")
|
||||||
|
private String billSid;
|
||||||
|
@ApiModelProperty("发票类型 1 普通发票")
|
||||||
|
private String invoiceType;
|
||||||
|
|
||||||
|
@ApiModelProperty("开票方")
|
||||||
|
private String invoicingParty;
|
||||||
|
@ApiModelProperty("抬头")
|
||||||
|
private String rise;
|
||||||
|
@ApiModelProperty("总金额")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
@ApiModelProperty("税号")
|
||||||
|
private String dutyParagraph;
|
||||||
|
@ApiModelProperty("内容类型 1 发票商品 2自定义明细")
|
||||||
|
private String contentType;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoice;
|
||||||
|
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutDto;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailDto;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseInvoiceDto {
|
||||||
|
private String sid;
|
||||||
|
@ApiModelProperty("单据sid")
|
||||||
|
private String billSid;
|
||||||
|
@ApiModelProperty("发票类型 1 普通发票")
|
||||||
|
private String invoiceType;
|
||||||
|
|
||||||
|
@ApiModelProperty("开票方")
|
||||||
|
private String invoicingParty;
|
||||||
|
@ApiModelProperty("抬头")
|
||||||
|
private String rise;
|
||||||
|
@ApiModelProperty("总金额")
|
||||||
|
private String totalAmount;
|
||||||
|
@ApiModelProperty("税号")
|
||||||
|
private String dutyParagraph;
|
||||||
|
@ApiModelProperty("内容类型 1 发票商品 2自定义明细")
|
||||||
|
private String contentType;
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
|
||||||
|
private List<WarehouseInvoiceOutDto> detailsList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoice;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Mapper
|
||||||
|
public interface WarehouseInvoiceMapper extends BaseMapper<WarehouseInvoice> {
|
||||||
|
|
||||||
|
WarehouseInvoiceVo details(@Param("sid") String sid);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yxt.warehouse.biz.warehouseinvoice.WarehouseInvoiceMapper">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="details" resultType="com.yxt.warehouse.biz.warehouseinvoice.WarehouseInvoiceVo">
|
||||||
|
select a.*,
|
||||||
|
case a.invoiceType when 1 then '普通发票' end as invoiceTypeValue,
|
||||||
|
case a.contentType when 1 then '发票商品' when 2 then '2自定义明细' end as contentTypeValue
|
||||||
|
from warehouse_invoice a
|
||||||
|
<where>
|
||||||
|
a.billSid=#{sid}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoice;
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.Query;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseInvoiceQuery implements Query {
|
||||||
|
|
||||||
|
@ApiModelProperty("单据编号")
|
||||||
|
private String billNo;
|
||||||
|
private String billState;
|
||||||
|
@ApiModelProperty("外部单号")
|
||||||
|
private String externalOrderNumber;
|
||||||
|
@ApiModelProperty("线上单号")
|
||||||
|
private String onlineOrderNumber;
|
||||||
|
@ApiModelProperty("买家")
|
||||||
|
private String buyer;
|
||||||
|
@ApiModelProperty("运单号")
|
||||||
|
private String waybillNumber;
|
||||||
|
@ApiModelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
@ApiModelProperty("承运商")
|
||||||
|
private String carrier;
|
||||||
|
@ApiModelProperty("手机")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("出库类型")
|
||||||
|
private String outboundType;
|
||||||
|
@ApiModelProperty("地址")
|
||||||
|
private String address;
|
||||||
|
@ApiModelProperty("下单日期开始时间")
|
||||||
|
private String orderTimeStart;
|
||||||
|
@ApiModelProperty("下单日期结束时间")
|
||||||
|
private String orderTimeEnd;
|
||||||
|
|
||||||
|
private String orgLevelKey;//权限等级
|
||||||
|
@ApiModelProperty("菜单路由")
|
||||||
|
private String menuUrl;
|
||||||
|
@ApiModelProperty("组织全路径sid")
|
||||||
|
private String orgPath;
|
||||||
|
@ApiModelProperty("用户sid")
|
||||||
|
private String userSid;
|
||||||
|
private int index;
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoice;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
|
import com.yxt.common.base.utils.StringUtils;
|
||||||
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutDto;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetail;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class WarehouseInvoiceService extends MybatisBaseService<WarehouseInvoiceMapper, WarehouseInvoice> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
WarehouseInvoiceOutService warehouseInvoiceOutService;
|
||||||
|
@Autowired
|
||||||
|
WarehouseOutBillDetailService warehouseOutBillDetailService;
|
||||||
|
public ResultBean<String> saveOrUpdate(WarehouseInvoiceDto dto) {
|
||||||
|
ResultBean<String> rb = ResultBean.fireFail();
|
||||||
|
String sid = dto.getSid();
|
||||||
|
BigDecimal total=new BigDecimal(0);
|
||||||
|
if (StringUtils.isBlank(sid)) {
|
||||||
|
WarehouseInvoice warehouseInvoice = new WarehouseInvoice();
|
||||||
|
BeanUtil.copyProperties(dto, warehouseInvoice, "sid");
|
||||||
|
sid = warehouseInvoice.getSid();
|
||||||
|
List<WarehouseInvoiceOutDto> detailsList=new ArrayList<>();
|
||||||
|
if(dto.getContentType().equals("1")){
|
||||||
|
List<WarehouseOutBillDetail> s=warehouseOutBillDetailService.list(new QueryWrapper<WarehouseOutBillDetail>().eq("sid",dto.getBillSid()));
|
||||||
|
for (WarehouseOutBillDetail warehouseOutBillDetail : s) {
|
||||||
|
WarehouseInvoiceOutDto d=new WarehouseInvoiceOutDto();
|
||||||
|
d.setPrice(warehouseOutBillDetail.getPrice());
|
||||||
|
d.setOrderCount(warehouseOutBillDetail.getOrderCount());
|
||||||
|
d.setUnit(warehouseOutBillDetail.getUnit());
|
||||||
|
d.setGoodsSkuSid(warehouseOutBillDetail.getGoodsSkuSid());
|
||||||
|
d.setGoodsSpuName(warehouseOutBillDetail.getGoodsSpuName());
|
||||||
|
detailsList.add(d);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
detailsList= dto.getDetailsList();
|
||||||
|
}
|
||||||
|
detailsList.stream().forEach(s->s.setInvoiceSid(warehouseInvoice.getSid()));
|
||||||
|
detailsList.removeAll(Collections.singleton(null));
|
||||||
|
if (detailsList.size() > 0) {
|
||||||
|
total=warehouseInvoiceOutService.saveOrUpdate(detailsList).getData();
|
||||||
|
|
||||||
|
}
|
||||||
|
warehouseInvoice.setTotalAmount(total);
|
||||||
|
baseMapper.insert(warehouseInvoice);
|
||||||
|
} else {
|
||||||
|
WarehouseInvoice warehouseInvoice = fetchBySid(sid);
|
||||||
|
if (warehouseInvoice == null) {
|
||||||
|
return rb.setMsg("该单据不存在");
|
||||||
|
}
|
||||||
|
List<WarehouseInvoiceOutDto> detailsList=new ArrayList<>();
|
||||||
|
if(dto.getContentType().equals("1")){
|
||||||
|
List<WarehouseOutBillDetail> s=warehouseOutBillDetailService.list(new QueryWrapper<WarehouseOutBillDetail>().eq("sid",dto.getBillSid()));
|
||||||
|
for (WarehouseOutBillDetail warehouseOutBillDetail : s) {
|
||||||
|
WarehouseInvoiceOutDto d=new WarehouseInvoiceOutDto();
|
||||||
|
d.setPrice(warehouseOutBillDetail.getPrice());
|
||||||
|
d.setOrderCount(warehouseOutBillDetail.getOrderCount());
|
||||||
|
d.setUnit(warehouseOutBillDetail.getUnit());
|
||||||
|
d.setGoodsSkuSid(warehouseOutBillDetail.getGoodsSkuSid());
|
||||||
|
d.setGoodsSpuName(warehouseOutBillDetail.getGoodsSpuName());
|
||||||
|
detailsList.add(d);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
detailsList= dto.getDetailsList();
|
||||||
|
}
|
||||||
|
BeanUtil.copyProperties(dto, warehouseInvoice, "sid");
|
||||||
|
detailsList.stream().forEach(s->s.setInvoiceSid(warehouseInvoice.getSid()));
|
||||||
|
detailsList.removeAll(Collections.singleton(null));
|
||||||
|
if (detailsList.size() > 0) {
|
||||||
|
total=warehouseInvoiceOutService.saveOrUpdate(detailsList).getData();
|
||||||
|
}
|
||||||
|
warehouseInvoice.setTotalAmount(total);
|
||||||
|
baseMapper.updateById(warehouseInvoice);
|
||||||
|
}
|
||||||
|
return rb.success().setData(sid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean<WarehouseInvoiceVo> details(String sid) {
|
||||||
|
ResultBean<WarehouseInvoiceVo> rb = ResultBean.fireFail();
|
||||||
|
WarehouseInvoiceVo warehouseInvoiceDetailsVo = baseMapper.details(sid);
|
||||||
|
if (warehouseInvoiceDetailsVo == null) {
|
||||||
|
return rb.setMsg("该单据不存在");
|
||||||
|
}
|
||||||
|
//ToDo:需补充仓库等信息
|
||||||
|
List<WarehouseInvoiceOutVo> detailsList = warehouseInvoiceOutService.detailsByInvoiceSid(warehouseInvoiceDetailsVo.getSid()).getData();
|
||||||
|
detailsList.removeAll(Collections.singleton(null));
|
||||||
|
if (!detailsList.isEmpty()) {
|
||||||
|
warehouseInvoiceDetailsVo.setDetailsList(detailsList);
|
||||||
|
}
|
||||||
|
return rb.success().setData(warehouseInvoiceDetailsVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoice;
|
||||||
|
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutDto;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutVo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseInvoiceVo {
|
||||||
|
private String sid;
|
||||||
|
@ApiModelProperty("单据sid")
|
||||||
|
private String billSid;
|
||||||
|
@ApiModelProperty("发票类型 1 普通发票")
|
||||||
|
private String invoiceType;
|
||||||
|
private String invoiceTypeValue;
|
||||||
|
|
||||||
|
@ApiModelProperty("开票方")
|
||||||
|
private String invoicingParty;
|
||||||
|
@ApiModelProperty("抬头")
|
||||||
|
private String rise;
|
||||||
|
@ApiModelProperty("总金额")
|
||||||
|
private String totalAmount;
|
||||||
|
@ApiModelProperty("税号")
|
||||||
|
private String dutyParagraph;
|
||||||
|
@ApiModelProperty("内容类型 1 发票商品 2自定义明细")
|
||||||
|
private String contentType;
|
||||||
|
private String contentTypeValue;
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
|
||||||
|
private List<WarehouseInvoiceOutVo> detailsList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoiceout;
|
||||||
|
|
||||||
|
import com.yxt.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseInvoiceOut extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("发票sid")
|
||||||
|
private String invoiceSid;
|
||||||
|
@ApiModelProperty("商品skusid")
|
||||||
|
private String goodsSkuSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名")
|
||||||
|
private String goodsSpuName;
|
||||||
|
@ApiModelProperty("单位")
|
||||||
|
private String unit;
|
||||||
|
@ApiModelProperty("单价")
|
||||||
|
private BigDecimal price;
|
||||||
|
@ApiModelProperty("数量")
|
||||||
|
private BigDecimal orderCount;
|
||||||
|
@ApiModelProperty("总金额")
|
||||||
|
private BigDecimal salesAmount;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoiceout;
|
||||||
|
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailDto;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseInvoiceOutDto {
|
||||||
|
|
||||||
|
private String sid;
|
||||||
|
@ApiModelProperty("发票sid")
|
||||||
|
private String invoiceSid;
|
||||||
|
@ApiModelProperty("商品skusid")
|
||||||
|
private String goodsSkuSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名")
|
||||||
|
private String goodsSpuName;
|
||||||
|
@ApiModelProperty("单位")
|
||||||
|
private String unit;
|
||||||
|
@ApiModelProperty("单价")
|
||||||
|
private BigDecimal price;
|
||||||
|
@ApiModelProperty("数量")
|
||||||
|
private BigDecimal orderCount;
|
||||||
|
@ApiModelProperty("总金额")
|
||||||
|
private BigDecimal salesAmount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoiceout;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbill.WarehouseOutBillDetailsVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbill.WarehouseOutBillInventoryVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Mapper
|
||||||
|
public interface WarehouseInvoiceOutMapper extends BaseMapper<WarehouseInvoiceOut> {
|
||||||
|
IPage<WarehouseInvoiceOutVo> listPage(IPage<WarehouseInvoiceOut> page, @Param(Constants.WRAPPER) QueryWrapper<WarehouseInvoiceOut> qw);
|
||||||
|
|
||||||
|
List<WarehouseInvoiceOutVo> detailsByInvoiceSid(@Param("sid") String sid);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listPage" resultType="com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutVo">
|
||||||
|
select a.* from warehouse_invoice_out a
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="detailsByInvoiceSid" resultType="com.yxt.warehouse.biz.warehouseinvoiceout.WarehouseInvoiceOutVo">
|
||||||
|
select a.* from warehouse_invoice_out a
|
||||||
|
<where>
|
||||||
|
a.invoiceSid=#{sid}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoiceout;
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.Query;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseInvoiceOutQuery implements Query {
|
||||||
|
|
||||||
|
@ApiModelProperty("单据编号")
|
||||||
|
private String billNo;
|
||||||
|
private String billState;
|
||||||
|
@ApiModelProperty("外部单号")
|
||||||
|
private String externalOrderNumber;
|
||||||
|
@ApiModelProperty("线上单号")
|
||||||
|
private String onlineOrderNumber;
|
||||||
|
@ApiModelProperty("买家")
|
||||||
|
private String buyer;
|
||||||
|
@ApiModelProperty("运单号")
|
||||||
|
private String waybillNumber;
|
||||||
|
@ApiModelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
@ApiModelProperty("承运商")
|
||||||
|
private String carrier;
|
||||||
|
@ApiModelProperty("手机")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("出库类型")
|
||||||
|
private String outboundType;
|
||||||
|
@ApiModelProperty("地址")
|
||||||
|
private String address;
|
||||||
|
@ApiModelProperty("下单日期开始时间")
|
||||||
|
private String orderTimeStart;
|
||||||
|
@ApiModelProperty("下单日期结束时间")
|
||||||
|
private String orderTimeEnd;
|
||||||
|
|
||||||
|
private String orgLevelKey;//权限等级
|
||||||
|
@ApiModelProperty("菜单路由")
|
||||||
|
private String menuUrl;
|
||||||
|
@ApiModelProperty("组织全路径sid")
|
||||||
|
private String orgPath;
|
||||||
|
@ApiModelProperty("用户sid")
|
||||||
|
private String userSid;
|
||||||
|
private int index;
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoiceout;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinventory.WarehouseInventoryService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinventoryrecord.WarehouseInventoryRecordService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class WarehouseInvoiceOutService extends MybatisBaseService<WarehouseInvoiceOutMapper, WarehouseInvoiceOut> {
|
||||||
|
@Autowired
|
||||||
|
private WarehouseOutBillDetailService warehouseOutBillDetailService;
|
||||||
|
@Autowired
|
||||||
|
private WarehouseInventoryService warehouseInventoryService;
|
||||||
|
@Autowired
|
||||||
|
private WarehouseInventoryRecordService warehouseInventoryRecordService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public ResultBean<BigDecimal> saveOrUpdate(List<WarehouseInvoiceOutDto> dtos) {
|
||||||
|
ResultBean<BigDecimal> rb = ResultBean.fireFail();
|
||||||
|
if(dtos.size()!=0){
|
||||||
|
baseMapper.delete(new QueryWrapper<WarehouseInvoiceOut>().eq("invoiceSid",dtos.get(0).getInvoiceSid()));
|
||||||
|
}
|
||||||
|
BigDecimal total=new BigDecimal(0);
|
||||||
|
for (WarehouseInvoiceOutDto dto : dtos) {
|
||||||
|
WarehouseInvoiceOut warehouseInvoiceOut = new WarehouseInvoiceOut();
|
||||||
|
BeanUtil.copyProperties(dto, warehouseInvoiceOut, "sid");
|
||||||
|
warehouseInvoiceOut.setSalesAmount(warehouseInvoiceOut.getOrderCount().multiply(warehouseInvoiceOut.getPrice()));
|
||||||
|
total=total.add(warehouseInvoiceOut.getSalesAmount());
|
||||||
|
baseMapper.insert(warehouseInvoiceOut);
|
||||||
|
}
|
||||||
|
return rb.success().setData(total);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean<List<WarehouseInvoiceOutVo>> detailsByInvoiceSid(String sid) {
|
||||||
|
ResultBean<List<WarehouseInvoiceOutVo>> rb = ResultBean.fireFail();
|
||||||
|
List<WarehouseInvoiceOutVo> warehouseInvoiceOutVo = baseMapper.detailsByInvoiceSid(sid);
|
||||||
|
if (warehouseInvoiceOutVo.size()==0) {
|
||||||
|
return rb.setMsg("该单据不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
return rb.success().setData(warehouseInvoiceOutVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseinvoiceout;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseInvoiceOutVo {
|
||||||
|
|
||||||
|
private String sid;
|
||||||
|
@ApiModelProperty("发票sid")
|
||||||
|
private String invoiceSid;
|
||||||
|
@ApiModelProperty("商品skusid")
|
||||||
|
private String goodsSkuSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名")
|
||||||
|
private String goodsSpuName;
|
||||||
|
@ApiModelProperty("单位")
|
||||||
|
private String unit;
|
||||||
|
@ApiModelProperty("单价")
|
||||||
|
private BigDecimal price;
|
||||||
|
@ApiModelProperty("数量")
|
||||||
|
private BigDecimal orderCount;
|
||||||
|
@ApiModelProperty("总金额")
|
||||||
|
private BigDecimal salesAmount;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,32 +14,96 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
public class WarehouseOutBill extends BaseEntity {
|
public class WarehouseOutBill extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("单据编号")
|
@ApiModelProperty("单据编号")
|
||||||
private String billNo;
|
private String billNo;
|
||||||
|
@ApiModelProperty("0 待分配 1零拣打单 2待出库 3已出库")
|
||||||
|
private String billState;
|
||||||
|
|
||||||
@ApiModelProperty("来源单号")
|
@ApiModelProperty("来源单号")
|
||||||
private String sourceBillNo;
|
private String sourceBillNo;
|
||||||
@ApiModelProperty("制单人")
|
@ApiModelProperty("外部状态")
|
||||||
private String createByName;
|
private String externalState;
|
||||||
@ApiModelProperty("业务类型key")
|
@ApiModelProperty("买家留言")
|
||||||
private String busTypeKey;
|
private String buyerMessage;
|
||||||
@ApiModelProperty("业务类型value((销售出库、采购退货出库等))")
|
@ApiModelProperty("库存状态")
|
||||||
private String busTypeValue;
|
private String inventoryStatus;
|
||||||
@ApiModelProperty("货主sid")
|
|
||||||
private String goodsOwnerSid;
|
|
||||||
@ApiModelProperty("货主")
|
@ApiModelProperty("货主")
|
||||||
private String goodsOwner;
|
private String shipper;
|
||||||
@ApiModelProperty("已完成/已发货")
|
@ApiModelProperty("承运商")
|
||||||
private Integer billState;
|
private String carrierKey;
|
||||||
@ApiModelProperty("是否一起发货(否0,是1)")
|
private String carrierValue;
|
||||||
private Integer isTogether;
|
@ApiModelProperty("运单号")
|
||||||
@ApiModelProperty("挂起状态(1挂起,0不挂起,2解锁)")
|
private String waybillNumber;
|
||||||
private Integer isHandUp;
|
@ApiModelProperty("配送方式")
|
||||||
@ApiModelProperty("优先级")
|
private String deliveryMethod;
|
||||||
private Integer priority;
|
@ApiModelProperty("买家")
|
||||||
@ApiModelProperty("实际发货时间")
|
private String buyer;
|
||||||
private Date actualDeliveTime;
|
@ApiModelProperty("收货人")
|
||||||
|
private String consignee;
|
||||||
|
@ApiModelProperty("固话")
|
||||||
|
private String fixedLine;
|
||||||
|
@ApiModelProperty("邮编")
|
||||||
|
private String postalCode;
|
||||||
|
@ApiModelProperty("省")
|
||||||
|
private String province;
|
||||||
|
@ApiModelProperty("市")
|
||||||
|
private String city;
|
||||||
|
@ApiModelProperty("区")
|
||||||
|
private String county;
|
||||||
|
@ApiModelProperty("街道")
|
||||||
|
private String street;
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
@ApiModelProperty("手机")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("实付")
|
||||||
|
private double actualPayment;
|
||||||
|
@ApiModelProperty("优惠")
|
||||||
|
private double discount;
|
||||||
|
@ApiModelProperty("运费")
|
||||||
|
private double freight;
|
||||||
|
@ApiModelProperty("重量")
|
||||||
|
private double weight;
|
||||||
|
@ApiModelProperty("估重")
|
||||||
|
private double weightEstimation;
|
||||||
|
@ApiModelProperty("商品数量")
|
||||||
|
private double quantity;
|
||||||
|
@ApiModelProperty("下单时间")
|
||||||
|
private Date orderTime;
|
||||||
|
@ApiModelProperty("订单号")
|
||||||
|
private String orderNumber;
|
||||||
|
@ApiModelProperty("外部订单号")
|
||||||
|
private String externalOrderNumber;
|
||||||
|
@ApiModelProperty("线上订单号")
|
||||||
|
private String onlineOrderNumber;
|
||||||
|
@ApiModelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
@ApiModelProperty("付款时间")
|
||||||
|
private Date paymentTime;
|
||||||
|
@ApiModelProperty("接单时间")
|
||||||
|
private Date orderAcceptanceTime;
|
||||||
|
@ApiModelProperty("拣选区域")
|
||||||
|
private String pickingArea;
|
||||||
|
@ApiModelProperty("出库类型")
|
||||||
|
private String outboundType;
|
||||||
|
@ApiModelProperty("品牌")
|
||||||
|
private String brand;
|
||||||
|
@ApiModelProperty("波次")
|
||||||
|
private String waveTimes;
|
||||||
|
@ApiModelProperty("超时时间")
|
||||||
|
private Date timeoutPeriod;
|
||||||
|
@ApiModelProperty("到货时间")
|
||||||
|
private Date deliveryTime;
|
||||||
|
@ApiModelProperty("体积")
|
||||||
|
private double volume;
|
||||||
|
@ApiModelProperty("标记")
|
||||||
|
private String sign;
|
||||||
|
@ApiModelProperty("最晚发货时间")
|
||||||
|
private Date latestDeliveryTime;
|
||||||
@ApiModelProperty("创建组织sid")
|
@ApiModelProperty("创建组织sid")
|
||||||
private String createOrgSid;
|
private String createOrgSid;
|
||||||
@ApiModelProperty("使用组织sid")
|
@ApiModelProperty("使用组织sid")
|
||||||
private String useOrgSid;
|
private String useOrgSid;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,22 +17,95 @@ import java.util.List;
|
|||||||
public class WarehouseOutBillDetailsVo {
|
public class WarehouseOutBillDetailsVo {
|
||||||
|
|
||||||
private String sid;
|
private String sid;
|
||||||
@ApiModelProperty("创建人sid")
|
@ApiModelProperty("0 待分配 1零拣打单 2待出库 3已出库")
|
||||||
private String createBySid;
|
|
||||||
@ApiModelProperty("制单人")
|
|
||||||
private String createByName;
|
|
||||||
@ApiModelProperty("单据日期")
|
|
||||||
private String createTime;
|
|
||||||
@ApiModelProperty("外部单号")
|
|
||||||
private String sourceBillNo;
|
|
||||||
|
|
||||||
@ApiModelProperty("业务类型key")
|
|
||||||
private String busTypeKey;
|
|
||||||
@ApiModelProperty("业务类型value((销售出库、采购退货出库等))")
|
|
||||||
private String busTypeValue;
|
|
||||||
|
|
||||||
@ApiModelProperty("单据状态")
|
|
||||||
private String billState;
|
private String billState;
|
||||||
|
@ApiModelProperty("单据编号")
|
||||||
|
private String billNo;
|
||||||
|
@ApiModelProperty("来源单号")
|
||||||
|
private String sourceBillNo;
|
||||||
|
@ApiModelProperty("外部状态")
|
||||||
|
private String externalState;
|
||||||
|
@ApiModelProperty("买家留言")
|
||||||
|
private String buyerMessage;
|
||||||
|
@ApiModelProperty("库存状态")
|
||||||
|
private String inventoryStatus;
|
||||||
|
@ApiModelProperty("货主")
|
||||||
|
private String shipper;
|
||||||
|
@ApiModelProperty("承运商")
|
||||||
|
private String carrierKey;
|
||||||
|
private String carrierValue;
|
||||||
|
@ApiModelProperty("运单号")
|
||||||
|
private String waybillNumber;
|
||||||
|
@ApiModelProperty("配送方式")
|
||||||
|
private String deliveryMethod;
|
||||||
|
@ApiModelProperty("买家")
|
||||||
|
private String buyer;
|
||||||
|
@ApiModelProperty("收货人")
|
||||||
|
private String consignee;
|
||||||
|
@ApiModelProperty("固话")
|
||||||
|
private String fixedLine;
|
||||||
|
@ApiModelProperty("邮编")
|
||||||
|
private String postalCode;
|
||||||
|
@ApiModelProperty("省")
|
||||||
|
private String province;
|
||||||
|
@ApiModelProperty("市")
|
||||||
|
private String city;
|
||||||
|
@ApiModelProperty("区")
|
||||||
|
private String county;
|
||||||
|
@ApiModelProperty("街道")
|
||||||
|
private String street;
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
@ApiModelProperty("手机")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("实付")
|
||||||
|
private double actualPayment;
|
||||||
|
@ApiModelProperty("优惠")
|
||||||
|
private double discount;
|
||||||
|
@ApiModelProperty("运费")
|
||||||
|
private double freight;
|
||||||
|
@ApiModelProperty("重量")
|
||||||
|
private double weight;
|
||||||
|
@ApiModelProperty("估重")
|
||||||
|
private double weightEstimation;
|
||||||
|
@ApiModelProperty("商品数量")
|
||||||
|
private double quantity;
|
||||||
|
@ApiModelProperty("下单时间")
|
||||||
|
private Date orderTime;
|
||||||
|
@ApiModelProperty("订单号")
|
||||||
|
private String orderNumber;
|
||||||
|
@ApiModelProperty("外部订单号")
|
||||||
|
private String externalOrderNumber;
|
||||||
|
@ApiModelProperty("线上订单号")
|
||||||
|
private String onlineOrderNumber;
|
||||||
|
@ApiModelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
@ApiModelProperty("付款时间")
|
||||||
|
private Date paymentTime;
|
||||||
|
@ApiModelProperty("接单时间")
|
||||||
|
private Date orderAcceptanceTime;
|
||||||
|
@ApiModelProperty("拣选区域")
|
||||||
|
private String pickingArea;
|
||||||
|
@ApiModelProperty("出库类型")
|
||||||
|
private String outboundType;
|
||||||
|
@ApiModelProperty("品牌")
|
||||||
|
private String brand;
|
||||||
|
@ApiModelProperty("波次")
|
||||||
|
private String waveTimes;
|
||||||
|
@ApiModelProperty("超时时间")
|
||||||
|
private Date timeoutPeriod;
|
||||||
|
@ApiModelProperty("到货时间")
|
||||||
|
private Date deliveryTime;
|
||||||
|
@ApiModelProperty("体积")
|
||||||
|
private double volume;
|
||||||
|
@ApiModelProperty("标记")
|
||||||
|
private String sign;
|
||||||
|
@ApiModelProperty("最晚发货时间")
|
||||||
|
private Date latestDeliveryTime;
|
||||||
|
@ApiModelProperty("创建组织sid")
|
||||||
|
private String createOrgSid;
|
||||||
|
@ApiModelProperty("使用组织sid")
|
||||||
|
private String useOrgSid;
|
||||||
@ApiModelProperty("备注")
|
@ApiModelProperty("备注")
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,24 +17,98 @@ import java.util.List;
|
|||||||
public class WarehouseOutBillDto {
|
public class WarehouseOutBillDto {
|
||||||
|
|
||||||
private String sid;
|
private String sid;
|
||||||
@ApiModelProperty("创建人sid")
|
@ApiModelProperty("0 待分配 1零拣打单 2待出库 3已出库")
|
||||||
private String createBySid;
|
|
||||||
@ApiModelProperty("制单人")
|
|
||||||
private String createByName;
|
|
||||||
@ApiModelProperty("单据日期")
|
|
||||||
private String createTime;
|
|
||||||
@ApiModelProperty("外部单号")
|
|
||||||
private String sourceBillNo;
|
|
||||||
|
|
||||||
@ApiModelProperty("业务类型key")
|
|
||||||
private String busTypeKey;
|
|
||||||
@ApiModelProperty("业务类型value((销售出库、采购退货出库等))")
|
|
||||||
private String busTypeValue;
|
|
||||||
|
|
||||||
@ApiModelProperty("单据状态")
|
|
||||||
private String billState;
|
private String billState;
|
||||||
@ApiModelProperty("备注")
|
@ApiModelProperty("单据编号")
|
||||||
|
private String billNo;
|
||||||
|
@ApiModelProperty("来源单号")
|
||||||
|
private String sourceBillNo;
|
||||||
|
@ApiModelProperty("外部状态")
|
||||||
|
private String externalState;
|
||||||
|
@ApiModelProperty("买家留言")
|
||||||
|
private String buyerMessage;
|
||||||
|
@ApiModelProperty("库存状态")
|
||||||
|
private String inventoryStatus;
|
||||||
|
@ApiModelProperty("货主")
|
||||||
|
private String shipper;
|
||||||
|
@ApiModelProperty("承运商")
|
||||||
|
private String carrierKey;
|
||||||
|
private String carrierValue;
|
||||||
|
@ApiModelProperty("运单号")
|
||||||
|
private String waybillNumber;
|
||||||
|
@ApiModelProperty("配送方式")
|
||||||
|
private String deliveryMethod;
|
||||||
|
@ApiModelProperty("买家")
|
||||||
|
private String buyer;
|
||||||
|
@ApiModelProperty("收货人")
|
||||||
|
private String consignee;
|
||||||
|
@ApiModelProperty("固话")
|
||||||
|
private String fixedLine;
|
||||||
|
@ApiModelProperty("邮编")
|
||||||
|
private String postalCode;
|
||||||
|
@ApiModelProperty("省")
|
||||||
|
private String province;
|
||||||
|
@ApiModelProperty("市")
|
||||||
|
private String city;
|
||||||
|
@ApiModelProperty("区")
|
||||||
|
private String county;
|
||||||
|
@ApiModelProperty("街道")
|
||||||
|
private String street;
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
@ApiModelProperty("手机")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("实付")
|
||||||
|
private double actualPayment;
|
||||||
|
@ApiModelProperty("优惠")
|
||||||
|
private double discount;
|
||||||
|
@ApiModelProperty("运费")
|
||||||
|
private double freight;
|
||||||
|
@ApiModelProperty("重量")
|
||||||
|
private double weight;
|
||||||
|
@ApiModelProperty("估重")
|
||||||
|
private double weightEstimation;
|
||||||
|
@ApiModelProperty("商品数量")
|
||||||
|
private double quantity;
|
||||||
|
@ApiModelProperty("下单时间")
|
||||||
|
private Date orderTime;
|
||||||
|
@ApiModelProperty("订单号")
|
||||||
|
private String orderNumber;
|
||||||
|
@ApiModelProperty("外部订单号")
|
||||||
|
private String externalOrderNumber;
|
||||||
|
@ApiModelProperty("线上订单号")
|
||||||
|
private String onlineOrderNumber;
|
||||||
|
@ApiModelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
@ApiModelProperty("付款时间")
|
||||||
|
private Date paymentTime;
|
||||||
|
@ApiModelProperty("接单时间")
|
||||||
|
private Date orderAcceptanceTime;
|
||||||
|
@ApiModelProperty("拣选区域")
|
||||||
|
private String pickingArea;
|
||||||
|
@ApiModelProperty("出库类型")
|
||||||
|
private String outboundType;
|
||||||
|
@ApiModelProperty("品牌")
|
||||||
|
private String brand;
|
||||||
|
@ApiModelProperty("波次")
|
||||||
|
private String waveTimes;
|
||||||
|
@ApiModelProperty("超时时间")
|
||||||
|
private Date timeoutPeriod;
|
||||||
|
@ApiModelProperty("到货时间")
|
||||||
|
private Date deliveryTime;
|
||||||
|
@ApiModelProperty("体积")
|
||||||
|
private double volume;
|
||||||
|
@ApiModelProperty("标记")
|
||||||
|
private String sign;
|
||||||
|
@ApiModelProperty("最晚发货时间")
|
||||||
|
private Date latestDeliveryTime;
|
||||||
|
@ApiModelProperty("创建组织sid")
|
||||||
|
private String createOrgSid;
|
||||||
|
@ApiModelProperty("使用组织sid")
|
||||||
|
private String useOrgSid;
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
private String userSid;
|
||||||
|
private String userName;
|
||||||
|
|
||||||
private List<WarehouseOutBillDetailDto> detailsList = new ArrayList<>();
|
private List<WarehouseOutBillDetailDto> detailsList = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseoutbill;
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.Query;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/26
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseOutBillGoodsQuery implements Query {
|
||||||
|
private String sourceBillSid;
|
||||||
|
//商品编码
|
||||||
|
private String goodsSkuCode;
|
||||||
|
//商品名称
|
||||||
|
private String goodsSpuName;
|
||||||
|
//规格
|
||||||
|
private String goodsSkuOwnSpec;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package com.yxt.warehouse.biz.warehouseoutbill;
|
|
||||||
|
|
||||||
import com.yxt.common.core.query.Query;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description:
|
|
||||||
* @author: dimengzhe
|
|
||||||
* @date: 2024/4/26
|
|
||||||
**/
|
|
||||||
@Data
|
|
||||||
public class WarehouseOutBillInventoryQuery implements Query {
|
|
||||||
|
|
||||||
//商品名称
|
|
||||||
@ApiModelProperty("商品名称")
|
|
||||||
private String goodsSpuName;
|
|
||||||
|
|
||||||
//商品编码
|
|
||||||
private String goodsSkuCode;
|
|
||||||
|
|
||||||
//仓库
|
|
||||||
private String warehouseName;
|
|
||||||
|
|
||||||
//库位
|
|
||||||
private String warehouseRackCode;
|
|
||||||
|
|
||||||
//供应商
|
|
||||||
private String supplierName;
|
|
||||||
|
|
||||||
private String orgPath;
|
|
||||||
|
|
||||||
private String busrepairBillsid;//维修工单sid
|
|
||||||
private String name;
|
|
||||||
}
|
|
||||||
@@ -3,6 +3,8 @@ package com.yxt.warehouse.biz.warehouseoutbill;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description:
|
* @description:
|
||||||
* @author: dimengzhe
|
* @author: dimengzhe
|
||||||
@@ -11,41 +13,95 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class WarehouseOutBillInventoryVo {
|
public class WarehouseOutBillInventoryVo {
|
||||||
private String sid;
|
private String sid;
|
||||||
private String inventorySid;
|
@ApiModelProperty("0 待分配 1零拣打单 2待出库 3已出库")
|
||||||
@ApiModelProperty("商品ID")
|
private String billState;
|
||||||
private String goodsID;
|
@ApiModelProperty("单据编号")
|
||||||
@ApiModelProperty("商品基础信息Sid")
|
private String billNo;
|
||||||
private String goodSpuSid;
|
@ApiModelProperty("来源单号")
|
||||||
@ApiModelProperty("商品名称")
|
private String sourceBillNo;
|
||||||
private String goodsSpuName;
|
@ApiModelProperty("外部状态")
|
||||||
@ApiModelProperty("图号")
|
private String externalState;
|
||||||
private String goodsSkuCode;
|
@ApiModelProperty("买家留言")
|
||||||
@ApiModelProperty("商品Skusid")
|
private String buyerMessage;
|
||||||
private String goodsSkuSid;
|
@ApiModelProperty("库存状态")
|
||||||
@ApiModelProperty("商品Sku名称")
|
private String inventoryStatus;
|
||||||
private String goodsSkuTitle;
|
@ApiModelProperty("货主")
|
||||||
@ApiModelProperty("规格型号")
|
private String shipper;
|
||||||
private String goodsSkuOwnSpec;
|
@ApiModelProperty("承运商")
|
||||||
@ApiModelProperty("计量单位")
|
private String carrier;
|
||||||
private String unit;
|
@ApiModelProperty("运单号")
|
||||||
@ApiModelProperty("仓库sid")
|
private String waybillNumber;
|
||||||
private String warehouseSid;
|
@ApiModelProperty("配送方式")
|
||||||
@ApiModelProperty("仓库名称")
|
private String deliveryMethod;
|
||||||
private String warehouseName;
|
@ApiModelProperty("买家")
|
||||||
@ApiModelProperty("库位sid")
|
private String buyer;
|
||||||
private String warehouseRackSid;
|
@ApiModelProperty("收货人")
|
||||||
@ApiModelProperty("库位编码")
|
private String consignee;
|
||||||
private String warehouseRackCode;
|
@ApiModelProperty("固话")
|
||||||
|
private String fixedLine;
|
||||||
private String price;//销售单价
|
@ApiModelProperty("邮编")
|
||||||
private String outboundCount;// 已出库数量
|
private String postalCode;
|
||||||
//入库单价
|
@ApiModelProperty("省")
|
||||||
private String money;
|
private String province;
|
||||||
//库存数量
|
@ApiModelProperty("市")
|
||||||
private String count;
|
private String city;
|
||||||
//供应商
|
@ApiModelProperty("区")
|
||||||
private String supplierSid;
|
private String county;
|
||||||
private String supplierName;
|
@ApiModelProperty("街道")
|
||||||
|
private String street;
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
@ApiModelProperty("手机")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("实付")
|
||||||
|
private double actualPayment;
|
||||||
|
@ApiModelProperty("优惠")
|
||||||
|
private double discount;
|
||||||
|
@ApiModelProperty("运费")
|
||||||
|
private double freight;
|
||||||
|
@ApiModelProperty("重量")
|
||||||
|
private double weight;
|
||||||
|
@ApiModelProperty("估重")
|
||||||
|
private double weightEstimation;
|
||||||
|
@ApiModelProperty("商品数量")
|
||||||
|
private double quantity;
|
||||||
|
@ApiModelProperty("下单时间")
|
||||||
|
private Date orderTime;
|
||||||
|
@ApiModelProperty("订单号")
|
||||||
|
private String orderNumber;
|
||||||
|
@ApiModelProperty("外部订单号")
|
||||||
|
private String externalOrderNumber;
|
||||||
|
@ApiModelProperty("线上订单号")
|
||||||
|
private String onlineOrderNumber;
|
||||||
|
@ApiModelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
@ApiModelProperty("付款时间")
|
||||||
|
private Date paymentTime;
|
||||||
|
@ApiModelProperty("接单时间")
|
||||||
|
private Date orderAcceptanceTime;
|
||||||
|
@ApiModelProperty("拣选区域")
|
||||||
|
private String pickingArea;
|
||||||
|
@ApiModelProperty("出库类型")
|
||||||
|
private String outboundType;
|
||||||
|
@ApiModelProperty("品牌")
|
||||||
|
private String brand;
|
||||||
|
@ApiModelProperty("波次")
|
||||||
|
private String waveTimes;
|
||||||
|
@ApiModelProperty("超时时间")
|
||||||
|
private Date timeoutPeriod;
|
||||||
|
@ApiModelProperty("到货时间")
|
||||||
|
private Date deliveryTime;
|
||||||
|
@ApiModelProperty("体积")
|
||||||
|
private double volume;
|
||||||
|
@ApiModelProperty("标记")
|
||||||
|
private String sign;
|
||||||
|
@ApiModelProperty("最晚发货时间")
|
||||||
|
private Date latestDeliveryTime;
|
||||||
|
@ApiModelProperty("创建组织sid")
|
||||||
|
private String createOrgSid;
|
||||||
|
@ApiModelProperty("使用组织sid")
|
||||||
|
private String useOrgSid;
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -16,8 +17,10 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
public interface WarehouseOutBillMapper extends BaseMapper<WarehouseOutBill> {
|
public interface WarehouseOutBillMapper extends BaseMapper<WarehouseOutBill> {
|
||||||
IPage<WarehouseOutBillVo> listPage(IPage<WarehouseOutBill> page, @Param(Constants.WRAPPER) QueryWrapper<WarehouseOutBill> qw);
|
IPage<WarehouseOutBillVo> listPage(IPage<WarehouseOutBill> page, @Param(Constants.WRAPPER) QueryWrapper<WarehouseOutBill> qw);
|
||||||
|
|
||||||
WarehouseOutBillDetailsVo details(String sid);
|
WarehouseOutBillDetailsVo details(@Param("sid") String sid);
|
||||||
|
|
||||||
IPage<WarehouseOutBillInventoryVo> getInventoryList(IPage<WarehouseOutBill> page, @Param(Constants.WRAPPER) QueryWrapper<WarehouseOutBill> qw);
|
IPage<WarehouseOutBillDetailVo> getInventoryList(IPage<WarehouseOutBill> page, @Param(Constants.WRAPPER) QueryWrapper<WarehouseOutBill> qw);
|
||||||
|
|
||||||
|
String selectNum(String billNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,35 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.yxt.warehouse.biz.warehouseoutbill.WarehouseOutBillMapper">
|
<mapper namespace="com.yxt.warehouse.biz.warehouseoutbill.WarehouseOutBillMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listPage" resultType="com.yxt.warehouse.biz.warehouseoutbill.WarehouseOutBillVo">
|
||||||
|
select a.* from warehouse_out_bill a
|
||||||
|
LEFT JOIN ss_user.sys_organization as s ON a.useOrgSid = s.sid
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="details" resultType="com.yxt.warehouse.biz.warehouseoutbill.WarehouseOutBillDetailsVo">
|
||||||
|
select a.* from warehouse_out_bill a
|
||||||
|
LEFT JOIN ss_user.sys_organization as s ON a.useOrgSid = s.sid
|
||||||
|
<where>
|
||||||
|
a.sid=#{sid}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="getInventoryList" resultType="com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailVo">
|
||||||
|
select a.* from warehouse_out_bill_detail a
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectNum" resultType="java.lang.String">
|
||||||
|
select RIGHT (billNo, 4)
|
||||||
|
from warehouse_out_bill
|
||||||
|
where billNo LIKE concat(#{billNo}, '%')
|
||||||
|
order by billNo desc
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -14,18 +14,36 @@ public class WarehouseOutBillQuery implements Query {
|
|||||||
|
|
||||||
@ApiModelProperty("单据编号")
|
@ApiModelProperty("单据编号")
|
||||||
private String billNo;
|
private String billNo;
|
||||||
@ApiModelProperty("单据日期开始时间")
|
|
||||||
private String createTimeStart;
|
|
||||||
@ApiModelProperty("单据日期结束时间")
|
|
||||||
private String createTimeEnd;
|
|
||||||
@ApiModelProperty("来源单号")
|
|
||||||
private String sourceBillNo;
|
|
||||||
@ApiModelProperty("业务类型value((销售出库、采购退货出库等))")
|
|
||||||
private String busTypeValue;
|
|
||||||
@ApiModelProperty("单据状态")
|
|
||||||
private String billState;
|
private String billState;
|
||||||
@ApiModelProperty("组织sid全路径")
|
@ApiModelProperty("外部单号")
|
||||||
|
private String externalOrderNumber;
|
||||||
|
@ApiModelProperty("线上单号")
|
||||||
|
private String onlineOrderNumber;
|
||||||
|
@ApiModelProperty("买家")
|
||||||
|
private String buyer;
|
||||||
|
@ApiModelProperty("运单号")
|
||||||
|
private String waybillNumber;
|
||||||
|
@ApiModelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
@ApiModelProperty("承运商")
|
||||||
|
private String carrier;
|
||||||
|
@ApiModelProperty("手机")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("出库类型")
|
||||||
|
private String outboundType;
|
||||||
|
@ApiModelProperty("地址")
|
||||||
|
private String address;
|
||||||
|
@ApiModelProperty("下单日期开始时间")
|
||||||
|
private String orderTimeStart;
|
||||||
|
@ApiModelProperty("下单日期结束时间")
|
||||||
|
private String orderTimeEnd;
|
||||||
|
|
||||||
|
private String orgLevelKey;//权限等级
|
||||||
|
@ApiModelProperty("菜单路由")
|
||||||
|
private String menuUrl;
|
||||||
|
@ApiModelProperty("组织全路径sid")
|
||||||
private String orgPath;
|
private String orgPath;
|
||||||
@ApiModelProperty("用户sid")
|
@ApiModelProperty("用户sid")
|
||||||
private String createBySid;
|
private String userSid;
|
||||||
|
private int index;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.yxt.warehouse.biz.warehouseoutbill;
|
package com.yxt.warehouse.biz.warehouseoutbill;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.yxt.common.base.service.MybatisBaseService;
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
@@ -9,17 +10,24 @@ import com.yxt.common.base.utils.StringUtils;
|
|||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.warehouse.biz.operationrecord.OperationRecordDto;
|
||||||
|
import com.yxt.warehouse.biz.operationrecord.OperationRecordService;
|
||||||
import com.yxt.warehouse.biz.warehouseinventory.WarehouseInventory;
|
import com.yxt.warehouse.biz.warehouseinventory.WarehouseInventory;
|
||||||
import com.yxt.warehouse.biz.warehouseinventory.WarehouseInventoryService;
|
import com.yxt.warehouse.biz.warehouseinventory.WarehouseInventoryService;
|
||||||
import com.yxt.warehouse.biz.warehouseinventoryrecord.WarehouseInventoryRecordDto;
|
import com.yxt.warehouse.biz.warehouseinventoryrecord.WarehouseInventoryRecordDto;
|
||||||
import com.yxt.warehouse.biz.warehouseinventoryrecord.WarehouseInventoryRecordService;
|
import com.yxt.warehouse.biz.warehouseinventoryrecord.WarehouseInventoryRecordService;
|
||||||
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailDto;
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailDto;
|
||||||
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailService;
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocation;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationService;
|
||||||
|
import com.yxt.warehouse.utils.Rule;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,36 +43,77 @@ public class WarehouseOutBillService extends MybatisBaseService<WarehouseOutBill
|
|||||||
private WarehouseInventoryService warehouseInventoryService;
|
private WarehouseInventoryService warehouseInventoryService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WarehouseInventoryRecordService warehouseInventoryRecordService;
|
private WarehouseInventoryRecordService warehouseInventoryRecordService;
|
||||||
|
@Autowired
|
||||||
|
private WarehouseOutLocationService warehouseOutLocationService;
|
||||||
|
@Autowired
|
||||||
|
OperationRecordService operationRecordService;
|
||||||
|
|
||||||
|
|
||||||
|
public ResultBean<PagerVo<WarehouseOutBillVo>> listPage(PagerQuery<WarehouseOutBillQuery> pagerQuery) {
|
||||||
public PagerVo<WarehouseOutBillVo> listPage(PagerQuery<WarehouseOutBillQuery> pagerQuery) {
|
ResultBean<PagerVo<WarehouseOutBillVo>> rb =new ResultBean().fail();
|
||||||
WarehouseOutBillQuery query = pagerQuery.getParams();
|
WarehouseOutBillQuery query = pagerQuery.getParams();
|
||||||
QueryWrapper<WarehouseOutBill> qw = new QueryWrapper<>();
|
QueryWrapper<WarehouseOutBill> qw = new QueryWrapper<>();
|
||||||
//ToDo:添加查询条件
|
//ToDo:添加查询条件
|
||||||
if (StringUtils.isNotBlank(query.getBillNo())) {
|
if (StringUtils.isNotBlank(query.getOrgLevelKey())) {
|
||||||
qw.like("wob.billNo", query.getBillNo());
|
//数据权限ID(1全部、2本部门及子部门、3本部门、4个人)
|
||||||
|
String orgLevelKey=query.getOrgLevelKey();
|
||||||
|
String orgSidPath=query.getOrgPath();
|
||||||
|
int index=query.getIndex();
|
||||||
|
if ("1".equals(orgLevelKey)) {
|
||||||
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
|
qw.like("s.orgSidPath", orgSidPath);
|
||||||
|
} else if ("2".equals(orgLevelKey)) {
|
||||||
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
|
qw.like("s.orgSidPath", orgSidPath);
|
||||||
|
} else if ("3".equals(orgLevelKey)) {
|
||||||
|
orgSidPath = orgSidPath.substring(0, index);
|
||||||
|
qw.apply("s.orgSidPath like('"+orgSidPath+"')");
|
||||||
|
} else if ("4".equals(orgLevelKey)) {
|
||||||
|
qw.eq("wab.createBySid", query.getUserSid());
|
||||||
|
} else {
|
||||||
|
PagerVo<WarehouseOutBillVo> p = new PagerVo<>();
|
||||||
|
return rb.success().setData(p);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
PagerVo<WarehouseOutBillVo> p = new PagerVo<>();
|
||||||
|
return rb.success().setData(p);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getBillState())) {
|
||||||
|
qw.eq("a.billState",query.getBillState());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getBillNo())) {
|
||||||
|
qw.like("a.billNo",query.getBillNo());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getBillNo())) {
|
||||||
|
qw.like("a.externalOrderNumber",query.getExternalOrderNumber());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getBillNo())) {
|
||||||
|
qw.like("a.onlineOrderNumber",query.getOnlineOrderNumber());
|
||||||
}
|
}
|
||||||
//单据日期开始时间-单据日期结束时间
|
|
||||||
qw.apply(StringUtils.isNotBlank(query.getCreateTimeStart()), "date_format (wob.createTime,'%Y-%m-%d') >= date_format('" + query.getCreateTimeStart() + "','%Y-%m-%d')").
|
|
||||||
apply(StringUtils.isNotBlank(query.getCreateTimeEnd()), "date_format (wob.createTime,'%Y-%m-%d') <= date_format('" + query.getCreateTimeEnd() + "','%Y-%m-%d')"
|
|
||||||
);
|
|
||||||
//来源单号
|
//来源单号
|
||||||
if (StringUtils.isNotBlank(query.getSourceBillNo())) {
|
if (StringUtils.isNotBlank(query.getBuyer())) {
|
||||||
qw.like("wob.sourceBillNo", query.getSourceBillNo());
|
qw.like("a.buyer", query.getBuyer());
|
||||||
}
|
}
|
||||||
//业务类型
|
//业务类型
|
||||||
if (StringUtils.isNotBlank(query.getBusTypeValue())) {
|
if (StringUtils.isNotBlank(query.getWaybillNumber())) {
|
||||||
qw.like("wob.busTypeValue", query.getBusTypeValue());
|
qw.like("a.busTypeValue", query.getWaybillNumber());
|
||||||
}
|
}
|
||||||
//单据类型
|
//单据类型
|
||||||
if (StringUtils.isNotBlank(query.getBillState())) {
|
if (StringUtils.isNotBlank(query.getPlatform())) {
|
||||||
qw.like("wob.billState", query.getBillState());
|
qw.like("a.billState", query.getPlatform());
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getCarrier())) {
|
||||||
|
qw.like("a.billState", query.getCarrier());
|
||||||
|
}
|
||||||
|
//单据日期开始时间-单据日期结束时间
|
||||||
|
qw.apply(StringUtils.isNotBlank(query.getOrderTimeStart()), "date_format (a.orderTime,'%Y-%m-%d') >= date_format('" + query.getOrderTimeStart() + "','%Y-%m-%d')").
|
||||||
|
apply(StringUtils.isNotBlank(query.getOrderTimeEnd()), "date_format (a.orderTime,'%Y-%m-%d') <= date_format('" + query.getOrderTimeEnd() + "','%Y-%m-%d')"
|
||||||
|
);
|
||||||
|
|
||||||
IPage<WarehouseOutBill> page = PagerUtil.queryToPage(pagerQuery);
|
IPage<WarehouseOutBill> page = PagerUtil.queryToPage(pagerQuery);
|
||||||
IPage<WarehouseOutBillVo> pagging = baseMapper.listPage(page, qw);
|
IPage<WarehouseOutBillVo> pagging = baseMapper.listPage(page, qw);
|
||||||
PagerVo<WarehouseOutBillVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<WarehouseOutBillVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
return p;
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultBean<String> saveOrUpdateOutBill(WarehouseOutBillDto dto) {
|
public ResultBean<String> saveOrUpdateOutBill(WarehouseOutBillDto dto) {
|
||||||
@@ -79,7 +128,26 @@ public class WarehouseOutBillService extends MybatisBaseService<WarehouseOutBill
|
|||||||
if (detailsList.size() > 0) {
|
if (detailsList.size() > 0) {
|
||||||
warehouseOutBillDetailService.saveOrUpdateBillDetails(sid, detailsList);
|
warehouseOutBillDetailService.saveOrUpdateBillDetails(sid, detailsList);
|
||||||
}
|
}
|
||||||
|
//生成单据编号
|
||||||
|
String billNo = "";
|
||||||
|
String date = DateUtil.format(DateUtil.date(), "yyyyMMdd");
|
||||||
|
billNo = "CK" + date;
|
||||||
|
String i = baseMapper.selectNum(billNo);
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(i)) {
|
||||||
|
billNo = Rule.getBillNo(billNo, Integer.valueOf(i).intValue());
|
||||||
|
} else {
|
||||||
|
billNo = Rule.getBillNo(billNo, 0);
|
||||||
|
}
|
||||||
|
WarehouseOutBill.setBillNo(billNo);
|
||||||
|
WarehouseOutBill.setBillState("0");
|
||||||
baseMapper.insert(WarehouseOutBill);
|
baseMapper.insert(WarehouseOutBill);
|
||||||
|
OperationRecordDto dto1 = new OperationRecordDto();
|
||||||
|
dto1.setBillSid(dto.getSid());
|
||||||
|
dto1.setUserSid(dto.getUserSid());
|
||||||
|
dto1.setUserName(dto.getUserName());
|
||||||
|
dto1.setCreateTime(new Date());
|
||||||
|
dto1.setContent("oms推送销售出库单");
|
||||||
|
operationRecordService.save(dto1);
|
||||||
} else {
|
} else {
|
||||||
WarehouseOutBill WarehouseOutBill = fetchBySid(sid);
|
WarehouseOutBill WarehouseOutBill = fetchBySid(sid);
|
||||||
if (WarehouseOutBill == null) {
|
if (WarehouseOutBill == null) {
|
||||||
@@ -110,66 +178,155 @@ public class WarehouseOutBillService extends MybatisBaseService<WarehouseOutBill
|
|||||||
}
|
}
|
||||||
return rb.success().setData(WarehouseOutBillDetailsVo);
|
return rb.success().setData(WarehouseOutBillDetailsVo);
|
||||||
}
|
}
|
||||||
|
// public ResultBean<WarehouseOutBillDetailsVo> selectGoodsByBillSid(PagerQuery<WarehouseOutBillGoodsQuery> pagerQuery) {
|
||||||
|
// ResultBean<WarehouseOutBillDetailsVo> rb = ResultBean.fireFail();
|
||||||
|
// WarehouseOutBillDetailsVo WarehouseOutBillDetailsVo = baseMapper.details(sid);
|
||||||
|
// if (WarehouseOutBillDetailsVo == null) {
|
||||||
|
// return rb.setMsg("该单据不存在");
|
||||||
|
// }
|
||||||
|
// return rb.success().setData(WarehouseOutBillDetailsVo);
|
||||||
|
// }
|
||||||
|
|
||||||
public PagerVo<WarehouseOutBillInventoryVo> getInventoryList(PagerQuery<WarehouseOutBillInventoryQuery> pagerQuery) {
|
public ResultBean<WarehouseOutBillDetailsVo> getAddresseeBySid(String sid) {
|
||||||
WarehouseOutBillInventoryQuery query = pagerQuery.getParams();
|
ResultBean<WarehouseOutBillDetailsVo> rb = ResultBean.fireFail();
|
||||||
QueryWrapper<WarehouseOutBill> qw = new QueryWrapper<>();
|
WarehouseOutBillDetailsVo WarehouseOutBillDetailsVo = baseMapper.details(sid);
|
||||||
//ToDo:添加查询条件
|
if (WarehouseOutBillDetailsVo == null) {
|
||||||
if (StringUtils.isNotBlank(query.getGoodsSpuName())) {
|
return rb.setMsg("该单据不存在");
|
||||||
qw.like("wi.goodsSpuName", query.getGoodsSpuName());
|
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(query.getName())) {
|
return rb.success().setData(WarehouseOutBillDetailsVo);
|
||||||
qw.like("wi.goodsSpuName", query.getName());
|
}
|
||||||
|
|
||||||
|
public PagerVo<WarehouseOutBillDetailVo> getInventoryList(PagerQuery<WarehouseOutBillGoodsQuery> pagerQuery) {
|
||||||
|
WarehouseOutBillGoodsQuery query = pagerQuery.getParams();
|
||||||
|
QueryWrapper<WarehouseOutBill> qw = new QueryWrapper<>();
|
||||||
|
// //ToDo:添加查询条件
|
||||||
|
if (StringUtils.isNotBlank(query.getGoodsSpuName())) {
|
||||||
|
qw.like("a.goodsSpuName", query.getGoodsSpuName());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getGoodsSkuCode())) {
|
||||||
|
qw.like("a.goodsSkuCode", query.getGoodsSkuCode());
|
||||||
}
|
}
|
||||||
//商品编码
|
//商品编码
|
||||||
if (StringUtils.isNotBlank(query.getGoodsSkuCode())) {
|
if (StringUtils.isNotBlank(query.getGoodsSkuOwnSpec())) {
|
||||||
qw.like("wi.goodsSkuCode", query.getGoodsSkuCode());
|
qw.like("a.goodsSkuOwnSpec", query.getGoodsSkuOwnSpec());
|
||||||
}
|
}
|
||||||
//仓库
|
qw.eq("sourceBillSid",query.getSourceBillSid());
|
||||||
if (StringUtils.isNotBlank(query.getWarehouseName())) {
|
|
||||||
qw.like("wi.warehouseName", query.getWarehouseName());
|
|
||||||
}
|
|
||||||
//库位
|
|
||||||
if (StringUtils.isNotBlank(query.getWarehouseRackCode())) {
|
|
||||||
qw.like("wi.warehouseRackCode", query.getWarehouseRackCode());
|
|
||||||
}
|
|
||||||
//ToDo:供应商
|
|
||||||
/* if (StringUtils.isNotBlank(query.getSupplierName())) {
|
|
||||||
qw.like("supplierName", query.getSupplierName());
|
|
||||||
}*/
|
|
||||||
IPage<WarehouseOutBill> page = PagerUtil.queryToPage(pagerQuery);
|
IPage<WarehouseOutBill> page = PagerUtil.queryToPage(pagerQuery);
|
||||||
IPage<WarehouseOutBillInventoryVo> pagging = baseMapper.getInventoryList(page, qw);
|
IPage<WarehouseOutBillDetailVo> pagging = baseMapper.getInventoryList(page, qw);
|
||||||
PagerVo<WarehouseOutBillInventoryVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<WarehouseOutBillDetailVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
public ResultBean updateCarrier(WarehouseOutBillDto dto) {
|
||||||
|
ResultBean rb=new ResultBean().fail();
|
||||||
|
WarehouseOutBill warehouseOutBill=baseMapper.selectOne(new QueryWrapper<WarehouseOutBill>().eq("sid",dto.getSid()));
|
||||||
|
warehouseOutBill.setCarrierKey(dto.getCarrierKey());
|
||||||
|
warehouseOutBill.setCarrierValue(dto.getCarrierValue());
|
||||||
|
// warehouseOutBill.setCarrier();
|
||||||
|
baseMapper.updateById(warehouseOutBill);
|
||||||
|
OperationRecordDto dto1 = new OperationRecordDto();
|
||||||
|
dto1.setBillSid(dto.getSid());
|
||||||
|
dto1.setUserSid(dto.getUserSid());
|
||||||
|
dto1.setUserName(dto.getUserName());
|
||||||
|
dto1.setCreateTime(new Date());
|
||||||
|
dto1.setContent("修改订单承运商");
|
||||||
|
operationRecordService.save(dto1);
|
||||||
|
return rb.success().setMsg("成功");
|
||||||
|
}
|
||||||
|
public ResultBean updateWaybillNumber(WarehouseOutBillDto dto) {
|
||||||
|
ResultBean rb=new ResultBean().fail();
|
||||||
|
WarehouseOutBill warehouseOutBill=baseMapper.selectOne(new QueryWrapper<WarehouseOutBill>().eq("sid",dto.getSid()));
|
||||||
|
warehouseOutBill.setWaybillNumber(dto.getWaybillNumber());
|
||||||
|
|
||||||
|
baseMapper.updateById(warehouseOutBill);
|
||||||
|
OperationRecordDto dto1 = new OperationRecordDto();
|
||||||
|
dto1.setBillSid(dto.getSid());
|
||||||
|
dto1.setUserSid(dto.getUserSid());
|
||||||
|
dto1.setUserName(dto.getUserName());
|
||||||
|
dto1.setCreateTime(new Date());
|
||||||
|
dto1.setContent("修改订单运单号");
|
||||||
|
operationRecordService.save(dto1);
|
||||||
|
return rb.success().setMsg("成功");
|
||||||
|
}
|
||||||
|
public ResultBean toBePickOut(WarehouseOutStateQuery query) {
|
||||||
|
ResultBean rb=new ResultBean().fail();
|
||||||
|
for (String s : query.getSid().split(",")) {
|
||||||
|
WarehouseOutBill warehouseOutBill=baseMapper.selectOne(new QueryWrapper<WarehouseOutBill>().eq("sid",s));
|
||||||
|
warehouseOutBill.setBillState(query.getBillState());
|
||||||
|
baseMapper.updateById(warehouseOutBill);
|
||||||
|
OperationRecordDto dto1 = new OperationRecordDto();
|
||||||
|
dto1.setBillSid(s);
|
||||||
|
dto1.setUserSid(query.getUserSid());
|
||||||
|
dto1.setUserName(query.getUserName());
|
||||||
|
dto1.setCreateTime(new Date());
|
||||||
|
dto1.setContent("待分配-->打到零拣");
|
||||||
|
operationRecordService.save(dto1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rb.success().setMsg("成功");
|
||||||
|
}
|
||||||
|
public ResultBean toBeOutbound(WarehouseOutStateQuery query) {
|
||||||
|
ResultBean rb=new ResultBean().fail();
|
||||||
|
for (String s : query.getSid().split(",")) {
|
||||||
|
WarehouseOutBill warehouseOutBill=baseMapper.selectOne(new QueryWrapper<WarehouseOutBill>().eq("sid",s));
|
||||||
|
warehouseOutBill.setBillState(query.getBillState());
|
||||||
|
OperationRecordDto dto1 = new OperationRecordDto();
|
||||||
|
dto1.setBillSid(s);
|
||||||
|
dto1.setUserSid(query.getUserSid());
|
||||||
|
dto1.setUserName(query.getUserName());
|
||||||
|
dto1.setCreateTime(new Date());
|
||||||
|
dto1.setContent("零拣打单 --> 待出库");
|
||||||
|
operationRecordService.save(dto1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rb.success().setMsg("成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean toBeAllocated(WarehouseOutStateQuery query) {
|
||||||
|
ResultBean rb=new ResultBean().fail();
|
||||||
|
for (String s : query.getSid().split(",")) {
|
||||||
|
WarehouseOutBill warehouseOutBill=baseMapper.selectOne(new QueryWrapper<WarehouseOutBill>().eq("sid",s));
|
||||||
|
warehouseOutBill.setBillState(query.getBillState());
|
||||||
|
OperationRecordDto dto1 = new OperationRecordDto();
|
||||||
|
dto1.setBillSid(s);
|
||||||
|
dto1.setUserSid(query.getUserSid());
|
||||||
|
dto1.setUserName(query.getUserName());
|
||||||
|
dto1.setCreateTime(new Date());
|
||||||
|
dto1.setContent("零拣打单--->待分配");
|
||||||
|
operationRecordService.save(dto1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rb.success().setMsg("成功");
|
||||||
|
}
|
||||||
public ResultBean confirm(WarehouseOutBillDto dto) {
|
public ResultBean confirm(WarehouseOutBillDto dto) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
String sid = saveOrUpdateOutBill(dto).getData();
|
for (String s : dto.getSid().split(",")) {
|
||||||
List<WarehouseOutBillDetailDto> detailsList = dto.getDetailsList();
|
List<WarehouseOutLocation> warehouseOutLocations=warehouseOutLocationService.list(new QueryWrapper<WarehouseOutLocation>().eq("sourceBillSid",dto.getSid()));
|
||||||
detailsList.removeAll(Collections.singleton(null));
|
for (WarehouseOutLocation warehouseOutLocation : warehouseOutLocations) {
|
||||||
if (!detailsList.isEmpty()) {
|
WarehouseInventory WarehouseInventory = warehouseInventoryService.fetchBySid(warehouseOutLocation.getInventorySid());
|
||||||
for (int i = 0; i < detailsList.size(); i++) {
|
|
||||||
WarehouseOutBillDetailDto WarehouseOutBillDetailDto = detailsList.get(i);
|
|
||||||
WarehouseInventory WarehouseInventory = warehouseInventoryService.fetchBySid(WarehouseOutBillDetailDto.getInventorySid());
|
|
||||||
//减去出库的数量
|
//减去出库的数量
|
||||||
WarehouseInventory.setCount(WarehouseInventory.getCount().subtract(new BigDecimal(WarehouseOutBillDetailDto.getOutCount())));
|
WarehouseInventory.setCount(WarehouseInventory.getCount().subtract(warehouseOutLocation.getCount()));
|
||||||
warehouseInventoryService.updateById(WarehouseInventory);
|
warehouseInventoryService.updateById(WarehouseInventory);
|
||||||
}
|
|
||||||
saveWarehouseInventory(dto.getSid());
|
saveWarehouseInventory(dto.getSid());
|
||||||
}
|
}
|
||||||
|
OperationRecordDto dto1 = new OperationRecordDto();
|
||||||
|
dto1.setBillSid(dto.getSid());
|
||||||
|
dto1.setUserSid(dto.getUserSid());
|
||||||
|
dto1.setUserName(dto.getUserName());
|
||||||
|
dto1.setCreateTime(new Date());
|
||||||
|
dto1.setContent("出库");
|
||||||
|
operationRecordService.save(dto1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return rb.success();
|
return rb.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveWarehouseInventory(String sid) {
|
public void saveWarehouseInventory(String sid) {
|
||||||
WarehouseOutBill WarehouseOutBill = fetchBySid(sid);
|
WarehouseOutBill WarehouseOutBill = fetchBySid(sid);
|
||||||
List<WarehouseOutBillDetailDto> detailList = warehouseOutBillDetailService.selectDetailsList(sid);
|
List<WarehouseOutLocation> warehouseOutLocations=warehouseOutLocationService.list(new QueryWrapper<WarehouseOutLocation>().eq("sourceBillSid",sid));
|
||||||
detailList.removeAll(Collections.singleton(null));
|
for (WarehouseOutLocation warehouseOutLocation : warehouseOutLocations) {
|
||||||
if (!detailList.isEmpty()) {
|
|
||||||
for (int i = 0; i < detailList.size(); i++) {
|
|
||||||
WarehouseOutBillDetailDto WarehouseOutBillDetailDto = detailList.get(i);
|
|
||||||
WarehouseInventoryRecordDto WarehouseInventoryRecordDto = new WarehouseInventoryRecordDto();
|
WarehouseInventoryRecordDto WarehouseInventoryRecordDto = new WarehouseInventoryRecordDto();
|
||||||
WarehouseInventoryRecordDto.setInventorySid(WarehouseOutBillDetailDto.getInventorySid());
|
WarehouseInventoryRecordDto.setInventorySid(warehouseOutLocation.getInventorySid());
|
||||||
WarehouseInventoryRecordDto.setGoodsID(WarehouseInventoryRecordDto.getGoodsID());
|
WarehouseInventoryRecordDto.setGoodsID(WarehouseInventoryRecordDto.getGoodsID());
|
||||||
WarehouseInventoryRecordDto.setSourceBillSid(WarehouseOutBill.getSid());
|
WarehouseInventoryRecordDto.setSourceBillSid(WarehouseOutBill.getSid());
|
||||||
WarehouseInventoryRecordDto.setBillNo(WarehouseOutBill.getBillNo());
|
WarehouseInventoryRecordDto.setBillNo(WarehouseOutBill.getBillNo());
|
||||||
@@ -180,7 +337,7 @@ public class WarehouseOutBillService extends MybatisBaseService<WarehouseOutBill
|
|||||||
WarehouseInventoryRecordDto.setGoodsSkuSid(WarehouseInventoryRecordDto.getGoodsSkuSid());
|
WarehouseInventoryRecordDto.setGoodsSkuSid(WarehouseInventoryRecordDto.getGoodsSkuSid());
|
||||||
WarehouseInventoryRecordDto.setGoodsSkuCode(WarehouseInventoryRecordDto.getGoodsSkuCode());
|
WarehouseInventoryRecordDto.setGoodsSkuCode(WarehouseInventoryRecordDto.getGoodsSkuCode());
|
||||||
WarehouseInventoryRecordDto.setUnit(WarehouseInventoryRecordDto.getUnit());
|
WarehouseInventoryRecordDto.setUnit(WarehouseInventoryRecordDto.getUnit());
|
||||||
// WarehouseInventoryRecordDto.setCurrentCount(StringUtils.isNotBlank(WarehouseInventoryRecordDto.getCount().toString()) ? new BigDecimal(WarehouseInventoryRecordDto.getCount().toString()) : BigDecimal.ZERO);
|
WarehouseInventoryRecordDto.setCurrentCount(StringUtils.isNotBlank(WarehouseInventoryRecordDto.getCount().toString()) ? new BigDecimal(WarehouseInventoryRecordDto.getCount().toString()).toString() : BigDecimal.ZERO.toString());
|
||||||
WarehouseInventoryRecordDto.setWarehouseSid(WarehouseInventoryRecordDto.getWarehouseSid());
|
WarehouseInventoryRecordDto.setWarehouseSid(WarehouseInventoryRecordDto.getWarehouseSid());
|
||||||
WarehouseInventoryRecordDto.setWarehouseName(WarehouseInventoryRecordDto.getWarehouseName());
|
WarehouseInventoryRecordDto.setWarehouseName(WarehouseInventoryRecordDto.getWarehouseName());
|
||||||
WarehouseInventoryRecordDto.setWarehouseRackSid(WarehouseInventoryRecordDto.getWarehouseRackSid());
|
WarehouseInventoryRecordDto.setWarehouseRackSid(WarehouseInventoryRecordDto.getWarehouseRackSid());
|
||||||
@@ -188,5 +345,4 @@ public class WarehouseOutBillService extends MybatisBaseService<WarehouseOutBill
|
|||||||
warehouseInventoryRecordService.saveOrUpdateDto(WarehouseInventoryRecordDto);
|
warehouseInventoryRecordService.saveOrUpdateDto(WarehouseInventoryRecordDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.yxt.warehouse.biz.warehouseoutbill;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description:
|
* @description:
|
||||||
* @author: dimengzhe
|
* @author: dimengzhe
|
||||||
@@ -12,19 +14,96 @@ import lombok.Data;
|
|||||||
public class WarehouseOutBillVo {
|
public class WarehouseOutBillVo {
|
||||||
|
|
||||||
private String sid;
|
private String sid;
|
||||||
|
@ApiModelProperty("0 待分配 1零拣打单 2待出库 3已出库")
|
||||||
|
private String billState;
|
||||||
@ApiModelProperty("单据编号")
|
@ApiModelProperty("单据编号")
|
||||||
private String billNo;
|
private String billNo;
|
||||||
@ApiModelProperty("单据日期")
|
|
||||||
private String createTime;
|
|
||||||
@ApiModelProperty("制单人")
|
|
||||||
private String createByName;
|
|
||||||
@ApiModelProperty("来源单号")
|
@ApiModelProperty("来源单号")
|
||||||
private String sourceBillNo;
|
private String sourceBillNo;
|
||||||
@ApiModelProperty("业务类型value((销售出库、采购退货出库等))")
|
@ApiModelProperty("外部状态")
|
||||||
private String busTypeValue;
|
private String externalState;
|
||||||
@ApiModelProperty("单据状态:已完成/已发货")
|
@ApiModelProperty("买家留言")
|
||||||
private String billState;
|
private String buyerMessage;
|
||||||
|
@ApiModelProperty("库存状态")
|
||||||
|
private String inventoryStatus;
|
||||||
|
@ApiModelProperty("货主")
|
||||||
|
private String shipper;
|
||||||
|
@ApiModelProperty("承运商")
|
||||||
|
private String carrierKey;
|
||||||
|
private String carrierValue;
|
||||||
|
@ApiModelProperty("运单号")
|
||||||
|
private String waybillNumber;
|
||||||
|
@ApiModelProperty("配送方式")
|
||||||
|
private String deliveryMethod;
|
||||||
|
@ApiModelProperty("买家")
|
||||||
|
private String buyer;
|
||||||
|
@ApiModelProperty("收货人")
|
||||||
|
private String consignee;
|
||||||
|
@ApiModelProperty("固话")
|
||||||
|
private String fixedLine;
|
||||||
|
@ApiModelProperty("邮编")
|
||||||
|
private String postalCode;
|
||||||
|
@ApiModelProperty("省")
|
||||||
|
private String province;
|
||||||
|
@ApiModelProperty("市")
|
||||||
|
private String city;
|
||||||
|
@ApiModelProperty("区")
|
||||||
|
private String county;
|
||||||
|
@ApiModelProperty("街道")
|
||||||
|
private String street;
|
||||||
|
@ApiModelProperty("详细地址")
|
||||||
|
private String address;
|
||||||
|
@ApiModelProperty("手机")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("实付")
|
||||||
|
private double actualPayment;
|
||||||
|
@ApiModelProperty("优惠")
|
||||||
|
private double discount;
|
||||||
|
@ApiModelProperty("运费")
|
||||||
|
private double freight;
|
||||||
|
@ApiModelProperty("重量")
|
||||||
|
private double weight;
|
||||||
|
@ApiModelProperty("估重")
|
||||||
|
private double weightEstimation;
|
||||||
|
@ApiModelProperty("商品数量")
|
||||||
|
private double quantity;
|
||||||
|
@ApiModelProperty("下单时间")
|
||||||
|
private Date orderTime;
|
||||||
|
@ApiModelProperty("订单号")
|
||||||
|
private String orderNumber;
|
||||||
|
@ApiModelProperty("外部订单号")
|
||||||
|
private String externalOrderNumber;
|
||||||
|
@ApiModelProperty("线上订单号")
|
||||||
|
private String onlineOrderNumber;
|
||||||
|
@ApiModelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
@ApiModelProperty("付款时间")
|
||||||
|
private Date paymentTime;
|
||||||
|
@ApiModelProperty("接单时间")
|
||||||
|
private Date orderAcceptanceTime;
|
||||||
|
@ApiModelProperty("拣选区域")
|
||||||
|
private String pickingArea;
|
||||||
|
@ApiModelProperty("出库类型")
|
||||||
|
private String outboundType;
|
||||||
|
@ApiModelProperty("品牌")
|
||||||
|
private String brand;
|
||||||
|
@ApiModelProperty("波次")
|
||||||
|
private String waveTimes;
|
||||||
|
@ApiModelProperty("超时时间")
|
||||||
|
private Date timeoutPeriod;
|
||||||
|
@ApiModelProperty("到货时间")
|
||||||
|
private Date deliveryTime;
|
||||||
|
@ApiModelProperty("体积")
|
||||||
|
private double volume;
|
||||||
|
@ApiModelProperty("标记")
|
||||||
|
private String sign;
|
||||||
|
@ApiModelProperty("最晚发货时间")
|
||||||
|
private Date latestDeliveryTime;
|
||||||
|
@ApiModelProperty("创建组织sid")
|
||||||
|
private String createOrgSid;
|
||||||
|
@ApiModelProperty("使用组织sid")
|
||||||
|
private String useOrgSid;
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseoutbill;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2024/8/15 16:19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WarehouseOutStateQuery {
|
||||||
|
private String billState;//0 待分配 1 零拣 2待出库 3已出库
|
||||||
|
private String sid;
|
||||||
|
private String userSid;
|
||||||
|
private String userName;
|
||||||
|
}
|
||||||
@@ -14,10 +14,11 @@ import java.util.Date;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class WarehouseOutBillDetail extends BaseEntity {
|
public class WarehouseOutBillDetail extends BaseEntity {
|
||||||
|
private String sid;
|
||||||
@ApiModelProperty("单据sid")
|
@ApiModelProperty("单据sid")
|
||||||
private String billSid;
|
private String sourceBillSid;
|
||||||
@ApiModelProperty("商品基础信息Sid")
|
@ApiModelProperty("图片")
|
||||||
private String goodSpuSid;
|
private String pic;
|
||||||
@ApiModelProperty("商品名称")
|
@ApiModelProperty("商品名称")
|
||||||
private String goodsSpuName;
|
private String goodsSpuName;
|
||||||
@ApiModelProperty("商品Skusid")
|
@ApiModelProperty("商品Skusid")
|
||||||
@@ -28,22 +29,31 @@ public class WarehouseOutBillDetail extends BaseEntity {
|
|||||||
private String goodsSkuCode;
|
private String goodsSkuCode;
|
||||||
@ApiModelProperty("规格型号")
|
@ApiModelProperty("规格型号")
|
||||||
private String goodsSkuOwnSpec;
|
private String goodsSkuOwnSpec;
|
||||||
|
@ApiModelProperty("条码")
|
||||||
|
private String barCode;
|
||||||
@ApiModelProperty("计量单位")
|
@ApiModelProperty("计量单位")
|
||||||
private String unit;
|
private String unit;
|
||||||
|
@ApiModelProperty("单价")
|
||||||
|
private BigDecimal price;
|
||||||
@ApiModelProperty("订单数量")
|
@ApiModelProperty("订单数量")
|
||||||
private BigDecimal orderCount;
|
private BigDecimal orderCount;
|
||||||
@ApiModelProperty("未结数量")
|
@ApiModelProperty("应收价格")
|
||||||
private BigDecimal remainingCount;
|
private BigDecimal receivable;
|
||||||
@ApiModelProperty("调整数量")
|
@ApiModelProperty("实际价格")
|
||||||
private BigDecimal adjustCount;
|
private BigDecimal actualPrice;
|
||||||
@ApiModelProperty("分配数量")
|
@ApiModelProperty("销售金额")
|
||||||
private BigDecimal distributeCount;
|
private BigDecimal salesAmount;
|
||||||
@ApiModelProperty("发货数量")
|
@ApiModelProperty("序列号")
|
||||||
private BigDecimal deliveryCount;
|
private String serialNumber;
|
||||||
@ApiModelProperty("状态(新建/已发货完成、部分分配、全部分配等)")
|
@ApiModelProperty("库位")
|
||||||
private Integer billState;
|
private String rackState;//0:待分配 1部分分配 2已分配
|
||||||
@ApiModelProperty("发货时间")
|
@ApiModelProperty("批次号")
|
||||||
private Date deliveTime;
|
private String batchNumber;
|
||||||
|
@ApiModelProperty("生产日期")
|
||||||
|
private Date dateOfManufacture;
|
||||||
|
@ApiModelProperty("过期日期")
|
||||||
|
private Date expirationDate;
|
||||||
|
@ApiModelProperty("批次扩展属性")
|
||||||
|
private String batchExpansion;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package com.yxt.warehouse.biz.warehouseoutbilldetail;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description:
|
* @description:
|
||||||
* @author: dimengzhe
|
* @author: dimengzhe
|
||||||
@@ -11,11 +14,10 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class WarehouseOutBillDetailDto {
|
public class WarehouseOutBillDetailDto {
|
||||||
private String sid;
|
private String sid;
|
||||||
@ApiModelProperty("库存商品sid")
|
@ApiModelProperty("单据sid")
|
||||||
private String inventorySid;
|
private String sourceBillSid;
|
||||||
|
@ApiModelProperty("图片")
|
||||||
@ApiModelProperty("商品基础信息Sid")
|
private String pic;
|
||||||
private String goodSpuSid;
|
|
||||||
@ApiModelProperty("商品名称")
|
@ApiModelProperty("商品名称")
|
||||||
private String goodsSpuName;
|
private String goodsSpuName;
|
||||||
@ApiModelProperty("商品Skusid")
|
@ApiModelProperty("商品Skusid")
|
||||||
@@ -26,24 +28,32 @@ public class WarehouseOutBillDetailDto {
|
|||||||
private String goodsSkuCode;
|
private String goodsSkuCode;
|
||||||
@ApiModelProperty("规格型号")
|
@ApiModelProperty("规格型号")
|
||||||
private String goodsSkuOwnSpec;
|
private String goodsSkuOwnSpec;
|
||||||
|
@ApiModelProperty("条码")
|
||||||
|
private String barCode;
|
||||||
@ApiModelProperty("计量单位")
|
@ApiModelProperty("计量单位")
|
||||||
private String unit;
|
private String unit;
|
||||||
|
@ApiModelProperty("单价")
|
||||||
|
private BigDecimal price;
|
||||||
@ApiModelProperty("出库数量")
|
@ApiModelProperty("订单数量")
|
||||||
private String outCount;
|
private BigDecimal orderCount;
|
||||||
@ApiModelProperty("仓库sid")
|
@ApiModelProperty("应收价格")
|
||||||
private String warehouseSid;
|
private BigDecimal receivable;
|
||||||
//仓库名称
|
@ApiModelProperty("实际价格")
|
||||||
private String warehouseName;
|
private BigDecimal actualPrice;
|
||||||
//库位sid
|
@ApiModelProperty("销售金额")
|
||||||
private String warehouseRackSid;
|
private BigDecimal salesAmount;
|
||||||
//库位编码
|
@ApiModelProperty("序列号")
|
||||||
private String warehouseRackCode;
|
private String serialNumber;
|
||||||
//销售单价
|
@ApiModelProperty("库位")
|
||||||
private String money;
|
private String rackState;
|
||||||
//金额
|
@ApiModelProperty("批次号")
|
||||||
private String moneyAll;
|
private String batchNumber;
|
||||||
|
@ApiModelProperty("生产日期")
|
||||||
|
private Date dateOfManufacture;
|
||||||
|
@ApiModelProperty("过期日期")
|
||||||
|
private Date expirationDate;
|
||||||
|
@ApiModelProperty("批次扩展属性")
|
||||||
|
private String batchExpansion;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,5 +24,5 @@ public interface WarehouseOutBillDetailMapper extends BaseMapper<WarehouseOutBil
|
|||||||
@Delete("delete from warehouse_out_bill_detail where sid = #{sid}")
|
@Delete("delete from warehouse_out_bill_detail where sid = #{sid}")
|
||||||
void delByMainSid(String billSid);
|
void delByMainSid(String billSid);
|
||||||
List<WarehouseOutBillDetailDto> selectDetailsList(String sid);
|
List<WarehouseOutBillDetailDto> selectDetailsList(String sid);
|
||||||
|
List<WarehouseOutBillDetailVo> selectDetailsByBillSid(String sid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,14 +17,13 @@
|
|||||||
where a.sid =#{sid}
|
where a.sid =#{sid}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectDetailsList" resultType="com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailDto">
|
<select id="selectDetailsList" resultType="com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailDto">
|
||||||
select wbd.goodSpuSid,
|
select wbd.*
|
||||||
wbd.goodsSpuName,
|
|
||||||
wbd.goodsSkuSid,
|
|
||||||
wbd.goodsSkuTitle,
|
|
||||||
wbd.goodsSkuCode,
|
|
||||||
wbd.goodsSkuOwnSpec,
|
|
||||||
wbd.unit
|
|
||||||
from warehouse_out_bill_detail wbd
|
from warehouse_out_bill_detail wbd
|
||||||
where wbd.billSid = #{sid}
|
where wbd.sourceBillSid = #{sid}
|
||||||
|
</select>
|
||||||
|
<select id="selectDetailsByBillSid" resultType="com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailVo">
|
||||||
|
select wbd.*,case wbd.rackState when 0 then '待分配' when 1 then '部分分配' when 2 then '已分配' end as rackStateValue
|
||||||
|
from warehouse_out_bill_detail wbd
|
||||||
|
where wbd.sourceBillSid = #{sid}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -106,11 +106,14 @@ public class WarehouseOutBillDetailService extends MybatisBaseService<WarehouseO
|
|||||||
WarehouseOutBillDetailDto WarehouseOutBillDetailDto = detailsList.get(i);
|
WarehouseOutBillDetailDto WarehouseOutBillDetailDto = detailsList.get(i);
|
||||||
WarehouseOutBillDetail WarehouseOutBillDetail = new WarehouseOutBillDetail();
|
WarehouseOutBillDetail WarehouseOutBillDetail = new WarehouseOutBillDetail();
|
||||||
BeanUtil.copyProperties(WarehouseOutBillDetailDto, WarehouseOutBillDetail, "sid");
|
BeanUtil.copyProperties(WarehouseOutBillDetailDto, WarehouseOutBillDetail, "sid");
|
||||||
WarehouseOutBillDetail.setBillSid(sid);
|
WarehouseOutBillDetail.setSourceBillSid(sid);
|
||||||
baseMapper.insert(WarehouseOutBillDetail);
|
baseMapper.insert(WarehouseOutBillDetail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public List<WarehouseOutBillDetailDto> selectDetailsList(String sid) {
|
public List<WarehouseOutBillDetailDto> selectDetailsList(String sid) {
|
||||||
return baseMapper.selectDetailsList(sid);
|
return baseMapper.selectDetailsList(sid);
|
||||||
}
|
}
|
||||||
|
public List<WarehouseOutBillDetailVo> selectDetailsByBillSid(String sid) {
|
||||||
|
return baseMapper.selectDetailsByBillSid(sid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,11 @@ import java.util.Date;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class WarehouseOutBillDetailVo {
|
public class WarehouseOutBillDetailVo {
|
||||||
|
private String sid;
|
||||||
@ApiModelProperty("单据sid")
|
@ApiModelProperty("单据sid")
|
||||||
private String billSid;
|
private String sourceBillSid;
|
||||||
@ApiModelProperty("商品基础信息Sid")
|
@ApiModelProperty("图片")
|
||||||
private String goodSpuSid;
|
private String pic;
|
||||||
@ApiModelProperty("商品名称")
|
@ApiModelProperty("商品名称")
|
||||||
private String goodsSpuName;
|
private String goodsSpuName;
|
||||||
@ApiModelProperty("商品Skusid")
|
@ApiModelProperty("商品Skusid")
|
||||||
@@ -27,21 +28,32 @@ public class WarehouseOutBillDetailVo {
|
|||||||
private String goodsSkuCode;
|
private String goodsSkuCode;
|
||||||
@ApiModelProperty("规格型号")
|
@ApiModelProperty("规格型号")
|
||||||
private String goodsSkuOwnSpec;
|
private String goodsSkuOwnSpec;
|
||||||
|
@ApiModelProperty("条码")
|
||||||
|
private String barCode;
|
||||||
@ApiModelProperty("计量单位")
|
@ApiModelProperty("计量单位")
|
||||||
private String unit;
|
private String unit;
|
||||||
|
@ApiModelProperty("单价")
|
||||||
|
private BigDecimal price;
|
||||||
@ApiModelProperty("订单数量")
|
@ApiModelProperty("订单数量")
|
||||||
private BigDecimal orderCount;
|
private BigDecimal orderCount;
|
||||||
@ApiModelProperty("未结数量")
|
@ApiModelProperty("应收价格")
|
||||||
private BigDecimal remainingCount;
|
private BigDecimal receivable;
|
||||||
@ApiModelProperty("调整数量")
|
@ApiModelProperty("实际价格")
|
||||||
private BigDecimal adjustCount;
|
private BigDecimal actualPrice;
|
||||||
@ApiModelProperty("分配数量")
|
@ApiModelProperty("销售金额")
|
||||||
private BigDecimal distributeCount;
|
private BigDecimal salesAmount;
|
||||||
@ApiModelProperty("发货数量")
|
@ApiModelProperty("序列号")
|
||||||
private BigDecimal deliveryCount;
|
private String serialNumber;
|
||||||
@ApiModelProperty("状态(新建/已发货完成、部分分配、全部分配等)")
|
@ApiModelProperty("库位")
|
||||||
private Integer billState;
|
private String rackState;
|
||||||
@ApiModelProperty("发货时间")
|
private String rackStateValue;//value
|
||||||
private Date deliveTime;
|
@ApiModelProperty("批次号")
|
||||||
|
private String batchNumber;
|
||||||
|
@ApiModelProperty("生产日期")
|
||||||
|
private Date dateOfManufacture;
|
||||||
|
@ApiModelProperty("过期日期")
|
||||||
|
private Date expirationDate;
|
||||||
|
@ApiModelProperty("批次扩展属性")
|
||||||
|
private String batchExpansion;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseoutlocation;
|
||||||
|
|
||||||
|
import com.yxt.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseOutLocation extends BaseEntity {
|
||||||
|
|
||||||
|
private String sid;
|
||||||
|
@ApiModelProperty("来源单")
|
||||||
|
private String sourceBillSid;
|
||||||
|
@ApiModelProperty("sku")
|
||||||
|
private String goodsSkuSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名称")
|
||||||
|
private String goodsSpuName;
|
||||||
|
@ApiModelProperty("商品title")
|
||||||
|
private String goodsSkuTitle;
|
||||||
|
@ApiModelProperty("商品规格编码")
|
||||||
|
private String goodsSkuCode;
|
||||||
|
@ApiModelProperty("数量")
|
||||||
|
private BigDecimal count;
|
||||||
|
@ApiModelProperty("库位sid")
|
||||||
|
private String rackSid;
|
||||||
|
@ApiModelProperty("库位编码")
|
||||||
|
private String rackCode;
|
||||||
|
private String inventorySid;
|
||||||
|
private String spec;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseoutlocation;
|
||||||
|
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailDto;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseOutLocationDto {
|
||||||
|
private String sid;
|
||||||
|
@ApiModelProperty("来源单")
|
||||||
|
private String sourceBillSid;
|
||||||
|
@ApiModelProperty("sku")
|
||||||
|
private String goodsSkuSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名称")
|
||||||
|
private String goodsSpuName;
|
||||||
|
@ApiModelProperty("商品title")
|
||||||
|
private String goodsSpuTitle;
|
||||||
|
@ApiModelProperty("商品规格编码")
|
||||||
|
private String goodsSkuCode;
|
||||||
|
@ApiModelProperty("数量")
|
||||||
|
private BigDecimal count;
|
||||||
|
@ApiModelProperty("库位sid")
|
||||||
|
private String rackSid;
|
||||||
|
@ApiModelProperty("库位编码")
|
||||||
|
private String rackCode;
|
||||||
|
private String inventorySid;
|
||||||
|
private BigDecimal initialCount;
|
||||||
|
private String locationSid;
|
||||||
|
private String spec;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseoutlocation;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Mapper
|
||||||
|
public interface WarehouseOutLocationMapper extends BaseMapper<WarehouseOutLocation> {
|
||||||
|
|
||||||
|
List<WarehouseOutLocationVo> details(@Param("sid") String sid);
|
||||||
|
WarehouseOutLocationVo totalCountBySkuSid(@Param("sid") String sid,@Param("skuSid") String skuSid);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listPage" resultType="com.yxt.warehouse.biz.warehouseoutbill.WarehouseOutBillVo">
|
||||||
|
select a.* from warehouse_out_bill a
|
||||||
|
LEFT JOIN ss_user.sys_organization as s ON a.useOrgSid = s.sid
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="details" resultType="com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationVo">
|
||||||
|
select a.* from warehouse_out_location a
|
||||||
|
<where>
|
||||||
|
a.sourceBillSid=#{sid}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="totalCountBySkuSid" resultType="com.yxt.warehouse.biz.warehouseoutlocation.WarehouseOutLocationVo">
|
||||||
|
select sum(count) as totalCount from warehouse_out_location a
|
||||||
|
<where>
|
||||||
|
a.sourceBillSid=#{sid} and a.goodsSkuSid=#{skuSid}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseoutlocation;
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.Query;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseOutLocationQuery implements Query {
|
||||||
|
|
||||||
|
@ApiModelProperty("单据编号")
|
||||||
|
private String billNo;
|
||||||
|
private String billState;
|
||||||
|
@ApiModelProperty("外部单号")
|
||||||
|
private String externalOrderNumber;
|
||||||
|
@ApiModelProperty("线上单号")
|
||||||
|
private String onlineOrderNumber;
|
||||||
|
@ApiModelProperty("买家")
|
||||||
|
private String buyer;
|
||||||
|
@ApiModelProperty("运单号")
|
||||||
|
private String waybillNumber;
|
||||||
|
@ApiModelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
@ApiModelProperty("承运商")
|
||||||
|
private String carrier;
|
||||||
|
@ApiModelProperty("手机")
|
||||||
|
private String mobile;
|
||||||
|
@ApiModelProperty("出库类型")
|
||||||
|
private String outboundType;
|
||||||
|
@ApiModelProperty("地址")
|
||||||
|
private String address;
|
||||||
|
@ApiModelProperty("下单日期开始时间")
|
||||||
|
private String orderTimeStart;
|
||||||
|
@ApiModelProperty("下单日期结束时间")
|
||||||
|
private String orderTimeEnd;
|
||||||
|
|
||||||
|
private String orgLevelKey;//权限等级
|
||||||
|
@ApiModelProperty("菜单路由")
|
||||||
|
private String menuUrl;
|
||||||
|
@ApiModelProperty("组织全路径sid")
|
||||||
|
private String orgPath;
|
||||||
|
@ApiModelProperty("用户sid")
|
||||||
|
private String userSid;
|
||||||
|
private int index;
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseoutlocation;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
|
import com.yxt.common.base.utils.PagerUtil;
|
||||||
|
import com.yxt.common.base.utils.StringUtils;
|
||||||
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinventory.WarehouseInventory;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinventory.WarehouseInventoryService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinventoryrecord.WarehouseInventoryRecordDto;
|
||||||
|
import com.yxt.warehouse.biz.warehouseinventoryrecord.WarehouseInventoryRecordService;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetail;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailDto;
|
||||||
|
import com.yxt.warehouse.biz.warehouseoutbilldetail.WarehouseOutBillDetailService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class WarehouseOutLocationService extends MybatisBaseService<WarehouseOutLocationMapper, WarehouseOutLocation> {
|
||||||
|
@Autowired
|
||||||
|
WarehouseInventoryService warehouseInventoryService;
|
||||||
|
@Autowired
|
||||||
|
WarehouseOutBillDetailService warehouseOutBillDetailService;
|
||||||
|
|
||||||
|
public ResultBean<String> save(List<WarehouseOutLocationDto> dtos) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
if (dtos.size() == 0) {
|
||||||
|
return rb.setMsg("参数不正确");
|
||||||
|
}
|
||||||
|
//分配
|
||||||
|
WarehouseOutLocationVo warehouseOutLocationVo = baseMapper.totalCountBySkuSid(dtos.get(0).getSourceBillSid(), dtos.get(0).getGoodsSkuSid());
|
||||||
|
//总得
|
||||||
|
WarehouseOutBillDetail warehouseOutBillDetail = warehouseOutBillDetailService.getOne(new QueryWrapper<WarehouseOutBillDetail>()
|
||||||
|
.eq("sourceBillSid", dtos.get(0).getSourceBillSid())
|
||||||
|
.eq("goodsSkuSid", dtos.get(0).getGoodsSkuSid()));
|
||||||
|
BigDecimal t = new BigDecimal(0);
|
||||||
|
for (WarehouseOutLocationDto dto : dtos) {
|
||||||
|
WarehouseInventory warehouseInventory = warehouseInventoryService.getOne(new QueryWrapper<WarehouseInventory>().eq("sid", dto.getInventorySid()));
|
||||||
|
warehouseInventory.setAllocateCount(warehouseInventory.getAllocateCount().add(dto.getCount().multiply(dto.getInitialCount())));
|
||||||
|
warehouseInventoryService.saveOrUpdate(warehouseInventory);
|
||||||
|
t.add(dto.getCount());
|
||||||
|
}
|
||||||
|
int result = t.add(warehouseOutLocationVo.getTotalCount()).compareTo(warehouseOutBillDetail.getOrderCount());
|
||||||
|
if (result > 0) {
|
||||||
|
return rb.setMsg("分配数量超过订单数量");
|
||||||
|
}
|
||||||
|
for (WarehouseOutLocationDto dto : dtos) {
|
||||||
|
int i = dto.getInitialCount().compareTo(new BigDecimal(0));
|
||||||
|
if (i == 0) {
|
||||||
|
WarehouseOutLocation warehouseOutLocation = new WarehouseOutLocation();
|
||||||
|
BeanUtil.copyProperties(dto, warehouseOutLocation, "sid");
|
||||||
|
warehouseOutLocation.setGoodsSkuCode(warehouseOutBillDetail.getGoodsSkuCode());
|
||||||
|
baseMapper.insert(warehouseOutLocation);
|
||||||
|
} else {
|
||||||
|
WarehouseOutLocation warehouseOutLocation = new WarehouseOutLocation();
|
||||||
|
BeanUtil.copyProperties(dto, warehouseOutLocation);
|
||||||
|
warehouseOutLocation.setSid(dto.getLocationSid());
|
||||||
|
warehouseOutLocation.setGoodsSkuCode(warehouseOutBillDetail.getGoodsSkuCode());
|
||||||
|
baseMapper.updateById(warehouseOutLocation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (warehouseOutBillDetail.getOrderCount() == warehouseOutLocationVo.getTotalCount()) {
|
||||||
|
warehouseOutBillDetail.setRackState("2");
|
||||||
|
} else if (warehouseOutBillDetail.getOrderCount() != warehouseOutLocationVo.getTotalCount()) {
|
||||||
|
warehouseOutBillDetail.setRackState("1");
|
||||||
|
}
|
||||||
|
return rb.success().setData("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ResultBean<List<WarehouseOutLocationVo>> details(String sid) {
|
||||||
|
ResultBean<List<WarehouseOutLocationVo>> rb = ResultBean.fireFail();
|
||||||
|
List<WarehouseOutLocationVo> warehouseOutLocationVo = baseMapper.details(sid);
|
||||||
|
if (warehouseOutLocationVo == null) {
|
||||||
|
return rb.setMsg("该单据不存在");
|
||||||
|
}
|
||||||
|
return rb.success().setData(warehouseOutLocationVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResultBean<WarehouseOutLocationVo> totalCountBySkuSid(String sid, String skuSid) {
|
||||||
|
ResultBean<WarehouseOutLocationVo> rb = ResultBean.fireFail();
|
||||||
|
WarehouseOutLocationVo warehouseOutLocationVo = baseMapper.totalCountBySkuSid(sid, skuSid);
|
||||||
|
return rb.success().setData(warehouseOutLocationVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.yxt.warehouse.biz.warehouseoutlocation;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author: dimengzhe
|
||||||
|
* @date: 2024/4/24
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class WarehouseOutLocationVo {
|
||||||
|
|
||||||
|
private String sid;
|
||||||
|
@ApiModelProperty("来源单")
|
||||||
|
private String sourceBillSid;
|
||||||
|
@ApiModelProperty("sku")
|
||||||
|
private String goodsSkuSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名称")
|
||||||
|
private String goodsSpuName;
|
||||||
|
@ApiModelProperty("商品title")
|
||||||
|
private String goodsSpuTitle;
|
||||||
|
@ApiModelProperty("商品规格编码")
|
||||||
|
private String goodsSkuCode;
|
||||||
|
@ApiModelProperty("数量")
|
||||||
|
private BigDecimal count;
|
||||||
|
@ApiModelProperty("库位sid")
|
||||||
|
private String rackSid;
|
||||||
|
@ApiModelProperty("库位编码")
|
||||||
|
private String rackCode;
|
||||||
|
private String inventorySid;
|
||||||
|
private BigDecimal totalCount;
|
||||||
|
private String spec;
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user