|
@@ -1,11 +1,19 @@
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.rongwei.bsentity.domain.ZchxNdtProjectNdtCheckWeldSeamDo;
|
|
import com.rongwei.bsentity.domain.ZchxNdtProjectNdtCheckWeldSeamDo;
|
|
import com.rongwei.bscommon.sys.dao.ZchxNdtProjectNdtCheckWeldSeamDao;
|
|
import com.rongwei.bscommon.sys.dao.ZchxNdtProjectNdtCheckWeldSeamDao;
|
|
import com.rongwei.bscommon.sys.service.ZchxNdtProjectNdtCheckWeldSeamService;
|
|
import com.rongwei.bscommon.sys.service.ZchxNdtProjectNdtCheckWeldSeamService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.HashSet;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Set;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
* NDT检测-项目NDT单据_焊缝 服务实现类
|
|
* NDT检测-项目NDT单据_焊缝 服务实现类
|
|
@@ -17,4 +25,43 @@ import org.springframework.stereotype.Service;
|
|
@Service
|
|
@Service
|
|
public class ZchxNdtProjectNdtCheckWeldSeamServiceImpl extends ServiceImpl<ZchxNdtProjectNdtCheckWeldSeamDao, ZchxNdtProjectNdtCheckWeldSeamDo> implements ZchxNdtProjectNdtCheckWeldSeamService {
|
|
public class ZchxNdtProjectNdtCheckWeldSeamServiceImpl extends ServiceImpl<ZchxNdtProjectNdtCheckWeldSeamDao, ZchxNdtProjectNdtCheckWeldSeamDo> implements ZchxNdtProjectNdtCheckWeldSeamService {
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 完成焊缝
|
|
|
|
+ *
|
|
|
|
+ * @param checkId
|
|
|
|
+ * @param completedWeldList
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void completeWeld(String checkId, List<String> completedWeldList) {
|
|
|
|
+
|
|
|
|
+ // 所有设值为未完成
|
|
|
|
+ final LambdaUpdateWrapper<ZchxNdtProjectNdtCheckWeldSeamDo> updateUncomWrapper = Wrappers.lambdaUpdate();
|
|
|
|
+ updateUncomWrapper.set(ZchxNdtProjectNdtCheckWeldSeamDo::getResult, "20")
|
|
|
|
+ .notIn(ZchxNdtProjectNdtCheckWeldSeamDo::getWeldcode, completedWeldList)
|
|
|
|
+ .eq(ZchxNdtProjectNdtCheckWeldSeamDo::getCheckid, checkId);
|
|
|
|
+ update(updateUncomWrapper);
|
|
|
|
+
|
|
|
|
+ // 修改为完成
|
|
|
|
+ final LambdaUpdateWrapper<ZchxNdtProjectNdtCheckWeldSeamDo> updateComWrapper = Wrappers.lambdaUpdate();
|
|
|
|
+ updateUncomWrapper.set(ZchxNdtProjectNdtCheckWeldSeamDo::getResult, "10")
|
|
|
|
+ .in(ZchxNdtProjectNdtCheckWeldSeamDo::getWeldcode, completedWeldList)
|
|
|
|
+ .eq(ZchxNdtProjectNdtCheckWeldSeamDo::getCheckid, checkId);
|
|
|
|
+ update(updateComWrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取已完成焊缝数量
|
|
|
|
+ *
|
|
|
|
+ * @param libId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int getCompleted(String libId) { //查询已完成焊缝
|
|
|
|
+ final LambdaQueryWrapper<ZchxNdtProjectNdtCheckWeldSeamDo> queryResultComWrapper = Wrappers.lambdaQuery();
|
|
|
|
+ queryResultComWrapper.eq(ZchxNdtProjectNdtCheckWeldSeamDo::getLibid, libId)
|
|
|
|
+ .eq(ZchxNdtProjectNdtCheckWeldSeamDo::getResult, "10");
|
|
|
|
+ final List<ZchxNdtProjectNdtCheckWeldSeamDo> list = list(queryResultComWrapper);
|
|
|
|
+
|
|
|
|
+ return (int) list.stream().map(ZchxNdtProjectNdtCheckWeldSeamDo::getWeldcode).distinct().count();
|
|
|
|
+ }
|
|
}
|
|
}
|