|
|
@@ -1,11 +1,19 @@
|
|
|
package com.zd.bottle.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.zd.bottle.domain.UsegasApply;
|
|
|
import com.zd.bottle.mapper.UsegasApplyMapper;
|
|
|
import com.zd.bottle.service.UsegasApplyService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.zd.bottle.vo.UsegasApplyVo;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Optional;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 用气申请表 服务实现类
|
|
|
@@ -17,4 +25,29 @@ import org.springframework.stereotype.Service;
|
|
|
@Service
|
|
|
public class UsegasApplyServiceImpl extends ServiceImpl<UsegasApplyMapper, UsegasApply> implements UsegasApplyService {
|
|
|
|
|
|
+ @Override
|
|
|
+ public List <UsegasApplyVo> selectUseagsApplyList(UsegasApply usegasApply) {
|
|
|
+ LambdaQueryWrapper <UsegasApply> wrapper = Wrappers.lambdaQuery();
|
|
|
+ wrapper.setEntity(usegasApply);
|
|
|
+ List <UsegasApply> list = list(wrapper);
|
|
|
+ List <UsegasApplyVo> collect = Optional.ofNullable(list).orElseGet(Collections::emptyList)
|
|
|
+ .stream()
|
|
|
+ .map(a -> {
|
|
|
+ UsegasApplyVo usegasApplyVo = new UsegasApplyVo();
|
|
|
+ usegasApplyVo.setId(a.getId());
|
|
|
+ usegasApplyVo.setApplyUserName(a.getApplyUser());
|
|
|
+ usegasApplyVo.setApplyUserPhone(a.getPhone());
|
|
|
+ usegasApplyVo.setUseGasName(a.getUseGasName());
|
|
|
+ usegasApplyVo.setApplyTime(a.getCreateTime());
|
|
|
+ //todo 这里需要判断第一个审批人是否审批通过,如果第一个通过了,那么需要返回第二个审批人的id
|
|
|
+ if (a.getLeadAuditStaus() == 0) {
|
|
|
+ usegasApplyVo.setAuditUserid(a.getLeadAuditUserid());
|
|
|
+ } else if (a.getCenterAuditStatus() == 0) {
|
|
|
+ usegasApplyVo.setAuditUserid(a.getCenterAuditUserid());
|
|
|
+ }
|
|
|
+
|
|
|
+ return usegasApplyVo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return collect;
|
|
|
+ }
|
|
|
}
|