|
@@ -24,7 +24,6 @@ import java.util.List;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
public class ChuanyunTestController {
|
|
public class ChuanyunTestController {
|
|
-
|
|
|
|
private final ChuanYunManager chuanYunManager;
|
|
private final ChuanYunManager chuanYunManager;
|
|
private final EntityManager entityManager;
|
|
private final EntityManager entityManager;
|
|
|
|
|
|
@@ -38,65 +37,69 @@ public class ChuanyunTestController {
|
|
*/
|
|
*/
|
|
@GetMapping("/testEntity")
|
|
@GetMapping("/testEntity")
|
|
public void test() throws JsonProcessingException {
|
|
public void test() throws JsonProcessingException {
|
|
- Session session=entityManager.unwrap(Session.class);
|
|
|
|
- List<?> testList=session.createSQLQuery("select * from baba").list();
|
|
|
|
- ObjectMapper objectMapper=new ObjectMapper();
|
|
|
|
|
|
+ Session session = entityManager.unwrap(Session.class);
|
|
|
|
+ List<?> testList = session.createSQLQuery("select * from baba").list();
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
System.out.println(objectMapper.writeValueAsString(testList));
|
|
System.out.println(objectMapper.writeValueAsString(testList));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 单条查询测试
|
|
* 单条查询测试
|
|
- * @return 测试结果
|
|
|
|
|
|
+ *
|
|
|
|
+ * @return 测试结果
|
|
*/
|
|
*/
|
|
@GetMapping("/chuanyunTest/testFind")
|
|
@GetMapping("/chuanyunTest/testFind")
|
|
public String testFind() throws JsonProcessingException {
|
|
public String testFind() throws JsonProcessingException {
|
|
- ObjectMapper objectMapper=new ObjectMapper();
|
|
|
|
- ChuanyunFindBizDTO<ProjectLogDO> logTemplateChuanYunFindResponse =chuanYunManager.find(ProjectLogDO.SCHEMA_CODE,"ae5f74e9-a8f8-4d20-9e94-b594e57c12bc");
|
|
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
+ ChuanyunFindBizDTO<ProjectLogDO> logTemplateChuanYunFindResponse = chuanYunManager.find(ProjectLogDO.SCHEMA_CODE, "ae5f74e9-a8f8-4d20-9e94-b594e57c12bc");
|
|
return objectMapper.writeValueAsString(logTemplateChuanYunFindResponse);
|
|
return objectMapper.writeValueAsString(logTemplateChuanYunFindResponse);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 单条查询测试
|
|
* 单条查询测试
|
|
- * @return 测试结果
|
|
|
|
|
|
+ *
|
|
|
|
+ * @return 测试结果
|
|
*/
|
|
*/
|
|
@GetMapping("/chuanyunTest/testFindList")
|
|
@GetMapping("/chuanyunTest/testFindList")
|
|
public String testFindList() throws JsonProcessingException {
|
|
public String testFindList() throws JsonProcessingException {
|
|
- ObjectMapper objectMapper=new ObjectMapper();
|
|
|
|
- Filter testFilter=Filter.instance(0,20,true);
|
|
|
|
- ChuanyunFindAllBizDTO<ChuanyunProjectDO> logTemplateChuanYunFindAllResponse =chuanYunManager.findAll(ChuanyunProjectDO.SCHEMA_CODE,testFilter);
|
|
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
+ Filter testFilter = Filter.instance(0, 20, true);
|
|
|
|
+ ChuanyunFindAllBizDTO<ChuanyunProjectDO> logTemplateChuanYunFindAllResponse = chuanYunManager.findAll(ChuanyunProjectDO.SCHEMA_CODE, testFilter);
|
|
return objectMapper.writeValueAsString(logTemplateChuanYunFindAllResponse);
|
|
return objectMapper.writeValueAsString(logTemplateChuanYunFindAllResponse);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 保存测试
|
|
* 保存测试
|
|
- * @return 保存结果
|
|
|
|
|
|
+ *
|
|
|
|
+ * @return 保存结果
|
|
*/
|
|
*/
|
|
@GetMapping("/chuanyunTest/testSave")
|
|
@GetMapping("/chuanyunTest/testSave")
|
|
public String testSave() throws JsonProcessingException, BigSizeException {
|
|
public String testSave() throws JsonProcessingException, BigSizeException {
|
|
- MaterialResendBO resendVO=new MaterialResendBO();
|
|
|
|
|
|
+ MaterialResendBO resendVO = new MaterialResendBO();
|
|
resendVO.setRequestDate(LocalDate.now());
|
|
resendVO.setRequestDate(LocalDate.now());
|
|
resendVO.setRequestType("test");
|
|
resendVO.setRequestType("test");
|
|
- ObjectMapper objectMapper=new ObjectMapper();
|
|
|
|
- ChuanyunSaveDTO chuanyunSaveResponse= chuanYunManager.save(MaterialResendBO.SCHEMA_CODE,objectMapper.writeValueAsString(resendVO),true);
|
|
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
+ ChuanyunSaveDTO chuanyunSaveResponse = chuanYunManager.save(MaterialResendBO.SCHEMA_CODE, objectMapper.writeValueAsString(resendVO), true);
|
|
return objectMapper.writeValueAsString(chuanyunSaveResponse);
|
|
return objectMapper.writeValueAsString(chuanyunSaveResponse);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 保存所有
|
|
* 保存所有
|
|
- * @return 保存结果
|
|
|
|
- * @throws JsonProcessingException json处理异常
|
|
|
|
|
|
+ *
|
|
|
|
+ * @return 保存结果
|
|
|
|
+ * @throws JsonProcessingException json处理异常
|
|
*/
|
|
*/
|
|
@GetMapping("/chuanyunTest/testSaveAll")
|
|
@GetMapping("/chuanyunTest/testSaveAll")
|
|
public String testSaveAll() throws JsonProcessingException, BigSizeException {
|
|
public String testSaveAll() throws JsonProcessingException, BigSizeException {
|
|
- MaterialResendBO resend1=new MaterialResendBO();
|
|
|
|
- MaterialResendBO resend2=new MaterialResendBO();
|
|
|
|
|
|
+ MaterialResendBO resend1 = new MaterialResendBO();
|
|
|
|
+ MaterialResendBO resend2 = new MaterialResendBO();
|
|
resend1.setRequestType("helloChuanyunSaveAll1");
|
|
resend1.setRequestType("helloChuanyunSaveAll1");
|
|
resend2.setRequestType("helloChuanyunSaveAll2");
|
|
resend2.setRequestType("helloChuanyunSaveAll2");
|
|
- ObjectMapper objectMapper=new ObjectMapper();
|
|
|
|
- List<String> strings=new ArrayList<>();
|
|
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
+ List<String> strings = new ArrayList<>();
|
|
strings.add(objectMapper.writeValueAsString(resend1));
|
|
strings.add(objectMapper.writeValueAsString(resend1));
|
|
strings.add(objectMapper.writeValueAsString(resend2));
|
|
strings.add(objectMapper.writeValueAsString(resend2));
|
|
- ChuanyunSaveAllDTO chuanyunSaveAllResponse= chuanYunManager.saveAll(MaterialResendBO.SCHEMA_CODE,strings,true);
|
|
|
|
|
|
+ ChuanyunSaveAllDTO chuanyunSaveAllResponse = chuanYunManager.saveAll(MaterialResendBO.SCHEMA_CODE, strings, true);
|
|
return objectMapper.writeValueAsString(chuanyunSaveAllResponse);
|
|
return objectMapper.writeValueAsString(chuanyunSaveAllResponse);
|
|
}
|
|
}
|
|
}
|
|
}
|