Commit 5dc8ffed authored by 1650842865's avatar 1650842865

采购申请当选了1000工厂 ,库存地点只能是1000下的;选择了内部订单,成本中心隐藏;采购信息记录增加短文本字段,排序字段取值优化

parent b1786160
......@@ -51,10 +51,10 @@ function initializate() {
}
});
//不参与成本核算 修改 根据价格控制决定
$("#ncost").combox({onChange:function(data) {
financialDisplayNcost($("#vprsv").val());
}
});
// $("#ncost").combox({onChange:function(data) {
// financialDisplayNcost($("#vprsv").val());
// }
// });
switch ($("#active").val()) {
case '0'://待填报
// $("#businessUsageDiv").hide();
......
......@@ -374,7 +374,7 @@
<x:inputC name="peinh" label="定价基数" labelCol="1" fieldCol="2" required="false"/>
<x:hidden name="ncost"/>
<%--<x:selectC name="ncost" label="不参与成本核算" labelCol="2" fieldCol="1" dictionary="ncost" />--%>
<x:selectC name="hkmat" label="物料来源" labelCol="1" fieldCol="2" 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="stprs" label="标准价" labelCol="1" fieldCol="2"/>
......
......@@ -198,7 +198,14 @@ function getGridColumns() {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "LGORT"}
if (Public.isBlank(item.werks)){
Public.tip("请先选择工厂");
return false;
}
return {
fieldName: "LGORT",
filterValue: item.werks
}
},
back: {
LGORT: "lgort",
......
......@@ -50,7 +50,7 @@ function initAufnr(knttp){
//成本中心
columns.some(column => {
if (column.name == "kostlName"){
//column.hide = knttp == 'F'? false:true;
column.hide = knttp == 'F'? true:false;
if (isApplyProcUnit()){
column.editor.required = knttp == 'K'? true:false;
}
......@@ -340,7 +340,14 @@ function getGridColumns() {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "LGORT"}
if (Public.isBlank(item.werks)){
Public.tip("请先选择工厂");
return false;
}
return {
fieldName: "LGORT",
filterValue: item.werks
}
},
back: {
LGORT: "lgort",
......
......@@ -172,30 +172,41 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
//物料编码为空 排序字段 传SAP FYL+7位流水号
if (StringUtils.isBlank(sapPurchaseInfoRecordItemVo.getMatnr())
&&StringUtils.isBlank(sapPurchaseInfoRecordItemVo.getSortl())) {
//物料描述赋值给短文本
sapPurchaseInfoRecordItemVo.setTxz01(sapPurchaseInfoRecordItem.getMaktx());
//根据供应商和物料组来查询是否推送成功过,如果成功过 则设置序号 并累加1
SapPurchaseInfoRecordQueryRequest query=new SapPurchaseInfoRecordQueryRequest();
query.setLifnr(sapPurchaseInfoRecordItem.getLifnr());
query.setMatkl(sapPurchaseInfoRecordItem.getMatkl());
synchronized(this) {
List list=sapPurchaseInfoRecordItemApplication.querySapPurchaseInfoRecordItemByMaytkl(query);
if (list.size()>0){
synchronized(this) {
String sql = "select t.* from code_rule t where t.RULE_KIND = ? for update";
CodeRule codeRule = this.sqlExecutorDao.queryToObject(sql, CodeRule.class, "sortl");
Integer currentValue = codeRule.getCurrentValue();
if (currentValue == null) {
currentValue = 0;
sapPurchaseInfoRecordItemVo.setSortl("FYL"+formatSerialNumber(list.size()+1,7));
}else {
sapPurchaseInfoRecordItemVo.setSortl("FYL"+formatSerialNumber(1,7));
}
}
currentValue += 1;
codeRule.setCurrentValue(currentValue);
codeRule.setLastModifiedDate(DateUtil.getTimestamp());
codeRule = codeRuleRepository.save(codeRule);
String sortNo = codeRule.getPrefix() + formatSerialNumber(currentValue, 7);
sapPurchaseInfoRecordItemVo.setSortl(sortNo);
// if (list.size()>0){
// synchronized(this) {
// String sql = "select t.* from code_rule t where t.RULE_KIND = ? for update";
// CodeRule codeRule = this.sqlExecutorDao.queryToObject(sql, CodeRule.class, "sortl");
// Integer currentValue = codeRule.getCurrentValue();
// if (currentValue == null) {
// currentValue = 0;
// }
// currentValue += 1;
// codeRule.setCurrentValue(currentValue);
// codeRule.setLastModifiedDate(DateUtil.getTimestamp());
// codeRule = codeRuleRepository.save(codeRule);
//
// String sortNo = codeRule.getPrefix() + formatSerialNumber(currentValue, 7);
// sapPurchaseInfoRecordItemVo.setSortl(sortNo);
// }
// sapPurchaseInfoRecordItem.setSortl(sapPurchaseInfoRecordItemVo.getSortl());
// }
}
sapPurchaseInfoRecordItem.setSortl(sapPurchaseInfoRecordItemVo.getSortl());
}
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
if (sapPurchaseInfoRecordItem.getDatab() !=null){
String datab = dateFormat.format(sapPurchaseInfoRecordItem.getDatab());
......
......@@ -248,4 +248,10 @@ public class SapPurchaseInfoRecordItemVo implements Serializable {
@JsonProperty("KBETR6")
private BigDecimal kbetr6;
/**
* 短文本
*/
@JsonProperty("TXZ01")
private String txz01;
}
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