Commit 0bed51d5 by shiwenbo

修改自提车辆后端接口

parent 4d0e5bdd
......@@ -9,4 +9,6 @@ public interface SelfPickupCarDao {
void update(KObject kobject);
UUID create(KObject kobject);
KObject load(UUID id);
}
......@@ -7,6 +7,7 @@ import org.springframework.orm.hibernate5.HibernateOperations;
import org.springframework.stereotype.Repository;
import com.beecode.bcp.type.KObject;
import com.xyst.dinas.contract.constant.SelfPickupCarConstant;
import com.xyst.dinas.contract.dao.SelfPickupCarDao;
@Repository
......@@ -22,4 +23,8 @@ public class SelfPickupCarDaoImpl implements SelfPickupCarDao {
public UUID create(KObject kObject) {
return (UUID) template.save(kObject.getType().getName(), kObject);
}
public KObject load(UUID id) {
return (KObject) template.get(SelfPickupCarConstant.ENTITY, id);
}
}
......@@ -3,6 +3,7 @@ package com.xyst.dinas.contract.internal.service;
import java.util.Date;
import java.util.UUID;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -38,11 +39,18 @@ public class SelfPickupCarServiceImpl implements SelfPickupCarService {
@Override
@Transactional
public void update(KObject kobject) {
public void update(String param) {
JSONObject obj = new JSONObject(param);
String id = obj.getString("id");
String carInfo = obj.getString("carInfo");
KObject kobject = selfPickupCarDao.load(UUID.fromString(id));
KObject staff = AminoContextHolder.getContext().getStaff();
kobject.set(BaseConstants.MODIFIER, staff);
kobject.set(BaseConstants.MODIFY_TIME, new Date());
kobject.set(SelfPickupCarConstant.CAR_INFO, carInfo);
selfPickupCarDao.update(kobject);
}
......
......@@ -8,5 +8,5 @@ public interface SelfPickupCarService {
UUID create(KObject kobject);
void update(KObject kobject);
void update(String param);
}
......@@ -31,10 +31,13 @@ public class SelfPickupCarController {
@PostMapping("/selfPickupCar/update")
public CommonResult update(@RequestBody String selfPickupCarInfo) {
KClass type = Amino.getApplicationMetadataContext().getBean(SelfPickupCarConstant.ENTITY,
KClass.class);
KObject kObject = JSONObjectUtils.toObject(selfPickupCarInfo, type);
selfPickupCarService.update(kObject);
selfPickupCarService.update(selfPickupCarInfo);
return CommonResult.SUCCESS_RESULT;
}
@PostMapping("/sand/user/selfPickupCar/update")
public CommonResult updateForCompany(@RequestBody String selfPickupCarInfo) {
selfPickupCarService.update(selfPickupCarInfo);
return CommonResult.SUCCESS_RESULT;
}
}
<model>
<header>
<type>inz.query.Query</type>
<package>com.xyst.dinas.contract.query</package>
<name>SelfPickupCarNoAuthFilterScene</name>
<title>自提车辆</title>
<tags></tags>
<description></description>
</header>
<content>
<customQuery id='9e608aff-d801-4d21-83bd-77c650f06d66'>
<kclass>com.xyst.dinas.contract.datamodel.SelfPickupCar</kclass>
<dataProcessor></dataProcessor>
<innerScene title='全部'>
<id>aa22e7aa-741a-4a19-aee8-09ed1315c575</id>
<javaImplement>com.beecode.inz.common.scene.CommonAllScene</javaImplement>
<defaultExecute></defaultExecute>
<hide></hide>
</innerScene>
<innerScene title='已废弃'>
<id>dd174342-9395-4f2c-972f-71841ed302fb</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='项目ID'>
<name>project.id</name>
<type>uuid</type>
<ref>
<type></type>
<name>com.xyst.dinas.project.datamodel.ProjectFiled</name>
</ref>
<description></description>
</field>
<field title='项目编号'>
<name>project.projectNum</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='项目名称'>
<name>project.projectName</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='区域公司ID'>
<name>regionalCompany.id</name>
<type>uuid</type>
<ref>
<type></type>
<name>com.xyst.dinas.biz.datamodel.xystOrganization</name>
</ref>
<description></description>
</field>
<field title='区域公司名称'>
<name>regionalCompany.name</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='购砂单位'>
<name>purchaseSandUnit.id</name>
<type>uuid</type>
<ref>
<type></type>
<name>com.xyst.dinas.project.datamodel.PurchaseSandCompany</name>
</ref>
<description></description>
</field>
<field title='购砂单位名称'>
<name>purchaseSandUnit.name</name>
<type>string</type>
<description></description>
</field>
<field title='合同'>
<name>contract.id</name>
<type>uuid</type>
<ref>
<type></type>
<name>com.xyst.dinas.contract.datamodel.Contract</name>
</ref>
<description></description>
</field>
<field title='合同名称'>
<name>contract.contractName</name>
<type>string</type>
<description></description>
</field>
<field title='合同编号'>
<name>contract.contractCode</name>
<type>string</type>
<description></description>
</field>
<field title='车辆信息'>
<name>carInfo</name>
<type>string</type>
<description></description>
</field>
<field title='备注'>
<name>memo</name>
<type>string</type>
<description></description>
</field>
<field title='车辆行驶证'>
<name>attId</name>
<type>uuid</type>
<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>
<field title='废弃'>
<name>discard</name>
<type>boolean</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>9e608aff-d801-4d21-83bd-77c650f06d66</id>
<name>com.xyst.dinas.contract.query.SelfPickupCarNoAuthFilterScene</name>
<title>自提车辆</title>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.contract.datamodel.SelfPickupCar</dependency>
<content>
<m:query>
<m:type>com.xyst.dinas.contract.datamodel.SelfPickupCar</m:type>
<m:dataProcessor></m:dataProcessor>
<m:authorityItem></m:authorityItem>
<m:innerScenes>
<m:innerScene>
<m:id>aa22e7aa-741a-4a19-aee8-09ed1315c575</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>dd174342-9395-4f2c-972f-71841ed302fb</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>project.id</m:name>
<m:title>项目ID</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name>com.xyst.dinas.project.datamodel.ProjectFiled</m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>project.projectNum</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>project.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>regionalCompany.id</m:name>
<m:title>区域公司ID</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name>com.xyst.dinas.biz.datamodel.xystOrganization</m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>regionalCompany.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>purchaseSandUnit.id</m:name>
<m:title>购砂单位</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name>com.xyst.dinas.project.datamodel.PurchaseSandCompany</m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>purchaseSandUnit.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>contract.id</m:name>
<m:title>合同</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name>com.xyst.dinas.contract.datamodel.Contract</m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>contract.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>contract.contractCode</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>carInfo</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>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>attId</m:name>
<m:title>车辆行驶证</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>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:field>
<m:name>discard</m:name>
<m:title>废弃</m:title>
<m:type>boolean</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>
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