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

1111

parent 8afae9c0
......@@ -7,7 +7,9 @@ import cn.wise.sc.cement.business.entity.EntityEnclosure;
import cn.wise.sc.cement.business.model.*;
import cn.wise.sc.cement.business.enumation.FileExt;
import cn.wise.sc.cement.business.model.query.SampleHandleEnclosureQuery;
import cn.wise.sc.cement.business.model.vo.CraftReport;
import cn.wise.sc.cement.business.model.vo.EntrustVo;
import cn.wise.sc.cement.business.model.vo.IndustrialReport;
import cn.wise.sc.cement.business.model.vo.TenElementReport;
import cn.wise.sc.cement.business.service.IEntityEnclosureService;
import cn.wise.sc.cement.business.service.IEntrustService;
......@@ -104,19 +106,26 @@ public class ReportController {
//十元素1导出
List<TenElementReport> list1 = iEntrustService.getTen1List(entrustId);
beanParams.put("list1", list1);
//工艺性能
//物理性能
//颗粒分析
//十元素2导出
List<TenElementReport> list2 = iEntrustService.getTen2List(entrustId);
beanParams.put("list2", list2);
//煤的工业分析
List<IndustrialReport> list3 = iEntrustService.getIndustrialList(entrustId);
beanParams.put("list3", list3);
//工艺性能
List<CraftReport> list4 = iEntrustService.getCraftList(entrustId);
beanParams.put("list4", list4);
//物理性能
//颗粒分析
//事项-----不用处理
//十元素2导出
List<TenElementReport> list2 = iEntrustService.getTen2List(entrustId);
beanParams.put("list2", list2);
//品质-----不用处理
WordUtil.writeWordReport(rts.getProjectName() + "(报告)", "report_new.ftl",
......
package cn.wise.sc.cement.business.mapper;
import cn.wise.sc.cement.business.entity.SampleCheck;
import cn.wise.sc.cement.business.model.IndustrialReport;
import cn.wise.sc.cement.business.model.vo.IndustrialReport;
import cn.wise.sc.cement.business.model.ElementReport;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
......
......@@ -18,7 +18,7 @@
group by s.id, sdc.id,t.name
</select>
<select id="getSampleIndustrialCheck" resultType="cn.wise.sc.cement.business.model.IndustrialReport">
<select id="getSampleIndustrialCheck" resultType="cn.wise.sc.cement.business.model.vo.IndustrialReport">
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id FROM sample_check sc
LEFT JOIN
(SELECT check_id,sample_id FROM sample_check_team) sct
......
......@@ -7,7 +7,7 @@ package cn.wise.sc.cement.business.model;
**/
public enum ElementKey {
//十元素key
//十元素1&十元素2 key
LOI("L.O.I"),
SiO2("SiO<sub>2</sub>"),
Al2O3AndTiO2("Al<sub>2</sub>O<sub>3</sub>+TiO<sub>2</sub>"),
......@@ -26,7 +26,19 @@ public enum ElementKey {
//煤的工业分析key
Gyfx("工业分析"),
Stad("St,ad"),
Km("可磨")
Km("可磨"), //煤的工业分析&工艺性能 共用key
//工艺性能key
Ymx("易磨性"),
Fsx("磨蚀性"),
Gm("辊磨"),
//易烧性 直接取游离钙的结果
FCaO1350("fCaO 1350"),
FCaO1400("fCaO 1400"),
FCaO1450("fCaO 1450")
;
private String key;
......
package cn.wise.sc.cement.business.model;
/**
* @description: 工业特性key
* @author: qh
* @create: 2020-10-16 14:33
**/
public enum IndustrialElementKey {
//工业特性
Mad("Mad"),
Aad("Aad"),
Vad("Vad"),
QnetAdMJkg("Qnet,ad(MJ/kg)"),
JZ("焦渣"),
StAd("St,ad");
private String key;
IndustrialElementKey(String key) {
this.key = key;
}
public String getKey() {
return key;
}
}
package cn.wise.sc.cement.business.model.vo;
import cn.wise.sc.cement.business.model.ElementReport;
import lombok.Data;
import java.io.Serializable;
/**
* @description: 工艺性能报告
* @author: ztw
* @create: 2021-3-19
**/
@Data
public class CraftReport extends ElementReport implements Serializable {
private static final long serialVersionUID = 42L;
//下面是工艺性能析检测项
private String mjt ="";
private String kwht ="";
private String ai ="";
private String hgi ="";
private String cyl ="";
private String tmf ="";
private String twf ="";
private String fcao1350 ="";
private String fcao1400 ="";
private String fcao1450 ="";
}
package cn.wise.sc.cement.business.model;
package cn.wise.sc.cement.business.model.vo;
import cn.wise.sc.cement.business.model.ElementReport;
import lombok.Data;
import java.io.Serializable;
/**
* @description: 煤的工业分析报告
* @author: qh
* @author: ztw
* @create: 2021-3-19
**/
@Data
......
......@@ -144,6 +144,8 @@ public interface IEntrustService extends IService<Entrust> {
List<IndustrialReport> getIndustrialList(Integer entrustId);
List<CraftReport> getCraftList(Integer entrustId);
//质量管理
BaseResponse<IPage<EntrustVo>> getQualityPage(PageQuery pageQuery,
......
......@@ -3,7 +3,6 @@ package cn.wise.sc.cement.business.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.wise.sc.cement.business.entity.*;
import cn.wise.sc.cement.business.mapper.*;
import cn.wise.sc.cement.business.model.*;
......@@ -5069,9 +5068,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
IndustrialReport report = new IndustrialReport();
BeanUtils.copyProperties(first, report);
Map<String,ElementReport> reportMap = entry.getValue().stream().collect(Collectors.toMap(ElementReport::getTeamName, item -> item));
//工业分析结果拆分
String gyfxLastResult = reportMap.get(ElementKey.Gyfx.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Gyfx.getKey()).getLastResult())?"":reportMap.get(ElementKey.Gyfx.getKey()).getLastResult();
if(StringUtils.isNotBlank(gyfxLastResult)){
Map<String,String> gyfxMap = getGyfxLastResult(gyfxLastResult);
Map<String,String> gyfxMap = splitLastResult(gyfxLastResult);
report.setMad(gyfxMap==null || org.springframework.util.StringUtils.isEmpty(gyfxMap.get("Mad")) ?"—":gyfxMap.get("Mad"));
report.setAad(gyfxMap==null || org.springframework.util.StringUtils.isEmpty(gyfxMap.get("Aad")) ?"—":gyfxMap.get("Aad"));
report.setVad(gyfxMap==null || org.springframework.util.StringUtils.isEmpty(gyfxMap.get("Vad")) ?"—":gyfxMap.get("Vad"));
......@@ -5086,8 +5086,18 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
report.setStad(reportMap.get(ElementKey.Stad.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Stad.getKey()).getLastResult()) ?"—":reportMap.get(ElementKey.Stad.getKey()).getLastResult());
report.setClad("—");
report.setHgi("—");
report.setCyl("—");
//可磨性结果拆分
String kmLastResult = reportMap.get(ElementKey.Km.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Km.getKey()).getLastResult())?"":reportMap.get(ElementKey.Km.getKey()).getLastResult();
if(StringUtils.isNotBlank(kmLastResult)){
Map<String,String> kmMap = splitLastResult(kmLastResult);
report.setHgi(kmMap==null || org.springframework.util.StringUtils.isEmpty(kmMap.get("HGI")) ?"—":kmMap.get("HGI"));
report.setCyl(kmMap==null || org.springframework.util.StringUtils.isEmpty(kmMap.get("出样率(%)")) ?"—":kmMap.get("出样率(%)"));
}else{
report.setHgi("—");
report.setCyl("—");
}
newList.add(report);
}
//将样品重量换算成kg
......@@ -5107,8 +5117,110 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
list.add("可磨");
return sampleCheckMapper.getSampleElementCheck(entrustId, list);
}
//工业分析检测项最终结果拆分显示
private Map<String,String> getGyfxLastResult(String lastResult){
/**
* 获取煤的工艺性能的检测信息
* @param entrustId 委托id
* @return
*/
@Override
public List<CraftReport> getCraftList(Integer entrustId) {
List<CraftReport> newList = null;
List<ElementReport> list = getSampleCraftElementCheck(entrustId);
if(list != null && list.size() > 0){
newList = new ArrayList<>();
}
Map<Integer, List<ElementReport>> groupBySample = list.stream().collect(Collectors.groupingBy(ElementReport::getId, Collectors.toList()));
for(Map.Entry<Integer,List<ElementReport>> entry : groupBySample.entrySet()){
ElementReport first = entry.getValue().get(0);
CraftReport report = new CraftReport();
BeanUtils.copyProperties(first, report);
Map<String,ElementReport> reportMap = entry.getValue().stream().collect(Collectors.toMap(ElementReport::getTeamName, item -> item));
//易磨性结果拆分
String ymxLastResult = reportMap.get(ElementKey.Ymx.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Ymx.getKey()).getLastResult())?"":reportMap.get(ElementKey.Ymx.getKey()).getLastResult();
if(StringUtils.isNotBlank(ymxLastResult)){
Map<String,String> ymxMap = splitLastResult(ymxLastResult);
report.setMjt(ymxMap==null || org.springframework.util.StringUtils.isEmpty(ymxMap.get("易磨性(MJ/t)")) ?"—":ymxMap.get("易磨性(MJ/t)"));
report.setKwht(ymxMap==null || org.springframework.util.StringUtils.isEmpty(ymxMap.get("易磨性值")) ?"—":ymxMap.get("易磨性值"));
}else{
report.setMjt("—");
report.setKwht("—");
}
//磨蚀性结果拆分
String fsxLastResult = reportMap.get(ElementKey.Fsx.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Fsx.getKey()).getLastResult())?"":reportMap.get(ElementKey.Fsx.getKey()).getLastResult();
if(StringUtils.isNotBlank(fsxLastResult)){
Map<String,String> fsxMap = splitLastResult(fsxLastResult);
report.setAi(fsxMap==null || org.springframework.util.StringUtils.isEmpty(fsxMap.get("Ai(g)")) ?"—":fsxMap.get("Ai(g)"));
}else{
report.setAi("—");
}
//可磨性结果拆分
String kmLastResult = reportMap.get(ElementKey.Km.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Km.getKey()).getLastResult())?"":reportMap.get(ElementKey.Km.getKey()).getLastResult();
if(StringUtils.isNotBlank(kmLastResult)){
Map<String,String> kmMap = splitLastResult(kmLastResult);
report.setHgi(kmMap==null || org.springframework.util.StringUtils.isEmpty(kmMap.get("HGI")) ?"—":kmMap.get("HGI"));
report.setCyl(kmMap==null || org.springframework.util.StringUtils.isEmpty(kmMap.get("出样率(%)")) ?"—":kmMap.get("出样率(%)"));
}else{
report.setHgi("—");
report.setCyl("—");
}
//辊磨结果拆分
String gmLastResult = reportMap.get(ElementKey.Gm.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.Gm.getKey()).getLastResult())?"":reportMap.get(ElementKey.Gm.getKey()).getLastResult();
if(StringUtils.isNotBlank(gmLastResult)){
Map<String,String> gmMap = splitLastResult(gmLastResult);
report.setTmf(gmMap==null || org.springframework.util.StringUtils.isEmpty(gmMap.get("TMF")) ?"—":gmMap.get("TMF"));
report.setTwf(gmMap==null || org.springframework.util.StringUtils.isEmpty(gmMap.get("TWF(kg/t)")) ?"—":gmMap.get("TWF(kg/t)"));
}else{
report.setTmf("—");
report.setTwf("—");
}
//易烧性结果 不用拆分 直接取游离钙结果
report.setFcao1350(reportMap.get(ElementKey.FCaO1350.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.FCaO1350.getKey()).getLastResult()) ?"—":reportMap.get(ElementKey.FCaO1350.getKey()).getLastResult());
report.setFcao1400(reportMap.get(ElementKey.FCaO1400.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.FCaO1400.getKey()).getLastResult()) ?"—":reportMap.get(ElementKey.FCaO1400.getKey()).getLastResult());
report.setFcao1450(reportMap.get(ElementKey.FCaO1450.getKey())==null || org.springframework.util.StringUtils.isEmpty(reportMap.get(ElementKey.FCaO1450.getKey()).getLastResult()) ?"—":reportMap.get(ElementKey.FCaO1450.getKey()).getLastResult());
newList.add(report);
}
//将样品重量换算成kg
if(newList != null){
newList.stream().forEach(arg ->{
arg.setWeight(Sample.weight2Kg(arg.getWeight(), arg.getWeightType()));
});
}
return newList;
}
//获取工艺性能的检测项检测信息
private List<ElementReport> getSampleCraftElementCheck(Integer entrustId) {
Set<String> list = new HashSet<>(7);
list.add("易磨性");
list.add("磨蚀性");
list.add("可磨");
list.add("辊磨");
list.add("fCaO 1350");
list.add("fCaO 1400");
list.add("fCaO 1450");
return sampleCheckMapper.getSampleElementCheck(entrustId, list);
}
/**
* 特殊处理的检测项最终结果拆分显示
* @param lastResult
* @return
*/
private Map<String,String> splitLastResult(String lastResult){
Map<String,String> map = new HashMap<>();
if(StringUtils.isNotBlank(lastResult)){
String[] str = lastResult.split("\n");
......@@ -5127,6 +5239,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//***********************************质量控制************************************
/**
* 质量检测分页列表
......
server:
port: 7005
port: 7007
#-Dspring.config.location=D:\idea_workspases\tianjin-cement\cement-business\src\main\resources\application.yml
spring:
......
......@@ -4416,8 +4416,7 @@
ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s259"/>
</Row>
<!-- 别表结束 -->
</#list>
<!-- </#list> -->
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s223">
<Cell ss:MergeAcross="15" ss:StyleID="m1898254380784"><Data ss:Type="String">以下空白</Data><NamedCell
......@@ -4729,7 +4728,7 @@
<Cell ss:StyleID="s289"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s289"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s63"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s290" ss:Formula="=首页!R[-2]C[-11]"><Data ss:Type="String">2</Data><NamedCell
<Cell ss:StyleID="s290" ss:Formula="=首页!R[-2]C[-11]"><Data ss:Type="String">9</Data><NamedCell
ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s291"><Data ss:Type="String">第3页 </Data><NamedCell
ss:Name="Print_Area"/></Cell>
......@@ -6019,7 +6018,7 @@
</Row>
<!-- 煤工业分析 13行 -->
<#--如果list1不为空-->
<#--如果list3不为空-->
<#if list3??>
<!-- <#list list3 as item3> -->
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s400">
......@@ -6417,55 +6416,91 @@
<Cell ss:StyleID="s234"><Data ss:Type="String">MnO</Data><NamedCell
ss:Name="Print_Area"/></Cell>
</Row>
<!-- 十元素2 14 -->
<#list list2 as item>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s225">
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleName}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleForm}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.sampleCode}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.weight}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item.cementCode}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.loi}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.sio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.al2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.fe2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.cao}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.mgo}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.tio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.k2o}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.na2o}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item.so3}</Data></Cell>
<Cell ss:StyleID="s265"><Data ss:Type="String">${item.cl}</Data></Cell>
<Cell ss:StyleID="s248"><Data ss:Type="String">${item.mno}</Data></Cell>
</Row>
</#list>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s223">
<Cell ss:MergeAcross="16" ss:StyleID="m1896304848688"><Data ss:Type="String">以下空白</Data><NamedCell
ss:Name="Print_Area"/></Cell>
</Row>
<!-- 六元素2end -->
<#if list2??>
<#list 1..13 as i>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s225">
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s265"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s248"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s256"/>
<!-- 十元素2 14行 -->
<#--如果list2不为空-->
<#if list2??>
<!--<#list list2 as item2>-->
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s225">
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.sampleName}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.sampleForm}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.sampleCode}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.weight}</Data></Cell>
<Cell ss:StyleID="s263"><Data ss:Type="String">${item2.cementCode}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.loi}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.sio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.al2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.fe2o3}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.cao}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.mgo}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.tio2}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.k2o}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.na2o}</Data></Cell>
<Cell ss:StyleID="s264"><Data ss:Type="String">${item2.so3}</Data></Cell>
<Cell ss:StyleID="s265"><Data ss:Type="String">${item2.cl}</Data></Cell>
<Cell ss:StyleID="s248"><Data ss:Type="String">${item2.mno}</Data></Cell>
</Row>
<!-- </#list> -->
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s223">
<Cell ss:MergeAcross="16" ss:StyleID="m1896304848688"><Data ss:Type="String">以下空白</Data><NamedCell
ss:Name="Print_Area"/></Cell>
</Row>
<#if list2?size lte 13>
<#list 1..(list2?size+1 - 13) as i>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s225">
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s265"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s248"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s256"/>
</Row>
</#list>
</#if>
</#if>
<#--如果list2空-->
<#if ! list2??>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s223">
<Cell ss:MergeAcross="16" ss:StyleID="m1896304848688"><Data ss:Type="String">以下空白</Data><NamedCell
ss:Name="Print_Area"/></Cell>
</Row>
<#list 1..13 as i>
<Row ss:AutoFitHeight="0" ss:Height="25.5" ss:StyleID="s225">
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s263"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s264"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s265"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s248"><NamedCell ss:Name="Print_Area"/></Cell>
<Cell ss:StyleID="s256"/>
</Row>
</#list>
</#if>
......
<?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="cn.wise.sc.cement.business.mapper.DataStatisticsMapper">
<select id="countTeamByTime" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT DATE_FORMAT(sd.create_time,'%Y-%m-%d') as name, count(sd.id) as value
FROM sample_distribution sd
where sd.finish_time is not null
<if test="params.cycle == 1 ">
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if test="params.cycle == 2 ">
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if test="params.cycle = 3 ">
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(sd.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
<if test="params.startDate == null and params.endDate == null">
and date(sd.create_time) > date_sub(curdate(),interval 30 day)
</if>
group by name
</select>
<select id="countTeamByOrigin" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT s.origin as name, count(sd.id) as value
FROM sample_distribution sd
left join sample s on s.id = sd.sample_id
where sd.finish_time is not null
<if test="params.cycle == 1 ">
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if test="params.cycle == 2 ">
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if test="params.cycle == 3 ">
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(sd.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
group by s.origin
</select>
<select id="countEntrustSumNum" resultType="integer">
SELECT count(*)
FROM entrust e
left join client c on c.id = e.client_id
where e.status != 0 and e.project_type is not null
<if test="params.startDate != null and params.startDate != ''">
and DATE(e.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(e.create_time) &lt;= #{params.endDate}
</if>
<if test="params.clientId != null">
and e.clientId = #{clientId}
</if>
<if test="params.clientName != null and params.clientName != ''">
and c.name like concat('%', #{params.clientName}, '%')
</if>
</select>
<select id="countEntrustStatus" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT (
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
WHEN 9 THEN '修改待确认'
ELSE ''
END
) as name,
count(*) as value
FROM entrust e
left join client c on c.id = e.client_id
where e.status != 0 and e.project_type is not null
<if test="params.cycle == 1 ">
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if test="params.cycle == 2 ">
and DATE_FORMAT( e.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if test="params.cycle == 3 ">
and YEAR(e.create_time) = YEAR( NOW( ) )
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(e.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(e.create_time) &lt;= #{params.endDate}
</if>
<if test="params.clientId != null">
and e.clientId = #{clientId}
</if>
<if test="params.clientName != null and params.clientName != ''">
and c.name like concat('%', #{params.clientName}, '%')
</if>
group by e.status
</select>
<select id="countEntrustType" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
select e.project_type as name, count(*) as value
from entrust e
left join client c on c.id = e.client_id
where e.status != 0 and e.project_type is not null
<if test="params.cycle == 1 ">
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if test="params.cycle == 2 ">
and DATE_FORMAT( e.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if test="params.cycle == 3 ">
and YEAR(e.create_time) = YEAR( NOW( ) )
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(e.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(e.create_time) &lt;= #{params.endDate}
</if>
<if test="params.clientId != null">
and e.clientId = #{clientId}
</if>
<if test="params.clientName != null and params.clientName != ''">
and c.name like concat('%', #{params.clientName}, '%')
</if>
group by e.project_type
</select>
<select id="countEntrustPage" resultType="cn.wise.sc.cement.business.model.vo.EntrustVo">
select e.*, p.name as projectName, p.code as projectCode, c.name as clientName, su.name as userName,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
WHEN 9 THEN '修改待确认'
ELSE ''
END
) as statusValue
from entrust e
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
where e.status != 0 and e.project_type is not null
<if test="params.clientId != null">
and e.clientId = #{clientId}
</if>
<if test="params.clientName != null and params.clientName != ''">
and c.name like concat('%', #{params.clientName}, '%')
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(e.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(e.create_time) &lt;= #{params.endDate}
</if>
order by create_time desc
</select>
<select id="exportEntrustList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
IF(ISNULL(e.id),'',e.id) as entrustId,
IF(ISNULL(e.entrust_code),'',e.entrust_code) as 委托单号,
IF(ISNULL(c.name),'',c.name) as 委托单位,
IF(ISNULL(p.code),'',p.code) as 项目编号,
IF(ISNULL(p.name),'',p.name) as 项目名称,
IF(ISNULL(su.name),'',su.name) as 委托人,
IF(ISNULL(e.sample_num),'',e.sample_num) as 样品数量,
IF(ISNULL(e.entrust_date),'',e.entrust_date) as 委托日期,
IF(ISNULL(e.is_urgent),'',e.is_urgent) as isUrgent,
(
CASE e.is_urgent
WHEN 0 THEN '不加急'
WHEN 1 THEN '加急'
ELSE ''
END
) as 是否加急
from entrust e
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
,(select @i:=0)aa
where e.status != 0 and e.project_type is not null
<if test="params.clientId != null">
and e.clientId = #{clientId}
</if>
<if test="params.clientName != null and params.clientName != ''">
and c.name like concat('%', #{params.clientName}, '%')
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(e.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(e.create_time) &lt;= #{params.endDate}
</if>
order by 序号
</select>
<select id="exportEntrustNewList" resultType="java.util.HashMap">
SELECT
(@i:=@i+1) as 序号,
e.id as entrustId,
IF(ISNULL(e.entrust_code),'',e.entrust_code) as 委托单号,
(
CASE e.is_urgent
WHEN 0 THEN '不加急'
WHEN 1 THEN '加急'
ELSE NULL
END
) as 是否加急,
IF(ISNULL(p.name),'',p.name) as 项目名称,
IF(ISNULL(p.code),'',p.code) as 项目编号,
IF(ISNULL(su.name),'',su.name) as 委托人,
IF(ISNULL(c.name),'',c.name) as 委托单位,
IF(ISNULL(e.entrust_date),'',e.entrust_date) as 委托日期,
IF(ISNULL(e.sample_num),'',e.sample_num) as 样品数量,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
WHEN 9 THEN '修改待确认'
WHEN 10 THEN '已作废'
ELSE ''
END
) as 状态
from entrust e
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
,(select @i:=0)aa
where e.status != 0 and e.project_type is not null
<if test="params.clientId != null">
and e.clientId = #{clientId}
</if>
<if test="params.clientName != null and params.clientName != ''">
and c.name like concat('%', #{params.clientName}, '%')
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(e.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(e.create_time) &lt;= #{params.endDate}
</if>
order by 序号
</select>
<select id="countHandlePage" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT su.id as id, su.name as name, count(*) as value FROM sample_handle sh
left join sys_user su on su.id = sh.user_id
where (sh.status = 1 or sh.status = 5)
<if test="params.startDate != null and params.startDate != ''">
and DATE(sh.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sh.create_time) &lt;= #{params.endDate}
</if>
group by sh.user_id
</select>
<select id="countHandleWeek" resultType="integer">
SELECT count(*)
FROM sample_handle sh
left join sys_user su on su.id = sh.user_id
where (sh.status =2 or sh.status =4)
<if test="userId != null ">
and sh.user_id = #{userId}
</if>
<if test="weekType == 1 ">
and YEARWEEK(date_format(sh.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())-1
</if>
<if test="weekType == 2 ">
and YEARWEEK(date_format(sh.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
group by sh.user_id
</select>
<select id="countDistributionPage" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT su.id as id, su.name as name, count(*) as value FROM sample_distribution sd
left join sys_user su on su.id = sd.user_id
where (sd.status = 1 or sd.status = 5)
<if test="params.startDate != null and params.startDate != ''">
and DATE(sh.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sh.create_time) &lt;= #{params.endDate}
</if>
group by sd.user_id
</select>
<select id="countDistributionWeek" resultType="integer">
SELECT count(*)
FROM sample_distribution sd
left join sys_user su on su.id = sd.user_id
where (sd.status =2 or sd.status =4)
<if test="userId != null ">
and sd.user_id = #{userId}
</if>
<if test="weekType == 1 ">
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())-1
</if>
<if test="weekType == 2 ">
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
group by sd.user_id
</select>
<select id="countTeamIng" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT t.name as name, count(*) as value FROM sample_distribution sd
left join team t on t.id = sd.team_id
where (sd.status = 1 or sd.status = 5)
<if test="params.startDate != null and params.startDate != ''">
and DATE(sd.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
group by sd.team_id
</select>
<select id="countTeam" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
SELECT t.name as name, count(*) as value FROM sample_distribution sd
left join team t on t.id = sd.team_id
where 1=1
<if test="params.cycle == 1 ">
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if test="params.cycle == 2 ">
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if test="params.cycle == 3 ">
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(sd.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
group by sd.team_id
</select>
<select id="countTeamPage" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsTeamVo">
SELECT t.id as id, t.name as teamName, count(*) as teamNum FROM sample_distribution sd
left join team t on t.id = sd.team_id
where 1=1
<if test="params.cycle == 1 ">
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if test="params.cycle == 2 ">
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if test="params.cycle == 3 ">
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(sd.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
group by sd.team_id
</select>
<select id="exportTeamList" resultType="java.util.HashMap">
SELECT (@i:=@i+1) as 序号,
t.id as id,
t.name as 检测项目,
count(*) as 检测项数量
FROM sample_distribution sd
left join team t on t.id = sd.team_id
,(select @i:=0)t
where 1=1
<if test="params.cycle == 1 ">
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if test="params.cycle == 2 ">
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if test="params.cycle == 3 ">
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if test="params.startDate != null and params.startDate != ''">
and DATE(sd.create_time) &gt;= #{params.startDate}
</if>
<if test="params.endDate != null and params.endDate != ''">
and DATE(sd.create_time) &lt;= #{params.endDate}
</if>
group by sd.team_id
order by 序号
</select>
<select id="countEntrustNum" resultType="integer">
select count(*) as entrustNum from (
SELECT sd.entrust_id as id, count(*) as entrustNum FROM sample_distribution sd
where sd.team_id = #{teamId}
group by sd.entrust_id
)aa
</select>
<select id="countSampleNum" resultType="integer">
select count(*) as sampleNum from (
SELECT sd.sample_id as id, count(*) as entrustNum FROM sample_distribution sd
where sd.team_id = #{teamId}
group by sd.sample_id
)aa
</select>
<select id="countByClient" resultType="cn.wise.sc.cement.business.model.vo.DataStatisticsVo">
select c.name as name, count(*) as value from entrust e
left join client c on c.id = e.client_id
group by e.client_id
</select>
<select id="countItemDistributionSample"
resultType="cn.wise.sc.cement.business.entity.ItemDistributionSample">
SELECT COUNT(sd.team_id) as `count`,t.`name` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
WHERE 1=1
<if test="start != null and end != null">
AND (sd.finish_time between #{start} and #{end})
</if>
<if test="origin != null and origin != '' ">
AND s.origin = #{origin}
</if>
<if test="teamId != '' and teamId != null ">
AND sd.team_id = #{teamId}
</if>
</select>
<select id="countItemDistribution" resultType="cn.wise.sc.cement.business.entity.ItemDistribution">
SELECT COUNT(a.sample_id) as `count`,`key` from
(SELECT sd.team_id,sd.sample_id,t.`name`,sd.finish_time,CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as
`key` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
WHERE 1=1
<if test="start != null and end != null">
AND (sd.finish_time between #{start} and #{end})
</if>
<if test="origins != null and origins.size()>0">
AND s.origin in
<foreach collection="origins" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="itemId != null">
AND sd.team_id = #{itemId}
</if>
) a GROUP BY a.`key`
</select>
<select id="exporItemDistributionList" resultType="java.util.HashMap">
SELECT (@i:=@i+1) as 序号,
COUNT(a.sample_id) as `count`,
`key`
from
(SELECT sd.team_id,sd.sample_id,t.`name`,sd.finish_time,CONCAT(sd.team_id,',',s.origin,',',s.is_foreign) as
`key` FROM sample_distribution sd
LEFT JOIN sample s ON sd.sample_id = s.id
LEFT JOIN team t ON t.id = sd.team_id
,(select @i:=0)t
WHERE 1=1
<if test="start != null and end != null">
AND (sd.finish_time between #{start} and #{end})
</if>
<if test="origins != null and origins.size()>0">
AND s.origin in
<foreach collection="origins" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="itemId != null">
AND sd.team_id = #{itemId}
</if>
) a GROUP BY a.`key`
order by 序号
</select>
</mapper>
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