Ver Fonte

修改仓库增加对应关系

koul há 4 anos atrás
pai
commit
7add2b910c

+ 47 - 20
src/main/java/com/uas/eis/service/Impl/MESServiceImpl.java

@@ -41,8 +41,8 @@ public class MESServiceImpl implements MESService {
         if ("".equals(mesCode)){
         if ("".equals(mesCode)){
             return ApiResponse.failRsp("10011",request.getHeader("RequestId"),"MES编号不能为空!");
             return ApiResponse.failRsp("10011",request.getHeader("RequestId"),"MES编号不能为空!");
         }
         }
-        VerifyApply verifyApply = baseDao.getJdbcTemplate().queryForObject("select va_id,va_mescode,va_code,to_char(va_date,'yyyy-MM-dd HH24:mi:ss') va_date,va_vendcode,va_vendname,va_currency,va_rate,va_paymentscode,va_payments,va_transport,va_sendcode,va_emcode,va_emname,va_whcode,va_whname,va_departmentcode,va_department,va_recorder,nvl(va_cop,'BYT') va_cop,va_remark,va_ancode,va_factory,0 version,va_custcode,va_custname,va_type,va_pucode,case when nvl(va_pucode,' ')=' ' then 0 else (select pu_id from purchase where pu_code=va_pucode) end pu_id,va_status,1 posted,to_char(va_auditdate,'yyyy-MM-dd HH24:mi:ss') va_auditdate,va_auditman " +
-                        "from VerifyApply where va_statuscode='AUDITED' and va_mescode=?",
+        VerifyApply verifyApply = baseDao.getJdbcTemplate().queryForObject("select va_id,va_mescode,va_code,to_char(va_date,'yyyy-MM-dd HH24:mi:ss') va_date,va_vendcode,va_vendname,va_currency,va_rate,va_paymentscode,va_payments,va_transport,va_sendcode,va_emcode,va_emname,wh_mesc_user va_whcode,wh_mesn_user va_whname,va_departmentcode,va_department,va_recorder,nvl(va_cop,'BYT') va_cop,va_remark,va_ancode,va_factory,0 version,va_custcode,va_custname,va_type,va_pucode,case when nvl(va_pucode,' ')=' ' then 0 else (select pu_id from purchase where pu_code=va_pucode) end pu_id,va_status,1 posted,to_char(va_auditdate,'yyyy-MM-dd HH24:mi:ss') va_auditdate,va_auditman " +
+                        "from VerifyApply left join Warehouse on va_whcode=wh_code where va_statuscode='AUDITED' and va_mescode=?",
                 new BeanPropertyRowMapper<VerifyApply>(VerifyApply.class), mesCode);
                 new BeanPropertyRowMapper<VerifyApply>(VerifyApply.class), mesCode);
         if (verifyApply==null) {
         if (verifyApply==null) {
             return ApiResponse.failRsp("10012",request.getHeader("RequestId"),"单据未审核或不存在,请确认!");
             return ApiResponse.failRsp("10012",request.getHeader("RequestId"),"单据未审核或不存在,请确认!");
@@ -177,19 +177,23 @@ public class MESServiceImpl implements MESService {
             Map<Object, Object> map6 = JSONUtil.toMap(StringUtil.valueOf(jsonObject2.get("FFManagerID")));
             Map<Object, Object> map6 = JSONUtil.toMap(StringUtil.valueOf(jsonObject2.get("FFManagerID")));
             Map<Object, Object> map7 = JSONUtil.toMap(StringUtil.valueOf(jsonObject2.get("FSManagerID")));
             Map<Object, Object> map7 = JSONUtil.toMap(StringUtil.valueOf(jsonObject2.get("FSManagerID")));
             Map<Object, Object> map8 = JSONUtil.toMap(StringUtil.valueOf(jsonObject2.get("FBillerID")));
             Map<Object, Object> map8 = JSONUtil.toMap(StringUtil.valueOf(jsonObject2.get("FBillerID")));
+            String whcode = StringUtil.nvl(map4.get("FNumber"), "");
+            String whname = StringUtil.nvl(map4.get("FName"), "");
+            if ("".equals(whcode)){
+                return ApiResponse.failRsp("10073",request.getHeader("RequestId"),"MES仓库编号不能为空!");
+            }
+            int count = baseDao.getCount("select count(1) from Warehouse where wh_mesc_user='" + whcode + "'");
+            if (count<=0){
+                return ApiResponse.failRsp("10074",request.getHeader("RequestId"),"MES仓库编号在ERP没有对应关系,请联系管理员新增!");
+            }
+            Object[] warehouses = baseDao.getFieldsDataByCondition("Warehouse", "wh_code,wh_description", "wh_mesc_user='" + whcode + "'");
             id = baseDao.getSeqId("PRODINOUT_SEQ");
             id = baseDao.getSeqId("PRODINOUT_SEQ");
             code = baseDao.sGetMaxNumber("ProdInOut!Make!In", 2);
             code = baseDao.sGetMaxNumber("ProdInOut!Make!In", 2);
-            sqls.add("insert into prodinout (pi_id,pi_inoutno,pi_class,pi_date,pi_statuscode,pi_status,pi_whcode," +
-                    "pi_whname,pi_departmentcode,pi_departmentname,pi_emcode,pi_emname,pi_invostatuscode,pi_invostatus," +
-                    "pi_recordman,pi_recorddate,pi_printstatuscode,pi_printstatus) " +
-                    "values ("+id+",'"+code+"','完工入库单',to_date('"+jsonObject2.get("Fdate")+"','yyyy/MM/dd HH24:mi:ss'),'UNPOST'," +
-                    "'未过账','"+map4.get("FNumber")+"','"+map4.get("FName")+"','"+map5.get("FNumber")+"','"+map5.get("FName")+"','"+map6.get("FNumber")+"','"+map7.get("FName")+"','ENTERING','在录入'," +
-                    "'"+map8.get("FName")+"',to_date('"+jsonObject2.get("Fdate")+"','yyyy/MM/dd HH24:mi:ss'),'UNPRINT','未打印')");
+            sqls.add("insert into prodinout (pi_id,pi_inoutno,pi_class,pi_date,pi_statuscode,pi_status,pi_whcode,pi_whname,pi_departmentcode,pi_departmentname,pi_emcode,pi_emname,pi_invostatuscode,pi_invostatus,pi_recordman,pi_recorddate,pi_printstatuscode,pi_printstatus) values ("+id+",'"+code+"','完工入库单',to_date('"+jsonObject2.get("Fdate")+"','yyyy/MM/dd HH24:mi:ss'),'UNPOST'," + "'未过账','"+warehouses[0]+"','"+warehouses[1]+"','"+map5.get("FNumber")+"','"+map5.get("FName")+ "','"+map6.get("FNumber")+"','"+map7.get("FName")+"','ENTERING','在录入','"+map8.get("FName")+"',to_date('"+jsonObject2.get("Fdate")+"','yyyy/MM/dd HH24:mi:ss'),'UNPRINT','未打印')");
         }
         }
         JSONArray jsonArray1 = data.get("detail");
         JSONArray jsonArray1 = data.get("detail");
-        int detno=0;
+        int detno=1;
         for (int i = 0; i <jsonArray1.size() ; i++) {
         for (int i = 0; i <jsonArray1.size() ; i++) {
-            detno=i+1;
             Object obj = jsonArray1.get(i);
             Object obj = jsonArray1.get(i);
             JSONObject jsonObject3 = JSON.parseObject(StringUtil.nvl(obj, ""));
             JSONObject jsonObject3 = JSON.parseObject(StringUtil.nvl(obj, ""));
             Map<Object, Object> map11 = JSONUtil.toMap(StringUtil.valueOf(jsonObject3.get("FItemID")));
             Map<Object, Object> map11 = JSONUtil.toMap(StringUtil.valueOf(jsonObject3.get("FItemID")));
@@ -221,6 +225,7 @@ public class MESServiceImpl implements MESService {
                     "','"+map11.get("FNumber")+"','"+fBatchNo+"',"+fauxqty+",'"+fSecUnitID+"',"+fSecCoefficient+","+fSecQty+","+fAuxPlanPrice+","+fPlanAmount+","+fauxprice+"," +
                     "','"+map11.get("FNumber")+"','"+fBatchNo+"',"+fauxqty+",'"+fSecUnitID+"',"+fSecCoefficient+","+fSecQty+","+fAuxPlanPrice+","+fPlanAmount+","+fauxprice+"," +
                     ""+famount+",'"+map12.get("FNumber")+"','"+map12.get("FName")+"','"+fnote+"',to_date('"+fEntrySelfA0248+"'," +
                     ""+famount+",'"+map12.get("FNumber")+"','"+map12.get("FName")+"','"+fnote+"',to_date('"+fEntrySelfA0248+"'," +
                     "'yyyy-MM-dd HH24:mi:ss'),to_date('"+fPeriodDate+"','yyyy-MM-dd HH24:mi:ss'),'"+location+"','"+fICMOBillNo+"')");
                     "'yyyy-MM-dd HH24:mi:ss'),to_date('"+fPeriodDate+"','yyyy-MM-dd HH24:mi:ss'),'"+location+"','"+fICMOBillNo+"')");
+            detno++;
         }
         }
         baseDao.execute(sqls);
         baseDao.execute(sqls);
         return ApiResponse.successRsp("0",request.getHeader("RequestId"),"完工入库单:"+code+",请在ERP查看!");
         return ApiResponse.successRsp("0",request.getHeader("RequestId"),"完工入库单:"+code+",请在ERP查看!");
@@ -359,12 +364,17 @@ public class MESServiceImpl implements MESService {
             String whcode = StringUtil.nvl(map1.get("FNumber"), "");
             String whcode = StringUtil.nvl(map1.get("FNumber"), "");
             String whname = StringUtil.nvl(map1.get("FName"), "");
             String whname = StringUtil.nvl(map1.get("FName"), "");
             if ("".equals(whcode)){
             if ("".equals(whcode)){
-                return ApiResponse.failRsp("10033",request.getHeader("RequestId"),"仓库编号不能为空!");
+                return ApiResponse.failRsp("10034",request.getHeader("RequestId"),"MES仓库编号不能为空!");
+            }
+            int count = baseDao.getCount("select count(1) from Warehouse where wh_mesc_user='" + whcode + "'");
+            if (count<=0){
+                return ApiResponse.failRsp("10035",request.getHeader("RequestId"),"MES仓库编号在ERP没有对应关系,请联系管理员新增!");
             }
             }
+            Object[] warehouses = baseDao.getFieldsDataByCondition("Warehouse", "wh_code,wh_description", "wh_mesc_user='" + whcode + "'");
             sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
             sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
                     "pd_outqty,pd_whcode,pd_whname,pd_remark) " +
                     "pd_outqty,pd_whcode,pd_whname,pd_remark) " +
                     "values (PRODIODETAIL_SEQ.nextval,"+id+",'"+code+"','其它出库单',"+detno+",'"+itemNo+
                     "values (PRODIODETAIL_SEQ.nextval,"+id+",'"+code+"','其它出库单',"+detno+",'"+itemNo+
-                    "',"+qty+",'"+whcode+"','"+whname+"','"+fnote+"')");
+                    "',"+qty+",'"+warehouses[0]+"','"+warehouses[1]+"','"+fnote+"')");
             detno++;
             detno++;
         }
         }
         baseDao.execute(sqls);
         baseDao.execute(sqls);
@@ -444,6 +454,11 @@ public class MESServiceImpl implements MESService {
             if ("".equals(whcode)){
             if ("".equals(whcode)){
                 return ApiResponse.failRsp("10043",request.getHeader("RequestId"),"发料仓库不能为空!");
                 return ApiResponse.failRsp("10043",request.getHeader("RequestId"),"发料仓库不能为空!");
             }
             }
+            int count = baseDao.getCount("select count(1) from Warehouse where wh_mesc_user='" + whcode + "'");
+            if (count<=0){
+                return ApiResponse.failRsp("10044",request.getHeader("RequestId"),"MES仓库编号在ERP没有对应关系,请联系管理员新增!");
+            }
+            Object[] warehouses = baseDao.getFieldsDataByCondition("Warehouse", "wh_code,wh_description", "wh_mesc_user='" + whcode + "'");
             String fSourceInterId = StringUtil.nvl(object.get("FSourceInterId"), "");
             String fSourceInterId = StringUtil.nvl(object.get("FSourceInterId"), "");
             String ficmoBillNo = StringUtil.nvl(object.get("FICMOBillNo"), "");
             String ficmoBillNo = StringUtil.nvl(object.get("FICMOBillNo"), "");
             Object lineId = object.get("lineId");
             Object lineId = object.get("lineId");
@@ -452,12 +467,12 @@ public class MESServiceImpl implements MESService {
                 sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
                 sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
                         "pd_outqty,pd_whcode,pd_whname,pd_inwhcode,pd_inwhname) " +
                         "pd_outqty,pd_whcode,pd_whname,pd_inwhcode,pd_inwhname) " +
                         "values (PRODIODETAIL_SEQ.nextval," + bcpiid + ",'" + bccode + "','"+bcpiclass+"'," + detno + ",'" + itemNo +
                         "values (PRODIODETAIL_SEQ.nextval," + bcpiid + ",'" + bccode + "','"+bcpiclass+"'," + detno + ",'" + itemNo +
-                        "'," + qty + ",'" + mmwhcode + "','" + mmwhname + "','" + whcode + "','" + whname + "')");
+                        "'," + qty + ",'" + mmwhcode + "','" + mmwhname + "','" + warehouses[0] + "','" + warehouses[1] + "')");
             }
             }
             sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
             sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
                     "pd_outqty,pd_whcode,pd_whname,pd_ordercode,pd_orderdetno) " +
                     "pd_outqty,pd_whcode,pd_whname,pd_ordercode,pd_orderdetno) " +
                     "values (PRODIODETAIL_SEQ.nextval," + llpiid + ",'" + llcode + "','"+llpiclass+"'," + detno + ",'" + itemNo +
                     "values (PRODIODETAIL_SEQ.nextval," + llpiid + ",'" + llcode + "','"+llpiclass+"'," + detno + ",'" + itemNo +
