cim模块
This commit is contained in:
parent
368d78f48f
commit
a20fd1f5c8
|
@ -0,0 +1,30 @@
|
||||||
|
package io.renren.modules.resource.controller;
|
||||||
|
|
||||||
|
import io.renren.modules.resource.service.CIMService;
|
||||||
|
import io.renren.modules.sys.service.SysDeptService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资源表
|
||||||
|
*
|
||||||
|
* @author dg
|
||||||
|
* @since 1.0 2022-04-13
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/resource")
|
||||||
|
@Api(tags = "资源表")
|
||||||
|
public class CIMController {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(ResourceController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private io.renren.modules.resource.service.CIMService CIMService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysDeptService sysDeptService;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
package io.renren.modules.resource.service;
|
||||||
|
|
||||||
|
public interface CIMService {
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package io.renren.modules.resource.service.impl;
|
||||||
|
|
||||||
|
import io.renren.modules.resource.service.CIMService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CIMServiceImpl implements CIMService {
|
||||||
|
}
|
|
@ -307,13 +307,13 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
resourceDao.insert(resourceEntity);
|
resourceDao.insert(resourceEntity);
|
||||||
BeanUtils.copyProperties(resourceEntity, dto);
|
BeanUtils.copyProperties(resourceEntity, dto);
|
||||||
List<AttrEntity> attrEntities = dto.getInfoList();
|
List<AttrEntity> attrEntities = dto.getInfoList();
|
||||||
List<AttrEntity> attrEntities_ = new ArrayList<>();
|
List<AttrEntity> attrEntityList = new ArrayList<>();
|
||||||
if (attrEntities != null) {
|
if (attrEntities != null) {
|
||||||
attrEntities.forEach(item -> {
|
attrEntities.forEach(item -> {
|
||||||
item.setDelFlag(ResourceEntityDelFlag.NORMAL.getFlag());
|
item.setDelFlag(ResourceEntityDelFlag.NORMAL.getFlag());
|
||||||
item.setDataResourceId(resourceID);
|
item.setDataResourceId(resourceID);
|
||||||
attrDao.insert(item);
|
attrDao.insert(item);
|
||||||
attrEntities_.add(item);
|
attrEntityList.add(item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
for (AttrEntity attrEntity : resourceEntity.getInfoList()) {
|
for (AttrEntity attrEntity : resourceEntity.getInfoList()) {
|
||||||
|
@ -321,7 +321,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
if (StringUtils.isNotBlank(attrEntity.getAttrValue())) {
|
if (StringUtils.isNotBlank(attrEntity.getAttrValue())) {
|
||||||
String[] ids = attrEntity.getAttrValue().split(",");
|
String[] ids = attrEntity.getAttrValue().split(",");
|
||||||
if (ids.length != 0) {
|
if (ids.length != 0) {
|
||||||
|
|
||||||
for (String keyid : ids) {
|
for (String keyid : ids) {
|
||||||
TbDataResourceRelEntity resourceRel = new TbDataResourceRelEntity();
|
TbDataResourceRelEntity resourceRel = new TbDataResourceRelEntity();
|
||||||
resourceRel.setKeyId(Long.valueOf(keyid));
|
resourceRel.setKeyId(Long.valueOf(keyid));
|
||||||
|
@ -332,7 +331,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resourceEntity.setInfoList(attrEntities_);
|
resourceEntity.setInfoList(attrEntityList);
|
||||||
resourceDao.updateById(resourceEntity);
|
resourceDao.updateById(resourceEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package io.renren.modules.resourceCar.service.impl;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import io.renren.common.constant.Constant;
|
||||||
import io.renren.common.service.impl.CrudServiceImpl;
|
import io.renren.common.service.impl.CrudServiceImpl;
|
||||||
import io.renren.modules.resource.service.ResourceService;
|
import io.renren.modules.resource.service.ResourceService;
|
||||||
import io.renren.modules.resourceCar.dao.ResourceCarDao;
|
import io.renren.modules.resourceCar.dao.ResourceCarDao;
|
||||||
|
@ -58,8 +59,7 @@ public class ResourceCarServiceImpl extends CrudServiceImpl<ResourceCarDao, Reso
|
||||||
selectMap.put("user_id", userId);
|
selectMap.put("user_id", userId);
|
||||||
selectMap.put("del_flag", 0);
|
selectMap.put("del_flag", 0);
|
||||||
List<ResourceCarEntity> carEntities = resourceCarDao.selectByMap(selectMap);
|
List<ResourceCarEntity> carEntities = resourceCarDao.selectByMap(selectMap);
|
||||||
//TODO: 固定资源id改为配置文件
|
if (carEntities.isEmpty() || dto.getResourceId() == Constant.CEMERALISTID) {
|
||||||
if (carEntities.isEmpty() || dto.getResourceId() == 8888888880000000001L) {
|
|
||||||
ResourceCarEntity carEntity = new ResourceCarEntity();
|
ResourceCarEntity carEntity = new ResourceCarEntity();
|
||||||
dto.setUserId(userId);
|
dto.setUserId(userId);
|
||||||
BeanUtils.copyProperties(dto, carEntity);
|
BeanUtils.copyProperties(dto, carEntity);
|
||||||
|
|
|
@ -94,6 +94,10 @@ public interface Constant {
|
||||||
* 代码生成参数KEY
|
* 代码生成参数KEY
|
||||||
*/
|
*/
|
||||||
String DEV_TOOLS_PARAM_KEY = "DEV_TOOLS_PARAM_KEY";
|
String DEV_TOOLS_PARAM_KEY = "DEV_TOOLS_PARAM_KEY";
|
||||||
|
/**
|
||||||
|
* 将视频资源申请全部视为一个特殊能力,使用此ID
|
||||||
|
*/
|
||||||
|
Long CEMERALISTID = 8888888880000000001L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务状态
|
* 定时任务状态
|
||||||
|
|
Loading…
Reference in New Issue