添加apms作废生产单接口,任务表新增生产单号
This commit is contained in:
@@ -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("无法删除,任务正在执行中。");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user