diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/ApmsCheckResult.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/ApmsCheckResult.java
new file mode 100644
index 0000000..8c47de2
--- /dev/null
+++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/ApmsCheckResult.java
@@ -0,0 +1,129 @@
+package com.mt.wms.core.dal.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *
+ * apms推送检验结果表
+ *
+ *
+ * @author mt
+ * @since 2021-11-19
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("t_apms_check_result")
+public class ApmsCheckResult extends Model {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 删除标志,是否有效:1 可用 0不可用,2停止
+ */
+ @TableField("valid")
+ @TableLogic
+ private Integer valid;
+
+ /**
+ * 添加时间,入库时间
+ */
+ @TableField("create_time")
+ private LocalDateTime createTime;
+
+ /**
+ * 创建人id
+ */
+ @TableField("creator_id")
+ private Integer creatorId;
+
+ /**
+ * 更新人id
+ */
+ @TableField("updater_id")
+ private Integer updaterId;
+
+ /**
+ * 修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同
+ */
+ @TableField("update_time")
+ private LocalDateTime updateTime;
+
+ /**
+ * 版本号 默认为 1
+ */
+ @TableField("version")
+ @Version
+ private String version;
+
+ /**
+ * 生产单号
+ */
+ @TableField("sheet_no")
+ private String sheetNo;
+
+ /**
+ * 标识卡号
+ */
+ @TableField("iden_card_num")
+ private String idenCardNum;
+
+ /**
+ * 硬度检验结果(合格、不合格、返工、作废)
+ */
+ @TableField("hardness")
+ private String hardness;
+
+ /**
+ * 金相检验结果(合格、不合格)
+ */
+ @TableField("metallography")
+ private String metallography;
+
+ /**
+ * 心部硬度检验值
+ */
+ @TableField("heart_hardness")
+ private Float heartHardness;
+
+
+ public static final String ID = "id";
+
+ public static final String VALID = "valid";
+
+ public static final String CREATE_TIME = "create_time";
+
+ public static final String CREATOR_ID = "creator_id";
+
+ public static final String UPDATER_ID = "updater_id";
+
+ public static final String UPDATE_TIME = "update_time";
+
+ public static final String VERSION = "version";
+
+ public static final String SHEET_NO = "sheet_no";
+
+ public static final String IDEN_CARD_NUM = "iden_card_num";
+
+ public static final String HARDNESS = "hardness";
+
+ public static final String METALLOGRAPHY = "metallography";
+
+ public static final String HEART_HARDNESS = "heart_hardness";
+
+ @Override
+ protected Serializable pkVal() {
+ return this.id;
+ }
+
+}
diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ApmsCheckResultMapper.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ApmsCheckResultMapper.java
new file mode 100644
index 0000000..5dfd80e
--- /dev/null
+++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ApmsCheckResultMapper.java
@@ -0,0 +1,16 @@
+package com.mt.wms.core.dal.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.mt.wms.core.dal.entity.ApmsCheckResult;
+
+/**
+ *
+ * apms推送检验结果表 Mapper 接口
+ *
+ *
+ * @author mt
+ * @since 2021-11-19
+ */
+public interface ApmsCheckResultMapper extends BaseMapper {
+
+}
diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ApmsCheckResultMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ApmsCheckResultMapper.xml
new file mode 100644
index 0000000..3d4ef1a
--- /dev/null
+++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ApmsCheckResultMapper.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ id, valid, create_time, creator_id, updater_id, update_time, version, sheet_no, iden_card_num, hardness,
+ metallography, heart_hardness
+
+
+
diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/ApmsCheckResultServiceBiz.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/ApmsCheckResultServiceBiz.java
new file mode 100644
index 0000000..415ef28
--- /dev/null
+++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/ApmsCheckResultServiceBiz.java
@@ -0,0 +1,16 @@
+package com.mt.wms.core.dal.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.mt.wms.core.dal.entity.ApmsCheckResult;
+
+/**
+ *
+ * apms推送检验结果表 服务类
+ *
+ *
+ * @author mt
+ * @since 2021-11-19
+ */
+public interface ApmsCheckResultServiceBiz extends IService {
+
+}
diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/ApmsCheckResultServiceBizImpl.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/ApmsCheckResultServiceBizImpl.java
new file mode 100644
index 0000000..5773e71
--- /dev/null
+++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/ApmsCheckResultServiceBizImpl.java
@@ -0,0 +1,20 @@
+package com.mt.wms.core.dal.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.mt.wms.core.dal.entity.ApmsCheckResult;
+import com.mt.wms.core.dal.mapper.ApmsCheckResultMapper;
+import com.mt.wms.core.dal.service.ApmsCheckResultServiceBiz;
+import org.springframework.stereotype.Service;
+
+/**
+ *
+ * apms推送检验结果表 服务实现类
+ *
+ *
+ * @author mt
+ * @since 2021-11-19
+ */
+@Service
+public class ApmsCheckResultServiceBizImpl extends ServiceImpl implements ApmsCheckResultServiceBiz {
+
+}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
index 0cac0f5..3770983 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
@@ -6,6 +6,8 @@ import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.mt.wms.core.base.BaseController;
import com.mt.wms.core.constants.CommonConstant;
+import com.mt.wms.core.dal.entity.CommunicationLog;
+import com.mt.wms.core.dal.service.CommunicationLogServiceBiz;
import com.mt.wms.core.vo.R;
import com.mt.wms.empty.params.*;
import com.mt.wms.empty.service.OrderInfoService;
@@ -21,6 +23,11 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
+/**
+ * @author xcc
+ * @date 2021年11月18日
+ * @since 1.0
+ */
@RestController
@RequestMapping(CommonConstant.API_MODULE_BASE + "apms")
@Slf4j
@@ -29,74 +36,132 @@ public class ApmsController extends BaseController {
@Autowired
private OrderInfoService orderInfoService;
+ @Autowired
+ private CommunicationLogServiceBiz communicationLogServiceBiz;
+
static String Token = "";
- static String ApiAdress = "http://59.110.171.25:9010";
+ static String ApiAddress = "http://59.110.171.25:9010";
@PostMapping(value = "apmsPostOrder")
@ApiOperation(value = "接收APMS推送订单信息")
public R apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) {
+ CommunicationLog communicationLog = new CommunicationLog();
+ communicationLog.setCode("APMS" + System.currentTimeMillis());
+ communicationLog.setLogName("Wms接收Apms订单");
+ communicationLog.setContent(apmsPostOrderParam.toString());
+ setCommonField(communicationLog);
+ communicationLogServiceBiz.save(communicationLog);
return orderInfoService.apmsPostOrder(apmsPostOrderParam);
}
+ @PostMapping(value = "apmsVoidOrder")
+ @ApiOperation(value = "APMS作废订单")
+ public R apmsVoidOrder(@Validated @RequestBody String idenCardNum) {
+ CommunicationLog communicationLog = new CommunicationLog();
+ communicationLog.setCode("APMS" + System.currentTimeMillis());
+ communicationLog.setLogName("APMS作废订单");
+ communicationLog.setContent(idenCardNum);
+ setCommonField(communicationLog);
+ communicationLogServiceBiz.save(communicationLog);
+ return orderInfoService.apmsVoidOrder(idenCardNum);
+ }
+
+ @PostMapping(value = "apmsCompleteOrder")
+ @ApiOperation(value = "APMS完成订单")
+ public R apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) {
+ CommunicationLog communicationLog = new CommunicationLog();
+ communicationLog.setCode("APMS" + System.currentTimeMillis());
+ communicationLog.setLogName("APMS完成订单");
+ communicationLog.setContent(apmsCompleteOrder.toString());
+ setCommonField(communicationLog);
+ communicationLogServiceBiz.save(communicationLog);
+ return orderInfoService.apmsCompleteOrder(apmsCompleteOrder);
+ }
+
@PostMapping(value = "createProcessSheet")
- @ApiOperation(value = "通知APMS开始加工处理信息")
+ @ApiOperation(value = "APMS创建生产单接口")
public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) {
- //todo
checkToken();
HashMap paramMap = new HashMap<>();
paramMap.put("entity", apmsCreateProcess);
- HttpResponse response = HttpUtil.createPost(ApiAdress + "/platform/api/createProcessSheet")
+ HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/createProcessSheet")
.header("token", Token).form(paramMap).execute();
+ CommunicationLog communicationLog = new CommunicationLog();
+ communicationLog.setCode("APMS" + System.currentTimeMillis());
+ communicationLog.setLogName("APMS创建生产单");
+ communicationLog.setContent(paramMap.toString());
+ setCommonField(communicationLog);
+ communicationLogServiceBiz.save(communicationLog);
return successful(response);
}
@PostMapping(value = "startProcess")
- @ApiOperation(value = "获取APMS订单开始处理")
+ @ApiOperation(value = "通知APMS生产单开始处理")
public R startProcess(@Validated @RequestBody ApmsStartProcess apmsStartProcess) {
- //todo
checkToken();
HashMap paramMap = new HashMap<>();
paramMap.put("entity", apmsStartProcess);
- HttpResponse response = HttpUtil.createPost(ApiAdress + "/platform/api/startProcess")
+ HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/startProcess")
.header("token", Token).form(paramMap).execute();
+ CommunicationLog communicationLog = new CommunicationLog();
+ communicationLog.setCode("APMS" + System.currentTimeMillis());
+ communicationLog.setLogName("通知APMS生产单开始处理");
+ communicationLog.setContent(paramMap.toString());
+ setCommonField(communicationLog);
+ communicationLogServiceBiz.save(communicationLog);
return successful(response);
}
@PostMapping(value = "endProcess")
@ApiOperation(value = "通知APMS订单结束处理")
public R endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) {
- //todo
checkToken();
HashMap paramMap = new HashMap<>();
paramMap.put("entity", apmsEndProcess);
- HttpResponse response = HttpUtil.createPost(ApiAdress + "/platform/api/endProcess")
+ HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/endProcess")
.header("token", Token).form(paramMap).execute();
+ CommunicationLog communicationLog = new CommunicationLog();
+ communicationLog.setCode("APMS" + System.currentTimeMillis());
+ communicationLog.setLogName("通知APMS订单结束处理");
+ communicationLog.setContent(paramMap.toString());
+ setCommonField(communicationLog);
+ communicationLogServiceBiz.save(communicationLog);
return successful(response);
}
@PostMapping(value = "finishProcessSheet")
- @ApiOperation(value = "通知APMS结束加工处理信息")
+ @ApiOperation(value = "通知APMS完成生产单接口")
public R finishProcessSheet(@Validated @RequestBody ApmsFinishProcessSheet apmsFinishProcessSheet) {
- //todo
checkToken();
HashMap paramMap = new HashMap<>();
paramMap.put("entity", apmsFinishProcessSheet);
- HttpResponse response = HttpUtil.createPost(ApiAdress + "/platform/api/finishProcessSheet")
+ HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/finishProcessSheet")
.header("token", Token).form(paramMap).execute();
+ CommunicationLog communicationLog = new CommunicationLog();
+ communicationLog.setCode("APMS" + System.currentTimeMillis());
+ communicationLog.setLogName("通知APMS完成生产单接口");
+ communicationLog.setContent(paramMap.toString());
+ setCommonField(communicationLog);
+ communicationLogServiceBiz.save(communicationLog);
return successful(response);
}
@PostMapping(value = "getApmsToken")
- @ApiOperation(value = "获取APMS获得Token")
+ @ApiOperation(value = "获取APMS Token")
public R getApmsToken() {
HashMap paramMap = new HashMap<>();
paramMap.put("apiKey", "7ee8f59bbaeae27e");
paramMap.put("platFormCode", "CUC");
- String result = HttpUtil.get(ApiAdress + "/platform/api/getToken", paramMap);
+ String result = HttpUtil.get(ApiAddress + "/platform/api/getToken", paramMap);
JSON parse = JSONUtil.parse(result);
Object token = parse.getByPath("token");
Token = token.toString();
- //todo 记录通讯日志
+ CommunicationLog communicationLog = new CommunicationLog();
+ communicationLog.setCode("APMS" + System.currentTimeMillis());
+ communicationLog.setLogName("获取APMS Token");
+ communicationLog.setContent(paramMap.toString());
+ setCommonField(communicationLog);
+ communicationLogServiceBiz.save(communicationLog);
return successful(result);
}
@@ -106,9 +171,14 @@ public class ApmsController extends BaseController {
checkToken();
HashMap paramMap = new HashMap<>();
paramMap.put("workShopCode", workShopCode);
- HttpResponse response = HttpUtil.createGet(ApiAdress + "/platform/api/getStoveCodeByWorkShopCode")
+ HttpResponse response = HttpUtil.createGet(ApiAddress + "/platform/api/getStoveCodeByWorkShopCode")
.header("token", Token).form(paramMap).execute();
- //todo 记录通讯日志
+ CommunicationLog communicationLog = new CommunicationLog();
+ communicationLog.setCode("APMS" + System.currentTimeMillis());
+ communicationLog.setLogName("APMS通过车间编码获取炉号信息");
+ communicationLog.setContent(paramMap.toString());
+ setCommonField(communicationLog);
+ communicationLogServiceBiz.save(communicationLog);
return successful(response);
}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCompleteOrder.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCompleteOrder.java
new file mode 100644
index 0000000..eab0510
--- /dev/null
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCompleteOrder.java
@@ -0,0 +1,37 @@
+package com.mt.wms.empty.params;
+
+
+import com.mt.wms.core.base.BaseParam;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value = "Apms返回订单检验结果", description = "Apms返回订单检验结果")
+public class ApmsCompleteOrder extends BaseParam {
+
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "生产单编号", required = false)
+ private String sheetNo;
+
+ /**
+ * 标识卡号,APMS系统获取
+ */
+ @ApiModelProperty(value = "标识卡号", required = true)
+ private String idenCardNum;
+
+ @ApiModelProperty(value = "硬度检验结果", required = true)
+ private String hardness;
+
+ @ApiModelProperty(value = "金相检验结果", required = true)
+ private String metallographic;
+
+ @ApiModelProperty(value = "心部硬度检验值", required = true)
+ private Float heartHardness;
+}
+
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderParamForApms.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderParamForApms.java
index 3e5c93e..513cde0 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderParamForApms.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderParamForApms.java
@@ -59,12 +59,21 @@ public class OrderParamForApms extends BaseParam {
/**
* 材料牌号 APMS系统获取
*/
- @ApiModelProperty(value = "材料牌号")
+ @ApiModelProperty(value = "材料牌号")
private String materialDes;
/**
* 工艺要求 APMS系统获取
*/
- @ApiModelProperty(value = "工艺要求")
+ @ApiModelProperty(value = "工艺要求")
private String craftIll;
+
+ @ApiModelProperty(value = "加工数量")
+ private Float quantity;
+
+ @ApiModelProperty(value = "加工重量")
+ private Float weight;
+
+ @ApiModelProperty(value = "单位")
+ private String unit;
}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java
index dc95a63..c691eb6 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java
@@ -50,4 +50,12 @@ public interface CurrTaskDetService {
* @return 结果
*/
List getTaskDetailsByMainId(IdParam idParam);
+
+ /**
+ * 查询某个标识卡号的详细任务列表
+ *
+ * @param idenCardNum 标识卡号
+ * @return 结果
+ */
+ List getTaskDetailsByIdenCardNum(String idenCardNum);
}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java
index 76915e5..409129b 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java
@@ -3,10 +3,7 @@ package com.mt.wms.empty.service;
import com.mt.wms.core.params.IdParam;
import com.mt.wms.core.vo.PageVo;
import com.mt.wms.core.vo.R;
-import com.mt.wms.empty.params.OrderInfoBasePageParam;
-import com.mt.wms.empty.params.OrderInfoPersonCreateParam;
-import com.mt.wms.empty.params.OrderInfoTaskDetParam;
-import com.mt.wms.empty.params.OrderParamForApms;
+import com.mt.wms.empty.params.*;
import com.mt.wms.empty.vo.OrderInfoTaskDetVo;
import com.mt.wms.empty.vo.OrderInfoVo;
@@ -77,4 +74,21 @@ public interface OrderInfoService {
* @return 结果
*/
R voidOrder(IdParam idParam);
+
+ /**
+ * APMS作废订单
+ *
+ * @param idenCardNum 标识卡号
+ * @return 结果
+ */
+ R apmsVoidOrder(String idenCardNum);
+
+ /**
+ * APMS返回订单结果
+ *
+ * @param apmsCompleteOrder 订单检验结果
+ * @return 结果
+ */
+ R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder);
+
}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java
index 976d972..9bbd583 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java
@@ -71,4 +71,12 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe
.eq(CurrTaskDet.VALID, 1);
return currTaskDetServiceBiz.list(queryWrapper);
}
+
+ @Override
+ public List getTaskDetailsByIdenCardNum(String idenCardNum) {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, idenCardNum)
+ .eq(CurrTaskDet.VALID, 1);
+ return currTaskDetServiceBiz.list(queryWrapper);
+ }
}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java
index bb1d7b3..632a5f6 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java
@@ -11,16 +11,16 @@ import com.mt.wms.basic.vo.KilnInfoVo;
import com.mt.wms.basic.vo.VehicleVo;
import com.mt.wms.core.api.Assert;
import com.mt.wms.core.base.BaseService;
+import com.mt.wms.core.dal.entity.CurrTaskDet;
import com.mt.wms.core.dal.entity.OrderInfo;
+import com.mt.wms.core.dal.service.CommunicationLogServiceBiz;
import com.mt.wms.core.dal.service.OrderInfoServiceBiz;
import com.mt.wms.core.params.IdParam;
import com.mt.wms.core.vo.PageVo;
import com.mt.wms.core.vo.R;
+import com.mt.wms.empty.controller.ApmsController;
import com.mt.wms.empty.enums.OrderSourceEnum;
-import com.mt.wms.empty.params.OrderInfoBasePageParam;
-import com.mt.wms.empty.params.OrderInfoPersonCreateParam;
-import com.mt.wms.empty.params.OrderInfoTaskDetParam;
-import com.mt.wms.empty.params.OrderParamForApms;
+import com.mt.wms.empty.params.*;
import com.mt.wms.empty.service.CurrTaskDetService;
import com.mt.wms.empty.service.CurrTaskService;
import com.mt.wms.empty.service.OrderInfoHisService;
@@ -67,17 +67,20 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
@Autowired
LocationInfoService locationInfoService;
+ @Autowired
+ CommunicationLogServiceBiz communicationLogServiceBiz;
+ @Autowired
+ ApmsController apmsControl;
@Override
public R apmsPostOrder(OrderParamForApms apmsPostOrderParam) {
OrderInfo orderInfo = new OrderInfo();
- BeanUtils.copyProperties(apmsPostOrderParam,orderInfo);
+ BeanUtils.copyProperties(apmsPostOrderParam, orderInfo);
setCommonField(orderInfo);
//设定来源信息为apms
orderInfo.setOrderSource(OrderSourceEnum.APMS.getValue());
- orderInfo.setInterCode("APMS"+System.currentTimeMillis());
+ orderInfo.setInterCode("APMS" + System.currentTimeMillis());
orderInfoService.save(orderInfo);
- //todo 记录通讯日志信息
return successful("Wms接收Apms订单成功。");
}
@@ -101,7 +104,6 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
orderInfo.setOrderSource(OrderSourceEnum.PERSON.getValue());
orderInfo.setInterCode("PERSONAL"+System.currentTimeMillis());
orderInfoService.save(orderInfo);
- //todo 通知apms创建了一个订单
return successful("人工创建订单成功。");
}
@@ -181,4 +183,24 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
orderInfoService.updateById(byId);
return successful("操作成功。");
}
+
+ @Override
+ public R apmsVoidOrder(String idenCardNum) {
+ OrderInfo byId = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, idenCardNum));
+ //确定是否有订单在生产
+ List taskDetailsByIdenCardNum = currTaskDetService.getTaskDetailsByIdenCardNum(idenCardNum);
+ if (taskDetailsByIdenCardNum.size() > 0)
+ {
+ return failed("操作失败,已经存在生产中的任务单。");
+ }
+ else
+ {
+ return voidOrder(IdParam.builder().id(byId.getId()).build());
+ }
+ }
+
+ @Override
+ public R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder) {
+ return null;
+ }
}