-                    "'," + qty + ",'" + whcode + "','" + whname + "','"+ficmoBillNo+"',"+mmdetno+")");
+                    "'," + qty + ",'" + warehouses[0] + "','" + warehouses[1] + "','"+ficmoBillNo+"',"+mmdetno+")");
             detno++;
             detno++;
         }
         }
         baseDao.execute(sqls);
         baseDao.execute(sqls);
@@ -504,6 +519,11 @@ public class MESServiceImpl implements MESService {
             if ("".equals(whcode)){
             if ("".equals(whcode)){
                 return ApiResponse.failRsp("10053",request.getHeader("RequestId"),"仓库编号不能为空!");
                 return ApiResponse.failRsp("10053",request.getHeader("RequestId"),"仓库编号不能为空!");
             }
             }
+            int count = baseDao.getCount("select count(1) from Warehouse where wh_mesc_user='" + whcode + "'");
+            if (count<=0){
+                return ApiResponse.failRsp("10054",request.getHeader("RequestId"),"MES仓库编号在ERP没有对应关系,请联系管理员新增!");
+            }
+            Object[] warehouses = baseDao.getFieldsDataByCondition("Warehouse", "wh_code,wh_description", "wh_mesc_user='" + whcode + "'");
             String ficmoBillNo = StringUtil.nvl(object.get("FICMOBillNo"), "");
             String ficmoBillNo = StringUtil.nvl(object.get("FICMOBillNo"), "");
             String fBatchNo = StringUtil.nvl(object.get("FBatchNo"), "");
             String fBatchNo = StringUtil.nvl(object.get("FBatchNo"), "");
             Object lineId = object.get("lineId");
             Object lineId = object.get("lineId");
@@ -511,7 +531,7 @@ public class MESServiceImpl implements MESService {
             sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
             sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
                     "pd_inqty,pd_whcode,pd_whname,pd_remark,pd_batchcode,pd_ordercode,pd_orderdetno) " +
                     "pd_inqty,pd_whcode,pd_whname,pd_remark,pd_batchcode,pd_ordercode,pd_orderdetno) " +
                     "values (PRODIODETAIL_SEQ.nextval,"+id+",'"+code+"','生产退料单',"+detno+",'"+itemNo+
                     "values (PRODIODETAIL_SEQ.nextval,"+id+",'"+code+"','生产退料单',"+detno+",'"+itemNo+
-                    "',"+qty+",'"+whcode+"','"+whname+"','"+fnote+"','"+fBatchNo+"','"+ficmoBillNo+"',"+mmdetno+")");
+                    "',"+qty+",'"+warehouses[0]+"','"+warehouses[1]+"','"+fnote+"','"+fBatchNo+"','"+ficmoBillNo+"',"+mmdetno+ ")");
             detno++;
             detno++;
         }
         }
         baseDao.execute(sqls);
         baseDao.execute(sqls);
