|
|
@@ -6,19 +6,14 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
-
|
|
|
-import org.apache.poi.poifs.property.Child;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
import com.goafanti.business.bo.JtBusinessCategoryBo;
|
|
|
import com.goafanti.business.bo.JtBusinessCategoryTree;
|
|
|
import com.goafanti.business.bo.JtBusinessProjectResult;
|
|
|
import com.goafanti.business.bo.makeMoneyCategoryListBo;
|
|
|
import com.goafanti.business.service.JtBusinessService;
|
|
|
-import com.goafanti.comment.bo.CommentDetailResult;
|
|
|
import com.goafanti.common.bo.MyCollection;
|
|
|
import com.goafanti.common.dao.JtBusinessCategoryMapper;
|
|
|
import com.goafanti.common.dao.JtBusinessProjectMapper;
|
|
|
@@ -27,18 +22,14 @@ import com.goafanti.common.dao.JtCommodityCommentMapper;
|
|
|
import com.goafanti.common.dao.JtTagMapper;
|
|
|
import com.goafanti.common.enums.BusinessCategoryModule;
|
|
|
import com.goafanti.common.enums.ProjectAuditStatus;
|
|
|
-import com.goafanti.common.enums.UserAuthentication;
|
|
|
import com.goafanti.common.enums.collectType;
|
|
|
import com.goafanti.common.model.JtBusinessCategory;
|
|
|
-import com.goafanti.common.model.JtBusinessCategoryExample;
|
|
|
import com.goafanti.common.model.JtBusinessProject;
|
|
|
import com.goafanti.common.model.JtCollectSearch;
|
|
|
-import com.goafanti.common.model.JtTag;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
-import com.goafanti.order.enums.AuditState;
|
|
|
|
|
|
@Service
|
|
|
public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapper> implements JtBusinessService{
|
|
|
@@ -56,19 +47,16 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
private JtCollectSearchMapper jtCollectSearchMapper;
|
|
|
@Override
|
|
|
public JtBusinessCategory getBusinessCategoryByLayerAndName(Integer layer, String name) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
return jtBusinessCategoryMapper.getBusinessCategoryByLayerAndName(layer, name);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<JtBusinessCategory> getBusinessCategoryBySuperId(String id,Integer size) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
return jtBusinessCategoryMapper.getBusinessCategoryBySuperId(id,size);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<JtBusinessProject> getBusinessProjectByCategoryId(String id,Integer size,Integer isHot) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
return jtBusinessProjectMapper.getBusinessProjectByCategoryId(id,size,isHot);
|
|
|
}
|
|
|
|
|
|
@@ -85,7 +73,6 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
|
|
|
@Override
|
|
|
public JtBusinessCategoryTree getCategoryTree(String id) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
return jtBusinessCategoryMapper.getCategoryTree(id);
|
|
|
}
|
|
|
|
|
|
@@ -158,7 +145,6 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
|
|
|
@Override
|
|
|
public int insertCategory(JtBusinessCategory jtBusinessCategory) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
// jtBusinessCategoryMapper.autoIncreaseSort(jtBusinessCategory.getLayer(),jtBusinessCategory.getSort());
|
|
|
if(jtBusinessCategory.getSuperId()!=null && jtBusinessCategory.getLayer().intValue()==1 && jtBusinessCategory.getSuperId().length()>0)return -2;
|
|
|
//查看是否重名
|
|
|
@@ -207,7 +193,6 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
|
|
|
@Override
|
|
|
public int deleteCategoryById(String id) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
//查找品类
|
|
|
JtBusinessCategory sp=jtBusinessCategoryMapper.selectByPrimaryKey(id);
|
|
|
//查找子品类 存在子品类不允许删除
|
|
|
@@ -224,14 +209,12 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
|
|
|
@Override
|
|
|
public JtBusinessCategory getCategoryById(String id) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
return jtBusinessCategoryMapper.selectByPrimaryKey(id);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int updateCategory(JtBusinessCategory jtBusinessCategory) {
|
|
|
// 层级不会变
|
|
|
- // TODO Auto-generated method stub
|
|
|
//修改不影响结构的数据
|
|
|
JtBusinessCategory category = new JtBusinessCategory();
|
|
|
category.setId(jtBusinessCategory.getId());
|
|
|
@@ -311,27 +294,10 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
|
|
|
|
|
|
|
|
|
- private Map<String, Object> disposeCategoryParams(String name,Integer layer ) {
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
-
|
|
|
- if (layer!=null) {
|
|
|
- params.put("layer", layer);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
- if (StringUtils.isNotBlank(name)) {
|
|
|
- params.put("name", name);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- return params;
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
public int insertProject(JtBusinessProject jtBusinessProject) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
jtBusinessProject.setCreateTime(new Date());
|
|
|
jtBusinessProject.setId(UUID.randomUUID().toString());
|
|
|
jtBusinessProject.setOwnerId(TokenManager.getUserId());
|
|
|
@@ -348,7 +314,6 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
cSize=Integer.parseInt(nbString)+1;
|
|
|
cSize=Math.max(cSize, projects.size()+1);
|
|
|
}catch (Exception e) {
|
|
|
- // TODO: handle exception
|
|
|
return -1;
|
|
|
}
|
|
|
}
|
|
|
@@ -387,13 +352,11 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
|
|
|
@Override
|
|
|
public List<JtBusinessProject> getProjectsLimit(Integer size) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
return jtBusinessProjectMapper.findProjectOrderByNumber();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int deleteByIdAndUid(String id) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
if(TokenManager.getUserId()==null)return -1;
|
|
|
return jtBusinessProjectMapper.deleteByIdAndUid(id,TokenManager.getUserId());
|
|
|
}
|
|
|
@@ -401,7 +364,6 @@ public class JtBusinessServiceImpl extends BaseMybatisDao<JtBusinessProjectMapp
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<JtBusinessProject> listProjectIInterestedIn(Integer pageNo,Integer pageSize) {
|
|
|
- // TODO Auto-generated method stub
|
|
|
|
|
|
if (pageNo == null || pageNo < 0) {
|
|
|
pageNo = 1;
|