Commit 7fbc28dd authored by 1650842865's avatar 1650842865

采购信息记录增加导出功能;物料申请增加正反面图片,并流转

parent 1f729225
......@@ -136,7 +136,7 @@ function copyQualityInfoRecord(){
return;
}
UICtrl.addTabItem({
tabid: 'epChangeForm',
tabid: 'epChangeForm'+row.id,
text: '新增变更申请/通知单',
url: web_app.name + '/epChangeForm/copyEpChangeForm.job?id=' + row.id
});
......
......@@ -125,7 +125,7 @@
<%--<x:selectC name="mtposMara" label="项目类别组" labelCol="1" fieldCol="2" dictionary="mtposMara"/>--%>
<x:hidden name="mtposMara"/>
<x:inputC name="maktx" label="SAP物料名称" required="true" labelCol="1" fieldCol="5" maxLength="40"/>
<x:inputC name="groes" label="规格" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="groes" label="规格" required="false" labelCol="1" fieldCol="2"/>
<x:hidden name="xchpf"/>
<!--x:inputC name="magrv" label="包装物料组" labelCol="1" fieldCol="2"/-->
......
......@@ -32,7 +32,7 @@ function bindMaktx(){
formValues.push(inputValue);
}
});
let result = formValues.join('_');
let result = formValues.join('');
//限定40个字符
result = result.substring(0,40);
$("#materialNameElement #maktx").val(result);
......
......@@ -114,4 +114,36 @@ function bindEvent(){
$('#baseUnitName').val(data.MSEHL);
}
});
//正面图片
var _img=$('#showFrontPicture');
var _frontPicturePath=$('#frontPicturePath').val();
if (Public.isNotBlank(_frontPicturePath)) {
_img[0].src = $.getCSRFUrl('attachment/downFileBySavePath.ajax',{file:_frontPicturePath});
}
$('#addFrontPicture').uploadButton({
filetype: ['jpg','gif','jpeg','png','bmp'],
afterUpload: function(data){
_img[0].src = $.getCSRFUrl('attachmentDownFile.ajax',{id:data.id});
},
param: function(){
return {bizCode: 'frontPicture', bizId: $("#attbizId").val(), flag: 'false', deleteOld: 'true', returnPath: 'true'};
}
});
//反面图片
var back_img=$('#showBackPicture');
var _backPicturePath=$('#backPicturePath').val();
if (Public.isNotBlank(_backPicturePath)) {
back_img[0].src = $.getCSRFUrl('attachment/downFileBySavePath.ajax',{file:_backPicturePath});
}
$('#addBackPicture').uploadButton({
filetype: ['jpg','gif','jpeg','png','bmp'],
afterUpload: function(data){
back_img[0].src = $.getCSRFUrl('attachmentDownFile.ajax',{id:data.id});
},
param: function(){
return {bizCode: 'backPicture', bizId: $("#attbizId").val(), flag: 'false', deleteOld: 'true', returnPath: 'true'};
}
});
}
\ No newline at end of file
......@@ -40,6 +40,8 @@
<x:hidden name="createdDate"/>
<x:hidden name="maktxRemZh"/>
<x:hidden name="maktxRemEn"/>
<x:hidden name="frontPicturePath"/>
<x:hidden name="backPicturePath"/>
<%-- <x:hidden name="personMemberName"/>--%>
<x:title title="申请人填写区域" name="group"/>
<div class="hg-form-cols">
......@@ -111,6 +113,22 @@
</div>
</div>
</div>
<div class="hg-form-cols">
<div class="hg-form-row">
<div style="text-align: left;margin-top:10px;">
<img src='<c:url value="/images/photo.jpg"/>' height='200' width='170' border=0 id="showFrontPicture" onerror="src='<c:url value="/images/photo.jpg"/>';"/>
&nbsp;&nbsp;
<img src='<c:url value="/images/photo.jpg"/>' height='200' width='170' border=0 id="showBackPicture" onerror="src='<c:url value="/images/photo.jpg"/>';"/>
</div>
<div style="text-align: left;margin-top:20px;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<x:button value="正面图片" id="addFrontPicture" icon="fa-hand-o-up"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<x:button value="反面图片" id="addBackPicture" icon="fa-hand-o-up"/>
</div>
</div>
</div>
</form>
......
......@@ -18,11 +18,12 @@ function initializate() {
UICtrl.disable("#mtart")
UICtrl.setDisable("#totalContentDiv");
coRowNum= $("#busiLens").val();
initKlart($("#mtart").val());
initRaube($("#mtart").val());
initbstmi($("#mtart").val());
initueetk($("#mtart").val());
initKunnrName($("#mtart").val());
var mtart = $("#mtart").val();
initKlart(mtart);
initRaube(mtart);
initbstmi(mtart);
initueetk(mtart);
initKunnrName(mtart);
//页面控制
UICtrl.enable($("#businessUsage"));
UICtrl.enable($("#matklName"));
......@@ -182,6 +183,17 @@ function initializate() {
var lvorm = $("#lvorm").val();
bindEvent_lvorm(lvorm)
}
//BPM不能修改产成品、半成品、设备类的产品名称、物料组、单位、规格
if (mtart == "ZBCP" || mtart == "ZZCP" || mtart == "ZSHB"){
// UICtrl.disable("#matklTypeName");
// UICtrl.disable("#matklName");
// UICtrl.disable("#groes");
// UICtrl.disable("#spartName");
// UICtrl.disable("#meinsName");
// UICtrl.disable("#maktxRemZh");
// UICtrl.disable("#maktx");
}
}
function initKlart(mtart) {
......
......@@ -120,7 +120,7 @@
<x:hidden name="matklType"/>
<x:inputC name="matklName" label="物料组小类" required="true" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="matkl"/>
<x:inputC name="groes" label="规格" required="true" labelCol="1" fieldCol="2"/>
<x:inputC name="groes" label="规格" required="false" labelCol="1" fieldCol="2"/>
<x:inputC name="spartName" label="产品组" required="true" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="spart"/>
<x:selectC name="mtposMara" label="项目类别组" labelCol="1" fieldCol="2" dictionary="mtposMara"/>
......
......@@ -51,7 +51,8 @@ function initPurchaseListGrid() {
id: 'cancelHandler', text: "作废", img:'fa-trash-o', click: function(){
cancelHandlerInfoRecord();
}
}
},
exportExcelHandler:exportExcelHandler,
});
purchaseInfoRecordGridManager = UICtrl.grid('#purchaseInfoRecordGrid', {
columns: [
......@@ -290,3 +291,9 @@ function cancelHandlerInfoRecord(){
})
}
//导出Excel
function exportExcelHandler() {
var date = Public.formatDate(new Date(),`%Y%M%D`);
UICtrl.gridExport(purchaseInfoRecordGridManager,{fileName:"采购信息记录"+date});
}
package com.huigou.topsun.sap.nonProdApply.application;
import com.huigou.topsun.sap.nonProdApply.domain.NonProdApplyBaseInfo;
import com.huigou.topsun.sap.nonProdApply.domain.SapNonProdApplyDept;
import com.huigou.topsun.sap.nonProdApply.domain.query.NonProdApplyBaseInfoQueryRequest;
import com.huigou.topsun.sap.nonProdApply.domain.vo.ProdApplyFromSapVO;
......@@ -34,7 +35,7 @@ public interface NonProdApplyApplication{
String getChangeBusinessUsage(String bizId,String type);
//保存来自SAP的产品申请
String saveProdApplyFromSapVO(ProdApplyFromSapVO prodApplyFromSapVO);
String saveProdApplyFromSapVO(ProdApplyFromSapVO prodApplyFromSapVO, SapNonProdApplyDept sapNonProdApplyDept);
Map<String, Object> slicedNonApplyBaseInfoByMaktx(NonProdApplyBaseInfoQueryRequest query);
......
......@@ -35,7 +35,7 @@ public interface NonProdApplyDeptApplication {
SapNonProdApplyDept getNonProdApplyDeptByBaseInfoId(String id);
SapNonProdApplyDept getNonProdApplyDeptByMatnr(String matnr);
List<SapNonProdApplyDept> getNonProdApplyDeptByMatnr(String matnr);
void deleteSapNonProdApplyDept(SapNonProdApplyDept sapNonProdApplyDept);
/**
......
......@@ -11,6 +11,7 @@ import com.huigou.cache.SystemCache;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.data.domain.model.CommonDomainConstants;
import com.huigou.data.domain.model.Creator;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.base.bsnMessage.appliction.BsnMessageApplication;
......@@ -36,6 +37,8 @@ import com.huigou.topsun.sap.nonProdApply.repository.NonProdApplyBaseInfoReposit
import com.huigou.topsun.sap.nonProdApply.repository.NonProdApplyDeptRepository;
import com.huigou.topsun.sap.wasteSale.domain.WasteSale;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.doc.attachment.application.AttachmentApplication;
import com.huigou.uasp.bmp.doc.attachment.domain.model.Attachment;
import com.huigou.uasp.bmp.operator.OperatorApplication;
import com.huigou.uasp.bmp.opm.repository.org.OrgRepository;
import com.huigou.uasp.bpm.ApprovalParameter;
......@@ -86,7 +89,8 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
DefaultHttpClient defaultHttpClient;
@Autowired
private NonProdApplyDeptRepository nonProdApplyDeptRepository;
@Autowired
private AttachmentApplication attachmentApplication;
@SneakyThrows
@Transactional(propagation = Propagation.REQUIRES_NEW)
@Override
......@@ -261,6 +265,31 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
nonProdApplyBaseInfo.setStatusId(status.getId());
nonProdApplyBaseInfo.setApprover(getOperator().getPersonMemberName());
nonProdApplyBaseInfo.setApprovalDate(new Date());
//复制正反面图片
List<Attachment> frontAttachments = attachmentApplication.queryAttachments("frontPicture", nonProdApplyBaseInfo.getAttbizId());
List<Attachment> backAttachments = attachmentApplication.queryAttachments("backPicture", nonProdApplyBaseInfo.getAttbizId());
if (frontAttachments.size() > 0) {
Attachment attachment = frontAttachments.get(0);
Attachment attachmentNew = new Attachment();
ClassHelper.copyProperties(attachment, attachmentNew);
attachmentNew.setId(null);
attachmentNew.setBizId(nonProdApplyBaseInfo.getId());
Creator creator = attachmentNew.getCreator();
creator.setCreatedDate(new Date());
attachmentNew.setCreator(creator);
attachmentApplication.saveAttachment(attachmentNew);
}
if (backAttachments.size() > 0) {
Attachment attachment = backAttachments.get(0);
Attachment attachmentNew = new Attachment();
ClassHelper.copyProperties(attachment, attachmentNew);
attachmentNew.setId(null);
attachmentNew.setBizId(nonProdApplyBaseInfo.getId());
Creator creator = attachmentNew.getCreator();
creator.setCreatedDate(new Date());
attachmentNew.setCreator(creator);
attachmentApplication.saveAttachment(attachmentNew);
}
nonProdApplyBaseInfoRepository.save(nonProdApplyBaseInfo);
}
......@@ -483,7 +512,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
if (!"modify".equals(maintenanceType)) {
usedBusiness += mapExd.get("businessUsage").toString() + ",";
}
if (!"3".equals(mapExd.get("status").toString())){
if (!"3".equals(mapExd.get("status").toString()) && !"5".equals(mapExd.get("status").toString())){
isExistApplyStatus=true;
maintenanceType=mapExd.get("maintenanceType").toString().equals("extend")?"扩展":"变更";
break;
......@@ -500,7 +529,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
@Override
@Transactional
public String saveProdApplyFromSapVO(ProdApplyFromSapVO prodApplyFromSapVO) {
public String saveProdApplyFromSapVO(ProdApplyFromSapVO prodApplyFromSapVO,SapNonProdApplyDept sapNonProdApplyDept) {
//初始化用户信息
String createdById = SystemCache.getParameter("adminPersonId", String.class);
......@@ -508,7 +537,7 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
String message="";
try {
NonProdApplyBaseInfo nonProdApplyBaseInfo = new NonProdApplyBaseInfo();
SapNonProdApplyDept sapNonProdApplyDept = new SapNonProdApplyDept();
ClassHelper.copyProperties(prodApplyFromSapVO,sapNonProdApplyDept);
ClassHelper.copyProperties(prodApplyFromSapVO, nonProdApplyBaseInfo);
......
......@@ -250,7 +250,7 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
return nonProdApplyDeptRepository.findByBaseInfoId(baseInfoId);
}
@Override
public SapNonProdApplyDept getNonProdApplyDeptByMatnr(String matnr){
public List<SapNonProdApplyDept> getNonProdApplyDeptByMatnr(String matnr){
return nonProdApplyDeptRepository.findByMatnr(matnr);
}
@Override
......
......@@ -11,7 +11,7 @@ public interface NonProdApplyDeptRepository extends JpaRepository<SapNonProdAppl
SapNonProdApplyDept findByBaseInfoId(String baseInfoId);
SapNonProdApplyDept findByApplyDeptId(String applyDeptId);
SapNonProdApplyDept findByMatnr(String matnr);
List<SapNonProdApplyDept> findByMatnr(String matnr);
List<SapNonProdApplyDept> findByMatnrAndWerks(String matnr,String werks);
List <SapNonProdApplyDept> findByMaktx(String maktx);
......
......@@ -3,6 +3,7 @@ package com.huigou.topsun.sap.purchase.domain;
import javax.persistence.*;
import com.huigou.data.domain.model.FlowBillAbstractEntity;
import com.huigou.util.StringUtil;
import lombok.Data;
import java.util.Date;
......@@ -75,6 +76,17 @@ public class SapPurchase extends FlowBillAbstractEntity {
@Column(name = "kostl")
private String kostl;
public String getKostl() {
return kostl;
}
public void setKostl(String kostl) {
if (StringUtil.isBlank(kostl)) {
return;
}
this.kostl = kostl;
}
private static final long serialVersionUID = 1L;
@Override
......
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