Merge branch 'master' of http://121.40.234.130:7788/lyd/zhuzhouzhongwu
# Conflicts: # lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/basedata_manage/service/dto/StrategyStructParam.java # lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch_manage/service/impl/SchBasePointServiceImpl.java
This commit is contained in:
@@ -67,4 +67,5 @@ public interface ISectattrService extends IService<Sectattr> {
|
||||
*/
|
||||
void changeActive(JSONObject json);
|
||||
|
||||
Sectattr findByCode(String code);
|
||||
}
|
||||
|
||||
@@ -230,9 +230,13 @@ public class Structattr implements Serializable {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 放置类型
|
||||
*/
|
||||
private String placement_type;
|
||||
/**
|
||||
* 占用状态:1空位 2空载具 3有料
|
||||
*/
|
||||
private Integer placement_type;
|
||||
private Integer occupancy_state;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@ package org.nl.wms.basedata_manage.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleext;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/6/5
|
||||
*/
|
||||
@Data
|
||||
public class MdPbStoragevehicleextDto extends MdPbStoragevehicleext{
|
||||
public class MdPbStoragevehicleextDto extends GroupPlate {
|
||||
|
||||
/**
|
||||
* 库区标识
|
||||
|
||||
@@ -57,8 +57,15 @@ public class StrategyStructParam {
|
||||
*/
|
||||
private String ioType;
|
||||
|
||||
|
||||
/**
|
||||
* 出入库类型
|
||||
*/
|
||||
private String stragegyType;
|
||||
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
private String dis_id;
|
||||
|
||||
}
|
||||
|
||||
@@ -241,4 +241,12 @@ public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> i
|
||||
.eq(Structattr::getSect_id, sect_id)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sectattr findByCode(String code) {
|
||||
LambdaQueryWrapper<Sectattr> queryWrapper = new LambdaQueryWrapper<>(Sectattr.class)
|
||||
.eq(Sectattr::getSect_code, code)
|
||||
.eq(Sectattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
return getOne(queryWrapper, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_id(currentUserId);
|
||||
dto.setUpdate_name(nickName);
|
||||
Sectattr sectattr = iSectattrService.findById(dto.getSect_id());
|
||||
Sectattr sectattr = iSectattrService.findByCode(dto.getSect_id());
|
||||
BsrealStorattr bsrealStorattr = iBsrealStorattrService.findById(sectattr.getStor_id());
|
||||
dto.setSect_code(sectattr.getSect_code());
|
||||
dto.setSect_name(sectattr.getSect_name());
|
||||
@@ -417,7 +417,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
Structattr structattr = this.getByCode(changeDto.getStructCode());
|
||||
for (GroupPlate vehicleMater : groupPlates) {
|
||||
String vehicleCode = vehicleMater.getStoragevehicle_code();
|
||||
BigDecimal subtract = vehicleMater.getQty().subtract(vehicleMater.getFrozen_qty());
|
||||
BigDecimal subtract = vehicleMater.getQty().add(vehicleMater.getFrozen_qty());
|
||||
//100-出50 = 50
|
||||
//如果出库是手持库出确认则不在这边变动组盘信息
|
||||
if (!changeDto.getInBound()) {
|
||||
@@ -425,7 +425,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
.set("frozen_qty", 0)
|
||||
.set("qty", subtract)
|
||||
.set("update_time", now)
|
||||
.set("status", GROUP_PLATE_STATUS.code("组盘"))
|
||||
.set("status", GROUP_PLATE_STATUS.code("出库"))
|
||||
.eq("group_id", vehicleMater.getGroup_id());
|
||||
iMdPbGroupplateService.update(update);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.decision_manage.service.strategyConfig.decisioner.impl.diy;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.decision_manage.service.strategyConfig.decisioner.Decisioner;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 原料出库规则
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/24
|
||||
*/
|
||||
@Slf4j
|
||||
@Service("rawOutRuleHandle")
|
||||
public class RawOutRuleHandle extends Decisioner<Structattr, JSONObject> {
|
||||
@Override
|
||||
public List<Structattr> handler(List<Structattr> list, JSONObject param) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.nl.wms.decision_manage.service.strategyConfig.decisioner.impl.diy;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.decision_manage.service.strategyConfig.decisioner.Decisioner;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 解包入库策略
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/23
|
||||
*/
|
||||
@Service("unpacking")
|
||||
@Slf4j
|
||||
public class UnpackingRuleHandler extends Decisioner<Structattr, JSONObject> {
|
||||
@Resource
|
||||
private IStructattrService iStructattrService;
|
||||
@Resource
|
||||
private IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||
@Resource
|
||||
private IOStorInvDisMapper disMapper;
|
||||
@Override
|
||||
public List<Structattr> handler(List<Structattr> list, JSONObject param) {
|
||||
IOStorInvDis dis = disMapper.selectById(param.getString("dis_id"));
|
||||
MdPbStoragevehicleinfo vinfo = iMdPbStoragevehicleinfoService.getByCode(dis.getStoragevehicle_code());
|
||||
if (ObjectUtil.isEmpty(vinfo)) {
|
||||
throw new BadRequestException("载具号【" + dis.getStoragevehicle_code() + "】未维护信息!");
|
||||
}
|
||||
// 获取仓库中对应托盘类型的可出的空桶点位
|
||||
List<Structattr> outPoints = iStructattrService.list(new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getOccupancy_state, 2)
|
||||
.eq(Structattr::getStoragevehicle_type, vinfo.getStoragevehicle_type())
|
||||
.eq(Structattr::getLock_type, "0")
|
||||
.eq(Structattr::getSect_code, param.getString("sect_code"))
|
||||
.eq(Structattr::getStor_id, param.getString("stor_code"))
|
||||
.isNotNull(Structattr::getStoragevehicle_code)
|
||||
.isNull(Structattr::getTask_code));
|
||||
if (outPoints.size() == 0) {
|
||||
throw new BadRequestException("料桶缓存库无空桶!");
|
||||
}
|
||||
return outPoints;
|
||||
}
|
||||
}
|
||||
@@ -38,4 +38,16 @@ public class PdaJBController {
|
||||
public ResponseEntity<Object> callMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaJBService.callMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/getWeight")
|
||||
@Log("获取重量")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getWeight(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaJBService.getWeight(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/downMaterial")
|
||||
@Log("解包下料")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> downMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaJBService.downMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,8 @@ public interface PdaJBService {
|
||||
PdaResponse getOrderList(JSONObject whereJson);
|
||||
|
||||
PdaResponse callMaterial(JSONObject whereJson);
|
||||
|
||||
PdaResponse getWeight(JSONObject whereJson);
|
||||
|
||||
PdaResponse downMaterial(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
@@ -13,8 +14,10 @@ import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.ISectattrService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.pda_manage.sch_manage.service.PdaJBService;
|
||||
import org.nl.wms.pda_manage.sch_manage.service.mapper.PdaJBMapper;
|
||||
@@ -23,15 +26,19 @@ import org.nl.wms.pm_manage.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pm_manage.service.dao.PdmBdWorkorder;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.jb.JbUpAgvTask;
|
||||
import org.nl.wms.system_manage.service.dict.ISysDictService;
|
||||
import org.nl.wms.system_manage.service.dict.dao.Dict;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.IOutBillService;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInv;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDtl;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDtlMapper;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvMapper;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -40,9 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
@@ -75,10 +80,18 @@ public class PdaJBServiceImpl implements PdaJBService {
|
||||
private ISchBasePointService pointService;
|
||||
@Resource
|
||||
private JbUpAgvTask jbUpAgvTask;
|
||||
|
||||
@Resource
|
||||
private ISysDictService dictService;
|
||||
@Resource
|
||||
private ISectattrService sectattrService;
|
||||
@Resource
|
||||
private IInBillService inBillService;
|
||||
@Override
|
||||
public PdaResponse getOrderList(JSONObject whereJson) {
|
||||
List<PdmBdWorkorder> workorders = pdaJBMapper.getUnProductOrderList(whereJson.getString("point_code"));
|
||||
String flag = whereJson.getString("flag");
|
||||
List<PdmBdWorkorder> workorders = pdaJBMapper.getUnProductOrderList(
|
||||
whereJson.getString("point_code"),
|
||||
"1".equals(flag) ? "1" : "4");
|
||||
return PdaResponse.requestParamOk(workorders);
|
||||
}
|
||||
|
||||
@@ -86,17 +99,15 @@ public class PdaJBServiceImpl implements PdaJBService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PdaResponse callMaterial(JSONObject whereJson) {
|
||||
log.info("解包叫料,请求参数:{}", whereJson);
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
// workorder_id、area、point_code
|
||||
String pointCode = whereJson.getString("point_code");
|
||||
String workorderId = whereJson.getString("workorder_id");
|
||||
PdmBdWorkorder workorder = workorderService.getById(workorderId);
|
||||
if (ObjectUtil.isEmpty(workorder)) {
|
||||
throw new BadRequestException("工单不存在!");
|
||||
}
|
||||
if ("3".equals(workorder.getWorkorder_status())) {
|
||||
throw new BadRequestException("该工单已经执行中,请勿重复开工!");
|
||||
if (!"1".equals(workorder.getWorkorder_status())) {
|
||||
throw new BadRequestException("该工单不是未生产,无法开工!");
|
||||
}
|
||||
// 出库的仓位
|
||||
Structattr outStructAttr = structattrService.getByCode(workorder.getStruct_code());
|
||||
@@ -114,122 +125,229 @@ public class PdaJBServiceImpl implements PdaJBService {
|
||||
throw new BadRequestException("托盘[" + outStructAttr.getStoragevehicle_code() + "]组盘信息不存在!");
|
||||
}
|
||||
// 1、创建出库单、明细、分配明细
|
||||
// 1.1 单据表
|
||||
String invId = IdUtil.getStringId();
|
||||
IOStorInv ioStorInv = new IOStorInv();
|
||||
ioStorInv.setIostorinv_id(invId);
|
||||
ioStorInv.setBill_code(CodeUtil.getNewCode("OUT_STORE_CODE"));
|
||||
ioStorInv.setBiz_date(DateUtil.format(new Date(), "yyyy-MM-dd"));
|
||||
ioStorInv.setIo_type(IOSEnum.IO_TYPE.code("出库"));
|
||||
ioStorInv.setDetail_count(1);
|
||||
ioStorInv.setCreate_mode(IOSEnum.CREATE_MODE.code("终端产生"));
|
||||
ioStorInv.setStor_id(outStructAttr.getStor_id());
|
||||
ioStorInv.setStor_code(outStructAttr.getStor_code());
|
||||
ioStorInv.setStor_name(outStructAttr.getStor_name());
|
||||
ioStorInv.setBill_status(IOSEnum.BILL_STATUS.code("分配完"));
|
||||
ioStorInv.setBill_type("1009");
|
||||
ioStorInv.setIs_delete(BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
ioStorInv.setIs_upload(BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
ioStorInv.setInput_optid(currentUserId);
|
||||
ioStorInv.setInput_optname(nickName);
|
||||
ioStorInv.setInput_time(now);
|
||||
ioStorInv.setUpdate_optid(currentUserId);
|
||||
ioStorInv.setUpdate_optname(nickName);
|
||||
ioStorInv.setUpdate_time(now);
|
||||
ioStorInv.setTotal_qty(BigDecimal.valueOf(1));
|
||||
ioStorInv.setDetail_count(1);
|
||||
outBillService.save(ioStorInv);
|
||||
// 1.2 单据明细
|
||||
IOStorInvDtl dtl = new IOStorInvDtl();
|
||||
dtl.setIostorinvdtl_id(IdUtil.getStringId());
|
||||
dtl.setIostorinv_id(invId);
|
||||
dtl.setSeq_no("1");
|
||||
dtl.setMaterial_id(materialbase.getMaterial_id());
|
||||
dtl.setMaterial_code(materialbase.getMaterial_code());
|
||||
dtl.setPcsn(groupPlate.getPcsn());
|
||||
dtl.setBill_status(IOSEnum.BILL_STATUS.code("分配完"));
|
||||
dtl.setQty_unit_id(groupPlate.getQty_unit_id());
|
||||
dtl.setQty_unit_name(groupPlate.getQty_unit_name());
|
||||
dtl.setPlan_qty(BigDecimal.ONE);
|
||||
dtl.setAssign_qty(BigDecimal.ONE);
|
||||
dtl.setUnassign_qty(BigDecimal.ZERO);
|
||||
ioStorInvDtlMapper.insert(dtl);
|
||||
// 1.3 分配明细
|
||||
IOStorInvDis ioStorInvDis = new IOStorInvDis();
|
||||
ioStorInvDis.setIostorinvdis_id(IdUtil.getStringId());
|
||||
ioStorInvDis.setIostorinv_id(dtl.getIostorinv_id());
|
||||
ioStorInvDis.setIostorinvdtl_id(dtl.getIostorinvdtl_id());
|
||||
ioStorInvDis.setSeq_no("1");
|
||||
ioStorInvDis.setSect_id(outStructAttr.getSect_id());
|
||||
ioStorInvDis.setPcsn(groupPlate.getPcsn());
|
||||
ioStorInvDis.setMaterial_id(materialbase.getMaterial_id());
|
||||
ioStorInvDis.setMaterial_code(materialbase.getMaterial_code());
|
||||
ioStorInvDis.setSect_name(outStructAttr.getSect_name());
|
||||
ioStorInvDis.setSect_code(outStructAttr.getSect_code());
|
||||
ioStorInvDis.setStruct_id(outStructAttr.getStruct_id());
|
||||
ioStorInvDis.setStruct_name(outStructAttr.getStruct_name());
|
||||
ioStorInvDis.setStruct_code(outStructAttr.getStruct_code());
|
||||
ioStorInvDis.setStoragevehicle_code(outStructAttr.getStoragevehicle_code());
|
||||
ioStorInvDis.setIs_issued(BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
ioStorInvDis.setQty_unit_id(groupPlate.getQty_unit_id());
|
||||
ioStorInvDis.setQty_unit_name(groupPlate.getQty_unit_name());
|
||||
ioStorInvDis.setWork_status(IOSEnum.INBILL_DIS_STATUS.code("生成"));
|
||||
ioStorInvDis.setPlan_qty(groupPlate.getFrozen_qty());
|
||||
JSONObject insertInvObj = new JSONObject();
|
||||
JSONArray tableData = new JSONArray();
|
||||
JSONObject table = new JSONObject();
|
||||
tableData.add(table);
|
||||
insertInvObj.put("stor_id", outStructAttr.getStor_id());
|
||||
insertInvObj.put("stor_code", outStructAttr.getStor_code());
|
||||
insertInvObj.put("bill_status", "10");
|
||||
insertInvObj.put("total_qty", workorder.getPlan_weight());
|
||||
insertInvObj.put("detail_count", 1);
|
||||
insertInvObj.put("bill_type", "1012");
|
||||
insertInvObj.put("biz_date", DateUtil.format(new Date(), "yyyy-MM-dd"));
|
||||
insertInvObj.put("tableData", tableData);
|
||||
table.put("turnout_struct_code", outStructAttr.getStruct_code());
|
||||
table.put("turnout_sect_code", outStructAttr.getSect_code());
|
||||
table.put("turnout_sect_name", outStructAttr.getSect_name());
|
||||
table.put("sect_id", outStructAttr.getSect_id());
|
||||
table.put("struct_id", outStructAttr.getStruct_id());
|
||||
table.put("group_id", groupPlate.getGroup_id());
|
||||
table.put("storagevehicle_code", outStructAttr.getStoragevehicle_code());
|
||||
table.put("storagevehicle_type", workorder.getVehicle_type());
|
||||
table.put("material_id", materialbase.getMaterial_id());
|
||||
table.put("pcsn", groupPlate.getPcsn());
|
||||
table.put("qty", groupPlate.getQty());
|
||||
table.put("qty_unit_id", groupPlate.getQty_unit_id());
|
||||
table.put("qty_unit_name", groupPlate.getQty_unit_name());
|
||||
table.put("fronzen_qty", 0);
|
||||
table.put("status", "01");
|
||||
table.put("material_code", materialbase.getMaterial_code());
|
||||
table.put("material_name", materialbase.getMaterial_name());
|
||||
table.put("material_spec", materialbase.getMaterial_spec());
|
||||
String invId = outBillService.insertDtl(insertInvObj);
|
||||
// 调用手工分配
|
||||
JSONObject param = new JSONObject();
|
||||
JSONObject row = new JSONObject();
|
||||
JSONArray rows = new JSONArray();
|
||||
rows.add(row);
|
||||
param.put("rows", rows);
|
||||
IOStorInvDtl dtl = ioStorInvDtlMapper.selectOne(new LambdaQueryWrapper<IOStorInvDtl>()
|
||||
.eq(IOStorInvDtl::getIostorinv_id, invId));
|
||||
param.put("row", dtl);
|
||||
row.put("storagevehicle_code", outStructAttr.getStoragevehicle_code());
|
||||
row.put("pcsn", groupPlate.getPcsn());
|
||||
row.put("qty", groupPlate.getQty());
|
||||
row.put("qty_unit_name", groupPlate.getQty_unit_name());
|
||||
row.put("frozen_qty", groupPlate.getFrozen_qty());
|
||||
row.put("struct_id", outStructAttr.getStruct_id());
|
||||
row.put("struct_code", outStructAttr.getStruct_code());
|
||||
row.put("struct_name", outStructAttr.getStruct_name());
|
||||
row.put("sect_id", outStructAttr.getSect_id());
|
||||
row.put("sect_code", outStructAttr.getSect_code());
|
||||
row.put("sect_name", outStructAttr.getSect_name());
|
||||
row.put("material_code", groupPlate.getMaterial_code());
|
||||
row.put("material_name", groupPlate.getMaterial_name());
|
||||
row.put("edit", true);
|
||||
outBillService.manualDiv(param);
|
||||
|
||||
// 1.3 仓位锁住
|
||||
JSONObject lock_map = new JSONObject();
|
||||
lock_map.put("struct_code", outStructAttr.getStruct_code());
|
||||
lock_map.put("inv_id", ioStorInv.getIostorinv_id());
|
||||
lock_map.put("inv_code", ioStorInv.getBill_code());
|
||||
lock_map.put("inv_type", ioStorInv.getBill_type());
|
||||
lock_map.put("lock_type", IOSEnum.LOCK_TYPE.code("出库锁"));
|
||||
iStructattrService.updateStatusByCode("0",lock_map);
|
||||
//更新组盘表冻结数量状态
|
||||
iMdPbGroupPlateService.update(new LambdaUpdateWrapper<GroupPlate>()
|
||||
.set(GroupPlate::getFrozen_qty, "1")
|
||||
.set(GroupPlate::getUpdate_time, now)
|
||||
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||
.eq(GroupPlate::getStoragevehicle_code, outStructAttr.getStoragevehicle_code())
|
||||
.eq(GroupPlate::getPcsn, groupPlate.getPcsn())
|
||||
.eq(GroupPlate::getMaterial_id, materialbase.getMaterial_id())
|
||||
.eq(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("入库")));
|
||||
// 2、创建任务、下发
|
||||
// 获取工单对应的区域的出入点
|
||||
SchBasePoint inPoint = pointService.getNotTaskByRegionAndType(workorder.getRegion_code(), "3");
|
||||
SchBasePoint outPoint = pointService.getNotTaskByRegionAndType(workorder.getRegion_code(), "4");
|
||||
if (ObjectUtil.isEmpty(inPoint) || ObjectUtil.isEmpty(outPoint)) {
|
||||
throw new BadRequestException("解包机输送线点位不存在或者存在任务!");
|
||||
}
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "JbUpAgvTask");
|
||||
task_form.put("group_id", groupPlate.getGroup_id());
|
||||
task_form.put("order_id", workorder.getWorkorder_id());
|
||||
task_form.put("TaskCode",CodeUtil.getNewCode("TASK_CODE"));
|
||||
task_form.put("point_code1", outStructAttr.getStruct_code());
|
||||
task_form.put("point_code2", inPoint.getPoint_code());
|
||||
task_form.put("vehicle_code", outStructAttr.getStoragevehicle_code());
|
||||
if ("2".equals(outPoint.getPoint_status())) {
|
||||
// 四点任务
|
||||
task_form.put("point_code3", outPoint.getPoint_code());
|
||||
task_form.put("point_code4", outStructAttr.getStruct_code());
|
||||
task_form.put("vehicle_code2", outPoint.getVehicle_code());
|
||||
}
|
||||
String task_id = jbUpAgvTask.create(task_form);
|
||||
ioStorInvDis.setTask_id(task_id);
|
||||
ioStorInvDis.setIs_issued(BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
ioStorInvDis.setPoint_code(outStructAttr.getStruct_code());
|
||||
ioStorInvDisMapper.insert(ioStorInvDis);
|
||||
// 创建任务
|
||||
SchBasePoint outPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getParent_point_code, pointCode)
|
||||
.eq(SchBasePoint::getRegion_code, "CKQ"));
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("order_id", workorderId);
|
||||
taskParam.put("iostorinv_id", invId);
|
||||
taskParam.put("point_code", outPoint.getPoint_code());
|
||||
outBillService.allSetPoint(taskParam);
|
||||
|
||||
// 3、工单状态修改,设置实际开始时间
|
||||
workorder.setWorkorder_status("3");
|
||||
workorder.setRealproducestart_date(DateUtil.now());
|
||||
workorderService.updateById(workorder);
|
||||
|
||||
inPoint.setIng_task_code(task_id);
|
||||
if ("2".equals(outPoint.getPoint_status())) {
|
||||
outPoint.setIng_task_code(task_id);
|
||||
}
|
||||
pointService.updateBatchById(Arrays.asList(inPoint, outPoint));
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse getWeight(JSONObject whereJson) {
|
||||
// todo: 调用acs获取
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("weight", "999.99");
|
||||
res.put("flag", "2");
|
||||
res.put("message", "重量误差过大,请注意!");
|
||||
return PdaResponse.requestParamOk(res);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PdaResponse downMaterial(JSONObject whereJson) {
|
||||
// 用任务组的方式下发任务(3条任务)
|
||||
log.info("解包下料,请求参数:{}", whereJson);
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
// workorder_id、area、point_code、weight、tp_code、lt_code
|
||||
String area = whereJson.getString("area");
|
||||
// 设备
|
||||
String pointCode = whereJson.getString("point_code");
|
||||
BigDecimal weight = whereJson.getBigDecimal("weight");
|
||||
String tpCode = whereJson.getString("tp_code");
|
||||
String ltCode = whereJson.getString("lt_code");
|
||||
String workorderId = whereJson.getString("workorder_id");
|
||||
|
||||
PdmBdWorkorder workorder = workorderService.getById(workorderId);
|
||||
if (ObjectUtil.isEmpty(workorder)) {
|
||||
throw new BadRequestException("工单不存在!");
|
||||
}
|
||||
// 物料
|
||||
MdMeMaterialbase materialbase = materialbaseService.getById(workorder.getMaterial_id());
|
||||
if (ObjectUtil.isEmpty(materialbase)) {
|
||||
throw new BadRequestException("物料【" + workorder.getMaterial_id() + "】不存在!");
|
||||
}
|
||||
// 0、创建组盘
|
||||
GroupPlate groupPlate = new GroupPlate();
|
||||
groupPlate.setGroup_id(IdUtil.getStringId());
|
||||
groupPlate.setStoragevehicle_code(ltCode);
|
||||
// 料桶类型根据工单,工单是根据点位
|
||||
groupPlate.setStoragevehicle_type(workorder.getVehicle_type());
|
||||
groupPlate.setMaterial_id(materialbase.getMaterial_id());
|
||||
groupPlate.setPcsn(DateUtil.format(new Date(), "yyyy-MM-dd"));
|
||||
groupPlate.setQty(weight);
|
||||
groupPlate.setQty_unit_id("11");
|
||||
groupPlate.setQty_unit_name("kg");
|
||||
groupPlate.setFrozen_qty(BigDecimal.ZERO);
|
||||
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("组盘"));
|
||||
groupPlate.setCreate_id(currentUserId);
|
||||
groupPlate.setCreate_name(nickName);
|
||||
groupPlate.setCreate_time(now);
|
||||
groupplateService.save(groupPlate);
|
||||
|
||||
Dict dict = dictService.getDictByCodeAndValue("storagevehicle_type", workorder.getVehicle_type());
|
||||
Sectattr sect = sectattrService.findByCode(dict.getPara1());
|
||||
// 组装插入主表明细表的数据
|
||||
Map<String, Object> insertInvObj = buildInsertData(ltCode, workorder, materialbase, groupPlate, sect);
|
||||
String invId = inBillService.insertDtl(insertInvObj);
|
||||
|
||||
// 组织数据,调用分配货位
|
||||
JSONObject divObj = buildDivStructData(sect, invId);
|
||||
inBillService.divStruct(divObj);
|
||||
|
||||
// 一键设置,创建任务
|
||||
// 组建参数
|
||||
Map<String, Object> jsonMst = buildTaskData(pointCode, workorderId, invId);
|
||||
inBillService.divPoint(jsonMst);
|
||||
|
||||
// 工单完成
|
||||
workorder.setWorkorder_status("5");
|
||||
workorder.setRealproduceend_date(DateUtil.now());
|
||||
workorderService.updateById(workorder);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
private Map<String, Object> buildTaskData(String pointCode, String workorderId, String invId) {
|
||||
Map<String, Object> jsonMst = new HashMap<>();
|
||||
// ru库点
|
||||
List<SchBasePoint> rkq = pointService.list(new LambdaUpdateWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, "RKQ")
|
||||
.eq(SchBasePoint::getParent_point_code, pointCode)
|
||||
.isNull(SchBasePoint::getIng_task_code));
|
||||
if (rkq.size() == 0) {
|
||||
throw new BadRequestException("找不到可用的解包区入库点!");
|
||||
}
|
||||
jsonMst.put("point_code", rkq.get(0).getPoint_code());
|
||||
// 组织明细数据
|
||||
IOStorInvDtl dtlDao = ioStorInvDtlMapper.selectOne(
|
||||
new QueryWrapper<IOStorInvDtl>().lambda()
|
||||
.eq(IOStorInvDtl::getIostorinv_id, invId)
|
||||
);
|
||||
// 查找分配明细
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("iostorinvdtl_id",dtlDao.getIostorinvdtl_id());
|
||||
List<IOStorInvDisDto> disDtl = inBillService.getDisDtl(map);
|
||||
// 类型转换
|
||||
ArrayList<LinkedHashMap> tableMater = new ArrayList<>();
|
||||
disDtl.forEach(item -> {
|
||||
tableMater.add(JSONObject.parseObject(JSONObject.toJSONString(item), LinkedHashMap.class));
|
||||
});
|
||||
jsonMst.put("tableMater", tableMater);
|
||||
jsonMst.put("workorder_id", workorderId);
|
||||
return jsonMst;
|
||||
}
|
||||
|
||||
private JSONObject buildDivStructData(Sectattr sect, String invId) {
|
||||
JSONObject divObj = new JSONObject();
|
||||
divObj.put("sect_code", sect.getSect_code());
|
||||
divObj.put("stor_code", sect.getStor_id());
|
||||
divObj.put("checked", true);
|
||||
List<IOStorInvDis> ioStorInvDis = ioStorInvDisMapper.selectList(new LambdaQueryWrapper<IOStorInvDis>()
|
||||
.eq(IOStorInvDis::getIostorinv_id, invId));
|
||||
if (ioStorInvDis.size() == 0) {
|
||||
throw new BadRequestException("分配明细不存在!");
|
||||
}
|
||||
// 类型转换
|
||||
ArrayList<LinkedHashMap> tables = new ArrayList<>();
|
||||
ioStorInvDis.forEach(item -> {
|
||||
tables.add(JSONObject.parseObject(JSONObject.toJSONString(item), LinkedHashMap.class));
|
||||
});
|
||||
divObj.put("tableMater", tables);
|
||||
return divObj;
|
||||
}
|
||||
|
||||
public static Map<String, Object> buildInsertData(String ltCode, PdmBdWorkorder workorder, MdMeMaterialbase materialbase, GroupPlate groupPlate, Sectattr sect) {
|
||||
Map<String, Object> insertInvObj = new HashMap();
|
||||
ArrayList<HashMap> tableData = new ArrayList<>();
|
||||
HashMap<String, Object> table = new HashMap<>();
|
||||
tableData.add(table);
|
||||
insertInvObj.put("stor_id", sect.getStor_id());
|
||||
insertInvObj.put("bill_status", "10");
|
||||
insertInvObj.put("total_qty", workorder.getPlan_weight());
|
||||
insertInvObj.put("detail_count", 1);
|
||||
insertInvObj.put("bill_type", "0011");
|
||||
insertInvObj.put("biz_date", DateUtil.format(new Date(), "yyyy-MM-dd"));
|
||||
insertInvObj.put("tableData", tableData);
|
||||
table.put("group_id", groupPlate.getGroup_id());
|
||||
table.put("storagevehicle_code", ltCode);
|
||||
table.put("storagevehicle_type", workorder.getVehicle_type());
|
||||
table.put("material_id", materialbase.getMaterial_id());
|
||||
table.put("pcsn", groupPlate.getPcsn());
|
||||
table.put("qty", groupPlate.getQty());
|
||||
table.put("qty_unit_id", groupPlate.getQty_unit_id());
|
||||
table.put("qty_unit_name", groupPlate.getQty_unit_name());
|
||||
table.put("fronzen_qty", groupPlate.getFrozen_qty());
|
||||
table.put("status", "01");
|
||||
table.put("material_code", materialbase.getMaterial_code());
|
||||
table.put("material_name", materialbase.getMaterial_name());
|
||||
table.put("material_spec", materialbase.getMaterial_spec());
|
||||
return insertInvObj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.nl.wms.pda_manage.sch_manage.service.mapper;
|
||||
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.pm_manage.service.dao.PdmBdWorkorder;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -9,5 +11,21 @@ import java.util.List;
|
||||
* @Date: 2025/7/21
|
||||
*/
|
||||
public interface PdaJBMapper {
|
||||
List<PdmBdWorkorder> getUnProductOrderList(String pointCode);
|
||||
List<PdmBdWorkorder> getUnProductOrderList(String pointCode, String workorder_status);
|
||||
|
||||
/**
|
||||
* 查找没有任务的空桶仓位
|
||||
* @param vehicleType
|
||||
* @param storCode
|
||||
* @return
|
||||
*/
|
||||
List<Structattr> getNoTaskEmptyBarrelStructs(String vehicleType, String storCode);
|
||||
|
||||
/**
|
||||
* 获取可以用的开该机
|
||||
* @param workorder
|
||||
* @param pointStatus
|
||||
* @return
|
||||
*/
|
||||
List<SchBasePoint> getCanUseCFGJ(PdmBdWorkorder workorder, String pointStatus);
|
||||
}
|
||||
|
||||
@@ -2,14 +2,39 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.pda_manage.sch_manage.service.mapper.PdaJBMapper">
|
||||
<select id="getUnProductOrderList" resultType="org.nl.wms.pm_manage.service.dao.PdmBdWorkorder">
|
||||
SELECT
|
||||
o.*,
|
||||
mm.material_code,
|
||||
mm.material_name
|
||||
FROM
|
||||
`pdm_bd_workorder` o
|
||||
LEFT JOIN md_me_materialbase mm ON mm.material_id = o.material_id
|
||||
WHERE o.workorder_status = '1'
|
||||
SELECT o.*,
|
||||
mm.material_code,
|
||||
mm.material_name
|
||||
FROM `pdm_bd_workorder` o
|
||||
LEFT JOIN md_me_materialbase mm ON mm.material_id = o.material_id
|
||||
WHERE o.workorder_status = #{workorder_status}
|
||||
AND o.point_code = #{pointCode}
|
||||
</select>
|
||||
<select id="getNoTaskEmptyBarrelStructs" resultType="org.nl.wms.basedata_manage.service.dao.Structattr">
|
||||
|
||||
</select>
|
||||
<select id="getCanUseCFGJ" resultType="org.nl.wms.sch_manage.service.dao.SchBasePoint">
|
||||
SELECT
|
||||
p.*
|
||||
FROM
|
||||
`sch_base_point` p
|
||||
WHERE
|
||||
p.region_code = #{workorder.region_code}
|
||||
AND p.point_status = #{pointStatus}
|
||||
AND p.can_vehicle_type LIKE CONCAT('%', #{workorder.vehicle_type}, '%')
|
||||
AND 0 = (
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
sch_base_task t
|
||||
WHERE
|
||||
t.is_delete = '0'
|
||||
AND t.task_status <![CDATA[<]]> '4'
|
||||
AND (
|
||||
t.point_code1 = p.point_code
|
||||
OR t.point_code2 = p.point_code
|
||||
OR t.point_code3 = p.point_code
|
||||
OR t.point_code4 = p.point_code
|
||||
))
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -76,6 +76,11 @@ public class SchBasePointController {
|
||||
public ResponseEntity<Object> getPointList(@RequestBody(required = false) SchBasePoint region) {
|
||||
return new ResponseEntity<>(schBasePointService.getPointList(region), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/getPointList2")
|
||||
@Log("获取区域下拉框")
|
||||
public ResponseEntity<Object> getPointList2(@RequestBody(required = false) SchBasePoint region) {
|
||||
return new ResponseEntity<>(schBasePointService.getPointList2(region), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("锁定与解锁")
|
||||
@PostMapping("/changeLock")
|
||||
|
||||
@@ -114,4 +114,14 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
pointType, String pointCode, String vehicleIsNull, boolean isFourPoint);
|
||||
|
||||
SchBasePoint getNotTaskByRegionAndType(String regionCode, String s);
|
||||
|
||||
/**
|
||||
* 获取可用的没任务的点位
|
||||
* @param parentPoint
|
||||
* @param pointStatus
|
||||
* @return
|
||||
*/
|
||||
List<SchBasePoint> getCanUseCFGJs(SchBasePoint parentPoint, String pointStatus);
|
||||
|
||||
List<SchBasePoint> getPointList2(SchBasePoint region);
|
||||
}
|
||||
|
||||
@@ -46,4 +46,6 @@ public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
||||
IPage<SchBasePoint> selectPageLeftJoin(IPage<SchBasePoint> pages, SchBasePointQuery whereJson);
|
||||
|
||||
SchBasePoint getNotTaskByRegionAndType(String regionCode, String type);
|
||||
|
||||
List<SchBasePoint> getCanUseCFGJs(SchBasePoint parentPoint, String pointStatus);
|
||||
}
|
||||
|
||||
@@ -86,4 +86,28 @@
|
||||
AND t.point_code4 = p.point_code
|
||||
))
|
||||
</select>
|
||||
<select id="getCanUseCFGJs" resultType="org.nl.wms.sch_manage.service.dao.SchBasePoint">
|
||||
SELECT
|
||||
p.*
|
||||
FROM
|
||||
`sch_base_point` p
|
||||
WHERE
|
||||
p.region_code = 'DTCFGQ'
|
||||
AND p.point_status = #{pointStatus}
|
||||
AND p.can_vehicle_type LIKE CONCAT('%', #{parentPoint.can_vehicle_type}, '%')
|
||||
AND 0 = (
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
sch_base_task t
|
||||
WHERE
|
||||
t.is_delete = '0'
|
||||
AND t.task_status <![CDATA[<]]> '4'
|
||||
AND (
|
||||
t.point_code1 = p.point_code
|
||||
OR t.point_code2 = p.point_code
|
||||
OR t.point_code3 = p.point_code
|
||||
OR t.point_code4 = p.point_code
|
||||
))
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -189,7 +189,6 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
}
|
||||
return pointMapper.selectList(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, region.getRegion_code())
|
||||
|
||||
//点位类型,根据传入的值是否为空增加判断
|
||||
.eq(StringUtils.isNotBlank(region.getPoint_type()), SchBasePoint::getPoint_type, region.getPoint_type())
|
||||
.eq(SchBasePoint::getIs_has_workder, true));
|
||||
@@ -311,4 +310,19 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
return this.baseMapper.getNotTaskByRegionAndType(regionCode, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SchBasePoint> getCanUseCFGJs(SchBasePoint parentPoint, String pointStatus) {
|
||||
return this.baseMapper.getCanUseCFGJs(parentPoint, pointStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SchBasePoint> getPointList2(SchBasePoint region) {
|
||||
if (ObjectUtil.isEmpty(region)) {
|
||||
return this.list();
|
||||
}
|
||||
return pointMapper.selectList(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, region.getRegion_code())
|
||||
.eq(SchBasePoint::getIs_has_workder, true));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.ext_manage.service.WmsToAcsService;
|
||||
import org.nl.wms.ext_manage.service.util.AcsResponse;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
@@ -142,6 +143,16 @@ public abstract class AbstractTask {
|
||||
return resultForAcs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请任务
|
||||
*
|
||||
* @param param
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public void apply(JSONObject param) throws BadRequestException {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 反馈任务状态
|
||||
* @param taskCode 任务编码
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
package org.nl.wms.sch_manage.service.util.tasks.jb;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.pm_manage.service.dao.PdmBdWorkorder;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.IInBillService;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 解包下料
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/24
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("JbDownAgvTask")
|
||||
public class JbDownAgvTask extends AbstractTask {
|
||||
@Resource
|
||||
private ISchBaseTaskService taskService;
|
||||
@Resource
|
||||
private IInBillService inBillService;
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
@Resource
|
||||
private ISchBasePointService pointService;
|
||||
@Override
|
||||
public String create(JSONObject param) {
|
||||
// 改造:多条任务
|
||||
JSONArray tasks = param.getJSONArray("tasks");
|
||||
List<SchBaseTask> batchTask = new ArrayList<>();
|
||||
for (int i = 0; i < tasks.size(); i++) {
|
||||
JSONObject json = tasks.getJSONObject(i);
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(json.getString("TaskCode"));
|
||||
task.setTask_status(TaskStatus.CREATE.getCode());
|
||||
task.setConfig_code(json.getString("task_type"));
|
||||
task.setPoint_code1(json.getString("point_code1"));
|
||||
task.setPoint_code2(json.getString("point_code2"));
|
||||
task.setPoint_code3(json.getString("point_code3"));
|
||||
task.setPoint_code4(json.getString("point_code4"));
|
||||
task.setVehicle_code(json.getString("vehicle_code"));
|
||||
task.setVehicle_code2(json.getString("vehicle_code2"));
|
||||
task.setGroup_id(json.getString("group_id"));
|
||||
task.setTask_group_id(json.getString("task_group_id"));
|
||||
task.setTask_group_seq(json.getBigDecimal("task_group_seq"));
|
||||
task.setRequest_param(json.toString());
|
||||
task.setPriority(json.getString("Priority"));
|
||||
task.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
task.setCreate_time(DateUtil.now());
|
||||
batchTask.add(task);
|
||||
}
|
||||
|
||||
taskService.saveBatch(batchTask);
|
||||
return batchTask.get(2).getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AcsTaskDto sendAcsParam(String taskId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateStatus(String task_code, TaskStatus status) {
|
||||
// 校验任务
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) {
|
||||
throw new BadRequestException("该任务已完成!");
|
||||
}
|
||||
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
|
||||
throw new BadRequestException("该任务已取消!");
|
||||
}
|
||||
// 根据传来的类型去对任务进行操作
|
||||
if (status.equals(TaskStatus.EXECUTING)) {
|
||||
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
||||
taskObj.setRemark("执行中");
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.FINISHED)) {
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.CANCELED)) {
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelTask(SchBaseTask taskObj) {
|
||||
// 取消任务
|
||||
taskService.update(new LambdaUpdateWrapper<SchBaseTask>()
|
||||
.set(SchBaseTask::getTask_status, TaskStatus.CANCELED.getCode())
|
||||
.set(SchBaseTask::getRemark, "已取消")
|
||||
.eq(SchBaseTask::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
//分配表清除任务
|
||||
ioStorInvDisMapper.update(new IOStorInvDis(),new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getTask_id,null)
|
||||
.set(IOStorInvDis::getPoint_code,null)
|
||||
.set(IOStorInvDis::getIs_issued,0)
|
||||
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("未生成"))
|
||||
.eq(IOStorInvDis::getTask_id,taskObj.getTask_id())
|
||||
);
|
||||
}
|
||||
|
||||
private void finishTask(SchBaseTask taskObj) {
|
||||
// 任务完成
|
||||
taskObj.setRemark("等待最后一条任务完成");
|
||||
if ("1".equals(taskObj.getTask_group_seq().toString())) {
|
||||
// 开盖设置成有盖
|
||||
SchBasePoint khgPoint = pointService.getById(taskObj.getPoint_code2());
|
||||
khgPoint.setPoint_status("2");
|
||||
khgPoint.setUpdate_time(DateUtil.now());
|
||||
pointService.updateById(khgPoint);
|
||||
}
|
||||
if ("2".equals(taskObj.getTask_group_seq().toString())) {
|
||||
SchBasePoint jbjPoint = pointService.getById(taskObj.getPoint_code1());
|
||||
jbjPoint.setPoint_status("2");
|
||||
jbjPoint.setVehicle_code(taskObj.getVehicle_code());
|
||||
jbjPoint.setUpdate_time(DateUtil.now());
|
||||
pointService.updateById(jbjPoint);
|
||||
}
|
||||
if ("3".equals(taskObj.getTask_group_seq().toString())) {
|
||||
// 开盖设置成有盖
|
||||
SchBasePoint khgPoint = pointService.getById(taskObj.getPoint_code2());
|
||||
khgPoint.setPoint_status("2");
|
||||
khgPoint.setUpdate_time(DateUtil.now());
|
||||
pointService.updateById(khgPoint);
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
task.setRemark("任务执行完毕");
|
||||
taskService.update(task, new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getTask_group_id, taskObj.getTask_group_id()));
|
||||
inBillService.taskFinish(taskObj);
|
||||
return;
|
||||
}
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.finishTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
if (!TaskStatus.CREATE.getCode().equals(taskObj.getTask_status())) {
|
||||
throw new BadRequestException("任务状态必须为生成才能取消任务");
|
||||
}
|
||||
this.cancelTask(taskObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backMes(String task_code) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.pm_manage.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pm_manage.service.dao.PdmBdWorkorder;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
@@ -23,19 +24,19 @@ import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDisMapper;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 解包上料AGV任务
|
||||
*
|
||||
* @Author: lyd
|
||||
* @Date: 2025/7/22
|
||||
*/
|
||||
@Component("JbUpAgvTask")
|
||||
public class JbUpAgvTask extends AbstractTask {
|
||||
@Autowired
|
||||
@Resource
|
||||
private ISchBaseTaskService taskService;
|
||||
@Resource
|
||||
private IOStorInvDisMapper ioStorInvDisMapper;
|
||||
@@ -47,6 +48,9 @@ public class JbUpAgvTask extends AbstractTask {
|
||||
private ISchBasePointService pointService;
|
||||
@Resource
|
||||
private IMdPbGroupplateService groupplateService;
|
||||
@Resource
|
||||
private IStructattrService structattrService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
@@ -103,17 +107,17 @@ public class JbUpAgvTask extends AbstractTask {
|
||||
// 取消任务
|
||||
taskService.update(new LambdaUpdateWrapper<SchBaseTask>()
|
||||
.set(SchBaseTask::getTask_status, TaskStatus.CANCELED.getCode())
|
||||
.set(SchBaseTask::getRemark,"已取消")
|
||||
.eq(SchBaseTask::getTask_id,taskObj.getTask_id())
|
||||
.set(SchBaseTask::getRemark, "已取消")
|
||||
.eq(SchBaseTask::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
|
||||
//分配表清除任务
|
||||
ioStorInvDisMapper.update(new IOStorInvDis(),new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getTask_id,null)
|
||||
.set(IOStorInvDis::getPoint_code,null)
|
||||
.set(IOStorInvDis::getIs_issued,0)
|
||||
ioStorInvDisMapper.update(new IOStorInvDis(), new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getTask_id, null)
|
||||
.set(IOStorInvDis::getPoint_code, null)
|
||||
.set(IOStorInvDis::getIs_issued, 0)
|
||||
.set(IOStorInvDis::getWork_status, IOSEnum.INBILL_DIS_STATUS.code("未生成"))
|
||||
.eq(IOStorInvDis::getTask_id,taskObj.getTask_id())
|
||||
.eq(IOStorInvDis::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,16 +130,18 @@ public class JbUpAgvTask extends AbstractTask {
|
||||
// 工单完成
|
||||
JSONObject requestParam = JSONObject.parseObject(taskObj.getRequest_param());
|
||||
String orderId = requestParam.getString("order_id");
|
||||
workorderService.update(new LambdaUpdateWrapper<PdmBdWorkorder>()
|
||||
.set(PdmBdWorkorder::getWorkorder_status, "5")
|
||||
.set(PdmBdWorkorder::getReal_qty, 1)
|
||||
.set(PdmBdWorkorder::getRealproduceend_date, DateUtil.now())
|
||||
.eq(PdmBdWorkorder::getWorkorder_id, orderId));
|
||||
if (ObjectUtil.isNotEmpty(orderId)) {
|
||||
workorderService.update(new LambdaUpdateWrapper<PdmBdWorkorder>()
|
||||
.set(PdmBdWorkorder::getWorkorder_status, "4")
|
||||
.set(PdmBdWorkorder::getReal_qty, 1)
|
||||
.set(PdmBdWorkorder::getRealproduceend_date, DateUtil.now())
|
||||
.eq(PdmBdWorkorder::getWorkorder_id, orderId));
|
||||
}
|
||||
// 点位设置值
|
||||
pointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
||||
.set(SchBasePoint::getVehicle_code, taskObj.getVehicle_code())
|
||||
.set(SchBasePoint::getPoint_status, "3")
|
||||
.set(SchBasePoint::getIng_task_code, "")
|
||||
.set(SchBasePoint::getIng_task_code, null)
|
||||
.set(SchBasePoint::getUpdate_id, SecurityUtils.getCurrentUserId())
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||
@@ -143,22 +149,18 @@ public class JbUpAgvTask extends AbstractTask {
|
||||
if (ObjectUtil.isNotEmpty(taskObj.getPoint_code3())) {
|
||||
pointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
||||
.set(SchBasePoint::getVehicle_code, "")
|
||||
.set(SchBasePoint::getIng_task_code, "")
|
||||
.set(SchBasePoint::getIng_task_code, null)
|
||||
.set(SchBasePoint::getPoint_status, "1")
|
||||
.set(SchBasePoint::getUpdate_id, SecurityUtils.getCurrentUserId())
|
||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||
.eq(SchBasePoint::getPoint_code, taskObj.getPoint_code3()));
|
||||
// 仓位设置空托盘
|
||||
structattrService.update(new LambdaUpdateWrapper<Structattr>()
|
||||
.set(Structattr::getStoragevehicle_code, taskObj.getVehicle_code2())
|
||||
.set(Structattr::getOccupancy_state, 2)
|
||||
.eq(Structattr::getStruct_code, taskObj.getPoint_code4()));
|
||||
}
|
||||
|
||||
groupplateService.update(new LambdaUpdateWrapper<GroupPlate>()
|
||||
.set(GroupPlate::getFrozen_qty, "1")
|
||||
.set(GroupPlate::getUpdate_time, DateUtil.now())
|
||||
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
|
||||
.eq(GroupPlate::getStoragevehicle_code, taskObj.getVehicle_code())
|
||||
// .eq(GroupPlate::getPcsn, w.getPcsn())
|
||||
// .eq(GroupPlate::getMaterial_id, materialbase.getMaterial_id())
|
||||
.eq(GroupPlate::getStatus,IOSEnum.GROUP_PLATE_STATUS.code("入库")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,4 +89,12 @@ public interface ISysDictService extends IService<Dict> {
|
||||
* 动态枚举信息
|
||||
*/
|
||||
List<Map> dynamicTableEnum(String table,String label,String value);
|
||||
|
||||
/**
|
||||
* 获取key-value的对象
|
||||
* @param code
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
Dict getDictByCodeAndValue(String code, String value);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
.like(ObjectUtil.isNotEmpty(blurry), Dict::getCode, blurry)
|
||||
.or(ObjectUtil.isNotEmpty(blurry))
|
||||
.like(ObjectUtil.isNotEmpty(blurry), Dict::getName, blurry)
|
||||
.orderBy(true, true, Dict::getCode)
|
||||
.orderBy(true, true, Dict::getCode)
|
||||
.groupBy(Dict::getCode, Dict::getName));
|
||||
return pages;
|
||||
}
|
||||
@@ -61,7 +61,8 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
String date = DateUtil.now();
|
||||
List<Dict> oldDict = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>()
|
||||
.eq(ObjectUtil.isNotEmpty(dict.getCode()), Dict::getCode, dict.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(oldDict)) throw new BadRequestException(LangProcess.msg("error_ParamExist",dict.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(oldDict))
|
||||
throw new BadRequestException(LangProcess.msg("error_ParamExist", dict.getCode()));
|
||||
dict.setDict_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
dict.setCreate_id(currentUserId);
|
||||
dict.setCreate_name(nickName);
|
||||
@@ -81,7 +82,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
}
|
||||
List<Dict> dictList = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>().eq(Dict::getCode, dto.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(dictList) && !dto.getCode().equals(dict.getCode()))
|
||||
throw new BadRequestException(LangProcess.msg("error_ParamExist",dto.getCode()));
|
||||
throw new BadRequestException(LangProcess.msg("error_ParamExist", dto.getCode()));
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentNickName = SecurityUtils.getCurrentNickName();
|
||||
// 根据code获取所有字典
|
||||
@@ -132,7 +133,8 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
// 校验是否已经有标签
|
||||
Dict one = sysDictMapper.selectOne(new LambdaQueryWrapper<Dict>().eq(Dict::getLabel, dict.getLabel())
|
||||
.eq(Dict::getCode, dict.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException(LangProcess.msg("error_ParamExist",dict.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(one))
|
||||
throw new BadRequestException(LangProcess.msg("error_ParamExist", dict.getCode()));
|
||||
// 判断是否有空的值
|
||||
List<Dict> selectOne = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>().eq(Dict::getCode, dict.getCode()));
|
||||
Dict dic = selectOne.get(0);
|
||||
@@ -173,7 +175,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
List<Dict> dictList = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>().eq(Dict::getLabel, resources.getLabel())
|
||||
.eq(Dict::getCode, resources.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(dictList) && !resources.getLabel().equals(dict.getLabel())) {
|
||||
throw new BadRequestException(LangProcess.msg("error_ParamExist",resources.getLabel()));
|
||||
throw new BadRequestException(LangProcess.msg("error_ParamExist", resources.getLabel()));
|
||||
}
|
||||
resources.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
resources.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
@@ -197,9 +199,19 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
|
||||
@Override
|
||||
public List<Map> dynamicTableEnum(String table, String label, String value) {
|
||||
if (StringUtils.isEmpty(table)||StringUtils.isEmpty(label)||StringUtils.isEmpty(value)){
|
||||
if (StringUtils.isEmpty(table) || StringUtils.isEmpty(label) || StringUtils.isEmpty(value)) {
|
||||
throw new BadRequestException("参数不能为空");
|
||||
}
|
||||
return this.sysDictMapper.dynamicTableEnum(table,label,value);
|
||||
return this.sysDictMapper.dynamicTableEnum(table, label, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dict getDictByCodeAndValue(String code, String value) {
|
||||
LambdaQueryWrapper<Dict> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(Dict::getCode, code)
|
||||
.eq(Dict::getValue, value)
|
||||
.isNotNull(Dict::getLabel)
|
||||
.ne(Dict::getLabel, "");
|
||||
return getOne(lam, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -28,8 +29,11 @@ import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMappe
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.sch_manage.enums.StatusEnum;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.StInTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.jb.JbDownAgvTask;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
@@ -84,6 +88,10 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
|
||||
@Resource
|
||||
private MdPbGroupplateServiceImpl mdPbGroupplateService;
|
||||
@Resource
|
||||
private ISchBasePointService pointService;
|
||||
@Resource
|
||||
private JbDownAgvTask jbDownAgvTask;
|
||||
|
||||
@Override
|
||||
public IPage<IOStorInv> pageQuery(Map whereJson, PageQuery page) {
|
||||
@@ -358,6 +366,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
.material_code(param.getString("material_code"))
|
||||
.qty(new BigDecimal(param.getString("qty")))
|
||||
.pcsn(param.getString("pcsn"))
|
||||
.dis_id(map.get("iostorinvdis_id"))
|
||||
.build());
|
||||
Structattr struct = structattrs.get(0);
|
||||
sect_id = struct.getSect_id();
|
||||
@@ -525,21 +534,108 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
|
||||
if (ObjectUtil.isEmpty(ioStorInvDis)){
|
||||
throw new BadRequestException("该明细还没分配货位,请先分配货位");
|
||||
}
|
||||
IOStorInv invObj = this.getById(map.get("iostorinv_id"));
|
||||
String task_id = "";
|
||||
if ("0011".equals(invObj.getBill_type())) {
|
||||
String structCode = map.get("struct_code");
|
||||
if (ObjectUtil.isEmpty(structCode)) {
|
||||
throw new BadRequestException("仓位未分配!");
|
||||
}
|
||||
// 获取组盘信息
|
||||
GroupPlate groupPlate = mdPbGroupplateService.getOne(new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, ioStorInvDis.getStoragevehicle_code())
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库")));
|
||||
|
||||
//创建任务
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "STInTask");
|
||||
task_form.put("TaskCode", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task_form.put("PickingLocation", point_code);
|
||||
task_form.put("PlacedLocation", ioStorInvDis.getStruct_code());
|
||||
task_form.put("vehicle_code", map.get("storagevehicle_code"));
|
||||
// GroupPlate groupPlate = mdPbGroupplateMapper.selectOne(new LambdaQueryWrapper<>(GroupPlate.class)
|
||||
// .eq(GroupPlate::getStoragevehicle_code,map.get("storagevehicle_code"))
|
||||
// );
|
||||
// task_form.put("group_id", groupPlate.getGroup_id());
|
||||
StInTask stInTask = SpringContextHolder.getBean("STInTask");
|
||||
Structattr inStruct = iStructattrService.findByCode(structCode);
|
||||
// 解包入库 (创建3条任务,并且为一组)
|
||||
SchBasePoint rkPoint = pointService.getById(point_code);
|
||||
// 父点位
|
||||
SchBasePoint parentPoint = pointService.getById(rkPoint.getParent_point_code());
|
||||
// 2、创建任务(4条任务、优先级需要获取所有的任务中的最小值并且-1,默认8)
|
||||
// 获取工单对应的区域的出入点
|
||||
SchBasePoint intoPoint = pointService.getNotTaskByRegionAndType(parentPoint.getRegion_code(), "2");
|
||||
SchBasePoint emptyPoint = pointService.getNotTaskByRegionAndType(parentPoint.getRegion_code(), "5");
|
||||
SchBasePoint fullPoint = pointService.getNotTaskByRegionAndType(parentPoint.getRegion_code(), "6");
|
||||
// 获取无盖子的对应的点位
|
||||
List<SchBasePoint> canUseCFGJs = pointService.getCanUseCFGJs(parentPoint, "1");
|
||||
if (canUseCFGJs.size() == 0) {
|
||||
throw new BadRequestException("找不到可用的拆封盖机");
|
||||
}
|
||||
SchBasePoint cfgjPoint = canUseCFGJs.get(0);
|
||||
// 创建任务1
|
||||
String taskGroupId = IdUtil.getStringId();
|
||||
JSONObject task1 = new JSONObject();
|
||||
task1.put("task_type", "JbDownAgvTask");
|
||||
task1.put("group_id", groupPlate.getGroup_id());
|
||||
task1.put("workorder_id", whereJson.get("workorder_id"));
|
||||
task1.put("task_group_id", taskGroupId);
|
||||
task1.put("task_group_seq", 1);
|
||||
task1.put("TaskCode", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task1.put("point_code1", structCode);
|
||||
task1.put("point_code2", cfgjPoint.getPoint_code());
|
||||
task1.put("point_code3", cfgjPoint.getPoint_code());
|
||||
task1.put("point_code4", emptyPoint.getPoint_code());
|
||||
task1.put("seq", 1);
|
||||
// 空托盘
|
||||
task1.put("vehicle_code", inStruct.getStoragevehicle_code());
|
||||
// 入库的满托盘
|
||||
task1.put("vehicle_code2", map.get("storagevehicle_code"));
|
||||
|
||||
// 创建任务2
|
||||
JSONObject task2 = new JSONObject();
|
||||
task2.put("task_type", "JbDownAgvTask");
|
||||
task2.put("group_id", groupPlate.getGroup_id());
|
||||
task2.put("task_group_id", taskGroupId);
|
||||
task2.put("task_group_seq", 2);
|
||||
task2.put("workorder_id", whereJson.get("workorder_id"));
|
||||
task2.put("TaskCode", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task2.put("point_code1", intoPoint.getPoint_code());
|
||||
task2.put("point_code2", fullPoint.getPoint_code());
|
||||
task2.put("point_code3", emptyPoint.getPoint_code());
|
||||
task2.put("point_code4", intoPoint.getPoint_code());
|
||||
task2.put("seq", 2);
|
||||
// 空托盘
|
||||
task2.put("vehicle_code", inStruct.getStoragevehicle_code());
|
||||
// 入库的满托盘
|
||||
task2.put("vehicle_code2", map.get("storagevehicle_code"));
|
||||
|
||||
// 创建任务3
|
||||
JSONObject task3 = new JSONObject();
|
||||
task3.put("task_type", "JbDownAgvTask");
|
||||
task3.put("group_id", groupPlate.getGroup_id());
|
||||
task3.put("task_group_id", taskGroupId);
|
||||
task3.put("task_group_seq", 3);
|
||||
task3.put("workorder_id", whereJson.get("workorder_id"));
|
||||
task3.put("TaskCode", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task3.put("point_code1", fullPoint.getPoint_code());
|
||||
task3.put("point_code2", cfgjPoint.getPoint_code());
|
||||
task3.put("point_code3", cfgjPoint.getPoint_code());
|
||||
task3.put("point_code4", structCode);
|
||||
task3.put("seq", 3);
|
||||
// 空托盘
|
||||
task3.put("vehicle_code", inStruct.getStoragevehicle_code());
|
||||
// 入库的满托盘
|
||||
task3.put("vehicle_code2", map.get("storagevehicle_code"));
|
||||
List<JSONObject> jsonObjects = Arrays.asList(task1, task2, task3);
|
||||
JSONObject requestTaskParam = new JSONObject();
|
||||
requestTaskParam.put("tasks", jsonObjects);
|
||||
task_id = jbDownAgvTask.create(requestTaskParam);
|
||||
} else {
|
||||
//创建任务
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "STInTask");
|
||||
task_form.put("TaskCode", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task_form.put("PickingLocation", point_code);
|
||||
task_form.put("PlacedLocation", ioStorInvDis.getStruct_code());
|
||||
task_form.put("vehicle_code", map.get("storagevehicle_code"));
|
||||
// GroupPlate groupPlate = mdPbGroupplateMapper.selectOne(new LambdaQueryWrapper<>(GroupPlate.class)
|
||||
// .eq(GroupPlate::getStoragevehicle_code,map.get("storagevehicle_code"))
|
||||
// );
|
||||
// task_form.put("group_id", groupPlate.getGroup_id());
|
||||
StInTask stInTask = SpringContextHolder.getBean("STInTask");
|
||||
task_id = stInTask.create(task_form);
|
||||
}
|
||||
|
||||
String task_id = stInTask.create(task_form);
|
||||
|
||||
//分配明细表更新任务相关数据
|
||||
IOStorInvDis dis = new IOStorInvDis();
|
||||
|
||||
@@ -28,11 +28,13 @@ import org.nl.wms.basedata_manage.service.dto.StrategyStructMaterialVO;
|
||||
import org.nl.wms.basedata_manage.service.dto.StrategyStructParam;
|
||||
import org.nl.wms.basedata_manage.service.dto.StructattrChangeDto;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.StOutTask;
|
||||
import org.nl.wms.sch_manage.service.util.tasks.jb.JbUpAgvTask;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSConstant;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
@@ -46,6 +48,7 @@ import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvDtlMappe
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.mapper.IOStorInvMapper;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDisDto;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dto.IOStorInvDtlDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -69,6 +72,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
|
||||
@Resource
|
||||
private IStructattrService iStructattrService;
|
||||
@Resource
|
||||
private ISchBasePointService pointService;
|
||||
|
||||
/**
|
||||
* 载具扩展属性mapper
|
||||
@@ -94,6 +99,8 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
|
||||
@Resource
|
||||
private IMdPbGroupplateService iMdPbGroupPlateService;
|
||||
@Autowired
|
||||
private JbUpAgvTask jbUpAgvTask;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -575,7 +582,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDis.setSect_id(outAllocation.getSect_id());
|
||||
ioStorInvDis.setPcsn(outAllocation.getPcsn());
|
||||
ioStorInvDis.setMaterial_id(outAllocation.getMaterial_id());
|
||||
ioStorInvDis.setMaterial_code(outAllocation.getMaterial_code());
|
||||
// ioStorInvDis.setMaterial_code(outAllocation.getMaterial_code());
|
||||
ioStorInvDis.setSect_name(outAllocation.getSect_name());
|
||||
ioStorInvDis.setSect_code(outAllocation.getSect_code());
|
||||
ioStorInvDis.setStruct_id(outAllocation.getStruct_id());
|
||||
@@ -753,7 +760,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
double allocation_canuse_qty = 0;
|
||||
for (int i = 0; i < rows.size(); i++){
|
||||
JSONObject ivt = rows.getJSONObject(i);
|
||||
double canuse_qty = ivt.getDoubleValue("canuse_qty");
|
||||
double canuse_qty = ivt.getDoubleValue("qty");
|
||||
//分配明细
|
||||
IOStorInvDis ioStorInvDis = new IOStorInvDis();
|
||||
ioStorInvDis.setIostorinvdis_id(IdUtil.getStringId());
|
||||
@@ -763,6 +770,7 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
ioStorInvDis.setSect_id(ivt.getString("sect_id"));
|
||||
ioStorInvDis.setPcsn(ivt.getString("pcsn"));
|
||||
ioStorInvDis.setMaterial_id(dtl.getMaterial_id());
|
||||
ioStorInvDis.setMaterial_code(dtl.getMaterial_code());
|
||||
ioStorInvDis.setSect_name(ivt.getString("sect_name"));
|
||||
ioStorInvDis.setSect_code(ivt.getString("sect_code"));
|
||||
ioStorInvDis.setStruct_id(ivt.getString("struct_id"));
|
||||
@@ -952,19 +960,49 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i
|
||||
if (ObjectUtil.isEmpty(ioStorInvDisList)){
|
||||
throw new BadRequestException("当前没有可设置的分配明细");
|
||||
}
|
||||
|
||||
String task_id = "";
|
||||
for (IOStorInvDis ioStorInvDis:ioStorInvDisList){
|
||||
//创建任务
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "STOutTask");
|
||||
task_form.put("TaskCode",CodeUtil.getNewCode("TASK_CODE"));
|
||||
task_form.put("PickingLocation", ioStorInvDis.getStruct_code());
|
||||
task_form.put("PlacedLocation", point_code);
|
||||
task_form.put("vehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||
if ("1012".equals(ioStorInv.getBill_type())) {
|
||||
// 解包需要单独操作
|
||||
SchBasePoint ckPoint = pointService.getById(point_code);
|
||||
SchBasePoint outPointP = pointService.getById(ckPoint.getParent_point_code());
|
||||
SchBasePoint inPoint = pointService.getNotTaskByRegionAndType(outPointP.getRegion_code(), "3");
|
||||
SchBasePoint outPoint = pointService.getNotTaskByRegionAndType(outPointP.getRegion_code(), "4");
|
||||
if (ObjectUtil.isEmpty(inPoint) || ObjectUtil.isEmpty(outPoint)) {
|
||||
throw new BadRequestException("解包机输送线点位不存在或者存在任务!");
|
||||
}
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "JbUpAgvTask");
|
||||
task_form.put("order_id", whereJson.getString("order_id"));
|
||||
task_form.put("TaskCode", CodeUtil.getNewCode("TASK_CODE"));
|
||||
task_form.put("point_code1", ioStorInvDis.getStruct_code());
|
||||
task_form.put("point_code2", inPoint.getPoint_code());
|
||||
task_form.put("vehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||
if ("2".equals(outPoint.getPoint_status())) {
|
||||
// 四点任务
|
||||
task_form.put("point_code3", outPoint.getPoint_code());
|
||||
task_form.put("point_code4", ioStorInvDis.getStruct_code());
|
||||
task_form.put("vehicle_code2", outPoint.getVehicle_code());
|
||||
}
|
||||
task_id = jbUpAgvTask.create(task_form);
|
||||
inPoint.setIng_task_code(task_id);
|
||||
if ("2".equals(outPoint.getPoint_status())) {
|
||||
outPoint.setIng_task_code(task_id);
|
||||
}
|
||||
pointService.updateBatchById(Arrays.asList(inPoint, outPoint));
|
||||
} else {
|
||||
//创建任务
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "STOutTask");
|
||||
task_form.put("TaskCode",CodeUtil.getNewCode("TASK_CODE"));
|
||||
task_form.put("PickingLocation", ioStorInvDis.getStruct_code());
|
||||
task_form.put("PlacedLocation", point_code);
|
||||
task_form.put("vehicle_code", ioStorInvDis.getStoragevehicle_code());
|
||||
|
||||
StOutTask stOutTask = SpringContextHolder.getBean("STOutTask");
|
||||
StOutTask stOutTask = SpringContextHolder.getBean("STOutTask");
|
||||
|
||||
String task_id = stOutTask.create(task_form);
|
||||
task_id = stOutTask.create(task_form);
|
||||
}
|
||||
|
||||
//分配明细表更新任务相关数据
|
||||
IOStorInvDis dis = new IOStorInvDis();
|
||||
|
||||
@@ -2,62 +2,62 @@
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
物料查询:
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
物料查询:
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
批次查询:
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
载具编码:
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="载具编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
组盘状态:
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.GROUP_STATUS"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
批次查询:
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
载具编码:
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="载具编码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
组盘状态:
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
size="mini"
|
||||
placeholder="状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.GROUP_STATUS"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--新增表格-->
|
||||
@@ -71,19 +71,19 @@
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code" >
|
||||
<el-input v-model="form.material_code" @focus="getMaterial" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" @focus="getMaterial" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input disabled v-model="form.material_name" style="width: 200px;" />
|
||||
<el-form-item label="物料名称" prop="material_name">
|
||||
<el-input v-model="form.material_name" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格" prop="material_spec">
|
||||
<el-form-item label="规格" prop="material_spec">
|
||||
<label slot="label">规 格</label>
|
||||
<el-input disabled v-model="form.material_spec" style="width: 200px;" />
|
||||
<el-input v-model="form.material_spec" disabled style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -154,7 +154,13 @@
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||
<el-table-column prop="status" label="状态" :formatter="formattStatus" :min-width="flexWidth('status',crud.data,'状态')" />
|
||||
<el-table-column prop="qty" label="组盘数量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="qty" label="可用数" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="frozen_qty" label="冻结数" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column label="总数" :formatter="crud.formatNum3" :min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ parseFloat(scope.row.qty + scope.row.frozen_qty).toFixed(3) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column prop="create_name" label="组盘人" :min-width="flexWidth('create_name',crud.data,'组盘人')" />
|
||||
<el-table-column prop="create_time" label="组盘时间" :min-width="flexWidth('create_time',crud.data,'组盘时间')" />
|
||||
|
||||
@@ -93,16 +93,16 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-check"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="openOneCreate"-->
|
||||
<!-- >-->
|
||||
<!-- 一键生成-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-check"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="openOneCreate"-->
|
||||
<!-- >-->
|
||||
<!-- 一键生成-->
|
||||
<!-- </el-button>-->
|
||||
</crudOperation>
|
||||
|
||||
<!--表单组件-->
|
||||
@@ -272,16 +272,16 @@
|
||||
{{ dict.label.placement_type[scope.row.placement_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="是否启用" align="center" prop="is_used">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-switch-->
|
||||
<!-- :value="format_is_used(scope.row.is_used)"-->
|
||||
<!-- active-color="#409EFF"-->
|
||||
<!-- inactive-color="#F56C6C"-->
|
||||
<!-- @change="changeEnabled(scope.row, scope.row.is_used)"-->
|
||||
<!-- />-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="taskdtl_type" label="锁定任务类型" width="150" :formatter="taskdtl_typeFormat" />
|
||||
<el-table-column prop="task_code" label="锁定任务编码" width="150" />
|
||||
<el-table-column prop="inv_code" label="锁定单据编码" width="150" />
|
||||
@@ -305,7 +305,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<!-- <OneCreateDialog :dialog-show.sync="openOneCreateDialog" />-->
|
||||
<!-- <OneCreateDialog :dialog-show.sync="openOneCreateDialog" />-->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -61,27 +61,27 @@
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="success"-->
|
||||
<!-- icon="el-icon-position"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="!(crud.selections[0]) || crud.selections[1]"-->
|
||||
<!-- @click="submits(crud.selections[0])"-->
|
||||
<!-- >-->
|
||||
<!-- 开工-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="success"-->
|
||||
<!-- icon="el-icon-position"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="synchronize()"-->
|
||||
<!-- >-->
|
||||
<!-- 同步-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="success"-->
|
||||
<!-- icon="el-icon-position"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="!(crud.selections[0]) || crud.selections[1]"-->
|
||||
<!-- @click="submits(crud.selections[0])"-->
|
||||
<!-- >-->
|
||||
<!-- 开工-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="success"-->
|
||||
<!-- icon="el-icon-position"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="synchronize()"-->
|
||||
<!-- >-->
|
||||
<!-- 同步-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -233,14 +233,14 @@
|
||||
@focus="getProductionOrder(form.material_id)"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="静置时间(分钟)" prop="standing_time">-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model.number="form.standing_time"-->
|
||||
<!-- :min="0"-->
|
||||
<!-- :max="999"-->
|
||||
<!-- style="width: 240px;"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="静置时间(分钟)" prop="standing_time">-->
|
||||
<!-- <el-input-number-->
|
||||
<!-- v-model.number="form.standing_time"-->
|
||||
<!-- :min="0"-->
|
||||
<!-- :max="999"-->
|
||||
<!-- style="width: 240px;"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item v-if="crud.status.edit" label="实际数量" prop="real_qty">
|
||||
<el-input-number
|
||||
v-model.number="form.real_qty"
|
||||
@@ -290,18 +290,18 @@
|
||||
<el-form-item v-if="false" label="工单类型" prop="workorder_type">
|
||||
<el-input v-model="form.workorder_type" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="是否自动搬运" prop="is_needmove">-->
|
||||
<!-- <el-radio-group v-model="form.is_needmove" style="width: 240px">-->
|
||||
<!-- <el-radio :label="true">是</el-radio>-->
|
||||
<!-- <el-radio :label="false">否</el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="是否加急" prop="is_needmove">-->
|
||||
<!-- <el-radio-group v-model="form.is_urgent" style="width: 240px">-->
|
||||
<!-- <el-radio :label="true">是</el-radio>-->
|
||||
<!-- <el-radio :label="false">否</el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="是否自动搬运" prop="is_needmove">-->
|
||||
<!-- <el-radio-group v-model="form.is_needmove" style="width: 240px">-->
|
||||
<!-- <el-radio :label="true">是</el-radio>-->
|
||||
<!-- <el-radio :label="false">否</el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="是否加急" prop="is_needmove">-->
|
||||
<!-- <el-radio-group v-model="form.is_urgent" style="width: 240px">-->
|
||||
<!-- <el-radio :label="true">是</el-radio>-->
|
||||
<!-- <el-radio :label="false">否</el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
@@ -437,7 +437,8 @@
|
||||
<MaterialDialog
|
||||
:dialog-show.sync="materialDialog"
|
||||
:flag="flag"
|
||||
@tableChanged="tableChanged"/>
|
||||
@tableChanged="tableChanged"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -600,7 +601,7 @@ export default {
|
||||
const param = {
|
||||
region_code: this.regionCodeParam
|
||||
}
|
||||
crudSchBasePoint.getPointList(param).then(res => {
|
||||
crudSchBasePoint.getPointList2(param).then(res => {
|
||||
this.pointList = res
|
||||
this.regionCodeParam = null
|
||||
})
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
<el-form-item label="区域类型">
|
||||
<el-select
|
||||
v-model="query.region_code"
|
||||
@clear="handleClear"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
placeholder="区域类型"
|
||||
class="filter-item"
|
||||
@clear="handleClear"
|
||||
@change="getPointStatusAndTypeList(query.region_code, 1)"
|
||||
>
|
||||
<el-option
|
||||
@@ -109,7 +109,7 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" >
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
v-if="crud.query.is_used == 'false'"
|
||||
slot="right"
|
||||
@@ -230,7 +230,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="父类编码" prop="vehicle_code">
|
||||
<el-input v-model="form.parent_point_code" clearable style="width: 370px;" @focus="getParentPoint"/>
|
||||
<el-input v-model="form.parent_point_code" clearable style="width: 370px;" @focus="getParentPoint" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.point_status !== '1'" label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
|
||||
@@ -241,8 +241,8 @@
|
||||
v-for="item in dict.storagevehicle_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="可放载具类型" prop="can_vehicle_types">
|
||||
@@ -251,12 +251,12 @@
|
||||
v-for="item in dict.storagevehicle_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具数量" prop="vehicle_qty">
|
||||
<el-input-number style="width: 370px;" :controls="false" class="clear-number-input" v-model="form.vehicle_qty" :min="0" :precision="0" :max="99999" label="载具数量" size="mini" />
|
||||
<el-input-number v-model="form.vehicle_qty" style="width: 370px;" :controls="false" class="clear-number-input" :min="0" :precision="0" :max="99999" label="载具数量" size="mini" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否有工单">
|
||||
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_has_workder" :label="item.value">{{ item.label }}</el-radio>
|
||||
@@ -281,25 +281,25 @@
|
||||
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')" />
|
||||
<el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />
|
||||
<el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')" />
|
||||
<el-table-column prop="point_type_name" label="点位类型" :min-width="flexWidth('point_type_name',crud.data,'点位类型')"/>
|
||||
<el-table-column prop="point_status_name" label="点位状态" :min-width="flexWidth('point_status_name',crud.data,'点位类型')"/>
|
||||
<!-- <el-table-column prop="point_type" label="点位类型" :min-width="flexWidth('point_type',crud.data,'点位类型')" />-->
|
||||
<!-- <el-table-column prop="point_status" label="点位状态" :min-width="flexWidth('point_status',crud.data,'点位状态')" />-->
|
||||
<el-table-column prop="point_type_name" label="点位类型" :min-width="flexWidth('point_type_name',crud.data,'点位类型')" />
|
||||
<el-table-column prop="point_status_name" label="点位状态" :min-width="flexWidth('point_status_name',crud.data,'点位类型')" />
|
||||
<!-- <el-table-column prop="point_type" label="点位类型" :min-width="flexWidth('point_type',crud.data,'点位类型')" />-->
|
||||
<!-- <el-table-column prop="point_status" label="点位状态" :min-width="flexWidth('point_status',crud.data,'点位状态')" />-->
|
||||
<el-table-column prop="vehicle_type" label="当前载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 30)">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.storagevehicle_type[scope.row.vehicle_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="can_vehicle_type" label="可放载具类型" :min-width="flexWidth('can_vehicle_type',crud.data,'载具类型', 30)">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.storagevehicle_type[scope.row.can_vehicle_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" />
|
||||
<el-table-column prop="vehicle_qty" label="载具数量" :min-width="flexWidth('vehicle_qty',crud.data,'载具数量')" />
|
||||
<el-table-column label="是否锁定" :min-width="flexWidth('vehicle_qty',crud.data,'是否锁定')">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.ing_task_code?'是':'否'}}
|
||||
{{ scope.row.ing_task_code?'是':'否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="can_vehicle_type" label="可放载具类型" :min-width="flexWidth('can_vehicle_type',crud.data,'载具类型', 30)">
|
||||
<template slot-scope="scope">
|
||||
{{ getVehicleTypeLabel(scope.row.can_vehicle_type) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'载具数量')" />
|
||||
@@ -307,22 +307,22 @@
|
||||
<el-table-column prop="material_spec" label="物料规格" :min-width="flexWidth('material_spec',crud.data,'载具数量')" />
|
||||
<el-table-column prop="material_model" label="物料型号" :min-width="flexWidth('material_model',crud.data,'载具数量')" />
|
||||
<el-table-column prop="material_qty" label="物料数量" :min-width="flexWidth('material_qty',crud.data,'载具数量')" />
|
||||
<el-table-column prop="parent_point_code" label="父点位编码" :min-width="flexWidth('parent_point_code',crud.data,'父点位编码')"/>
|
||||
<el-table-column prop="parent_point_code" label="父点位编码" :min-width="flexWidth('parent_point_code',crud.data,'父点位编码')" />
|
||||
<el-table-column prop="ing_task_code" label="在执行的任务标识" :min-width="flexWidth('ing_task_code',crud.data,'在执行的任务标识')" />
|
||||
<el-table-column prop="is_has_workder" label="是否有工单" :min-width="flexWidth('is_has_workder',crud.data,'是否有工单')">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.is_has_workder?'是':'否'}}
|
||||
{{ scope.row.is_has_workder?'是':'否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_auto" label="是否自动" :min-width="flexWidth('is_auto',crud.data,'是否自动')">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.is_auto?'是':'否'}}
|
||||
{{ scope.row.is_auto?'是':'否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.is_used?'是':'否'}}
|
||||
{{ scope.row.is_used?'是':'否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
|
||||
@@ -351,8 +351,8 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<ViewDialog ref="viewDialog"/>
|
||||
<PointDialog :dialog-show.sync="pointDialog" :is-single="false" @tableChanged="tableChanged"/>
|
||||
<ViewDialog ref="viewDialog" />
|
||||
<PointDialog :dialog-show.sync="pointDialog" :is-single="false" @tableChanged="tableChanged" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -468,6 +468,12 @@ export default {
|
||||
this.getPointStatusAndTypeList(this.form.region_code, 2)
|
||||
}
|
||||
},
|
||||
getVehicleTypeLabel(value) {
|
||||
if (!value) return ''
|
||||
const types = value.toString().split(',').map(item => item.trim())
|
||||
const labels = types.map(type => this.dict.label.storagevehicle_type[type] || '未知')
|
||||
return labels.join(', ')
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
|
||||
@@ -39,6 +39,13 @@ export function getPointList(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getPointList2(data) {
|
||||
return request({
|
||||
url: 'api/schBasePoint/getPointList2',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function changeLock(data) {
|
||||
return request({
|
||||
@@ -48,4 +55,4 @@ export function changeLock(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeUsed, getPointList, changeLock }
|
||||
export default { add, edit, del, changeUsed, getPointList, getPointList2, changeLock }
|
||||
|
||||
@@ -32,12 +32,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="任务名称">
|
||||
<label slot="label">任务名称:</label>
|
||||
<el-select v-model="query.config_code" placeholder="请选择" style="width: 240px" @change="crud.toQuery" clearable>
|
||||
<el-select v-model="query.config_code" placeholder="请选择" style="width: 240px" clearable @change="crud.toQuery">
|
||||
<el-option
|
||||
v-for="item in taskConfigList"
|
||||
:key="item.config_id"
|
||||
:label="item.task_name"
|
||||
:value="item.config_code">
|
||||
:value="item.config_code"
|
||||
>
|
||||
<span style="float: left">{{ item.config_code }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.task_name }}</span>
|
||||
</el-option>
|
||||
@@ -60,8 +61,8 @@
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="crud.toQuery">
|
||||
</el-date-picker>
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态">
|
||||
<el-select
|
||||
@@ -122,9 +123,9 @@
|
||||
<el-form-item label="载具编码">
|
||||
<el-input v-model="form.vehicle_code" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="优先级">-->
|
||||
<!-- <el-input v-model="form.priority" style="width: 240px;" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="优先级">-->
|
||||
<!-- <el-input v-model="form.priority" style="width: 240px;" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item v-if="false" label="处理类">
|
||||
<el-input v-model="form.handle_class" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
@@ -179,12 +180,12 @@
|
||||
{{ scope.row.vehicle_code ? scope.row.vehicle_code : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--<el-table-column prop="vehicle_code2" label="载具编码2" :min-width="flexWidth('vehicle_code2',crud.data,'载具编码2')">
|
||||
<el-table-column prop="vehicle_code2" label="载具编码2" :min-width="flexWidth('vehicle_code2',crud.data,'载具编码2')">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.vehicle_code2 ? scope.row.vehicle_code2 : '-' }}
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<!-- <el-table-column prop="task_class_id" label="任务分类" :min-width="flexWidth('task_class_id',crud.data,'任务分类')" />-->
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="task_class_id" label="任务分类" :min-width="flexWidth('task_class_id',crud.data,'任务分类')" />-->
|
||||
<el-table-column prop="task_status" label="任务状态" :min-width="flexWidth('task_status',crud.data,'任务状态')">
|
||||
<template slot-scope="scope">
|
||||
{{ getStatusName(scope.row.task_status) }}
|
||||
@@ -193,10 +194,10 @@
|
||||
<el-table-column prop="remark" label="提示信息" :min-width="flexWidth('remark',crud.data,'提示信息')" />
|
||||
<el-table-column prop="config_code" label="配置编码" :min-width="flexWidth('config_code',crud.data,'配置编码')" />
|
||||
<el-table-column prop="task_name" label="配置名称" :min-width="flexWidth('task_name',crud.data,'任务名称')" />
|
||||
<el-table-column prop="point_code1" label="起点" :min-width="flexWidth('point_code1',crud.data,'起点')" />
|
||||
<el-table-column prop="point_code2" label="终点" :min-width="flexWidth('point_code2',crud.data,'终点')" />
|
||||
<!-- <el-table-column prop="point_code3" label="起点2" :min-width="flexWidth('point_code3',crud.data,'点位3')" />
|
||||
<el-table-column prop="point_code4" label="终点2" :min-width="flexWidth('point_code4',crud.data,'点位4')" />-->
|
||||
<el-table-column prop="point_code1" label="起点1" :min-width="flexWidth('point_code1',crud.data,'起点')" />
|
||||
<el-table-column prop="point_code2" label="终点1" :min-width="flexWidth('point_code2',crud.data,'终点')" />
|
||||
<el-table-column prop="point_code3" label="起点2" :min-width="flexWidth('point_code3',crud.data,'点位3')" />
|
||||
<el-table-column prop="point_code4" label="终点2" :min-width="flexWidth('point_code4',crud.data,'点位4')" />
|
||||
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型', 20)">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||
@@ -207,14 +208,14 @@
|
||||
<el-table-column v-if="false" prop="handle_class" label="处理类" :min-width="flexWidth('handle_class',crud.data,'处理类')" />
|
||||
<el-table-column v-if="false" prop="handle_status" label="处理状态" :min-width="flexWidth('handle_status',crud.data,'处理状态')" />
|
||||
<el-table-column prop="car_no" label="车号" :min-width="flexWidth('car_no',crud.data,'车号')" />
|
||||
<!-- <el-table-column prop="task_group_id" label="任务组标识" :min-width="flexWidth('task_group_id',crud.data,'任务组标识')" />-->
|
||||
<el-table-column prop="task_group_id" label="任务组标识" :min-width="flexWidth('task_group_id',crud.data,'任务组标识')" />
|
||||
<el-table-column prop="task_group_seq" label="任务组顺序号" :min-width="flexWidth('task_group_seq',crud.data,'任务组顺序号')" />
|
||||
<el-table-column prop="finished_type" label="任务完成类型" :min-width="flexWidth('finished_type',crud.data,'任务完成类型')">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.finished_type[scope.row.finished_type]?dict.label.finished_type[scope.row.finished_type]:'未完成' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_mode" label="生成方式" :min-width="flexWidth('create_mode',crud.data,'生成方式')" >
|
||||
<el-table-column prop="create_mode" label="生成方式" :min-width="flexWidth('create_mode',crud.data,'生成方式')">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.create_mode[scope.row.create_mode] }}
|
||||
</template>
|
||||
@@ -223,29 +224,29 @@
|
||||
<el-table-column prop="request_param" label="生成任务的请求参数" :min-width="flexWidth('request_param',crud.data,'生成任务的请求参数')" />
|
||||
<el-table-column prop="response_param" label="下发任务的请求参数" :min-width="flexWidth('response_param',crud.data,'下发任务的请求参数')" />
|
||||
<el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />
|
||||
<!-- <el-table-column prop="ext_group_data" label="额外组盘信息" :min-width="flexWidth('ext_group_data',crud.data,'额外组盘信息')" />-->
|
||||
<!-- <el-table-column prop="ext_group_data" label="额外组盘信息" :min-width="flexWidth('ext_group_data',crud.data,'额外组盘信息')" />-->
|
||||
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
|
||||
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
||||
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||
<el-table-column v-permission="[]" label="操作" width="160px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-upload"-->
|
||||
<!-- @click="doOperate(scope.row, 'c')"-->
|
||||
<!-- >下发</el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-upload"-->
|
||||
<!-- @click="doOperate(scope.row, 'c')"-->
|
||||
<!-- >下发</el-button>-->
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-success"
|
||||
@click="doOperate(scope.row, 'a')"
|
||||
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
|
||||
@click="doOperate(scope.row, 'a')"
|
||||
>完成</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-error"
|
||||
@click="doOperate(scope.row, 'b')"
|
||||
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
|
||||
@click="doOperate(scope.row, 'b')"
|
||||
>取消</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="storagevehicle_code" label="批次号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="pcsn" label="批次号" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip width="150" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip width="170" prop="qty" label="数量" />
|
||||
<el-table-column show-overflow-tooltip width="170" prop="qty_unit_name" label="计量单位名称" />
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="托盘编码" align="center" width="250px" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column show-overflow-tooltip sortable prop="pcsn" label="批次号" align="center" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可出重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="qty" label="可出重量" :formatter="crud.formatNum3" align="center" />
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button v-show="!scope.row.edit" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
@@ -200,15 +200,15 @@ export default {
|
||||
}
|
||||
row.edit = !row.edit
|
||||
if (row.edit) {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.canuse_qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.canuse_qty)
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) - parseFloat(row.qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) + parseFloat(row.qty)
|
||||
} else {
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.canuse_qty)
|
||||
this.queryrow.assign_qty = parseFloat(this.queryrow.assign_qty) - parseFloat(row.qty)
|
||||
// 如果待分配重量等于0则 明细重量 - 已分配重量
|
||||
if (parseInt(this.queryrow.unassign_qty) === 0) {
|
||||
this.queryrow.unassign_qty = parseFloat(this.goal_unassign_qty) - parseFloat(this.queryrow.assign_qty)
|
||||
} else {
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.canuse_qty)
|
||||
this.queryrow.unassign_qty = parseFloat(this.queryrow.unassign_qty) + parseFloat(row.qty)
|
||||
}
|
||||
if (this.queryrow.unassign_qty > this.goal_unassign_qty) {
|
||||
this.queryrow.unassign_qty = JSON.parse(JSON.stringify(this.goal_unassign_qty))
|
||||
|
||||
Reference in New Issue
Block a user