Commit 0591eacc by 王衍超

解决冲突;

parents c8568aa5 26c02c2e
......@@ -9,11 +9,13 @@ dependencies {
compile lib.jackson_datatype_jdk8
compile lib.jackson_datatype_jsr310
compile lib.json
compile lib.bcp_advanced_query
compile "com.beecode:bap2.participant:${aminoVersion}"
compile "com.beecode:bcp.org:${aminoVersion}"
compile "com.beecode:bap2.department:${aminoVersion}"
compile "com.beecode:bap2.staff:${aminoVersion}"
compile 'com.deepoove:poi-tl:1.5.0'
compile project(":inz.common")
compile project(":inz.query")
......
......@@ -3,6 +3,10 @@ package com.xyst.dinas.biz.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.xyst.dinas.biz.init.OrganizationDataInitializer;
import com.xyst.dinas.biz.web.SandAdvancedQueryController;
import com.xyst.dinas.biz.web.SandSceneController;
import com.xyst.dinas.biz.web.WarehouseAdvancedQueryController;
import com.xyst.dinas.biz.web.WarehouseSceneController;
import com.xyst.dinas.biz.handler.DinasPrepareEventHandlers;
@Configuration
......@@ -17,4 +21,24 @@ public class BizDataInitializerConfig {
public OrganizationDataInitializer organizationDataInitializer(){
return new OrganizationDataInitializer();
}
@Bean("com.xyst.dinas.biz.web.SandAdvancedQueryController")
public SandAdvancedQueryController sandAdvancedQueryController(){
return new SandAdvancedQueryController();
}
@Bean("com.xyst.dinas.biz.web.WarehouseAdvancedQueryController")
public WarehouseAdvancedQueryController warehouseAdvancedQueryController(){
return new WarehouseAdvancedQueryController();
}
@Bean("com.xyst.dinas.biz.web.SandSceneController")
public SandSceneController sandSceneController(){
return new SandSceneController();
}
@Bean("com.xyst.dinas.biz.web.OrganizationDataInitializer")
public WarehouseSceneController warehouseSceneController(){
return new WarehouseSceneController();
}
}
package com.xyst.dinas.biz.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.beecode.amino.common.Convert;
import com.beecode.amino.core.Amino;
import com.beecode.bcp.advanced.query.QueryPreprocessor;
import com.beecode.bcp.advanced.query.QueryPreprocessorFactory;
import com.beecode.bcp.advanced.query.bean.PaginationResult;
import com.beecode.bcp.advanced.query.bean.QueryParameter;
import com.beecode.bcp.advanced.query.bean.QueryTemplate;
import com.beecode.bcp.advanced.query.bean.QueryView;
import com.beecode.bcp.advanced.query.bean.RowData;
import com.beecode.bcp.advanced.query.service.QueryMetaService;
import com.beecode.bcp.advanced.query.service.QueryService;
import com.fasterxml.jackson.databind.JsonNode;
@RestController
@RequestMapping("/sand/user/bcp/query/advance")
public class SandAdvancedQueryController {
@Autowired
private QueryService service;
@Autowired
private QueryMetaService metaService;
@PostMapping(value = "/view")
public Object getViewContent (@RequestParam String queryView){
QueryView view = Amino.getApplicationContext().getBean(queryView, QueryView.class);
return view.getViewContent();
}
@PostMapping(value = "/query")
public String getQueryInfo(@RequestBody QueryParameter queryParameter) {
QueryTemplate template = metaService.getQueryTemplate(queryParameter.getDatasource());
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(queryParameter, template);
List<RowData> rows = service.queryList(preprocessor);
int count = service.queryCount(preprocessor);
PaginationResult result = new PaginationResult();
result.setRows(rows);
result.setTotalCount(count);
return result.toString();
}
@PostMapping(value = "/count")
public Object getCount(@RequestBody QueryParameter queryParameter) {
QueryTemplate template = metaService.getQueryTemplate(queryParameter.getDatasource());
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(queryParameter, template);
return service.queryCount(preprocessor);
}
@PostMapping(value = "/total")
public String queryTotal(@RequestBody QueryParameter queryParameter) {
QueryTemplate template = metaService.getQueryTemplate(queryParameter.getDatasource());
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(queryParameter, template);
RowData row = service.queryTotal(preprocessor);
if(null == row) {
return RowData.EMPTY.toString();
}
return row.toString();
}
@PostMapping(value = "/subTotal")
public String querySubTotal(@RequestBody QueryParameter queryParameter) {
QueryTemplate template = metaService.getQueryTemplate(queryParameter.getDatasource());
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(queryParameter, template);
RowData row = service.querySubTotal(preprocessor);
if(null == row) {
return RowData.EMPTY.toString();
}
return row.toString();
}
@PostMapping(value = "/counts")
public List<Integer> getCounts(@RequestBody List<QueryParameter> queryParameters) {
List<Integer> result = new ArrayList<>();
for (QueryParameter qp : queryParameters) {
result.add((Integer) getCount(qp));
}
return result;
}
@PostMapping(value = "/groupCount")
public List<Integer> getGroupCount(@RequestBody JsonNode body) {
JsonNode groupCount = body.get("groupCount");
JsonNode names = body.get("groupNames");
String datasource = groupCount.get("dataSource").asText();
QueryTemplate template = metaService.getQueryTemplate(datasource);
QueryParameter qp = new QueryParameter();
qp.setDatasource(datasource);
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(qp, template);
Map<String, Integer> valueMap = new HashMap<>();
List<RowData> rds = service.queryList(preprocessor);
int allcount = 0;
for (RowData rd : rds) {
int cv = Convert.toInt(rd.get("value"));
valueMap.put((String) rd.get("key"), cv);
allcount += cv;
}
if (!valueMap.containsKey("all")) {
valueMap.put("all", allcount);
}
List<Integer> result = new ArrayList<>();
JsonNode keyMap = groupCount.get("keyMap");
for (int i = 0; i < names.size(); i++) {
String name = names.get(i).asText();
String value = keyMap.get(name).asText();
result.add(valueMap.get(value));
}
return result;
}
}
package com.xyst.dinas.biz.web;
import java.util.List;
import java.util.UUID;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.beecode.bcp.advanced.query.StringUtils;
import com.beecode.bcp.advanced.query.constant.CustomSceneConstant;
import com.beecode.bcp.advanced.query.exception.SceneException;
import com.beecode.bcp.advanced.query.service.SceneService;
import com.beecode.bcp.type.KClass;
import com.beecode.bcp.type.KObject;
import com.beecode.bcp.type.json.JSONObjectUtils;
@RestController
@RequestMapping(value = "/sand/user/bcp/query/advance/scene")
public class SandSceneController {
@Autowired
private SceneService service;
@Autowired
@Qualifier(CustomSceneConstant.ENTITY)
private KClass kclass;
/**
* 创建新的场景
* @param scene 场景对象
*/
@PostMapping(value="/create")
public void create(@RequestBody String scene) {
KObject object = toKObject(scene);
String title = object.getString(CustomSceneConstant.TITLE);
if(StringUtils.isBlank(title)) {
throw new SceneException("场景标题不能为空");
}
String content = object.getString(CustomSceneConstant.CONTENT);
if(StringUtils.isBlank(content)) {
throw new SceneException("场景内容不能为空");
}
service.create(object);
}
/**
* 修改现有场景
* @param scene 场景对象
*/
@PostMapping(value = "/update")
public void update(@RequestBody String scene) {
KObject object = toKObject(scene);
// ContextUser user = CurrentInfo.getCurrentUser();
// if(null == user) {
// throw new SceneException("当前登录人信息获取失败");
// }
// UUID creatorId = object.getUuid(CustomSceneConstant.CREATOR_ID);
// if(null == creatorId) {
// throw new SceneException("不能修改非本人创建的场景");
// }
// UUID currentUserId = UUID.fromString(user.getId());
// if(!creatorId.equals(currentUserId)) {
// throw new SceneException("不能修改非本人创建的场景");
// }
service.update(object);
}
/**
* 获取当前登录人的所有场景
* @param viewName 查询视图元数据名称
* @param group 查询页签名称
* @return
*/
@GetMapping(value = "/query")
public String query(@RequestParam(name = "viewName", required = true) String viewName,
@RequestParam(name = "group", required = true) String group) {
// ContextUser user = CurrentInfo.getCurrentUser();
// if(null == user) {
// throw new SceneException("当前登录人信息获取失败");
// }
List<KObject> scenes = service.query(viewName, group);
if(scenes.isEmpty()) {
return "[]";
}
return JSONObjectUtils.toArrayNode(scenes).toString();
}
/**
* 删除场景
* @param id 场景id
*/
@PostMapping(value="/delete/{id}")
public void delete(@PathVariable("id") String sid) {
if(StringUtils.isBlank(sid)) {
return;
}
UUID id = UUID.fromString(sid);
service.delete(id);
}
private KObject toKObject(String content) {
JSONObject object = new JSONObject(content);
KObject kobject = kclass.newInstance();
UUID id = getUUIDField(object, CustomSceneConstant.ID);
kobject.set(CustomSceneConstant.ID, id);
kobject.set(CustomSceneConstant.CREATE_TIME, object.opt(CustomSceneConstant.CREATE_TIME));
kobject.set(CustomSceneConstant.MODIFY_TIME, object.opt(CustomSceneConstant.MODIFY_TIME));
kobject.set(CustomSceneConstant.CREATOR_ID, getUUIDField(object, CustomSceneConstant.CREATOR_ID));
kobject.set(CustomSceneConstant.CREATOR_NAME, object.optString(CustomSceneConstant.CREATOR_NAME));
kobject.set(CustomSceneConstant.TITLE, object.optString(CustomSceneConstant.TITLE));
kobject.set(CustomSceneConstant.VIEW_NAME, object.optString(CustomSceneConstant.VIEW_NAME));
kobject.set(CustomSceneConstant.GROUP, object.optString(CustomSceneConstant.GROUP));
kobject.set(CustomSceneConstant.CONTENT, object.optString(CustomSceneConstant.CONTENT));
return kobject;
}
private UUID getUUIDField(JSONObject json, String field) {
String sid = json.optString(field);
return StringUtils.isBlank(sid) ? null : UUID.fromString(sid);
}
}
package com.xyst.dinas.biz.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.beecode.amino.common.Convert;
import com.beecode.amino.core.Amino;
import com.beecode.bcp.advanced.query.QueryPreprocessor;
import com.beecode.bcp.advanced.query.QueryPreprocessorFactory;
import com.beecode.bcp.advanced.query.bean.PaginationResult;
import com.beecode.bcp.advanced.query.bean.QueryParameter;
import com.beecode.bcp.advanced.query.bean.QueryTemplate;
import com.beecode.bcp.advanced.query.bean.QueryView;
import com.beecode.bcp.advanced.query.bean.RowData;
import com.beecode.bcp.advanced.query.service.QueryMetaService;
import com.beecode.bcp.advanced.query.service.QueryService;
import com.fasterxml.jackson.databind.JsonNode;
@RestController
@RequestMapping("/warehouse/api/bcp/query/advance")
public class WarehouseAdvancedQueryController {
@Autowired
private QueryService service;
@Autowired
private QueryMetaService metaService;
@PostMapping(value = "/view")
public Object getViewContent (@RequestParam String queryView){
QueryView view = Amino.getApplicationContext().getBean(queryView, QueryView.class);
return view.getViewContent();
}
@PostMapping(value = "/query")
public String getQueryInfo(@RequestBody QueryParameter queryParameter) {
QueryTemplate template = metaService.getQueryTemplate(queryParameter.getDatasource());
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(queryParameter, template);
List<RowData> rows = service.queryList(preprocessor);
int count = service.queryCount(preprocessor);
PaginationResult result = new PaginationResult();
result.setRows(rows);
result.setTotalCount(count);
return result.toString();
}
@PostMapping(value = "/count")
public Object getCount(@RequestBody QueryParameter queryParameter) {
QueryTemplate template = metaService.getQueryTemplate(queryParameter.getDatasource());
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(queryParameter, template);
return service.queryCount(preprocessor);
}
@PostMapping(value = "/total")
public String queryTotal(@RequestBody QueryParameter queryParameter) {
QueryTemplate template = metaService.getQueryTemplate(queryParameter.getDatasource());
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(queryParameter, template);
RowData row = service.queryTotal(preprocessor);
if(null == row) {
return RowData.EMPTY.toString();
}
return row.toString();
}
@PostMapping(value = "/subTotal")
public String querySubTotal(@RequestBody QueryParameter queryParameter) {
QueryTemplate template = metaService.getQueryTemplate(queryParameter.getDatasource());
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(queryParameter, template);
RowData row = service.querySubTotal(preprocessor);
if(null == row) {
return RowData.EMPTY.toString();
}
return row.toString();
}
@PostMapping(value = "/counts")
public List<Integer> getCounts(@RequestBody List<QueryParameter> queryParameters) {
List<Integer> result = new ArrayList<>();
for (QueryParameter qp : queryParameters) {
result.add((Integer) getCount(qp));
}
return result;
}
@PostMapping(value = "/groupCount")
public List<Integer> getGroupCount(@RequestBody JsonNode body) {
JsonNode groupCount = body.get("groupCount");
JsonNode names = body.get("groupNames");
String datasource = groupCount.get("dataSource").asText();
QueryTemplate template = metaService.getQueryTemplate(datasource);
QueryParameter qp = new QueryParameter();
qp.setDatasource(datasource);
QueryPreprocessor preprocessor = QueryPreprocessorFactory.newInstance(qp, template);
Map<String, Integer> valueMap = new HashMap<>();
List<RowData> rds = service.queryList(preprocessor);
int allcount = 0;
for (RowData rd : rds) {
int cv = Convert.toInt(rd.get("value"));
valueMap.put((String) rd.get("key"), cv);
allcount += cv;
}
if (!valueMap.containsKey("all")) {
valueMap.put("all", allcount);
}
List<Integer> result = new ArrayList<>();
JsonNode keyMap = groupCount.get("keyMap");
for (int i = 0; i < names.size(); i++) {
String name = names.get(i).asText();
String value = keyMap.get(name).asText();
result.add(valueMap.get(value));
}
return result;
}
}
package com.xyst.dinas.biz.web;
import java.util.List;
import java.util.UUID;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.beecode.bcp.advanced.query.StringUtils;
import com.beecode.bcp.advanced.query.constant.CustomSceneConstant;
import com.beecode.bcp.advanced.query.exception.SceneException;
import com.beecode.bcp.advanced.query.service.SceneService;
import com.beecode.bcp.type.KClass;
import com.beecode.bcp.type.KObject;
import com.beecode.bcp.type.json.JSONObjectUtils;
@RestController
@RequestMapping(value = "/warehouse/api/bcp/query/advance/scene")
public class WarehouseSceneController {
@Autowired
private SceneService service;
@Autowired
@Qualifier(CustomSceneConstant.ENTITY)
private KClass kclass;
/**
* 创建新的场景
* @param scene 场景对象
*/
@PostMapping(value="/create")
public void create(@RequestBody String scene) {
KObject object = toKObject(scene);
String title = object.getString(CustomSceneConstant.TITLE);
if(StringUtils.isBlank(title)) {
throw new SceneException("场景标题不能为空");
}
String content = object.getString(CustomSceneConstant.CONTENT);
if(StringUtils.isBlank(content)) {
throw new SceneException("场景内容不能为空");
}
service.create(object);
}
/**
* 修改现有场景
* @param scene 场景对象
*/
@PostMapping(value = "/update")
public void update(@RequestBody String scene) {
KObject object = toKObject(scene);
// ContextUser user = CurrentInfo.getCurrentUser();
// if(null == user) {
// throw new SceneException("当前登录人信息获取失败");
// }
// UUID creatorId = object.getUuid(CustomSceneConstant.CREATOR_ID);
// if(null == creatorId) {
// throw new SceneException("不能修改非本人创建的场景");
// }
// UUID currentUserId = UUID.fromString(user.getId());
// if(!creatorId.equals(currentUserId)) {
// throw new SceneException("不能修改非本人创建的场景");
// }
service.update(object);
}
/**
* 获取当前登录人的所有场景
* @param viewName 查询视图元数据名称
* @param group 查询页签名称
* @return
*/
@GetMapping(value = "/query")
public String query(@RequestParam(name = "viewName", required = true) String viewName,
@RequestParam(name = "group", required = true) String group) {
// ContextUser user = CurrentInfo.getCurrentUser();
// if(null == user) {
// throw new SceneException("当前登录人信息获取失败");
// }
List<KObject> scenes = service.query(viewName, group);
if(scenes.isEmpty()) {
return "[]";
}
return JSONObjectUtils.toArrayNode(scenes).toString();
}
/**
* 删除场景
* @param id 场景id
*/
@PostMapping(value="/delete/{id}")
public void delete(@PathVariable("id") String sid) {
if(StringUtils.isBlank(sid)) {
return;
}
UUID id = UUID.fromString(sid);
service.delete(id);
}
private KObject toKObject(String content) {
JSONObject object = new JSONObject(content);
KObject kobject = kclass.newInstance();
UUID id = getUUIDField(object, CustomSceneConstant.ID);
kobject.set(CustomSceneConstant.ID, id);
kobject.set(CustomSceneConstant.CREATE_TIME, object.opt(CustomSceneConstant.CREATE_TIME));
kobject.set(CustomSceneConstant.MODIFY_TIME, object.opt(CustomSceneConstant.MODIFY_TIME));
kobject.set(CustomSceneConstant.CREATOR_ID, getUUIDField(object, CustomSceneConstant.CREATOR_ID));
kobject.set(CustomSceneConstant.CREATOR_NAME, object.optString(CustomSceneConstant.CREATOR_NAME));
kobject.set(CustomSceneConstant.TITLE, object.optString(CustomSceneConstant.TITLE));
kobject.set(CustomSceneConstant.VIEW_NAME, object.optString(CustomSceneConstant.VIEW_NAME));
kobject.set(CustomSceneConstant.GROUP, object.optString(CustomSceneConstant.GROUP));
kobject.set(CustomSceneConstant.CONTENT, object.optString(CustomSceneConstant.CONTENT));
return kobject;
}
private UUID getUUIDField(JSONObject json, String field) {
String sid = json.optString(field);
return StringUtils.isBlank(sid) ? null : UUID.fromString(sid);
}
}
......@@ -4,7 +4,9 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
......@@ -26,6 +28,7 @@ import com.beecode.inz.basis.team.pojo.ResponseObj;
import com.xyst.dinas.biz.service.DinasOrganizationService;
import com.xyst.dinas.biz.service.DinasTypeService;
import com.xyst.dinas.biz.service.StationService;
import com.xyst.dinas.biz.warn.dao.WarnSettingDao;
import com.xyst.dinas.price.entity.StationDinasTypePriceDetail;
import com.xyst.dinas.price.service.PriceAdjustmentService;
import com.xyst.dinas.sales.constant.InventoryConstant;
......@@ -58,6 +61,9 @@ public class InventoryServiceImpl implements InventoryService {
public InventoryDao inventoryDao;
@Autowired
private WarnSettingDao warnSettingDao;
@Autowired
public BapContext bapContext;
@Override
......@@ -250,4 +256,21 @@ public class InventoryServiceImpl implements InventoryService {
public Double getStockAmountByDinas(UUID stationId,String dinasTypeName) {
return inventoryDao.getStockAmountByDinas(stationId, dinasTypeName);
}
@Override
public Object queryWarnSettingById(UUID id) {
KObject warnSetting = warnSettingDao.queryWarnSettingById(id);
String billId = warnSetting.getString("billId");
KObject station = stationService.getById(UUID.fromString(billId));
Map<String, Object> map = new HashMap<>();
map.put("stationName", station.getString("stationName"));
map.put("personnel", warnSetting.getString("personnel"));
map.put("max", warnSetting.getString("max"));
map.put("min", warnSetting.getString("min"));
map.put("target", warnSetting.getString("target"));
map.put("targetType", warnSetting.getString("targetType"));
map.put("id", warnSetting.getUuid("id"));
map.put("billId", warnSetting.getString("billId"));
return map;
}
}
......@@ -12,6 +12,7 @@ public interface InventoryService {
public List<StationDinasTypeRelation> getInventoryByRegionalCompany(UUID regionalCompany);
public ResponseObj<String> modifyInventory(String body, boolean isLog, boolean autoCalculate);
public List<InventoryLog> queryLog(UUID regionalCompany);
Object queryWarnSettingById(UUID id);
/**
* 查询某种砂石的库存量
......
......@@ -4,6 +4,8 @@ import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -48,4 +50,10 @@ public class InventoryController {
List<InventoryLog> data = inventoryService.queryLog(UUID.fromString(regionalCompany));
return ResponseObj.success("库存纠正日志查询成功", data);
}
@GetMapping("/inventory/warnsetting/{id}")
public Object queryWarnSetting(@PathVariable UUID id) {
Assert.notNull(id,"The id must not be null");
return inventoryService.queryWarnSettingById(id);
}
}
......@@ -63,6 +63,14 @@
<annotation id='d7f8eac6-3f6d-4847-b6ea-ceeedadffbb6' attributeId='fcff3632-1871-4b01-97b7-7debaaed13e8' name='length' value='undefined'>
</annotation>
</attribute>
<attribute id='d46bfe16-a5a0-476e-a495-52ba4f953412' name='createUser' columnName='create_user' title='创建人' type='string' default='' precision='' isArray='false'>
<annotation id='5a75f2da-67c2-4e98-a72c-43b631cd1eab' attributeId='c578891e-df62-474f-873a-80b0fd4f211b' name='length' value='100'>
</annotation>
</attribute>
<attribute id='0838c295-883c-4b50-b4b6-1ed627763181' name='modifyUser' columnName='modify_user' title='修改人' type='string' default='' precision='' isArray='false'>
<annotation id='a61aa054-3efa-41b0-bc5b-57c7c85ae12b' attributeId='ac88d86e-db98-4702-a327-05a6284ea8bd' name='length' value='100'>
</annotation>
</attribute>
<childModel id='d667dff0-2b8b-497c-ba26-99b9d0e4de2f' attributeId='b706360e-39b1-44c5-9ed6-0b82c4a72807' refParentAttributeId='ccddb9cc-707e-4c56-890b-5272f1268d3c' name='NeedPlanDetail' tableName='xyst_dinas_sales_need_plan_detail' domainInherit='' title='需用计划明细表' >
<parent>com.beecode.bap.biztrait.datamodel.StoreSubTableRequirement</parent>
<attribute id='4c3923a4-9631-439f-bdac-1ee06c057765' name='dinasType' columnName='dinas_type' title='砂石类型' type='com.xyst.dinas.biz.datamodel.DinasType' default='' precision='' isArray='false'>
......
......@@ -239,6 +239,24 @@
</ref>
<description></description>
</field>
<field title='创建人'>
<name>createUser</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='修改人'>
<name>modifyUser</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
</customQuery>
</content>
</model>
\ No newline at end of file
......@@ -59,6 +59,15 @@
</ref>
<description></description>
</field>
<field title='业务type'>
<name>billType</name>
<type>string</type>
<ref>
<type></type>
<name></name>
</ref>
<description></description>
</field>
<field title='预警指标'>
<name>target</name>
<type>string</type>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata">
<specification>1.0</specification>
<id>f21d842b-3613-4b14-9751-cfcb4b34e53c</id>
<name>com.xyst.dinas.sales.advanquery.NeedPlanAdvQuery</name>
<title>需用计划分析</title>
<description>需用计划分析</description>
<define>advanced.query.template</define>
<define-version>1.0</define-version>
<content>
<template>
<sql-type>SQL</sql-type>
<sql>
SELECT
needPlan.id AS id,
xystorganization.NAME AS organization,
planningCycle.title AS planningCycleTitle,
projectFiled.projectName AS projectName,
'需用计划' AS type,
needPlan.needPlanTotalAmount AS needPlanTotalAmount,
salesPlan.planTotalAmount AS planTotalAmount
FROM
NeedPlan AS needPlan
LEFT JOIN xystOrganization AS xystorganization ON xystorganization.id = needPlan.regionalCompany
LEFT JOIN PlanningCycle AS planningCycle ON planningCycle.id = needPlan.planningCycle
LEFT JOIN SalesPlan AS salesPlan ON salesPlan.planningCycle = needPlan.planningCycle
LEFT JOIN ProjectFiled AS projectFiled ON projectFiled.id = needPlan.project
WHERE ( needPlan.DISCARD = FALSE OR needPlan.DISCARD IS NULL )
</sql>
</template>
</content>
</metadata>
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata">
<specification>1.0</specification>
<id>36693223-9764-415d-9b49-17e8b2dfa608</id>
<name>com.xyst.dinas.sales.advanquery.NeedPlanQueryView</name>
<title>需用计划分析</title>
<description>需用计划分析</description>
<define>advanced.query.view</define>
<define-version>1.0</define-version>
<content>
<view>
{
"name": "需用计划",
"title": "需用计划分析",
"description": "需用计划分析",
"actions": [],
"scenes" : {
"isShowScenes" : true
},
"fuzzySearch": [
],
"isShowTabCountZero": true,
"groups": [
{
"name": "all",
"title": "全部",
"content": {
"datasource": "com.xyst.dinas.sales.advanquery.NeedPlanAdvQuery"
}
}
],
"content": {
"isShowView": "table",
"datasource": "com.xyst.dinas.sales.advanquery.NeedPlanAdvQuery",
"arguments": {
"items": [
]
},
"actions": [
{
"param": [],
"enable": "ALL",
"name": "query_export",
"action": "query_export",
"title": "导出",
"type": ""
},
{
"name": "queryRefresh",
"title": "刷新",
"action": "queryRefresh",
"param": [],
"type": "",
"enable": "ALL"
}
],
"table": {
"selectType": "MULTI",
"serialNumber": "series",
"pageSize": 200,
"orders":[
],
"expand": false,
"columns": [
{
"type": "VALUE",
"title": "id",
"key": "id",
"columnType": {
"name" : "inner",
"data": {
"selected": true
}
}
},
{
"type": "VALUE",
"title": "区域公司",
"key": "organization",
"columnType": {
"name": "select",
"data": {
"selected": true
}
}
},
{
"type": "VALUE",
"title": "计划周期",
"key": "planningCycleTitle",
"columnType": {
"name": "select",
"data": {
"selected": true
}
}
},
{
"type": "VALUE",
"title": "项目名称",
"key": "projectName",
"columnType": {
"name": "select",
"data": {
"selected": true
}
}
},
{
"type": "VALUE",
"title": "计划类型",
"key": "type",
"columnType": {
"name": "select",
"data": {
"selected": true
}
}
},
{
"type": "VALUE",
"title": "需用计划量(吨)",
"key": "needPlanTotalAmount",
"columnType": {
"name": "select",
"data": {
"selected": true
}
}
},
{
"type": "VALUE",
"title": "销售计划量(吨)",
"key": "planTotalAmount",
"columnType": {
"name": "select",
"data": {
"selected": true
}
}
},
{
"type" : "ACTION",
"key" : "new_logo77b16046-4d20-4e43-b6bc-5e5e264014fe",
"title" : "操作列",
"width" : 150,
"actions" : [ {
"name" : "new_action",
"title" : "详情",
"action" : "openDetail",
"param" : {
"modelName" : "123"
},
"type" : ""
} ],
"nodeKey" : 13,
"align" : "center",
"isShow" : false
}
]
}
}
}
</view>
</content>
</metadata>
......@@ -25,8 +25,8 @@
LEFT JOIN xystOrganization AS xystorganization ON xystorganization.id = salesPlan.regionalCompany
LEFT JOIN PlanningCycle AS planningCycle ON planningCycle.id = salesPlan.planningCycle
LEFT JOIN NeedPlan AS needPlan ON needPlan.planningCycle = salesPlan.planningCycle
LEFT JOIN ProjectFiled AS projectFiled ON projectFiled.id = needPlan.project UNION
WHERE ( salesPlan.DISCARD = FALSE OR salesPlan.DISCARD IS NULL )
LEFT JOIN ProjectFiled AS projectFiled ON projectFiled.id = needPlan.project
WHERE ( salesPlan.DISCARD = FALSE OR salesPlan.DISCARD IS NULL ) UNION
SELECT
salesPlanTemp.id AS id,
xystorganizationrTemp.NAME AS organization,
......
......@@ -311,6 +311,52 @@
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>100</m:value>
</m:annotation>
<m:annotation>
<m:type>javax.persistence.Column</m:type>
<m:properties>
<m:property>
<m:key>name</m:key>
<m:value>create_user</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>d46bfe16-a5a0-476e-a495-52ba4f953412</m:id>
<m:name>createUser</m:name>
<m:title>创建人</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>bcp.type.constraint.StringLength</m:type>
<m:value>100</m:value>
</m:annotation>
<m:annotation>
<m:type>javax.persistence.Column</m:type>
<m:properties>
<m:property>
<m:key>name</m:key>
<m:value>modify_user</m:value>
</m:property>
</m:properties>
</m:annotation>
</m:annotations>
<m:id>0838c295-883c-4b50-b4b6-1ed627763181</m:id>
<m:name>modifyUser</m:name>
<m:title>修改人</m:title>
<m:type>string</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
<m:attribute>
<m:annotations>
<m:annotation>
<m:type>com.beecode.bap.biztrait.datamodel.SubTableAnnotation</m:type>
</m:annotation>
</m:annotations>
......
......@@ -270,6 +270,26 @@
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>createUser</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>modifyUser</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>
......
......@@ -3,7 +3,7 @@
<specification>1.0</specification>
<id>62ee19e3-374c-4954-bcb8-eab78f76dd1f</id>
<name>com.xyst.dinas.sales.query.SalesWarningExe</name>
<title>销售预警</title>
<title>执行预警</title>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.biz.datamodel.WarningExe</dependency>
......@@ -70,6 +70,16 @@
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>billType</m:name>
<m:title>业务type</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>
......
......@@ -69,6 +69,12 @@
<property name="needPlanTotalAmount" type="big_decimal" not-null="false">
<column name="need_plan_total_amount" precision="12" scale="4"></column>
</property>
<property name="createUser" type="nstring" not-null="false">
<column name="create_user" length="100"></column>
</property>
<property name="modifyUser" type="nstring" not-null="false">
<column name="modify_user" length="100"></column>
</property>
<bag name="NeedPlanDetails" lazy="true" fetch="select" inverse="true">
<key column="master_id" not-null="true" />
<one-to-many entity-name="com.xyst.dinas.sales.datamodel.NeedPlan$NeedPlanDetail" />
......
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