Commit 976ee3d8 authored by wanghang's avatar wanghang

打样申请流程

parent ca8b7ff2
<%@ 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"%>
<form class="hg-form" method="post" action="" id="submitDetailForm">
<x:hidden name="id" />
<div class="hg-form-row">
<x:inputC name="materialName" required="true" label="物料" labelCol="3" maxLength="64" fieldCol="9" />
</div>
<div class="hg-form-row">
<x:inputC name="materialNumber" required="true" label="物料数量" labelCol="3" maxLength="32" fieldCol="9" />
</div>
<div class="hg-form-row">
<x:inputC name="productName" required="true" label="产品" labelCol="3" maxLength="32" fieldCol="9" />
</div>
</form>
\ No newline at end of file
var gridManager = null, refreshFlag = false,istoolbar=true;
//定义控件列
const bom=
[
{ display: "物料", name: "materialName", width: 140, minWidth: 60, type: "string", align: "left" },
{ display: "物料数量", name: "materialNumber", width: 120, minWidth: 60, type: "string", align: "left" },
{ display: "产品", name: "productId", width: 120, minWidth: 60, type: "string", align: "left" }
]
const technology=[
{ display: "工艺", name: "materialId", width: 140, minWidth: 60, type: "string", align: "left", hidden: true }
]
const process=[
{ display: "工序内容", name: "materialId", width: 140, minWidth: 60, type: "string", align: "left", hidden: true },
{ display: "工序名称", name: "materialName", width: 140, minWidth: 60, type: "string", align: "left" },
{ display: "工序说明", name: "materialNumber", width: 120, minWidth: 60, type: "string", align: "left" },
{ display: "工序类别", name: "materialNumber", width: 120, minWidth: 60, type: "string", align: "left" },
{ display: "工时", name: "productName", width: 120, minWidth: 60, type: "string", align: "left" }
]
const processBom=[
{ display: "物料", name: "materialId", width: 140, minWidth: 60, type: "string", align: "left", hidden: true },
{ display: "SAP物料详细信息", name: "materialName", width: 140, minWidth: 60, type: "string", align: "left" },
{ display: "使用的物料数量", name: "materialNumber", width: 120, minWidth: 60, type: "string", align: "left" },
{ display: "物料计量单位", name: "productName", width: 120, minWidth: 60, type: "string", align: "left" }
]
$(document).ready(function() {
initializateUI();
loadOrgTreeView();
bindQueryEvent();
loadProofingApplyGrid(null,bom,"mobTableGrid","forwardProofingApply");//加载BOm
loadProofingApplyGrid(null,technology,"technologyGrid","forwardProofingApply");//加载工艺
loadProofingApplyGrid(null,process,"processGrid","forwardProofingApply");//加载工序
loadProofingApplyGrid(null,processBom,"processBomGrid","forwardProofingApply");//加载物料
});
//工艺、工序、工序物料三级联动
function test(){
}
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
//创建表格(参数、列、插入的节点、请求地址)
function loadProofingApplyGrid(param,columns,node,url) {
const toolbarOptions = istoolbar
? UICtrl.getDefaultToolbarOptions({
addHandler: addHandler,
updateHandler() {
updateHandler();
},
deleteHandler: deleteHandler,
})
: null;
istoolbar = false;
gridManager = UICtrl.grid("#"+node, {
columns: columns,
dataAction: "server",
url: web_app.name + '/proofingApply/'+url+'.ajax',
parms:param,
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
width: "100%",
height: "100%",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
//双击行响应事件
onDblClickRow : function(data, rowindex, rowobj) {
updateHandler(data.id);
}
});
UICtrl.setSearchAreaToggle(gridManager);
}
function loadOrgTreeView() {
//ssrfOrgRootId hxPurchaseCommon.js
$('#orgTree').commonTree({
loadTreesAction:'org/queryOrgs.ajax',
parentId :ssrfOrgRootId,
getParam : function(e){
return {showDisabledOrg:0,displayableOrgKinds : "ogn,dpt"};
},
changeNodeIcon:function(data){
data[this.options.iconFieldName]= OpmUtil.getOrgImgUrl(data.orgKindId, data.status);
},
IsShowMenu:false,
onClick :onFolderTreeNodeClick
});
}
function onFolderTreeNodeClick(data) {
var html=[];
html.push('<span class="tomato-color">[',data.name,']</span>','编号规则管理');
$('#layout').layout('setCenterTitle',html.join(''));
$('#treefullId').val(data.fullId);
if (gridManager) {
UICtrl.gridSearch(gridManager,{fullId:data.fullId});
}
}
//绑定selectC
function bindQueryEvent(){
//
// $('#productId').searchbox({
// type : "product",name : "productCode",
// onChange:function(value,data){
// console.log("@"+data.productId)
// $('#productId').val(data.productId);
//
// console.log($('#productId').val())
//
// }
// });
$('#productId').searchbox({
type : "product",name : "productCode",
onChange:function(value,data){
$('#productId').val(data.productId);
console.log($('#productId').val())
// loadProofingApplyGrid({id:data.productId},bom,"mobTableGrid","forwardProofingApply");
}
});
$('#productType').searchbox({
type : "product",name : "productType",
onChange:function(value,data){
$('#productType').val(data.productCategoryId);
console.log($('#productType').val())
}
});
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function reloadGrid() {
gridManager.loadData();
}
function resetForm(obj) {
$(obj).formClean();
}
function updateHandler(id){
if(!id){
var id = DataUtil.getUpdateRowId(gridManager);
if (!id){ return; }
}
UICtrl.showAjaxDialog({
url: web_app.name + '/codeRule/showLoadCodeRule.load',
title: "修改BOM",
width: 340,
param:{id:id},
ok: function(div){
var _self=this;
$('#submitForm',div).ajaxSubmit({url: web_app.name + '/codeRule/updateCodeRule.ajax',
success : function() {
_self.close();
reloadGrid();
}
});
}
});
}
// 查询
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
//刷新表格
function reloadGrid() {
gridManager.loadData();
}
//重置表单
function resetForm(obj) {
$(obj).formClean();
}
//关闭对话框
function dialogClose(){
if(refreshFlag){
reloadGrid();
refreshFlag=false;
}
}
//添加按钮
function addHandler() {
// var resourceTypeId=$('#resourceTypeId').val();
// if (Public.isBlank(resourceTypeId)) {
// Public.tip('请选择资源!');
// return;
// }
UICtrl.showAjaxDialog({
title: $.i18nProp('添加BOM'),
url : web_app.name + '/proofingApply/forwardAddBom.load',
//init:initDetailDialog,
// param:{resourceTypeId:resourceTypeId},
ok : insert,
width : 600,
close : dialogClose
});
}
//新增保存
function insert() {
var _self=this;
$('#submitDetailForm').ajaxSubmit({
url : web_app.name + '/resourceField/saveResourceFiledValue.ajax',
param:{},
success : function(data) {
if (data == "1"){
Public.successTip("保存成功!");
}
_self.close();
reloadGrid();
}
});
}
//编辑按钮
function updateHandler(id) {
if (!id) {
//获取所选行id
id = DataUtil.getUpdateRowId(gridManager);
if (!id) {
return;
}
}
UICtrl.showAjaxDialog({
title: $.i18nProp('更新Bom'),
width: 600,
url: web_app.name + '/proofingApply/forwardAddBom.load',
param: {id: id,resourceTypeId: $('#resourceTypeId').val()},
ok: update,
close:dialogClose
});
}
//编辑保存
function update() {
var _self=this;
$('#submitDetailForm').ajaxSubmit({
url : web_app.name + '/proofingApply/updateResourceFiledValue.ajax',
success : function(data) {
if (data == "1"){
Public.successTip("修改成功!");
}
refreshFlag = true;
_self.close();
reloadGrid();
}
});
}
//删除按钮
function deleteHandler() {
DataUtil.del({
action: 'resourceField/deleteResourceFiledValue.ajax',
param:{
id:DataUtil.getUpdateRowId(gridManager),
resourceTypeId: $('#resourceTypeId').val()
},
gridManager: gridManager, idFieldName: 'id',
onSuccess: function (data) {
if (data == "1"){
Public.successTip("删除成功!");
}
reloadGrid();
}
});
}
//值改变刷新BOM
// function productIdSelectChange(){
// console.log("jiaz")
// $('#productCode_text').on('change', function() {
// // 获取输入框的当前值
// var currentValue = $(this).val();
// console.log("change触发")
// // 打印到控制台
// console.log('Input value changed:', currentValue);
// });
// // $("#productCode_text").change(function () {
// // console.log("change触发")
// // loadCodeRuleListGrid(this.productId);
// // });
// }
\ No newline at end of file
<%@ 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"%>
<x:base include="grid,date" />
<x:script src='/system/opm/js/OpmUtil.js'/>
<x:script src='/biz/topsun/common/purchaseCommon.js'/>
<x:script src='/biz/topsun/proofing/proofingApply.js'/>
<div class="container-fluid" style="padding: 10px;">
<form class="hg-form" method="post" action="" id="submitForm">
<%-- <x:hidden name="id" />--%>
<div><h3>基本信息</h3></div>
<div class="hg-form-cols">
<x:inputC name="proofingApplyNo" required="true" readonly="true" label="申请单号" maxLength="32" labelCol="1" fieldCol="2"/>
<%-- <x:selectC name="productCode" required="true" label="产品编号" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="productId" required="true" label="产品编号" labelCol="1" fieldCol="2"/>
<x:inputC name="customerId" required="true" label="品牌客户编号" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplyPageNeedTime" required="true" label="版面需求时间" wrapper="date" labelCol="1" fieldCol="2"/>
<%-- <x:inputC name="completeDate" required="true" label="完成日期" maxLength="32" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="proofingApplyCompleteDate" id="completeDate" required="false" label="完成日期" wrapper="date" labelCol="1" />
<x:inputC name="proofingApplySampleCnName" required="true" label="样品中文名称" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplySampleEnName" required="true" label="样品英文名称" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplySampleVersion" required="true" label="样品版次" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplySampleSize" required="true" label="样品规格" maxLength="32" labelCol="1" fieldCol="2"/>
<%-- <x:inputC name="sampleStyle" required="true" label="样品款式" maxLength="32" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="proofingApplySampleNum" required="true" label="样品数量" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplyOutputSituation" required="true" label="产量情况" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplyProductNo" required="true" label="产品代号" maxLength="32" labelCol="1" fieldCol="2"/>
<%-- <x:selectC name="proofingType" required="true" label="打样形式" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="proofingType" required="true" label="打样形式" labelCol="1" fieldCol="2"/>
<x:inputC name="page" required="true" label="版面" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplyAllocationType" required="true" label="分配方式" maxLength="32" labelCol="1" fieldCol="2"/>
<%-- <x:selectC name="allocationType" required="true" label="分配方式" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="productType" required="true" label="产品类别" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplySurfaceTreatment" required="true" label="表面处理" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplyNgReReason" required="true" label="NG重新打样原因" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="a" required="true" label="测试标准" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="proofingApplyTestStandard" required="true" label="申请单状态" maxLength="32" labelCol="1" fieldCol="2"/>
</div>
<div><h3>样品外观要求</h3></div>
<div class="hg-form-cols" >
<x:selectC name="isOutput" required="false" label="是否量产" dictionary="yesorno" labelCol="1" fieldCol="2"/>
<x:selectC name="isOut" required="false" label="是否外发" dictionary="yesorno" labelCol="1" fieldCol="2"/>
<x:selectC name="isChange" required="false" label="是否改变" dictionary="yesorno" labelCol="1" fieldCol="2"/>
<x:inputC name="plasticBagType" required="false" label="塑料袋结构类型" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="length" required="false" label="长度(cm)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="width" required="false" label="宽度(cm)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="height" required="false" label="高度(cm)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="thickness" required="false" label="厚度(mm)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="layerNum" required="false" label="单层厚(丝)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationStatus" required="false" label="层数" maxLength="32" labelCol="1" fieldCol="2"/>
</div>
</form>
<div><h3>BOM设置</h3></div>
<div id="mobTableGrid" style="margin: 2px;"></div>
<hr>
<div><h3>工艺设置</h3></div>
<div><h4>工艺</h4></div>
<div id="technologyGrid" style="margin: 2px;"></div>
<div><h4>工序</h4></div>
<div id="processGrid" style="margin: 2px;"></div>
<div><h4>工序物料</h4></div>
<div id="processBomGrid" style="margin: 2px;"></div>
</div>
<%@ 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"%>
<x:script src='/system/opm/js/OpmUtil.js'/>
<x:script src='/biz/topsun/common/purchaseCommon.js'/>
<x:script src='/biz/topsun/sample/proofingApply.js'/>
<div class="container-fluid" style="padding: 10px;">
<form class="hg-form" method="post" action="" id="submitForm">
<%-- <x:hidden name="id" />--%>
<div><h3>基本信息</h3></div>
<div class="hg-form-cols">
<x:inputC name="applicationNo" required="true" readonly="true" label="制作单号" maxLength="32" labelCol="1" fieldCol="2"/>
<x:selectC name="productCode" required="true" label="申请单号" labelCol="1" fieldCol="2"/>
<x:inputC name="customerCode" required="true" label="产品编号" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="pageNeedTime" required="true" label="品牌客户编号" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="completeDate" required="true" label="版面需求时间" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="completeDate" label="完成日期" required="true" labelCol="1" fieldCol="2" wrapper="date"/>
<x:inputC name="sampleCnName" required="true" label="样品中文名称" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="sampleEnName" required="true" label="样品英文名称" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="sampleVersion" required="true" label="样品版次" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="sampleSize" required="true" label="样品规格" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="sampleStyle" required="true" label="样品款式" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="sampleNum" required="true" label="样品数量" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="outputSituation" required="true" label="产量情况" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="productNo" required="true" label="产品代号" maxLength="32" labelCol="1" fieldCol="2"/>
<x:selectC name="proofingType" required="true" label="打样形式" labelCol="1" fieldCol="2"/>
<x:inputC name="page" required="true" label="版面" maxLength="32" labelCol="1" fieldCol="2"/>
<%-- <x:inputC name="allocationType" required="true" label="分配方式" maxLength="32" labelCol="1" fieldCol="2"/>--%>
<x:selectC name="allocationType" required="true" label="分配方式" labelCol="1" fieldCol="2"/>
<x:selectC name="productType" required="true" label="产品类别" labelCol="1" fieldCol="2"/>
<x:inputC name="surfaceTreatment" required="true" label="表面处理" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="ngReReason" required="true" label="NG重新打样原因" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationNo" required="true" label="测试标准" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationStatus" required="true" label="申请单状态" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationStatus" required="true" label="颜色种类" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationStatus" required="true" label="专" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationStatus" required="true" label="网版目数" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationStatus" required="true" label="啤版目数" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationStatus" required="true" label="模切板模数" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationStatus" required="true" label="标准色号" maxLength="32" labelCol="1" fieldCol="2"/>
</div>
<div><h3>样品外观要求</h3></div>
<div class="hg-form-cols" >
<x:inputC name="isOutput" required="true" label="是否量产" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="isOut" required="true" label="是否外发" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="isChange" required="true" label="是否改变" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="plasticBagType" required="true" label="塑料袋结构类型" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="length" required="true" label="长度(cm)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="width" required="true" label="宽度(cm)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="height" required="true" label="高度(cm)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="thickness" required="true" label="厚度(mm)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="layerNum" required="true" label="单层厚(丝)" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="applicationStatus" required="true" label="层数" maxLength="32" labelCol="1" fieldCol="2"/>
</div>
</form>
<div><h3>BOM设置</h3></div>
<div id="mobTableGrid" style="margin: 2px;"></div>
<hr>
<%-- <div><h3>工艺设置</h3></div>--%>
<%-- <div><h4>工艺</h4></div>--%>
<%-- <div id="technologyGrid" style="margin: 2px;"></div>--%>
<%-- <div><h4>工序</h4></div>--%>
<%-- <div id="processGrid" style="margin: 2px;"></div>--%>
<%-- <div><h4>工序物料</h4></div>--%>
<%-- <div id="processBomGrid" style="margin: 2px;"></div>--%>
</div>
package com.huigou.topsun.proofing.application;
import com.huigou.topsun.proofing.domain.model.ProofingApply;
import com.huigou.topsun.proofing.domain.query.ProofingApplyQuery;
import java.util.Map;
public interface ProofingApplyApplication {
String PROCESS_DEFINITION_KEY = "proofingProc";
ProofingApply loadProofingApplyById(String id);
Map<String, Object> slicedQuery(ProofingApplyQuery query);
}
package com.huigou.topsun.proofing.application.impl;
import com.huigou.topsun.proofing.application.ProofingApplyApplication;
import com.huigou.topsun.proofing.domain.model.ProofingApply;
import com.huigou.topsun.proofing.domain.query.ProofingApplyQuery;
import com.huigou.topsun.proofing.mapper.ProofingApplyMapper;
import com.huigou.topsun.proofing.repository.ProofingApplyRepository;
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 java.util.Map;
import java.util.UUID;
/**
* @author yonghuan
*/
@Service("proofingApplyApplication")
public class ProofingApplyApplicationImpl extends FlowBroker implements ProofingApplyApplication {
private ProofingApplyRepository proofingApplyRepository;
private ProofingApplyMapper proofingApplyMapper;
@Autowired
public void setProofingApplyRepository(ProofingApplyRepository proofingApplyRepository) {
this.proofingApplyRepository = proofingApplyRepository;
}
@Autowired
public void setProofingApplyMapper(ProofingApplyMapper proofingApplyMapper) {
this.proofingApplyMapper = proofingApplyMapper;
}
@Override
public ProofingApply loadProofingApplyById(String id) {
return proofingApplyRepository.findOne(id);
}
@Override
public Map<String, Object> slicedQuery(ProofingApplyQuery query) {
return proofingApplyMapper.slicedQuery(query);
}
@Override
protected String saveBizAndApprovalData() {
super.saveBizAndApprovalData();
ProofingApply proofingApply = getBizEntity(ProofingApply.class);
if (proofingApply.isNew()) {
proofingApply.setStatusId(BizBillStatus.APPLYING.getId());
} else {
proofingApply = (ProofingApply) commonDomainService.loadAndFillinProperties(proofingApply);
}
String id= UUID.randomUUID().toString().replace("-", "");
proofingApply.setProofingApplyId(id);
proofingApply = proofingApplyRepository.save(proofingApply);
return proofingApply.getId();
}
@Override
protected Map<String, Object> getProcessBizParams(String bizId) {
// 返回业务数据给流程实例,
return ClassHelper.toMap(proofingApplyRepository.getOne(bizId));
}
@Override
protected void onEnd(DelegateExecution delegateExecution) {
super.onEnd(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
BizBillStatus status = approvePassed() ? BizBillStatus.COMPLETED : BizBillStatus.ABORTED;
ProofingApply proofingApply = proofingApplyRepository.findOne(bizId);
proofingApply.setStatusId(status.getId());
proofingApplyRepository.save(proofingApply);
}
@Override
protected void onAbortProcessInstance(DelegateExecution delegateExecution) {
super.onAbortProcessInstance(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
ProofingApply proofingApply = proofingApplyRepository.findOne(bizId);
proofingApply.setStatusId(BizBillStatus.ABORTED.getId());
proofingApplyRepository.save(proofingApply);
}
/**
* @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();
ProofingApply proofingApply = proofingApplyRepository.findOne(bizId);
proofingApply.setStatusId(BizBillStatus.APPLYING.getId());
proofingApplyRepository.save(proofingApply);
}
}
}
package com.huigou.topsun.proofing.controller;
import com.huigou.topsun.proofing.application.ProofingApplyApplication;
import com.huigou.topsun.proofing.domain.model.ProofingApply;
import com.huigou.topsun.proofing.domain.vo.BomVo;
import com.huigou.topsun.proofing.service.BomService;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController;
import com.huigou.uasp.log.annotation.LogInfo;
import com.huigou.uasp.log.domain.model.LogType;
import com.huigou.uasp.log.domain.model.OperationType;
import com.huigou.util.SDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@ControllerMapping("/proofingApply")
public class ProofingApplyController extends CommonController {
protected String getPagePath() {
return "/biz/topsun/proofing/";
}
@Autowired
private BomService bomService;
@Autowired
ProofingApplyApplication proofingApplyApplication;
/**
* 打样表单页
* @return
*/
public String forwardProofingApply(){
this.putAttribute("processDefinitionKey",proofingApplyApplication .PROCESS_DEFINITION_KEY);
String applicationNo="测试单号";
this.putAttribute("procUnitId", "Apply");
this.putAttribute("proofingApplyNo",applicationNo);
return forward("proofingApply");
}
public String forwardAddBom(){
//如果有id的话就带参数过去
SDO sdo = this.getSDO();
String id = sdo.getId();
List<BomVo> bom = bomService.getBomVoByProductId(id);
return forward("BomDetail",bom);
}
public String addProofingApply(){
SDO sdo = this.getSDO();
// ResourceTypeVo resourceTypeVo = sdo.toObject(ResourceTypeVo.class);
// sampleService.getProductNoList();
return toResult(1);
}
@LogInfo(logType = LogType.BIZ, subType = "", operaionType = OperationType.QUERY, description = "分页查询BOM表")
public String slicedQueryBomRule() {
SDO sdo = this.getSDO();
String id = sdo.getId();
List<BomVo> bom = bomService.getBomVoByProductId(id);
Map<String,Object> map =new HashMap();
map.put("Rows",bom);
return toResult(map);
}
public String updateResourceFiledValue(){
SDO sdo = this.getSDO();
Map<String, Object> map = sdo.getProperties();
return toResult(null);
}
/**
* 跳转到打样申请详情页面
*/
public String showProofingApply() {
SDO sdo = this.getSDO();
String id = sdo.getBizId();
ProofingApply proofingApply = proofingApplyApplication.loadProofingApplyById(id);
return forward("proofingApply", proofingApply);
}
}
package com.huigou.topsun.proofing.domain.model;
import com.huigou.data.domain.model.FlowBillAbstractEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 打样申请单表
* @TableName proofing_apply
*/
@Table(name ="proofing_apply")
@Entity
public class ProofingApply extends FlowBillAbstractEntity {
/**
* 申请单id
*/
@Column(name = "proofing_apply_id")
private String proofingApplyId;
/**
* 申请单号
*/
@Column(name = "proofing_apply_no")
private String proofingApplyNo;
/**
* 产品id
*/
@Column(name = "product_id")
private String productId;
/**
* 客户id
*/
@Column(name = "customer_id")
private String customerId;
/**
* 版面需求时间
*/
@Column(name = "proofing_apply_page_need_time")
private Date proofingApplyPageNeedTime;
/**
* 完成日期
*/
@Column(name = "proofing_apply_complete_date")
private Date proofingApplyCompleteDate;
/**
* 样品中文名称
*/
@Column(name = "proofing_apply_sample_cn_name")
private String proofingApplySampleCnName;
/**
* 样品英文名称
*/
@Column(name = "proofing_apply_sample_en_name")
private String proofingApplySampleEnName;
/**
* 样品版次
*/
@Column(name = "proofing_apply_sample_version")
private Integer proofingApplySampleVersion;
/**
* 样品规格
*/
@Column(name = "proofing_apply_sample_size")
private Integer proofingApplySampleSize;
/**
* 样品数量
*/
@Column(name = "proofing_apply_sample_num")
private Long proofingApplySampleNum;
/**
* 产量情况
*/
@Column(name = "proofing_apply_output_situation")
private String proofingApplyOutputSituation;
/**
* 产品代号
*/
@Column(name = "proofing_apply_product_no")
private String proofingApplyProductNo;
/**
* 打样形式
*/
@Column(name = "proofing_type")
private String proofingType;
/**
* 分配方式
*/
@Column(name = "proofing_apply_allocation_type")
private String proofingApplyAllocationType;
/**
* 表面处理
*/
@Column(name = "proofing_apply_surface_treatment")
private String proofingApplySurfaceTreatment;
/**
* NG重新打样原因
*/
@Column(name = "proofing_apply_ng_re_reason")
private String proofingApplyNgReReason;
/**
* 申请单状态
*/
@Column(name = "proofing_apply_application_status")
private String proofingApplyApplicationStatus;
/**
* 测试标准
*/
@Column(name = "proofing_apply_test_standard")
private String proofingApplyTestStandard;
public String getProofingApplyId() {
return proofingApplyId;
}
public void setProofingApplyId(String proofingApplyId) {
this.proofingApplyId = proofingApplyId;
}
public String getProofingApplyNo() {
return proofingApplyNo;
}
public void setProofingApplyNo(String proofingApplyNo) {
this.proofingApplyNo = proofingApplyNo;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public Date getProofingApplyPageNeedTime() {
return proofingApplyPageNeedTime;
}
public void setProofingApplyPageNeedTime(Date proofingApplyPageNeedTime) {
this.proofingApplyPageNeedTime = proofingApplyPageNeedTime;
}
public Date getProofingApplyCompleteDate() {
return proofingApplyCompleteDate;
}
public void setProofingApplyCompleteDate(Date proofingApplyCompleteDate) {
this.proofingApplyCompleteDate = proofingApplyCompleteDate;
}
public String getProofingApplySampleCnName() {
return proofingApplySampleCnName;
}
public void setProofingApplySampleCnName(String proofingApplySampleCnName) {
this.proofingApplySampleCnName = proofingApplySampleCnName;
}
public String getProofingApplySampleEnName() {
return proofingApplySampleEnName;
}
public void setProofingApplySampleEnName(String proofingApplySampleEnName) {
this.proofingApplySampleEnName = proofingApplySampleEnName;
}
public Integer getProofingApplySampleVersion() {
return proofingApplySampleVersion;
}
public void setProofingApplySampleVersion(Integer proofingApplySampleVersion) {
this.proofingApplySampleVersion = proofingApplySampleVersion;
}
public Integer getProofingApplySampleSize() {
return proofingApplySampleSize;
}
public void setProofingApplySampleSize(Integer proofingApplySampleSize) {
this.proofingApplySampleSize = proofingApplySampleSize;
}
public Long getProofingApplySampleNum() {
return proofingApplySampleNum;
}
public void setProofingApplySampleNum(Long proofingApplySampleNum) {
this.proofingApplySampleNum = proofingApplySampleNum;
}
public String getProofingApplyOutputSituation() {
return proofingApplyOutputSituation;
}
public void setProofingApplyOutputSituation(String proofingApplyOutputSituation) {
this.proofingApplyOutputSituation = proofingApplyOutputSituation;
}
public String getProofingApplyProductNo() {
return proofingApplyProductNo;
}
public void setProofingApplyProductNo(String proofingApplyProductNo) {
this.proofingApplyProductNo = proofingApplyProductNo;
}
public String getProofingType() {
return proofingType;
}
public void setProofingType(String proofingType) {
this.proofingType = proofingType;
}
public String getProofingApplyAllocationType() {
return proofingApplyAllocationType;
}
public void setProofingApplyAllocationType(String proofingApplyAllocationType) {
this.proofingApplyAllocationType = proofingApplyAllocationType;
}
public String getProofingApplySurfaceTreatment() {
return proofingApplySurfaceTreatment;
}
public void setProofingApplySurfaceTreatment(String proofingApplySurfaceTreatment) {
this.proofingApplySurfaceTreatment = proofingApplySurfaceTreatment;
}
public String getProofingApplyNgReReason() {
return proofingApplyNgReReason;
}
public void setProofingApplyNgReReason(String proofingApplyNgReReason) {
this.proofingApplyNgReReason = proofingApplyNgReReason;
}
public String getProofingApplyApplicationStatus() {
return proofingApplyApplicationStatus;
}
public void setProofingApplyApplicationStatus(String proofingApplyApplicationStatus) {
this.proofingApplyApplicationStatus = proofingApplyApplicationStatus;
}
public String getProofingApplyTestStandard() {
return proofingApplyTestStandard;
}
public void setProofingApplyTestStandard(String proofingApplyTestStandard) {
this.proofingApplyTestStandard = proofingApplyTestStandard;
}
@Override
protected String getCodeRuleId() {
return "proofingApply";
}
}
\ No newline at end of file
package com.huigou.topsun.proofing.domain.query;
import com.huigou.data.domain.query.FlowBillSuperQueryRequest;
public class ProofingApplyQuery extends FlowBillSuperQueryRequest {
}
package com.huigou.topsun.proofing.domain.vo;
import lombok.Data;
import java.io.Serializable;
/**
* 物料清单
*/
@Data
public class BomVo implements Serializable {
/**
* 物料组成id
*/
private Long id;
/**
* 物料名称
*/
private String materialName;
/**
* 物料数量
*/
private Integer materialNumber;
/**
* 产品id
*/
private Long productId;
/**
* 产品
*/
private String productName;
}
package com.huigou.topsun.proofing.domain.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("product")
public class ProductVo {
/**
* 产品编号
*/
private String ProductNo;
}
package com.huigou.topsun.proofing.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huigou.topsun.proofing.domain.vo.BomVo;
import org.springframework.data.repository.query.Param;
import java.util.List;
public interface BomMapper extends BaseMapper<BomVo> {
List<BomVo> getBomVoByProductId(@Param("productId") String productId);
}
package com.huigou.topsun.proofing.mapper;
import com.huigou.topsun.proofing.domain.query.ProofingApplyQuery;
import com.topsunit.query.annotations.Mapper;
import java.util.Map;
/**
* @author yonghuan
*/
@Mapper(xml = "config/demo/proofingApply.xml")
public interface ProofingApplyMapper {
Map<String, Object> slicedQuery(ProofingApplyQuery query);
}
package com.huigou.topsun.proofing.repository;
import com.huigou.topsun.proofing.domain.model.ProofingApply;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ProofingApplyRepository extends JpaRepository<ProofingApply, String> {
}
package com.huigou.topsun.proofing.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huigou.topsun.proofing.domain.vo.BomVo;
import java.util.List;
public interface BomService extends IService<BomVo> {
List<BomVo> getBomVoByProductId(String productId);
BomVo getBomVoById(Long product_materialId);
}
package com.huigou.topsun.proofing.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huigou.topsun.proofing.domain.vo.BomVo;
import com.huigou.topsun.proofing.mapper.BomMapper;
import com.huigou.topsun.proofing.service.BomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class BomServiceImpl extends ServiceImpl<BomMapper, BomVo> implements BomService {
@Autowired
private BomMapper bomMapper;
@Override
public List<BomVo> getBomVoByProductId(String productId) {
return bomMapper.getBomVoByProductId(productId);
}
@Override
public BomVo getBomVoById(Long product_materialId) {
return this.baseMapper.selectById(product_materialId);
}
}
<?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="proofingProc" name="打样" isExecutable="true">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="#{proofingApplyApplication}"></activiti:executionListener>
<activiti:executionListener event="end" delegateExpression="#{proofingApplyApplication}"></activiti:executionListener>
</extensionElements>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="Apply" name="打样申请" activiti:formKey="proofingApply/showProofingApply.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{proofingApplyApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{proofingApplyApplication}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="Approve" name="打样审批" activiti:assignee="${assignee} " activiti:formKey="proofingApply/showProofingApply.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{proofingApplyApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{proofingApplyApplication}"></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_proofingProc">
<bpmndi:BPMNPlane bpmnElement="proofingProc" id="BPMNPlane_proofingProc">
<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"?>
<easy-search-mappings>
<easy-search name="productCode" desc="产品">
<sql>select product_id,product_name from product</sql>
<field name="productId" title="产品编码" code="productId" width="200" />
<field name="productName" title="产品编码" code="productName" width="200" />
</easy-search>
<easy-search name="productType" desc="产品状态" >
<sql>select pc.* from
product_category pc</sql>
<field name="productCategoryName" title="产品名称" code="productCategoryName" type="hidden" width="300"/>
<field name="productCategoryStatus" title="产品状态" code="productCategoryStatus" width="200"/>
<field name="productCategoryCode" title="产品编码" code="productCategoryCode" type="hidden" width="300"/>
<field name="productCategoryId" code="productCategoryId" type='hidden' />
</easy-search>
</easy-search-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