diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CraftInfo.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CraftInfo.java new file mode 100644 index 0000000..7698dc9 --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CraftInfo.java @@ -0,0 +1,137 @@ +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; + +/** + *

+ * 设备工艺信息 + *

+ * + * @author mt + * @since 2021-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("t_craft_info") +public class CraftInfo 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; + + /** + * 状态,0:可用,1:不可用 + */ + @TableField("status") + private Integer status; + + /** + * 内部编码,系统自动生成 + */ + @TableField("inter_code") + private String interCode; + + /** + * 工艺号 + */ + @TableField("craft_code") + private String craftCode; + + /** + * 编码 + */ + @TableField("code") + private String code; + + /** + * 对应PLC值 + */ + @TableField("plc_value") + private Integer plcValue; + + /** + * 说明 + */ + @TableField("content") + private String content; + + + 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 STATUS = "status"; + + public static final String INTER_CODE = "inter_code"; + + public static final String CRAFT_CODE = "craft_code"; + + public static final String CODE = "code"; + + public static final String PLC_VALUE = "plc_value"; + + public static final String CONTENT = "content"; + + @Override + protected Serializable pkVal() { + return this.id; + } + +} diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java index 885fb2a..a2c413a 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java @@ -1,25 +1,21 @@ package com.mt.wms.core.dal.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.activerecord.Model; -import com.baomidou.mybatisplus.annotation.Version; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.time.LocalDateTime; + /** *

* 当前任务 *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-09 */ @Data @EqualsAndHashCode(callSuper = false) @@ -88,6 +84,12 @@ public class CurrTask extends Model { @TableField("task_code") private String taskCode; + /** + * 生产单号 APMS生成生产单后返回 + */ + @TableField("sheet_no") + private String sheetNo; + /** * 任务来源 0:人工 扩展字段 */ @@ -172,6 +174,18 @@ public class CurrTask extends Model { @TableField("location_name") private String locationName; + /** + * 工艺号ID,关联工艺号表:t_craft_info + */ + @TableField("f_craft_code_id") + private Long fCraftCodeId; + + /** + * 工艺号对应PLC值 + */ + @TableField("f_plc_value") + private Integer fPlcValue; + public static final String ID = "id"; @@ -193,6 +207,8 @@ public class CurrTask extends Model { public static final String TASK_CODE = "task_code"; + public static final String SHEET_NO = "sheet_no"; + public static final String TASK_SOURCE = "task_source"; public static final String TASK_TYPE = "task_type"; @@ -221,6 +237,10 @@ public class CurrTask extends Model { public static final String LOCATION_NAME = "location_name"; + public static final String F_CRAFT_CODE_ID = "f_craft_code_id"; + + public static final String F_PLC_VALUE = "f_plc_value"; + @Override protected Serializable pkVal() { return this.id; diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java index e561ad4..1636215 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java @@ -1,25 +1,21 @@ package com.mt.wms.core.dal.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.activerecord.Model; -import com.baomidou.mybatisplus.annotation.Version; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.time.LocalDateTime; + /** *

* 订单任务表 *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-09 */ @Data @EqualsAndHashCode(callSuper = false) @@ -100,6 +96,12 @@ public class OrderInfo extends Model { @TableField("order_no") private String orderNo; + /** + * 原订单号,APMS系统获取 返单时才存在 + */ + @TableField("old_order_no") + private String oldOrderNo; + /** * 标识卡号,APMS系统获取 */ @@ -209,6 +211,8 @@ public class OrderInfo extends Model { public static final String ORDER_NO = "order_no"; + public static final String OLD_ORDER_NO = "old_order_no"; + public static final String IDEN_CARD_NUM = "iden_card_num"; public static final String CUSTOMER_NO = "customer_no"; diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java index f09911a..4c599ec 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java @@ -1,25 +1,21 @@ package com.mt.wms.core.dal.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.activerecord.Model; -import com.baomidou.mybatisplus.annotation.Version; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.time.LocalDateTime; + /** *

* 订单任务历史表 *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-09 */ @Data @EqualsAndHashCode(callSuper = false) @@ -100,6 +96,12 @@ public class OrderInfoHis extends Model { @TableField("order_no") private String orderNo; + /** + * 原订单号,APMS系统获取,返工单才存在 + */ + @TableField("old_order_no") + private String oldOrderNo; + /** * 标识卡号,APMS系统获取 */ @@ -185,6 +187,8 @@ public class OrderInfoHis extends Model { public static final String ORDER_NO = "order_no"; + public static final String OLD_ORDER_NO = "old_order_no"; + public static final String IDEN_CARD_NUM = "iden_card_num"; public static final String CUSTOMER_NO = "customer_no"; diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/TaskHis.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/TaskHis.java index e1e530b..b3d00b9 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/TaskHis.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/TaskHis.java @@ -1,25 +1,21 @@ package com.mt.wms.core.dal.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.activerecord.Model; -import com.baomidou.mybatisplus.annotation.Version; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.time.LocalDateTime; + /** *

* 任务历史 *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-09 */ @Data @EqualsAndHashCode(callSuper = false) @@ -88,6 +84,12 @@ public class TaskHis extends Model { @TableField("task_code") private String taskCode; + /** + * 生产单号 APMS生成生产单后返回 + */ + @TableField("sheet_no") + private String sheetNo; + /** * 任务来源 0:人工 扩展字段 */ @@ -172,6 +174,18 @@ public class TaskHis extends Model { @TableField("location_name") private String locationName; + /** + * 工艺号ID,关联工艺号表:t_craft_info + */ + @TableField("f_craft_code_id") + private Long fCraftCodeId; + + /** + * 工艺号对应PLC值 + */ + @TableField("f_plc_value") + private Integer fPlcValue; + public static final String ID = "id"; @@ -193,6 +207,8 @@ public class TaskHis extends Model { public static final String TASK_CODE = "task_code"; + public static final String SHEET_NO = "sheet_no"; + public static final String TASK_SOURCE = "task_source"; public static final String TASK_TYPE = "task_type"; @@ -221,6 +237,10 @@ public class TaskHis extends Model { public static final String LOCATION_NAME = "location_name"; + public static final String F_CRAFT_CODE_ID = "f_craft_code_id"; + + public static final String F_PLC_VALUE = "f_plc_value"; + @Override protected Serializable pkVal() { return this.id; diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.java new file mode 100644 index 0000000..03289f5 --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.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.CraftInfo; + +/** + *

+ * 设备工艺信息 Mapper 接口 + *

+ * + * @author mt + * @since 2021-12-09 + */ +public interface CraftInfoMapper extends BaseMapper { + +} diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.xml new file mode 100644 index 0000000..953ee3e --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, craft_code, code, + plc_value, content + + + diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CurrTaskMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CurrTaskMapper.xml index 0db46ac..375bce2 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CurrTaskMapper.xml +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CurrTaskMapper.xml @@ -14,25 +14,30 @@ + - - - - - - - - - - + + + + + + + + + + + + - id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, task_code, task_source, task_type, process_type, pallet_code, a_begin_time, a_end_time, start_position, target_position, kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name + id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, task_code, sheet_no, + task_source, task_type, process_type, pallet_code, a_begin_time, a_end_time, start_position, target_position, + kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name, f_craft_code_id, f_plc_value diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml index 0476782..352684c 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml @@ -16,6 +16,7 @@ + @@ -30,7 +31,9 @@ - id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code, order_no, iden_card_num, customer_no, customer_name, product_name, product_model, material_des, craft_ill, unit, weight, quantity + 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 diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml index c1efe7b..1131b73 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml @@ -16,6 +16,7 @@ + @@ -34,7 +35,9 @@ - id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code, 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 + 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 diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/TaskHisMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/TaskHisMapper.xml index 3c467da..d6710d4 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/TaskHisMapper.xml +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/TaskHisMapper.xml @@ -14,25 +14,30 @@ + - - - - - - - - - - + + + + + + + + + + + + - id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, task_code, task_source, task_type, process_type, pallet_code, a_begin_time, a_end_time, start_position, target_position, kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name + id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, task_code, sheet_no, + task_source, task_type, process_type, pallet_code, a_begin_time, a_end_time, start_position, target_position, + kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name, f_craft_code_id, f_plc_value diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/CraftInfoServiceBiz.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/CraftInfoServiceBiz.java new file mode 100644 index 0000000..087fa8c --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/CraftInfoServiceBiz.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.CraftInfo; + +/** + *

+ * 设备工艺信息 服务类 + *

+ * + * @author mt + * @since 2021-12-09 + */ +public interface CraftInfoServiceBiz extends IService { + +} diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/CraftInfoServiceBizImpl.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/CraftInfoServiceBizImpl.java new file mode 100644 index 0000000..af0e7d9 --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/CraftInfoServiceBizImpl.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.CraftInfo; +import com.mt.wms.core.dal.mapper.CraftInfoMapper; +import com.mt.wms.core.dal.service.CraftInfoServiceBiz; +import org.springframework.stereotype.Service; + +/** + *

+ * 设备工艺信息 服务实现类 + *

+ * + * @author mt + * @since 2021-12-09 + */ +@Service +public class CraftInfoServiceBizImpl extends ServiceImpl implements CraftInfoServiceBiz { + +} 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 3770983..67e607f 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 @@ -1,5 +1,6 @@ package com.mt.wms.empty.controller; +import cn.hutool.http.ContentType; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; import cn.hutool.json.JSON; @@ -8,9 +9,14 @@ 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.enums.WhetherEnum; import com.mt.wms.core.vo.R; import com.mt.wms.empty.params.*; import com.mt.wms.empty.service.OrderInfoService; +import com.mt.wms.empty.vo.ApmsCreateProcessSheetVo; +import com.mt.wms.empty.vo.ApmsEndProcessVo; +import com.mt.wms.empty.vo.ApmsFinishProcessSheetVo; +import com.mt.wms.empty.vo.ApmsStoveVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -21,6 +27,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.HashMap; /** @@ -39,27 +47,31 @@ public class ApmsController extends BaseController { @Autowired private CommunicationLogServiceBiz communicationLogServiceBiz; + // static String Token = "eyJhbGciOiJIUzI1NiJ9.eyJkYXRlIjozMTkyNzU4NDk4ODA3LCJwbGF0Rm9ybUlkIjoyLCJhcGlLZXkiOiI3ZWU4ZjU5YmJhZWFlMjdlIiwiZXhwIjozMTkyNzU4NDk4LCJpYXQiOjE2Mzc1NTg0OTh9.RH3MRQr1dCBYW996-WXN69eXu1ZFblAQHfhZHNbTmCg"; static String Token = ""; + static LocalDateTime TokenExpireTime = LocalDateTime.now(); static String ApiAddress = "http://59.110.171.25:9010"; @PostMapping(value = "apmsPostOrder") @ApiOperation(value = "接收APMS推送订单信息") - public R apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) { + public R 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); communicationLogServiceBiz.save(communicationLog); return orderInfoService.apmsPostOrder(apmsPostOrderParam); } @PostMapping(value = "apmsVoidOrder") - @ApiOperation(value = "APMS作废订单") - public R apmsVoidOrder(@Validated @RequestBody String idenCardNum) { + @ApiOperation(value = "APMS通知WMS作废订单") + public R apmsVoidOrder(@Validated @RequestBody String idenCardNum) { CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("APMS作废订单"); + communicationLog.setLogName("APMS通知WMS作废订单"); + communicationLog.setType(3); communicationLog.setContent(idenCardNum); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); @@ -67,99 +79,129 @@ public class ApmsController extends BaseController { } @PostMapping(value = "apmsCompleteOrder") - @ApiOperation(value = "APMS完成订单") - public R apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) { + @ApiOperation(value = "APMS完成订单,返回加工单检验结果") + public R apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) { CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("APMS完成订单"); + communicationLog.setLogName("APMS完成订单,返回WMS加工单检验结果"); + communicationLog.setType(3); communicationLog.setContent(apmsCompleteOrder.toString()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); + //APMS完成订单,返回检验结果,更新结果和后续处理 return orderInfoService.apmsCompleteOrder(apmsCompleteOrder); } - @PostMapping(value = "createProcessSheet") - @ApiOperation(value = "APMS创建生产单接口") - public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) { + + /** + * 通过生产单编号删除生产单,如果生产单加工完成,不允许删除 + * + * @param sheetNo 生产单编号 + * @return 删除结果 + */ + @PostMapping(value = "deleteBySheetNo") + @ApiOperation(value = "通知APMS删除生产单") + public R deleteBySheetNo(@Validated @RequestBody String sheetNo) { checkToken(); HashMap paramMap = new HashMap<>(); - paramMap.put("entity", apmsCreateProcess); - HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/createProcessSheet") + paramMap.put("sheetNo", sheetNo); + HttpResponse response = HttpUtil.createGet(ApiAddress + "/platform/api/deleteBySheetNo") .header("token", Token).form(paramMap).execute(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("APMS创建生产单"); - communicationLog.setContent(paramMap.toString()); + communicationLog.setLogName("WMS通知APMS删除生产单"); + communicationLog.setType(2); + communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(response); + return successful(JSONUtil.toBean(response.body(), ApmsEndProcessVo.class)); + } + + @PostMapping(value = "createProcessSheet") + @ApiOperation(value = "通知APMS创建生产单接口") + public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) { + checkToken(); + String paramJson = JSONUtil.toJsonStr(apmsCreateProcess); + HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/createProcessSheet") + .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute(); + CommunicationLog communicationLog = new CommunicationLog(); + communicationLog.setCode("APMS" + System.currentTimeMillis()); + communicationLog.setLogName("WMS通知APMS创建生产单"); + communicationLog.setType(2); + communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body()); + setCommonField(communicationLog); + communicationLogServiceBiz.save(communicationLog); + return successful(JSONUtil.toBean(response.body(), ApmsCreateProcessSheetVo.class)); } @PostMapping(value = "startProcess") @ApiOperation(value = "通知APMS生产单开始处理") - public R startProcess(@Validated @RequestBody ApmsStartProcess apmsStartProcess) { + public R startProcess(@Validated @RequestBody ApmsStartProcess apmsStartProcess) { checkToken(); - HashMap paramMap = new HashMap<>(); - paramMap.put("entity", apmsStartProcess); + String paramJson = JSONUtil.toJsonStr(apmsStartProcess); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/startProcess") - .header("token", Token).form(paramMap).execute(); + .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("通知APMS生产单开始处理"); - communicationLog.setContent(paramMap.toString()); + communicationLog.setLogName("WMS通知APMS生产单开始处理"); + communicationLog.setType(2); + communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(response); + return successful(JSONUtil.toBean(response.body(), ApmsStartProcess.class)); } @PostMapping(value = "endProcess") - @ApiOperation(value = "通知APMS订单结束处理") - public R endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) { + @ApiOperation(value = "通知APMS生产单结束处理") + public R endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) { checkToken(); - HashMap paramMap = new HashMap<>(); - paramMap.put("entity", apmsEndProcess); + String paramJson = JSONUtil.toJsonStr(apmsEndProcess); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/endProcess") - .header("token", Token).form(paramMap).execute(); + .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("通知APMS订单结束处理"); - communicationLog.setContent(paramMap.toString()); + communicationLog.setLogName("WMS通知APMS生产单结束处理"); + communicationLog.setType(2); + communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(response); + return successful(JSONUtil.toBean(response.body(), ApmsEndProcessVo.class)); } @PostMapping(value = "finishProcessSheet") @ApiOperation(value = "通知APMS完成生产单接口") - public R finishProcessSheet(@Validated @RequestBody ApmsFinishProcessSheet apmsFinishProcessSheet) { + public R finishProcessSheet(@Validated @RequestBody ApmsFinishProcessSheet apmsFinishProcessSheet) { checkToken(); - HashMap paramMap = new HashMap<>(); - paramMap.put("entity", apmsFinishProcessSheet); + String paramJson = JSONUtil.toJsonStr(apmsFinishProcessSheet); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/finishProcessSheet") - .header("token", Token).form(paramMap).execute(); + .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("通知APMS完成生产单接口"); - communicationLog.setContent(paramMap.toString()); + communicationLog.setLogName("WMS通知APMS完成生产单"); + communicationLog.setType(2); + communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(response); + return successful(JSONUtil.toBean(response.body(), ApmsFinishProcessSheetVo.class)); } @PostMapping(value = "getApmsToken") @ApiOperation(value = "获取APMS Token") - public R getApmsToken() { + public R getApmsToken() { HashMap paramMap = new HashMap<>(); paramMap.put("apiKey", "7ee8f59bbaeae27e"); paramMap.put("platFormCode", "CUC"); String result = HttpUtil.get(ApiAddress + "/platform/api/getToken", paramMap); JSON parse = JSONUtil.parse(result); Object token = parse.getByPath("token"); + String expireTime = parse.getByPath("expireTime").toString(); Token = token.toString(); + TokenExpireTime = LocalDateTime.parse(expireTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("获取APMS Token"); - communicationLog.setContent(paramMap.toString()); + communicationLog.setLogName("WMS获取APMS Token"); + communicationLog.setType(2); + communicationLog.setContent("param:" + paramMap + "\nresult:" + result); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); return successful(result); @@ -167,7 +209,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "getStoveCodeByWorkShopCode") @ApiOperation(value = "APMS通过车间编码获取炉号信息") - public R getStoveCodeByWorkShopCode(String workShopCode) { + public R getStoveCodeByWorkShopCode(String workShopCode) { checkToken(); HashMap paramMap = new HashMap<>(); paramMap.put("workShopCode", workShopCode); @@ -175,11 +217,12 @@ public class ApmsController extends BaseController { .header("token", Token).form(paramMap).execute(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("APMS通过车间编码获取炉号信息"); - communicationLog.setContent(paramMap.toString()); + communicationLog.setLogName("WMS通过APMS使用车间编码获取炉号信息"); + communicationLog.setType(2); + communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(response); + return successful(JSONUtil.toBean(response.body(), ApmsStoveVo.class)); } private void checkToken() { @@ -187,5 +230,15 @@ public class ApmsController extends BaseController { { getApmsToken(); } + else if (TokenExpireTime.isBefore(LocalDateTime.now())) + { + getApmsToken(); + } + } + + private void setCommonField(CommunicationLog communicationLog) { + communicationLog.setValid(WhetherEnum.YES.getValue()); + communicationLog.setCreateTime(LocalDateTime.now()); + communicationLog.setUpdateTime(LocalDateTime.now()); } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java index f69eabc..9defeb6 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java @@ -1,15 +1,25 @@ package com.mt.wms.empty.controller; +import com.mt.wms.basic.service.KilnInfoService; +import com.mt.wms.basic.vo.KilnInfoVo; import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; +import com.mt.wms.core.dal.entity.CurrTask; +import com.mt.wms.core.params.BasePageParam; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.IdVo; import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.ApmsCreateProcessSheet; +import com.mt.wms.empty.params.CreateItem; import com.mt.wms.empty.params.CurrTaskQueryParam; import com.mt.wms.empty.params.TaskCreateParam; import com.mt.wms.empty.service.CurrTaskDetService; import com.mt.wms.empty.service.CurrTaskService; +import com.mt.wms.empty.service.OrderInfoService; +import com.mt.wms.empty.vo.ApmsCreateProcessSheetVo; +import com.mt.wms.empty.vo.ApmsStoveVo; +import com.mt.wms.empty.vo.CurrTaskMainQueryVo; import com.mt.wms.empty.vo.CurrTaskQueryVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -21,6 +31,11 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Map; + /** * @author xcc * @date 2021年11月8日 @@ -35,25 +50,102 @@ public class CurrTaskController extends BaseController { private CurrTaskService currTaskService; @Autowired private CurrTaskDetService currTaskDetService; + @Autowired + private OrderInfoService orderInfoService; + @Autowired + private ApmsController apmsControl; + @Autowired + private KilnInfoService kilnInfoService; @PostMapping(value = "createProcessTask") - @ApiOperation(value = "创建一个加工任务至任务队列") - public R createProcessTask(@Validated @RequestBody TaskCreateParam param) { - R mainTask = currTaskService.createProcessTask(param); - currTaskDetService.createProcessTaskDet(param.getDetParams(), mainTask.getData().getId()); - return successful("创建成功。"); + @ApiOperation(value = "订单加工-创建一个加工任务至任务队列") + public R createProcessTask(@Validated @RequestBody TaskCreateParam param) { + //验证标识卡号正确无误。 + orderInfoService.verifyTaskInfoByIdenCardNum(param.getDetParams()); + //验证炉子编码信息在apms正确无误 + R kilnInfoVoR = kilnInfoService.get(IdParam.builder().id(param.getKilnId()).build()); + String kilnCode = kilnInfoVoR.getData().getCode(); + R bm = apmsControl.getStoveCodeByWorkShopCode("BM"); + ArrayList> stoveCodes = bm.getData().getStoveCodes(); + //验证apms数据中存在这个炉子 + boolean verifyCodes = false; + ArrayList codeStr = new ArrayList<>(); + stoveCodes.forEach(kilnMap -> { + codeStr.add(kilnMap.get("code")); + }); + for (String s : codeStr) + { + if (s.equals(kilnCode)) + { + verifyCodes = true; + break; + } + } + if (!verifyCodes) + { + return failed("创建失败,APMS中验证炉号" + kilnCode + "失败!"); + } + + //通知apms创建一个生产单 + ApmsCreateProcessSheet apmsCreateSheet = new ApmsCreateProcessSheet(); + apmsCreateSheet.setWorkShopCode("BM"); + apmsCreateSheet.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + apmsCreateSheet.setTechCode(param.getCraftCode()); + //fixme 暂时没有正式user,使用测试账户 + apmsCreateSheet.setStartUser("QJJP03"); + ArrayList createItems = new ArrayList<>(); + param.getDetParams().forEach(e -> { + CreateItem createItem = new CreateItem(); + createItem.setItemCode(e.getIdenCardNum()); + createItem.setQuantity(e.getQuantity().intValue()); + createItem.setWeight(e.getWeight().doubleValue()); + createItems.add(createItem); + }); + apmsCreateSheet.setStoveCode(kilnCode); + apmsCreateSheet.setItems(createItems); + R processSheet = apmsControl.createProcessSheet(apmsCreateSheet); + + if (processSheet.getData().getSuccess()) + { + //apms创建成功后写入数据库 + R mainTask = currTaskService.createProcessTask(param); + currTaskDetService.createProcessTaskDet(param.getDetParams(), mainTask.getData().getId()); + String sheetNo = processSheet.getData().getSheetNo(); + //将返回的生产单号写入到主任务中。 + CurrTask currTaskById = currTaskService.getCurrTaskById(mainTask.getData().getId()); + currTaskById.setSheetNo(sheetNo); + currTaskService.updateCurrTaskById(currTaskById); + //生成详细任务中的检验结果数据在apms推送生产单结果时创建 + return successful("创建成功,任务添加至等待执行队列。"); + } + else + { + return failed("创建失败,APMS报错:" + processSheet.getData().getMsg()); + } } + @PostMapping(value = "mainCurrentTaskNow") + @ApiOperation(value = "首页-获取当前执行中的任务") + public R> mainCurrentTaskNow(@Validated @RequestBody BasePageParam param) { + return currTaskService.currentTaskMainPage(param); + } + @PostMapping(value = "currentTaskNow") - @ApiOperation(value = "获取当前执行的任务") + @ApiOperation(value = "获取当前执行的任务 (车辆名称传id)") public R> currentTask(@Validated @RequestBody CurrTaskQueryParam param) { return currTaskService.currentTaskPage(param); } @PostMapping(value = "completeTask") - @ApiOperation(value = "完成执行任务") - public R completeTask(@Validated @RequestBody IdParam param) { + @ApiOperation(value = "执行任务完成(仅wms,不通知apms)") + public R completeTask(@Validated @RequestBody IdParam param) { return currTaskService.completeTask(param); } + + @PostMapping(value = "deleteBySheetNo") + @ApiOperation(value = "人工通过生产单编号删除未正式开始的生产单(通知APMS)") + public R deleteBySheetNo(@Validated @RequestBody String sheetNo) { + return currTaskService.deleteBySheetNo(sheetNo); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java index 86b77eb..65ada3e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java @@ -12,7 +12,10 @@ import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * @author xcc @@ -28,7 +31,7 @@ public class CurrTaskDetController extends BaseController { CurrTaskDetService currTaskDetService; @PostMapping(value = "getTaskDet") - @ApiOperation(value = "查看主任务的详情任务列表") + @ApiOperation(value = "当前执行任务-查看详情") public R> getTaskDetailsPage(@Validated@RequestBody CurrTaskDetQueryParam currTaskId){ return currTaskDetService.getTaskDetailsPage(currTaskId); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java index 9bf5d8a..df6b264 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java @@ -35,44 +35,51 @@ public class OrderInfoController extends BaseController { private OrderInfoService orderInfoService; @PostMapping(value = "page") - @ApiOperation(value = "获取分页订单基础信息") + @ApiOperation(value = "订单加工管理-获取分页订单信息") private R> page(@Validated({PageGroup.class, Default.class}) @RequestBody OrderInfoBasePageParam orderBaseParam) { return orderInfoService.page(orderBaseParam); } + /** + * 应该没有人工创建信息这个接口 + */ @PostMapping(value = "personCreateOrder") @ApiOperation(value = "人工创建订单信息") - private R personCreateOrder(@Validated({Default.class}) @RequestBody OrderInfoPersonCreateParam orderInfoPersonCreateParam) { + @Deprecated + private R personCreateOrder(@Validated({Default.class}) @RequestBody OrderInfoPersonCreateParam orderInfoPersonCreateParam) { return orderInfoService.personCreateOrder(orderInfoPersonCreateParam); } - @PostMapping(value = "get") - @ApiOperation(value = "当前订单查看详情") + + @PostMapping(value = "getDet") + @ApiOperation(value = "当前订单列表-查看详情") private R get(@Validated @RequestBody IdParam idParam) { return orderInfoService.getOne(idParam); } @PostMapping(value = "getTaskInfo") - @ApiOperation(value = "当前订单任务详情") + @ApiOperation(value = "当前订单列表-查看任务详情") private R> getTaskInfo(@Validated @RequestBody OrderInfoTaskDetParam orderInfoTaskDetParam) { return orderInfoService.getTaskInfo(orderInfoTaskDetParam); } @GetMapping(value = "getTaskInfoByIdenCardNum") - @ApiOperation(value = "根据标识卡获取信息") + @ApiOperation(value = "订单加工-填写时根据标识卡获取信息") private R getTaskInfoByIdenCardNum(@Validated @RequestParam String idenCardNum) { return orderInfoService.getTaskInfoByIdenCardNum(idenCardNum); } @PostMapping(value = "completeOrder") - @ApiOperation(value = "完成订单") - private R completeOrder(@Validated @RequestBody IdParam idParam) { + @ApiOperation(value = "人工完成订单(不需通知apms,仅在wms完成)") + @Deprecated + private R completeOrder(@Validated @RequestBody IdParam idParam) { return orderInfoService.completeOrder(idParam); } @PostMapping(value = "voidOrder") @ApiOperation(value = "作废订单") - private R voidOrder(@Validated @RequestBody IdParam idParam) { + @Deprecated + private R voidOrder(@Validated @RequestBody IdParam idParam) { return orderInfoService.voidOrder(idParam); } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoHisController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoHisController.java index ac91c41..f0cd79e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoHisController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoHisController.java @@ -37,19 +37,19 @@ public class OrderInfoHisController extends BaseController { private OrderInfoHisService orderInfoHisService; @PostMapping(value = "page") - @ApiOperation(value = "获取分页订单基础信息") + @ApiOperation(value = "获取分页订单历史信息") private R> page(@Validated({PageGroup.class, Default.class}) @RequestBody OrderInfoBasePageParam orderBaseParam) { return orderInfoHisService.page(orderBaseParam); } - @PostMapping(value = "get") - @ApiOperation(value = "订单历史查看详情") + @PostMapping(value = "getDet") + @ApiOperation(value = "订单历史-查看详情") private R get(@Validated @RequestBody IdParam idParam) { return orderInfoHisService.getOne(idParam); } @PostMapping(value = "getTaskInfo") - @ApiOperation(value = "订单历史任务详情") + @ApiOperation(value = "订单历史-查看任务详情") private R> getTaskInfo(@Validated @RequestBody OrderInfoTaskDetParam orderInfoTaskDetParam) { return orderInfoHisService.getTaskInfo(orderInfoTaskDetParam); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java index 479b30d..a429dfe 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java @@ -2,10 +2,18 @@ package com.mt.wms.empty.controller; import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; -import com.mt.wms.empty.service.CurrTaskDetService; +import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskDetQueryParam; +import com.mt.wms.empty.service.TaskDetHisService; +import com.mt.wms.empty.vo.TaskHisDetVo; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -20,6 +28,11 @@ import org.springframework.web.bind.annotation.RestController; @Api(value = "任务详情历史", tags = "任务详情历史管理", hidden = false) public class TaskDetHisController extends BaseController { @Autowired - CurrTaskDetService currTaskDetService; + TaskDetHisService taskDetHisService; + @PostMapping(value = "getTaskDet") + @ApiOperation(value = "历史执行任务-查看详情") + public R> getTaskDetailsPage(@Validated @RequestBody CurrTaskDetQueryParam param) { + return taskDetHisService.getTaskDetailsPage(param); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java index 02a66a1..6f6f2e5 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java @@ -2,13 +2,24 @@ package com.mt.wms.empty.controller; import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; -import com.mt.wms.empty.service.CurrTaskService; +import com.mt.wms.core.utils.LocalDateTimeUtils; +import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.TaskHisQueryParam; +import com.mt.wms.empty.service.TaskHisService; +import com.mt.wms.empty.vo.TaskHisQueryVo; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Objects; + /** * @author xcc * @date 2021年11月16日 @@ -20,5 +31,19 @@ import org.springframework.web.bind.annotation.RestController; @Api(value = "任务历史管理", tags = "任务历史管理", hidden = false) public class TaskHisController extends BaseController { @Autowired - private CurrTaskService currTaskService; + private TaskHisService taskHisService; + + @PostMapping(value = "taskHis") + @ApiOperation(value = "获取历史执行的任务 (车辆名称传id)") + public R> currentTask(@Validated @RequestBody TaskHisQueryParam param) { + if (Objects.nonNull(param.getStartTime())) + { + param.setStartTime(LocalDateTimeUtils.getDayStart(param.getStartTime())); + } + if (Objects.nonNull(param.getEndTime())) + { + param.setEndTime(LocalDateTimeUtils.getDayEnd(param.getEndTime())); + } + return taskHisService.taskHisPage(param); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCreateProcessSheet.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCreateProcessSheet.java index 0422593..77e467c 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCreateProcessSheet.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCreateProcessSheet.java @@ -41,18 +41,3 @@ public class ApmsCreateProcessSheet extends BaseParam { private String workShopCode; } -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "Apms生产单详细", description = "Apms生产单详细") -class CreateItem extends BaseParam { - private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "标识卡号", required = true) - private String itemCode; - - @ApiModelProperty(value = "加工数量", required = true) - private String quantity; - - @ApiModelProperty(value = "加工重量", required = true) - private String weight; -} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsFinishProcessSheet.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsFinishProcessSheet.java index a43e462..a549569 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsFinishProcessSheet.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsFinishProcessSheet.java @@ -13,7 +13,7 @@ import java.util.List; @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) -@ApiModel(value = "Apms创建生产单", description = "Apms创建生产单") +@ApiModel(value = "Apms结束生产单", description = "Apms结束生产单") public class ApmsFinishProcessSheet extends BaseParam { private static final long serialVersionUID = 1L; @@ -34,18 +34,3 @@ public class ApmsFinishProcessSheet extends BaseParam { private String remark; } -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "Apms生产单详细", description = "Apms生产单详细") -class FinishItem extends BaseParam { - private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "标识卡号", required = true) - private String itemCode; - - @ApiModelProperty(value = "完成加工数量", required = true) - private String finishQuantity; - - @ApiModelProperty(value = "完成加工重量", required = true) - private String finishWeight; -} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CreateItem.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CreateItem.java new file mode 100644 index 0000000..4c789d4 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CreateItem.java @@ -0,0 +1,24 @@ +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 CreateItem extends BaseParam { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "标识卡号", required = true) + private String itemCode; + + @ApiModelProperty(value = "加工数量", required = true) + private Integer quantity; + + @ApiModelProperty(value = "加工重量", required = true) + private Double weight; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java index 7c7801c..5d1250e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java @@ -15,12 +15,11 @@ import lombok.experimental.Accessors; @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) -@ApiModel(value = "获取任务信息", description = "获取任务信息") +@ApiModel(value = "获取任务详细信息", description = "获取任务详细信息") public class CurrTaskDetQueryParam extends BasePageParam { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主任务id",required = true) private Long currTaskId; - } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java index b9d1445..a614906 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java @@ -20,8 +20,6 @@ public class CurrTaskQueryParam extends BasePageParam { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "标识卡号",required = false) - private String idenCardNum; @ApiModelProperty(value = "车辆id") private String vehicleId; diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/FinishItem.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/FinishItem.java new file mode 100644 index 0000000..1b6821f --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/FinishItem.java @@ -0,0 +1,24 @@ +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 FinishItem extends BaseParam { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "标识卡号", required = true) + private String itemCode; + + @ApiModelProperty(value = "完成加工数量", required = true) + private Integer finishQuantity; + + @ApiModelProperty(value = "完成加工重量", required = true) + private Double finishWeight; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderInfoBasePageParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderInfoBasePageParam.java index 40e22bc..329aacb 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderInfoBasePageParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderInfoBasePageParam.java @@ -1,6 +1,5 @@ package com.mt.wms.empty.params; -import com.mt.wms.core.base.BaseParam; import com.mt.wms.core.params.BasePageParam; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -24,13 +23,13 @@ public class OrderInfoBasePageParam extends BasePageParam { /** * 订单号,APMS系统获取 */ - @ApiModelProperty(value = "订单号", required = false) + @ApiModelProperty(value = "订单号", required = true) private String orderNo; /** * 标识卡号,APMS系统获取 */ - @ApiModelProperty(value = "标识卡号", required = false) + @ApiModelProperty(value = "标识卡号", required = true) private String idenCardNum; 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 513cde0..fe7a8de 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 @@ -15,7 +15,7 @@ import lombok.experimental.Accessors; @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) -@ApiModel(value = "apms订单对象", description = "用于推送新的订单信息") +@ApiModel(value = "apms订单对象", description = "用于APMS推送新的订单信息") public class OrderParamForApms extends BaseParam { private static final long serialVersionUID = 1L; @@ -68,10 +68,10 @@ public class OrderParamForApms extends BaseParam { @ApiModelProperty(value = "工艺要求") private String craftIll; - @ApiModelProperty(value = "加工数量") + @ApiModelProperty(value = "加工数量", required = true) private Float quantity; - @ApiModelProperty(value = "加工重量") + @ApiModelProperty(value = "加工重量", required = true) private Float weight; @ApiModelProperty(value = "单位") diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java index b529af1..90d1fe9 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java @@ -22,16 +22,18 @@ public class TaskCreateParam extends BaseParam { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "托盘号") - private String palletCode; - @ApiModelProperty(value = "起点", required = true) - private String startPosition; +// @ApiModelProperty(value = "托盘号") +// private String palletCode; +@ApiModelProperty(value = "起点(提升平台)", required = true) +private String startPosition; @ApiModelProperty(value = "终点位置", required = true) private String targetPosition; - @ApiModelProperty(value = "加工任务类型", required = true) + @ApiModelProperty(value = "加工类型:0 初始加工,1 复加工", required = true) private Integer processType; - @ApiModelProperty(value = "窑炉Id", required = true) + @ApiModelProperty(value = "窑炉Id", example = "1", required = true) private Long kilnId; + @ApiModelProperty(value = "工艺号", required = true) + private String craftCode; @ApiModelProperty(value = "详细信息", required = true) private List detParams; diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java new file mode 100644 index 0000000..bb428f9 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java @@ -0,0 +1,31 @@ +package com.mt.wms.empty.params; + +import com.mt.wms.core.params.BasePageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @author xcc + * @date 2021年11月9日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "获取任务信息", description = "获取任务信息") +public class TaskHisQueryParam extends BasePageParam { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "车辆id") + private String vehicleId; + @ApiModelProperty(value = "开始时间", example = "2021-11-20T12:05:20") + private LocalDateTime startTime; + @ApiModelProperty(value = "结束时间", example = "2021-11-25T12:05:20") + private LocalDateTime endTime; +} 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 c691eb6..cdf876d 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 @@ -10,6 +10,7 @@ import com.mt.wms.empty.params.TaskCreateDetParam; import com.mt.wms.empty.vo.CurrTaskDetVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; +import java.util.HashMap; import java.util.List; /** @@ -58,4 +59,20 @@ public interface CurrTaskDetService { * @return 结果 */ List getTaskDetailsByIdenCardNum(String idenCardNum); + + /** + * 通过生产单删除某个生产单 + * + * @param currTaskId 生产单号 + * @return 结果 + */ + R deleteByCurrTaskId(Long currTaskId); + + /** + * 通过标识卡号查询订单统计数 + * + * @param idCard 任务详情历史 + * @return 结果 + */ + HashMap getSumByIdCard(String idCard); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java index bbb5387..a334cad 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java @@ -1,11 +1,14 @@ package com.mt.wms.empty.service; +import com.mt.wms.core.dal.entity.CurrTask; +import com.mt.wms.core.params.BasePageParam; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.IdVo; import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; import com.mt.wms.empty.params.CurrTaskQueryParam; import com.mt.wms.empty.params.TaskCreateParam; +import com.mt.wms.empty.vo.CurrTaskMainQueryVo; import com.mt.wms.empty.vo.CurrTaskQueryVo; import com.mt.wms.empty.vo.CurrTaskVo; @@ -20,11 +23,26 @@ public interface CurrTaskService { /** * 内部使用,获取详情任务的关联任务 + * * @param idParam 任务id * @return 任务实体 */ CurrTaskVo getCurrTask(IdParam idParam); + /** + * 内部使用,更新任务单号 + * + * @param id 任务id + */ + void updateCurrTaskById(CurrTask id); + + /** + * 内部使用,获取任务实体 + * + * @param id 任务id + * @return 任务实体 + */ + CurrTask getCurrTaskById(Long id); /** * 创建加工任务的主任务信息 @@ -43,10 +61,25 @@ public interface CurrTaskService { R> currentTaskPage(CurrTaskQueryParam param); /** - * 完成执行任务 + * 完成执行任务 不会物理删除,会将删除值置为0,同时在历史表复制一份记录 方便在订单未完成时查询任务详情 * * @param param id * @return 结果 */ - R completeTask(IdParam param); + R completeTask(IdParam param); + + /** + * 通过生产单编号删除生产单 + * + * @param sheetNo 生产单号 + * @return 结果 + */ + R deleteBySheetNo(String sheetNo); + + /** + * 首页 获取当前执行的任务 + * + * @return 结果 + */ + R> currentTaskMainPage(BasePageParam param); } 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 409129b..209e246 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 @@ -7,6 +7,8 @@ import com.mt.wms.empty.params.*; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; import com.mt.wms.empty.vo.OrderInfoVo; +import java.util.List; + /** * 订单相关服务 * @@ -21,7 +23,7 @@ public interface OrderInfoService { * @param apmsPostOrderParam 订单参数 * @return 操作结果 */ - R apmsPostOrder(OrderParamForApms apmsPostOrderParam); + R apmsPostOrder(OrderParamForApms apmsPostOrderParam); /** * 查询当前订单列表 @@ -30,13 +32,15 @@ public interface OrderInfoService { * @return 分页结果集 */ R> page(OrderInfoBasePageParam orderInfoBasePageParam); + /** * 人工创建订单 * * @param orderInfoPersonCreateParam 人工订单参数 * @return 结果 */ - R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam); + R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam); + /** * 获取详细单条信息 * @@ -59,13 +63,20 @@ public interface OrderInfoService { */ R getTaskInfoByIdenCardNum(String idenCardNum); + /** + * 验证传入的详细订单标识卡正确 + * + * @param detParams 详细订单 + */ + void verifyTaskInfoByIdenCardNum(List detParams); + /** * 完成订单 * * @param idParam id号 * @return 结果 */ - R completeOrder(IdParam idParam); + R completeOrder(IdParam idParam); /** * 作废订单 @@ -73,7 +84,7 @@ public interface OrderInfoService { * @param idParam id号 * @return 结果 */ - R voidOrder(IdParam idParam); + R voidOrder(IdParam idParam); /** * APMS作废订单 @@ -81,7 +92,7 @@ public interface OrderInfoService { * @param idenCardNum 标识卡号 * @return 结果 */ - R apmsVoidOrder(String idenCardNum); + R apmsVoidOrder(String idenCardNum); /** * APMS返回订单结果 @@ -89,6 +100,6 @@ public interface OrderInfoService { * @param apmsCompleteOrder 订单检验结果 * @return 结果 */ - R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder); + R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java index 40324fc..865f953 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java @@ -3,9 +3,12 @@ package com.mt.wms.empty.service; import com.mt.wms.core.dal.entity.TaskDetHis; import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskDetQueryParam; import com.mt.wms.empty.params.OrderInfoTaskDetParam; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; +import com.mt.wms.empty.vo.TaskHisDetVo; +import java.util.HashMap; import java.util.List; /** @@ -22,7 +25,7 @@ public interface TaskDetHisService { * @param taskDetHis 任务详情历史 * @return 结果 */ - R save(TaskDetHis taskDetHis); + R save(TaskDetHis taskDetHis); /** * 保存任务详情历史list @@ -30,7 +33,7 @@ public interface TaskDetHisService { * @param taskDetHis 任务详情历史 * @return 结果 */ - R saveList(List taskDetHis); + R saveList(List taskDetHis); /** * 保存任务详情历史list @@ -39,4 +42,20 @@ public interface TaskDetHisService { * @return 结果 */ PageVo getHisOrderHisTask(OrderInfoTaskDetParam param); + + /** + * 通过标识卡号查询订单统计数 + * + * @param idCard 任务详情历史 + * @return 结果 + */ + HashMap getSumByIdCard(String idCard); + + /** + * 查询历史加工的详细任务信息 + * + * @param currTaskId 详细任务信息 + * @return 结果 + */ + R> getTaskDetailsPage(CurrTaskDetQueryParam currTaskId); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskHisService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskHisService.java index 98e3cdd..6972169 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskHisService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskHisService.java @@ -3,8 +3,11 @@ package com.mt.wms.empty.service; import com.mt.wms.core.dal.entity.TaskHis; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.IdVo; +import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.TaskHisQueryParam; import com.mt.wms.empty.vo.CurrTaskVo; +import com.mt.wms.empty.vo.TaskHisQueryVo; /** * 主任务历史相关服务 @@ -30,4 +33,13 @@ public interface TaskHisService { * @return 结果 */ CurrTaskVo getById(IdParam id); + + /** + * 查询分页信息 + * + * @param param 查询参数 + * @return 结果 + */ + R> taskHisPage(TaskHisQueryParam param); + } 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 9bbd583..0545a15 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 @@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.CurrTaskDetServiceBiz; +import com.mt.wms.core.dal.service.OrderInfoServiceBiz; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.utils.BeanUtils; import com.mt.wms.core.vo.PageVo; @@ -13,12 +15,15 @@ import com.mt.wms.empty.params.CurrTaskDetQueryParam; import com.mt.wms.empty.params.OrderInfoTaskDetParam; import com.mt.wms.empty.params.TaskCreateDetParam; import com.mt.wms.empty.service.CurrTaskDetService; +import com.mt.wms.empty.service.CurrTaskService; import com.mt.wms.empty.vo.CurrTaskDetVo; +import com.mt.wms.empty.vo.CurrTaskVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.HashMap; import java.util.List; /** @@ -34,15 +39,19 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe @Autowired CurrTaskDetServiceBiz currTaskDetServiceBiz; + @Autowired + CurrTaskService currTaskService; + @Autowired + OrderInfoServiceBiz orderInfoService; @Override public PageVo getCurrOrderCurrTask(OrderInfoTaskDetParam param) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM,param.getIdenCardNum()) - .eq(CurrTaskDet.ORDER_NO,param.getOrderNo()) - .eq(CurrTaskDet.VALID,1); + queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, param.getIdenCardNum()) + .eq(CurrTaskDet.ORDER_NO, param.getOrderNo()) + .eq(CurrTaskDet.VALID, 1); Page page = currTaskDetServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); - return new PageVo<>(page, OrderInfoTaskDetVo.class); + return new PageVo<>(page, OrderInfoTaskDetVo.class); } @Override @@ -61,7 +70,15 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe queryWrapper.eq(CurrTaskDet.CURR_TASK_ID, currTaskId.getCurrTaskId()) .eq(CurrTaskDet.VALID, 1); Page page = currTaskDetServiceBiz.page(new Page<>(currTaskId.getCurrent(), currTaskId.getSize()), queryWrapper); - return successful(new PageVo<>(page, CurrTaskDetVo.class)); + PageVo currTaskDetVo = new PageVo<>(page, CurrTaskDetVo.class); + currTaskDetVo.getRecords().forEach( + e -> { + OrderInfo one = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, e.getIdenCardNum())); + e.setProductModel(one.getProductModel()); + e.setCustomer(one.getCustomerName()); + } + ); + return successful(currTaskDetVo); } @Override @@ -79,4 +96,33 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe .eq(CurrTaskDet.VALID, 1); return currTaskDetServiceBiz.list(queryWrapper); } + + @Override + public R deleteByCurrTaskId(Long currTaskId) { + currTaskDetServiceBiz.remove(new QueryWrapper().eq(CurrTaskDet.CURR_TASK_ID, currTaskId)); + return successful("成功。"); + } + + @Override + public HashMap getSumByIdCard(String idCard) { + HashMap result = new HashMap<>(2); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, idCard) + .eq(CurrTaskDet.VALID, 1); + List list = currTaskDetServiceBiz.list(queryWrapper); + list.forEach(e -> { + CurrTaskVo byId = currTaskService.getCurrTask(IdParam.builder().id(e.getCurrTaskId()).build()); + //如果加工类型是复加工,或者任务作废。移除对象 + if (byId.getProcessType().equals(2) || byId.getValid() != 1) + { + list.remove(e); + } + }); + //计算加工总数 + double sumWeight = list.stream().mapToDouble(CurrTaskDet::getWeight).sum(); + double sumQuantity = list.stream().mapToDouble(CurrTaskDet::getQuantity).sum(); + result.put("weight", sumWeight); + result.put("quantity", sumQuantity); + return result; + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index 794b613..fd97c52 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -2,16 +2,18 @@ package com.mt.wms.empty.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.mt.wms.core.api.Assert; import com.mt.wms.core.base.BaseService; -import com.mt.wms.core.dal.entity.CurrTask; -import com.mt.wms.core.dal.entity.CurrTaskDet; -import com.mt.wms.core.dal.entity.TaskDetHis; -import com.mt.wms.core.dal.entity.TaskHis; +import com.mt.wms.core.dal.entity.*; +import com.mt.wms.core.dal.service.CraftInfoServiceBiz; import com.mt.wms.core.dal.service.CurrTaskServiceBiz; +import com.mt.wms.core.dal.service.OrderInfoServiceBiz; +import com.mt.wms.core.params.BasePageParam; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.IdVo; 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.TaskTypeEnum; import com.mt.wms.empty.params.CurrTaskQueryParam; import com.mt.wms.empty.params.TaskCreateParam; @@ -19,6 +21,8 @@ import com.mt.wms.empty.service.CurrTaskDetService; import com.mt.wms.empty.service.CurrTaskService; import com.mt.wms.empty.service.TaskDetHisService; import com.mt.wms.empty.service.TaskHisService; +import com.mt.wms.empty.vo.ApmsEndProcessVo; +import com.mt.wms.empty.vo.CurrTaskMainQueryVo; import com.mt.wms.empty.vo.CurrTaskQueryVo; import com.mt.wms.empty.vo.CurrTaskVo; import org.apache.commons.lang.StringUtils; @@ -27,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.List; /** @@ -52,6 +57,14 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService @Autowired TaskDetHisService taskDetHisService; + @Autowired + ApmsController apmsControl; + + @Autowired + OrderInfoServiceBiz orderInfoServiceBiz; + @Autowired + CraftInfoServiceBiz craftInfoServiceBiz; + @Override public CurrTaskVo getCurrTask(IdParam idParam) { CurrTask byId = currTaskServiceBiz.getById(idParam.getId()); @@ -60,12 +73,27 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService return build; } + @Override + public CurrTask getCurrTaskById(Long id) { + return currTaskServiceBiz.getById(id); + } + + @Override + public void updateCurrTaskById(CurrTask id) { + currTaskServiceBiz.updateById(id); + } + @Override public R createProcessTask(TaskCreateParam param) { + Assert.notNull("错误,加工类型不可为空!", param.getProcessType()); CurrTask currTask = new CurrTask(); BeanUtils.copyProperties(param, currTask); currTask.setTaskType(TaskTypeEnum.WTK.getValue()); currTask.setTaskSource(0); + //根据工艺号查询工艺id以及工艺plc值 + CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper().eq(CraftInfo.CREATOR_ID, param.getCraftCode())); + currTask.setFCraftCodeId(one.getId()); + currTask.setFPlcValue(one.getPlcValue()); setCommonField(currTask); currTaskServiceBiz.save(currTask); return successful(IdVo.builder().id(currTask.getId()).build()); @@ -81,7 +109,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService } @Override - public R completeTask(IdParam param) { + public R completeTask(IdParam param) { CurrTask byId = currTaskServiceBiz.getById(param.getId()); TaskHis taskHis = new TaskHis(); BeanUtils.copyProperties(byId, taskHis); @@ -89,7 +117,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService taskHis.setId(null); //将主任务放入到历史表,清空id,防止重复 R save = taskHisService.save(taskHis); - currTaskServiceBiz.removeById(byId.getId()); + byId.setValid(0); + byId.setStatus(2); + currTaskServiceBiz.updateById(byId); List taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(byId.getId()).build()); List taskDetHis = com.mt.wms.core.utils.BeanUtils.copyList(taskDetailsByMainId, TaskDetHis.class); taskDetHis.forEach(detHis -> { @@ -99,4 +129,60 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService taskDetHisService.saveList(taskDetHis); return successful("执行成功。"); } + + @Override + public R deleteBySheetNo(String sheetNo) { + CurrTask byId = currTaskServiceBiz.getById(new QueryWrapper().eq(CurrTask.SHEET_NO, sheetNo)); + //如果尚未执行(状态 0) + if (byId.getStatus() == 0) + { + + R apmsStartProcessR = apmsControl.deleteBySheetNo(sheetNo); + if (apmsStartProcessR.getData().getSuccess()) + { + currTaskServiceBiz.removeById(byId.getId()); + currTaskDetService.deleteByCurrTaskId(byId.getId()); + return successful("APMS生产单删除成功。"); + } + else + { + return failed(apmsStartProcessR.getData().getMsg()); + } + } + return failed("无法删除,任务正在执行中。"); + + } + + @Override + public R> currentTaskMainPage(BasePageParam param) { + QueryWrapper currTaskQueryWrapper = new QueryWrapper<>(); + currTaskQueryWrapper.eq(CurrTask.STATUS, 1); + currTaskQueryWrapper.eq(CurrTask.VALID, 1); + Page page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper); + PageVo pageVo = new PageVo<>(page, CurrTaskMainQueryVo.class); + Assert.notNull("无执行中的任务!", pageVo.getRecords()); + pageVo.getRecords().forEach(e -> + { + //根据当前主任务查详细任务 + List taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(e.getId()).build()); + ArrayList materialDes = new ArrayList<>(); + ArrayList iden = new ArrayList<>(); + //写入材料名与标识卡号 + taskDetailsByMainId.forEach(a -> { + materialDes.add(a.getMaterialDes()); + iden.add(a.getIdenCardNum()); + }); + e.setMaterials(materialDes); + e.setIdens(iden); + ArrayList customers = new ArrayList<>(); + //根据标识卡号查订单的客户名并写入 + e.getIdens().forEach(id -> { + OrderInfo one = orderInfoServiceBiz.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, id)); + customers.add(one.getCustomerName()); + } + ); + e.setCustomers(customers); + }); + return successful(pageVo); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoHisServiceImpl.java index 478fc94..bbe1207 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoHisServiceImpl.java @@ -94,7 +94,7 @@ public class OrderInfoHisServiceImpl extends BaseService implements OrderInfoHis public R> getTaskInfo(OrderInfoTaskDetParam param) { //从历史任务详细中获取该标识卡和订单的所有订单 PageVo currOrderCurrTask = taskDetHisService.getHisOrderHisTask(param); - Assert.gtZero(currOrderCurrTask.getRecords().size(), "该订单暂无详细记录。"); + Assert.notNull("该订单下无历史任务!", currOrderCurrTask.getRecords()); //获取车辆信息 R> vehicle = vehicleService.list(new VehicleQueryParam()); Map> collect = vehicle.getData().stream().collect(Collectors.groupingBy(VehicleVo::getId)); 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 632a5f6..245b0dd 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,20 +11,20 @@ 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.ApmsCheckResult; import com.mt.wms.core.dal.entity.CurrTaskDet; import com.mt.wms.core.dal.entity.OrderInfo; +import com.mt.wms.core.dal.service.ApmsCheckResultServiceBiz; import com.mt.wms.core.dal.service.CommunicationLogServiceBiz; import com.mt.wms.core.dal.service.OrderInfoServiceBiz; +import com.mt.wms.core.enums.WhetherEnum; 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.*; -import com.mt.wms.empty.service.CurrTaskDetService; -import com.mt.wms.empty.service.CurrTaskService; -import com.mt.wms.empty.service.OrderInfoHisService; -import com.mt.wms.empty.service.OrderInfoService; +import com.mt.wms.empty.service.*; import com.mt.wms.empty.vo.CurrTaskVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; import com.mt.wms.empty.vo.OrderInfoVo; @@ -34,8 +34,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDateTime; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -57,6 +60,8 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Autowired CurrTaskDetService currTaskDetService; @Autowired + TaskDetHisService taskDetHisService; + @Autowired CurrTaskService currTaskService; @Autowired KilnInfoService kilnInfoService; @@ -69,11 +74,14 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Autowired CommunicationLogServiceBiz communicationLogServiceBiz; + + @Autowired + ApmsCheckResultServiceBiz apmsCheckResultServiceBiz; @Autowired ApmsController apmsControl; @Override - public R apmsPostOrder(OrderParamForApms apmsPostOrderParam) { + public R apmsPostOrder(OrderParamForApms apmsPostOrderParam) { OrderInfo orderInfo = new OrderInfo(); BeanUtils.copyProperties(apmsPostOrderParam, orderInfo); setCommonField(orderInfo); @@ -86,23 +94,34 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Override public R> page(OrderInfoBasePageParam param) { - QueryWrapper 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) + QueryWrapper 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 page = orderInfoService.page(new Page<>(param.getCurrent(), param.getSize()), wrapper); - return successful(new PageVo<>(page,OrderInfoVo.class)); + PageVo orderInfoVoPageVo = new PageVo<>(page, OrderInfoVo.class); + orderInfoVoPageVo.getRecords().forEach(e -> + { + R info = getTaskInfoByIdenCardNum(e.getIdenCardNum()); + e.setFinishWeight(info.getData().getFinishWeight()); + e.setFinishQuantity(info.getData().getQuantity()); + e.setWaitWeight(info.getData().getWaitWeight()); + e.setWaitQuantity(info.getData().getWaitQuantity()); + e.setReProcessQuantity(info.getData().getReProcessQuantity()); + e.setReProcessWeight(info.getData().getReProcessWeight()); + }); + return successful(orderInfoVoPageVo); } @Override - public R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam) { + public R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam) { OrderInfo orderInfo = new OrderInfo(); - BeanUtils.copyProperties(orderInfoPersonCreateParam,orderInfo); + BeanUtils.copyProperties(orderInfoPersonCreateParam, orderInfo); setCommonField(orderInfo); //设定来源信息为人工 orderInfo.setOrderSource(OrderSourceEnum.PERSON.getValue()); - orderInfo.setInterCode("PERSONAL"+System.currentTimeMillis()); + orderInfo.setInterCode("PERSONAL" + System.currentTimeMillis()); orderInfoService.save(orderInfo); return successful("人工创建订单成功。"); } @@ -111,7 +130,14 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic public R getOne(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); OrderInfoVo build = OrderInfoVo.builder().build(); - BeanUtils.copyProperties(byId,build); + BeanUtils.copyProperties(byId, build); + R info = getTaskInfoByIdenCardNum(build.getIdenCardNum()); + build.setFinishWeight(info.getData().getFinishWeight()); + build.setFinishQuantity(info.getData().getQuantity()); + build.setWaitWeight(info.getData().getWaitWeight()); + build.setWaitQuantity(info.getData().getWaitQuantity()); + build.setReProcessQuantity(info.getData().getReProcessQuantity()); + build.setReProcessWeight(info.getData().getReProcessWeight()); return successful(build); } @@ -159,33 +185,74 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Override public R getTaskInfoByIdenCardNum(String idenCardNum) { QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(OrderInfo.IDEN_CARD_NUM, idenCardNum).eq(OrderInfo.VALID, 1).eq(OrderInfo.STATUS, 0); + wrapper.eq(OrderInfo.IDEN_CARD_NUM, idenCardNum).eq(OrderInfo.VALID, 1); OrderInfo one = orderInfoService.getOne(wrapper); + Assert.notNull("未找到该标识卡信息!", one); OrderInfoVo build = OrderInfoVo.builder().build(); BeanUtils.copyProperties(one, build); + //查询历史任务表,当前任务表,拉取加工完成 创建任务未加工 计算剩余数量 + HashMap sumCurrTask = currTaskDetService.getSumByIdCard(idenCardNum); + build.setWaitQuantity(sumCurrTask.get("quantity").floatValue()); + build.setWaitWeight(sumCurrTask.get("weight").floatValue()); + + HashMap sumTaskHis = taskDetHisService.getSumByIdCard(idenCardNum); + build.setFinishQuantity(sumTaskHis.get("quantity").floatValue()); + build.setFinishWeight(sumTaskHis.get("weight").floatValue()); + + // 考虑返工单的加工情况,添加到返工统计信息中。 + if (Objects.nonNull(one.getOldOrderNo())) + { + List list = orderInfoService.list(new QueryWrapper().eq(OrderInfo.VALID, 1).eq(OrderInfo.ORDER_NO, one.getOldOrderNo())); + float reQuantity = 0; + float reWeight = 0; + for (OrderInfo orderInfo : list) + { + HashMap reCurrTask = currTaskDetService.getSumByIdCard(orderInfo.getIdenCardNum()); + reQuantity += reCurrTask.get("quantity").floatValue(); + reWeight += reCurrTask.get("weight").floatValue(); + + HashMap reTaskHis = taskDetHisService.getSumByIdCard(orderInfo.getIdenCardNum()); + reQuantity += reTaskHis.get("quantity").floatValue(); + reWeight += reTaskHis.get("weight").floatValue(); + } + build.setReProcessQuantity(reQuantity); + build.setReProcessWeight(reWeight); + } + return successful(build); } @Override - public R completeOrder(IdParam idParam) { + public void verifyTaskInfoByIdenCardNum(List detParams) { + for (TaskCreateDetParam detParam : detParams) + { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(OrderInfo.IDEN_CARD_NUM, detParam.getIdenCardNum()).eq(OrderInfo.VALID, 1); + OrderInfo one = orderInfoService.getOne(wrapper); + Assert.notNull("错误,标识卡号" + detParam.getIdenCardNum() + "在订单中不存在!", one); + } + } + + @Override + public R completeOrder(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); orderInfoHisService.save(byId); byId.setValid(0); byId.setStatus(2); orderInfoService.updateById(byId); - return successful("操作成功。"); + return successful("订单状态成功置为完成。"); } @Override - public R voidOrder(IdParam idParam) { + public R voidOrder(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); byId.setValid(0); orderInfoService.updateById(byId); - return successful("操作成功。"); + return successful("订单状态成功置为作废。"); } @Override - public R apmsVoidOrder(String idenCardNum) { + public R apmsVoidOrder(String idenCardNum) { OrderInfo byId = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, idenCardNum)); //确定是否有订单在生产 List taskDetailsByIdenCardNum = currTaskDetService.getTaskDetailsByIdenCardNum(idenCardNum); @@ -200,7 +267,19 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic } @Override - public R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder) { - return null; + public R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder) { + //通过标识卡号与生产单号进行更新检验结果 + ApmsCheckResult one = new ApmsCheckResult(); + one.setIdenCardNum(apmsCompleteOrder.getIdenCardNum()); + one.setSheetNo(apmsCompleteOrder.getSheetNo()); + one.setCreateTime(LocalDateTime.now()); + one.setValid(WhetherEnum.YES.getValue()); + one.setMetallography(apmsCompleteOrder.getMetallographic()); + one.setHeartHardness(apmsCompleteOrder.getHeartHardness()); + one.setHardness(apmsCompleteOrder.getHardness()); + one.setUpdateTime(LocalDateTime.now()); + apmsCheckResultServiceBiz.save(one); + //订单不应该在该地方完成,额外提供一个完成接口供人工完成,不通知apms + return successful("任务执行完成。"); } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java index 173410c..52fef9e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java @@ -3,18 +3,25 @@ package com.mt.wms.empty.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.entity.TaskDetHis; +import com.mt.wms.core.dal.service.OrderInfoServiceBiz; import com.mt.wms.core.dal.service.TaskDetHisServiceBiz; +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.CurrTaskDetQueryParam; import com.mt.wms.empty.params.OrderInfoTaskDetParam; import com.mt.wms.empty.service.TaskDetHisService; +import com.mt.wms.empty.service.TaskHisService; +import com.mt.wms.empty.vo.CurrTaskVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; +import com.mt.wms.empty.vo.TaskHisDetVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.HashMap; import java.util.List; /** @@ -30,27 +37,70 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ @Autowired TaskDetHisServiceBiz taskDetHisServiceBiz; - + @Autowired + TaskHisService taskhisService; + @Autowired + OrderInfoServiceBiz orderInfoService; @Override - public R save(TaskDetHis taskDetHis) { + public R save(TaskDetHis taskDetHis) { taskDetHisServiceBiz.save(taskDetHis); return successful("操作成功"); } @Override - public R saveList(List taskDetHis) { + public R saveList(List taskDetHis) { taskDetHisServiceBiz.saveBatch(taskDetHis); - return null; + return successful("操作成功"); } @Override public PageVo getHisOrderHisTask(OrderInfoTaskDetParam param) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, param.getIdenCardNum()) - .eq(CurrTaskDet.ORDER_NO, param.getOrderNo()) - .eq(CurrTaskDet.VALID, 1); + queryWrapper.eq(TaskDetHis.IDEN_CARD_NUM, param.getIdenCardNum()) + .eq(TaskDetHis.ORDER_NO, param.getOrderNo()) + .eq(TaskDetHis.VALID, 1); Page page = taskDetHisServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); return new PageVo<>(page, OrderInfoTaskDetVo.class); } + + @Override + public HashMap getSumByIdCard(String idCard) { + HashMap result = new HashMap<>(2); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(TaskDetHis.IDEN_CARD_NUM, idCard) + .eq(TaskDetHis.VALID, 1); + List list = taskDetHisServiceBiz.list(queryWrapper); + list.forEach(e -> { + CurrTaskVo byId = taskhisService.getById(IdParam.builder().id(e.getTaskId()).build()); + //如果加工类型是复加工,或者任务作废。移除对象 + if (byId.getProcessType().equals(2) || byId.getValid() != 1) + { + list.remove(e); + } + }); + //计算加工总数 + double sumWeight = list.stream().mapToDouble(TaskDetHis::getWeight).sum(); + double sumQuantity = list.stream().mapToDouble(TaskDetHis::getQuantity).sum(); + result.put("weight", sumWeight); + result.put("quantity", sumQuantity); + return result; + } + + @Override + public R> getTaskDetailsPage(CurrTaskDetQueryParam currTaskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(TaskDetHis.TASK_ID, currTaskId.getCurrTaskId()) + .eq(TaskDetHis.VALID, 1); + Page page = taskDetHisServiceBiz.page(new Page<>(currTaskId.getCurrent(), currTaskId.getSize()), queryWrapper); + PageVo taskHisDetVoPageVo = new PageVo<>(page, TaskHisDetVo.class); + taskHisDetVoPageVo.getRecords().forEach( + e -> { + OrderInfo one = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, e.getIdenCardNum())); + e.setProductModel(one.getProductModel()); + e.setCustomer(one.getCustomerName()); + } + ); + return successful(taskHisDetVoPageVo); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskHisServiceImpl.java index 7054466..86643bd 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskHisServiceImpl.java @@ -1,18 +1,26 @@ package com.mt.wms.empty.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mt.wms.core.base.BaseService; import com.mt.wms.core.dal.entity.TaskHis; import com.mt.wms.core.dal.service.TaskHisServiceBiz; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.IdVo; +import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.TaskHisQueryParam; import com.mt.wms.empty.service.TaskHisService; import com.mt.wms.empty.vo.CurrTaskVo; +import com.mt.wms.empty.vo.TaskHisQueryVo; +import jodd.util.StringUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Objects; + /** * 服务实现类 * @@ -41,4 +49,14 @@ public class TaskHisServiceImpl extends BaseService implements TaskHisService { BeanUtils.copyProperties(byId, build); return build; } + + @Override + public R> taskHisPage(TaskHisQueryParam param) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(StringUtil.isNotBlank(param.getVehicleId()), TaskHis.VEHICLE_ID, param.getVehicleId()) + .between(Objects.nonNull(param.getStartTime()) && Objects.nonNull(param.getEndTime()), TaskHis.CREATE_TIME, param.getStartTime(), param.getEndTime()) + .eq(TaskHis.VALID, 1).orderByDesc(TaskHis.CREATE_TIME); + Page page = taskHisService.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); + return successful(new PageVo<>(page, TaskHisQueryVo.class)); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsCreateProcessSheetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsCreateProcessSheetVo.java new file mode 100644 index 0000000..fd83f13 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsCreateProcessSheetVo.java @@ -0,0 +1,40 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import io.swagger.annotations.ApiModel; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "APMS返回创建生产单信息", description = "APMS返回创建生产单信息") +public class ApmsCreateProcessSheetVo extends BaseVo { + /** + * 返回消息,返回false时为失败原因 + */ + private String msg; + + /** + * 是否成功 + */ + private Boolean success; + + /** + * 生产单编号,创建成功后返回,需要记录此生产单编号,加工过程处理及结束加工处理需要传入此生产单编号 + */ + private String sheetNo; + + /** + * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误 + */ + private String statusCode; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsEndProcessVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsEndProcessVo.java new file mode 100644 index 0000000..4a32894 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsEndProcessVo.java @@ -0,0 +1,34 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import io.swagger.annotations.ApiModel; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "APMS返回生产单结束信息", description = "APMS返回生产单结束信息") +public class ApmsEndProcessVo extends BaseVo { + /** + * 返回消息,返回false时为失败原因 + */ + private String msg; + + /** + * 是否成功 + */ + private Boolean success; + /** + * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误 + */ + private String statusCode; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsFinishProcessSheetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsFinishProcessSheetVo.java new file mode 100644 index 0000000..9ff9d58 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsFinishProcessSheetVo.java @@ -0,0 +1,40 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import io.swagger.annotations.ApiModel; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "APMS返回完成生产单信息", description = "APMS返回完成生产单信息") +public class ApmsFinishProcessSheetVo extends BaseVo { + /** + * 返回消息,返回false时为失败原因 + */ + private String msg; + + /** + * 是否成功 + */ + private Boolean success; + + /** + * 生产单编号,创建成功后返回,需要记录此生产单编号,加工过程处理及结束加工处理需要传入此生产单编号 + */ + private String sheetNo; + + /** + * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误 + */ + private String statusCode; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStartProcessVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStartProcessVo.java new file mode 100644 index 0000000..e091db5 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStartProcessVo.java @@ -0,0 +1,34 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import io.swagger.annotations.ApiModel; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "APMS返回生产单开始信息", description = "APMS返回生产单开始信息") +public class ApmsStartProcessVo extends BaseVo { + /** + * 返回消息,返回false时为失败原因 + */ + private String msg; + + /** + * 是否成功 + */ + private Boolean success; + /** + * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误 + */ + private String statusCode; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStoveVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStoveVo.java new file mode 100644 index 0000000..e91f063 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStoveVo.java @@ -0,0 +1,43 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import io.swagger.annotations.ApiModel; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.ArrayList; +import java.util.Map; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "APMS返回窑炉信息", description = "APMS返回窑炉信息") +public class ApmsStoveVo extends BaseVo { + /** + * 返回消息,返回false时为失败原因 + */ + private String msg; + + /** + * 是否成功 + */ + private Boolean success; + + /** + * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误 + */ + private String statusCode; + + /** + * 车间炉号信息明细 + */ + private ArrayList> stoveCodes; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java index 2a10900..c0c7f09 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java @@ -41,7 +41,10 @@ public class CurrTaskDetVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty("任务编码") private String taskCode; - + @ApiModelProperty("客户名") + private String customer; + @ApiModelProperty("订单名") + private String orderNo; /** * 当前任务id,关联当前任务表:t_curr_task */ @@ -53,6 +56,39 @@ public class CurrTaskDetVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty("重量") private Float weight; + @ApiModelProperty("标识卡号") + private String idenCardNum; + + /** + * 产品名称 + */ + @ApiModelProperty("产品名称") + private String productName; + + /** + * 材料牌号 + */ + @ApiModelProperty("材料牌号") + private String materialDes; + + /** + * 产品型号 + */ + @ApiModelProperty("产品型号") + private String productModel; + + /** + * 工艺要求 + */ + @ApiModelProperty("工艺要求") + private String craftIll; + + /** + * 单位 + */ + @ApiModelProperty("单位") + private Float unit; + /** * 数量,手动输入 */ diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskMainQueryVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskMainQueryVo.java new file mode 100644 index 0000000..80043c1 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskMainQueryVo.java @@ -0,0 +1,80 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import com.mt.wms.core.vo.PageVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.ArrayList; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "首页当前任务信息", description = "首页当前任务信息") +public class CurrTaskMainQueryVo extends BaseVo implements PageVo.ConvertVo { + @ApiModelProperty(value = "id") + private Long id; + + /** + * 任务编码, 查看任务编码规则 + */ + @ApiModelProperty("任务编码") + private String taskCode; + /** + * 标识卡集 + */ + @ApiModelProperty("标识卡集") + private ArrayList idens; + /** + * 物料集 材料集? + */ + @ApiModelProperty("物料集") + private ArrayList materials; + /** + * 客户集 + */ + @ApiModelProperty("客户集") + private ArrayList customers; + + /** + * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) + */ + private Integer status; + + /** + * 任务类型:0:入库到窑炉,1:入库到缓存区,2出库到 窑炉到缓存区,3缓存区出库 + */ + @ApiModelProperty("任务类型") + private Integer taskType; + /** + * 开始位置 + */ + @ApiModelProperty("开始位置") + private String startPosition; + + /** + * 目标位置指的是窑炉的位置 + */ + @ApiModelProperty("窑炉位置") + private String targetPosition; + /** + * 库位 + */ + @ApiModelProperty("库位") + private String locationName; + /** + * 窑炉名称 + */ + @ApiModelProperty("窑炉名称") + private String kilnName; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java index c5dd173..94b3c15 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java @@ -51,12 +51,31 @@ public class CurrTaskQueryVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty("任务类型") private Integer taskType; + /** + * 开始加工时间 + */ + @ApiModelProperty("开始加工时间") + private LocalDateTime aBeginTime; + + /** + * 加工完成时间 + */ + @ApiModelProperty("加工完成时间") + private LocalDateTime aEndTime; + + @ApiModelProperty("窑炉工艺号") + private String craftCode; /** * 开始位置 */ @ApiModelProperty("开始位置") private String startPosition; + /** + * 生产单号 + */ + @ApiModelProperty("生产单号") + private String sheetNo; /** * 目标位置指的是窑炉的位置 */ diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java index a47c415..5b9419a 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java @@ -25,6 +25,14 @@ import java.time.LocalDateTime; public class CurrTaskVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty(value = "id") private Long id; + + /** + * 删除标志,是否有效:1 可用 0不可用,2停止 + */ + @ApiModelProperty("删除标志") + private Integer valid; + + /** * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) */ @@ -55,6 +63,12 @@ public class CurrTaskVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty("任务类型") private Integer taskType; + /** + * 加工类型:0 初始加工,1 复加工 ,2 追加加工 + */ + @ApiModelProperty("任务类型") + private Integer processType; + /** * 托盘编码 */ diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java index b6e110b..8bb80c0 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java @@ -1,8 +1,6 @@ package com.mt.wms.empty.vo; -import com.baomidou.mybatisplus.annotation.*; import com.mt.wms.core.base.BaseVo; -import com.mt.wms.core.base.ITree; import com.mt.wms.core.vo.PageVo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -11,9 +9,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -import java.util.List; /** * @@ -43,18 +39,6 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty(value = "添加时间") private LocalDateTime createTime; - /** - * 创建人id - */ - @ApiModelProperty(value = "创建人id") - private Integer creatorId; - - /** - * 更新人id - */ - @ApiModelProperty(value = "更新人id") - private Integer updaterId; - /** * 修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同 */ @@ -65,13 +49,6 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty(value = "状态") private Integer status; - - /** - * 内部编码,系统自动生成 - */ - @ApiModelProperty(value = "内部编码") - private String interCode; - /** * 编码 */ @@ -143,4 +120,41 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty(value = "数量") private Float quantity; + + /** + * 重量 + */ + @ApiModelProperty(value = "完成加工重量") + private Float finishWeight; + + /** + * 数量 + */ + @ApiModelProperty(value = "完成加工数量") + private Float finishQuantity; + + /** + * 待加工重量 任务创建等待中 + */ + @ApiModelProperty(value = "等待重量") + private Float waitWeight; + + /** + * 待加工数量 任务创建等待中 + */ + @ApiModelProperty(value = "等待数量") + private Float waitQuantity; + + /** + * 返工重量 返工单中计算的值 + */ + @ApiModelProperty(value = "返工重量") + private Float reProcessWeight; + + /** + * 返工数量 返工单中计算的值 + */ + @ApiModelProperty(value = "返工数量") + private Float reProcessQuantity; + } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisDetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisDetVo.java new file mode 100644 index 0000000..de5e609 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisDetVo.java @@ -0,0 +1,97 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import com.mt.wms.core.vo.PageVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "任务详细信息", description = "用于返回任务详细信息") +public class TaskHisDetVo extends BaseVo implements PageVo.ConvertVo { + @ApiModelProperty(value = "id") + private Long id; + /** + * 修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同 + */ + @ApiModelProperty("修改时间") + private LocalDateTime updateTime; + + /** + * 状态: 0等待执行 + */ + @ApiModelProperty("状态") + private Integer status; + /** + * 任务编码 + */ + @ApiModelProperty("任务编码") + private String taskCode; + @ApiModelProperty("客户名") + private String customer; + @ApiModelProperty("订单名") + private String orderNo; + /** + * 历史任务id,关联当前任务表:t_task_his + */ + @ApiModelProperty("历史任务id") + private Long taskId; + + @ApiModelProperty("标识卡号") + private String idenCardNum; + + /** + * 产品名称 + */ + @ApiModelProperty("产品名称") + private String productName; + + /** + * 材料牌号 + */ + @ApiModelProperty("材料牌号") + private String materialDes; + + /** + * 产品型号 + */ + @ApiModelProperty("产品型号") + private String productModel; + + /** + * 工艺要求 + */ + @ApiModelProperty("工艺要求") + private String craftIll; + + /** + * 单位 + */ + @ApiModelProperty("单位") + private Float unit; + + /** + * 重量,手动输入 + */ + @ApiModelProperty("重量") + private Float weight; + + /** + * 数量,手动输入 + */ + @ApiModelProperty("数量") + private Float quantity; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java new file mode 100644 index 0000000..ba67b75 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java @@ -0,0 +1,79 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import com.mt.wms.core.vo.PageVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "历史任务信息", description = "历史任务信息") +public class TaskHisQueryVo extends BaseVo implements PageVo.ConvertVo { + @ApiModelProperty(value = "id") + private Long id; + + /** + * 任务编码, 查看任务编码规则 + */ + @ApiModelProperty("任务编码") + private String taskCode; + /** + * 发起任务时间 + */ + @ApiModelProperty("发起时间") + private LocalDateTime createTime; + /** + * 任务来源, 暂时只有人工 + */ + @ApiModelProperty("任务来源") + private String taskSource; + /** + * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) + */ + @ApiModelProperty("状态") + private Integer status; + /** + * 任务类型:0:入库到窑炉,1:入库到缓存区,2出库到 窑炉到缓存区,3缓存区出库 + */ + @ApiModelProperty("任务类型") + private Integer taskType; + /** + * 开始位置 + */ + @ApiModelProperty("开始位置") + private String startPosition; + /** + * 开始加工时间 + */ + @ApiModelProperty("开始加工时间") + private LocalDateTime aBeginTime; + + /** + * 加工完成时间 + */ + @ApiModelProperty("加工完成时间") + private LocalDateTime aEndTime; + /** + * 目标位置指的是窑炉的位置 + */ + @ApiModelProperty("窑炉位置") + private String targetPosition; + /** + * 车辆名称,关联车辆表:t_vehicle_info + */ + @ApiModelProperty("车辆名称") + private String vehicleName; +} diff --git a/6.program/wms-gateway/src/main/resources/config/application.yml b/6.program/wms-gateway/src/main/resources/config/application.yml index 4f5a514..9348986 100644 --- a/6.program/wms-gateway/src/main/resources/config/application.yml +++ b/6.program/wms-gateway/src/main/resources/config/application.yml @@ -88,6 +88,7 @@ wms: - /*/login - /*/wechatLogin - /*/mobileLogin + - /apms #公共配置 common: