Browse Source

扫描商品码接口开发

master
God 10 months ago
parent
commit
b47e6664ef
  1. 5
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/wms/inventorycheckbill/WmsInventoryCheckbillFeign.java
  2. 33
      anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/wms/inventorycheckbill/WmsInventoryCheckbillRest.java
  3. 4
      anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/wms/inventorycheckbill/WmsInventoryCheckbillService.java
  4. 11
      anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/fegin/wmsInventoryCheckbill/WmsInventoryCheckbillFeign.java
  5. 288
      yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryCheckbillRest.java
  6. 30
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbill/WmsInventoryCheckbillService.java
  7. 3
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailMapper.java
  8. 18
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailMapper.xml
  9. 91
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailService.java
  10. 44
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/app/HandleBean.java
  11. 2
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventoryrecord/WmsInventoryRecordMapper.java
  12. 9
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventoryrecord/WmsInventoryRecordMapper.xml
  13. 4
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventoryrecord/WmsInventoryRecordService.java

5
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/wms/inventorycheckbill/WmsInventoryCheckbillFeign.java

@ -44,4 +44,9 @@ public interface WmsInventoryCheckbillFeign {
@PostMapping("/saveInventoryInfo")
@ResponseBody
ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto);
@ApiOperation("扫描商品码")
@GetMapping("/scan")
@ResponseBody
public ResultBean<HandleBean> scan(@RequestParam("sid") String sid,@RequestParam("content") String content,@RequestParam("houseSid") String houseSid);
}

33
anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/wms/inventorycheckbill/WmsInventoryCheckbillRest.java

@ -39,21 +39,26 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("v1/inventory")
public class WmsInventoryCheckbillRest implements WmsInventoryCheckbillFeign {
@Autowired
private WmsInventoryCheckbillService wmsInventoryCheckbillService;
@Autowired
private WmsInventoryCheckbillService wmsInventoryCheckbillService;
@Override
public ResultBean<PagerVo<WmsInventoryCheckbillPageVo>> list(PagerQuery<WmsInventoryCheckbillPageQuery> pagerQuery) {
return wmsInventoryCheckbillService.pdlist(pagerQuery);
}
@Override
public ResultBean<PagerVo<WmsInventoryCheckbillPageVo>> list(PagerQuery<WmsInventoryCheckbillPageQuery> pagerQuery) {
return wmsInventoryCheckbillService.pdlist(pagerQuery);
}
@Override
public ResultBean<PagerVo<WmsInventoryCheckbillGoodsPageVo>> fetchByKuWeiSid(PagerQuery<WmsInventoryCheckbillGoodsPageQuery> pagerQuery) {
return wmsInventoryCheckbillService.fetchByKuWeiSid(pagerQuery);
}
@Override
public ResultBean<PagerVo<WmsInventoryCheckbillGoodsPageVo>> fetchByKuWeiSid(PagerQuery<WmsInventoryCheckbillGoodsPageQuery> pagerQuery) {
return wmsInventoryCheckbillService.fetchByKuWeiSid(pagerQuery);
}
@Override
public ResultBean saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) {
return wmsInventoryCheckbillService.saveInventoryInfo(dto);
}
@Override
public ResultBean saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) {
return wmsInventoryCheckbillService.saveInventoryInfo(dto);
}
@Override
public ResultBean<HandleBean> scan(String sid, String content, String houseSid) {
return wmsInventoryCheckbillService.scan(sid, content, houseSid);
}
}

4
anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/wms/inventorycheckbill/WmsInventoryCheckbillService.java

@ -91,4 +91,8 @@ public class WmsInventoryCheckbillService {
public ResultBean saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) {
return wmsInventoryCheckbillFeign.saveInventoryInfo(dto);
}
public ResultBean<HandleBean> scan(String sid, String content, String houseSid) {
return wmsInventoryCheckbillFeign.scan(sid, content, houseSid);
}
}

11
anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/fegin/wmsInventoryCheckbill/WmsInventoryCheckbillFeign.java

