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. 5
      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. 10
      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. 5
      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);
} }

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

@ -56,4 +56,9 @@ public class WmsInventoryCheckbillRest implements WmsInventoryCheckbillFeign {
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);
} }

10
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;
@ -150,7 +151,14 @@ public class WmsInventoryCheckbillRest {
@ResponseBody @ResponseBody
ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto) { ResultBean saveInventoryInfo(@RequestBody WmsInventoryCheckbillGoodsDto dto) {
return wmsInventoryCheckbillService.saveInventoryInfo(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);
}
/*********************************************************流程************************************************************/ /*********************************************************流程************************************************************/

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>

5
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;
@ -98,4 +99,8 @@ public class WmsInventoryCheckbillDetailService extends MybatisBaseService<WmsIn
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