Commit 3668dea2 authored by 鲁鑫's avatar 鲁鑫

资产报废处置、转固导入优化

parent a87eae83
......@@ -87,11 +87,10 @@ $.extend(ExcelImpManager.prototype,{
this._$('#toolbar_import').uploadButton({
filetype:['xls','xlsx'],
param:function(){
debugger
//截断事件发送请求,为全局code赋值
//let code = prompt("请输入编码");
//Public.syncAjax(web_app.name + '/globalCode/revampGlobalCode.ajax',{dictionaryCode:code})
// let code = prompt("请输入编码");
// Public.syncAjax(web_app.name + '/globalCode/revampGlobalCode.ajax',{dictionaryCode:code})
//
// UICtrl.showDialog({
// title: $.i18nProp('编码详情'),
// width: 600,
......
......@@ -42,22 +42,6 @@ function loadGrid() {
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
{
display: "主资产号", name: "anln1", width: 140, minWidth: 60, type: "string", align: "left",
/*editor: {
required: true, type: "select",
data: {
type: 'system',
name: "querySapFixedAssets",
back: {
anln1: "anln1",
}
},
}*/
editor: {
type: "text"
}
},
{
display: "公司代码", name: "bukrs", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
......@@ -74,6 +58,22 @@ function loadGrid() {
},
}
},
{
display: "主资产号", name: "anln1", width: 140, minWidth: 60, type: "string", align: "left",
/*editor: {
required: true, type: "select",
data: {
type: 'system',
name: "querySapFixedAssets",
back: {
anln1: "anln1",
}
},
}*/
editor: {
type: "text"
}
},
{
display: "凭证日期", name: "bldat", width: 120, minWidth: 60, type: "date", align: "left",
......@@ -97,7 +97,7 @@ function loadGrid() {
},
{
display: "百分比(%)", name: "prozs", width: 100, minWidth: 60, type: "string", align: "left",
editor: {required: false, mask: 'nn',type: "text"}
editor: {required: false, mask: 'nnn',type: "text"}
},
{
display: "金额", name: "betrr", width: 100, minWidth: 60, type: "string", align: "left",
......@@ -117,6 +117,18 @@ function loadGrid() {
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onBeforeEdit: function (editParm) {
var c = editParm.column, data = editParm.record;
// if (c.name == 'anbtr') {//
//elementGridManager.reRender({ rowdata: data });
if (Public.isNotBlank(data.betrr) && c.name == 'prozs') {
return false;
}
if (Public.isNotBlank(data.prozs) && c.name == 'betrr') {
return false;
}
// }
},
});
UICtrl.setSearchAreaToggle(gridManager);
}
......@@ -159,7 +171,7 @@ function saveUpLoadGrid() {
for (var row=0;row<data.length;row++) {
//debugger
UICtrl.addGridRow(gridManager,{anln1:data[row].anln1,bukrs:data[row].bukrs
,bldat:data[row].bldat,budat:data[row].budat,bzdat:data[row].bzdat
,bldat:data[row].bldat,budat:data[row].budat,bzdat:data[row].budat
,sgtxt:data[row].sgtxt,empge:data[row].empge,prozs:data[row].prozs,betrr:data[row].betrr
});
......
......@@ -114,7 +114,7 @@ function loadGrid() {
{
display: "购置业务年度", name: "xa", width: 160, minWidth: 60, type: "string", align: "left",
// editor: {required: false, type: "text"}
editor: {type:'dictionary',data:{name: 'sapFixedRetirementYear'} ,textField:'xaTextView',valueField:'xa'}
editor: {type:'dictionary',data:{name:'sapFixedRetirementYear'} ,textField:'xaTextView',valueField:'xa'}
}
],
dataAction: "server",
......
......@@ -5,8 +5,10 @@ import com.huigou.topsun.sap.fixedAssets.domain.TmpFixedRetirementData;
import com.huigou.topsun.sap.fixedAssets.repository.TmpFixedAssessDataRepository;
import com.huigou.topsun.sap.fixedAssets.repository.TmpFixedRetirementDataRepository;
import com.huigou.uasp.tool.dataimport.application.ExcelImportInterface;
import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
......@@ -19,6 +21,13 @@ public class SapFixedAssessExcelImport implements ExcelImportInterface {
@Override
public void executeImport(String batchNumer) {
List<TmpFixedAssessData> tmpFixedAssessList = tmpFixedAssessDataRepository.findByBatchNumber(batchNumer);
if (!CollectionUtils.isEmpty(tmpFixedAssessList)){
for (TmpFixedAssessData tmpFixedAssessData : tmpFixedAssessList) {
if (StringUtil.isNotBlank(tmpFixedAssessData.getProzs()) && StringUtil.isNotBlank(tmpFixedAssessData.getBetrr())){
throw new RuntimeException("金额和百分比不能同时有值");
}
}
}
System.out.println("=========================");
// orgSyncApplication.sync(SyncKind.PSM, portalPeoples);
}
......
package com.huigou.topsun.sap.fixedAssets.application.impl;
import com.huigou.topsun.sap.fixedAssets.domain.TmpFixedAssessData;
import com.huigou.topsun.sap.fixedAssets.domain.TmpFixedRetirementData;
import com.huigou.topsun.sap.fixedAssets.repository.TmpFixedRetirementDataRepository;
import com.huigou.uasp.tool.dataimport.application.ExcelImportInterface;
import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
@Service("sapFixedRetirementExcelImport")
......@@ -16,6 +19,13 @@ public class SapFixedRetirementExcelImport implements ExcelImportInterface {
@Override
public void executeImport(String batchNumber) {
List<TmpFixedRetirementData> tmpFixedRetirementDataList = tmpFixedRetirementDataRepository.findByBatchNumber(batchNumber);
if (!CollectionUtils.isEmpty(tmpFixedRetirementDataList)){
for (TmpFixedRetirementData tmpFixedRetirementData : tmpFixedRetirementDataList) {
if (StringUtil.isNotBlank(tmpFixedRetirementData.getProzs()) && StringUtil.isNotBlank(tmpFixedRetirementData.getAnbtr())){
throw new RuntimeException("金额和百分比不能同时有值");
}
}
}
System.out.println("=========================");
// orgSyncApplication.sync(SyncKind.PSM, portalPeoples);
}
......
......@@ -62,13 +62,13 @@ public class TmpFixedAssessData extends AbstractPortalOrg {
* 金额
*/
@Column(name = "betrr")
private BigDecimal betrr;
private String betrr;
/**
* 百分比
*/
@Column(name = "PROZS")
private BigDecimal prozs;
private String prozs;
/**
* 接收方
......
......@@ -11,7 +11,7 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* 门户人员信息导入临时表。
* 固定资产报废及处置导入临时表。
*
* @author lxh
*/
......@@ -60,13 +60,13 @@ public class TmpFixedRetirementData extends AbstractPortalOrg {
* 报废金额
*/
@Column(name = "anbtr")
private BigDecimal anbtr;
private String anbtr;
/**
* 百分比
*/
@Column(name = "PROZS")
private BigDecimal prozs;
private String prozs;
/**
* 购置业务年度
......
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