Commit 3d5fc58d authored by 1650842865's avatar 1650842865

供应商增加联系人信息;源发BPM采购申请的关单流程;工序外协增加交货日期;采购申请审批删除关闭待办任务

parent 26982d8a
......@@ -65,7 +65,7 @@ function loadOrderItemGrid() {
meinsName: row.MSEH3,
menge: row.GAMNG,
printLoss: row.ZLOSSC,
eeind: Public.formatDate(new Date(),'%Y-%M-%D'),
bedat: Public.formatDate(new Date(),'%Y-%M-%D'),
// 行号加一
sequence: (orderItemGridManager.getData().length + 1),
kpein: 1,
......@@ -317,7 +317,7 @@ function getOrderColumns(){
}
},);
columns.push({
display: "需求日期", name: "eeind", width: 140, minWidth: 60, type: "string", align: "left",
display: "需求日期", name: "bedat", width: 140, minWidth: 60, type: "date", align: "left",
editor: {
type: "date", required: true
}
......@@ -343,6 +343,12 @@ function getOrderColumns(){
}
},);
if (typeof(getSubProcUnitId) =='function'&&"outer" == getSubProcUnitId()){
columns.push({
display: "交货日期", name: "eeind", width: 140, minWidth: 60, type: "date", align: "left",
editor: {
type: "date", required: true
}
},);
columns.push({
display: "单价", name: "kbetr", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
......@@ -405,6 +411,9 @@ function getOrderColumns(){
// },
});
}else {
columns.push({
display: "交货日期", name: "eeind", width: 140, minWidth: 60, type: "date", align: "left",
},);
columns.push({
display: "单价", name: "kbetr", width: 140, minWidth: 60, type: "string", align: "left",
},);
......
......@@ -20,6 +20,7 @@ function loadProcessOutsourceOrderListGrid() {
{display: "申请单编号", name: "billCode", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请状态", name: "statusTextView", width: 60, minWidth: 60, type: "string", align: "left"},
{display: "申请日期", name: "fillinDate", width: 120, minWidth: 60, type: "datetime", align: "left"},
{display: "需求日期", name: "bedat", width: 140, minWidth: 60, type: "date", align: "left"},
{display: "工厂", name: "werksName", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "采购订单", name: "ebeln", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "订单行项目号", name: "ebelp", width: 120, minWidth: 60, type: "string", align: "left"},
......@@ -37,7 +38,7 @@ function loadProcessOutsourceOrderListGrid() {
{display: "定价基数", name: "kpein", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "币别", name: "waersTextView", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "税码", name: "purchaseMwskzTextView", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "需求到货日期", name: "eeind", width: 140, minWidth: 60, type: "date", align: "left"},
{display: "货日期", name: "eeind", width: 140, minWidth: 60, type: "date", align: "left"},
{display: "供应商", name: "lifnrName", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "申请人", name: "personMemberName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请部门", name: "deptName", width: 120, minWidth: 60, type: "string", align: "left"},
......
......@@ -26,6 +26,7 @@ function initPurchaseListGrid() {
Public.tip("只能由创建人撤审!");
return;
}
var _self = this;
UICtrl.showAjaxDialog({
url: web_app.name + '/sapPurchase/showRevokeDetail.load',
param:{id:row.id},
......@@ -35,6 +36,7 @@ function initPurchaseListGrid() {
Public.ajax(web_app.name + '/sapPurchase/revokeApproval.ajax', {id: row.id,revokeReason: $("#revokeForm #revokeReason").val(),revokeType:$("#revokeType").val()}, function (msg) {
purchaseGridManager.loadData();
});
_self.close();
}
});
// UICtrl.confirm('确定要把当前单据撤销审批吗?',function(){
......@@ -59,6 +61,7 @@ function initPurchaseListGrid() {
{display: "PR类型", name: "bsartTextView", width: 150, minWidth: 60, type: "string", align: "center"},
{display: "科目分配类别", name: "knttpTextView", width: 150, minWidth: 60, type: "string", align: "center"},
{display: "采购申请编号", name: "banfn", width: 150, minWidth: 60, type: "string", align: "center"},
{display: "sap回执", name: "message", width: 200, minWidth: 60, type: "string", align: "center"},
//{display: "批准时间", name: "frgdt", width: 200, minWidth: 60, type: "date", align: "center"},
//{display: "申请日期", name: "fillinDate", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "录入人", name: "personMemberName", width: 120, minWidth: 60, type: "string", align: "left"},
......
......@@ -10,7 +10,7 @@
<x:hidden name="id"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:selectC name="revokeType" required="true" label="撤审类型" labelCol="4" fieldCol="8" dictionary="revokeType"/>
<x:selectC name="revokeType" required="true" label="撤审类型" labelCol="4" fieldCol="8" dictionary="revokeType" disabled="true"/>
<x:textareaC name="revokeReason" required="true" label="撤审原因" labelCol="4" fieldCol="8" rows="3"/>
</div>
</div>
......
......@@ -23,6 +23,7 @@ function initPurchaseListGrid() {
Public.tip("只能由创建人撤审!");
return;
}
var _self = this;
UICtrl.showAjaxDialog({
url: web_app.name + '/sapPurchaseApproval/showRevokeDetail.load',
param:{id:row.id},
......@@ -32,6 +33,7 @@ function initPurchaseListGrid() {
Public.ajax(web_app.name + '/sapPurchaseApproval/revokeApproval.ajax', {id: row.id,revokeReason: $("#revokeForm #revokeReason").val(),revokeType:$("#revokeType").val()}, function (msg) {
purchaseApprovalGridManager.loadData();
});
_self.close();
}
});
}
......
......@@ -38,6 +38,7 @@ function loadGrid() {
Public.tip("只能由创建人撤审!");
return;
}
var _self = this;
UICtrl.showAjaxDialog({
url: web_app.name + '/sapPurchaseOrder/showRevokeDetail.load',
param:{id:row.id},
......@@ -47,6 +48,7 @@ function loadGrid() {
Public.ajax(web_app.name + '/sapPurchaseOrder/revokeApproval.ajax', {id: row.id,revokeReason: $("#revokeForm #revokeReason").val(),revokeType:$("#revokeType").val()}, function (msg) {
purchaseOrderGridManager.loadData();
});
_self.close();
}
});
}
......
......@@ -52,42 +52,57 @@
<x:selectC name="buGroup" label="业务伙伴分组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup"/>
<x:inputC name="partner" label="供应商编码" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:selectC name="title" label="称谓代码" labelCol="1" fieldCol="2" dictionary="title"/>
</div>
<div class="hg-form-row">
<x:inputC name="nameOrg1" label="供应商名称1" labelCol="1" fieldCol="2" required="true"/>
<x:inputC name="nameOrg2" label="供应商名称2" labelCol="1" fieldCol="2"/>
<%--<x:inputC name="nameOrg3" label="组织名称3" labelCol="1" fieldCol="2"/>
<x:inputC name="nameOrg4" label="组织名称4" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="buSort1" label="搜索词1" labelCol="1" fieldCol="2" required="true"/>
<x:inputC name="buSort2" label="搜索词2" labelCol="1" fieldCol="2"/>
<%--<x:inputC name="strSuppl1" label="街道2" labelCol="1" fieldCol="2"/>
<x:inputC name="strSuppl2" label="街道3" labelCol="1" fieldCol="2"/>
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2"/>--%>
</div>
<div class="hg-form-row">
<x:inputC name="land1Name" label="国家" labelCol="1" fieldCol="2" required="true" wrapper="select"/>
<x:hidden name="land1"/>
<x:inputC name="regionName" label="地区" labelCol="1" fieldCol="2" required="true" wrapper="select"/>
<x:hidden name="region"/>
<x:inputC name="city1" label="城市" labelCol="1" fieldCol="2" required="true" />
<x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="true" maxLength="6"/>
</div>
<div class="hg-form-row">
<x:inputC name="street" label="街道地址" labelCol="1" fieldCol="2" maxLength="35"/>
<x:inputC name="strSuppl1" label="街道2" labelCol="1" fieldCol="2" maxLength="35"/>
<x:inputC name="strSuppl2" label="街道3" labelCol="1" fieldCol="2" maxLength="35"/>
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2" maxLength="35"/>
<x:inputC name="strSuppl4" label="街道5" labelCol="1" fieldCol="2" maxLength="35"/>
</div>
<div class="hg-form-row">
<x:selectC name="langu" label="语言" labelCol="1" fieldCol="2" required="true" dictionary="langu"/>
<x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" match="email"/>
<x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="true" maxLength="6"/>
<x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" />
<%--<x:inputC name="telExtens" label="第一个电话号码分机" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2"/>
<%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="faxNumber" label="传真" labelCol="1" fieldCol="2" maxLength="30"/>
<%--<x:inputC name="faxExtens" label="第一个传真号分机号" labelCol="1" fieldCol="2"/>--%>
<!--x:selectC name="ktokk" label="供应商帐户组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup"/-->
<x:inputC name="kunnr" label="客户编号" labelCol="1" fieldCol="2"/>
<%--<x:inputC name="vbund" label="贸易伙伴" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="stenr" label="税号" labelCol="1" fieldCol="2" required="true" maxLength="18"/>
<x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2"/>
</div>
<x:title title="联系人信息" name="group"/>
<div class="hg-form-row">
<x:inputC name="contact" label="联系人" labelCol="1" fieldCol="2"/>
<x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" />
<x:inputC name="faxNumber" label="传真" labelCol="1" fieldCol="2" maxLength="30"/>
<x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" match="email"/>
</div>
<div class="hg-form-row">
<x:inputC name="contact1" label="联系人1" labelCol="1" fieldCol="2"/>
<x:inputC name="telNumber1" label="电话1" labelCol="1" fieldCol="2" />
<x:inputC name="faxNumber1" label="传真1" labelCol="1" fieldCol="2" maxLength="30"/>
<x:inputC name="smtpAddr1" label="电子邮件地址1" labelCol="1" fieldCol="2" maxLength="30" match="email"/>
</div>
<div class="hg-form-row">
<x:inputC name="contact2" label="联系人2" labelCol="1" fieldCol="2"/>
<x:inputC name="telNumber2" label="电话2" labelCol="1" fieldCol="2" />
<x:inputC name="faxNumber2" label="传真2" labelCol="1" fieldCol="2" maxLength="30"/>
<x:inputC name="smtpAddr2" label="电子邮件地址2" labelCol="1" fieldCol="2" maxLength="30" match="email"/>
</div>
<div class="hg-form-row">
<x:inputC name="contact3" label="联系人3" labelCol="1" fieldCol="2"/>
<x:inputC name="telNumber3" label="电话3" labelCol="1" fieldCol="2" />
<x:inputC name="faxNumber3" label="传真3" labelCol="1" fieldCol="2" maxLength="30"/>
<x:inputC name="smtpAddr3" label="电子邮件地址3" labelCol="1" fieldCol="2" maxLength="30" match="email"/>
</div>
<x:title title="供应商银行信息" name="group"/>
<div class="hg-form-row">
......@@ -98,7 +113,6 @@
<x:inputC name="bkref" label="银行细目的参考明细" labelCol="1" fieldCol="2" required="false" maxLength="18"/>
<x:inputC name="koinh" label="账户持有人姓名" labelCol="1" fieldCol="2" required="false" />
</div>
<div id="frozenDiv">
<x:selectC name="sperr" label="中心记帐冻结" labelCol="1" fieldCol="2" dictionary="sperr"/>
<x:selectC name="sperm" label="集中设置的采购冻结" labelCol="2" fieldCol="1" dictionary="sperrB"/>
......
......@@ -44,45 +44,63 @@
<x:selectC name="buGroup" label="业务伙伴分组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup" disabled="true"/>
<x:inputC name="partner" label="供应商编码" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:selectC name="title" label="称谓代码" labelCol="1" fieldCol="2" dictionary="title" disabled="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="nameOrg1" label="供应商名称1" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:inputC name="nameOrg2" label="供应商名称2" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="nameOrg3" label="组织名称3" labelCol="1" fieldCol="2"/>
<x:inputC name="nameOrg4" label="组织名称4" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="buSort1" label="搜索词1" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:inputC name="buSort2" label="搜索词2" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="strSuppl1" label="街道2" labelCol="1" fieldCol="2"/>
<x:inputC name="strSuppl2" label="街道3" labelCol="1" fieldCol="2"/>
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2"/>--%>
</div>
<div class="hg-form-row">
<x:inputC name="land1Name" label="国家" labelCol="1" fieldCol="2" required="true" wrapper="select" readonly="true"/>
<x:hidden name="land1"/>
<x:inputC name="regionName" label="地区" labelCol="1" fieldCol="2" required="true" wrapper="select" readonly="true"/>
<x:hidden name="region"/>
<x:inputC name="city1" label="城市" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="true" maxLength="6" readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="street" label="街道地址" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:inputC name="strSuppl1" label="街道2" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:inputC name="strSuppl2" label="街道3" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
<x:inputC name="strSuppl4" label="街道5" labelCol="1" fieldCol="2" maxLength="35" readonly="true"/>
</div>
<div class="hg-form-row">
<x:selectC name="langu" label="语言" labelCol="1" fieldCol="2" required="true" dictionary="langu" disabled="true"/>
<x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" readonly="true" match="email"/>
<x:inputC name="postCode1" label="城市邮政编码" labelCol="1" fieldCol="2" required="true" maxLength="6" readonly="true"/>
<x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="telExtens" label="第一个电话号码分机" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="faxNumber" label="传真" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
<%--<x:inputC name="faxExtens" label="第一个传真号分机号" labelCol="1" fieldCol="2"/>--%>
<!--x:selectC name="ktokk" label="供应商帐户组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup"/-->
<x:inputC name="kunnr" label="客户编号" labelCol="1" fieldCol="2" readonly="true"/>
<%--<x:inputC name="vbund" label="贸易伙伴" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="stenr" label="税号" labelCol="1" fieldCol="2" required="true" maxLength="18" readonly="true"/>
<x:inputC name="mobNumber" label="移动电话" labelCol="1" fieldCol="2" readonly="true"/>
</div>
<x:title title="联系人信息" name="group"/>
<div class="hg-form-row">
<x:inputC name="contact" label="联系人" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="telNumber" label="电话" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="faxNumber" label="传真" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
<x:inputC name="smtpAddr" label="电子邮件地址" labelCol="1" fieldCol="2" maxLength="30" match="email" readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="contact1" label="联系人1" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="telNumber1" label="电话1" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="faxNumber1" label="传真1" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
<x:inputC name="smtpAddr1" label="电子邮件地址1" labelCol="1" fieldCol="2" maxLength="30" match="email" readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="contact2" label="联系人2" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="telNumber2" label="电话2" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="faxNumber2" label="传真2" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
<x:inputC name="smtpAddr2" label="电子邮件地址2" labelCol="1" fieldCol="2" maxLength="30" match="email" readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="contact3" label="联系人3" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="telNumber3" label="电话3" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="faxNumber3" label="传真3" labelCol="1" fieldCol="2" maxLength="30" readonly="true"/>
<x:inputC name="smtpAddr3" label="电子邮件地址3" labelCol="1" fieldCol="2" maxLength="30" match="email" readonly="true"/>
</div>
<div class="hg-form-row">
<x:selectC name="sperr" label="中心记帐冻结" labelCol="1" fieldCol="2" dictionary="sperr" disabled="true"/>
<x:selectC name="sperm" label="集中设置的采购冻结" labelCol="2" fieldCol="1" dictionary="sperrB" disabled="true"/>
</div>
</div>
<x:title title="供应商银行信息" name="group"/>
<div class="hg-form-row">
<x:selectC name="banks" label="银行所属国家" labelCol="1" fieldCol="2" required="true" dictionary="country" disabled="true"/>
......
......@@ -18,4 +18,8 @@ public interface BaseTask {
//根据业务ID查询审批人
List<String> queryHandlersByBizId(String bizId);
void deleteRunTimeTaskExtensionByBizId(String bizId);
void updateHistoricTaskInstanceExtensionByBizId(String bizId);
}
......@@ -6,11 +6,19 @@ import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.topsun.base.task.BaseTask;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import com.huigou.uasp.bmp.operator.OperatorApplication;
import com.huigou.uasp.bpm.ProcessStatus;
import com.huigou.uasp.bpm.TaskStatus;
import com.huigou.uasp.bpm.engine.application.WorkflowApplication;
import com.huigou.uasp.bpm.engine.domain.model.HistoricTaskInstanceExtension;
import com.huigou.uasp.bpm.engine.domain.model.RuntimeTaskExtension;
import com.huigou.uasp.bpm.engine.repository.HistoricTaskInstanceExtensionRepository;
import com.huigou.uasp.bpm.engine.repository.RuntimeTaskExtensionRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -24,6 +32,10 @@ public class BaseTaskImpl extends BaseApplication implements BaseTask {
private OperatorApplication operatorApplication;
@Autowired
private WorkflowApplication workflowService;
@Autowired
private RuntimeTaskExtensionRepository runtimeTaskExtensionRepository;
@Autowired
private HistoricTaskInstanceExtensionRepository historicTaskInstanceExtensionRepository;
@Override
public String queryTaskByBizId(String bizId) {
......@@ -47,4 +59,32 @@ public class BaseTaskImpl extends BaseApplication implements BaseTask {
String sql = queryDescriptor.getSql();
return this.sqlExecutorDao.queryToList(sql, String.class, bizId);
}
@Override
public void deleteRunTimeTaskExtensionByBizId(String bizId) {
//删除待办任务
List<String> kindIds = new ArrayList<>();
kindIds.add("task");
List<RuntimeTaskExtension> extensionList = runtimeTaskExtensionRepository.findCoordinationTaskInstances(bizId, "process", kindIds);
if (!CollectionUtils.isEmpty(extensionList)){
runtimeTaskExtensionRepository.delete(extensionList);
}
}
@Override
public void updateHistoricTaskInstanceExtensionByBizId(String bizId) {
//更新任务状态
List<HistoricTaskInstanceExtension> extensionList = historicTaskInstanceExtensionRepository.findByBusinessKeyAndTaskDefinitionKey(bizId, "Apply");
if (!CollectionUtils.isEmpty(extensionList)){
extensionList.forEach(historicTaskInstanceExtension -> {
if ("back".equals(historicTaskInstanceExtension.getGenerateReason())){
historicTaskInstanceExtension.setStatusId(ProcessStatus.ABORTED.getId());
historicTaskInstanceExtension.setStatusName(ProcessStatus.ABORTED.getDisplayName());
historicTaskInstanceExtension.setEndTime(new Date());
historicTaskInstanceExtension.setDeleteReason(TaskStatus.ABORTED.getId());
historicTaskInstanceExtensionRepository.save(historicTaskInstanceExtension);
}
});
}
}
}
......@@ -108,7 +108,7 @@ public class ProcessOutsourceOrderItem extends AbstractEntity {
private String lgortName;
/**
* 需求到货日期
* 货日期
*/
@Column(name = "EEIND")
private Date eeind;
......@@ -179,4 +179,10 @@ public class ProcessOutsourceOrderItem extends AbstractEntity {
@Column(name = "amount")
private BigDecimal amount;
/**
* 需求日期
*/
@Column(name = "BEDAT")
private Date bedat;
}
......@@ -52,7 +52,7 @@ public class ProcessOutsourceItemVo implements Serializable {
private String meins;
/**
* 需求到货日期
* 货日期
*/
@JsonProperty("EEIND")
private String eeind;
......@@ -130,4 +130,10 @@ public class ProcessOutsourceItemVo implements Serializable {
@JsonProperty("WAERS")
private String waers;
/**
* 需求日期
*/
@JsonProperty("BEDAT")
private String bedat;
}
......@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huigou.cache.SystemCache;
import com.huigou.context.Operator;
import com.huigou.context.ThreadLocalUtil;
......@@ -24,6 +26,8 @@ import com.huigou.topsun.sap.purchase.domain.vo.SapPurchaseItemVo;
import com.huigou.topsun.sap.purchase.domain.vo.SapPurchaseVo;
import com.huigou.topsun.sap.purchase.repository.SapPurchaseRepository;
import com.huigou.topsun.sap.common.domain.SapResult;
import com.huigou.topsun.sap.purchaseApproval.application.SapPurchaseApprovalApplication;
import com.huigou.topsun.sap.purchaseApproval.domain.SapPurchaseApprovalItem;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.operator.OperatorApplication;
import com.huigou.uasp.bmp.opm.domain.model.org.Org;
......@@ -67,6 +71,8 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas
private DataPermissionApplication dataPermissionApplication;
@Autowired
private OperatorApplication operatorApplication;
@Autowired
private SapPurchaseApprovalApplication sapPurchaseApprovalApplication;
@Override
protected String saveBizAndApprovalData() {
......@@ -183,10 +189,18 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas
SapPurchase sapPurchase = sapPurchaseRepository.findOne(bizId);
sapPurchase.setStatusId(status.getId());
sapPurchase.setFrgdt(new Date());
if ("close".equals(sapPurchase.getRevokeType())){
this.closeSapPurchase(sapPurchase);
}else {
this.createdSapPurchase(sapPurchase);
}
}
public void createdSapPurchase(SapPurchase sapPurchase){
SapPurchaseVo sapPurchaseVo = this.getSapPurchaseVoJson(sapPurchase);
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("businessType", "采购申请创建");
resultMap.put("businessId", bizId);
resultMap.put("businessId", sapPurchase.getId());
resultMap.put("parameter", JSON.toJSONString(sapPurchaseVo));
try {
String url = SystemCache.getParameter("sap.purchase.url", String.class);
......@@ -202,6 +216,8 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas
throw new RuntimeException("数据传输失败,"+ String.join(";",messages));
}
sapPurchase.setBanfn(sapResult.getMESSAGE_V1());//SAP采购申请编号
sapPurchase.setType(sapResult.getTYPE());
sapPurchase.setMessage(sapResult.getMESSAGE());
sapPurchaseRepository.save(sapPurchase);
} catch (IOException e) {
resultMap.put("TYPE", "E");
......@@ -212,6 +228,56 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas
}
}
public void closeSapPurchase(SapPurchase sapPurchase){
List<SapPurchaseItem> sapPurchaseItemList = this.sapPurchaseItemApplication.findBySapPurchaseId(sapPurchase.getId());
List<Map<String,Object>> paramList= new ArrayList<>();
for (SapPurchaseItem sapPurchaseItem : sapPurchaseItemList) {
Map<String,Object> paramItem = new HashMap<>();
paramItem.put("banfn",sapPurchase.getBanfn());
paramItem.put("BEDNR",sapPurchase.getBillCode());
paramItem.put("frgkz","10");
paramItem.put("bnfpo",sapPurchaseItem.getBnfpo());
paramItem.put("flag","N");
paramItem.put("status",0);
paramItem.put("ELIKZ", "X");
paramList.add(paramItem);
}
Map<String,Object> param = new HashMap<>();
param.put("MODE","PR");
param.put("DATA",paramList);
ObjectMapper objectMapper = new ObjectMapper();
String url = "pass_approval/approval";
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("businessType", "采购申请关单");
resultMap.put("businessId", sapPurchase.getId());
resultMap.put("parameter", JSON.toJSONString(param));
String type = "";
String message = "";
try {
String result = httpClient.execute(param, url);
List<Map<String, Object>> resultList = objectMapper.readValue(result, new TypeReference<List<Map<String, Object>>>() {});
Map<String, Object> backMap = resultList.get(0);
type = (String) backMap.get("TYPE");
message = (String) backMap.get("MESSAGE");
if (!"S".equals(type)) {
throw new RuntimeException("数据传输失败,请稍后手动重试!"+message);
} else {
resultMap.put("TYPE", type);
resultMap.put("MESSAGE", message);
}
} catch (Exception e) {
resultMap.put("TYPE", "E");
resultMap.put("MESSAGE", e.getMessage());
throw new RuntimeException("数据传输失败请检查数据后重试!"+e.getMessage());
}finally {
sapPurchase.setType(type);
sapPurchase.setMessage(message);
sapPurchaseRepository.save(sapPurchase);
sapMutualEpLogApplication.saveSapMutualEpLog(resultMap);
}
}
/**
* 转换成SAP JSON格式数据
* @param sapPurchase
......@@ -319,6 +385,12 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas
@Override
public String revokeApproval(String id,String revokeReason,String revokeType){
SapPurchase sapPurchase = this.sapPurchaseRepository.findOne(id);
//验证采购申请单是否生成了采购订单
String result = this.sapPurchaseApprovalApplication.checkOrderByPurchaseNo(sapPurchase.getBanfn());
//Y是可以提交撤审,N是查询到有对应的采购订单,不可以提交撤审
if ("N".equals(result)){
throw new RuntimeException("采购申请单已生成采购订单,不能撤销!");
}
if (sapPurchase.getStatusId()!=BizBillStatus.COMPLETED.getId()){
throw new RuntimeException("审批完成的单据才能撤销!");
}
......@@ -329,6 +401,7 @@ public class SapPurchaseApplicationImpl extends FlowBroker implements SapPurchas
SapPurchase newSapPurchase=new SapPurchase();
ClassHelper.copyProperties(sapPurchase,newSapPurchase);
newSapPurchase.setId("");
newSapPurchase.setBillCode("");
newSapPurchase.setRevokeReason(revokeReason);
newSapPurchase.setRevokeType(revokeType);
String pId=mannualStartWorkApplication.startWorkflow(newSapPurchase,PROCESS_DEFINITION_KEY,"sapPurchase");
......
......@@ -189,6 +189,9 @@ public class SapPurchaseController extends CommonController {
SDO sdo = this.getSDO();
String id = sdo.getId();
this.putAttribute("id",id);
this.putAttribute("revokeType","close");
this.putAttribute("revokeTypeTextView","关单");
return forward("showRevokeDetail");
}
}
......@@ -53,6 +53,17 @@ public class SapPurchase extends FlowBillAbstractEntity {
@Column(name = "revoke_type")
private String revokeType;
/**
* 消息类型
*/
@Column(name = "TYPE")
private String type;
/**
* 消息内容
*/
@Column(name = "MESSAGE")
private String message;
private static final long serialVersionUID = 1L;
@Override
......
......@@ -25,5 +25,7 @@ public interface SapPurchaseApprovalApplication {
String revokeApproval(String id,String revokeReason,String revokeType);
void abortPurchaseApproval(String id,String jobPageId);
String checkOrderByPurchaseNo(String banfn);
void abortPurchaseApproval(String id, String jobPageId);
}
......@@ -5,21 +5,17 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huigou.cache.DictUtil;
import com.huigou.cache.SystemCache;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.context.ThreadLocalUtil;
import com.huigou.data.domain.model.CommonDomainConstants;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.base.bsnMessage.appliction.MannualStartWorkApplication;
import com.huigou.topsun.base.task.BaseTask;
import com.huigou.topsun.sap.common.DefaultHttpClient;
import com.huigou.topsun.sap.common.application.SapMutualEpLogApplication;
import com.huigou.topsun.sap.common.domain.SapMutualEpLog;
import com.huigou.topsun.sap.costReimbursement.domain.SapCostReimbursement;
import com.huigou.topsun.sap.purchase.domain.SapPurchase;
import com.huigou.topsun.sap.purchase.domain.SapPurchaseItem;
import com.huigou.topsun.sap.purchaseApproval.application.SapPurchaseApprovalApplication;
import com.huigou.topsun.sap.purchaseApproval.application.SapPurchaseApprovalItemApplication;
import com.huigou.topsun.sap.purchaseApproval.domain.SapPurchaseApproval;
......@@ -29,24 +25,16 @@ import com.huigou.topsun.sap.purchaseApproval.domain.vo.SapPurchaseApprovalDto;
import com.huigou.topsun.sap.purchaseApproval.domain.vo.SapPurchaseApprovalItemVo;
import com.huigou.topsun.sap.purchaseApproval.domain.vo.SapPurchaseApprovalVo;
import com.huigou.topsun.sap.purchaseApproval.repository.SapPurchaseApprovalRepository;
import com.huigou.topsun.sap.purchaseOrder.domain.SapPurchaseOrder;
import com.huigou.topsun.sap.sapApplication.application.SapDictionaryApplication;
import com.huigou.topsun.sap.transfers.application.SapStockTransfersApplication;
import com.huigou.topsun.util.SAPUtils;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.fn.CodeGenerator;
import com.huigou.uasp.bmp.operator.OperatorApplication;
import com.huigou.uasp.bmp.opm.domain.model.org.Org;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.uasp.bpm.ProcessAction;
import com.huigou.uasp.bpm.ProcessStartModel;
import com.huigou.uasp.bpm.engine.application.WorkflowApplication;
import com.huigou.util.*;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.persistence.entity.TaskEntity;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -84,6 +72,8 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
private SapStockTransfersApplication sapStockTransfersApplication;
@Autowired
private SapDictionaryApplication sapDictionaryApplication;
@Autowired
private BaseTask baseTask;
@Override
protected String saveBizAndApprovalData() {
......@@ -289,6 +279,7 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
BeanUtil.copyProperties(sapPurchaseApprovalDto.getLsDeader(), sapPurchaseApproval);
List<SapPurchaseApprovalItemVo> approvalItemVoList = sapPurchaseApprovalDto.getItems();
List<SapPurchaseApprovalItem> sapPurchaseApprovalItems = new ArrayList<>();
String loekz = "";//删除标识
for (SapPurchaseApprovalItemVo approvalItemVo : approvalItemVoList) {
SapPurchaseApprovalItem sapPurchaseApprovalItem = new SapPurchaseApprovalItem();
BeanUtil.copyProperties(approvalItemVo,sapPurchaseApprovalItem);
......@@ -317,6 +308,9 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
if ("7".equals(sapPurchaseApprovalItem.getPstyp())){
sapPurchaseApproval.setBatxt(sapPurchaseApprovalItem.getPtext());
}
if ("L".equals(approvalItemVo.getLoekz())){
loekz = "L";
}
}
//knttp审批要素没有值时,赋值0,防止发起流程时报错
if (StringUtil.isBlank(sapPurchaseApproval.getKnttp())){
......@@ -354,6 +348,12 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
List<String> collect = itemList.stream().map(SapPurchaseApprovalItem::getId).collect(Collectors.toList());
sapPurchaseApprovalItemApplication.deleteByIds(collect);
purchaseApprovalId = purchaseApproval.getId();
if ("L".equals(loekz)){
purchaseApproval.setStatusId(BizBillStatus.ABORTED.getId());
baseTask.deleteRunTimeTaskExtensionByBizId(purchaseApproval.getId());
baseTask.updateHistoricTaskInstanceExtensionByBizId(purchaseApproval.getId());
}
}
this.sapPurchaseApprovalRepository.save(purchaseApproval);
}
......@@ -560,7 +560,8 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
return newSapPurchaseApproval.getId();
}
private String checkOrderByPurchaseNo(String banfn) {
@Override
public String checkOrderByPurchaseNo(String banfn) {
String result = "";
try {
List<Map<String, String>> mapList = sapDictionaryApplication.getSapDictionary("BANFN", banfn);
......
......@@ -196,5 +196,11 @@ public class SapPurchaseApprovalItem extends AbstractEntity {
@Column(name = "BUKRS")
private String bukrs;
/**
* 删除标识
*/
@Column(name = "LOEKZ")
private String loekz;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -191,6 +191,10 @@ public class SapPurchaseApprovalItemVo {
@JsonProperty("BUKRS")
private String bukrs;
/**
* 删除标识
*/
@JsonProperty("LOEKZ")
private String loekz;
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import com.huigou.data.domain.model.CommonDomainConstants;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.base.bsnMessage.appliction.MannualStartWorkApplication;
import com.huigou.topsun.base.task.BaseTask;
import com.huigou.topsun.common.CommonUtils;
import com.huigou.topsun.ep.epApplication.EpApplication;
import com.huigou.topsun.ep.epApplication.EpVo.EpProductInfoVo;
......@@ -110,7 +111,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
@Autowired
SapMutualEpLogApplication sapMutualEpLogApplication;
@Autowired
private RuntimeTaskExtensionRepository runtimeTaskExtensionRepository;
private BaseTask baseTask;
@Autowired
private NonProdApplyDeptRepository nonProdApplyDeptRepository;
......@@ -390,13 +391,8 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
purchaseOrderId = purchaseOrder.getId();
if ("L".equals(loekz)){
purchaseOrder.setStatusId(BizBillStatus.ABORTED.getId());
//删除待办任务
List<String> kindIds = new ArrayList<>();
kindIds.add("task");
List<RuntimeTaskExtension> extensionList = runtimeTaskExtensionRepository.findCoordinationTaskInstances(purchaseOrder.getId(), "process", kindIds);
if (!CollectionUtils.isEmpty(extensionList)){
runtimeTaskExtensionRepository.delete(extensionList);
}
baseTask.deleteRunTimeTaskExtensionByBizId(purchaseOrder.getId());
baseTask.updateHistoricTaskInstanceExtensionByBizId(purchaseOrder.getId());
}
}
this.sapPurchaseOrderRepository.save(purchaseOrder);
......@@ -483,6 +479,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
SapPurchaseOrder newSapPurchaseOrder=new SapPurchaseOrder();
ClassHelper.copyProperties(sapPurchaseOrder,newSapPurchaseOrder);
newSapPurchaseOrder.setId("");
newSapPurchaseOrder.setBillCode("");
newSapPurchaseOrder.setRevokeReason(revokeReason);//撤审原因
newSapPurchaseOrder.setRevokeType(revokeType);//撤审类型
String pId=mannualStartWorkApplication.startWorkflow(newSapPurchaseOrder,PROCESS_DEFINITION_KEY,"sapPurchaseOrder");
......@@ -560,7 +557,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
if (StringUtil.isNotBlank(ltext)){
strList.add(ltext);
}
if (StringUtil.isNotBlank(vbeln)){
if (StringUtil.isNotBlank(vbeln) && strList.size()>0){
headText2 = headText2 + vbeln + ":"+ String.join(";", strList);
}
}
......
......@@ -349,6 +349,55 @@ public class SuppliersInfo extends FlowBillAbstractEntity {
@Transient
private String sId;
@Column(name = "contact")
private String contact;
@Column(name = "contact1")
private String contact1;
@Column(name = "contact2")
private String contact2;
@Column(name = "contact3")
private String contact3;
@Column(name = "tel_number1")
private String telNumber1;
@Column(name = "tel_number2")
private String telNumber2;
@Column(name = "tel_number3")
private String telNumber3;
@Column(name = "fax_number1")
private String faxNumber1;
@Column(name = "fax_number2")
private String faxNumber2;
@Column(name = "fax_number3")
private String faxNumber3;
/**
* 电子邮件地址
*/
@Column(name = "smtp_addr1")
private String smtpAddr1;
/**
* 电子邮件地址
*/
@Column(name = "smtp_addr2")
private String smtpAddr2;
/**
* 电子邮件地址
*/
@Column(name = "smtp_addr3")
private String smtpAddr3;
@Override
protected String getCodeRuleId() {
return "sapSuppliersInfo";
......
......@@ -52,7 +52,8 @@
t.MENGE,
t.MEINS,
t.MEINS_NAME,
DATE_FORMAT(t.EEIND, '%Y-%m-%d') EEIND,
t.EEIND,
t.BEDAT,
t.LIFNR,
t.LIFNR_NAME,
t.KBETR,
......
......@@ -20,6 +20,8 @@
t.banfn,
t.revoke_type,
t.revoke_reason,
t.type,
t.message,
it.sap_purchase_id,
it.bnfpo,
it.pstyp,
......
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