@@ -559,17 +579,24 @@ public class MESServiceImpl implements MESService {
             if ("".equals(whcode)){
             if ("".equals(whcode)){
                 return ApiResponse.failRsp("10063",request.getHeader("RequestId"),"发货仓库不能为空!");
                 return ApiResponse.failRsp("10063",request.getHeader("RequestId"),"发货仓库不能为空!");
             }
             }
+            int count = baseDao.getCount("select count(1) from Warehouse where wh_mesc_user='" + whcode + "'");
+            if (count<=0){
+                return ApiResponse.failRsp("10064",request.getHeader("RequestId"),"发货仓库编号在ERP没有对应关系,请联系管理员新增!");
+            }
+            Object[] warehouses = baseDao.getFieldsDataByCondition("Warehouse", "wh_code,wh_description", "wh_mesc_user='" + whcode + "'");
             Map<Object, Object> map2 = JSONUtil.toMap(StringUtil.valueOf(object.get("FDCStockID1")));
             Map<Object, Object> map2 = JSONUtil.toMap(StringUtil.valueOf(object.get("FDCStockID1")));
             String whcode2 = StringUtil.nvl(map2.get("FNumber"), "");
             String whcode2 = StringUtil.nvl(map2.get("FNumber"), "");
             String whname2 = StringUtil.nvl(map2.get("FName"), "");
             String whname2 = StringUtil.nvl(map2.get("FName"), "");
             if ("".equals(whcode2)){
             if ("".equals(whcode2)){
-                return ApiResponse.failRsp("10064",request.getHeader("RequestId"),"收货仓库不能为空!");
+                return ApiResponse.failRsp("10065",request.getHeader("RequestId"),"收货仓库不能为空!");
             }
             }
-
+            int count2 = baseDao.getCount("select count(1) from Warehouse where wh_mesc_user='" + whcode2 + "'");
+            if (count2<=0){
+                return ApiResponse.failRsp("10066",request.getHeader("RequestId"),"收货仓库编号在ERP没有对应关系,请联系管理员新增!");
+            }
+            Object[] warehouses2 = baseDao.getFieldsDataByCondition("Warehouse", "wh_code,wh_description", "wh_mesc_user='" + whcode2 + "'");
             sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
             sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
-                    "pd_outqty,pd_whcode,pd_whname,pd_inwhcode,pd_inwhname) " +
-                    "values (PRODIODETAIL_SEQ.nextval,"+id+",'"+code+"','拨出单',"+detno+",'"+itemNo+
-                    "',"+qty+",'"+whcode+"','"+whname+"','"+whcode2+"','"+whname2+"')");
+                    "pd_outqty,pd_whcode,pd_whname,pd_inwhcode,pd_inwhname) values (PRODIODETAIL_SEQ.nextval,"+id+",'"+code+"','拨出单',"+detno+",'"+itemNo+"',"+qty+",'"+warehouses[0]+"','"+warehouses[1]+"','"+warehouses2[0]+"','"+warehouses2[1]+"')");
             detno++;
             detno++;
         }
         }
         baseDao.execute(sqls);
         baseDao.execute(sqls);

