Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

zhuang 1 vuosi sitten
vanhempi
commit
e5e0175aaf

+ 4 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxProjectRectifyDao.java

@@ -2,6 +2,8 @@ package com.rongwei.bscommon.sys.dao;
 
 import com.rongwei.bsentity.domain.ZhcxProjectRectifyDo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.domain.ZhcxProjectRectifyMachineDo;
+import org.apache.ibatis.annotations.Delete;
 
 /**
  * <p>
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ZhcxProjectRectifyDao extends BaseMapper<ZhcxProjectRectifyDo> {
 
+    @Delete("delete from ZHCX_PROJECT_RECTIFY where PRJID = #{prjid}")
+    void deleteByProjectId(ZhcxProjectRectifyMachineDo machineDo);
 }

+ 3 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxProjectRectifyMachineDao.java

@@ -2,6 +2,7 @@ package com.rongwei.bscommon.sys.dao;
 
 import com.rongwei.bsentity.domain.ZhcxProjectRectifyMachineDo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Delete;
 
 /**
  * <p>
@@ -13,4 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ZhcxProjectRectifyMachineDao extends BaseMapper<ZhcxProjectRectifyMachineDo> {
 
+    @Delete("delete from ZHCX_PROJECT_RECTIFY_MACHINE where PRJID = #{prjid}")
+    void deleteByProjectId(ZhcxProjectRectifyMachineDo machineDo);
 }

+ 6 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/ZhcxProjectRectifyMachineService.java

@@ -13,4 +13,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ZhcxProjectRectifyMachineService extends IService<ZhcxProjectRectifyMachineDo> {
 
+    /**
+     * 通过项目删除
+     *
+     * @param prjId
+     */
+    void deleteByPrjId(String prjId);
 }

+ 15 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectRectifyMachineServiceImpl.java

@@ -4,6 +4,7 @@ import com.rongwei.bsentity.domain.ZhcxProjectRectifyMachineDo;
 import com.rongwei.bscommon.sys.dao.ZhcxProjectRectifyMachineDao;
 import com.rongwei.bscommon.sys.service.ZhcxProjectRectifyMachineService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
@@ -17,4 +18,18 @@ import org.springframework.stereotype.Service;
 @Service
 public class ZhcxProjectRectifyMachineServiceImpl extends ServiceImpl<ZhcxProjectRectifyMachineDao, ZhcxProjectRectifyMachineDo> implements ZhcxProjectRectifyMachineService {
 
+    @Autowired
+    private ZhcxProjectRectifyMachineDao dao;
+
+    /**
+     * 通过项目删除
+     *
+     * @param prjId
+     */
+    @Override
+    public void deleteByPrjId(String prjId) {
+        ZhcxProjectRectifyMachineDo rectifyMachineDo = new ZhcxProjectRectifyMachineDo();
+        rectifyMachineDo.setPrjid(prjId);
+        dao.deleteByProjectId(rectifyMachineDo);
+    }
 }

+ 8 - 9
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectRectifyServiceImpl.java

@@ -22,6 +22,9 @@ import org.springframework.stereotype.Service;
 @Service
 public class ZhcxProjectRectifyServiceImpl extends ServiceImpl<ZhcxProjectRectifyDao, ZhcxProjectRectifyDo> implements ZhcxProjectRectifyService {
 
+    @Autowired
+    private ZhcxProjectRectifyDao dao;
+
     @Autowired
     private ZhcxProjectRectifyMachineService rectifyMachineService;
 
@@ -32,16 +35,12 @@ public class ZhcxProjectRectifyServiceImpl extends ServiceImpl<ZhcxProjectRectif
      */
     @Override
     public void delByPrjId(String prjId) {
-
+        //物理删除
         //删除明细
-        LambdaQueryWrapper<ZhcxProjectRectifyMachineDo> delWrapper = Wrappers.lambdaQuery();
-        delWrapper.eq(ZhcxProjectRectifyMachineDo::getPrjid, prjId)
-                .eq(ZhcxProjectRectifyMachineDo::getDeleted,"0");
-        rectifyMachineService.remove(delWrapper);
+        rectifyMachineService.deleteByPrjId(prjId);
 
-        LambdaQueryWrapper<ZhcxProjectRectifyDo> delWrapper2 = Wrappers.lambdaQuery();
-        delWrapper2.eq(ZhcxProjectRectifyDo::getPrjid, prjId)
-                .eq(ZhcxProjectRectifyDo::getDeleted, "0");
-        remove(delWrapper2);
+        ZhcxProjectRectifyMachineDo machineDo = new ZhcxProjectRectifyMachineDo();
+        machineDo.setPrjid(prjId);
+        dao.deleteByProjectId(machineDo);
     }
 }