Commit 80dd8093 authored by 刘学辉's avatar 刘学辉

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

# Conflicts:
#	topsun-xt/src/main/resources/数据库变更记录
parents b34fdf88 88334e37
......@@ -56,12 +56,22 @@ UICtrl.getColumnLocal = function(tableKey, allColumns) {
if (!!!localColumns) return allColumns
// 有本地配置,与默认配置进行匹配,
return allColumns.map(column => {
return {
...column,
hide: localColumns.find(v => v.name == column.name)?._hide
}
})
// return allColumns.map(column => {
// return {
// ...column,
// hide: localColumns.find(v => v.name == column.name)?._hide
// }
// })
return allColumns.map(function(column) {
var matchingColumn = localColumns.find(function(v) {
return v.name === column.name;
});
return Object.assign({}, column, {
hide: matchingColumn ? matchingColumn._hide : undefined
});
});
} catch(e) {
// 未获取到,或者报错,直接返回默认columns
return allColumns
......
......@@ -89,3 +89,14 @@ ALTER TABLE topsun_dev.sap_exception_report_payable ADD unit varchar(100) NULL C
ALTER TABLE topsun_dev.sap_exception_report_payable ADD unit_name varchar(100) NULL;
ALTER TABLE topsun_dev.sap_exception_duty_person CHANGE remark duty_remark varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '备注';
ALTER TABLE topsun_dev.sap_exception_report_item ADD reason_type varchar(10) NULL COMMENT '异常原因类型';
--2024-09-27 ECN变更单跟进事项
ALTER TABLE `topsun_dev`.`sap_purchase_item`
ADD COLUMN `AFNAM_ID` varchar(128) NULL COMMENT '申请人ID' AFTER `KOSTL_NAME`;
ALTER TABLE `topsun_dev`.`ep_change_form_impl_item`
ADD COLUMN `follow_matter` varchar(128) NULL COMMENT '跟进事项' AFTER `date`;
--2024-10-11 ECN具体生效日期
ALTER TABLE `topsun_dev`.`ep_change_form`
ADD COLUMN `effective_date` datetime NULL COMMENT '具体生效日期' AFTER `material_reason_for_change`;
\ No newline at end of file
......@@ -194,6 +194,12 @@ function loadGrid() {
// valueField: 'deptId'
// }
},
{
display: "跟进事项", name: "followMatter", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: "text"
}
},
{
display: "执行人", name: "executor", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
......@@ -423,10 +429,10 @@ function getExtendedData(processAction) {
}
function print(){
if ($("#statusId").val() != 3){
Public.tip("请审批完成再打印!");
return;
}
// if ($("#statusId").val() != 3){
// Public.tip("请审批完成再打印!");
// return;
// }
var url='/epChangeForm/print.load';
Public.openPostWindow(web_app.name+url,{id :$("#id").val()});
}
......@@ -26,23 +26,24 @@
<div class="hg-form-cols">
<div class="hg-form-row">
<x:inputC name="changeNo" required="true" label="变更序号" labelCol="2" maxLength="64" fieldCol="2" />
<x:inputC name="brandName" required="false" label="品牌名称" labelCol="2" fieldCol="2" wrapper="select"/>
<x:inputC name="brandName" required="true" label="品牌名称" labelCol="2" fieldCol="2" wrapper="select"/>
<x:hidden name="brandCode"/>
<x:hidden name="changePersonId"/>
<x:inputC name="changePerson" required="false" label="变更申请部门/姓名" labelCol="2" fieldCol="2" wrapper="select"/>
</div>
<div class="hg-form-row">
<x:checkboxListC name="reasonForChange" list="reasonForChangeList" required="true" label="变更原因" labelCol="2" fieldCol="6"/>
<x:checkboxListC name="reasonForChange" list="reasonForChangeList" required="true" label="变更类型" labelCol="2" fieldCol="6"/>
<x:inputC name="otherReasonDesc" required="false" label="其他原因描述" labelCol="2" fieldCol="2"/>
</div>
<div class="hg-form-row">
<x:textareaC name="changeMatter" required="false" label="变更事项" rows="3" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:textareaC name="reasonDesc" required="false" label="原因描述" rows="3" labelCol="2" fieldCol="10"/>
<x:textareaC name="reasonDesc" required="false" label="变更原因" rows="3" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:checkboxListC name="changeEffective" dictionary="changeEffective" required="true" label="生效日期" labelCol="2" fieldCol="10"/>
<x:checkboxListC name="changeEffective" dictionary="changeEffective" required="true" label="生效日期" labelCol="2" fieldCol="6"/>
<x:inputC name="effectiveDate" required="false" label="生效日期" labelCol="2" fieldCol="2" wrapper="datetime"/>
</div>
<x:title title="CURRENT SPEC 目前产品信息" name="group"/>
<div class="hg-form-row">
......@@ -69,7 +70,7 @@
<%-- <x:inputC name="othersMaterialStore" required="false" label="涉及原材料成品库存" labelCol="2" fieldCol="10"/>--%>
<%-- </div>--%>
<div class="hg-form-row">
<x:inputC name="others" required="true" label="其他" labelCol="2" fieldCol="10"/>
<x:inputC name="others" required="false" label="其他" labelCol="2" fieldCol="10"/>
</div>
<x:title title="REVISED SPEC 变更后产品信息" name="group"/>
<div class="hg-form-row">
......@@ -85,7 +86,7 @@
<x:textareaC name="changedMaterial" required="true" label="原材料" labelCol="2" fieldCol="10" rows="3"/>
</div>
<div class="hg-form-row">
<x:inputC name="changedOthers" required="true" label="其他" labelCol="2" fieldCol="10"/>
<x:inputC name="changedOthers" required="false" label="其他" labelCol="2" fieldCol="10"/>
</div>
</div>
<div style="padding-top: 15px;">
......
......@@ -27,16 +27,16 @@ function loadGrid() {
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
{display: "审批状态", name: "statusTextView", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "创建日期", name: "fillinDate", width: 120, minWidth: 60, type: "date", align: "left"},
{display: "序号", name: "changeNo", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "单据编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "变更事项", name: "changeMatter", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "产品代号", name: "pd", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "产品名称", name: "productName", width: 200, minWidth: 60, type: "string", align: "left"},
{display: "变更原因", name: "reasonForChangeTextView", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "变更类型", name: "reasonForChangeTextView", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "成品变更原因", name: "reasonDesc", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "原材料变更原因", name: "materialReasonForChangeTextView", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "原因描述", name: "reasonDesc", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "审批状态", name: "statusTextView", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "创建日期", name: "fillinDate", width: 120, minWidth: 60, type: "date", 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: "code", width: 100, minWidth: 60, type: "string", align: "left"},
......@@ -103,10 +103,10 @@ function printHandler(){
if (!row) {
return;
}
if (row.status != 3){
Public.tip("请审批完成再打印!");
return;
}
// if (row.status != 3){
// Public.tip("请审批完成再打印!");
// return;
// }
var url='/epChangeForm/print.load';
Public.openPostWindow(web_app.name+url,{id :row.id});
}
......@@ -85,6 +85,12 @@ function loadGrid() {
// valueField: 'deptId'
// }
},
{
display: "跟进事项", name: "followMatter", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: "text"
}
},
{
display: "执行人", name: "executor", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
......@@ -314,10 +320,10 @@ function getExtendedData(processAction) {
}
function print(){
if ($("#statusId").val() != 3){
Public.tip("请审批完成再打印!");
return;
}
// if ($("#statusId").val() != 3){
// Public.tip("请审批完成再打印!");
// return;
// }
var url='/epChangeForm/print.load';
Public.openPostWindow(web_app.name+url,{id :$("#id").val()});
}
......@@ -31,14 +31,14 @@
<x:inputC name="changePerson" required="false" label="变更申请部门/姓名" labelCol="2" fieldCol="2" wrapper="select"/>
</div>
<div class="hg-form-row">
<x:checkboxListC name="materialReasonForChange" dictionary="materialReasonForChange" required="true" label="变更原因" labelCol="2" fieldCol="6"/>
<x:checkboxListC name="materialReasonForChange" dictionary="materialReasonForChange" required="true" label="变更类型" labelCol="2" fieldCol="6"/>
<x:inputC name="otherReasonDesc" required="false" label="其他原因描述" labelCol="2" fieldCol="2"/>
</div>
<div class="hg-form-row">
<x:textareaC name="changeMatter" required="false" label="变更事项" rows="3" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:textareaC name="reasonDesc" required="false" label="原因描述" rows="3" labelCol="2" fieldCol="10"/>
<x:textareaC name="reasonDesc" required="false" label="变更原因" rows="3" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:checkboxListC name="changeEffective" dictionary="changeEffective" required="true" label="生效日期" labelCol="2" fieldCol="10"/>
......@@ -60,7 +60,7 @@
<x:inputC name="othersMaterialStore" required="false" label="涉及原材料成品库存" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:inputC name="others" required="true" label="其他" labelCol="2" fieldCol="10"/>
<x:inputC name="others" required="false" label="其他" labelCol="2" fieldCol="10"/>
</div>
<x:title title="REVISED SPEC 变更后产品信息" name="group"/>
<div class="hg-form-row">
......@@ -70,7 +70,7 @@
<x:inputC name="changedProductName" required="true" label="产品名称" labelCol="2" fieldCol="10"/>
</div>
<div class="hg-form-row">
<x:inputC name="changedOthers" required="true" label="其他" labelCol="2" fieldCol="10"/>
<x:inputC name="changedOthers" required="false" label="其他" labelCol="2" fieldCol="10"/>
</div>
</div>
<div style="padding-top: 15px;">
......
......@@ -18,40 +18,39 @@
<img src='data:image/jpg;base64,${bsnPng}' width="100px"/>
</span>
宝绅内部变更申请/通知单</div>
<div class="billTitle">Specification Change Form</div>
<div class="billTitle">Engineering Change Notice</div>
<table cellspacing="0px" cellpadding="0px" class="tablePrint">
<colgroup>
<col width="34%"/>
<col width="34%"/>
</colgroup>
<tr>
<td class="right">变更编号SCF#:${billCode?default("")?html}</td>
<td class="left">${changeNo?default("")?html}</td>
<td class="right">变更编号:${billCode?default("")?html}</td>
</tr>
</table>
<div class="title" style="background: #CC8F81;text-align: center">General Information 基本信息</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<#--<colgroup>
<col width='16%' />
<col width='17%' />
<col width='17%' />
<col width='17%' />
<col width='16%' />
<col width='17%' />
<col width="16%" />
</colgroup>
<tr>
<td class="center">DATE日期:</td>
<td class="center"><@formatDate date=fillinDate/></td>
<td class="center">BRAND品牌名称:</td>
<td class="center">${brandName?default("")?html}</td>
<td class="center">CHANGE REQUESTED BY (DEPT/NAME)变更申请部门/姓名:</td>
<td class="center">${deptName?default("")?html}</td>
</tr>
</table>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
</colgroup>-->
<colgroup>
<col width='100%' />
<col width='14%' />
<col width='33%' />
<col width='51%' />
</colgroup>
<tr>
<td class="left">REASON FOR CHANGE变更原因:${reasonDesc?default("")?html}</td>
<td class="left">DATE日期:<br/><@formatDate date=fillinDate/></td>
<#--<td class="center"><@formatDate date=fillinDate/></td>-->
<td class="left">BRAND品牌名称:<br/>${brandName?default("")?html}</td>
<#--<td class="center">${brandName?default("")?html}</td>-->
<td class="left">CHANGE REQUESTED BY (DEPT/NAME)变更申请部门/姓名:<br/>${deptName?default("")?html}</td>
<#--<td class="center">${deptName?default("")?html}</td>-->
</tr>
</table>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
......@@ -59,17 +58,30 @@
<col width='100%' />
</colgroup>
<tr>
<td class="left">${reasonForChange?default("")?html}</td>
<td class="left">${otherReasonDesc?default("")?html}</td>
<td class="left">REASON FOR CHANGE变更原因:${reasonDesc?default("")?html}
<br/>
${reasonForChange?replace("nbsp", "&nbsp;&nbsp;&nbsp;&nbsp;")!default("")?html}
<span style="text-decoration: underline">其他:${otherReasonDesc?default("")?html}</span>
</td>
</tr>
</table>
<#--<table cellspacing="0px" cellpadding="0px" class="tableBorder">-->
<#-- <colgroup>-->
<#-- <col width='100%' />-->
<#-- </colgroup>-->
<#-- <tr>-->
<#-- <td class="left">${reasonForChange?default("")?html}</td>-->
<#-- <td class="left">${otherReasonDesc?default("")?html}</td>-->
<#-- </tr>-->
<#--</table>-->
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='100%' />
</colgroup>
<tr>
<td class="left">CHANGE EFFECTIVE 生效日期:
<span style="text-decoration: underline">${changeEffective?default("")?html}</span>
<td class="left">CHANGE EFFECTIVE 生效日期:<@formatDate date=effectiveDate/>
<br/>
${changeEffective?replace("nbsp", "&nbsp;&nbsp;&nbsp;&nbsp;")!default("")?html}
</td>
</tr>
</table>
......@@ -77,25 +89,22 @@
<div class="title" style="background: yellow;text-align: left">CURRENT SPEC 目前产品信息</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='22%' />
<col width='78%' />
<col width='14%' />
<col width='84%' />
</colgroup>
<tr>
<td class="left">
PD#
产品代号#:</td>
PD# 产品代号#:</td>
<td class="left">${pd?default("")?html}</td>
</tr>
<tr>
<td class="left">
PRODUCT NAME:
产品名称:</td>
PRODUCT NAME<br/>产品名称:</td>
<td class="left">${productName?default("")?html}</td>
</tr>
<tr>
<td class="left">
PROCESS:
制程工艺:</td>
PROCESS制程工艺:</td>
<td class="left">${process?default("")?html}</td>
</tr>
<tr>
......@@ -110,25 +119,22 @@
<div class="title" style="background: yellow;text-align: left">REVISED SPEC 变更后产品信息</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='22%' />
<col width='78%' />
<col width='14%' />
<col width='84%' />
</colgroup>
<tr>
<td class="left">
PD#
产品代号#:</td>
PD# 产品代号#:</td>
<td class="left">${changedPd?default("")?html}</td>
</tr>
<tr>
<td class="left">
PRODUCT NAME:
产品名称:</td>
PRODUCT NAME<br/>产品名称:</td>
<td class="left">${changedProductName?default("")?html}</td>
</tr>
<tr>
<td class="left">
PROCESS:
制程工艺:</td>
PROCESS制程工艺:</td>
<td class="left">${changedProcess?default("")?html}</td>
</tr>
<tr>
......@@ -147,9 +153,9 @@
<div class="title" style="background: #CC8F81;text-align: center">Approvals / Checks 确认</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='25%' />
<col width='20%' />
<col width='55%' />
<col width='22%' />
<col width='28%' />
<col width='50%' />
</colgroup>
<tr>
<td class="center" style="background: yellow">审批节点</td>
......@@ -160,7 +166,7 @@
<#list approvals as detail>
<tr>
<td class="left">${detail.approvalName?default("")?html}</td>
<td class="left">${detail.handledDate?default("")?html}</td>
<td class="center">${detail.handledDate?default("")?html}</td>
<td class="left">${detail.opinion?default("")?html}</td>
</tr>
</#list>
......@@ -174,26 +180,35 @@
</table>
<div class="title" style="background: #CC8F81;text-align: center">Implementation 执行人(版具/模具等)</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<#-- <colgroup>-->
<#-- <col width='25%' />-->
<#-- <col width='25%' />-->
<#-- <col width='25%' />-->
<#-- <col width='25%' />-->
<#-- </colgroup>-->
<colgroup>
<col width='14%' />
<col width='25%' />
<col width='25%' />
<col width='25%' />
<col width='25%' />
<col width='10%' />
<col width='18%' />
<col width='33%' />
</colgroup>
<tr>
<td class="center" style="background: yellow">部门</td>
<td class="center" style="background: yellow">执行人</td>
<td class="center" style="background: yellow">跟进事项</td>
<td class="center" style="background: yellow">签名确认</td>
<td class="center" style="background: yellow">DATE日期</td>
<td class="center" style="background: yellow">COMMENTS评论</td>
</tr>
<#if implItemMaps?? && implItemMaps?size gt 0>
<#list implItemMaps as detail>
<tr>
<td class="center">${detail.deptName?default("")?html}</td>
<td class="center">${detail.followMatter?default("")?html}</td>
<td class="center">${detail.executor?default("")?html}</td>
<td class="center">${detail.confirmTextView?default("")?html}</td>
<td class="center">${detail.date?default("")?html}</td>
<td class="center">${detail.comment?default("")?html}</td>
</tr>
</#list>
<#else>
......@@ -202,31 +217,46 @@
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
</tr>
</#if>
</table>
<div class="title" style="background: #CC8F81;text-align: center">Stock / Inventory 库存</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<#-- <colgroup>-->
<#-- <col width='25%' />-->
<#-- <col width='25%' />-->
<#-- <col width='25%' />-->
<#-- <col width='25%' />-->
<#-- </colgroup>-->
<#-- <colgroup>-->
<#-- <col width='14%' />-->
<#-- <col width='51%' />-->
<#-- <col width='16%' />-->
<#-- <col width='17%' />-->
<#-- </colgroup>-->
<colgroup>
<col width='14%' />
<col width='25%' />
<col width='25%' />
<col width='25%' />
<col width='25%' />
<col width='10%' />
<col width='18%' />
<col width='33%' />
</colgroup>
<tr>
<td class="center" style="background: yellow">部门</td>
<td class="center" style="background: yellow">专属原材料/半成品/在制品/成品数量(张)</td>
<td class="center" style="background: yellow">签名确认</td>
<td class="center" style="background: yellow">DATE日期</td>
<td class="center" style="background: yellow">COMMENTS评论</td>
</tr>
<#if stockItemMaps?? && stockItemMaps?size gt 0>
<#list stockItemMaps as detail>
<tr>
<td class="center">${detail.deptName?default("")?html}</td>
<td class="center">${detail.description?default("")?html}</td>
<td class="center">${detail.confirmTextView?default("")?html}</td>
<td class="center">${detail.executor?default("")?html}</td>
<td class="center">${detail.date?default("")?html}</td>
<td class="center">${detail.comment?default("")?html}</td>
</tr>
</#list>
<#else>
......@@ -235,6 +265,7 @@
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
</tr>
</#if>
</table>
......
......@@ -13,6 +13,8 @@ import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
/**
......@@ -134,4 +136,21 @@ public class Function extends AbstractDaoFunction {
String sql = this.getSqlByname("fundApproval");
return this.sqlExecutorDao.queryToList(sql, OrgUnit.class,bizId);
}
/**
* 根据业务id查询指定的执行人
* @param bizId
* @return
*/
public List<OrgUnit> fundECNApproval(String bizId){
Assert.hasText(bizId, "参数id不能为空。");
String sql = this.getSqlByname("fundECNItemApproval");
String sqlStock = this.getSqlByname("fundECNStockItemApproval");
List<OrgUnit> orgUnits = this.sqlExecutorDao.queryToList(sql, OrgUnit.class, bizId);
List<OrgUnit> orgUnitStocks = this.sqlExecutorDao.queryToList(sqlStock, OrgUnit.class, bizId);
orgUnits.addAll(orgUnitStocks);
HashSet<OrgUnit> orgUnitHashSet = new HashSet<>(orgUnits);
ArrayList<OrgUnit> orgUnitArrayList = new ArrayList<>(orgUnitHashSet);
return orgUnitArrayList;
}
}
......@@ -23,4 +23,6 @@ public interface EpChangeFormApplication {
Map<String, Object> slicedEpChangeFormList(EpChangeFormQueryRequest queryRequest);
List<Map<String,Object>> queryApprovalPersons(String bizId);
Map<String, Object> print(EpChangeFormQueryRequest queryRequest);
}
......@@ -3,7 +3,10 @@ package com.huigou.topsun.ep.change.application.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.huigou.cache.DictUtil;
import com.huigou.cache.SystemCache;
import com.huigou.data.domain.model.CommonDomainConstants;
import com.huigou.data.domain.query.QueryPageRequest;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.ep.change.application.EpChangeFormApplication;
......@@ -26,14 +29,22 @@ import com.huigou.uasp.bpm.engine.domain.model.ProcUnitHandler;
import com.huigou.uasp.bpm.engine.domain.model.TaskExtension;
import com.huigou.util.ClassHelper;
import com.huigou.util.DateUtil;
import com.huigou.util.StringUtil;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import sun.misc.BASE64Encoder;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
/**
......@@ -43,6 +54,7 @@ import java.util.*;
*/
@Service("epChangeFormApplication")
public class EpChangeFormApplicationImpl extends FlowBroker implements EpChangeFormApplication {
private final static Logger LOG = LoggerFactory.getLogger(EpChangeFormApplicationImpl.class);
@Autowired
private EpChangeFormRepository epChangeFormRepository;
@Autowired
......@@ -121,12 +133,11 @@ public class EpChangeFormApplicationImpl extends FlowBroker implements EpChangeF
}
}
changeFormImplItemApplication.saveEpChangeFormImplItems(bizId,formImplItemList);
}
if ("库存".equals(subProcUnitName)){
//匹配仓库环节审批完,更新确认状态是时间
List<EpChangeFormStockItem> stockItemList = epChangeFormStockItemRepository.findByEpChangeFormId(bizId);
for (EpChangeFormStockItem epChangeFormStockItem : stockItemList) {
if (org.getDeptId().equals(epChangeFormStockItem.getDeptId())){
if (org.getId().equals(epChangeFormStockItem.getExecutorId())){
epChangeFormStockItem.setConfirm("1");
epChangeFormStockItem.setDate(new Date());
}
......@@ -238,12 +249,110 @@ public class EpChangeFormApplicationImpl extends FlowBroker implements EpChangeF
return this.sqlExecutorDao.queryToListMap(queryDescriptor.getSql(),bizId);
}
@Override
public Map<String, Object> print(EpChangeFormQueryRequest queryRequest) {
Map<String, Object> objectMap = this.slicedEpChangeFormList(queryRequest);
List<Map<String, Object>> objectMaps = (List<Map<String, Object>>) objectMap.get("Rows");
Map<String,Object> map = objectMaps.get(0);
map.put("deptName",map.get("deptName")+"-"+map.get("personMemberName"));
//处理产成品变更类型和原材料变更类型
//例如:√ BRAND CHANGE 客户变更 BSN PROCESS CHANGE 内部工艺变更 PRODUCT MATERIAL CHANGE 产品材质变更
// TEMPLATE CHANGE 版具变更 MATERIAL CHANGE 原材料变更 OTHERS 其它
String reasonForChange = "";
Map<String, String> reasonForChangeMap = new HashMap<>();
String reasonForChangePD = (String) map.get("reasonForChange");
String reasonForChangeMaterial = (String) map.get("materialReasonForChange");
if (StringUtil.isNotBlank(reasonForChangePD)){
reasonForChange = reasonForChangePD;
reasonForChangeMap = DictUtil.getDictionary("reasonForChange");
}
if (StringUtil.isNotBlank(reasonForChangeMaterial)){
reasonForChange = reasonForChangeMaterial;
reasonForChangeMap = DictUtil.getDictionary("materialReasonForChange");
}
String[] split = reasonForChange.split(",");
List<String> strings = Arrays.asList(split);
StringBuilder change = new StringBuilder();
Map<String, String> finalReasonForChangeMap = reasonForChangeMap;
finalReasonForChangeMap.keySet().forEach(key->{
if (strings.contains(key)){
change.append(" √ ");
}
if (StringUtil.isNotBlank(reasonForChangeMaterial)){
change.append(finalReasonForChangeMap.get(key)).append("nbsp");
}
if (StringUtil.isNotBlank(reasonForChangePD)){
change.append(key).append(" ").append(finalReasonForChangeMap.get(key)).append("nbsp");
}
});
map.put("reasonForChange",change.toString());
//处理生效日期类型
//例如:√ IMMEDIATE 立即变更 RUNNING CHANGE 正常变更(用完后变更) SEASON 换季更改
Map<String, String> changeEffective = DictUtil.getDictionary("changeEffective");
StringBuilder effective = new StringBuilder();
String[] splitE = map.get("changeEffective").toString().split(",");
List<String> stringList = Arrays.asList(splitE);
changeEffective.keySet().forEach(key->{
if (stringList.contains(key)){
effective.append(" √ ");
}
effective.append(key).append(" ").append(changeEffective.get(key)).append("nbsp");
});
map.put("changeEffective",effective.toString());
File file = new File(SystemCache.getRealPath() +"/images/bsnLogo.png");
try {
FileInputStream inputFile = new FileInputStream(file);
byte[] buffer = new byte[inputFile.available()];
inputFile.read(buffer);
inputFile.close();
BASE64Encoder base64Encoder = new BASE64Encoder();
String encode = base64Encoder.encode(buffer);
map.put("bsnPng",encode);
}catch (Exception e) {
LOG.error("异常信息:" + e.getMessage());
}
// 获取Grid数据
QueryPageRequest pageModel = queryRequest.getPageModel();
pageModel.setPageSize(20);
queryRequest.setPageModel(pageModel);
queryRequest.setEpChangeFormId(queryRequest.getId());
//查询Implementation 执行人(版具/模具等)
Map<String, Object> implItemMap = changeFormImplItemApplication.findByEpChangeFormId(queryRequest);
//查询Stock / Inventory 库存
Map<String, Object> stockItemMap = changeFormStockItemApplication.findByEpChangeFormId(queryRequest);
//查询审批人
List<Map<String, Object>> mapList = this.queryApprovalPersons(queryRequest.getId());
List<Map<String, Object>> implItemMaps = (List<Map<String, Object>>) implItemMap.get("Rows");
implItemMaps.forEach(itemMap->{
mapList.forEach(approvalMap -> {
if (approvalMap.get("handlerName").equals(itemMap.get("executor"))){
itemMap.put("comment",approvalMap.get("opinion"));
}
});
});
List<Map<String, Object>> stockItemMaps = (List<Map<String, Object>>) stockItemMap.get("Rows");
stockItemMaps.forEach(itemMap->{
mapList.forEach(approvalMap -> {
if (approvalMap.get("handlerName").equals(itemMap.get("executor"))){
itemMap.put("comment",approvalMap.get("opinion"));
}
});
});
map.put("printTime", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format(LocalDateTime.now()));
map.put("implItemMaps", implItemMaps);
map.put("stockItemMaps", stockItemMaps);
map.put("approvals", mapList);
return map;
}
public void feedBackSaleEcn(EpChangeForm epChangeForm){
Map<String,Object> map = new HashMap<>();
//日志记录
Map<String, Object> resultMap = new HashMap<>();
try {
String execute = httpClient.executeForEp(map, "pro/productionSolution/openEcn?productionSolutionId="+epChangeForm.getProductionSolutionId());
String execute = httpClient.executeForEp(map, "pro/productionSolution/openEcn?pds="+epChangeForm.getPd());
EpResult epResult = JSONObject.parseObject(execute, EpResult.class);
resultMap.put("TYPE", epResult.getCode());
resultMap.put("message", epResult.getMsg());
......
package com.huigou.topsun.ep.change.controller;
import com.huigou.cache.DictUtil;
import com.huigou.cache.SystemCache;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.data.domain.query.QueryPageRequest;
import com.huigou.topsun.ep.change.application.EpChangeFormApplication;
import com.huigou.topsun.ep.change.application.EpChangeFormImplItemApplication;
import com.huigou.topsun.ep.change.application.EpChangeFormStockItemApplication;
import com.huigou.topsun.ep.change.domain.EpChangeForm;
import com.huigou.topsun.ep.change.domain.query.EpChangeFormQueryRequest;
import com.huigou.topsun.ep.order.controller.EpSaleOrderCancelController;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.engine.application.ActApplication;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import sun.misc.BASE64Encoder;
import javax.annotation.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -42,7 +29,6 @@ import java.util.Map;
@Controller
@ControllerMapping("/epChangeForm")
public class EpChangeFormController extends CommonController {
private final static Logger LOG = LoggerFactory.getLogger(EpChangeFormController.class);
@Override
protected String getPagePath() {
return "/biz/topsun/ep/change/";
......@@ -54,8 +40,6 @@ public class EpChangeFormController extends CommonController {
private EpChangeFormImplItemApplication changeFormImplItemApplication;
@Autowired
private EpChangeFormStockItemApplication changeFormStockItemApplication;
@Autowired
private ActApplication actApplication;
public String forwardEpChangeFormList(){
return forward("epChangeFormList");
......@@ -142,57 +126,7 @@ public class EpChangeFormController extends CommonController {
String id = sdo.getId();
EpChangeFormQueryRequest queryRequest = sdo.toQueryRequest(EpChangeFormQueryRequest.class);
queryRequest.setId(id);
Map<String, Object> objectMap = this.epChangeFormApplication.slicedEpChangeFormList(queryRequest);
List<Map<String, Object>> objectMaps = (List<Map<String, Object>>) objectMap.get("Rows");
Map<String,Object> map = objectMaps.get(0);
map.put("deptName",map.get("deptName")+"-"+map.get("personMemberName"));
String[] split = map.get("reasonForChange").toString().split(",");
String[] splitText = map.get("reasonForChangeTextView").toString().split(",");
List<String> strings = Arrays.asList(split);
List<String> stringTexts = Arrays.asList(splitText);
StringBuilder change = new StringBuilder();
for (int i = 0; i < strings.size(); i++) {
String s = strings.get(i);
change.append(" √ ").append(s).append(" ").append(stringTexts.get(i));
}
map.put("reasonForChange",change.toString());
StringBuilder effective = new StringBuilder();
String[] splitE = map.get("changeEffective").toString().split(",");
String[] splitETextView = map.get("changeEffectiveTextView").toString().split(",");
List<String> stringList = Arrays.asList(splitE);
List<String> stringListTextView = Arrays.asList(splitETextView);
for (int i = 0; i < stringList.size(); i++) {
String s = stringList.get(i);
effective.append(" √ ").append(s).append(" ").append(stringListTextView.get(i));
}
map.put("changeEffective",effective.toString());
File file = new File(SystemCache.getRealPath() +"/images/bsnLogo.png");
try {
FileInputStream inputFile = new FileInputStream(file);
byte[] buffer = new byte[inputFile.available()];
inputFile.read(buffer);
inputFile.close();
BASE64Encoder base64Encoder = new BASE64Encoder();
String encode = base64Encoder.encode(buffer);
map.put("bsnPng",encode);
}catch (Exception e) {
LOG.error("异常信息:" + e.getMessage());
}
// 获取Grid数据
QueryPageRequest pageModel = queryRequest.getPageModel();
pageModel.setPageSize(20);
queryRequest.setPageModel(pageModel);
queryRequest.setEpChangeFormId(id);
Map<String, Object> implItemMap = changeFormImplItemApplication.findByEpChangeFormId(queryRequest);
Map<String, Object> stockItemMap = changeFormStockItemApplication.findByEpChangeFormId(queryRequest);
List<Map<String, Object>> mapList = this.epChangeFormApplication.queryApprovalPersons(id);
List<Map<String, Object>> implItemMaps = (List<Map<String, Object>>) implItemMap.get("Rows");
List<Map<String, Object>> stockItemMaps = (List<Map<String, Object>>) stockItemMap.get("Rows");
map.put("printTime", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format(LocalDateTime.now()));
map.put("implItemMaps", implItemMaps);
map.put("stockItemMaps", stockItemMaps);
map.put("approvals", mapList);
Map<String,Object> map = this.epChangeFormApplication.print(queryRequest);
String pintPage = String.format("/print/topsun/epChangeForm.ftl");
return outputAndProcUnitHandlerPDF(pintPage, id, map);
}
......
......@@ -6,6 +6,7 @@ import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* @Auther: xin.lu
......@@ -55,6 +56,12 @@ public class EpChangeForm extends FlowBillAbstractEntity {
@Column(name = "change_effective")
private String changeEffective;
/**
* 具体生效日期
*/
@Column(name = "effective_date")
private Date effectiveDate;
//CURRENT SPEC 目前产品信息
/**
......
......@@ -54,4 +54,10 @@ public class EpChangeFormImplItem extends AbstractEntity {
*/
@Column(name = "date")
private Date date;
/**
* 跟进事项
*/
@Column(name = "follow_matter")
private String followMatter;
}
......@@ -29,6 +29,8 @@ public interface SapCostReimbursementApplication {
void savePaymentReceiptVo(PaymentReceiptVo paymentReceiptVo);
void endTask(SapCostReimbursement reimbursement);
String queryTaskByBizId(String bizId);
Integer checkzyl06(String zyl06);
......
......@@ -23,14 +23,15 @@ import com.huigou.topsun.sap.costReimbursement.repostiory.SapCostReimbursementRe
import com.huigou.topsun.util.MyBaseUtil;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.operator.OperatorApplication;
import com.huigou.uasp.bpm.ApprovalParameter;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.uasp.bpm.engine.application.WorkflowApplication;
import com.huigou.uasp.bpm.engine.domain.model.ProcUnitHandler;
import com.huigou.uasp.bpm.engine.domain.model.TaskExtension;
import com.huigou.util.*;
import lombok.SneakyThrows;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -44,8 +45,6 @@ import javax.annotation.Resource;
import java.io.IOException;
import java.util.*;
import static com.huigou.uasp.bpm.ApprovalParameterUtil.getApprovalParameter;
@Service("sapCostReimbursementApplication")
public class SapCostReimbursementApplicationImpl extends FlowBroker implements SapCostReimbursementApplication {
......@@ -59,6 +58,8 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
@Autowired
DefaultHttpClient defaultHttpClient;
@Autowired
private WorkflowApplication workflowApplication;
// @Autowired
// MessageCodec messageCodec;
......@@ -332,11 +333,30 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
sapCostReimbursementDetail.setGjahr1(paymentReceiptVo.getGjahr1());
costReimbursementDetailRepository.save(sapCostReimbursementDetail);
}
//
this.endTask(reimbursement);
//在接收到SAP回执消息后,修改任务标题和当前时间,让申请人能看到该任务
this.updateActRuTaskExtension(reimbursement.getId());
//this.updateActRuTaskExtension(reimbursement.getId());
//this.makeACopyFor(reimbursement);
}
@Override
public void endTask(SapCostReimbursement reimbursement) {
Operator operator = operatorApplication.createOperatorByPersonMemberId(reimbursement.getPersonMemberId());
ThreadLocalUtil.putOperator(operator);
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "queryTaskByBusinessKey");
ApprovalParameter approvalParameter = this.sqlExecutorDao.queryToObject(queryDescriptor.getSql(), ApprovalParameter.class, reimbursement.getId());
approvalParameter.setProcessAction("advance");
approvalParameter.setHandleResult(1);
approvalParameter.setHandleOpinion("同意!");
Map<String, Object> variables = new HashMap();
SDO localSdo = new SDO();
localSdo.putProperty("processAction", "advance");
ThreadLocalUtil.putVariable("sdo",localSdo);
ThreadLocalUtil.putVariable("_approvalParameter_",approvalParameter);
this.workflowApplication.advance(approvalParameter.getTaskId(),variables);
}
@Override
public String queryTaskByBizId(String bizId) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "queryTaskByBizId");
......
......@@ -446,6 +446,7 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
PurchaseOrderItemVo itemVo = new PurchaseOrderItemVo();
itemVo.setMatnr(goods.getProductCode());
itemVo.setTxz01(goods.getProductName());
itemVo.setMenge(goods.getNumber());
itemVo.setMeins(goods.getUnit());
itemVo.setEeind(DateUtil.getDateFormat("yyyyMMdd", goods.getNeedDate()));
......
package com.huigou.topsun.sap.purchaseInfoRecord.controller;
import com.alibaba.fastjson.JSON;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.topsun.common.BillStatus;
......@@ -10,14 +9,11 @@ import com.huigou.topsun.sap.purchaseInfoRecord.domain.SapPurchaseInfoRecord;
import com.huigou.topsun.sap.purchaseInfoRecord.domain.SapPurchaseInfoRecordItem;
import com.huigou.topsun.sap.purchaseInfoRecord.domain.query.SapPurchaseInfoRecordQueryRequest;
import com.huigou.topsun.sap.purchaseInfoRecord.repository.SapPurchaseInfoRecordItemRepository;
import com.huigou.topsun.sap.suppliers.domain.SuppliersInfo;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.fn.CodeGenerator;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import com.huigou.util.StringUtil;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......
......@@ -77,6 +77,21 @@
<sql name="findDepartException">
SELECT duty_dept full_id,duty_dept_name full_name from sap_exception_report t WHERE t.id = ?
</sql>
</query>
<!--查询ECN执行人-->
<sql name="fundECNItemApproval">
SELECT o.FULL_ID, o.FULL_NAME FROM sa_oporg o
LEFT JOIN ep_change_form_impl_item ii ON ii.executor_id = o.id
LEFT JOIN ep_change_form cf ON cf.id = ii.ep_change_form_id
WHERE cf.id = ?
</sql>
<!--查询ECN库存执行人-->
<sql name="fundECNStockItemApproval">
SELECT o.FULL_ID, o.FULL_NAME FROM sa_oporg o
LEFT JOIN ep_change_form_stock_item si ON si.executor_id = o.id
LEFT JOIN ep_change_form cf ON cf.id = si.ep_change_form_id
WHERE cf.id = ?
</sql>
</query>
</query-mappings>
\ No newline at end of file
......@@ -39,10 +39,11 @@
wf_procunithandler t WHERE t.BIZ_ID = ? ORDER BY t.GROUP_ID ASC-->
SELECT
CONCAT( t.SUB_PROC_UNIT_NAME, ":", t.HANDLER_NAME ) AS approval_name,
t.HANDLER_NAME,
t.HANDLED_DATE,
t.OPINION
FROM
wf_procunithandler t WHERE t.BIZ_ID = ? ORDER BY t.GROUP_ID ASC
wf_procunithandler t WHERE t.BIZ_ID = ? and t.RESULT = 1 and t.SUB_PROC_UNIT_ID != 'executorId' ORDER BY t.GROUP_ID,t.HANDLED_DATE ASC
</sql-query>
</query>
......
......@@ -45,4 +45,22 @@
WHERE t.STATUS IN ( 1, 3 ) AND d.ZYL06 = ?
</sql-query>
</query>
<query name="queryTaskByBusinessKey">
<sql-query>
SELECT
e.PROC_INST_ID_ AS proc_inst_id,
e.PROC_UNIT_HANDLER_ID_ AS current_handle_id,
e.PRIORITY_ AS current_handle_group_id,
e.COOPERATION_MODEL_ID_ AS current_handle_cooperation_model_id,
e.BUSINESS_KEY_ AS biz_id,
e.BUSINESS_CODE_ AS biz_code,
e.TASK_DEF_KEY_ AS proc_unit_id,
t.ID_ AS task_id
FROM act_ru_task_extension e
LEFT JOIN act_ru_task t ON e.PROC_INST_ID_ = t.PROC_INST_ID_
WHERE e.BUSINESS_KEY_ = ?
</sql-query>
</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