Эх сурвалжийг харах

[思拓微WMS]领料申请以及客户码采集提交

caosy 2 долоо хоног өмнө
parent
commit
78912f84e8

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

@@ -435,4 +435,20 @@ public class PdaOutMaterialController extends BaseApiController {
 	public ModelMap endProdOut(int id) throws IOException {
 		return success(pdaOutMaterialService.endProdOut(id));
 	}
+
+
+
+	/**
+	 * 采集客户码接口
+	 * @return
+	 */
+	@RequestMapping(value="/khbarcode.action",method = RequestMethod.POST)
+	public ModelMap khbarcode(String barcode,String ids,boolean ifcancel){
+		if (ids == null||barcode == null) {
+			throw new APIErrorException(APIErrorCode.ILLEGAL_ARGUMENTS, "请传递必要的参数");
+		}
+		pdaOutMaterialService.khbarcode(barcode,ids,ifcancel);
+		return success();
+	}
+
 }

+ 2 - 0
src/com/uas/pda/service/PdaOutMaterialService.java

@@ -69,4 +69,6 @@ public interface PdaOutMaterialService {
 	Map<String, Object> startProdOut(int id) throws IOException;
 
 	String endProdOut(int id) throws IOException;
+
+	void khbarcode(String barcode,String ids,boolean ifcancel);
 }

+ 31 - 0
src/com/uas/pda/service/impl/PdaOutMaterialServiceImpl.java

@@ -8,6 +8,7 @@ import com.uas.erp.core.support.SystemSession;
 import com.uas.erp.dao.BaseDao;
 import com.uas.erp.dao.SqlRowList;
 import com.uas.erp.dao.common.VerifyApplyDao;
+import com.uas.erp.model.UserSession;
 import com.uas.pda.dao.PdaCommonDao;
 import com.uas.pda.service.PdaBatchService;
 import com.uas.pda.service.PdaMsdService;
@@ -2066,4 +2067,34 @@ public class PdaOutMaterialServiceImpl implements PdaOutMaterialService {
 			}
 		}
 	}
+
+
+
+	@Override
+	public void khbarcode(String barcode, String ids, boolean ifcancel) {
+      SqlRowList rs = null;
+        if(ifcancel)
+		{
+			if (!baseDao.checkIf("barcodeio"," bi_barcode = '"+barcode+"' and bi_type = '客户码' and bi_piid = '"+ids+"' "))
+			{
+               throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND,"客户码:"+barcode+"未在此单采集,无法取消");
+			}else
+			{
+				baseDao.execute("delete barcodeio where bi_barcode = '"+barcode+"' and bi_type = '客户码' and bi_piid = '"+ids+"'  ");
+			}
+		}else
+		{
+			if (baseDao.checkIf("barcodeio"," bi_barcode = '"+barcode+"' and bi_type = '客户码' "))
+			{
+				rs = baseDao.queryForRowSet(" select * from barcodeio where bi_barcode = '"+barcode+"' and bi_type = '客户码'  ");
+				rs.next();
+				throw new APIErrorException(APIErrorCode.DATA_NOT_FOUND,"客户码:"+barcode+"已在"+rs.getString("bi_inoutno")+"采集,无法重复采集");
+			}else
+			{
+				baseDao.execute(" insert into barcodeio (bi_id,bi_barcode,bi_piid,bi_piclass,bi_inoutno,bi_inman,bi_indate,bi_type)" +
+						" select barcodeio_seq.nextval,'"+barcode+"',pi_id,pi_class,pi_inoutno,'"+ SystemSession.getUser().getEm_name() +"',sysdate,'客户码' from prodinout where pi_id = '"+ids+"' ");
+			}
+		}
+	}
+
 }

+ 1 - 1
src/com/uas/pdaio/service/Impl/PdaioInServiceImpl.java

@@ -530,7 +530,7 @@ public class PdaioInServiceImpl implements PdaioInService{
 
 	@Override
 	public List<Map<String, Object>> getWllist(String whcode) {
-		SqlRowList rs = baseDao.queryForRowSet(" select * from productWH  left join Product on pw_prodcode=pr_code left join warehouse on pw_whcode=wh_code" +
+		SqlRowList rs = baseDao.queryForRowSet(" select PW_PRODCODE,PW_ONHAND,PR_DETAIL,PR_SPEC from productWH  left join Product on pw_prodcode=pr_code left join warehouse on pw_whcode=wh_code" +
 				" where  nvl(pw_onhand,0)>0  and pw_whcode = ? ",whcode);
 		return rs.getResultList();
 	}