Commit c1f1566f by liuyang

优化鸿鹏生产驾驶舱页面显示和接口

parent f005940c
......@@ -80,16 +80,12 @@
<select id="queryDayWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
ifnull(YGL, 0) as "ygl",
format(ifnull(JHCL, 0), 2) as "jhcl",
format(ifnull(SJCL, 0), 2) as "sjcl",
case when ifnull(YGL, 0) = 0 then '0.00'
else format(ifnull(SJCL, 0)/ ifnull(YGL, 0), 2)
ifnull(sum(USER_COUNT),0) as "ygl",
ifnull(sum(WEIGHT), 0) as "sjcl",
case
when ifnull(sum(USER_COUNT), 0) = 0 then 0
else format(ifnull(sum(WEIGHT), 0)/ ifnull(sum(USER_COUNT), 0), 2)
end as "rjcl"
from (
select
(
select sum(USER_COUNT)
from ${hpjxSchema}.t_hpsc008
where DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
......@@ -101,56 +97,17 @@
<isNotEmpty prepend=" AND " property="date">
REGISTER_DATE = #date#
</isNotEmpty>
) as YGL,
0 as JHCL,
(
select sum(WEIGHT)
from ${hpjxSchema}.t_hpsc008
where DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
REGISTER_DATE = #date#
</isNotEmpty>
) as SJCL
from dual
) a
</select>
<select id="queryMonthWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
ifnull(YGL, 0) as "ljygl",
format(ifnull(JHCL, 0), 2) as "ljjhcl",
format(ifnull(SJCL, 0), 2) as "ljsjcl",
case when ifnull(YGL, 0) = 0 then '0.00'
else format(ifnull(SJCL, 0)/ ifnull(YGL, 0), 2)
ifnull(sum(USER_COUNT), 0) as "ljygl",
ifnull(sum(WEIGHT), 0) as "ljsjcl",
case
when ifnull(sum(USER_COUNT), 0) = 0 then 0
else format(ifnull(sum(WEIGHT), 0)/ ifnull(sum(USER_COUNT), 0), 2)
end as "ljrjcl"
from
(
select
(
select sum(USER_COUNT)
from ${hpjxSchema}.t_hpsc008
where DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
left(REGISTER_DATE,6) = left(#date#,6)
and REGISTER_DATE &lt;= #date#
</isNotEmpty>
) as YGL,
0 as JHCL,
(
select sum(WEIGHT)
from ${hpjxSchema}.t_hpsc008
where DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
......@@ -163,24 +120,16 @@
left(REGISTER_DATE,6) = left(#date#,6)
and REGISTER_DATE &lt;= #date#
</isNotEmpty>
) as SJCL
from dual
) a
</select>
<select id="queryYearWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
ifnull(YGL, 0) as nljyg,
format(ifnull(JHCL, 0), 2) as nljjhcl,
format(ifnull(SJCL, 0), 2) as nljsjcl,
case when ifnull(YGL, 0) = 0 then '0.00'
else format(ifnull(SJCL, 0)/ ifnull(YGL, 0), 2)
ifnull(sum(USER_COUNT),0) as "nljyg",
ifnull(sum(WEIGHT), 0) as nljsjcl,
case
when ifnull(sum(USER_COUNT),0) = 0 then 0
else format(ifnull(sum(WEIGHT), 0) / ifnull(sum(USER_COUNT), 0), 2)
end as nljrjcl
from
(
select
(
select sum(USER_COUNT)
from ${hpjxSchema}.t_hpsc008
where DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
......@@ -193,26 +142,6 @@
left(REGISTER_DATE, 4) = left(#date#, 4)
and REGISTER_DATE &lt;= #date#
</isNotEmpty>
) as YGL,
0 as JHCL,
(
select sum(WEIGHT)
from ${hpjxSchema}.t_hpsc008
where
DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="date">
left(REGISTER_DATE, 4) = left(#date#, 4)
and REGISTER_DATE &lt;= #date#
</isNotEmpty>
) as SJCL
from dual
) a
</select>
<!--组拼加焊综合总产量-->
<select id="queryZCL" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
......
......@@ -5,19 +5,17 @@ import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.common.InventTypeEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.tools.Iplat4jTools;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC001;
import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.hp.pz.domain.HPPZ006;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.StringUtil;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.hpjx.hp.sc.domain.HPSC001;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.hp.yx.domain.HPYX001;
import com.baosight.hpjx.util.*;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
......@@ -26,10 +24,8 @@ import com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author YK
......@@ -256,4 +252,32 @@ public class ServiceHPKC001 extends ServiceBase {
}
}
@OperationLogAnnotation(operModul = "采购入库单",operType = "导出",operDesc = "导出操作")
public EiInfo export(EiInfo inEiInfo) {
CommonMethod.initBlock(inEiInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null);
List<Map> listMap = inEiInfo.getBlock(DdynamicEnum.FACTORY_RECORD_BLOCK_ID.getBlockId()).getRows();
Map params = HPXSTools.setAuthParam("HPKC001."+ ACConstants.SQL_QUERY, EiInfoUtils.getFirstRow(inEiInfo));
params.put(HPYX001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
final List<String> list = new ArrayList<>(
Arrays.asList("purchaseNo","receiptDate","factoryCode", "factoryName", "inventType", "whCode","whName","inventCode"
, "inventName", "spec", "amount", "unitWeight", "weight", "length", "width", "thick", "coefficient"
,"material","unit", "remark","oldPurchaseNo","createdName","createdTime"));
inEiInfo = ExcelUtils.exportToExcel(ACConstants.SQL_COUNT, ACConstants.SQL_QUERY, params, list, new HPKC001());
List<Map> rows = inEiInfo.getBlock(EiConstant.resultBlock).getRows();
rows.forEach(row ->{
if (row.containsKey("inventType")){
row.put("inventType", row.get("inventType").toString());
}
List<Map> factoryList = listMap.stream().filter(map -> row.get("factoryCode").equals(map.get("valueField"))).collect(Collectors.toList());
if (factoryList.size() > 0){
row.put("factoryName", factoryList.get(0).get("textField"));
}
});
Map<String,Object> hashMap = new HashMap<String, Object>(){{
put("inventType", "hpjx.hpkc.inventType");
}};
String codeSetCode = "CODESET_CODE in ('hpjx.hpkc.inventType')";
inEiInfo.getBlock(EiConstant.resultBlock).setRows(Iplat4jTools.EdCm01.initResultRows(rows, hashMap, codeSetCode));
return inEiInfo;
}
}
......@@ -134,10 +134,10 @@
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="order">
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
......
package com.baosight.hpjx.hp.yx.domain;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
......@@ -480,7 +481,7 @@ public class HPYX001 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setSurveyDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SURVEY_DATE)), surveyDate));
setSurveyDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_SURVEY_DATE))), surveyDate));
setDistrict(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DISTRICT)), district));
setPolicyEnv(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_POLICY_ENV)), policyEnv));
setEconomyEnv(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ECONOMY_ENV)), economyEnv));
......
package com.baosight.hpjx.hp.yx.domain;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
......@@ -461,7 +462,7 @@ public class HPYX002 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setSurveyDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SURVEY_DATE)), surveyDate));
setSurveyDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_SURVEY_DATE))), surveyDate));
setDistrict(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DISTRICT)), district));
setClient(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CLIENT)), client));
setBuyMotive(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BUY_MOTIVE)), buyMotive));
......
package com.baosight.hpjx.hp.yx.domain;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
import com.baosight.iplat4j.core.ei.EiColumn;
......@@ -464,7 +465,7 @@ public class HPYX003 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setSurveyDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SURVEY_DATE)), surveyDate));
setSurveyDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_SURVEY_DATE))), surveyDate));
setDistrict(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DISTRICT)), district));
setProductName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRODUCT_NAME)), productName));
setQuantity(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_QUANTITY)), quantity));
......
package com.baosight.hpjx.hp.yx.domain;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
......@@ -457,7 +458,7 @@ public class HPYX004 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setSurveyDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_SURVEY_DATE)), surveyDate));
setSurveyDate(StringUtils.defaultIfEmpty(StringUtils.toString(DateUtils.formatShort(map.get(FIELD_SURVEY_DATE))), surveyDate));
setDistrict(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DISTRICT)), district));
setProductGoodBad(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRODUCT_GOOD_BAD)), productGoodBad));
setPriceGoodBad(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PRICE_GOOD_BAD)), priceGoodBad));
......
......@@ -380,9 +380,9 @@
this.queryZHCLInfo();
this.setOption2();
this.queryXMinfo();
this.$refs.homepageleft.queryRCLInfo();
this.$refs.homepageleft.queryYCLinfo();
this.$refs.homepageleft.queryNCLinfo();
//this.$refs.homepageleft.queryRCLInfo();
//this.$refs.homepageleft.queryYCLinfo();
//this.$refs.homepageleft.queryNCLinfo();
},
queryCompanyInfo() {
let _this = this;
......@@ -481,9 +481,17 @@
// { product: '生产四组', zp: 72.4, jh: 53.9, zh: 39.1 }
// ]
},
xAxis: {type: 'category'},
xAxis: {
type: 'category',
splitLine: {
show: false // 隐藏x轴的背景线条
}
},
yAxis: {
type: 'value'
type: 'value',
splitLine: {
show: false // 隐藏x轴的背景线条
}
},
series: [
{
......
......@@ -61,7 +61,8 @@ module.exports = {
data(){
return {
name: '红安',
dataPicker:new Date,
factoryCode:this.factory,
dataPicker: this.datapicker,
queryRCLList:['用工量/工','实际产量/T','人均产量/工'],
queryInfoList:['ygl','sjcl','rjcl'],
queryMonthList:['ljygl','ljsjcl','ljrjcl'],
......@@ -72,6 +73,20 @@ module.exports = {
queryYearObject:[],
};
},
watch: {
datapicker(val) {
this.dataPicker = val;
this.queryRCLInfo();
this.queryYCLinfo();
this.queryNCLinfo();
},
factory(val){
this.factoryCode = val;
this.queryRCLInfo();
this.queryYCLinfo();
this.queryNCLinfo();
}
},
mounted(){
this.queryRCLInfo();
this.queryYCLinfo();
......@@ -81,8 +96,8 @@ module.exports = {
queryRCLInfo(){
let _this = this;
var inInfo = new EiInfo();
inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-date',this.datapicker)
inInfo.set('inqu_status-0-factoryCode',this.factoryCode)
inInfo.set('inqu_status-0-date',this.dataPicker)
IPLAT.EiCommunicator.send('HPBI003', 'queryRCLInfo', inInfo, {
onSuccess: function (res) {
if(undefined != res.extAttr.result[0]){
......@@ -99,8 +114,8 @@ module.exports = {
queryYCLinfo(){
let _this = this;
var inInfo = new EiInfo();
inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-date',this.datapicker)
inInfo.set('inqu_status-0-factoryCode',this.factoryCode)
inInfo.set('inqu_status-0-date',this.dataPicker)
IPLAT.EiCommunicator.send('HPBI003', 'queryYCLinfo', inInfo, {
onSuccess: function (res) {
if(undefined != res.extAttr.result[0]){
......@@ -117,8 +132,8 @@ module.exports = {
queryNCLinfo(){
let _this = this;
var inInfo = new EiInfo();
inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-date',this.datapicker)
inInfo.set('inqu_status-0-factoryCode',this.factoryCode)
inInfo.set('inqu_status-0-date',this.dataPicker)
IPLAT.EiCommunicator.send('HPBI003', 'queryNCLinfo', inInfo, {
onSuccess: function (res) {
if(undefined != res.extAttr.result[0]) {
......
......@@ -118,6 +118,19 @@ $(function() {
return options.thick == 0 ? "-" : options.thick;
}
}],
exportGrid: {
beforeExport: function (gridInstance) {
return true;
},
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "采购入库单_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportServiceName: "HPKC001",
exportMethodName: "export",
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function (grid) {
// 此grid对象
......
......@@ -48,7 +48,7 @@
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" sort="all">
<EF:EFColumn ename="id" cname="内码" hidden="true"/>
<EF:EFColumn ename="purchaseNo" cname="采购单号" enable="false" width="130" align="center"/>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="90" align="center" editType="date"
......@@ -70,12 +70,12 @@
required="true" readonly="true"/>
<EF:EFColumn ename="unitWeight" cname="单重(KG)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="weight" cname="总重(T)" enable="false" width="120" align="right" format="{0:N3}"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="right" format="{0:N3}" readonly="true"/>
<EF:EFColumn ename="material" cname="材质" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true"/>
<EF:EFColumn ename="length" cname="长(MM)" width="80" align="right" format="{0:N3}" readonly="true" sort="false"/>
<EF:EFColumn ename="width" cname="宽(MM)" width="80" align="right" format="{0:N3}" readonly="true" sort="false"/>
<EF:EFColumn ename="thick" cname="厚(MM)" width="80" align="right" format="{0:N3}" readonly="true" sort="false"/>
<EF:EFColumn ename="coefficient" cname="系数" width="80" align="right" format="{0:N3}" readonly="true" sort="false"/>
<EF:EFColumn ename="material" cname="材质" width="80" align="center" readonly="true" sort="false"/>
<EF:EFColumn ename="unit" cname="单位" width="80" align="center" readonly="true" sort="false"/>
<EF:EFColumn ename="remark" cname="备注" width="150" readonly="true"/>
<EF:EFColumn ename="oldPurchaseNo" cname="原采购单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
......
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