Commit 16281b6c authored by 鲁鑫's avatar 鲁鑫

成本中心编码校验控制;成本中心导入根据名称转换成编码;统计指标过账成本中心和订单必填其中一项

parent 1a847e99
......@@ -79,6 +79,15 @@ function getId() {
return $("#id").val();
}
function getExtendedData(processAction) {
var kostl = $("#kostl").val();
if (kostl.length != 10){
Public.tip("成本中心编码只能是10位数,请检查")
return false;
}
return true;
}
function checkConstraints(){
var kostl = $("#kostl").val();
if (kostl.length != 10){
......
......@@ -70,7 +70,7 @@ function loadStatsIndicatorsDetailListGrid() {
{
display: "成本中心", name: "kostl", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
required: true, type: "select",
required: false, type: "select",
data: {
type: 'system',
name: "queryCostCenter",
......@@ -187,8 +187,8 @@ function getExtendedData(processAction) {
});
if (!datas) {
return false;
}else if (datas.some(item => item.ekostl === "" && item.eaufnr === "")){
const nullItems = datas.filter(item => item.ekostl === "" && item.eaufnr === "").map(item => item.zlenr);
}else if (datas.some(item => item.kostl === "" && item.aufnr === "")){
const nullItems = datas.filter(item => item.kostl === "" && item.aufnr === "").map(item => item.zlenr);
Public.tip("行号[" + nullItems.join(",") + "]成本中心or订单选择一栏填写");
return false;
}
......
package com.huigou.topsun.sap.costCenter.application.impl;
import cn.hutool.core.bean.BeanUtil;
import com.huigou.cache.DictUtil;
import com.huigou.cache.SystemCache;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
......@@ -56,12 +57,20 @@ public class CostCenterDataExcelImport implements ExcelImportInterface {
}
if (StringUtil.isBlank(tmpCostCenterData.getKosar())){
throw new RuntimeException("成本中心类型不能为空");
}else {
//根据名称转换成编码
String value = DictUtil.getDictionaryDetailValue("kosar", tmpCostCenterData.getKosar());
tmpCostCenterData.setKosar(value);
}
if (StringUtil.isBlank(tmpCostCenterData.getKhinr())){
throw new RuntimeException("层次结构范围不能为空");
}
if (StringUtil.isBlank(tmpCostCenterData.getPrctr())){
throw new RuntimeException("利润中心不能为空");
}else {
//根据名称转换成编码
String value = DictUtil.getDictionaryDetailValue("prctr", tmpCostCenterData.getPrctr());
tmpCostCenterData.setPrctr(value);
}
if (tmpCostCenterData.getDatab() == null){
throw new RuntimeException("有效截至日不能为空");
......
......@@ -80,6 +80,7 @@ public class CostCenterController extends CommonController {
costCenter.setIsDelete(0);
costCenter.setDatbi(DateUtil.getYearFirstDay(new Date()));
costCenter.setDatab(DateUtil.getDate(9999,12,31));
costCenter.setIsCostCenterHis("0");
return forward("sapCostCenterDetail", costCenter);
}
......
......@@ -383,7 +383,7 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
SapResult sapResult = sapResultList.get(0);
resultMap.put("sequence", resultMap.get("row"));
if ("S".equals(sapResult.getTYPE())&&"0".equals(suppliersInfo.getApplyType())) {
suppliersInfo.setPartner(sapResult.getMESSAGE_V1());
suppliersInfo.setPartner(sapResult.getMESSAGE_V1().substring(4));
resultMap.put("type", sapResult.getTYPE());
resultMap.put("MESSAGE", sapResult.getMESSAGE());
suppliersInfoRepository.save(suppliersInfo);
......
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