+ 4 - 5
src/main/java/com/uas/eis/service/Impl/ScheduleTaskServiceImpl.java

@@ -45,8 +45,7 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
                             "pr_version,pr_serial,nvl(pr_validdays,'0') pr_validdays,pr_msdlevel ,pr_fhelpcode ," +
                             "pr_version,pr_serial,nvl(pr_validdays,'0') pr_validdays,pr_msdlevel ,pr_fhelpcode ," +
                             "pr_f_115 ,pr_f_116 ,pr_f_102,pr_kind,wh_mesc_user pr_whcode,wh_mesn_user pr_whname,flag," +
                             "pr_f_115 ,pr_f_116 ,pr_f_102,pr_kind,wh_mesc_user pr_whcode,wh_mesn_user pr_whname,flag," +
                             "pr_statuscode,pr_status from mes_product left join Warehouse on pr_whcode=wh_code where id=?",
                             "pr_statuscode,pr_status from mes_product left join Warehouse on pr_whcode=wh_code where id=?",
-                    new BeanPropertyRowMapper<Product>(Product.class),
-                    rs.getInt("id"));
+                    new BeanPropertyRowMapper<Product>(Product.class), rs.getInt("id"));
             product.setMesUser(tokenConfig.get("mesUser"));
             product.setMesUser(tokenConfig.get("mesUser"));
             product.setMesPwd(MD5Util.encodeByMD5(tokenConfig.get("mesPwd")));
             product.setMesPwd(MD5Util.encodeByMD5(tokenConfig.get("mesPwd")));
             Map<String, Object> map = syncMES(JSON.toJSONString(product, SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncProduct"));
             Map<String, Object> map = syncMES(JSON.toJSONString(product, SerializerFeature.WriteMapNullValue).replace("null", "\"\""), tokenConfig.get("syncProduct"));
@@ -56,7 +55,7 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
                     baseDao.updateByCondition("mes_product","status='D'","status='W' and id="+rs.getInt("id"));
                     baseDao.updateByCondition("mes_product","status='D'","status='W' and id="+rs.getInt("id"));
                 }else {
                 }else {
                     baseDao.updateByCondition("mes_product","status='F'","status='W' and id="+rs.getInt("id"));
                     baseDao.updateByCondition("mes_product","status='F'","status='W' and id="+rs.getInt("id"));
-                    baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode) values (MESERRORLOG_SEQ.NEXTVAL,'"+tokenConfig.get("syncProduct")+"','"+StringUtil.nvl(map.get("msg"),"")+"',sysdate,'"+product.getPr_code()+"')");
+                    baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_type) values (MESERRORLOG_SEQ.NEXTVAL,'"+tokenConfig.get("syncProduct")+"','"+StringUtil.nvl(map.get("msg"),"")+"',sysdate,'"+product.getPr_code()+"','物料资料')");
                 }
                 }
             }
             }
         }
         }