@ -1,6 +1,7 @@
package com.yxt.anrui.terminal.fegin.wmsInventoryCheckbill;
import com.yxt.anrui.terminal.api.wms.inventorycheckbill.HandleBean;
import com.yxt.anrui.terminal.api.wms.inventorycheckbill.WmsInventoryCheckbillGoodsDto;
import com.yxt.anrui.terminal.api.wms.inventorycheckbill.WmsInventoryCheckbillPageQuery;
import com.yxt.anrui.terminal.api.wms.inventorycheckbill.WmsInventoryCheckbillPageVo;
@ -10,10 +11,7 @@ import com.yxt.common.core.vo.PagerVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
/**
* @Author
@ -40,4 +38,9 @@ public interface WmsInventoryCheckbillFeign {
@PostMapping("/saveInventoryInfo")
@ResponseBody
ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto);
@ApiOperation("扫描商品码")
@GetMapping("/scan")
@ResponseBody
public ResultBean<HandleBean> scan(@RequestParam("sid") String sid, @RequestParam("content") String content, @RequestParam("houseSid") String houseSid);
}

288
yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryCheckbillRest.java

@ -32,6 +32,7 @@ import com.yxt.common.core.vo.PagerVo;
import com.yxt.wms.biz.inventory.wmsinventorycheckbill.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbill.flowable.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillGoodsDto;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageQuery;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo;
@ -64,145 +65,152 @@ import java.util.List;
@RequestMapping("v1/wmsinventorycheckbill")
public class WmsInventoryCheckbillRest {
@Autowired
private WmsInventoryCheckbillService wmsInventoryCheckbillService;
@ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage")
public ResultBean<PagerVo<WmsInventoryCheckbillVo>> listPage(@RequestBody PagerQuery<WmsInventoryCheckbillQuery> pq){
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillVo> pv = wmsInventoryCheckbillService.listPageVo(pq);
return rb.success().setData(pv);
}
@ApiOperation("新建盘点单")
@PostMapping("/save")
public ResultBean save(@RequestBody WmsInventoryCheckbillDto dto){
return wmsInventoryCheckbillService.saveOrUpdateDto(dto);
}
@ApiOperation("生成盘点报告")
@PostMapping("/createReport")
public ResultBean createReport(@RequestParam("sid") String sid){
ResultBean rb = ResultBean.fireFail();
wmsInventoryCheckbillService.createReport(sid);
return rb.success();
}
@ApiOperation("查看盘点报告")
@PostMapping("/viewReport")
public ResultBean<WmsInventoryCheckbillReportDetailsVo> viewReport(@RequestParam("sid") String sid){
ResultBean rb = ResultBean.fireFail();
WmsInventoryCheckbillReportDetailsVo wmsInventoryCheckbillReportDetailsVo = wmsInventoryCheckbillService.viewReport(sid);
return rb.success().success().setData(wmsInventoryCheckbillReportDetailsVo);
}
@ApiOperation("生成盘点报告PDF")
@PostMapping("/createPdf")
public ResultBean<String> createPdf(@RequestParam("sid") String sid){
ResultBean rb = ResultBean.fireFail();
String url = wmsInventoryCheckbillService.createPdf(sid);
return rb.success().success().setData(url);
}
@ApiOperation("根据sid批量删除")
@Autowired
private WmsInventoryCheckbillService wmsInventoryCheckbillService;
@ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage")
public ResultBean<PagerVo<WmsInventoryCheckbillVo>> listPage(@RequestBody PagerQuery<WmsInventoryCheckbillQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillVo> pv = wmsInventoryCheckbillService.listPageVo(pq);
return rb.success().setData(pv);
}
@ApiOperation("新建盘点单")
@PostMapping("/save")
public ResultBean save(@RequestBody WmsInventoryCheckbillDto dto) {
return wmsInventoryCheckbillService.saveOrUpdateDto(dto);
}
@ApiOperation("生成盘点报告")
@PostMapping("/createReport")
public ResultBean createReport(@RequestParam("sid") String sid) {
ResultBean rb = ResultBean.fireFail();
wmsInventoryCheckbillService.createReport(sid);
return rb.success();
}
@ApiOperation("查看盘点报告")
@PostMapping("/viewReport")
public ResultBean<WmsInventoryCheckbillReportDetailsVo> viewReport(@RequestParam("sid") String sid) {
ResultBean rb = ResultBean.fireFail();
WmsInventoryCheckbillReportDetailsVo wmsInventoryCheckbillReportDetailsVo = wmsInventoryCheckbillService.viewReport(sid);
return rb.success().success().setData(wmsInventoryCheckbillReportDetailsVo);
}
@ApiOperation("生成盘点报告PDF")
@PostMapping("/createPdf")
public ResultBean<String> createPdf(@RequestParam("sid") String sid) {
ResultBean rb = ResultBean.fireFail();
String url = wmsInventoryCheckbillService.createPdf(sid);
return rb.success().success().setData(url);
}
@ApiOperation("根据sid批量删除")
@DeleteMapping("/delBySids")
public ResultBean delBySids(@RequestBody String[] sids){
return wmsInventoryCheckbillService.delAll(sids);
}
@ApiOperation("盘点-查看库位盘点列表")
@PostMapping("/detailRackPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillDetailRackPageListVo>> detailRackPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailRackPageListQuery> pq){
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillDetailRackPageListVo> pv = wmsInventoryCheckbillService.detailRackPageList(pq);
return rb.success().setData(pv);
}
@ApiOperation("盘点-查看商品盘点列表")
@PostMapping("/detailGoodPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillDetailGoodPageListVo>> detailGoodPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailGoodPageListQuery> pq){
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillDetailGoodPageListVo> pv = wmsInventoryCheckbillService.detailGoodPageList(pq);
return rb.success().setData(pv);
}
@ApiOperation("查看库位商品盘点列表")
@PostMapping("/detailRackGoodPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillDetailRackGoodPageListVo>> detailRackGoodPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailRackGoodPageListQuery> pq){
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillDetailRackGoodPageListVo> pv = wmsInventoryCheckbillService.detailRackGoodPageList(pq);
return rb.success().setData(pv);
}
/*********************************************************移动端************************************************************/
@ApiOperation("app-盘点-查看库位盘点列表")
@PostMapping("/appDetailRackPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillPageVo>> appDetailRackPageList(@RequestBody PagerQuery<WmsInventoryCheckbillPageQuery> pq){
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillPageVo> pv = wmsInventoryCheckbillService.appDetailRackPageList(pq);
return rb.success().setData(pv);
}
@ApiOperation("办理/扫码保存")
@PostMapping("/saveInventoryInfo")
@ResponseBody
ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto){
return wmsInventoryCheckbillService.saveInventoryInfo(dto);
};
/*********************************************************流程************************************************************/
@ApiOperation("提交")
@PostMapping("/submitApply")
public ResultBean submitApply(@Valid @RequestBody SubmitInventoryCheckDto dto) {
return wmsInventoryCheckbillService.submitApply(dto);
}
@ApiOperation(value = "办理(同意)")
@PostMapping("/complete")
public ResultBean complete(@Valid @RequestBody CompleteInventoryCheckDto query) {
BusinessVariables bv = new BusinessVariables();
BeanUtil.copyProperties(query, bv);
bv.setModelId("");
return wmsInventoryCheckbillService.complete(bv);
}
@ApiOperation(value = "获取上一个环节")
@GetMapping(value = "/getPreviousNodesForReject")
ResultBean<List<InventoryCheckNodeVo>> getPreviousNodesForReject(@Valid @SpringQueryMap InventoryCheckNodeQuery query) {
return wmsInventoryCheckbillService.getPreviousNodesForReject(query);
}
@ApiOperation(value = "获取下一个环节")
@GetMapping(value = "/getNextNodesForSubmit")
ResultBean<List<InventoryCheckNodeVo>> getNextNodesForSubmit(@Valid @SpringQueryMap InventoryCheckNodeQuery query) {
return wmsInventoryCheckbillService.getNextNodesForSubmit(query);
}
@ApiOperation(value = "驳回任务")
@PostMapping(value = "/reject")
public ResultBean taskReject(@Valid @RequestBody InventoryCheckTaskQuery query) {
return wmsInventoryCheckbillService.taskReject(query);
}
@ApiOperation(value = "撤回流程")
@PostMapping(value = "/revokeProcess")
public ResultBean revokeProcess(@Valid @RequestBody InventoryCheckTaskQuery query) {
return wmsInventoryCheckbillService.revokeProcess(query);
}
@ApiOperation(value = "终止任务")
@PostMapping(value = "/breakProcess")
public ResultBean breakProcess(@Valid @RequestBody InventoryCheckTaskQuery query) {
return wmsInventoryCheckbillService.breakProcess(query);
}
@ApiOperation(value = "加签")
@PostMapping(value = "/delegate")
@ResponseBody
public ResultBean delegate(@RequestBody InventoryCheckDelegateQuery query) {
return wmsInventoryCheckbillService.delegate(query);
}
public ResultBean delBySids(@RequestBody String[] sids) {
return wmsInventoryCheckbillService.delAll(sids);
}
@ApiOperation("盘点-查看库位盘点列表")
@PostMapping("/detailRackPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillDetailRackPageListVo>> detailRackPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailRackPageListQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillDetailRackPageListVo> pv = wmsInventoryCheckbillService.detailRackPageList(pq);
return rb.success().setData(pv);
}
@ApiOperation("盘点-查看商品盘点列表")
@PostMapping("/detailGoodPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillDetailGoodPageListVo>> detailGoodPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailGoodPageListQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillDetailGoodPageListVo> pv = wmsInventoryCheckbillService.detailGoodPageList(pq);
return rb.success().setData(pv);
}
@ApiOperation("查看库位商品盘点列表")
@PostMapping("/detailRackGoodPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillDetailRackGoodPageListVo>> detailRackGoodPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailRackGoodPageListQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillDetailRackGoodPageListVo> pv = wmsInventoryCheckbillService.detailRackGoodPageList(pq);
return rb.success().setData(pv);
}
/*********************************************************移动端************************************************************/
@ApiOperation("app-盘点-查看库位盘点列表")
@PostMapping("/appDetailRackPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillPageVo>> appDetailRackPageList(@RequestBody PagerQuery<WmsInventoryCheckbillPageQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillPageVo> pv = wmsInventoryCheckbillService.appDetailRackPageList(pq);
return rb.success().setData(pv);
}
@ApiOperation("办理/扫码保存")
@PostMapping("/saveInventoryInfo")
@ResponseBody
ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto) {
return wmsInventoryCheckbillService.saveInventoryInfo(dto);
}
@ApiOperation("扫描商品码")
@GetMapping("/scan")
@ResponseBody
public ResultBean<HandleBean> scan(@RequestParam("sid") String sid, @RequestParam("content") String content, @RequestParam("houseSid") String houseSid) {
return wmsInventoryCheckbillService.scan(sid, content, houseSid);
}
/*********************************************************流程************************************************************/
@ApiOperation("提交")
@PostMapping("/submitApply")
public ResultBean submitApply(@Valid @RequestBody SubmitInventoryCheckDto dto) {
return wmsInventoryCheckbillService.submitApply(dto);
}
@ApiOperation(value = "办理(同意)")
@PostMapping("/complete")
public ResultBean complete(@Valid @RequestBody CompleteInventoryCheckDto query) {
BusinessVariables bv = new BusinessVariables();
BeanUtil.copyProperties(query, bv);
bv.setModelId("");
return wmsInventoryCheckbillService.complete(bv);
}
@ApiOperation(value = "获取上一个环节")
@GetMapping(value = "/getPreviousNodesForReject")
ResultBean<List<InventoryCheckNodeVo>> getPreviousNodesForReject(@Valid @SpringQueryMap InventoryCheckNodeQuery query) {
return wmsInventoryCheckbillService.getPreviousNodesForReject(query);
}
@ApiOperation(value = "获取下一个环节")
@GetMapping(value = "/getNextNodesForSubmit")
ResultBean<List<InventoryCheckNodeVo>> getNextNodesForSubmit(@Valid @SpringQueryMap InventoryCheckNodeQuery query) {
return wmsInventoryCheckbillService.getNextNodesForSubmit(query);
}
@ApiOperation(value = "驳回任务")
@PostMapping(value = "/reject")
public ResultBean taskReject(@Valid @RequestBody InventoryCheckTaskQuery query) {
return wmsInventoryCheckbillService.taskReject(query);
}
@ApiOperation(value = "撤回流程")
@PostMapping(value = "/revokeProcess")
public ResultBean revokeProcess(@Valid @RequestBody InventoryCheckTaskQuery query) {
return wmsInventoryCheckbillService.revokeProcess(query);
}
@ApiOperation(value = "终止任务")
@PostMapping(value = "/breakProcess")
public ResultBean breakProcess(@Valid @RequestBody InventoryCheckTaskQuery query) {
return wmsInventoryCheckbillService.breakProcess(query);
}
@ApiOperation(value = "加签")
@PostMapping(value = "/delegate")
@ResponseBody
public ResultBean delegate(@RequestBody InventoryCheckDelegateQuery query) {
return wmsInventoryCheckbillService.delegate(query);
}
}

30
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbill/WmsInventoryCheckbillService.java

@ -43,10 +43,12 @@ import com.yxt.wms.biz.inventory.wmsinventory.WmsInventory;
import com.yxt.wms.biz.inventory.wmsinventory.WmsInventoryService;
import com.yxt.wms.biz.inventory.wmsinventorycheckbill.flowable.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillGoodsDto;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageQuery;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo;
import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.*;
import com.yxt.wms.biz.inventory.wmsinventoryrecord.WmsInventoryRecordService;
import com.yxt.wms.feign.flowable.flow.BusinessVariables;
import com.yxt.wms.feign.flowable.flow.FlowableFeign;
import com.yxt.wms.feign.flowable.flow.ProcDefEnum;
@ -106,6 +108,8 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor
@Autowired
private WmsInventoryService wmsInventoryService;
@Autowired
private WmsInventoryRecordService wmsInventoryRecordService;
@Autowired
private WmsWarehouseRackService wmsWarehouseRackService;
@Autowired
private WmsWarehouseAreaService wmsWarehouseAreaService;
@ -827,4 +831,30 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor
wmsInventoryCheckbillDetailService.saveInventoryInfo(dto);
return rb.success();
}
public ResultBean<HandleBean> scan(String sid, String content, String houseSid) {
ResultBean rb = ResultBean.fireFail();
if (content.contains("#")){
return rb.setMsg("请扫描商品码");
}
HandleBean handleBean = wmsInventoryCheckbillDetailService.scan(sid,content,houseSid);
if (handleBean == null){
List<WmsInventory> wmsInventories = wmsInventoryService.getListByGoodsID(content).getData();
if (!wmsInventories.isEmpty()){
for (WmsInventory wmsInventory : wmsInventories) {
WmsWarehouseRack wmsWarehouseRack = wmsWarehouseRackService.fetchBySid(wmsInventory.getWarehouseRackSid());
WmsWarehouseArea wmsWarehouseArea = wmsWarehouseAreaService.fetchBySid(wmsWarehouseRack.getLocationSid());
return rb.setMsg("本商品不属于本库位,属于" + wmsWarehouseArea.getAreaName() + "库区" + wmsWarehouseRack.getRackName() + "库位。");
}
}else {
String billNo = wmsInventoryRecordService.selByGoodsID(content);
if (StringUtils.isBlank(billNo)){
return rb.setMsg("商品码不正确");
}else {
return rb.setMsg("本商品已在" + billNo + "单据编号中出库。");
}
}
}
return rb.success().setData(handleBean);
}
}

3
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailMapper.java

@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillGoodsDto;
import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo;
import org.apache.ibatis.annotations.Delete;
@ -71,4 +72,6 @@ public interface WmsInventoryCheckbillDetailMapper extends BaseMapper<WmsInvento
void saveInventoryInfoPY(@Param("dto") WmsInventoryCheckbillGoodsDto dto,@Param("pyCount") BigDecimal pyCount);
void saveInventoryInfoPK(@Param("dto") WmsInventoryCheckbillGoodsDto dto,@Param("pkCount") BigDecimal pkCount);
HandleBean scan(@Param("sid") String sid,@Param("content") String content,@Param("houseSid") String houseSid);
}

18
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailMapper.xml

@ -90,4 +90,22 @@
<update id="saveInventoryInfoPK">
update wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = 0,loseCount = #{pkCount},remarks = #{dto.remarks} where sid = #{dto.sid}
</update>
<select id="scan" resultType="com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean">
SELECT
lossCount AS badNum,
goodsID,
goodsSkuTitle AS goodsName,
goodsSkuCode,
bookCount AS lockNum,
realCount AS num,
remarks,
sid,
unit
FROM
wms_inventory_checkbill_detail
WHERE billSid = #{sid}
AND goodsID = #{content}
AND warehouseRackSid = #{houseSid}
</select>
</mapper>

91
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailService.java

@ -26,6 +26,7 @@
package com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail;
import cn.hutool.core.bean.BeanUtil;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.HandleBean;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillGoodsDto;
import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo;
import com.yxt.common.base.service.MybatisBaseService;
@ -51,51 +52,55 @@ import java.util.List;
*/
@Service
public class WmsInventoryCheckbillDetailService extends MybatisBaseService<WmsInventoryCheckbillDetailMapper, WmsInventoryCheckbillDetail> {
public void insertByDto(WmsInventoryCheckbillDetailDto dto){
WmsInventoryCheckbillDetail entity = new WmsInventoryCheckbillDetail();
BeanUtil.copyProperties(dto, entity, "id", "sid");
baseMapper.insert(entity);
}
public WmsInventoryCheckbillDetailDetailsVo fetchDetailsVoBySid(String sid){
WmsInventoryCheckbillDetail entity = fetchBySid(sid);
WmsInventoryCheckbillDetailDetailsVo vo = new WmsInventoryCheckbillDetailDetailsVo();
BeanUtil.copyProperties(entity, vo);
return vo;
}
public void delByMainSid(String dtoSid) {
baseMapper.delByMainSid(dtoSid);
}
public void insertByDto(WmsInventoryCheckbillDetailDto dto) {
WmsInventoryCheckbillDetail entity = new WmsInventoryCheckbillDetail();
BeanUtil.copyProperties(dto, entity, "id", "sid");
baseMapper.insert(entity);
}
public List<WmsInventoryCheckbillDetailDetailsVo> selByMainSid(String billSid) {
return baseMapper.selByMainSid(billSid);
}
public WmsInventoryCheckbillDetailDetailsVo fetchDetailsVoBySid(String sid) {
WmsInventoryCheckbillDetail entity = fetchBySid(sid);
WmsInventoryCheckbillDetailDetailsVo vo = new WmsInventoryCheckbillDetailDetailsVo();
BeanUtil.copyProperties(entity, vo);
return vo;
}
public List<WmsInventoryCheckbillReportSumVo> reportSum(String sid, String sumType) {
List<WmsInventoryCheckbillReportSumVo> wmsInventoryCheckbillReportSumVos = new ArrayList<>();
if ("total".equals(sumType)){
WmsInventoryCheckbillReportSumVo wmsInventoryCheckbillReportSumVo = baseMapper.reportSumTotal(sid);
wmsInventoryCheckbillReportSumVos.add(wmsInventoryCheckbillReportSumVo);
}else if ("ware".equals(sumType)){
wmsInventoryCheckbillReportSumVos = baseMapper.reportSumWare(sid);
}else if ("area".equals(sumType)){
wmsInventoryCheckbillReportSumVos = baseMapper.reportSumArea(sid);
}
return wmsInventoryCheckbillReportSumVos;
}
public void delByMainSid(String dtoSid) {
baseMapper.delByMainSid(dtoSid);
}
public void saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) {
int i = new BigDecimal(dto.getLockNum()).compareTo(new BigDecimal(dto.getNum()));
if (i < 0){//盘盈
BigDecimal pyCount = new BigDecimal(dto.getNum()).subtract(new BigDecimal(dto.getLockNum()));
baseMapper.saveInventoryInfoPY(dto,pyCount);
}else if (i > 0){//盘亏
BigDecimal pkCount = new BigDecimal(dto.getLockNum()).subtract(new BigDecimal(dto.getNum()));
baseMapper.saveInventoryInfoPK(dto,pkCount);
}else {
baseMapper.saveInventoryInfoZC(dto,dto.getNum());
}
}
public List<WmsInventoryCheckbillDetailDetailsVo> selByMainSid(String billSid) {
return baseMapper.selByMainSid(billSid);
}
public List<WmsInventoryCheckbillReportSumVo> reportSum(String sid, String sumType) {
List<WmsInventoryCheckbillReportSumVo> wmsInventoryCheckbillReportSumVos = new ArrayList<>();
if ("total".equals(sumType)) {
WmsInventoryCheckbillReportSumVo wmsInventoryCheckbillReportSumVo = baseMapper.reportSumTotal(sid);
wmsInventoryCheckbillReportSumVos.add(wmsInventoryCheckbillReportSumVo);
} else if ("ware".equals(sumType)) {
wmsInventoryCheckbillReportSumVos = baseMapper.reportSumWare(sid);
} else if ("area".equals(sumType)) {
wmsInventoryCheckbillReportSumVos = baseMapper.reportSumArea(sid);
}
return wmsInventoryCheckbillReportSumVos;
}
public void saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) {
int i = new BigDecimal(dto.getLockNum()).compareTo(new BigDecimal(dto.getNum()));
if (i < 0) {//盘盈
BigDecimal pyCount = new BigDecimal(dto.getNum()).subtract(new BigDecimal(dto.getLockNum()));
baseMapper.saveInventoryInfoPY(dto, pyCount);
} else if (i > 0) {//盘亏
BigDecimal pkCount = new BigDecimal(dto.getLockNum()).subtract(new BigDecimal(dto.getNum()));
baseMapper.saveInventoryInfoPK(dto, pkCount);
} else {
baseMapper.saveInventoryInfoZC(dto, dto.getNum());
}
}
public HandleBean scan(String sid, String content, String houseSid) {
return baseMapper.scan(sid, content, houseSid);
}
}

44
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventorycheckbilldetail/app/HandleBean.java

@ -0,0 +1,44 @@
package com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app;
import lombok.Data;
import java.util.List;
@Data
public class HandleBean {
/**
* 损坏数量默认 0
*/
private String badNum;
private List<String> files;
/**
* 商品ID
*/
private String goodsID;
/**
* 商品名称
*/
private String goodsName;
/**
* 图号
*/
private String goodsSkuCode;
/**
* 本库位库存
*/
private String lockNum;
/**
* 确认数量/数量赋值为库存数量
*/
private String num;
private String remarks;
/**
* 商品记录sid
*/
private String sid;
/**
* 单位
*/
private String unit;
}

2
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventoryrecord/WmsInventoryRecordMapper.java

@ -86,4 +86,6 @@ public interface WmsInventoryRecordMapper extends BaseMapper<WmsInventoryRecord>
List<WmsInventoryRecord> selBySourceSid(String sid);
List<WmsInventoryRecord> selBySourceSidAndSkuCode(@Param("sid") String sid,@Param("goodsSkuCode") String goodsSkuCode);
String selByGoodsID(String content);
}

9
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventoryrecord/WmsInventoryRecordMapper.xml

@ -171,4 +171,13 @@
WHERE
r.sourceBillSid = #{sid} and r.goodsSkuCode = #{goodsSkuCode}
</select>
<select id="selByGoodsID" resultType="java.lang.String">
SELECT
billNo
FROM
wms_inventory_record
WHERE billType = '0'
AND goodsID = #{content}
</select>
</mapper>

4
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventoryrecord/WmsInventoryRecordService.java

@ -364,4 +364,8 @@ public class WmsInventoryRecordService extends MybatisBaseService<WmsInventoryRe
public List<WmsInventoryRecord> selBySourceSidAndSkuCode(String sid, String goodsSkuCode) {
return baseMapper.selBySourceSidAndSkuCode(sid,goodsSkuCode);
}
public String selByGoodsID(String content) {
return baseMapper.selByGoodsID(content);
}
}

Loading…
Cancel
Save