Commit a0c78d89 authored by 竹天卫's avatar 竹天卫

扫码获取样品信息

parent 443c0ba2
...@@ -187,11 +187,11 @@ public class SampleController { ...@@ -187,11 +187,11 @@ public class SampleController {
SampleVo sampleVo = sampleService.getDetail(Integer.valueOf(sampleId)).getData(); SampleVo sampleVo = sampleService.getDetail(Integer.valueOf(sampleId)).getData();
String content = ""; String content = "";
if(sampleVo != null){ if(sampleVo != null){
content = "样品名称:"+sampleVo.getName()+" \n "+ content = "样品名称:"+sampleVo.getName()!= null?sampleVo.getName():"" +" \n "+
"本所编号:"+sampleVo.getCementCode()+" \n "+ "本所编号:"+sampleVo.getCementCode()!= null?sampleVo.getCementCode():"" +" \n "+
"项目编号:"+sampleVo.getProjectCode()+" \n "+ "项目编号:"+sampleVo.getProjectCode()!= null?sampleVo.getProjectCode():"" +" \n "+
"项目名称:"+sampleVo.getProjectName()+" \n "+ "项目名称:"+sampleVo.getProjectName()!= null?sampleVo.getProjectName():"" +" \n "+
"小样位置:"+sampleVo.getLittlePosition(); "小样位置:"+sampleVo.getLittlePosition()!= null?sampleVo.getLittlePosition():"" ;
} }
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
BufferedImage bufferedImage = QrCodeUtil.generate(content, 200, 200); BufferedImage bufferedImage = QrCodeUtil.generate(content, 200, 200);
......
...@@ -14,17 +14,18 @@ ...@@ -14,17 +14,18 @@
</sql> </sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.SampleVo"> <select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.SampleVo">
select s.*, e.project_id as projectId, e.project_name as projectName,e.project_code as projectCode select s.*, e.project_id as projectId, p.name as projectName,p.code as projectCode
from sample s from sample s
left join entrust e on e.id = s.entrust_id left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
<include refid="where"/> <include refid="where"/>
order by s.name order by s.name
</select> </select>
<select id="exportList" resultType="java.util.HashMap"> <select id="exportList" resultType="java.util.HashMap">
SELECT SELECT
e.project_name as 项目名称, p.name as 项目名称,
e.project_code as 项目编号, p.code as 项目编号,
s.name as 样品名称, s.name as 样品名称,
s.sample_form as 样品状态, s.sample_form as 样品状态,
s.sample_code as 来样编号, s.sample_code as 来样编号,
...@@ -36,13 +37,15 @@ ...@@ -36,13 +37,15 @@
IF(ISNULL(s.remark),'',s.remark) as 备注 IF(ISNULL(s.remark),'',s.remark) as 备注
from sample s from sample s
left join entrust e on e.id = s.entrust_id left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
left join sys_user su on su.id = s.operator_id left join sys_user su on su.id = s.operator_id
<include refid="where"/> <include refid="where"/>
order by s.create_time desc order by s.create_time desc
</select> </select>
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.SampleVo"> <select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.SampleVo">
select s.*,s.name as sampleName, s.cement_code as cementCode, s.weight as weight select s.*,s.name as sampleName, s.cement_code as cementCode, s.weight as weight,
p.code as projectId, p.name as projectName
from sample s from sample s
left join entrust e on e.id = s.entrust_id left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id left join project p on p.id = e.project_id
...@@ -63,13 +66,14 @@ ...@@ -63,13 +66,14 @@
DATE_FORMAT(s.destruction_time,'%Y/%m/%d') as destruction_time, DATE_FORMAT(s.destruction_time,'%Y/%m/%d') as destruction_time,
s.operator_id, s.operator_id,
s.remark, s.remark,
e.project_name, p.name as projectName,
e.project_code, p.code as projectCode,
su.`name` as user_name su.`name` as user_name
FROM FROM
`sample` s `sample` s
LEFT JOIN entrust e LEFT JOIN entrust e
ON s.entrust_id = e.id ON s.entrust_id = e.id
left join project p on p.id = e.project_id
LEFT JOIN sys_user su LEFT JOIN sys_user su
ON su.id = s.operator_id ON su.id = s.operator_id
</select> </select>
...@@ -96,7 +100,7 @@ ...@@ -96,7 +100,7 @@
<select id="exportWordList" resultType="cn.wise.sc.cement.business.model.SampleWord"> <select id="exportWordList" resultType="cn.wise.sc.cement.business.model.SampleWord">
SELECT SELECT
IF(ISNULL(e.project_name),'',e.project_name) AS projectName, IF(ISNULL(p.name),'',p.name) AS projectName,
IF(ISNULL(e.entrust_code),'',e.entrust_code) AS entrustCode, IF(ISNULL(e.entrust_code),'',e.entrust_code) AS entrustCode,
IF(ISNULL(s.name),'',s.name) AS name, IF(ISNULL(s.name),'',s.name) AS name,
IF(ISNULL(s.cement_code),'',s.cement_code) AS cementCode, IF(ISNULL(s.cement_code),'',s.cement_code) AS cementCode,
...@@ -109,6 +113,7 @@ ...@@ -109,6 +113,7 @@
FROM FROM
sample s sample s
LEFT JOIN entrust e ON s.entrust_id = e.id LEFT JOIN entrust e ON s.entrust_id = e.id
left join project p on p.id = e.project_id
LEFT JOIN sys_user su ON su.id = s.operator_id LEFT JOIN sys_user su ON su.id = s.operator_id
<include refid="whereNew"/> <include refid="whereNew"/>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment