Commit 97d6fe21 by 王衍超

解决冲突;

parents 44003ef8 e974108d
......@@ -32,4 +32,6 @@ public interface DinasTypeDao extends BaseDao {
List<KObject> getByStation(UUID stationId);
List<KObject> getByRegionalCompanyId(UUID regionalCompanyId);
List<KObject> getStationsById(List<UUID> dinasTypeIds, List<UUID> regionalCompanyIds);
}
......@@ -20,6 +20,7 @@ import org.hibernate.criterion.Restrictions;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.util.CollectionUtils;
import java.io.Serializable;
import java.util.*;
......@@ -65,7 +66,6 @@ public class DinasTypeDaoImpl extends AbstractBaseDao implements DinasTypeDao, D
@Override
public Page<KObject> listDinasTypeInfoPaging(Page<KObject> page) {
KClass bean = Amino.getStaticMetadataContext().getBean(ENTITY, KClass.class);
KClass detailBean = Amino.getStaticMetadataContext().getBean(STATION_DINAS_TYPE_DETAIL_ENTITY, KClass.class);
DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName());
addRegionalCompanyFilter(detachedCriteria);
detachedCriteria.add(Restrictions.eq("del", false));
......@@ -73,10 +73,6 @@ public class DinasTypeDaoImpl extends AbstractBaseDao implements DinasTypeDao, D
page.setTotal(template.findByCriteria(detachedCriteria).size());
int offset = page.getPageSize() * (page.getPageNo() - 1);
List<KObject> list = (List<KObject>) template.findByCriteria(detachedCriteria, offset, page.getPageSize());
for (KObject kObject : list) {
KObject kObject1 = detailBean.newInstance();
kObject1.set("dinasType",kObject);
}
page.setDatas(list);
return page;
}
......@@ -84,15 +80,8 @@ public class DinasTypeDaoImpl extends AbstractBaseDao implements DinasTypeDao, D
@Override
public List<KObject> getByStation(UUID stationId) {
// KClass bean = Amino.getStaticMetadataContext().getBean(DinasTypeConstant.STATION_DINAS_TYPE_DETAIL_ENTITY, KClass.class);
// DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName());
// addRegionalCompanyFilter(detachedCriteria);
// detachedCriteria.add(Restrictions.eq("del", false));
// detachedCriteria.add(Restrictions.eq("station.id", stationId));
KClass bean = Amino.getStaticMetadataContext().getBean(STATION_DINAS_TYPE_DETAIL_ENTITY, KClass.class);
DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName());
addRegionalCompanyFilter(detachedCriteria);
detachedCriteria.add(Restrictions.eq("del", false));
detachedCriteria.createAlias("station","station");
detachedCriteria.add(Restrictions.eq("station.id", stationId));
......@@ -115,6 +104,25 @@ public class DinasTypeDaoImpl extends AbstractBaseDao implements DinasTypeDao, D
}
@Override
public List<KObject> getStationsById(List<UUID> dinasTypeIds, List<UUID> regionalCompanyIds) {
KClass bean = Amino.getStaticMetadataContext().getBean(STATION_DINAS_TYPE_DETAIL_ENTITY, KClass.class);
DetachedCriteria detachedCriteria = DetachedCriteria.forEntityName(bean.getName());
detachedCriteria.createAlias("station","s");
detachedCriteria.createAlias("dinasType","d");
detachedCriteria.add(Restrictions.eq("del", false));
detachedCriteria.add(Restrictions.eq("s.del", false));
if(!CollectionUtils.isEmpty(regionalCompanyIds)){
detachedCriteria.add(Restrictions.in("d.regionalCompany.id", regionalCompanyIds));
}
if(!CollectionUtils.isEmpty(dinasTypeIds)){
detachedCriteria.add(Restrictions.in("d.id", dinasTypeIds));
}
return (List<KObject>) template.findByCriteria(detachedCriteria);
}
@Override
public DetachedCriteria addRegionalCompanyFilter(DetachedCriteria detachedCriteria) {
KObject currentLoginRegionalCompany = getCurrentLoginRegionalCompany();
if (currentLoginRegionalCompany != null && currentLoginRegionalCompany.getString("type").equals(OrganizationTypeEnum.REGIONAL_COMPANY.name())) {
......
......@@ -52,6 +52,7 @@ import com.beecode.bap.attachment.common.Utils;
import com.beecode.bap.attachment.exception.AttachmentDataDownLoadException;
import com.beecode.bap.attachment.exception.AttachmentDataUploadException;
import com.beecode.bap.attachment.exception.AttachmentException;
import com.beecode.bap.attachment.internal.CreatorAdapterService;
import com.beecode.bap.attachment.service.AttachmentService;
import com.beecode.inz.basis.pojo.SandUser;
import com.beecode.inz.basis.service.SandUserService;
......@@ -489,8 +490,8 @@ public class SandAttachmentController {
return false;
}
// @Autowired
// private CreatorAdapterService creatorAdapterService;
@Autowired
private CreatorAdapterService creatorAdapterService;
// private UUID getCurrentCreatorId() {
// return creatorAdapterService.getCurrentCreatorId();
......@@ -502,10 +503,13 @@ public class SandAttachmentController {
}
private String getCreatorName(UUID id) {
// return creatorAdapterService.getCreatorName(id);
String userName = creatorAdapterService.getCreatorName(id);
if(userName == null) {
SandUser user = sandUserService.getById(id);
return user.getTitle();
}
return userName;
}
private Map<String, Object> toMap(AttachmentInfo info) {
Map<String, Object> map = new HashMap<>(20);
......
......@@ -52,6 +52,7 @@ import com.beecode.bap.attachment.common.Utils;
import com.beecode.bap.attachment.exception.AttachmentDataDownLoadException;
import com.beecode.bap.attachment.exception.AttachmentDataUploadException;
import com.beecode.bap.attachment.exception.AttachmentException;
import com.beecode.bap.attachment.internal.CreatorAdapterService;
import com.beecode.bap.attachment.service.AttachmentService;
import com.beecode.inz.basis.pojo.WarehouseUser;
import com.beecode.inz.basis.service.WarehouseUserService;
......@@ -489,8 +490,8 @@ public class WarehouseAttachmentController {
return false;
}
// @Autowired
// private CreatorAdapterService creatorAdapterService;
@Autowired
private CreatorAdapterService creatorAdapterService;
// private UUID getCurrentCreatorId() {
// return creatorAdapterService.getCurrentCreatorId();
......@@ -502,10 +503,13 @@ public class WarehouseAttachmentController {
}
private String getCreatorName(UUID id) {
// return creatorAdapterService.getCreatorName(id);
String userName = creatorAdapterService.getCreatorName(id);
if(userName == null) {
WarehouseUser user = warehouseUserService.getById(id);
return user.getTitle();
}
return userName;
}
private Map<String, Object> toMap(AttachmentInfo info) {
Map<String, Object> map = new HashMap<>(20);
......
......@@ -3,13 +3,13 @@
<type>bcp.biz.Bill</type>
<package>com.xyst.dinas.biz.bill</package>
<title>组织机构</title>
<name>Organization</name>
<name>xystOrganization</name>
<description>组织机构</description>
</header>
<content>
<bill>
<data>
{"baseData":{"name":"Organization","title":"组织机构","billModel":"com.beecode.bap.biztrait.BasicBillBiztrait","functionLibrarys":[],"description":"组织机构","dataModel":"com.xyst.dinas.biz.datamodel.xystOrganization"},"serial":{"serialData":[{"segment":"literal","segmentData":"EM"},{"segment":"sequence","segmentData":{"start-with":0,"increment":1,"min":0,"max":99999,"length":5,"cycle":true,"cut-direction":"left","pad-string":"0","pad-direction":"left","cache-size":10}}],"buildTime":"add"},"formula":[],"workflow":{"workflow":"","processParamConfig":[]},"print":[],"authority":[]}
{"baseData":{"name":"xystOrganization","title":"组织机构","billModel":"com.beecode.bap.biztrait.BasicBillBiztrait","functionLibrarys":[],"description":"组织机构","dataModel":"com.xyst.dinas.biz.datamodel.xystOrganization"},"serial":{"serialData":[{"segment":"literal","segmentData":"EM"},{"segment":"sequence","segmentData":{"start-with":0,"increment":1,"min":0,"max":99999,"length":5,"cycle":true,"cut-direction":"left","pad-string":"0","pad-direction":"left","cache-size":10}}],"buildTime":"add"},"formula":[],"workflow":{"workflow":"","processParamConfig":[]},"print":[],"authority":[]}
</data>
</bill>
</content>
......
......@@ -2,7 +2,7 @@
<header>
<type>inz.query.Query</type>
<package>com.xyst.dinas.biz.query</package>
<name>Organization</name>
<name>xystOrganization</name>
<title>组织机构</title>
<tags></tags>
<description>组织机构</description>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-sequence">
<specification>1.0</specification>
<id>49d5fd51-14d9-4f0c-bcdc-3e65a783bbf2</id>
<name>com.xyst.dinas.biz.bill.Organization$sequence</name>
<id>5e568530-fff2-41dc-8389-caa10463e601</id>
<name>com.xyst.dinas.biz.bill.xystOrganization$sequence</name>
<title>组织机构$sequence</title>
<description>组织机构</description>
<define>bcp.sequence</define>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-serial">
<specification>1.0</specification>
<id>dbabae74-e1ab-4a2d-bfba-609eba84ba91</id>
<name>com.xyst.dinas.biz.bill.Organization$serial</name>
<id>fbf08768-f045-4eab-b49f-d94b99767d95</id>
<name>com.xyst.dinas.biz.bill.xystOrganization$serial</name>
<title>组织机构$serial</title>
<description>组织机构</description>
<define>bcp.serial</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.biz.datamodel.xystOrganization</dependency>
<dependency>com.xyst.dinas.biz.bill.Organization$sequence</dependency>
<dependency>com.xyst.dinas.biz.bill.xystOrganization$sequence</dependency>
<content>
<m:serial>
<m:input>com.xyst.dinas.biz.datamodel.xystOrganization</m:input>
......@@ -21,8 +21,8 @@
<m:length>5</m:length>
<m:pad-direction>left</m:pad-direction>
<m:pad-string>0</m:pad-string>
<m:key>com.xyst.dinas.biz.bill.Organization$serial</m:key>
<m:sequenceName>com.xyst.dinas.biz.bill.Organization$sequence</m:sequenceName>
<m:key>com.xyst.dinas.biz.bill.xystOrganization$serial</m:key>
<m:sequenceName>com.xyst.dinas.biz.bill.xystOrganization$sequence</m:sequenceName>
</m:sequence>
</m:segments>
</m:serial>
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/bcp-biztype">
<specification>1.0</specification>
<id>20f2ee42-6a57-4b54-bca0-0d5bd84fedb0</id>
<name>com.xyst.dinas.biz.bill.Organization</name>
<id>2edef471-de90-4cf9-b4ec-d10ec115ce9b</id>
<name>com.xyst.dinas.biz.bill.xystOrganization</name>
<title>组织机构</title>
<description>组织机构</description>
<define>bcp.biz.Biztype</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.biz.datamodel.xystOrganization</dependency>
<dependency>com.xyst.dinas.biz.bill.Organization$serial</dependency>
<dependency>com.xyst.dinas.biz.bill.xystOrganization$serial</dependency>
<dependency>com.beecode.bap.biztrait.BasicBillBiztrait</dependency>
<content>
<m:biztype>
......@@ -17,7 +17,7 @@
<m:inheritance>
<m:biztrait>com.beecode.bap.biztrait.BasicBillBiztrait</m:biztrait>
<m:config type="xml">
<m:content>&lt;billBasictraitConfig&gt;&lt;formulas/&gt;&lt;parents&gt;&lt;parent&gt;&lt;billCodeConfig&gt;&lt;serialName&gt;com.xyst.dinas.biz.bill.Organization$serial&lt;/serialName&gt;&lt;buildTime&gt;add&lt;/buildTime&gt;&lt;/billCodeConfig&gt;&lt;/parent&gt;&lt;parent&gt;&lt;workflowConfig&gt;&lt;workflow&gt;&lt;/workflow&gt;&lt;/workflowConfig&gt;&lt;/parent&gt;&lt;parent&gt;&lt;printConfig&gt;&lt;templates/&gt;&lt;/printConfig&gt;&lt;/parent&gt;&lt;/parents&gt;&lt;functionLibrarys/&gt;&lt;/billBasictraitConfig&gt;</m:content>
<m:content>&lt;billBasictraitConfig&gt;&lt;formulas/&gt;&lt;parents&gt;&lt;parent&gt;&lt;billCodeConfig&gt;&lt;serialName&gt;com.xyst.dinas.biz.bill.xystOrganization$serial&lt;/serialName&gt;&lt;buildTime&gt;add&lt;/buildTime&gt;&lt;/billCodeConfig&gt;&lt;/parent&gt;&lt;parent&gt;&lt;workflowConfig&gt;&lt;workflow&gt;&lt;/workflow&gt;&lt;/workflowConfig&gt;&lt;/parent&gt;&lt;parent&gt;&lt;printConfig&gt;&lt;templates/&gt;&lt;/printConfig&gt;&lt;/parent&gt;&lt;/parents&gt;&lt;functionLibrarys/&gt;&lt;/billBasictraitConfig&gt;</m:content>
</m:config>
</m:inheritance>
</m:inheritances>
......
......@@ -2,7 +2,7 @@
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/inz-query">
<specification>1.0</specification>
<id>e9932470-2599-4a92-a1e2-1d5d418a96a3</id>
<name>com.xyst.dinas.biz.query.Organization</name>
<name>com.xyst.dinas.biz.query.xystOrganization</name>
<title>组织机构</title>
<description>组织机构</description>
<define>inz.query.Query</define>
......
......@@ -10,7 +10,36 @@
<content>
<template>
<sql-type>SQL</sql-type>
<sql>SELECT planningCycle.title as planningCycleTitle from NeedPlan as needPlan left join PlanningCycle as planningCycle on needPlan.planningCycle = planningCycle.id </sql>
<sql>
SELECT
xystorganization.NAME AS organization,
planningCycle.title AS planningCycleTitle,
projectFiled.projectName AS projectName,
'销售计划' AS type,
salesPlan.requiredTotalAmount AS requiredTotalAmount,
salesPlan.planTotalAmount AS totalPlanAmount,
salesPlan.actualSaleTotalAmount AS actualSaleTotalAmount
FROM
SalesPlan AS salesPlan
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
SELECT
xystorganizationrTemp.NAME AS organization,
planningCycleTemp.title AS planningCycleTitle,
projectFiledTemp.projectName AS projectName,
'临时销售计划' AS type,
needPlanTemp.needPlanTotalAmount AS requiredTotalAmount,
salesPlanTemp.totalPlanAmount AS totalPlanAmount,
'' AS actualSaleTotalAmount
FROM
SalesPlanTemp AS salesPlanTemp
LEFT JOIN xystOrganizationrTemp AS xystorganizationrTemp ON xystorganizationrTemp.id = salesPlanTemp.regional_company
LEFT JOIN PlanningCycleTemp AS planningCycleTemp ON planningCycleTemp.id = salesPlanTemp.planningCycle
LEFT JOIN ProjectFiledTemp AS projectFiledTemp ON projectFiledTemp.id = salesPlanTemp.project
LEFT JOIN NeedPlanTemp AS needPlanTemp ON needPlanTemp.planningCycle = salesPlanTemp.planningCycle
</sql>
</template>
</content>
</metadata>
......@@ -65,7 +65,18 @@
"columns": [
{
"type": "VALUE",
"title": "账单金额",
"title": "区域公司",
"key": "organization",
"columnType": {
"name": "select",
"data": {
"selected": true
}
}
},
{
"type": "VALUE",
"title": "计划周期",
"key": "planningCycleTitle",
"columnType": {
"name": "select",
......@@ -73,6 +84,80 @@
"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": "requiredTotalAmount",
"columnType": {
"name": "select",
"data": {
"selected": true
}
}
},
{
"type": "VALUE",
"title": "销售计划量(吨)",
"key": "totalPlanAmount",
"columnType": {
"name": "select",
"data": {
"selected": true
}
}
},
{
"type": "VALUE",
"title": "实际运输量(吨)",
"key": "actualSaleTotalAmount",
"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" : {
"viewName" : "123",
"billId" : "id"
},
"type" : ""
} ],
"nodeKey" : 13,
"align" : "center",
"isShow" : false
}
]
}
......
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