|
@@ -46,11 +46,8 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
@Autowired
|
|
|
WorkService workService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private CatalogMapper catalogMapper;
|
|
|
|
|
|
- @Autowired
|
|
|
- private CatalogService catalogService;
|
|
|
+
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -97,12 +94,12 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
try {
|
|
|
HttpResponse httpResponse = HttpUtils.doPost(url, headers, reqParam);
|
|
|
restResult = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
|
|
|
- log.info("restResult: " + restResult);
|
|
|
+ log.debug("restResult: " + restResult);
|
|
|
|
|
|
- // JSONObject.parse(restResult);
|
|
|
|
|
|
reJson = JSONObject.parseObject(restResult);
|
|
|
int code = reJson.getInteger("code");
|
|
|
+ log.info("resultCode: {}", code);
|
|
|
|
|
|
if (code == 3004) {
|
|
|
String msg = reJson.getString("msg");
|
|
@@ -132,6 +129,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
pro.setSceneName(proJson.getString("sceneName"));
|
|
|
pro.setThumb(proJson.getString("thumb"));
|
|
|
pro.setStatus(proJson.getInteger("status"));
|
|
|
+ pro.setCreateTime(proJson.getString("createTime"));
|
|
|
|
|
|
if (useScenes.contains(pro.getNum())) {
|
|
|
pro.setIsUse(1);
|
|
@@ -151,32 +149,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Result saveEntity(SceneDto param) {
|
|
|
- Long id = param.getId();
|
|
|
- SceneEntity entity = null;
|
|
|
- if (id == null) {
|
|
|
- entity = new SceneEntity();
|
|
|
- BeanUtils.copyProperties(param, entity);
|
|
|
-
|
|
|
- // 当没有分组时,创建默认分组
|
|
|
- if (param.getCatalogId() == null) {
|
|
|
- // 检查该用户是否存在默认分组
|
|
|
- Long catalogId = getCatalogId(entity.getWorkId());
|
|
|
- entity.setCatalogId(catalogId);
|
|
|
- }
|
|
|
- this.save(entity);
|
|
|
- } else {
|
|
|
- entity = findById(id);
|
|
|
- BeanUtils.copyProperties(param, entity);
|
|
|
- entity.setUpdateTime(new Date());
|
|
|
- this.update(entity);
|
|
|
-
|
|
|
- }
|
|
|
- return Result.success(entity);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @Override
|
|
|
public Result saves(List<SceneDto> params) {
|
|
|
SceneEntity entity = null;
|
|
|
for (SceneDto sceneDto : params) {
|
|
@@ -184,13 +156,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
if (id == null) {
|
|
|
entity = new SceneEntity();
|
|
|
BeanUtils.copyProperties(sceneDto, entity);
|
|
|
-
|
|
|
- // 当没有分组时,创建默认分组
|
|
|
- if (sceneDto.getCatalogId() == null) {
|
|
|
- // 检查该用户是否存在默认分组
|
|
|
- Long catalogId = getCatalogId(entity.getWorkId());
|
|
|
- entity.setCatalogId(catalogId);
|
|
|
- }
|
|
|
this.save(entity);
|
|
|
} else {
|
|
|
entity = findById(id);
|
|
@@ -204,10 +169,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public List<SceneEntity> findByWorkId(Long workId) {
|
|
|
- return entityMapper.findByWorkId(workId);
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public List<String> strFindByWorkId(Long workId, String type) {
|
|
@@ -221,26 +183,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 检查用户是否存在默认分组
|
|
|
- */
|
|
|
- private Long getCatalogId(Long workId) {
|
|
|
-// List<CatalogEntity> list = catalogMapper.findByUserId(userId);
|
|
|
- List<CatalogEntity> list = catalogMapper.findByWorkId(workId);
|
|
|
- CatalogEntity entity = null;
|
|
|
- if (list.size() > 0) {
|
|
|
- entity = list.get(0);
|
|
|
- } else {
|
|
|
- entity = new CatalogEntity();
|
|
|
- entity.setName("全部场景");
|
|
|
-// entity.setUserId(userId);
|
|
|
- entity.setWorkId(workId);
|
|
|
- catalogService.save(entity);
|
|
|
|
|
|
- }
|
|
|
- return entity.getId();
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -471,13 +414,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Test
|
|
|
- public void pngToJpg() {
|
|
|
-// String png = "C:\\Users\\Administrator\\Desktop\\33\\2_1.png";
|
|
|
-// String jpg = "C:\\Users\\Administrator\\Desktop\\33\\png\\1.jpn";
|
|
|
-// ImgUtil.convert();
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
@Override
|
|
|
public Result saveUseHots(UseHotsDto param) {
|
|
@@ -497,4 +433,6 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
}
|