Commit 14a5b67b authored by 刘学辉's avatar 刘学辉

物料主数据的页面调整

parent 40f68f59
...@@ -59,7 +59,12 @@ ...@@ -59,7 +59,12 @@
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="genericName" label="通用品名" labelCol="1" fieldCol="5"/> <x:inputC name="genericName" label="通用品名" labelCol="1" fieldCol="5"/>
<c:if test="${kind=='product'}">
<x:inputC name="applicableStandard" label="适用标准(国标)" labelCol="1" fieldCol="5"/> <x:inputC name="applicableStandard" label="适用标准(国标)" labelCol="1" fieldCol="5"/>
</c:if>
<c:if test="${kind!='product'}">
<x:inputC name="applicableStandard" label="适用行业标准" labelCol="1" fieldCol="5"/>
</c:if>
<x:hidden name="baseUnit"/> <x:hidden name="baseUnit"/>
<x:inputC name="baseUnitName" label="基本计量单位" labelCol="1" fieldCol="2" wrapper="select"/> <x:inputC name="baseUnitName" label="基本计量单位" labelCol="1" fieldCol="2" wrapper="select"/>
<x:inputC name="specifications" label="规格" labelCol="1" fieldCol="2"/> <x:inputC name="specifications" label="规格" labelCol="1" fieldCol="2"/>
......
...@@ -26,6 +26,7 @@ function initializate() { ...@@ -26,6 +26,7 @@ function initializate() {
//物品类型 控制存储的序列号参数 //物品类型 控制存储的序列号参数
$("#mtart").combox({onChange:function(data) { $("#mtart").combox({onChange:function(data) {
storeDisplaySer(data.value); storeDisplaySer(data.value);
getBklas(data.value);
} }
}); });
//价格控制 控制财务核算的 不参与成本核算 //价格控制 控制财务核算的 不参与成本核算
...@@ -435,6 +436,7 @@ function financialMustInput(flag) { ...@@ -435,6 +436,7 @@ function financialMustInput(flag) {
$("#peinh").val("1000"); $("#peinh").val("1000");
} }
financialDisplayNcost($("#vprsv").val()); financialDisplayNcost($("#vprsv").val());
getBklas($('#mtart').val());
} }
function financialDisplayNcost(vprsv) { // alert("-="+vprsv); function financialDisplayNcost(vprsv) { // alert("-="+vprsv);
...@@ -451,6 +453,27 @@ function financialDisplayNcost(vprsv) { // alert("-="+vprsv); ...@@ -451,6 +453,27 @@ function financialDisplayNcost(vprsv) { // alert("-="+vprsv);
} }
} }
} }
function getBklas(mtart){ //获取评估分类
if (mtart=='ZBCP'){
$('#bklas').val("7900");
} else
if (mtart=='ZBPJ'||mtart=='ZBZP'||mtart=='ZCOM'||mtart=='ZECC'||mtart=='ZFBL'||mtart=='ZGMB'
||mtart=='ZXHP'||mtart=='ZXNJ') {
$('#bklas').val("3001");
} else if (mtart=='ZKGL') {
$('#bklas').val("3000");
} else if (mtart=='ZMYP') {
$('#bklas').val("7930");
} else if (mtart==' ZSHB'|| mtart=='ZZCP') {
$('#bklas').val("7920");
} else if (mtart=='ZSRV') {
$('#bklas').val("7940");
} else if (mtart=='ZYCL') {
$('#bklas').val("3000");
}
}
/** /**
* 表单提交 * 表单提交
* @returns {boolean} * @returns {boolean}
......
...@@ -85,7 +85,12 @@ ...@@ -85,7 +85,12 @@
<div class="hg-form-cols" id="totalContentDiv"> <div class="hg-form-cols" id="totalContentDiv">
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="genericName" label="通用品名" labelCol="1" fieldCol="2"/> <x:inputC name="genericName" label="通用品名" labelCol="1" fieldCol="2"/>
<x:inputC name="applicableStandard" label="适用标准(国标)" labelCol="1" fieldCol="2"/> <c:if test="${kind=='product'}">
<x:inputC name="applicableStandard" label="适用标准(国标)" labelCol="1" fieldCol="2"/>
</c:if>
<c:if test="${kind!='product'}">
<x:inputC name="applicableStandard" label="适用行业标准" labelCol="1" fieldCol="2"/>
</c:if>
<x:hidden name="baseUnit"/> <x:hidden name="baseUnit"/>
<x:inputC name="baseUnitName" label="基本计量单位" labelCol="1" fieldCol="2" readonly="true"/> <x:inputC name="baseUnitName" label="基本计量单位" labelCol="1" fieldCol="2" readonly="true"/>
<x:inputC name="specifications" label="规格" labelCol="1" fieldCol="2"/> <x:inputC name="specifications" label="规格" labelCol="1" fieldCol="2"/>
...@@ -205,8 +210,8 @@ ...@@ -205,8 +210,8 @@
<x:selectC name="ktgrm" label="会计科目组" labelCol="1" fieldCol="2" required="false" dictionary="ktgrm"/> <x:selectC name="ktgrm" label="会计科目组" labelCol="1" fieldCol="2" required="false" dictionary="ktgrm"/>
<%--<x:selectC name="prodh" label="产品层级" labelCol="1" fieldCol="2" dictionary="productLevels"/>--%> <%--<x:selectC name="prodh" label="产品层级" labelCol="1" fieldCol="2" dictionary="productLevels"/>--%>
<x:inputC name="prodh" label="产品层级" labelCol="1" fieldCol="2"/> <x:inputC name="prodh" label="产品层级" labelCol="1" fieldCol="2"/>
<x:inputC name="mvgr1" label="版式" labelCol="1" fieldCol="2"/> <x:inputC name="mvgr1" label="品牌" labelCol="1" fieldCol="2"/>
<x:inputC name="mvgr2" label="品牌" labelCol="1" fieldCol="2" disabled="true"/> <x:selectC name="mvgr2" label="产品经营类型" labelCol="1" fieldCol="2" dictionary="mvgr2"/>
<x:inputC name="mvgr3" label="用途" labelCol="1" fieldCol="2"/> <x:inputC name="mvgr3" label="用途" labelCol="1" fieldCol="2"/>
<x:inputC name="mvgr4" label="备用1" labelCol="1" fieldCol="2"/> <x:inputC name="mvgr4" label="备用1" labelCol="1" fieldCol="2"/>
<x:inputC name="mvgr5" label="备用2" labelCol="1" fieldCol="2"/> <x:inputC name="mvgr5" label="备用2" labelCol="1" fieldCol="2"/>
...@@ -345,7 +350,8 @@ ...@@ -345,7 +350,8 @@
<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"/-->
<x:inputC name="bklas" label="评估分类" labelCol="1" fieldCol="2" readonly="true"/>
<!--x:inputC name="mlast" label="价格确定" labelCol="1" fieldCol="2" required="false"/--> <!--x:inputC name="mlast" label="价格确定" labelCol="1" fieldCol="2" required="false"/-->
<x:selectC name="mlast" label="价格确定" labelCol="1" fieldCol="2" dictionary="mlast"/> <x:selectC name="mlast" label="价格确定" labelCol="1" fieldCol="2" dictionary="mlast"/>
...@@ -356,7 +362,7 @@ ...@@ -356,7 +362,7 @@
<x:selectC name="ncost" label="不参与成本核算" labelCol="2" fieldCol="1" dictionary="xchpf"/> <x:selectC name="ncost" label="不参与成本核算" labelCol="2" fieldCol="1" dictionary="xchpf"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="ekalr" label="数量结构" labelCol="1" fieldCol="2"/> <x:selectC name="ekalr" label="数量结构" labelCol="1" fieldCol="2" dictionary="xchpf"/>
<x:selectC name="hkmat" label="物料来源" labelCol="1" fieldCol="2" dictionary="xchpf"/> <x:selectC name="hkmat" label="物料来源" labelCol="1" fieldCol="2" dictionary="xchpf"/>
<x:inputC name="awsls" label="差异码" labelCol="1" fieldCol="2"/> <x:inputC name="awsls" label="差异码" labelCol="1" fieldCol="2"/>
......
...@@ -611,7 +611,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA ...@@ -611,7 +611,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
//保存基本信息的维护的待办 //保存基本信息的维护的待办
// saveDeptStaff(deptStaffList, nonProdApplyDept.getApplyDeptId(),genericName); // saveDeptStaff(deptStaffList, nonProdApplyDept.getApplyDeptId(),genericName);
/* 改为推送给 货源专员
BsnMessageSponsor bsnMessageSponsor = new BsnMessageSponsor(); BsnMessageSponsor bsnMessageSponsor = new BsnMessageSponsor();
bsnMessageSponsor.setTaskSponsor(operator.getLoginUser().getId()); bsnMessageSponsor.setTaskSponsor(operator.getLoginUser().getId());
String genericName=nonProdApplyBaseInfo.getGenericName()!=null?nonProdApplyBaseInfo.getGenericName():""; String genericName=nonProdApplyBaseInfo.getGenericName()!=null?nonProdApplyBaseInfo.getGenericName():"";
...@@ -647,9 +647,13 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA ...@@ -647,9 +647,13 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
List<BsnMessageExecute> executes =new ArrayList<>(); List<BsnMessageExecute> executes =new ArrayList<>();
executes.add(messageExecute); executes.add(messageExecute);
bsnMessageApplication.saveBsnMessageExecute(executes); bsnMessageApplication.saveBsnMessageExecute(executes); */
// bsnMessageApplication.publishTasks(sapNonProdApplyDept.getApplyDeptId()); // bsnMessageApplication.publishTasks(sapNonProdApplyDept.getApplyDeptId());
Map backMap=new HashMap();
backMap.put("TYPE","P");
backMap.put("title",nonProdApplyBaseInfo.getBillCode());
backMap.put("positionCode","HYZY");
nonProdApplyDeptApplication.saveBsnMessageData(nonProdApplyBaseInfo, backMap);
}catch(Exception ex){ }catch(Exception ex){
message=ex.getMessage(); message=ex.getMessage();
// ex.printStackTrace(); // ex.printStackTrace();
......
...@@ -415,7 +415,9 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements ...@@ -415,7 +415,9 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
if ("0".equals(sapVO.getHkmat())){ //物料来源 否 传递空 if ("0".equals(sapVO.getHkmat())){ //物料来源 否 传递空
sapVO.setHkmat(""); sapVO.setHkmat("");
} }
if ("0".equals(sapVO.getEkalr())){ //数量结构 传递空
sapVO.setEkalr("");
}
if (baseInfo.getBusinessUsage().contains("K")){ if (baseInfo.getBusinessUsage().contains("K")){
sapVO.setPstat(baseInfo.getBusinessUsage()); sapVO.setPstat(baseInfo.getBusinessUsage());
}else { }else {
...@@ -593,6 +595,8 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements ...@@ -593,6 +595,8 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
title="("+title+")"; title="("+title+")";
} }
messageExecute.setTaskDescribe(genericName +sign+ "待确认" + title); messageExecute.setTaskDescribe(genericName +sign+ "待确认" + title);
} else if ("P".equals(backMap.get("TYPE").toString())) { //产品数据
messageExecute.setTaskDescribe(genericName +sign+ "数据维护");
} }
bsnMessageApplication.saveBsnMessageSponsor(bsnMessageSponsor); bsnMessageApplication.saveBsnMessageSponsor(bsnMessageSponsor);
messageExecute.setMessageSponsorId(bsnMessageSponsor.getId()); messageExecute.setMessageSponsorId(bsnMessageSponsor.getId());
......
...@@ -64,6 +64,7 @@ public class NonProdApplyController extends CommonController { ...@@ -64,6 +64,7 @@ public class NonProdApplyController extends CommonController {
nonProdApplyBaseInfo.setMaintenanceType("new"); nonProdApplyBaseInfo.setMaintenanceType("new");
nonProdApplyBaseInfo.setApplyType("0"); nonProdApplyBaseInfo.setApplyType("0");
nonProdApplyBaseInfo.setKind("materiel"); nonProdApplyBaseInfo.setKind("materiel");
this.putAttribute("kind","materiel");
nonProdApplyBaseInfo.setCreatedDate(new Date()); nonProdApplyBaseInfo.setCreatedDate(new Date());
if (StringUtil.isNotBlank(extended)) { //扩展流程 if (StringUtil.isNotBlank(extended)) { //扩展流程
nonProdApplyBaseInfo = nonProdApplyApplication.loadNonProdApplyBaseInfoById(bizId); nonProdApplyBaseInfo = nonProdApplyApplication.loadNonProdApplyBaseInfoById(bizId);
......
...@@ -149,6 +149,8 @@ public class NonProdApplyNextController extends CommonController { ...@@ -149,6 +149,8 @@ public class NonProdApplyNextController extends CommonController {
} }
if ("product".equals(nonProdApplyDept.getKind())){ if ("product".equals(nonProdApplyDept.getKind())){
this.putAttribute("kind","product"); this.putAttribute("kind","product");
} else{
this.putAttribute("kind","materiel");
} }
return forward("nonProdApplyNext", nonProdApplyDept); return forward("nonProdApplyNext", nonProdApplyDept);
} else { } else {
...@@ -348,7 +350,7 @@ public class NonProdApplyNextController extends CommonController { ...@@ -348,7 +350,7 @@ public class NonProdApplyNextController extends CommonController {
if (epResult.getData()!=null){ if (epResult.getData()!=null){
nonProdApplyDept.setBrand(epResult.getData().getCode()); nonProdApplyDept.setBrand(epResult.getData().getCode());
nonProdApplyDept.setBrandName(epResult.getData().getName()); nonProdApplyDept.setBrandName(epResult.getData().getName());
nonProdApplyDept.setMvgr2(epResult.getData().getCode()); nonProdApplyDept.setMvgr1(epResult.getData().getCode());
} }
} else { } else {
throw new RuntimeException("从EP查询品牌错误:" + epResult.getMsg()); throw new RuntimeException("从EP查询品牌错误:" + epResult.getMsg());
......
...@@ -8,6 +8,8 @@ import com.huigou.cache.SystemCache; ...@@ -8,6 +8,8 @@ import com.huigou.cache.SystemCache;
import com.huigou.data.domain.model.CommonDomainConstants; import com.huigou.data.domain.model.CommonDomainConstants;
import com.huigou.data.query.model.QueryDescriptor; import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel; import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.base.coderule.domain.model.CodeRule;
import com.huigou.topsun.base.coderule.repository.CodeRuleRepository;
import com.huigou.topsun.sap.common.HttpClient; import com.huigou.topsun.sap.common.HttpClient;
import com.huigou.topsun.sap.common.application.SapMutualEpLogApplication; import com.huigou.topsun.sap.common.application.SapMutualEpLogApplication;
import com.huigou.topsun.sap.costReimbursement.domain.SapCostReimbursement; import com.huigou.topsun.sap.costReimbursement.domain.SapCostReimbursement;
...@@ -22,9 +24,11 @@ import com.huigou.topsun.sap.purchaseInfoRecord.repository.SapPurchaseInfoRecord ...@@ -22,9 +24,11 @@ import com.huigou.topsun.sap.purchaseInfoRecord.repository.SapPurchaseInfoRecord
import com.huigou.uasp.bmp.common.BizBillStatus; import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.FlowBroker; import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.util.ClassHelper; import com.huigou.util.ClassHelper;
import com.huigou.util.DateUtil;
import com.huigou.util.StringUtil; import com.huigou.util.StringUtil;
import org.activiti.engine.delegate.DelegateExecution; import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask; import org.activiti.engine.delegate.DelegateTask;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -36,6 +40,7 @@ import java.text.SimpleDateFormat; ...@@ -36,6 +40,7 @@ import java.text.SimpleDateFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern;
/** /**
* @Auther: xin.lu * @Auther: xin.lu
...@@ -53,6 +58,8 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements ...@@ -53,6 +58,8 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
private HttpClient httpClient; private HttpClient httpClient;
@Autowired @Autowired
SapMutualEpLogApplication sapMutualEpLogApplication; SapMutualEpLogApplication sapMutualEpLogApplication;
@Autowired
private CodeRuleRepository codeRuleRepository;
@Transactional @Transactional
@Override @Override
...@@ -141,6 +148,28 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements ...@@ -141,6 +148,28 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
if (StringUtil.isBlank(sapPurchaseInfoRecordItemVo.getMeins())){ if (StringUtil.isBlank(sapPurchaseInfoRecordItemVo.getMeins())){
sapPurchaseInfoRecordItemVo.setMeins(sapPurchaseInfoRecordItemVo.getBprme()); sapPurchaseInfoRecordItemVo.setMeins(sapPurchaseInfoRecordItemVo.getBprme());
} }
//物料编码为空 排序字段 传SAP FYL+7位流水号
if (StringUtils.isBlank(sapPurchaseInfoRecordItemVo.getMatnr())
&&StringUtils.isBlank(sapPurchaseInfoRecordItemVo.getSortl())) {
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());
}
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
if (sapPurchaseInfoRecordItem.getDatab() !=null){ if (sapPurchaseInfoRecordItem.getDatab() !=null){
String datab = dateFormat.format(sapPurchaseInfoRecordItem.getDatab()); String datab = dateFormat.format(sapPurchaseInfoRecordItem.getDatab());
...@@ -185,6 +214,15 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements ...@@ -185,6 +214,15 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
}); });
} }
private String formatSerialNumber(Integer serialNumber, int length) {
String result = String.valueOf(serialNumber);
Assert.isTrue(result.length() <= length, String.format("流水号长度超出限制,设置长度:%s,实际长度:%s。", length, result.length()));
while (result.length() < length) {
result = "0" + result;
}
return result;
}
@Override @Override
protected void onAbortProcessInstance(DelegateExecution delegateExecution) { protected void onAbortProcessInstance(DelegateExecution delegateExecution) {
super.onAbortProcessInstance(delegateExecution); super.onAbortProcessInstance(delegateExecution);
......
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