Browse Source

fix: 与acs交互之间存在的问题

master
李永德 1 year ago
parent
commit
ab69d3e9eb
  1. 6
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/notice/ISysNoticeService.java
  2. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java
  3. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java
  4. 13
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/DeviceInfoDto.java
  5. 9
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/PutActionRequest.java
  6. 39
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  7. 30
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java
  8. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java
  9. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java
  10. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml
  11. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java
  12. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/service/impl/ReportServiceImpl.java
  13. 19
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java
  14. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/AcsUtil.java
  15. 108
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/auto/HLYZTask.java
  16. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java
  17. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java
  18. 32
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java
  19. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java
  20. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQLTask.java
  21. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJRKTask.java
  22. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSKTask.java
  23. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java
  24. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java
  25. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java
  26. 19
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java
  27. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZQKTask.java
  28. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSKTask.java
  29. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java
  30. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java
  31. 100
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/XmlFormatter.java
  32. 14
      lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java
  33. 10
      lms/nladmin-ui/src/views/wms/das/inKiln/index.vue
  34. 8
      lms/nladmin-ui/src/views/wms/das/inspection/index.vue
  35. 8
      lms/nladmin-ui/src/views/wms/das/intoKiln/index.vue
  36. 8
      lms/nladmin-ui/src/views/wms/das/outKiln/index.vue
  37. 30
      lms/nladmin-ui/src/views/wms/ext/record/index.vue

6
lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/notice/ISysNoticeService.java

@ -75,9 +75,9 @@ public interface ISysNoticeService extends IService<SysNotice> {
/**
* 写入信息
* @param msg
* @param title
* @param type
* @param msg: 数据信息
* @param title: 唯一
* @param type: 类型
*/
void createNotice(String msg, String title, String type);
}

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java

@ -2,6 +2,7 @@ package org.nl.wms.ext.acs.service;
import com.alibaba.fastjson.JSONArray;
import org.nl.wms.ext.acs.service.dto.ResultForAcs;
import org.nl.wms.ext.acs.service.dto.to.acs.DeviceInfoDto;
import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest;
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
import org.nl.wms.pdm.workorder.service.dao.vo.AcsWorkOrderVo;
@ -29,4 +30,11 @@ public interface WmsToAcsService {
* @return
*/
ResultForAcs getVehicleForLaminatingMachine(List<PutActionRequest> list);
/**
* 获取设备状态
* @param list
* @return
*/
ResultForAcs getDeviceStatusByCode(List<DeviceInfoDto> list);
}

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/ApplyTaskResponse.java

