Browse Source

rev: 工单字段修改

master
李永德 1 year ago
parent
commit
10ef2405ff
  1. BIN
      lms/nladmin-system/doc/wms.xls
  2. 120
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/PalletizeDto.java
  3. 35
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java
  4. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PdmBdWorkorder.java
  5. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/mapper/PdmBdWorkorderMapper.xml
  6. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dto/PdmBdWorkorderDto.java
  7. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java
  8. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java
  9. 25
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java
  10. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java
  11. 35
      lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue
  12. 8
      lms/nladmin-ui/src/views/wms/sch/group/MaterialDialog.vue

BIN
lms/nladmin-system/doc/wms.xls

Binary file not shown.

120
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/PalletizeDto.java

@ -0,0 +1,120 @@
package org.nl.wms.ext.service.dto;
import lombok.Data;
/**
* @Author: lyd
* @Description: 垛型参数
* @Date: 2023/7/18
*/
@Data
public class PalletizeDto {
/** 产品编号 */
private String product_code;
/** A长边 */
private String AlongSide;
/** B短边 */
private String BshortSide;
/** H梯形高 */
private String Htrapezoidal;
/** W厚度 */
private String Wthickness;
/** 当前垛盘数 */
private String tray_qty;
/** 垛盘高度 */
private String tray_high;
/** 垛型类别 */
private String crib_category;
/** 码垛X1行 */
private String palletX1_line;
/** 码垛Y1列 */
private String palletY1_row;
/** 码垛A1角度 */
private String palletA1_angle;
/** 码垛X2行 */
private String palletX2_line;
/** 码垛Y2列 */
private String palletY2_row;
/** 码垛A2角度 */
private String palletA2_angle;
/** 码垛X3行 */
private String palletX3_line;
/** 码垛Y3列 */
private String palletY3_row;
/** 码垛A3角度 */
private String palletA3_angle;
/** 压垛X1行 */
private String pressCribX1_line;
/** 压垛Y1列 */
private String pressCribY1_row;
/** 压垛A1角度 */
private String pressCribA1_angle;
/** 压垛X2行 */
private String pressCribX2_line;
/** 压垛Y2列 */
private String pressCribY2_row;
/** 压垛A2角度 */
private String pressCribA2_angle;
/** 压垛X3行 */
private String pressCribX3_line;
/** 压垛Y3列 */
private String pressCribY3_row;
/** 压垛A3角度 */
private String pressCribA3_angle;
/** Z轴偏移 */
private String Zoffset;
/** 码垛层数 */
private String pallet_layerQty;
/** 压垛层数 */
private String pressCrib_layerQty;
/** 码层X1间隔 */
private String codeLayerX1_interval;
/** 码层Y1间隔 */
private String codeLayerY1_interval;
/** 码层X2间隔 */
private String codeLayerX2_interval;
/** 码层Y2间隔 */
private String codeLayerY2_interval;
/** 码层X3间隔 */
private String codeLayerX3_interval;
/** 码层Y3间隔 */
private String codeLayerY3_interval;
/** 码层X1偏移 */
private String codeLayerX1_offset;
/** 码层Y1偏移 */
private String codeLayerY1_offset;
/** 码层X2偏移 */
private String codeLayerX2_offset;
/** 码层Y2偏移 */
private String codeLayerY2_offset;
/** 码层X3偏移 */
private String codeLayerX3_offset;
/** 码层Y3偏移 */
private String codeLayerY3_offset;
/** 压层X1间隔 */
private String pressLayerX1_interval;
/** 压层Y1间隔 */
private String pressLayerY1_interval;
/** 压层X2间隔 */
private String pressLayerX2_interval;
/** 压层Y2间隔 */
private String pressLayerY2_interval;
/** 压层X3间隔 */
private String pressLayerX3_interval;
/** 压层Y3间隔 */
private String pressLayerY3_interval;
/** 压层X1偏移 */
private String pressLayerX1_offset;
/** 压层Y1偏移 */
private String pressLayerY1_offset;
/** 压层X2偏移 */
private String pressLayerX2_offset;
/** 压层Y2偏移 */
private String pressLayerY2_offset;
/** 压层X3偏移 */
private String pressLayerX3_offset;
/** 压层Y3偏移 */
private String pressLayerY3_offset;
/** 工具坐标 */
private String tool_coordinate;
}

35
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java

@ -32,6 +32,7 @@ import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum;
import org.nl.wms.sch.task_manage.task.TaskFactory;
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
import org.nl.wms.util.CommonUtils;
import org.nl.wms.util.PointUtils;
import org.nl.wms.util.TaskUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -268,7 +269,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Transactional(rollbackFor = Exception.class)
public BaseResponse pressRequestMaterial(JSONObject param) { // (公共接口进来)只是给我一个下料位(中间位置)
String requestNo = param.getString("requestNo");
BaseResponse standResponse = BaseResponse.build(requestNo);
// 压机、原材料物料(混碾)、压机工单、叫料时间
String deviceCode = param.getString("device_code");// 几号压机下料位
SchBasePoint basePoint = pointService.getById(deviceCode);
@ -278,16 +278,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
.eq(PdmBdWorkorder::getPoint_code, parentPointCode)
.eq(PdmBdWorkorder::getWorkorder_status, WorkOrderStatusEnum.PRODUCING.getCode())
.eq(PdmBdWorkorder::getIs_delete, false));
// todo: 获取原材料物料
String materialId = workOrder.getMaterial_id();
// 获取原材料物料
PdmBdRequestMaterialRecord requestMaterialRecord = new PdmBdRequestMaterialRecord();
requestMaterialRecord.setRecord_id(IdUtil.getSnowflake(1,1).nextIdStr());
requestMaterialRecord.setMaterial_id(materialId);
requestMaterialRecord.setMaterial_id(workOrder.getRaw_material_id());
requestMaterialRecord.setWorkorder_id(workOrder.getWorkorder_id());
requestMaterialRecord.setDevice_code(parentPointCode);
requestMaterialRecord.setCreate_time(DateUtil.now());
requestMaterialRecordService.save(requestMaterialRecord);
return standResponse;
return BaseResponse.responseOk(requestNo);
}
@Override
@ -367,4 +366,30 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result.put("data", baseVehiclematerialgroup);
return result;
}
/** 实时修改点位状态 */
public BaseResponse realTimeSetPoint(JSONObject param) {
String requestNo = param.getString("requestNo");
String deviceCode = param.getString("device_code");
if (deviceCode == null) {
return BaseResponse.responseError(requestNo, "设备编码不能为空");
}
// move
String move = param.getString("move") + 1;
// 找到点位
SchBasePoint schBasePoint = pointService.getById(deviceCode);
if (ObjectUtil.isEmpty(schBasePoint)) {
return BaseResponse.responseError(requestNo, "设备: [" + deviceCode + "]未找到");
}
String pointStatus = ObjectUtil.isNotEmpty(schBasePoint.getPoint_status())
? schBasePoint.getPoint_status()
: "1";
if ((pointStatus.equals("3") && move.equals("2")) || (pointStatus.equals(move))) { // 不做操作
return BaseResponse.responseOk(requestNo);
}
schBasePoint.setPoint_status(move.toString());
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
return BaseResponse.responseOk(requestNo);
}
}

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/PdmBdWorkorder.java

@ -39,6 +39,9 @@ public class PdmBdWorkorder implements Serializable {
@ApiModelProperty(value = "物料标识")
private String material_id;
@ApiModelProperty(value = "原材料物料标识")
private String raw_material_id;
@ApiModelProperty(value = "载具类型")
private String vehicle_type;
@ -120,4 +123,10 @@ public class PdmBdWorkorder implements Serializable {
@TableField(exist = false)
private String material_spec;
@TableField(exist = false)
private String raw_material_name;
@TableField(exist = false)
private String raw_material_code;
}

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dao/mapper/PdmBdWorkorderMapper.xml

@ -6,8 +6,11 @@
,ma.material_name
,ma.material_code
,ma.material_spec
,ma2.material_name AS raw_material_name
,ma2.material_code AS raw_material_code
FROM pdm_bd_workorder wo
LEFT JOIN md_base_material ma ON ma.material_id = wo.material_id
LEFT JOIN md_base_material ma2 ON ma2.material_id = wo.raw_material_id
<where>
<if test="query.more_order_status != null and query.more_order_status != ''">
workorder_status IN

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/service/dto/PdmBdWorkorderDto.java

@ -28,6 +28,9 @@ public class PdmBdWorkorderDto implements Serializable {
/** 物料标识 */
private String material_id;
/** 原材料物料标识 */
private String raw_material_id;
/** 载具类型 */
private String vehicle_type;

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java

@ -182,6 +182,7 @@ public abstract class AbstractTask {
SchBaseTask task = new SchBaseTask(); // 任务实体
String apply_point_code = param.getString("device_code"); // 请求点
String config_code = param.getString("config_code");
String requestNo = param.getString("requestNo");
// 1、校验数据
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
.eq(SchBaseTaskconfig::getConfig_code, config_code));
@ -220,10 +221,10 @@ public abstract class AbstractTask {
return;
}
// 2、创建申请任务
task.setAcs_trace_id(requestNo);
task.setTask_code(IdUtil.getSnowflake(1, 1).nextIdStr());
task.setAcs_trace_id(param.getString("acs_trace_id"));
task.setConfig_code(config_code);
task.setCreate_mode(param.getString("create_mode"));
task.setCreate_mode(GeneralDefinition.ACS_CREATION);
task.setVehicle_code(param.getString("vehicle_code"));
task.setVehicle_qty(param.getInteger("vehicle_qty"));
task.setTask_status(TaskStatus.APPLY.getCode());

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java

@ -28,4 +28,9 @@ public class GeneralDefinition {
public static final String ENTRANCE = "1";
/**出口**/
public static final String EXIT = "2";
// 任务生产方式
/**自动创建**/
public static final String AUTO_CREATION = "1";
/**ACS创建**/
public static final String ACS_CREATION = "2";
}

25
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java

@ -1,6 +1,7 @@
package org.nl.wms.sch.task_manage.task.tasks.hn;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
@ -8,6 +9,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.Data;
import org.nl.common.exception.BadRequestException;
import org.nl.system.service.notice.ISysNoticeService;
import org.nl.wms.database.material.service.IMdBaseMaterialService;
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
import org.nl.wms.pdm.record.service.IPdmBdRequestMaterialRecordService;
import org.nl.wms.pdm.record.service.dao.PdmBdRequestMaterialRecord;
import org.nl.wms.pdm.record.service.dto.PdmBdRequestMaterialRecordDto;
@ -63,6 +66,8 @@ public class HNMLTask extends AbstractTask {
@Autowired
private ISysNoticeService noticeService;
@Autowired
private IMdBaseMaterialService materialService;
@Autowired
private HNMapper hnMapper;
@Autowired
private TaskUtils taskUtils;
@ -116,11 +121,13 @@ public class HNMLTask extends AbstractTask {
continue;
}
// 将找到的要料数据删除
// todo: 可能出现事务问题
requestMaterialRecordService.removeById(point.getRecord_id());
// 设置终点并修改创建成功状态
task.setPoint_code2(point.getPoint_code());
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("");
task.setVehicle_type(GeneralDefinition.STEEL_TRAY);
taskService.updateById(task);
point.setIng_task_code(task.getTask_code());
@ -139,24 +146,20 @@ public class HNMLTask extends AbstractTask {
}
/**
* 根据提前要料表的物料与混料的物料相同
* 根据提前要料表的物料与混料入库请求的物料相同
*
* @param nextRegionStr
* @param requestParam
* @return
*/
private SchBasePoint findNextPoint(List<String> nextRegionStr, JSONObject requestParam) {
// todo: 混碾无工单
String workorderCode = requestParam.getString("workorder_code"); // 混碾工单
PdmBdWorkorder one = ObjectUtil.isNotEmpty(workorderCode)
? workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>()
.eq(PdmBdWorkorder::getWorkorder_code, workorderCode))
: null;
if (one == null) {
throw new BadRequestException("混碾机的工单不能为空!");
}
// *: 混碾无工单
String materialCode = requestParam.getString("material_code");
Assert.notNull(materialCode, "物料编码不能为空!");
MdBaseMaterial baseMaterialObj = materialService.findByCode(materialCode);
Assert.notNull(materialCode, "物料: "+ materialCode + "未找到!");
// 根据工单物料标识寻找点位
List<SchBasePoint> points = hnMapper.findPointForHNML(nextRegionStr, one.getMaterial_id());
List<SchBasePoint> points = hnMapper.findPointForHNML(nextRegionStr, baseMaterialObj.getMaterial_id());
return ObjectUtil.isNotEmpty(points) ? points.get(0) : null;
}

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java

@ -73,7 +73,8 @@ public class YZSLTask extends AbstractTask {
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));
for (SchBaseTask task : tasks) {
taskUtils.setUpdateByAcs(task); // 修改修改者
List<String> nextRegionStr = Arrays.stream(taskConfig.getNext_region_str().split(",")).collect(Collectors.toList());
List<String> nextRegionStr = Arrays.stream(taskConfig.getNext_region_str().split(","))
.collect(Collectors.toList());
// 找终点
String requestParam = task.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam);
@ -168,7 +169,7 @@ public class YZSLTask extends AbstractTask {
}
String vehicleType = param.getString("vehicle_type");
String workorderCode = param.getString("workorder_code");
JSONObject stackParameters = param.getJSONObject("stackParameters");
JSONObject stackParameters = param.getJSONObject("PalletizeDto");
if (vehicleType == null) {
vehicleType = GeneralDefinition.STEEL_TRAY;
}
@ -200,8 +201,8 @@ public class YZSLTask extends AbstractTask {
groupEntity.setVehicle_code(vehicleCode);
groupEntity.setVehicle_type(vehicleType);
groupEntity.setMaterial_qty(qty);
groupEntity.setSource_vehicle_code(deviceCode);
groupEntity.setPoint_code(basePoint.getPoint_code()); // 哪台压机
groupEntity.setExt_data(JSONObject.toJSONString(stackParameters));
groupEntity.setPoint_code(basePoint.getPoint_code()); // 对接位
groupEntity.setPoint_name(basePoint.getPoint_name());
groupEntity.setPcsn(DateUtil.format(DateUtil.date(), "yyyyMMdd"));
groupEntity.setInstorage_time(DateUtil.now());

35
lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue

@ -93,7 +93,7 @@
</el-select>
</el-form-item>
<el-form-item label="物料名称" prop="material_name">
<el-input v-model="form.material_name" style="width: 240px;" @focus="getMaterial" />
<el-input v-model="form.material_name" style="width: 240px;" @focus="getMaterial(1)" />
</el-form-item>
<el-form-item label="物料编码">
<el-input v-model="form.material_code" style="width: 240px;" disabled />
@ -108,6 +108,12 @@
style="width: 240px;"
/>
</el-form-item>
<el-form-item label="原料名称" prop="material_name">
<el-input v-model="form.raw_material_name" style="width: 240px;" @focus="getMaterial(2)" />
</el-form-item>
<el-form-item label="原料编码">
<el-input v-model="form.raw_material_code" style="width: 240px;" disabled />
</el-form-item>
<el-form-item label="计划开始时间" prop="planproducestart_date">
<el-date-picker
v-model="form.planproducestart_date"
@ -332,7 +338,7 @@
<!--分页组件-->
<pagination />
</div>
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" />
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" :flag="flag"/>
</div>
</template>
@ -355,6 +361,9 @@ const defaultForm = {
plan_qty: null,
real_qty: null,
material_id: null,
raw_material_id: null,
raw_material_name: null,
raw_material_code: null,
vehicle_type: null,
planproducestart_date: null,
planproduceend_date: null,
@ -425,7 +434,8 @@ export default {
regionList: [],
pointList: [],
regionCodeParam: null,
materialDialog: false
materialDialog: false,
flag: 1
}
},
created() {
@ -464,14 +474,21 @@ export default {
})
}
},
getMaterial() {
getMaterial(flag) {
this.materialDialog = true
this.flag = flag
},
tableChanged(row) {
this.form.material_name = row.material_name
this.form.material_id = row.material_id
this.form.material_spec = row.material_spec
this.form.material_code = row.material_code
tableChanged(row, flag) {
if (flag === 1) {
this.form.material_name = row.material_name
this.form.material_id = row.material_id
this.form.material_spec = row.material_spec
this.form.material_code = row.material_code
} else {
this.form.raw_material_name = row.material_name
this.form.raw_material_id = row.material_id
this.form.raw_material_code = row.material_code
}
},
setRegionName(data) {
//

8
lms/nladmin-ui/src/views/wms/sch/group/MaterialDialog.vue

@ -101,6 +101,10 @@ export default {
isSingle: {
type: Boolean,
default: true
},
flag: {
type: Number,
default: 1
}
},
data() {
@ -143,7 +147,7 @@ export default {
//
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.tableRadio)
this.$emit('tableChanged', this.tableRadio, this.flag)
return
}
this.rows = this.$refs.table.selection
@ -153,7 +157,7 @@ export default {
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged', this.rows)
this.$emit('tableChanged', this.rows, this.flag)
}
}
}

Loading…
Cancel
Save