LMS版本同步马钢版本
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
package org.nl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.nl.config.MapOf;
|
||||
import org.nl.system.service.user.ISysUserService;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.region.service.ISchBaseRegionService;
|
||||
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task_manage.task.tasks.yz.mapper.YZMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -20,27 +21,15 @@ public class ApplicationTest {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private ISchBaseRegionService regionService;
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
private YZMapper yzMapper;
|
||||
@Test
|
||||
void contextLoads() {
|
||||
System.out.println(userService.list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试多数据源情况的事务
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
void contextLoads1() {
|
||||
SchBaseRegion region = new SchBaseRegion();
|
||||
region.setRegion_code("ee");
|
||||
region.setRegion_name("sss");
|
||||
region.setCreate_id("1");
|
||||
region.setCreate_name("sss");
|
||||
region.setCreate_time(DateUtil.now());
|
||||
regionService.save(region);
|
||||
int n = 1 / 0;
|
||||
void yzMapperTest() {
|
||||
List<SchBasePoint> pointForYZSL = yzMapper.findPointForYZSL(new JSONObject(
|
||||
MapOf.of("regionCode", "HCSSX", "pointType", "1")));
|
||||
System.out.println(pointForYZSL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package org.nl.task;
|
||||
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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.config.MapOf;
|
||||
import org.nl.wms.sch.task_manage.task.tasks.mapper.TestMapper;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.util.test.mapper.TestMapper;
|
||||
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.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -25,6 +26,9 @@ public class MapperTest {
|
||||
@Autowired
|
||||
private TestMapper testMapper;
|
||||
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
|
||||
/**
|
||||
* 无参查询
|
||||
* 返回类型: List<HashMap<String, Object>> 等同于JSONArray
|
||||
@@ -161,19 +165,11 @@ public class MapperTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void test1() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
System.out.println(SecureUtil.md5("123456"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用第二数据源
|
||||
*/
|
||||
@Test
|
||||
@Transactional
|
||||
void testMapper13() {
|
||||
JSONObject all13 = testMapper.getAll13();
|
||||
System.out.println("结果集:" + all13);
|
||||
SchBasePoint bcphj01 = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, "BCPHJ01"));
|
||||
String s = JSON.toJSONString(bcphj01);
|
||||
JSONObject jsonObject = JSONObject.parseObject(s);
|
||||
jsonObject.put("point_name", "测试");
|
||||
testMapper.updateByObject(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user