Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -2,6 +2,8 @@ package org.nl.acs.device_driver;
|
||||
|
||||
import org.nl.acs.opc.Device;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DeviceDriver {
|
||||
default String getDeviceCode() {
|
||||
return this.getDevice().getDevice_code();
|
||||
@@ -17,4 +19,5 @@ public interface DeviceDriver {
|
||||
return this.getDriverDefination().getDriverCode();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -123,5 +123,10 @@ public class ItemProtocol {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -230,11 +231,11 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
// } else if (error != 0) {
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
// message = "有报警";
|
||||
// //无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
@@ -421,18 +422,24 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
}
|
||||
|
||||
// public void writing(int type, int command) {
|
||||
// String to_material_code = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
// + "." + ItemProtocol.item_to_material_code;
|
||||
// String opcservcerid = this.getDevice().getOpc_server_id();
|
||||
// Server server = ReadUtil.getServer(opcservcerid);
|
||||
// Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
// if (type == 2) {
|
||||
// itemMap.put(to_material_code, command);
|
||||
// }
|
||||
// ReadUtil.write(itemMap, server);
|
||||
//
|
||||
// }
|
||||
public void writing(List list) {
|
||||
|
||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Object ob = list.get(i);
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(ob);
|
||||
if (!StrUtil.isEmpty(json.getString("value"))) {
|
||||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
+ "." + json.getString("code");
|
||||
itemMap.put(to_param, json.getString("value"));
|
||||
}
|
||||
}
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||
ReadUtil.write(itemMap, server);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -525,12 +532,42 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
taskserver.update(task);
|
||||
requireSucess = true;
|
||||
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
||||
this.writing("to_target", next_addr);
|
||||
this.writing("to_task", instdto.getInstruction_code());
|
||||
this.writing("to_command", "1");
|
||||
this.writing("to_task", instdto.getInstruction_code());
|
||||
this.writing("to_target", next_addr);
|
||||
this.writing("to_command", "1");
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code","to_target");
|
||||
map.put("value",next_addr);
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code","to_task");
|
||||
map2.put("value",instdto.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
|
||||
} else {
|
||||
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
|
||||
Device nextdevice = deviceAppservice.findDeviceByCode(inst.getNext_device_code());
|
||||
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code","to_target");
|
||||
map.put("value",next_addr);
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code","to_task");
|
||||
map2.put("value",inst.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -598,4 +635,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -114,5 +114,11 @@ public class ItemProtocol {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
@@ -64,6 +65,8 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
@Autowired
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
|
||||
|
||||
@Autowired
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
String container;
|
||||
|
||||
protected String barcode = null;
|
||||
@@ -214,12 +217,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
@@ -426,12 +424,50 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
instructionService.create(instdto);
|
||||
//创建指令后修改任务状态
|
||||
WQLObject taskwo = WQLObject.getWQLObject("acs_task");
|
||||
|
||||
task.setTask_status("1");
|
||||
//创建指令后修改任务状态
|
||||
task.setTask_status("1");
|
||||
taskserver.update(task);
|
||||
// this.writing("to_command","1");
|
||||
// if(StrUtil.isNotEmpty(task.getTo_z())){
|
||||
// if(StrUtil.equals(task.getTo_z(),"01")){
|
||||
// this.writing("to_target","102");
|
||||
// } else if(StrUtil.equals(task.getTo_z(),"02")){
|
||||
// this.writing("to_target","201");
|
||||
// } else if(StrUtil.equals(task.getTo_z(),"03")){
|
||||
// this.writing("to_target","301");
|
||||
// }
|
||||
// }
|
||||
// this.writing("to_command","1");
|
||||
// this.writing("to_task",instdto.getInstruction_code());
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
|
||||
if(StrUtil.isNotEmpty(task.getTo_z())){
|
||||
if(StrUtil.equals(task.getTo_z(),"01")){
|
||||
map.put("code","to_target");
|
||||
map.put("value","102");
|
||||
} else if(StrUtil.equals(task.getTo_z(),"02")){
|
||||
map.put("code","to_target");
|
||||
map.put("value","201");
|
||||
} else if(StrUtil.equals(task.getTo_z(),"03")){
|
||||
map.put("code","to_target");
|
||||
map.put("value","301");
|
||||
}
|
||||
}
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code","to_task");
|
||||
map2.put("value",instdto.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
|
||||
requireSucess = true;
|
||||
applySucess = true;
|
||||
} else {
|
||||
log.info("未找到载具号{}对应任务", container_code);
|
||||
@@ -531,15 +567,56 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
//创建指令后修改任务状态
|
||||
task.setTask_status("1");
|
||||
taskserver.update(task);
|
||||
|
||||
|
||||
|
||||
// this.writing("to_command","1");
|
||||
// if(StrUtil.isNotEmpty(task.getTo_z())){
|
||||
// if(StrUtil.equals(task.getTo_z(),"01")){
|
||||
// this.writing("to_target","102");
|
||||
// } else if(StrUtil.equals(task.getTo_z(),"02")){
|
||||
// this.writing("to_target","201");
|
||||
// } else if(StrUtil.equals(task.getTo_z(),"03")){
|
||||
// this.writing("to_target","301");
|
||||
// }
|
||||
// }
|
||||
// this.writing("to_command","1");
|
||||
// this.writing("to_task",instdto.getInstruction_code());
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
|
||||
if(StrUtil.isNotEmpty(task.getTo_z())){
|
||||
if(StrUtil.equals(task.getTo_z(),"01")){
|
||||
map.put("code","to_target");
|
||||
map.put("value","102");
|
||||
} else if(StrUtil.equals(task.getTo_z(),"02")){
|
||||
map.put("code","to_target");
|
||||
map.put("value","201");
|
||||
} else if(StrUtil.equals(task.getTo_z(),"03")){
|
||||
map.put("code","to_target");
|
||||
map.put("value","301");
|
||||
}
|
||||
}
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code","to_task");
|
||||
map2.put("value",instdto.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
|
||||
requireSucess = true;
|
||||
applySucess = true;
|
||||
} else {
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
message = "申请任务中...";
|
||||
JSONObject apply = new JSONObject();
|
||||
apply.put("type", "6");
|
||||
apply.put("vehicle_code", container_code);
|
||||
apply.put("point_code", device_code);
|
||||
apply.put("device_code", device_code);
|
||||
String str = acsToWmsService.applyTaskToWms(apply);
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
@@ -559,6 +636,39 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void writing(String param, String value) {
|
||||
|
||||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
+ "." + param;
|
||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
|
||||
itemMap.put(to_param, Integer.parseInt(value));
|
||||
// itemMap.put(to_param, Integer.parseInt(value));
|
||||
ReadUtil.write(itemMap, server);
|
||||
|
||||
}
|
||||
|
||||
public void writing(List list) {
|
||||
|
||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Object ob = list.get(i);
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(ob);
|
||||
if (!StrUtil.isEmpty(json.getString("value"))) {
|
||||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
+ "." + json.getString("code");
|
||||
itemMap.put(to_param, json.getString("value"));
|
||||
}
|
||||
}
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||
ReadUtil.write(itemMap, server);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDeviceStatusName() {
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.nl.acs.ext.wms.liKuData;
|
||||
|
||||
public class DeviceStatusData {
|
||||
|
||||
String deviceId;
|
||||
|
||||
String x;
|
||||
|
||||
String y;
|
||||
|
||||
//楼层
|
||||
String mapId;
|
||||
|
||||
//电量
|
||||
String power;
|
||||
|
||||
//托盘
|
||||
String pallet;
|
||||
|
||||
//有无货
|
||||
String load;
|
||||
|
||||
//报警
|
||||
String alarm;
|
||||
|
||||
//任务号
|
||||
String taskId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package org.nl.acs.ext.wms.liKuData;
|
||||
|
||||
public class DeviceStatusRequest {
|
||||
|
||||
String deviceId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.acs.ext.wms.liKuData;
|
||||
|
||||
public class DeviceStatusResponse {
|
||||
|
||||
String result;
|
||||
|
||||
String code;
|
||||
|
||||
String comment;
|
||||
|
||||
DeviceStatusData data;
|
||||
|
||||
|
||||
}
|
||||
@@ -88,4 +88,26 @@ public class AcsToLiKuController {
|
||||
public ResponseEntity<Object> cancelTask(@RequestBody CancelTaskRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.cancelTask(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryCarStatus")
|
||||
@Log("查询四向车状态")
|
||||
@ApiOperation("查询四向车状态")
|
||||
public ResponseEntity<Object> queryCarStatus(@RequestBody DeviceStatusRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.queryCarDeviceStatus(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryTsjStatus")
|
||||
@Log("查询提升机状态")
|
||||
@ApiOperation("查询提升机状态")
|
||||
public ResponseEntity<Object> queryTsjStatus(@RequestBody DeviceStatusRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.queryTsjDeviceStatus(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/querySsxStatus")
|
||||
@Log("查询输送线状态")
|
||||
@ApiOperation("查询提升机状态")
|
||||
public ResponseEntity<Object> querySsxStatus(@RequestBody DeviceStatusRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.queryTsjDeviceStatus(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,4 +65,24 @@ public interface AcsToLiKuService {
|
||||
* @return
|
||||
*/
|
||||
public Resp<CancelTaskResponse> cancelTask(CancelTaskRequest requestParam);
|
||||
|
||||
/**
|
||||
*查询小车设备状态
|
||||
* @return
|
||||
*/
|
||||
public Resp<DeviceStatusResponse> queryCarDeviceStatus(DeviceStatusRequest requestParam);
|
||||
|
||||
/**
|
||||
*查询tsj设备状态
|
||||
* @return
|
||||
*/
|
||||
public Resp<DeviceStatusResponse> queryTsjDeviceStatus(DeviceStatusRequest requestParam);
|
||||
|
||||
/**
|
||||
*查询ssx设备状态
|
||||
* @return
|
||||
*/
|
||||
public Resp<DeviceStatusResponse> querySsxDeviceStatus(DeviceStatusRequest requestParam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,12 +11,6 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* ACS向WMS申请任务
|
||||
* type:必填;1共挤线申请空盘、2共挤线满托入库、3油漆线申请空盘、4油漆线申请物料、5油漆线空盘入库、6、一楼空托入库
|
||||
* point_code:必填;
|
||||
* vehicle_num 载具数量
|
||||
* vehicle_type 载具类型
|
||||
* vehicle_code 载具号
|
||||
* qty 物料数量
|
||||
*/
|
||||
String applyTaskToWms(JSONObject jo);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.nl.acs.ext.wms.RespUtil;
|
||||
import org.nl.acs.ext.wms.AcsUtil;
|
||||
import org.nl.acs.ext.wms.liKuData.*;
|
||||
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -22,61 +23,173 @@ public class AcsToLiKuServiceImpl implements AcsToLiKuService {
|
||||
|
||||
private final AddressService addressService;
|
||||
|
||||
private String log_file_type="log_file_type";
|
||||
private String log_type="ACS请求立库";
|
||||
|
||||
@Override
|
||||
public Resp<InStoreResponse> inStore(InStoreRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
String api = addressService.findByCode("inStore").getMethods_url();
|
||||
log.info("inStore-----输入参数{}", requestParam);
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("inStore-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new InStoreResponse());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<OutStoreResponse> outStore(OutStoreRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("outStore-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("outStore").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("outStore-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new OutStoreResponse());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<EmptyVehicleOutStoreResponse> emptyVehicleOutStore(EmptyVehicleOutStoreRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("emptyVehicleOutStore-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("emptyVehicleOutStore").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("emptyVehicleOutStore-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new EmptyVehicleOutStoreResponse());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<MoveStoreResponse> moveStore(MoveStoreRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("moveStore-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("moveStore").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("moveStore-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new MoveStoreResponse());
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<InStoreResetResponse> inStoreReset(InStoreResetRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("inStoreReset-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("inStoreReset").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("inStoreReset-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new InStoreResetResponse());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<MoveStoreResetResponse> moveStoreReset(MoveStoreResetRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("moveStoreReset-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("moveStoreReset").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("moveStoreReset-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new MoveStoreResetResponse());
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<RoadWayIsLockResponse> roadWayIsLock(RoadWayIsLockRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("roadWayIsLock-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("roadWayIsLock").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("roadWayIsLock-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new RoadWayIsLockResponse());
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Resp<CancelTaskResponse> cancelTask(CancelTaskRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("cancelTask-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("cancelTask").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("cancelTask-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new CancelTaskResponse());
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<DeviceStatusResponse> queryCarDeviceStatus(DeviceStatusRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("queryCarDeviceStatus-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("queryCarDeviceStatus").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("queryCarDeviceStatus-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new DeviceStatusRequest());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<DeviceStatusResponse> queryTsjDeviceStatus(DeviceStatusRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("queryTsjDeviceStatus-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("queryTsjDeviceStatus").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("queryTsjDeviceStatus-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new DeviceStatusRequest());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<DeviceStatusResponse> querySsxDeviceStatus(DeviceStatusRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("queryTsjDeviceStatus-----输入参数{}", requestParam);
|
||||
String api = addressService.findByCode("querySsxDeviceStatus").getMethods_url();
|
||||
String result = AcsUtil.notifyAcs(api, requestParam);
|
||||
log.info("queryTsjDeviceStatus-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new DeviceStatusRequest());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -48,12 +49,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
/*@Value("${acsTowms.token}")*/
|
||||
public String token;
|
||||
|
||||
|
||||
private String log_file_type="log_file_type";
|
||||
private String log_type="ACS请求LMS";
|
||||
|
||||
@Override
|
||||
public String applyTaskToWms(JSONObject jo) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("applyTaskToWms-----输入参数{}", jo);
|
||||
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("applyTaskToWms");
|
||||
String url = wmsurl + addressDto.getMethods_url();
|
||||
log.info("applyTaskToWms-----请求参数{}", jo.toString());
|
||||
HttpResponse result2 = null;
|
||||
try {
|
||||
result2 = HttpRequest.post(url)
|
||||
@@ -74,10 +81,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
log.info("applyTaskToWms-----输出参数{}", result2.body());
|
||||
return result2.body();
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResponse feedbackTaskStatusToWms(JSONArray data) {
|
||||
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
|
||||
String task_code = "";
|
||||
@@ -114,6 +129,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONObject jo = JSONObject.parseObject(result2.body());
|
||||
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString());
|
||||
return result2;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -382,6 +401,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public ApplyLabelingAndBindingResponse applyLabelingAndBindingRequest(ApplyLabelingAndBindingRequest param) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = new ApplyLabelingAndBindingResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
@@ -404,10 +425,17 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
}
|
||||
return applyLabelingAndBindingResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public LiKuApplyTakResponse liKuApplyTaskRequest(LiKuApplyTaskRequest param) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
LiKuApplyTakResponse liKuApplyTakResponse = new LiKuApplyTakResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
@@ -430,25 +458,32 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
}
|
||||
return liKuApplyTakResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public UpdateLKTaskResponse updateLKTaskRequest(UpdateLKTaskRequest param) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("updateLKTaskRequest-----输入参数{}", param);
|
||||
UpdateLKTaskResponse updateLKTaskResponse = new UpdateLKTaskResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("liKuApplyTask");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
log.info("UpdateLKTaskResponse----请求参数{}", param);
|
||||
try {
|
||||
String result = HttpRequest.post(url)
|
||||
.body(JSON.toJSONString(param))
|
||||
.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
log.info("UpdateLKTaskResponse----返回参数{}", result);
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
updateLKTaskResponse = JSONObject.toJavaObject(jsonObject, UpdateLKTaskResponse.class);
|
||||
} catch (Exception e) {
|
||||
JSONObject map = new JSONObject();
|
||||
@@ -457,7 +492,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return JSONObject.toJavaObject(map, UpdateLKTaskResponse.class);
|
||||
}
|
||||
}
|
||||
|
||||
return updateLKTaskResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -40,9 +41,16 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
|
||||
private final AcsToLiKuService acsToLiKuService;
|
||||
|
||||
|
||||
private String log_file_type="log_file_type";
|
||||
private String log_type="立库请求ACS";
|
||||
|
||||
//入库任务状态反馈
|
||||
@Override
|
||||
public Resp<InStoreReportResponse> inStoreReport(InStoreReportRequest requestParam) throws Exception {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("入库任务状态反馈-----输入参数{}", requestParam.toString());
|
||||
String inst_code = requestParam.getOrderId();
|
||||
String status = requestParam.getState();
|
||||
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
||||
@@ -104,12 +112,20 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
result.put("code", "0");
|
||||
result.put("comment", "");
|
||||
result.put("data", inStoreReportResponse );
|
||||
|
||||
log.info("入库任务状态反馈-----输出参数{}", result);
|
||||
return RespUtil.getResp(result.toString(), new InStoreReportResponse());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resp<OutStoreReportResponse> outStoreReport(OutStoreReportRequest requestParam) throws Exception {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("出库任务状态反馈-----输入参数{}", requestParam.toString());
|
||||
String inst_code = requestParam.getOrderId();
|
||||
String status = requestParam.getState();
|
||||
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
||||
@@ -118,6 +134,7 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
// 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞
|
||||
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
|
||||
inst.setInstruction_status("1");
|
||||
instructionService.update(inst);
|
||||
} else if(StrUtil.equals(status,"3")){
|
||||
inst.setInstruction_status("2");
|
||||
instructionService.finish(inst.getInstruction_id());
|
||||
@@ -149,8 +166,14 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
result.put("code", "0");
|
||||
result.put("comment", "");
|
||||
result.put("data", outStoreReportResponse );
|
||||
log.info("出库任务状态反馈-----输出参数{}", result);
|
||||
|
||||
return RespUtil.getResp(result.toString(), new OutStoreReportResponse());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -158,6 +181,9 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
//移库任务上报
|
||||
@Override
|
||||
public Resp<MoveStoreReportResponse> moveStoreReport(MoveStoreReportRequest requestParam) throws Exception {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("移库任务上报-----输入参数{}", requestParam.toString());
|
||||
String inst_code = requestParam.getOrderId();
|
||||
String status = requestParam.getState();
|
||||
Instruction inst = instructionService.findByCodeFromCache(inst_code);
|
||||
@@ -165,6 +191,8 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
// 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞
|
||||
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
|
||||
inst.setInstruction_status("1");
|
||||
instructionService.update(inst);
|
||||
|
||||
} else if(StrUtil.equals(status,"3")){
|
||||
inst.setInstruction_status("2");
|
||||
instructionService.finish(inst.getInstruction_id());
|
||||
@@ -220,11 +248,16 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
result.put("code", "0");
|
||||
result.put("comment", "");
|
||||
result.put("data", moveStoreReportResponse );
|
||||
log.info("移库任务上报-----输出参数{}", result);
|
||||
|
||||
return RespUtil.getResp(result.toString(), new MoveStoreReportResponse());
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.nl.modules.system.service.ParamService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.exception.WDKException;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -49,6 +50,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
private final DeviceAppService deviceAppService;
|
||||
private final RouteLineService routeLineService;
|
||||
|
||||
private String log_file_type="log_file_type";
|
||||
private String log_type="LMS请求ACS";
|
||||
|
||||
@Override
|
||||
public CancelTaskResponse cancelFromWms(String param) throws Exception {
|
||||
@@ -137,6 +140,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
|
||||
@Override
|
||||
public PutActionResponse putAction(String jsonObject) throws Exception {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("putAction--------------:输出参数" + jsonObject);
|
||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||
PutActionResponse response = new PutActionResponse();
|
||||
@@ -161,10 +166,16 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
response.setMessage("success");
|
||||
log.info("putAction--------------:输出参数:" + response);
|
||||
return response;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryDevice(String jsonObject) throws Exception {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("queryDevice--------------:输入参数" + jsonObject.toString());
|
||||
JSONArray backja = new JSONArray();
|
||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||
@@ -230,6 +241,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
resultJson.put("data", backja);
|
||||
log.info("queryDevice--------------:输出参数" + resultJson.toString());
|
||||
return resultJson;
|
||||
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -276,6 +293,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
|
||||
@Override
|
||||
public CreateTaskResponse crateTask(String param) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("crateTask-----输入参数{}", param);
|
||||
JSONArray datas = JSONArray.parseArray(param);
|
||||
CreateTaskResponse response = new CreateTaskResponse();
|
||||
JSONArray errArr = new JSONArray();
|
||||
@@ -463,6 +483,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
log.info("createFromWms--------------:输出参数:" + response);
|
||||
|
||||
return response;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public class AutoCreateInst {
|
||||
String taskcode = acsTask.getTask_code();
|
||||
String task_type = acsTask.getTask_type();
|
||||
String vehiclecode = acsTask.getVehicle_code();
|
||||
String storage_task_type = acsTask.getStorage_task_type();
|
||||
String priority = acsTask.getPriority();
|
||||
String is_send = acsTask.getIs_send();
|
||||
|
||||
@@ -70,6 +71,9 @@ public class AutoCreateInst {
|
||||
if (StrUtil.equals(is_send, "0")) {
|
||||
continue;
|
||||
}
|
||||
if(StrUtil.equals(storage_task_type,"1") || StrUtil.equals(storage_task_type,"2") ){
|
||||
continue;
|
||||
}
|
||||
//校验路由关系
|
||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||
if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||
|
||||
@@ -2,14 +2,13 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
active: prod
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
redis:
|
||||
repositories:
|
||||
enabled: false
|
||||
|
||||
#配置 Jpa
|
||||
jpa:
|
||||
hibernate:
|
||||
@@ -18,7 +17,7 @@ spring:
|
||||
properties:
|
||||
hibernate:
|
||||
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
enable_lazy_load_no_trans: true
|
||||
|
||||
task:
|
||||
pool:
|
||||
# 核心线程池大小
|
||||
@@ -44,37 +43,13 @@ rsa:
|
||||
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||
logging:
|
||||
file:
|
||||
path: C:\log\wms
|
||||
config: classpath:logback-spring.xml
|
||||
# sa-token白名单配置
|
||||
security:
|
||||
# 排除路径
|
||||
excludes:
|
||||
# 认证
|
||||
- /auth/login
|
||||
- /auth/code
|
||||
- /auth/logout
|
||||
# swagger
|
||||
- /swagger-ui.html
|
||||
- /swagger-resources/**
|
||||
- /webjars/**
|
||||
- /file/**
|
||||
- /webSocket/**
|
||||
# 静态资源
|
||||
- /*.html
|
||||
- /**/*.html
|
||||
- /**/*.css
|
||||
- /**/*.js
|
||||
# swagger 文档配置
|
||||
- /favicon.ico
|
||||
- /*/api-docs
|
||||
- /*/api-docs/**
|
||||
# druid 监控配置
|
||||
- /druid/**
|
||||
# actuator 监控配置
|
||||
- /actuator
|
||||
- /actuator/**
|
||||
# 上传
|
||||
- /api/localStorage/pictures
|
||||
# 参数
|
||||
- /api/param/getValueByCode
|
||||
path: C:\logs\nlacs\
|
||||
demo:
|
||||
monitor:
|
||||
server-url: https://www.demo-monitor.com
|
||||
username: MessiLoveRidingBike
|
||||
password: 123456
|
||||
|
||||
acsTowms:
|
||||
token: Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI2ZjI2OGMxZjAyOTE0MTNiOWU3YThmMTM2ZTc2MWJkYSIsImF1dGgiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.lKxY3Wc_efzmBXXAS_dDC_Sfh32kZInxYmaxBzg83e5gviSJPPKolNt4IlCCaGM8HOc_yKByiIu8YFlgQif01Q
|
||||
|
||||
|
||||
Binary file not shown.
@@ -43,6 +43,13 @@ public class PdaCheckController {
|
||||
return new ResponseEntity<>(pdaCheckService.checkQueryDtl(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/checkQueryDetails")
|
||||
@Log("盘点单明细详情")
|
||||
@ApiOperation("盘点单明细详情")
|
||||
public ResponseEntity<Object> checkQueryDetails(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(pdaCheckService.checkQueryDetails(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/saveCheck")
|
||||
@Log("保存")
|
||||
@ApiOperation("保存")
|
||||
@@ -57,6 +64,20 @@ public class PdaCheckController {
|
||||
return new ResponseEntity<>(pdaCheckService.confirmCheck(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/exception")
|
||||
@Log("异常")
|
||||
@ApiOperation("异常")
|
||||
public ResponseEntity<Object> exception(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(pdaCheckService.exception(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/normal")
|
||||
@Log("正常")
|
||||
@ApiOperation("正常")
|
||||
public ResponseEntity<Object> normal(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(pdaCheckService.normal(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getStor")
|
||||
@Log("获取人员对应仓库下拉框")
|
||||
@ApiOperation("获取人员对应仓库下拉框")
|
||||
|
||||
@@ -44,4 +44,24 @@ public interface PdaCheckService {
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject getStor();
|
||||
|
||||
/**
|
||||
* 获取人员对应仓库下拉框
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject checkQueryDetails(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 异常
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject exception(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 正常
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject normal(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
package org.nl.wms.pda.st.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.druid.sql.visitor.functions.If;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
|
||||
@@ -141,4 +144,109 @@ public class PdaCheckServiceImpl implements PdaCheckService {
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject checkQueryDetails(JSONObject whereJson) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "3");
|
||||
map.put("storagevehicle_code", whereJson.getString("storagevehicle_code"));
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_CHECK").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject exception(JSONObject whereJson) {
|
||||
//主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_CheckMst");
|
||||
//明细表
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_CheckDtl");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONArray rows = whereJson.getJSONArray("check_rows");
|
||||
String check_code = "";
|
||||
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject json = rows.getJSONObject(i);
|
||||
check_code = json.getString("check_code");
|
||||
|
||||
JSONObject jsonDtl = wo_dtl.query("checkdtl_id = '" + json.getString("checkdtl_id") + "'").uniqueResult(0);
|
||||
jsonDtl.put("check_result", "2");
|
||||
jsonDtl.put("status", "4");
|
||||
jsonDtl.put("is_process", "0");
|
||||
jsonDtl.put("remark", json.getString("remark"));
|
||||
jsonDtl.put("check_optid", currentUserId);
|
||||
jsonDtl.put("check_optname", nickName);
|
||||
jsonDtl.put("check_time", now);
|
||||
wo_dtl.update(jsonDtl);
|
||||
}
|
||||
|
||||
JSONArray jsonDtlArr = wo_dtl.query("check_code = '" + check_code + "' and check_result = '2'").getResultJSONArray(0);
|
||||
|
||||
JSONObject jsonMst = wo_mst.query("check_code = '" + check_code + "'").uniqueResult(0);
|
||||
jsonMst.put("status", "3");
|
||||
if (ObjectUtil.isNotEmpty(jsonDtlArr)) {
|
||||
jsonMst.put("is_nok", "1");
|
||||
}
|
||||
wo_mst.update(jsonMst);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject normal(JSONObject whereJson) {
|
||||
//主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_CheckMst");
|
||||
//明细表
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_CheckDtl");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONArray rows = whereJson.getJSONArray("check_rows");
|
||||
String check_code = "";
|
||||
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject json = rows.getJSONObject(i);
|
||||
check_code = json.getString("check_code");
|
||||
|
||||
JSONObject jsonDtl = wo_dtl.query("checkdtl_id = '" + json.getString("checkdtl_id") + "'").uniqueResult(0);
|
||||
jsonDtl.put("check_result", "1");
|
||||
jsonDtl.put("is_process", "1");
|
||||
jsonDtl.put("status", "3");
|
||||
jsonDtl.put("remark", json.getString("remark"));
|
||||
jsonDtl.put("check_optid", currentUserId);
|
||||
jsonDtl.put("check_optname", nickName);
|
||||
jsonDtl.put("check_time", now);
|
||||
wo_dtl.update(jsonDtl);
|
||||
}
|
||||
|
||||
JSONArray jsonDtlArr = wo_dtl.query("check_code = '" + check_code + "' and check_result = '1'").getResultJSONArray(0);
|
||||
JSONArray jsonDtlArr2 = wo_dtl.query("check_code = '" + check_code + "'").getResultJSONArray(0);
|
||||
|
||||
JSONObject jsonMst = wo_mst.query("check_code = '" + check_code + "'").uniqueResult(0);
|
||||
jsonMst.put("status", "3");
|
||||
if (jsonDtlArr.size() == jsonDtlArr2.size()) {
|
||||
jsonMst.put("status", "99");
|
||||
jsonMst.put("confirm_optid", currentUserId);
|
||||
jsonMst.put("confirm_optname", nickName);
|
||||
jsonMst.put("confirm_time", now);
|
||||
}
|
||||
|
||||
wo_mst.update(jsonMst);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "操作成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
输入.check_code TYPEAS s_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
输入.stor_id TYPEAS s_string
|
||||
输入.storagevehicle_code TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -122,12 +123,12 @@
|
||||
CASE
|
||||
dtl.check_result
|
||||
WHEN '1' THEN '正常'
|
||||
WHEN '2' THEN '盘亏'
|
||||
WHEN '3' THEN '盘盈'
|
||||
WHEN '2' THEN '异常'
|
||||
END
|
||||
) AS check_result,
|
||||
dtl.check_optname,
|
||||
dtl.check_time,
|
||||
dtl.remark,
|
||||
|
||||
dtl.check_id,
|
||||
dtl.checkdtl_id
|
||||
@@ -135,7 +136,7 @@
|
||||
ST_IVT_CheckDtl dtl
|
||||
LEFT JOIN md_me_materialbase mater ON dtl.material_id = mater.material_id
|
||||
WHERE
|
||||
1=1
|
||||
dtl.status = '1'
|
||||
|
||||
OPTION 输入.check_code <> ""
|
||||
dtl.check_code = 输入.check_code
|
||||
@@ -144,3 +145,44 @@
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
sub.container_name,
|
||||
sub.sap_pcsn,
|
||||
sub.net_weight,
|
||||
(
|
||||
CASE
|
||||
sub.status
|
||||
WHEN '0' THEN '生成'
|
||||
WHEN '1' THEN '包装'
|
||||
WHEN '2' THEN '入库'
|
||||
WHEN '3' THEN '出库'
|
||||
END
|
||||
) AS status,
|
||||
sub.sale_order_name,
|
||||
sub.customer_name,
|
||||
sub.customer_description,
|
||||
sub.width,
|
||||
sub.thickness,
|
||||
sub.length,
|
||||
sub.width_standard,
|
||||
sub.thickness_request,
|
||||
sub.quality_guaran_period,
|
||||
sub.date_of_production,
|
||||
sub.date_of_fg_inbound
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON ivt.pcsn = sub.container_name AND sub.package_box_sn = attr.storagevehicle_code
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.storagevehicle_code <> ""
|
||||
sub.package_box_sn = 输入.storagevehicle_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -31,6 +31,20 @@ public class CheckController {
|
||||
return new ResponseEntity<>(checkService.pageQuery(whereJson,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getDtlView")
|
||||
@Log("查询盘点单明细详情")
|
||||
@ApiOperation("查询盘点单明细详情")
|
||||
public ResponseEntity<Object> getDtlView(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(checkService.getDtlView(whereJson,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getExceptionDispose")
|
||||
@Log("查询盘点单明细异常")
|
||||
@ApiOperation("查询盘点单明细异常")
|
||||
public ResponseEntity<Object> getExceptionDispose(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(checkService.getExceptionDispose(whereJson,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getOutBillDtl")
|
||||
@Log("查询移库单")
|
||||
@ApiOperation("查询移库单")
|
||||
@@ -125,4 +139,11 @@ public class CheckController {
|
||||
public void download(HttpServletResponse response,@RequestParam Map whereJson) throws IOException {
|
||||
checkService.download(checkService.getOutBillDtl(whereJson), response);
|
||||
}
|
||||
@PostMapping("/disposeConfirm")
|
||||
@Log("处理确认")
|
||||
@ApiOperation("处理确认")
|
||||
public ResponseEntity<Object> disposeConfirm(@RequestBody JSONObject whereJson) {
|
||||
checkService.disposeConfirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,24 @@ public interface CheckService {
|
||||
*/
|
||||
Map<String, Object> pageQuery(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> getDtlView(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> getExceptionDispose(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
@@ -91,4 +109,9 @@ public interface CheckService {
|
||||
* @throws IOException
|
||||
*/
|
||||
void download(JSONArray rows, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 处理确认
|
||||
*/
|
||||
void disposeConfirm(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.st.instor.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
@@ -59,6 +60,40 @@ public class CheckServiceImpl implements CheckService {
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getDtlView(Map whereJson, Pageable page) {
|
||||
String box_no = MapUtil.getStr(whereJson, "box_no");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("box_no",box_no);
|
||||
map.put("flag","9");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(pcsn)) map.put("pcsn", "%"+pcsn+"%");
|
||||
if (ObjectUtil.isNotEmpty(sap_pcsn)) map.put("sap_pcsn", "%"+sap_pcsn+"%");
|
||||
|
||||
JSONObject json = WQL.getWO("QST_IVT_CHECK").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "sub.container_name ASC");
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getExceptionDispose(Map whereJson, Pageable page) {
|
||||
String box_no = MapUtil.getStr(whereJson, "box_no");
|
||||
String check_code = MapUtil.getStr(whereJson, "check_code");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("check_code",check_code);
|
||||
map.put("flag","10");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(box_no)) map.put("box_no", "%"+box_no+"%");
|
||||
|
||||
JSONObject json = WQL.getWO("QST_IVT_CHECK").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "dtl.seq_no ASC");
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
@@ -149,11 +184,9 @@ public class CheckServiceImpl implements CheckService {
|
||||
jsonDtl.put("struct_name", json.getString("struct_name"));
|
||||
jsonDtl.put("storagevehicle_code", json.getString("storagevehicle_code"));
|
||||
jsonDtl.put("material_id", json.getLongValue("material_id"));
|
||||
jsonDtl.put("base_qty", json.getDoubleValue("base_qty"));
|
||||
jsonDtl.put("qty_unit_id", json.getLongValue("measure_unit_id"));
|
||||
jsonDtl.put("qty_unit_name", json.getString("qty_unit_name"));
|
||||
jsonDtl.put("status", "1");
|
||||
jsonDtl.put("fac_qty", json.getDoubleValue("fac_qty"));
|
||||
dtlTab.insert(jsonDtl);
|
||||
}
|
||||
}
|
||||
@@ -266,6 +299,9 @@ public class CheckServiceImpl implements CheckService {
|
||||
if (StrUtil.isNotEmpty(map.get("struct_code"))) {
|
||||
map.put("struct_code", "%" + map.get("struct_code") + "%");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(map.get("box_no"))) {
|
||||
map.put("box_no", "%" + map.get("box_no") + "%");
|
||||
}
|
||||
JSONObject jo = WQL.getWO("QST_IVT_CHECK")
|
||||
.addParam("flag", "3")
|
||||
.addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "struct.struct_code");
|
||||
@@ -282,64 +318,58 @@ public class CheckServiceImpl implements CheckService {
|
||||
|
||||
JSONObject form = whereJson.getJSONObject("row");
|
||||
JSONArray rows = whereJson.getJSONArray("rows");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject jo_mst = wo_mst.query("status in ('1','3') and check_id='" + form.getString("check_id") + "'").uniqueResult(0);
|
||||
if (jo_mst == null) {
|
||||
throw new BadRequestException("盘点单状态异常!");
|
||||
}
|
||||
wo_dtl.delete("status in ('1','2') and check_id='" + form.getString("check_id") + "'");
|
||||
//定义需要需要更新的的点位集合
|
||||
String check_id = form.getString("check_id");
|
||||
JSONObject jsonMst = wo_mst.query("check_id = '" + check_id + "'").uniqueResult(0);
|
||||
|
||||
// 更新明细
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject jo = rows.getJSONObject(i);
|
||||
String status = jo.getString("status");
|
||||
double base_qty = jo.getDoubleValue("base_qty");
|
||||
jo.put("seq_no", "" + (i + 1));
|
||||
//已盘点过的明细不再处理
|
||||
if ("3,4,5,99".contains(status)) {
|
||||
wo_dtl.update(jo);
|
||||
continue;
|
||||
}
|
||||
jo.put("status", "3");
|
||||
jo.put("check_optid", currentUserId);
|
||||
jo.put("check_optname", nickName);
|
||||
jo.put("check_time", now);
|
||||
double fac_qty = jo.getDoubleValue("fac_qty");
|
||||
//判断盈亏
|
||||
if (fac_qty > base_qty) {
|
||||
jo.put("check_result", "3");
|
||||
} else if (fac_qty < base_qty) {
|
||||
jo.put("check_result", "2");
|
||||
JSONObject json = rows.getJSONObject(i);
|
||||
JSONObject jsonDtl = wo_dtl.query("checkdtl_id = '" + json.getString("checkdtl_id") + "'").uniqueResult(0);
|
||||
|
||||
String check_result = json.getString("check_result");
|
||||
if (ObjectUtil.isEmpty(check_result)) {
|
||||
jsonDtl.put("check_result","1");
|
||||
jsonDtl.put("is_process","0");
|
||||
jsonDtl.put("status","3");
|
||||
} else {
|
||||
jo.put("check_result", "1");
|
||||
jsonDtl.put("check_result",check_result);
|
||||
|
||||
if (StrUtil.equals(check_result, "1")) {
|
||||
jsonDtl.put("is_process","1");
|
||||
jsonDtl.put("status","3");
|
||||
} else {
|
||||
jsonDtl.put("is_process","0");
|
||||
jsonDtl.put("status","4");
|
||||
}
|
||||
jo.put("status", "99");
|
||||
wo_dtl.insert(jo);
|
||||
}
|
||||
jo_mst.put("dtl_num", rows.size());
|
||||
jo_mst.put("status", "3");
|
||||
jo_mst.put("is_nok", "0");
|
||||
JSONArray ja_nok = wo_dtl.query("check_result <>'1' and check_id='" + form.getString("check_id") + "'").getResultJSONArray(0);
|
||||
if (ja_nok.size() != 0) {
|
||||
jo_mst.put("is_nok", "1");
|
||||
}
|
||||
|
||||
JSONArray ja = wo_dtl.query("status in ('99') and check_id='" + form.getString("check_id") + "'").getResultJSONArray(0);
|
||||
//说明全部确认
|
||||
if (ja.size() == jo_mst.getInteger("dtl_num")) {
|
||||
HashMap<String, String> mapdtl = new HashMap<>();
|
||||
|
||||
mapdtl.put("status", "99");
|
||||
wo_dtl.update(mapdtl, "check_id='" + form.getString("check_id") + "'");
|
||||
|
||||
jo_mst.put("status", "99");
|
||||
jo_mst.put("confirm_optid", currentUserId);
|
||||
jo_mst.put("confirm_optname", nickName);
|
||||
jo_mst.put("confirm_time", now);
|
||||
jsonDtl.put("remark", json.getString("remark"));
|
||||
jsonDtl.put("check_optid", currentUserId);
|
||||
jsonDtl.put("check_optname", nickName);
|
||||
jsonDtl.put("check_time", now);
|
||||
wo_dtl.update(jsonDtl);
|
||||
}
|
||||
wo_mst.update(jo_mst);
|
||||
|
||||
// 更新主表: 明细全部为正常 -1 主表为正常
|
||||
JSONArray jsonDtlArr = wo_dtl.query("check_id = '" + check_id + "' and check_result = '2'").getResultJSONArray(0);
|
||||
|
||||
if (jsonDtlArr.size() == 0) {
|
||||
// 更新主表为正常
|
||||
jsonMst.put("is_nok", "0");
|
||||
jsonMst.put("status", "99");
|
||||
} else {
|
||||
jsonMst.put("is_nok", "1");
|
||||
jsonMst.put("status", "3");
|
||||
}
|
||||
jsonMst.put("confirm_optid", currentUserId);
|
||||
jsonMst.put("confirm_optname", nickName);
|
||||
jsonMst.put("confirm_time", now);
|
||||
wo_mst.update(jsonMst);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -683,5 +713,49 @@ public class CheckServiceImpl implements CheckService {
|
||||
//FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void disposeConfirm(JSONObject whereJson) {
|
||||
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_CheckMst");
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_CheckDtl");
|
||||
|
||||
JSONArray rows = whereJson.getJSONArray("rows");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
|
||||
String check_id = "";
|
||||
// 更新明细
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject json = rows.getJSONObject(i);
|
||||
String is_process = json.getString("is_process");
|
||||
check_id = json.getString("check_id");
|
||||
|
||||
if (StrUtil.equals(is_process, "1")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
JSONObject jsonDtl = dtlTab.query("checkdtl_id = '" + json.getString("checkdtl_id") + "'").uniqueResult(0);
|
||||
|
||||
jsonDtl.put("is_process", "1");
|
||||
jsonDtl.put("status", "5");
|
||||
jsonDtl.put("process_optid", currentUserId);
|
||||
jsonDtl.put("process_time", DateUtil.now());
|
||||
dtlTab.update(jsonDtl);
|
||||
}
|
||||
|
||||
// 如果异常是否处理都为是则更新全部明细状态为完成,更新主表为完成
|
||||
JSONArray jsonDtlArr = dtlTab.query("check_id = '" + check_id + "' and is_process = '0'").getResultJSONArray(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonDtlArr)) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("status", "99");
|
||||
|
||||
// 更新明细为完成
|
||||
dtlTab.update(map,"check_id = '"+check_id+"'");
|
||||
|
||||
// 更新主表为完成
|
||||
mstTab.update(map,"check_id = '"+check_id+"'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
输入.material_id TYPEAS s_string
|
||||
输入.quality_scode TYPEAS s_string
|
||||
输入.pcsn TYPEAS s_string
|
||||
输入.sap_pcsn TYPEAS s_string
|
||||
输入.ivt_level TYPEAS s_string
|
||||
输入.is_active TYPEAS s_string
|
||||
输入.sect_id TYPEAS s_string
|
||||
@@ -38,6 +39,7 @@
|
||||
输入.struct_code TYPEAS s_string
|
||||
输入.ids TYPEAS f_string
|
||||
输入.storagevehicle_code TYPEAS s_string
|
||||
输入.box_no TYPEAS s_string
|
||||
输入.deptIds TYPEAS f_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
[临时表]
|
||||
@@ -173,6 +175,10 @@
|
||||
struct.struct_code like 输入.struct_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
struct.storagevehicle_code like 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.stor_id <> ""
|
||||
struct.stor_id = 输入.stor_id
|
||||
ENDOPTION
|
||||
@@ -349,6 +355,7 @@
|
||||
CheckDtl.process_type,
|
||||
CheckDtl.process_optid,
|
||||
CheckDtl.process_time,
|
||||
CheckDtl.remark,
|
||||
struct.struct_code,
|
||||
struct.sect_code,
|
||||
mb.material_code,
|
||||
@@ -374,3 +381,55 @@
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "9"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
sub.*
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON ivt.struct_id = attr.struct_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON ivt.pcsn = sub.container_name AND sub.package_box_sn = attr.storagevehicle_code
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
sub.package_box_sn = 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
ivt.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.sap_pcsn <> ""
|
||||
sub.sap_pcsn like 输入.sap_pcsn
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "10"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
dtl.*,
|
||||
mater.material_code,
|
||||
mater.material_name
|
||||
FROM
|
||||
ST_IVT_CheckDtl dtl
|
||||
LEFT JOIN md_me_materialbase mater ON dtl.material_id = mater.material_id
|
||||
WHERE
|
||||
dtl.check_result = '2'
|
||||
and dtl.status in ('4','5')
|
||||
|
||||
OPTION 输入.box_no <> ""
|
||||
dtl.storagevehicle_code like 输入.box_no
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.check_code <> ""
|
||||
dtl.check_code = 输入.check_code
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -115,14 +115,22 @@
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" />
|
||||
<el-table-column prop="sect_name" label="盘点库区" align="center" />
|
||||
<el-table-column prop="struct_name" label="盘点货位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="箱号号" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="base_qty" label="数量" align="center" :formatter="crud.formatNum0" />
|
||||
<el-table-column prop="fac_qty" label="盘点数量" align="center" :formatter="crud.formatNum0" />
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="sect_name" label="盘点库区" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_name" label="盘点货位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" width="250" label="箱号">
|
||||
<template slot-scope="scope">
|
||||
<el-link v-if="crud.status.view > 0" type="warning" @click="openDtlView(scope.row)">{{ scope.row.storagevehicle_code }}</el-link>
|
||||
<span v-if="crud.status.cu > 0">{{ scope.row.storagevehicle_code }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="150" align="center" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" min-width="150" show-overflow-tooltip />
|
||||
<!-- <el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" width="200px" >
|
||||
<template scope="scope">
|
||||
<el-input v-model="scope.row.remark" size="mini" />
|
||||
<span>{{ scope.row.remark }}</span>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, form.tableData)" />
|
||||
@@ -130,6 +138,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
|
||||
<DtlViewDialog :dialog-show.sync="dtlViewShow" :open-param="paramDtlView"/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@@ -137,8 +146,8 @@
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import AddDtl from '@/views/wms/st/inStor/check/AddDtl'
|
||||
import check from '@/views/wms/st/inStor/check/check'
|
||||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
import DtlViewDialog from '@/views/wms/st/inStor/check/DtlViewDialog'
|
||||
|
||||
const defaultForm = {
|
||||
check_code: '',
|
||||
@@ -154,7 +163,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { AddDtl },
|
||||
components: { AddDtl, DtlViewDialog },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
props: {
|
||||
dialogShow: {
|
||||
@@ -165,6 +174,8 @@ export default {
|
||||
dicts: ['check_bill_status', 'ST_INV_TYPE_CK', 'check_dtl_status'],
|
||||
data() {
|
||||
return {
|
||||
paramDtlView: '',
|
||||
dtlViewShow: false,
|
||||
dialogVisible: false,
|
||||
dtlShow: false,
|
||||
flagnow: false,
|
||||
@@ -281,6 +292,10 @@ export default {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
},
|
||||
openDtlView(row) {
|
||||
this.paramDtlView = row.storagevehicle_code
|
||||
this.dtlViewShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,18 +9,24 @@
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="库区">
|
||||
<el-cascader
|
||||
placeholder="库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
style="width: 200px;"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
</el-form-item>
|
||||
<el-form-item label="货位">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
clearable
|
||||
@@ -30,8 +36,19 @@
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号">
|
||||
<el-input
|
||||
v-model="query.box_no"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="箱号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料">
|
||||
<el-input
|
||||
v-model="query.remark"
|
||||
clearable
|
||||
@@ -41,12 +58,9 @@
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="padding: 10px" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
@@ -63,8 +77,6 @@
|
||||
<el-table-column prop="storagevehicle_code" label="箱号" :min-width="flexWidth('storagevehicle_code',crud.data,'箱号')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column show-overflow-tooltip prop="base_qty" label="数量" :formatter="crud.formatNum0" />
|
||||
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="计量单位" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -80,7 +92,6 @@
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
|
||||
export default {
|
||||
|
||||
@@ -91,62 +91,75 @@
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
max-height="400"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="sect_name" label="盘点库区" align="center" />
|
||||
<el-table-column prop="struct_name" label="盘点货位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="箱号" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center">
|
||||
<template scope="scope">
|
||||
<el-input v-show="isShow(scope.$index, scope.row,1)" v-model="scope.row.material_code" disabled class="input-with-select">
|
||||
<el-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
<span v-show="isShow(scope.$index, scope.row,3)">{{ scope.row.material_code }}</span>
|
||||
<el-table-column prop="sect_name" label="盘点库区" align="center" width="120px" />
|
||||
<el-table-column prop="struct_name" label="盘点货位" align="center" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" width="250" label="箱号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="openDtlView(scope.row)">{{ scope.row.storagevehicle_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_name" show-overflow-tooltip label="物料名称" align="center" />
|
||||
<el-table-column prop="base_qty" label="数量" :formatter="crud.formatNum0" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="fac_qty" label="盘点数量" width="160" align="center">
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="150" align="center" />
|
||||
<el-table-column prop="material_name" show-overflow-tooltip label="物料名称" align="center" width="170px" />
|
||||
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" width="110px" />
|
||||
<el-table-column show-overflow-tooltip prop="check_result" label="是否异常" align="center" width="210px">
|
||||
<template scope="scope">
|
||||
<el-input-number v-show="isShow(scope.$index, scope.row,2)" v-model="scope.row.fac_qty" :precision="0" :min="0" />
|
||||
<span v-show="isShow(scope.$index, scope.row,4)">{{ scope.row.fac_qty }}</span>
|
||||
<el-select
|
||||
v-model="scope.row.check_result"
|
||||
clearable
|
||||
placeholder="默认正常"
|
||||
style="width: 150px"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.check_result"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
|
||||
<el-table-column prop="check_result" label="是否异常" align="center" :formatter="check_resultFormat" />
|
||||
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" />
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<el-table-column prop="remark" label="明细备注" align="center" width="290px">
|
||||
<template scope="scope">
|
||||
<el-input v-model="scope.row.remark" size="mini" style="width: 250px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button :disabled="isCanDel(scope.$index, scope.row,1)" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index, tableData)" />
|
||||
<el-button v-show="!scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||
<el-button v-show="scope.row.edit" :disabled="isCanDel(scope.$index, scope.row,2)" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveCheck">保存</el-button>
|
||||
<!-- <el-button type="primary" @click="saveCheck">保存</el-button>-->
|
||||
<el-button type="primary" @click="submitCheck">确认</el-button>
|
||||
</span>
|
||||
<MaterDialog :dialog-show.sync="materShow" @tableChanged2="tableChanged2" />
|
||||
<DtlViewDialog :dialog-show.sync="dtlViewShow" :open-param="paramDtlView"/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import check from '@/views/wms/st/inStor/check/check'
|
||||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
||||
import DtlViewDialog from '@/views/wms/st/inStor/check/DtlViewDialog'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
|
||||
export default {
|
||||
name: 'CheckDialog',
|
||||
components: { MaterDialog },
|
||||
components: { MaterDialog, DtlViewDialog },
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
@@ -164,7 +177,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
paramDtlView: '',
|
||||
materShow: false,
|
||||
dtlViewShow: false,
|
||||
add_flag: true,
|
||||
nowrow: null,
|
||||
nowindex: '',
|
||||
@@ -195,9 +210,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({ 'is_productstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
crudUserStor.getUserStor().then(res => {
|
||||
this.storlist = res
|
||||
})
|
||||
check.getOutBillDtl2({ 'check_id': this.form.check_id }).then(res => {
|
||||
this.tableData = res
|
||||
@@ -349,18 +363,10 @@ export default {
|
||||
this.form.detail_count = this.tableData.length
|
||||
},
|
||||
submitCheck() {
|
||||
if (this.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
if (!this.tableData[i].edit) {
|
||||
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||
return false
|
||||
}
|
||||
}
|
||||
check.confirm({ 'row': this.form, 'rows': this.tableData }).then(res => {
|
||||
this.dialogVisible = false
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
saveCheck() {
|
||||
@@ -377,6 +383,10 @@ export default {
|
||||
check.saveCheck({ 'row': this.form, 'rows': this.tableData }).then(res => {
|
||||
this.dialogVisible = false
|
||||
})
|
||||
},
|
||||
openDtlView(row) {
|
||||
this.paramDtlView = row.storagevehicle_code
|
||||
this.dtlViewShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
141
lms/nladmin-ui/src/views/wms/st/inStor/check/DtlViewDialog.vue
Normal file
141
lms/nladmin-ui/src/views/wms/st/inStor/check/DtlViewDialog.vue
Normal file
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="明细详情"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
width="1400px"
|
||||
:before-close="handleClose"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="子卷号">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="子卷号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="sap批次">
|
||||
<el-input
|
||||
v-model="query.sap_pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="sap批次"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<div style="padding: 10px" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip prop="container_name" label="子卷号" align="center" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="sap_pcsn" label="sap批次" align="center" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="net_weight" label="净重" align="center" :formatter="crud.formatNum2" />
|
||||
<el-table-column show-overflow-tooltip prop="status" label="状态" align="center" :formatter="formatStatus" />
|
||||
<el-table-column show-overflow-tooltip prop="sale_order_name" label="订单号" align="center" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="customer_name" label="客户编码" align="center" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="customer_description" label="客户名称" align="center" width="210px" />
|
||||
<el-table-column show-overflow-tooltip prop="width" label="幅宽" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="thickness" label="厚度" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="length" label="长度" align="center" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="width_standard" label="客户要求幅宽" align="center" width="120px" />
|
||||
<el-table-column show-overflow-tooltip prop="thickness_request" label="物料标准厚度" align="center" width="120px" />
|
||||
<el-table-column show-overflow-tooltip prop="quality_guaran_period" label="保质期" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="date_of_production" label="制造完成日期" align="center" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="date_of_fg_inbound" label="入库日期" align="center" width="150px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
export default {
|
||||
name: 'DtlViewDialog',
|
||||
dicts: ['sub_package_relation'],
|
||||
components: { rrOperation, pagination },
|
||||
mixins: [presenter(), header()],
|
||||
cruds() {
|
||||
return CRUD({ title: '用户', idField: 'stockrecord_id', url: 'api/check/getDtlView',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}})
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
open() {
|
||||
this.crud.query.box_no = this.openParam
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
formatStatus(row) {
|
||||
return this.dict.label.sub_package_relation[row.status]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,249 +1,148 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="盘点单异常处理"
|
||||
title="异常处理"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:visible.sync="dialogVisible"
|
||||
@open="open"
|
||||
width="1400px"
|
||||
:before-close="handleClose"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
|
||||
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
|
||||
<el-form-item label="单据号" prop="check_code">
|
||||
<el-input v-model="form.check_code" placeholder="单据号" clearable disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="check_type">
|
||||
<el-select
|
||||
v-model="form.check_type"
|
||||
placeholder="业务类型"
|
||||
:disabled="true"
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="箱号">
|
||||
<el-input
|
||||
v-model="query.box_no"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="子卷号"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.ST_INV_TYPE_CK"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-select
|
||||
v-model="form.status"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
:disabled="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.check_bill_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="明细数" prop="dtl_num">
|
||||
<el-input v-model="form.dtl_num" style="width: 200px" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" :disabled="true" style="width: 480px;" clearable :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" maxlength="100" show-word-limit />
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">盘点单明细</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="process1_flag"
|
||||
@click="process1"
|
||||
>
|
||||
重新盘点
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="process0_flag"
|
||||
@click="process0"
|
||||
>
|
||||
账务为准
|
||||
</el-button>
|
||||
|
||||
</div>
|
||||
<div style="padding: 10px" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
max-height="300"
|
||||
border
|
||||
:highlight-current-row="true"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="sect_name" label="盘点库区" align="center" />
|
||||
<el-table-column prop="struct_name" label="盘点货位" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="190" align="center" />
|
||||
<el-table-column prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="base_qty" label="桶数" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="fac_qty" label="盘点桶数" :formatter="crud.formatNum0" width="160" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
|
||||
<el-table-column prop="check_result" label="盘点结果" align="center" :formatter="check_resultFormat" />
|
||||
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" />
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column show-overflow-tooltip prop="seq_no" label="明细序号" align="center" width="100px" />
|
||||
<el-table-column show-overflow-tooltip prop="status" label="状态" align="center" width="100px" :formatter="formatStatus" />
|
||||
<el-table-column show-overflow-tooltip prop="sect_name" label="盘点库区" align="center" width="100px" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_name" label="货位名称" align="center" width="140px" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="箱号" align="center" width="250px" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" width="150px" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" width="180px" />
|
||||
<el-table-column show-overflow-tooltip prop="is_process" label="是否处理" align="center" :formatter="formatIsProcess" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" width="210px" />
|
||||
<el-table-column show-overflow-tooltip prop="process_time" label="处理时间" align="center" width="150px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="close">取 消</el-button>
|
||||
<el-button type="primary" @click="disposeConfirm">处理确认</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { crud } from '@crud/crud'
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import check from '@/views/wms/st/inStor/check/check'
|
||||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
|
||||
export default {
|
||||
name: 'ProcessDialog',
|
||||
components: { },
|
||||
mixins: [crud()],
|
||||
dicts: ['check_dtl_status', 'IS_OR_NOT'],
|
||||
components: { rrOperation, pagination },
|
||||
mixins: [presenter(), header()],
|
||||
cruds() {
|
||||
return CRUD({ title: '用户', idField: 'stockrecord_id', url: 'api/check/getExceptionDispose',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: true,
|
||||
download: false
|
||||
}})
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
dicts: ['check_bill_status', 'ST_INV_TYPE_CK', 'check_dtl_status', 'check_result'],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
materShow: false,
|
||||
process1_flag: true,
|
||||
process0_flag: true,
|
||||
nowrow: null,
|
||||
nowindex: '',
|
||||
storlist: [],
|
||||
form: {
|
||||
check_id: '',
|
||||
check_code: '',
|
||||
stor_id: '',
|
||||
stor_code: '',
|
||||
stor_name: '',
|
||||
status: '10',
|
||||
dtl_num: '0',
|
||||
check_type: '',
|
||||
remark: '',
|
||||
create_mode: ''
|
||||
},
|
||||
tableData: [],
|
||||
rules: {
|
||||
}
|
||||
type: String
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
// 查询原材料库的仓库
|
||||
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
|
||||
this.storlist = res.content
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
this.getOutBillDtl()
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
open() {
|
||||
this.crud.query.check_code = this.openParam
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
handleCurrentChange(current) {
|
||||
if (current !== null) {
|
||||
this.nowrow = current
|
||||
if (current.status === '05' || current.status === '06') {
|
||||
this.process0_flag = false
|
||||
this.process1_flag = false
|
||||
} else {
|
||||
this.process0_flag = true
|
||||
this.process1_flag = true
|
||||
}
|
||||
} else {
|
||||
this.nowrow = null
|
||||
this.process0_flag = true
|
||||
this.process1_flag = true
|
||||
}
|
||||
},
|
||||
setForm(row) {
|
||||
this.dialogVisible = true
|
||||
this.form = row
|
||||
},
|
||||
bill_statusFormat(row, column) {
|
||||
formatStatus(row) {
|
||||
return this.dict.label.check_dtl_status[row.status]
|
||||
},
|
||||
check_resultFormat(row, column) {
|
||||
return this.dict.label.check_result[row.check_result]
|
||||
formatIsProcess(row) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_process]
|
||||
},
|
||||
process0() {
|
||||
check.process0({ 'form': this.form, 'row': this.nowrow }).then(res => {
|
||||
this.getOutBillDtl()
|
||||
})
|
||||
},
|
||||
process1() {
|
||||
if (this.nowrow !== null) {
|
||||
this.$refs.child3.setReForm(this.nowrow)
|
||||
disposeConfirm() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (_selectData.length === 0) {
|
||||
return this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
},
|
||||
getOutBillDtl() {
|
||||
check.getOutBillDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||
this.tableData = res
|
||||
const data = {
|
||||
'rows': _selectData
|
||||
}
|
||||
check.disposeConfirm(data).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -101,4 +101,11 @@ export function process1(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, getOutBillDtl, getStructIvt, getOutBillDtl2, confirm, getInvTypes, saveCheck, process0, getOutBillDis, process1 }
|
||||
export function disposeConfirm(data) {
|
||||
return request({
|
||||
url: '/api/check/disposeConfirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, getOutBillDtl, getStructIvt, getOutBillDtl2, confirm, getInvTypes, saveCheck, process0, getOutBillDis, process1, disposeConfirm }
|
||||
|
||||
@@ -119,18 +119,18 @@
|
||||
>
|
||||
盘点
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
:disabled="confirm_flag"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="confirm"
|
||||
@click="exceptionDispose"
|
||||
>
|
||||
异常处理
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
@@ -171,25 +171,25 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column show-overflow-tooltip prop="check_code" width="130" label="单据号">
|
||||
<el-table-column show-overflow-tooltip prop="check_code" width="160" label="单据号">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.check_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="100" prop="status" label="单据状态" />
|
||||
<el-table-column show-overflow-tooltip :formatter="stateFormat" width="150" prop="status" label="单据状态" />
|
||||
<el-table-column prop="stor_name" label="仓库" width="120" />
|
||||
<el-table-column show-overflow-tooltip prop="check_type" :formatter="bill_typeFormat" width="120" label="业务类型" />
|
||||
<el-table-column show-overflow-tooltip prop="is_nok" :formatter="is_nokFormat" width="120" label="盘点状态" />
|
||||
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="120" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_num" width="120" />
|
||||
<el-table-column show-overflow-tooltip prop="input_time" width="150" label="创建日期" />
|
||||
<el-table-column show-overflow-tooltip prop="check_type" :formatter="bill_typeFormat" width="150" label="业务类型" />
|
||||
<el-table-column show-overflow-tooltip prop="is_nok" :formatter="is_nokFormat" width="150" label="盘点状态" />
|
||||
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="150" />
|
||||
<el-table-column label="明细数" align="center" prop="dtl_num" width="150" />
|
||||
<el-table-column show-overflow-tooltip prop="input_time" width="170" label="创建日期" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<CheckDialog ref="child" @AddChanged="querytable" />
|
||||
<ProcessDialog ref="child2" @AddChanged="querytable" />
|
||||
<ProcessDialog :dialog-show.sync="processDialogShow" :open-param="openParam" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -203,7 +203,6 @@ import pagination from '@crud/Pagination'
|
||||
import AddDialog from '@/views/wms/st/inStor/check/AddDialog'
|
||||
import CheckDialog from '@/views/wms/st/inStor/check/CheckDialog'
|
||||
import ProcessDialog from '@/views/wms/st/inStor/check/ProcessDialog'
|
||||
import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
@@ -232,6 +231,8 @@ export default {
|
||||
edit: ['admin', 'check:edit'],
|
||||
del: ['admin', 'check:del']
|
||||
},
|
||||
processDialogShow: false,
|
||||
openParam: '',
|
||||
check_flag: true,
|
||||
downdtl_flag: true,
|
||||
confirm_flag: true,
|
||||
@@ -341,6 +342,11 @@ export default {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
exceptionDispose() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
this.openParam = _selectData[0].check_code
|
||||
this.processDialogShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user