物料推送qms
This commit is contained in:
		
							parent
							
								
									20a9b73243
								
							
						
					
					
						commit
						486edf88eb
					
				|  | @ -12,6 +12,7 @@ import nc.bs.trade.business.HYPubBO; | |||
| import nc.bs.trade.business.HYSuperDMO; | ||||
| import nc.bs.uapbd.util.MyHelper; | ||||
| import nc.bs.uapbd.util.ThirdPartyPostRequestUtil; | ||||
| import nc.jdbc.framework.processor.ColumnProcessor; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.pubitf.uapbd.IMaterialPubService; | ||||
| import nc.vo.bd.defdoc.DefdocVO; | ||||
|  | @ -66,7 +67,11 @@ public class MaterialPushToQmsAction implements ICommonAction { | |||
|             buildSyncData(new MaterialVO[]{useVOs}, "1002"); | ||||
| 
 | ||||
|         } catch (Exception ex) { | ||||
| 
 | ||||
|             try { | ||||
|                 throw new BusinessException(ex.getMessage()); | ||||
|             } catch (BusinessException e) { | ||||
|                 throw new RuntimeException(e); | ||||
|             } | ||||
|         } | ||||
|         return "success"; | ||||
|     } | ||||
|  | @ -78,7 +83,7 @@ public class MaterialPushToQmsAction implements ICommonAction { | |||
|             String pkOrg = vo.getPk_org(); | ||||
|             String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg); | ||||
|             Integer num = MyHelper.checkIfOrg(configParams, pkMaterial, "xbOrg"); | ||||
|             if (!"1009".equals(eventType) && (num <= 0)) { | ||||
|             if (!"1002".equals(eventType) && (num <= 0)) { | ||||
|                 continue; | ||||
|             } | ||||
|             // 字段值翻译 | ||||
|  | @ -104,7 +109,7 @@ public class MaterialPushToQmsAction implements ICommonAction { | |||
|             String wlxhgg = MyHelper.skipNull(vo.getMaterialtype()) + MyHelper.skipNull(vo.getMaterialspec()); | ||||
|             contentObj.put("wlxhgg", wlxhgg); // 物料型号规格 | ||||
|             contentObj.put("wlfl", mrlTypeName); // 物料分类 | ||||
|             contentObj.put("wlbz", "²úÆ·"); // ÎïÁϱêÖ¾ | ||||
|             contentObj.put("wlbz", getMrlType(vo.getPk_material(),configParams.get("mrlOrg"))); // ÎïÁϱêÖ¾ | ||||
|             contentObj.put("sjjldw", unitMap.get("unitname")); // 设计计量单位 | ||||
|             contentObj.put("cgjldw", unitMap.get("deputy_unitname")); // 采购计量单位 | ||||
|             contentObj.put("zhxs", unitMap.getOrDefault("convertRate", "1.00")); // 转换系数 | ||||
|  | @ -133,9 +138,26 @@ public class MaterialPushToQmsAction implements ICommonAction { | |||
|               } | ||||
|              */ | ||||
|             pushData(singleObj); | ||||
|             updateBs(pkMaterial); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private void updateBs(String pkMaterial) throws DAOException { | ||||
|         BaseDAO dao = new BaseDAO(); | ||||
|         String sql = "update BD_MATERIAL set def36='Y' where pk_material='" | ||||
|                 + pkMaterial + "'"; | ||||
|         dao.executeUpdate(sql); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     private Object getMrlType(String pkMaterial, String xbOrg) throws DAOException { | ||||
|         String sql = " select martype from bd_materialstock  left join org_stockorg on org_stockorg.pk_stockorg = bd_materialstock.pk_org " + | ||||
|                 " where pk_material = '" + pkMaterial + "' AND bd_materialstock.dr=0 " + " and org_stockorg.code  = '" + xbOrg + "' "; | ||||
|         Object map = (Object) new BaseDAO().executeQuery(sql,new ColumnProcessor()); | ||||
|         return map; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     /** | ||||
|      * 推送同步数据 | ||||
|      */ | ||||
|  |  | |||
|  | @ -10,10 +10,12 @@ import nc.bs.businessevent.IBusinessEvent; | |||
| import nc.bs.businessevent.IBusinessListener; | ||||
| import nc.bs.businessevent.bd.BDCommonEvent; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.dao.DAOException; | ||||
| import nc.bs.logging.Log; | ||||
| import nc.bs.trade.business.HYPubBO; | ||||
| import nc.bs.uapbd.util.MyHelper; | ||||
| import nc.bs.uapbd.util.ThirdPartyPostRequestUtil; | ||||
| import nc.jdbc.framework.processor.ColumnProcessor; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.vo.bd.material.MaterialVO; | ||||
| import nc.vo.bd.material.marbasclass.MarBasClassVO; | ||||
|  | @ -115,7 +117,7 @@ public class MaterialToQmsListener implements IBusinessListener { | |||
|             String wlxhgg = MyHelper.skipNull(vo.getMaterialtype()) + MyHelper.skipNull(vo.getMaterialspec()); | ||||
|             contentObj.put("wlxhgg", wlxhgg); // 物料型号规格 | ||||
|             contentObj.put("wlfl", mrlTypeName); // 物料分类 | ||||
|             contentObj.put("wlbz", "²úÆ·"); // ÎïÁϱêÖ¾ | ||||
|             contentObj.put("wlbz", getMrlType(vo.getPk_material(),configParams.get("mrlOrg"))); // ÎïÁϱêÖ¾ | ||||
|             contentObj.put("sjjldw", unitMap.get("unitname")); // 设计计量单位 | ||||
|             contentObj.put("cgjldw", unitMap.get("deputy_unitname")); // 采购计量单位 | ||||
|             contentObj.put("zhxs", unitMap.getOrDefault("convertRate", "1.00")); // 转换系数 | ||||
|  | @ -144,9 +146,21 @@ public class MaterialToQmsListener implements IBusinessListener { | |||
|               } | ||||
|              */ | ||||
|             pushData(singleObj); | ||||
|             updateBs(pkMaterial); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private void updateBs(String pkMaterial) throws DAOException { | ||||
|         BaseDAO dao = new BaseDAO(); | ||||
|         String sql = "update BD_MATERIAL set def36='Y' where pk_material='" | ||||
|                 + pkMaterial + "'"; | ||||
|         dao.executeUpdate(sql); | ||||
|     } | ||||
|     private Object getMrlType(String pkMaterial, String xbOrg) throws DAOException { | ||||
|         String sql = " select martype from bd_materialstock  left join org_stockorg on org_stockorg.pk_stockorg = bd_materialstock.pk_org " + | ||||
|                 " where pk_material = '" + pkMaterial + "' AND bd_materialstock.dr=0 " + " and org_stockorg.code  = '" + xbOrg + "' "; | ||||
|         Object map = (Object) new BaseDAO().executeQuery(sql,new ColumnProcessor()); | ||||
|         return map; | ||||
|     } | ||||
|     /** | ||||
|      * 推送同步数据 | ||||
|      */ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue