fix: 交互业务
This commit is contained in:
@@ -1,15 +1,23 @@
|
||||
package org.nl.point;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.ext.acs.service.dto.to.wms.ApplyDeviceDto;
|
||||
import org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest;
|
||||
import org.nl.wms.sch.region.service.ISchBaseRegionService;
|
||||
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
@@ -72,4 +80,23 @@ public class test {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test04() {
|
||||
List<ApplyDeviceDto> list = new ArrayList<>();
|
||||
for (int i = 0; i < 2; i++) {
|
||||
ApplyDeviceDto applyDeviceDto = new ApplyDeviceDto();
|
||||
applyDeviceDto.setDevice_code("t" + i);
|
||||
applyDeviceDto.setVehicle_code("v" + i);
|
||||
applyDeviceDto.setVehicle_type("1");
|
||||
applyDeviceDto.setQty(String.valueOf(12 + i));
|
||||
list.add(applyDeviceDto);
|
||||
}
|
||||
ApplyTaskRequest a = new ApplyTaskRequest();
|
||||
a.setList(list);
|
||||
a.setRequestNo("sfasdf");
|
||||
String s = JSON.toJSONString(a);
|
||||
JSONObject jsonObject = JSONObject.parseObject(s);
|
||||
System.out.println(jsonObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.config.MapOf;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
@@ -172,4 +173,59 @@ public class MapperTest {
|
||||
jsonObject.put("point_name", "测试");
|
||||
testMapper.updateByObject(jsonObject);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void test111() {
|
||||
try {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
// 参数处理
|
||||
if (i == 1) {
|
||||
throw new BadRequestException("出错了 - 1");
|
||||
}
|
||||
try {
|
||||
// 创建
|
||||
if (i == 2) {
|
||||
throw new BadRequestException("出错了 - 2");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
// 记录
|
||||
System.out.println("捕获 - 2");
|
||||
}
|
||||
|
||||
// 成功
|
||||
System.out.println(i);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("捕获 - 1");
|
||||
}
|
||||
}
|
||||
@Test
|
||||
void test112() {
|
||||
try {
|
||||
// 转换
|
||||
for (int i = 0; i < 5; i++) {
|
||||
try {
|
||||
// 参数处理
|
||||
if (i == 1) {
|
||||
throw new BadRequestException("出错了 - 1");
|
||||
}
|
||||
// 创建任务
|
||||
if (i == 2) {
|
||||
throw new BadRequestException("出错了 - 2");
|
||||
}
|
||||
|
||||
// 成功
|
||||
System.out.println(i);
|
||||
} catch (Exception e) {
|
||||
// add
|
||||
System.out.println("ssssssss");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// x 400
|
||||
}
|
||||
// 200 errArray()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user