@@ -77,7 +76,7 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
                     baseDao.updateByCondition("mes_make","status='D'","status='W' and id="+rs.getInt("id"));
                     baseDao.updateByCondition("mes_make","status='D'","status='W' and id="+rs.getInt("id"));
                 }else {
                 }else {
                     baseDao.updateByCondition("mes_make","status='F'","status='W' and id="+rs.getInt("id"));
                     baseDao.updateByCondition("mes_make","status='F'","status='W' and id="+rs.getInt("id"));
-                    baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode) values (MESERRORLOG_SEQ.NEXTVAL,'"+tokenConfig.get("syncMakeBase")+"','"+StringUtil.nvl(map.get("msg"),"")+"',sysdate,'"+make.getMa_code()+"')");
+                    baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_type) values (MESERRORLOG_SEQ.NEXTVAL,'"+tokenConfig.get("syncMakeBase")+"','"+StringUtil.nvl(map.get("msg"),"")+"',sysdate,'"+make.getMa_code()+"','工单')");
                 }
                 }
             }
             }
         }
         }
@@ -99,7 +98,7 @@ public class ScheduleTaskServiceImpl implements ScheduleTaskService {
                         baseDao.updateByCondition("mes_makematerial", "status='D'", "status='W' and id=" + rs.getInt("id"));
                         baseDao.updateByCondition("mes_makematerial", "status='D'", "status='W' and id=" + rs.getInt("id"));
                     } else {
                     } else {
                         baseDao.updateByCondition("mes_makematerial", "status='F'", "status='W' and id=" + rs.getInt("id"));
                         baseDao.updateByCondition("mes_makematerial", "status='F'", "status='W' and id=" + rs.getInt("id"));
-                        baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_djdetno) values(MESERRORLOG_SEQ.NEXTVAL,'" + tokenConfig.get("syncMakeBaseDetail") + "','" + StringUtil.nvl(map.get("msg"), "") + "',sysdate,'" + rs.getGeneralString("mm_code") + "',"+rs.getInt("mm_detno")+")");
+                        baseDao.execute("insert into meserrorlog (mel_id,mel_url,mel_error,mel_indate,mel_djcode,mel_djdetno,mel_type) values(MESERRORLOG_SEQ.NEXTVAL,'" + tokenConfig.get("syncMakeBaseDetail") + "','" + StringUtil.nvl(map.get("msg"), "") + "',sysdate,'" + rs.getGeneralString("mm_code") + "',"+rs.getInt("mm_detno")+",'工单BOM')");
                     }
                     }
                 }
                 }
             }
             }