Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangzhiqiang
2023-05-30 19:55:57 +08:00
33 changed files with 423 additions and 157 deletions

View File

@@ -1,5 +1,6 @@
package org.nl.wms.masterdata_manage.service.vehicle;
import com.alibaba.fastjson.JSONObject;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbBucketrecord;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -24,4 +25,6 @@ public interface IMdPbBucketrecordService extends IService<MdPbBucketrecord> {
* @return Object /
*/
Object queryAll(Map whereJson, PageQuery page);
void createBucke(MdPbBucketrecord dao);
}

View File

@@ -1,6 +1,8 @@
package org.nl.wms.masterdata_manage.service.vehicle.dao;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
@@ -28,6 +30,7 @@ public class MdPbBucketrecord implements Serializable {
/**
* 桶记录标识
*/
@TableId
private Long bucket_record_id;
/**
@@ -43,7 +46,7 @@ public class MdPbBucketrecord implements Serializable {
/**
* 物料标识
*/
private Long material_id;
private String material_id;
/**
* 批次

View File

@@ -1,6 +1,8 @@
package org.nl.wms.masterdata_manage.service.vehicle.dao;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import java.io.Serializable;
@@ -27,6 +29,7 @@ public class MdPbStoragevehicleext implements Serializable {
/**
* 载具扩展标识
*/
@TableId
private String storagevehicleext_id;
/**

View File

@@ -1,16 +1,29 @@
package org.nl.wms.masterdata_manage.service.vehicle.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.nl.common.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.masterdata_manage.MasterEnum;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbBucketrecord;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleinfo;
import org.nl.wms.masterdata_manage.service.vehicle.dao.mapper.MdPbBucketrecordMapper;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.wms.storage_manage.IOSEnum;
import org.nl.wms.storage_manage.IVTEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@@ -25,6 +38,10 @@ import java.util.Map;
@Service
public class MdPbBucketrecordServiceImpl extends ServiceImpl<MdPbBucketrecordMapper, MdPbBucketrecord> implements IMdPbBucketrecordService {
@Autowired
protected IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService; // 载具服务
@Override
public Object queryAll(Map whereJson, PageQuery pageQuery) {
Page<Object> page = PageHelper.startPage(pageQuery.getPage()+1, pageQuery.getSize());
@@ -33,4 +50,32 @@ public class MdPbBucketrecordServiceImpl extends ServiceImpl<MdPbBucketrecordMap
build.setTotalElements(page.getTotal());
return build;
}
@Override
public void createBucke(MdPbBucketrecord dao) {
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getOne(
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, dao.getStoragevehicle_code())
);
dao.setBucket_record_id(IdUtil.getLongId());
dao.setStoragevehicle_type("1"); // TODO 暂时写死
dao.setIvt_level(IVTEnum.IVT_LEVEL.code("一级"));
dao.setIs_active("1");
dao.setQuality_scode(IVTEnum.QUALITY_SCODE.code("待检品"));
dao.setPrint_times(BigDecimal.valueOf(0));
dao.setCreate_id(Long.valueOf(SecurityUtils.getCurrentUserId()));
dao.setCreate_name(SecurityUtils.getCurrentNickName());
dao.setCreate_time(DateUtil.now());
dao.setStoragevehicle_id(Long.valueOf(vehicleDao.getStoragevehicle_id()));
dao.setStoragevehicle_code(vehicleDao.getStoragevehicle_code());
dao.setMakeup_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
dao.setMakeup_optname(SecurityUtils.getCurrentNickName());
dao.setMakeup_time(DateUtil.now());
dao.setInstor_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
dao.setInstor_optname(SecurityUtils.getCurrentNickName());
dao.setInstor_time(DateUtil.now());
this.save(dao);
}
}

View File

@@ -25,7 +25,7 @@ public enum IOSEnum {
//单据状态
WORK_STATUS(MapOf.of("未生成", "00", "生成", "10", "执行中", "20", "完成", "99")),
//锁定类型
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3")),
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4")),
;
private Map<String, String> code;

View File

@@ -455,7 +455,8 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
// 4) 更新载具扩展属性
iMdPbStoragevehicleextService.update(
new MdPbStoragevehicleext()
.setMaterial_id(""),
.setMaterial_id("")
.setStorage_qty(BigDecimal.valueOf(0)),
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code,dao.getStoragevehicle_code())
);
@@ -477,7 +478,7 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
@Override
public List getStructIvt(JSONObject whereJson) {
JSONObject param = new JSONObject();
param.put("materia_id", whereJson.getString("materia_id"));
param.put("material_id", whereJson.getString("material_id"));
param.put("stor_id", whereJson.getString("stor_id"));
if (ObjectUtil.isNotEmpty(whereJson.getString("source_billdtl_id"))) param.put("sale_id", whereJson.getString("source_billdtl_id"));
if (ObjectUtil.isNotEmpty(whereJson.getString("search"))) param.put("remark", whereJson.getString("search"));

View File

@@ -271,6 +271,7 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
// 6.更新载具扩展属性表
MdPbStoragevehicleext vehicleDao = new MdPbStoragevehicleext();
vehicleDao.setMaterial_id(disDtlDao.getMaterial_id());
vehicleDao.setStorage_qty(qty);
vehicleDao.setUpdate_id(SecurityUtils.getCurrentUserId());
vehicleDao.setUpdate_name(SecurityUtils.getCurrentNickName());
vehicleDao.setUpdate_time(new Date());

View File

@@ -1,6 +1,7 @@
package org.nl.wms.storage_manage.productmanage.service.iostorInv.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -117,6 +118,7 @@ public class StIvtIostorinvdisCpServiceImpl extends ServiceImpl<StIvtIostorinvdi
// 更新载具扩展属性表
MdPbStoragevehicleext vehicleExtDao = new MdPbStoragevehicleext();
vehicleExtDao.setMaterial_id(item.getString("material_id"));
vehicleExtDao.setStorage_qty(NumberUtil.add(vehicleExtDao.getStorage_qty(),item.getBigDecimal("qty")));
vehicleExtDao.setUpdate_id(SecurityUtils.getCurrentUserId());
vehicleExtDao.setUpdate_name(SecurityUtils.getCurrentNickName());
vehicleExtDao.setUpdate_time(new Date());

View File

@@ -54,5 +54,7 @@
</if>
</where>
order by mst.mol_code DESC
</select>
</mapper>

View File

@@ -107,7 +107,7 @@ public class StIvtMoreorlessdtlCpServiceImpl extends ServiceImpl<StIvtMoreorless
//锁定货位
structattrService.update(
new UpdateWrapper<StIvtStructattr>()
.set("lock_type", IOSEnum.LOCK_TYPE.code("盘点"))
.set("lock_type", IOSEnum.LOCK_TYPE.code("损溢"))
.set("inv_code",mst.getMol_code())
.eq("struct_id", row.getStruct_id()));
}

View File

@@ -19,11 +19,17 @@ import org.nl.common.utils.IdUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.wms.masterdata_manage.MasterEnum;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbBucketrecord;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
import org.nl.wms.storage_manage.CHECKEnum;
import org.nl.wms.storage_manage.IOSEnum;
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.IStIvtMoreorlessdtlCpService;
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.IStIvtMoreorlessmstCpService;
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao.StIvtMoreorlessdtlCp;
@@ -38,6 +44,7 @@ import org.nl.wms.storage_manage.rawmanage.service.structIvt.dao.StIvtStructivtY
import org.nl.wms.storage_manage.semimanage.MLEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
@@ -66,6 +73,12 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
@Autowired
private IStIvtStructattrService structattrService; // 仓位属性服务
@Autowired
protected IMdPbBucketrecordService iMdPbBucketrecordService; // 包装箱记录表服务
@Autowired
protected IMdPbStoragevehicleextService iMdPbStoragevehicleextService; // 载具扩展属性信息表服务
@Override
public Object pageQuery(MoreOrlessQuery query, PageQuery pageQuery) {
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
@@ -117,10 +130,28 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
StIvtMoreorlessmstCp dao = this.getOne(new QueryWrapper<StIvtMoreorlessmstCp>().eq("mol_id", id));
dao.setIs_delete(true);
this.updateById(dao);
// 解锁货位
StIvtMoreorlessdtlCp dtlDao = iStIvtMoreorlessdtlCpService.getOne(
new QueryWrapper<StIvtMoreorlessdtlCp>().lambda()
.eq(StIvtMoreorlessdtlCp::getMol_id, id),
false
);
structattrService.update(
new StIvtStructattr()
.setInv_code("")
.setInv_type("")
.setInv_id("")
.setLock_type(IOSEnum.LOCK_TYPE.code("未锁定")),
new QueryWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_id, dtlDao.getStruct_id())
);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void confirm(JSONObject whereJson) {
String mol_id = (String) whereJson.get("mol_id");
@@ -146,9 +177,64 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
BigDecimal mol_qty = dtl.getMol_qty();
ivt.setCanuse_qty(NumberUtil.sub(canuse_qty, mol_qty));
ivt.setIvt_qty(NumberUtil.sub(ivt_qty, mol_qty));
// 更新载具扩展属性重量
MdPbStoragevehicleext vehicleDao = iMdPbStoragevehicleextService.getOne(
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, dtl.getStoragevehicle_code())
);
if (ObjectUtil.isNotEmpty(vehicleDao)) {
vehicleDao.setStorage_qty(NumberUtil.sub(vehicleDao.getStorage_qty(),mol_qty));
iMdPbStoragevehicleextService.updateById(vehicleDao);
}
// 判断是否有箱
MdPbBucketrecord buckDao = iMdPbBucketrecordService.getOne(
new QueryWrapper<MdPbBucketrecord>().lambda()
.eq(MdPbBucketrecord::getBucketunique, dtl.getBucketunique())
.eq(MdPbBucketrecord::getMaterial_id, dtl.getMaterial_id())
);
if (ObjectUtil.isNotEmpty(buckDao)) {
// 更新箱重量
buckDao.setStorage_qty(NumberUtil.sub(buckDao.getStorage_qty(), mol_qty));
iMdPbBucketrecordService.updateById(buckDao);
}
//如果库存变为0则删除记录
if (canuse_qty.compareTo(mol_qty) == 0 && canuse_qty.compareTo(ivt_qty) == 0) {
iStIvtStructivtCpService.removeById(ivt.getStockrecord_id());
// 更新箱记录表状态为出库
iMdPbBucketrecordService.update(
MdPbBucketrecord.builder()
.status(MasterEnum.BOX_STATUS.code("出库"))
.build(),
new QueryWrapper<MdPbBucketrecord>().lambda()
.eq(MdPbBucketrecord::getBucketunique, dtl.getBucketunique())
.eq(MdPbBucketrecord::getMaterial_id, dtl.getMaterial_id())
);
// 更新载具扩展属性 - 释放载具对应物料关系 清空数量
iMdPbStoragevehicleextService.update(
new MdPbStoragevehicleext()
.setMaterial_id("")
.setStorage_qty(BigDecimal.valueOf(0)),
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code,dtl.getStoragevehicle_code())
);
// 更新货位 -- 清除载具号
structattrService.update(
new StIvtStructattr()
.setStoragevehicle_code("")
.setInv_id("")
.setInv_type("")
.setInv_code(""),
new QueryWrapper<StIvtStructattr>().lambda()
.eq(StIvtStructattr::getStruct_id, ivt.getStruct_id())
);
} else {
iStIvtStructivtCpService.updateById(ivt);
}
@@ -177,12 +263,99 @@ public class StIvtMoreorlessmstCpServiceImpl extends ServiceImpl<StIvtMoreorless
.setInstorage_time(DateUtil.now())
.setStor_id(mst.getStor_id())
);
// 更新仓位 - 载具编码
struct_jo.setStoragevehicle_code(dtl.getStoragevehicle_code());
structattrService.updateById(struct_jo);
// 更新载具对应物料关系、数量
MdPbStoragevehicleext vehicleDao = iMdPbStoragevehicleextService.getOne(
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, dtl.getStoragevehicle_code())
);
if (ObjectUtil.isNotEmpty(vehicleDao)) {
vehicleDao.setStorage_qty(mol_qty);
vehicleDao.setMaterial_id(dtl.getMaterial_id());
iMdPbStoragevehicleextService.updateById(vehicleDao);
}
// 判断是否有箱
if (ObjectUtil.isNotEmpty(dtl.getBucketunique())) {
MdPbBucketrecord buckDao = iMdPbBucketrecordService.getOne(
new QueryWrapper<MdPbBucketrecord>().lambda()
.eq(MdPbBucketrecord::getBucketunique, dtl.getBucketunique())
.eq(MdPbBucketrecord::getMaterial_id, dtl.getMaterial_id())
);
if (ObjectUtil.isEmpty(buckDao)) {
// 新增一条箱记录
MdPbBucketrecord param = MdPbBucketrecord.builder()
.bucketunique(dtl.getBucketunique())
.material_id(dtl.getMaterial_id())
.pcsn(dtl.getPcsn())
.qty_unit_id(Long.valueOf(dtl.getQty_unit_id()))
.qty_unit_name(dtl.getQty_unit_name())
.storage_qty(dtl.getMol_qty())
.status(MasterEnum.BOX_STATUS.code("入库"))
.storagevehicle_code(dtl.getStoragevehicle_code())
.build();
iMdPbBucketrecordService.createBucke(param);
} else {
buckDao.setStorage_qty(dtl.getMol_qty());
buckDao.setStatus(MasterEnum.BOX_STATUS.code("入库"));
iMdPbBucketrecordService.updateById(buckDao);
}
}
} else {
BigDecimal canuse_qty = ivt.getCanuse_qty();
BigDecimal ivt_qty = ivt.getIvt_qty();
// 更新库存
ivt.setCanuse_qty(NumberUtil.add(canuse_qty, mol_qty));
ivt.setIvt_qty(NumberUtil.add(ivt_qty, mol_qty));
iStIvtStructivtCpService.updateById(ivt);
// 判断是否有箱
if (ObjectUtil.isNotEmpty(dtl.getBucketunique())) {
MdPbBucketrecord buckDao = iMdPbBucketrecordService.getOne(
new QueryWrapper<MdPbBucketrecord>().lambda()
.eq(MdPbBucketrecord::getBucketunique, dtl.getBucketunique())
.eq(MdPbBucketrecord::getMaterial_id, dtl.getMaterial_id())
);
if (ObjectUtil.isEmpty(buckDao)) {
// 新增一条箱记录
MdPbBucketrecord param = MdPbBucketrecord.builder()
.bucketunique(dtl.getBucketunique())
.material_id(dtl.getMaterial_id())
.pcsn(dtl.getPcsn())
.qty_unit_id(Long.valueOf(dtl.getQty_unit_id()))
.qty_unit_name(dtl.getQty_unit_name())
.storage_qty(dtl.getMol_qty())
.status(MasterEnum.BOX_STATUS.code("入库"))
.storagevehicle_code(dtl.getStoragevehicle_code())
.build();
iMdPbBucketrecordService.createBucke(param);
} else {
buckDao.setStorage_qty(NumberUtil.add(buckDao.getStorage_qty(), dtl.getMol_qty()));
buckDao.setStatus(MasterEnum.BOX_STATUS.code("入库"));
iMdPbBucketrecordService.updateById(buckDao);
}
}
// 更新载具扩展属性 - 数量
MdPbStoragevehicleext vehicleDao = iMdPbStoragevehicleextService.getOne(
new QueryWrapper<MdPbStoragevehicleext>().lambda()
.eq(MdPbStoragevehicleext::getStoragevehicle_code, dtl.getStoragevehicle_code())
);
if (ObjectUtil.isNotEmpty(vehicleDao)) {
vehicleDao.setStorage_qty(NumberUtil.add(vehicleDao.getStorage_qty(), dtl.getMol_qty()));
iMdPbStoragevehicleextService.updateById(vehicleDao);
}
}
//更新明细状态

View File

@@ -25,4 +25,6 @@ public interface StIvtStructivtCpMapper extends BaseMapper<StIvtStructivtCp> {
List<Map> getStructIvtMore(@Param("query") StructIvtYLQuery query);
List<Map> getStructIvtMoreBox(JSONObject json);
}

View File

@@ -74,6 +74,7 @@
sa.struct_id,
sa.struct_code,
sa.struct_name,
sa.storagevehicle_code,
class.class_name
FROM
ST_IVT_StructIvt_CP ivt
@@ -97,4 +98,44 @@
</where>
</select>
<select id="getStructIvtMoreBox" resultType="java.util.Map">
SELECT
buck.storage_qty AS ivt_qty,
buck.qty_unit_id,
buck.qty_unit_name,
buck.quality_scode,
buck.ivt_level,
buck.pcsn,
buck.material_id,
buck.bucketunique,
mb.material_code,
mb.material_name,
sa.sect_id,
sa.sect_code,
sa.sect_name,
sa.struct_id,
sa.struct_code,
sa.struct_name,
sa.storagevehicle_code,
class.class_name
FROM
md_pb_bucketrecord buck
LEFT JOIN md_me_materialbase mb ON mb.material_id = buck.material_id
LEFT JOIN st_ivt_structattr sa ON sa.storagevehicle_code = buck.storagevehicle_code
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
<where>
buck.storage_qty > 0
AND
sa.lock_type = '0'
AND
buck.status = '3'
<if test="storagevehicle_code!= null and storagevehicle_code != ''">
and sa.storagevehicle_code = #{storagevehicle_code}
</if>
<if test="struct_code!= null and struct_code != ''">
and sa.struct_code = #{struct_code}
</if>
</where>
</select>
</mapper>

View File

@@ -10,6 +10,8 @@ import org.nl.common.utils.IdUtil;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbBucketrecordService;
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbBucketrecord;
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
@@ -43,6 +45,9 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
@Autowired
protected IMdMeMaterialbaseService iMdMeMaterialbaseService; // 物料服务
@Autowired
protected IMdPbBucketrecordService iMdPbBucketrecordService; // 包装箱记录表服务
@Override
@Transactional(rollbackFor = Exception.class)
public void UpdateIvt(JSONObject json) {
@@ -95,7 +100,24 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
@Override
public List<Map> getStructIvtMore(StructIvtYLQuery whereJson) {
return this.baseMapper.getStructIvtMore(whereJson);
// 判断货位是否有箱
List<Map> structIvtList = this.baseMapper.getStructIvtMore(whereJson);
if (ObjectUtil.isNotEmpty(structIvtList)) {
MdPbBucketrecord buckDao = iMdPbBucketrecordService.getOne(
new QueryWrapper<MdPbBucketrecord>().lambda()
.eq(MdPbBucketrecord::getStoragevehicle_code, structIvtList.get(0).get("storagevehicle_code")),
false
);
if (ObjectUtil.isNotEmpty(buckDao)) {
JSONObject param = new JSONObject();
param.put("storagevehicle_code",structIvtList.get(0).get("storagevehicle_code"));
param.put("struct_code",structIvtList.get(0).get("struct_code"));
structIvtList = this.baseMapper.getStructIvtMoreBox(param);
}
}
return structIvtList;
}
/*

View File

@@ -391,9 +391,11 @@ export default {
this.form.sect_name = row.sect_name
this.form.struct_name = row.struct_name
crudMoreOrless.getStructIvt({'struct_id': row.struct_id}).then(res => {
debugger
this.form.tableData = res
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.material_id = row.material_id.toString()
this.$set(row, 'edit', false)
this.form.tableData.splice(i, 1, row)
}
@@ -407,7 +409,7 @@ export default {
this.nowrow = row
},
async queryStruct() {
if (!this.form.mol_type) {
if (!this.form.mol_type) {structShow
this.crud.notify('请先选择损溢类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
@@ -450,6 +452,7 @@ export default {
this.form.struct_name = ''
},
handleEdit(index, row) {
row.material_id = row.material_id.toString()
if (!row.edit) {
if (typeof (row.mol_qty) === 'undefined' | (parseFloat(row.mol_qty) <= 0)) {
this.crud.notify('不允许损溢数量为0', CRUD.NOTIFICATION_TYPE.INFO)
@@ -459,6 +462,10 @@ export default {
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (!row.storagevehicle_code) {
this.crud.notify('载具号不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
if (this.form.mol_type === '0' && (parseFloat(row.ivt_qty) < parseFloat(row.mol_qty))) {
this.crud.notify('不允许损数量大于库存数量!', CRUD.NOTIFICATION_TYPE.INFO)
return false

View File

@@ -15,9 +15,11 @@ import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.acs.task.service.impl.TaskServiceImpl;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.service.ParamService;
import org.nl.modules.system.service.impl.ParamServiceImpl;
import org.nl.modules.wql.util.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.DataInputStream;
@@ -33,23 +35,22 @@ import static org.nl.acs.agv.server.impl.NDCAgvServiceImpl.Bytes2HexString;
@Slf4j
@Component
public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
@Autowired
private ParamService paramService;
@Autowired
private InstructionService instructionService;
@Autowired
private TaskService taskService;
@Autowired
private NDCAgvService ndcAgvService;
@Autowired
private DeviceAppService deviceAppService;
Socket s;
String ip = "192.168.46.225";
int port = 1234;
static DataOutputStream dos;
static DataInputStream dis;
private int recordTimeOut = 10000;
private Date recordTime;
String[] ERROR = new String[]{
"货叉尖部传感器触发", "S300传感器触发", "载货状态改变", "急停按钮触发", "触边开关出发", "需要复位",
"停在充电位", "取货失败", "放货失败", "轮子打滑", "没有动作码不能进入站点", "取货时有货", "丢失定位",
"抬叉停止"};
boolean bConnected = true;
private Socket socket;
private static DataOutputStream dos;
private static DataInputStream dis;
public NDCSocketConnectionAutoRun() {
this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut);
}
@Override
@@ -65,37 +66,30 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
@Override
public void autoRun() throws IOException {
try {
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class);
TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class);
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class);
ip = paramService.findByCode(AcsConfig.AGVURL).getValue();
port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT).getValue());
byte[] b = new byte[1028];
s = new Socket(ip, port);
dos = new DataOutputStream(s.getOutputStream());
dis = new DataInputStream(s.getInputStream());
while (bConnected) {
int count = dis.read(b);
if (count == -1) {
break;
}
int[] arr = new int[count];
StringBuffer bs = new StringBuffer();
for (int i = 0; i < count; i++) {
int temp = b[i];
String ip = paramService.findByCode(AcsConfig.AGVURL).getValue();
int port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT).getValue());
socket = new Socket(ip, port);
byte[] bytes = new byte[1024];
dos = new DataOutputStream(socket.getOutputStream());
dis = new DataInputStream(socket.getInputStream());
int len;
int[] arr;
StringBuffer sb;
while ((len = dis.read(bytes)) != -1) {
arr = new int[len];
sb = new StringBuffer();
for (int i = 0; i < len; i++) {
int temp = bytes[i];
if (temp < 0)
temp += 256;
arr[i] = temp;
StringBuffer bs1 = new StringBuffer("0");
bs.append(temp < 16 ? bs1.append(Integer.toHexString(temp)) : Integer.toHexString(temp));
sb.append(temp < 16 ? bs1.append(Integer.toHexString(temp)) : Integer.toHexString(temp));
}
if (arr[8] * 256 + arr[9] == 0x73) {
byte[] data = null;
System.out.println("接收agv上报信息" + bs);
System.out.println("接收agv上报信息" + sb);
//执行阶段
int phase = arr[16] * 256 + arr[17];
// agv任务号
@@ -114,7 +108,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
insts = instructionService.findByLinkNum(String.valueOf(ikey));
}
log.info("接收agv上报信息" + bs);
log.info("接收agv上报信息" + sb);
log.info("接收agv上报信息" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno);
Device device = null;
//
@@ -147,12 +141,6 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
log.info("修改指令执行信息成功,指令号:{}", inst.getInstruction_code());
}
// for (Instruction inst : insts) {
// inst.setInstruction_status("1");
// inst.setAgv_jobno(String.valueOf(index));
// instructionService.update(inst);
// log.info("修改指令执行信息成功,指令号:{}", inst.getInstruction_code());
// }
}
}
if (flag) {
@@ -161,10 +149,6 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
}
} else if (phase == 0x1A) {
//任务完毕无车id及状态
// for (Instruction inst : insts) {
// instructionService.finish(inst.getInstruction_id());
// }
instructionService.finishByLinkNum(String.valueOf(ikey));
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else if (phase == 0x30) {
@@ -196,21 +180,15 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
System.out.println("agv上报不是0073类型动作不处理");
}
}
} catch (Exception e) {
System.out.println("双工Agv链接异常");
log.info("双工AGV链接异常");
log.error("agv连接出现异常:{}", JSON.toJSONString(e));
if (ObjectUtil.isNotEmpty(s)) {
s.close();
if (ObjectUtil.isNotEmpty(socket)) {
socket.close();
}
System.out.println(e.getMessage());
e.printStackTrace();
} finally {
}
}
@@ -218,7 +196,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
public void stop() {
super.after();
try {
s.close();
socket.close();
} catch (Exception e) {
e.printStackTrace();
}
@@ -232,9 +210,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
dos.write(b);
dos.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
throw new BadRequestException(e.getMessage());
}
}
}

View File

@@ -1,6 +1,7 @@
package org.nl.acs.auto.run;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.AcsConfig;
import org.nl.acs.agv.server.NDCAgvService;
@@ -11,9 +12,12 @@ import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.instruction.service.impl.InstructionServiceImpl;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.task.service.TaskService;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.service.ParamService;
import org.nl.modules.system.service.impl.ParamServiceImpl;
import org.nl.modules.wql.util.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.DataInputStream;
@@ -29,23 +33,21 @@ import static org.nl.acs.agv.server.impl.NDCAgvServiceImpl.Bytes2HexString;
@Slf4j
@Component
public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
@Autowired
private ParamService paramService;
@Autowired
private InstructionService instructionService;
@Autowired
private NDCAgvService ndcAgvService;
@Autowired
private DeviceAppService deviceAppService;
Socket s;
String ip = "192.168.46.225";
int port = 1234;
static DataOutputStream dos;
static DataInputStream dis;
private int recordTimeOut = 10000;
private Date recordTime;
String[] ERROR = new String[]{
"货叉尖部传感器触发", "S300传感器触发", "载货状态改变", "急停按钮触发", "触边开关出发", "需要复位",
"停在充电位", "取货失败", "放货失败", "轮子打滑", "没有动作码不能进入站点", "取货时有货", "丢失定位",
"抬叉停止"};
boolean bConnected = true;
private Socket socket;
private static DataOutputStream dos;
private static DataInputStream dis;
public OneNDCSocketConnectionAutoRun() {
this.recordTime = new Date((new Date()).getTime() - (long) this.recordTimeOut);
}
@Override
@@ -60,40 +62,27 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
@Override
public void autoRun() throws IOException {
System.out.println("OneAgv链接开始");
ParamService paramService = SpringContextHolder.getBean(ParamServiceImpl.class);
InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class);
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class);
ip = paramService.findByCode(AcsConfig.ONEAGVURL).getValue();
port = Integer.parseInt(paramService.findByCode(AcsConfig.ONEAGVPORT).getValue());
try {
byte[] b = new byte[1028];
s = new Socket(ip, port);
dos = new DataOutputStream(s.getOutputStream());
dis = new DataInputStream(s.getInputStream());
System.out.println("OneAgv链接成功");
while (bConnected) {
int count = dis.read(b);
if (count == -1) {
break;
}
int[] arr = new int[count];
StringBuffer bs = new StringBuffer();
String ip = paramService.findByCode(AcsConfig.ONEAGVURL).getValue();
int port = Integer.parseInt(paramService.findByCode(AcsConfig.ONEAGVPORT).getValue());
socket = new Socket(ip, port);
dos = new DataOutputStream(socket.getOutputStream());
dis = new DataInputStream(socket.getInputStream());
byte[] bytes = new byte[1024];
int count;
int[] arr;
StringBuffer bs;
while ((count = dis.read(bytes)) != -1) {
arr = new int[count];
bs = new StringBuffer();
for (int i = 0; i < count; i++) {
int temp = b[i];
int temp = bytes[i];
if (temp < 0)
temp += 256;
arr[i] = temp;
StringBuffer bs1 = new StringBuffer("0");
bs.append(temp < 16 ? bs1.append(Integer.toHexString(temp)) : Integer.toHexString(temp));
}
//System.out.println("收到请求参数:" + bs);
boolean flag = false;
if (arr[8] * 256 + arr[9] == 0x73) {
byte[] data = null;
System.out.println("接收agv上报信息" + bs);
@@ -114,14 +103,10 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
log.info("接收agv上报信息" + bs);
log.info("接收agv上报信息" + "phase--" + phase + " index--" + index + " ikey--" + ikey + " agvaddr--" + agvaddr + " Car--" + carno);
Device device = null;
String device_code = null;
//
AgvNdcOneDeviceDriver agvNdcOneDeviceDriver;
//开始任务/上报订单号
if (phase == 0x01) {
if (ObjectUtil.isNotEmpty(insts)) {
for (Instruction inst : insts) {
inst.setInstruction_status("1");
inst.setAgv_jobno(String.valueOf(index));
@@ -129,13 +114,9 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
instructionService.update(inst);
}
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
}
} else if (phase == 0x0A) {
// for (Instruction inst : insts) {
// instructionService.finish(inst.getInstruction_id());
// }
instructionService.finishByLinkNum(String.valueOf(ikey));
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
@@ -143,10 +124,6 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
data = ndcAgvService.sendAgvOneModeInst(143, index, 0);
} else if (phase == 0xFF) {
// for (Instruction inst : insts) {
// instructionService.cancelNoSendAgv(inst.getInstruction_id());
// }
instructionService.cancelByLinkNum(String.valueOf(ikey));
data = ndcAgvService.sendAgvOneModeInst(phase, index, 0);
} else if (phase == 0x50) {
@@ -176,18 +153,13 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
} catch (Exception e) {
System.out.println("OneAgv链接异常");
if (ObjectUtil.isNotEmpty(s)) {
s.close();
log.error("agv连接出现异常:{}", JSON.toJSONString(e));
if (ObjectUtil.isNotEmpty(socket)) {
socket.close();
}
System.out.println(e.getMessage());
e.printStackTrace();
} finally {
}
}
@@ -195,7 +167,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
public void stop() {
super.after();
try {
s.close();
socket.close();
} catch (Exception e) {
e.printStackTrace();
}
@@ -209,8 +181,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
dos.write(b);
dos.flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new BadRequestException(e.getMessage());
}
}

View File

@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.basedriver.hailiang_one;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
@@ -8,7 +9,7 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class MonitoringLargeScreenData {
//存储倒料位剩余物料个数并返库MES
public static ConcurrentHashMap<String, Integer> deviceNumData = new ConcurrentHashMap<>();
public static ConcurrentHashMap<String, Map<String, Integer>> deviceNumData = new ConcurrentHashMap<>();
//存储工单数量并反馈MES
public static ConcurrentHashMap<String, Integer> orderData = new ConcurrentHashMap<>();
}

View File

@@ -140,7 +140,10 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
logServer.deviceExecuteLog(this.device_code, "", "", "信号is_open" + last_is_open + "->" + is_open);
}
if (silo_weight != last_silo_weight) {
MonitoringLargeScreenData.deviceNumData.put(this.device_code, this.getSilo_weight());
Map<String, Integer> feedNumMap = new HashMap<>();
feedNumMap.put("qty", this.getFull_number());
feedNumMap.put("weight", this.getSilo_weight());
MonitoringLargeScreenData.deviceNumData.put(this.device_code, feedNumMap);
logServer.deviceExecuteLog(this.device_code, "", "", "信号silo_weight" + last_silo_weight + "->" + silo_weight);
}
if (full_number != last_full_number) {

View File

@@ -296,6 +296,7 @@ public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implement
public void issuedOrderFinish(String autoFinish) {
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
this.writing("to_order_compel_finished", "1");
this.writing("to_confirm_finished", "1");
} else {
this.writing("to_confirm_finished", "1");
}

View File

@@ -671,6 +671,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
Map<String, Object> map = new LinkedHashMap<>();
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
map.put("to_order_compel_finished", "1");
map.put("to_confirm_finished", "1");
} else {
map.put("to_confirm_finished", "1");
}

View File

@@ -325,6 +325,7 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
Map<String, Object> map = new LinkedHashMap<>();
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
map.put("to_order_compel_finished", "1");
map.put("to_confirm_finished", "1");
} else {
map.put("to_confirm_finished", "1");
}

View File

@@ -180,7 +180,7 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
message = "";
//满料位满足联机有货有工单时向MES申请任务
if (mode == 1 && move == 1 && order > 0 && !requireSucess) {
if (mode == 1 && move == 1 && order > 0 && full_number > 0 && !requireSucess) {
boolean flag = apply_task();
this.noApplyTaskMessage = null;
if (flag) {
@@ -204,7 +204,7 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
//agv到达取货位
if (agvphase == 0x03 || agvphase == 0x07) {
if (mode == 1 && move == 1 && full_number > 0 && ObjectUtil.isNotEmpty(inst)) {
if (mode == 1 && move == 1 && ObjectUtil.isNotEmpty(inst)) {
//下发取货位agv取货就绪
this.writing("to_agv_ready", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_TO_GET.getCode());
@@ -223,9 +223,6 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
if (move == 0) {
notFeedAgvMessage += "光电信号无货,";
}
if (full_number == 0) {
notFeedAgvMessage += "满框数量为0,";
}
if (inst == null) {
notFeedAgvMessage += "AGV指令为空,";
}

View File

@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
@@ -141,7 +142,9 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
if (storage_stock_num != last_storage_stock_num) {
if (order > 0 && this.itemProtocol.getIsonline() && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))) {
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), this.getStorage_stock_num());
Map<String, Integer> feedNumMap = new HashMap<>();
feedNumMap.put("qty", this.getStorage_stock_num());
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), feedNumMap);
}
if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("min_num")) && storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) != -1) {
requireSucess = false;

View File

@@ -643,6 +643,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
Map<String, Object> map = new LinkedHashMap<>();
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
map.put("to_order_compel_finished", "1");
map.put("to_confirm_finished", "1");
} else {
map.put("to_confirm_finished", "1");
}

View File

@@ -299,6 +299,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
Map<String, Object> map = new LinkedHashMap<>();
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
map.put("to_order_compel_finished", "1");
map.put("to_confirm_finished", "1");
} else {
map.put("to_confirm_finished", "1");
}

View File

@@ -182,7 +182,7 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
message = "";
//工作模式联机、满料位有货、工单号大于0 就申请agv任务
if (mode == 1 && move == 1 && order > 0 && !requireSucess) {
if (mode == 1 && move == 1 && full_number > 0 && order > 0 && !requireSucess) {
boolean flag = apply_task();
this.noApplyTaskMessage = null;
if (flag) {
@@ -206,7 +206,7 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
//agv到达取货点
if (agvphase == 0x03 || agvphase == 0x07) {
if (mode == 1 && move == 1 && full_number > 0 && ObjectUtil.isNotEmpty(inst)) {
if (mode == 1 && move == 1 && ObjectUtil.isNotEmpty(inst)) {
//下发取货位agv取货就绪
this.writing("to_agv_ready", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_TO_GET.getCode());
@@ -225,9 +225,6 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
if (move == 0) {
notFeedAgvMessage += "光电信号无货,";
}
if (full_number == 0) {
notFeedAgvMessage += "满框数量为0,";
}
if (inst == null) {
notFeedAgvMessage += "AGV指令为空,";
}

View File

@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
@@ -142,7 +143,9 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
}
if (storage_stock_num != last_storage_stock_num) {
if (order > 0 && this.itemProtocol.getIsonline() && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))) {
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), this.getStorage_stock_num());
Map<String, Integer> feedNumMap = new HashMap<>();
feedNumMap.put("qty", this.getStorage_stock_num());
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), feedNumMap);
}
if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("min_num")) && storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) != -1) {
requireSucess = false;

View File

@@ -418,6 +418,7 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
Map<String, Object> map = new LinkedHashMap<>();
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
map.put("to_compel_finish", "1");
map.put("to_confirm_finished", "1");
} else {
map.put("to_confirm_finished", "1");
}

View File

@@ -210,6 +210,7 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
public void issuedOrderFinish(String autoFinish) {
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
this.writing("to_order_compel_finished", "1");
this.writing("to_confirm_finished", "1");
} else {
this.writing("to_confirm_finished", "1");
}

View File

@@ -52,7 +52,7 @@ public interface AcsToWmsService {
* @param map
* @return
*/
HttpResponse feedDeviceNum(Map<String, Integer> map);
HttpResponse feedDeviceNum(Map<String, Map<String,Integer>> map);
/**

View File

@@ -106,7 +106,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result = HttpRequest.post(url)
.body(JSON.toJSONString(param))
.execute();
log.info("acs向mes反馈工单状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result));
log.info("acs向mes反馈工单状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result.body()));
} catch (Exception e) {
log.error("acs向mes反馈工单状态失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage());
}
@@ -148,10 +148,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public HttpResponse feedOrderRealQty(JSONObject param) {
log.info("acs开始向mes反馈当前设备工单生产数量,请求参数:{}", JSON.toJSONString(param));
try {
MDC.put(log_file_type, log_type);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
log.info("acs开始向mes反馈当前设备工单生产数量,请求参数:{}", JSON.toJSONString(param));
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("feedOrderRealQty");
String methods_url = addressDto.getMethods_url();
@@ -175,11 +175,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
@Override
public HttpResponse feedDeviceNum(Map<String, Integer> map) {
log.info("acs开始向mes反馈设备数量,请求参数:{}", JSON.toJSONString(map));
public HttpResponse feedDeviceNum(Map<String, Map<String, Integer>> map) {
try {
MDC.put(log_file_type, log_type);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
log.info("acs开始向mes反馈设备数量,请求参数:{}", JSON.toJSONString(map));
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("feedDeviceNum");
String methods_url = addressDto.getMethods_url();

View File

@@ -520,6 +520,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
if (ObjectUtil.isNotEmpty(dto.getVehicle_code())) {
feed_jo.put("vehicle_code", dto.getVehicle_code());
}
if (ObjectUtil.isNotEmpty(dto.getWeight())) {
feed_jo.put("weight", dto.getWeight());
}
feed_jo.put("ext_param", dto.getExt_param());
JSONArray ja = new JSONArray();
ja.add(feed_jo);