Ver código fonte

权限功能修改

liujh 3 anos atrás
pai
commit
9d771080d7
14 arquivos alterados com 163 adições e 78 exclusões
  1. 7 0
      zd-common/zd-common-core/src/main/java/com/zd/common/core/domain/per/PerPrefix.java
  2. 8 6
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpFlowDetailController.java
  3. 1 1
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpQualificationApplyController.java
  4. 5 5
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpQualificationApplyManageController.java
  5. 1 1
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpUsegasApplyController.java
  6. 1 1
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpUsegasApplyManageController.java
  7. 9 11
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/domain/QpUsegasApply.java
  8. 8 0
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/IQpQualificationApplyService.java
  9. 1 1
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpBottleStorageServiceImpl.java
  10. 3 0
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpFlowDetailServiceImpl.java
  11. 26 1
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpQualificationApplyServiceImpl.java
  12. 12 9
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpUsegasApplyServiceImpl.java
  13. 69 34
      zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpFlowDetailMapper.xml
  14. 12 8
      zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpUsegasApplyMapper.xml

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

@@ -573,6 +573,8 @@ public class PerPrefix {
      * 气瓶资格管理
      */
     public static final String AIRBOTTLE_QUALIFICATIONAPPLYMANAGE = "airbottle:qualificationApplyManage:";
+    public static final String AIRBOTTLE_QUALIFICATIONMANAGE = "airbottle:qualificationManage:";//资格管理
+    public static final String AIRBOTTLE_QUALIFICATIONAUDITMANAGE = "airbottle:qualificationAuditManage:";//资格审核
 
     /**
      * 气瓶规格
@@ -595,6 +597,11 @@ public class PerPrefix {
     public static final String AIRBOTTLE_STORAGE= "airbottle:storageManage:";
 
     /**
+     * 实验中心人员添加
+     */
+    public static final String AIRBOTTLE_FLOWDETAIL= "airbottle:flowDetail:";
+
+    /**
      * 气瓶出库
      */
     public static final String AIRBOTTLE_STORAGE_OUT= "airbottle:storageOutManage:";

+ 8 - 6
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpFlowDetailController.java

@@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.zd.airbottle.domain.vo.QpFlowDetailVO;
 import com.zd.airbottle.domain.vo.QpFlowVO;
+import com.zd.common.core.domain.per.PerFun;
+import com.zd.common.core.domain.per.PerPrefix;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -46,7 +48,7 @@ public class QpFlowDetailController extends BaseController
     /**
      * 查询气瓶流程详情列表
      */
-    @PreAuthorize(hasPermi = "airbottle:flowDetail:list")
+    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_FLOWDETAIL+ PerFun.LIST)
     @GetMapping("/list")
     @ApiOperation(value = "查询气瓶流程详情列表")
     public TableDataInfo<QpFlowDetailVO> list(QpFlowDetailVO qpFlowDetail)
@@ -60,7 +62,7 @@ public class QpFlowDetailController extends BaseController
      * 导出气瓶流程详情列表
      */
     @ApiOperation(value = "导出气瓶流程详情列表")
-    @PreAuthorize(hasPermi = "airbottle:flowDetail:export")
+    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_FLOWDETAIL+ PerFun.EXPORT)
     @Log(title = "气瓶流程详情", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, QpFlowDetailVO qpFlowDetail) throws IOException
@@ -74,7 +76,7 @@ public class QpFlowDetailController extends BaseController
      * 获取气瓶流程详情详细信息
      */
     @ApiOperation(value = "获取气瓶流程详情详细信息")
-    @PreAuthorize(hasPermi = "airbottle:flowDetail:query")
+    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_FLOWDETAIL+ PerFun.QUERY)
     @GetMapping(value = "/{id}")
     public ResultData<QpFlowDetail> getInfo(@PathVariable("id") Long id)
     {
@@ -85,7 +87,7 @@ public class QpFlowDetailController extends BaseController
      * 新增气瓶流程详情
      */
     @ApiOperation(value = "新增气瓶流程详情")
-    @PreAuthorize(hasPermi = "airbottle:flowDetail:add")
+    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_FLOWDETAIL+ PerFun.ADD)
     @Log(title = "气瓶流程详情", businessType = BusinessType.INSERT)
     @PostMapping
     public ResultData add(@RequestBody QpFlowDetailVO qpFlow)
@@ -97,7 +99,7 @@ public class QpFlowDetailController extends BaseController
      * 修改气瓶流程详情
      */
     @ApiOperation(value = "修改气瓶流程详情")
-    @PreAuthorize(hasPermi = "airbottle:flowDetail:edit")
+    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_FLOWDETAIL+ PerFun.EDIT)
     @Log(title = "气瓶流程详情", businessType = BusinessType.UPDATE)
     @PutMapping
     public ResultData edit(@RequestBody QpFlowDetail qpFlowDetail)
@@ -109,7 +111,7 @@ public class QpFlowDetailController extends BaseController
      * 删除气瓶流程详情
      */
     @ApiOperation(value = "删除气瓶流程详情")
-    @PreAuthorize(hasPermi = "airbottle:flowDetail:remove")
+    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_FLOWDETAIL+ PerFun.REMOVE)
     @Log(title = "气瓶流程详情", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public ResultData remove(@PathVariable Long[] ids)

+ 1 - 1
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpQualificationApplyController.java

@@ -515,7 +515,7 @@ public class QpQualificationApplyController extends BaseController
 
         //查询是否有用气资格
         QpUsegasApplyVO usegasApply = new QpUsegasApplyVO();
-        usegasApply.setApplyUserid(sysUser.getUserId());
+        usegasApply.setUserId(sysUser.getUserId());
         List<QpUsegasApplyVO>  usegasList= qpUsegasApplyService.selectQpUsegasApplyList(usegasApply);
         for (QpUsegasApplyVO useApplyvo:usegasList) {
             userApplyNumberYq++;

+ 5 - 5
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpQualificationApplyManageController.java

@@ -87,15 +87,15 @@ public class QpQualificationApplyManageController extends BaseController
     /**
      * 用气资格管理列表
      */
-    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_QUALIFICATIONAPPLYMANAGE+ "listManage")
+    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_QUALIFICATIONMANAGE+ PerFun.LIST)
     @GetMapping("/listManage")
-    @ApiOperation(value = "用气资格管理列表",notes = "权限字符:"+ PerPrefix.AIRBOTTLE_QUALIFICATIONAPPLYMANAGE+ "listManage")
+    @ApiOperation(value = "用气资格管理列表",notes = "权限字符:"+ PerPrefix.AIRBOTTLE_QUALIFICATIONMANAGE+ PerFun.LIST)
     public TableDataInfo<QpQualificationApplyVO> listManage(QpQualificationApplyVO qpQualificationApply)
     {
         qpQualificationApply.setCenterAuditStatus(1);//审核通过的数据
         qpQualificationApply.setRemark("100");
         startPage();
-        List<QpQualificationApplyVO> list = qpQualificationApplyService.selectQpQualificationApplyList(qpQualificationApply);
+        List<QpQualificationApplyVO> list = qpQualificationApplyService.selectQpQualificationApplyManageList(qpQualificationApply);
         return getDataTable(list);
     }
 
@@ -104,9 +104,9 @@ public class QpQualificationApplyManageController extends BaseController
      * @param applyVO
      * @return
      */
-    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_QUALIFICATIONAPPLYMANAGE+ "auditList")
+    @PreAuthorize(hasPermi = PerPrefix.AIRBOTTLE_QUALIFICATIONAUDITMANAGE+ PerFun.LIST)
     @GetMapping("/auditList")
-    @ApiOperation(value = "用气资格管理列表",notes = "权限字符:"+PerPrefix.AIRBOTTLE_QUALIFICATIONAPPLYMANAGE+ "auditList" )
+    @ApiOperation(value = "用气资格管理列表",notes = "权限字符:"+PerPrefix.AIRBOTTLE_QUALIFICATIONAUDITMANAGE+ PerFun.LIST )
     public TableDataInfo<QpQualificationApplyVO> auditList(QpQualificationApplyVO applyVO)
     {
         startPage();

+ 1 - 1
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpUsegasApplyController.java

@@ -72,7 +72,7 @@ public class QpUsegasApplyController extends BaseController
     {
         //获取当前登录用户信息
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
-        qpUsegasApply.setApplyUserid(sysUser.getUserId());//当前登陆人申请数据
+        qpUsegasApply.setUserId(sysUser.getUserId());//当前登陆人申请数据
 
         startPage();
         List<QpUsegasApplyVO> list = qpUsegasApplyService.selectQpUsegasApplyList(qpUsegasApply);

+ 1 - 1
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/QpUsegasApplyManageController.java

@@ -72,7 +72,7 @@ public class QpUsegasApplyManageController extends BaseController
     {
         //获取当前登录用户信息
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
-        qpUsegasApply.setApplyUserid(sysUser.getUserId());//当前登陆人申请数据
+        qpUsegasApply.setUserId(sysUser.getUserId());//当前登陆人申请数据
 
         //qpUsegasApply.setLeadAuditStaus(1);//实验室负责人审核通过
         //qpUsegasApply.setRemark("100");//按实验室负责人审核时间排序

+ 9 - 11
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/domain/QpUsegasApply.java

@@ -41,7 +41,7 @@ public class QpUsegasApply extends BaseEntity
     /** 申请人id */
     @Excel(name = "申请人id")
     @ApiModelProperty(value = "申请人id")
-    private Long applyUserid;
+    private Long userId;
     /** 部门id */
     @Excel(name = "部门id")
     @ApiModelProperty(value = "部门id")
@@ -170,15 +170,13 @@ public class QpUsegasApply extends BaseEntity
     {
         return applyUser;
     }
-    public void setApplyUserid(Long applyUserid)
-    {
-        this.applyUserid = applyUserid;
-    }
 
-    public Long getApplyUserid()
-    {
-        return applyUserid;
-    }
+    @Override
+    public Long getUserId() {        return userId;    }
+
+    @Override
+    public void setUserId(Long userId) {        this.userId = userId;    }
+
     public void setDeptId(Long deptId)
     {
         this.deptId = deptId;
@@ -361,7 +359,7 @@ public class QpUsegasApply extends BaseEntity
                 .append("location", getLocation())
                 .append("subjectId", getSubjectId())
                 .append("applyUser", getApplyUser())
-                .append("applyUserid", getApplyUserid())
+                .append("userId", getUserId())
                 .append("deptId", getDeptId())
                 .append("deptName", getDeptName())
                 .append("phone", getPhone())
@@ -385,4 +383,4 @@ public class QpUsegasApply extends BaseEntity
                 .append("createTime", getCreateTime())
                 .toString();
     }
-}
+}

+ 8 - 0
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/IQpQualificationApplyService.java

@@ -30,6 +30,14 @@ public interface IQpQualificationApplyService
      */
     public List<QpQualificationApplyVO> selectQpQualificationApplyList(QpQualificationApplyVO qpQualificationApply);
 
+    /****
+     * 资格管理列表
+     * @param qpQualificationApply
+     * @return
+     */
+    public List<QpQualificationApplyVO> selectQpQualificationApplyManageList(QpQualificationApplyVO qpQualificationApply);
+
+
     /**
      * 新增资格申请
      *

+ 1 - 1
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpBottleStorageServiceImpl.java

@@ -284,7 +284,7 @@ public class QpBottleStorageServiceImpl implements IQpBottleStorageService {
 
             //查询用户使用资格
             QpUsegasApplyVO usegasApplyVO = new QpUsegasApplyVO();
-            usegasApplyVO.setApplyUserid(SecurityUtils.getUserId());
+            usegasApplyVO.setUserId(SecurityUtils.getUserId());
             usegasApplyVO.setUseGasName(qpBottleStorageRVo.getAirName());
             usegasApplyVO.setSubjectId(qpBottleStorageRVo.getSubjectId());
             usegasApplyVO.setCenterAuditStatus(1);

+ 3 - 0
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpFlowDetailServiceImpl.java

@@ -8,8 +8,10 @@ import com.zd.airbottle.domain.QpFlow;
 import com.zd.airbottle.domain.vo.QpFlowDetailVO;
 import com.zd.airbottle.domain.vo.QpFlowVO;
 import com.zd.airbottle.mapper.QpFlowMapper;
+import com.zd.common.core.domain.per.PerPrefix;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.SecurityUtils;
+import com.zd.common.datascope.annotation.DataScope;
 import com.zd.common.security.service.TokenService;
 import com.zd.common.security.utils.SaveUtil;
 
@@ -59,6 +61,7 @@ public class QpFlowDetailServiceImpl implements IQpFlowDetailService
      * @return 气瓶流程详情
      */
     @Override
+    @DataScope(deptAlias = "d", userAlias = "u", permi = PerPrefix.AIRBOTTLE_FLOWDETAIL)
     public List<QpFlowDetailVO> selectQpFlowDetailList(QpFlowDetailVO qpFlowDetail)
     {
         return qpFlowDetailMapper.selectQpFlowDetailList(qpFlowDetail);

+ 26 - 1
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpQualificationApplyServiceImpl.java

@@ -84,7 +84,7 @@ public class QpQualificationApplyServiceImpl implements IQpQualificationApplySer
      * @return 资格申请
      */
     @Override
-    //@DataScope(deptAlias = "d", userAlias = "u", permi = PerPrefix.AIRBOTTLE_QUALIFICATIONAPPLYMANAGE)
+    @DataScope(deptAlias = "d", userAlias = "u", permi = PerPrefix.AIRBOTTLE_QUALIFICATIONAPPLYMANAGE)
     public List<QpQualificationApplyVO> selectQpQualificationApplyList(QpQualificationApplyVO qpQualificationApply)
     {
         List<QpQualificationApplyVO> list= qpQualificationApplyMapper.selectQpQualificationApplyList(qpQualificationApply);
@@ -104,6 +104,31 @@ public class QpQualificationApplyServiceImpl implements IQpQualificationApplySer
         return list;
     }
 
+    /****
+     * 资格管理列表
+     * @param qpQualificationApply
+     * @return
+     */
+    @Override
+    @DataScope(deptAlias = "d", userAlias = "u", permi = PerPrefix.AIRBOTTLE_QUALIFICATIONMANAGE)
+    public List<QpQualificationApplyVO> selectQpQualificationApplyManageList(QpQualificationApplyVO qpQualificationApply) {
+        List<QpQualificationApplyVO> list= qpQualificationApplyMapper.selectQpQualificationApplyList(qpQualificationApply);
+        if(!list.isEmpty()){
+            for (int i=0;i<list.size();i++){
+                if(list.get(i).getLeadAuditStatus()==2 || list.get(i).getCenterAuditStatus()==2){
+                    list.get(i).setRemark("2");//驳回
+                }else if(list.get(i).getCenterAuditStatus()==1){
+                    list.get(i).setRemark("1");//通过
+                }else   if(list.get(i).getLeadAuditStatus()==0 || list.get(i).getCenterAuditStatus()==0){
+                    list.get(i).setRemark("0");//待审核
+                } else{
+                    list.get(i).setRemark("");//
+                }
+            }
+        }
+        return list;
+    }
+
     /**
      * 新增资格申请
      *

+ 12 - 9
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/service/impl/QpUsegasApplyServiceImpl.java

@@ -9,8 +9,10 @@ import com.zd.airbottle.domain.vo.QpUsegasApplyVO;
 import com.zd.airbottle.mapper.QpBottleStorageMapper;
 import com.zd.common.core.constant.HttpStatus;
 import com.zd.common.core.domain.R;
+import com.zd.common.core.domain.per.PerPrefix;
 import com.zd.common.core.template.TemplateResult;
 import com.zd.common.core.utils.DateUtils;
+import com.zd.common.datascope.annotation.DataScope;
 import com.zd.common.security.service.TokenService;
 import com.zd.common.security.utils.SaveUtil;
 
@@ -25,12 +27,12 @@ import com.zd.airbottle.service.IQpUsegasApplyService;
 
 /**
  * 用气申请Service业务层处理
- * 
+ *
  * @author zd
  */
 @Service
 @Slf4j
-public class QpUsegasApplyServiceImpl implements IQpUsegasApplyService 
+public class QpUsegasApplyServiceImpl implements IQpUsegasApplyService
 {
     @Autowired
     private QpUsegasApplyMapper qpUsegasApplyMapper;
@@ -46,7 +48,7 @@ public class QpUsegasApplyServiceImpl implements IQpUsegasApplyService
 
     /**
      * 查询用气申请
-     * 
+     *
      * @param id 用气申请主键
      * @return 用气申请
      */
@@ -68,11 +70,12 @@ public class QpUsegasApplyServiceImpl implements IQpUsegasApplyService
 
     /**
      * 查询用气申请列表
-     * 
+     *
      * @param qpUsegasApply 用气申请
      * @return 用气申请
      */
     @Override
+    @DataScope(deptAlias = "d", userAlias = "u", permi = PerPrefix.AIRBOTTLE_USEAGSAPPLY)
     public List<QpUsegasApplyVO> selectQpUsegasApplyList(QpUsegasApplyVO qpUsegasApply)
     {
         List<QpUsegasApplyVO> list = qpUsegasApplyMapper.selectQpUsegasApplyList(qpUsegasApply);
@@ -94,7 +97,7 @@ public class QpUsegasApplyServiceImpl implements IQpUsegasApplyService
 
     /**
      * 新增用气申请
-     * 
+     *
      * @param qpUsegasApply 用气申请
      * @return 结果
      */
@@ -106,7 +109,7 @@ public class QpUsegasApplyServiceImpl implements IQpUsegasApplyService
 
         SysUser sysUser = tokenService.getLoginUser().getSysUser();
         qpUsegasApply.setCreateTime(new Date());//创建时间
-        qpUsegasApply.setApplyUserid(sysUser.getUserId());//申请人id
+        qpUsegasApply.setUserId(sysUser.getUserId());//申请人id
         qpUsegasApply.setApplyUser(sysUser.getNickName());//申请人姓名
         //qpUsegasApply.setPhone(sysUser.getPhonenumber());//电话
         int flg = qpUsegasApplyMapper.insertQpUsegasApply(qpUsegasApply);
@@ -127,7 +130,7 @@ public class QpUsegasApplyServiceImpl implements IQpUsegasApplyService
 
     /**
      * 修改用气申请
-     * 
+     *
      * @param qpUsegasApply 用气申请
      * @return 结果
      */
@@ -139,7 +142,7 @@ public class QpUsegasApplyServiceImpl implements IQpUsegasApplyService
 
     /**
      * 批量删除用气申请
-     * 
+     *
      * @param ids 需要删除的用气申请主键
      * @return 结果
      */
@@ -151,7 +154,7 @@ public class QpUsegasApplyServiceImpl implements IQpUsegasApplyService
 
     /**
      * 删除用气申请信息
-     * 
+     *
      * @param id 用气申请主键
      * @return 结果
      */

+ 69 - 34
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpFlowDetailMapper.xml

@@ -5,47 +5,75 @@
 <mapper namespace="com.zd.airbottle.mapper.QpFlowDetailMapper">
 
     <resultMap type="com.zd.airbottle.domain.QpFlowDetail" id="QpFlowDetailResult">
-        <result property="id"    column="id"    />
-        <result property="uuid"    column="uuid"    />
-        <result property="userName"    column="user_number"    />
-        <result property="flowType"    column="flow_type"    />
-        <result property="userType"    column="user_type"    />
-        <result property="userId"    column="user_id"    />
-        <result property="userName"    column="user_name"    />
-        <result property="userTelephone"    column="user_telephone"    />
-        <result property="deptId"    column="dept_id"    />
-        <result property="deptName"    column="dept_name"    />
-        <result property="createTime"    column="create_time"    />
+        <result property="id" column="id"/>
+        <result property="uuid" column="uuid"/>
+        <result property="userName" column="user_number"/>
+        <result property="flowType" column="flow_type"/>
+        <result property="userType" column="user_type"/>
+        <result property="userId" column="user_id"/>
+        <result property="userName" column="user_name"/>
+        <result property="userTelephone" column="user_telephone"/>
+        <result property="deptId" column="dept_id"/>
+        <result property="deptName" column="dept_name"/>
+        <result property="createTime" column="create_time"/>
     </resultMap>
 
     <resultMap type="com.zd.airbottle.domain.vo.QpFlowDetailVO" id="QpFlowDetailResultVO">
     </resultMap>
 
     <sql id="selectQpFlowDetailVo">
-        select id, uuid,user_number,flow_type, user_type, user_id, user_name, user_telephone, dept_id, dept_name, create_time from qp_flow_detail
+        select id,
+               uuid,
+               user_number,
+               flow_type,
+               user_type,
+               user_id,
+               user_name,
+               user_telephone,
+               dept_id,
+               dept_name,
+               create_time
+        from qp_flow_detail
     </sql>
     <sql id="selectQpFlowDetailListVo">
-        select t.id, t.uuid, t.user_number,t.flow_type, t.user_type, t.user_id, t.user_name, t.user_telephone, t.dept_id,
-               t.dept_name, t.create_time from qp_flow_detail as t
+        select t.id,
+               t.uuid,
+               t.user_number,
+               t.flow_type,
+               t.user_type,
+               t.user_id,
+               t.user_name,
+               t.user_telephone,
+               t.dept_id,
+               t.dept_name,
+               t.create_time
+        from qp_flow_detail as t
+                 LEFT JOIN sys_dept d on t.dept_id = d.dept_id
+                 LEFT JOIN sys_user u on t.user_id = u.user_id
     </sql>
-    <select id="selectQpFlowDetailList" parameterType="com.zd.airbottle.domain.vo.QpFlowDetailVO" resultMap="QpFlowDetailResultVO">
+    <select id="selectQpFlowDetailList" parameterType="com.zd.airbottle.domain.vo.QpFlowDetailVO"
+            resultMap="QpFlowDetailResultVO">
         <include refid="selectQpFlowDetailListVo"/>
         <where>
             <if test="searchValue != null  and searchValue != ''">
-            and ( t.user_name like concat('%', #{searchValue}, '%')
-                or t.user_number  like concat('%', #{searchValue}, '%')
-                or t.user_telephone  like concat('%', #{searchValue}, '%')
-             )
+                and ( t.user_name like concat('%', #{searchValue}, '%')
+                or t.user_number like concat('%', #{searchValue}, '%')
+                or t.user_telephone like concat('%', #{searchValue}, '%')
+                )
             </if>
-            <if test="uuid != null  and uuid != ''"> and t.uuid = #{uuid}</if>
-            <if test="userNumber != null "> and t.user_number = #{userNumber}</if>
-            <if test="flowType != null "> and t.flow_type = #{flowType}</if>
-            <if test="userType != null "> and t.user_type = #{userType}</if>
-            <if test="userId != null "> and t.user_id = #{userId}</if>
-            <if test="flowType != null "> and t.flow_type = #{flowType}</if>
-            <if test="userName != null  and userName != ''"> and t.user_name like concat('%', #{userName}, '%')</if>
-            <if test="userTelephone != null  and userTelephone != ''"> and t.user_telephone = #{userTelephone}</if>
-            <if test="deptId != null "> and ( dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId} ,ancestors )) or dept_id = #{deptId} )</if>
+            <if test="uuid != null  and uuid != ''">and t.uuid = #{uuid}</if>
+            <if test="userNumber != null ">and t.user_number = #{userNumber}</if>
+            <if test="flowType != null ">and t.flow_type = #{flowType}</if>
+            <if test="userType != null ">and t.user_type = #{userType}</if>
+            <if test="userId != null ">and t.user_id = #{userId}</if>
+            <if test="flowType != null ">and t.flow_type = #{flowType}</if>
+            <if test="userName != null  and userName != ''">and t.user_name like concat('%', #{userName}, '%')</if>
+            <if test="userTelephone != null  and userTelephone != ''">and t.user_telephone = #{userTelephone}</if>
+            <if test="deptId != null ">and ( dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
+                ,ancestors )) or dept_id = #{deptId} )
+            </if>
+            <!-- 数据范围过滤 -->
+            ${params.dataScope}
         </where>
     </select>
 
@@ -64,7 +92,8 @@
         where id = #{id}
     </select>
 
-    <insert id="insertQpFlowDetail" parameterType="com.zd.airbottle.domain.QpFlowDetail" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertQpFlowDetail" parameterType="com.zd.airbottle.domain.QpFlowDetail" useGeneratedKeys="true"
+            keyProperty="id">
         insert into qp_flow_detail
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="uuid != null">uuid,</if>
@@ -119,7 +148,9 @@
     </update>
 
     <delete id="deleteQpFlowDetailById">
-        delete from qp_flow_detail where id = #{id}
+        delete
+        from qp_flow_detail
+        where id = #{id}
     </delete>
 
     <delete id="deleteQpFlowDetailByIds">
@@ -131,14 +162,18 @@
 
     <!-- 实验中心-资格审核权限查询 -->
     <select id="selectZgCenterByUserIdIs" resultMap="QpFlowDetailResult">
-        select fd.* from qp_flow_detail fd
-        where  fd.user_type=2 and user_id=#{userId} limit 1
+        select fd.*
+        from qp_flow_detail fd
+        where fd.user_type = 2
+          and user_id = #{userId} limit 1
     </select>
 
     <!-- 实验中心-用气审核查询 -->
     <select id="selectYqCenterByUserIdIs" resultMap="QpFlowDetailResult">
-        select fd.* from qp_flow_detail fd
-        where  fd.user_type=2 and user_id=#{userId} limit 1
+        select fd.*
+        from qp_flow_detail fd
+        where fd.user_type = 2
+          and user_id = #{userId} limit 1
     </select>
 
 </mapper>

+ 12 - 8
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpUsegasApplyMapper.xml

@@ -9,7 +9,7 @@
         <result property="location"    column="location"    />
         <result property="subjectId"    column="subject_id"    />
         <result property="applyUser"    column="apply_user"    />
-        <result property="applyUserid"    column="apply_userid"    />
+        <result property="userId"    column="user_id"    />
         <result property="deptId"    column="dept_id"    />
         <result property="deptName"    column="dept_name"    />
         <result property="phone"    column="phone"    />
@@ -34,7 +34,7 @@
     </resultMap>
 
     <sql id="selectQpUsegasApplyVo">
-        select id, location, subject_id, apply_user, apply_userid, dept_id, dept_name,
+        select id, location, subject_id, apply_user, user_id, dept_id, dept_name,
                phone, start_time, end_time, gas_use, apply_certificate, safety_precautions,
                use_gas_id,use_gas_name, lead_audit_staus, lead_audit_userid, lead_audit_username,
                lead_audit_time, lead_audit_cause, center_audit_status, center_audit_userid,
@@ -42,7 +42,7 @@
         from qp_usegas_apply
     </sql>
     <sql id="selectQpUsegasApplyListVo">
-        select t.id, t.location, t.subject_id, t.apply_user, t.apply_userid, t.dept_id,
+        select t.id, t.location, t.subject_id, t.apply_user, t.user_id, t.dept_id,
                t.dept_name, t.phone, t.start_time, t.end_time, t.gas_use, t.apply_certificate,
                t.safety_precautions, t.use_gas_id,t.use_gas_name, t.lead_audit_staus,
                t.lead_audit_userid, t.lead_audit_username, t.lead_audit_time, t.lead_audit_cause,
@@ -51,6 +51,8 @@
                (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and  s.id=t.subject_id) room,
                ( select admin_id from lab_subject  su where  su.id=t.subject_id ) admin_id
         from qp_usegas_apply as t
+                 LEFT JOIN   sys_dept d on   t.dept_id=d.dept_id
+                 LEFT JOIN sys_user u on  t.user_id=u.user_id
     </sql>
     <select id="selectQpUsegasApplyList" parameterType="com.zd.airbottle.domain.vo.QpUsegasApplyVO" resultMap="QpUsegasApplyResult">
         <include refid="selectQpUsegasApplyListVo"/>
@@ -64,7 +66,7 @@
             <if test="location != null  and location != ''"> and t.location = #{location}</if>
             <if test="subjectId != null "> and t.subject_id = #{subjectId}</if>
             <if test="applyUser != null  and applyUser != ''"> and t.apply_user = #{applyUser}</if>
-            <if test="applyUserid != null "> and t.apply_userid = #{applyUserid}</if>
+            <if test="userId != null "> and t.user_id = #{userId}</if>
             <if test="deptId != null "> and t.dept_id = #{deptId}</if>
             <if test="deptName != null  and deptName != ''"> and t.dept_name like concat('%', #{deptName}, '%')</if>
             <if test="phone != null  and phone != ''"> and t.phone = #{phone}</if>
@@ -88,6 +90,8 @@
             <if test="auditStatus !=null and  auditStatus == 0 "> and (t.lead_audit_staus=0 or t.center_audit_status=0 ) and t.lead_audit_staus !=2</if> /**待审核**/
             <if test="auditStatus !=null and  auditStatus == 1 "> and t.center_audit_status=1 </if> /**通过**/
             <if test="auditStatus !=null and  auditStatus == 2 "> and (t.lead_audit_staus=2 or t.center_audit_status=2) </if> /**驳回**/
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
         order by
         <if test="remark != '100' "> t.create_time </if>
         <if test="remark == '100' "> t.lead_audit_time </if>
@@ -108,7 +112,7 @@
 
             <if test="applyUser != null">apply_user,</if>
 
-            <if test="applyUserid != null">apply_userid,</if>
+            <if test="userId != null">user_id,</if>
 
             <if test="deptId != null">dept_id,</if>
 
@@ -157,7 +161,7 @@
             <if test="location != null">#{location},</if>
             <if test="subjectId != null">#{subjectId},</if>
             <if test="applyUser != null">#{applyUser},</if>
-            <if test="applyUserid != null">#{applyUserid},</if>
+            <if test="userId != null">#{userId},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="deptName != null">#{deptName},</if>
             <if test="phone != null">#{phone},</if>
@@ -188,7 +192,7 @@
             <if test="location != null">location = #{location},</if>
             <if test="subjectId != null">subject_id = #{subjectId},</if>
             <if test="applyUser != null">apply_user = #{applyUser},</if>
-            <if test="applyUserid != null">apply_userid = #{applyUserid},</if>
+            <if test="userId != null">user_id = #{userId},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="deptName != null">dept_name = #{deptName},</if>
             <if test="phone != null">phone = #{phone},</if>
@@ -232,7 +236,7 @@
             <if test="location != null">location = #{location},</if>
             <if test="subjectId != null">subject_id = #{subjectId},</if>
             <if test="applyUser != null">apply_user = #{applyUser},</if>
-            <if test="applyUserid != null">apply_userid = #{applyUserid},</if>
+            <if test="userId != null">user_id = #{userId},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="deptName != null">dept_name = #{deptName},</if>
             <if test="phone != null">phone = #{phone},</if>