@ -16,6 +16,7 @@ public class ApplyTaskResponse extends BaseResponse {
* 是否优先包装
*/
private String is_package;
private String mix_number;
public static ApplyTaskResponse responseOk(String requestNo) {
ApplyTaskResponse response = new ApplyTaskResponse();

13
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/DeviceInfoDto.java

@ -0,0 +1,13 @@
package org.nl.wms.ext.acs.service.dto.to.acs;
import lombok.Data;
/**
* @Author: lyd
* @Description:
* @Date: 2023/8/4
*/
@Data
public class DeviceInfoDto {
private String device_code;
}

9
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/PutActionRequest.java

@ -1,5 +1,7 @@
package org.nl.wms.ext.acs.service.dto.to.acs;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import lombok.Data;
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
import org.nl.wms.ext.acs.service.dto.SignalData;
@ -25,4 +27,11 @@ public class PutActionRequest extends BaseRequest {
*/
private List<SignalData> list;
public static PutActionRequest createRequest() {
PutActionRequest baseRequest = new PutActionRequest();
baseRequest.setRequestNo(IdUtil.simpleUUID());
baseRequest.setRequestDate(DateUtil.now());
return baseRequest;
}
}

39
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -108,6 +108,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public BaseResponse acsApply(JSONObject param) {
String requestNo = param.getString("requestNo");
String requestMethodName = param.getString("request_medthod_name");
BaseResponse result = BaseResponse.build(requestNo);
try {
String requestMethodCode = param.getString("request_medthod_code"); // 获取请求方法名
@ -125,11 +126,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result.setMessage(message);
result.setRequestNo(requestNo);
// 消息通知
noticeService.createNotice("异常信息:" + message, "acsApply: " + requestNo,
noticeService.createNotice("异常信息:" + message, "acsApply: " + param.getString("request_medthod_code"),
NoticeTypeEnum.EXCEPTION.getCode());
}
// acs对接记录
interactRecordService.saveRecord(param.getString("request_medthod_name"), param, result, GeneralDefinition.ACS_LMS);
interactRecordService.saveRecord(requestMethodName, param, result, GeneralDefinition.ACS_LMS);
return result;
}
@ -314,6 +315,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
/** 强制去包装位(半托) 记录不包装 --- 业务不需要*/
@Deprecated
public String forceNoPackage(JSONObject param) {
String requestNo = param.getString("requestNo");
return requestNo;
@ -347,10 +349,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
PdmBdVehicleBinding vehicleBinding = new PdmBdVehicleBinding();
vehicleBinding.setOrigin_vehicle_code(request.getGet_station_vehicle_code());
vehicleBinding.setOrigin_vehicle_type(pickupPoint.getVehicle_type());
vehicleBinding.setOrigin_qty(request.getGet_station_qty());
vehicleBinding.setOrigin_qty(request.getGet_station_qty()); // 当前码垛位的数量
vehicleBinding.setTarget_vehicle_code(request.getPut_station_vehicle_code());
vehicleBinding.setTarget_vehicle_type(putPoint.getVehicle_type());
vehicleBinding.setTarget_qty(request.getPut_station_qty());
vehicleBinding.setTarget_qty(request.getPut_station_qty()); // 当前拆垛位的数量
if (productionTask != null) {
vehicleBinding.setOrder_code(productionTask.getWorkorder_code());
}
@ -368,7 +370,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/** 申请贴标 */
public BaseResponse applyLabelling(JSONObject param) {
// 木托盘号##物料编码##数量##吨量(单重X数量)##生产日期##成型工单号(mes提供压制工单
// 木托盘号##物料编码##数量##吨量(单重X数量)##生产日期## todo: 成型工单号(未添加
String requestNo = param.getString("requestNo");
ApplyTaskRequest baseRequest = param.toJavaObject(ApplyTaskRequest.class);
if (baseRequest.getVehicle_code() == null) {
@ -435,6 +437,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/** 扫码成功申请 - 判断是否静置完成 */
public ApplyTaskResponse barcodeSuccessApply(JSONObject param) {
ApplyTaskRequest baseRequest = param.toJavaObject(ApplyTaskRequest.class);
ApplyTaskResponse taskResponse = ApplyTaskResponse.responseOk(baseRequest.getRequestNo());
String deviceCode = baseRequest.getDevice_code();
SchBasePoint basePoint = pointService.getById(deviceCode); // 获取点位实体
switch (basePoint.getRegion_code()) {
@ -443,7 +446,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
case GeneralDefinition.GZY: // 如果是入窑口就是记录数据
return this.recordKilnTime(baseRequest); // 直接返回
default:
return (ApplyTaskResponse) ApplyTaskResponse.responseError(baseRequest.getRequestNo(),"参数错误");
taskResponse.setMessage("参数错误!");
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST);
return taskResponse;
}
}
@ -454,29 +459,36 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
ApplyTaskResponse taskResponse = ApplyTaskResponse.responseOk(requestNo);
SchBasePoint basePoint = pointService.getById(baseRequest.getDevice_code());
if (ObjectUtil.isEmpty(baseRequest.getVehicle_code())) {
return (ApplyTaskResponse) ApplyTaskResponse.responseError(requestNo, "载具编码不能为空!");
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST);
taskResponse.setMessage("载具编码不能为空!");
return taskResponse;
}
if (ObjectUtil.isEmpty(baseRequest.getVehicle_type())) {
baseRequest.setVehicle_type(GeneralDefinition.STEEL_TRAY);
baseRequest.setVehicle_type(GeneralDefinition.MATERIAL_CUP);
}
// 静置完成要把组盘改成以解绑
SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getGroupInfo(baseRequest.getVehicle_code(),
baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue());
if (ObjectUtil.isEmpty(one)) {
// 返回400,物料不存在
return (ApplyTaskResponse) ApplyTaskResponse.responseError(requestNo, "物料不存在!");
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST);
taskResponse.setMessage("组盘不存在或已静置完成!");
return taskResponse;
}
String yjDeviceCode = basePoint.getParent_point_code(); // 压机设备编码
// 获取当前工单
PdmBdWorkorder productionTask = workorderService.getDeviceProductionTask(yjDeviceCode);
// 校验物料是否正确
if (ObjectUtil.isEmpty(productionTask)) {
return (ApplyTaskResponse) ApplyTaskResponse.responseError(requestNo,
"压机" + yjDeviceCode + "工单不存在!");
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST);
taskResponse.setMessage("压机" + yjDeviceCode + "工单不存在!");
return taskResponse;
}
String rawMaterialCode = productionTask.getRaw_material_code();
if (!rawMaterialCode.equals(baseRequest.getMaterial_code())) {
return (ApplyTaskResponse) ApplyTaskResponse.responseError(requestNo, "物料不一样!");
if (!rawMaterialCode.equals(one.getRedundance_material_code())) {
taskResponse.setCode(HttpStatus.HTTP_BAD_REQUEST);
taskResponse.setMessage("物料不一样!");
return taskResponse;
}
// 判断是否静置完成
@ -490,6 +502,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
TaskUtils.setGroupUpdateByAcs(one);
vehiclematerialgroupService.updateById(one);
taskResponse.setMix_number(one.getMix_times());
taskResponse.setIs_standing_finish(GeneralDefinition.YES);
taskResponse.setMessage("静置完成");
return taskResponse;

30
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java

@ -5,6 +5,7 @@ import cn.hutool.http.HttpStatus;
import lombok.extern.slf4j.Slf4j;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.ext.acs.service.dto.ResultForAcs;
import org.nl.wms.ext.acs.service.dto.to.acs.DeviceInfoDto;
import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest;
import org.nl.wms.ext.record.service.ISysInteractRecordService;
import org.nl.wms.pdm.workorder.service.dao.vo.AcsWorkOrderVo;
@ -31,15 +32,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String api = "api/wms/order";
List<AcsWorkOrderVo> list = new CopyOnWriteArrayList<>();
list.add(workorder);
ResultForAcs resultForAcs = ResultForAcs.requestOk();
try {
resultForAcs = AcsUtil.notifyAcs(api, list);
} catch (Exception e) {
log.error(api + ": {}", e.getMessage());
resultForAcs.setTimestamp(DateUtil.now());
resultForAcs.setStatus(HttpStatus.HTTP_BAD_REQUEST);
resultForAcs.setMessage(e.getMessage());
}
ResultForAcs resultForAcs = AcsUtil.notifyAcs(api, list);
// 记录日志
interactRecordService.saveRecord("下发工单", workorder, resultForAcs, GeneralDefinition.LMS_ACS);
return resultForAcs;
@ -48,17 +41,18 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
@Override
public ResultForAcs getVehicleForLaminatingMachine(List<PutActionRequest> list) {
String api = "api/wms/order"; // todo: 地址未确认
ResultForAcs resultForAcs = ResultForAcs.requestOk();
try {
resultForAcs = AcsUtil.notifyAcs(api, list);
} catch (Exception e) {
log.error(api + ": {}", e.getMessage());
resultForAcs.setTimestamp(DateUtil.now());
resultForAcs.setStatus(HttpStatus.HTTP_BAD_REQUEST);
resultForAcs.setMessage(e.getMessage());
}
ResultForAcs resultForAcs = AcsUtil.notifyAcs(api, list);
// 记录日志
interactRecordService.saveRecord("下发信号传送空木托盘", list, resultForAcs, GeneralDefinition.LMS_ACS);
return resultForAcs;
}
@Override
public ResultForAcs getDeviceStatusByCode(List<DeviceInfoDto> list) {
String api = "api/wms/order"; // todo: 地址未确认
ResultForAcs resultForAcs = AcsUtil.notifyAcs(api, list);
// 记录日志
interactRecordService.saveRecord("获取设备状态", list, resultForAcs, GeneralDefinition.LMS_ACS);
return resultForAcs;
}
}

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java

@ -2,6 +2,7 @@ package org.nl.wms.ext.record.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -23,6 +24,7 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
/**
* @description 服务实现
@ -38,7 +40,17 @@ public class SysInteractRecordServiceImpl extends ServiceImpl<SysInteractRecordM
@Override
public IPage<SysInteractRecord> queryAll(Map whereJson, PageQuery page){
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
String interactDirection = ObjectUtil.isNotEmpty(whereJson.get("interact_direction")) ? whereJson.get("interact_direction").toString() : null;
LambdaQueryWrapper<SysInteractRecord> lam = new LambdaQueryWrapper<>();
lam.eq(interactDirection!=null, SysInteractRecord::getDirection, interactDirection)
.and(blurry != null, s -> s.like(SysInteractRecord::getInteract_name, blurry)
.or()
.like(SysInteractRecord::getMessage, blurry)
.or()
.like(SysInteractRecord::getRequest_param, blurry)
.or()
.like(SysInteractRecord::getResponse_param, blurry));
lam.orderByDesc(SysInteractRecord::getRecord_time);
IPage<SysInteractRecord> pages = new Page<>(page.getPage() + 1, page.getSize());
sysInteractRecordMapper.selectPage(pages, lam);

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java

@ -35,7 +35,6 @@ public class PdaController {
@PostMapping("/deviceCheck/verify")
@Log("设备点检")
@ApiOperation("设备点检")
@SaIgnore
public ResponseEntity<Object> deviceCheck(@Validated @RequestBody DasDeviceCheckRecord entity){
return new ResponseEntity<>(deviceCheckRecordService.create(entity), HttpStatus.OK);
}
@ -43,7 +42,6 @@ public class PdaController {
@PostMapping("/deviceCheck/deviceInfo")
@Log("设备下拉框数据")
@ApiOperation("设备下拉框数据")
@SaIgnore
public ResponseEntity<Object> deviceInfo(){
return new ResponseEntity<>(pdaService.getDeviceInfo(), HttpStatus.OK);
}
@ -51,7 +49,6 @@ public class PdaController {
@PostMapping("/deviceCheck/deviceStatus")
@Log("设备状态下拉框数据")
@ApiOperation("设备状态下拉框数据")
@SaIgnore
public ResponseEntity<Object> deviceStatus(){
return new ResponseEntity<>(pdaService.getDeviceStatus(), HttpStatus.OK);
}

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/mapper/PdmBdWorkorderMapper.xml

@ -36,6 +36,7 @@
w.point_code AS device_code,
w.plan_qty,
m.half_material_code AS material_code,
0 AS to_material_code,
0 AS a,
0 AS b,
0 AS h,

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java

@ -12,6 +12,7 @@ public class AcsWorkOrderVo {
private String workorder_code;
private String device_code;
private String material_code;
private String to_material_code;
private String plan_qty;
private String a;
private String b;

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/report/service/impl/ReportServiceImpl.java

@ -15,7 +15,7 @@ import java.util.Map;
/**
* @Author: lyd
* @Description:
* @Description: 报表实现类
* @Date: 2023/7/21
*/
@Slf4j

19
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java

@ -111,6 +111,13 @@ public abstract class AbstractTask {
resultForAcs.setStatus(HttpStatus.HTTP_BAD_REQUEST);
resultForAcs.setMessage(e.getMessage());
}
// 如果下发完毕,就修改状态
if (resultForAcs.getStatus() == 200) {
for (SchBaseTask schBaseTask : taskList) {
schBaseTask.setTask_status(TaskStatus.ISSUED.getCode());
}
taskService.updateBatchById(taskList);
}
// 记录日志
interactRecordService.saveRecord("下发任务", list, resultForAcs, GeneralDefinition.LMS_ACS);
return resultForAcs;
@ -132,6 +139,16 @@ public abstract class AbstractTask {
public void schedule() {
this.autoCreate();
this.create();
// 下发
this.getAllFinishTask();
}
public void getAllFinishTask() {
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
.eq(SchBaseTask::getTask_status, TaskStatus.CREATED.getCode()));
if (ObjectUtil.isEmpty(list)) return;
// 下发
this.renotifyAcs(list);
}
public void updateTaskStatus(String task_code, TaskStatus status) {
@ -216,7 +233,7 @@ public abstract class AbstractTask {
taskConfig.getConfig_code(), apply_point_code, taskConfig.getTask_direction());
Assert.isFalse(unFinishTasksByTaskConfig.size() >= tcmn,
"该点位申请的任务未完成数已超过上限,无法申请任务");
apply_point_code + "该点位申请的任务未完成数已超过上限,无法申请任务");
// 获取对接位点位对象
SchBasePoint pointObj = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, apply_point_code));

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/AcsUtil.java

