Exemple #1
0
 /**
  * Initialize method
  *
  * @throws Exception
  */
 public void init() throws Exception {
   super.init();
   this.setInterfaceType(ConstantInterface.INTERFACE_TYPE_PARTS_PRICE);
   //		this.loaderCsv = new
   // PartPriceCsvLoaderImpl(this.getAppSettingInfo(),this.getInterfaceType());
   this.loaderTxt = new PartPriceLoaderImpl(this.getAppSettingInfo(), this.getInterfaceType());
   this.sender = new PartPriceSenderImpl(this.getAppSettingInfo(), this.getInterfaceType());
   this.callback = (CallbackNpcBizService) CommUtil.getBean("npcSyncPartPriceServiceAD");
 }
 /* (non-Javadoc)
  * @see cn.com.sony.npc.maintenance.service.NpcCommonModelDefineService#checkPart(java.lang.String)
  */
 @Override
 public boolean checkPart(String partCode, String namingRule) {
   MultiEntity multiEntity = CommUtil.getMultiEntityBean();
   String defineBy = SysConstants.DEFINE_BY_NPC;
   if (SysConstants.COUNTRY_CODE_AD.equals(multiEntity.getCountryCode())) { // 如果当前用户是admin--->srpc
     defineBy = SysConstants.DEFINE_BY_SRPC;
   }
   String hql =
       "select pmd.suffix from NpcCommonModelDefine pmd where pmd.suffix = ? and pmd.namingRule = ? and pmd.defineBy = ? and pmd.delFlag != 1";
   List<String> suffixList =
       this.getNpcCommonModelDefineDao()
           .list(hql, partCode.substring(partCode.length() - 1), namingRule, defineBy);
   if (suffixList != null && suffixList.size() > 0) { // 说明此零件的后缀有符合的
     return true;
   }
   return false;
 }