From 4d1a30da0ec4d37694baeb129a9a21aa29c157b7 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期四, 22 八月 2024 10:19:15 +0800
Subject: [PATCH] fix order complete Rate
---
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineSv.java | 28 ++++++++++++++++++++++++----
1 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineSv.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineSv.java
index 6398bc8..a661cbc 100644
--- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineSv.java
+++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/proLine/ProLineSv.java
@@ -2,6 +2,7 @@
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoPlt.PltProductionLineMapper;
+import com.dy.pmsGlobal.daoPlt.PltStationMapper;
import com.dy.pmsGlobal.pojoPlt.PltProductionLine;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
@@ -17,16 +18,21 @@
public class ProLineSv {
private PltProductionLineMapper dao;
+ private PltStationMapper stationDao;
@Autowired
public void setDao(PltProductionLineMapper dao) {
this.dao = dao;
}
+ @Autowired
+ public void setStationDao(PltStationMapper stationDao) {
+ this.stationDao = stationDao;
+ }
@Transactional
- public int save(PltProductionLine line) throws Exception {
+ public int save(PltProductionLine line) throws RuntimeException {
if(dao.selectByNameId(line.id,line.name)>0){
- throw new Exception("鐢熶骇绾垮悕绉板凡瀛樺湪");
+ throw new RuntimeException("鐢熶骇绾垮悕绉板凡瀛樺湪");
}
int count = dao.insertSelective(line);
return count;
@@ -45,9 +51,9 @@
@Transactional
- public int update(PltProductionLine line) throws Exception {
+ public int update(PltProductionLine line) throws RuntimeException {
if(dao.selectByNameId(line.id,line.name)>0){
- throw new Exception("鐢熶骇绾垮悕绉板凡瀛樺湪");
+ throw new RuntimeException("鐢熶骇绾垮悕绉板凡瀛樺湪");
}
int count = dao.updateByPrimaryKeySelective(line);
return count;
@@ -79,5 +85,19 @@
public List<PltProductionLine> selectAll() {
return dao.selectAll();
}
+
+ @Transactional
+ public int updateStatus(PltProductionLine line) {
+ if(line.disabled){
+ long count = stationDao.selectByLineAndStatus(line.id,false);
+ if(count>0){
+ throw new RuntimeException("璇ョ敓浜х嚎杩樻湁鍚敤鐘舵�佺殑宸ョ珯");
+ }
+ }
+ PltProductionLine lineParam = new PltProductionLine();
+ lineParam.id = line.id;
+ lineParam.disabled = line.disabled;
+ return dao.updateByPrimaryKeySelective(lineParam);
+ }
}
--
Gitblit v1.8.0