Commit a95068f8 authored by 1650842865's avatar 1650842865

采购信息记录修改,作废功能;放行条打印优化;异常报告金额合计

parent a99e33f4
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
<property name="jpaProperties"> <property name="jpaProperties">
<props> <props>
<prop key="hibernate.hbm2ddl.auto">none</prop> <prop key="hibernate.hbm2ddl.auto">none</prop>
<prop key="hibernate.show_sql">true</prop> <prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">true</prop> <prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.dialect">${system.hibernate.dialect}</prop> <prop key="hibernate.dialect">${system.hibernate.dialect}</prop>
<prop key="hibernate.enable_lazy_load_no_trans">true</prop> <prop key="hibernate.enable_lazy_load_no_trans">true</prop>
</props> </props>
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
<property name="jpaProperties"> <property name="jpaProperties">
<props> <props>
<prop key="hibernate.hbm2ddl.auto">none</prop> <prop key="hibernate.hbm2ddl.auto">none</prop>
<prop key="hibernate.show_sql">true</prop> <prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">true</prop> <prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.dialect">${system.hibernate.dialect}</prop> <prop key="hibernate.dialect">${system.hibernate.dialect}</prop>
<prop key="hibernate.enable_lazy_load_no_trans">true</prop> <prop key="hibernate.enable_lazy_load_no_trans">true</prop>
</props> </props>
......
...@@ -432,17 +432,26 @@ function initClientGrid() { ...@@ -432,17 +432,26 @@ function initClientGrid() {
//异常金额 = 异常数量 * 单价 //异常金额 = 异常数量 * 单价
if (item.column.name == "exceptionNumber"|| item.column.name == "price" ){ if (item.column.name == "exceptionNumber"|| item.column.name == "price" ){
if (Public.isNotBlank(item.record.exceptionNumber) && Public.isNotBlank(item.record.price)){ if (Public.isNotBlank(item.record.exceptionNumber) && Public.isNotBlank(item.record.price)){
clientGridManager.updateRow(item.record, {money: MathUtil.mul(item.record.exceptionNumber,item.record.price) }); var money = MathUtil.mul(item.record.exceptionNumber,item.record.price);
clientGridManager.updateRow(item.record, {money: money,rmbMoney: MathUtil.mul(money,item.record.exchangeRate) });
//损失金额 = 行项目异常金额总和 + 赔付金额 //损失金额 = 行项目异常金额总和 + 赔付金额
countSum(clientGridManager.rows); countSum(clientGridManager.rows);
} }
} }
//运输费
// 返工费
// 停工待料费
if (item.column.name == "freight"|| item.column.name == "rework" || item.column.name == "stopWaitMaterial"){
//损失金额 = 行项目异常金额总和 + 赔付金额
countSum(clientGridManager.rows);
}
//换算金额 = 异常金额 * 汇率 //换算金额 = 异常金额 * 汇率
if (item.column.name == "money"|| item.column.name == "exchangeRate" ){ if (item.column.name == "money"|| item.column.name == "exchangeRate" ){
if (Public.isNotBlank(item.record.money) && Public.isNotBlank(item.record.exchangeRate)){ if (Public.isNotBlank(item.record.money) && Public.isNotBlank(item.record.exchangeRate)){
clientGridManager.updateRow(item.record, {rmbMoney: MathUtil.mul(item.record.money,item.record.exchangeRate) }); clientGridManager.updateRow(item.record, {rmbMoney: MathUtil.mul(item.record.money,item.record.exchangeRate) });
countSum(clientGridManager.rows);
} }
} }
}, },
...@@ -825,16 +834,16 @@ function initPurchaseGrid() { ...@@ -825,16 +834,16 @@ function initPurchaseGrid() {
//autoApplyNextEditor:false, //autoApplyNextEditor:false,
toolbar: purchaseToolbarOptions, toolbar: purchaseToolbarOptions,
onAfterEdit: function (item) { onAfterEdit: function (item) {
if (item.column.name == 'rmbMoney' || item.column.name == 'freight' if (item.column.name == 'money' || item.column.name == 'rmbMoney' || item.column.name == 'freight'
|| item.column.name == 'rework' || item.column.name == 'stopWaitMaterial' || item.column.name == 'rework' || item.column.name == 'stopWaitMaterial'
|| item.column.name =='startupFee') { || item.column.name =='startupFee') {
countSum(purchaseGridManager.rows);
var money = MathUtil.add(item.record.money, item.record.rmbMoney) var money = MathUtil.add(item.record.money, item.record.rmbMoney)
.add(item.record.freight) .add(item.record.freight)
.add(item.record.rework) .add(item.record.rework)
.add(item.record.stopWaitMaterial) .add(item.record.stopWaitMaterial)
.add(item.record.startupFee); .add(item.record.startupFee);
purchaseGridManager.updateRow(item.record, {totalMoney:money }); purchaseGridManager.updateRow(item.record, {totalMoney:money });
countSum(purchaseGridManager.rows);
} }
}, },
onAfterShowData() { onAfterShowData() {
...@@ -984,21 +993,22 @@ function countSum(zrow) { ...@@ -984,21 +993,22 @@ function countSum(zrow) {
// var zrow=itemGridManager.rows; // var zrow=itemGridManager.rows;
var money = 0; var money = 0;
for (var r = 0; r < zrow.length; r++) { for (var r = 0; r < zrow.length; r++) {
//客户异常 折算金额+赔付金额=损失金额 //客户异常/生产异常 运输费+返工费+停工待料费+折算金额+赔付金额=损失金额
if ($('#exceptionReasonType').val() == "3" || $('#exceptionReasonType').val() == "2") { if ($('#exceptionReasonType').val() == "3" || $('#exceptionReasonType').val() == "2") {
if (Public.isNotBlank(zrow[r].rmbMoney)) { if (Public.isNotBlank(zrow[r].rmbMoney) && zrow[r].rmbMoney != 0) {
money = MathUtil.add(zrow[r].rmbMoney, money); money = MathUtil.add(zrow[r].rmbMoney, money);
}else { }else {
money = MathUtil.add(zrow[r].money, money); money = MathUtil.add(zrow[r].money, money);
} }
money = money.add(zrow[r].freight).add(zrow[r].rework).add(zrow[r].stopWaitMaterial);
}else { }else {
//供应商材料问题 运输费+返工费+停工待料费+损失金额+开机费+赔付金额=损失总金额
money = MathUtil.add(zrow[r].money, money); money = MathUtil.add(zrow[r].money, money);
money = money.add(zrow[r].freight).add(zrow[r].rework).add(zrow[r].stopWaitMaterial).add(zrow[r].startupFee);
} }
} }
money = MathUtil.add($('#payMoney').val(), money); money = MathUtil.add($('#payMoney').val(), money);
// for (var x=0;x<row.length;x++){
// money = MathUtil.add(row[x].dutyMoney,money);
// }
$('#loseMoney').val(money); $('#loseMoney').val(money);
} }
......
...@@ -443,6 +443,9 @@ function bindEvent() { ...@@ -443,6 +443,9 @@ function bindEvent() {
//选择了工厂、库存地点、仓库号,带出存储类型和上下架存储类型 //选择了工厂、库存地点、仓库号,带出存储类型和上下架存储类型
bindEvent_lgtyp($('#werks').val(),data.LGORT,$('#lgnum').val()); bindEvent_lgtyp($('#werks').val(),data.LGORT,$('#lgnum').val());
$("#lgpro").val(data.LGORT);
$("#lgproName").val(data.LGOBE);
} }
}); });
......
...@@ -1046,6 +1046,14 @@ function bindEvent() { ...@@ -1046,6 +1046,14 @@ function bindEvent() {
onChange: function (value, data) { onChange: function (value, data) {
$('#lgort').val(data.LGORT); $('#lgort').val(data.LGORT);
$('#lgortName').val(data.LGOBE); $('#lgortName').val(data.LGOBE);
//物料主数据创建,修改,字段LGPRO优化一下
// 当LGPRO当为空时,默认=LGORT
// 不为空时,以实际填写为准
if (Public.isBlank($("#lgpro").val())){
$("#lgpro").val(data.LGORT);
$("#lgproName").val(data.LGOBE);
}
} }
}); });
//仓库号 //仓库号
......
...@@ -175,7 +175,7 @@ function reloadGrid() { ...@@ -175,7 +175,7 @@ function reloadGrid() {
} }
function printPage() { function printPage() {
Public.openPostWindow(web_app.name + '/PDFViewer/PDFViewer.do',{id: $("#id").val(),applicationType:"sapPermit"}); Public.openPostWindow(web_app.name + '/sapPermit/printInfo.load',{id: $("#id").val()});
} }
function getExtendedData(processAction) { function getExtendedData(processAction) {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<x:hidden name="isEmptyCar"/> <x:hidden name="isEmptyCar"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<c:if test="${statusId==3}"> <c:if test="${statusId==3 || statusId==1}">
<div style="float: right; margin-right: 10px;" class="btn-group" id="buttonBox"> <div style="float: right; margin-right: 10px;" class="btn-group" id="buttonBox">
<button id="save" title="" type="button" onclick="printPage()" class="btn btn-gray"><i <button id="save" title="" type="button" onclick="printPage()" class="btn btn-gray"><i
class="fa fa-save"></i>打印 class="fa fa-save"></i>打印
......
var itemGridManager = null,fillinDate="";
$(document).ready(function () {
initialize();
initItemGrid();
bindEvent();
});
function initialize() {
UICtrl.layout("#layout", {leftWidth: 3});
$('#fileList').fileList({bizId:$("#id").val()});
}
function bindEvent() {
fillinDate = $("#fillinDate").val();
}
function initItemGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
});
itemGridManager = UICtrl.grid('#maingrid', {
columns: getGridColumns(),
dataAction: 'server',
_tableKey: 'sapPurchaseInfoRecordItem',
_local: true,
url: web_app.name + '/sapPurchaseInfoRecordItem/queryUpdateSapPurchaseInfoRecordItems.ajax',
parms:{sapPurchaseInfoRecordId:getId(),ids:$("#ids").val()},
height: '94%',
heightDiff: -4,
sortName: 'id',
sortOrder: 'asc',
checkbox: true,
usePager: true,
rownumbers: true,
enabledEdit: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
//autoApplyNextEditor:false,
toolbar: toolbarOptions,
onDblClickRow: function (data, rowindex, rowobj) {
viewHandler(data);
},
}
);
UICtrl.setSearchAreaToggle(itemGridManager);
}
function getGridColumns() {
var columns = [];
columns = [
{display: "id", name: "id", width: "100", align: "left", type: "string",hide:true},
{display: "采购信息记录号", name: "infnr", width: "100", align: "left", type: "string"},
{display: "定价条件号", name: "knumh", width: "100", align: "left", type: "string"},
{display: "工厂", name: "werks", width: "10", align: "left", type: "string",hide:true},
{display: "工厂", name: "werksName", width: "200", align: "left", type: "string"},
{display: "采购组织", name: "ekorg", width: "10", align: "left", type: "string",hide:true},
{display: "采购组织", name: "ekorgName", width: "200", align: "left", type: "string"},
{display: "供应商编码", name: "lifnr", width: "100", align: "left", type: "string"},
{display: "供应商名称1", name: "name1", width: "200", align: "left", type: "string"},
{display: "供应商物料编码", name: "idnlf", width: "120", align: "left", type: "string"},
{display: "物料编码", name: "matnr", width: "160", align: "left", type: "string",},
{display: "物料描述", name: "maktx", width: "200", align: "left", type: "string",},
{display: "物料组编号", name: "matkl", width: "10", align: "left", type: "string",hide:true},
{display: "物料组", name: "matklName", width: "160", align: "left", type: "string"},
{display: "采购信息记录分类编号", name: "esokz", width: "20", align: "left", type: "string",hide:true},
{display: "采购信息记录分类", name: "esokzTextView", width: "140", align: "left", type: "string"},
{display: "采购组编号", name: "ekgrp", width: "20", align: "left", type: "string",hide:true},
{display: "采购组", name: "ekgrpName", width: "200", align: "left", type: "string"},
{display: "净价", name: "netpr", width: "100", align: "left", type: "string"},
{display: "运输费", name: "freight", width: "100", align: "left", type: "string"},
{display: "包装费", name: "kbetr6", width: "100", align: "left", type: "string"},
{display: "货币码编号", name: "waers", width: "20", align: "left", type: "string",hide:true},
{display: "货币码", name: "waersName", width: "100", align: "left", type: "string"},
{display: "价格单位", name: "peinh", width: "100", align: "left", type: "string"},
{display: "订单价格单位编号", name: "bprme", width: "20", align: "left", type: "string",hide:true},
{display: "订单价格单位(采购)", name: "bprmeName", width: "90", align: "left", type: "string"},
{display: "标准采购订单数量", name: "norbm", width: "120", align: "left", type: "string"},
{display: "基本计量单位", name: "meinsName", width: "100", align: "left", type: "string" },
{display: "基本计量单位", name: "meins", width: "40", align: "left", type: "string",hide:"true" },
{display: "订单单位转换分母", name: "umren", width: "100", align: "left", type: "string"},
{display: "订单单位转换分子", name: "umrez", width: "100", align: "left", type: "string"},
{display: "销售/购买税代码", name: "mwskz", width: "40", align: "left", type: "string",hide:"true" },
{display: "销售/购买税代码", name: "mwskzTextView", width: "150", align: "left", type: "string"},
{display: "开始生效日期", name: "datab", width: "100", align: "left", type: "string"},
{display: "有效期至日期", name: "datbi", width: "100", align: "left", type: "string"},
{display: "销售员", name: "verkf", width: "100", align: "left", type: "string"},
{display: "电话", name: "telf1", width: "100", align: "left", type: "string"},
{display: "原产地国代码", name: "urzla", width: "40", align: "left", type: "string",hide:"true"},
{display: "原产地国", name: "urzlaName", width: 150, minWidth: 60, type: "string", align: "center"},
{display: "地区", name: "regio", width: 10, minWidth: 60, type: "string", align: "center",hide:"true"},
{display: "地区", name: "regioName", width: 150, minWidth: 60, type: "string", align: "center"},
{display: "删除标志", name: "loekz", width: "40", align: "left", type: "string",hide:"true" },
{display: "删除标志", name: "loekzTextView", width: 150, minWidth: 60, type: "string", align: "center"},
{display: "排序字段", name: "sortl", width: 150, minWidth: 60, type: "string", align: "center"},
{display: "最小采购订单数量", name: "minbm", width: "120", align: "left", type: "string"},
{display: "计划交货时间(天)", name: "aplfz", width: "150", align: "left", type: "string"},
{display: "基于收货的发票验证", name: "webre", width: "40", align: "left", type: "string",hide:"true" },
{display: '基于收货的发票验证', name: "webreTextView", width: "100", align: "left", type: "string"},
{display: "价格有效至", name: "prdat", width: "100", align: "left", type: "string",hide:true,
//editor: {type: 'date', required: false}
render: function (item){
return item.prdat = item.datbi
}
},
{display: "等级类型", name: "stfkz", width: "40", align: "left", type: "string",hide:"true" },
{display: "等级类型", name:"stfkzTextView", width: "200", align: "left", type: "string",},
{display: "条件等级计量单位", name: "konms", width: "100", align: "left", type: "string"},
{display: "等级数量1", name: "kstbm", width: "100", align: "left", type: "string"},
{display: "等级金额1", name: "kbetr", width: "100", align: "left", type: "string"},
{display: "等级数量2", name: "kstbm2", width: "100", align: "left", type: "string"},
{display: "等级金额2", name: "kbetr2", width: "100", align: "left", type: "string"},
{display: "等级数量3", name: "kstbm3", width: "100", align: "left", type: "string"},
{display: "等级金额3", name: "kbetr3", width: "100", align: "left", type: "string"},
{display: "等级数量4", name: "kstbm4", width: "100", align: "left", type: "string"},
{display: "等级金额4", name: "kbetr4", width: "100", align: "left", type: "string"},
{display: "等级数量5", name: "kstbm5", width: "100", align: "left", type: "string"},
{display: "等级金额5", name: "kbetr5", width: "100", align: "left", type: "string"},
{display: "备注", name: "remark", width: "300", align: "left", type: "string",}
]
return columns;
}
//获取数据保存的参数
function getExtendedData(processAction) {
//回退、打回、转交时,不需要验证必填项是否已经填写;
if (processAction == ProcessAction.BACK
|| processAction == ProcessAction.REPLENISH
|| processAction == ProcessAction.TRANSMIT) {
//不验证
$('#submitForm').attr('check', false);
}
var extendedData = {};
var _grid = UICtrl.getGridManager('#maingrid');
if (_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: true
});
if (!datas) {
return false;
}
datas.forEach(data=>{
if (Public.isNotBlank(data.bprme)
&& Public.isNotBlank(data.meins)
&& (Public.isBlank(data.umren) || Public.isBlank(data.umrez))){
Public.tip("订单价格单位不为空,单位转换分子、分母必填")
return false;
}
})
extendedData.sapPurchaseInfoRecordItems = Public.encodeJSONURI(datas);
}
return extendedData;
}
//提交前校验
function checkConstraints() {
var _grid = UICtrl.getGridManager('#maingrid');
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: true
});
if (datas.length < 1) {
Public.tip("请添加采购信息记录");
return false;
}
return true;
}
function getId() {
return $('#id').val();
}
function setId(value) {
$("#id").val(value);
var _grid=UICtrl.getGridManager('#maingrid');
_grid.options.parms.sapPurchaseInfoRecordId = value;
$('#fileList').fileList({bizId : value});
}
function reloadGrid() {
itemGridManager.loadData();
}
function getGridData(){
var _grid = UICtrl.getGridManager('#maingrid');
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: true
});
return datas;
}
function initShowDialog() {
if ($("#datab").val() == null || $("#datab").val() == ''){
$("#datab").val($("#fillinDate").val().substring(0,10));
}
if ($("#datbi").val() == null || $("#datbi").val() == ''){
$("#datbi").val('9999-12-31');
}
// var mainFileTable = $('#compensateLibraryList').fileList();
// mainFileTable.find('table').css({
// borderTopWidth: 0
// });
}
function doSaveDefine() {
var _self = this;
var returnResult=checkInput();
var row = itemGridManager.rows;
var rId="";
if ($("#matnr").val()==""&&$("#matklName").val()==""){
Public.tip("物料编码与物料组必须填写一个!");
return false;
}
if ($("#matnr").val()==""&&$("#maktx").val()==""){
Public.tip("物料描述必须填写!");
return false;
}
// if ($("#matnr").val()==""&&$("#sortl").val()==""){
// Public.tip("排序字段必须填写!");
// return false;
// }
if (MathUtil.compare($("#norbm").val(),$("#minbm").val())<0){
Public.tip("标准采购订单数量必须大于最小采购订单量!");
return false;
}
if (MathUtil.compare($("#peinh").val(),1) < 0){
Public.tip("价格单位必须大于等于 1");
return false;
}
if (returnResult) {
if (row.length > 0) {
for (var u = 0; u < row.length; u++) {
rId = itemGridManager.rows[u].__id;
if ($("#rowId").val() == rId) {
itemGridManager.deleteRow(itemGridManager.rows[u]);
break;
}
}
}
UICtrl.addGridRow(itemGridManager, {
id: $("#id").val(),
infnr: $("#infnr").val(),
werks: $("#werks").val(),
werksName: $("#werksName").val(),
ekorg: $("#ekorg").val(),
ekorgName: $("#ekorgName").val(),
lifnr: $("#lifnr").val(),
name1: $("#name1").val(),
idnlf: $("#idnlf").val(),
matnr: $("#matnr").val(),
maktx: $("#maktx").val(),
matkl: $("#matkl").val(),
matklName: $("#matklName").val(),
esokz: $("#esokz").val(),
esokzTextView: $("#esokz").find("option:selected").text(),
ekgrp: $("#ekgrp").val(),
ekgrpName: $("#ekgrpName").val(),
netpr: $("#netpr").val(),
freight: $("#freight").val(),
kbetr6: $("#kbetr6").val(),
waers: $("#waers").val(),
ltsnr: $("#ltsnr").val(),
ltsbz: $("#ltsbz").val(),
waersName: $("#waersName").val(),
peinh: $("#peinh").val(),
bprme: $("#bprme").val(),
bprmeName: $("#bprmeName").val(),
norbm: $("#norbm").val(),
meins: $("#meins").val(),
meinsName: $("#meinsName").val(),
umren: $("#umren").val(),
umrez: $("#umrez").val(),
mwskz: $("#mwskz").val(),
mwskzTextView: $("#mwskz").find("option:selected").text(),
datab: $("#datab").val(),
datbi: $("#datbi").val(),
verkf: $("#verkf").val(),
telf1: $("#telf1").val(),
urzlaName: $("#urzlaName").val(),
urzla: $("#urzla").val(),
regioName: $("#regioName").val(),
regio: $("#regio").val(),
loekz: $("#loekz").val(),
loekzTextView: $("#loekz").find("option:selected").text(),
sortl: $("#sortl").val(),
minbm: $("#minbm").val(),
aplfz: $("#aplfz").val(),
webre: $("#webre").val(),
webreTextView: $("#webre").find("option:selected").text(),
stfkz: $("#stfkz").val(),
stfkzTextView: $("#stfkz").find("option:selected").text(),
konms: $("#konms").val(),
kstbm: $("#kstbm").val(),
kbetr: $("#kbetr").val(),
kstbm2: $("#kstbm2").val(),
kbetr2: $("#kbetr2").val(),
kstbm3: $("#kstbm3").val(),
kbetr3: $("#kbetr3").val(),
kstbm4: $("#kstbm4").val(),
kbetr4: $("#kbetr4").val(),
kstbm5: $("#kstbm5").val(),
kbetr5: $("#kbetr5").val(),
remark: $("#remark").val(),
knumh: $("#knumh").val(),
});
this.close();
}
}
function checkInput() {
if ($("#werks").val()==""){
Public.tip("工厂必输!");
return false;
}
if ($("#ekorg").val()==""){
Public.tip("采购组织必输!");
return false;
}
if ($("#lifnr").val()==""){
Public.tip("供应商必输!");
return false;
}
/* if ($("#matnr").val()==""){
Public.tip("物料编码必输!");
return false;
}*/
if ($("#esokz").val()==""){
Public.tip("记录分类必输!");
return false;
}
if ($("#ekgrp").val()==""){
Public.tip("采购组必输!");
return false;
}
if ($("#netpr").val()==""){
Public.tip("净价必输!");
return false;
}
if ($("#waers").val()==""){
Public.tip("货币码必输!");
return false;
}
if ($("#mwskz").val()==""){
Public.tip("销售/购买税代码必输!");
return false;
}
if ($("#datab").val()==""){
Public.tip("生效日期起必输!");
return false;
}
if ($("#datbi").val()==""){
Public.tip("生效日期止必输!");
return false;
}
if ($("#peinh").val()==""){
Public.tip("价格单位必输!");
return false;
}
if ($("#bprmeName").val()==""){
Public.tip("订单价格单位(采购)必输!");
return false;
}
if ($("#mwskz").val()==""){
Public.tip("销售/购买税代码必输!");
return false;
}
if ($("#umren").val()==""){
Public.tip("订单单位转换分母必输!");
return false;
}
if ($("#umrez").val()==""){
Public.tip("订单单位转换分子必输!");
return false;
}
if ($("#aplfz").val()==""){
Public.tip("计划交货时间(天)必输!");
return false;
}
if ($("#webre").val()==""){
Public.tip("基于收货的发票验证必输!");
return false;
}
if ($("#stfkz").val()==""){
Public.tip("等级类型必输!");
return false;
}
return true;
}
function viewHandler(data){
var param = JSON.stringify(data);
var rowId=data.__id;
var readwriteList = UICtrl.getUIElementPermissions(UIPO.READWRITE, UIPK.DETAIL);
if ($("#isReadOnly").val()=="true"||($("#statusId").val()==1&&readwriteList.length==0&&TaskKind.isReplenishTask(taskKindId)!=true)) {
UICtrl.showAjaxDialog({
title: "查看采购信息记录",
url: web_app.name + '/sapPurchaseInfoRecord/cancelSapPurchaseInfoRecordDetail.load?id=' + data.id + '&rowId=' + rowId+'&isReadOnly=true',
param: {
param
},
width: 1200,
height: 860,
init: initShowDialog,
ok:false,
close: onDialogCloseHandler
});
} else {
UICtrl.showAjaxDialog({
title: "作废采购信息记录",
url: web_app.name + '/sapPurchaseInfoRecord/cancelSapPurchaseInfoRecordDetail.load?id=' + data.id + '&rowId=' + rowId,
param: {
param
},
width: 1200,
height: 860,
init: initShowDialog,
okVal: '确定',
ok: doSaveDefine,
close: onDialogCloseHandler
});
}
}
// 关闭对话框
function onDialogCloseHandler() {
//if (refreshFlag) {
parent.reloadGrid();
// refreshFlag = false;
// }
}
\ No newline at end of file
<%--采购申请--%>
<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,date,dateTime,combox,attachment,commonTree,comboDialog"/>
<x:script src="/biz/topsun/sap/purchaseInfoRecord/cancelPurchaseInfoRecord.js"/>
</head>
<body>
<div class="container-fluid">
<x:billTitle title="作废采购信息记录" needStatus="true" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/>
<x:hidden name="version"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<x:hidden name="deptName"/>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<x:hidden name="statusId"/>
<x:hidden name="ids"/>
<x:hidden name="isReadOnly"/>
<x:hidden name="flag"/>
<div class="hg-form-cols">
<div class="hg-form-row">
</div>
</div>
<div id="maingrid"></div>
<div style="padding-top: 15px;">
<x:fileList bizCode="purchaseInfoRecord" bizId="id" id="fileList" title="相关资料" />
</div>
</form>
</div>
</body>
\ No newline at end of file
var gridManager = null;
var canEdit=true;
$(document).ready(function () {
initialize();
bindDetailEvent();
});
function initialize(){
UICtrl.layout("#layout", {leftWidth: 3});
}
function bindDetailEvent(){
}
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree"/>
<x:script src='/biz/topsun/sap/purchaseInfoRecord/cancelPurchaseInfoRecordDetail.js'/>
</head>
<body>
<form class="hg-form" method="post" action="" id="infoRecord">
<div class="hg-form-cols">
<div class="hg-form-row">
<x:hidden name="id"/>
<x:hidden name="rowId"/>
<x:hidden name="isReadOnly"/>
<x:hidden name="knumh"/>
<x:inputC name="infnr" label="信息记录编号" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:hidden name="werks"/>
<x:inputC name="werksName" required="true" label="工厂" labelCol="1" readonly="true" fieldCol="2"/>
<x:hidden name="ekorg"/>
<x:inputC name="ekorgName" label="采购组织" labelCol="1" fieldCol="2" readonly="true" required="true"/>
<x:inputC name="lifnr" label="供应商" labelCol="1" fieldCol="2" required="true" readonly="true"/>
<x:inputC name="name1" label="供应商名称" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:inputC name="idnlf" label="供应商物料" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="matnr" label="物料编码" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:inputC name="maktx" label="物料描述" labelCol="1" fieldCol="2" readonly="true"/>
<x:selectC name="esokz" label="记录分类" labelCol="1" fieldCol="2" required="true" dictionary="esokz"
disabled="true"/>
<x:hidden name="ekgrp"/>
<x:inputC name="ekgrpName" label="采购组" labelCol="1" fieldCol="2" readonly="true" required="true"/>
<x:inputC name="netpr" label="净价" labelCol="1" fieldCol="2" required="true" mask="999999999.99"
readonly="true"/>
<x:inputC name="freight" label="运输费" labelCol="1" fieldCol="2" required="false" mask="99999999.99"
readonly="true"/>
<x:inputC name="kbetr6" label="包装费" labelCol="1" fieldCol="2" required="false" mask="99999999.99"
readonly="true"/>
<x:hidden name="matkl"/>
<x:inputC name="matklName" label="物料组" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="waersName" label="货币码" labelCol="1" fieldCol="2" required="true"
readonly="true"/>
<x:hidden name="waers"/>
<x:hidden name="ltsnr"/>
<x:hidden name="ltsbz"/>
<x:inputC name="peinh" label="价格单位" labelCol="1" fieldCol="2" required="true" mask="99999999.99"
readonly="true"/>
<x:inputC name="meinsName" label="基本计量单位" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:hidden name="bprme"/>
<x:inputC name="bprmeName" label="订单价格单位(采购)" labelCol="2" fieldCol="2"
required="true" readonly="true"/>
<x:selectC name="mwskz" label="销售/购买税代码" labelCol="2" fieldCol="3" required="true"
dictionary="purchaseMwskz" disabled="true"/>
</div>
<div class="hg-form-row">
<x:hidden name="meins"/>
<x:inputC name="norbm" label="标准采购订单数量" labelCol="2" fieldCol="1" required="false"
mask="99999999.99" readonly="true"/>
<x:inputC name="umren" label="订单单位转换分母" labelCol="1" fieldCol="2" required="true" mask="99999999.99"
readonly="true"/>
<x:inputC name="umrez" label="订单单位转换分子" labelCol="1" fieldCol="2" required="true" mask="99999999.99"
readonly="true"/>
<x:inputC name="datab" required="true" label="生效日期起" wrapper="date" labelCol="1" fieldCol="2"/>
<x:inputC name="datbi" required="true" label="生效日期止" wrapper="date" labelCol="1" fieldCol="2"/>
<x:inputC name="verkf" label="销售员" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:inputC name="telf1" label="电话" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:inputC name="urzlaName" label="原产国" labelCol="1" fieldCol="2" required="false"
readonly="true"/>
<x:hidden name="urzla"/>
<x:inputC name="regioName" label="地区" labelCol="1" fieldCol="2" required="false"
readonly="true"/>
<x:hidden name="regio"/>
<x:selectC name="loekz" label="删除标志" labelCol="1" fieldCol="2" required="false" dictionary="loekz"/>
<x:inputC name="sortl" label="排序字段" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<x:inputC name="minbm" label="最小采购订单数量" labelCol="2" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
<x:inputC name="aplfz" label="计划交货时间(天)" labelCol="2" fieldCol="1" required="true" mask="9999999"
readonly="true"/>
<x:selectC name="webre" label="基于收货的发票验证" labelCol="2" fieldCol="1" required="true"
dictionary="webre" disabled="true"/>
<x:selectC name="stfkz" label="等级类型" labelCol="1" fieldCol="5" required="true" dictionary="stfkz"
disabled="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="kstbm" label="等级数量1" labelCol="1" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
<x:inputC name="kstbm2" label="等级数量2" labelCol="1" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
<x:inputC name="kstbm3" label="等级数量3" labelCol="1" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
<x:inputC name="kstbm4" label="等级数量4" labelCol="1" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
<x:inputC name="kstbm5" label="等级数量5" labelCol="1" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="kbetr" label="等级金额1" labelCol="1" fieldCol="1" required="false" readonly="true"/>
<x:inputC name="kbetr2" label="等级金额2" labelCol="1" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
<x:inputC name="kbetr3" label="等级金额3" labelCol="1" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
<x:inputC name="kbetr4" label="等级金额4" labelCol="1" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
<x:inputC name="kbetr5" label="等级金额5" labelCol="1" fieldCol="1" required="false" mask="9999999.99"
readonly="true"/>
</div>
<div class="hg-form-row">
<x:textareaC name="remark" rows="3" label="备注" labelCol="1" fieldCol="9"/>
</div>
</div>
</form>
</body>
</html>
...@@ -42,16 +42,16 @@ function initPurchaseListGrid() { ...@@ -42,16 +42,16 @@ function initPurchaseListGrid() {
copyQualityInfoRecord(); copyQualityInfoRecord();
} }
}, },
// updateHandler:{ updateHandler:{
// id: 'updateHandler', text: "修改", img:'fa-edit', click: function(){ id: 'updateHandler', text: "修改", img:'fa-edit', click: function(){
// updateHandlerInfoRecord(); updateHandlerInfoRecord();
// } }
// } },
// 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: [
...@@ -267,20 +267,25 @@ function updateHandlerInfoRecord(){ ...@@ -267,20 +267,25 @@ function updateHandlerInfoRecord(){
} }
function cancelHandlerInfoRecord(){ function cancelHandlerInfoRecord(){
var row = purchaseInfoRecordGridManager.getSelectedRow(); var rows = purchaseInfoRecordGridManager.getSelectedRows();
if (!row) { if (rows.length == 0) {
Public.tip('请选择数据!');
return; return;
} }
var ids = [];
for (var i = 0; i < rows.length; i++){
var row=rows[i];
if (Public.isBlank(row.infnr)) { if (Public.isBlank(row.infnr)) {
Public.errorTip('只能作废有采购信息记录号的数据!'); Public.errorTip('只能作废有采购信息记录号的数据!');
return false; return false;
} }
UICtrl.confirm('您确定要作废该条采购信息记录吗,作废后无法恢复?', function () { ids.push(row.id)
Public.ajax(web_app.name + '/sapPurchaseInfoRecord/cancelPurchaseRecord.ajax', }
{id: row.id},
function () { UICtrl.addTabItem({
reloadPurchaseGrid(); tabid: 'cancelHandlerInfoRecord' + row.id,
}); text: '作废采购信息记录',
}); url: web_app.name + '/sapPurchaseInfoRecord/showCancelHandlerInfoRecord.job?ids='+ ids.join(",")
})
} }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>物品携出放行条</title>
<#include "/print/commonStyleTemplate.ftl" />
<style type="text/css">
td {
font-size: 13px;
}
</style>
</head>
<body>
<div class="billTitle">物品领料单</div>
<span class="fs" style="font-family:SimSun;position: absolute;right: 60px;top: 1px">
<img class="barcode" src="${barCode}"></img>
</span>
<div class="blank_div"></div>
<table cellspacing="0px" cellpadding="0px" class="tablePrint">
<colgroup>
<col width='70%'/>
<col width="30%"/>
</colgroup>
<tr>
<td class="left">单据编号:${billCode?default("")?html}</td>
<td class="left">录入日期:${fillinDate?default("")?html}</td>
</tr>
</table>
<table cellspacing="0px" cellpadding="0px" class="tablePrint">
<colgroup>
<col width='70%'/>
<col width="30%"/>
</colgroup>
<tr>
<td class="left">公司名称:${company?default("")?html}</td>
<td class="left">携出人:${belongPerson?default("")?html}</td>
</tr>
</table>
<div> 物品明细</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='50%'/>
<col width='10%'/>
<col width='10%'/>
<col width='30%'/>
</colgroup>
<tr>
<td class="center">携出物品名称</td>
<td class="center">数量</td>
<td class="center">单位</td>
<td class="center">备注</td>
</tr>
<#if itemList?? && itemList?size gt 0>
<#list itemList as detail>
<tr>
<td class="center">${detail.belongings?default("")?html}</td>
<td class="center">${detail.quantity?default("")?html}</td>
<td class="center">${detail.unitName?default("")?html}</td>
<td class="center">${detail.remark?default("")?html}</td>
</tr>
</#list>
<#else>
<tr>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
</tr>
</#if>
</table>
<table cellspacing="0px" cellpadding="0px" class="tablePrint">
<colgroup>
<col width='25%'/>
<col width="11%"/>
<col width="11%"/>
<col width="11%"/>
<col width="11%"/>
<col width="11%"/>
<col width="20%"/>
</colgroup>
<tr>
<td class="left">保安填写出厂时间:</td>
<td class="left"></td>
<td class="left"></td>
<td class="left"></td>
<td class="left"></td>
<td class="left"></td>
<td class="left">签字:</td>
</tr>
</table>
<table cellspacing="0px" cellpadding="0px" class="tablePrint">
<colgroup>
<col width='20%'/>
<col width="20%"/>
<col width="20%"/>
<col width="20%"/>
<col width="20%"/>
</colgroup>
<tr>
<td class="left">核准:${lastAuditPerson?default("")?html}</td>
<td class="left">审核:${preAuditPerson?default("")?html}</td>
<td class="left">供应商签收人:</td>
<td class="left">申请人:${personMemberName?default("")?html}</td>
<td class="left">制表人:${personMemberName?default("")?html}</td>
</tr>
</table>
</body>
</html>
...@@ -205,7 +205,7 @@ public class NonProducePickApplicationImpl extends FlowBroker implements NonProd ...@@ -205,7 +205,7 @@ public class NonProducePickApplicationImpl extends FlowBroker implements NonProd
//实际退料数量大于等于退料数量标识完结Y,否则N //实际退料数量大于等于退料数量标识完结Y,否则N
BigDecimal zerfmg = pickItem.getZerfmg(); BigDecimal zerfmg = pickItem.getZerfmg();
BigDecimal backNum = pickItem.getBackNum(); BigDecimal backNum = pickItem.getBackNum();
if (zerfmg.compareTo(backNum) > 0){ if (zerfmg.compareTo(backNum) >= 0){
pickItem.setCheckedBox("Y"); pickItem.setCheckedBox("Y");
}else { }else {
pickItem.setCheckedBox("N"); pickItem.setCheckedBox("N");
......
...@@ -32,5 +32,5 @@ public interface SapPermitApplication { ...@@ -32,5 +32,5 @@ public interface SapPermitApplication {
void saveSapPermitVo(SapPermitVo sapPermitVo); void saveSapPermitVo(SapPermitVo sapPermitVo);
ByteArrayOutputStream printInfo(HttpServletResponse response, String id); Map<String, Object> printInfo(String id);
} }
...@@ -245,63 +245,44 @@ public class SapPermitApplicationImpl extends FlowBroker implements SapPermitApp ...@@ -245,63 +245,44 @@ public class SapPermitApplicationImpl extends FlowBroker implements SapPermitApp
} }
} }
public String startProcessInstance(String processDefinitionKey,Map<String, Object> formData){ @Override
Map<String, Object> variables = new HashMap(); public Map<String, Object> printInfo(String id) {
SDO localSdo = this.buildSDO(formData);
ThreadLocalUtil.putVariable(Constants.SDO, localSdo);
variables.put("startModel", ProcessStartModel.MANUAL.getId());
Operator operator = localSdo.getOperator();
variables.put("executorFullId", operator.getFullId());
variables.put("executorFullName", operator.getFullName());
ThreadLocalUtil.putOperator(operator);
ThreadLocalUtil.putVariable("client.ip", "127.0.0.1");
ProcessInstance processInstance = this.workflowApplication.startProcessInstanceByKey(processDefinitionKey, variables);
String businessKey = processInstance.getBusinessKey();
return businessKey;
}
private SDO buildSDO(Map<String, Object> formData) {
String createdById = (String) formData.get("applyPerson");
Operator operator = operatorApplication.createOperatorByPersonMemberId(createdById);
SDO localSdo = new SDO();
// 将业务数据传递给工作流
formData.forEach(localSdo::putProperty);
// 将业务流程信息传递给工作流
localSdo.putProperty("processAction", ProcessAction.SAVE);
localSdo.putProperty("procUnitId", "Apply");
localSdo.setOperator(operator);
return localSdo;
}
public ByteArrayOutputStream printInfo(HttpServletResponse response, String id) {
SapPermit permit=this.sapPermitRepository.findOne(id); SapPermit permit=this.sapPermitRepository.findOne(id);
Map<String, Object> data = ClassHelper.beanToMap(permit);
List <SapPermitItem> itemList=this.sapPermitItemRepository.findBySapPermitId(id); List <SapPermitItem> itemList=this.sapPermitItemRepository.findBySapPermitId(id);
if (itemList.size()<10){ if (itemList.size()<10){
int s=itemList.size(); int s=itemList.size();
for (int u=0;u<10-s;u++) { for (int u=0;u<10-s;u++) {
SapPermitItem item = new SapPermitItem(); SapPermitItem item = new SapPermitItem();
item.setBelongings("&nbsp;"); item.setBelongings("");
itemList.add(item); itemList.add(item);
} }
} }
String sql="select s.code,w.handler_name,w.handler_id,w.dept_name,w.full_id,w.HANDLED_DATE FROM WF_PROCUNITHANDLER w left join sa_oporg s on s.id=w.HANDLER_ID"; String sql="select s.code,w.handler_name,w.handler_id,w.dept_name,w.full_id,w.HANDLED_DATE FROM WF_PROCUNITHANDLER w left join sa_oporg s on s.id=w.HANDLER_ID";
sql+=" where biz_id='"+id+"' order by w.HANDLED_DATE desc "; sql+=" where biz_id='"+id+"' and w.result = 1 order by w.HANDLED_DATE desc ";
List<Map<String, Object>> mapList=sqlExecutorDao.queryToListMap(sql); List<Map<String, Object>> mapList=sqlExecutorDao.queryToListMap(sql);
Map<String ,Object> data = new HashMap<>(); if (!CollectionUtils.isEmpty(mapList)){
if (mapList.size()>0){ if (mapList.size()==1) {
String preLastAuditPerson = mapList.get(0).get("handlerName").toString();
data.put("preAuditPerson",preLastAuditPerson);
data.put("lastAuditPerson",preLastAuditPerson);
}else {
String lastAuditPerson=mapList.get(0).get("handlerName").toString(); String lastAuditPerson=mapList.get(0).get("handlerName").toString();
data.put("lastAuditPerson",lastAuditPerson); data.put("lastAuditPerson",lastAuditPerson);
}
if (mapList.size()>1) {
String preLastAuditPerson = mapList.get(1).get("handlerName").toString(); String preLastAuditPerson = mapList.get(1).get("handlerName").toString();
data.put("preAuditPerson",preLastAuditPerson); data.put("preAuditPerson",preLastAuditPerson);
} }
data.put("head",permit); }
// if (mapList.size()>0){
// String lastAuditPerson=mapList.get(0).get("handlerName").toString();
// data.put("lastAuditPerson",lastAuditPerson);
// }
//
// if (mapList.size()>1) {
// String preLastAuditPerson = mapList.get(1).get("handlerName").toString();
// data.put("preAuditPerson",preLastAuditPerson);
// }
data.put("itemList",itemList); data.put("itemList",itemList);
//Document document = null;
ByteArrayOutputStream byteArrayOutputStream = null;
try { try {
File file = new File("bar-"+permit.getBillCode()+".png"); File file = new File("bar-"+permit.getBillCode()+".png");
if(!file.exists()) { if(!file.exists()) {
...@@ -312,15 +293,38 @@ public class SapPermitApplicationImpl extends FlowBroker implements SapPermitApp ...@@ -312,15 +293,38 @@ public class SapPermitApplicationImpl extends FlowBroker implements SapPermitApp
} }
File fileb = new File("baoshen.png"); File fileb = new File("baoshen.png");
data.put("baoshen",fileb); data.put("baoshen",fileb);
Template template = freemarkerConfigurer.getConfiguration().getTemplate("fxt.ftl");
byteArrayOutputStream = CommonUtils.createPDF(data,template);
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("PDF生成失败!"); throw new RuntimeException("PDF生成失败!");
} }
return byteArrayOutputStream; return data;
} }
public String startProcessInstance(String processDefinitionKey,Map<String, Object> formData){
Map<String, Object> variables = new HashMap();
SDO localSdo = this.buildSDO(formData);
ThreadLocalUtil.putVariable(Constants.SDO, localSdo);
variables.put("startModel", ProcessStartModel.MANUAL.getId());
Operator operator = localSdo.getOperator();
variables.put("executorFullId", operator.getFullId());
variables.put("executorFullName", operator.getFullName());
ThreadLocalUtil.putOperator(operator);
ThreadLocalUtil.putVariable("client.ip", "127.0.0.1");
ProcessInstance processInstance = this.workflowApplication.startProcessInstanceByKey(processDefinitionKey, variables);
String businessKey = processInstance.getBusinessKey();
return businessKey;
}
private SDO buildSDO(Map<String, Object> formData) {
String createdById = (String) formData.get("applyPerson");
Operator operator = operatorApplication.createOperatorByPersonMemberId(createdById);
SDO localSdo = new SDO();
// 将业务数据传递给工作流
formData.forEach(localSdo::putProperty);
// 将业务流程信息传递给工作流
localSdo.putProperty("processAction", ProcessAction.SAVE);
localSdo.putProperty("procUnitId", "Apply");
localSdo.setOperator(operator);
return localSdo;
}
} }
...@@ -3,6 +3,7 @@ package com.huigou.topsun.sap.permit.controller; ...@@ -3,6 +3,7 @@ package com.huigou.topsun.sap.permit.controller;
import com.huigou.context.Operator; import com.huigou.context.Operator;
import com.huigou.context.OrgUnit; import com.huigou.context.OrgUnit;
import com.huigou.topsun.common.CommonUtils;
import com.huigou.topsun.sap.permit.application.SapPermitApplication; import com.huigou.topsun.sap.permit.application.SapPermitApplication;
import com.huigou.topsun.sap.permit.application.SapPermitItemApplication; import com.huigou.topsun.sap.permit.application.SapPermitItemApplication;
import com.huigou.topsun.sap.permit.domain.SapPermit; import com.huigou.topsun.sap.permit.domain.SapPermit;
...@@ -12,8 +13,10 @@ import com.huigou.uasp.annotation.ControllerMapping; ...@@ -12,8 +13,10 @@ import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus; import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.client.CommonController; import com.huigou.uasp.client.CommonController;
import com.huigou.uasp.tool.dataimport.application.ExcelImportApplication; import com.huigou.uasp.tool.dataimport.application.ExcelImportApplication;
import com.huigou.util.ClassHelper;
import com.huigou.util.CommonUtil; import com.huigou.util.CommonUtil;
import com.huigou.util.SDO; import com.huigou.util.SDO;
import org.krysalis.barcode4j.HumanReadablePlacement;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -22,6 +25,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; ...@@ -22,6 +25,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -91,20 +95,10 @@ public class SapPermitController extends CommonController { ...@@ -91,20 +95,10 @@ public class SapPermitController extends CommonController {
return success(); return success();
} }
public String printPermitInfo() { public String printInfo() {
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
String id = sdo.getString("id"); String id = sdo.getId();
System.out.println("id======="+id); Map<String, Object> data = this.sapPermitApplication.printInfo(id);
// HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse(); return outputAndProcUnitHandlerPDF("/permit.ftl", id, data);
HttpServletResponse response = this .getResponse();
sapPermitApplication.printInfo(response,id);
//SapPermit permit=this.sapPermitApplication.getPermitById(id);
// List <SapPermitItem> itemList=sapPermitItemApplication.findBySapPermitId(id);
// String template="fxt.ftl";
// Map<String ,Object> data = new HashMap<>();
// data.put("head",permit);
// data.put("itemList",itemList);
return "";
// return outputPDF(template,data);
} }
} }
...@@ -214,6 +214,11 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements ...@@ -214,6 +214,11 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
if ("0".equals(sapPurchaseInfoRecordItemVo.getLoekz())){ if ("0".equals(sapPurchaseInfoRecordItemVo.getLoekz())){
sapPurchaseInfoRecordItemVo.setLoekz(""); sapPurchaseInfoRecordItemVo.setLoekz("");
} }
if ("cancel".equals(sapPurchaseInfoRecord.getFlag())){
//如果是作废,设置报价失效标志为X
sapPurchaseInfoRecordItemVo.setZzf("X");
}
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
resultMap.put("businessType", "采购信息记录维护"); resultMap.put("businessType", "采购信息记录维护");
resultMap.put("businessId", sapPurchaseInfoRecord.getId()); resultMap.put("businessId", sapPurchaseInfoRecord.getId());
......
...@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -110,6 +111,25 @@ public class SapPurchaseInfoRecordController extends CommonController { ...@@ -110,6 +111,25 @@ public class SapPurchaseInfoRecordController extends CommonController {
return forward("updatePurchaseInfoRecordDetail",item); return forward("updatePurchaseInfoRecordDetail",item);
} }
public String cancelSapPurchaseInfoRecordDetail() {
SDO sdo = this.getSDO();
String id = sdo.getId();
//String edit=sdo.getString("edit");
String rowId=sdo.getString("rowId");
SapPurchaseInfoRecordItem item = JSONUtil.toBean(sdo.getString("param"), SapPurchaseInfoRecordItem.class);
if (item!=null){
item.setRowId(rowId);
if (id.equals(rowId)){
item.setId("");
} else {
item.setId(id);
}
}
this.putAttribute("isReadOnly",sdo.getString("isReadOnly"));
// SapPurchaseInfoRecord sapPurchaseInfoRecord = sapPurchaseInfoRecordApplication.loadSapPurchaseInfoRecord(id);
return forward("cancelPurchaseInfoRecordDetail",item);
}
public String saveSapPurchaseInfoRecordDetail() { public String saveSapPurchaseInfoRecordDetail() {
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
String id = sdo.getId(); String id = sdo.getId();
...@@ -129,8 +149,12 @@ public class SapPurchaseInfoRecordController extends CommonController { ...@@ -129,8 +149,12 @@ public class SapPurchaseInfoRecordController extends CommonController {
} }
if ("new".equals(sapPurchaseInfoRecord.getFlag())){ if ("new".equals(sapPurchaseInfoRecord.getFlag())){
return forward("purchaseInfoRecord",sapPurchaseInfoRecord); return forward("purchaseInfoRecord",sapPurchaseInfoRecord);
}else { }else if ("update".equals(sapPurchaseInfoRecord.getFlag())){
return forward("updatePurchaseInfoRecord",sapPurchaseInfoRecord); return forward("updatePurchaseInfoRecord",sapPurchaseInfoRecord);
}else if ("cancel".equals(sapPurchaseInfoRecord.getFlag())){
return forward("cancelPurchaseInfoRecord",sapPurchaseInfoRecord);
}else {
return forward("purchaseInfoRecord",sapPurchaseInfoRecord);
} }
} }
...@@ -170,6 +194,24 @@ public class SapPurchaseInfoRecordController extends CommonController { ...@@ -170,6 +194,24 @@ public class SapPurchaseInfoRecordController extends CommonController {
return forward("updatePurchaseInfoRecord",sapPurchaseInfoRecord); return forward("updatePurchaseInfoRecord",sapPurchaseInfoRecord);
} }
public String showCancelHandlerInfoRecord(){
SDO sdo = this.getSDO();
String ids = sdo.getString("ids");
this.putAttribute("processDefinitionKey", SapPurchaseInfoRecordApplication.PROCESS_DEFINITION_KEY);
// 新增的时候procUnitId一定要设置成Apply,不然jsp页面的所有表单元素是readonly状态
this.putAttribute("procUnitId", "Apply");
this.putAttribute("ids",ids);
SapPurchaseInfoRecord sapPurchaseInfoRecord = new SapPurchaseInfoRecord();
sapPurchaseInfoRecord.setId(null);
sapPurchaseInfoRecord.setStatusId(BizBillStatus.APPLYING.getId());
Operator operator = getOperator();
sapPurchaseInfoRecord.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
String nextCode = codeGenerator.getNextCode("purchaseInfoRecord");
sapPurchaseInfoRecord.setBillCode(nextCode);
sapPurchaseInfoRecord.setFlag("cancel");
return forward("cancelPurchaseInfoRecord",sapPurchaseInfoRecord);
}
public String cancelPurchaseRecord(){ public String cancelPurchaseRecord(){
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
String id = sdo.getId(); String id = sdo.getId();
......
...@@ -273,4 +273,11 @@ public class SapPurchaseInfoRecordItemVo implements Serializable { ...@@ -273,4 +273,11 @@ public class SapPurchaseInfoRecordItemVo implements Serializable {
@JsonProperty("TXZ01") @JsonProperty("TXZ01")
private String txz01; private String txz01;
/**
* (报价失效标志),值范围:X(是),空(否)
*/
@JsonProperty("ZZF")
private String zzf;
} }
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
t.PRDAT, t.PRDAT,
t.BPUMN, t.BPUMN,
t.BPUMZ, t.BPUMZ,
t.DATAB, now() as DATAB,
t.DATBI, t.DATBI,
t.KSTBM, t.KSTBM,
t.KONMS, t.KONMS,
......
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