Commit 824579e3 authored by 1650842865's avatar 1650842865

ECN变更单复制功能

parent 7e74ab78
...@@ -251,7 +251,7 @@ function loadGrid() { ...@@ -251,7 +251,7 @@ function loadGrid() {
url: web_app.name + '/epChangeForm/slicedEpChangeFormImplItems.ajax', url: web_app.name + '/epChangeForm/slicedEpChangeFormImplItems.ajax',
pageSize: 10, pageSize: 10,
usePager: true, usePager: true,
parms:{epChangeFormId:getId()}, parms:{epChangeFormId:getId(),oldId:$('#oldId').val()},
toolbar: toolbarOptions, toolbar: toolbarOptions,
enabledEdit: true, enabledEdit: true,
width: "100%", width: "100%",
...@@ -358,7 +358,7 @@ function loadStockGrid() { ...@@ -358,7 +358,7 @@ function loadStockGrid() {
url: web_app.name + '/epChangeForm/slicedEpChangeFormStockItems.ajax', url: web_app.name + '/epChangeForm/slicedEpChangeFormStockItems.ajax',
pageSize: 10, pageSize: 10,
usePager: true, usePager: true,
parms:{epChangeFormId:getId()}, parms:{epChangeFormId:getId(),oldId:$('#oldId').val()},
toolbar: toolbarOptions, toolbar: toolbarOptions,
enabledEdit: true, enabledEdit: true,
width: "100%", width: "100%",
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<x:hidden name="personMemberId"/> <x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/> <x:hidden name="personMemberName"/>
<x:hidden name="statusId"/> <x:hidden name="statusId"/>
<x:hidden name="oldId"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="changeNo" required="true" label="变更序号" labelCol="2" maxLength="64" fieldCol="2" /> <x:inputC name="changeNo" required="true" label="变更序号" labelCol="2" maxLength="64" fieldCol="2" />
......
...@@ -25,6 +25,11 @@ function loadGrid() { ...@@ -25,6 +25,11 @@ function loadGrid() {
printHandler(); printHandler();
} }
}, },
copyHandler:{
id: 'copyHandler', text: "复制", img:'fa-clipboard', click: function(){
copyQualityInfoRecord();
}
}
}); });
gridManager = UICtrl.grid("#maingrid", { gridManager = UICtrl.grid("#maingrid", {
columns: [ columns: [
...@@ -124,3 +129,15 @@ function printHandler(){ ...@@ -124,3 +129,15 @@ function printHandler(){
var url='/epChangeForm/print.load'; var url='/epChangeForm/print.load';
Public.openPostWindow(web_app.name+url,{id :row.id}); Public.openPostWindow(web_app.name+url,{id :row.id});
} }
function copyQualityInfoRecord(){
var row = gridManager.getSelectedRow();
if (!row) {
return;
}
UICtrl.addTabItem({
tabid: 'epChangeForm',
text: '新增变更申请/通知单',
url: web_app.name + '/epChangeForm/copyEpChangeForm.job?id=' + row.id
});
}
...@@ -171,7 +171,7 @@ function loadGrid() { ...@@ -171,7 +171,7 @@ function loadGrid() {
url: web_app.name + '/epChangeForm/slicedEpChangeFormImplItems.ajax', url: web_app.name + '/epChangeForm/slicedEpChangeFormImplItems.ajax',
pageSize: 10, pageSize: 10,
usePager: true, usePager: true,
parms:{epChangeFormId:getId()}, parms:{epChangeFormId:getId(),oldId:$('#oldId').val()},
toolbar: toolbarOptions, toolbar: toolbarOptions,
enabledEdit: true, enabledEdit: true,
width: "100%", width: "100%",
...@@ -278,7 +278,7 @@ function loadStockGrid() { ...@@ -278,7 +278,7 @@ function loadStockGrid() {
url: web_app.name + '/epChangeForm/slicedEpChangeFormStockItems.ajax', url: web_app.name + '/epChangeForm/slicedEpChangeFormStockItems.ajax',
pageSize: 10, pageSize: 10,
usePager: true, usePager: true,
parms:{epChangeFormId:getId()}, parms:{epChangeFormId:getId(),oldId:$('#oldId').val()},
toolbar: toolbarOptions, toolbar: toolbarOptions,
enabledEdit: true, enabledEdit: true,
width: "100%", width: "100%",
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<x:hidden name="personMemberId"/> <x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/> <x:hidden name="personMemberName"/>
<x:hidden name="statusId"/> <x:hidden name="statusId"/>
<x:hidden name="oldId"/>
<x:hidden name="reasonForChange"/> <x:hidden name="reasonForChange"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
......
...@@ -18,4 +18,6 @@ public interface EpChangeFormImplItemApplication { ...@@ -18,4 +18,6 @@ public interface EpChangeFormImplItemApplication {
void saveEpChangeFormImplItems(String epChangeFormId,List<EpChangeFormImplItem> items); void saveEpChangeFormImplItems(String epChangeFormId,List<EpChangeFormImplItem> items);
void deleteItems(List<String> ids); void deleteItems(List<String> ids);
Map<String, Object> findByOldId(EpChangeFormQueryRequest queryRequest);
} }
...@@ -18,4 +18,6 @@ public interface EpChangeFormStockItemApplication { ...@@ -18,4 +18,6 @@ public interface EpChangeFormStockItemApplication {
void saveEpChangeFormStockItems(String epChangeFormId,List<EpChangeFormStockItem> epChangeFormStockItems); void saveEpChangeFormStockItems(String epChangeFormId,List<EpChangeFormStockItem> epChangeFormStockItems);
void deleteItems(List<String> ids); void deleteItems(List<String> ids);
Map<String, Object> findByOldId(EpChangeFormQueryRequest queryRequest);
} }
...@@ -51,4 +51,12 @@ public class EpChangeFormImplItemApplicationImpl extends BaseApplication impleme ...@@ -51,4 +51,12 @@ public class EpChangeFormImplItemApplicationImpl extends BaseApplication impleme
changeFormImplItemRepository.delete(id); changeFormImplItemRepository.delete(id);
} }
} }
@Override
public Map<String, Object> findByOldId(EpChangeFormQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "epChangeFormItemByOldId");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
queryModel.putDictionary("confirm", DictUtil.getDictionary("confirm"));
return this.sqlExecutorDao.executeSlicedQuery(queryModel);
}
} }
...@@ -52,4 +52,12 @@ public class EpChangeFormStockItemApplicationImpl extends BaseApplication implem ...@@ -52,4 +52,12 @@ public class EpChangeFormStockItemApplicationImpl extends BaseApplication implem
changeFormStockItemRepository.delete(id); changeFormStockItemRepository.delete(id);
} }
} }
@Override
public Map<String, Object> findByOldId(EpChangeFormQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "epChangeFormStockItemByOldId");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
queryModel.putDictionary("confirm", DictUtil.getDictionary("confirm"));
return this.sqlExecutorDao.executeSlicedQuery(queryModel);
}
} }
...@@ -8,11 +8,15 @@ import com.huigou.topsun.ep.change.application.EpChangeFormImplItemApplication; ...@@ -8,11 +8,15 @@ import com.huigou.topsun.ep.change.application.EpChangeFormImplItemApplication;
import com.huigou.topsun.ep.change.application.EpChangeFormStockItemApplication; import com.huigou.topsun.ep.change.application.EpChangeFormStockItemApplication;
import com.huigou.topsun.ep.change.domain.EpChangeForm; import com.huigou.topsun.ep.change.domain.EpChangeForm;
import com.huigou.topsun.ep.change.domain.query.EpChangeFormQueryRequest; import com.huigou.topsun.ep.change.domain.query.EpChangeFormQueryRequest;
import com.huigou.topsun.sap.purchaseInfoRecord.application.SapPurchaseInfoRecordApplication;
import com.huigou.topsun.sap.purchaseInfoRecord.domain.SapPurchaseInfoRecord;
import com.huigou.uasp.annotation.ControllerMapping; import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus; import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.engine.application.ActApplication; import com.huigou.uasp.bpm.engine.application.ActApplication;
import com.huigou.uasp.client.CommonController; import com.huigou.uasp.client.CommonController;
import com.huigou.util.ClassHelper;
import com.huigou.util.SDO; import com.huigou.util.SDO;
import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -93,14 +97,27 @@ public class EpChangeFormController extends CommonController { ...@@ -93,14 +97,27 @@ public class EpChangeFormController extends CommonController {
public String slicedEpChangeFormImplItems(){ public String slicedEpChangeFormImplItems(){
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
EpChangeFormQueryRequest queryRequest = sdo.toQueryRequest(EpChangeFormQueryRequest.class); EpChangeFormQueryRequest queryRequest = sdo.toQueryRequest(EpChangeFormQueryRequest.class);
return toResult(changeFormImplItemApplication.findByEpChangeFormId(queryRequest)); Map<String, Object> map = new HashMap<>();
if (StringUtil.isNotBlank(queryRequest.getEpChangeFormId())){
map = changeFormImplItemApplication.findByEpChangeFormId(queryRequest);
}
if (StringUtil.isNotBlank(queryRequest.getOldId()) && StringUtil.isBlank(queryRequest.getEpChangeFormId())){
map = changeFormImplItemApplication.findByOldId(queryRequest);
}
return toResult(map);
} }
public String slicedEpChangeFormStockItems(){ public String slicedEpChangeFormStockItems(){
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
EpChangeFormQueryRequest queryRequest = sdo.toQueryRequest(EpChangeFormQueryRequest.class); EpChangeFormQueryRequest queryRequest = sdo.toQueryRequest(EpChangeFormQueryRequest.class);
//String epChangeFormId = sdo.getString("epChangeFormId"); Map<String, Object> map = new HashMap<>();
return toResult(changeFormStockItemApplication.findByEpChangeFormId(queryRequest)); if (StringUtil.isNotBlank(queryRequest.getEpChangeFormId())){
map = changeFormStockItemApplication.findByEpChangeFormId(queryRequest);
}
if (StringUtil.isNotBlank(queryRequest.getOldId()) && StringUtil.isBlank(queryRequest.getEpChangeFormId())){
map = changeFormStockItemApplication.findByOldId(queryRequest);
}
return toResult(map);
} }
public String deleteEpChangeFormImplItem(){ public String deleteEpChangeFormImplItem(){
...@@ -130,4 +147,38 @@ public class EpChangeFormController extends CommonController { ...@@ -130,4 +147,38 @@ public class EpChangeFormController extends CommonController {
String pintPage = String.format((String) map.get("printPage")); String pintPage = String.format((String) map.get("printPage"));
return outputAndProcUnitHandlerPDF(pintPage, id, map); return outputAndProcUnitHandlerPDF(pintPage, id, map);
} }
/**
* 复制功能
* @return
*/
public String copyEpChangeForm(){
/**
* 设置jsp页面初始化填充数据,如果不设置, 那么在jsp页面上填写完表单之后立即提交申请TaskDescription获取不到时间和相关人员信息
*/
SDO sdo = this.getSDO();
String id = sdo.getString("id");
this.putAttribute("oldId", id);
this.putAttribute("processDefinitionKey", EpChangeFormApplication.PROCESS_DEFINITION_KEY);
// 新增的时候procUnitId一定要设置成Apply,不然jsp页面的所有表单元素是readonly状态
this.putAttribute("procUnitId", "Apply");
EpChangeForm epChangeFormDb = epChangeFormApplication.findEpChangeFormById(id);
EpChangeForm epChangeForm = new EpChangeForm();
ClassHelper.copyProperties(epChangeFormDb,epChangeForm);
epChangeForm.setId("");
epChangeForm.setBillCode("");
epChangeForm.setCode("");
epChangeForm.setMsg("");
epChangeForm.setStatusId(BizBillStatus.APPLYING.getId());
Operator operator = getOperator();
epChangeForm.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
Map<String, String> reasonForChange = new HashMap<>();
if ("".equals(epChangeForm.getReasonForChange())){
return forward("epMaterialChangeFormDetail",epChangeForm);
}else {
reasonForChange = DictUtil.getDictionary("reasonForChange");
this.putAttribute("reasonForChangeList",reasonForChange);
return forward("epChangeFormDetail",epChangeForm);
}
}
} }
...@@ -13,4 +13,5 @@ public class EpChangeFormQueryRequest extends QueryAbstractRequest { ...@@ -13,4 +13,5 @@ public class EpChangeFormQueryRequest extends QueryAbstractRequest {
private String billCode; private String billCode;
private String epChangeFormId; private String epChangeFormId;
private String id; private String id;
private String oldId;
} }
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<query-mappings> <query-mappings>
<query name="epChangeForm" label="EP销售订单" table="ep_change_form"> <query name="epChangeForm" label="EP变更单" table="ep_change_form">
<sql-query> <sql-query>
select t.* from ep_change_form t select t.* from ep_change_form t
</sql-query> </sql-query>
...@@ -8,18 +8,25 @@ ...@@ -8,18 +8,25 @@
<condition column="id" name="id" type="java.lang.String" symbol="=" alias="t"/> <condition column="id" name="id" type="java.lang.String" symbol="=" alias="t"/>
</query> </query>
<query name="epSaleOrderItems" label="EP销售订单明细" table="ep_sale_order_item"> <query name="epChangeFormStockItem">
<sql-query> <sql-query>
select t.* from ep_sale_order_item t select t.* from ep_change_form_stock_item t where 1=1
</sql-query> </sql-query>
<condition column="ep_sale_order_id" name="epSaleOrderId" type="java.lang.String" symbol="=" alias="t"/> <condition column="ep_change_form_id" name="epChangeFormId" type="java.lang.String" symbol="=" alias="t"/>
</query> </query>
<query name="epChangeFormStockItem"> <query name="epChangeFormStockItemByOldId">
<sql-query> <sql-query>
select t.* from ep_change_form_stock_item t where 1=1 select t.dept_id,
t.dept_name,
t.description,
t.confirm,
t.date,
t.executor_id,
t.executor,
t.comments from ep_change_form_stock_item t where 1=1
</sql-query> </sql-query>
<condition column="ep_change_form_id" name="epChangeFormId" type="java.lang.String" symbol="=" alias="t"/> <condition column="ep_change_form_id" name="oldId" type="java.lang.String" symbol="=" alias="t"/>
</query> </query>
<query name="epChangeFormImplItem"> <query name="epChangeFormImplItem">
...@@ -29,6 +36,20 @@ ...@@ -29,6 +36,20 @@
<condition column="ep_change_form_id" name="epChangeFormId" type="java.lang.String" symbol="=" alias="t"/> <condition column="ep_change_form_id" name="epChangeFormId" type="java.lang.String" symbol="=" alias="t"/>
</query> </query>
<query name="epChangeFormItemByOldId">
<sql-query>
select t.dept_id,
t.dept_name,
t.executor_id,
t.executor,
t.confirm,
t.date,
t.follow_matter,
t.comments from ep_change_form_impl_item t where 1=1
</sql-query>
<condition column="ep_change_form_id" name="oldId" type="java.lang.String" symbol="=" alias="t"/>
</query>
<query name="queryApprovalPersons"> <query name="queryApprovalPersons">
<sql-query> <sql-query>
<!--SELECT <!--SELECT
......
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