Browse Source

fix: 交互业务

master
李永德 1 year ago
parent
commit
c4883efe34
  1. BIN
      lms/nladmin-system/doc/wms.xls
  2. 27
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoClearInteractionData.java
  3. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java
  4. 3
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/BrickInfoDto.java
  5. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/ResultForAcs.java
  6. 126
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/acs/CreateTaskRequest.java
  7. 32
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/ApplyDeviceDto.java
  8. 27
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/ApplySignalStatusRequest.java
  9. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/ApplyTaskRequest.java
  10. 19
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/to/wms/CreateTaskResponse.java
  11. 165
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  12. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java
  13. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java
  14. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java
  15. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml
  16. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java
  17. 66
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/controller/PdmBdMudConsumptionController.java
  18. 43
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/IPdmBdMudConsumptionService.java
  19. 53
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dao/PdmBdMudConsumption.java
  20. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dao/mapper/PdmBdMudConsumptionMapper.java
  21. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dao/mapper/PdmBdMudConsumptionMapper.xml
  22. 41
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dto/PdmBdMudConsumptionDto.java
  23. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dto/PdmBdMudConsumptionQuery.java
  24. 68
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/impl/PdmBdMudConsumptionServiceImpl.java
  25. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java
  26. 44
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java
  27. 117
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AcsTaskDto.java
  28. 38
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/AcsUtil.java
  29. 15
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java
  30. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJQLTask.java
  31. 25
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJRKTask.java
  32. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java
  33. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZQKTask.java
  34. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java
  35. 10
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java
  36. 4
      lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml
  37. 33
      lms/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml
  38. 27
      lms/nladmin-system/nlsso-server/src/test/java/org/nl/point/test.java
  39. 56
      lms/nladmin-system/nlsso-server/src/test/java/org/nl/task/MapperTest.java
  40. 108
      lms/nladmin-ui/src/views/wms/pdm/consumption/index.vue
  41. 27
      lms/nladmin-ui/src/views/wms/pdm/consumption/pdmBdMudConsumption.js

BIN
lms/nladmin-system/doc/wms.xls

Binary file not shown.

27
lms/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoClearInteractionData.java

@ -0,0 +1,27 @@
package org.nl.system.service.quartz.task;
import lombok.extern.slf4j.Slf4j;
import org.nl.system.service.param.ISysParamService;
import org.nl.system.service.param.dao.Param;
import org.nl.wms.ext.record.service.ISysInteractRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @Author: lyd
* @Description: 自动清理交互数据
* @Date: 2023/8/11
*/
@Slf4j
@Component
public class AutoClearInteractionData {
@Autowired
private ISysInteractRecordService recordService;
@Autowired
private ISysParamService paramService;
public void run(){
Param interactionDay = paramService.findByCode("interaction_day");
recordService.deleteByDay(interactionDay.getValue());
log.info("run 执行成功");
}
}

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

