提交 1188fd60 authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 1a200b67
package com.zrqx.core.model.resource.publicLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
@Data
@ApiModel(value="ClassifyRelation",description="自定义分类关系表")
@Table(name = "res_classify_relation")
public class ClassifyRelation {
@Id
@GeneratedValue(strategy =GenerationType.IDENTITY, generator = "SELECT REPLACE (UUID(), '-', '')")
@ApiModelProperty("id")
private String id;
@ApiModelProperty("资源id")
private String objectId;
@ApiModelProperty("自定义分类id")
private String dtId;
@ApiModelProperty("自定义分类code")
private String code;
@ApiModelProperty("资源类型")
private String objectType;
}
package com.zrqx.core.model.resource.publicLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
@Data
@ApiModel(value="LabelRelation",description="标签关系表")
@Table(name = "res_label_relation")
public class LabelRelation {
@Id
@GeneratedValue(strategy =GenerationType.IDENTITY, generator = "SELECT REPLACE (UUID(), '-', '')")
@ApiModelProperty("id")
private String id;
@ApiModelProperty("资源id")
private String objectId;
@ApiModelProperty("资源类型")
private String objectType;
@ApiModelProperty("标签id")
private String labelId;
@ApiModelProperty(value = "标签内容id")
private String labelContentId;
@ApiModelProperty(value = "标签内容code")
private String labelContentCode;
}
package com.zrqx.core.model.resource.publicLibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
@Data
@ApiModel(value = "ResourceRelation", description = "关联资源")
@Table(name = "res_resource_relation")
public class ResourceRelation {
@Id
@GeneratedValue(strategy =GenerationType.IDENTITY, generator = "SELECT REPLACE (UUID(), '-', '')")
@ApiModelProperty("关联表id")
private String id;
@ApiModelProperty("PDFid")
private String objectId;
@ApiModelProperty("资源id")
private String resourceId;
@ApiModelProperty("资源类型")
private Integer resourceType;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("资源名称")
private String name;
@ApiModelProperty("封面")
private String cover;
}
...@@ -84,4 +84,6 @@ public class ClauseLibraryOneVo { ...@@ -84,4 +84,6 @@ public class ClauseLibraryOneVo {
private Integer videoResourceType; private Integer videoResourceType;
@ApiModelProperty("判断音频,资源来自新上传资源(值为1)还是已有资源绑定(值为2)") @ApiModelProperty("判断音频,资源来自新上传资源(值为1)还是已有资源绑定(值为2)")
private Integer audioResourceType; private Integer audioResourceType;
@ApiModelProperty("附件列表 用逗号分隔")
private String attachmentList;
} }
package com.zrqx.resource.bg.mapper.publicLibrary;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.publicLibrary.ClassifyRelation;
/**
*自定义分类关系表
*/
public interface ClassifyRelationMapper extends BaseMapper<ClassifyRelation> {
}
package com.zrqx.resource.bg.mapper.publicLibrary;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.publicLibrary.LabelRelation;
/**
* 自定义标签关系表
* @author rjc
* @date 2019年5月22日下午3:45:45
*/
public interface LabelRelationMapper extends BaseMapper<LabelRelation> {
}
package com.zrqx.resource.bg.mapper.publicLibrary;
import java.util.List;
import org.apache.ibatis.annotations.Select;
import com.zrqx.core.form.resource.bg.QueryResourceRelationForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.publicLibrary.ResourceRelation;
import com.zrqx.core.vo.resource.ResourceRelationVo;
public interface ResourceRelationMapper extends BaseMapper<ResourceRelation> {
@Select("<script>"
+ "select id ,objectId,name,resourceId,resourceType,cover,createTime from res_resource_relation "
+ "where objectId = #{id} "
+ "<if test='resourceType != null'> and resourceType = #{resourceType}</if>"
+ "<if test='name != null'> and name like concat ('%',#{name},'%')</if>"
+ "</script>")
List<ResourceRelationVo> queryByIdAndResourceType(QueryResourceRelationForm entity);
}
...@@ -368,6 +368,7 @@ public class ClauseLibraryServiceImpl extends BaseServiceImpl<ClauseLibrary, Int ...@@ -368,6 +368,7 @@ public class ClauseLibraryServiceImpl extends BaseServiceImpl<ClauseLibrary, Int
// 保存商品信息 // 保存商品信息
ClauseGoods goods = new ClauseGoods(); ClauseGoods goods = new ClauseGoods();
BeanUtils.copyProperties(form, goods); BeanUtils.copyProperties(form, goods);
goods.setId(null);
if (StringUtils.isNotBlank(form.getStartDate())) { if (StringUtils.isNotBlank(form.getStartDate())) {
goods.setStartDate(sdf.parse(form.getStartDate())); goods.setStartDate(sdf.parse(form.getStartDate()));
} }
......
package com.zrqx.resource.bg.service.publicLibrary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.publicLibrary.ClassifyRelation;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.resource.bg.mapper.publicLibrary.ClassifyRelationMapper;
/**
* 自定义分类关系表
* @author rjc
* @date 2019年5月22日下午3:46:08
*/
@Service
public class ClassifyRelationSerivceImpl extends BaseServiceImpl<ClassifyRelation,Integer> implements ClassifyRelationService {
@Autowired
private ClassifyRelationMapper mapper;
@Override
public BaseMapper<ClassifyRelation> getMapper() {
return mapper;
}
}
package com.zrqx.resource.bg.service.publicLibrary;
import com.zrqx.core.model.resource.publicLibrary.ClassifyRelation;
import com.zrqx.core.service.BaseService;
/**
* 自定义分类关系表
* @author rjc
* @date 2019年5月22日下午3:46:48
*/
public interface ClassifyRelationService extends BaseService<ClassifyRelation,Integer>{
}
package com.zrqx.resource.bg.service.publicLibrary;
import com.zrqx.core.model.resource.publicLibrary.LabelRelation;
import com.zrqx.core.service.BaseService;
/**
* 自定义标签关系表
* @author rjc
* @date 2019年5月22日下午3:47:07
*/
public interface LabelRelationService extends BaseService<LabelRelation, Integer> {
}
package com.zrqx.resource.bg.service.publicLibrary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.publicLibrary.LabelRelation;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.resource.bg.mapper.publicLibrary.LabelRelationMapper;
@Service
public class LabelRelationServiceImpl extends BaseServiceImpl<LabelRelation, Integer> implements LabelRelationService{
@Autowired
private LabelRelationMapper labelMapper;
@Override
public BaseMapper<LabelRelation> getMapper() {
// TODO Auto-generated method stub
return labelMapper;
}
}
package com.zrqx.resource.bg.service.publicLibrary;
import java.util.List;
import com.zrqx.core.form.resource.bg.QueryResourceRelationForm;
import com.zrqx.core.model.resource.publicLibrary.ResourceRelation;
import com.zrqx.core.service.BaseService;
import com.zrqx.core.util.PageParam;
import com.zrqx.core.vo.resource.ResourceRelationVo;
public interface ResourceRelationService extends BaseService<ResourceRelation, Integer> {
/**
* 获取相关资源列表
* @param entity
* @param pageParam
* @return
* @author yzg
* @date: 2018年7月24日 上午9:09:34
*/
List<ResourceRelationVo> queryByIdAndResourceType(QueryResourceRelationForm entity, PageParam pageParam);
/**
* 批量删除相关资源
* @param ids
* @return
* @author rjc
* @date: 2019年2月15日 下午4:16:02
*/
boolean batchDeleteResource(List<String> ids);
}
package com.zrqx.resource.bg.service.publicLibrary;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.zrqx.core.exception.BaseException;
import com.zrqx.core.form.resource.bg.QueryResourceRelationForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.publicLibrary.ResourceRelation;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.core.util.PageParam;
import com.zrqx.core.vo.resource.ResourceRelationVo;
import com.zrqx.resource.bg.mapper.publicLibrary.ResourceRelationMapper;
@Service
public class ResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelation, Integer> implements ResourceRelationService{
@Autowired
private ResourceRelationMapper resourceRelationMapper;
@Override
public BaseMapper<ResourceRelation> getMapper() {
// TODO Auto-generated method stub
return resourceRelationMapper;
}
/**
* 获取相关资源列表
* @see com.zrqx.resource.bg.service.articlelibrary.ArticleResourceService#queryByIdAndResourceType(com.zrqx.core.form.resource.bg.QueryResourceRelationForm, com.zrqx.core.util.PageParam)
* @param entity
* @param pageParam
* @return
* @author yzg
* @date: 2018年7月24日 上午9:10:11
*/
@Override
public List<ResourceRelationVo> queryByIdAndResourceType(QueryResourceRelationForm entity, PageParam pageParam) {
PageHelper.startPage(pageParam);
// TODO Auto-generated method stub
return resourceRelationMapper.queryByIdAndResourceType(entity);
}
/**
* 批量删除相关资源
* @param ids
* @return
* @author rjc
* @date: 2019年2月15日 下午4:15:00
*/
@Override
public boolean batchDeleteResource(List<String> ids) {
if (ids==null) {
throw new BaseException(-7,"没有选中任何数据,请重新选择");
}
createCriteria().andIn("id", ids);
List<ResourceRelation> list = resourceRelationMapper.selectByExample(example);
for (ResourceRelation entity : list) {
entity.setId(entity.getId());
resourceRelationMapper.delete(entity);
}
return true;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论