Merge branch 'master' of http://121.40.234.130:7788/lyd/zhuzhouzhongwu
This commit is contained in:
@@ -413,7 +413,7 @@ public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structa
|
||||
.eq("storagevehicle_code", changeDto.getStoragevehicleCode())
|
||||
.lt("status", IOSEnum.GROUP_PLATE_STATUS.code("出库")));
|
||||
List<StIvtStructivtflow> records = new ArrayList<>();
|
||||
//更新冻结数量
|
||||
// question:更新冻结数量
|
||||
Structattr structattr = this.getByCode(changeDto.getStructCode());
|
||||
for (GroupPlate vehicleMater : groupPlates) {
|
||||
String vehicleCode = vehicleMater.getStoragevehicle_code();
|
||||
|
||||
@@ -9,7 +9,6 @@ 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;
|
||||
@@ -49,7 +48,7 @@ public class UnpackingRuleHandler extends Decisioner<Structattr, JSONObject> {
|
||||
.isNotNull(Structattr::getStoragevehicle_code)
|
||||
.isNull(Structattr::getTask_code));
|
||||
if (outPoints.size() == 0) {
|
||||
throw new BadRequestException("料桶缓存库无空桶!");
|
||||
throw new BadRequestException("当前出库策略:解包入库,库存分配失败,失败原因:料桶缓存库无空桶!");
|
||||
}
|
||||
return outPoints;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.ext_manage.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.ext_manage.service.AcsToWmsService;
|
||||
@@ -34,4 +35,11 @@ public class AcsToWmsController {
|
||||
return new ResponseEntity<>(acsToWmsService.receiveTaskStatusAcs(string), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/empty-move")
|
||||
@Log(value = "ACS给WMS反馈空托盘移动")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> emptyMove(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acsToWmsService.emptyMove(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package org.nl.wms.ext_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.ext_manage.service.util.AcsResponse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -20,4 +23,6 @@ public interface AcsToWmsService {
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> receiveTaskStatusAcs(String string);
|
||||
|
||||
AcsResponse emptyMove(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
package org.nl.wms.ext_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.Data;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.ext_manage.enums.ResultAcsStatus;
|
||||
import org.nl.wms.ext_manage.service.AcsToWmsService;
|
||||
import org.nl.wms.ext_manage.service.util.AcsResponse;
|
||||
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.TaskFactory;
|
||||
@@ -19,6 +25,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -45,6 +52,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
*/
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
|
||||
/**
|
||||
* 任务工厂服务
|
||||
@@ -103,4 +112,25 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
log.info("acs向lms反馈任务状态,返回参数:--------------------------------------" + result.toString());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AcsResponse emptyMove(JSONObject param) {
|
||||
log.info("ACS请求空托盘移动: {}", param);
|
||||
String deviceCode = param.getString("device_code");
|
||||
SchBasePoint ddjbj = pointService.getById(deviceCode);
|
||||
SchBasePoint inPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, ddjbj.getRegion_code())
|
||||
.eq(SchBasePoint::getPoint_type, "3"));
|
||||
SchBasePoint outPoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getRegion_code, ddjbj.getRegion_code())
|
||||
.eq(SchBasePoint::getPoint_type, "4"));
|
||||
outPoint.setPoint_status("2");
|
||||
outPoint.setVehicle_code(inPoint.getPoint_code());
|
||||
outPoint.setUpdate_time(DateUtil.now());
|
||||
inPoint.setPoint_status("1");
|
||||
inPoint.setVehicle_code("");
|
||||
inPoint.setUpdate_time(DateUtil.now());
|
||||
pointService.updateBatchById(Arrays.asList(inPoint, outPoint));
|
||||
return AcsResponse.requestOk();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,22 @@ public class PdaJBController {
|
||||
public ResponseEntity<Object> downMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaJBService.downMaterial(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/checkStruct")
|
||||
@Log("检测站点")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> checkStruct(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaJBService.checkStruct(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/confirmSet")
|
||||
@Log("确认放置")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> confirmSet(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(pdaJBService.confirmSet(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/jbReturnMaterial")
|
||||
@Log("解包退料")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> jbReturnMaterial(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(null, HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,18 @@ public interface PdaJBService {
|
||||
PdaResponse getWeight(JSONObject whereJson);
|
||||
|
||||
PdaResponse downMaterial(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 检测站点
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
PdaResponse checkStruct(JSONObject param);
|
||||
|
||||
/**
|
||||
* 确认放置
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
PdaResponse confirmSet(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -14,9 +14,11 @@ 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.IMdPbStoragevehicleinfoService;
|
||||
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.MdPbStoragevehicleinfo;
|
||||
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;
|
||||
@@ -26,7 +28,6 @@ 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;
|
||||
@@ -86,6 +87,8 @@ public class PdaJBServiceImpl implements PdaJBService {
|
||||
private ISectattrService sectattrService;
|
||||
@Resource
|
||||
private IInBillService inBillService;
|
||||
@Resource
|
||||
private IMdPbStoragevehicleinfoService storagevehicleinfoService;
|
||||
@Override
|
||||
public PdaResponse getOrderList(JSONObject whereJson) {
|
||||
String flag = whereJson.getString("flag");
|
||||
@@ -274,6 +277,137 @@ public class PdaJBServiceImpl implements PdaJBService {
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PdaResponse checkStruct(JSONObject param) {
|
||||
String pointCode = param.getString("point_code");
|
||||
JSONObject res = doCheckStruct(pointCode);
|
||||
return PdaResponse.requestParamOk(res);
|
||||
}
|
||||
|
||||
public JSONObject doCheckStruct(String pointCode) {
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("message", "该仓位可用!");
|
||||
res.put("flag", "1");
|
||||
Structattr struct = structattrService.getByCode(pointCode);
|
||||
if (!"0".equals(struct.getLock_type()) || ObjectUtil.isNotEmpty(struct.getTask_code())) {
|
||||
res.put("message", "该仓位不可用, 已被占用!");
|
||||
res.put("flag", "2");
|
||||
}
|
||||
if (!struct.getIs_used()) {
|
||||
res.put("message", "该仓位不可用, 仓位已禁用!");
|
||||
res.put("flag", "2");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PdaResponse confirmSet(JSONObject param) {
|
||||
String pointCode = param.getString("point_code");
|
||||
String vehicleCode = param.getString("vehicle_code");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
JSONObject res = doCheckStruct(pointCode);
|
||||
if ("2".equals(res.getString("flag"))) {
|
||||
throw new BadRequestException(res.getString("message"));
|
||||
}
|
||||
// 获取组盘信息
|
||||
GroupPlate groupPlate = groupplateService.getOne(new LambdaQueryWrapper<GroupPlate>()
|
||||
.eq(GroupPlate::getStoragevehicle_code, vehicleCode)
|
||||
.eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘")));
|
||||
if (ObjectUtil.isEmpty(groupPlate)) {
|
||||
throw new BadRequestException("料桶:" + vehicleCode + " 未组盘,请先组盘!");
|
||||
}
|
||||
Structattr structattr = structattrService.getByCode(pointCode);
|
||||
if (ObjectUtil.isEmpty(structattr)) {
|
||||
throw new BadRequestException("仓位:" + pointCode + " 不存在!");
|
||||
}
|
||||
MdPbStoragevehicleinfo vehicleInfo = storagevehicleinfoService.getByCode(vehicleCode);
|
||||
if (ObjectUtil.isEmpty(vehicleInfo)) {
|
||||
throw new BadRequestException("载具:" + vehicleCode + " 的信息不存在!");
|
||||
}
|
||||
MdMeMaterialbase materialbase = materialbaseService.getById(groupPlate.getMaterial_id());
|
||||
if (ObjectUtil.isEmpty(materialbase)) {
|
||||
throw new BadRequestException("物料【" + groupPlate.getMaterial_id() + "】不存在!");
|
||||
}
|
||||
// 1、创建出库单、明细、分配明细
|
||||
// 1.1 单据表
|
||||
String invId = IdUtil.getStringId();
|
||||
IOStorInv ioStorInv = new IOStorInv();
|
||||
ioStorInv.setIostorinv_id(invId);
|
||||
ioStorInv.setBill_code(CodeUtil.getNewCode("IN_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(structattr.getStor_id());
|
||||
ioStorInv.setStor_code(structattr.getStor_code());
|
||||
ioStorInv.setStor_name(structattr.getStor_name());
|
||||
ioStorInv.setBill_status(IOSEnum.BILL_STATUS.code("完成"));
|
||||
ioStorInv.setBill_type("0009");
|
||||
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(groupPlate.getQty());
|
||||
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(groupPlate.getQty());
|
||||
dtl.setAssign_qty(groupPlate.getQty());
|
||||
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(structattr.getSect_id());
|
||||
ioStorInvDis.setPcsn(groupPlate.getPcsn());
|
||||
ioStorInvDis.setMaterial_id(materialbase.getMaterial_id());
|
||||
ioStorInvDis.setMaterial_code(materialbase.getMaterial_code());
|
||||
ioStorInvDis.setSect_name(structattr.getSect_name());
|
||||
ioStorInvDis.setSect_code(structattr.getSect_code());
|
||||
ioStorInvDis.setStruct_id(structattr.getStruct_id());
|
||||
ioStorInvDis.setStruct_name(structattr.getStruct_name());
|
||||
ioStorInvDis.setStruct_code(structattr.getStruct_code());
|
||||
ioStorInvDis.setStoragevehicle_code(groupPlate.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.getQty());
|
||||
ioStorInvDisMapper.insert(ioStorInvDis);
|
||||
|
||||
// 1.3 仓位赋值
|
||||
structattr.setStoragevehicle_code(groupPlate.getStoragevehicle_code());
|
||||
structattr.setStoragevehicle_type(vehicleInfo.getStoragevehicle_type());
|
||||
structattr.setOccupancy_state(3);
|
||||
structattrService.updateById(structattr);
|
||||
|
||||
// 1.4 组盘设置入库
|
||||
groupPlate.setStatus(IOSEnum.GROUP_PLATE_STATUS.code("入库"));
|
||||
groupPlate.setUpdate_time(now);
|
||||
groupplateService.updateById(groupPlate);
|
||||
return PdaResponse.requestOk();
|
||||
}
|
||||
|
||||
private Map<String, Object> buildTaskData(String pointCode, String workorderId, String invId) {
|
||||
Map<String, Object> jsonMst = new HashMap<>();
|
||||
// ru库点
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
WHERE
|
||||
p.point_type = #{type}
|
||||
AND p.region_code = #{regionCode}
|
||||
AND p.is_used = true
|
||||
AND 0 = (
|
||||
SELECT
|
||||
COUNT(*)
|
||||
|
||||
@@ -302,11 +302,11 @@
|
||||
{{ getVehicleTypeLabel(scope.row.can_vehicle_type) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'载具数量')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'载具数量')" />
|
||||
<el-table-column prop="material_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="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'载具数量')" />-->
|
||||
<!-- <el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'载具数量')" />-->
|
||||
<!-- <el-table-column prop="material_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="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,'是否有工单')">
|
||||
|
||||
Reference in New Issue
Block a user