@ -24,14 +24,14 @@ public interface AcsToWmsService {
ApplyTaskResponse applyTakeFullVehicle(JSONObject param);
/** 任务:申请强制取走满料盅托盘(强制入库) */
ApplyTaskResponse applyForceTakeFullVehicle(JSONObject param);
/** 任务:分拣回收剩料 todo: 暂时 */
/** 任务:分拣回收剩料 */
ApplyTaskResponse applyForceTakeFullVehicleInStorage(JSONObject param);
/** 强制去包装位(半托) 记录不包装 --- 业务不需要*/
String forceNoPackage(JSONObject param);
/** 质检记录 */
BaseResponse qualityInspection(JSONObject param);
/** 分拣 - 记录钢托与木托的绑定 */
BaseResponse recordVehicleBiding(JSONObject param);
BaseResponse applyGetPutStation(JSONObject param);
/** 反馈压机残留重量*/
BaseResponse applyFeedbackWeight(JSONObject param);
/** 申请贴标 */

3
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/BrickInfoDto.java

@ -1,6 +1,7 @@
package org.nl.wms.ext.acs.service.dto;
import lombok.Data;
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
/**
* @Author: lyd
@ -8,7 +9,7 @@ import lombok.Data;
* @Date: 2023/7/18
*/
@Data
public class BrickInfoDto {
public class BrickInfoDto extends BaseRequest {
/** 当前抓取工位 **/
private String get_station;
/** 当前放置工位 **/

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/ResultForAcs.java

@ -2,12 +2,13 @@ package org.nl.wms.ext.acs.service.dto;
import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
/**
* @Author: lyd
* @Description: 统一接口返回 - 请求ACS返回的数据类型
* @Description: 统一接口返回 - 请求ACS返回的数据类型 - 以前不做处理的类型
* @Date: 2023/7/28
*/
@Data
@ -16,6 +17,7 @@ public class ResultForAcs {
private String message;
private String timestamp;
private JSONObject data;
private JSONArray errArr;
public static ResultForAcs requestRefuse(String message) {
ResultForAcs result = new ResultForAcs();

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

@ -1,8 +1,12 @@
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.sch.task_manage.AcsTaskDto;
import java.util.List;
import java.util.Map;
/**
@ -12,119 +16,17 @@ import java.util.Map;
*/
@Data
public class CreateTaskRequest extends BaseRequest {
/**
* 任务标识
*/
private String ext_task_id;
/**
* 任务编号
*/
private String task_code;
/**
* 取货点1
*/
String start_device_code;
/**
* 放货点1
*/
String next_device_code;
/**
* 取货点2
*/
String start_device_code2;
/**
* 放货点2
*/
String next_device_code2;
/**
* 对接位
*/
String put_device_code;
/**
* 优先级
*/
String priority;
/**
* 载具号
*/
String vehicle_code;
/**
* 载具号2
*/
String vehicle_code2;
/**
* 载具类型
*/
String vehicle_type;
/**
* 路由方案
*/
String route_plan_code;
/**
* 任务类型
*/
String task_type;
/**
* 立库任务类型
*
*/
String dtl_type;
/**
* Agv系统类型
* 1:1楼叉车系统
* 2:2楼1区域AGV系统
* 3:2楼2区域AGV系统
*/
String agv_system_type;
/**
* 备注
*/
String remark;
/**
* 烘箱时间
*/
String oven_time;
/**
* 烘箱温度
*/
String temperature;
/**
* agv取货高度
*/
private String start_height;
/**
* agv放货高度
*/
private String next_height;
/**
* 方向 1往左 2往右
*/
private String direction;
/**
* 扩展属性
* 任务数组
*/
Map<String,String> params;
private List<AcsTaskDto> list = null;
public static CreateTaskRequest buildRequestObj(String name, List<AcsTaskDto> list) {
CreateTaskRequest request = new CreateTaskRequest();
request.setRequest_medthod_name(name);
request.setRequestNo(IdUtil.simpleUUID());
request.setRequestDate(DateUtil.now());
request.setList(list);
return request;
}
}

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

@ -0,0 +1,32 @@
package org.nl.wms.ext.acs.service.dto.to.wms;
import lombok.Data;
/**
* @Author: lyd
* @Description:
* @Date: 2023/8/14
*/
@Data
public class ApplyDeviceDto {
/**
* 设备编码
*/
private String device_code;
/**
* 数量
*/
private String qty;
/**
* 载具号
*/
private String vehicle_code;
/**
* 载具类型
*/
private String vehicle_type;
}

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

@ -0,0 +1,27 @@
package org.nl.wms.ext.acs.service.dto.to.wms;
import lombok.Data;
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
/**
* @Author: lyd
* @Description: 光电信号实时反馈
* @Date: 2023/8/10
*/
@Data
public class ApplySignalStatusRequest extends BaseRequest {
/**
* 光电信号 0无货 1有货
*/
private String move;
/**
* 载具类型
*/
private String vehicle_type;
/**
* 是否允许 0不允许 1允许
*/
private String action;
}

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

@ -4,6 +4,8 @@ import lombok.Data;
import org.nl.wms.ext.acs.service.dto.to.BaseRequest;
import org.nl.wms.ext.acs.service.dto.PalletizeDto;
import java.util.List;
/**
* ACS 任务申请请求实体
*/
@ -44,5 +46,8 @@ public class ApplyTaskRequest extends BaseRequest {
* 砖型
*/
private PalletizeDto palletizeDto;
/**
* 关联设备属性
*/
private List<ApplyDeviceDto> list;
}

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

@ -1,5 +1,8 @@
package org.nl.wms.ext.acs.service.dto.to.wms;
import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONArray;
import lombok.Data;
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
@ -10,6 +13,22 @@ import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
*/
@Data
public class CreateTaskResponse extends BaseResponse {
private JSONArray errArr = new JSONArray();
public static CreateTaskResponse requestRefuse(String message) {
CreateTaskResponse result = new CreateTaskResponse();
result.setCode(HttpStatus.HTTP_BAD_REQUEST);
result.setMessage(message);
result.setResponseDate(DateUtil.now());
return result;
}
public static CreateTaskResponse requestOk() {
CreateTaskResponse result = new CreateTaskResponse();
result.setCode(HttpStatus.HTTP_OK);
result.setMessage("请求成功");
result.setResponseDate(DateUtil.now());
return result;
}
}

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

@ -17,16 +17,14 @@ import org.nl.wms.database.brick.service.IMdBaseBrickInfoService;
import org.nl.wms.database.material.service.IMdBaseMaterialService;
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
import org.nl.wms.ext.acs.service.dto.*;
import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest;
import org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest;
import org.nl.wms.ext.acs.service.dto.to.wms.FeedBackSplitPalletStationRequest;
import org.nl.wms.ext.acs.service.dto.to.wms.FeedBackTaskStatusRequest;
import org.nl.wms.ext.acs.service.dto.to.wms.GetPalletizeRequest;
import org.nl.wms.ext.acs.service.dto.to.wms.*;
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.ext.acs.service.dto.to.acs.ApplyTaskResponse;
import org.nl.wms.ext.acs.service.dto.to.acs.GetPalletizeResponse;
import org.nl.wms.ext.record.service.ISysInteractRecordService;
import org.nl.wms.pdm.consumption.service.IPdmBdMudConsumptionService;
import org.nl.wms.pdm.consumption.service.dao.PdmBdMudConsumption;
import org.nl.wms.pdm.record.service.IPdmBdRequestMaterialRecordService;
import org.nl.wms.pdm.record.service.dao.PdmBdRequestMaterialRecord;
import org.nl.wms.pdm.residue.service.IPdmBdMaterialResidueService;
@ -61,7 +59,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
@ -104,6 +101,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
private IPdmBdMaterialResidueService materialResidueService;
@Autowired
private IPdmBdVehicleBindingService vehicleBindingService;
@Autowired
private IPdmBdMudConsumptionService mudConsumptionService;
@Override
public BaseResponse acsApply(JSONObject param) {
@ -136,9 +135,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/**
* 任务申请补满料盅托盘(叫料)
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*
* @param param: ApplyTaskRequest的json形式
* @return
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*/
@Override
@SneakyThrows
@ -169,9 +169,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/**
* 任务申请补空料盅托盘(叫空盘)
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*
* @param param: ApplyTaskRequest的json形式
* @return
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*/
@Override
@SneakyThrows
@ -202,9 +203,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/**
* 任务申请取走空料盅托盘(送空盘)
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*
* @param param: ApplyTaskRequest的json形式
* @return
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*/
@Override
@SneakyThrows
@ -235,9 +237,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/**
* 任务申请取走满料盅托盘入库
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*
* @param param: ApplyTaskRequest的json形式
* @return
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*/
@Override
@SneakyThrows
@ -268,9 +271,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/**
* 任务申请强制取走满料盅托盘(强制入库)
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*
* @param param: ApplyTaskRequest的json形式
* @return
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*/
@Override
@SneakyThrows
@ -300,9 +304,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/**
* 任务申请强制满托入缓存 todo: 暂时
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*
* @param param: ApplyTaskRequest的json形式
* @return
* @see org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest
*/
public ApplyTaskResponse applyForceTakeFullVehicleInStorage(JSONObject param) {
// 找到当前的设备
@ -319,7 +324,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return ApplyTaskResponse.responseOk(requestNo);
}
/** 强制去包装位(半托) 记录不包装 --- 业务不需要*/
/**
* 强制去包装位(半托) 记录不包装 --- 业务不需要
*/
@Override
@Deprecated
public String forceNoPackage(JSONObject param) {
@ -327,7 +334,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return requestNo;
}
/** 质检记录 */
/**
* 质检记录
*/
@Override
public BaseResponse qualityInspection(JSONObject param) {
ApplyTaskRequest applyTaskRequest = param.toJavaObject(ApplyTaskRequest.class);
@ -336,19 +345,21 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return BaseResponse.responseOk(applyTaskRequest.getRequestNo());
}
/** 分拣 - 记录钢托与木托的绑定 */
/**
* 分拣 - 记录钢托与木托的绑定
*/
@Override
public BaseResponse recordVehicleBiding(JSONObject param) {
public BaseResponse applyGetPutStation(JSONObject param) {
FeedBackSplitPalletStationRequest request = param.toJavaObject(FeedBackSplitPalletStationRequest.class);
String getStation = request.getGet_station(); // 取货点
String putStation = request.getPut_station(); // 放货点
// 查找当前点位中的信息,如果acs没有提供,就获取点位上的数据,如果点位没有,则数据失效
SchBasePoint pickupPoint = pointService.getById(getStation);
SchBasePoint putPoint = pointService.getById(putStation);
if (request.getGet_station_vehicle_code() == null) {
if (request.getGet_station_vehicle_code() == null || request.getGet_station_vehicle_code().equals("0")) {
request.setGet_station_vehicle_code(pickupPoint.getVehicle_code());
}
if (request.getPut_station_vehicle_code() == null) {
if (request.getPut_station_vehicle_code() == null || request.getPut_station_vehicle_code().equals("0")) {
request.setPut_station_vehicle_code(putPoint.getVehicle_code());
}
// 获取工单
@ -356,11 +367,13 @@ 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_vehicle_type(GeneralDefinition.STEEL_TRAY);
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.setGet_station(request.getGet_station());
vehicleBinding.setPut_station(request.getPut_station());
if (productionTask != null) {
vehicleBinding.setOrder_code(productionTask.getWorkorder_code());
}
@ -369,7 +382,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
/** 反馈压机残留重量*/
/**
* 反馈压机残留重量
*/
@Override
public BaseResponse applyFeedbackWeight(JSONObject param) {
ApplyTaskRequest applyTaskRequest = param.toJavaObject(ApplyTaskRequest.class);
@ -377,7 +392,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return BaseResponse.responseOk(applyTaskRequest.getRequestNo());
}
/** 申请贴标 */
/**
* 申请贴标
*/
@Override
public BaseResponse applyLabelling(JSONObject param) {
// 木托盘号##物料编码##数量##吨量(单重X数量)##生产日期## todo: 成型工单号(未添加)
@ -399,17 +416,19 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return BaseResponse.responseOk(requestNo, MapOf.of("labelling", sb.toString()));
}
/** 单次放置完成 - 每块砖的信息 */
/**
* 单次放置完成 - 每块砖的信息
*/
@Override
public BaseResponse applyOneGrab(JSONObject param) {
String requestNo = param.getString("requestNo");
JSONObject brickInfo = param.getJSONObject("brick_info");
BrickInfoDto brickInfoDto = brickInfo.toJavaObject(BrickInfoDto.class);
BrickInfoDto brickInfoDto = param.toJavaObject(BrickInfoDto.class);
baseBrickInfoService.addBrickInfo(brickInfoDto); // 添加数据
return BaseResponse.responseOk(requestNo);
return BaseResponse.responseOk(brickInfoDto.getRequestNo());
}
/** 人工排产确认 */
/**
* 人工排产确认
*/
@Override
public BaseResponse orderVerify(JSONObject param) { // 执行中
String requestNo = param.getString("requestNo");
@ -428,7 +447,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return BaseResponse.responseOk(requestNo);
}
/** 工单完成 */
/**
* 工单完成
*/
@Override
public BaseResponse orderFinish(JSONObject param) { // 完成
String requestNo = param.getString("requestNo");
@ -447,7 +468,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return BaseResponse.responseOk(requestNo);
}
/** 扫码成功申请 - 判断是否静置完成 */
/**
* 扫码成功申请 - 判断是否静置完成
*/
@Override
public ApplyTaskResponse barcodeSuccessApply(JSONObject param) {
ApplyTaskRequest baseRequest = param.toJavaObject(ApplyTaskRequest.class);
@ -467,7 +490,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
/** 扫码成功申请 - 判断是否静置完成 */
/**
* 扫码成功申请 - 判断是否静置完成
*/
@Override
public ApplyTaskResponse isStandingFinish(ApplyTaskRequest baseRequest) {
String requestNo = baseRequest.getRequestNo();
@ -517,6 +542,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
TaskUtils.setGroupUpdateByAcs(one);
vehiclematerialgroupService.updateById(one);
// 记录泥料
PdmBdMudConsumption mudConsumption = new PdmBdMudConsumption();
mudConsumption.setDevice_code(productionTask.getPoint_code());
mudConsumption.setGroup_id(one.getGroup_id());
mudConsumption.setMaterial_id(one.getMaterial_id());
mudConsumption.setWeight(one.getMaterial_weight());
mudConsumption.setCurrent_point(basePoint.getPoint_code());
mudConsumption.setWorkorder_code(productionTask.getWorkorder_code());
mudConsumption.setRaw_material_code(rawMaterialCode);
mudConsumptionService.create(mudConsumption);
taskResponse.setMix_number(one.getMix_times());
taskResponse.setIs_standing_finish(GeneralDefinition.YES);
taskResponse.setMessage("静置完成");
@ -528,7 +563,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
}
/** 扫码成功申请 - 入窑记录时间 */
/**
* 扫码成功申请 - 入窑记录时间
*/
@Override
public ApplyTaskResponse recordKilnTime(ApplyTaskRequest baseRequest) {
if (ObjectUtil.isEmpty(baseRequest.getVehicle_code())) {
@ -541,6 +578,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// 入窑记录时间
SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(baseRequest.getVehicle_code(),
baseRequest.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue());
if (ObjectUtil.isNotEmpty(groupInfo.getInto_kiln_time())) {
// 如果已经记录就跳过
return ApplyTaskResponse.responseOk(baseRequest.getRequestNo());
}
groupInfo.setInto_kiln_time(DateUtil.now());
if (ObjectUtil.isNotEmpty(basePoint)) {
// 记录当前位置
@ -562,6 +603,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
/**
* 压机请求要料
*
* @param param
* @return
*/
@ -569,14 +611,24 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
public BaseResponse pressRequestMaterial(JSONObject param) {
// todo: 换成acs请求
String requestNo = param.getString("requestNo");
String deviceCode = param.getString("device_code");
SchBasePoint basePoint = pointService.getById(deviceCode);
if (ObjectUtil.isEmpty(basePoint)) {
throw new BadRequestException("设备[" + deviceCode + "]不存在");
}
// 获取设备位
SchBasePoint devicePoint = pointService.getById(basePoint.getParent_point_code());
// todo: 1、校验是否有工单,是否需要叫料
// todo: 2、通知混碾机生产泥料
// todo: 3、修改设备点位为空位,并且更新时间
PointUtils.setUpdateByAcs(devicePoint);
PointUtils.clearPoint(devicePoint);
return null;
}
/**
* 提前要料
*
* @param param
* @return
*/
@ -601,7 +653,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
// 获取原材料物料
PdmBdRequestMaterialRecord requestMaterialRecord = new PdmBdRequestMaterialRecord();
requestMaterialRecord.setRecord_id(IdUtil.getSnowflake(1,1).nextIdStr());
requestMaterialRecord.setRecord_id(IdUtil.getSnowflake(1, 1).nextIdStr());
// requestMaterialRecord.setMaterial_id(workOrder.getRaw_material_id());
requestMaterialRecord.setWorkorder_id(workOrder.getWorkorder_id());
requestMaterialRecord.setDevice_code(parentPointCode);
@ -611,7 +663,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return BaseResponse.responseOk(requestNo);
}
/** 任务反馈 */
/**
* 任务反馈
*/
@Override
public BaseResponse feedbackTaskStatus(JSONObject param) {
// todo: action暂未维护
@ -656,7 +710,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return BaseResponse.responseOk(requestNo, "任务状态反馈成功!");
}
/** 获取组盘信息 */
/**
* 获取组盘信息
*/
@Override
public GetPalletizeResponse getVehicleInfo(JSONObject param) {
// 校验组盘信息
@ -678,43 +734,46 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return GetPalletizeResponse.responseOk(palletizeRequest.getRequestNo(), palletizeDto);
}
/** 实时修改点位状态 */
/**
* 实时修改点位状态
*/
@Override
public BaseResponse realTimeSetPoint(JSONObject param) {
// todo: 实体错误
PutActionRequest actionRequest = param.toJavaObject(PutActionRequest.class);
String requestNo = actionRequest.getRequestNo();
ApplySignalStatusRequest actionRequest = param.toJavaObject(ApplySignalStatusRequest.class);
String deviceCode = actionRequest.getDevice_code();
List<SignalData> list = actionRequest.getList();
String move = null;
if (ObjectUtil.isNotEmpty(actionRequest.getMove())) {
move = (Integer.parseInt(actionRequest.getMove()) + 1) + "";
}
String action = actionRequest.getAction();
String vehicleType = actionRequest.getVehicle_type();
if (deviceCode == null) {
return BaseResponse.responseError(requestNo, "设备编码不能为空");
}
String move = "";
// move 根据链表数据来
for (SignalData signalData : list) {
if (signalData.getCode().equals("move")) {
move = (Integer.parseInt(signalData.getValue()) + 1) + "";
}
return BaseResponse.responseError(actionRequest.getRequestNo(), "设备编码不能为空");
}
// 找到点位
SchBasePoint schBasePoint = pointService.getById(deviceCode);
if (ObjectUtil.isEmpty(schBasePoint)) {
return BaseResponse.responseError(requestNo, "设备: [" + deviceCode + "]未找到");
return BaseResponse.responseError(actionRequest.getRequestNo(), "设备: [" + deviceCode + "]未找到");
}
// 点位的状态如果是null,就默认是空位置
String pointStatus = ObjectUtil.isNotEmpty(schBasePoint.getPoint_status())
? schBasePoint.getPoint_status()
: PointStatusEnum.EMPTY_POINT.getCode();
if ((pointStatus.equals(PointStatusEnum.FULL_POINT.getCode())
&& move.equals(PointStatusEnum.EMPTY_VEHICLE.getCode())) || (pointStatus.equals(move))) { // 不做操作
return BaseResponse.responseOk(requestNo);
return BaseResponse.responseOk(actionRequest.getRequestNo());
}
// 载具类型不为空,并且不是0的情况,lmsVehicleTypeShift:转成lms的载具类型
if (ObjectUtil.isNotEmpty(vehicleType) && !vehicleType.equals(GeneralDefinition.NO)) {
schBasePoint.setVehicle_type(TaskUtils.toLmsVehicleTypeShift(vehicleType));
}
if (vehicleType != null) {
schBasePoint.setVehicle_type(vehicleType);
if (ObjectUtil.isNotEmpty(action)) {
schBasePoint.setIs_used(action.equals(GeneralDefinition.YES));
}
schBasePoint.setPoint_status(move);
// move为空则表示无货
schBasePoint.setPoint_status(move == null ? PointStatusEnum.EMPTY_POINT.getCode() : move);
PointUtils.setUpdateByAcs(schBasePoint);
pointService.updateById(schBasePoint);
return BaseResponse.responseOk(requestNo);
return BaseResponse.responseOk(actionRequest.getRequestNo());
}
}

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

@ -40,7 +40,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
@Override
public ResultForAcs getVehicleForLaminatingMachine(List<PutActionRequest> list) {
String api = "api/wms/order"; // todo: 地址未确认
String api = "/api/wms/action";
ResultForAcs resultForAcs = AcsUtil.notifyAcs(api, list);
// 记录日志
interactRecordService.saveRecord("下发信号传送空木托盘", list, resultForAcs, GeneralDefinition.LMS_ACS);
@ -49,7 +49,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
@Override
public ResultForAcs getDeviceStatusByCode(List<DeviceInfoDto> list) {
String api = "api/wms/order"; // todo: 地址未确认
String api = "api/"; // todo: 地址未确认
ResultForAcs resultForAcs = AcsUtil.notifyAcs(api, list);
// 记录日志
interactRecordService.saveRecord("获取设备状态", list, resultForAcs, GeneralDefinition.LMS_ACS);

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java

@ -67,4 +67,6 @@ public interface ISysInteractRecordService extends IService<SysInteractRecord> {
* @param direction
*/
<K, V> void saveRecord(String name, K request, V response, String direction);
void deleteByDay(String day);
}

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java

@ -9,4 +9,5 @@ import org.nl.wms.ext.record.service.dao.SysInteractRecord;
**/
public interface SysInteractRecordMapper extends BaseMapper<SysInteractRecord> {
void deleteByDay(String day);
}

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml

@ -2,4 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.ext.record.service.dao.mapper.SysInteractRecordMapper">
<delete id="deleteByDay">
DELETE FROM sys_interact_record
WHERE record_time <![CDATA[<=]]> DATE_SUB(NOW(), INTERVAL #{day} DAY);
</delete>
</mapper>

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

@ -14,6 +14,7 @@ import org.nl.common.domain.query.PageQuery;
import org.nl.common.exception.BadRequestException;
import org.nl.wms.ext.acs.service.dto.ResultForAcs;
import org.nl.wms.ext.acs.service.dto.to.BaseResponse;
import org.nl.wms.ext.acs.service.dto.to.wms.CreateTaskResponse;
import org.nl.wms.ext.record.service.ISysInteractRecordService;
import org.nl.wms.ext.record.service.dao.mapper.SysInteractRecordMapper;
import org.nl.wms.ext.record.service.dao.SysInteractRecord;
@ -128,7 +129,18 @@ public class SysInteractRecordServiceImpl extends ServiceImpl<SysInteractRecordM
entity.setMessage(re.getMessage());
entity.setIs_success(re.getStatus() == HttpStatus.HTTP_OK);
}
if (response instanceof CreateTaskResponse) { // wms请求acs的返回数据
CreateTaskResponse re = (CreateTaskResponse) response;
entity.setCode(re.getCode());
entity.setMessage(re.getMessage());
entity.setIs_success(re.getCode() == HttpStatus.HTTP_OK);
}
sysInteractRecordMapper.insert(entity);
}
@Override
public void deleteByDay(String day) {
sysInteractRecordMapper.deleteByDay(day);
}
}

66
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/controller/PdmBdMudConsumptionController.java

@ -0,0 +1,66 @@
package org.nl.wms.pdm.consumption.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.pdm.consumption.service.IPdmBdMudConsumptionService;
import org.nl.wms.pdm.consumption.service.dao.PdmBdMudConsumption;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.Set;
/**
* @author lyd
* @date 2023-08-11
**/
@Slf4j
@RestController
@Api(tags = "泥料消耗记录管理")
@RequestMapping("/api/pdmBdMudConsumption")
public class PdmBdMudConsumptionController {
@Autowired
private IPdmBdMudConsumptionService pdmBdMudConsumptionService;
@GetMapping
@Log("查询泥料消耗记录")
@ApiOperation("查询泥料消耗记录")
//@SaCheckPermission("@el.check('pdmBdMudConsumption:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(pdmBdMudConsumptionService.queryAll(whereJson,page)),HttpStatus.OK);
}
@PostMapping
@Log("新增泥料消耗记录")
@ApiOperation("新增泥料消耗记录")
//@SaCheckPermission("@el.check('pdmBdMudConsumption:add')")
public ResponseEntity<Object> create(@Validated @RequestBody PdmBdMudConsumption entity){
pdmBdMudConsumptionService.create(entity);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@Log("修改泥料消耗记录")
@ApiOperation("修改泥料消耗记录")
//@SaCheckPermission("@el.check('pdmBdMudConsumption:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody PdmBdMudConsumption entity){
pdmBdMudConsumptionService.update(entity);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除泥料消耗记录")
@ApiOperation("删除泥料消耗记录")
//@SaCheckPermission("@el.check('pdmBdMudConsumption:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
pdmBdMudConsumptionService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}

43
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/IPdmBdMudConsumptionService.java

@ -0,0 +1,43 @@
package org.nl.wms.pdm.consumption.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.nl.common.domain.query.PageQuery;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.wms.pdm.consumption.service.dao.PdmBdMudConsumption;
import java.util.Map;
import java.util.Set;
/**
* @description 服务接口
* @author lyd
* @date 2023-08-11
**/
public interface IPdmBdMudConsumptionService extends IService<PdmBdMudConsumption> {
/**
* 查询数据分页
* @param whereJson 条件
* @param pageable 分页参数
* @return IPage<PdmBdMudConsumption>
*/
IPage<PdmBdMudConsumption> queryAll(Map whereJson, PageQuery pageable);
/**
* 创建
* @param entity /
*/
void create(PdmBdMudConsumption entity);
/**
* 编辑
* @param entity /
*/
void update(PdmBdMudConsumption entity);
/**
* 多选删除
* @param ids /
*/
void deleteAll(Set<String> ids);
}

53
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dao/PdmBdMudConsumption.java

@ -0,0 +1,53 @@
package org.nl.wms.pdm.consumption.service.dao;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.io.Serializable;
/**
* @description /
* @author lyd
* @date 2023-08-11
**/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("pdm_bd_mud_consumption")
public class PdmBdMudConsumption implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "record_id", type = IdType.NONE)
@ApiModelProperty(value = "记录标识")
private String record_id;
@ApiModelProperty(value = "泥料编码")
private String raw_material_code;
@ApiModelProperty(value = "设备编码")
private String device_code;
@ApiModelProperty(value = "泥料重量")
private BigDecimal weight;
@ApiModelProperty(value = "工单号")
private String workorder_code;
@ApiModelProperty(value = "物料id")
private String material_id;
@ApiModelProperty(value = "记录时间")
private String record_time;
@ApiModelProperty(value = "组盘标识")
private String group_id;
@ApiModelProperty(value = "下料位编码")
private String current_point;
}

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dao/mapper/PdmBdMudConsumptionMapper.java

@ -0,0 +1,12 @@
package org.nl.wms.pdm.consumption.service.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.nl.wms.pdm.consumption.service.dao.PdmBdMudConsumption;
/**
* @author lyd
* @date 2023-08-11
**/
public interface PdmBdMudConsumptionMapper extends BaseMapper<PdmBdMudConsumption> {
}

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dao/mapper/PdmBdMudConsumptionMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.pdm.consumption.service.dao.mapper.PdmBdMudConsumptionMapper">
</mapper>

41
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dto/PdmBdMudConsumptionDto.java

@ -0,0 +1,41 @@
package org.nl.wms.pdm.consumption.service.dto;
import java.math.BigDecimal;
import lombok.Data;
import java.io.Serializable;
/**
* @description /
* @author lyd
* @date 2023-08-11
**/
@Data
public class PdmBdMudConsumptionDto implements Serializable {
/** 记录标识 */
private String record_id;
/** 泥料编码 */
private String raw_material_code;
/** 设备编码 */
private String device_code;
/** 泥料重量 */
private BigDecimal weight;
/** 工单号 */
private String workorder_code;
/** 物料id */
private String material_id;
/** 记录时间 */
private String record_time;
/** 组盘标识 */
private String group_id;
/** 下料位编码 */
private String current_point;
}

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/dto/PdmBdMudConsumptionQuery.java

@ -0,0 +1,12 @@
package org.nl.wms.pdm.consumption.service.dto;
import org.nl.common.domain.query.BaseQuery;
import org.nl.wms.pdm.consumption.service.dao.PdmBdMudConsumption;
/**
* @author lyd
* @date 2023-08-11
**/
public class PdmBdMudConsumptionQuery extends BaseQuery<PdmBdMudConsumption> {
}

68
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/consumption/service/impl/PdmBdMudConsumptionServiceImpl.java

@ -0,0 +1,68 @@
package org.nl.wms.pdm.consumption.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.pdm.consumption.service.IPdmBdMudConsumptionService;
import org.nl.wms.pdm.consumption.service.dao.mapper.PdmBdMudConsumptionMapper;
import org.nl.wms.pdm.consumption.service.dao.PdmBdMudConsumption;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.Set;
/**
* @description 服务实现
* @author lyd
* @date 2023-08-11
**/
@Slf4j
@Service
public class PdmBdMudConsumptionServiceImpl extends ServiceImpl<PdmBdMudConsumptionMapper, PdmBdMudConsumption> implements IPdmBdMudConsumptionService {
@Autowired
private PdmBdMudConsumptionMapper pdmBdMudConsumptionMapper;
@Override
public IPage<PdmBdMudConsumption> queryAll(Map whereJson, PageQuery page){
LambdaQueryWrapper<PdmBdMudConsumption> lam = new LambdaQueryWrapper<>();
IPage<PdmBdMudConsumption> pages = new Page<>(page.getPage() + 1, page.getSize());
pdmBdMudConsumptionMapper.selectPage(pages, lam);
return pages;
}
@Override
public void create(PdmBdMudConsumption entity) {
String now = DateUtil.now();
entity.setRecord_id(IdUtil.getSnowflake(1, 1).nextIdStr());
entity.setRecord_time(now);
pdmBdMudConsumptionMapper.insert(entity);
}
@Override
public void update(PdmBdMudConsumption entity) {
PdmBdMudConsumption dto = pdmBdMudConsumptionMapper.selectById(entity.getRecord_id());
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
String now = DateUtil.now();
entity.setRecord_time(now);
pdmBdMudConsumptionMapper.updateById(entity);
}
@Override
public void deleteAll(Set<String> ids) {
// 真删除
pdmBdMudConsumptionMapper.deleteBatchIds(ids);
}
}

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -27,6 +27,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
@ -63,15 +64,14 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
Boolean parent_point = ObjectUtil.isNotEmpty(whereJson.get("parent_point"))
? Boolean.valueOf(whereJson.get("parent_point").toString()) : false;
LambdaQueryWrapper<SchBasePoint> lam = new LambdaQueryWrapper<>();
lam.like(ObjectUtil.isNotEmpty(blurry), SchBasePoint::getPoint_code, blurry)
.or(ObjectUtil.isNotEmpty(blurry), lam1 -> lam1.like(SchBasePoint::getPoint_name, blurry))
.eq(ObjectUtil.isNotEmpty(workshop_code), SchBasePoint::getWorkshop_code, workshop_code)
lam.eq(ObjectUtil.isNotEmpty(workshop_code), SchBasePoint::getWorkshop_code, workshop_code)
.and(ObjectUtil.isNotEmpty(blurry), la -> la.like(SchBasePoint::getPoint_code, blurry)
.or().like(SchBasePoint::getPoint_name, blurry))
.eq(ObjectUtil.isNotEmpty(region_code), SchBasePoint::getRegion_code, region_code)
.eq(ObjectUtil.isNotEmpty(point_type), SchBasePoint::getPoint_type, point_type)
.eq(ObjectUtil.isNotEmpty(point_status), SchBasePoint::getPoint_status, point_status)
.eq(ObjectUtil.isNotEmpty(is_used), SchBasePoint::getIs_used, is_used)
.and(!lock_type, slam -> slam.isNull(SchBasePoint::getIng_task_code)
.or()
.and(!lock_type, slam -> slam.isNull(SchBasePoint::getIng_task_code).or()
.eq(SchBasePoint::getIng_task_code, ""))
.and(lock_type, slam -> slam.isNotNull(SchBasePoint::getIng_task_code)
.ne(SchBasePoint::getIng_task_code, ""))

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

@ -5,11 +5,14 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpStatus;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.exception.BadRequestException;
import org.nl.wms.ext.acs.service.dto.ResultForAcs;
import org.nl.wms.ext.acs.service.dto.to.acs.CreateTaskRequest;
import org.nl.wms.ext.acs.service.dto.to.wms.CreateTaskResponse;
import org.nl.wms.ext.record.service.ISysInteractRecordService;
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
@ -63,7 +66,7 @@ public abstract class AbstractTask {
* @author ldjun
* @created 2020年6月12日 下午5:52:28
*/
protected ResultForAcs renotifyAcs(SchBaseTask task) {
protected CreateTaskResponse renotifyAcs(SchBaseTask task) {
Assert.notNull(task);
List<SchBaseTask> taskList = new ArrayList<>();
taskList.add(task);
@ -76,8 +79,8 @@ public abstract class AbstractTask {
* @author ldjun
* @created 2020年6月12日 下午5:52:28
*/
protected ResultForAcs renotifyAcs(List<SchBaseTask> taskList) {
ResultForAcs resultForAcs = ResultForAcs.requestOk();
protected CreateTaskResponse renotifyAcs(List<SchBaseTask> taskList) {
CreateTaskResponse resultForAcs = CreateTaskResponse.requestOk();
//1、获取任务
//2、根据任务配置补全任务
//3、下发
@ -89,9 +92,7 @@ public abstract class AbstractTask {
JSONObject jsonObject = JSONObject.parseObject(responseParam);
taskDto.setDirection(jsonObject.getString("direction"));
}
taskDto.setRequestNo(IdUtil.simpleUUID());// todo
taskDto.setRequestDate(DateUtil.now());
taskDto.setExt_task_id(task.getTask_id());
taskDto.setExt_task_uuid(task.getTask_id());
taskDto.setTask_code(task.getTask_code());
taskDto.setRoute_plan_code("normal");
taskDto.setStart_device_code(task.getPoint_code1());
@ -104,17 +105,36 @@ public abstract class AbstractTask {
list.add(taskDto);
}
try {
resultForAcs = AcsUtil.notifyAcs("api/wms/task", list);
// 创建下发对象
resultForAcs = AcsUtil.notifyAcs2("api/wms/task",
CreateTaskRequest.buildRequestObj("下发任务", list));
} catch (Exception e) {
log.error("任务下发异常: {}", e.getMessage());
resultForAcs.setTimestamp(DateUtil.now());
resultForAcs.setStatus(HttpStatus.HTTP_BAD_REQUEST);
resultForAcs.setResponseDate(DateUtil.now());
resultForAcs.setCode(HttpStatus.HTTP_BAD_REQUEST);
resultForAcs.setMessage(e.getMessage());
}
// 如果下发完毕,就修改状态
if (resultForAcs.getStatus() == 200) {
if (resultForAcs.getCode() == 200) {
// 解析
JSONArray errArr = resultForAcs.getErrArr();
for (SchBaseTask schBaseTask : taskList) {
schBaseTask.setTask_status(TaskStatus.ISSUED.getCode());
if (errArr == null) {
schBaseTask.setTask_status(TaskStatus.ISSUED.getCode());
} else {
schBaseTask.setTask_status(TaskStatus.ISSUED.getCode());
// 判断是否是出错的任务
for (int i = 0; i < errArr.size(); i++) {
JSONObject errObj = errArr.getJSONObject(i);
String taskCode = errObj.getString("task_code");
if (taskCode.equals(schBaseTask.getTask_code())) {
// 出错的任务就设置出错信息为备注,不是出错就设置下发
schBaseTask.setTask_status(TaskStatus.CREATED.getCode());
schBaseTask.setRemark(errObj.getString("message"));
break;
}
}
}
}
taskService.updateBatchById(taskList);
}
@ -221,7 +241,7 @@ public abstract class AbstractTask {
String apply_point_code = param.getString("device_code"); // 请求点
String config_code = param.getString("config_code");
String requestNo = param.getString("requestNo");
String vehicleType = TaskUtils.acsVehicleTypeShift(param.getString("vehicle_type"));
String vehicleType = TaskUtils.toAcsVehicleTypeShift(param.getString("vehicle_type"));
String vehicleCode = TaskUtils.defaultVehicleCode(param.getString("vehicle_code"));
// 1、校验数据
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()

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

@ -3,7 +3,122 @@ package org.nl.wms.sch.task_manage;
import lombok.Data;
import org.nl.wms.ext.acs.service.dto.to.acs.CreateTaskRequest;
import java.util.Map;
@Data
public class AcsTaskDto extends CreateTaskRequest {
public class AcsTaskDto {
/**
* 任务标识
*/
private String ext_task_uuid;
/**
* 任务编号
*/
private String task_code;
/**
* 取货点1
*/
String start_device_code;
/**
* 放货点1
*/
String next_device_code;
/**
* 取货点2
*/
String start_device_code2;
/**
* 放货点2
*/
String next_device_code2;
/**
* 对接位
*/
String put_device_code;
/**
* 优先级
*/
String priority;
/**
* 载具号
*/
String vehicle_code;
/**
* 载具号2
*/
String vehicle_code2;
/**
* 载具类型
*/
String vehicle_type;
/**
* 路由方案
*/
String route_plan_code;
/**
* 任务类型
*/
String task_type;
/**
* 立库任务类型
*
*/
String dtl_type;
/**
* Agv系统类型
* 1:1楼叉车系统
* 2:2楼1区域AGV系统
* 3:2楼2区域AGV系统
*/
String agv_system_type;
/**
* 备注
*/
String remark;
/**
* 烘箱时间
*/
String oven_time;
/**
* 烘箱温度
*/
String temperature;
/**
* agv取货高度
*/
private String start_height;
/**
* agv放货高度
*/
private String next_height;
/**
* 方向 1往左 2往右
*/
private String direction;
/**
* 扩展属性
*/
Map<String,String> params;
}

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

@ -11,6 +11,8 @@ import org.nl.config.SpringContextHolder;
import org.nl.system.service.param.dao.Param;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.ext.acs.service.dto.ResultForAcs;
import org.nl.wms.ext.acs.service.dto.to.acs.CreateTaskRequest;
import org.nl.wms.ext.acs.service.dto.to.wms.CreateTaskResponse;
import org.nl.wms.sch.task_manage.GeneralDefinition;
import java.util.List;
@ -64,4 +66,40 @@ public class AcsUtil {
}
return resultForAcs;
}
public static <T> CreateTaskResponse notifyAcs2(String api, T object) {
SysParamServiceImpl sysParamService = SpringContextHolder.getBean(SysParamServiceImpl.class);
//判断是否连接ACS系统
Param isConnectAcs = sysParamService.findByCode(GeneralDefinition.IS_CONNECT_ACS);
if (ObjectUtil.isEmpty(isConnectAcs)) {
return CreateTaskResponse.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)) {
return CreateTaskResponse.requestRefuse("参数表中:" + GeneralDefinition.ACS_URL + "不存在");
}
String acsUrl = acsUrlObj.getValue();
JSONObject result;
if (StrUtil.equals(GeneralDefinition.NO, isConnect)) {
return CreateTaskResponse.requestRefuse("未连接ACS!");
}
String url = acsUrl + api;
log.info("下发acs任务的参数为:{}", object.toString());
CreateTaskResponse resultForAcs;
try {
String resultMsg = HttpRequest.post(url)
.body(JSON.toJSONString(object))
.execute().body();
result = JSONObject.parseObject(resultMsg);
resultForAcs = JSONObject.toJavaObject(result, CreateTaskResponse.class);
} catch (Exception e) {
String msg = e.getMessage();
//网络不通
log.error("连接失败:{}", msg);
return CreateTaskResponse.requestRefuse("网络不通,操作失败!");
}
return resultForAcs;
}
}

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

@ -3,6 +3,7 @@ package org.nl.wms.sch.task_manage.task.tasks.fj;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.nl.common.exception.BadRequestException;
@ -10,6 +11,7 @@ import org.nl.common.utils.CodeUtil;
import org.nl.config.MapOf;
import org.nl.system.service.notice.ISysNoticeService;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.ext.acs.service.dto.to.wms.ApplyDeviceDto;
import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService;
@ -77,6 +79,10 @@ public class FJMKTask extends AbstractTask {
.collect(Collectors.toList());
String requestParam = task.getRequest_param();// 任务的其他数据
JSONObject jsonObject = JSONObject.parseObject(requestParam);
String startPoint = task.getPoint_code1();
// 获取起点 回写载具编码
SchBasePoint startPointObj = pointService.getById(startPoint);
task.setVehicle_code(startPointObj.getVehicle_code()); // 起点的木托盘编码
// 找终点
/** 包装位 */
SchBasePoint packagePoint = findNextPoint(nextRegionStr, jsonObject);
@ -90,9 +96,14 @@ public class FJMKTask extends AbstractTask {
}
task.setPoint_code2(packagePoint.getPoint_code()); // 包装线
// todo: 校验是否够码满一托
List<ApplyDeviceDto> list = JSONArray.parseArray(jsonObject.getString("list"), ApplyDeviceDto.class);
// 1 获取点位相应数量
int sum = 0;
for (ApplyDeviceDto applyDeviceDto : list) {
sum += Integer.parseInt(applyDeviceDto.getQty());
}
// 2 获取库存数量
// 3 木托盘需要多少块
// 3 获取木托盘需要多少块
/** 覆膜机木托盘位 */
SchBasePoint LaminatePoint = findStartPoint(startRegionStr, jsonObject);
if (ObjectUtil.isEmpty(LaminatePoint)) {
@ -107,7 +118,7 @@ public class FJMKTask extends AbstractTask {
String vehicleCode = CodeUtil.getNewCode("VEHICLE_CODE");
// 设置终点并修改创建成功状态
task.setPoint_code3(LaminatePoint.getParent_point_code());
task.setPoint_code4(task.getPoint_code1());
task.setPoint_code4(startPoint);
task.setVehicle_code2(vehicleCode); // 覆膜机下的木托盘编码
task.setTask_status(TaskStatus.CREATED.getCode());
task.setRemark("");

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

@ -71,6 +71,8 @@ public class FJQLTask extends AbstractTask {
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));
for (SchBaseTask task : tasks) {
TaskUtils.setUpdateByAcs(task);
// 钢托盘
task.setVehicle_type(GeneralDefinition.STEEL_TRAY);
List<String> startRegionStr = Arrays.stream(taskConfig.getStart_region_str().split(","))
.collect(Collectors.toList());
// 找起点

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

@ -63,6 +63,10 @@ public class FJRKTask extends AbstractTask {
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));
for (SchBaseTask task : tasks) {
TaskUtils.setUpdateByAcs(task);
// 获取起点 回写载具编码
String startPoint = task.getPoint_code1();
SchBasePoint startPointObj = pointService.getById(startPoint);
task.setVehicle_code(startPointObj.getVehicle_code());
List<String> nextRegionStr = Arrays.stream(taskConfig.getNext_region_str().split(",")).collect(Collectors.toList());
// 找终点
SchBasePoint point = findNextPoint(nextRegionStr);
@ -110,33 +114,26 @@ public class FJRKTask extends AbstractTask {
public String setGroupPlate(JSONObject param) {
// 强制入库组盘
// 组盘,返回组盘标识,设置待绑定,搬运结束就设置已绑定
String vehicleCode = param.getString("vehicle_code");
if (vehicleCode == null) {
throw new BadRequestException("载具编码不能为空");
}
String deviceCode = param.getString("device_code");
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");
// 砖块数量
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;
String vehicleCode = basePoint.getVehicle_code();
PdmBdWorkorder workorderObject = workorderService.getDeviceProductionTask(basePoint.getParent_point_code());
// 找到相同组盘信息就直接返回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()
: "");
@ -162,7 +159,7 @@ public class FJRKTask 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);
// 将所有当前位置的砖块设置组盘标识
// baseBrickInfoService.setGroupByCurrentAllBrick(deviceCode, groupEntity.getGroup_id());
// 返回组盘id记录任务中

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

@ -104,7 +104,8 @@ public class HNMLTask extends AbstractTask {
.eq(SchBaseTaskconfig::getConfig_code, TASK_CONFIG_CODE));
for (SchBaseTask task : tasks) {
TaskUtils.setUpdateByAcs(task); // 修改修改者
List<String> nextRegionStr = Arrays.stream(taskConfig.getNext_region_str().split(",")).collect(Collectors.toList());
List<String> nextRegionStr = Arrays.stream(taskConfig.getNext_region_str().split(","))
.collect(Collectors.toList());
String requestParam = task.getRequest_param();// 任务的其他数据
JSONObject jsonObject = JSONObject.parseObject(requestParam);
// 找终点
@ -284,7 +285,7 @@ public class HNMLTask extends AbstractTask {
SchBasePoint basePoint = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, deviceCode)
.eq(SchBasePoint::getIs_used, true));
if (vehicleCode == null) {
if (vehicleCode == null || vehicleCode.equals(GeneralDefinition.NO)) {
throw new BadRequestException("载具编码不能为空");
}
SchBaseVehiclematerialgroup groupEntity = new SchBaseVehiclematerialgroup();

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

@ -66,7 +66,7 @@ public class YZQKTask extends AbstractTask {
SchBasePoint point = findStartPoint(startRegionStr, jsonObject);
if (ObjectUtil.isEmpty(point)) {
task.setRemark("未找到所需点位!");
taskService.update(task);
taskService.updateById(task);
// 消息通知
noticeService.createNotice("未找到所需点位!", TASK_CONFIG_CODE + task.getTask_code(),
NoticeTypeEnum.WARN.getCode());

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/PointUtils.java

@ -8,6 +8,7 @@ import org.nl.config.SpringContextHolder;
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.point.service.impl.SchBasePointServiceImpl;
import org.nl.wms.sch.task_manage.GeneralDefinition;
import org.nl.wms.sch.task_manage.enums.PointStatusEnum;
import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum;
@ -55,8 +56,8 @@ public class PointUtils {
/** 点位修改更新信息 **/
public static void setUpdateByAcs(SchBasePoint pointObj) {
pointObj.setUpdate_id("2");
pointObj.setUpdate_name("ACS系统");
pointObj.setUpdate_id(GeneralDefinition.ACS_ID);
pointObj.setUpdate_name(GeneralDefinition.ACS_NAME);
pointObj.setUpdate_time(DateUtil.now());
}
/** 点位修改更新信息 **/

10
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java

@ -10,15 +10,11 @@ import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.nl.wms.sch.task.service.dao.SchBaseTask;
import org.nl.wms.sch.task.service.impl.SchBaseTaskServiceImpl;
import org.nl.wms.sch.task_manage.GeneralDefinition;
import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum;
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.List;
import java.util.function.Consumer;
/**
* @Author: lyd
@ -129,12 +125,13 @@ public class TaskUtils {
}
/**
* 转成ACS需要的载具类型
* ACS载具类型1 2 3 ...
* LMS载具类型3 4 5 ...
* @param acsVehicleType
* @return
*/
public static String acsVehicleTypeShift(String acsVehicleType) {
public static String toAcsVehicleTypeShift(String acsVehicleType) {
if (ObjectUtil.isEmpty(acsVehicleType)) {
return null;
}
@ -148,12 +145,13 @@ public class TaskUtils {
}
/**
* 转成LMS需要的载具类型
* ACS载具类型1 2 3 ...
* LMS载具类型3 4 5 ...
* @param lmsVehicleType
* @return
*/
public static String lmsVehicleTypeShift(String lmsVehicleType) {
public static String toLmsVehicleTypeShift(String lmsVehicleType) {
if (ObjectUtil.isEmpty(lmsVehicleType)) {
return null;
}

4
lms/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

@ -54,7 +54,6 @@ spring:
multi-statement-allow: true
redis:
#数据库索引
database: ${REDIS_DB:2}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
@ -63,6 +62,7 @@ spring:
threads: 4
nettyThreads: 4
singleServerConfig:
database: 3
connectionMinimumIdleSize: 8
connectionPoolSize: 8
address: redis://127.0.0.1:6379
@ -163,7 +163,7 @@ sa-token:
token-session-check-login: false
alone-redis:
# Redis数据库索引(默认为0)
database: 2
database: 8
# Redis服务器地址
host: 127.0.0.1
# Redis服务器连接端口

33
lms/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml

@ -53,7 +53,6 @@ spring:
multi-statement-allow: true
redis:
#数据库索引
database: ${REDIS_DB:15}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
@ -62,6 +61,7 @@ spring:
threads: 4
nettyThreads: 4
singleServerConfig:
database: 15
connectionMinimumIdleSize: 8
connectionPoolSize: 8
address: redis://127.0.0.1:6379
@ -165,5 +165,32 @@ sa-token:
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
# token 前缀
token-prefix: Bearer
is-read-cookie: false
is-read-body: false
sso:
# Ticket有效期 (单位: 秒),默认五分钟
ticket-timeout: 300
# 所有允许的授权回调地址
allow-url: "*"
# 是否打开单点注销功能
is-slo: true
# ------- SSO-模式三相关配置 (下面的配置在SSO模式三并且 is-slo=true 时打开)
# 是否打开模式三
isHttp: true
# 接口调用秘钥(用于SSO模式三的单点注销功能)
secretkey: kQwIOrYvnXmSDkwEiFngrKidMcdrgKor
# ---- 除了以上配置项,你还需要为 Sa-Token 配置http请求处理器(文档有步骤说明)
is-read-cookie: true
is-print: false
# 未登录 StpUtil.getTokenSession() 设置值,获取值 @SaIgnore 得忽略接口
token-session-check-login: false
alone-redis:
# Redis数据库索引(默认为0)
database: 9
# Redis服务器地址
host: 127.0.0.1
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码(默认为空)
password:
# 连接超时时间
timeout: 10s

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

@ -1,15 +1,23 @@
package org.nl.point;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.checkerframework.checker.units.qual.A;
import org.junit.jupiter.api.Test;
import org.nl.common.exception.BadRequestException;
import org.nl.wms.ext.acs.service.dto.to.wms.ApplyDeviceDto;
import org.nl.wms.ext.acs.service.dto.to.wms.ApplyTaskRequest;
import org.nl.wms.sch.region.service.ISchBaseRegionService;
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: lyd
* @Description:
@ -72,4 +80,23 @@ public class test {
}
}
@Test
public void test04() {
List<ApplyDeviceDto> list = new ArrayList<>();
for (int i = 0; i < 2; i++) {
ApplyDeviceDto applyDeviceDto = new ApplyDeviceDto();
applyDeviceDto.setDevice_code("t" + i);
applyDeviceDto.setVehicle_code("v" + i);
applyDeviceDto.setVehicle_type("1");
applyDeviceDto.setQty(String.valueOf(12 + i));
list.add(applyDeviceDto);
}
ApplyTaskRequest a = new ApplyTaskRequest();
a.setList(list);
a.setRequestNo("sfasdf");
String s = JSON.toJSONString(a);
JSONObject jsonObject = JSONObject.parseObject(s);
System.out.println(jsonObject);
}
}

56
lms/nladmin-system/nlsso-server/src/test/java/org/nl/task/MapperTest.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.junit.jupiter.api.Test;
import org.nl.common.exception.BadRequestException;
import org.nl.config.MapOf;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
@ -172,4 +173,59 @@ public class MapperTest {
jsonObject.put("point_name", "测试");
testMapper.updateByObject(jsonObject);
}
@Test
void test111() {
try {
for (int i = 0; i < 5; i++) {
// 参数处理
if (i == 1) {
throw new BadRequestException("出错了 - 1");
}
try {
// 创建
if (i == 2) {
throw new BadRequestException("出错了 - 2");
}
}catch (Exception e) {
// 记录
System.out.println("捕获 - 2");
}
// 成功
System.out.println(i);
}
} catch (Exception e) {
System.out.println("捕获 - 1");
}
}
@Test
void test112() {
try {
// 转换
for (int i = 0; i < 5; i++) {
try {
// 参数处理
if (i == 1) {
throw new BadRequestException("出错了 - 1");
}
// 创建任务
if (i == 2) {
throw new BadRequestException("出错了 - 2");
}
// 成功
System.out.println(i);
} catch (Exception e) {
// add
System.out.println("ssssssss");
}
}
} catch (Exception e) {
// x 400
}
// 200 errArray()
}
}

108
lms/nladmin-ui/src/views/wms/pdm/consumption/index.vue

@ -0,0 +1,108 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
<el-form-item label="泥料编码">
<el-input v-model="form.raw_material_code" style="width: 370px;" />
</el-form-item>
<el-form-item label="设备编码">
<el-input v-model="form.device_code" style="width: 370px;" />
</el-form-item>
<el-form-item label="泥料重量">
<el-input v-model="form.weight" style="width: 370px;" />
</el-form-item>
<el-form-item label="工单号">
<el-input v-model="form.workorder_code" style="width: 370px;" />
</el-form-item>
<el-form-item label="记录时间">
<el-input v-model="form.record_time" style="width: 370px;" />
</el-form-item>
<el-form-item label="下料位编码">
<el-input v-model="form.current_point" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column prop="raw_material_code" label="泥料编码" :min-width="flexWidth('raw_material_code',crud.data,'泥料编码')"/>
<el-table-column prop="device_code" label="设备编码" :min-width="flexWidth('device_code',crud.data,'设备编码')"/>
<el-table-column prop="weight" label="泥料重量" :min-width="flexWidth('weight',crud.data,'泥料重量')"/>
<el-table-column prop="workorder_code" label="工单号" :min-width="flexWidth('workorder_code',crud.data,'工单号')"/>
<el-table-column prop="record_time" label="记录时间" :min-width="flexWidth('record_time',crud.data,'记录时间')"/>
<el-table-column prop="current_point" label="下料位编码" :min-width="flexWidth('current_point',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 />
</div>
</div>
</template>
<script>
import crudPdmBdMudConsumption from './pdmBdMudConsumption'
import CRUD, {crud, form, header, presenter} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
const defaultForm = {
record_id: null,
raw_material_code: null,
device_code: null,
weight: null,
workorder_code: null,
material_id: null,
record_time: null,
group_id: null,
current_point: null
}
export default {
name: 'PdmBdMudConsumption',
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '泥料消耗记录',
url: 'api/pdmBdMudConsumption',
idField: 'record_id',
sort: 'record_id,desc',
crudMethod: { ...crudPdmBdMudConsumption }
})
},
data() {
return {
permission: {
},
rules: {
} }
},
methods: {
// false
[CRUD.HOOK.beforeRefresh]() {
return true
}
}
}
</script>
<style scoped>
</style>

27
lms/nladmin-ui/src/views/wms/pdm/consumption/pdmBdMudConsumption.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
export function add(data) {
return request({
url: 'api/pdmBdMudConsumption',
method: 'post',
data
})
}
export function del(ids) {
return request({
url: 'api/pdmBdMudConsumption/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
url: 'api/pdmBdMudConsumption',
method: 'put',
data
})
}
export default { add, edit, del }
Loading…
Cancel
Save