|
|
@@ -230,14 +230,22 @@ public class MESServiceImpl implements MESService {
|
|
|
Employee employee = baseDao.getJdbcTemplate().queryForObject("select * from employee where em_code=?",
|
|
|
new BeanPropertyRowMapper<Employee>(Employee.class), "mes");
|
|
|
JSONArray array = data.get("detail");
|
|
|
- if(array!=null&&array.size()>0){
|
|
|
- String macode = StringUtil.valueOf(JSON.parseObject(StringUtil.nvl(array.get(0), "{}")).get("FICMOBillNo"));
|
|
|
- Object[] data1 = baseDao.getFieldsDataByCondition("Make", "ma_tasktype,ma_id", "ma_code in ('" + macode + "')");
|
|
|
- if (data1!=null&&data1.length>0) {
|
|
|
- ma_tasktype = StringUtil.nvl(data1[0], "");
|
|
|
- ma_id = Integer.parseInt(StringUtil.nvl(data1[1], "0"));
|
|
|
- }else {
|
|
|
- return ApiResponse.failRsp("10077", request.getHeader("RequestId"), "工单在ERP不存在,请核对!");
|
|
|
+ if(array!=null&&array.size()>0) {
|
|
|
+ for (int i = 0; i < array.size(); i++) {
|
|
|
+ JSONObject json = JSON.parseObject(StringUtil.nvl(array.get(i), ""));
|
|
|
+ String macode = StringUtil.nvl(json.get("FICMOBillNo"),"");
|
|
|
+ Object[] data1 = baseDao.getFieldsDataByCondition("Make", "ma_tasktype,ma_id", "ma_code in ('" + macode + "')");
|
|
|
+ if (data1 != null && data1.length > 0) {
|
|
|
+ ma_tasktype = StringUtil.nvl(data1[0], "");
|
|
|
+ ma_id = Integer.parseInt(StringUtil.nvl(data1[1], "0"));
|
|
|
+ } else {
|
|
|
+ return ApiResponse.failRsp("10077", request.getHeader("RequestId"), "工单在ERP不存在,请核对!");
|
|
|
+ }
|
|
|
+ float fauxqty = json.get("Fauxqty") == null ? 0 : Float.parseFloat(json.get("Fauxqty").toString());
|
|
|
+ String msg = baseDao.callProcedure("USER_WGRKCHECK", new Object[]{ma_id, fauxqty});
|
|
|
+ if (msg != null && !msg.trim().equals("")){
|
|
|
+ return ApiResponse.failRsp("10078",request.getHeader("RequestId"),msg);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
for (int i = 0; i <jsonArray.size() ; i++) {
|
|
|
@@ -1509,7 +1517,7 @@ public class MESServiceImpl implements MESService {
|
|
|
SQLStr = "select pi_statuscode from prodinout where pi_id=" + rs.getInt("pi_id") + " and pi_statuscode='POSTED' ";
|
|
|
rs0 = baseDao.queryForRowSet(SQLStr);
|
|
|
if (rs0.next()) {
|
|
|
- return Outpiclass + ":" + rs.getString("pi_inoutno") + "过账成功!";
|
|
|
+ return null;
|
|
|
} else {
|
|
|
return Outpiclass + ":" + rs.getString("pi_inoutno") + "过账不成功!";
|
|
|
}
|