From 595315b149529e995bb80c556b151b9c973ebda2 Mon Sep 17 00:00:00 2001 From: think <1787994136@qq.com> Date: Tue, 14 Jan 2025 11:27:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E7=A8=8B=E6=A3=80=E5=92=8C=E7=BB=88?= =?UTF-8?q?=E6=A3=80=E5=A2=9E=E5=8A=A0=E7=AE=A1=E6=8E=A7=EF=BC=8C=E6=8A=A5?= =?UTF-8?q?=E5=B7=A5=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/heli/enums/ErrorCodeConstants.java | 1 + .../bgmasterline/BgMasterLineServiceImpl.java | 4 +++ .../ZjBgMasterLineServiceImpl.java | 3 ++ .../src/pages/pgMaster/pgMaster-detail.vue | 35 +++++++++++------- .../pages/zjPgMaster/zjPgMaster-detail.vue | 36 ++++++++++++------- 5 files changed, 53 insertions(+), 26 deletions(-) diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java index aa32149..fce9082 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java @@ -103,6 +103,7 @@ public interface ErrorCodeConstants { ErrorCode TASK_REPORT_PARAMS_ERRORBG = new ErrorCode(1_009_009, "开始报工和结束报工操作人员不同,无法报工"); ErrorCode TASK_REPORT_PARAMS_ERRORJD = new ErrorCode(1_009_010, "报工进度不能超过100%"); ErrorCode TASK_REPORT_PARAMS_ERRORSJBG = new ErrorCode(1_009_011, "报工进度不能小于上次报工进度"); + ErrorCode TASK_DISPATCH_TASK_NOT_EXISTS = new ErrorCode(1_009_004, "任务不存在或已完成"); ErrorCode TASK_DISPATCH_TASK_NO_PERMISSION_FOR_OPERATE = new ErrorCode(1_009_005, "任务不满足操作条件"); ErrorCode TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS = new ErrorCode(1_009_006, "无法超额报工"); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/bgmasterline/BgMasterLineServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/bgmasterline/BgMasterLineServiceImpl.java index 0daaa57..b6f4424 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/bgmasterline/BgMasterLineServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/bgmasterline/BgMasterLineServiceImpl.java @@ -38,6 +38,10 @@ public class BgMasterLineServiceImpl implements BgMasterLineService { //结束本次报工 @Override public Integer updateBgMasterLines(BgMasterLineSaveReqVO createReqVO){ + if(createReqVO.getAmount() == null || createReqVO.getWorkTime() == null){ + throw exception(TASK_REPORT_PARAMS_ERROR); + } + //先取出总的派工数量和预计工时 PgMasterLineDO pgMasterLineDO = pgMasterLineMapper.selectById(createReqVO.getZjMxId()); //然后再取出这条ID明细ID下的所有工时和报工数量相加 diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/zjbgmasterline/ZjBgMasterLineServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/zjbgmasterline/ZjBgMasterLineServiceImpl.java index ace3a43..1b28a26 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/zjbgmasterline/ZjBgMasterLineServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/zjbgmasterline/ZjBgMasterLineServiceImpl.java @@ -50,6 +50,9 @@ public class ZjBgMasterLineServiceImpl implements ZjBgMasterLineService { //结束本次报工 @Override public Integer updateBgMasterLines(ZjBgMasterLineSaveReqVO createReqVO){ + if(createReqVO.getAmount() == null || createReqVO.getWorkTime() == null){ + throw exception(TASK_REPORT_PARAMS_ERROR); + } //先取出总的派工数量和预计工时 ZjPgMasterLineDO zjPgMasterLineDO = zjPgMasterLineMapper.selectById(createReqVO.getZjMxId()); //然后再取出这条ID明细ID下的所有工时和报工数量相加 diff --git a/mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue b/mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue index bb43d77..0a8d71b 100644 --- a/mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue +++ b/mes-ui/mini-app/src/pages/pgMaster/pgMaster-detail.vue @@ -113,17 +113,26 @@ const handleComplate = async () => { } // 提交报工 const handleOk = async (active) => { - const params = { - zjMxId: detailInfo.value?.id, - amount: amount.value, - workTime: workTime.value, - bgUser: userId, - } - const data = await postOperateAPIEnd(params) - const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}` - uni.redirectTo({ - url, - }) + if(amount.value>0&&workTime.value>0){ + const params = { + zjMxId: detailInfo.value?.id, + amount: amount.value, + workTime: workTime.value, + bgUser: userId, + } + const data = await postOperateAPIEnd(params) + const url = `/pages/pgMaster/pgMaster-detail?id=${detailInfo.value.id}` + uni.redirectTo({ + url, + }) + }else{ + uni.showToast({ + title: '报工数量或报工时间必须大于0,请检查!', + icon: 'none', // 显示纯文本时icon设为none + duration: 2000 + }); + } + } // 开始生产 const handleStart = async () => { @@ -248,14 +257,14 @@ const handleStop = async () => { - + *本次报工工时: diff --git a/mes-ui/mini-app/src/pages/zjPgMaster/zjPgMaster-detail.vue b/mes-ui/mini-app/src/pages/zjPgMaster/zjPgMaster-detail.vue index afa7a9d..3fad50d 100644 --- a/mes-ui/mini-app/src/pages/zjPgMaster/zjPgMaster-detail.vue +++ b/mes-ui/mini-app/src/pages/zjPgMaster/zjPgMaster-detail.vue @@ -113,17 +113,27 @@ const handleComplate = async () => { } // 提交报工 const handleOk = async (active) => { - const params = { - zjMxId: detailInfo.value?.id, - amount: amount.value, - workTime: workTime.value, - bgUser: userId, - } - const data = await postOperateAPIEnd(params) - const url = `/pages/zjPgMaster/zjPgMaster-detail?id=${detailInfo.value.id}` - uni.redirectTo({ - url, - }) + if(amount.value>0&&workTime.value>0){ + const params = { + zjMxId: detailInfo.value?.id, + amount: amount.value, + workTime: workTime.value, + bgUser: userId, + } + const data = await postOperateAPIEnd(params) + const url = `/pages/zjPgMaster/zjPgMaster-detail?id=${detailInfo.value.id}` + uni.redirectTo({ + url, + }) + }else{ + uni.showToast({ + title: '报工数量或报工时间必须大于0,请检查!', + icon: 'none', // 显示纯文本时icon设为none + duration: 2000 + }); + } + + } // 开始生产 const handleStart = async () => { @@ -259,14 +269,14 @@ const handleStop = async () => { - + *本次报工工时: