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. 87
      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") @PostMapping("/saveInventoryInfo")
@ResponseBody @ResponseBody
ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto); 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") @RequestMapping("v1/inventory")
public class WmsInventoryCheckbillRest implements WmsInventoryCheckbillFeign { public class WmsInventoryCheckbillRest implements WmsInventoryCheckbillFeign {
@Autowired @Autowired
private WmsInventoryCheckbillService wmsInventoryCheckbillService; private WmsInventoryCheckbillService wmsInventoryCheckbillService;
@Override @Override
public ResultBean<PagerVo<WmsInventoryCheckbillPageVo>> list(PagerQuery<WmsInventoryCheckbillPageQuery> pagerQuery) { public ResultBean<PagerVo<WmsInventoryCheckbillPageVo>> list(PagerQuery<WmsInventoryCheckbillPageQuery> pagerQuery) {
return wmsInventoryCheckbillService.pdlist(pagerQuery); return wmsInventoryCheckbillService.pdlist(pagerQuery);
} }
@Override @Override
public ResultBean<PagerVo<WmsInventoryCheckbillGoodsPageVo>> fetchByKuWeiSid(PagerQuery<WmsInventoryCheckbillGoodsPageQuery> pagerQuery) { public ResultBean<PagerVo<WmsInventoryCheckbillGoodsPageVo>> fetchByKuWeiSid(PagerQuery<WmsInventoryCheckbillGoodsPageQuery> pagerQuery) {
return wmsInventoryCheckbillService.fetchByKuWeiSid(pagerQuery); return wmsInventoryCheckbillService.fetchByKuWeiSid(pagerQuery);
} }
@Override @Override
public ResultBean saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) { public ResultBean saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) {
return wmsInventoryCheckbillService.saveInventoryInfo(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) { public ResultBean saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) {
return wmsInventoryCheckbillFeign.saveInventoryInfo(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; 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.WmsInventoryCheckbillGoodsDto;
import com.yxt.anrui.terminal.api.wms.inventorycheckbill.WmsInventoryCheckbillPageQuery; import com.yxt.anrui.terminal.api.wms.inventorycheckbill.WmsInventoryCheckbillPageQuery;
import com.yxt.anrui.terminal.api.wms.inventorycheckbill.WmsInventoryCheckbillPageVo; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
/** /**
* @Author * @Author
@ -40,4 +38,9 @@ public interface WmsInventoryCheckbillFeign {
@PostMapping("/saveInventoryInfo") @PostMapping("/saveInventoryInfo")
@ResponseBody @ResponseBody
ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto); 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.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbill.flowable.*; import com.yxt.wms.biz.inventory.wmsinventorycheckbill.flowable.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.*; 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.WmsInventoryCheckbillGoodsDto;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageQuery; import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageQuery;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo; import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo;
@ -64,145 +65,152 @@ import java.util.List;
@RequestMapping("v1/wmsinventorycheckbill") @RequestMapping("v1/wmsinventorycheckbill")
public class WmsInventoryCheckbillRest { public class WmsInventoryCheckbillRest {
@Autowired @Autowired
private WmsInventoryCheckbillService wmsInventoryCheckbillService; private WmsInventoryCheckbillService wmsInventoryCheckbillService;
@ApiOperation("根据条件分页查询数据的列表") @ApiOperation("根据条件分页查询数据的列表")
@PostMapping("/listPage") @PostMapping("/listPage")
public ResultBean<PagerVo<WmsInventoryCheckbillVo>> listPage(@RequestBody PagerQuery<WmsInventoryCheckbillQuery> pq){ public ResultBean<PagerVo<WmsInventoryCheckbillVo>> listPage(@RequestBody PagerQuery<WmsInventoryCheckbillQuery> pq) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillVo> pv = wmsInventoryCheckbillService.listPageVo(pq); PagerVo<WmsInventoryCheckbillVo> pv = wmsInventoryCheckbillService.listPageVo(pq);
return rb.success().setData(pv); return rb.success().setData(pv);
} }
@ApiOperation("新建盘点单") @ApiOperation("新建盘点单")
@PostMapping("/save") @PostMapping("/save")
public ResultBean save(@RequestBody WmsInventoryCheckbillDto dto){ public ResultBean save(@RequestBody WmsInventoryCheckbillDto dto) {
return wmsInventoryCheckbillService.saveOrUpdateDto(dto); return wmsInventoryCheckbillService.saveOrUpdateDto(dto);
} }
@ApiOperation("生成盘点报告") @ApiOperation("生成盘点报告")
@PostMapping("/createReport") @PostMapping("/createReport")
public ResultBean createReport(@RequestParam("sid") String sid){ public ResultBean createReport(@RequestParam("sid") String sid) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
wmsInventoryCheckbillService.createReport(sid); wmsInventoryCheckbillService.createReport(sid);
return rb.success(); return rb.success();
} }
@ApiOperation("查看盘点报告") @ApiOperation("查看盘点报告")
@PostMapping("/viewReport") @PostMapping("/viewReport")
public ResultBean<WmsInventoryCheckbillReportDetailsVo> viewReport(@RequestParam("sid") String sid){ public ResultBean<WmsInventoryCheckbillReportDetailsVo> viewReport(@RequestParam("sid") String sid) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
WmsInventoryCheckbillReportDetailsVo wmsInventoryCheckbillReportDetailsVo = wmsInventoryCheckbillService.viewReport(sid); WmsInventoryCheckbillReportDetailsVo wmsInventoryCheckbillReportDetailsVo = wmsInventoryCheckbillService.viewReport(sid);
return rb.success().success().setData(wmsInventoryCheckbillReportDetailsVo); return rb.success().success().setData(wmsInventoryCheckbillReportDetailsVo);
} }
@ApiOperation("生成盘点报告PDF") @ApiOperation("生成盘点报告PDF")
@PostMapping("/createPdf") @PostMapping("/createPdf")
public ResultBean<String> createPdf(@RequestParam("sid") String sid){ public ResultBean<String> createPdf(@RequestParam("sid") String sid) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
String url = wmsInventoryCheckbillService.createPdf(sid); String url = wmsInventoryCheckbillService.createPdf(sid);
return rb.success().success().setData(url); return rb.success().success().setData(url);
} }
@ApiOperation("根据sid批量删除") @ApiOperation("根据sid批量删除")
@DeleteMapping("/delBySids") @DeleteMapping("/delBySids")
public ResultBean delBySids(@RequestBody String[] sids){ public ResultBean delBySids(@RequestBody String[] sids) {
return wmsInventoryCheckbillService.delAll(sids); return wmsInventoryCheckbillService.delAll(sids);
} }
@ApiOperation("盘点-查看库位盘点列表") @ApiOperation("盘点-查看库位盘点列表")
@PostMapping("/detailRackPageList") @PostMapping("/detailRackPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillDetailRackPageListVo>> detailRackPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailRackPageListQuery> pq){ public ResultBean<PagerVo<WmsInventoryCheckbillDetailRackPageListVo>> detailRackPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailRackPageListQuery> pq) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillDetailRackPageListVo> pv = wmsInventoryCheckbillService.detailRackPageList(pq); PagerVo<WmsInventoryCheckbillDetailRackPageListVo> pv = wmsInventoryCheckbillService.detailRackPageList(pq);
return rb.success().setData(pv); return rb.success().setData(pv);
} }
@ApiOperation("盘点-查看商品盘点列表") @ApiOperation("盘点-查看商品盘点列表")
@PostMapping("/detailGoodPageList") @PostMapping("/detailGoodPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillDetailGoodPageListVo>> detailGoodPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailGoodPageListQuery> pq){ public ResultBean<PagerVo<WmsInventoryCheckbillDetailGoodPageListVo>> detailGoodPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailGoodPageListQuery> pq) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillDetailGoodPageListVo> pv = wmsInventoryCheckbillService.detailGoodPageList(pq); PagerVo<WmsInventoryCheckbillDetailGoodPageListVo> pv = wmsInventoryCheckbillService.detailGoodPageList(pq);
return rb.success().setData(pv); return rb.success().setData(pv);
} }
@ApiOperation("查看库位商品盘点列表") @ApiOperation("查看库位商品盘点列表")
@PostMapping("/detailRackGoodPageList") @PostMapping("/detailRackGoodPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillDetailRackGoodPageListVo>> detailRackGoodPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailRackGoodPageListQuery> pq){ public ResultBean<PagerVo<WmsInventoryCheckbillDetailRackGoodPageListVo>> detailRackGoodPageList(@RequestBody PagerQuery<WmsInventoryCheckbillDetailRackGoodPageListQuery> pq) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillDetailRackGoodPageListVo> pv = wmsInventoryCheckbillService.detailRackGoodPageList(pq); PagerVo<WmsInventoryCheckbillDetailRackGoodPageListVo> pv = wmsInventoryCheckbillService.detailRackGoodPageList(pq);
return rb.success().setData(pv); return rb.success().setData(pv);
} }
/*********************************************************移动端************************************************************/ /*********************************************************移动端************************************************************/
@ApiOperation("app-盘点-查看库位盘点列表") @ApiOperation("app-盘点-查看库位盘点列表")
@PostMapping("/appDetailRackPageList") @PostMapping("/appDetailRackPageList")
public ResultBean<PagerVo<WmsInventoryCheckbillPageVo>> appDetailRackPageList(@RequestBody PagerQuery<WmsInventoryCheckbillPageQuery> pq){ public ResultBean<PagerVo<WmsInventoryCheckbillPageVo>> appDetailRackPageList(@RequestBody PagerQuery<WmsInventoryCheckbillPageQuery> pq) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
PagerVo<WmsInventoryCheckbillPageVo> pv = wmsInventoryCheckbillService.appDetailRackPageList(pq); PagerVo<WmsInventoryCheckbillPageVo> pv = wmsInventoryCheckbillService.appDetailRackPageList(pq);
return rb.success().setData(pv); return rb.success().setData(pv);
} }
@ApiOperation("办理/扫码保存") @ApiOperation("办理/扫码保存")
@PostMapping("/saveInventoryInfo") @PostMapping("/saveInventoryInfo")
@ResponseBody @ResponseBody
ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto){ ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto) {
return wmsInventoryCheckbillService.saveInventoryInfo(dto); return wmsInventoryCheckbillService.saveInventoryInfo(dto);
}; }
/*********************************************************流程************************************************************/ @ApiOperation("扫描商品码")
@GetMapping("/scan")
@ApiOperation("提交") @ResponseBody
@PostMapping("/submitApply") public ResultBean<HandleBean> scan(@RequestParam("sid") String sid, @RequestParam("content") String content, @RequestParam("houseSid") String houseSid) {
public ResultBean submitApply(@Valid @RequestBody SubmitInventoryCheckDto dto) { return wmsInventoryCheckbillService.scan(sid, content, houseSid);
return wmsInventoryCheckbillService.submitApply(dto); }
}
/*********************************************************流程************************************************************/
@ApiOperation(value = "办理(同意)")
@PostMapping("/complete") @ApiOperation("提交")
public ResultBean complete(@Valid @RequestBody CompleteInventoryCheckDto query) { @PostMapping("/submitApply")
BusinessVariables bv = new BusinessVariables(); public ResultBean submitApply(@Valid @RequestBody SubmitInventoryCheckDto dto) {
BeanUtil.copyProperties(query, bv); return wmsInventoryCheckbillService.submitApply(dto);
bv.setModelId(""); }
return wmsInventoryCheckbillService.complete(bv);
} @ApiOperation(value = "办理(同意)")
@PostMapping("/complete")
@ApiOperation(value = "获取上一个环节") public ResultBean complete(@Valid @RequestBody CompleteInventoryCheckDto query) {
@GetMapping(value = "/getPreviousNodesForReject") BusinessVariables bv = new BusinessVariables();
ResultBean<List<InventoryCheckNodeVo>> getPreviousNodesForReject(@Valid @SpringQueryMap InventoryCheckNodeQuery query) { BeanUtil.copyProperties(query, bv);
return wmsInventoryCheckbillService.getPreviousNodesForReject(query); bv.setModelId("");
} return wmsInventoryCheckbillService.complete(bv);
}
@ApiOperation(value = "获取下一个环节")
@GetMapping(value = "/getNextNodesForSubmit") @ApiOperation(value = "获取上一个环节")
ResultBean<List<InventoryCheckNodeVo>> getNextNodesForSubmit(@Valid @SpringQueryMap InventoryCheckNodeQuery query) { @GetMapping(value = "/getPreviousNodesForReject")
return wmsInventoryCheckbillService.getNextNodesForSubmit(query); ResultBean<List<InventoryCheckNodeVo>> getPreviousNodesForReject(@Valid @SpringQueryMap InventoryCheckNodeQuery query) {
} return wmsInventoryCheckbillService.getPreviousNodesForReject(query);
}
@ApiOperation(value = "驳回任务")
@PostMapping(value = "/reject") @ApiOperation(value = "获取下一个环节")
public ResultBean taskReject(@Valid @RequestBody InventoryCheckTaskQuery query) { @GetMapping(value = "/getNextNodesForSubmit")
return wmsInventoryCheckbillService.taskReject(query); ResultBean<List<InventoryCheckNodeVo>> getNextNodesForSubmit(@Valid @SpringQueryMap InventoryCheckNodeQuery query) {
} return wmsInventoryCheckbillService.getNextNodesForSubmit(query);
}
@ApiOperation(value = "撤回流程")
@PostMapping(value = "/revokeProcess") @ApiOperation(value = "驳回任务")
public ResultBean revokeProcess(@Valid @RequestBody InventoryCheckTaskQuery query) { @PostMapping(value = "/reject")
return wmsInventoryCheckbillService.revokeProcess(query); public ResultBean taskReject(@Valid @RequestBody InventoryCheckTaskQuery query) {
} return wmsInventoryCheckbillService.taskReject(query);
}
@ApiOperation(value = "终止任务")
@PostMapping(value = "/breakProcess") @ApiOperation(value = "撤回流程")
public ResultBean breakProcess(@Valid @RequestBody InventoryCheckTaskQuery query) { @PostMapping(value = "/revokeProcess")
return wmsInventoryCheckbillService.breakProcess(query); public ResultBean revokeProcess(@Valid @RequestBody InventoryCheckTaskQuery query) {
} return wmsInventoryCheckbillService.revokeProcess(query);
}
@ApiOperation(value = "加签")
@PostMapping(value = "/delegate") @ApiOperation(value = "终止任务")
@ResponseBody @PostMapping(value = "/breakProcess")
public ResultBean delegate(@RequestBody InventoryCheckDelegateQuery query) { public ResultBean breakProcess(@Valid @RequestBody InventoryCheckTaskQuery query) {
return wmsInventoryCheckbillService.delegate(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.wmsinventory.WmsInventoryService;
import com.yxt.wms.biz.inventory.wmsinventorycheckbill.flowable.*; import com.yxt.wms.biz.inventory.wmsinventorycheckbill.flowable.*;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.*; 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.WmsInventoryCheckbillGoodsDto;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageQuery; import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageQuery;
import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo; import com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillPageVo;
import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.*; 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.BusinessVariables;
import com.yxt.wms.feign.flowable.flow.FlowableFeign; import com.yxt.wms.feign.flowable.flow.FlowableFeign;
import com.yxt.wms.feign.flowable.flow.ProcDefEnum; import com.yxt.wms.feign.flowable.flow.ProcDefEnum;
@ -106,6 +108,8 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor
@Autowired @Autowired
private WmsInventoryService wmsInventoryService; private WmsInventoryService wmsInventoryService;
@Autowired @Autowired
private WmsInventoryRecordService wmsInventoryRecordService;
@Autowired
private WmsWarehouseRackService wmsWarehouseRackService; private WmsWarehouseRackService wmsWarehouseRackService;
@Autowired @Autowired
private WmsWarehouseAreaService wmsWarehouseAreaService; private WmsWarehouseAreaService wmsWarehouseAreaService;
@ -827,4 +831,30 @@ public class WmsInventoryCheckbillService extends MybatisBaseService<WmsInventor
wmsInventoryCheckbillDetailService.saveInventoryInfo(dto); wmsInventoryCheckbillDetailService.saveInventoryInfo(dto);
return rb.success(); 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.metadata.IPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants; 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.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillGoodsDto;
import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo; import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo;
import org.apache.ibatis.annotations.Delete; 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 saveInventoryInfoPY(@Param("dto") WmsInventoryCheckbillGoodsDto dto,@Param("pyCount") BigDecimal pyCount);
void saveInventoryInfoPK(@Param("dto") WmsInventoryCheckbillGoodsDto dto,@Param("pkCount") BigDecimal pkCount); 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 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 wms_inventory_checkbill_detail set lossCount = #{dto.badNum},realCount = #{dto.num},profitCount = 0,loseCount = #{pkCount},remarks = #{dto.remarks} where sid = #{dto.sid}
</update> </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> </mapper>

87
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; package com.yxt.wms.biz.inventory.wmsinventorycheckbilldetail;
import cn.hutool.core.bean.BeanUtil; 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.wmsinventorycheckbilldetail.app.WmsInventoryCheckbillGoodsDto;
import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo; import com.yxt.wms.biz.inventory.wmsinventorycheckbillreport.WmsInventoryCheckbillReportSumVo;
import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.service.MybatisBaseService;
@ -52,50 +53,54 @@ import java.util.List;
@Service @Service
public class WmsInventoryCheckbillDetailService extends MybatisBaseService<WmsInventoryCheckbillDetailMapper, WmsInventoryCheckbillDetail> { public class WmsInventoryCheckbillDetailService extends MybatisBaseService<WmsInventoryCheckbillDetailMapper, WmsInventoryCheckbillDetail> {
public void insertByDto(WmsInventoryCheckbillDetailDto dto){ public void insertByDto(WmsInventoryCheckbillDetailDto dto) {
WmsInventoryCheckbillDetail entity = new WmsInventoryCheckbillDetail(); WmsInventoryCheckbillDetail entity = new WmsInventoryCheckbillDetail();
BeanUtil.copyProperties(dto, entity, "id", "sid"); BeanUtil.copyProperties(dto, entity, "id", "sid");
baseMapper.insert(entity); baseMapper.insert(entity);
} }
public WmsInventoryCheckbillDetailDetailsVo fetchDetailsVoBySid(String sid){ public WmsInventoryCheckbillDetailDetailsVo fetchDetailsVoBySid(String sid) {
WmsInventoryCheckbillDetail entity = fetchBySid(sid); WmsInventoryCheckbillDetail entity = fetchBySid(sid);
WmsInventoryCheckbillDetailDetailsVo vo = new WmsInventoryCheckbillDetailDetailsVo(); WmsInventoryCheckbillDetailDetailsVo vo = new WmsInventoryCheckbillDetailDetailsVo();
BeanUtil.copyProperties(entity, vo); BeanUtil.copyProperties(entity, vo);
return vo; return vo;
} }
public void delByMainSid(String dtoSid) { public void delByMainSid(String dtoSid) {
baseMapper.delByMainSid(dtoSid); baseMapper.delByMainSid(dtoSid);
} }
public List<WmsInventoryCheckbillDetailDetailsVo> selByMainSid(String billSid) { public List<WmsInventoryCheckbillDetailDetailsVo> selByMainSid(String billSid) {
return baseMapper.selByMainSid(billSid); return baseMapper.selByMainSid(billSid);
} }
public List<WmsInventoryCheckbillReportSumVo> reportSum(String sid, String sumType) { public List<WmsInventoryCheckbillReportSumVo> reportSum(String sid, String sumType) {
List<WmsInventoryCheckbillReportSumVo> wmsInventoryCheckbillReportSumVos = new ArrayList<>(); List<WmsInventoryCheckbillReportSumVo> wmsInventoryCheckbillReportSumVos = new ArrayList<>();
if ("total".equals(sumType)){ if ("total".equals(sumType)) {
WmsInventoryCheckbillReportSumVo wmsInventoryCheckbillReportSumVo = baseMapper.reportSumTotal(sid); WmsInventoryCheckbillReportSumVo wmsInventoryCheckbillReportSumVo = baseMapper.reportSumTotal(sid);
wmsInventoryCheckbillReportSumVos.add(wmsInventoryCheckbillReportSumVo); wmsInventoryCheckbillReportSumVos.add(wmsInventoryCheckbillReportSumVo);
}else if ("ware".equals(sumType)){ } else if ("ware".equals(sumType)) {
wmsInventoryCheckbillReportSumVos = baseMapper.reportSumWare(sid); wmsInventoryCheckbillReportSumVos = baseMapper.reportSumWare(sid);
}else if ("area".equals(sumType)){ } else if ("area".equals(sumType)) {
wmsInventoryCheckbillReportSumVos = baseMapper.reportSumArea(sid); wmsInventoryCheckbillReportSumVos = baseMapper.reportSumArea(sid);
} }
return wmsInventoryCheckbillReportSumVos; return wmsInventoryCheckbillReportSumVos;
} }
public void saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) { public void saveInventoryInfo(WmsInventoryCheckbillGoodsDto dto) {
int i = new BigDecimal(dto.getLockNum()).compareTo(new BigDecimal(dto.getNum())); int i = new BigDecimal(dto.getLockNum()).compareTo(new BigDecimal(dto.getNum()));
if (i < 0){//盘盈 if (i < 0) {//盘盈
BigDecimal pyCount = new BigDecimal(dto.getNum()).subtract(new BigDecimal(dto.getLockNum())); BigDecimal pyCount = new BigDecimal(dto.getNum()).subtract(new BigDecimal(dto.getLockNum()));
baseMapper.saveInventoryInfoPY(dto,pyCount); baseMapper.saveInventoryInfoPY(dto, pyCount);
}else if (i > 0){//盘亏 } else if (i > 0) {//盘亏
BigDecimal pkCount = new BigDecimal(dto.getLockNum()).subtract(new BigDecimal(dto.getNum())); BigDecimal pkCount = new BigDecimal(dto.getLockNum()).subtract(new BigDecimal(dto.getNum()));
baseMapper.saveInventoryInfoPK(dto,pkCount); baseMapper.saveInventoryInfoPK(dto, pkCount);
}else { } else {
baseMapper.saveInventoryInfoZC(dto,dto.getNum()); 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> selBySourceSid(String sid);
List<WmsInventoryRecord> selBySourceSidAndSkuCode(@Param("sid") String sid,@Param("goodsSkuCode") String goodsSkuCode); 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 WHERE
r.sourceBillSid = #{sid} and r.goodsSkuCode = #{goodsSkuCode} r.sourceBillSid = #{sid} and r.goodsSkuCode = #{goodsSkuCode}
</select> </select>
<select id="selByGoodsID" resultType="java.lang.String">
SELECT
billNo
FROM
wms_inventory_record
WHERE billType = '0'
AND goodsID = #{content}
</select>
</mapper> </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) { public List<WmsInventoryRecord> selBySourceSidAndSkuCode(String sid, String goodsSkuCode) {
return baseMapper.selBySourceSidAndSkuCode(sid,goodsSkuCode); return baseMapper.selBySourceSidAndSkuCode(sid,goodsSkuCode);
} }
public String selByGoodsID(String content) {
return baseMapper.selByGoodsID(content);
}
} }

Loading…
Cancel
Save