|
|
@@ -1,12 +1,16 @@
|
|
|
package com.zd.bottle.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
|
|
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.UsegasApplyTabVo;
|
|
|
import com.zd.bottle.vo.UsegasApplyVo;
|
|
|
+import com.zd.common.core.utils.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Collections;
|
|
|
@@ -25,29 +29,47 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class UsegasApplyServiceImpl extends ServiceImpl<UsegasApplyMapper, UsegasApply> implements UsegasApplyService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UsegasApplyMapper usegasApplyMapper;
|
|
|
+
|
|
|
@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());
|
|
|
- }
|
|
|
+ List <UsegasApplyVo> applyVos = usegasApplyMapper.selectUseagsApplyList(usegasApply);
|
|
|
+// LambdaQueryWrapper <UsegasApply> wrapper = Wrappers.lambdaQuery();
|
|
|
+// wrapper.setEntity(usegasApply);
|
|
|
+// if(StringUtils.isNotEmpty(usegasApply.getSearchValue())){
|
|
|
+// wrapper.and(
|
|
|
+// wrapper1 -> wrapper1
|
|
|
+// .like(StringUtils.isNotEmpty(usegasApply.getSearchValue()),UsegasApply::getApplyUser, "%"+usegasApply.getSearchValue()+"%")
|
|
|
+// .or()
|
|
|
+// .like(StringUtils.isNotEmpty(usegasApply.getSearchValue()),UsegasApply::getPhone, "%"+usegasApply.getSearchValue()+"%")
|
|
|
+// );
|
|
|
+// }
|
|
|
+// 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 applyVos;
|
|
|
+ }
|
|
|
|
|
|
- return usegasApplyVo;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- return collect;
|
|
|
+ @Override
|
|
|
+ public UsegasApplyTabVo selectApplyTabCount(UsegasApply usegasApply) {
|
|
|
+ return usegasApplyMapper.selectApplyTabCount(usegasApply);
|
|
|
}
|
|
|
}
|