* 'master' of http://221.0.232.152:9393/ability-center/share-platform:
  npe
  npe
  删除无用代码,清除system.out代码,去除无用import
This commit is contained in:
huangweixiong 2022-06-10 09:29:25 +08:00
commit 46b38e4edb
8 changed files with 13 additions and 19 deletions

View File

@ -30,9 +30,9 @@ public class FileUploadController {
@Value("${server.servlet.context-path}")
private String context_path;
private static Logger logger = LoggerFactory.getLogger(FileUploadController.class);
private static final Logger logger = LoggerFactory.getLogger(FileUploadController.class);
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/");
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/");
@PostMapping("/upload")
@ApiOperation("上传")

View File

@ -178,8 +178,6 @@ public class SJZTService {
String url = "?actionType={1}&senderCode={2}&data={3}";
String senderCode = "";//发送方标识
String actionType = "UP_REC_REPORT";//调用方法固定值
boolean result = false;
ResponseEntity<JSONObject> responseEntity;
try{
responseEntity = restTemplate.postForEntity(url, null, JSONObject.class,senderCode,actionType,data);

View File

@ -232,7 +232,11 @@ public class ResourceController {
return new Result().ok(map);
} catch (Exception e) {
e.printStackTrace();
return new Result().ok(new HashMap<>());
return new Result().ok(new HashMap<String, Object>(){{
put("sxmlcount", 0);
put("yfbfwcount", 0);
put("yfbjk", 0);
}});
}
}

View File

@ -35,7 +35,7 @@ import java.util.Map;
*/
@Component
public class ResourceUndercarriageListener implements TaskListener, ExecutionListener {
private static Logger logger = LoggerFactory.getLogger(ResourceUndercarriageListener.class);
private static final Logger logger = LoggerFactory.getLogger(ResourceUndercarriageListener.class);
@Value("${big_date.name}")
private String bigDateDeptName; // 大数据局名称

View File

@ -241,7 +241,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
public void updateVisits(Long id) {
ResourceEntity resourceEntity = resourceDao.selectById(id);
ResourceEntity entity = new ResourceEntity();
entity.setVisits(resourceEntity.getVisits() + 1);
entity.setVisits((resourceEntity.getVisits() == null ? 0 : resourceEntity.getVisits()) + 1);
UpdateWrapper<ResourceEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda()
.eq(ResourceEntity::getId, resourceEntity.getId())

View File

@ -43,11 +43,11 @@ public class InsertTaskListJob implements ITask {
Map<String, Object> key = (Map<String, Object>) index;
String eventType = (String) key.get("eventType");
String eventCnName = (String) key.get("eventCnName");
JSONObject taskListBody = shangTangService.tasklist(eventType);
if (taskListBody.isEmpty()) {
Optional<JSONObject> taskListBody = Optional.ofNullable(shangTangService.tasklist(eventType));
if (!taskListBody.isPresent() || taskListBody.get().isEmpty()) {
return;
}
Optional<JSONObject> taskdatajobj = Optional.ofNullable(taskListBody.getJSONObject("data"));
Optional<JSONObject> taskdatajobj = Optional.ofNullable(taskListBody.get().getJSONObject("data"));
taskdatajobj.ifPresent(task -> {
Optional<JSONArray> taskdatajobjJSONArray = Optional.ofNullable(task.getJSONArray("dataList"));
taskdatajobjJSONArray.orElse(new JSONArray()).stream().forEach(index_ -> {

View File

@ -19,11 +19,8 @@ public class DynamicDataSourceTest {
@Test
public void test(){
// Long id = 1067246875800000001L;
Long id = 1067246875800000001L;
// dynamicDataSourceTestService.updateUser(id);
// dynamicDataSourceTestService.updateUserBySlave1(id);
//dynamicDataSourceTestService.updateUserBySlave2(id);
}

View File

@ -1,11 +1,6 @@
package io.renren.service;
import io.renren.commons.dynamic.datasource.annotation.DataSource;
import io.renren.modules.sys.dao.SysUserDao;
import io.renren.modules.sys.entity.SysUserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 测试多数据源