rev:现场调试优化

This commit is contained in:
2025-09-25 14:41:06 +08:00
parent 36e3a06643
commit 57cec455e1
19 changed files with 120 additions and 60 deletions

View File

@@ -37,7 +37,7 @@ public enum PackageInfoIvtEnum {
//是否启用 //是否启用
IS_USED(MapOf.of("启用", "1", "未启用", "0")), IS_USED(MapOf.of("启用", "1", "未启用", "0")),
//agv二次分配类型 //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")), TASK_ACTION_TYPE(MapOf.of("普通任务", "1", "取货二次分配", "2", "放货二次分配", "3", "取放货二次分配", "4")),
//是否自动下发 //是否自动下发

View File

@@ -18,6 +18,7 @@ package org.nl.common.logging.aspect;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
@@ -132,7 +133,7 @@ public class LogAspect {
if (argList.size() == 0) { if (argList.size() == 0) {
return ""; 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);
} }

View File

@@ -280,7 +280,7 @@ public class OnlineUserService {
* loginInfo: Token挂载的扩展参数 此方法只有在集成jwt插件时才会生效 * loginInfo: Token挂载的扩展参数 此方法只有在集成jwt插件时才会生效
*/ */
StpUtil.login(userInfo.getUser_id(), new SaLoginModel() StpUtil.login(userInfo.getUser_id(), new SaLoginModel()
.setDevice("PC") .setDevice("LMS")
.setExtra("loginInfo", user) .setExtra("loginInfo", user)
); );

View File

@@ -18,4 +18,6 @@ import java.util.List;
public interface MdMeMaterialbaseMapper extends BaseMapper<MdMeMaterialbase> { public interface MdMeMaterialbaseMapper extends BaseMapper<MdMeMaterialbase> {
List<JSONObject> selectAllMaters(@Param("param") JSONObject whereJson); List<JSONObject> selectAllMaters(@Param("param") JSONObject whereJson);
List<JSONObject> getMaterialTypes();
} }

View File

@@ -4,16 +4,26 @@
<select id="selectAllMaters" resultType="com.alibaba.fastjson.JSONObject" <select id="selectAllMaters" resultType="com.alibaba.fastjson.JSONObject"
parameterType="com.alibaba.fastjson.JSONObject"> parameterType="com.alibaba.fastjson.JSONObject">
SELECT SELECT
mater.material_code, material_code,
mater.material_name, material_name,
u.unit_name as measure_unit_id unit_name as measure_unit_id
FROM FROM
`md_me_materialbase` mater `md_me_materialbase`
LEFT JOIN md_pb_measureunit u ON u.measure_unit_id = mater.measure_unit_id
WHERE WHERE
1=1 1=1
<if test="param.blurry != null and param.blurry != ''"> <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> </if>
</select> </select>
<select id="getMaterialTypes" resultType="com.alibaba.fastjson.JSONObject">
SELECT
material_type
FROM
`md_me_materialbase`
GROUP BY
material_type
</select>
</mapper> </mapper>

View File

@@ -48,6 +48,12 @@ public class PdaTaskController {
return new ResponseEntity<>(pdaTaskService.selectMaterials(whereJson), HttpStatus.OK); return new ResponseEntity<>(pdaTaskService.selectMaterials(whereJson), HttpStatus.OK);
} }
@PostMapping("/getMaterialTypes")
@Log("查询物料信息")
public ResponseEntity<Object> getMaterialTypes() {
return new ResponseEntity<>(pdaTaskService.getMaterialTypes(), HttpStatus.OK);
}
@PostMapping("/getRegions") @PostMapping("/getRegions")
@Log("获取所有区域") @Log("获取所有区域")
public ResponseEntity<Object> getRegions() { public ResponseEntity<Object> getRegions() {

View File

@@ -64,4 +64,6 @@ public interface PdaTaskService {
JSONObject getEndRegions(); JSONObject getEndRegions();
JSONObject getChargeRegions(); JSONObject getChargeRegions();
JSONObject getMaterialTypes();
} }

View File

@@ -159,7 +159,7 @@ public class PdaTaskServiceImpl implements PdaTaskService {
String prefix = schBasePoint.getPoint_code().substring(0, schBasePoint.getPoint_code().length() - 2); String prefix = schBasePoint.getPoint_code().substring(0, schBasePoint.getPoint_code().length() - 2);
List<SchBaseTask> existTask = taskService.findUnFinishTasksByTaskConfig("THSLTask", prefix); List<SchBaseTask> existTask = taskService.findUnFinishTasksByTaskConfig("THSLTask", prefix);
if (existTask.size() <= 1) { 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) { if (list.size() == 0) {
throw new BadRequestException(region_code + "区域无空闲点位"); throw new BadRequestException(region_code + "区域无空闲点位");
} }
@@ -463,6 +463,26 @@ public class PdaTaskServiceImpl implements PdaTaskService {
return ret; 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 @Override
public JSONObject getMaterialInfoByPoint(JSONObject whereJson) { public JSONObject getMaterialInfoByPoint(JSONObject whereJson) {
String point_code = whereJson.getString("point_code"); String point_code = whereJson.getString("point_code");
@@ -627,7 +647,7 @@ public class PdaTaskServiceImpl implements PdaTaskService {
public JSONObject vehicleBinding(JSONObject whereJson) { public JSONObject vehicleBinding(JSONObject whereJson) {
String point_code = whereJson.getString("point_code"); String point_code = whereJson.getString("point_code");
SchBasePoint point = pointMapper.selectOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, 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); pointMapper.updateById(point);
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
ret.put("status", String.valueOf(HttpStatus.HTTP_OK)); ret.put("status", String.valueOf(HttpStatus.HTTP_OK));

View File

@@ -30,6 +30,8 @@ public class MaterialRecord implements Serializable {
*/ */
private String material_name; private String material_name;
private String material_type;
private String region_code; private String region_code;

View File

@@ -54,17 +54,13 @@ public class MaterialRecordServiceImpl extends ServiceImpl<MaterialRecordMapper,
.eq(SchBaseRegion::getRegion_code, entity.getRegion_code())); .eq(SchBaseRegion::getRegion_code, entity.getRegion_code()));
MdMeMaterialbase mdMeMaterialbase = mdMeMaterialbaseMapper.selectOne(new LambdaQueryWrapper<MdMeMaterialbase>() MdMeMaterialbase mdMeMaterialbase = mdMeMaterialbaseMapper.selectOne(new LambdaQueryWrapper<MdMeMaterialbase>()
.eq(MdMeMaterialbase::getMaterial_code, entity.getMaterial_code())); .eq(MdMeMaterialbase::getMaterial_code, entity.getMaterial_code()));
String measure_unit_id = mdMeMaterialbase.getMeasure_unit_id(); String getUnit_name = mdMeMaterialbase.getUnit_name();
Measureunit measureunit = measureunitMapper.selectById(measure_unit_id);
entity.setRecord_id(IdUtil.getSnowflake(1, 1).nextIdStr()); entity.setRecord_id(IdUtil.getSnowflake(1, 1).nextIdStr());
entity.setRegion_name(schBaseRegion.getRegion_name()); 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_id(currentUserId);
entity.setCreate_name(nickName); entity.setCreate_name(nickName);
entity.setCreate_time(now); entity.setCreate_time(now);
entity.setUpdate_id(currentUserId);
entity.setUpdate_name(nickName);
entity.setUpdate_time(now);
materialRecordMapper.insert(entity); materialRecordMapper.insert(entity);
} }

View File

@@ -47,7 +47,7 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
List<SchBasePoint> checkEndPointTask(SchBaseTask baseTask); 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); List<SchBasePoint> selectSameRowPoints(@Param("point") SchBasePoint point);

View File

@@ -192,7 +192,7 @@
AND is_delete = '0' AND is_delete = '0'
) )
AND point_code LIKE CONCAT(#{prefix}, '%') AND point_code LIKE CONCAT(#{prefix}, '%')
AND point_type = '3' AND point_type = #{point_type}
AND is_used = 1 AND is_used = 1
AND point_status = '1' AND point_status = '1'
ORDER BY in_order_seq desc ORDER BY in_order_seq desc
@@ -219,7 +219,7 @@
SELECT * SELECT *
FROM `sch_base_point` p FROM `sch_base_point` p
WHERE p.region_code = #{region_code} 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 (point_type = '1' OR point_type = '3')
AND is_used = 1 AND is_used = 1
AND point_status = "1" AND point_status = "1"

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.nl.common.enums.PackageInfoIvtEnum;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.CodeUtil; import org.nl.common.utils.CodeUtil;
import org.nl.common.utils.IdUtil; import org.nl.common.utils.IdUtil;
@@ -88,8 +89,10 @@ public class PdaPointTask extends AbstractTask {
String requestParam = task.getRequest_param(); String requestParam = task.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam); JSONObject jsonObject = JSONObject.parseObject(requestParam);
String point_code2 = jsonObject.getString("point_code2"); String point_code2 = jsonObject.getString("point_code2");
// 设置终点并修改创建成功状态 // 设置终点并修改创建成功状态
task.setPoint_code2(point_code2); task.setPoint_code2(point_code2);
task.setVehicle_code2(PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务"));
task.setRemark(""); task.setRemark("");
task.setTask_status(TaskStatus.CREATED.getCode()); task.setTask_status(TaskStatus.CREATED.getCode());
taskService.save(task); taskService.save(task);

View File

@@ -22,7 +22,7 @@
AND g.material_code = #{material_code} AND g.material_code = #{material_code}
AND p.point_status = '2' AND p.point_status = '2'
AND p.is_used = 1 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>
<select id="findPointsByMaterialCode" resultType="org.nl.wms.sch.point.service.dto.SchBasePointDto"> <select id="findPointsByMaterialCode" resultType="org.nl.wms.sch.point.service.dto.SchBasePointDto">

View File

@@ -150,7 +150,7 @@ public class THXLTask extends AbstractTask {
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
//找一排都是空的点位 //找一排都是空的点位
//找最大列为空且没有任务的点位 //找最大列为空且没有任务的点位
if (regionCode.equals("KTP")) { // if (regionCode.equals("KTP")) {
List<SchBasePoint> points = pointService.getPointByMaxCol(regionCode, 2); List<SchBasePoint> points = pointService.getPointByMaxCol(regionCode, 2);
for (int i = 0; i < points.size(); i++) { for (int i = 0; i < points.size(); i++) {
SchBasePoint twoColPoint = points.get(0); SchBasePoint twoColPoint = points.get(0);
@@ -166,31 +166,31 @@ public class THXLTask extends AbstractTask {
} }
continue; continue;
} }
} // }
if (regionCode.equals("DKB")){ // if (regionCode.equals("DKB")){
//找一排都是空的点位 //todo: 两台机台有没有生成相同物料 机台速度 // //找一排都是空的点位 //todo: 两台机台有没有生成相同物料 机台速度
//找最大列为空且没有任务的点位 // //找最大列为空且没有任务的点位
List<SchBasePoint> points = pointService.getPointByMaxCol(regionCode, 3); // List<SchBasePoint> points = pointService.getPointByMaxCol(regionCode, 3);
for (int i = 0; i < points.size(); i++) { // for (int i = 0; i < points.size(); i++) {
SchBasePoint thirdColPoint = points.get(0); // SchBasePoint thirdColPoint = points.get(0);
String firstColPointCode = thirdColPoint.getPoint_code().substring(0, thirdColPoint.getPoint_code().length() - 1) + "1"; // 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"; // String secondColPointCode = thirdColPoint.getPoint_code().substring(0, thirdColPoint.getPoint_code().length() - 1) + "2";
//
// 查询第一列和第二列点位 // // 查询第一列和第二列点位
SchBasePoint firstColPoint = pointService.findByCode(firstColPointCode); // SchBasePoint firstColPoint = pointService.findByCode(firstColPointCode);
SchBasePoint secondColPoint = pointService.findByCode(secondColPointCode); // SchBasePoint secondColPoint = pointService.findByCode(secondColPointCode);
// 判断第一列和第二列点位是否为空且没有任务 // // 判断第一列和第二列点位是否为空且没有任务
boolean isFirstColFree = checkIsEmpty(firstColPoint); // boolean isFirstColFree = checkIsEmpty(firstColPoint);
boolean isSecondColFree = checkIsEmpty(secondColPoint); // boolean isSecondColFree = checkIsEmpty(secondColPoint);
// 如果第一列和第二列都为空,则返回这个第三列点位 // // 如果第一列和第二列都为空,则返回这个第三列点位
if (isFirstColFree && isSecondColFree) { // if (isFirstColFree && isSecondColFree) {
task.setVehicle_code2(PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配")); // task.setVehicle_code2(PackageInfoIvtEnum.AGV_ACTION_TYPE.code("放货二次分配"));
return thirdColPoint; // return thirdColPoint;
} else { // } else {
continue; // continue;
} // }
} // }
} // }
} }
return null; return null;
} }

View File

@@ -1,9 +1,9 @@
window.g = { window.g = {
dev: { dev: {
VUE_APP_BASE_API: 'http://192.168.217.2:8011' VUE_APP_BASE_API: 'http://192.168.217.8:8010'
}, },
prod: { prod: {
VUE_APP_BASE_API: 'http://192.168.217.2:8011' VUE_APP_BASE_API: 'http://192.168.217.8:8010'
} }
} }

View File

@@ -28,10 +28,10 @@ const user = {
actions: { actions: {
// 登录 // 登录
Login({ commit }, userInfo) { Login({ commit }, userInfo) {
const rememberMe = userInfo.rememberMe // const rememberMe = userInfo.rememberMe
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(userInfo.username, userInfo.password, userInfo.code, userInfo.uuid).then(res => { login(userInfo.username, userInfo.password, userInfo.code, userInfo.uuid).then(res => {
setToken(res.token, rememberMe) // setToken(res.token, rememberMe)
commit('SET_TOKEN', res.token) commit('SET_TOKEN', res.token)
setUserInfo(res.user, commit) setUserInfo(res.user, commit)
// 第一次加载菜单时用到, 具体见 src 目录下的 permission.js // 第一次加载菜单时用到, 具体见 src 目录下的 permission.js

View File

@@ -24,6 +24,15 @@
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="物料名称">
<el-input
v-model="query.material_type"
clearable
size="mini"
placeholder="物料类型"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation /> <rrOperation />
</el-form> </el-form>
@@ -50,7 +59,7 @@
<el-table-column prop="material_code" label="物料编码" width="140" /> <el-table-column prop="material_code" label="物料编码" width="140" />
<el-table-column prop="material_name" label="物料名称" width="170" show-overflow-tooltip /> <el-table-column prop="material_name" label="物料名称" width="170" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="170" show-overflow-tooltip /> <el-table-column prop="material_spec" label="物料规格" width="170" show-overflow-tooltip />
<el-table-column prop="class_name" label="物料类" width="140" /> <el-table-column prop="material_type" label="物料类" width="140" />
<el-table-column prop="measure_unit_id" label="单位编码" width="140" /> <el-table-column prop="measure_unit_id" label="单位编码" width="140" />
<el-table-column prop="unit_name" label="计量单位" /> <el-table-column prop="unit_name" label="计量单位" />
<el-table-column prop="product_series_name" label="系列" /> <el-table-column prop="product_series_name" label="系列" />

View File

@@ -45,6 +45,9 @@
<el-form-item label="物料名称" prop="material_name"> <el-form-item label="物料名称" prop="material_name">
<el-input v-model="form.material_name" disabled style="width: 200px;" /> <el-input v-model="form.material_name" disabled style="width: 200px;" />
</el-form-item> </el-form-item>
<el-form-item label="物料类型" prop="material_type">
<el-input v-model="form.material_type" disabled style="width: 200px;" />
</el-form-item>
<el-form-item label="物料数量" prop="qty"> <el-form-item label="物料数量" prop="qty">
<el-input v-model="form.qty" style="width: 200px;" /> <el-input v-model="form.qty" style="width: 200px;" />
</el-form-item> </el-form-item>
@@ -71,6 +74,7 @@
<el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')" /> <el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')" />
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" /> <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" /> <el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
<el-table-column prop="material_type" label="物料类型" :min-width="flexWidth('material_type',crud.data,'物料类型')" />
<el-table-column prop="qty" label="物料数量" show-overflow-tooltip :min-width="flexWidth('qty',crud.data,'物料数量')" /> <el-table-column prop="qty" label="物料数量" show-overflow-tooltip :min-width="flexWidth('qty',crud.data,'物料数量')" />
<el-table-column prop="measure_unit_id" label="计量单位" show-overflow-tooltip :min-width="flexWidth('measure_unit_id',crud.data,'计量单位')" /> <el-table-column prop="measure_unit_id" label="计量单位" show-overflow-tooltip :min-width="flexWidth('measure_unit_id',crud.data,'计量单位')" />
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" /> <el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
@@ -111,6 +115,7 @@ const defaultForm = {
region_name: null, region_name: null,
material_code: null, material_code: null,
material_name: null, material_name: null,
material_type: null,
qty: null, qty: null,
measure_unit_id: null, measure_unit_id: null,
remark: null, remark: null,
@@ -148,6 +153,9 @@ export default {
], ],
material_name: [ material_name: [
{ required: true, message: '物料名称不能为空', trigger: 'blur' } { required: true, message: '物料名称不能为空', trigger: 'blur' }
],
material_type: [
{ required: true, message: '物料类型不能为空', trigger: 'blur' }
] ]
}, },
workShopList: [], workShopList: [],
@@ -226,15 +234,16 @@ export default {
} }
}, },
tableChanged(row) { tableChanged(row) {
debugger
this.form.material_name = row.material_name this.form.material_name = row.material_name
this.form.material_code = row.material_code this.form.material_code = row.material_code
this.form.material_type = row.material_type
}, },
clearMaterial() { clearMaterial() {
this.form.material_name = null this.form.material_name = null
this.form.material_id = null this.form.material_id = null
this.form.material_spec = null this.form.material_spec = null
this.form.material_code = null this.form.material_code = null
this.form.material_type = null
}, },
setPointName(data) { setPointName(data) {
var point = this.pointList.find(item => item.point_code === data) var point = this.pointList.find(item => item.point_code === data)