添加apms作废生产单接口,任务表新增生产单号
This commit is contained in:
parent
4403f9ec52
commit
f68b45870f
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 当前任务
|
||||
* </p>
|
||||
*
|
||||
* @author mt
|
||||
* @since 2021-11-18
|
||||
* @since 2021-11-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ -88,6 +84,12 @@ public class CurrTask extends Model<CurrTask> {
|
||||
@TableField("task_code")
|
||||
private String taskCode;
|
||||
|
||||
/**
|
||||
* 生产单号 APMS生成生产单后返回
|
||||
*/
|
||||
@TableField("sheet_no")
|
||||
private String sheetNo;
|
||||
|
||||
/**
|
||||
* 任务来源 0:人工 扩展字段
|
||||
*/
|
||||
@ -193,6 +195,8 @@ public class CurrTask extends Model<CurrTask> {
|
||||
|
||||
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";
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 任务历史
|
||||
* </p>
|
||||
*
|
||||
* @author mt
|
||||
* @since 2021-11-18
|
||||
* @since 2021-11-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ -88,6 +84,12 @@ public class TaskHis extends Model<TaskHis> {
|
||||
@TableField("task_code")
|
||||
private String taskCode;
|
||||
|
||||
/**
|
||||
* 生产单号 APMS生成生产单后返回
|
||||
*/
|
||||
@TableField("sheet_no")
|
||||
private String sheetNo;
|
||||
|
||||
/**
|
||||
* 任务来源 0:人工 扩展字段
|
||||
*/
|
||||
@ -193,6 +195,8 @@ public class TaskHis extends Model<TaskHis> {
|
||||
|
||||
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";
|
||||
|
@ -14,6 +14,7 @@
|
||||
<result column="status" property="status" />
|
||||
<result column="inter_code" property="interCode" />
|
||||
<result column="task_code" property="taskCode" />
|
||||
<result column="sheet_no" property="sheetNo"/>
|
||||
<result column="task_source" property="taskSource" />
|
||||
<result column="task_type" property="taskType" />
|
||||
<result column="process_type" property="processType" />
|
||||
@ -32,7 +33,9 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
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
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
@ -14,6 +14,7 @@
|
||||
<result column="status" property="status" />
|
||||
<result column="inter_code" property="interCode" />
|
||||
<result column="task_code" property="taskCode" />
|
||||
<result column="sheet_no" property="sheetNo"/>
|
||||
<result column="task_source" property="taskSource" />
|
||||
<result column="task_type" property="taskType" />
|
||||
<result column="process_type" property="processType" />
|
||||
@ -32,7 +33,9 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
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
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
@ -65,11 +65,11 @@ public class ApmsController extends BaseController {
|
||||
}
|
||||
|
||||
@PostMapping(value = "apmsVoidOrder")
|
||||
@ApiOperation(value = "APMS作废订单")
|
||||
@ApiOperation(value = "APMS通知WMS作废订单")
|
||||
public R<String> 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);
|
||||
@ -91,6 +91,31 @@ public class ApmsController extends BaseController {
|
||||
return orderInfoService.apmsCompleteOrder(apmsCompleteOrder);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过生产单编号删除生产单,如果生产单加工完成,不允许删除
|
||||
*
|
||||
* @param sheetNo 生产单编号
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "deleteBySheetNo")
|
||||
@ApiOperation(value = "通知APMS删除生产单")
|
||||
public R<ApmsEndProcessVo> deleteBySheetNo(@Validated @RequestBody String sheetNo) {
|
||||
checkToken();
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
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("WMS通知APMS删除生产单");
|
||||
communicationLog.setType(2);
|
||||
communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
|
||||
setCommonField(communicationLog);
|
||||
communicationLogServiceBiz.save(communicationLog);
|
||||
return successful(JSONUtil.toBean(response.body(), ApmsEndProcessVo.class));
|
||||
}
|
||||
|
||||
@PostMapping(value = "createProcessSheet")
|
||||
@ApiOperation(value = "通知APMS创建生产单接口")
|
||||
public R<ApmsCreateProcessSheetVo> createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) {
|
||||
@ -191,7 +216,7 @@ public class ApmsController extends BaseController {
|
||||
.header("token", Token).form(paramMap).execute();
|
||||
CommunicationLog communicationLog = new CommunicationLog();
|
||||
communicationLog.setCode("APMS" + System.currentTimeMillis());
|
||||
communicationLog.setLogName("APMS通过车间编码获取炉号信息");
|
||||
communicationLog.setLogName("WMS通过APMS使用车间编码获取炉号信息");
|
||||
communicationLog.setType(2);
|
||||
communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
|
||||
setCommonField(communicationLog);
|
||||
|
@ -38,7 +38,7 @@ public class CurrTaskController extends BaseController {
|
||||
|
||||
@PostMapping(value = "createProcessTask")
|
||||
@ApiOperation(value = "创建一个加工任务至任务队列")
|
||||
public R createProcessTask(@Validated @RequestBody TaskCreateParam param) {
|
||||
public R<String> createProcessTask(@Validated @RequestBody TaskCreateParam param) {
|
||||
R<IdVo> mainTask = currTaskService.createProcessTask(param);
|
||||
currTaskDetService.createProcessTaskDet(param.getDetParams(), mainTask.getData().getId());
|
||||
return successful("创建成功。");
|
||||
@ -53,7 +53,13 @@ public class CurrTaskController extends BaseController {
|
||||
|
||||
@PostMapping(value = "completeTask")
|
||||
@ApiOperation(value = "完成执行任务")
|
||||
public R completeTask(@Validated @RequestBody IdParam param) {
|
||||
public R<String> completeTask(@Validated @RequestBody IdParam param) {
|
||||
return currTaskService.completeTask(param);
|
||||
}
|
||||
|
||||
@PostMapping(value = "deleteBySheetNo")
|
||||
@ApiOperation(value = "通过生产单编号删除生产单(APMS)")
|
||||
public R<String> deleteBySheetNo(@Validated @RequestBody String sheetNo) {
|
||||
return currTaskService.deleteBySheetNo(sheetNo);
|
||||
}
|
||||
}
|
||||
|
@ -58,4 +58,12 @@ public interface CurrTaskDetService {
|
||||
* @return 结果
|
||||
*/
|
||||
List<CurrTaskDet> getTaskDetailsByIdenCardNum(String idenCardNum);
|
||||
|
||||
/**
|
||||
* 查询某个标识卡号的详细任务列表
|
||||
*
|
||||
* @param currTaskId 生产单号
|
||||
* @return 结果
|
||||
*/
|
||||
R<String> deleteByCurrTaskId(Long currTaskId);
|
||||
}
|
||||
|
@ -49,4 +49,12 @@ public interface CurrTaskService {
|
||||
* @return 结果
|
||||
*/
|
||||
R<String> completeTask(IdParam param);
|
||||
|
||||
/**
|
||||
* 通过生产单编号删除生产单
|
||||
*
|
||||
* @param sheetNo 生产单号
|
||||
* @return 结果
|
||||
*/
|
||||
R<String> deleteBySheetNo(String sheetNo);
|
||||
}
|
||||
|
@ -79,4 +79,10 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe
|
||||
.eq(CurrTaskDet.VALID, 1);
|
||||
return currTaskDetServiceBiz.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<String> deleteByCurrTaskId(Long currTaskId) {
|
||||
currTaskDetServiceBiz.remove(new QueryWrapper<CurrTaskDet>().eq(CurrTaskDet.CURR_TASK_ID, currTaskId));
|
||||
return successful("成功。");
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ 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 +20,7 @@ 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.CurrTaskQueryVo;
|
||||
import com.mt.wms.empty.vo.CurrTaskVo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@ -52,6 +54,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
@Autowired
|
||||
TaskDetHisService taskDetHisService;
|
||||
|
||||
@Autowired
|
||||
ApmsController apmsControl;
|
||||
|
||||
@Override
|
||||
public CurrTaskVo getCurrTask(IdParam idParam) {
|
||||
CurrTask byId = currTaskServiceBiz.getById(idParam.getId());
|
||||
@ -99,4 +104,27 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
|
||||
taskDetHisService.saveList(taskDetHis);
|
||||
return successful("执行成功。");
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<String> deleteBySheetNo(String sheetNo) {
|
||||
CurrTask byId = currTaskServiceBiz.getById(new QueryWrapper<CurrTask>().eq(CurrTask.SHEET_NO, sheetNo));
|
||||
//如果尚未执行(状态 0)
|
||||
if (byId.getStatus() == 0)
|
||||
{
|
||||
|
||||
R<ApmsEndProcessVo> 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("无法删除,任务正在执行中。");
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user