Forráskód Böngészése

2022-09-9 审核列表查询。

zhuchangxue 3 éve
szülő
commit
8a53d2e2e0

+ 3 - 0
zd-common/zd-common-core/src/main/java/com/zd/common/core/domain/per/PerPrefix.java

@@ -697,4 +697,7 @@ public class PerPrefix {
 
     public static final String ACT_HXP_AUDITCONFIG = "chemical:auditconfig:";
 
+
+    /**   ================================================气瓶申请流程的权限=====================================     */
+    public static final String QP_USEGASAPPLY = "bottle:usegasapply:";
 }

+ 1 - 1
zd-common/zd-common-core/src/main/java/com/zd/common/core/web/controller/BaseController.java

@@ -88,7 +88,7 @@ public class BaseController<T> {
      * 响应请求分页数据
      */
     @SuppressWarnings({"rawtypes", "unchecked"})
-    protected TableDataInfo<T> getDataTable(List<T> list) {
+    protected TableDataInfo<T> getDataTable(List<? extends T> list) {
         TableDataInfo<T> rspData = new TableDataInfo();
         rspData.setCode(HttpStatus.SUCCESS);
         rspData.setRows(list);

+ 3 - 0
zd-common/zd-common-core/src/main/java/com/zd/common/core/web/domain/BaseBean.java

@@ -57,6 +57,9 @@ public class BaseBean implements Serializable {
      */
     protected transient boolean isNewRecord;
 
+    @ApiModelProperty(value = "关键字搜索")
+    private transient String searchValue;
+
     /**
      * 是否为新记录
      *

+ 3 - 3
zd-common/zd-common-core/src/main/java/com/zd/common/core/web/page/TableDataInfo.java

@@ -24,7 +24,7 @@ public class TableDataInfo<T> implements Serializable {
     /**
      * 列表数据
      */
-    private transient List<T> rows;
+    private transient List<? extends T> rows;
 
     /**
      * 消息状态码
@@ -61,11 +61,11 @@ public class TableDataInfo<T> implements Serializable {
         this.total = total;
     }
 
-    public List<T> getRows() {
+    public List<? extends T> getRows() {
         return rows;
     }
 
-    public void setRows(List<T> rows) {
+    public void setRows(List<? extends T> rows) {
         this.rows = rows;
     }
 

+ 40 - 0
zd-modules/zd-bottle-parent/zd-bottle-api/src/main/java/com/zd/bottle/vo/UsegasApplyVo.java

@@ -0,0 +1,40 @@
+package com.zd.bottle.vo;
+
+import com.zd.bottle.domain.UsegasApply;
+import com.zd.common.core.web.domain.BaseBean;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * Controller
+ *
+ * @author cyl
+ * @date 2022/9/8
+ */
+@Data
+@Accessors(chain = true)
+@ApiModel(value = "UsegasApply对象", description = "用气申请表")
+@EqualsAndHashCode(callSuper = true)
+public class UsegasApplyVo extends UsegasApply {
+
+    @ApiModelProperty(value = "申请人姓名")
+    private String applyUserName;
+
+    @ApiModelProperty(value = "申请人电话")
+    private String applyUserPhone;
+
+    @ApiModelProperty(value = "使用气体")
+    private String useGasName;
+
+    @ApiModelProperty(value = "申请时间")
+    private Date applyTime;
+
+    @ApiModelProperty(value = "当前审批人id")
+    private Long auditUserid;
+
+}

+ 22 - 0
zd-modules/zd-bottle-parent/zd-bottle/src/main/java/com/zd/bottle/controller/UsegasApplyController.java

@@ -1,10 +1,21 @@
 package com.zd.bottle.controller;
 
 import com.zd.bottle.domain.UsegasApply;
+import com.zd.bottle.service.UsegasApplyService;
+import com.zd.bottle.vo.UsegasApplyVo;
+import com.zd.common.core.domain.per.PerFun;
+import com.zd.common.core.domain.per.PerPrefix;
+import com.zd.common.core.web.domain.BaseBean;
+import com.zd.common.core.web.page.TableDataInfo;
+import com.zd.common.security.annotation.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import com.zd.common.core.web.controller.BaseController;
 
+import java.util.List;
+
 /**
  * <p>
  * 用气申请表 前端控制器
@@ -17,4 +28,15 @@ import com.zd.common.core.web.controller.BaseController;
 @RequestMapping("/usegasApply")
 public class UsegasApplyController extends BaseController<UsegasApply> {
 
+    @Autowired
+    private UsegasApplyService usegasApplyService;
+
+    @PreAuthorize(hasPermi = PerPrefix.QP_USEGASAPPLY + PerFun.LIST)
+    @GetMapping("/list")
+    public TableDataInfo <UsegasApply> list(UsegasApply usegasApply){
+        startPage();
+        List <UsegasApplyVo> list = usegasApplyService.selectUseagsApplyList(usegasApply);
+        return getDataTable(list);
+    }
+
 }

+ 5 - 0
zd-modules/zd-bottle-parent/zd-bottle/src/main/java/com/zd/bottle/service/UsegasApplyService.java

@@ -2,6 +2,9 @@ package com.zd.bottle.service;
 
 import com.zd.bottle.domain.UsegasApply;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zd.bottle.vo.UsegasApplyVo;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +16,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface UsegasApplyService extends IService<UsegasApply> {
 
+    List <UsegasApplyVo> selectUseagsApplyList(UsegasApply usegasApply);
+
 }

+ 33 - 0
zd-modules/zd-bottle-parent/zd-bottle/src/main/java/com/zd/bottle/service/impl/UsegasApplyServiceImpl.java

@@ -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;
+    }
 }