@ -34,13 +34,13 @@ public class AcsUtil {
//判断是否连接ACS系统
Param isConnectAcs = sysParamService.findByCode(GeneralDefinition.IS_CONNECT_ACS);
if (ObjectUtil.isEmpty(isConnectAcs)) {
throw new BadRequestException("参数表中:" + GeneralDefinition.IS_CONNECT_ACS + "不存在");
return ResultForAcs.requestRefuse("参数表中:" + GeneralDefinition.IS_CONNECT_ACS + "不存在");
}
String isConnect = isConnectAcs.getValue();
//ACS地址:127.0.0.1:8010
Param acsUrlObj = sysParamService.findByCode(GeneralDefinition.ACS_URL);
if (ObjectUtil.isEmpty(acsUrlObj)) {
throw new BadRequestException("参数表中:" + GeneralDefinition.ACS_URL + "不存在");
return ResultForAcs.requestRefuse("参数表中:" + GeneralDefinition.ACS_URL + "不存在");
}
String acsUrl = acsUrlObj.getValue();
JSONObject result;

108
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/auto/HLYZTask.java

@ -1,108 +0,0 @@
//package org.nl.wms.sch.task_manage.task.tasks.auto;
//
//import cn.hutool.core.util.ObjectUtil;
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import org.nl.common.exception.BadRequestException;
//import org.nl.system.service.param.ISysParamService;
//import org.nl.system.service.param.dao.Param;
//import org.nl.wms.sch.point.service.ISchBasePointService;
//import org.nl.wms.sch.point.service.dao.SchBasePoint;
//import org.nl.wms.sch.task.service.ISchBaseTaskService;
//import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
//import org.nl.wms.sch.task.service.dao.SchBaseTask;
//import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
//import org.nl.wms.sch.task_manage.AbstractTask;
//import org.nl.wms.sch.task_manage.GeneralDefinition;
//import org.nl.wms.sch.task_manage.task.TaskType;
//import org.nl.wms.sch.task_manage.task.core.TaskStatus;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.util.Arrays;
//import java.util.List;
//import java.util.stream.Collectors;
//
///**
// * @Author: lyd
// * @Description: 混料压制物料输送任务
// * @Date: 2023/7/27
// */
//@Component
//@TaskType("HLYZTask")
//public class HLYZTask extends AbstractTask {
// private static String TASK_CONFIG_CODE = "HLYZTask";
// @Autowired
// private ISchBasePointService pointService;
// @Autowired
// private ISchBaseTaskService taskService;
// @Autowired
// private ISchBaseTaskconfigService taskConfigService;
// @Autowired
// private ISysParamService paramService;
// @Override
// protected void create() throws BadRequestException {
//
// }
//
// @Override
// protected void autoCreate() {
// // 自动创建任务
//// Param autoKilnCall = paramService.findByCode(GeneralDefinition.AUTO_KILN_CALL);
//// if (autoKilnCall.getValue().equals(GeneralDefinition.NO)) {
//// return;
//// }
// // 判断当前点位有没有任务执行
// List<SchBaseTask> unFinishTasksByTaskConfig = taskService.findUnFinishTasksByTaskConfig(TASK_CONFIG_CODE);
// if (unFinishTasksByTaskConfig.size() > 0) {
// // 有任务在执行就不创建
// return;
// }
// // 获取任务配置
// SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
// .eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));
// // 创建任务
// SchBaseTask task = new SchBaseTask(); // 任务实体
// // 2、创建申请任务
// task.setConfig_code(TASK_CONFIG_CODE);
// task.setCreate_mode(GeneralDefinition.AUTO_CREATION);
// task.setTask_status(TaskStatus.APPLY.getCode());
// task.setWorkshop_code(taskConfig.getWorkshop_code()); // 车间编码
// // 设置起/终点
// this.setTaskPoint(taskConfig, task, "***");
// // 找起点
// List<String> nextRegionStr = Arrays
// .stream(taskConfig.getNext_region_str().split(","))
// .collect(Collectors.toList());
// SchBasePoint point = findNextPoint(nextRegionStr);
// if (ObjectUtil.isEmpty(point)) {
// task.setRemark("未找到所需点位!");
// taskService.create(task);
// // 消息通知
// return;
// }
// // 设置终点并修改创建成功状态
// task.setPoint_code2(point.getPoint_code());
// task.setRemark("");
// task.setTask_status(TaskStatus.CREATED.getCode());
// taskService.create(task);
// point.setIng_task_code(task.getTask_code());
// pointService.update(point);
// //下发
//// this.renotifyAcs(task);
// }
//
// @Override
// protected void updateStatus(String task_code, TaskStatus status) {
//
// }
//
// @Override
// public void forceFinish(String task_code) {
//
// }
//
// @Override
// public void cancel(String task_code) {
//
// }
//}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/CTQKTask.java

@ -80,7 +80,7 @@ public class CTQKTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/dtk/DTSKTask.java

@ -81,7 +81,7 @@ public class DTSKTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}

32
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java

@ -124,40 +124,35 @@ public class FJMKTask extends AbstractTask {
pointService.updateById(basePoint);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}
@Override
public String setGroupPlate(JSONObject param) {
// 载具编码从点位中获取
// 组盘,返回组盘标识,设置待绑定,搬运结束就设置已绑定
String vehicleCode = param.getString("vehicle_code");
if (vehicleCode == null) {
throw new BadRequestException("载具编码不能为空");
}
String vehicleType = param.getString("vehicle_type");
String workorderCode = param.getString("workorder_code");
JSONObject stackParameters = param.getJSONObject("palletize");
if (vehicleType == null) {
vehicleType = GeneralDefinition.STEEL_TRAY;
}
String deviceCode = param.getString("device_code");
String isFull = param.getString("is_full");
if (isFull == null) {
isFull = GeneralDefinition.YES;
}
// 砖块数量
Integer qty = param.getInteger("qty");
SchBasePoint basePoint = pointService.getById(deviceCode);
PdmBdWorkorder workorderObject = ObjectUtil.isNotEmpty(workorderCode)
? workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>()
.eq(PdmBdWorkorder::getWorkorder_code, workorderCode))
: null;
PdmBdWorkorder workorderObject = workorderService.getDeviceProductionTask(basePoint.getParent_point_code());
String vehicleCode = basePoint.getVehicle_code();
String vehicleType = basePoint.getVehicle_type();
// 找到相同组盘信息就直接返回id,避免任务取消组盘信息还存在,重复插入
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup();
groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr());
SchBaseVehiclematerialgroup groupObject = vehiclematerialgroupService.getGroupInfo(vehicleCode, vehicleType,
GroupBindMaterialStatusEnum.BOUND.getValue(), workorderObject.getMaterial_id());
if (groupObject != null) {
return groupObject.getGroup_id();
groupEntity = groupObject;
}
// 要把数据存到组盘表
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup();
groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr());
groupEntity.setMaterial_id(ObjectUtil.isNotEmpty(workorderObject)
? workorderObject.getMaterial_id()
: "");
@ -183,9 +178,8 @@ public class FJMKTask extends AbstractTask {
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 绑定
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
groupEntity.setIs_delete(false);
groupEntity.setIs_full(isFull.equals(GeneralDefinition.YES) ? true : false);
vehiclematerialgroupService.save(groupEntity);
// 将所有当前位置的砖块设置组盘标识
// baseBrickInfoService.setGroupByCurrentAllBrick(deviceCode, groupEntity.getGroup_id());
// 返回组盘id记录任务中
return groupEntity.getGroup_id();
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQKTask.java

@ -104,7 +104,7 @@ public class FJQKTask extends AbstractTask {
pointService.updateById(basePoint);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQLTask.java

@ -99,7 +99,7 @@ public class FJQLTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}
@ -119,7 +119,7 @@ public class FJQLTask extends AbstractTask {
: null;
Assert.notNull(workOrder, "工单不能为空!");
// 从所选区域中,选择满料位、无锁、可用的点位
List<SchBasePoint> points = fjMapper.findPointForFJQL(startRegionStr, workOrder.getRaw_material_code());
List<SchBasePoint> points = fjMapper.findPointForFJQL(startRegionStr, workOrder.getMaterial_id());
return ObjectUtil.isNotEmpty(points) ? points.get(0) : null;
}
@ -177,7 +177,7 @@ public class FJQLTask extends AbstractTask {
PointUtils.setUpdateByType(startPointObj, taskFinishedType);
PointUtils.clearPoint(startPointObj);
SchBaseVehiclematerialgroup vehicleMaterialGroupObj =
vehiclematerialgroupService.getById(taskObj.getGroup_id());
vehiclematerialgroupService.getById(taskObj.getGroup_id());
// 等到变成空盘才能解除
// vehicleMaterialGroupObj.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
vehicleMaterialGroupObj.setPoint_code(endPointObj.getPoint_code()); // 当前位置
@ -196,7 +196,7 @@ public class FJQLTask extends AbstractTask {
// 终点设置对应的参数
endPointObj.setVehicle_code(startPointObj.getVehicle_code());
endPointObj.setVehicle_type(startPointObj.getVehicle_type());
endPointObj.setPoint_status(PointStatusEnum.FULL_POINT.getCode());
endPointObj.setPoint_status(PointStatusEnum.EMPTY_VEHICLE.getCode());
PointUtils.setUpdateByType(endPointObj, taskFinishedType);
pointService.updateById(endPointObj);
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJRKTask.java

@ -85,7 +85,7 @@ public class FJRKTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSKTask.java

@ -86,7 +86,7 @@ public class FJSKTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJSLTask.java

@ -56,7 +56,7 @@ public class FJSLTask extends AbstractTask {
private ISysNoticeService noticeService;
@Override
protected void create() throws BadRequestException {
// 获取任务
// 获取任务
List<SchBaseTask> tasks = taskService.findTasksByTaskStatus(TASK_CONFIG_CODE, TaskStatus.APPLY);
// 配置信息
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
@ -89,7 +89,7 @@ public class FJSLTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}

15
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java

@ -136,7 +136,7 @@ public class HNMLTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
// this.renotifyAcs(task);
}
}
@ -234,7 +234,7 @@ public class HNMLTask extends AbstractTask {
}
}
// 更新组盘数据
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue());
TaskUtils.setGroupUpdateByType(groupEntity, taskFinishedType);
vehiclematerialgroupService.updateById(groupEntity);
// 起点清空 - 由ACS请求修改
@ -273,7 +273,7 @@ public class HNMLTask extends AbstractTask {
String vehicleType = param.getString("vehicle_type");
// 泥料物料对应不出物料标识
String materialCode = param.getString("material_code"); // 泥料编码
String mixTimes = param.getString("grinding_number"); // 碾次
String mixTimes = param.getString("mix_number"); // 碾次
// 载具类型默认料盅
if (vehicleType == null) {
vehicleType = GeneralDefinition.MATERIAL_CUP;
@ -286,15 +286,16 @@ public class HNMLTask extends AbstractTask {
if (vehicleCode == null) {
throw new BadRequestException("载具编码不能为空");
}
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup();
groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr());
// 找到相同组盘信息就直接返回id,避免任务取消组盘信息还存在,重复插入
// 找到不直接返回,用那条数据进行修改
SchBaseVehiclematerialgroup groupObject = vehiclematerialgroupService.getGroupInfo(vehicleCode, vehicleType,
GroupBindMaterialStatusEnum.BOUND.getValue());
if (groupObject != null) {
return groupObject.getGroup_id();
groupEntity = groupObject;
}
// 要把数据存到组盘表
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup();
groupEntity.setGroup_id(IdUtil.getSnowflake(1, 1).nextIdStr());
groupEntity.setMaterial_id("-");
groupEntity.setRedundance_material_code(materialCode);
groupEntity.setCreate_id(GeneralDefinition.ACS_ID);
@ -314,7 +315,7 @@ public class HNMLTask extends AbstractTask {
groupEntity.setGroup_bind_material_status(GroupBindMaterialStatusEnum.BOUND.getValue()); // 待绑定
groupEntity.setGroup_status(GroupStatusEnum.IN_STORAGE.getType()); // 暂时不维护。
groupEntity.setIs_delete(false);
vehiclematerialgroupService.save(groupEntity);
vehiclematerialgroupService.saveOrUpdate(groupEntity);
return groupEntity.getGroup_id();
}
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/CYZCTask.java

@ -94,7 +94,7 @@ public class CYZCTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}

19
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yao/GZYQLTask.java

@ -19,6 +19,7 @@ import org.nl.wms.sch.task_manage.enums.PointStatusEnum;
import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum;
import org.nl.wms.sch.task_manage.task.TaskType;
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
import org.nl.wms.sch.task_manage.task.tasks.yz.mapper.YZMapper;
import org.nl.wms.util.PointUtils;
import org.nl.wms.util.TaskUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -47,6 +48,8 @@ public class GZYQLTask extends AbstractTask {
@Autowired
private ISysNoticeService noticeService;
@Autowired
private YZMapper yzMapper;
@Override
protected void create() throws BadRequestException {
// 获取任务
@ -82,12 +85,23 @@ public class GZYQLTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}
/**
* 找到有货最多的那层搬运到入窑口
* @param startRegionStr
* @param jsonObject
* @return
*/
private SchBasePoint findStartPoint(List<String> startRegionStr, JSONObject jsonObject) {
// 无需工单
// 判断是使用desc还是asc
int countUp = yzMapper.countConveyorLine(startRegionStr.get(0), GeneralDefinition.UPPER_CONVEYOR_LINE,
PointStatusEnum.EMPTY_VEHICLE.getCode());
int countLower = yzMapper.countConveyorLine(startRegionStr.get(0), GeneralDefinition.LOWER_CONVEYOR_LINE,
PointStatusEnum.EMPTY_VEHICLE.getCode());
// 默认认为缓存线有东西
LambdaQueryWrapper<SchBasePoint> lam = new LambdaQueryWrapper<>();
lam.in(SchBasePoint::getRegion_code, startRegionStr)
@ -96,7 +110,8 @@ public class GZYQLTask extends AbstractTask {
.or()
.eq(SchBasePoint::getIng_task_code, ""))
.eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_VEHICLE.getCode())
.eq(SchBasePoint::getIs_used, true);
.eq(SchBasePoint::getIs_used, true)
.orderBy(true, countUp > countLower, SchBasePoint::getPoint_code);;
List<SchBasePoint> schBasePoints = pointService.list(lam);
return ObjectUtil.isNotEmpty(schBasePoints) ? schBasePoints.get(0) : null;
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZQKTask.java

@ -83,7 +83,7 @@ public class YZQKTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSKTask.java

@ -88,7 +88,7 @@ public class YZSKTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java

@ -106,7 +106,7 @@ public class YZSLTask extends AbstractTask {
pointService.updateById(point);
//下发
this.renotifyAcs(task);
//this.renotifyAcs(task);
}
}
@ -198,7 +198,6 @@ public class YZSLTask extends AbstractTask {
throw new BadRequestException("载具编码不能为空");
}
String vehicleType = param.getString("vehicle_type");
String workorderCode = param.getString("workorder_code");
JSONObject stackParameters = param.getJSONObject("palletize");
if (vehicleType == null) {
vehicleType = GeneralDefinition.STEEL_TRAY;
@ -211,10 +210,7 @@ public class YZSLTask extends AbstractTask {
// 砖块数量
Integer qty = param.getInteger("qty");
SchBasePoint basePoint = pointService.getById(deviceCode);
PdmBdWorkorder workorderObject = ObjectUtil.isNotEmpty(workorderCode)
? workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>()
.eq(PdmBdWorkorder::getWorkorder_code, workorderCode))
: null;
PdmBdWorkorder workorderObject = workorderService.getDeviceProductionTask(basePoint.getParent_point_code());
// 找到相同组盘信息就直接返回id,避免任务取消组盘信息还存在,重复插入
SchBaseVehiclematerialgroup groupObject = vehiclematerialgroupService.getGroupInfo(vehicleCode, vehicleType,
GroupBindMaterialStatusEnum.WAIT_BIND.getValue(), workorderObject.getMaterial_id());

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java

@ -44,7 +44,7 @@ public class CommonUtils {
// 请求ACS释放一个木托盘
public static List<PutActionRequest> requestAcsReleaseVehicle(HashMap<String, String> map, String deviceCode) {
List<PutActionRequest> list = new CopyOnWriteArrayList<>();
PutActionRequest putActionRequest = (PutActionRequest) BaseRequest.createRequest();
PutActionRequest putActionRequest = PutActionRequest.createRequest();
putActionRequest.setDevice_code(deviceCode);
List<SignalData> signalList = new CopyOnWriteArrayList<>();
for (Map.Entry<String, String> entry : map.entrySet()) {

100
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/XmlFormatter.java

@ -0,0 +1,100 @@
package org.nl.wms.util;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
* @Author: lyd
* @Description: 将xml字符串存入xml文件中
* @Date: 2023/8/7
*/
public class XmlFormatter {
public static void main(String[] args) {
String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<definitions>\n" +
" <process id=\"JGXL\" name=\"机关下料\">\n" +
" <start id=\"start\" name=\"Starter\" targetRef=\"A1_JGXL\"></start>\n" +
" <flow id=\"A1_JGXL\" name=\"机关下料工序\" has=\"1\" sourceRef=\"start\" targetRef=\"A1_TWYTJ\">\n" +
" <param id=\"cacheLine\" has=\"2\">\n" +
" <item spec=\"15\" value=\"A1_HCX_01\"></item>\n" +
" <item spec=\"22\" value=\"A1_HCX_02\"></item>\n" +
" </param>\n" +
" </flow>\n" +
" <flow id=\"A1_TWYTJ\" name=\"推弯一体工序\" sourceRef=\"A1_JGXL\" targetRef=\"A1_SKQX\">\n" +
" </flow>\n" +
" <flow id=\"A1_SKQX\" name=\"深坑清洗\" sourceRef=\"A1_TWYTJ\" targetRef=\"end\"></flow>\n" +
" <end id=\"end\" name=\"Junior Reject End\" sourceRef=\"A1_SKQX\"></end>\n" +
" </process>\n" +
" <process id=\"WXXL\" name=\"直管无屑下料\">\n" +
" <start id=\"start\" name=\"Starter\" targetRef=\"A1_WXXL\"></start>\n" +
" <flow id=\"A1_WXXL\" name=\"无屑下料工序\" has=\"1\" sourceRef=\"starter\" targetRef=\"A1_STLS\">\n" +
" <param id=\"cacheLine\" value=\"A1_HCX_03\"/>\n" +
" </flow>\n" +
" <flow id=\"A1_STLS\" name=\"三通拉伸工序\" sourceRef=\"A1_WXXL\" targetRef=\"A1_TK\"></flow>\n" +
" <flow id=\"A1_TK\" name=\"镗孔\" sourceRef=\"A1_TK\" targetRef=\"A1_SKQX\"></flow>\n" +
" <flow id=\"A1_SKQX\" name=\"深坑清洗\" sourceRef=\"A1_STLS\" targetRef=\"end\"></flow>\n" +
" <end id=\"end\" name=\"Junior Reject End\" sourceRef=\"A1_SKQX\"></end>\n" +
" </process>\n" +
"</definitions>\n";
// 格式化XML字符串
String formattedXmlString = formatXmlString(xmlString);
// 将格式化后的XML字符串存储到文件中
String fileName = "xx.xml";
saveXmlToFile(fileName, formattedXmlString);
}
public static String formatXmlString(String xmlString) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new java.io.StringReader(xmlString)));
// 格式化XML
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
DOMSource source = new DOMSource(document);
java.io.StringWriter sw = new java.io.StringWriter();
StreamResult result = new StreamResult(sw);
transformer.transform(source, result);
return sw.toString();
} catch (ParserConfigurationException | IOException | SAXException | TransformerException e) {
e.printStackTrace();
}
return xmlString;
}
public static void saveXmlToFile(String fileName, String xmlString) {
try {
File file = new File(fileName);
FileWriter writer = new FileWriter(file);
writer.write(xmlString);
writer.flush();
writer.close();
System.out.println("XML file saved successfully.");
} catch (IOException e) {
e.printStackTrace();
}
}
}

14
lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java

@ -58,4 +58,18 @@ public class test {
// return g;
// }
@Test
void test03() {
try {
for (int i = 0; i < 5; i++) {
System.out.println(i);
if (i==3) {
throw new RuntimeException("1");
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}

10
lms/nladmin-ui/src/views/wms/das/inKiln/index.vue

@ -13,14 +13,6 @@
<el-table-column prop="material_code" label="产品编码" :min-width="flexWidth('material_code',crud.data,'拆垛工位')" />
<el-table-column prop="material_name" label="产品名称" :min-width="flexWidth('material_name',crud.data,'分拣工单')" />
<el-table-column prop="material_qty" label="产品数量" :min-width="flexWidth('material_qty',crud.data,'分拣工单')" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
@ -40,7 +32,7 @@ export default {
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
title: '窑记录报表',
title: '窑记录报表',
url: 'api/report/inKilnReport',
optShow: {
add: false,

8
lms/nladmin-ui/src/views/wms/das/inspection/index.vue

@ -40,14 +40,6 @@
<el-table-column prop="material_qty" label="数量" :min-width="flexWidth('material_qty',crud.data,'数量')" />
<el-table-column prop="point_code" label="拆垛工位" :min-width="flexWidth('point_code',crud.data,'拆垛工位')" />
<el-table-column prop="workorder_code" label="分拣工单" :min-width="flexWidth('workorder_code',crud.data,'分拣工单')" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />

8
lms/nladmin-ui/src/views/wms/das/intoKiln/index.vue

@ -14,14 +14,6 @@
<el-table-column prop="material_code" label="产品编码" :min-width="flexWidth('material_code',crud.data,'拆垛工位')" />
<el-table-column prop="material_name" label="产品名称" :min-width="flexWidth('material_name',crud.data,'分拣工单')" />
<el-table-column prop="material_qty" label="产品数量" :min-width="flexWidth('material_qty',crud.data,'分拣工单')" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />

8
lms/nladmin-ui/src/views/wms/das/outKiln/index.vue

@ -14,14 +14,6 @@
<el-table-column prop="material_code" label="产品编码" :min-width="flexWidth('material_code',crud.data,'拆垛工位')" />
<el-table-column prop="material_name" label="产品名称" :min-width="flexWidth('material_name',crud.data,'分拣工单')" />
<el-table-column prop="material_qty" label="产品数量" :min-width="flexWidth('material_qty',crud.data,'分拣工单')" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />

30
lms/nladmin-ui/src/views/wms/ext/record/index.vue

@ -2,6 +2,36 @@
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="90px"
label-suffix=":"
>
<el-form-item label="模糊查询">
<el-input
v-model="query.blurry"
clearable
size="mini"
placeholder="对接名称/内容"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="请求方向">
<el-select v-model="query.interact_direction" placeholder="请求方向" clearable>
<el-option
v-for="item in dict.interact_direction"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->

Loading…
Cancel
Save