为订单信息和订单历史信息添加作废字段

优化apms接口注解
优化订单作废等相关操作数据逻辑
This commit is contained in:
徐晨晨 2021-12-15 11:05:23 +08:00
bovenliggende 336bc29ddc
commit f105cb3e5d
8 gewijzigde bestanden met toevoegingen van 40 en 29 verwijderingen

Bestand weergeven

@ -15,7 +15,7 @@ import java.time.LocalDateTime;
* </p>
*
* @author mt
* @since 2021-12-09
* @since 2021-12-15
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ -73,7 +73,7 @@ public class OrderInfo extends Model<OrderInfo> {
private Integer orderSource;
/**
* 状态 0等待执行1执行中2执行完成3追加后完成追加后就按完成来算
* 状态 0等待执行1执行中2执行完成
*/
@TableField("status")
private Integer status;
@ -186,6 +186,12 @@ public class OrderInfo extends Model<OrderInfo> {
@TableField("orther_b")
private String ortherB;
/**
* 是否作废 1:正常 0:作废
*/
@TableField("order_void")
private Integer orderVoid;
public static final String ID = "id";
@ -241,6 +247,8 @@ public class OrderInfo extends Model<OrderInfo> {
public static final String ORTHER_B = "orther_b";
public static final String ORDER_VOID = "order_void";
@Override
protected Serializable pkVal() {
return this.id;

Bestand weergeven

@ -15,7 +15,7 @@ import java.time.LocalDateTime;
* </p>
*
* @author mt
* @since 2021-12-09
* @since 2021-12-15
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ -73,7 +73,7 @@ public class OrderInfoHis extends Model<OrderInfoHis> {
private Integer orderSource;
/**
* 状态 0等待执行1执行中2执行完成3追加后完成追加后就按完成来算
* 状态 0等待执行1执行中2执行完成
*/
@TableField("status")
private Integer status;
@ -162,6 +162,12 @@ public class OrderInfoHis extends Model<OrderInfoHis> {
@TableField("quantity")
private Float quantity;
/**
* 是否作废 0正常 1作废
*/
@TableField("order_void")
private Integer orderVoid;
public static final String ID = "id";
@ -209,6 +215,8 @@ public class OrderInfoHis extends Model<OrderInfoHis> {
public static final String QUANTITY = "quantity";
public static final String ORDER_VOID = "order_void";
@Override
protected Serializable pkVal() {
return this.id;

Bestand weergeven

@ -27,13 +27,14 @@
<result column="unit" property="unit" />
<result column="weight" property="weight" />
<result column="quantity" property="quantity" />
<result column="order_void" property="orderVoid"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code,
order_no, old_order_no, iden_card_num, customer_no, customer_name, product_name, product_model, material_des,
craft_ill, unit, weight, quantity
craft_ill, unit, weight, quantity, order_void
</sql>
</mapper>

Bestand weergeven

@ -31,13 +31,14 @@
<result column="add_b" property="addB" />
<result column="orther_a" property="ortherA" />
<result column="orther_b" property="ortherB" />
<result column="order_void" property="orderVoid"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code,
order_no, old_order_no, iden_card_num, customer_no, customer_name, product_name, product_model, material_des,
craft_ill, unit, weight, quantity, add_a, add_b, orther_a, orther_b
craft_ill, unit, weight, quantity, add_a, add_b, orther_a, orther_b, order_void
</sql>
</mapper>

Bestand weergeven

@ -53,11 +53,11 @@ public class ApmsController extends BaseController {
static String ApiAddress = "http://59.110.171.25:9010";
@PostMapping(value = "apmsPostOrder")
@ApiOperation(value = "接收APMS推送订单信息")
@ApiOperation(value = "WMS接收APMS推送订单信息")
public R<String> apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) {
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("WMS接收APMS订单");
communicationLog.setLogName("WMS接收APMS推送订单信息");
communicationLog.setContent(apmsPostOrderParam.toString());
communicationLog.setType(3);
setCommonField(communicationLog);
@ -66,11 +66,11 @@ public class ApmsController extends BaseController {
}
@PostMapping(value = "apmsVoidOrder")
@ApiOperation(value = "APMS通知WMS作废订单")
@ApiOperation(value = "WMS接收APMS作废订单信息")
public R<String> apmsVoidOrder(@Validated @RequestBody String idenCardNum) {
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("APMS通知WMS作废订单");
communicationLog.setLogName("WMS接收APMS作废订单信息");
communicationLog.setType(3);
communicationLog.setContent(idenCardNum);
setCommonField(communicationLog);
@ -79,11 +79,11 @@ public class ApmsController extends BaseController {
}
@PostMapping(value = "apmsCompleteOrder")
@ApiOperation(value = "APMS返回加工单检验结果")
@ApiOperation(value = "WMS接收APMS加工单检验结果")
public R<String> apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) {
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("APMS返回WMS加工单检验结果");
communicationLog.setLogName("WMS接收APMS加工单检验结果");
communicationLog.setType(3);
communicationLog.setContent(apmsCompleteOrder.toString());
setCommonField(communicationLog);
@ -208,7 +208,7 @@ public class ApmsController extends BaseController {
}
@PostMapping(value = "getStoveCodeByWorkShopCode")
@ApiOperation(value = "APMS通过车间编码获取炉号信息")
@ApiOperation(value = "WMS通过APMS使用车间编码获取炉号信息")
public R<ApmsStoveVo> getStoveCodeByWorkShopCode(String workShopCode) {
checkToken();
HashMap<String, Object> paramMap = new HashMap<>();

Bestand weergeven

@ -118,9 +118,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
setCommonField(taskHis);
//将主任务放入到历史表清空id防止重复
R<IdVo> save = taskHisService.save(taskHis);
byId.setValid(0);
byId.setStatus(2);
currTaskServiceBiz.updateById(byId);
currTaskServiceBiz.removeById(byId);
List<CurrTaskDet> taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(byId.getId()).build());
List<TaskDetHis> taskDetHis = com.mt.wms.core.utils.BeanUtils.copyList(taskDetailsByMainId, TaskDetHis.class);
taskDetHis.forEach(detHis -> {

Bestand weergeven

@ -98,7 +98,6 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
QueryWrapper<OrderInfo> wrapper = new QueryWrapper<>();
wrapper.like(StringUtils.isNotBlank(param.getIdenCardNum()), OrderInfo.IDEN_CARD_NUM, param.getIdenCardNum())
.like(StringUtils.isNotBlank(param.getOrderNo()), OrderInfo.ORDER_NO, param.getOrderNo())
.eq(OrderInfo.VALID, 1)
.orderByDesc(OrderInfo.CREATE_TIME);
Page<OrderInfo> page = orderInfoService.page(new Page<>(param.getCurrent(), param.getSize()), wrapper);
PageVo<OrderInfoVo> orderInfoVoPageVo = new PageVo<>(page, OrderInfoVo.class);
@ -130,6 +129,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
@Override
public R<OrderInfoVo> getOne(IdParam idParam) {
OrderInfo byId = orderInfoService.getById(idParam.getId());
Assert.notNull("未找到订单信息。", byId);
OrderInfoVo build = OrderInfoVo.builder().build();
BeanUtils.copyProperties(byId, build);
R<OrderInfoVo> info = getTaskInfoByIdenCardNum(build.getIdenCardNum());
@ -150,7 +150,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
public R<PageVo<OrderInfoTaskDetVo>> getTaskInfo(OrderInfoTaskDetParam param) {
//从任务详细中获取该标识卡和订单的所有订单
PageVo<OrderInfoTaskDetVo> currOrderCurrTask = currTaskDetService.getCurrOrderCurrTask(param);
Assert.gtZero(currOrderCurrTask.getRecords().size(),"该订单暂无详细记录。");
Assert.notNull("该订单暂无详细任务记录。", currOrderCurrTask.getRecords());
//获取车辆信息
R<List<VehicleVo>> vehicle = vehicleService.list(new VehicleQueryParam());
Map<Long, List<VehicleVo>> collect = vehicle.getData().stream().collect(Collectors.groupingBy(VehicleVo::getId));
@ -237,11 +237,9 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
@Override
public R<String> completeOrder(IdParam idParam) {
OrderInfo byId = orderInfoService.getById(idParam.getId());
byId.setValid(0);
byId.setStatus(2);
orderInfoService.updateById(byId);
orderInfoService.removeById(byId);
byId.setId(null);
byId.setValid(1);
byId.setInterCode(IDGenerator.gen("DDHIS", IDGenerator.PATTERN_YYYYMMDDHHMM, 2, "ORDER_HIS_CODE"));
setCommonField(byId);
orderInfoHisService.save(byId);
@ -251,8 +249,9 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
@Override
public R<String> voidOrder(IdParam idParam) {
OrderInfo byId = orderInfoService.getById(idParam.getId());
Assert.notNull("未找到订单信息。", byId);
byId.setUpdateTime(LocalDateTime.now());
byId.setValid(0);
byId.setOrderVoid(0);
orderInfoService.updateById(byId);
return successful("成功,订单状态置为作废。");
}
@ -286,6 +285,6 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
one.setUpdateTime(LocalDateTime.now());
apmsCheckResultServiceBiz.save(one);
//订单不应该在该地方完成额外提供一个完成接口供人工完成不通知apms
return successful("任务执行完成");
return successful("接收检验结果成功");
}
}

Bestand weergeven

@ -30,13 +30,8 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo {
private Long id;
@ApiModelProperty(value = "订单状态")
private Integer valid;
private Integer orderVoid;
/**
* 来源1.APMS 2.人工输入
*/
@ApiModelProperty(value = "订单来源")
private Integer orderSource;
/**
* 添加时间每次修改记录要更新记录新增时间
*/
@ -49,7 +44,7 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo {
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
/**
* 状态 0等待执行1执行中2执行完成3追加后完成追加后就按完成来算
* 状态 0等待执行1执行中2执行完成
*/
@ApiModelProperty(value = "状态")
private Integer status;