Commit 41336cc5 by 王衍超

Merge branch 'develop' of gitlab.beecode.cn:kunlun/xyst_dinas/xyst_dinas_backend into develop

parents b415eab0 7e829d5b
......@@ -29,11 +29,11 @@
<annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='50'>
</annotation>
</attribute>
<attribute id='c4154a1b-f727-48cf-9ef0-ad1bee512504' name='purchaseSandUnit' columnName='purchase_sand_unit_id' title='购砂单位' type='com.xyst.dinas.project.datamodel.PurchaseSandCompany' default='' precision='' isArray='false'>
<attribute id='c4154a1b-f727-48cf-9ef0-ad1bee512504' name='purchaseSandUnit' columnName='purchase_sand_Unit_id' title='购砂单位' type='com.xyst.dinas.project.datamodel.PurchaseSandCompany' default='' precision='' isArray='false'>
<annotation id='00caecc1-35aa-4342-90c8-250f84609fe4' attributeId='55efd3f5-036a-4ac4-83c9-14e22cf5465a' name='length' value='undefined'></annotation>
<annotation id='95a6dd6d-c676-4265-9c8b-d115c13b472f' attributeId='43768653-e259-4b0f-8c9d-8739f030675b' name='mappingType' value='many-to-one'></annotation>
</attribute>
<attribute id='cbb5b983-299b-4259-97d9-6470651bb18b' name='purchaseSandUnitName' columnName='purchase_sand_unit_name' title='购砂单位名称' type='string' default='' precision='' isArray='false'>
<attribute id='cbb5b983-299b-4259-97d9-6470651bb18b' name='purchaseSandUnitName' columnName='purchase_sand_Unit_name' title='购砂单位名称' type='string' default='' precision='' isArray='false'>
<annotation id='ea154cb8-f939-4e9f-9793-9673d984161f' attributeId='ffc0a199-4038-4ebf-a94f-a0f12bfc76dd' name='length' value='50'>
</annotation>
</attribute>
......@@ -127,15 +127,15 @@
<attribute id='77e202d5-a342-436c-8042-adcaa8dde410' name='purchaseAmount' columnName='purchase_amount' title='砂石量(吨)' type='fixnum' default='' precision='' isArray='false'>
<annotation id='b203f8fa-0ad3-4837-a023-0ef742a74f29' attributeId='ff41e7d3-9fba-4a9b-811a-9b66ab87950d' name='length' value='100'>
</annotation>
<annotation id='4d1596bd-ae0a-4d7e-8258-5dad66493239' attributeId='7b049c9a-56e4-4791-a0a3-451237fd38a1' name='precision' value='10'>
<annotation id='4d1596bd-ae0a-4d7e-8258-5dad66493239' attributeId='7b049c9a-56e4-4791-a0a3-451237fd38a1' name='precision' value='12'>
</annotation>
<annotation id='1a25ed97-846e-4847-aa21-1a0b025c01ed' attributeId='52a3d8ee-92ab-45dc-b668-46408143254d' name='scale' value='2'>
<annotation id='1a25ed97-846e-4847-aa21-1a0b025c01ed' attributeId='52a3d8ee-92ab-45dc-b668-46408143254d' name='scale' value='4'>
</annotation>
</attribute>
<attribute id='77e202d5-a342-436c-8042-adcaa8dde410' name='price' columnName='price' title='单价' type='fixnum' default='' precision='' isArray='false'>
<annotation id='b203f8fa-0ad3-4837-a023-0ef742a74f29' attributeId='ff41e7d3-9fba-4a9b-811a-9b66ab87950d' name='length' value='100'>
</annotation>
<annotation id='4d1596bd-ae0a-4d7e-8258-5dad66493239' attributeId='7b049c9a-56e4-4791-a0a3-451237fd38a1' name='precision' value='10'>
<annotation id='4d1596bd-ae0a-4d7e-8258-5dad66493239' attributeId='7b049c9a-56e4-4791-a0a3-451237fd38a1' name='precision' value='12'>
</annotation>
<annotation id='1a25ed97-846e-4847-aa21-1a0b025c01ed' attributeId='52a3d8ee-92ab-45dc-b668-46408143254d' name='scale' value='2'>
</annotation>
......@@ -143,7 +143,7 @@
<attribute id='77e202d5-a342-436c-8042-adcaa8dde410' name='amount' columnName='amount' title='总价' type='fixnum' default='' precision='' isArray='false'>
<annotation id='b203f8fa-0ad3-4837-a023-0ef742a74f29' attributeId='ff41e7d3-9fba-4a9b-811a-9b66ab87950d' name='length' value='100'>
</annotation>
<annotation id='4d1596bd-ae0a-4d7e-8258-5dad66493239' attributeId='7b049c9a-56e4-4791-a0a3-451237fd38a1' name='precision' value='10'>
<annotation id='4d1596bd-ae0a-4d7e-8258-5dad66493239' attributeId='7b049c9a-56e4-4791-a0a3-451237fd38a1' name='precision' value='12'>
</annotation>
<annotation id='1a25ed97-846e-4847-aa21-1a0b025c01ed' attributeId='52a3d8ee-92ab-45dc-b668-46408143254d' name='scale' value='2'>
</annotation>
......
......@@ -80,7 +80,7 @@
</field>
<field title='购砂单位'>
<name>purchaseSandUnit.id</name>
<name>purchaseSandCompany.id</name>
<type>uuid</type>
<ref>
<type></type>
......@@ -89,7 +89,7 @@
<description></description>
</field>
<field title='购砂单位名称'>
<name>purchaseSandUnit.name</name>
<name>purchaseSandCompany.name</name>
<type>string</type>
<description></description>
</field>
......
......@@ -42,11 +42,11 @@
<m:properties>
<m:property>
<m:key>precision</m:key>
<m:value>10</m:value>
<m:value>12</m:value>
</m:property>
<m:property>
<m:key>scale</m:key>
<m:value>2</m:value>
<m:value>4</m:value>
</m:property>
</m:properties>
</m:annotation>
......@@ -65,7 +65,7 @@
<m:properties>
<m:property>
<m:key>precision</m:key>
<m:value>10</m:value>
<m:value>12</m:value>
</m:property>
<m:property>
<m:key>scale</m:key>
......@@ -88,7 +88,7 @@
<m:properties>
<m:property>
<m:key>precision</m:key>
<m:value>10</m:value>
<m:value>12</m:value>
</m:property>
<m:property>
<m:key>scale</m:key>
......
......@@ -90,7 +90,7 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>purchaseSandUnit.id</m:name>
<m:name>purchaseSandCompany.id</m:name>
<m:title>购砂单位</m:title>
<m:type>uuid</m:type>
<m:ref>
......@@ -100,7 +100,7 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>purchaseSandUnit.name</m:name>
<m:name>purchaseSandCompany.name</m:name>
<m:title>购砂单位名称</m:title>
<m:type>string</m:type>
<m:ref>
......
......@@ -143,13 +143,13 @@
<column name="dinas_type_id" not-null="false"/>
</many-to-one>
<property name="purchaseAmount" type="big_decimal" not-null="false">
<column name="purchase_amount" precision="10" scale="2"></column>
<column name="purchase_amount" precision="12" scale="4"></column>
</property>
<property name="price" type="big_decimal" not-null="false">
<column name="price" precision="10" scale="2"></column>
<column name="price" precision="12" scale="2"></column>
</property>
<property name="amount" type="big_decimal" not-null="false">
<column name="amount" precision="10" scale="2"></column>
<column name="amount" precision="12" scale="2"></column>
</property>
</class>
</hibernate-mapping>
\ No newline at end of file
......@@ -6,5 +6,7 @@ public interface ProjectFiledConstant {
* 实体名
*/
String PROJECTFILED_NTITY = "com.xyst.dinas.project.datamodel.ProjectFiled";
String PROJECTFILED_DINASTYPE_ENTITY = "com.xyst.dinas.project.datamodel.ProjectFiled$ProjectFiledDinasDetail";
}
package com.xyst.dinas.project.dao;
import java.util.List;
import java.util.UUID;
import com.beecode.bcp.type.KObject;
public interface ProjectFiledDao {
List<KObject> queryProjectFiledByName(String name);
KObject load(UUID id);
List<KObject> loadDinasTypeDetail(UUID id);
}
package com.xyst.dinas.project.internal.dao;
import java.util.List;
import java.util.UUID;
import org.hibernate.HibernateException;
import org.hibernate.Session;
......@@ -31,4 +32,25 @@ public class ProjectFiledDaoImpl implements ProjectFiledDao, ProjectFiledConstan
});
}
@Override
public KObject load(UUID id) {
return (KObject) template.load(PROJECTFILED_NTITY, id);
}
private static final String getProjectDinasDetailById="from " + PROJECTFILED_DINASTYPE_ENTITY+" as v where v.master.id=:id and (v.master.discard is null or v.master.discard = 0)";
@Override
public List<KObject> loadDinasTypeDetail(UUID id) {
return template.execute(new HibernateCallback<List<KObject>>() {
@Override
public List<KObject> doInHibernate(Session session) throws HibernateException {
Query<KObject> query = session.createQuery(getProjectDinasDetailById, KObject.class);
query.setParameter("id", id);
return query.getResultList();
}
});
}
}
package com.xyst.dinas.project.internal.service;
import java.util.List;
import java.util.UUID;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import com.beecode.bcp.type.KObject;
......@@ -24,4 +27,18 @@ public class ProjectFiledServiceImpl implements ProjectFiledService {
return flag;
}
@Override
public JSONArray getDinasTypeByProjectId(String id) {
List<KObject> detail = projectFiledDao.loadDinasTypeDetail(UUID.fromString(id));
JSONArray result = new JSONArray();
for(KObject item : detail) {
JSONObject obj = new JSONObject();
obj.put("dinasTypeId", item.get("dinasType").getUuid("id"));
obj.put("dinasTypeName", item.get("dinasType").getString("dinasTypeName"));
obj.put("weight", item.getFloat("weight"));
result.put(obj);
}
return result;
}
}
package com.xyst.dinas.project.service;
import org.json.JSONArray;
public interface ProjectFiledService {
Boolean verifyName(String name);
JSONArray getDinasTypeByProjectId(String id);
}
......@@ -41,4 +41,16 @@ public class ProjectFiledController {
}
return null;
}
/**
* @Description: 根据项目id查询砂石种类
* @param id
* @return return_type
* @throws
*/
@ResponseBody
@RequestMapping(value = "/project/projectFiled/getDinasTypeByProjectId", method = RequestMethod.GET)
public String getDinasTypeByProjectId(@RequestParam("id") String id) {
return projectFiledService.getDinasTypeByProjectId(id).toString();
}
}
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