|
|
@ -11,6 +11,7 @@ import com.ccsens.ptos_open.bean.po.*; |
|
|
import com.ccsens.ptos_open.bean.vo.BusinessVo; |
|
|
import com.ccsens.ptos_open.bean.vo.BusinessVo; |
|
|
import com.ccsens.ptos_open.bean.vo.PluginVo; |
|
|
import com.ccsens.ptos_open.bean.vo.PluginVo; |
|
|
import com.ccsens.ptos_open.persist.dao.PluginDao; |
|
|
import com.ccsens.ptos_open.persist.dao.PluginDao; |
|
|
|
|
|
import com.ccsens.ptos_open.persist.dao.UserDao; |
|
|
import com.ccsens.ptos_open.persist.mapper.OpenPluginImgMapper; |
|
|
import com.ccsens.ptos_open.persist.mapper.OpenPluginImgMapper; |
|
|
import com.ccsens.ptos_open.util.OpenCodeError; |
|
|
import com.ccsens.ptos_open.util.OpenCodeError; |
|
|
import com.ccsens.util.CodeEnum; |
|
|
import com.ccsens.util.CodeEnum; |
|
|
@ -33,7 +34,10 @@ import java.util.List; |
|
|
@Service |
|
|
@Service |
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
|
|
public class PluginService implements IPluginService { |
|
|
public class PluginService implements IPluginService { |
|
|
|
|
|
@Resource |
|
|
|
|
|
private OpenPluginImgMapper imgMapper; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private UserDao userDao; |
|
|
@Resource |
|
|
@Resource |
|
|
private PluginDao pluginDao; |
|
|
private PluginDao pluginDao; |
|
|
@Resource |
|
|
@Resource |
|
|
@ -185,12 +189,26 @@ public class PluginService implements IPluginService { |
|
|
pluginInfo.setUpdatedTime(openPlugin.getUpdatedAt().getTime()); |
|
|
pluginInfo.setUpdatedTime(openPlugin.getUpdatedAt().getTime()); |
|
|
pluginInfo.setAuthorId(openPlugin.getCreatorId()); |
|
|
pluginInfo.setAuthorId(openPlugin.getCreatorId()); |
|
|
//作者id查user表
|
|
|
//作者id查user表
|
|
|
|
|
|
String userName = userDao.getUserNameById(openPlugin.getCreatorId()); |
|
|
// pluginInfo.setAuthorName(openPlugin.);
|
|
|
pluginInfo.setAuthorName(userName); |
|
|
//
|
|
|
//通过id查询预览图
|
|
|
// pluginInfo.setPreview(openPlugin.get);
|
|
|
OpenPluginImgExample imgExample = new OpenPluginImgExample(); |
|
|
//
|
|
|
imgExample.createCriteria().andPluginIdEqualTo(openPlugin.getId()).andTypeEqualTo((byte)0); |
|
|
// pluginInfo.setMine(openPlugin.get);
|
|
|
List<OpenPluginImg> Img =imgMapper.selectByExample(imgExample); |
|
|
|
|
|
String path = null; |
|
|
|
|
|
if(Img != null && Img.size() != 0){ |
|
|
|
|
|
Img.get(0); |
|
|
|
|
|
path = Img.get(0).getFilePath(); |
|
|
|
|
|
} |
|
|
|
|
|
pluginInfo.setPreview(path); |
|
|
|
|
|
|
|
|
|
|
|
if(openPlugin.getCreatorId() == userId) { |
|
|
|
|
|
Byte main = 1; |
|
|
|
|
|
pluginInfo.setMine(main); |
|
|
|
|
|
} else { |
|
|
|
|
|
Byte main = 0; |
|
|
|
|
|
pluginInfo.setMine(main); |
|
|
|
|
|
} |
|
|
pluginInfo.setHtml(openPlugin.getHtml()); |
|
|
pluginInfo.setHtml(openPlugin.getHtml()); |
|
|
pluginInfo.setCss(openPlugin.getCss()); |
|
|
pluginInfo.setCss(openPlugin.getCss()); |
|
|
pluginInfo.setJs(openPlugin.getJs()); |
|
|
pluginInfo.setJs(openPlugin.getJs()); |
|
|
|