|
|
@@ -49,7 +49,7 @@ public class LogoService extends BaseService<Logo> {
|
|
|
for (Logo logo : Logo) {
|
|
|
List<Attachment> attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.LOGO, logo.getId(), null);
|
|
|
if (null != attachments && attachments.size() > 0) {
|
|
|
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(),attachments.get(0).getDownload_uri());
|
|
|
+ FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
|
|
|
logo.setFileDown(fileDown);
|
|
|
}
|
|
|
}
|
|
|
@@ -64,11 +64,11 @@ public class LogoService extends BaseService<Logo> {
|
|
|
criteria.andEqualTo("is_start", 1);
|
|
|
example.orderBy("create_time").desc();
|
|
|
List<Logo> logo = this.selectByExample(example);
|
|
|
- if (null != logo) {
|
|
|
+ if (null != logo && logo.size() > 0) {
|
|
|
Logo lo = logo.get(0);
|
|
|
List<Attachment> attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.LOGO, lo.getId(), null);
|
|
|
if (null != attachments && attachments.size() > 0) {
|
|
|
- FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(),attachments.get(0).getDownload_uri());
|
|
|
+ FileDown fileDown = new FileDown(attachments.get(0).getId(), attachments.get(0).getFile_name(), attachments.get(0).getFile_url(), attachments.get(0).getDownload_uri());
|
|
|
lo.setFileDown(fileDown);
|
|
|
}
|
|
|
return lo;
|
|
|
@@ -79,7 +79,7 @@ public class LogoService extends BaseService<Logo> {
|
|
|
public Boolean saveLogo(Logo logo) throws Exception {
|
|
|
if (this.insertAndGetId(logo) > 0) {
|
|
|
//更新其他logo
|
|
|
- if(null!=logo.getIs_start()&&logo.getIs_start()){
|
|
|
+ if (null != logo.getIs_start() && logo.getIs_start()) {
|
|
|
logoDao.updateOtherLogo(logo.getId());
|
|
|
}
|
|
|
attachmentDao.deleteByBusiness(Constant.Attachment.LOGO, logo.getId());
|
|
|
@@ -94,10 +94,10 @@ public class LogoService extends BaseService<Logo> {
|
|
|
public Boolean updateLogo(Logo logo) throws Exception {
|
|
|
if (this.updateSelective(logo) == 1) {
|
|
|
//更新其他logo
|
|
|
- if(null!=logo.getIs_start()&&logo.getIs_start()){
|
|
|
+ if (null != logo.getIs_start() && logo.getIs_start()) {
|
|
|
logoDao.updateOtherLogo(logo.getId());
|
|
|
}
|
|
|
- if(null!=logo.getFileDown().getFile_id()) {
|
|
|
+ if (null != logo.getFileDown().getFile_id()) {
|
|
|
attachmentDao.deleteByBusiness(Constant.Attachment.LOGO, logo.getId());
|
|
|
attachmentDao.updateAttachment(Constant.Attachment.LOGO, logo.getId(), logo.getFileDown().getFile_id());
|
|
|
}
|
|
|
@@ -125,7 +125,8 @@ public class LogoService extends BaseService<Logo> {
|
|
|
public void updateOtherLogo(Integer id) throws Exception {
|
|
|
logoDao.updateOtherLogo(id);
|
|
|
}
|
|
|
- public Integer countLogo(Integer id) throws Exception {
|
|
|
- return logoDao.countLogo(id);
|
|
|
+
|
|
|
+ public Integer countLogo(Integer id) throws Exception {
|
|
|
+ return logoDao.countLogo(id);
|
|
|
}
|
|
|
}
|