检测报告管理
This commit is contained in:
parent
db0ab9f8c6
commit
59f3375f9b
|
|
@ -1,9 +1,11 @@
|
|||
package com.bonus.aqgqj.basis.dao;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface TestReportManageDao {
|
||||
|
|
@ -95,4 +97,12 @@ public interface TestReportManageDao {
|
|||
* @return
|
||||
*/
|
||||
int updateReportCode(TestReportManageDto dto);
|
||||
|
||||
/**
|
||||
* 获取设备编号与结果
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@MapKey("devCode")
|
||||
List<Map<String, String>> getExperDevItems(TestReportManageDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package com.bonus.aqgqj.basis.entity.dto;
|
||||
|
||||
import com.bonus.aqgqj.base.entity.PageEntity;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工器具个体管理
|
||||
* @author hay
|
||||
|
|
@ -31,6 +34,11 @@ public class TestReportManageDto extends PageEntity {
|
|||
*/
|
||||
private String customName;
|
||||
|
||||
/**
|
||||
* 送样部门id
|
||||
*/
|
||||
private Integer departmentId;
|
||||
|
||||
/**
|
||||
* 送样部门
|
||||
*/
|
||||
|
|
@ -163,6 +171,6 @@ public class TestReportManageDto extends PageEntity {
|
|||
*/
|
||||
private String detectionTime;
|
||||
|
||||
|
||||
private List<ExperimentalDetailVo.Sample> sampleList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.aqgqj.basis.dao.TestReportManageDao;
|
||||
import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.service.SamplesManageService;
|
||||
import com.bonus.aqgqj.basis.service.TestReportManageService;
|
||||
import com.bonus.aqgqj.utils.DateTimeHelper;
|
||||
|
|
@ -15,7 +16,9 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 工器具个体管理
|
||||
|
|
@ -55,6 +58,13 @@ public class TestReportManageServiceImpl implements TestReportManageService {
|
|||
List<TestReportManageDto> list = testReportManageDao.getDetailsList(data);
|
||||
//如果没有报告编号,需要生成报告编号
|
||||
for (TestReportManageDto dto : list){
|
||||
//将每条数据下的设备编号,试验结果加进去
|
||||
List<ExperimentalDetailVo.Sample> sampleList = new ArrayList<>();
|
||||
List<Map<String, String>> mapList = testReportManageDao.getExperDevItems(dto);
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.addAll(mapList);
|
||||
sampleList = jsonArray.toJavaList(ExperimentalDetailVo.Sample.class);
|
||||
dto.setSampleList(sampleList);
|
||||
if (StringHelper.isEmpty(dto.getReportCode())){
|
||||
//生成报告编号
|
||||
String reportCode = generateReportCode(dto);
|
||||
|
|
|
|||
|
|
@ -148,10 +148,14 @@
|
|||
LIMIT 1
|
||||
</select>
|
||||
<select id="getTeamSelected" resultType="com.bonus.aqgqj.basis.entity.dto.SamplesManageDto">
|
||||
SELECT id,
|
||||
team_name AS name
|
||||
FROM tb_team
|
||||
WHERE del_flag = 0
|
||||
SELECT
|
||||
id,
|
||||
team_name AS NAME
|
||||
FROM
|
||||
tb_team
|
||||
WHERE
|
||||
del_flag = 0
|
||||
AND team_type_code =2
|
||||
</select>
|
||||
<select id="getDeptSelectedById" resultType="com.bonus.aqgqj.basis.entity.dto.SamplesManageDto">
|
||||
SELECT id,
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@
|
|||
SELECT
|
||||
te.id,
|
||||
tsd.dev_type_name as sampleTools,
|
||||
ted.department_id as departmentId,
|
||||
tc.custom_name as sampleDepartment,
|
||||
GROUP_CONCAT( DISTINCT tsd.dev_module SEPARATOR '、' ) as devModule,
|
||||
COUNT(ted.id) as devNum,
|
||||
|
|
@ -140,6 +141,10 @@
|
|||
)aa
|
||||
LEFT JOIN tb_certificate tc on tc.exper_id=aa.id and tc.dev_type=aa.sampleTools
|
||||
and tc.is_hg=aa.isHg and tc.department=aa.sampleDepartment
|
||||
where 1=1
|
||||
<if test="reportCode != null and reportCode != ''">
|
||||
and tc.`code` like concat('%', #{reportCode}, '%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="listTools" resultType="com.bonus.aqgqj.basis.entity.dto.TestReportManageDto">
|
||||
select
|
||||
|
|
@ -191,4 +196,18 @@
|
|||
WHERE SUBSTRING(`code`, 7, 7) = #{nowDate}
|
||||
ORDER BY SUBSTRING( `code`, 14, 3 ) DESC LIMIT 1
|
||||
</select>
|
||||
<select id="getExperDevItems" resultType="java.util.Map">
|
||||
SELECT ted.dev_code as devCode,
|
||||
case ted.is_hg
|
||||
WHEN '1' THEN '不合格'
|
||||
WHEN '0' THEN '合格'
|
||||
ELSE '不合格' END AS testResult
|
||||
FROM tb_exper_dev ted
|
||||
LEFT JOIN tb_exper te on te.id = ted.exper_id
|
||||
WHERE ted.exper_id = #{id}
|
||||
and ted.is_hg = #{isHg}
|
||||
and ted.department_id = #{departmentId}
|
||||
and te.dev_type_name = #{sampleTools}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
tsd.customer_code as customerCode,
|
||||
tsd.dev_module as devModule,
|
||||
tc.custom_name as customName,
|
||||
ts.department as sampleDepartment,
|
||||
tcs.custom_name as sampleDepartment,
|
||||
ted.manufacture_date as manufactureDate,
|
||||
te.exper_time as experTime,
|
||||
te.exper_conclu as experConclu,
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
tb_sample_device tsd
|
||||
LEFT JOIN tb_sample ts on ts.id=tsd.sample_id and ts.del_flag=0
|
||||
LEFT JOIN tb_custom tc on tc.id=ts.custom_id and tc.del_flag=0
|
||||
LEFT JOIN tb_custom tcs on tcs.id=tsd.department_id and tcs.del_flag=0
|
||||
LEFT JOIN tb_exper_dev ted on ted.dev_id=tsd.id
|
||||
LEFT JOIN tb_exper te on te.id=ted.exper_id and te.del_flag=0
|
||||
LEFT JOIN sys_user su on su.id=te.create_user and su.del_flag=0
|
||||
|
|
@ -35,7 +36,7 @@
|
|||
tsd.customer_code like concat('%', #{keyWord}, '%') OR
|
||||
tsd.dev_module like concat('%', #{keyWord}, '%') OR
|
||||
tc.custom_name like concat('%', #{keyWord}, '%') OR
|
||||
ts.department like concat('%', #{keyWord}, '%') OR
|
||||
tcs.custom_name like concat('%', #{keyWord}, '%') OR
|
||||
te.exper_conclu like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -91,14 +91,36 @@ function initTable(dataList, limit, page) {
|
|||
{field: "reportCode", title: "报告编号", unresize: true, align: "center"},
|
||||
{field: "sampleDepartment", title: "送样部门", unresize: true, align: "center"},
|
||||
{field: "devModule", title: "规格型号", unresize: true, align: "center"},
|
||||
{
|
||||
field: "devNum",
|
||||
title: "样品数量",
|
||||
width: 68,
|
||||
unresize: true,
|
||||
align: "center",
|
||||
{field: "", title: "样品数量", width: 68, unresize: true, align: "center",
|
||||
templet: function (d) {
|
||||
return `<span style="color: blue">${d.devNum}</span>`;
|
||||
var testResult="";
|
||||
var html = '';
|
||||
var sampleList = JSON.stringify(d.sampleList);
|
||||
console.log("d.sampleList",d.sampleList)
|
||||
console.log("sampleList",sampleList)
|
||||
if(d.sampleList.length>0){
|
||||
for (let i = 0; i < d.sampleList.length; i++) {
|
||||
if (d.sampleList[i].testResult == "合格") {
|
||||
|
||||
}else{
|
||||
testResult = d.sampleList[i].testResult
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(testResult=="不合格"){
|
||||
// 添加包裹元素并应用类
|
||||
html += "<span class='layui-show-details' onmouseover='getMouseover("+ sampleList +")' onmouseout='getMouseout()' style='color: #F39268; cursor: pointer'>" +
|
||||
d.devNum +
|
||||
"</span>";
|
||||
}else{
|
||||
// 添加包裹元素并应用类
|
||||
html += "<span class='layui-show-details' onmouseover='getMouseover("+ sampleList +")' onmouseout='getMouseout()' style='color: #2A6EDF; cursor: pointer'>" +
|
||||
d.devNum +
|
||||
"</span>";
|
||||
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -129,6 +151,52 @@ function initTable(dataList, limit, page) {
|
|||
});
|
||||
}
|
||||
|
||||
function getMouseout(){
|
||||
// alert("鼠标移出");
|
||||
// layer.close(devOpenIndex);
|
||||
}
|
||||
|
||||
function getMouseover(data){
|
||||
console.log("data",data)
|
||||
var html = '<table class="classTable" lay-skin="line" lay-size="sm" style="width: 100%;">' +
|
||||
'<thead>' +
|
||||
'<tr>' +
|
||||
'<th>序号</th>' +
|
||||
'<th>设备编号</th>' +
|
||||
'<th>试验结果</th>'+
|
||||
'</tr>'+
|
||||
'</thead>'
|
||||
|
||||
html += '<tbody>';
|
||||
if (data.length>0){
|
||||
for (let i = 0; i < data.length; i++){
|
||||
html += '<tr>' +
|
||||
'<td>' + (i+1) + '</td>' +
|
||||
'<td title="'+ data[i].devCode +'" style="cursor: pointer;" >' + data[i].devCode + '</td>' +
|
||||
'<td title="'+ data[i].testResult +'" style="cursor: pointer;">' + data[i].testResult + '</td>' +
|
||||
'</tr>';
|
||||
}
|
||||
}else{
|
||||
html += '<tr>' +
|
||||
'<td colspan="3" style="text-align: center">暂无数据</td>' +
|
||||
'</tr>';
|
||||
}
|
||||
html += '</tbody>';
|
||||
html += '</table>';
|
||||
|
||||
let devOpenIndex = layer.open({
|
||||
type: 0,
|
||||
title: '设备信息',
|
||||
area: ['400px', '500px'],
|
||||
content: html,
|
||||
btn: ['关闭'],
|
||||
yes: function (index, layero) {
|
||||
layer.close(index);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function handleClick1(view1) {
|
||||
alert('Clicked on: ' + view1);
|
||||
}
|
||||
|
|
@ -156,7 +224,8 @@ function getReqParams(page, limit, type) {
|
|||
limit: limit + "",
|
||||
id: idParam,
|
||||
sampleTools: selectedText,
|
||||
keyWord:$('#keyWord').val()
|
||||
keyWord:$('#keyWord').val(),
|
||||
reportCode:$('#reportCode').val()
|
||||
};
|
||||
} else {
|
||||
obj = {
|
||||
|
|
@ -164,7 +233,8 @@ function getReqParams(page, limit, type) {
|
|||
limit: '10',
|
||||
id: idParam,
|
||||
sampleTools: selectedText,
|
||||
keyWord: ''
|
||||
keyWord: '',
|
||||
reportCode:''
|
||||
};
|
||||
}
|
||||
console.log(obj)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,13 @@
|
|||
|
||||
<div class="layui-inline" style="padding: 0 0 0 10px;">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="keyWord" maxlength="30" class="layui-input" autocomplete="off" placeholder="请输入关键字">
|
||||
<input type="text" id="reportCode" maxlength="30" class="layui-input" placeholder="请输入报告编号">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline" style="padding: 0 0 0 10px;">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="keyWord" maxlength="30" class="layui-input" placeholder="请输入关键字">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue