update
This commit is contained in:
@@ -2,9 +2,10 @@ package org.jeecg.modules.database.constant;
|
|||||||
|
|
||||||
public interface ExperimentStatus {
|
public interface ExperimentStatus {
|
||||||
|
|
||||||
String STAGING = "暂存";
|
String STAGING = "暂存";
|
||||||
String PRE_TEST = "试验前";
|
String PRE_TEST = "试验前";
|
||||||
String PROGRESSING = "试验进行中";
|
String PROGRESSING = "试验进行中";
|
||||||
String REPORT_AUDITING = "报告审批中";
|
String REPORT_AUDITING = "报告审批中";
|
||||||
String COMPLETED = "试验完成";
|
String COMPLETED = "试验完成";
|
||||||
|
String REVIEWED = "已审核";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.jeecg.common.api.vo.Result;
|
|||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.jeecg.common.system.util.JwtUtil;
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.common.util.ReflectHelper;
|
||||||
import org.jeecg.modules.database.constant.ExperimentStatus;
|
import org.jeecg.modules.database.constant.ExperimentStatus;
|
||||||
import org.jeecg.modules.database.dto.NasaDataRecordPage;
|
import org.jeecg.modules.database.dto.NasaDataRecordPage;
|
||||||
import org.jeecg.modules.database.entity.*;
|
import org.jeecg.modules.database.entity.*;
|
||||||
@@ -88,13 +89,23 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
|||||||
// 自定义duoXuan字段的查询规则为:LIKE_WITH_OR
|
// 自定义duoXuan字段的查询规则为:LIKE_WITH_OR
|
||||||
//customeRuleMap.put("startDate", QueryRuleEnum.RIGHT_LIKE);
|
//customeRuleMap.put("startDate", QueryRuleEnum.RIGHT_LIKE);
|
||||||
//
|
//
|
||||||
//Map<String, String[]> parameterMap = req.getParameterMap();
|
Map<String, String[]> parameterMap = req.getParameterMap();
|
||||||
//QueryWrapper<Experiment> queryWrapper = QueryGenerator.initQueryWrapper(experiment, parameterMap, customeRuleMap);
|
//QueryWrapper<Experiment> queryWrapper = QueryGenerator.initQueryWrapper(experiment, parameterMap, customeRuleMap);
|
||||||
Page<Experiment> page = new Page<>(pageNo, pageSize);
|
Page<Experiment> page = new Page<>(pageNo, pageSize);
|
||||||
//if (!parameterMap.containsKey("column") || StringUtils.isBlank(parameterMap.get("column")[0])) {
|
|
||||||
// page.addOrder(OrderItem.asc("index_no"));
|
String username = JwtUtil.getUserNameByToken(req);
|
||||||
//}
|
SysUser currentUser = userService.getUserByName(username);
|
||||||
IPage<Experiment> pageList = experimentService.join(page, experiment, null);
|
if (parameterMap.containsKey("column") && StringUtils.isNotBlank(parameterMap.get("column")[0])) {
|
||||||
|
String columnObj = parameterMap.get("column")[0];
|
||||||
|
String column = ReflectHelper.getTableFieldName(experiment.getClass(), columnObj);
|
||||||
|
String order = parameterMap.get("order")[0];
|
||||||
|
String orderSql = "e." + column + " " + order;
|
||||||
|
currentUser.setPostText(orderSql);
|
||||||
|
} else {
|
||||||
|
currentUser.setPostText("e.index_no asc");
|
||||||
|
}
|
||||||
|
|
||||||
|
IPage<Experiment> pageList = experimentService.join(page, experiment, currentUser);
|
||||||
pageList.getRecords().forEach(v -> experimentService.fetchExperimentDetail(v));
|
pageList.getRecords().forEach(v -> experimentService.fetchExperimentDetail(v));
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
@@ -368,4 +379,18 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
|||||||
return Result.OK(result);
|
return Result.OK(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核
|
||||||
|
*
|
||||||
|
* @param experiment
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/audit")
|
||||||
|
public Result<String> queryPageList(Experiment experiment) {
|
||||||
|
if (Objects.isNull(experiment) || StringUtils.isBlank(experiment.getId())) {
|
||||||
|
return Result.OK("请选择试验");
|
||||||
|
}
|
||||||
|
return Result.OK("审核完成");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.jeecg.modules.database.entity.Experiment;
|
import org.jeecg.modules.database.entity.Experiment;
|
||||||
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 试验管理
|
* @Description: 试验管理
|
||||||
@@ -14,7 +15,7 @@ import org.jeecg.modules.database.entity.Experiment;
|
|||||||
*/
|
*/
|
||||||
public interface ExperimentMapper extends BaseMapper<Experiment> {
|
public interface ExperimentMapper extends BaseMapper<Experiment> {
|
||||||
|
|
||||||
IPage<Experiment> join(Page<Experiment> page, Experiment experiment);
|
IPage<Experiment> join(Page<Experiment> page, Experiment experiment, SysUser loginUser);
|
||||||
|
|
||||||
@Select("SELECT SUM(total_count_lhs) FROM experiment where total_count_lhs is not null")
|
@Select("SELECT SUM(total_count_lhs) FROM experiment where total_count_lhs is not null")
|
||||||
Long sumLhs();
|
Long sumLhs();
|
||||||
|
|||||||
@@ -4,11 +4,15 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="join" resultType="org.jeecg.modules.database.entity.Experiment">
|
<select id="join" resultType="org.jeecg.modules.database.entity.Experiment">
|
||||||
select *
|
select DISTINCT e.*
|
||||||
from experiment e
|
from experiment e
|
||||||
LEFT JOIN experiment_sample_info s ON s.experiment_id = e.id
|
LEFT JOIN experiment_sample_info s ON s.experiment_id = e.id
|
||||||
left join experiment_deviation_equipment d on d.experiment_id = e.id
|
left join experiment_deviation_equipment d on d.experiment_id = e.id
|
||||||
|
left join experiment_report r on r.experiment_id = e.id
|
||||||
<where>
|
<where>
|
||||||
|
( e.supervisor=#{loginUser.id} or e.create_by=#{loginUser.username}
|
||||||
|
or r.auditor=#{loginUser.id} or r.proofreader=#{loginUser.id}
|
||||||
|
or r.confirmer=#{loginUser.id} )
|
||||||
<if test="experiment.sampleType != null and experiment.sampleType != ''">
|
<if test="experiment.sampleType != null and experiment.sampleType != ''">
|
||||||
and s.sample_type like concat('%', #{experiment.sampleType}, '%')
|
and s.sample_type like concat('%', #{experiment.sampleType}, '%')
|
||||||
</if>
|
</if>
|
||||||
@@ -25,6 +29,8 @@
|
|||||||
and d.equipment_model like concat('%', #{experiment.equipmentModel}, '%')
|
and d.equipment_model like concat('%', #{experiment.equipmentModel}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
<if test="loginUser.postText != null and loginUser.postText != ''">
|
||||||
|
order by #{loginUser.postText}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
package org.jeecg.modules.database.service;
|
package org.jeecg.modules.database.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.jeecg.modules.database.entity.Experiment;
|
import org.jeecg.modules.database.entity.Experiment;
|
||||||
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 试验管理
|
* @Description: 试验管理
|
||||||
@@ -24,7 +24,7 @@ public interface IExperimentService extends IService<Experiment> {
|
|||||||
|
|
||||||
Integer getLastIndex();
|
Integer getLastIndex();
|
||||||
|
|
||||||
IPage<Experiment> join(Page<Experiment> page, Experiment experiment, QueryWrapper<Experiment> queryWrapper);
|
IPage<Experiment> join(Page<Experiment> page, Experiment experiment, SysUser loginUser);
|
||||||
|
|
||||||
Long sumLhs();
|
Long sumLhs();
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -274,8 +273,8 @@ public class ExperimentServiceImpl extends ServiceImpl<ExperimentMapper, Experim
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<Experiment> join(Page<Experiment> page, Experiment experiment, QueryWrapper<Experiment> queryWrapper) {
|
public IPage<Experiment> join(Page<Experiment> page, Experiment experiment, SysUser loginUser) {
|
||||||
return baseMapper.join(page, experiment);
|
return baseMapper.join(page, experiment,loginUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user