Merge remote-tracking branch 'origin/master'

master
赵嘉伟 3 years ago
commit 257710c268

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.common.model;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* *
@ -33,7 +34,7 @@ public class CustomReportSearchConditionConfig {
private Integer columnID; private Integer columnID;
private Integer columnWidthPercent; private Integer columnWidthPercent;
//自定义报表 Load后需赋上初值 //自定义报表 Load后需赋上初值
private List<String> fieldValueList; private List<Map<String, Object>> fieldValueList;
//增加insert所需字段 //增加insert所需字段
private String site; private String site;
@ -177,10 +178,11 @@ public class CustomReportSearchConditionConfig {
this.columnWidthPercent = columnWidthPercent; this.columnWidthPercent = columnWidthPercent;
} }
public List<String> getFieldValueList() { public List<Map<String, Object>> getFieldValueList() {
return fieldValueList; return fieldValueList;
} }
public void setFieldValueList(List<String> fieldValueList) {
public void setFieldValueList(List<Map<String, Object>> fieldValueList) {
this.fieldValueList = fieldValueList; this.fieldValueList = fieldValueList;
} }
} }

@ -115,27 +115,46 @@ public class CustomReportImpl implements CustomReportInterface {
int k=0; int k=0;
for(CustomReportSearchConditionConfig searchConditionConfig:conditionConfigList) for(CustomReportSearchConditionConfig searchConditionConfig:conditionConfigList)
{ {
if(searchConditionConfig.getDailogCheckboxSQL().trim().isEmpty()) if (searchConditionConfig.getDailogCheckboxSQL().trim().isEmpty()) {
{
conditionConfigList.get(k).setFieldValueList(new ArrayList());
}else
{
//当 弹出复选框数据获取SQL 有值时依SQL获取相应的字段值列表
//List<Map<String, Object>> result=logicService.executeQuery(site, searchConditionConfig.getDailogCheckboxSQL().trim(), new HashMap<String,Object>()); conditionConfigList.get(k).setFieldValueList(new ArrayList());
List<Map<String, Object>> result = customReportMapper.executeSqlQuery( searchConditionConfig.getDailogCheckboxSQL().trim() ); } else {
if(result.size()>0) String dictOrSql = searchConditionConfig.getDailogCheckboxSQL();
{ if (dictOrSql.startsWith("SELECT".toUpperCase())) {
List<String> lst=new ArrayList<String>(); //当 弹出复选框数据获取SQL 有值时依SQL获取相应的字段值列表
//List<Map<String, Object>> result=logicService.executeQuery(site, searchConditionConfig.getDailogCheckboxSQL().trim(), new HashMap<String,Object>());
for(Map<String,Object> m:result) List<Map<String, Object>> result = customReportMapper.executeSqlQuery(dictOrSql.trim());
{ if (result.size() > 0) {
for(String key:m.keySet()) List<Map<String, Object>> lst = new ArrayList<>();
{ for (Map<String, Object> m : result) {
lst.add(m.get(key).toString()); Map<String, Object> _map = new HashMap<>();
for (String key : m.keySet()) {
_map.put("key", m.get(key));
_map.put("text", m.get(key));
break;
}
lst.add(_map);
} }
conditionConfigList.get(k).setFieldValueList(lst);
}
} else if (dictOrSql.contains("*") && dictOrSql.contains(";")) {
String[] dictOrSqlArray = dictOrSql.split(";");
if (dictOrSqlArray != null && dictOrSqlArray.length > 0) {
List<Map<String, Object>> mapList = new ArrayList<>();
Map<String, Object> _map = null;
for (int i = 0; i < dictOrSqlArray.length; i++) {
String keyValue = dictOrSqlArray[i];
if (!keyValue.contains("*")) {
continue;
}
_map = new HashMap<>();
_map.put("key", keyValue.split("\\*")[0]);
_map.put("text", keyValue.split("\\*")[1]);
mapList.add(_map);
}
conditionConfigList.get(k).setFieldValueList(mapList);
} }
conditionConfigList.get(k).setFieldValueList(lst);
} }
} }
@ -202,24 +221,15 @@ public class CustomReportImpl implements CustomReportInterface {
if(querySentence.trim().isEmpty()) if(querySentence.trim().isEmpty())
{ {
//70502.simple=请在检索语句配置栏填写 SQL语句
//throw Exceptions.convert(new BasicBOBeanException(70502,new Data()));
throw new RuntimeException("请在检索语句配置栏填写 SQL语句"); throw new RuntimeException("请在检索语句配置栏填写 SQL语句");
} }
param=null;
//2.依定的规则 检索语句中需替换的内容 以 :开头,所以此处依:先做下判断是否有需替换的内容 //2.依定的规则 检索语句中需替换的内容 以 :开头,所以此处依:先做下判断是否有需替换的内容
if(querySentence.indexOf(":")>1) if(querySentence.indexOf(":")>1)
{ {
//处理需替换的数据 //处理需替换的数据
param = new HashMap();
//自定义报表_检索条件动态SQL配置
List<CustomReportSearchConditionDynSQLConfig> dynSQLConfigList=new ArrayList<CustomReportSearchConditionDynSQLConfig>();
param = new HashMap<String, Object>();
param.put("MAINHANDLE", "CustomReportBO:*,"+reportID); param.put("MAINHANDLE", "CustomReportBO:*,"+reportID);
//map=logicService.executeQuery(site, QUERY_DYNSQLCONFIG_SQL, param); //map=logicService.executeQuery(site, QUERY_DYNSQLCONFIG_SQL, param);
@ -235,10 +245,8 @@ public class CustomReportImpl implements CustomReportInterface {
} }
if(object.getString(dynSqlConfigMap.get(i).toString())==null || object.getString(dynSqlConfigMap.get(i).getConditionField()).isEmpty()) if( dynSqlConfigMap == null || dynSqlConfigMap.get(i)==null || object.getString(dynSqlConfigMap.get(i).getConditionField()) == null)
{ {
//当前台的json格式字串中没有 依赖条件的值时,即表示查询条件中无此项,可直接赋空字串
//queryMap.put(map.get(i).get("DYN_CONDITION_REPLACE_FIELD").toString().trim(), "");
querySentence=querySentence.replaceAll(dynSqlConfigMap.get(i).getDynConditionReplaceField().trim(), " "); querySentence=querySentence.replaceAll(dynSqlConfigMap.get(i).getDynConditionReplaceField().trim(), " ");
}else }else
@ -268,11 +276,11 @@ public class CustomReportImpl implements CustomReportInterface {
} }
//3.执行查询
Map<String,Object> siteParam=new HashMap<String, Object>();
//siteParam.put("SITE", site);
//替换站点 2021/08/19 //替换站点 2021/08/19
querySentence = querySentence.replace(":SITE","\'"+site+"\'"); querySentence = querySentence.replace(":SITE","\'"+site+"\'");
//3.执行查询
//List<Map<String, Object>> result=logicService.executeQuery(site, querySentence,siteParam); //List<Map<String, Object>> result=logicService.executeQuery(site, querySentence,siteParam);
List<Map<String, Object>> result= customReportMapper.executeSqlQuery( querySentence ); List<Map<String, Object>> result= customReportMapper.executeSqlQuery( querySentence );
@ -289,7 +297,5 @@ public class CustomReportImpl implements CustomReportInterface {
} }
return result; return result;
} }
} }

@ -20,6 +20,24 @@ public class SfcDto extends Sfc {
private String plannedCompDate; private String plannedCompDate;
//工作令号 //工作令号
private String workOrder; private String workOrder;
private String employeeDescription;
private String lastOperationStatus;
public String getEmployeeDescription() {
return employeeDescription;
}
public void setEmployeeDescription(String employeeDescription) {
this.employeeDescription = employeeDescription;
}
public String getLastOperationStatus() {
return lastOperationStatus;
}
public void setLastOperationStatus(String lastOperationStatus) {
this.lastOperationStatus = lastOperationStatus;
}
public String getAbnormalNo() { public String getAbnormalNo() {
return abnormalNo; return abnormalNo;

@ -44,6 +44,9 @@
<result column="OPERATION_DESCRIPTION" property="operationDescription" /> <result column="OPERATION_DESCRIPTION" property="operationDescription" />
<result column="PREPOSITION_OPERATION" property="prepositionOperation" /> <result column="PREPOSITION_OPERATION" property="prepositionOperation" />
<result column="RESRCE" property="resrce" /> <result column="RESRCE" property="resrce" />
<result column="EMPLOYEE_DESCRIPTION" property="employeeDescription" />
<result column="LAST_OPERATION_STATUS" property="lastOperationStatus" />
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@ -636,7 +639,7 @@
SELECT IW.DATE_STARTED SELECT IW.DATE_STARTED
FROM SFC S FROM SFC S
INNER JOIN SFC_ROUTING SR ON SR.SFC_BO = S.HANDLE INNER JOIN SFC_ROUTING SR ON SR.SFC_BO = S.HANDLE
INNER JOIN SFC_ROUTER SRO ON SRO.SFC_ROUTING_BO = SR.HANDLE INNER JOIN SFC_ROUTER SRO ON SRO.SFC_ROUTING_BO = SR.HANDLE AND SRSRO.IN_USE = 'true'
INNER JOIN SFC_STEP SS ON SS.SFC_ROUTER_BO = SRO.HANDLE INNER JOIN SFC_STEP SS ON SS.SFC_ROUTER_BO = SRO.HANDLE
INNER JOIN SFC_IN_WORK IW ON SS.HANDLE = IW.SFC_STEP_BO INNER JOIN SFC_IN_WORK IW ON SS.HANDLE = IW.SFC_STEP_BO
INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO AND ST.STATUS ='403' INNER JOIN STATUS ST ON ST.HANDLE = S.STATUS_BO AND ST.STATUS ='403'
@ -663,10 +666,18 @@
</select> </select>
<select id="pageByResrce" resultMap="FullResultMap"> <select id="pageByResrce" resultMap="FullResultMap">
SELECT S.SFC,S.QTY,IT.DESCRIPTION ITEM_DESCRIPTION FROM SFC S SELECT PREZSD.EMPLOYEE_DESCRIPTION,CASE WHEN TO_NUMBER(zsd.DISPATCH_SEQ)=1 THEN NULL
WHEN SS.STEP_SEQUENCE>TO_NUMBER(zsd.DISPATCH_SEQ)-1 THEN '完成'
ELSE '未完成' END LAST_OPERATION_STATUS,
S.SFC,S.QTY,IT.DESCRIPTION ITEM_DESCRIPTION FROM SFC S
LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.ITEM_BO AND IT.LOCALE=#{locale} LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.ITEM_BO AND IT.LOCALE=#{locale}
JOIN Z_SFC_DISPATCH zsd ON S.SFC=zsd.SFC AND S.SITE=zsd.SITE JOIN Z_SFC_DISPATCH zsd ON S.SFC=zsd.SFC AND S.SITE=zsd.SITE
LEFT JOIN Z_SFC_DISPATCH PREZSD ON zsd.SFC=PREZSD.SFC AND PREZSD.DISPATCH_SEQ=TO_NUMBER(zsd.DISPATCH_SEQ)-1
JOIN Z_PROD_READY_TASK zprt ON ZPRT.SFC_DISPATCH_BO=zsd.HANDLE JOIN Z_PROD_READY_TASK zprt ON ZPRT.SFC_DISPATCH_BO=zsd.HANDLE
JOIN SFC S ON S.SFC=ZSD.SFC AND S.SITE=ZSD.SITE
JOIN SFC_ROUTING SR ON SR.SFC_BO=S.HANDLE
JOIN SFC_ROUTER SR2 ON SR.HANDLE =SR2.SFC_ROUTING_BO AND SR2.IN_USE = 'true'
LEFT JOIN SFC_STEP SS ON SR2.HANDLE =SS.SFC_ROUTER_BO AND (SS.QTY_IN_QUEUE>0 or SS.QTY_IN_WORK>0)
WHERE S.SITE=#{ew.entity.site} AND ZSD.RESRCE=#{ew.entity.resrce} AND ZSD.DISPATCH_STATUS!='CANCEL' AND ZSD.DISPATCH_STATUS!='COMPLETE' WHERE S.SITE=#{ew.entity.site} AND ZSD.RESRCE=#{ew.entity.resrce} AND ZSD.DISPATCH_STATUS!='CANCEL' AND ZSD.DISPATCH_STATUS!='COMPLETE'
AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403','StatusBO:'||#{ew.entity.site}||',404') AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403','StatusBO:'||#{ew.entity.site}||',404')
AND zprt.STATUS='FINISH' AND ZPRT."RESULT"='OK' AND zprt.STATUS='FINISH' AND ZPRT."RESULT"='OK'

Loading…
Cancel
Save