Commit 661921db by wancheng

生产日报页面优化

parent 4eada0c5
...@@ -62,7 +62,7 @@ public class HPBI001 extends DaoEPBase { ...@@ -62,7 +62,7 @@ public class HPBI001 extends DaoEPBase {
private String yearValue = " "; /* 供应商编码*/ private String yearValue = " "; /* 供应商编码*/
private String janValue = " "; /* 供应商名称*/ private String janValue = " "; /* 供应商名称*/
private String febValue = " "; /* 地址*/ private String febValue = " "; /* 地址*/
private Integer marValue = 1; /* 状态 0禁用 1启用*/ private String marValue = " "; /* 状态 0禁用 1启用*/
private String aprValue = " "; /* 创建人*/ private String aprValue = " "; /* 创建人*/
private String mayValue = " "; /* 创建人名称*/ private String mayValue = " "; /* 创建人名称*/
private String junValue = " "; /* 创建时间*/ private String junValue = " "; /* 创建时间*/
...@@ -252,7 +252,7 @@ public class HPBI001 extends DaoEPBase { ...@@ -252,7 +252,7 @@ public class HPBI001 extends DaoEPBase {
* get the marValue - 状态 0禁用 1启用. * get the marValue - 状态 0禁用 1启用.
* @return the marValue * @return the marValue
*/ */
public Integer getmarValue() { public String getmarValue() {
return this.marValue; return this.marValue;
} }
...@@ -261,7 +261,7 @@ public class HPBI001 extends DaoEPBase { ...@@ -261,7 +261,7 @@ public class HPBI001 extends DaoEPBase {
* *
* @param marValue - 状态 0禁用 1启用 * @param marValue - 状态 0禁用 1启用
*/ */
public void setmarValue(Integer marValue) { public void setmarValue(String marValue) {
this.marValue = marValue; this.marValue = marValue;
} }
/** /**
...@@ -427,7 +427,7 @@ public class HPBI001 extends DaoEPBase { ...@@ -427,7 +427,7 @@ public class HPBI001 extends DaoEPBase {
setyearValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(YEARVALUE)), yearValue)); setyearValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(YEARVALUE)), yearValue));
setjanValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(JANVALUE)), janValue)); setjanValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(JANVALUE)), janValue));
setfebValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FEBVALUE)), febValue)); setfebValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FEBVALUE)), febValue));
setmarValue(NumberUtils.toInteger(StringUtils.toString(map.get(MARVLAUE)), marValue)); setmarValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(MARVLAUE)), marValue));
setaprValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(APRVALUE)), aprValue)); setaprValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(APRVALUE)), aprValue));
setmayValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(MAYVALUE)), mayValue)); setmayValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(MAYVALUE)), mayValue));
setjunValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(JUNVALUE)), junValue)); setjunValue(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(JUNVALUE)), junValue));
......
...@@ -8,6 +8,7 @@ import com.baosight.hpjx.common.DdynamicEnum; ...@@ -8,6 +8,7 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum; import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.bi.domain.HPBI001; import com.baosight.hpjx.hp.bi.domain.HPBI001;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001; import com.baosight.hpjx.hp.kc.domain.HPKC001;
...@@ -70,16 +71,34 @@ public class ServiceHPBI001 extends ServiceBase { ...@@ -70,16 +71,34 @@ public class ServiceHPBI001 extends ServiceBase {
EiInfo outInfo = new EiInfo(); EiInfo outInfo = new EiInfo();
try { try {
Map params = new HashMap(); Map params = new HashMap();
params.put("factory", inInfo.getCellStr(EiConstant.queryBlock, 0, "factory")); params.put("factory", inInfo.get("factory")==null?"xxxx":inInfo.get("factory"));
params.put("date", inInfo.getCellStr(EiConstant.queryBlock, 0, "date")); params.put("date", inInfo.get("date")==null?"xxxx":inInfo.get("date"));
params.put("company_code", UserSessionUtils.getCompanyCode());
inInfo.setCell(EiConstant.queryBlock, 0, "company_code",UserSessionUtils.getCompanyCode());
inInfo.setCell(EiConstant.queryBlock, 0, "factory",inInfo.get("factory")==null?"xxxx":inInfo.get("factory"));
inInfo.setCell(EiConstant.queryBlock, 0, "date",inInfo.get("date")==null?"xxxx":inInfo.get("date"));
//汇总数据 //汇总数据
outInfo = super.query(inInfo,"HPBI001.querySum",new HPBI001()); //if(!StringUtils.isEmpty(inInfo.getCellStr(EiConstant.queryBlock, 0, "date"))){
//每日数据 //每日数据
List mrsj= super.dao.query("HPBI001.queryDay", params); String pro_name = "***";
//生产月报 List<Map> mrsj= dao.query("HPBI001.queryDay", params);
List scyb= super.dao.query("HPBI001.queryMon", params); if(mrsj!=null){
outInfo.set("mrsj",mrsj); for (Map obj:mrsj) {
outInfo.set("scyb",scyb); if((Long) obj.get("SORT") == 2){
pro_name = (String) obj.get("VALUE");
}
}
}
params.put("pro_name", pro_name);
inInfo.setCell(EiConstant.queryBlock, 0, "pro_name",pro_name);
outInfo = super.query(inInfo,"HPBI001.querySum",new HPBI001());
//生产月报
List scyb= dao.query("HPBI001.queryMon", params);
outInfo.set("mrsj",mrsj);
outInfo.set("scyb",scyb);
// }
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
} }
...@@ -96,6 +115,7 @@ public class ServiceHPBI001 extends ServiceBase { ...@@ -96,6 +115,7 @@ public class ServiceHPBI001 extends ServiceBase {
EiInfo outInfo = new EiInfo(); EiInfo outInfo = new EiInfo();
try { try {
Map params = new HashMap(); Map params = new HashMap();
params.put("loginName", UserSession.getUserId()); params.put("loginName", UserSession.getUserId());
//params.put("loginName", "QY000019"); //params.put("loginName", "QY000019");
//汇总数据 //汇总数据
......
$(function () { var myChart ='';
$(function () {
$(document).ready(function() { $(document).ready(function() {
$("#inqu_status-0-date").data("kendoDatePicker").value(new Date()); $("#inqu_status-0-date").data("kendoDatePicker").value(new Date());
}); });
//$("#inqu_status-date").data("kendoDatePicker").value(new Date()); //$("#inqu_status-date").data("kendoDatePicker").value(new Date());
//$(element) .data("kendoDatePicker").value(Date) //$(element) .data("kendoDatePicker").value(Date)
$("#QUERY").click(); //$("#QUERY").click();
/* $("#QUERY").on("click", function () { /* $("#QUERY").on("click", function () {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
buildOption("scrb"); buildOption("scrb");
...@@ -12,12 +13,15 @@ $(function () { ...@@ -12,12 +13,15 @@ $(function () {
$("#QUERY").on("click", function (e) { $("#QUERY").on("click", function (e) {
//resultGrid.dataSource.page(1); //resultGrid.dataSource.page(1);
var inInfo = new EiInfo(); var inInfo = new EiInfo();
inInfo.set("date",$("#inqu_status-0-date").val());
inInfo.set("factory",$("#inqu_status-0-factory").val());
EiCommunicator.send("HPBI001","query", inInfo, { EiCommunicator.send("HPBI001","query", inInfo, {
// 服务调用成功后的回调函数 onSuccess // 服务调用成功后的回调函数 onSuccess
onSuccess: function(response){ onSuccess: function(response){
$('#mrsj').empty(); $('#mrsj').empty();
var mrsj = response.get('mrsj'); var mrsj = response.get('mrsj');
var scyb = response.get('scyb'); var scyb = response.get('scyb');
if(mrsj.length>0){
$.each(mrsj, function(index, item) { $.each(mrsj, function(index, item) {
str = str =
'<tr>' + '<tr>' +
...@@ -26,8 +30,15 @@ $(function () { ...@@ -26,8 +30,15 @@ $(function () {
'</tr>'; '</tr>';
$('#mrsj').append(str); $('#mrsj').append(str);
}) })
buildOption("scrb",scyb); }
resultGrid.dataSource.page(1); if(scyb.length>0) {
buildOption("scrb", scyb);
}else{
if (myChart != null && myChart.dispose) {
myChart.dispose();
}
}
resultGrid.setEiInfo(response);
}, },
// 服务调用失败后的回调函数 onFail // 服务调用失败后的回调函数 onFail
onFail: function(errorMsg, status, e) { onFail: function(errorMsg, status, e) {
...@@ -76,14 +87,15 @@ function buildOption(vid,data){ ...@@ -76,14 +87,15 @@ function buildOption(vid,data){
$.each(data, function(index, item) { $.each(data, function(index, item) {
if(item.INDCODE == 'sccl'){ if(item.INDCODE == 'sccl'){
x_data.push(item.X); x_data.push(item.X);
y_data1.push(item.VAULE); y_data1.push(item.VALUE);
}else if(item.INDCODE == 'scrs'){ }else if(item.INDCODE == 'scrs'){
y_data2.push(item.VAULE); y_data2.push(item.VALUE);
}else if(item.INDCODE == 'rjcl'){ }else if(item.INDCODE == 'rjcl'){
y_data3.push(item.VAULE); y_data3.push(item.VALUE);
} }
}) })
var myChart = echarts.init(document.getElementById(vid)); myChart = echarts.init(document.getElementById(vid));
var colors = ['#5470C6', '#91CC75', '#EE6666']; var colors = ['#5470C6', '#91CC75', '#EE6666'];
var option = { var option = {
title: { title: {
...@@ -145,5 +157,5 @@ function buildOption(vid,data){ ...@@ -145,5 +157,5 @@ function buildOption(vid,data){
} }
] ]
}; };
myChart.setOption(option, true); myChart.setOption(option, false);
} }
...@@ -13,23 +13,12 @@ ...@@ -13,23 +13,12 @@
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<%-- <EF:EFSelect cname="工厂" defaultValue="0" ename="inqu_status-0-factory" colWidth="3"> <EF:EFSelect cname="工厂" ename="factory" blockId="inqu_status" row="0" colWidth="3" filter="contains">
<EF:EFOption label="黄陂" value="黄陂"/>
<EF:EFOption label="红安" value="红安"/>
</EF:EFSelect>--%>
<EF:EFSelect cname="工厂" ename="inqu_status-0-factory" colWidth="3" filter="contains">
<%--<EF:EFOption label="全部" value=""/>--%>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<%-- <EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains"> <EF:EFDatePicker ename="date" blockId="inqu_status" row="0" colWidth="3" cname="日期:"
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>--%>
<EF:EFDatePicker ename="inqu_status-0-date" colWidth="3" cname="日期:"
format="yyyy-MM-dd"/> format="yyyy-MM-dd"/>
</div> </div>
<%-- <EF:EFButton ename="QUERY" cname="查询" row="1" class="btn-align-right"></EF:EFButton>--%>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result1" title="每日数据"> <EF:EFRegion id="result1" title="每日数据">
......
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