Sfoglia il codice sorgente

fix 委托 审核通过 应该不能删除 或者修改

32197351@qq.com 2 anni fa
parent
commit
7d34824fbf

+ 19 - 1
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/weituo/service/impl/ItdmWeituoInfoServiceImpl.java

@@ -85,7 +85,12 @@ public class ItdmWeituoInfoServiceImpl extends ServiceImpl<ItdmWeituoInfoMapper,
     @Override
     public void updateWeituo(WeituoUpdateCommand command) {
         ItdmWeituoInfo itdmWeituoInfo = WeituoConvert.INSTANCE.convert(command);
-        if (Objects.equals(itdmWeituoInfo.getShenheStatus(), ShenheStatus.t.getCode())) {
+
+
+        ItdmWeituoInfo select = this.baseMapper.selectById(command.getId());
+
+
+        if (Objects.equals(select.getShenheStatus(), ShenheStatus.t.getCode())) {
             throw new JeecgBootException("审核通过不能修改数据");
         }
 
@@ -130,6 +135,11 @@ public class ItdmWeituoInfoServiceImpl extends ServiceImpl<ItdmWeituoInfoMapper,
     @Override
     @Transactional
     public void deleteById(String id) {
+
+        ItdmWeituoInfo itdmWeituoInfo =   this.baseMapper.selectById(id);
+        if (Objects.equals(itdmWeituoInfo.getShenheStatus(), ShenheStatus.t.getCode())) {
+            throw new JeecgBootException("审核通过不能修改数据");
+        }
         this.baseMapper.deleteById(id);
         this.yangpinMapper.delete(Wrappers.lambdaQuery(ItdmWeituoYangpin.class).eq(ItdmWeituoYangpin::getWeituoId, id));
         this.yangpinExtendMapper.delete(Wrappers.lambdaQuery(ItdmWeituoYangpinExtend.class).eq(ItdmWeituoYangpinExtend::getWeituoId, id));
@@ -140,6 +150,14 @@ public class ItdmWeituoInfoServiceImpl extends ServiceImpl<ItdmWeituoInfoMapper,
     @Override
     @Transactional
     public void deleteByIds(List<String> id) {
+
+
+        id.forEach(i->{
+            ItdmWeituoInfo itdmWeituoInfo =   this.baseMapper.selectById(i);
+            if (Objects.equals(itdmWeituoInfo.getShenheStatus(), ShenheStatus.t.getCode())) {
+                throw new JeecgBootException("审核通过不能修改数据");
+            }
+        });
         this.baseMapper.deleteBatchIds(id);
         this.yangpinMapper.delete(Wrappers.lambdaQuery(ItdmWeituoYangpin.class).in(ItdmWeituoYangpin::getWeituoId, id));
         this.yangpinExtendMapper.delete(Wrappers.lambdaQuery(ItdmWeituoYangpinExtend.class).in(ItdmWeituoYangpinExtend::getWeituoId, id));