| | |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import com.vci.common.log.LogType; |
| | | import com.vci.common.objects.UserEntity; |
| | | import com.vci.common.resource.CommonProperties; |
| | | import com.vci.common.utility.ObjectUtility; |
| | |
| | | import com.vci.corba.framework.data.SpecialCharClsfInfo; |
| | | import com.vci.corba.framework.data.SpecialCharInfo; |
| | | import com.vci.corba.framework.data.SystemCfgInfo; |
| | | import com.vci.corba.log.data.LogType; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | | import com.vci.server.base.delegate.BaseDelegate; |
| | | import com.vci.server.base.delegate.UserEntityDelegate; |
| | | import com.vci.server.base.utility.LogRecordUtil; |
| | | import com.vci.server.framework.systemConfig.SystemCfg; |
| | | import com.vci.server.framework.systemConfig.SystemCfgService; |
| | | import com.vci.server.framework.systemConfig.log.LogRecordUtil; |
| | | import com.vci.server.framework.systemConfig.specialchar.SpecialChar; |
| | | import com.vci.server.framework.systemConfig.specialchar.SpecialCharService; |
| | | import com.vci.server.framework.systemConfig.specialcharclsf.SpecialCharClsf; |
| | |
| | | } |
| | | String id = ObjectUtility.getNewObjectID36(); |
| | | specialCharClsfInfo.id = id; |
| | | UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | try { |
| | | SpecialCharClsf special = changeSpecialCharClsfInfoToSpecialCharClsf(specialCharClsfInfo); |
| | | specialCharClsfService.saveSpecialCharClsf(special); |
| | | LogRecordUtil.writeLog(userEntity, "添加", "成功", special.getLogInfo(),LogType.GeneralOperation,special.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "添加", "成功", special.getLogInfo(),LogType.General,special.getId()); |
| | | } catch (Exception e) { |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符分类", "添加失败!",LogType.GeneralOperation); |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符分类", "添加失败!",LogType.General); |
| | | e.printStackTrace(); |
| | | throw new VCIError("150008", new String[]{}); |
| | | } |
| | |
| | | SpecialCharClsfService specialCharClsfService = new SpecialCharClsfService(); |
| | | SpecialCharClsf checkSpecialCharClsf = specialCharClsfService.selectSpecialCharClsfByName(specialCharClsfInfo.name); |
| | | UserEntityDelegate.setUserEntityToService(specialCharClsfService, userEntityInfo); |
| | | UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | if (checkSpecialCharClsf != null && !checkSpecialCharClsf.getId().equals(specialCharClsfInfo.id)) { |
| | | throw new VCIError("10063", new String[]{}); |
| | | } |
| | |
| | | StringBuilder logres = new StringBuilder(); |
| | | logres.append("更新前:"+speciaBefore.getLogInfo()); |
| | | logres.append(" 更新后:"+specia.getLogInfo()); |
| | | LogRecordUtil.writeLog(userEntity, "更新", "成功", logres.toString(), LogType.GeneralOperation,specia.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "更新", "成功", logres.toString(), LogType.General,specia.getId()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new VCIError("150012", new String[]{}); |
| | |
| | | */ |
| | | public boolean deletSpecialCharClsf(String[] ids, UserEntityInfo userEntityInfo) throws VCIError { |
| | | boolean rs = true; |
| | | UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | SpecialCharClsfService specialCharClsfService = new SpecialCharClsfService(); |
| | | try { |
| | | UserEntityDelegate.setUserEntityToService(specialCharClsfService, userEntityInfo); |
| | |
| | | Iterator<String> it = map.keySet().iterator(); |
| | | while(it.hasNext()){ |
| | | String speciaId = it.next(); |
| | | LogRecordUtil.writeLog(userEntity, "删除", "成功", speciaId, LogType.GeneralOperation,map.get(speciaId)); |
| | | LogRecordUtil.writeLog(userEntityInfo, "删除", "成功", speciaId, LogType.General,map.get(speciaId)); |
| | | } |
| | | } catch (Exception e) { |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符分类", "删除失败!",LogType.GeneralOperation); |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符分类", "删除失败!",LogType.General); |
| | | e.printStackTrace(); |
| | | throw new VCIError("150002", new String[]{}); |
| | | } |
| | |
| | | SpecialCharService specialCharService = new SpecialCharService(); |
| | | int length = specialCharInfos.length; |
| | | UserEntityDelegate.setUserEntityToService(specialCharService, userEntityInfo); |
| | | UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | for (int i = 0; i < length; i++) { |
| | | SpecialChar checksPecialChar = specialCharService.getSepcialCharByClsfIdAndVal(specialCharInfos[i].parentId, specialCharInfos[i].value); |
| | | if (checksPecialChar != null) { |
| | |
| | | try { |
| | | SpecialChar specia = changeSpecialCharInfoToSpecialChar(specialCharInfos[i]); |
| | | specialCharService.saveSpecialChar(specia); |
| | | LogRecordUtil.writeLog(userEntity, "添加", "成功", specia.getLogInfo(),LogType.GeneralOperation,specia.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "添加", "成功", specia.getLogInfo(),LogType.General,specia.getId()); |
| | | } catch (Exception e) { |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符", "添加失败!",LogType.GeneralOperation); |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符", "添加失败!",LogType.General); |
| | | e.printStackTrace(); |
| | | throw new VCIError("150006", new String[]{}); |
| | | } |
| | |
| | | SpecialCharService specialCharService = new SpecialCharService(); |
| | | UserEntityDelegate.setUserEntityToService(specialCharService, userEntityInfo); |
| | | SpecialChar checksPecialChar = specialCharService.getSepcialCharByClsfIdAndVal(specialCharInfo.parentId, specialCharInfo.value); |
| | | UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | if (checksPecialChar != null && !checksPecialChar.getId().equals(specialCharInfo.id)) { |
| | | throw new VCIError("10062", new String[]{}); |
| | | } |
| | |
| | | StringBuilder logres = new StringBuilder(); |
| | | logres.append("更新前:"+speciaBefore.getLogInfo()); |
| | | logres.append(" 更新后:"+specia.getLogInfo()); |
| | | LogRecordUtil.writeLog(userEntity, "更新", "成功", logres.toString(), LogType.GeneralOperation,specia.getId()); |
| | | LogRecordUtil.writeLog(userEntityInfo, "更新", "成功", logres.toString(), LogType.General,specia.getId()); |
| | | } catch (Exception e) { |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符", "修改失败!",LogType.GeneralOperation); |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符", "修改失败!",LogType.General); |
| | | e.printStackTrace(); |
| | | throw new VCIError("150010", new String[]{}); |
| | | } |
| | |
| | | public boolean deletSpecialChar(String[] ids, UserEntityInfo userEntityInfo) throws VCIError { |
| | | boolean rs = true; |
| | | SpecialCharService specialCharService = new SpecialCharService(); |
| | | UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo); |
| | | try { |
| | | UserEntityDelegate.setUserEntityToService(specialCharService, userEntityInfo); |
| | | LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); |
| | |
| | | Iterator<String> it = map.keySet().iterator(); |
| | | while(it.hasNext()){ |
| | | String logKey = it.next(); |
| | | LogRecordUtil.writeLog(userEntity, "删除", "成功", logKey, LogType.GeneralOperation,map.get(logKey)); } |
| | | LogRecordUtil.writeLog(userEntityInfo, "删除", "成功", logKey, LogType.General,map.get(logKey)); } |
| | | } catch (Exception e) { |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符", "删除失败!",LogType.GeneralOperation); |
| | | //LogRecordUtil.writeLog(userEntity, "特殊字符", "删除失败!",LogType.General); |
| | | e.printStackTrace(); |
| | | throw new VCIError("150001", new String[]{}); |
| | | } |