no message

This commit is contained in:
18188916393
2022-08-25 17:32:40 +08:00
parent 8cc98575cd
commit 5014df9aed
10 changed files with 533 additions and 3 deletions

View File

@@ -2,6 +2,8 @@
package org.nl.wms.ext.acs.rest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -115,4 +117,11 @@ public class AcsToWmsController {
public ResponseEntity<Object> receiveAgvStatus(@RequestBody Map whereJson ) {
return new ResponseEntity<>(acsToWmsService.receiveAgvStatus( whereJson), HttpStatus.OK);
}
@PostMapping("/queryCribbingInfo")
@Log("获取木托盘垛形信息")
@ApiOperation("获取木托盘垛形信息")
public ResponseEntity<Object> queryCribbingInfo(@RequestBody Map whereJson) {
return new ResponseEntity<>(acsToWmsService.queryCribbingInfo(whereJson), HttpStatus.OK);
}
}

View File

@@ -4,7 +4,6 @@ package org.nl.wms.ext.acs.rest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -73,4 +72,6 @@ public class WmsToAcsController {
}
}

View File

@@ -109,5 +109,10 @@ public interface AcsToWmsService {
* @return Map<String, Object>
*/
Map<String, Object> receiveAgvStatus(Map jsonObject);
/**
* 获取垛形参数
* @return Map<String, Object>
*/
Map<String, Object> queryCribbingInfo(Map jsonObject);
}

View File

