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;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
window.g = {
|
||||
dev: {
|
||||
VUE_APP_BASE_API: 'http://192.168.217.2:8011'
|
||||
VUE_APP_BASE_API: 'http://192.168.217.8:8010'
|
||||
},
|
||||
prod: {
|
||||
VUE_APP_BASE_API: 'http://192.168.217.2:8011'
|
||||
VUE_APP_BASE_API: 'http://192.168.217.8:8010'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ const user = {
|
||||
actions: {
|
||||
// 登录
|
||||
Login({ commit }, userInfo) {
|
||||
const rememberMe = userInfo.rememberMe
|
||||
// const rememberMe = userInfo.rememberMe
|
||||
return new Promise((resolve, reject) => {
|
||||
login(userInfo.username, userInfo.password, userInfo.code, userInfo.uuid).then(res => {
|
||||
setToken(res.token, rememberMe)
|
||||
// setToken(res.token, rememberMe)
|
||||
commit('SET_TOKEN', res.token)
|
||||
setUserInfo(res.user, commit)
|
||||
// 第一次加载菜单时用到, 具体见 src 目录下的 permission.js
|
||||
|
||||
@@ -24,6 +24,15 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</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 />
|
||||
</el-form>
|
||||
|
||||
@@ -49,8 +58,8 @@
|
||||
</el-table-column>
|
||||
<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_spec" label="物料规格" width="170" show-overflow-tooltip/>
|
||||
<el-table-column prop="class_name" label="物料分类" width="140" />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="material_type" label="物料类型" width="140" />
|
||||
<el-table-column prop="measure_unit_id" label="单位编码" width="140" />
|
||||
<el-table-column prop="unit_name" label="计量单位" />
|
||||
<el-table-column prop="product_series_name" label="系列" />
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :rules="rules" size="mini" label-width="115px" label-suffix=":">
|
||||
<el-form ref="form" :model="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :rules="rules" size="mini" label-width="115px" label-suffix=":">
|
||||
<el-form-item label="区域编码" prop="region_code">
|
||||
<el-select v-model="form.region_code" placeholder="请选择" style="width: 200px;">
|
||||
<el-select v-model="form.region_code" placeholder="请选择" style="width: 200px;">
|
||||
<el-option
|
||||
v-for="item in regionList"
|
||||
:key="item.region_code"
|
||||
@@ -38,13 +38,16 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="getMaterial()" />
|
||||
</el-input>
|
||||
<el-input v-model="form.material_code" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="getMaterial()" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||
</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-input v-model="form.qty" style="width: 200px;" />
|
||||
</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="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_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="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,'备注')" />
|
||||
@@ -91,7 +95,7 @@
|
||||
<pagination />
|
||||
</div>
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" @materialChoose="tableChanged" />
|
||||
<MaterialDialog :dialog-show.sync="materialDialog" @materialChoose="tableChanged" />
|
||||
<!-- <WorkOrderDialog :dialog-show.sync="workOrderDialog" @tableChanged="tableChanged" />-->
|
||||
</div>
|
||||
</template>
|
||||
@@ -111,6 +115,7 @@ const defaultForm = {
|
||||
region_name: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
material_type: null,
|
||||
qty: null,
|
||||
measure_unit_id: null,
|
||||
remark: null,
|
||||
@@ -148,6 +153,9 @@ export default {
|
||||
],
|
||||
material_name: [
|
||||
{ required: true, message: '物料名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_type: [
|
||||
{ required: true, message: '物料类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
workShopList: [],
|
||||
@@ -226,15 +234,16 @@ export default {
|
||||
}
|
||||
},
|
||||
tableChanged(row) {
|
||||
debugger
|
||||
this.form.material_name = row.material_name
|
||||
this.form.material_code = row.material_code
|
||||
this.form.material_type = row.material_type
|
||||
},
|
||||
clearMaterial() {
|
||||
this.form.material_name = null
|
||||
this.form.material_id = null
|
||||
this.form.material_spec = null
|
||||
this.form.material_code = null
|
||||
this.form.material_type = null
|
||||
},
|
||||
setPointName(data) {
|
||||
var point = this.pointList.find(item => item.point_code === data)
|
||||
|
||||
Reference in New Issue
Block a user