Commit 3b3b6ecd by 杨清松

执行预警查询

parent 8704b329
......@@ -13,6 +13,7 @@ import com.beecode.inz.workflow.config.TriggerCondition;
import com.xyst.dinas.contract.constant.ContractConstant;
import com.xyst.dinas.contract.internal.dao.ContractInfoDao;
import com.xyst.dinas.contract.internal.service.ContractServiceImpl;
import com.xyst.dinas.contract.query.processor.PerformWarningProcessor;
import com.xyst.dinas.contract.service.ContractService;
import com.xyst.dinas.contract.web.ContractController;
/**
......@@ -58,4 +59,9 @@ public class ContractConfiguration {
configuration.setProcessConfiguration(processConfig);
return configuration;
}
@Bean("com.xyst.dinas.contract.query.processor.PerformWarningProcessor")
public PerformWarningProcessor performWarningProcessor() {
return new PerformWarningProcessor();
}
}
package com.xyst.dinas.contract.internal.dao;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.HibernateOperations;
import com.beecode.bcp.type.KObject;
import com.xyst.dinas.contract.constant.ContractConstant;
public class ContractDao {
@Autowired
private HibernateOperations template;
public KObject load(UUID id) {
return (KObject) template.get(ContractConstant.ENTITY_CONTRACT, id);
}
}
......@@ -76,6 +76,12 @@ public class ContractServiceImpl implements ContractService{
// BillData equipmentBillData = equipmentBill.getData();
}
@Override
public KObject queryContractById(UUID id) {
KObject kobject = contractInfoDao.load(id);
return kobject;
}
}
package com.xyst.dinas.contract.query.processor;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import com.beecode.bcp.type.KObject;
import com.beecode.inz.query.entity.RowData;
import com.beecode.inz.query.processor.DataProcessor;
import com.beecode.inz.query.processor.DataProcessorContext;
import com.xyst.dinas.contract.service.ContractService;
public class PerformWarningProcessor implements DataProcessor {
@Autowired
private ContractService contractService;
@Override
public void process(DataProcessorContext context) {
List<RowData> rowDatas = context.getRowDatas();
for (RowData row : rowDatas) {
//合同,项目,购砂单位
UUID contractId = UUID.fromString(row.get("id").toString());
KObject contract = contractService.queryContractById(contractId);
row.put("projectName", contract.isNull("project") ? "" : contract.get("project").getString("name"));
row.put("contractName", contract.getString("contractName"));
row.put("purchaseSandUnitName", contract.getString("purchaseSandUnitName"));
}
}
}
package com.xyst.dinas.contract.service;
public class ContractPerformWarningService {
}
......@@ -23,4 +23,6 @@ public interface ContractService {
* @return
*/
Set<String> getProjectListByPurSandId(UUID purchaseSandId);
KObject queryContractById(UUID id);
}
<model>
<header>
<type>inz.query.Query</type>
<package>com.xyst.dinas.contract.query</package>
<name>WarningExe</name>
<title>执行预警</title>
<tags></tags>
<description></description>
</header>
<content>
<customQuery id='7226bf7b-a061-4554-bef3-c7968b05fdba'>
<kclass>com.xyst.dinas.contract.datamodel.WarningExe</kclass>
<dataProcessor>com.xyst.dinas.contract.query.processor.PerformWarningProcessor</dataProcessor>
<innerScene title='全部'>
<id>fa6d9e0d-a774-4f90-b20a-b4b3d5b468a6</id>
<javaImplement>com.beecode.inz.common.scene.CommonAllScene</javaImplement>
<defaultExecute></defaultExecute>
<hide></hide>
</innerScene>
<innerScene title='已废弃'>
<id>12cb7e87-edde-4447-ac5f-53fcd2bdc163</id>
<javaImplement>com.beecode.inz.common.scene.DefaultDiscardScene</javaImplement>
<defaultExecute></defaultExecute>
<hide></hide>
</innerScene>
<field title='id'>
<name>id</name>
<type>uuid</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='开始时间'>
<name>startTime</name>
<type>datetime</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='结束时间'>
<name>endTime</name>
<type>datetime</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='购砂单位'>
<name>purchaseSandUnitName</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='项目名称'>
<name>projectName</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='合同名称'>
<name>contractName</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='预警指标'>
<name>target</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='实际值'>
<name>min</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='创建时间'>
<name>createTime</name>
<type>datetime</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='创建人'>
<name>creator.name</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='修改时间'>
<name>modifyTime</name>
<type>datetime</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='修改人'>
<name>modifier.name</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
</customQuery>
</content>
</model>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/inz-query">
<specification>1.0</specification>
<id>7226bf7b-a061-4554-bef3-c7968b05fdba</id>
<name>com.xyst.dinas.contract.query.WarningExe</name>
<title>执行预警</title>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.contract.datamodel.WarningExe</dependency>
<content>
<m:query>
<m:type>com.xyst.dinas.contract.datamodel.WarningExe</m:type>
<m:dataProcessor>com.xyst.dinas.contract.query.processor.PerformWarningProcessor</m:dataProcessor>
<m:authorityItem></m:authorityItem>
<m:innerScenes>
<m:innerScene>
<m:id>fa6d9e0d-a774-4f90-b20a-b4b3d5b468a6</m:id>
<m:title>全部</m:title>
<m:javaImplement>com.beecode.inz.common.scene.CommonAllScene</m:javaImplement>
<m:defaultExecute></m:defaultExecute>
<m:hide></m:hide>
</m:innerScene>
<m:innerScene>
<m:id>12cb7e87-edde-4447-ac5f-53fcd2bdc163</m:id>
<m:title>已废弃</m:title>
<m:javaImplement>com.beecode.inz.common.scene.DefaultDiscardScene</m:javaImplement>
<m:defaultExecute></m:defaultExecute>
<m:hide></m:hide>
</m:innerScene>
</m:innerScenes>
<m:fields>
<m:field>
<m:name>id</m:name>
<m:title>id</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>startTime</m:name>
<m:title>开始时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>endTime</m:name>
<m:title>结束时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>purchaseSandUnitName</m:name>
<m:title>购砂单位</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>projectName</m:name>
<m:title>项目名称</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>contractName</m:name>
<m:title>合同名称</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>target</m:name>
<m:title>预警指标</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>min</m:name>
<m:title>实际值</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>createTime</m:name>
<m:title>创建时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>creator.name</m:name>
<m:title>创建人</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>modifyTime</m:name>
<m:title>修改时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>modifier.name</m:name>
<m:title>修改人</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
</m:fields>
</m:query>
</content>
</metadata>
......@@ -41,7 +41,21 @@
<property name="min" type="nstring" not-null="false">
<column name="min" length="100"></column>
</property>
<property name="discard" type="boolean" not-null="false">
<column name="discard"></column>
</property>
<property name="createTime" type="timestamp" not-null="false">
<column name="create_time"></column>
</property>
<many-to-one name="creator" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
<column name="creator_id" not-null="false"/>
</many-to-one>
<property name="modifyTime" type="timestamp" not-null="false">
<column name="modify_time"></column>
</property>
<many-to-one name="modifier" entity-name="com.beecode.bap.staff.datamodel.Staff" fetch="select">
<column name="modifier_id" not-null="false"/>
</many-to-one>
</class>
</hibernate-mapping>
\ No newline at end of file
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