Commit 00788865 authored by 刘学辉's avatar 刘学辉

Merge remote-tracking branch 'origin/dev' into dev

parents f322e9fa c7be5752
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<div class="col-md-8"> <div class="col-md-8">
<x:inputC name="email" id="email" label="电子邮件" required="true" labelCol="2" fieldCol="4" maxlength="64" match="email"/> <x:inputC name="email" id="email" label="电子邮件" required="false" labelCol="2" fieldCol="4" maxlength="64" match="email"/>
<x:inputC name="qq" id="qq" label="QQ" labelCol="2" fieldCol="4" match="qq" maxlength="20"/> <x:inputC name="qq" id="qq" label="QQ" labelCol="2" fieldCol="4" match="qq" maxlength="20"/>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
......
...@@ -5,6 +5,10 @@ $(document).ready(function () { ...@@ -5,6 +5,10 @@ $(document).ready(function () {
function initializateUI() { function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3}); UICtrl.layout("#layout", {leftWidth: 3});
$('#nonOrderStorageList').fileList({
bizId : $("#id").val()
});
var isCharge = $("#isCharge").val(); var isCharge = $("#isCharge").val();
amountController(isCharge) amountController(isCharge)
} }
...@@ -49,6 +53,27 @@ function bindEvent() { ...@@ -49,6 +53,27 @@ function bindEvent() {
amountController(data.value) amountController(data.value)
} }
}) })
$('#productName').searchbox({
type: "system", name: "sapMaterialSelect",
getParam: function (item) {
if (Public.isBlank($('#werks').val())){
Public.tip("请先选择工厂!")
return false
}
return {
/// fieldName: "sapMaterialSelect",
filterValue: $('#werks').val()
}
},
onChange: function (value, data) {
$('#productName').val(data.MAKTX);
$('#unit').val(data.MEINS);
$('#unitName').val(data.MSEHL);
$('#store').val(data.LGFSB);
$('#storeName').val(data.LGOBE);
}
});
} }
function amountController(value){ function amountController(value){
...@@ -62,6 +87,9 @@ function amountController(value){ ...@@ -62,6 +87,9 @@ function amountController(value){
} }
function setId(value) { function setId(value) {
$('#id').val(value); $('#id').val(value);
$('#nonOrderStorageList').fileList({
bizId : value
});
} }
function getId() { function getId() {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html> <html>
<head> <head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date"/> <x:base include="layout,dialog,grid,tree,combox,commonTree,date,attachment"/>
<x:script src='/biz/topsun/sap/nonOrderStorage/nonOrderStorageDetail.js'/> <x:script src='/biz/topsun/sap/nonOrderStorage/nonOrderStorageDetail.js'/>
</head> </head>
<body> <body>
...@@ -33,13 +33,13 @@ ...@@ -33,13 +33,13 @@
<x:hidden name="message"/> <x:hidden name="message"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="productName" required="true" label="品名" labelCol="1" maxLength="64" fieldCol="2"/> <x:inputC name="werksName" required="true" label="工厂" labelCol="1" wrapper="select" fieldCol="2"/>
<x:inputC name="productName" required="true" label="品名" labelCol="1" maxLength="64" fieldCol="2" wrapper="select"/>
<x:inputC name="number" required="true" label="数量" labelCol="1" maxLength="64" fieldCol="2"/> <x:inputC name="number" required="true" label="数量" labelCol="1" maxLength="64" fieldCol="2"/>
<x:inputC name="unitName" required="true" label="单位" labelCol="1" wrapper="select" fieldCol="2"/> <x:inputC name="unitName" required="true" label="单位" labelCol="1" wrapper="select" fieldCol="2"/>
<x:selectC name="isCharge" required="true" label="是否收费" labelCol="1" dictionary="yesorno" fieldCol="2"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="werksName" required="true" label="工厂" labelCol="1" wrapper="select" fieldCol="2"/> <x:selectC name="isCharge" required="true" label="是否收费" labelCol="1" dictionary="yesorno" fieldCol="2"/>
<x:inputC name="storeName" required="false" label="库存地点" labelCol="1" wrapper="select" fieldCol="2"/> <x:inputC name="storeName" required="false" label="库存地点" labelCol="1" wrapper="select" fieldCol="2"/>
<x:inputC name="supplier" required="true" label="供应商" labelCol="1" fieldCol="2"/> <x:inputC name="supplier" required="true" label="供应商" labelCol="1" fieldCol="2"/>
<x:inputC name="amount" required="false" label="总价值" labelCol="1" fieldCol="2" mask="positiveMoney"/> <x:inputC name="amount" required="false" label="总价值" labelCol="1" fieldCol="2" mask="positiveMoney"/>
...@@ -48,7 +48,9 @@ ...@@ -48,7 +48,9 @@
<x:textareaC name="reason" required="true" label="事由" labelCol="1" rows="3" fieldCol="6"/> <x:textareaC name="reason" required="true" label="事由" labelCol="1" rows="3" fieldCol="6"/>
</div> </div>
</div> </div>
<div style="padding-top: 15px;">
<x:fileList bizCode="nonOrderStorage" bizId="id" id="nonOrderStorageList" title="附件" />
</div>
</form> </form>
</div> </div>
</body> </body>
......
var gridManager = null;
$(document).ready(function () {
initialize();
bindEvent();
});
function initialize(){
UICtrl.layout("#layout", {leftWidth: 3});
$('#produceMaterialApplyList').fileList({
bizId : $("#id").val()
});
}
function bindEvent(){
}
/**
* 流程引擎回调设置打样的id
* @param value 打样申请的id
*/
function setId(id) {
$("#id").val(id);
$('#produceMaterialApplyList').fileList({
bizId : id
});
}
/**
* 流程引擎获取打样申请id的回掉方法。
* @return 打样申请的id
*/
function getId() {
return $("#id").val() || "";
}
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date,attachment"/>
<x:script src='/biz/topsun/sap/produceMaterialApply/produceMaterialApplyDetail.js'/>
</head>
<body>
<x:billTitle title="生产类货源开发申请表" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate" type="datetime"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<x:hidden name="deptName"/>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<x:hidden name="statusId"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:selectC name="purpose" required="true" label="用途" labelCol="2" fieldCol="2" dictionary="purpose"/>
</div>
<div class="hg-form-row">
<x:textareaC name="reason" required="true" label="原由" labelCol="2" fieldCol="10" rows="2"/>
</div>
<div class="hg-form-row">
<x:textareaC name="requireDes" required="true" label="需求描述" labelCol="2" fieldCol="10" rows="3"/>
</div>
</div>
<div style="padding-top: 15px;">
<x:fileList bizCode="produceMaterialApply" bizId="id" id="produceMaterialApplyList" title="附件" />
</div>
</form>
</body>
</html>
var gridManager = null;
$(document).ready(function () {
initUI();
loadGrid();
})
function initUI() {
UICtrl.initDefaultLayout();
}
function loadGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: addHandler,
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
{display: "单据编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "创建日期", name: "fillinDate", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请人", name: "personMemberName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "申请部门", name: "deptName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "用途", name: "purposeTextView", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "原由", name: "reason", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "需求描述", name: "requireDes", width: 300, minWidth: 60, type: "string", align: "left"},
],
dataAction: "server",
url: web_app.name + '/produceMaterialApply/slicedProduceMaterialApplyList.ajax',
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
width: "100%",
height: "100%",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow: function (data, rowindex, rowobj) {
doView(data.id);
},
});
UICtrl.setSearchAreaToggle(gridManager);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function reloadGrid() {
gridManager.loadData();
}
function resetForm(obj) {
$(obj).formClean();
}
function addHandler() {
UICtrl.addTabItem({
tabid: 'produceMaterialApply',
text: "新增生产类货源开发申请表",
url: web_app.name + '/produceMaterialApply/forwardProduceMaterialApplyDetail.job'
});
}
function doView(id) {
UICtrl.addTabItem({
tabid: 'produceMaterialApply'+id,
text: "查看生产类货源开发申请表",
url: web_app.name + '/produceMaterialApply/showProduceMaterialApplyDetail.job?bizId='+id+"&isReadOnly=true"
});
}
<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree"/>
<x:script src='/biz/topsun/sap/produceMaterialApply/produceMaterialApplyList.js'/>
</head>
<body>
<div class="container-fluid">
<div class="ui-hide">
</div>
<div id="layout">
<div position="center" title="生产类货源开发申请表">
<x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/>
<form class="hg-form ui-hide" method="post" action="" id="queryMainForm">
<x:inputC name="billCode" required="false" label="申请单号" labelCol="1"/>
<x:searchButtons/>
</form>
<div class="blank_div clearfix"></div>
<div id="maingrid" style="margin: 2px;"></div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
...@@ -98,14 +98,7 @@ function loadGrid() { ...@@ -98,14 +98,7 @@ function loadGrid() {
columns: [ columns: [
{ {
display: "行号", name: "ebelp", width: 100, minWidth: 60, type: "String", align: "left" display: "行号", name: "ebelp", width: 100, minWidth: 60, type: "String", align: "left"
// editor: {type: 'spinner', min: 1, max: 100, mask: 'nn'}
}, },
// { display: "项目类别", name: "epstp", width: 380, minWidth: 200, type: "string", align: "left",
// editor: { type: "text",required: true }
// },
// { display: "物料", name: "matnr", width: 140, minWidth: 60, type: "string", align: "left",
// editor: { type: "text",required: true }
// },
{display: "物料", name: "matnr", width: "160", align: "left", type: "string", {display: "物料", name: "matnr", width: "160", align: "left", type: "string",
editor: { editor: {
required: true, type: "select", required: true, type: "select",
...@@ -119,18 +112,9 @@ function loadGrid() { ...@@ -119,18 +112,9 @@ function loadGrid() {
}, },
back: { back: {
MATNR: "matnr", MATNR: "matnr",
// MAKTX: "maktx", MAKTX: "matnrName",
MAKTX: "matnrName" MEINS: "meins",
// MATKL: "matkl" MSEHL: "meinsName"
// WGBEZ: "matklName"
// EKGRP: "ekgrp",
// EKNAM: "ekgrpName",
// PEINH: "peinh",
// MEINS: "meins",
// MSEHL: "meinsName",
// LGORT: "lgort",
// LGOBE: "lgobe"
} }
}, },
} }
...@@ -176,25 +160,6 @@ function loadGrid() { ...@@ -176,25 +160,6 @@ function loadGrid() {
} }
}, },
{display: "库存地点名称", name: "lgortName", width: "200", align: "left", type: "string"}, {display: "库存地点名称", name: "lgortName", width: "200", align: "left", type: "string"},
// {display: "收货工厂", name: "werks", width: "100", align: "left", type: "string",
// editor: {
// required: true, type: "select",
// data: {
// type: 'system',
// name: "dictionary",
// getParam: function (item) {
// return {fieldName: "WERKS"}
// },
// back: {
// WERKS: "werks",
// NAME1: "werksName"
// }
// },
// }
// },
// {display: "工厂名称", name: "werksName", width: "200", align: "left", type: "string",
// editor: {required: false, type: "text"}
// },
], ],
dataAction: "server", dataAction: "server",
url: web_app.name + '/sapStockTransfersItem/querySapStockTransfersItems.ajax', url: web_app.name + '/sapStockTransfersItem/querySapStockTransfersItems.ajax',
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<x:script src='/biz/topsun/sap/transfers/sapStockTransfersDetail.js'/> <x:script src='/biz/topsun/sap/transfers/sapStockTransfersDetail.js'/>
</head> </head>
<body> <body>
<x:billTitle title="存货转移单" needStatus="false" needPerson="true"/> <x:billTitle title="公司内跨工厂存货调拨申请单" needStatus="false" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm"> <form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/> <x:hidden name="id"/>
<x:hidden name="billCode"/> <x:hidden name="billCode"/>
......
...@@ -30,6 +30,8 @@ function loadGrid() { ...@@ -30,6 +30,8 @@ function loadGrid() {
{display: "采购组织", name: "ekorgName", width: 200, minWidth: 60, type: "string", align: "left"}, {display: "采购组织", name: "ekorgName", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "采购组", name: "ekgrpName", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "采购组", name: "ekgrpName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "公司代码", name: "burksName", width: 120, minWidth: 60, type: "string", align: "left"}, {display: "公司代码", name: "burksName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "消息类型", name: "type", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "凭证编号", name: "message", width: 200, minWidth: 60, type: "string", align: "left"},
], ],
dataAction: "server", dataAction: "server",
url: web_app.name + '/sapStockTransfers/slicedSapStockTransfersList.ajax', url: web_app.name + '/sapStockTransfers/slicedSapStockTransfersList.ajax',
...@@ -86,7 +88,7 @@ function deleteHandler() { ...@@ -86,7 +88,7 @@ function deleteHandler() {
function addHandler() { function addHandler() {
UICtrl.addTabItem({ UICtrl.addTabItem({
tabid: 'addSapStockTransfers', tabid: 'addSapStockTransfers',
text: "新增存货转移单", text: "新增公司内跨工厂存货调拨申请单",
url: web_app.name + '/sapStockTransfers/forwardSapStockTransfersDetail.job' url: web_app.name + '/sapStockTransfers/forwardSapStockTransfersDetail.job'
}); });
} }
...@@ -95,7 +97,7 @@ function addHandler() { ...@@ -95,7 +97,7 @@ function addHandler() {
function doView(id) { function doView(id) {
UICtrl.addTabItem({ UICtrl.addTabItem({
tabid: 'viewSapTransfers'+id, tabid: 'viewSapTransfers'+id,
text: "存货转移单", text: "公司内跨工厂存货调拨申请单",
url: web_app.name + '/sapStockTransfers/showStockTransfers.job?bizId='+id+"&isReadOnly=true" url: web_app.name + '/sapStockTransfers/showStockTransfers.job?bizId='+id+"&isReadOnly=true"
}); });
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div class="ui-hide"> <div class="ui-hide">
</div> </div>
<div id="layout"> <div id="layout">
<div position="center" title="存货转移申请单"> <div position="center" title="公司内跨工厂存货调拨申请单">
<x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/> <x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/>
<form class="hg-form ui-hide" method="post" action="" id="queryMainForm"> <form class="hg-form ui-hide" method="post" action="" id="queryMainForm">
<x:hidden name="templetId" value="sapFixedRetirementData"/> <x:hidden name="templetId" value="sapFixedRetirementData"/>
......
package com.huigou.topsun.sap.produceMaterialApply.application;
import com.huigou.topsun.sap.produceMaterialApply.domain.ProduceMaterialApply;
import com.huigou.topsun.sap.produceMaterialApply.domain.query.ProduceMaterialApplyQueryRequest;
import java.util.List;
import java.util.Map;
/**
* @Auther: xin.lu
* @Date: 2024/05/31/15:07
* @Description:
*/
public interface ProduceMaterialApplyApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/sap/produceMaterialApply/produceMaterialApply.xml";
String PROCESS_DEFINITION_KEY = "produceMaterialProc";
Map<String, Object> slicedProduceMaterialApplyList(ProduceMaterialApplyQueryRequest queryRequest);
void deleteByIds(List<String> ids);
ProduceMaterialApply findProduceMaterialApplyById(String id);
}
package com.huigou.topsun.sap.produceMaterialApply.application.impl;
import com.huigou.data.domain.model.CommonDomainConstants;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.sap.produceMaterialApply.application.ProduceMaterialApplyApplication;
import com.huigou.topsun.sap.produceMaterialApply.domain.query.ProduceMaterialApplyQueryRequest;
import com.huigou.topsun.sap.produceMaterialApply.repository.ProduceMaterialApplyRepository;
import com.huigou.topsun.sap.produceMaterialApply.domain.ProduceMaterialApply;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.util.ClassHelper;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import java.util.List;
import java.util.Map;
/**
* @Auther: xin.lu
* @Date: 2024/05/31/15:07
* @Description:
*/
@Service("produceMaterialApplyApplication")
public class ProduceMaterialApplyApplicationImpl extends FlowBroker implements ProduceMaterialApplyApplication {
@Autowired
private ProduceMaterialApplyRepository produceMaterialApplyRepository;
@Override
protected String saveBizAndApprovalData() {
super.saveBizAndApprovalData();
ProduceMaterialApply produceMaterialApply = getBizEntity(ProduceMaterialApply.class);
if (produceMaterialApply.isNew()) {
produceMaterialApply.setStatusId(BizBillStatus.APPLYING.getId());
} else {
produceMaterialApply = (ProduceMaterialApply) commonDomainService.loadAndFillinProperties(produceMaterialApply);
}
produceMaterialApply = produceMaterialApplyRepository.save(produceMaterialApply);
return produceMaterialApply.getId();
}
@Override
protected Map<String, Object> getProcessBizParams(String bizId) {
// 返回业务数据给流程实例,
return ClassHelper.toMap(produceMaterialApplyRepository.getOne(bizId));
}
/**
* 任务完成前执行
*/
@Override
protected void onBeforeComplete(DelegateTask delegateTask) {
super.onBeforeComplete(delegateTask);
String bizId = delegateTask.getExecution().getProcessBusinessKey();
if (this.isApplyProcUnit(delegateTask) && this.getApprovalParameter().isAdvanceProcessAction()) {// 校验及预算
updateStatus(bizId, BizBillStatus.APPROVING);
}
}
@Transactional
protected void updateStatus(String bizId, BizBillStatus status) {
Assert.hasText(bizId, CommonDomainConstants.ID_NOT_BLANK);
this.commonDomainService.updateStatus(ProduceMaterialApply.class, bizId, status.getId());
}
/**
* 流程撤销事件
**/
@Override
protected void onRecallProcessInstance(DelegateExecution delegateExecution) {
String bizId = delegateExecution.getProcessBusinessKey();
// 修改单据状态为申请
updateStatus(bizId, BizBillStatus.APPLYING);
}
/**
* 回收事件
**/
@Override
protected void onWithdraw(DelegateTask delegateTask, String destActivityId) {
super.onWithdraw(delegateTask, destActivityId);
String bizId = delegateTask.getExecution().getProcessBusinessKey();
if (destActivityId.equalsIgnoreCase("apply")) {
updateStatus(bizId, BizBillStatus.APPLYING);
}
}
@Override
protected void onEnd(DelegateExecution delegateExecution) {
super.onEnd(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
BizBillStatus status = approvePassed() ? BizBillStatus.COMPLETED : BizBillStatus.ABORTED;
ProduceMaterialApply produceMaterialApply = produceMaterialApplyRepository.findOne(bizId);
produceMaterialApply.setStatusId(status.getId());
produceMaterialApplyRepository.save(produceMaterialApply);
}
@Override
protected void onAbortProcessInstance(DelegateExecution delegateExecution) {
super.onAbortProcessInstance(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
ProduceMaterialApply produceMaterialApply = produceMaterialApplyRepository.findOne(bizId);
produceMaterialApply.setStatusId(BizBillStatus.ABORTED.getId());
produceMaterialApplyRepository.save(produceMaterialApply);
}
/**
* @param delegateTask
* @param destActivityId 回退到的目标节点id
*/
@Override
protected void onBack(DelegateTask delegateTask, String destActivityId) {
super.onBack(delegateTask, destActivityId);
if ("Apply".equalsIgnoreCase(destActivityId)) {
String bizId = delegateTask.getExecution().getProcessBusinessKey();
ProduceMaterialApply produceMaterialApply = produceMaterialApplyRepository.findOne(bizId);
produceMaterialApply.setStatusId(BizBillStatus.APPLYING.getId());
produceMaterialApplyRepository.save(produceMaterialApply);
}
}
@Override
public Map<String, Object> slicedProduceMaterialApplyList(ProduceMaterialApplyQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "produceMaterialApply");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
Map<String, Object> map = this.sqlExecutorDao.executeSlicedQuery(queryModel);
return map;
}
@Override
public void deleteByIds(List<String> ids) {
ids.forEach(id->{
produceMaterialApplyRepository.delete(id);
});
}
@Override
public ProduceMaterialApply findProduceMaterialApplyById(String id) {
return produceMaterialApplyRepository.findOne(id);
}
}
package com.huigou.topsun.sap.produceMaterialApply.controller;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.topsun.sap.produceMaterialApply.application.ProduceMaterialApplyApplication;
import com.huigou.topsun.sap.produceMaterialApply.domain.ProduceMaterialApply;
import com.huigou.topsun.sap.produceMaterialApply.domain.query.ProduceMaterialApplyQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.util.Map;
/**
* @Auther: xin.lu
* @Date: 2024/05/31/15:07
* @Description:
*/
@Controller
@ControllerMapping("/produceMaterialApply")
public class ProduceMaterialApplyController extends CommonController {
@Override
protected String getPagePath() {
return "/biz/topsun/sap/produceMaterialApply/";
}
@Resource
private ProduceMaterialApplyApplication produceMaterialApplyApplication;
public String forwardProduceMaterialApplyList(){
return forward("produceMaterialApplyList");
}
public String slicedProduceMaterialApplyList(){
SDO sdo = this.getSDO();
ProduceMaterialApplyQueryRequest queryRequest = sdo.toQueryRequest(ProduceMaterialApplyQueryRequest.class);
Map<String, Object> map = produceMaterialApplyApplication.slicedProduceMaterialApplyList(queryRequest);
return toResult(map);
}
public String forwardProduceMaterialApplyDetail(){
this.putAttribute("processDefinitionKey", ProduceMaterialApplyApplication.PROCESS_DEFINITION_KEY);
// 新增的时候procUnitId一定要设置成Apply,不然jsp页面的所有表单元素是readonly状态
this.putAttribute("procUnitId", "Apply");
ProduceMaterialApply produceMaterialApply = new ProduceMaterialApply();
produceMaterialApply.setStatusId(BizBillStatus.APPLYING.getId());
/**
* 设置jsp页面初始化填充数据,如果不设置, 那么在jsp页面上填写完表单之后立即提交申请TaskDescription获取不到时间和相关人员信息
*/
Operator operator = getOperator();
produceMaterialApply.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
return forward("produceMaterialApplyDetail",produceMaterialApply);
}
public String showProduceMaterialApplyDetail(){
SDO sdo = this.getSDO();
String id = sdo.getBizId();
ProduceMaterialApply produceMaterialApply = produceMaterialApplyApplication.findProduceMaterialApplyById(id);
return forward("produceMaterialApplyDetail",produceMaterialApply);
}
}
package com.huigou.topsun.sap.produceMaterialApply.domain;
import com.huigou.data.domain.model.FlowBillAbstractEntity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Auther: xin.lu
* @Date: 2024/05/31/15:02
* @Description: 《生产类货源开发申请表》
*/
@Entity
@Data
@Table(name = "sap_produce_material_apply")
public class ProduceMaterialApply extends FlowBillAbstractEntity {
/**
* 用途
*/
@Column(name = "purpose")
private String purpose;
/**
* 原由
*/
@Column(name = "reason")
private String reason;
/**
* 需求描述
*/
@Column(name = "require_des")
private String requireDes;
@Override
protected String getCodeRuleId() {
return "produceMaterialApply";
}
}
package com.huigou.topsun.sap.produceMaterialApply.domain.query;
import com.huigou.data.domain.query.QueryAbstractRequest;
import lombok.Data;
/**
* @Auther: xin.lu
* @Date: 2024/05/31/15:09
* @Description:
*/
@Data
public class ProduceMaterialApplyQueryRequest extends QueryAbstractRequest {
private String billCode;
}
package com.huigou.topsun.sap.produceMaterialApply.repository;
import com.huigou.topsun.sap.produceMaterialApply.domain.ProduceMaterialApply;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* @Auther: xin.lu
* @Date: 2024/05/31/15:07
* @Description:
*/
public interface ProduceMaterialApplyRepository extends JpaRepository<ProduceMaterialApply,String> {
}
...@@ -130,7 +130,7 @@ public class SapStockTransfersApplicationImpl extends FlowBroker implements SapS ...@@ -130,7 +130,7 @@ public class SapStockTransfersApplicationImpl extends FlowBroker implements SapS
SapStockTransfersVO sapStockTransfersVO=new SapStockTransfersVO(); SapStockTransfersVO sapStockTransfersVO=new SapStockTransfersVO();
BeanUtil.copyProperties(stockTransfers, sapStockTransfersVO); BeanUtil.copyProperties(stockTransfers, sapStockTransfersVO);
List <SapStockTransfersItemVO> newItemList=new ArrayList<>(); List <SapStockTransfersItemVO> newItemList=new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
for (SapStockTransfersItem item:itemList){ for (SapStockTransfersItem item:itemList){
SapStockTransfersItemVO sapStockTransfersItemVO=new SapStockTransfersItemVO(); SapStockTransfersItemVO sapStockTransfersItemVO=new SapStockTransfersItemVO();
BeanUtil.copyProperties(item, sapStockTransfersItemVO); BeanUtil.copyProperties(item, sapStockTransfersItemVO);
...@@ -217,10 +217,13 @@ public class SapStockTransfersApplicationImpl extends FlowBroker implements SapS ...@@ -217,10 +217,13 @@ public class SapStockTransfersApplicationImpl extends FlowBroker implements SapS
SapResult sapResult = sapResultList.get(0); SapResult sapResult = sapResultList.get(0);
resultMap.put("sequence", resultMap.get("row")); resultMap.put("sequence", resultMap.get("row"));
if ("S".equals(sapResult.getTYPE())) { if ("S".equals(sapResult.getTYPE())) {
// suppliersInfo.setPartner(sapResult.getMESSAGE_V1()); SapStockTransfers sapStockTransfers = this.getStockTransfersById(id);
// suppliersInfo.setPartner(sapResult.getMESSAGE_V1());
resultMap.put("type", sapResult.getTYPE()); resultMap.put("type", sapResult.getTYPE());
resultMap.put("MESSAGE", sapResult.getMESSAGE()); resultMap.put("MESSAGE", sapResult.getMESSAGE());
// suppliersInfoRepository.save(suppliersInfo); sapStockTransfers.setType(sapResult.getTYPE());
sapStockTransfers.setMessage(sapResult.getMESSAGE_V1());
sapStockTransfersRepository.save(sapStockTransfers);
} else { } else {
throw new RuntimeException("数据传输失败,请稍后手动重试!" + sapResult.getMESSAGE()); throw new RuntimeException("数据传输失败,请稍后手动重试!" + sapResult.getMESSAGE());
} }
......
...@@ -70,6 +70,12 @@ public class SapStockTransfers extends FlowBillAbstractEntity { ...@@ -70,6 +70,12 @@ public class SapStockTransfers extends FlowBillAbstractEntity {
@Column(name = "werks_name") @Column(name = "werks_name")
private String werksName; private String werksName;
@Column(name = "type")
private String type;
@Column(name = "message")
private String message;
@Override @Override
protected String getCodeRuleId() { protected String getCodeRuleId() {
return "sapStockTransfers"; return "sapStockTransfers";
......
...@@ -3,8 +3,6 @@ package com.huigou.topsun.sap.transfers.domain.vo; ...@@ -3,8 +3,6 @@ package com.huigou.topsun.sap.transfers.domain.vo;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import javax.persistence.Column;
import java.util.Date;
@Data @Data
public class SapStockTransfersItemVO { public class SapStockTransfersItemVO {
...@@ -18,30 +16,30 @@ public class SapStockTransfersItemVO { ...@@ -18,30 +16,30 @@ public class SapStockTransfersItemVO {
private String epstp; private String epstp;
//物料编码 //物料编码
@Column(name = "MATNR") @JsonProperty("MATNR")
private String matnr; private String matnr;
//数量 //数量
@Column(name = "MENGE") @JsonProperty("MENGE")
private Integer menge; private Integer menge;
//基本计量单位 //基本计量单位
@Column(name = "MEINS") @JsonProperty("MEINS")
private String meins; private String meins;
/** /**
* 交货日期 * 交货日期
*/ */
@Column(name = "EEIND") @JsonProperty("EEIND")
private String eeind; private String eeind;
//存储地点 //存储地点
@Column(name = "LOGORT") @JsonProperty("LOGORT")
private String lgort; private String lgort;
//工厂 //工厂
@Column(name = "WERKS") @JsonProperty("WERKS")
private String werks; private String werks;
......
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="produceMaterialProc" name="生产类货源开发申请" isExecutable="true">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="#{produceMaterialApplyApplication}"></activiti:executionListener>
<activiti:executionListener event="end" delegateExpression="#{produceMaterialApplyApplication}"></activiti:executionListener>
</extensionElements>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="Apply" name="生产类货源开发申请" activiti:formKey="produceMaterialApply/showProduceMaterialApplyDetail.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{produceMaterialApplyApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{produceMaterialApplyApplication}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="Approve" name="生产类货源开发审批" activiti:assignee="${assignee} " activiti:formKey="produceMaterialApply/showProduceMaterialApplyDetail.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{produceMaterialApplyApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{produceMaterialApplyApplication}"></activiti:taskListener>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="handlerList" activiti:elementVariable="assignee">
<completionCondition>${chiefApprovePassed}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="Apply"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="Apply" targetRef="Approve"></sequenceFlow>
<exclusiveGateway id="ApproveFinished" name="审批结束"></exclusiveGateway>
<sequenceFlow id="flow3" name="审批通过" sourceRef="ApprovePassed" targetRef="ApproveFinished">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${approvePassed}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow4" name="审批结束" sourceRef="ApproveFinished" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${approveFinished}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow5" name="审批未结束" sourceRef="ApproveFinished" targetRef="Approve">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approveFinished}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="ApprovePassed" name="审批通过"></exclusiveGateway>
<sequenceFlow id="flow6" sourceRef="Approve" targetRef="ApprovePassed"></sequenceFlow>
<sequenceFlow id="flow9" name="审批未通过" sourceRef="ApprovePassed" targetRef="Apply">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approvePassed}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_produceMaterialProc">
<bpmndi:BPMNPlane bpmnElement="produceMaterialProc" id="BPMNPlane_produceMaterialProc">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="355.0" y="50.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="355.0" y="550.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Apply" id="BPMNShape_Apply">
<omgdc:Bounds height="55.0" width="161.0" x="292.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Approve" id="BPMNShape_Approve">
<omgdc:Bounds height="55.0" width="161.0" x="292.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ApproveFinished" id="BPMNShape_ApproveFinished">
<omgdc:Bounds height="40.0" width="40.0" x="352.0" y="440.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ApprovePassed" id="BPMNShape_ApprovePassed">
<omgdc:Bounds height="40.0" width="40.0" x="352.0" y="349.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="372.0" y="85.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="140.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="372.0" y="195.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="240.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="372.0" y="389.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="440.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="320.0" y="396.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="372.0" y="480.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="550.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="382.0" y="489.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="392.0" y="460.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="459.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="317.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="267.0"></omgdi:waypoint>
<omgdi:waypoint x="489.0" y="267.0"></omgdi:waypoint>
<omgdi:waypoint x="453.0" y="267.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="60.0" x="459.0" y="411.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="372.0" y="295.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="349.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="352.0" y="369.0"></omgdi:waypoint>
<omgdi:waypoint x="231.0" y="369.0"></omgdi:waypoint>
<omgdi:waypoint x="231.0" y="167.0"></omgdi:waypoint>
<omgdi:waypoint x="292.0" y="167.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="60.0" x="257.0" y="376.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<query-mappings>
<query name="produceMaterialApply" label="生产类货源开发申请表" table="sap_produce_material_apply">
<sql-query>
select
t.*
from sap_produce_material_apply t where 1=1
</sql-query>
<condition column="bill_code" name="billCode" type="java.lang.String" symbol="like" alias="t"/>
</query>
</query-mappings>
\ No newline at end of file
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