rev: 混碾下料任务修改、物料修改、工单修改
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
package org.nl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.enums.PointStatusEnum;
|
||||
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;
|
||||
@@ -21,6 +26,8 @@ public class ApplicationTest {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
@Autowired
|
||||
private YZMapper yzMapper;
|
||||
@Test
|
||||
void contextLoads() {
|
||||
@@ -28,8 +35,32 @@ public class ApplicationTest {
|
||||
}
|
||||
@Test
|
||||
void yzMapperTest() {
|
||||
List<SchBasePoint> pointForYZSL = yzMapper.findPointForYZSL(new JSONObject(
|
||||
MapOf.of("regionCode", "HCSSX", "pointType", "1")));
|
||||
System.out.println(pointForYZSL);
|
||||
// List<SchBasePoint> pointForYZSL = yzMapper.findPointForYZSL(new JSONObject(
|
||||
// MapOf.of("regionCode", "HCSSX", "pointType", "1")));
|
||||
int countUp = yzMapper.countConveyorLine("HCSSX", GeneralDefinition.UPPER_CONVEYOR_LINE,
|
||||
PointStatusEnum.EMPTY_POINT.getCode());
|
||||
System.out.println(countUp);
|
||||
}
|
||||
@Test
|
||||
void yzMapper2Test() {
|
||||
// String apply = "ORDER BY point_code";
|
||||
int countUp = yzMapper.countConveyorLine("HCSSX", GeneralDefinition.UPPER_CONVEYOR_LINE,
|
||||
PointStatusEnum.EMPTY_POINT.getCode());
|
||||
int countLower = yzMapper.countConveyorLine("HCSSX", GeneralDefinition.LOWER_CONVEYOR_LINE,
|
||||
PointStatusEnum.EMPTY_POINT.getCode());
|
||||
// if (countUp < countLower) {
|
||||
// apply = "ORDER BY point_code DESC";
|
||||
// }
|
||||
LambdaQueryWrapper<SchBasePoint> lam = new QueryWrapper<SchBasePoint>().lambda();
|
||||
lam.eq(SchBasePoint::getRegion_code, "HCSSX")
|
||||
.eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_POINT.getCode())
|
||||
.eq(SchBasePoint::getPoint_type, GeneralDefinition.ENTRANCE) // 对接位
|
||||
.and(la -> la.isNull(SchBasePoint::getIng_task_code) // 当前执行的任务为空或者NULL,有数据表示锁住
|
||||
.or()
|
||||
.eq(SchBasePoint::getIng_task_code, ""))
|
||||
.eq(SchBasePoint::getIs_used, true)
|
||||
.orderBy(true, countUp > countLower, SchBasePoint::getPoint_code);
|
||||
List<SchBasePoint> schBasePoints = pointService.list(lam);
|
||||
System.out.println(schBasePoints.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user