Browse Source

手持液压机出库后将点位置空

master
张江玮 2 years ago
parent
commit
7b1a7afa7d
  1. 6
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java
  2. 25
      wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql
  3. 2
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/callMaterial/service/impl/CallMaterialServiceImpl.java
  4. 9
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/pressout/service/impl/PressureOutServiceImpl.java
  5. 2
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/ProducetaskController.java
  6. 2
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/ProducetaskService.java
  7. 30
      wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/ProducetaskServiceImpl.java
  8. 12
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java
  9. 8
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/DumpTask.java
  10. 3
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java
  11. 2
      wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/TaskServiceImpl.java
  12. 11
      wms/qd/src/views/wms/pdm/produceTask/index.vue

6
wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java

@ -74,7 +74,7 @@ public class StructFindUtil {
}
public static JSONObject getEmptyVehicleInStruct(JSONObject jsonObject) {
String vehice_type = "";
String vehicle_type = "";
String area_type = jsonObject.getString("area_type");
String vehicle_code = jsonObject.getString("vehicle_code");
String point_code = jsonObject.getString("point_code");
@ -87,13 +87,13 @@ public class StructFindUtil {
if (ObjectUtil.isEmpty(vehicleObj)) {
throw new BadRequestException("未找到托盘号为'" + vehicle_code + "' 托盘信息!");
}
vehice_type = vehicleObj.getString("vehicle_type");
vehicle_type = vehicleObj.getString("vehicle_type");
}
JSONObject result = WQL
.getWO("QSTRUCT_RULE")
.addParam("flag", "4")
.addParam("area_type", area_type)
.addParam("vehice_type", vehice_type)
.addParam("vehicle_type", vehicle_type)
.addParam("point_code", point_code)
.process()
.uniqueResult(0);

25
wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql

@ -13,17 +13,17 @@
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.code TYPEAS s_string
输入.flag TYPEAS s_string
输入.code TYPEAS s_string
输入.material_id TYPEAS s_string
输入.sect_id TYPEAS s_string
输入.area_type TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.workprocedure_id TYPEAS s_string
输入.area_type TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.workprocedure_id TYPEAS s_string
输入.is_full TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.point_code TYPEAS s_string
输入.point_vehicle_type TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.point_code TYPEAS s_string
输入.point_vehicle_type TYPEAS s_string
[临时表]
@ -155,11 +155,12 @@ IF 输入.flag = "4"
point.point_id as struct_id,
point.point_code as struct_code,
point.point_name as struct_name
FROM
sch_base_point point
WHERE
FROM
sch_base_point point
LEFT JOIN ST_IVT_StructRelaVehicleType rulevehicle ON rulevehicle.struct_id = point.point_id
WHERE
point.lock_type = '00'
AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL )
AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL )
AND point.point_status = '00'
OPTION 输入.area_type <> ""
point.area_type = 输入.area_type

2
wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/callMaterial/service/impl/CallMaterialServiceImpl.java

