Commit 7475eb3f authored by 1650842865's avatar 1650842865

质量评审表增加采购订单类型、订单数量、供应商编码、供应商名称、仓管员;

parent e94cdbb0
...@@ -27,32 +27,37 @@ ...@@ -27,32 +27,37 @@
<x:hidden name="hasDecide"/> <x:hidden name="hasDecide"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="mblnr" required="false" readonly="true" label="物料凭证号" labelCol="2" fieldCol="2"/> <x:inputC name="mblnr" required="false" readonly="true" label="物料凭证号" labelCol="1" fieldCol="2"/>
<x:inputC name="zeile" required="false" readonly="true" label="凭证项次" labelCol="2" fieldCol="2"/> <x:inputC name="zeile" required="false" readonly="true" label="凭证项次" labelCol="1" fieldCol="2"/>
<x:inputC name="mjahr" required="false" readonly="true" label="凭证年份" labelCol="2" fieldCol="2"/> <x:inputC name="mjahr" required="false" readonly="true" label="凭证年份" labelCol="1" fieldCol="2"/>
<x:inputC name="type" required="false" readonly="true" label="类别" labelCol="1" fieldCol="2"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="productName" required="false" readonly="true" label="产品名称" labelCol="2" fieldCol="2"/> <x:inputC name="productName" required="false" readonly="true" label="产品名称" labelCol="1" fieldCol="2"/>
<x:inputC name="type" required="false" readonly="true" label="类别" labelCol="2" fieldCol="2"/> <x:inputC name="batchNo" required="false" readonly="true" label="生产批次" labelCol="1" fieldCol="2"/>
<x:inputC name="batchNo" required="false" readonly="true" label="生产批次" labelCol="2" fieldCol="2"/> <x:inputC name="purchaseOrderNo" required="false" readonly="true" label="采购单号" labelCol="1" fieldCol="2"/>
<x:inputC name="orderType" required="false" readonly="true" label="订单类型" labelCol="1" fieldCol="2"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="purchaseOrderNo" required="false" readonly="true" label="采购单号" labelCol="2" fieldCol="2"/> <x:inputC name="pd" required="false" readonly="true" label="PD/YL编码" labelCol="1" fieldCol="2"/>
<x:inputC name="pd" required="false" readonly="true" label="PD/YL编码" labelCol="2" fieldCol="2"/> <x:inputC name="quantity" required="false" readonly="true" label="订单数量" labelCol="1" fieldCol="2"/>
<x:inputC name="exceptionNum" required="false" readonly="true" label="异常数量" labelCol="2" maxLength="64" fieldCol="2"/> <x:inputC name="exceptionNum" required="false" readonly="true" label="异常数量" labelCol="1" maxLength="64" fieldCol="2"/>
<x:inputC name="process" required="false" readonly="true" label="部门/工序" labelCol="1" maxLength="64" fieldCol="2"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:hidden name="dutyDept"/> <x:hidden name="dutyDept"/>
<x:inputC name="process" required="false" readonly="true" label="部门/工序" labelCol="2" maxLength="64" fieldCol="2"/>
<x:inputC name="dutyDeptName" required="false" readonly="true" label="评审部门" labelCol="2" fieldCol="2" />
<x:hidden name="submitter"/> <x:hidden name="submitter"/>
<x:inputC name="submitterName" required="false" readonly="true" label="提报人" labelCol="2" fieldCol="2" /> <x:inputC name="vendorCode" required="false" readonly="true" label="供应商编码" labelCol="1" maxLength="64" fieldCol="2"/>
<x:inputC name="vendorName" required="false" readonly="true" label="供应商名称" labelCol="1" maxLength="64" fieldCol="2"/>
<x:inputC name="dutyDeptName" required="false" readonly="true" label="评审部门" labelCol="1" fieldCol="2" />
<x:inputC name="submitterName" required="false" readonly="true" label="提报人" labelCol="1" fieldCol="2" />
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:textareaC name="exceptionDesc" required="false" label="异常描述" labelCol="2" fieldCol="10" rows="3" readonly="true"/> <x:textareaC name="exceptionDesc" required="false" label="异常描述" labelCol="1" fieldCol="10" rows="3" readonly="true"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:selectC name="result" required="false" label="评审结果" labelCol="2" fieldCol="2" dictionary="result"/> <x:inputC name="usnam" required="false" readonly="true" label="仓管员" labelCol="1" fieldCol="2" />
<x:selectC name="result" required="false" label="评审结果" labelCol="1" fieldCol="2" dictionary="result"/>
</div> </div>
</div> </div>
<div style="padding-top: 15px;"> <div style="padding-top: 15px;">
......
...@@ -690,9 +690,9 @@ function bindEvent() { ...@@ -690,9 +690,9 @@ function bindEvent() {
$("#thickness").val(thickness); $("#thickness").val(thickness);
$("#weight").val(weight); $("#weight").val(weight);
$("#maktxRemZh").val(maktxRemZh); $("#maktxRemZh").val(maktxRemZh);
this.close();
} }
}); });
this.close();
} }
}) })
}) })
...@@ -1017,13 +1017,30 @@ function bindEvent_financial(mtart) { ...@@ -1017,13 +1017,30 @@ function bindEvent_financial(mtart) {
$("#ekalr").val("X");//数量结构 $("#ekalr").val("X");//数量结构
} }
//物料类型=ZSRV服务时。成本视图——不计算成本默认打勾选上 //物料类型=ZSRV服务时。成本视图——不计算成本默认打勾选上
// if (mtart == "ZSRV"){ // 物料类型 字段NCOST
// $("#ncost").val("X");//不参与成本核算 // ZBPJ 空
// }else { // ZBZP 空
// $("#ncost").val("0");//不参与成本核算 // ZCOM 空
// } // ZECC 空
// ZGMB 空
// ZKGL X
// ZSHB 空
// ZSRV 见注解
// ZXNJ X
// ZYCL 空
// ZZCP 空
if (mtart == "ZKGL" || mtart == "ZXNJ"){
$("#ncost").val("X");//不参与成本核算
$("#ncost_text").val("X-是");//不参与成本核算
}else if (mtart == "ZSRV"){
$("#ncost").val("");//不参与成本核算
$("#ncost_text").val("");//不参与成本核算
}else {
$("#ncost").val("0");//不参与成本核算
$("#ncost_text").val("0-否");//不参与成本核算
}
//调整为全部传空 //调整为全部传空
$("#ncost").val("0");//不参与成本核算 //$("#ncost").val("0");//不参与成本核算
} }
......
...@@ -394,7 +394,7 @@ ...@@ -394,7 +394,7 @@
</div> </div>
<div class="hg-form-cols" id="financialDiv"> <div class="hg-form-cols" id="financialDiv">
<%--<x:title title="财务核算" name="group"/>--%> <x:title title="财务核算" name="group"/>
<div class="hg-form-row"> <div class="hg-form-row">
<!--x:selectC name="bklas" label="评估分类" labelCol="1" fieldCol="2" dictionary="bklas"/--> <!--x:selectC name="bklas" label="评估分类" labelCol="1" fieldCol="2" dictionary="bklas"/-->
...@@ -404,7 +404,8 @@ ...@@ -404,7 +404,8 @@
<x:hidden name="mlast" /> <x:hidden name="mlast" />
<x:hidden name="peinh" /> <x:hidden name="peinh" />
<x:hidden name="ncost" /> <x:selectC name="ncost" label="不参与成本核算" labelCol="1" fieldCol="1" dictionary="ncost" />
<%--<x:hidden name="ncost" />--%>
<x:hidden name="hkmat" /> <x:hidden name="hkmat" />
<x:hidden name="verpr" /> <x:hidden name="verpr" />
<x:hidden name="stprs" /> <x:hidden name="stprs" />
......
...@@ -105,7 +105,11 @@ function loadNonProdApplyListGrid() { ...@@ -105,7 +105,11 @@ function loadNonProdApplyListGrid() {
} }
}, },
{display: "工厂", name: "werksName", width: 200, minWidth: 60, type: "string", align: "left"}, {display: "工厂", name: "werksName", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "物料/产品编码", name: "matnr", width: 150, minWidth: 60, type: "string", align: "left"}, {display: "物料/产品编码", name: "matnr", width: 150, minWidth: 60, type: "string", align: "left",
// render:function(item){
// return item.matnr.replace(/^0+/, '');
// }
},
{display: "维护类型", name: "maintenanceTypeTextView", width: 130, minWidth: 60, type: "string", align: "left", {display: "维护类型", name: "maintenanceTypeTextView", width: 130, minWidth: 60, type: "string", align: "left",
render:function(item){ render:function(item){
var result = item.maintenanceTypeTextView+"-待填报"; var result = item.maintenanceTypeTextView+"-待填报";
......
...@@ -653,10 +653,15 @@ function financialDisplayNcost(vprsv) { // alert("-="+vprsv); ...@@ -653,10 +653,15 @@ function financialDisplayNcost(vprsv) { // alert("-="+vprsv);
//物料类型=ZSRV服务时。成本视图——不计算成本默认打勾选上 //物料类型=ZSRV服务时。成本视图——不计算成本默认打勾选上
var mtart = $("#mtart").val(); var mtart = $("#mtart").val();
if (mtart == "ZSRV"){ if (mtart == "ZKGL" || mtart == "ZXNJ"){
$('#ncost').val('0'); $("#ncost").val("X");//不参与成本核算
//$("#ncost").val("X");//不参与成本核算 $("#ncost_text").val("X-是");//不参与成本核算
//$('#ncost_text').val('X-是'); }else if (mtart == "ZSRV"){
$("#ncost").val("");//不参与成本核算
$("#ncost_text").val("");//不参与成本核算
}else {
$("#ncost").val("0");//不参与成本核算
$("#ncost_text").val("0-否");//不参与成本核算
} }
} }
...@@ -1455,9 +1460,9 @@ function bindEvent() { ...@@ -1455,9 +1460,9 @@ function bindEvent() {
$("#thickness").val(thickness); $("#thickness").val(thickness);
$("#weight").val(weight); $("#weight").val(weight);
$("#maktxRemZh").val(maktxRemZh); $("#maktxRemZh").val(maktxRemZh);
this.close();
} }
}); });
this.close();
} }
}) })
}) })
......
...@@ -376,7 +376,7 @@ ...@@ -376,7 +376,7 @@
<x:inputC name="peinh" label="定价基数" labelCol="1" fieldCol="2" required="false"/> <x:inputC name="peinh" label="定价基数" labelCol="1" fieldCol="2" required="false"/>
<x:hidden name="ncost"/> <x:hidden name="ncost"/>
<%--<x:selectC name="ncost" label="不参与成本核算" labelCol="2" fieldCol="1" dictionary="ncost" />--%> <x:selectC name="ncost" label="不参与成本核算" labelCol="2" fieldCol="1" dictionary="ncost" />
<x:selectC name="hkmat" label="物料来源" labelCol="2" fieldCol="1" dictionary="xchpf"/> <x:selectC name="hkmat" label="物料来源" labelCol="2" fieldCol="1" dictionary="xchpf"/>
<x:inputC name="verpr" label="移动平均价" labelCol="1" fieldCol="2"/> <x:inputC name="verpr" label="移动平均价" labelCol="1" fieldCol="2"/>
<x:inputC name="stprs" label="标准价" labelCol="1" fieldCol="2"/> <x:inputC name="stprs" label="标准价" labelCol="1" fieldCol="2"/>
......
...@@ -62,6 +62,30 @@ function loadGrid() { ...@@ -62,6 +62,30 @@ function loadGrid() {
// } // }
gridManager = UICtrl.grid("#maingrid", { gridManager = UICtrl.grid("#maingrid", {
columns: [ columns: [
{
display: "采购单号", name: "ebeln", width: "160", align: "left", type: "string",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "EKPO"}
},
back: {
EBELN: "ebeln",
MATNR: "matnr",
TXZ01: "belongings",
ZNAME: "lifnrName",
MEINS: "unit",
MEINS: "unitName"
}
}
}
},
{
display: "携出物品编码", name: "matnr", width: "160", align: "left", type: "string",
},
{ display: "携出物品名称", name: "belongings", width: 380, minWidth: 200, type: "string", align: "left", { display: "携出物品名称", name: "belongings", width: 380, minWidth: 200, type: "string", align: "left",
editor: { type: "text",required: true } editor: { type: "text",required: true }
}, },
...@@ -71,16 +95,6 @@ function loadGrid() { ...@@ -71,16 +95,6 @@ function loadGrid() {
}, },
{display: "unit", name: "unit", width: "140", align: "left", type: "string", hide: true}, {display: "unit", name: "unit", width: "140", align: "left", type: "string", hide: true},
{ display: "单位", name: "unitName", width: 120, minWidth: 60, type: "string", align: "left", { display: "单位", name: "unitName", width: 120, minWidth: 60, type: "string", align: "left",
/*editor: {
type: 'dictionary',
data: {name: 'sapPermitUnit'},
textField: 'unitTextView',
valueField: 'unit',
required: true,
render: function (item) {
return item.unitTextView;
},required: true
}*/
editor: { editor: {
required: true, type: "select", required: true, type: "select",
data: { data: {
...@@ -115,6 +129,13 @@ function loadGrid() { ...@@ -115,6 +129,13 @@ function loadGrid() {
checkbox: true, checkbox: true,
fixedCellHeight: true, fixedCellHeight: true,
selectRowButtonOnly: true, selectRowButtonOnly: true,
onAfterEdit:function (item) {
if (item.column.name == "ebeln" ){
var lifnrName = item.record.lifnrName;
$("#company").val(lifnrName);
}
return item;
}
}); });
UICtrl.setSearchAreaToggle(gridManager); UICtrl.setSearchAreaToggle(gridManager);
} }
......
...@@ -82,7 +82,6 @@ function bindEvent(){ ...@@ -82,7 +82,6 @@ function bindEvent(){
return {fieldName: "WERKS"} return {fieldName: "WERKS"}
}, },
onChange: function (value, data) { onChange: function (value, data) {
debugger;
var werks = $("#werks").val(); var werks = $("#werks").val();
if (data.WERKS != werks) { if (data.WERKS != werks) {
...@@ -123,6 +122,13 @@ function bindEvent(){ ...@@ -123,6 +122,13 @@ function bindEvent(){
getParam: function (item) { getParam: function (item) {
}, },
onChange: function (value, data) { onChange: function (value, data) {
debugger;
var name1 = $("#name1").val();
if (data.nameOrg1 != name1) {
//如果选择的是其他公司,清空所选物料数据
$('#waersName').val("");
$('#waers').val("");
}
$('#lifnr').val(data.partner); $('#lifnr').val(data.partner);
$('#name1').val(data.nameOrg1); $('#name1').val(data.nameOrg1);
} }
......
...@@ -42,11 +42,11 @@ function initPurchaseListGrid() { ...@@ -42,11 +42,11 @@ function initPurchaseListGrid() {
copyQualityInfoRecord(); copyQualityInfoRecord();
} }
}, },
cancelHandler:{ // cancelHandler:{
id: 'cancelHandler', text: "作废", img:'fa-trash-o', click: function(){ // id: 'cancelHandler', text: "作废", img:'fa-trash-o', click: function(){
cancelHandlerInfoRecord(); // cancelHandlerInfoRecord();
} // }
} // }
}); });
purchaseInfoRecordGridManager = UICtrl.grid('#purchaseInfoRecordGrid', { purchaseInfoRecordGridManager = UICtrl.grid('#purchaseInfoRecordGrid', {
columns: [ columns: [
...@@ -109,7 +109,7 @@ function initPurchaseListGrid() { ...@@ -109,7 +109,7 @@ function initPurchaseListGrid() {
_tableKey: 'sapPurchaseInfoRecord', _tableKey: 'sapPurchaseInfoRecord',
_local: true, _local: true,
url: web_app.name + '/sapPurchaseInfoRecord/slicedSapPurchaseInfoRecordList.ajax?', url: web_app.name + '/sapPurchaseInfoRecord/slicedSapPurchaseInfoRecordList.ajax?',
//parms: {requireItemId: $("#prepareItemId").val()}, parms: {cancelFlag: $("#cancelFlag").val()},
toolbar: toolbarOptions, toolbar: toolbarOptions,
width: '99.8%', width: '99.8%',
height: '100%', height: '100%',
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
<div class="col-xs-4 col-sm-2 col-white-bg"> <div class="col-xs-4 col-sm-2 col-white-bg">
<x:input name="fillinEndDate" label="至" required="false" wrapper="date" /> <x:input name="fillinEndDate" label="至" required="false" wrapper="date" />
</div> </div>
<x:selectC name="cancelFlag" label="作废状态" labelCol="1" dictionary="cancelFlag"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:checkboxListC name="statusKind" label="common.field.status" list="statusKindsList" labelCol="1" fieldCol="3"/> <x:checkboxListC name="statusKind" label="common.field.status" list="statusKindsList" labelCol="1" fieldCol="3"/>
......
...@@ -29,6 +29,7 @@ import com.huigou.topsun.sap.purchaseOrder.repository.SapPurchaseOrderRepository ...@@ -29,6 +29,7 @@ import com.huigou.topsun.sap.purchaseOrder.repository.SapPurchaseOrderRepository
import com.huigou.uasp.bmp.common.BizBillStatus; import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.operator.OperatorApplication; import com.huigou.uasp.bmp.operator.OperatorApplication;
import com.huigou.uasp.bmp.opm.domain.model.org.Org; import com.huigou.uasp.bmp.opm.domain.model.org.Org;
import com.huigou.uasp.bmp.opm.domain.model.org.Person;
import com.huigou.uasp.bpm.FlowBroker; import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.uasp.bpm.ProcessAction; import com.huigou.uasp.bpm.ProcessAction;
import com.huigou.uasp.bpm.ProcessStartModel; import com.huigou.uasp.bpm.ProcessStartModel;
...@@ -329,7 +330,7 @@ public class UnqualifiedMaterialsApplicationImpl extends FlowBroker implements U ...@@ -329,7 +330,7 @@ public class UnqualifiedMaterialsApplicationImpl extends FlowBroker implements U
//质量异常评审表审批完成后:抄送给采购订单的采购员和审批人、仓库、质量异常评审表创建人和审批人 //质量异常评审表审批完成后:抄送给采购订单的采购员和审批人、仓库、质量异常评审表创建人和审批人
List<String> handlers = baseTask.queryHandlersByBizId(bizId); List<String> handlers = baseTask.queryHandlersByBizId(bizId);
List<String> executorIds = new ArrayList<>(handlers); Set<String> setIds = new HashSet<>(handlers);
//获取采购订单的采购员和审批人 //获取采购订单的采购员和审批人
SapPurchaseOrder order = sapPurchaseOrderRepository.findByEbelnAndStatusId(unqualifiedMaterials.getPurchaseOrderNo(),BizBillStatus.COMPLETED.getId()); SapPurchaseOrder order = sapPurchaseOrderRepository.findByEbelnAndStatusId(unqualifiedMaterials.getPurchaseOrderNo(),BizBillStatus.COMPLETED.getId());
...@@ -337,10 +338,17 @@ public class UnqualifiedMaterialsApplicationImpl extends FlowBroker implements U ...@@ -337,10 +338,17 @@ public class UnqualifiedMaterialsApplicationImpl extends FlowBroker implements U
throw new RuntimeException("采购订单:" + unqualifiedMaterials.getPurchaseOrderNo() + " 未审批完成"); throw new RuntimeException("采购订单:" + unqualifiedMaterials.getPurchaseOrderNo() + " 未审批完成");
} }
List<String> orderHandlers = baseTask.queryHandlersByBizId(order.getId()); List<String> orderHandlers = baseTask.queryHandlersByBizId(order.getId());
executorIds.add(order.getPersonMemberId()); setIds.add(order.getPersonMemberId());
executorIds.addAll(orderHandlers); setIds.addAll(orderHandlers);
//仓管员
//TODO 获取仓库人员 String usnam = unqualifiedMaterials.getUsnam();
if (StringUtil.isNotBlank(usnam)){
Org org = orgApplication.loadMainOrgByLoginName(usnam);
if (org != null){
setIds.add(org.getId());
}
}
List<String> executorIds = new ArrayList<>(setIds);
baseTask.makeACopyFor(bizId,personMemberId,executorIds,title); baseTask.makeACopyFor(bizId,personMemberId,executorIds,title);
} }
......
...@@ -137,6 +137,36 @@ public class UnqualifiedMaterials extends FlowBillAbstractEntity { ...@@ -137,6 +137,36 @@ public class UnqualifiedMaterials extends FlowBillAbstractEntity {
*/ */
@Column(name = "purchase_order_no") @Column(name = "purchase_order_no")
private String purchaseOrderNo; private String purchaseOrderNo;
/**
* 仓管员
*/
@Column(name = "usnam")
private String usnam;
/**
* sap订单类型
*/
@Column(name = "order_type")
private String orderType;
/**
* 订单数量
*/
@Column(name = "quantity")
private String quantity;
/**
* 供应商名称
*/
@Column(name = "vendor_name")
private String vendorName;
/**
* 供应商编码
*/
@Column(name = "vendor_code")
private String vendorCode;
@Override @Override
protected String getCodeRuleId() { protected String getCodeRuleId() {
return "unqualifiedMaterials"; return "unqualifiedMaterials";
......
package com.huigou.topsun.mes.unqualifiedMaterials.domain.vo; package com.huigou.topsun.mes.unqualifiedMaterials.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.huigou.data.domain.model.FlowBillAbstractEntity;
import lombok.Data; import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* @Auther: xin.lu * @Auther: xin.lu
...@@ -106,4 +101,34 @@ public class UnqualifiedMaterialsVo implements Serializable { ...@@ -106,4 +101,34 @@ public class UnqualifiedMaterialsVo implements Serializable {
*/ */
@JsonProperty("purchaseOrderNo") @JsonProperty("purchaseOrderNo")
private String purchaseOrderNo; private String purchaseOrderNo;
/**
* 仓管员
*/
@JsonProperty("username")
private String usnam;
/**
* sap订单类型
*/
@JsonProperty("orderType")
private String orderType;
/**
* 数量
*/
@JsonProperty("quantity")
private String quantity;
/**
* 供应商名称
*/
@JsonProperty("vendorName")
private String vendorName;
/**
* 供应商编码
*/
@JsonProperty("vendorCode")
private String vendorCode;
} }
...@@ -112,6 +112,12 @@ public class ProdApplyFromSapVO { ...@@ -112,6 +112,12 @@ public class ProdApplyFromSapVO {
@JsonProperty("MAKTX_ZH") @JsonProperty("MAKTX_ZH")
private String maktx; private String maktx;
/**
* 中文文本说明
*/
@JsonProperty("MAKTX_REM_ZH")
private String maktxRemZh;
/** /**
* 汉语语言 * 汉语语言
*/ */
......
...@@ -53,5 +53,23 @@ public class SapPermitItem extends AbstractEntity { ...@@ -53,5 +53,23 @@ public class SapPermitItem extends AbstractEntity {
@Column(name = "remark") @Column(name = "remark")
private String remark; private String remark;
/**
* SAP采购订单
*/
@Column(name = "ebeln")
private String ebeln;
/**
* 物料编码
*/
@Column(name = "matnr")
private String matnr;
/**
* 供应商名称
*/
@Column(name = "lifnr_name")
private String lifnrName;
} }
\ No newline at end of file
...@@ -320,9 +320,8 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa ...@@ -320,9 +320,8 @@ public class SapPurchaseApprovalApplicationImpl extends FlowBroker implements Sa
for (SapPurchaseApproval purchaseApproval : purchaseApprovalList) { for (SapPurchaseApproval purchaseApproval : purchaseApprovalList) {
//将存在的作废掉 05.11 lxh //将存在的作废掉 05.11 lxh
//终止状态不管 //审批完成的,终止状态的,终止审批完成的,并发起新的流程
//审批完成的,SAP撤审触发,终止审批完成的,并发起新的流程 if (purchaseApproval.getStatusId() == BizBillStatus.COMPLETED.getId() || purchaseApproval.getStatusId() == BizBillStatus.ABORTED.getId()){
if (purchaseApproval.getStatusId() == BizBillStatus.COMPLETED.getId()){
purchaseApproval.setStatusId(BizBillStatus.ABORTED.getId()); purchaseApproval.setStatusId(BizBillStatus.ABORTED.getId());
purchaseApprovalId=mannualStartWorkApplication.startWorkflow(sapPurchaseApproval,PROCESS_DEFINITION_KEY,"sapPurchaseApproval"); purchaseApprovalId=mannualStartWorkApplication.startWorkflow(sapPurchaseApproval,PROCESS_DEFINITION_KEY,"sapPurchaseApproval");
} }
......
...@@ -255,6 +255,7 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements ...@@ -255,6 +255,7 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
sapPurchaseInfoRecordItem.setMESSAGE(sapResult.getMESSAGE()); sapPurchaseInfoRecordItem.setMESSAGE(sapResult.getMESSAGE());
// sapPurchaseInfoRecordItem.setInfnr();//回写信息记录编号 待确认 //????? // sapPurchaseInfoRecordItem.setInfnr();//回写信息记录编号 待确认 //?????
sapPurchaseInfoRecordItemApplication.save(sapPurchaseInfoRecordItem); sapPurchaseInfoRecordItemApplication.save(sapPurchaseInfoRecordItem);
this.markCancelRecordItems(sapPurchaseInfoRecordItem);
} catch (IOException e) { } catch (IOException e) {
resultMap.put("TYPE", "E"); resultMap.put("TYPE", "E");
resultMap.put("MESSAGE", e.getMessage()); resultMap.put("MESSAGE", e.getMessage());
...@@ -265,6 +266,22 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements ...@@ -265,6 +266,22 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
}); });
} }
/**
* 标记作废的采购信息记录明细
* 根据采购信息记录号查询所有的采购信息记录明细,然后将不是最新的采购信息记录明细的作废标志设置为X
* @param purchaseInfoRecordItem
*/
public void markCancelRecordItems(SapPurchaseInfoRecordItem purchaseInfoRecordItem){
sapPurchaseInfoRecordItemRepository.findByInfnr(purchaseInfoRecordItem.getInfnr()).forEach(sapPurchaseInfoRecordItem1 -> {
if (!sapPurchaseInfoRecordItem1.getId().equals(purchaseInfoRecordItem.getId())
&& purchaseInfoRecordItem.getWerks().equals(sapPurchaseInfoRecordItem1.getWerks())){
sapPurchaseInfoRecordItem1.setCancelFlag("X");
sapPurchaseInfoRecordItemRepository.save(sapPurchaseInfoRecordItem1);
}
});
}
private String formatSerialNumber(Integer serialNumber, int length) { private String formatSerialNumber(Integer serialNumber, int length) {
String result = String.valueOf(serialNumber); String result = String.valueOf(serialNumber);
Assert.isTrue(result.length() <= length, String.format("流水号长度超出限制,设置长度:%s,实际长度:%s。", length, result.length())); Assert.isTrue(result.length() <= length, String.format("流水号长度超出限制,设置长度:%s,实际长度:%s。", length, result.length()));
...@@ -342,6 +359,7 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements ...@@ -342,6 +359,7 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
//recordItem.setInfnr(sapResult.getMESSAGE_V1()); //recordItem.setInfnr(sapResult.getMESSAGE_V1());
recordItem.setTYPE(sapResult.getTYPE()); recordItem.setTYPE(sapResult.getTYPE());
recordItem.setMESSAGE(sapResult.getMESSAGE()); recordItem.setMESSAGE(sapResult.getMESSAGE());
recordItem.setCancelFlag("X");
sapPurchaseInfoRecordItemApplication.save(recordItem); sapPurchaseInfoRecordItemApplication.save(recordItem);
} catch (IOException e) { } catch (IOException e) {
resultMap.put("TYPE", "E"); resultMap.put("TYPE", "E");
......
...@@ -34,6 +34,7 @@ public class SapPurchaseInfoRecordItemApplicationImpl extends BaseApplication im ...@@ -34,6 +34,7 @@ public class SapPurchaseInfoRecordItemApplicationImpl extends BaseApplication im
// throw new RuntimeException("供应商:'"+sapPurchaseInfoRecordItem.getLifnr()+"'和物料:'"+sapPurchaseInfoRecordItem.getMatnr()+"'未通过质检或价格有效至已超过合格有效期"); // throw new RuntimeException("供应商:'"+sapPurchaseInfoRecordItem.getLifnr()+"'和物料:'"+sapPurchaseInfoRecordItem.getMatnr()+"'未通过质检或价格有效至已超过合格有效期");
// } // }
sapPurchaseInfoRecordItem.setSapPurchaseInfoRecordId(sapPurchaseInfoRecordId); sapPurchaseInfoRecordItem.setSapPurchaseInfoRecordId(sapPurchaseInfoRecordId);
sapPurchaseInfoRecordItem.setCancelFlag("0");
sapPurchaseInfoRecordItemRepository.save(sapPurchaseInfoRecordItem); sapPurchaseInfoRecordItemRepository.save(sapPurchaseInfoRecordItem);
}); });
} }
......
...@@ -45,6 +45,7 @@ public class SapPurchaseInfoRecordController extends CommonController { ...@@ -45,6 +45,7 @@ public class SapPurchaseInfoRecordController extends CommonController {
private CodeGenerator codeGenerator; private CodeGenerator codeGenerator;
public String forwardSapPurchaseInfoRecordList(){ public String forwardSapPurchaseInfoRecordList(){
this.putAttribute("cancelFlag", "0");
this.putAttribute("statusKindsList", BillStatus.getValidMap()); this.putAttribute("statusKindsList", BillStatus.getValidMap());
return forward("purchaseInfoRecordList"); return forward("purchaseInfoRecordList");
} }
......
...@@ -380,5 +380,11 @@ public class SapPurchaseInfoRecordItem extends AbstractEntity { ...@@ -380,5 +380,11 @@ public class SapPurchaseInfoRecordItem extends AbstractEntity {
@Transient @Transient
private String rowId; private String rowId;
/**
* 作废标志
*/
@Column(name = "cancel_flag")
private String cancelFlag;
} }
...@@ -35,4 +35,6 @@ public class SapPurchaseInfoRecordQueryRequest extends QueryAbstractRequest { ...@@ -35,4 +35,6 @@ public class SapPurchaseInfoRecordQueryRequest extends QueryAbstractRequest {
*/ */
protected Date fillinEndDate; protected Date fillinEndDate;
private String statusKind; private String statusKind;
private String cancelFlag;
} }
...@@ -14,7 +14,7 @@ public interface SapPurchaseInfoRecordItemRepository extends JpaRepository<SapPu ...@@ -14,7 +14,7 @@ public interface SapPurchaseInfoRecordItemRepository extends JpaRepository<SapPu
List<SapPurchaseInfoRecordItem> findBySapPurchaseInfoRecordId(String sapPurchaseInfoRecordId); List<SapPurchaseInfoRecordItem> findBySapPurchaseInfoRecordId(String sapPurchaseInfoRecordId);
SapPurchaseInfoRecordItem findByInfnr(String infnr); List<SapPurchaseInfoRecordItem> findByInfnr(String infnr);
......
...@@ -211,10 +211,10 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu ...@@ -211,10 +211,10 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
sapPurchaseOrder.setStatusId(status.getId()); sapPurchaseOrder.setStatusId(status.getId());
SapPurchaseOrder save = sapPurchaseOrderRepository.save(sapPurchaseOrder); SapPurchaseOrder save = sapPurchaseOrderRepository.save(sapPurchaseOrder);
this.sendSapDate(save, "Y",""); this.sendSapDate(save, "Y","");
asyncWriteExecutor.execute(()-> // asyncWriteExecutor.execute(()->
//创建放行条 // //创建放行条
this.startSapPermit(sapPurchaseOrder) // this.startSapPermit(sapPurchaseOrder)
); // );
} }
public void startSapPermit(SapPurchaseOrder purchaseOrder){ public void startSapPermit(SapPurchaseOrder purchaseOrder){
...@@ -344,9 +344,9 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu ...@@ -344,9 +344,9 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
} else { } else {
//将存在的作废掉 05.11 lxh //将存在的作废掉 05.11 lxh
for (SapPurchaseOrder purchaseOrder : purchaseOrders) { for (SapPurchaseOrder purchaseOrder : purchaseOrders) {
//终止状态不管
//审批完成的,SAP撤审触发,终止审批完成的,并发起新的流程 //审批完成的,SAP撤审触发,终止审批完成的,并发起新的流程
if (purchaseOrder.getStatusId() == BizBillStatus.COMPLETED.getId()){ if (purchaseOrder.getStatusId() == BizBillStatus.COMPLETED.getId() || purchaseOrder.getStatusId() == BizBillStatus.ABORTED.getId()){
purchaseOrder.setStatusId(BizBillStatus.ABORTED.getId()); purchaseOrder.setStatusId(BizBillStatus.ABORTED.getId());
purchaseOrderId=mannualStartWorkApplication.startWorkflow(sapPurchaseOrder,PROCESS_DEFINITION_KEY,"sapPurchaseOrder"); purchaseOrderId=mannualStartWorkApplication.startWorkflow(sapPurchaseOrder,PROCESS_DEFINITION_KEY,"sapPurchaseOrder");
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<condition column="person_member_name" name="personMemberName" type="java.lang.String" symbol="like" alias="t"/> <condition column="person_member_name" name="personMemberName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="status" name="statusKind" type="java.lang.Integer" symbol="in" alias="t"/> <condition column="status" name="statusKind" type="java.lang.Integer" symbol="in" alias="t"/>
<condition column="matkl_name" name="matklName" type="java.lang.String" symbol="like" alias="i"/> <condition column="matkl_name" name="matklName" type="java.lang.String" symbol="like" alias="i"/>
<condition column="cancel_flag" name="cancelFlag" type="java.lang.String" symbol="=" alias="i"/>
</query> </query>
</query-mappings> </query-mappings>
\ No newline at end of file
...@@ -93,5 +93,11 @@ ...@@ -93,5 +93,11 @@
LEFT JOIN ep_change_form cf ON cf.id = si.ep_change_form_id LEFT JOIN ep_change_form cf ON cf.id = si.ep_change_form_id
WHERE cf.id = ? WHERE cf.id = ?
</sql> </sql>
<!--根据单据ID查询申请人-->
<sql name="findPurchaseOrderPersonMember">
SELECT o.FULL_ID, o.FULL_NAME
FROM sa_oporg o LEFT JOIN sap_purchase_order t ON t.person_member_id = o.id WHERE t.id = ?
</sql>
</query> </query>
</query-mappings> </query-mappings>
\ No newline at end of file
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