diff --git a/lms/nladmin-system/doc/wms.xls b/lms/nladmin-system/doc/wms.xls index 5d5a54f..dc41488 100644 Binary files a/lms/nladmin-system/doc/wms.xls and b/lms/nladmin-system/doc/wms.xls differ diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/controller/AcsToWmsController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/controller/AcsToWmsController.java similarity index 96% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/controller/AcsToWmsController.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/controller/AcsToWmsController.java index 79ff55c..ed45257 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/controller/AcsToWmsController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/controller/AcsToWmsController.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.controller; +package org.nl.wms.ext.acs.controller; import cn.dev33.satoken.annotation.SaIgnore; import com.alibaba.fastjson.JSONObject; @@ -6,7 +6,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.nl.common.logging.annotation.Log; -import org.nl.wms.ext.service.AcsToWmsService; +import org.nl.wms.ext.acs.service.AcsToWmsService; import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/AcsToWmsService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java similarity index 84% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/AcsToWmsService.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java index 72a6005..5fa6edb 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/AcsToWmsService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java @@ -1,7 +1,7 @@ -package org.nl.wms.ext.service; +package org.nl.wms.ext.acs.service; import com.alibaba.fastjson.JSONObject; -import org.nl.wms.ext.service.vo.BaseResponse; +import org.nl.wms.ext.acs.service.vo.BaseResponse; /** * @Author: lyd diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/WmsToAcsService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java similarity index 75% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/WmsToAcsService.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java index 2ce7c26..dab2890 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/WmsToAcsService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service; +package org.nl.wms.ext.acs.service; /** * @Author: lyd diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/ApplyTaskRequest.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/ApplyTaskRequest.java similarity index 92% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/ApplyTaskRequest.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/ApplyTaskRequest.java index 140446c..32bd0d7 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/ApplyTaskRequest.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/ApplyTaskRequest.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service.dto; +package org.nl.wms.ext.acs.service.dto; import lombok.Data; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/BaseRequest.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/BaseRequest.java similarity index 96% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/BaseRequest.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/BaseRequest.java index be168aa..4926be6 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/BaseRequest.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/BaseRequest.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service.dto; +package org.nl.wms.ext.acs.service.dto; import com.alibaba.fastjson.JSONObject; import lombok.Data; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/BrickInfoDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/BrickInfoDto.java new file mode 100644 index 0000000..0f53e78 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/BrickInfoDto.java @@ -0,0 +1,42 @@ +package org.nl.wms.ext.acs.service.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 砖信息 + * @Date: 2023/7/18 + */ +@Data +public class BrickInfoDto { + /** 当前抓取工位 **/ + private String get_station; + /** 当前放置工位 **/ + private String put_station; + /** 是否合格 **/ + private String is_qualified; + /** 激光标刻码 **/ + private String laser_marking_code; + /** 碾次 **/ + private String grinding_number; + /** 高度1 **/ + private String height1; + /** 高度2 **/ + private String height2; + /** 高度3 **/ + private String height3; + /** 高度4 **/ + private String height4; + /** 宽度1 **/ + private String width1; + /** 宽度2 **/ + private String width2; + /** 长度 **/ + private String len; + /** 体积 **/ + private String volume; + /** 平面度 **/ + private String flatness; + /** 缺陷个数 **/ + private String unqualified_qty; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/GrabRequest.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/GrabRequest.java similarity index 96% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/GrabRequest.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/GrabRequest.java index de9055a..b6d44f8 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/GrabRequest.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/GrabRequest.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service.dto; +package org.nl.wms.ext.acs.service.dto; import lombok.Data; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/PalletizeDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/PalletizeDto.java similarity index 98% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/PalletizeDto.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/PalletizeDto.java index 6600787..8d59416 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/dto/PalletizeDto.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/dto/PalletizeDto.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service.dto; +package org.nl.wms.ext.acs.service.dto; import lombok.Data; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java similarity index 91% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index c1a3888..9da141b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service.impl; +package org.nl.wms.ext.acs.service.impl; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; @@ -11,10 +11,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.extern.slf4j.Slf4j; import org.nl.common.exception.BadRequestException; import org.nl.system.service.notice.ISysNoticeService; -import org.nl.wms.ext.service.AcsToWmsService; -import org.nl.wms.ext.service.dto.ApplyTaskRequest; -import org.nl.wms.ext.service.vo.ApplyTaskResponse; -import org.nl.wms.ext.service.vo.BaseResponse; +import org.nl.wms.ext.acs.service.dto.ApplyTaskRequest; +import org.nl.wms.ext.acs.service.vo.BaseResponse; +import org.nl.wms.ext.acs.service.AcsToWmsService; +import org.nl.wms.ext.acs.service.vo.ApplyTaskResponse; +import org.nl.wms.ext.record.service.ISysInteractRecordService; import org.nl.wms.pdm.record.service.IPdmBdRequestMaterialRecordService; import org.nl.wms.pdm.record.service.dao.PdmBdRequestMaterialRecord; import org.nl.wms.pdm.service.IPdmBdWorkorderService; @@ -26,8 +27,10 @@ import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task.service.dao.SchBaseTask; import org.nl.wms.sch.task_manage.AbstractTask; +import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum; +import org.nl.wms.sch.task_manage.enums.PointStatusEnum; import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; import org.nl.wms.sch.task_manage.task.TaskFactory; import org.nl.wms.sch.task_manage.task.core.TaskStatus; @@ -66,16 +69,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { private TaskUtils taskUtils; @Autowired private ISysNoticeService noticeService; + @Autowired + private ISysInteractRecordService interactRecordService; @Override public BaseResponse acsApply(JSONObject param) { BaseResponse result = new BaseResponse(); try { - String requestMedthodCode = param.getString("request_medthod_code"); // 获取请求方法名 - if (ObjectUtil.isEmpty(requestMedthodCode)) { + String requestMethodCode = param.getString("request_medthod_code"); // 获取请求方法名 + if (ObjectUtil.isEmpty(requestMethodCode)) { throw new BadRequestException("请求参数错误"); } - Method method = this.getClass().getMethod(StrUtil.toCamelCase(requestMedthodCode), JSONObject.class); + Method method = this.getClass().getMethod(StrUtil.toCamelCase(requestMethodCode), JSONObject.class); result = (BaseResponse) method.invoke(this, param); } catch (Exception e) { String message = ObjectUtil.isEmpty(e.getMessage()) @@ -89,6 +94,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { noticeService.createNotice("异常信息:" + message, "acsApply: " + param.getString("requestNo"), NoticeTypeEnum.EXCEPTION.getCode()); } + // acs对接记录 + interactRecordService.saveRecord(param, result, GeneralDefinition.ACS_LMS); return result; } @@ -265,6 +272,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return standResponse; } + /** + * 提前要料 + * @param param + * @return + */ @Override @Transactional(rollbackFor = Exception.class) public BaseResponse pressRequestMaterial(JSONObject param) { // (公共接口进来)只是给我一个下料位(中间位置) @@ -272,12 +284,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { // 压机、原材料物料(混碾)、压机工单、叫料时间 String deviceCode = param.getString("device_code");// 几号压机下料位 SchBasePoint basePoint = pointService.getById(deviceCode); + if (ObjectUtil.isEmpty(basePoint)) { + return BaseResponse.responseError(requestNo, "设备号[" + deviceCode + "]不正确!"); + } String parentPointCode = basePoint.getParent_point_code(); // 获取当前正在生产的工单 PdmBdWorkorder workOrder = workorderService.getOne(new LambdaQueryWrapper() .eq(PdmBdWorkorder::getPoint_code, parentPointCode) .eq(PdmBdWorkorder::getWorkorder_status, WorkOrderStatusEnum.PRODUCING.getCode()) .eq(PdmBdWorkorder::getIs_delete, false)); + if (ObjectUtil.isEmpty(workOrder)) { + return BaseResponse.responseError(requestNo, "工单不存在!"); + } // 获取原材料物料 PdmBdRequestMaterialRecord requestMaterialRecord = new PdmBdRequestMaterialRecord(); requestMaterialRecord.setRecord_id(IdUtil.getSnowflake(1,1).nextIdStr()); @@ -375,7 +393,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return BaseResponse.responseError(requestNo, "设备编码不能为空"); } // move - String move = param.getString("move") + 1; + String move = (param.getInteger("move") + 1) + ""; // 找到点位 SchBasePoint schBasePoint = pointService.getById(deviceCode); if (ObjectUtil.isEmpty(schBasePoint)) { @@ -383,11 +401,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } String pointStatus = ObjectUtil.isNotEmpty(schBasePoint.getPoint_status()) ? schBasePoint.getPoint_status() - : "1"; - if ((pointStatus.equals("3") && move.equals("2")) || (pointStatus.equals(move))) { // 不做操作 + : PointStatusEnum.EMPTY_POINT.getCode(); + if ((pointStatus.equals(PointStatusEnum.FULL_POINT.getCode()) + && move.equals(PointStatusEnum.EMPTY_VEHICLE.getCode())) || (pointStatus.equals(move))) { // 不做操作 return BaseResponse.responseOk(requestNo); } - schBasePoint.setPoint_status(move.toString()); + schBasePoint.setPoint_status(move); PointUtils.setUpdateByAcs(schBasePoint); pointService.updateById(schBasePoint); return BaseResponse.responseOk(requestNo); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/WmsToAcsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java similarity index 70% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/WmsToAcsServiceImpl.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java index 523fe2a..87d87cb 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/impl/WmsToAcsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java @@ -1,7 +1,7 @@ -package org.nl.wms.ext.service.impl; +package org.nl.wms.ext.acs.service.impl; import lombok.extern.slf4j.Slf4j; -import org.nl.wms.ext.service.WmsToAcsService; +import org.nl.wms.ext.acs.service.WmsToAcsService; import org.springframework.stereotype.Service; /** diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/ApplyTaskResponse.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/ApplyTaskResponse.java similarity index 92% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/ApplyTaskResponse.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/ApplyTaskResponse.java index e131efb..14e2f6b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/ApplyTaskResponse.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/ApplyTaskResponse.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service.vo; +package org.nl.wms.ext.acs.service.vo; import cn.hutool.core.date.DateUtil; import cn.hutool.http.HttpStatus; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/BaseResponse.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/BaseResponse.java similarity index 98% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/BaseResponse.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/BaseResponse.java index dc06404..71db999 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/BaseResponse.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/BaseResponse.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service.vo; +package org.nl.wms.ext.acs.service.vo; import cn.hutool.core.date.DateUtil; import cn.hutool.http.HttpStatus; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/GrabResponse.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/GrabResponse.java similarity index 57% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/GrabResponse.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/GrabResponse.java index 83804fa..b853921 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/GrabResponse.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/GrabResponse.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service.vo; +package org.nl.wms.ext.acs.service.vo; public class GrabResponse extends BaseResponse { } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/StandResponse.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/StandResponse.java similarity index 91% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/StandResponse.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/StandResponse.java index 416fa8c..1bd177b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/service/vo/StandResponse.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/vo/StandResponse.java @@ -1,4 +1,4 @@ -package org.nl.wms.ext.service.vo; +package org.nl.wms.ext.acs.service.vo; import cn.hutool.core.date.DateUtil; import cn.hutool.http.HttpStatus; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/controller/SysInteractRecordController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/controller/SysInteractRecordController.java new file mode 100644 index 0000000..c1e0931 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/controller/SysInteractRecordController.java @@ -0,0 +1,66 @@ +package org.nl.wms.ext.record.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.ext.record.service.ISysInteractRecordService; +import org.nl.wms.ext.record.service.dao.SysInteractRecord; +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-07-19 +**/ +@Slf4j +@RestController +@Api(tags = "外部系统接口记录管理") +@RequestMapping("/api/sysInteractRecord") +public class SysInteractRecordController { + + @Autowired + private ISysInteractRecordService sysInteractRecordService; + + @GetMapping + @Log("查询外部系统接口记录") + @ApiOperation("查询外部系统接口记录") + //@SaCheckPermission("@el.check('sysInteractRecord:list')") + public ResponseEntity query(@RequestParam Map whereJson, PageQuery page){ + return new ResponseEntity<>(TableDataInfo.build(sysInteractRecordService.queryAll(whereJson,page)),HttpStatus.OK); + } + + @PostMapping + @Log("新增外部系统接口记录") + @ApiOperation("新增外部系统接口记录") + //@SaCheckPermission("@el.check('sysInteractRecord:add')") + public ResponseEntity create(@Validated @RequestBody SysInteractRecord entity){ + sysInteractRecordService.create(entity); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改外部系统接口记录") + @ApiOperation("修改外部系统接口记录") + //@SaCheckPermission("@el.check('sysInteractRecord:edit')") + public ResponseEntity update(@Validated @RequestBody SysInteractRecord entity){ + sysInteractRecordService.update(entity); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除外部系统接口记录") + @ApiOperation("删除外部系统接口记录") + //@SaCheckPermission("@el.check('sysInteractRecord:del')") + @DeleteMapping + public ResponseEntity delete(@RequestBody Set ids) { + sysInteractRecordService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java new file mode 100644 index 0000000..fcebdf9 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/ISysInteractRecordService.java @@ -0,0 +1,50 @@ +package org.nl.wms.ext.record.service; + +import com.alibaba.fastjson.JSONObject; +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.ext.acs.service.vo.BaseResponse; +import org.nl.wms.ext.record.service.dao.SysInteractRecord; + +import java.util.Map; +import java.util.Set; + +/** +* @description 服务接口 +* @author lyd +* @date 2023-07-19 +**/ +public interface ISysInteractRecordService extends IService { + + /** + * 查询数据分页 + * @param whereJson 条件 + * @param pageable 分页参数 + * @return IPage + */ + IPage queryAll(Map whereJson, PageQuery pageable); + + /** + * 创建 + * @param entity / + */ + void create(SysInteractRecord entity); + + /** + * 编辑 + * @param entity / + */ + void update(SysInteractRecord entity); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Set ids); + + /** + * 创建记录 + */ + void saveRecord(JSONObject param, BaseResponse response, String direction); +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/SysInteractRecord.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/SysInteractRecord.java new file mode 100644 index 0000000..9bcb4f7 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/SysInteractRecord.java @@ -0,0 +1,52 @@ +package org.nl.wms.ext.record.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.io.Serializable; + +/** +* @description / +* @author lyd +* @date 2023-07-19 +**/ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("sys_interact_record") +public class SysInteractRecord implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "interact_id", type = IdType.NONE) + @ApiModelProperty(value = "对接标识") + private String interact_id; + + @ApiModelProperty(value = "对接编码") + private String interact_code; + + @ApiModelProperty(value = "响应编码") + private int code; + + @ApiModelProperty(value = "响应信息") + private String message; + + @ApiModelProperty(value = "请求报文") + private String request_param; + + @ApiModelProperty(value = "响应结果") + private String response_param; + + @ApiModelProperty(value = "记录时间") + private String record_time; + + @ApiModelProperty(value = "方向") + private String direction; + + @ApiModelProperty(value = "是否成功") + private Boolean is_success; + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java new file mode 100644 index 0000000..c7d1a0d --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.java @@ -0,0 +1,12 @@ +package org.nl.wms.ext.record.service.dao.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.nl.wms.ext.record.service.dao.SysInteractRecord; + +/** +* @author lyd +* @date 2023-07-19 +**/ +public interface SysInteractRecordMapper extends BaseMapper { + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml new file mode 100644 index 0000000..55417d8 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dao/mapper/SysInteractRecordMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dto/SysInteractRecordDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dto/SysInteractRecordDto.java new file mode 100644 index 0000000..3939677 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dto/SysInteractRecordDto.java @@ -0,0 +1,40 @@ +package org.nl.wms.ext.record.service.dto; + +import lombok.Data; +import java.io.Serializable; + +/** +* @description / +* @author lyd +* @date 2023-07-19 +**/ +@Data +public class SysInteractRecordDto implements Serializable { + + /** 对接标识 */ + private String interact_id; + + /** 对接编码 */ + private String interact_code; + + /** 响应编码 */ + private String code; + + /** 响应信息 */ + private String message; + + /** 请求报文 */ + private String request_param; + + /** 响应结果 */ + private String response_param; + + /** 记录时间 */ + private String record_time; + + /** 方向 */ + private String direction; + + /** 是否成功 */ + private Boolean is_success; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dto/SysInteractRecordQuery.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dto/SysInteractRecordQuery.java new file mode 100644 index 0000000..3222808 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/dto/SysInteractRecordQuery.java @@ -0,0 +1,12 @@ +package org.nl.wms.ext.record.service.dto; + +import org.nl.common.domain.query.BaseQuery; +import org.nl.wms.ext.record.service.dao.SysInteractRecord; + +/** +* @author lyd +* @date 2023-07-19 +**/ +public class SysInteractRecordQuery extends BaseQuery { + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java new file mode 100644 index 0000000..4ee8240 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/record/service/impl/SysInteractRecordServiceImpl.java @@ -0,0 +1,82 @@ +package org.nl.wms.ext.record.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.http.HttpStatus; +import com.alibaba.fastjson.JSONObject; +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.ext.acs.service.vo.BaseResponse; +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; +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-07-19 +**/ +@Slf4j +@Service +public class SysInteractRecordServiceImpl extends ServiceImpl implements ISysInteractRecordService { + + @Autowired + private SysInteractRecordMapper sysInteractRecordMapper; + + @Override + public IPage queryAll(Map whereJson, PageQuery page){ + LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); + lam.orderByDesc(SysInteractRecord::getRecord_time); + IPage pages = new Page<>(page.getPage() + 1, page.getSize()); + sysInteractRecordMapper.selectPage(pages, lam); + return pages; + } + + @Override + public void create(SysInteractRecord entity) { + + entity.setInteract_id(IdUtil.getSnowflake(1, 1).nextIdStr()); + sysInteractRecordMapper.insert(entity); + } + + @Override + public void update(SysInteractRecord entity) { + SysInteractRecord dto = sysInteractRecordMapper.selectById(entity.getInteract_id()); + if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!"); + sysInteractRecordMapper.updateById(entity); + } + + @Override + public void deleteAll(Set ids) { + // 真删除 + sysInteractRecordMapper.deleteBatchIds(ids); + } + + @Override + public void saveRecord(JSONObject param, BaseResponse response, String direction) { + SysInteractRecord entity = new SysInteractRecord(); + entity.setInteract_id(IdUtil.getSnowflake(1, 1).nextIdStr()); + entity.setInteract_code(response.getRequestNo()); + entity.setCode(response.getCode()); + entity.setMessage(response.getMessage()); + entity.setRecord_time(DateUtil.now()); + entity.setDirection(direction); + entity.setRequest_param(JSONObject.toJSONString(param)); + entity.setResponse_param(JSONObject.toJSONString(response)); + entity.setIs_success(response.getCode() == HttpStatus.HTTP_OK); + sysInteractRecordMapper.insert(entity); + } + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java index 92f10f7..89a25e0 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task/service/ISchBaseTaskService.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; 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.ext.acs.service.dto.BaseRequest; import org.nl.wms.sch.task.service.dao.SchBaseTask; import org.nl.wms.sch.task_manage.task.core.TaskStatus; @@ -82,7 +83,7 @@ public interface ISchBaseTaskService extends IService { /** * 任务申请 - * @see org.nl.wms.ext.service.dto.BaseRequest + * @see BaseRequest * @param param / */ void apply(JSONObject param); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java index 418b7c7..adb02d0 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/GeneralDefinition.java @@ -33,4 +33,13 @@ public class GeneralDefinition { public static final String AUTO_CREATION = "1"; /**ACS创建**/ public static final String ACS_CREATION = "2"; + // 请求方向 + /**ACS->LMS**/ + public static final String ACS_LMS = "1"; + /**LMS->ACS**/ + public static final String LMS_ACS = "2"; + /**MES->LMS**/ + public static final String MES_LMS = "3"; + /**LMS->MES**/ + public static final String LMS_LMS = "4"; } diff --git a/lms/nladmin-ui/src/views/wms/ext/record/index.vue b/lms/nladmin-ui/src/views/wms/ext/record/index.vue new file mode 100644 index 0000000..320cdb1 --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/ext/record/index.vue @@ -0,0 +1,186 @@ + + + + + diff --git a/lms/nladmin-ui/src/views/wms/ext/record/sysInteractRecord.js b/lms/nladmin-ui/src/views/wms/ext/record/sysInteractRecord.js new file mode 100644 index 0000000..9f6d776 --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/ext/record/sysInteractRecord.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/sysInteractRecord', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/sysInteractRecord/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/sysInteractRecord', + method: 'put', + data + }) +} + +export default { add, edit, del }