@ -19,6 +19,7 @@ import org.nl.wms.common.StructFindUtil;
import org.nl.wms.pda.callMaterial.service.CallMaterialService;
import org.nl.wms.pda.exception.PdaRequestException;
import org.nl.wms.sch.manage.AreaEnum;
import org.nl.wms.sch.manage.VehicleTypeEnum;
import org.nl.wms.sch.manage.buss.CallEmptyVehicleTask;
import org.nl.wms.sch.manage.buss.CallMaterialTask;
import org.nl.wms.sch.manage.buss.DumpTask;
@ -71,6 +72,7 @@ public class CallMaterialServiceImpl implements CallMaterialService {
param1.put("material_id", material_id);
param1.put("area_type", startArea_type);
param1.put("workprocedure_id", WorkProcedureEnum.HNGX.getId());
param1.put("vehicle_type", VehicleTypeEnum.DLZ.getCode());
param1.put("is_full", is_full);
JSONObject outStructObj = StructFindUtil.getOutStruct(param1);
if (ObjectUtil.isEmpty(outStructObj)) {

9
wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/pressout/service/impl/PressureOutServiceImpl.java

@ -63,7 +63,7 @@ public class PressureOutServiceImpl implements PressurelOutService {
}
//创建出库单据
JSONObject iosObj = new JSONObject();
String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
iosObj.put("iostorinv_id", iostorinv_id);
iosObj.put("bill_code", CodeUtil.getNewCode("OUT_STORE_CODE"));
iosObj.put("io_type", "1");
@ -100,6 +100,13 @@ public class PressureOutServiceImpl implements PressurelOutService {
jo.put("struct_id", point_id);
StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
ivtService.addIvtFlow(jo, IvtChangeTypeEnum.SUB_IVT_AND_CAN_USE);
// 将点位置空
JSONObject empty = new JSONObject();
empty.put("point_status", "00");
empty.put("vehicle_code", "");
WQLObject.getWQLObject("sch_base_point").update(empty, "point_code = '" + point_code + "'");
JSONObject returnjo = new JSONObject();
returnjo.put("code", "1");
returnjo.put("desc", "操作成功!");

2
wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/ProducetaskController.java

@ -172,7 +172,7 @@ public class ProducetaskController {
@PostMapping("/getVehicleType")
@Log("通过设备查询可用载具类型")
@ApiOperation("通过设备查询可用载具类型")
public ResponseEntity<JSONObject> getVehicleTypeByDeviceId(@RequestBody JSONObject device) {
public ResponseEntity<JSONArray> getVehicleTypeByDeviceId(@RequestBody JSONObject device) {
return new ResponseEntity<>(producetaskService.getVehicleTypeByDeviceId(device.getLong("device_id")), HttpStatus.OK);
}

2
wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/ProducetaskService.java

@ -148,5 +148,5 @@ public interface ProducetaskService {
* @param deviceId 设备id
* @return 字典表数组
*/
JSONObject getVehicleTypeByDeviceId(Long deviceId);
JSONArray getVehicleTypeByDeviceId(Long deviceId);
}

30
wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/ProducetaskServiceImpl.java

@ -420,14 +420,11 @@ public class ProducetaskServiceImpl implements ProducetaskService {
}
@Override
public JSONObject getVehicleTypeByDeviceId(Long deviceId) {
public JSONArray getVehicleTypeByDeviceId(Long deviceId) {
WQLObject dict = WQLObject.getWQLObject("sys_dict_detail");
JSONObject result = new JSONObject();
result.put("isHLJ", false);
if (ObjectUtil.isEmpty(deviceId)) {
// 如果请求参数为空返回所有
result.put("vehicleTypeList", dict.query("dict_id = 25").getResultJSONArray(0));
return result;
return dict.query("dict_id = 25").getResultJSONArray(0);
}
// 根据设备id查询设备
@ -449,32 +446,23 @@ public class ProducetaskServiceImpl implements ProducetaskService {
assert workProcedure != null;
switch (workProcedure) {
case HNGX:
result.put("isHLJ", true);
// 混料机只能使用料盅
result.put("vehicleTypeList",
dict
return dict
.query("dict_id = 25 AND (value = '01' OR value = '09')")
.getResultJSONArray(0));
break;
.getResultJSONArray(0);
case YZGX:
// 压制机只能使用钢托
result.put("vehicleTypeList",
dict
return dict
.query("dict_id = 25 AND value = '02'")
.getResultJSONArray(0));
break;
.getResultJSONArray(0);
case FJGX:
// 分拣机只能使用木托盘
result.put("vehicleTypeList",
dict
return dict
.query("dict_id = 25 AND value IN ('03', '04', '05', '06', '07', '08')")
.getResultJSONArray(0));
break;
.getResultJSONArray(0);
default:
// 其它返回所有
result.put("vehicleTypeList", dict.query("dict_id = 25").getResultJSONArray(0));
return dict.query("dict_id = 25").getResultJSONArray(0);
}
return result;
}
}

12
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java

@ -188,6 +188,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
}
String start_point_code = form.getString("start_point_code");
String vehicle_type = form.getString("vehicle_type");
String point_vehicle_type ="";
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
//判断起点有没有未完成的指令
JSONObject beforTaskObj = taskTable
@ -213,7 +214,11 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
case HNGX:
start_area = AreaEnum.KLHJ.getCode();
//托盘类型取当前工单生产的托盘类型
vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type");
vehicle_type = WQLObject
.getWQLObject("PDM_MG_produceTask")
.query("device_id='" + device_id + "' and producetask_status='04'")
.uniqueResult(0)
.getString("vehicle_type");
break;
// 压制工序
case YZGX:
@ -229,7 +234,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
//分拣工序
case FJGX:
//托盘类型取当前工单生产的托盘类型
vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type");
point_vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type");
start_area = AreaEnum.RGCPQ.getCode();
is_auto_issue = "0";
//更新设备点位。
@ -250,7 +255,8 @@ public class CallEmptyVehicleTask extends AbstractAcsTask {
start_area = AreaEnum.KLHJ.getCode();
}
JSONObject param = new JSONObject();
param.put("point_vehicle_type", vehicle_type);
param.put("vehicle_type", vehicle_type);
param.put("point_vehicle_type", point_vehicle_type);
param.put("area_type", start_area);
param.put("point_code", start_point_code);
JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param);

8
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/DumpTask.java

@ -98,15 +98,16 @@ public class DumpTask extends AbstractAcsTask {
taskObj.put("task_id", IdUtil.getSnowflake(1,1).nextId());
}
taskObj.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
taskObj.put("task_type", "04");
String task_status = TaskStatusEnum.START_AND_POINT.getCode();
taskObj.put("task_status", task_status);
taskObj.put("start_point_code", form.getString("start_point_code"));
taskObj.put("next_point_code", form.getString("next_point_code"));
taskObj.put("vehicle_code", form.getString("vehicle_code"));
taskObj.put("create_id", SecurityUtils.getCurrentUserId());
taskObj.put("create_name", SecurityUtils.getNickName());
taskObj.put("create_time", DateUtil.now());
taskObj.put("handle_class", THIS_CLASS);
taskObj.put("task_type", "05");
//任务基础表【sch_base_task】
WQLObject.getWQLObject("sch_base_task").insert(taskObj);
return taskObj.getString("task_id");
@ -119,7 +120,10 @@ public class DumpTask extends AbstractAcsTask {
if (StrUtil.isEmpty(task_id)) {
throw new BadRequestException("任务id不能为空!");
}
JSONObject taskjo = WQLObject.getWQLObject("sch_base_task").query("task_id='" + task_id + "'").uniqueResult(0);
JSONObject taskjo = WQLObject
.getWQLObject("sch_base_task")
.query("task_id='" + task_id + "'")
.uniqueResult(0);
taskjo.getString("taskfinish_mode");
this.updateTaskStatus(taskjo, TaskStatusEnum.FINISHED.getCode());
}

3
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java

@ -203,6 +203,9 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
param.put("vehicle_code", vehicle_code);
param.put("point_code", next_point_code);
JSONObject inStructObj = StructFindUtil.getEmptyVehicleInStruct(param);
if (ObjectUtil.isEmpty(inStructObj)) {
throw new BadRequestException("未找到合适的入库点位");
}
next_point_code = inStructObj.getString("struct_code");
}
String bill_status = "10";

2
wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/TaskServiceImpl.java

@ -185,7 +185,7 @@ public class TaskServiceImpl implements TaskService {
Class<?> clz = Class.forName(processing_class);
Object obj = clz.newInstance();
// 调用每个任务类的method_name()强制结束方法
Method m = obj.getClass().getMethod(method_name, String.class);
Method m = clz.getMethod(method_name, String.class);
JSONObject result = (JSONObject) m.invoke(obj, task_id);
if (ObjectUtil.isEmpty(result)) return;
JSONArray arr = result.getJSONArray("errArr");

11
wms/qd/src/views/wms/pdm/produceTask/index.vue

@ -166,8 +166,8 @@
<el-input-number v-model="form.seq_no" controls-position="right" style="width: 200px;text-align: left" :min="1" />
<!-- <el-input-number v-model="form.seq_no" :precision="0" :step="10" :min="0" style="width: 200px;" />-->
</el-form-item>
<el-form-item label="静置时间" prop="stewing_time" :rules="isHLJ ? [{ required: true, message: '混料机的静置时间不能为空', trigger: 'blur' }] : [{ required: false }]">
<el-input v-model="form.stewing_time" :rows="3" style="width: 200px;" />
<el-form-item label="静置时间" prop="stewing_time">
<el-input v-model="form.stewing_time" type="number" :rows="3" style="width: 200px;" />
</el-form-item>
<el-form-item label="型号" prop="model">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
@ -308,7 +308,7 @@ import CopyDialog from '@/views/wms/pdm/produceTask/CopyDialog'
import SortDialog from '@/views/wms/pdm/produceTask/SortDialog'
import MaterDialog from './MaterDialog.vue'
const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, material_name: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null, stewing_time: null, is_package: '0' }
const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, material_name: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null, stewing_time: 0, is_package: '0' }
export default {
name: 'Producetask',
dicts: ['PRODUCETASK_STATUS', 'PRODUCETASK_STATUS_TYPE', 'MD_EVEHICLE_TYPE'],
@ -339,7 +339,6 @@ export default {
materDialog: false,
materType: '',
vehicleTypeList: [],
isHLJ: false,
rules: {
device_id: [
{ required: true, message: '设备标识不能为空', trigger: 'blur' }
@ -515,9 +514,7 @@ export default {
}
const data = { device_id: this.form.device_id }
crudProducetask.getVehicleType(data).then(res => {
console.log(res)
this.vehicleTypeList = res.vehicleTypeList
this.isHLJ = res.isHLJ
this.vehicleTypeList = res
})
}
}

Loading…
Cancel
Save