@@ -713,7 +713,45 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public Map<String, Object> receiveAgvStatus(Map jsonObject) {
return null;
WQLObject deviceStatus_table = WQLObject.getWQLObject("st_buss_deviceStatus");
String agv_no = (String) jsonObject.get("agv_no");
String status = (String) jsonObject.get("status");
JSONObject statsObj = deviceStatus_table.query("device_type ='1' and device_code ='" + agv_no + "'").uniqueResult(0);
statsObj.put("device_status", status);
statsObj.put("update_time", DateUtil.now());
deviceStatus_table.update(statsObj);
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "任务状态反馈成功!");
result.put("data", new JSONObject());
return result;
}
@Override
public Map<String, Object> queryCribbingInfo(Map jsonObject) {
String device_code = (String) jsonObject.get("device_code");
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
JSONObject produceInfoByCode = this.getProduceInfoByCode(device_code);
//根据点位获取排产单
String material_id = produceInfoByCode.getString("material_id");
String vehicle_code = pointTable.query("point_code = '" + device_code + "'").uniqueResult(0).getString("vehicle_code");
JSONObject result = new JSONObject();
WQLObject CribbingInfo_Table = WQLObject.getWQLObject("MD_ME_CribbingInfo");
WQLObject group_table = WQLObject.getWQLObject("st_buss_vehiclegroup");
if (StrUtil.isEmpty(vehicle_code)) {
//从基础表里去获取
result = CribbingInfo_Table.query("material_id = '" + material_id + "'").uniqueResult(0);
} else {
//从组盘表里面去获取
result = group_table.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
}
JSONObject returnjo = new JSONObject();
returnjo.put("status", HttpStatus.OK.value());
returnjo.put("message", "任务状态反馈成功!");
returnjo.put("data", result);
return returnjo;
}
private JSONObject getProduceInfoByCode(String code) {

View File

@@ -0,0 +1,132 @@
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
package org.nl.wms.pda.ruleSetting.rest;
=======
package org.nl.wms.pda.outstruct.rest;
>>>>>>> Stashed changes
=======
package org.nl.wms.pda.outstruct.rest;
>>>>>>> Stashed changes
=======
package org.nl.wms.pda.outstruct.rest;
>>>>>>> Stashed changes
=======
package org.nl.wms.pda.outstruct.rest;
>>>>>>> Stashed changes
=======
package org.nl.wms.pda.ruleSetting.rest;
>>>>>>> Stashed changes
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.annotation.Log;
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
import org.nl.wms.pda.ruleSetting.service.PdaRuleSettingService;
=======
import org.nl.wms.pda.outstruct.service.OutStructService;
>>>>>>> Stashed changes
=======
import org.nl.wms.pda.outstruct.service.OutStructService;
>>>>>>> Stashed changes
=======
import org.nl.wms.pda.outstruct.service.OutStructService;
>>>>>>> Stashed changes
=======
import org.nl.wms.pda.outstruct.service.OutStructService;
>>>>>>> Stashed changes
=======
import org.nl.wms.pda.ruleSetting.service.PdaRuleSettingService;
>>>>>>> Stashed changes
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @author ldjun
* @date 2021-07-26
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "手持托盘入窑贵州")
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
=======
>>>>>>> Stashed changes
@RequestMapping("/api/pda/ruleSetting")
@Slf4j
public class PdaRuleSettingController {
private final PdaRuleSettingService pdaBindingService;
@PostMapping("/queryInfo")
@Log("查询规则信息")
@ApiOperation("查询规则信息")
public ResponseEntity<Object> queryInfo(@RequestBody Map<String, String> param) {
return new ResponseEntity<>(pdaBindingService.queryInfo(param), HttpStatus.OK);
}
@PostMapping("/confirm")
@Log("规则确定")
@ApiOperation("规则确定")
public ResponseEntity<Object> Confirm(@RequestBody JSONObject param) {
return new ResponseEntity<>(pdaBindingService.Confirm(param), HttpStatus.OK);
<<<<<<< Updated upstream
=======
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
@RequestMapping("/api/pda/outStruct")
@Slf4j
public class OutStructController {
private final OutStructService outStructService;
@PostMapping("/queryInfoBycode")
@Log("根据托盘号查询库存信息")
@ApiOperation("根据托盘号查询库存信息")
public ResponseEntity<Object> queryInfoBycode(@RequestBody Map<String, String> param) {
return new ResponseEntity<>(outStructService.queryInfoBycode(param), HttpStatus.OK);
}
@PostMapping("/confirm")
@Log("出库确定")
@ApiOperation("出库确定")
public ResponseEntity<Object> Confirm(@RequestBody JSONObject param) {
return new ResponseEntity<>(outStructService.Confirm(param), HttpStatus.OK);
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
}
}

View File

@@ -0,0 +1,54 @@
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
=======
>>>>>>> Stashed changes
package org.nl.wms.pda.ruleSetting.service;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.Map;
public interface PdaRuleSettingService {
Map<String, Object> queryInfo(Map<String,String> jsonObject);
/**
* 盘点单确认
<<<<<<< Updated upstream
=======
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
package org.nl.wms.pda.outstruct.service;
import com.alibaba.fastjson.JSONObject;
import java.util.Map;
public interface OutStructService {
Map<String, Object> queryInfoBycode(Map<String,String> jsonObject);
/**
* 出库确定
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
* @param param 条件
* @return Map<String,Object>
*
*/
Map<String, Object> Confirm( JSONObject param);
}

View File

@@ -0,0 +1,269 @@
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
package org.nl.wms.pda.ruleSetting.service.impl;
=======
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
package org.nl.wms.pda.outstruct.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
package org.nl.wms.pda.ruleSetting.service.impl;
>>>>>>> Stashed changes
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
=======
>>>>>>> Stashed changes
import org.nl.modules.system.service.UserService;
import org.nl.wms.database.service.MaterialService;
import org.nl.wms.pda.exception.PdaRequestException;
import org.nl.wms.pda.ruleSetting.service.PdaRuleSettingService;
import org.nl.wql.core.bean.WQLObject;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
<<<<<<< Updated upstream
=======
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
import org.nl.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil;
import org.nl.utils.SecurityUtils;
import org.nl.wms.WorkProcedureEnum;
import org.nl.wms.pda.outstruct.service.OutStructService;
import org.nl.wms.sch.manage.AreaEnum;
import org.nl.wms.sch.manage.BillTypeEnum;
import org.nl.wms.st.ivt.IvtChangeTypeEnum;
import org.nl.wms.st.ivt.StoreIvtServiceImpl;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import org.springframework.stereotype.Service;
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
import java.util.Map;
@Service
@RequiredArgsConstructor
@Slf4j
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
=======
>>>>>>> Stashed changes
public class PdaRuleSettingServiceImpl implements PdaRuleSettingService {
@Override
public Map<String, Object> queryInfo(Map<String, String> jsonObject) {
String mode = jsonObject.get("mode");
//1 为入 2 为出
JSONArray arr = new JSONArray();
JSONObject infojo = new JSONObject();
//1 启用 0 停用
String is_used = "";
if (StrUtil.equals("1", mode)) {
arr = WQLObject.getWQLObject("st_rule_cacheline").query("1=1", "in_seq_no ").getResultJSONArray(0);
is_used = WQLObject.getWQLObject("sys_param").query("code='is_inrule'").uniqueResult(0).getString("value");
} else {
arr = WQLObject.getWQLObject("st_rule_cacheline").query("1=1", "out_seq_no ").getResultJSONArray(0);
is_used = WQLObject.getWQLObject("sys_param").query("code='is_outrule'").uniqueResult(0).getString("value");
}
infojo.put("is_used", is_used);
infojo.put("JSONArray", arr);
JSONObject returnjo = new JSONObject();
returnjo.put("code", "1");
returnjo.put("desc", "查询成功!");
returnjo.put("result", infojo);
<<<<<<< Updated upstream
=======
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
public class OutStructServiceImpl implements OutStructService {
@Override
public Map<String, Object> queryInfoBycode(Map<String, String> jsonObject) {
String vehicle_code = jsonObject.get("vehicle_code");
if (StrUtil.isEmpty(vehicle_code)) {
throw new BadRequestException("托盘号不能为空!");
}
JSONObject resutl = WQL.getWO("QPADSERVICE").addParam("flag", "17").process().uniqueResult(0);
JSONObject returnjo = new JSONObject();
returnjo.put("code", "1");
returnjo.put("desc", "查询成功!");
returnjo.put("result", resutl);
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
return returnjo;
}
@Override
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
=======
>>>>>>> Stashed changes
public Map<String, Object> Confirm( JSONObject param) {
String mode =(String) param.get("mode");
String is_used = (String)param.get("is_used");
JSONArray arr = param.getJSONArray("JSONArray");
WQLObject paramTable = WQLObject.getWQLObject("sys_param");
WQLObject ruleTable = WQLObject.getWQLObject("st_rule_cacheline");
if (StrUtil.equals(mode, "1")) {
JSONObject paramObj = paramTable.query("code='is_inrule'").uniqueResult(0);
paramObj.put("value", is_used);
paramTable.update(paramObj);
for (int i = 0; i < arr.size(); i++) {
JSONObject joo = arr.getJSONObject(i);
joo.put("in_seq_no",i);
ruleTable.update(joo);
}
} else {
JSONObject paramObj = paramTable.query("code='is_outrule'").uniqueResult(0);
paramObj.put("value", is_used);
paramTable.update(paramObj);
for (int i = 0; i < arr.size(); i++) {
JSONObject joo = arr.getJSONObject(i);
joo.put("out_seq_no",i);
ruleTable.update(joo);
}
}
<<<<<<< Updated upstream
=======
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
public Map<String, Object> Confirm(JSONObject param) {
String point_id = param.getString("point_id");
String point_code = param.getString("point_code");
String lock_type = WQLObject.getWQLObject("sch_base_point").query("point_id='" + point_id + "'").uniqueResult(0).getString("lock_type");
if (StrUtil.equals(lock_type, "01")) {
throw new BadRequestException("点位为'" + point_code + "'已锁定,不能出库");
}
WQLObject ivtTable = WQLObject.getWQLObject("st_ivt_structivt");
JSONObject ivtObj = ivtTable.query("struct_id = '" + point_id + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(ivtObj)){
throw new BadRequestException("未找到库存信息");
}
//创建人工出库单据
//创建出库单据
JSONObject iosObj = new JSONObject();
String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
iosObj.put("iostorinv_id", iostorinv_id);
iosObj.put("bill_code", CodeUtil.getNewCode("OUT_STORE_CODE"));
iosObj.put("io_type", "1");
iosObj.put("bill_type", BillTypeEnum.FJCK.getCode());
iosObj.put("workprocedure_id", WorkProcedureEnum.FJGX.getId());
iosObj.put("ivt_workprocedure_id", ivtObj.getString("workprocedure_id"));
iosObj.put("material_id", ivtObj.getString("material_id"));
iosObj.put("vehicle_code", ivtObj.getString("vehicle_code"));
iosObj.put("producetask_id", ivtObj.getString("producetask_id"));
iosObj.put("qty",ivtObj.getString("canuse_qty") );
//默认是完成分配状态
iosObj.put("bill_status", "50");
iosObj.put("start_point_code", point_code);
iosObj.put("end_point_code", "");
iosObj.put("start_area", AreaEnum.CYHCHJ.getCode());
iosObj.put("end_area", "");
iosObj.put("create_mode", "01");
iosObj.put("task_id", "");
iosObj.put("remark", "手持人工出库!");
iosObj.put("create_id", SecurityUtils.getCurrentUserId());
iosObj.put("create_name", SecurityUtils.getNickName());
iosObj.put("create_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_workProcedureIOS").insert(iosObj);
//清除库存
StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
param.put("material_id", ivtObj.getString("material_id"));
param.put("bill_id", iostorinv_id);
param.put("change_qty", ivtObj.getString("canuse_qty"));
param.put("vehicle_code", ivtObj.getString("vehicle_code"));
param.put("workprocedure_id", ivtObj.getString("ivt_workprocedure_id"));
param.put("struct_id",point_id);
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_IVT_AND_CAN_USE);
<<<<<<< Updated upstream
<<<<<<< Updated upstream
<<<<<<< Updated upstream
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
=======
>>>>>>> Stashed changes
JSONObject returnjo = new JSONObject();
returnjo.put("code", "1");
returnjo.put("desc", "操作成功!");
return returnjo;
}
}

View File

@@ -409,5 +409,27 @@ IF 输入.flag = "16"
ENDQUERY
ENDIF
IF 输入.flag = "17"
QUERY
SELECT
ivt.canuse_qty,
ivt.vehicle_code,
point.point_id,
point.point_code,
point.point_name,
task.producetask_code
FROM
st_ivt_structivt ivt
LEFT JOIN sch_base_point point ON point.point_id = ivt.struct_id
LEFT JOIN st_buss_vehiclegroup vehiclegroup ON vehiclegroup.vehicle_code = ivt.vehicle_code
LEFT JOIN pdm_mg_producetask task ON task.producetask_id = vehiclegroup.producetask_id
WHERE
1 =1
and area_type ='02'
OPTION 输入.vehicle_code <> ""
ivt.vehicle_code = 输入.vehicle_code
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF