Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5eaa25a14d
|
|
@ -0,0 +1,45 @@
|
|||
package com.bonus.aqgqj.basis.controller;
|
||||
|
||||
import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
||||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.basis.service.ExamineService;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ExamineController
|
||||
* @author:cwchen
|
||||
* @date:2024-07-23-9:47
|
||||
* @version:1.0
|
||||
* @description:审查-controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/examine/")
|
||||
@Slf4j
|
||||
public class ExamineController {
|
||||
|
||||
@Resource(name = "ExamineService")
|
||||
private ExamineService service;
|
||||
|
||||
@PostMapping(value = "getList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "审查管理", operation = "查询列表", operDesc = "系统级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:examine:query')" )
|
||||
public ServerResponse getList(EncryptedReq<ParamsDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
List<ExperimentalVo> list = service.getList(data.getData());
|
||||
PageInfo<ExperimentalVo> pageInfo = new PageInfo<>(list);
|
||||
return ServerResponse.createSuccessPage(pageInfo, data.getData().getPage(), data.getData().getLimit());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.bonus.aqgqj.basis.dao;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ExamineMapper
|
||||
* @author:cwchen
|
||||
* @date:2024-07-23-9:48
|
||||
* @version:1.0
|
||||
* @description:审查-mapper
|
||||
*/
|
||||
@Repository(value = "ExamineMapper")
|
||||
public interface ExamineMapper {
|
||||
/**
|
||||
* 试验审查列表
|
||||
* @param dto
|
||||
* @return List<ExperimentalVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/23 10:15
|
||||
*/
|
||||
List<ExperimentalVo> getList(ParamsDto dto);
|
||||
}
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
package com.bonus.aqgqj.basis.entity.dto;
|
||||
|
||||
import com.bonus.aqgqj.base.entity.PageEntity;
|
||||
import com.bonus.aqgqj.utils.UserUtil;
|
||||
import lombok.Data;
|
||||
import org.apache.catalina.User;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @className:ParamsDto
|
||||
|
|
@ -42,4 +45,28 @@ public class ParamsDto extends PageEntity {
|
|||
*/
|
||||
private Long[] ids;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 角色编码
|
||||
*/
|
||||
private String roleCode = UserUtil.getLoginUser() !=null && StringUtils.isNotBlank(UserUtil.getLoginUser().getRoleCode()) ? UserUtil.getLoginUser().getRoleCode() : null;
|
||||
/**
|
||||
* 班组ID
|
||||
*/
|
||||
private String teamId = UserUtil.getLoginUser() !=null && StringUtils.isNotBlank(UserUtil.getLoginUser().getTeamId()) ? UserUtil.getLoginUser().getTeamId() : "-1";
|
||||
|
||||
/**
|
||||
* 是否是班组长
|
||||
*/
|
||||
private String isTeamLeader = UserUtil.getLoginUser() !=null && StringUtils.isNotBlank(UserUtil.getLoginUser().getIsTeamLeader()) ? UserUtil.getLoginUser().getIsTeamLeader() : "0";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class ExperConfigVo {
|
|||
* 创建人
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Long createUser = UserUtil.getLoginUser().getId();
|
||||
private Long createUser = UserUtil.getLoginUser() !=null ? UserUtil.getLoginUser().getId() : -1;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
|
@ -71,7 +71,7 @@ public class ExperConfigVo {
|
|||
* 修改人
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Long updateUser = UserUtil.getLoginUser().getId();
|
||||
private Long updateUser = UserUtil.getLoginUser() !=null ? UserUtil.getLoginUser().getId() : -1;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public class TestVo {
|
|||
* 创建人
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Long createUser = UserUtil.getLoginUser().getId();
|
||||
private Long createUser = UserUtil.getLoginUser() !=null ? UserUtil.getLoginUser().getId() : -1;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
|
@ -134,7 +134,7 @@ public class TestVo {
|
|||
* 修改人
|
||||
*/
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
private Long updateUser = UserUtil.getLoginUser().getId();
|
||||
private Long updateUser = UserUtil.getLoginUser() !=null ? UserUtil.getLoginUser().getId() : -1;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.aqgqj.basis.service;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ExamineService
|
||||
* @author:cwchen
|
||||
* @date:2024-07-23-9:47
|
||||
* @version:1.0
|
||||
* @description:审查-service
|
||||
*/
|
||||
public interface ExamineService {
|
||||
/**
|
||||
* 试验审查列表
|
||||
* @param data
|
||||
* @return List<ExperimentalVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/23 10:14
|
||||
*/
|
||||
List<ExperimentalVo> getList(ParamsDto data);
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.aqgqj.basis.service.impl;
|
||||
|
||||
import com.bonus.aqgqj.basis.dao.ExamineMapper;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.basis.service.ExamineService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ExamineServiceImpl
|
||||
* @author:cwchen
|
||||
* @date:2024-07-23-9:47
|
||||
* @version:1.0
|
||||
* @description:审查-impl
|
||||
*/
|
||||
@Service(value = "ExamineService")
|
||||
@Slf4j
|
||||
public class ExamineServiceImpl implements ExamineService {
|
||||
|
||||
@Resource(name = "ExamineMapper")
|
||||
private ExamineMapper mapper;
|
||||
|
||||
@Override
|
||||
public List<ExperimentalVo> getList(ParamsDto dto) {
|
||||
List<ExperimentalVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getList(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
@ -360,4 +360,5 @@ public class ExperimentStandardServiceImpl implements ExperimentStandardService
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.bonus.aqgqj.basis.entity.vo.*;
|
|||
import com.bonus.aqgqj.basis.service.ExperimentalService;
|
||||
import com.bonus.aqgqj.utils.DateTimeHelper;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.bonus.aqgqj.utils.SystemUtils;
|
||||
import com.bonus.aqgqj.webResult.Constants;
|
||||
import com.bonus.aqgqj.webResult.HttpStatus;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -124,6 +125,9 @@ public class ExperimentalServiceImpl implements ExperimentalService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public ServerResponse addTestData(TestVo vo) {
|
||||
try {
|
||||
if(!SystemUtils.isExperimentalTeam()){
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "非试验班组,无法添加试验数据");
|
||||
}
|
||||
// 整体数据校验数据
|
||||
String validResult = validatorsUtils.valid(vo, TestVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
|
|
@ -194,6 +198,9 @@ public class ExperimentalServiceImpl implements ExperimentalService {
|
|||
if(vo.getId() == null){
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "参数不完整");
|
||||
}
|
||||
if(!SystemUtils.isExperimentalTeam()){
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "非试验班组,无法修改试验数据");
|
||||
}
|
||||
// 处于审核流程中的数据无法进行修改
|
||||
int isCheck = mapper.isCheck(vo.getId());
|
||||
if(isCheck > 0){
|
||||
|
|
@ -323,6 +330,9 @@ public class ExperimentalServiceImpl implements ExperimentalService {
|
|||
if(dto.getIds() == null || dto.getIds().length == 0){
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR,"未提交审查数据");
|
||||
}
|
||||
if(!SystemUtils.isExperimentalTeam()){
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "非试验班组,无法提交审查数据");
|
||||
}
|
||||
// 判断提交数据中是否存在流程数据或者存在待试验项
|
||||
List<Long> list = Arrays.asList(dto.getIds());
|
||||
int result = mapper.isNotEditData(list);
|
||||
|
|
|
|||
|
|
@ -115,6 +115,8 @@ public class SysUser extends PageEntity {
|
|||
private String roleCode;
|
||||
/**班组ID*/
|
||||
private String teamId;
|
||||
/**是否是班组长*/
|
||||
private String isTeamLeader;
|
||||
|
||||
|
||||
public interface Status {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
package com.bonus.aqgqj.utils;
|
||||
|
||||
import com.bonus.aqgqj.webResult.Constants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class SystemUtils {
|
||||
|
|
@ -63,9 +67,51 @@ public class SystemUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是试验班组-试验人员
|
||||
* @return Boolean
|
||||
* @author cwchen
|
||||
* @date 2024/7/23 9:30
|
||||
*/
|
||||
public static Boolean isExperimentalTeam(){
|
||||
if(UserUtil.getLoginUser() == null){
|
||||
return false;
|
||||
}
|
||||
String roleCode = StringUtils.isNotBlank(UserUtil.getLoginUser().getRoleCode()) ? UserUtil.getLoginUser().getRoleCode() : null;
|
||||
String teamId = StringUtils.isNotBlank(UserUtil.getLoginUser().getTeamId()) ? UserUtil.getLoginUser().getTeamId() : "-1";
|
||||
String isTeamLeader = StringUtils.isNotBlank(UserUtil.getLoginUser().getIsTeamLeader()) ? UserUtil.getLoginUser().getIsTeamLeader() : "0";
|
||||
if(Objects.equals(Constants.EXPERIMENTALTEAM,roleCode)
|
||||
&& !Objects.equals(Constants.VALUE_DATA,teamId)
|
||||
&& Objects.equals(isTeamLeader,Constants.VALUE_DATA2)){
|
||||
return true;
|
||||
}else if(Objects.equals(Constants.ADMIDMINISTRATORS,roleCode) ){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 是否是试验班组-班组长
|
||||
* @return Boolean
|
||||
* @author cwchen
|
||||
* @date 2024/7/23 9:30
|
||||
*/
|
||||
public static Boolean isExperimentalTeamLeader(){
|
||||
if(UserUtil.getLoginUser() == null){
|
||||
return false;
|
||||
}
|
||||
String roleCode = StringUtils.isNotBlank(UserUtil.getLoginUser().getRoleCode()) ? UserUtil.getLoginUser().getRoleCode() : null;
|
||||
String teamId = StringUtils.isNotBlank(UserUtil.getLoginUser().getTeamId()) ? UserUtil.getLoginUser().getTeamId() : "-1";
|
||||
String isTeamLeader = StringUtils.isNotBlank(UserUtil.getLoginUser().getIsTeamLeader()) ? UserUtil.getLoginUser().getIsTeamLeader() : "0";
|
||||
if(Objects.equals(Constants.EXPERIMENTALTEAM,roleCode)
|
||||
&& !Objects.equals(Constants.VALUE_DATA,teamId)
|
||||
&& Objects.equals(isTeamLeader,Constants.VALUE_DATA3)){
|
||||
return true;
|
||||
}else if(Objects.equals(Constants.ADMIDMINISTRATORS,roleCode) ){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,5 +144,20 @@ public class Constants
|
|||
public static final String ERROR_RESULT2 = "不通过";
|
||||
public static final String SUCCESS_RESULT = "合格";
|
||||
|
||||
/**管理员*/
|
||||
public static final String ADMIDMINISTRATORS = "administrators";
|
||||
/**技术负责人*/
|
||||
public static final String TECHNICALDIRECTOR = "technicalDirector";
|
||||
/**中心负责人*/
|
||||
public static final String CENTERTRALMANAGER = "centerManager";
|
||||
/**试验班组*/
|
||||
public static final String EXPERIMENTALTEAM = "experimentalTeam";
|
||||
/**综合班组*/
|
||||
public static final String INTEGRATEDTEAM = "integratedTeam";
|
||||
|
||||
public static final String VALUE_DATA = "-1";
|
||||
public static final String VALUE_DATA2 = "0";
|
||||
public static final String VALUE_DATA3 = "1";
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,95 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.aqgqj.basis.dao.ExamineMapper">
|
||||
|
||||
<!--试验审查列表-->
|
||||
<select id="getList" resultType="com.bonus.aqgqj.basis.entity.vo.ExperimentalVo">
|
||||
SELECT ts.id,
|
||||
tc.custom_name AS customName,
|
||||
DATE_FORMAT(ts.sample_time, '%Y-%m-%d') AS sampleTime,
|
||||
IFNULL(tsd.num,0) AS customNum,
|
||||
tsd.sampleDev,
|
||||
su.user_name AS sampleUserName,
|
||||
su2.user_name AS dispatchUserName,
|
||||
DATE_FORMAT(ts.sample_date, '%Y-%m-%d') AS sampleDate,
|
||||
tt.team_name AS teamName,
|
||||
<if test="roleCode == 'experimentalTeam'">
|
||||
WHEN process_status = 1 AND audti_status = 0 THEN '待审阅'
|
||||
END AS audtiStatus,
|
||||
</if>
|
||||
<if test="roleCode == 'technicalDirector'">
|
||||
WHEN process_status = 2 AND audti_status = 0 THEN '待审核'
|
||||
END AS audtiStatus,
|
||||
</if>
|
||||
<if test="roleCode=='centerManager'">
|
||||
WHEN process_status = 3 AND audti_status = 0 THEN '待审批'
|
||||
END AS audtiStatus,
|
||||
</if>
|
||||
<if test="roleCode == 'administrators'">
|
||||
CASE WHEN process_status = 1 AND audti_status = 0 THEN '待审阅'
|
||||
WHEN process_status = 2 AND audti_status = 0 THEN '待审核'
|
||||
WHEN process_status = 3 AND audti_status = 0 THEN '待审批'
|
||||
END AS audtiStatus,
|
||||
</if>
|
||||
ts.remarks
|
||||
FROM tb_sample ts
|
||||
LEFT JOIN tb_custom tc ON ts.custom_id = tc.id
|
||||
LEFT JOIN sys_user su ON ts.create_user = su.id AND su.del_flag = 0
|
||||
LEFT JOIN sys_user su2 ON ts.update_user = su2.id AND su2.del_flag = 0
|
||||
LEFT JOIN tb_team tt ON ts.team_id = tt.id AND tt.del_flag = 0
|
||||
LEFT JOIN (
|
||||
SELECT sample_id,COUNT(sample_id) AS num,ANY_VALUE(GROUP_CONCAT(DISTINCT dev_type_name)) AS sampleDev,ANY_VALUE(GROUP_CONCAT(DISTINCT dev_type_code)) AS sampleDevCode
|
||||
FROM tb_sample_device
|
||||
WHERE del_falg = 0
|
||||
GROUP BY sample_id
|
||||
) tsd ON tsd.sample_id = ts.id
|
||||
WHERE ts.del_flag = 0
|
||||
<if test="keyWord != null and keyWord!=''">
|
||||
AND (
|
||||
INSTR(tt.team_name,#{keyWord}) > 0 OR
|
||||
INSTR(su2.user_name,#{keyWord}) > 0
|
||||
)
|
||||
</if>
|
||||
<if test="sampleUserName != null and sampleUserName!=''">
|
||||
AND INSTR(su.user_name,#{sampleUserName}) > 0
|
||||
</if>
|
||||
<if test="startTime != null and endTime!=''">
|
||||
AND DATE_FORMAT(ts.sample_date, '%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
<if test="devTypeCode != null and devTypeCode!=''">
|
||||
AND INSTR(tsd.sampleDevCode,#{devTypeCode})
|
||||
</if>
|
||||
/*管理员、技术负责人、中心负责人查询全部数据*/
|
||||
<if test="roleCode != 'administrators' and roleCode != 'technicalDirector' and roleCode != 'centerManager' and roleCode == 'experimentalTeam'">
|
||||
/*试验班组-班组长审阅-只审阅本班组提交的审阅*/
|
||||
<if test="teamId != '-1' and isTeamLeader == '1'">
|
||||
AND ts.team_id = #{teamId}
|
||||
</if>
|
||||
<if test="and teamId != '-1' and isTeamLeader == '0'">
|
||||
AND ts.team_id = -1
|
||||
</if>
|
||||
</if>
|
||||
/*非管理员、非技术负责人、非中心负责人无审查数据权限*/
|
||||
<if test="roleCode != 'administrators' and roleCode != 'technicalDirector' and roleCode != 'centerManager' and roleCode != 'experimentalTeam'">
|
||||
AND ts.team_id = -1
|
||||
</if>
|
||||
/*班组长-审阅*/
|
||||
<if test="roleCode == 'experimentalTeam'">
|
||||
AND process_status = 1 AND audti_status = 0
|
||||
</if>
|
||||
/*技术负责人-审核*/
|
||||
<if test="roleCode == 'technicalDirector'">
|
||||
AND process_status = 2 AND audti_status = 0
|
||||
</if>
|
||||
/*中心负责人-审批*/
|
||||
<if test="roleCode=='centerManager'">
|
||||
AND process_status = 3 AND audti_status = 0
|
||||
</if>
|
||||
/*管理员*/
|
||||
<if test="roleCode=='administrators'">
|
||||
AND process_status IN (1,2,3) AND audti_status = 0
|
||||
</if>
|
||||
ORDER BY FIELD(audtiStatus, '待审阅','待审核','待审批') ASC,dispatch_time ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -262,7 +262,7 @@
|
|||
WHEN process_status = 2 AND audti_status = 2 THEN '审核不通过'
|
||||
WHEN process_status = 3 AND audti_status = 0 THEN '待审批'
|
||||
WHEN process_status = 3 AND audti_status = 2 THEN '审批不通过'
|
||||
WHEN process_status = 4 AND audti_status = 1 THEN '试验结束'
|
||||
WHEN process_status = 4 AND audti_status = 1 THEN '试验完成'
|
||||
ELSE '待试验'
|
||||
END AS audtiStatus,
|
||||
ts.remarks
|
||||
|
|
@ -293,6 +293,14 @@
|
|||
<if test="devTypeCode != null and devTypeCode!=''">
|
||||
AND INSTR(tsd.sampleDevCode,#{devTypeCode})
|
||||
</if>
|
||||
<if test="roleCode != 'administrators'">
|
||||
<if test="roleCode == 'experimentalTeam' and teamId != '-1' and isTeamLeader == '0'">
|
||||
AND ts.team_id = #{teamId}
|
||||
</if>
|
||||
<if test="(roleCode != 'experimentalTeam') or (roleCode == 'experimentalTeam' and teamId != '-1' and isTeamLeader == '1')">
|
||||
AND ts.team_id = -1
|
||||
</if>
|
||||
</if>
|
||||
ORDER BY FIELD(audtiStatus, '审阅不通过','审核不通过','审批不通过','待试验','待提交','待审阅','待审核','待审批','试验结束') ASC,dispatch_time ASC
|
||||
</select>
|
||||
<!--试验详情列表-->
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
<select id="getUser" parameterType="String" resultType="com.bonus.aqgqj.model.SysUser">
|
||||
select t.id,t.user_name as username,t.login_name as loginName,
|
||||
t.password,t.state,t.role_id as roleId,t.login_type loginType,t.new_user newUser,
|
||||
sr.role_code AS roleCode,sr.role_name AS roleName,t.team_id AS teamId
|
||||
sr.role_code AS roleCode,sr.role_name AS roleName,t.team_id AS teamId,t.is_team_leader AS isTeamLeader
|
||||
from sys_user t
|
||||
LEFT JOIN sys_role sr ON t.role_id = sr.role_id AND sr.del_flag = 0
|
||||
where t.login_name = #{username}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,205 @@
|
|||
let form, layer, table, tableIns,laydate;
|
||||
let pageNum = 1, limitSize = 10; // 默认第一页,分页数量为10
|
||||
let deviceTypeList = [];
|
||||
layui.use(['form', 'layer', 'table','laydate'], function () {
|
||||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
table = layui.table;
|
||||
laydate = layui.laydate;
|
||||
layui.form.render();
|
||||
deviceTypeList = getDictsSelect("dev_code");
|
||||
setDictSelectValue(deviceTypeList,'devTypeCode');
|
||||
laydate.render({
|
||||
elem: '#ID-laydate-rangeLinked',
|
||||
range: ['#startTime', '#endTime'],
|
||||
rangeLinked: true // 开启日期范围选择时的区间联动标注模式 --- 2.8+ 新增
|
||||
});
|
||||
pages(1, 10, 1);
|
||||
})
|
||||
|
||||
function pages(pageNum, pageSize, typeNum) {
|
||||
let params = getReqParams(pageNum, pageSize, typeNum);
|
||||
$.ajax({
|
||||
url: dataUrl + "/examine/getList",
|
||||
headers: {
|
||||
"token": tokens
|
||||
},
|
||||
data: params,
|
||||
type: 'POST',
|
||||
async: false,
|
||||
success: function (result) {
|
||||
console.log(result);
|
||||
if (result.code === 200) {
|
||||
if (result.data) {
|
||||
initTable(result.data, result.limit, result.curr)
|
||||
laypages(result.count, result.curr, result.limit)
|
||||
}
|
||||
} else if (result.code === 500) {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, error: function (xhr) {
|
||||
error(xhr);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function laypages(total, page, limit) {
|
||||
layui.use(['laypage'], function () {
|
||||
let laypage = layui.laypage;
|
||||
laypage.render({
|
||||
elem: 'voi-page',
|
||||
count: total,
|
||||
curr: page,
|
||||
limit: limit,
|
||||
limits: [10, 20, 50, 100, 200, 500],
|
||||
layout: ['prev', 'page', 'next', 'skip', 'count', 'limit'],
|
||||
groups: 5,
|
||||
jump: function (obj, first) {
|
||||
if (!first) {
|
||||
pageNum = obj.curr, limitSize = obj.limit;
|
||||
pages(obj.curr, obj.limit, null);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/*初始化表格*/
|
||||
function initTable(dataList, limit, page) {
|
||||
let loadingMsg = layer.msg("数据加载中,请稍候...", {icon: 16, scrollbar: false, time: 0,});
|
||||
tableIns = table.render({
|
||||
elem: "#table_data",
|
||||
height: "full-140",
|
||||
data: dataList,
|
||||
limit: limit,
|
||||
cols: [
|
||||
[
|
||||
//表头
|
||||
{
|
||||
title: "序号", width: 80, unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
return (page - 1) * limit + d.LAY_NUM;
|
||||
}
|
||||
},
|
||||
{field: "customName", title: "送样单位", unresize: true, align: "center"},
|
||||
{field: "sampleTime", title: "送样时间", unresize: true, align: "center"},
|
||||
{field: "sampleDev", title: "送样设备", unresize: true, align: "center"},
|
||||
{field: "customNum", title: "送样数量", unresize: true, align: "center"},
|
||||
{field: "sampleUserName", title: "收样人", unresize: true, align: "center"},
|
||||
{field: "sampleDate", title: "收样时间", unresize: true, align: "center"},
|
||||
{field: "teamName", title: "试验班组", unresize: true, align: "center"},
|
||||
{field: "audtiStatus", title: "状态", unresize: true, align: "center"},
|
||||
{
|
||||
title: "操作", unresize: true, width: 180, align: "center",
|
||||
templet: function (d) {
|
||||
let html = '';
|
||||
html += "<a class='layui-icon layui-icon-edit' title='编辑' onclick=\"addData('" + d.id + "')\"></a>" +
|
||||
"<a class='layui-icon layui-icon-delete' title='删除' onclick=\"delData('" + d.id + "')\"></a>";
|
||||
return html;
|
||||
}
|
||||
},
|
||||
],
|
||||
],
|
||||
done: function (res, curr, count) {
|
||||
layer.close(loadingMsg);
|
||||
table.resize("table_data");
|
||||
count || this.elem.next(".layui-table-view").find(".layui-table-header").css("display", "inline-block");
|
||||
count || this.elem.next(".layui-table-view").find(".layui-table-box").css("overflow", "auto");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 获取参数
|
||||
function getReqParams(page, limit, type) {
|
||||
let obj = {};
|
||||
if (!type) {
|
||||
obj = {
|
||||
page: page + "",
|
||||
limit: limit + "",
|
||||
keyWord: $('#keyWord').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val(),
|
||||
devTypeCode : $('#devTypeCode').val(),
|
||||
};
|
||||
} else {
|
||||
obj = {
|
||||
page: '1',
|
||||
limit: '10',
|
||||
keyWord: '',
|
||||
accessType: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
devTypeCode : ''
|
||||
};
|
||||
}
|
||||
obj = {
|
||||
encryptedData: encryptCBC(JSON.stringify(obj))
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function query() {
|
||||
let pattern = new RegExp("[%_<>]");
|
||||
if (pattern.test($("#ip").val())) {
|
||||
$("#ip").val('');
|
||||
return layer.msg('ip查询包含特殊字符,请重新输入', {
|
||||
icon: 2,
|
||||
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
||||
});
|
||||
}
|
||||
pageNum = 1;
|
||||
pages(1, limitSize);
|
||||
}
|
||||
|
||||
function reloadData() {
|
||||
pages(pageNum, limitSize);
|
||||
}
|
||||
|
||||
// 新增/修改平台用户
|
||||
function addData(id) {
|
||||
let title = '新增白名单'
|
||||
if (id) {
|
||||
title = '修改白名单';
|
||||
}
|
||||
let param = {
|
||||
'id': id
|
||||
}
|
||||
openIframe2("addOrEditWhite", title, "child/whiteForm.html", '875px', '625px', param);
|
||||
}
|
||||
|
||||
function addPwdData(id) {
|
||||
let param = {
|
||||
'id': id
|
||||
}
|
||||
openIframe2("addOrEditWhite", '密码规则配置', "child/pwdRuleForm.html", '875px', '625px', param);
|
||||
}
|
||||
|
||||
/*删除白名单*/
|
||||
function delData(id) {
|
||||
layer.confirm("确定删除吗?", {
|
||||
move: false
|
||||
}, function () {
|
||||
let loadingMsg = layer.msg('数据删除中,请稍候...', {icon: 16, scrollbar: false, time: 0});
|
||||
let url = dataUrl + "/sys/white/delWhite"
|
||||
let obj = {'id': id}
|
||||
let params = {
|
||||
encryptedData: encryptCBC(JSON.stringify(obj))
|
||||
}
|
||||
ajaxRequest(url, "POST", params, true, function () {
|
||||
}, function (result) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
if (result.status === 200) {
|
||||
parent.layer.msg(result.msg, {icon: 1})
|
||||
query()
|
||||
} else if (result.status === 500) {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
layer.close(loadingMsg); // 关闭提示层
|
||||
error(xhr)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -214,3 +214,34 @@ function setFormSelects2(selName,list) {
|
|||
});
|
||||
layui.form.render();
|
||||
}
|
||||
|
||||
/**字典表下拉选*/
|
||||
function getDictsSelect(value) {
|
||||
let data = [];
|
||||
let url = dataUrl + "/sys/select/getDicts"
|
||||
let obj = {"code":value}
|
||||
let params = {
|
||||
encryptedData: encryptCBC(JSON.stringify(obj))
|
||||
}
|
||||
ajaxRequest(url, "POST", params, false, function () {
|
||||
}, function (result) {
|
||||
if (result.status === 200) {
|
||||
data = result.data;
|
||||
} else if (result.status === 500) {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
/**字典表下拉选赋值*/
|
||||
function setDictSelectValue(list, selectName) {
|
||||
let html = '<option value="" selected>请选择</option>';
|
||||
$.each(list, function (index, item) {
|
||||
html += '<option value="' + item.value + '">' + item.name + '</option>';
|
||||
})
|
||||
$('#' + selectName).empty().append(html);
|
||||
layui.form.render();
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../../js/layui-v2.9.14/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="../../css/table-common2.css">
|
||||
<script src="../../js/libs/jquery-2.1.1.min.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../js/layui-v2.9.14/layui/layui.js" charset="UTF-8" type="text/javascript"></script>
|
||||
<script src="../../js/publicJs.js"></script>
|
||||
<script src="../../js/commonUtils.js"></script>
|
||||
<script src="../../js/openIframe.js"></script>
|
||||
<script src="../../js/my/aes.js"></script>
|
||||
<script src="../../js/ajaxRequest.js"></script>
|
||||
<script src="../../js/select.js"></script>
|
||||
<title>试验数据-审查</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
<div class="basic-search-box layout">
|
||||
<form class="layui-form basic-form" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline" style="padding: 0 0 0 10px;">
|
||||
<div class="layui-input-inline">
|
||||
<select class="layui-select" id="devTypeCode">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-inline" id="ID-laydate-rangeLinked">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" readonly id="startTime" class="layui-input"
|
||||
placeholder="开始日期">
|
||||
</div>
|
||||
<div class="layui-form-mid">-</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" readonly id="endTime" class="layui-input"
|
||||
placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="keyWord" maxlength="30" class="layui-input" autocomplete="off"
|
||||
placeholder="请输入关键字">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline btns">
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm btn-1" onclick="query(1)">查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="table-box" table-responsive style="z-index: 1;">
|
||||
<table id="table_data" class="table" lay-filter="table_data"></table>
|
||||
<div id="voi-page" class="layout"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<style>
|
||||
.layui-table-init {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="../../js/basis/examine.js" charset="UTF-8" type="text/javascript"></script>
|
||||
</html>
|
||||
Loading…
Reference in New Issue