rev:现场调试优化
This commit is contained in:
@@ -37,7 +37,7 @@ public enum PackageInfoIvtEnum {
|
||||
//是否启用
|
||||
IS_USED(MapOf.of("启用", "1", "未启用", "0")),
|
||||
//agv二次分配类型
|
||||
AGV_ACTION_TYPE(MapOf.of("普通任务", "1", "取货二次分配", "2", "放货二次分配", "3", "取放货二次分配", "4","HXT取放货二次分配","5")),
|
||||
AGV_ACTION_TYPE(MapOf.of("普通任务", "1", "取货二次分配", "2", "放货二次分配", "3", "E2取放货二次分配", "4","HXT取放货二次分配","5")),
|
||||
//二次分配请求类型
|
||||
TASK_ACTION_TYPE(MapOf.of("普通任务", "1", "取货二次分配", "2", "放货二次分配", "3", "取放货二次分配", "4")),
|
||||
//是否自动下发
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.nl.common.logging.aspect;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
@@ -132,7 +133,7 @@ public class LogAspect {
|
||||
if (argList.size() == 0) {
|
||||
return "";
|
||||
}
|
||||
return argList.size() == 1 ? JSONUtil.toJsonStr(argList.get(0)) : JSONUtil.toJsonStr(argList);
|
||||
return argList.size() == 1 ? JSONUtil.toJsonStr(JSON.toJSONString(argList.get(0))) : JSONUtil.toJsonStr(argList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ public class OnlineUserService {
|
||||
* loginInfo: Token挂载的扩展参数 (此方法只有在集成jwt插件时才会生效)
|
||||
*/
|
||||
StpUtil.login(userInfo.getUser_id(), new SaLoginModel()
|
||||
.setDevice("PC")
|
||||
.setDevice("LMS")
|
||||
.setExtra("loginInfo", user)
|
||||
);
|
||||
|
||||
|
||||
@@ -18,4 +18,6 @@ import java.util.List;
|
||||
public interface MdMeMaterialbaseMapper extends BaseMapper<MdMeMaterialbase> {
|
||||
|
||||
List<JSONObject> selectAllMaters(@Param("param") JSONObject whereJson);
|
||||
|
||||
List<JSONObject> getMaterialTypes();
|
||||
}
|
||||
|
||||
@@ -4,16 +4,26 @@
|
||||
<select id="selectAllMaters" resultType="com.alibaba.fastjson.JSONObject"
|
||||
parameterType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
u.unit_name as measure_unit_id
|
||||
material_code,
|
||||
material_name,
|
||||
unit_name as measure_unit_id
|
||||
FROM
|
||||
`md_me_materialbase` mater
|
||||
LEFT JOIN md_pb_measureunit u ON u.measure_unit_id = mater.measure_unit_id
|
||||
`md_me_materialbase`
|
||||
WHERE
|
||||
1=1
|
||||
<if test="param.blurry != null and param.blurry != ''">
|
||||
AND (mater.material_code = #{param.blurry} OR mater.material_name = #{param.blurry})
|
||||
AND (material_code = #{param.blurry} OR material_name = #{param.blurry})
|
||||
</if>
|
||||
<if test="param.material_type != null and param.material_type != ''">
|
||||
AND material_type = #{param.material_type}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getMaterialTypes" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
material_type
|
||||
FROM
|
||||
`md_me_materialbase`
|
||||
GROUP BY
|
||||
material_type
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -48,6 +48,12 @@ public class PdaTaskController {
|
||||
return new ResponseEntity<>(pdaTaskService.selectMaterials(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getMaterialTypes")
|
||||
@Log("查询物料信息")
|
||||
public ResponseEntity<Object> getMaterialTypes() {
|
||||
return new ResponseEntity<>(pdaTaskService.getMaterialTypes(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getRegions")
|
||||
@Log("获取所有区域")
|
||||
public ResponseEntity<Object> getRegions() {
|
||||
|
||||
@@ -64,4 +64,6 @@ public interface PdaTaskService {
|
||||
JSONObject getEndRegions();
|
||||
|
||||
JSONObject getChargeRegions();
|
||||
|
||||
JSONObject getMaterialTypes();
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public class PdaTaskServiceImpl implements PdaTaskService {
|
||||
String prefix = schBasePoint.getPoint_code().substring(0, schBasePoint.getPoint_code().length() - 2);
|
||||
List<SchBaseTask> existTask = taskService.findUnFinishTasksByTaskConfig("THSLTask", prefix);
|
||||
if (existTask.size() <= 1) {
|
||||
List<SchBasePoint> list = pointMapper.selectListByRegionAndPrefix(region_code, prefix);
|
||||
List<SchBasePoint> list = pointMapper.selectListByRegionAndPrefix(region_code, prefix,schBasePoint.getPoint_type());
|
||||
if (list.size() == 0) {
|
||||
throw new BadRequestException(region_code + "区域无空闲点位");
|
||||
}
|
||||
@@ -463,6 +463,26 @@ public class PdaTaskServiceImpl implements PdaTaskService {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getMaterialTypes() {
|
||||
List<JSONObject> list = mdMeMaterialbaseMapper.getMaterialTypes();
|
||||
List<JSONObject> arr = new ArrayList<>();
|
||||
JSONObject ret = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
list.forEach(point -> {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("value", point.getString("material_type"));
|
||||
jo.put("text", point.getString("material_type"));
|
||||
arr.add(jo);
|
||||
});
|
||||
ret.put("code", String.valueOf(HttpStatus.HTTP_OK));
|
||||
ret.put("message", "查询成功");
|
||||
ret.put("data", arr);
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getMaterialInfoByPoint(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
@@ -627,7 +647,7 @@ public class PdaTaskServiceImpl implements PdaTaskService {
|
||||
public JSONObject vehicleBinding(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
SchBasePoint point = pointMapper.selectOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, point_code));
|
||||
point.setPoint_status("1");
|
||||
point.setPoint_status("2");
|
||||
pointMapper.updateById(point);
|
||||
JSONObject ret = new JSONObject();
|
||||
ret.put("status", String.valueOf(HttpStatus.HTTP_OK));
|
||||
|
||||
@@ -30,6 +30,8 @@ public class MaterialRecord implements Serializable {
|
||||
*/
|
||||
private String material_name;
|
||||
|
||||
private String material_type;
|
||||
|
||||
private String region_code;
|
||||
|
||||
|
||||
|
||||
@@ -54,17 +54,13 @@ public class MaterialRecordServiceImpl extends ServiceImpl<MaterialRecordMapper,
|
||||
.eq(SchBaseRegion::getRegion_code, entity.getRegion_code()));
|
||||
MdMeMaterialbase mdMeMaterialbase = mdMeMaterialbaseMapper.selectOne(new LambdaQueryWrapper<MdMeMaterialbase>()
|
||||
.eq(MdMeMaterialbase::getMaterial_code, entity.getMaterial_code()));
|
||||
String measure_unit_id = mdMeMaterialbase.getMeasure_unit_id();
|
||||
Measureunit measureunit = measureunitMapper.selectById(measure_unit_id);
|
||||
String getUnit_name = mdMeMaterialbase.getUnit_name();
|
||||
entity.setRecord_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setRegion_name(schBaseRegion.getRegion_name());
|
||||
entity.setMeasure_unit_id(measureunit.getUnit_name());
|
||||
entity.setMeasure_unit_id(getUnit_name);
|
||||
entity.setCreate_id(currentUserId);
|
||||
entity.setCreate_name(nickName);
|
||||
entity.setCreate_time(now);
|
||||
entity.setUpdate_id(currentUserId);
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
materialRecordMapper.insert(entity);
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
||||
|
||||
List<SchBasePoint> checkEndPointTask(SchBaseTask baseTask);
|
||||
|
||||
List<SchBasePoint> selectListByRegionAndPrefix(@Param("region_code") String region_code, @Param("prefix") String prefix);
|
||||
List<SchBasePoint> selectListByRegionAndPrefix(@Param("region_code") String region_code, @Param("prefix") String prefix,@Param("point_type") String point_type);
|
||||
|
||||
List<SchBasePoint> selectSameRowPoints(@Param("point") SchBasePoint point);
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
AND is_delete = '0'
|
||||
)
|
||||
AND point_code LIKE CONCAT(#{prefix}, '%')
|
||||
AND point_type = '3'
|
||||
AND point_type = #{point_type}
|
||||
AND is_used = 1
|
||||
AND point_status = '1'
|
||||
ORDER BY in_order_seq desc
|
||||
@@ -219,7 +219,7 @@
|
||||
SELECT *
|
||||
FROM `sch_base_point` p
|
||||
WHERE p.region_code = #{region_code}
|
||||
AND p.parent_point_code == #{point_code2}
|
||||
AND p.parent_point_code = #{point_code2}
|
||||
AND (point_type = '1' OR point_type = '3')
|
||||
AND is_used = 1
|
||||
AND point_status = "1"
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
@@ -88,8 +89,10 @@ public class PdaPointTask extends AbstractTask {
|
||||
String requestParam = task.getRequest_param();
|
||||
JSONObject jsonObject = JSONObject.parseObject(requestParam);
|
||||
String point_code2 = jsonObject.getString("point_code2");
|
||||
|
||||
// 设置终点并修改创建成功状态
|
||||
task.setPoint_code2(point_code2);
|
||||
task.setVehicle_code2(PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务"));
|
||||
task.setRemark("");
|
||||
task.setTask_status(TaskStatus.CREATED.getCode());
|
||||
taskService.save(task);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
AND g.material_code = #{material_code}
|
||||
AND p.point_status = '2'
|
||||
AND p.is_used = 1
|
||||
AND (p.region_code = 'E2' OR p.region_code = 'H1' OR p.region_code = 'H2')
|
||||
AND (p.region_code = 'E2' OR p.region_code = 'H1' OR p.region_code = 'H2' OR p.region_code = 'HXTFZW')
|
||||
</select>
|
||||
|
||||
<select id="findPointsByMaterialCode" resultType="org.nl.wms.sch.point.service.dto.SchBasePointDto">
|
||||
|
||||
@@ -150,7 +150,7 @@ public class THXLTask extends AbstractTask {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
//找一排都是空的点位
|
||||
//找最大列为空且没有任务的点位
|
||||
if (regionCode.equals("KTP")) {
|
||||
// if (regionCode.equals("KTP")) {
|
||||
List<SchBasePoint> points = pointService.getPointByMaxCol(regionCode, 2);
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
SchBasePoint twoColPoint = points.get(0);
|
||||
@@ -166,31 +166,31 @@ public class THXLTask extends AbstractTask {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (regionCode.equals("DKB")){
|
||||
//找一排都是空的点位 //todo: 两台机台有没有生成相同物料 机台速度
|
||||
//找最大列为空且没有任务的点位
|
||||
List<SchBasePoint> points = pointService.getPointByMaxCol(regionCode, 3);
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
SchBasePoint thirdColPoint = points.get(0);
|
||||
String firstColPointCode = thirdColPoint.getPoint_code().substring(0, thirdColPoint.getPoint_code().length() - 1) + "1";
|
||||
String secondColPointCode = thirdColPoint.getPoint_code().substring(0, thirdColPoint.getPoint_code().length() - 1) + "2";
|
||||
|
||||
// 查询第一列和第二列点位
|
||||
SchBasePoint firstColPoint = pointService.findByCode(firstColPointCode);
|
||||
SchBasePoint secondColPoint = pointService.findByCode(secondColPointCode);
|
||||
// 判断第一列和第二列点位是否为空且没有任务
|
||||
boolean isFirstColFree = checkIsEmpty(firstColPoint);
|
||||
boolean isSecondColFree = checkIsEmpty(secondColPoint);
|
||||
// 如果第一列和第二列都为空,则返回这个第三列点位
|
||||
if (isFirstColFree && isSecondColFree) {
|
||||
task.setVehicle_code2(PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
|
||||
return thirdColPoint;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
// if (regionCode.equals("DKB")){
|
||||
// //找一排都是空的点位 //todo: 两台机台有没有生成相同物料 机台速度
|
||||
// //找最大列为空且没有任务的点位
|
||||
// List<SchBasePoint> points = pointService.getPointByMaxCol(regionCode, 3);
|
||||
// for (int i = 0; i < points.size(); i++) {
|
||||
// SchBasePoint thirdColPoint = points.get(0);
|
||||
// String firstColPointCode = thirdColPoint.getPoint_code().substring(0, thirdColPoint.getPoint_code().length() - 1) + "1";
|
||||
// String secondColPointCode = thirdColPoint.getPoint_code().substring(0, thirdColPoint.getPoint_code().length() - 1) + "2";
|
||||
//
|
||||
// // 查询第一列和第二列点位
|
||||
// SchBasePoint firstColPoint = pointService.findByCode(firstColPointCode);
|
||||
// SchBasePoint secondColPoint = pointService.findByCode(secondColPointCode);
|
||||
// // 判断第一列和第二列点位是否为空且没有任务
|
||||
// boolean isFirstColFree = checkIsEmpty(firstColPoint);
|
||||
// boolean isSecondColFree = checkIsEmpty(secondColPoint);
|
||||
// // 如果第一列和第二列都为空,则返回这个第三列点位
|
||||
// if (isFirstColFree && isSecondColFree) {
|
||||
// task.setVehicle_code2(PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
|
||||
// return thirdColPoint;
|
||||
// } else {
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user