lihao-箱变-流程生产订单和物料同步启源
This commit is contained in:
		
							parent
							
								
									0f2cd1c76d
								
							
						
					
					
						commit
						005f2a508b
					
				|  | @ -4,22 +4,16 @@ import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| import com.alibaba.fastjson.serializer.SerializerFeature; | ||||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||||
| import com.google.gson.Gson; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.dao.DAOException; | ||||
| import nc.bs.logging.Log; | ||||
| import nc.bs.logging.Logger; | ||||
| 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.itf.mmpac.pmo.pac0002.IPMOQueryService; | ||||
| import nc.jdbc.framework.processor.ColumnProcessor; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.vo.bc.pmpub.project.ProjectHeadVO; | ||||
| import nc.vo.bd.defdoc.DefdocVO; | ||||
| import nc.vo.cmp.util.StringUtils; | ||||
| import nc.vo.mmpac.pmo.pac0002.entity.PMOAggVO; | ||||
| import nc.vo.mmpac.pmo.pac0002.entity.PMOHeadVO; | ||||
| import nc.vo.mmpac.pmo.pac0002.entity.PMOItemVO; | ||||
|  | @ -27,30 +21,21 @@ import nc.vo.org.OrgVO; | |||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.lang.UFDateTime; | ||||
| import nc.vo.sm.UserVO; | ||||
| import nc.vo.util.CloneUtil; | ||||
| import nccloud.framework.service.ServiceLocator; | ||||
| import nccloud.framework.web.action.itf.ICommonAction; | ||||
| import nccloud.framework.web.container.IRequest; | ||||
| import nccloud.framework.web.json.JsonFactory; | ||||
| import nccloud.web.mmpub.pub.resexp.PfResumeExceptionNccUtils; | ||||
| import org.apache.http.client.config.CookieSpecs; | ||||
| import org.apache.http.client.config.RequestConfig; | ||||
| import org.apache.http.client.methods.HttpGet; | ||||
| import org.apache.http.client.methods.HttpPost; | ||||
| import org.apache.http.entity.StringEntity; | ||||
| import org.apache.http.impl.client.CloseableHttpClient; | ||||
| import org.apache.http.impl.client.HttpClients; | ||||
| import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; | ||||
| import org.apache.http.util.EntityUtils; | ||||
| 
 | ||||
| import java.io.IOException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| /** | ||||
|  * ÄÚÅä¶©µ¥ÊÖ¶¯ÍÆPLM | ||||
|  * 箱变-流程生产订单同步启源 | ||||
|  * | ||||
|  * @author lihao | ||||
|  * @date 2025/10/11 | ||||
|  */ | ||||
| public class PmoToQmsAction implements ICommonAction { | ||||
| 
 | ||||
|  | @ -82,7 +67,7 @@ public class PmoToQmsAction implements ICommonAction { | |||
|             if (configParams.isEmpty()) { | ||||
|                 throw new BusinessException("Ïä±äµÄQMS½Ó¿ÚȱÉÙÅäÖÃ"); | ||||
|             } | ||||
|             return  buildSyncData(pmoAggVOS); | ||||
|             return buildSyncData(pmoAggVOS); | ||||
| 
 | ||||
|         } catch (Exception e) { | ||||
|             return PfResumeExceptionNccUtils.handleResumeException(e); | ||||
|  | @ -102,8 +87,8 @@ public class PmoToQmsAction implements ICommonAction { | |||
|             if (checkIfOrg(orgCode, configParams)) { | ||||
|                 continue; | ||||
|             } | ||||
|             if(vo.getChildrenVO().length >=0 ){ | ||||
|                 if(vo.getChildrenVO()[0].getAttributeValue("vdef32").equals("Y")){ | ||||
|             if (vo.getChildrenVO().length >= 0) { | ||||
|                 if (null != vo.getChildrenVO()[0].getAttributeValue("vdef32") && vo.getChildrenVO()[0].getAttributeValue("vdef32").equals("Y")) { | ||||
|                     continue; | ||||
|                 } | ||||
|             } | ||||
|  | @ -203,14 +188,14 @@ public class PmoToQmsAction implements ICommonAction { | |||
|         String baseUrl = configParams.get("qmsBaseUrl"); | ||||
|         String requestUrl = baseUrl + reqUrl; | ||||
|         logger.error("QMS-PMO-JM-url = " + requestUrl); | ||||
| //        String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr); | ||||
| //        JSONObject resultObj = JSONObject.parseObject(result); | ||||
| //        logger.error("QMS-PMO-JM-res = " + result); | ||||
| // | ||||
| //        if (!"true".equals(resultObj.getString("success"))) { | ||||
| //            logger.error("QMS-PMO-JM-error,result[" + resultObj.toJSONString() + "]"); | ||||
| //            throw new BusinessException("QMS-PMO-JM-error:" + resultObj.getString("message")); | ||||
| //        } | ||||
|         String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr); | ||||
|         JSONObject resultObj = JSONObject.parseObject(result); | ||||
|         logger.error("QMS-PMO-JM-res = " + result); | ||||
| 
 | ||||
|         if (!"true".equals(resultObj.getString("success"))) { | ||||
|             logger.error("QMS-PMO-JM-error,result[" + resultObj.toJSONString() + "]"); | ||||
|             throw new BusinessException("QMS-PMO-JM-error:" + resultObj.getString("message")); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private boolean checkIfOrg(String code, Map<String, String> configParams) throws BusinessException { | ||||
|  |  | |||
|  | @ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| import com.alibaba.fastjson.serializer.SerializerFeature; | ||||
| import nc.bs.bd.baseservice.ArrayClassConvertUtil; | ||||
| import nc.bs.dao.BaseDAO; | ||||
| import nc.bs.dao.DAOException; | ||||
| import nc.bs.framework.common.NCLocator; | ||||
|  | @ -13,48 +12,31 @@ 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.itf.scmpub.reference.uap.bd.material.MaterialPubService; | ||||
| import nc.jdbc.framework.processor.MapProcessor; | ||||
| import nc.pubitf.uapbd.IMaterialPubService; | ||||
| import nc.util.mmf.framework.base.MMValueCheck; | ||||
| import nc.vo.bd.defdoc.DefdocVO; | ||||
| import nc.vo.bd.material.MaterialVO; | ||||
| import nc.vo.bd.material.marbasclass.MarBasClassVO; | ||||
| import nc.vo.bd.material.plan.MaterialPlanVO; | ||||
| import nc.vo.bd.material.stock.MaterialStockVO; | ||||
| import nc.vo.cmp.util.StringUtils; | ||||
| import nc.vo.ml.NCLangRes4VoTransl; | ||||
| import nc.vo.org.OrgVO; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nccloud.baseapp.core.log.NCCForPrintLogger; | ||||
| import nccloud.framework.core.exception.ExceptionUtils; | ||||
| import nccloud.framework.core.io.WebFile; | ||||
| import nccloud.framework.core.io.WebFileDisposition; | ||||
| import nccloud.framework.core.json.IJson; | ||||
| import nccloud.framework.web.action.itf.ICommonAction; | ||||
| import nccloud.framework.web.container.IRequest; | ||||
| import nccloud.framework.web.json.JsonFactory; | ||||
| import org.apache.http.client.config.CookieSpecs; | ||||
| import org.apache.http.client.config.RequestConfig; | ||||
| import org.apache.http.client.methods.HttpGet; | ||||
| import org.apache.http.impl.client.CloseableHttpClient; | ||||
| import org.apache.http.impl.client.HttpClients; | ||||
| import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; | ||||
| import org.apache.http.util.EntityUtils; | ||||
| import org.owasp.esapi.ESAPI; | ||||
| 
 | ||||
| import java.io.*; | ||||
| import java.text.SimpleDateFormat; | ||||
| import java.util.*; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Objects; | ||||
| import java.util.stream.Stream; | ||||
| import java.util.zip.ZipEntry; | ||||
| import java.util.zip.ZipOutputStream; | ||||
| 
 | ||||
| /** | ||||
|  * »ñÈ¡ÎïÁÏPLMÎļþ | ||||
|  * Ïä±ä-ÎïÁÏͬ²½ÆôÔ´ | ||||
|  * | ||||
|  * @author mzr | ||||
|  * @date 2025/8/4 | ||||
|  * @author lihao | ||||
|  * @date 2025/10/8 | ||||
|  */ | ||||
| public class MaterialPushToQmsAction implements ICommonAction { | ||||
|     private static final String LOG_INFO_NAME = "qyMesLog"; | ||||
|  | @ -68,10 +50,10 @@ public class MaterialPushToQmsAction implements ICommonAction { | |||
| 
 | ||||
|         HYPubBO hyPub = new HYPubBO(); | ||||
|         IJson json = JsonFactory.create(); | ||||
|         Map<String,Object> info = json.fromJson(read, Map.class); | ||||
|         Map<String, Object> info = json.fromJson(read, Map.class); | ||||
|         try { | ||||
|             String materialCodeArr = (String) info.get("pk_material"); // 获取所有物料编码 | ||||
|             if (materialCodeArr == null ) { | ||||
|             if (materialCodeArr == null) { | ||||
|                 ExceptionUtils.wrapBusinessException("物料不能为空"); | ||||
|             } | ||||
| //            String[] pks = materialCodeArr.split(","); | ||||
|  |  | |||
|  | @ -8,7 +8,7 @@ | |||
| 
 | ||||
| 	<action> | ||||
| 		<name>uapbd.material.pushtoqms</name> | ||||
| 		<label>物料-下载PLM物料文件</label> | ||||
| 		<label>物料推送qms</label> | ||||
| 		<clazz>nccloud.web.uapbd.material.action.MaterialPushToQmsAction</clazz> | ||||
| 	</action> | ||||
| </actions> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue