丽知:存货分类修改

This commit is contained in:
zhengyf 2024-08-27 13:33:55 +08:00
parent 0d81aa63d7
commit 0a79dc6c91
1 changed files with 2 additions and 140 deletions

View File

@ -301,13 +301,11 @@ public class SKUClassPluginInitializer extends PluginBaseEntity {
mapStr = JSONUtil.toJsonStr(map); mapStr = JSONUtil.toJsonStr(map);
ZTResult ztResult = pushU8CByApiCode.pushByCode(url, mapStr); ZTResult ztResult = pushU8CByApiCode.pushByCode(url, mapStr);
//两层判断,一层中台转发,一层u8c返回 //两层判断,一层中台转发,一层u8c返回
Attribute attribute = ztResult.getAttribute();
if ("false".equals(ztResult.getFlag())) { if ("false".equals(ztResult.getFlag())) {
//转发失败 //转发失败
Assert.state(false, "丽知OFS货品档案分类--->U8C货品档案分类.中台转发失败,失败原因:{}", ztResult.getAttribute().getErrormsg()); Assert.state(false, "丽知OFS货品档案分类--->U8C货品档案分类.中台转发失败,失败原因:{}", attribute.getErrormsg());
} }
Attribute attribute = ztResult.getAttribute();
System.out.println(attribute);
boolean isSuccess = false; boolean isSuccess = false;
String invclasscode = ""; String invclasscode = "";
if ("success".equals(attribute.getStatus())) { if ("success".equals(attribute.getStatus())) {
@ -352,142 +350,6 @@ public class SKUClassPluginInitializer extends PluginBaseEntity {
} }
}
//
// //查询pk_corp=0001下的所有分类
// List<BdInvclEntity> bdInvclEntities = queryU8CAllInvcl();
// //将pk_corp=0001下的所有分类分为123级
// List<BdInvclEntity> u8cLevel1 = new ArrayList<>();//length==2
// List<BdInvclEntity> u8cLevel2 = new ArrayList<>();//length==5
// List<BdInvclEntity> u8cLevel3 = new ArrayList<>();//length==9
// for (BdInvclEntity bdInvclEntity : bdInvclEntities) {
// switch (bdInvclEntity.getInvclasscode().length()) {
// case 2: System.out.println("U8C1级分类" + bdInvclEntity.getInvclasscode()); u8cLevel1.add(bdInvclEntity); break;
// case 5: System.out.println("U8C2级分类" + bdInvclEntity.getInvclasscode()); u8cLevel2.add(bdInvclEntity); break;
// case 9: System.out.println("U8C3级分类" + bdInvclEntity.getInvclasscode()); u8cLevel3.add(bdInvclEntity); break;
// }
// }
//
// List<OFSSKUClassSearchResponse.SKUClass> ofsLevel1 = new ArrayList<>();//length==2
// List<OFSSKUClassSearchResponse.SKUClass> ofsLevel2 = new ArrayList<>();//length==5
// List<OFSSKUClassSearchResponse.SKUClass> ofsLevel3 = new ArrayList<>();//length==9
// for (OFSSKUClassSearchResponse.SKUClass ofsSKUClass : filterSKUClasss) {
// switch (ofsSKUClass.getCInvCCode().length()) {
// case 2: System.out.println("OFS1级分类" + ofsSKUClass.getCInvCCode()); ofsLevel1.add(ofsSKUClass); break;
// case 5: System.out.println("OFS2级分类" + ofsSKUClass.getCInvCCode()); ofsLevel2.add(ofsSKUClass); break;
// case 9: System.out.println("OFS3级分类" + ofsSKUClass.getCInvCCode()); ofsLevel3.add(ofsSKUClass); break;
// }
// }
// System.out.println(1111);
//
//
// //分三次推送按顺序123
// if(ofsLevel1!=null&&ofsLevel1.size()>0){
// specificImplement(ofsLevel1,u8cLevel1);
// }
// if(ofsLevel2!=null&&ofsLevel2.size()>0){
// specificImplement(ofsLevel2,u8cLevel2);
// }
// if(ofsLevel3!=null&&ofsLevel3.size()>0){
// specificImplement(ofsLevel3,u8cLevel3);
// }
// //生成业务日期
// String businessFormat = "";
// String mapStr="";
//
//
// String invclasscode=null;
// String invclassname=null;
// try {
//
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // 定义日期格式
// Date date = new Date(System.currentTimeMillis()); // 创建Date对象
// businessFormat = sdf.format(date); // 将Date对象格式化为字符串
//
//
//
//
// List<BdInvclEntity> bdInvclEntities = new ArrayList<>();
//
// BdInvclEntity bdInvclEntity = new BdInvclEntity();
//
// //分类编码-invclasscode
// invclasscode = "AA004";
// bdInvclEntity.setInvclasscode(invclasscode);
//
// //分类名称-invclassname
// invclassname = "分类名称AA004";
//
// bdInvclEntity.setInvclassname(invclassname);
// //公司编码-pk_corp
// String pk_corp = "1001";
// bdInvclEntity.setPk_corp(pk_corp);
// //分类级别-invclasslevel
// bdInvclEntities.add(bdInvclEntity);
//
// String jsonStr = JSONUtil.toJsonStr(bdInvclEntities);
//
// Map<String, Object> map = new HashMap<>();
// map.put("invcl", jsonStr);
// mapStr = JSONUtil.toJsonStr(map);
//
// String response = pushDataByU8cUtil.pushU8CByPK(OverallConstant.getOverAllValue("bdinvclSave"), mapStr);
// System.out.println(response);
// boolean isSuccess = false;
// if (response != null && !"".equals(response)) {
// ReusltStrDto reusltStrDto = JSON.parseObject(response, ReusltStrDto.class);
// if ("success".equals(reusltStrDto.getStatus())) {
// isSuccess = true;
// }
// }
// if (!isSuccess) {
// Assert.state(false, "推送U8C-->丽知OFS货品档案分类--->U8C货品档案分类失败 接口返回结果:{} 接口入参:{}", response, jsonStr);
// }
// //成功
// IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
// integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_Y);
// integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
// integrationTaskLivingDetailsEntity.setNewTransmitInfo(response);
// integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
// integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
// integrationTaskLivingDetailsEntity.setRootAppPk(invclasscode);
// integrationTaskLivingDetailsEntity.setRootAppBill(invclassname);
// integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
// saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
//
//
// } catch (Exception e) {
// e.printStackTrace();
// logger.error("丽知OFS货品档案分类--->U8C货品档案分类,implement()方法报错:", e);
// //失败
// String ErrMessage = e.getMessage();
// IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
// integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
// integrationTaskLivingDetailsEntity.setRootAppNewData(mapStr);
// integrationTaskLivingDetailsEntity.setNewTransmitInfo(ErrMessage);
// integrationTaskLivingDetailsEntity.setNewPushDate(new Date());
// integrationTaskLivingDetailsEntity.setBusinessDate(businessFormat);
// integrationTaskLivingDetailsEntity.setRootAppPk(invclasscode);
// integrationTaskLivingDetailsEntity.setRootAppBill(invclassname);
// integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
// saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
// }
// }
/**
* 具体推送支持新增删除修改
* 根据编码和名称对应
* ofs的id传U8C的forinvname
*
* @param ofsLevel OFS中的存货分类
* @param u8cLevel U8C中的存货分类
*/
public void specificImplement(List<OFSSKUClassSearchResponse.SKUClass> ofsLevel,List<BdInvclEntity> u8cLevel){
} }
/** /**