Commit f86d055c by 杨清松

合同预警查询

parent edbca53d
...@@ -19,4 +19,6 @@ public interface DinasOrganizationDao { ...@@ -19,4 +19,6 @@ public interface DinasOrganizationDao {
KObject load(UUID id); KObject load(UUID id);
List<UUID> queryStaffByPostId(String postId); List<UUID> queryStaffByPostId(String postId);
List<UUID> queryStaffByRegionalCompany(UUID id);
} }
...@@ -129,7 +129,27 @@ public class DinasOrganizationDaoImpl implements DinasOrganizationDao, DinasOrga ...@@ -129,7 +129,27 @@ public class DinasOrganizationDaoImpl implements DinasOrganizationDao, DinasOrga
query.setParameter("postId", postId); query.setParameter("postId", postId);
List<Tuple> result = query.getResultList(); List<Tuple> result = query.getResultList();
for (Tuple tuple : result) { for (Tuple tuple : result) {
System.out.println(Convert.toUUID(tuple.get(0))); uuids.add(Convert.toUUID(tuple.get(0)));
}
return uuids;
}
});
}
private static final String queryStaffByRegionalCompanyHql = "SELECT f.member.id FROM "+ ORGANIZATION_FOLLOWER_ENTITY +" as f WHERE f.following.id =:id";
@Override
public List<UUID> queryStaffByRegionalCompany(UUID id) {
return template.execute(new HibernateCallback<List<UUID>>() {
List<UUID> uuids = new ArrayList<>();
@Override
public List<UUID> doInHibernate(Session session) throws HibernateException {
//List<Tuple> uuids1 = session.createSQLQuery(queryStaffSql).addEntity(Tuple.class).setParameter("postId", postId).list();
Query<Tuple> query = session.createQuery(queryStaffByRegionalCompanyHql, Tuple.class);
query.setParameter("id", id);
List<Tuple> result = query.getResultList();
for (Tuple tuple : result) {
uuids.add(Convert.toUUID(tuple.get(0))); uuids.add(Convert.toUUID(tuple.get(0)));
} }
return uuids; return uuids;
......
...@@ -61,6 +61,12 @@ public class DinasOrganizationServiceImpl implements DinasOrganizationService { ...@@ -61,6 +61,12 @@ public class DinasOrganizationServiceImpl implements DinasOrganizationService {
return staffList; return staffList;
} }
@Override
public Object queryStaffByRegionalCompany(UUID id) {
List<UUID> staffList = dinasOrganizationDao.queryStaffByRegionalCompany(id);
return ResponseObj.success("查询成功", staffList);
}
} }
...@@ -18,4 +18,6 @@ public interface DinasOrganizationService { ...@@ -18,4 +18,6 @@ public interface DinasOrganizationService {
KObject load(UUID id); KObject load(UUID id);
List<UUID> queryStaffByPostId(String postId); List<UUID> queryStaffByPostId(String postId);
Object queryStaffByRegionalCompany(UUID fromString);
} }
...@@ -36,4 +36,16 @@ public class DinasOrganizationController { ...@@ -36,4 +36,16 @@ public class DinasOrganizationController {
String userName = new JSONObject(body).getString("userName"); String userName = new JSONObject(body).getString("userName");
return dinasOrganizationService.queryOrganizationByUserName(userName); return dinasOrganizationService.queryOrganizationByUserName(userName);
} }
/**
* @Description: 查询区域公司下的所有人
* @param id
* @return return_type
* @throws
*/
@ResponseBody
@RequestMapping(value = "/dinasBiz/organization/queryStaffByRegionalCompany/{id}", method = RequestMethod.GET)
public Object queryPositionIsUse(@PathVariable("id") String id) {
return dinasOrganizationService.queryStaffByRegionalCompany(UUID.fromString(id));
}
} }
...@@ -37,27 +37,17 @@ ...@@ -37,27 +37,17 @@
<type>int</type> <type>int</type>
<description></description> <description></description>
</field> </field>
<field title='业务id'>
<field title='购砂单位'> <name>billId</name>
<name>purchaseSandUnitName</name> <type>uuid</type>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='项目名称'>
<name>projectName</name>
<type>string</type>
<ref> <ref>
<type></type> <type></type>
<name></name> <name></name>
</ref> </ref>
<description></description> <description></description>
</field> </field>
<field title='合同名称'> <field title='预警指标'>
<name>contractName</name> <name>target</name>
<type>string</type> <type>string</type>
<ref> <ref>
<type></type> <type></type>
...@@ -65,18 +55,8 @@ ...@@ -65,18 +55,8 @@
</ref> </ref>
<description></description> <description></description>
</field> </field>
<field title='备注'>
<field title='业务id'> <name>memo</name>
<name>billId</name>
<type>uuid</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='预警指标'>
<name>target</name>
<type>string</type> <type>string</type>
<ref> <ref>
<type></type> <type></type>
......
...@@ -50,36 +50,6 @@ ...@@ -50,36 +50,6 @@
<m:desc></m:desc> <m:desc></m:desc>
</m:field> </m:field>
<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:name>target</m:name>
<m:title>预警指标</m:title> <m:title>预警指标</m:title>
<m:type>string</m:type> <m:type>string</m:type>
...@@ -120,6 +90,16 @@ ...@@ -120,6 +90,16 @@
<m:desc></m:desc> <m:desc></m:desc>
</m:field> </m:field>
<m:field> <m:field>
<m:name>memo</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:name>createTime</m:name>
<m:title>创建时间</m:title> <m:title>创建时间</m:title>
<m:type>datetime</m:type> <m:type>datetime</m:type>
......
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