Merge branch 'master' of http://121.40.234.130:8899/root/hl_one
This commit is contained in:
@@ -19,6 +19,7 @@ import java.util.Map;
|
|||||||
public class PointEvent<T> extends PublishEvent {
|
public class PointEvent<T> extends PublishEvent {
|
||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
|
private String acs_task_type;
|
||||||
private String point_code1;
|
private String point_code1;
|
||||||
private String point_code2;
|
private String point_code2;
|
||||||
private String vehicle_code;
|
private String vehicle_code;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class CodeUtil{
|
|||||||
String codeId = service.queryIdByCode(ruleCode);
|
String codeId = service.queryIdByCode(ruleCode);
|
||||||
RedissonUtils.lock(() -> {
|
RedissonUtils.lock(() -> {
|
||||||
code[0] = service.codeDemo(map);
|
code[0] = service.codeDemo(map);
|
||||||
}, codeId, 3);
|
}, codeId, 1);
|
||||||
return code[0];
|
return code[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public interface WmsToAcsService {
|
|||||||
|
|
||||||
Map<String, Object> issueTaskToAcs(JSONArray arr);
|
Map<String, Object> issueTaskToAcs(JSONArray arr);
|
||||||
Map<String, Object> issueTaskToAcs2(JSONArray arr);
|
Map<String, Object> issueTaskToAcs2(JSONArray arr);
|
||||||
|
Map<String, Object> issueTaskToAcs3(JSONArray arr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WMS客户端--->ACS服务端
|
* WMS客户端--->ACS服务端
|
||||||
|
|||||||
@@ -138,10 +138,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{
|
|||||||
String status = row.getString("status");
|
String status = row.getString("status");
|
||||||
// 任务处理类
|
// 任务处理类
|
||||||
try {
|
try {
|
||||||
|
if (ObjectUtil.isNotEmpty(processing_class)) {
|
||||||
AbstractAcsTask taskHandler = (AbstractAcsTask)SpringContextHolder.getBean(Class.forName(processing_class));
|
AbstractAcsTask taskHandler = (AbstractAcsTask)SpringContextHolder.getBean(Class.forName(processing_class));
|
||||||
if (taskHandler!=null){
|
if (taskHandler!=null){
|
||||||
taskHandler.updateTaskStatus(row,status);
|
taskHandler.updateTaskStatus(row,status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//发布一个任务执行事件:服务跟任务不一样,可以同事存在
|
//发布一个任务执行事件:服务跟任务不一样,可以同事存在
|
||||||
TaskEvent event = TaskEvent.builder()
|
TaskEvent event = TaskEvent.builder()
|
||||||
|
|||||||
@@ -66,6 +66,32 @@ public class WmsToAcsServiceImpl implements WmsToAcsService{
|
|||||||
return AcsUtil.notifyAcs(api, form);
|
return AcsUtil.notifyAcs(api, form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> issueTaskToAcs3(JSONArray arr) {
|
||||||
|
JSONArray form = new JSONArray();
|
||||||
|
for (Object o : arr) {
|
||||||
|
JSONObject task = (JSONObject) o;
|
||||||
|
Boolean is_send = task.getBoolean("is_send");
|
||||||
|
String send = "1";
|
||||||
|
if (!is_send) send = "0";
|
||||||
|
|
||||||
|
JSONObject param = new JSONObject(MapOf.of("task_id", task.getString("task_id")
|
||||||
|
, "task_code", task.getString("task_code")
|
||||||
|
, "task_group_id", task.getString("task_group_id")
|
||||||
|
, "start_point_code", task.getString("point_code1")
|
||||||
|
, "next_point_code", task.getString("point_code2")
|
||||||
|
, "task_type", task.getString("acs_task_type")
|
||||||
|
, "priority", task.getString("priority")
|
||||||
|
, "is_send", send
|
||||||
|
, "vehicle_code", task.getString("vehicle_code")
|
||||||
|
, "agv_system_type", task.getString("agv_system_type")
|
||||||
|
));
|
||||||
|
form.add(param);
|
||||||
|
}
|
||||||
|
String api = "api/wms/task";
|
||||||
|
return AcsUtil.notifyAcs(api, form);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> cancelToAcs(JSONArray arr) {
|
public Map<String, Object> cancelToAcs(JSONArray arr) {
|
||||||
String api = "api/wms/cancelTask";
|
String api = "api/wms/cancelTask";
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package org.nl.wms.masterdata_manage.service.vehicle.dao;
|
package org.nl.wms.masterdata_manage.service.vehicle.dao;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -25,6 +27,7 @@ public class MdPbStoragevehicleinfo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 载具标识
|
* 载具标识
|
||||||
*/
|
*/
|
||||||
|
@TableId
|
||||||
private String storagevehicle_id;
|
private String storagevehicle_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -40,4 +40,10 @@ public interface IStIvtStructattrService extends IService<StIvtStructattr> {
|
|||||||
* @param jo
|
* @param jo
|
||||||
*/
|
*/
|
||||||
JSONObject getSectCascader(JSONObject jo);
|
JSONObject getSectCascader(JSONObject jo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询超限货位
|
||||||
|
* @param jo
|
||||||
|
*/
|
||||||
|
StIvtStructattr getExceedAttr(JSONObject jo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper;
|
package org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||||
|
|
||||||
@@ -13,4 +14,5 @@ import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
|||||||
*/
|
*/
|
||||||
public interface StIvtStructattrMapper extends BaseMapper<StIvtStructattr> {
|
public interface StIvtStructattrMapper extends BaseMapper<StIvtStructattr> {
|
||||||
|
|
||||||
|
StIvtStructattr getExceedAttr(JSONObject jo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,35 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper.StIvtStructattrMapper">
|
<mapper namespace="org.nl.wms.masterdata_manage.storage.service.storage.dao.mapper.StIvtStructattrMapper">
|
||||||
|
|
||||||
|
<select id="getExceedAttr" resultType="org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr">
|
||||||
|
SELECT
|
||||||
|
a.*
|
||||||
|
FROM
|
||||||
|
st_ivt_structattr a
|
||||||
|
INNER JOIN st_ivt_structattr b ON a.struct_id = b.control_code
|
||||||
|
WHERE
|
||||||
|
a.is_used = '1'
|
||||||
|
and a.lock_type = '0'
|
||||||
|
and IFNULL(a.storagevehicle_code,'') = ''
|
||||||
|
|
||||||
|
and b.is_used = '1'
|
||||||
|
and b.lock_type = '0'
|
||||||
|
and IFNULL(b.storagevehicle_code,'') = ''
|
||||||
|
|
||||||
|
<if test="stor_id != null and stor_id != ''">
|
||||||
|
and a.stor_id = #{stor_id}
|
||||||
|
</if>
|
||||||
|
<if test="sect_id != null and sect_id != ''">
|
||||||
|
and a.sect_id = #{sect_id}
|
||||||
|
</if>
|
||||||
|
<if test="stor_id != null and stor_id != ''">
|
||||||
|
and b.stor_id = #{stor_id}
|
||||||
|
</if>
|
||||||
|
<if test="sect_id != null and sect_id != ''">
|
||||||
|
and b.sect_id = #{sect_id}
|
||||||
|
</if>
|
||||||
|
ORDER BY a.struct_code
|
||||||
|
LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -117,6 +117,11 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StIvtStructattr getExceedAttr(JSONObject jo) {
|
||||||
|
return this.baseMapper.getExceedAttr(jo);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void changeActive(JSONObject form) {
|
public void changeActive(JSONObject form) {
|
||||||
Assert.notNull(form,"请求参数不能为空");
|
Assert.notNull(form,"请求参数不能为空");
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class PointListener extends AbstraceListener<PointEvent> {
|
|||||||
task.put("task_id", task_id);
|
task.put("task_id", task_id);
|
||||||
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
task.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||||
task.put("task_type", event.getType());
|
task.put("task_type", event.getType());
|
||||||
task.put("acs_task_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
|
task.put("acs_task_type", event.getAcs_task_type());
|
||||||
task.put("task_status", TaskStatusEnum.CREATED.getCode());
|
task.put("task_status", TaskStatusEnum.CREATED.getCode());
|
||||||
task.put("point_code1", event.getPoint_code1());
|
task.put("point_code1", event.getPoint_code1());
|
||||||
task.put("point_code2", event.getPoint_code2());
|
task.put("point_code2", event.getPoint_code2());
|
||||||
@@ -43,6 +43,7 @@ public class PointListener extends AbstraceListener<PointEvent> {
|
|||||||
task.put("update_optname", SecurityUtils.getCurrentNickName());
|
task.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||||
task.put("create_time", DateUtil.now());
|
task.put("create_time", DateUtil.now());
|
||||||
task.put("update_time", DateUtil.now());
|
task.put("update_time", DateUtil.now());
|
||||||
|
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
|
||||||
task.put("priority", "1");}
|
task.put("priority", "1");}
|
||||||
taskService.save(task.toJavaObject(SchBaseTask.class));
|
taskService.save(task.toJavaObject(SchBaseTask.class));
|
||||||
return task_id;
|
return task_id;
|
||||||
|
|||||||
@@ -206,8 +206,9 @@ public class SpeEmpTask extends AbstractAcsTask {
|
|||||||
if (!("fall_finish"+task.getTask_id()).equals(device.getRemark())){
|
if (!("fall_finish"+task.getTask_id()).equals(device.getRemark())){
|
||||||
iDeviceService.update(new UpdateWrapper<PdmBiDevice>()
|
iDeviceService.update(new UpdateWrapper<PdmBiDevice>()
|
||||||
.set("material_id", task.getMaterial_id())
|
.set("material_id", task.getMaterial_id())
|
||||||
|
.set("deviceinstor_qty",device.getDeviceinstor_qty().add(task.getMaterial_qty()))
|
||||||
.set("remark","fall_finish"+task.getTask_id())
|
.set("remark","fall_finish"+task.getTask_id())
|
||||||
.eq("device_code", task.getPoint_code2()));
|
.eq("device_code", device.getDevice_code()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -171,34 +171,18 @@ public class SpeFullTask extends AbstractAcsTask {
|
|||||||
.set("update_name","acs")
|
.set("update_name","acs")
|
||||||
.set("update_time",DateUtil.now()).eq("task_id",task.getTask_id()));
|
.set("update_time",DateUtil.now()).eq("task_id",task.getTask_id()));
|
||||||
Map<String, String> extParam = (Map)param.get("ext_param");
|
Map<String, String> extParam = (Map)param.get("ext_param");
|
||||||
//取货完成/放货完成暂不处理箱子
|
//take_finish 取满 fall_finish 倒料 put_finish放空
|
||||||
if (extParam.get("put_finish") != null){
|
|
||||||
log.info("放货完成:{},vechile_code:{}",task.getTask_id(),task.getVehicle_code2());
|
|
||||||
// pointService.update(new UpdateWrapper<SchBasePoint>()
|
|
||||||
// .set("vehicle_code",task.getVehicle_code2())
|
|
||||||
// .eq("point_code",task.getPoint_code3()));
|
|
||||||
|
|
||||||
}
|
|
||||||
if (extParam.get("fall_finish") != null){
|
if (extParam.get("fall_finish") != null){
|
||||||
PdmBiDevice one = deviceService.getOne(new QueryWrapper<PdmBiDevice>().eq("device_code", task.getPoint_code2()));
|
//TODO:添加任务唯一性校验防止重复更新
|
||||||
|
PdmBiDevice one = deviceService.getDeviceByPointCode(task.getPoint_code2());
|
||||||
if (!("fall_finish"+task.getTask_id()).equals(one.getRemark())){
|
if (!("fall_finish"+task.getTask_id()).equals(one.getRemark())){
|
||||||
deviceService.update(new UpdateWrapper<PdmBiDevice>()
|
deviceService.update(new UpdateWrapper<PdmBiDevice>()
|
||||||
.set("material_id", task.getMaterial_id())
|
.set("material_id", task.getMaterial_id())
|
||||||
.set("deviceinstor_qty",one.getDeviceinstor_qty().add(task.getMaterial_qty()))
|
.set("deviceinstor_qty",one.getDeviceinstor_qty().add(task.getMaterial_qty()))
|
||||||
.set("remark","fall_finish"+task.getTask_id())
|
.set("remark","fall_finish"+task.getTask_id())
|
||||||
.eq("device_code", task.getPoint_code2()));
|
.eq("device_code", one.getDevice_code()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (extParam.get("take_finish") != null){
|
|
||||||
log.info("取货完成:{},vechile_code:{}",task.getTask_id(),task.getVehicle_code2());
|
|
||||||
// pointService.update(new UpdateWrapper<SchBasePoint>()
|
|
||||||
// .set("vehicle_code","")
|
|
||||||
// .eq("point_code",task.getPoint_code3()));
|
|
||||||
// pointService.update(new UpdateWrapper<SchBasePoint>()
|
|
||||||
// .set("vehicle_code",task.getVehicle_code2())
|
|
||||||
// .eq("point_code",task.getPoint_code1()));
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case STATUS_FINISH:
|
case STATUS_FINISH:
|
||||||
taskService.update(new UpdateWrapper<SchBaseTask>()
|
taskService.update(new UpdateWrapper<SchBaseTask>()
|
||||||
|
|||||||
@@ -254,12 +254,14 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
|||||||
// 循环获取的数据
|
// 循环获取的数据
|
||||||
List<PdmProduceWorkorder> data = new ArrayList<>();
|
List<PdmProduceWorkorder> data = new ArrayList<>();
|
||||||
Map<String, String> errorMap = new HashMap();
|
Map<String, String> errorMap = new HashMap();
|
||||||
|
|
||||||
|
List<String> workprodures = new ArrayList<>();
|
||||||
|
List<String> materialSpecs = new ArrayList<>();
|
||||||
|
List<String> persons = new ArrayList<>();
|
||||||
row:
|
row:
|
||||||
for (int i = 0; i < read.size(); i++) {
|
for (int i = 0; i < read.size(); i++) {
|
||||||
List<Object> list = read.get(i);
|
List<Object> list = read.get(i);
|
||||||
if (ObjectUtil.isEmpty(list)) {
|
if (ObjectUtil.isEmpty(list)) { continue; }
|
||||||
continue;
|
|
||||||
}
|
|
||||||
PdmProduceWorkorder workorder = new PdmProduceWorkorder();
|
PdmProduceWorkorder workorder = new PdmProduceWorkorder();
|
||||||
packageForm(workorder);
|
packageForm(workorder);
|
||||||
for (int j = 0; j < list.size(); j++) {
|
for (int j = 0; j < list.size(); j++) {
|
||||||
@@ -284,26 +286,12 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
|||||||
}
|
}
|
||||||
if (j == 2) {
|
if (j == 2) {
|
||||||
//物料
|
//物料
|
||||||
List<MdMeMaterialbase> material_specs = materialbaseService.list(new QueryWrapper<MdMeMaterialbase>().eq("material_spec", col));
|
materialSpecs.add(col);
|
||||||
if (CollectionUtils.isEmpty(material_specs)) {
|
workorder.setMaterial_id(col);
|
||||||
errorMap.put("第" + (i + 1) + "行,第" + (j + 1) + "列", col + "物料规格对应物料信息不存在");
|
|
||||||
} else {
|
|
||||||
Optional<MdMeMaterialbase> first = material_specs.stream().filter(mdMeMaterialbase -> mdMeMaterialbase.getMaterial_code().contains("S")
|
|
||||||
&& Pattern.matches("^[0-9]*$", mdMeMaterialbase.getMaterial_name().substring(mdMeMaterialbase.getMaterial_name().length() - 1))
|
|
||||||
).findFirst();
|
|
||||||
if (!first.isPresent()) {
|
|
||||||
errorMap.put("第" + (i + 1) + "行,第" + (j + 1) + "列", col + "物料规格对应物料信息不存在");
|
|
||||||
}
|
|
||||||
workorder.setMaterial_id(first.get().getMaterial_id());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (j == 3) {
|
if (j == 3) {
|
||||||
PdmBiWorkprocedure workprocedure = workprocedureService.getOne(new QueryWrapper<PdmBiWorkprocedure>().eq("workprocedure_name", col));
|
workprodures.add(col);
|
||||||
if (ObjectUtil.isEmpty(workprocedure)) {
|
workorder.setWorkprocedure_id(col);
|
||||||
errorMap.put("第" + (i + 1) + "行,第" + (j + 1) + "列", col + "工序名称是否正确");
|
|
||||||
} else {
|
|
||||||
workorder.setWorkprocedure_id(workprocedure.getWorkprocedure_id());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (j == 4) {
|
if (j == 4) {
|
||||||
//设备 A1_TW_
|
//设备 A1_TW_
|
||||||
@@ -315,13 +303,8 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
|||||||
workorder.setMaterial_weight(bigDecimal.setScale(3, RoundingMode.HALF_UP));
|
workorder.setMaterial_weight(bigDecimal.setScale(3, RoundingMode.HALF_UP));
|
||||||
}
|
}
|
||||||
if (j == 8) {
|
if (j == 8) {
|
||||||
//操作工
|
persons.add(col);
|
||||||
SysUser user = userService.getOne(new QueryWrapper<SysUser>().eq("person_name", col));
|
workorder.setCurrent_produce_person_id(col);
|
||||||
if (ObjectUtil.isEmpty(user)) {
|
|
||||||
errorMap.put("第" + (i + 1) + "行,第" + (j + 1) + "列", col + " 操作工没有账号");
|
|
||||||
} else {
|
|
||||||
workorder.setCurrent_produce_person_id(user.getUser_id());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (j == 9) {
|
if (j == 9) {
|
||||||
workorder.setPlan_qty(new BigDecimal(Long.valueOf(col)));
|
workorder.setPlan_qty(new BigDecimal(Long.valueOf(col)));
|
||||||
@@ -334,7 +317,46 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
|||||||
if (CollectionUtils.isEmpty(errorMap)) {
|
if (CollectionUtils.isEmpty(errorMap)) {
|
||||||
data.add(workorder);
|
data.add(workorder);
|
||||||
}
|
}
|
||||||
;
|
}
|
||||||
|
List<MdMeMaterialbase> tmp_material_specs = materialbaseService.list(new QueryWrapper<MdMeMaterialbase>().in("material_spec", materialSpecs));
|
||||||
|
List<SysUser> tmp_sysUsers = userService.list(new QueryWrapper<SysUser>().in("person_name", persons));
|
||||||
|
List<PdmBiWorkprocedure> tmp_workprocedure_names = workprocedureService.list(new QueryWrapper<PdmBiWorkprocedure>().in("workprocedure_name", workprodures));
|
||||||
|
|
||||||
|
Map<String, PdmBiWorkprocedure> collect = tmp_workprocedure_names.stream().collect(HashMap::new, (k, v) -> k.put(v.getWorkprocedure_name(), v), HashMap::putAll);
|
||||||
|
Map<String, SysUser> users = tmp_sysUsers.stream().collect(HashMap::new, (k, v) -> k.put(v.getPerson_name(), v), HashMap::putAll);
|
||||||
|
Map<String, List<MdMeMaterialbase>> materialspecs = tmp_material_specs.stream().collect(Collectors.groupingBy(MdMeMaterialbase::getMaterial_spec));
|
||||||
|
for (int i = 0; i < data.size(); i++) {
|
||||||
|
PdmProduceWorkorder workorder = data.get(i);
|
||||||
|
SysUser sysUser = users.get(workorder.getCurrent_produce_person_id());
|
||||||
|
if (sysUser==null){
|
||||||
|
errorMap.put("第"+(i+1)+"行:","账号:"+workorder.getCurrent_produce_person_id()+"不存在");
|
||||||
|
}else {
|
||||||
|
workorder.setCurrent_produce_person_id(sysUser.getUser_id());
|
||||||
|
}
|
||||||
|
PdmBiWorkprocedure workprocedure = collect.get(workorder.getWorkprocedure_id());
|
||||||
|
if (workprocedure==null){
|
||||||
|
errorMap.put("第"+(i+1)+"行:","工序名称:"+workorder.getWorkprocedure_id()+"不存在");
|
||||||
|
}else {
|
||||||
|
workorder.setWorkorder_id(workprocedure.getWorkprocedure_id());
|
||||||
|
}
|
||||||
|
List<MdMeMaterialbase> mdMeMaterialbases = materialspecs.get(workorder.getMaterial_id());
|
||||||
|
if (!CollectionUtils.isEmpty(mdMeMaterialbases)){
|
||||||
|
if (mdMeMaterialbases.size() == 1){
|
||||||
|
workorder.setMaterial_id(mdMeMaterialbases.get(0).getMaterial_id());
|
||||||
|
}else {
|
||||||
|
Optional<MdMeMaterialbase> first = mdMeMaterialbases.stream().filter(mdMeMaterialbase -> mdMeMaterialbase.getMaterial_code().contains("S")
|
||||||
|
&& Pattern.matches("^[0-9]*$", mdMeMaterialbase.getMaterial_name().substring(mdMeMaterialbase.getMaterial_name().length() - 1))
|
||||||
|
).findFirst();
|
||||||
|
if (first.isPresent()){
|
||||||
|
workorder.setMaterial_id(first.get().getMaterial_id());
|
||||||
|
}else {
|
||||||
|
errorMap.put("第"+(i+1)+"行:","物料规格:"+workorder.getMaterial_id()+"不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
errorMap.put("第"+(i+1)+"行:","物料规格:"+workorder.getMaterial_id()+"不存在");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty(errorMap)) {
|
if (!CollectionUtils.isEmpty(errorMap)) {
|
||||||
throw new BadRequestException(JSON.toJSONString(errorMap));
|
throw new BadRequestException(JSON.toJSONString(errorMap));
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import java.util.Map;
|
|||||||
public enum IOSEnum {
|
public enum IOSEnum {
|
||||||
//出入库类型
|
//出入库类型
|
||||||
IO_TYPE(MapOf.of("入库", "0", "出库", "1")),
|
IO_TYPE(MapOf.of("入库", "0", "出库", "1")),
|
||||||
|
//是否
|
||||||
|
IS_USED(MapOf.of("是", "1", "否", "0")),
|
||||||
//单据类型
|
//单据类型
|
||||||
BILL_TYPE(MapOf.of("生产入库", "11", "手工入库", "12", "原料入库", "13"
|
BILL_TYPE(MapOf.of("生产入库", "11", "手工入库", "12", "原料入库", "13"
|
||||||
, "领料出库", "21", "销售出库", "22", "手工出库", "23")),
|
, "领料出库", "21", "销售出库", "22", "手工出库", "23")),
|
||||||
@@ -25,7 +27,7 @@ public enum IOSEnum {
|
|||||||
//单据状态
|
//单据状态
|
||||||
WORK_STATUS(MapOf.of("未生成", "00", "生成", "10", "执行中", "20", "完成", "99")),
|
WORK_STATUS(MapOf.of("未生成", "00", "生成", "10", "执行中", "20", "完成", "99")),
|
||||||
//锁定类型
|
//锁定类型
|
||||||
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4")),
|
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4","其他锁","99")),
|
||||||
;
|
;
|
||||||
private Map<String, String> code;
|
private Map<String, String> code;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.storage_manage.productmanage.controller.iostorInv;
|
package org.nl.wms.storage_manage.productmanage.controller.iostorInv;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -141,5 +142,13 @@ public class IStivtlostorivnCpOutController {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/initAttr")
|
||||||
|
@Log("初始化仓位")
|
||||||
|
@ApiOperation("初始化仓位")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> initAttr(){
|
||||||
|
iStIvtIostorinvCpOutService.initAttr();
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,4 +178,9 @@ public interface IStIvtIostorinvCpOutService extends IService<StIvtIostorinvCp>
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
void confirmTask(JSONObject whereJson);
|
void confirmTask(JSONObject whereJson);
|
||||||
|
|
||||||
|
/*
|
||||||
|
初始化仓位
|
||||||
|
*/
|
||||||
|
void initAttr();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleextServic
|
|||||||
import org.nl.wms.masterdata_manage.service.vehicle.IMdPbStoragevehicleinfoService;
|
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.MdPbBucketrecord;
|
||||||
import org.nl.wms.masterdata_manage.service.vehicle.dao.MdPbStoragevehicleext;
|
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.storage.service.storage.IStIvtBsrealstorattrService;
|
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.IStIvtStructattrService;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||||
@@ -385,6 +386,8 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
|
|
||||||
PointEvent event = PointEvent.builder()
|
PointEvent event = PointEvent.builder()
|
||||||
.type(AcsTaskEnum.TASK_STRUCT_CP_OUT.getCode())
|
.type(AcsTaskEnum.TASK_STRUCT_CP_OUT.getCode())
|
||||||
|
.acs_task_type("8")
|
||||||
|
.task_group_id(IdUtil.getStringId())
|
||||||
.point_code1(disDao.getStruct_code())
|
.point_code1(disDao.getStruct_code())
|
||||||
.point_code2(pointDao.getPoint_code())
|
.point_code2(pointDao.getPoint_code())
|
||||||
.vehicle_code(disDao.getStoragevehicle_code())
|
.vehicle_code(disDao.getStoragevehicle_code())
|
||||||
@@ -457,7 +460,7 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
.findAny().get();
|
.findAny().get();
|
||||||
iStIvtStructivtCpService.UpdateIvt(ivtDataParam(dao,ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY,dtlDao.getSource_billdtl_id()));
|
iStIvtStructivtCpService.UpdateIvt(ivtDataParam(dao,ChangeIvtUtil.SUBFROZEN_SUBIVT_QTY,dtlDao.getSource_billdtl_id()));
|
||||||
|
|
||||||
// 3)解锁终点
|
// 3)解锁起点
|
||||||
unLockNext(dao.getStruct_id());
|
unLockNext(dao.getStruct_id());
|
||||||
|
|
||||||
// 4) 更新载具扩展属性
|
// 4) 更新载具扩展属性
|
||||||
@@ -571,7 +574,7 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
mst_jo.put("is_out", true);
|
mst_jo.put("is_out", true);
|
||||||
iostorinvdisCpService.confirm(mst_jo);
|
iostorinvdisCpService.confirm(mst_jo);
|
||||||
|
|
||||||
} else {
|
} else if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
||||||
// 更新任务为执行中
|
// 更新任务为执行中
|
||||||
iSchBaseTaskService.update(
|
iSchBaseTaskService.update(
|
||||||
new UpdateWrapper<SchBaseTask>().lambda()
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
@@ -585,6 +588,11 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
.eq(StIvtIostorinvdisCp::getTask_id, task_id)
|
.eq(StIvtIostorinvdisCp::getTask_id, task_id)
|
||||||
.set(StIvtIostorinvdisCp::getWork_status, IOSEnum.WORK_STATUS.code("执行中"))
|
.set(StIvtIostorinvdisCp::getWork_status, IOSEnum.WORK_STATUS.code("执行中"))
|
||||||
);
|
);
|
||||||
|
} if (status.equals(AcsTaskEnum.STATUS_CANNEL.getCode())) {
|
||||||
|
// 取消任务
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("iostorinvdis_id",disDao.getIostorinvdis_id());
|
||||||
|
delTask(param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,12 +622,11 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
public void sendTask(JSONObject whereJson) {
|
public void sendTask(JSONObject whereJson) {
|
||||||
|
|
||||||
SchBaseTask taskDao = iSchBaseTaskService.getById(whereJson.getString("task_id"));
|
SchBaseTask taskDao = iSchBaseTaskService.getById(whereJson.getString("task_id"));
|
||||||
JSONArray paramArr = new JSONArray();
|
JSONArray param = new JSONArray();
|
||||||
paramArr.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
|
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
|
||||||
|
|
||||||
// 1.下发任务
|
// 1.下发任务
|
||||||
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||||
bean.issueTaskToAcs2(paramArr);
|
bean.issueTaskToAcs3(param);
|
||||||
|
|
||||||
// 2.更新任务状态
|
// 2.更新任务状态
|
||||||
taskDao.setTask_status(TaskStatusEnum.ISSUE.getCode());
|
taskDao.setTask_status(TaskStatusEnum.ISSUE.getCode());
|
||||||
@@ -634,6 +641,45 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
taskOperate(whereJson);
|
taskOperate(whereJson);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void initAttr() {
|
||||||
|
// 总共9排 一排15列 5层 按照成品库区:sect_code: KQ001 sect_name: 成品库区 sect_id: 1528631043496742912
|
||||||
|
for (int i = 1; i < 10; i++) {
|
||||||
|
for (int j = 1; j < 16; j++) {
|
||||||
|
for (int k = 1; k < 6; k++) {
|
||||||
|
StIvtStructattr dao = new StIvtStructattr();
|
||||||
|
dao.setStruct_id(IdUtil.getStringId());
|
||||||
|
if (j<10) {
|
||||||
|
dao.setStruct_code("L0"+i+"-0"+j+"-0"+k);
|
||||||
|
} else {
|
||||||
|
dao.setStruct_code("L0"+i + "-" + j + "-0"+k);
|
||||||
|
}
|
||||||
|
dao.setStruct_name(i+"排"+j+"列"+k+"层");
|
||||||
|
dao.setSimple_name(i+"排"+j+"列"+k+"层");
|
||||||
|
dao.setSect_id("1528631043496742912");
|
||||||
|
dao.setSect_code("KQ001");
|
||||||
|
dao.setSect_name("成品库区");
|
||||||
|
dao.setStor_id("1528627995269533696");
|
||||||
|
dao.setStor_code("F102");
|
||||||
|
dao.setStor_name("紫铜成品仓库");
|
||||||
|
dao.setStor_type("4");
|
||||||
|
dao.setIs_tempstruct(false);
|
||||||
|
dao.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
dao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
dao.setCreate_time(new Date());
|
||||||
|
dao.setIs_used(true);
|
||||||
|
dao.setLock_type("0");
|
||||||
|
dao.setXqty(BigDecimal.valueOf(i));
|
||||||
|
dao.setYqty(BigDecimal.valueOf(j));
|
||||||
|
dao.setZqty(BigDecimal.valueOf(k));
|
||||||
|
dao.setMaterial_height_type("1");
|
||||||
|
iStIvtStructattrService.save(dao);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
|
private StIvtIostorinvCp packageMstForm(StIvtIostorinvCp stIvtIostorinvCp,JSONObject whereJson,Boolean isUpdate) {
|
||||||
JSONArray rows = whereJson.getJSONArray("tableData");
|
JSONArray rows = whereJson.getJSONArray("tableData");
|
||||||
@@ -808,6 +854,21 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
StIvtStructattr attrDao = iStIvtStructattrService.getById(struct_id);
|
StIvtStructattr attrDao = iStIvtStructattrService.getById(struct_id);
|
||||||
if (ObjectUtil.isEmpty(attrDao)) throw new BadRequestException("仓位不存在!");
|
if (ObjectUtil.isEmpty(attrDao)) throw new BadRequestException("仓位不存在!");
|
||||||
|
|
||||||
|
// 判断载具是否超限
|
||||||
|
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getOne(
|
||||||
|
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
|
||||||
|
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, attrDao.getStoragevehicle_code())
|
||||||
|
);
|
||||||
|
|
||||||
|
if (StrUtil.equals(vehicleDao.getOverstruct_type(),IOSEnum.IS_USED.code("是"))) {
|
||||||
|
// 解锁超限货位
|
||||||
|
iStIvtStructattrService.update(
|
||||||
|
new UpdateWrapper<StIvtStructattr>().lambda()
|
||||||
|
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
.eq(StIvtStructattr::getControl_code,attrDao.getStruct_id())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
attrDao.setInv_code("");
|
attrDao.setInv_code("");
|
||||||
attrDao.setInv_type("");
|
attrDao.setInv_type("");
|
||||||
attrDao.setInv_id("");
|
attrDao.setInv_id("");
|
||||||
@@ -816,5 +877,4 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
iStIvtStructattrService.updateById(attrDao);
|
iStIvtStructattrService.updateById(attrDao);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -425,14 +425,23 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
StIvtStructattr attrDao = new StIvtStructattr();
|
StIvtStructattr attrDao = new StIvtStructattr();
|
||||||
|
|
||||||
// 1.根据仓库、库区找出一个仓位
|
// 1.根据仓库、库区找出一个仓位
|
||||||
|
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getById(disDao.getStoragevehicle_id());
|
||||||
if (ObjectUtil.isEmpty(struct_id)) {
|
if (ObjectUtil.isEmpty(struct_id)) {
|
||||||
/* 自动分配 */
|
/* 自动分配 */
|
||||||
|
|
||||||
whereJson.put("rule_type", RuleUtil.PRODUCTION_IN_1);
|
// 判断载具是否超限
|
||||||
|
if (StrUtil.equals(vehicleDao.getOverstruct_type(),IOSEnum.IS_USED.code("是"))) {
|
||||||
|
whereJson.put("rule_type", RuleUtil.PRODUCTION_IN_2);
|
||||||
|
} else {
|
||||||
|
whereJson.put("rule_type", RuleUtil.PRODUCTION_IN_1);
|
||||||
|
}
|
||||||
|
|
||||||
attrDao = divRuleCpService.divRuleIn(whereJson);
|
attrDao = divRuleCpService.divRuleIn(whereJson);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* 手动分配 */
|
/* 手动分配 */
|
||||||
|
if (StrUtil.equals(vehicleDao.getOverstruct_type(),IOSEnum.IS_USED.code("是")))
|
||||||
|
throw new BadRequestException("载具超限请自动分配!");
|
||||||
|
|
||||||
// 查出对应仓位
|
// 查出对应仓位
|
||||||
attrDao = iStIvtStructattrService.getById(struct_id);
|
attrDao = iStIvtStructattrService.getById(struct_id);
|
||||||
@@ -516,6 +525,18 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
.eq(StIvtStructattr::getStruct_code, disDao.getStruct_code())
|
.eq(StIvtStructattr::getStruct_code, disDao.getStruct_code())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 判断载具是否超限
|
||||||
|
MdPbStoragevehicleinfo vehicleDao = iMdPbStoragevehicleinfoService.getById(disDao.getStoragevehicle_id());
|
||||||
|
|
||||||
|
if (StrUtil.equals(vehicleDao.getOverstruct_type(),IOSEnum.IS_USED.code("是"))) {
|
||||||
|
// 解锁超限货位
|
||||||
|
iStIvtStructattrService.update(
|
||||||
|
new UpdateWrapper<StIvtStructattr>().lambda()
|
||||||
|
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
.eq(StIvtStructattr::getControl_code,disDao.getStruct_id())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// 更新库存
|
// 更新库存
|
||||||
iStIvtStructivtCpService.UpdateIvt(ivtDataParam(disDao,ChangeIvtUtil.SUBWAREHOUSING_QTY,null));
|
iStIvtStructivtCpService.UpdateIvt(ivtDataParam(disDao,ChangeIvtUtil.SUBWAREHOUSING_QTY,null));
|
||||||
|
|
||||||
@@ -571,6 +592,8 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
|
|
||||||
PointEvent event = PointEvent.builder()
|
PointEvent event = PointEvent.builder()
|
||||||
.type(AcsTaskEnum.TASK_STRUCT_CP_IN.getCode())
|
.type(AcsTaskEnum.TASK_STRUCT_CP_IN.getCode())
|
||||||
|
.acs_task_type("8")
|
||||||
|
.task_group_id(IdUtil.getStringId())
|
||||||
.point_code2(disDao.getStruct_code())
|
.point_code2(disDao.getStruct_code())
|
||||||
.point_code1(pointDao.getPoint_code())
|
.point_code1(pointDao.getPoint_code())
|
||||||
.vehicle_code(disDao.getStoragevehicle_code())
|
.vehicle_code(disDao.getStoragevehicle_code())
|
||||||
@@ -696,7 +719,7 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
mst_jo.put("is_out", false);
|
mst_jo.put("is_out", false);
|
||||||
iostorinvdisCpService.confirm(mst_jo);
|
iostorinvdisCpService.confirm(mst_jo);
|
||||||
|
|
||||||
} else {
|
} else if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
||||||
// 更新任务为执行中
|
// 更新任务为执行中
|
||||||
iSchBaseTaskService.update(
|
iSchBaseTaskService.update(
|
||||||
new UpdateWrapper<SchBaseTask>().lambda()
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
@@ -709,6 +732,11 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
.eq(StIvtIostorinvdisCp::getTask_id, task_id)
|
.eq(StIvtIostorinvdisCp::getTask_id, task_id)
|
||||||
.set(StIvtIostorinvdisCp::getWork_status, IOSEnum.WORK_STATUS.code("执行中"))
|
.set(StIvtIostorinvdisCp::getWork_status, IOSEnum.WORK_STATUS.code("执行中"))
|
||||||
);
|
);
|
||||||
|
} else if (status.equals(AcsTaskEnum.STATUS_CANNEL.getCode())) {
|
||||||
|
// 取消任务
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("iostorinvdis_id",disDao.getIostorinvdis_id());
|
||||||
|
delTask(param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -736,13 +764,13 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void sendTask(JSONObject whereJson) {
|
public void sendTask(JSONObject whereJson) {
|
||||||
SchBaseTask taskDao = iSchBaseTaskService.getById(whereJson.getString("task_id"));
|
|
||||||
JSONArray paramArr = new JSONArray();
|
|
||||||
paramArr.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
|
|
||||||
|
|
||||||
|
SchBaseTask taskDao = iSchBaseTaskService.getById(whereJson.getString("task_id"));
|
||||||
|
JSONArray param = new JSONArray();
|
||||||
|
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
|
||||||
// 1.下发任务
|
// 1.下发任务
|
||||||
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||||
bean.issueTaskToAcs2(paramArr);
|
bean.issueTaskToAcs3(param);
|
||||||
|
|
||||||
// 2.更新任务状态
|
// 2.更新任务状态
|
||||||
taskDao.setTask_status(TaskStatusEnum.ISSUE.getCode());
|
taskDao.setTask_status(TaskStatusEnum.ISSUE.getCode());
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
dtl.struct_id,
|
dtl.struct_id,
|
||||||
SUM( dtl.mol_qty ) AS total_qty,
|
SUM( dtl.mol_qty ) AS total_qty,
|
||||||
dtl.mol_id,
|
dtl.mol_id,
|
||||||
dtl.bucketunique,
|
MAX(dtl.bucketunique) AS bucketunique,
|
||||||
MAX(dtl.storagevehicle_code) AS storagevehicle_code
|
MAX(dtl.storagevehicle_code) AS storagevehicle_code
|
||||||
FROM
|
FROM
|
||||||
st_ivt_moreorlessdtl_cp dtl
|
st_ivt_moreorlessdtl_cp dtl
|
||||||
|
|||||||
@@ -8,6 +8,12 @@ public class RuleUtil {
|
|||||||
*/
|
*/
|
||||||
public static final String PRODUCTION_IN_1 = "in_1";
|
public static final String PRODUCTION_IN_1 = "in_1";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 入库分配:
|
||||||
|
* 按照仓位顺序找到一个成品仓一层两个货位
|
||||||
|
*/
|
||||||
|
public static final String PRODUCTION_IN_2 = "in_2";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 出库分配:
|
* 出库分配:
|
||||||
* 根据 仓库、库区、物料、销售单找库存
|
* 根据 仓库、库区、物料、销售单找库存
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.nl.wms.storage_manage.productmanage.util.impl;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
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.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||||
@@ -50,13 +51,23 @@ public class DivRuleCpServiceImpl implements DivRuleCpService {
|
|||||||
new QueryWrapper<StIvtStructattr>().lambda()
|
new QueryWrapper<StIvtStructattr>().lambda()
|
||||||
.eq(StIvtStructattr::getStor_id, stor_id)
|
.eq(StIvtStructattr::getStor_id, stor_id)
|
||||||
.eq(StIvtStructattr::getSect_id, sect_id)
|
.eq(StIvtStructattr::getSect_id, sect_id)
|
||||||
.isNull(StIvtStructattr::getStoragevehicle_code)
|
.eq(StIvtStructattr::getIs_used, IOSEnum.IS_USED.code("是"))
|
||||||
.ne(StIvtStructattr::getStoragevehicle_code,"")
|
|
||||||
.eq(StIvtStructattr::getIs_used, "1") //TODO 暂时写死
|
|
||||||
.eq(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
.eq(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
.eq(StIvtStructattr::getStoragevehicle_code,"")
|
||||||
.orderByAsc(StIvtStructattr::getStruct_code)
|
.orderByAsc(StIvtStructattr::getStruct_code)
|
||||||
,false);
|
,false);
|
||||||
break;
|
break;
|
||||||
|
case RuleUtil.PRODUCTION_IN_2 :
|
||||||
|
attrDao = iStIvtStructattrService.getExceedAttr(whereJson);
|
||||||
|
|
||||||
|
// 不为空则锁住对应货位
|
||||||
|
if (ObjectUtil.isNotEmpty(attrDao))
|
||||||
|
iStIvtStructattrService.update(
|
||||||
|
new UpdateWrapper<StIvtStructattr>().lambda()
|
||||||
|
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("其他锁"))
|
||||||
|
.eq(StIvtStructattr::getStruct_id, attrDao.getControl_code())
|
||||||
|
);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return attrDao;
|
return attrDao;
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package org.nl.wms.storage_manage.semimanage.service.iostorInv.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
@@ -19,6 +22,8 @@ import org.nl.common.utils.IdUtil;
|
|||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||||
@@ -26,6 +31,8 @@ import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstora
|
|||||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||||
import org.nl.wms.product_manage.sch.manage.TaskStatusEnum;
|
import org.nl.wms.product_manage.sch.manage.TaskStatusEnum;
|
||||||
|
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
|
||||||
|
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
|
||||||
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||||
import org.nl.wms.storage_manage.IOSEnum;
|
import org.nl.wms.storage_manage.IOSEnum;
|
||||||
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivtflowService;
|
import org.nl.wms.storage_manage.basedata.service.record.service.IStIvtStructivtflowService;
|
||||||
@@ -70,6 +77,8 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
|||||||
private DivRuleCpService divRuleCpService;
|
private DivRuleCpService divRuleCpService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IStIvtSectattrService sectattrService;
|
private IStIvtSectattrService sectattrService;
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseTaskService iSchBaseTaskService; // 任务表服务
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -199,6 +208,7 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
|||||||
|
|
||||||
PointEvent event = PointEvent.builder()
|
PointEvent event = PointEvent.builder()
|
||||||
.type(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND.getCode())
|
.type(CHANGE_BILL_TYPE_ENUM.IOSTORINV_IN_SEND.getCode())
|
||||||
|
.acs_task_type("7")
|
||||||
.point_code1(mst.getPoint_code())
|
.point_code1(mst.getPoint_code())
|
||||||
.point_code2(mst.getStruct_code())
|
.point_code2(mst.getStruct_code())
|
||||||
.vehicle_code(mst.getStoragevehicle_code())
|
.vehicle_code(mst.getStoragevehicle_code())
|
||||||
@@ -213,9 +223,27 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
|||||||
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||||
this.updateById(mst);
|
this.updateById(mst);
|
||||||
|
|
||||||
|
// 下发任务
|
||||||
|
sendTask(mst.getTask_id());
|
||||||
return mst.getTask_id();
|
return mst.getTask_id();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void sendTask(String task_id) {
|
||||||
|
|
||||||
|
SchBaseTask taskDao = iSchBaseTaskService.getById(task_id);
|
||||||
|
JSONArray param = new JSONArray();
|
||||||
|
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
|
||||||
|
// 1.下发任务
|
||||||
|
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||||
|
bean.issueTaskToAcs3(param);
|
||||||
|
|
||||||
|
// 2.更新任务状态
|
||||||
|
taskDao.setTask_status(TaskStatusEnum.ISSUE.getCode());
|
||||||
|
iSchBaseTaskService.updateById(taskDao);
|
||||||
|
}
|
||||||
|
|
||||||
private void checkParam(StIvtIostorinvBcp mst) {
|
private void checkParam(StIvtIostorinvBcp mst) {
|
||||||
if (mst == null || mst.getIs_delete() == true) {
|
if (mst == null || mst.getIs_delete() == true) {
|
||||||
throw new BadRequestException("单据不存在");
|
throw new BadRequestException("单据不存在");
|
||||||
@@ -247,14 +275,48 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
|||||||
String status = form.getString("status");
|
String status = form.getString("status");
|
||||||
StIvtIostorinvBcp mst = this.getOne(new QueryWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id));
|
StIvtIostorinvBcp mst = this.getOne(new QueryWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id));
|
||||||
if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
||||||
|
// 完成
|
||||||
this.update(new UpdateWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id)
|
this.update(new UpdateWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id)
|
||||||
.set(StIvtIostorinvBcp::getWork_status, IOSEnum.WORK_STATUS.code("完成")));
|
.set(StIvtIostorinvBcp::getWork_status, IOSEnum.WORK_STATUS.code("完成")));
|
||||||
JSONObject mst_jo = new JSONObject();
|
JSONObject mst_jo = new JSONObject();
|
||||||
mst_jo.put("iostorinv_id", mst.getIostorinv_id());
|
mst_jo.put("iostorinv_id", mst.getIostorinv_id());
|
||||||
this.confirm(mst_jo);
|
this.confirm(mst_jo);
|
||||||
} else {
|
} else if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
||||||
|
// 执行中
|
||||||
this.update(new UpdateWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id)
|
this.update(new UpdateWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id)
|
||||||
.set(StIvtIostorinvBcp::getWork_status, IOSEnum.WORK_STATUS.code("执行中")));
|
.set(StIvtIostorinvBcp::getWork_status, IOSEnum.WORK_STATUS.code("执行中")));
|
||||||
|
|
||||||
|
// 更新任务
|
||||||
|
iSchBaseTaskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.set(SchBaseTask::getTask_status,TaskStatusEnum.EXECUTING.getCode())
|
||||||
|
.eq(SchBaseTask::getTask_id,task_id )
|
||||||
|
);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 取消
|
||||||
|
delTask(task_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void delTask(String task_id) {
|
||||||
|
|
||||||
|
StIvtIostorinvBcp mstDao = this.getOne(
|
||||||
|
new QueryWrapper<StIvtIostorinvBcp>().lambda()
|
||||||
|
.eq(StIvtIostorinvBcp::getTask_id, task_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 删除任务
|
||||||
|
iSchBaseTaskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode())
|
||||||
|
.eq(SchBaseTask::getTask_id, mstDao.getTask_id())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 更新主表
|
||||||
|
mstDao.setTask_id("");
|
||||||
|
mstDao.setWork_status(IOSEnum.WORK_STATUS.code("未生成"));
|
||||||
|
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||||
|
this.updateById(mstDao);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package org.nl.wms.storage_manage.semimanage.service.iostorInv.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
@@ -19,10 +22,14 @@ import org.nl.common.utils.MapOf;
|
|||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||||
import org.nl.wms.product_manage.sch.manage.TaskStatusEnum;
|
import org.nl.wms.product_manage.sch.manage.TaskStatusEnum;
|
||||||
|
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
|
||||||
|
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
|
||||||
import org.nl.wms.storage_manage.IOSEnum;
|
import org.nl.wms.storage_manage.IOSEnum;
|
||||||
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
import org.nl.wms.storage_manage.CHANGE_BILL_TYPE_ENUM;
|
||||||
import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowDto;
|
import org.nl.wms.storage_manage.basedata.service.record.dto.StIvtStructivtflowDto;
|
||||||
@@ -73,6 +80,8 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
|||||||
private DivRuleCpService divRuleCpService;
|
private DivRuleCpService divRuleCpService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IStIvtSectattrService sectattrService;
|
private IStIvtSectattrService sectattrService;
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseTaskService iSchBaseTaskService; // 任务表服务
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -186,6 +195,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public String confirmTask(JSONObject form) {
|
public String confirmTask(JSONObject form) {
|
||||||
Assert.notNull(new Object[]{form, form.get("iostorinv_id")}, "请求参数不能为空");
|
Assert.notNull(new Object[]{form, form.get("iostorinv_id")}, "请求参数不能为空");
|
||||||
StIvtIostorinvBcp mst = this.getById(form.getString("iostorinv_id"));
|
StIvtIostorinvBcp mst = this.getById(form.getString("iostorinv_id"));
|
||||||
@@ -219,6 +229,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
|||||||
|
|
||||||
PointEvent event = PointEvent.builder()
|
PointEvent event = PointEvent.builder()
|
||||||
.type(AcsTaskEnum.TASK_STRUCT_IN.getCode())
|
.type(AcsTaskEnum.TASK_STRUCT_IN.getCode())
|
||||||
|
.acs_task_type("7")
|
||||||
.point_code1(mst.getPoint_code())
|
.point_code1(mst.getPoint_code())
|
||||||
.point_code2(stIvtStructattr.getStruct_code())
|
.point_code2(stIvtStructattr.getStruct_code())
|
||||||
.vehicle_code(mst.getStoragevehicle_code())
|
.vehicle_code(mst.getStoragevehicle_code())
|
||||||
@@ -233,6 +244,9 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
|||||||
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
mst.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||||
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
mst.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||||
this.updateById(mst);
|
this.updateById(mst);
|
||||||
|
|
||||||
|
// 下发任务
|
||||||
|
sendTask(mst.getTask_id());
|
||||||
return mst.getTask_id();
|
return mst.getTask_id();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,10 +291,65 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
|||||||
//执行中
|
//执行中
|
||||||
this.update(new UpdateWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id)
|
this.update(new UpdateWrapper<StIvtIostorinvBcp>().lambda().eq(StIvtIostorinvBcp::getTask_id, task_id)
|
||||||
.set(StIvtIostorinvBcp::getWork_status, IOSEnum.WORK_STATUS.code("执行中")));
|
.set(StIvtIostorinvBcp::getWork_status, IOSEnum.WORK_STATUS.code("执行中")));
|
||||||
}else {
|
|
||||||
//
|
|
||||||
|
|
||||||
|
// 更新任务
|
||||||
|
iSchBaseTaskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.set(SchBaseTask::getTask_status,TaskStatusEnum.EXECUTING.getCode())
|
||||||
|
.eq(SchBaseTask::getTask_id,task_id )
|
||||||
|
);
|
||||||
|
}else {
|
||||||
|
// 取消
|
||||||
|
delTask(task_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void delTask(String task_id) {
|
||||||
|
|
||||||
|
StIvtIostorinvBcp mstDao = this.getOne(
|
||||||
|
new QueryWrapper<StIvtIostorinvBcp>().lambda()
|
||||||
|
.eq(StIvtIostorinvBcp::getTask_id, task_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 解锁仓位
|
||||||
|
structattrService.update(
|
||||||
|
new UpdateWrapper<StIvtStructattr>().lambda()
|
||||||
|
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
.eq(StIvtStructattr::getStruct_id, mstDao.getStruct_id())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 删除任务
|
||||||
|
iSchBaseTaskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.set(SchBaseTask::getTask_status, TaskStatusEnum.CANCEL.getCode())
|
||||||
|
.eq(SchBaseTask::getTask_id, mstDao.getTask_id())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 更新主表
|
||||||
|
mstDao.setSect_id("");
|
||||||
|
mstDao.setSect_code("");
|
||||||
|
mstDao.setSect_name("");
|
||||||
|
mstDao.setStruct_id("");
|
||||||
|
mstDao.setStruct_code("");
|
||||||
|
mstDao.setStruct_name("");
|
||||||
|
mstDao.setTask_id("");
|
||||||
|
mstDao.setWork_status(IOSEnum.WORK_STATUS.code("未生成"));
|
||||||
|
mstDao.setBill_status(IOSEnum.BILL_STATUS.code("生成"));
|
||||||
|
this.updateById(mstDao);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendTask(String task_id) {
|
||||||
|
|
||||||
|
SchBaseTask taskDao = iSchBaseTaskService.getById(task_id);
|
||||||
|
JSONArray param = new JSONArray();
|
||||||
|
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
|
||||||
|
// 1.下发任务
|
||||||
|
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||||
|
bean.issueTaskToAcs3(param);
|
||||||
|
|
||||||
|
// 2.更新任务状态
|
||||||
|
taskDao.setTask_status(TaskStatusEnum.ISSUE.getCode());
|
||||||
|
iSchBaseTaskService.updateById(taskDao);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ export default {
|
|||||||
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
|
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
|
||||||
this.sects = res.content
|
this.sects = res.content
|
||||||
})
|
})
|
||||||
const area_type = 'A1_RK01'
|
const area_type = 'A1_CPRK01'
|
||||||
crudPoint.getPoint({ 'area_type': area_type }).then(res => {
|
crudPoint.getPoint({ 'area_type': area_type }).then(res => {
|
||||||
this.pointlist = res
|
this.pointlist = res
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ export default {
|
|||||||
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
|
crudSectattr.getSect({ 'stor_id': this.storId }).then(res => {
|
||||||
this.sects = res.content
|
this.sects = res.content
|
||||||
})
|
})
|
||||||
const area_type = 'A1_RK01'
|
const area_type = 'A1_FH01'
|
||||||
crudPoint.getPoint({ 'area_type': area_type }).then(res => {
|
crudPoint.getPoint({ 'area_type': area_type }).then(res => {
|
||||||
this.pointList = res
|
this.pointList = res
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
String ip = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
String ip = paramService.findByCode(AcsConfig.AGVURL).getValue();
|
||||||
int port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT).getValue());
|
int port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT).getValue());
|
||||||
socket = new Socket(ip, port);
|
socket = new Socket(ip, port);
|
||||||
byte[] bytes = new byte[1024];
|
byte[] bytes = new byte[256];
|
||||||
dos = new DataOutputStream(socket.getOutputStream());
|
dos = new DataOutputStream(socket.getOutputStream());
|
||||||
dis = new DataInputStream(socket.getInputStream());
|
dis = new DataInputStream(socket.getInputStream());
|
||||||
int len;
|
int len;
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
socket = new Socket(ip, port);
|
socket = new Socket(ip, port);
|
||||||
dos = new DataOutputStream(socket.getOutputStream());
|
dos = new DataOutputStream(socket.getOutputStream());
|
||||||
dis = new DataInputStream(socket.getInputStream());
|
dis = new DataInputStream(socket.getInputStream());
|
||||||
byte[] bytes = new byte[1024];
|
byte[] bytes = new byte[256];
|
||||||
int count;
|
int count;
|
||||||
int[] arr;
|
int[] arr;
|
||||||
StringBuffer bs;
|
StringBuffer bs;
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ import org.nl.acs.device.service.DeviceService;
|
|||||||
import org.nl.acs.device_driver.DeviceDriver;
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_auto_cache_line.HailiangAutoCacheLineDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_old_special_empty_station.HailiangOldSpecialEmptyStationDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_old_special_full_station.HailiangOldSpecialFullStationDefination;
|
||||||
|
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_old_special_full_station.HailiangOldSpecialFullStationDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_old_special_pour_station.HailiangOldSpecialPourStationDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station.HailiangSpecialEmptyStationDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_empty_station.HailiangSpecialEmptyStationDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station.HailiangSpecialFullStationDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_full_station.HailiangSpecialFullStationDeviceDriver;
|
||||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_special_pour_station.HailiangSpecialPourStationDeviceDriver;
|
||||||
@@ -99,6 +103,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
HailiangSpecialEmptyStationDeviceDriver hailiangSpecialEmptyStationDeviceDriver;
|
HailiangSpecialEmptyStationDeviceDriver hailiangSpecialEmptyStationDeviceDriver;
|
||||||
//海亮专机设备满框位
|
//海亮专机设备满框位
|
||||||
HailiangSpecialFullStationDeviceDriver hailiangSpecialFullStationDeviceDriver;
|
HailiangSpecialFullStationDeviceDriver hailiangSpecialFullStationDeviceDriver;
|
||||||
|
//海亮smart200专机满料位
|
||||||
|
HailiangOldSpecialFullStationDeviceDriver hailiangOldSpecialFullStationDeviceDriver;
|
||||||
|
//海亮smarrt200专机空料位
|
||||||
|
HailiangOldSpecialEmptyStationDeviceDriver hailiangOldSpecialEmptyStationDeviceDriver;
|
||||||
|
//海亮smart200专机倒料位
|
||||||
|
HailiangOldSpecialPourStationDeviceDriver hailiangOldSpecialPourStationDeviceDriver;
|
||||||
//海亮专机设备倒料位
|
//海亮专机设备倒料位
|
||||||
HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver;
|
HailiangSpecialPourStationDeviceDriver hailiangSpecialPourStationDeviceDriver;
|
||||||
//自动缓存线
|
//自动缓存线
|
||||||
@@ -142,6 +152,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
||||||
hailiangSpecialFullStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialFullStationDeviceDriver.set(phase, index, inst);
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialFullStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,到达取货点1,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialFullStationDeviceDriver = (HailiangOldSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialFullStationDeviceDriver.set(phase, index, inst);
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||||
log.info("开始设置phase值,到达出缓存线取满框点1,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,到达出缓存线取满框点1,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -179,6 +194,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
||||||
hailiangSpecialFullStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialFullStationDeviceDriver.set(phase, index, inst);
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialFullStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,取货点1取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialFullStationDeviceDriver = (HailiangOldSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialFullStationDeviceDriver.set(phase, index, inst);
|
||||||
|
}
|
||||||
//入缓存线任务的起点有专机满料位 出缓存的起点是缓存线
|
//入缓存线任务的起点有专机满料位 出缓存的起点是缓存线
|
||||||
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||||
log.info("开始设置phase值,缓存线取满框点1取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,缓存线取满框点1取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
@@ -217,6 +237,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
||||||
hailiangSpecialFullStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialFullStationDeviceDriver.set(phase, index, inst);
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialFullStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,到达取货点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialFullStationDeviceDriver = (HailiangOldSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialFullStationDeviceDriver.set(phase, index, inst);
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||||
log.info("开始设置phase值,到达出缓存线取满框点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,到达出缓存线取满框点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -253,6 +278,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
hailiangSpecialFullStationDeviceDriver = (HailiangSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
||||||
hailiangSpecialFullStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialFullStationDeviceDriver.set(phase, index, inst);
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialFullStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,取货点2取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialFullStationDeviceDriver = (HailiangOldSpecialFullStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialFullStationDeviceDriver.set(phase, index, inst);
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||||
log.info("开始设置phase值,出缓存线取满框点2取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,出缓存线取满框点2取货完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -325,6 +355,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialPourStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,到达倒料点1,设备号:{}", device_code);
|
||||||
|
hailiangOldSpecialPourStationDeviceDriver = (HailiangOldSpecialPourStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialPourStationDeviceDriver.set(phase, index, inst);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
|
||||||
log.info("开始设置phase值,到达倒料点1,设备号:{}", device_code);
|
log.info("开始设置phase值,到达倒料点1,设备号:{}", device_code);
|
||||||
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
|
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -397,6 +433,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialPourStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,倒料点1倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialPourStationDeviceDriver = (HailiangOldSpecialPourStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialPourStationDeviceDriver.set(phase, index, inst);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
|
||||||
log.info("开始设置phase值,倒料点1倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,倒料点1倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
|
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -468,6 +510,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialPourStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,到达倒料点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialPourStationDeviceDriver = (HailiangOldSpecialPourStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialPourStationDeviceDriver.set(phase, index, inst);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
|
||||||
log.info("开始设置phase值,到达倒料点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,到达倒料点2,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
|
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -668,6 +716,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialPourStationDeviceDriver.set(phase, index, inst);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialPourStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,倒料点2倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialPourStationDeviceDriver = (HailiangOldSpecialPourStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialPourStationDeviceDriver.set(phase, index, inst);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangCleaningMachineStorageStationDeviceDriver) {
|
||||||
log.info("开始设置phase值,倒料点2倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,倒料点2倒料完毕,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
|
hailiangCleaningMachineStorageStationDeviceDriver = (HailiangCleaningMachineStorageStationDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -707,6 +761,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
||||||
hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialEmptyStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,到达还空框1,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialEmptyStationDeviceDriver = (HailiangOldSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||||
log.info("开始设置phase值,缓存线出库,还空框1完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,缓存线出库,还空框1完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -745,6 +804,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
||||||
hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialEmptyStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,还空框1完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialEmptyStationDeviceDriver = (HailiangOldSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||||
log.info("开始设置phase值,缓存线出库还空框1完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,缓存线出库还空框1完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -783,6 +847,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
||||||
hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialEmptyStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,到达还空框2,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialEmptyStationDeviceDriver = (HailiangOldSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||||
log.info("开始设置phase值,缓存线出库到达还空框2,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,缓存线出库到达还空框2,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -821,6 +890,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
hailiangSpecialEmptyStationDeviceDriver = (HailiangSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
||||||
hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
hailiangSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof HailiangOldSpecialEmptyStationDeviceDriver) {
|
||||||
|
log.info("开始设置phase值,还空框2完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
|
hailiangOldSpecialEmptyStationDeviceDriver = (HailiangOldSpecialEmptyStationDeviceDriver) device.getDeviceDriver();
|
||||||
|
hailiangOldSpecialEmptyStationDeviceDriver.set(phase, index, inst);
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||||
log.info("开始设置phase值,缓存线出库还空框2完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
log.info("开始设置phase值,缓存线出库还空框2完成,设备号:{},指令号:{}", device_code, inst.getInstruction_code());
|
||||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -853,6 +927,10 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
}
|
}
|
||||||
//1、得到重量信息
|
//1、得到重量信息
|
||||||
int weight = (arr[18] * 256 + arr[19]) * 10;
|
int weight = (arr[18] * 256 + arr[19]) * 10;
|
||||||
|
if (weight < 0) {
|
||||||
|
log.info("AGV上报重量小于0不反馈AGV信息,指令号:{}", ikey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (Instruction inst : insts) {
|
for (Instruction inst : insts) {
|
||||||
//校验agv上报站点编号与指令起始点相同
|
//校验agv上报站点编号与指令起始点相同
|
||||||
if (ObjectUtil.isEmpty(inst)) {
|
if (ObjectUtil.isEmpty(inst)) {
|
||||||
|
|||||||
@@ -134,6 +134,13 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (order_compel_finish != last_order_compel_finish) {
|
if (order_compel_finish != last_order_compel_finish) {
|
||||||
|
if (order_compel_finish == 1) {
|
||||||
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
map.put("to_confirm_finished", "1");
|
||||||
|
map.put("to_clear", "1");
|
||||||
|
map.put("to_order", "0");
|
||||||
|
this.writing(map);
|
||||||
|
}
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号order_compel_finish:" + last_order_compel_finish + "->" + order_compel_finish);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号order_compel_finish:" + last_order_compel_finish + "->" + order_compel_finish);
|
||||||
}
|
}
|
||||||
if (order != last_order) {
|
if (order != last_order) {
|
||||||
@@ -224,7 +231,7 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
//修改工单状态为自动完成
|
//修改工单状态为自动完成
|
||||||
if (mode == 1 && finish != last_finish && finish == 1 && order > 0 && now_order_prod_num == order_prod_allnum) {
|
if (mode == 1 && finish != last_finish && finish == 1 && order_compel_finish != 1 && order > 0 && now_order_prod_num == order_prod_allnum) {
|
||||||
ProduceshiftorderDto pdto = produceshiftorderService.findByCodeFromCache(String.valueOf(order));
|
ProduceshiftorderDto pdto = produceshiftorderService.findByCodeFromCache(String.valueOf(order));
|
||||||
if (pdto != null) {
|
if (pdto != null) {
|
||||||
if (pdto.getOrder_status().equals(WorkerOrderEnum.PRODUCTING.getCode())) {
|
if (pdto.getOrder_status().equals(WorkerOrderEnum.PRODUCTING.getCode())) {
|
||||||
@@ -310,8 +317,9 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
// if (!this.getItemProtocol().getIsonline()) {
|
// if (!this.getItemProtocol().getIsonline()) {
|
||||||
// throw new BadRequestException("设备未开机,开工失败!");
|
// throw new BadRequestException("设备未开机,开工失败!");
|
||||||
// }
|
// }
|
||||||
|
this.writing("to_clear", "1");
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
map.put("to_clear", "1");
|
//map.put("to_clear", "1");
|
||||||
map.put("to_order", dto.getOrder_code());
|
map.put("to_order", dto.getOrder_code());
|
||||||
map.put("to_one_box_num", String.valueOf(dto.getOne_qty()));
|
map.put("to_one_box_num", String.valueOf(dto.getOne_qty()));
|
||||||
map.put("to_order_prod_num", dto.getQty().toString());
|
map.put("to_order_prod_num", dto.getQty().toString());
|
||||||
@@ -327,12 +335,12 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
|
if (StrUtil.equals(autoFinish, WorkerOrderEnum.FORCEFINISH.getCode())) {
|
||||||
map.put("to_order_compel_finished", "1");
|
map.put("to_order_compel_finished", "1");
|
||||||
map.put("to_confirm_finished", "1");
|
//map.put("to_confirm_finished", "1");
|
||||||
} else {
|
} else {
|
||||||
map.put("to_confirm_finished", "1");
|
map.put("to_confirm_finished", "1");
|
||||||
|
map.put("to_order", "0");
|
||||||
|
map.put("to_clear", "1");
|
||||||
}
|
}
|
||||||
map.put("to_order", "0");
|
|
||||||
map.put("to_clear", "1");
|
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
|
|||||||
if (agvphase == 0x0D || agvphase == 0x11) {
|
if (agvphase == 0x0D || agvphase == 0x11) {
|
||||||
if (mode == 1 && ObjectUtil.isNotEmpty(inst)) {
|
if (mode == 1 && ObjectUtil.isNotEmpty(inst)) {
|
||||||
//下发倒料数量
|
//下发倒料数量
|
||||||
this.writing("item_to_pour_num", inst.getQuantity());
|
this.writing("to_pour_num", inst.getQuantity());
|
||||||
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode());
|
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode());
|
||||||
instructionService.update(inst);
|
instructionService.update(inst);
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
|
|||||||
@@ -297,8 +297,9 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
// if (!this.getItemProtocol().getIsonline()) {
|
// if (!this.getItemProtocol().getIsonline()) {
|
||||||
// throw new BadRequestException("设备未开机,开工失败!");
|
// throw new BadRequestException("设备未开机,开工失败!");
|
||||||
// }
|
// }
|
||||||
|
this.writing("to_clear", "1");
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
map.put("to_clear", "1");
|
//map.put("to_clear", "1");
|
||||||
map.put("to_order", dto.getOrder_code());
|
map.put("to_order", dto.getOrder_code());
|
||||||
map.put("to_one_box_num", String.valueOf(dto.getOne_qty()));
|
map.put("to_one_box_num", String.valueOf(dto.getOne_qty()));
|
||||||
map.put("to_order_prod_num", dto.getQty().toString());
|
map.put("to_order_prod_num", dto.getQty().toString());
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
|||||||
message = "未联机";
|
message = "未联机";
|
||||||
//有报警
|
//有报警
|
||||||
} else {
|
} else {
|
||||||
this.setIsonline(true);
|
//this.setIsonline(true);
|
||||||
this.setIserror(false);
|
this.setIserror(false);
|
||||||
message = "";
|
message = "";
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
|||||||
if (agvphase == 0x0D || agvphase == 0x11) {
|
if (agvphase == 0x0D || agvphase == 0x11) {
|
||||||
//下发电气倒料数量
|
//下发电气倒料数量
|
||||||
if (mode == 1 && ObjectUtil.isNotEmpty(inst)) {
|
if (mode == 1 && ObjectUtil.isNotEmpty(inst)) {
|
||||||
this.writing("item_to_pour_num", inst.getQuantity());
|
this.writing("to_pour_num", inst.getQuantity());
|
||||||
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode());
|
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_FALL_SEND_FULL_FINISH.getCode());
|
||||||
instructionService.update(inst);
|
instructionService.update(inst);
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
.header("Authorization", token)
|
.header("Authorization", token)
|
||||||
.body(JSON.toJSONString(param))
|
.body(JSON.toJSONString(param))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向wms请求任务成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result));
|
log.info("acs向wms请求任务成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), result.body());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向wms请求任务失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage());
|
log.error("acs向wms请求任务失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -64,10 +64,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse feedbackTaskStatusToWms(JSONArray data) {
|
public HttpResponse feedbackTaskStatusToWms(JSONArray data) {
|
||||||
log.info("acs开始向mes反馈任务状态,请求参数:{}", JSON.toJSONString(data));
|
|
||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
log.info("acs开始向mes反馈任务状态,请求参数:{}", JSON.toJSONString(data));
|
||||||
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms");
|
AddressDto addressDto = addressService.findByCode("feedbackTaskStatusToWms");
|
||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
@@ -78,7 +78,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
.header("Authorization", token)
|
.header("Authorization", token)
|
||||||
.body(JSON.toJSONString(data))
|
.body(JSON.toJSONString(data))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向mes反馈任务状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(data), JSON.toJSONString(result));
|
log.info("acs向mes反馈任务状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(data), result.body());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向mes反馈任务状态失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(data), e.getMessage());
|
log.error("acs向mes反馈任务状态失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(data), e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -93,10 +93,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse feedbackOrderStatus(JSONObject param) {
|
public HttpResponse feedbackOrderStatus(JSONObject param) {
|
||||||
log.info("acs开始向mes反馈工单状态,请求参数:{}", JSON.toJSONString(param));
|
|
||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
log.info("acs开始向mes反馈工单状态,请求参数:{}", JSON.toJSONString(param));
|
||||||
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
AddressDto addressDto = addressService.findByCode("feedbackOrderStatus");
|
AddressDto addressDto = addressService.findByCode("feedbackOrderStatus");
|
||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
@@ -106,7 +106,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(JSON.toJSONString(param))
|
.body(JSON.toJSONString(param))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向mes反馈工单状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result.body()));
|
log.info("acs向mes反馈工单状态成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), result.body());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向mes反馈工单状态失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage());
|
log.error("acs向mes反馈工单状态失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(JSON.toJSONString(param))
|
.body(JSON.toJSONString(param))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向mes反馈设备状态成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, JSON.toJSONString(result));
|
log.info("acs向mes反馈设备状态成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, result.body());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向mes反馈设备状态失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(param), url, e.getMessage());
|
log.error("acs向mes反馈设备状态失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(param), url, e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
log.info("acs开始向mes反馈当前设备工单生产数量,请求参数:{}", JSON.toJSONString(param));
|
//log.info("acs开始向mes反馈当前设备工单生产数量,请求参数:{}", JSON.toJSONString(param));
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
AddressDto addressDto = addressService.findByCode("feedOrderRealQty");
|
AddressDto addressDto = addressService.findByCode("feedOrderRealQty");
|
||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
@@ -162,7 +162,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
.post(url)
|
.post(url)
|
||||||
.body(JSON.toJSONString(param))
|
.body(JSON.toJSONString(param))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向mes反馈当前设备工单生产数量成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result));
|
//log.info("acs向mes反馈当前设备工单生产数量成功,请求路径:{},请求参数:{},响应参数:{}", url, JSON.toJSONString(param), JSON.toJSONString(result));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向mes反馈当前设备工单生产数量失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage());
|
log.error("acs向mes反馈当前设备工单生产数量失败,请求路径:{},请求参数:{},失败原因:{}", url, JSON.toJSONString(param), e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
log.info("acs开始向mes反馈设备数量,请求参数:{}", JSON.toJSONString(map));
|
//log.info("acs开始向mes反馈设备数量,请求参数:{}", JSON.toJSONString(map));
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
AddressDto addressDto = addressService.findByCode("feedDeviceNum");
|
AddressDto addressDto = addressService.findByCode("feedDeviceNum");
|
||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
@@ -189,7 +189,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(JSON.toJSONString(map))
|
.body(JSON.toJSONString(map))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向mes反馈设备设备数量成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result));
|
//log.info("acs向mes反馈设备设备数量成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向mes反馈设备数量失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage());
|
log.error("acs向mes反馈设备数量失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -206,7 +206,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
log.info("acs开始向mes反馈储料仓重量和数量,请求参数:{}", JSON.toJSONString(map));
|
//log.info("acs开始向mes反馈储料仓重量和数量,请求参数:{}", JSON.toJSONString(map));
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
AddressDto addressDto = addressService.findByCode("feedDeviceNum2");
|
AddressDto addressDto = addressService.findByCode("feedDeviceNum2");
|
||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
@@ -216,7 +216,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(JSON.toJSONString(map))
|
.body(JSON.toJSONString(map))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向mes反馈储料仓重量和数量成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result));
|
//log.info("acs向mes反馈储料仓重量和数量成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向mes反馈储料仓重量和数量失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage());
|
log.error("acs向mes反馈储料仓重量和数量失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -243,7 +243,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(JSON.toJSONString(map))
|
.body(JSON.toJSONString(map))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向mes申请扫码器任务成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result));
|
log.info("acs向mes申请扫码器任务成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, result.body());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向mes申请扫码器任务失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage());
|
log.error("acs向mes申请扫码器任务失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -260,7 +260,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
log.info("acs开始向mes反馈缓存线条码,请求参数:{}", JSON.toJSONString(map));
|
//log.info("acs开始向mes反馈缓存线条码,请求参数:{}", JSON.toJSONString(map));
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
AddressDto addressDto = addressService.findByCode("feedCacheLineBarcodes");
|
AddressDto addressDto = addressService.findByCode("feedCacheLineBarcodes");
|
||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
@@ -270,7 +270,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(JSON.toJSONString(map))
|
.body(JSON.toJSONString(map))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向mes反馈缓存线条码成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result));
|
//log.info("acs向mes反馈缓存线条码成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(map), url, JSON.toJSONString(result));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向mes反馈缓存线条码失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage());
|
log.error("acs向mes反馈缓存线条码失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(map), url, e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
MDC.put(log_file_type, log_type);
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
log.info("acs开始向mes反馈缓存线任务号,请求参数:{}", JSON.toJSONString(param));
|
//log.info("acs开始向mes反馈缓存线任务号,请求参数:{}", JSON.toJSONString(param));
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
AddressDto addressDto = addressService.findByCode("feedCacheLineTask");
|
AddressDto addressDto = addressService.findByCode("feedCacheLineTask");
|
||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
@@ -297,7 +297,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(JSON.toJSONString(param))
|
.body(JSON.toJSONString(param))
|
||||||
.execute();
|
.execute();
|
||||||
log.info("acs向mes反馈缓存线任务号成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, JSON.toJSONString(result));
|
//log.info("acs向mes反馈缓存线任务号成功,请求参数:{},请求路径:{},响应参数:{}", JSON.toJSONString(param), url, JSON.toJSONString(result));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("acs向mes反馈缓存线任务号失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(param), url, e.getMessage());
|
log.error("acs向mes反馈缓存线任务号失败,请求参数:{},请求路径:{},失败原因:{}", JSON.toJSONString(param), url, e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
if (StrUtil.isEmpty(task_group_id)) {
|
if (StrUtil.isEmpty(task_group_id)) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("task_id", task_id);
|
json.put("task_id", task_id);
|
||||||
json.put("message", "任务关联编号");
|
json.put("message", "任务关联编号不能为空");
|
||||||
errArr.add(json);
|
errArr.add(json);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
resultJson.put("status", 400);
|
resultJson.put("status", 400);
|
||||||
}
|
}
|
||||||
resultJson.put("errArr", errArr);
|
resultJson.put("errArr", errArr);
|
||||||
resultJson.put("message", errArr.size() > 0 ? "存在下发未成功的任务!" : "下发成功!");
|
resultJson.put("message", errArr.size() > 0 ? "存在下发未成功的任务!" + JSON.toJSONString(errArr) : "下发成功!");
|
||||||
resultJson.put("data", new JSONObject());
|
resultJson.put("data", new JSONObject());
|
||||||
log.info("createFromWms--------------:输出参数:" + resultJson.toString());
|
log.info("createFromWms--------------:输出参数:" + resultJson.toString());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -711,7 +711,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
if (code.equals("to_start_checking")) {
|
if (code.equals("to_start_checking")) {
|
||||||
hailiangAutoCacheLineDeviceDriver.writing("to_task", "1001");
|
hailiangAutoCacheLineDeviceDriver.writing("to_task", "1001");
|
||||||
}
|
}
|
||||||
if (code.equals("to_check_finish")){
|
if (code.equals("to_check_finish")) {
|
||||||
hailiangAutoCacheLineDeviceDriver.writing("to_task", "0");
|
hailiangAutoCacheLineDeviceDriver.writing("to_task", "0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1448,7 +1448,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if (next_device != null && next_device.getDeviceDriver() instanceof RemoveDevicePhase) {
|
if (next_device != null && next_device.getDeviceDriver() instanceof RemoveDevicePhase) {
|
||||||
removeDevicePhase = (RemoveDevicePhase) put_device.getDeviceDriver();
|
removeDevicePhase = (RemoveDevicePhase) next_device.getDeviceDriver();
|
||||||
removeDevicePhase.set(0, 0, null);
|
removeDevicePhase.set(0, 0, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user