浏览代码

[百岗WMS]AGV回传接口新增

caosy 2 周之前
父节点
当前提交
8ca4966313

+ 16 - 0
src/com/uas/mes/api/pda/PdaInMaterialController.java

@@ -213,4 +213,20 @@ public class PdaInMaterialController extends BaseApiController {
 		}
 		return success(pdaInMaterialService.saveBarAcceptCodeByParse(barcode, lotno, datecode, datas));
 	}
+
+	@RequestMapping(value = "/agvuplocation.action", method = RequestMethod.POST)
+	public ModelMap agvuplocation(String barcode,String location){
+		if (barcode == null||location==null) {
+			throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "请勿传空数据");
+		}
+		return success(pdaInMaterialService.agvuplocation(barcode,location));
+	}
+
+	@RequestMapping(value = "/agvreturn.action", method = RequestMethod.POST)
+	public ModelMap agvreturn(String barcode,String agvlocation){
+		if (barcode == null||agvlocation==null) {
+			throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "请勿传空数据");
+		}
+		return success(pdaInMaterialService.agvreturn(barcode,agvlocation));
+	}
 }

+ 7 - 0
src/com/uas/pda/service/PdaInMaterialService.java

@@ -33,4 +33,11 @@ public interface PdaInMaterialService {
 	Map<String, Object>  getBarAcceptCodeByParse(String barcode, String datas);
 
 	String  saveBarAcceptCodeByParse(String barcode, String lotno, String datecode, String datas);
+
+
+	String  agvuplocation(String barcode,String location);
+
+
+	String agvreturn(String barcode,String agvlocation);
+
 }

+ 19 - 0
src/com/uas/pda/service/impl/PdaInMaterialServiceImpl.java

@@ -870,4 +870,23 @@ public  class PdaInMaterialServiceImpl implements PdaInMaterialService {
 		str.append("\n"+"名称规格:"+rs.getString("pr_detail")+"");
 		return str.toString();
 	}
+
+	@Override
+	public String agvuplocation(String barcode, String location) {
+		SqlRowList rs = baseDao.queryForRowSet("select * from barcode left join product on pr_code = bar_prodcode where bar_code = ? and bar_status = 1",barcode);
+		if (!rs.next())
+			throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND,"条码"+barcode+"不存在");
+		if(baseDao.checkIf("productlocation","pl_code = '"+location+"' and pl_type is not null ")
+				&baseDao.checkIf("barcode","bar_location = '"+location+"' and bar_status = '1' "))
+		{
+			throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND,"存在条码属于仓位:"+location);
+		}
+		baseDao.execute("update barcode set bar_location = ? where bar_code = ?",location,barcode);
+		return null;
+	}
+
+	@Override
+	public String agvreturn(String barcode, String agvlocation) {
+		return null;
+	}
 }