|
|
@@ -2,6 +2,7 @@ package com.uas.eis.serviceImpl;
|
|
|
|
|
|
import com.uas.eis.core.config.SpObserver;
|
|
|
import com.uas.eis.dao.BaseDao;
|
|
|
+import com.uas.eis.dao.SqlRowList;
|
|
|
import com.uas.eis.entity.ErrorMessage;
|
|
|
import com.uas.eis.exception.ApiSystemException;
|
|
|
import com.uas.eis.sdk.entity.ApiResult;
|
|
|
@@ -243,7 +244,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ApiResult<List<Map<String,Object>>> getQRCode(String data) {
|
|
|
+ public ApiResult<Map<String,Object>> getQRCode(String data) {
|
|
|
Map<Object, Object> map = BaseUtil.parseFormStoreToMap(data);
|
|
|
String veCode = StringUtil.nvl(map.get("veCode"), "");
|
|
|
if ("".equals(veCode)){
|
|
|
@@ -266,9 +267,14 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
return ApiResponse.failRsp("10015","请确认获取条码的具体时间!");
|
|
|
}
|
|
|
if (baseDao.checkIf("ProdQRCode","qr_vecode='" + veCode + "' and qr_prodcode='" + prodCode + "' and qr_machinecode='" + machineCode + "' and qr_version='" + version + "' and to_char(qr_date,'yyyy-MM-dd')='"+indate+"' and nvl(qr_isobtained,0)=0")) {
|
|
|
- List<Map<String, Object>> maps = baseDao.queryForList("select to_char(qr_date,'yyyy-MM-dd') qr_date, qr_prodcode, qr_vecode, qr_version, qr_machinecode, qr_qty, qr_serianum, qr_code from ProdQRCode where qr_vecode='" + veCode + "' and qr_prodcode='" + prodCode + "' and qr_machinecode='" + machineCode + "' and qr_version='" + version + "' and to_char(qr_date,'yyyy-MM-dd')='"+indate+"' and nvl(qr_isobtained,0)=0");
|
|
|
- baseDao.execute("update ProdQRCode set qr_isobtained=-1 where qr_vecode='" + veCode + "' and qr_prodcode='" + prodCode + "' and qr_machinecode='" + machineCode + "' and qr_version='" + version + "' and to_char(qr_date,'yyyy-MM-dd')='"+indate+"' and nvl(qr_isobtained,0)=0");
|
|
|
- return ApiResponse.successRsp("0", "Success", "", maps);
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select * from ProdQRCode where qr_vecode='" + veCode + "' and qr_prodcode='" + prodCode + "' and qr_machinecode='" + machineCode + "' and qr_version='" + version + "' and to_char(qr_date,'yyyy-MM-dd')='" + indate + "' and nvl(qr_isobtained,0)=0 order by qr_id");
|
|
|
+ if (rs.next()) {
|
|
|
+ int qrId = rs.getGeneralInt("qr_id");
|
|
|
+ List<Map<String, Object>> maps = baseDao.queryForList("select to_char(qr_date,'yyyy-MM-dd') qr_date, qr_prodcode, qr_vecode, qr_version, qr_machinecode, qr_qty, qr_serianum, qr_code from ProdQRCode where qr_id=" + qrId);
|
|
|
+ baseDao.execute("update ProdQRCode set qr_isobtained=-1 where qr_vecode='" + veCode + "' and qr_prodcode='" + prodCode + "' and qr_machinecode='" + machineCode + "' and qr_version='" + version + "' and to_char(qr_date,'yyyy-MM-dd')='" + indate + "' and nvl(qr_isobtained,0)=0");
|
|
|
+ return ApiResponse.successRsp("0", "Success", "", maps.get(0));
|
|
|
+ }else
|
|
|
+ return ApiResponse.failRsp("10015","获取失败,请检查参数!");
|
|
|
}else
|
|
|
return ApiResponse.failRsp("10015","获取失败,请检查参数!");
|
|
|
}
|