if(!msgs.isEmpty()){
saveMessages(request, msgs);
break;
}
SiteBean site = super.getSiteBean(request);
MusicBean mbean = MusicDAO.getMusicByID(mform.getId());
//�ж��Ƿ�Ϊ��վ����
if(mbean==null ||mbean.getSite().getId()!=site.getId()){
break;
}
if (mbean.getStatus() == MusicBean.STATUS_NORMAL) {
// ��֤�µ����ֺе���Ч��(�ƶ����������ֺ�)
if ((mbean.getMusicBox() == null && mform.getBox() > 0)
|| (mbean.getMusicBox() != null && mform.getBox() != mbean
.getMusicBox().getId())) {
MusicBoxBean mbox = MusicDAO
.getMusicBoxByID(mform.getBox());
//�ж��Ƿ�Ϊ��վ�����ֺ�
if(mbox!=null && mbox.getSite().getId()!=site.getId()){
break;
}
//�任���ֺ�
if (mbox != null
&& (mbean.getMusicBox() == null || mbean.getMusicBox()
.getId() != mbox.getId())) {
//�������ֺ�֮���ƶ����ߴ�����
if (mbean.getMusicBox() != null)
mbean.getMusicBox().incMusicCount(-1);
mbean.setMusicBox(mbox);
mbox.incMusicCount(1);
} else if (mbox == null && mbean.getMusicBox() != null) {
//�����
mbean.getMusicBox().incMusicCount(-1);
mbean.setMusicBox(null);
}
}
}
//����ֵ
if(!StringUtils.equals(mbean.getTitle(), mform.getTitle()))
mbean.setTitle(super.autoFiltrate(site,mform.getTitle()));
if (StringUtils.isNotEmpty(mform.getAlbum()))
mbean.setAlbum(super.autoFiltrate(site,mform.getAlbum()));
if (StringUtils.isNotEmpty(mform.getSinger()))
mbean.setSinger(super.autoFiltrate(site,mform.getSinger()));
if (StringUtils.isNotEmpty(mform.getUrl()))
mbean.setUrl(mform.getUrl());
if (StringUtils.isNotEmpty(mform.getWord())){
String word = StringUtils.abbreviate(super.autoFiltrate(site,
mform.getWord()), MAX_MUSIC_LENGTH);
mbean.setWord(super.filterScriptAndStyle(word));
}
else
mbean.setWord(" ");
if (mbean.getStatus() != MusicBean.STATUS_NORMAL) {
// �����Ƽ����������
mbean.getMusicBox().incMusicCount(1);
mbean.setStatus(MusicBean.STATUS_NORMAL);
}
MusicDAO.flush();
break;
}while(true);