增加 物料质检入库

master
wanghao 4 months ago
parent 2189c0f53b
commit 9a3bad8bd1

@ -11,6 +11,7 @@ import org.dromara.wms.service.*;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@RequiredArgsConstructor
@ -24,6 +25,7 @@ public class WmsPdaApiController extends BaseController {
private final IWmsBaseLocationService baseLocationService;
private final IWmsHppStorePlaceService wmsHppStorePlaceService;
private final IWmsBaseAreaService baseAreaService;
private final IWmsInstockPrintService wmsInstockPrintService;
/**
* 退-
@ -77,7 +79,7 @@ public class WmsPdaApiController extends BaseController {
public R<WmsInstockPrintVo> inSelectCode(String code, String type) {
WmsInstockPrintVo wmsInstockPrintVo = apiService.inSelectCode(code);
if (wmsInstockPrintVo == null) {
R.fail();
return R.fail("条码扫描错误");
}
// 推荐库位
String locationCode = null;
@ -89,7 +91,7 @@ public class WmsPdaApiController extends BaseController {
return R.ok(wmsInstockPrintVo);
}
private final IWmsInstockPrintService wmsInstockPrintService;
@PostMapping("/raw/inSubmit")
public R<Void> inSubmit(@RequestBody WmsInstockPrintVo vo) {
@ -105,20 +107,31 @@ private final IWmsInstockPrintService wmsInstockPrintService;
if (wmsBaseArea == null || !wmsBaseArea.getAreaType().equals("9")) {
return R.fail("待检物料放入待检区域");
}
WmsInstockPrintBo bo=new WmsInstockPrintBo();
WmsInstockPrintBo bo = new WmsInstockPrintBo();
bo.setInstockPrintId(vo.getInstockPrintId());
bo.setLocationId(vo.getLocationId());
bo.setInspectionType("1");
wmsInstockPrintService.updateByBo(bo);
} else if (vo.getTitle().equals("入库")) {
WmsInstockPrintBo bo = new WmsInstockPrintBo();
bo.setInstockPrintId(vo.getInstockPrintId());
bo.setLocationId(vo.getLocationId());
bo.setActualInboundTime(new Date());
bo.setInboundStatus("1");
wmsInstockPrintService.updateByBo(bo);
}else if (vo.getTitle().equals("入库")){
vo.setWarehouseId(wmsBaseLocationVo.getWarehouseId());
} else if (vo.getTitle().equals("AGV入库")){
vo.setLocationId(wmsBaseLocationVo.getWarehouseId());
Boolean result = apiService.inSubmit(vo);
return result ? R.ok() : R.fail();
} else if (vo.getTitle().equals("AGV入库")) {
WmsInstockPrintBo bo = new WmsInstockPrintBo();
bo.setInstockPrintId(vo.getInstockPrintId());
bo.setLocationId(vo.getLocationId());
bo.setInboundStatus("2");
bo.setAgvStatus("1");
wmsInstockPrintService.updateByBo(bo);
// vo.setLocationId(wmsBaseLocationVo.getWarehouseId());
}
Boolean result = apiService.inSubmit(vo);
return result ? R.ok() : R.fail();
return R.ok();
}
/**

@ -148,6 +148,6 @@ public class WmsInstockPrint{
@TableField(exist = false)
private String materialCategoryName;//字段映射
private String inspectionType;
}

@ -157,6 +157,7 @@ public class WmsInstockPrintVo implements Serializable {
* (0,1)
*/
private String inspectionRequest;
private String inspectionType;
// PDA 操作标题
private String title;

@ -15,7 +15,7 @@ import org.springframework.stereotype.Repository;
@Repository
public interface WmsInstockPrintMapper extends BaseMapperPlus<WmsInstockPrint, WmsInstockPrintVo> {
@Select("select top 1 material_spe,batch_code,material_code,material_name,unit_name, " +
" material_id,instock_print_id,apportion_qty,instock_code,material_qty " +
" material_id,instock_print_id,apportion_qty,instock_code,material_qty,inspection_request,inspection_type " +
"from wms_instock_print where batch_code=#{code}")
WmsInstockPrintVo inSelectCode(String code);
}

@ -209,6 +209,8 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
// 插入库存
WmsInventory inventory = new WmsInventory();
BeanUtils.copyProperties(vo, inventory);
inventory.setWarehouseId(String.valueOf(vo.getWarehouseId()));
inventory.setStoreId(vo.getWarehouseId());
inventory.setInventoryQty(BigDecimal.valueOf(vo.getInstockQty()));
wmsInventoryMapper.insert(inventory);
} else {

Loading…
Cancel
Save