Commit 67d165ce authored by wanghang's avatar wanghang

指导书

parent 8b937322
...@@ -61,6 +61,5 @@ function getExtendedData(processAction) { ...@@ -61,6 +61,5 @@ function getExtendedData(processAction) {
$('#submitForm').attr('check', false); $('#submitForm').attr('check', false);
} }
return getTableResult(); return getTableResult();
} }
...@@ -19,6 +19,7 @@ function initialize() { ...@@ -19,6 +19,7 @@ function initialize() {
showTable({proofingMakeId:$("#proofingMakeId").val()}); showTable({proofingMakeId:$("#proofingMakeId").val()});
} }
$("#formButton").hide(); $("#formButton").hide();
$("#jobPageTop").hide();
} }
} }
...@@ -55,14 +56,15 @@ function saveForm() { ...@@ -55,14 +56,15 @@ function saveForm() {
_self.close(); _self.close();
} }
}); });
//新开作业指导申请书页 // //新开作业指导申请书页
let productId = $("#productId").val(); // let productId = $("#productId").val();
let proofingMakeNo = $("#proofingMakeNo").val(); // let proofingMakeNo = $("#proofingMakeNo").val();
UICtrl.addTabItem({ // UICtrl.addTabItem({
tabid: 'workInstructionApply' + proofingMakeNo, // tabid: 'workInstructionApply' + proofingMakeNo,
text: "作业指导申请书", // text: "作业指导申请书",
url: web_app.name + '/workInstructionApply/forwardWorkInstructionApply.do?productId=' + productId // url: web_app.name + '/workInstructionApply/forwardWorkInstructionApply.do?productId=' + productId
}); // });
} }
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
$(document).ready(function () { $(document).ready(function () {
initializateUI(); initializateUI();
loadTechnologyListGrid(); loadProofingMakeListGrid();
}); });
function initializateUI() { function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3}); UICtrl.layout("#layout", {leftWidth: 3});
} }
function loadTechnologyListGrid() { function loadProofingMakeListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({ var toolbarOptions = UICtrl.getDefaultToolbarOptions({
deleteHandler: deleteHandler, deleteHandler: deleteHandler,
......
...@@ -321,6 +321,7 @@ function getTableResult(){ ...@@ -321,6 +321,7 @@ function getTableResult(){
let processResult =processObj.gridManager.getSelectedRows(); let processResult =processObj.gridManager.getSelectedRows();
let processMaterialResult = processBomObj.gridManager.getSelectedRows(); let processMaterialResult = processBomObj.gridManager.getSelectedRows();
getExtendedData()
if(!technologyResult){ if(!technologyResult){
alert("请选择工艺!") alert("请选择工艺!")
return false; return false;
......
$(document).ready(function () { $(document).ready(function () {
bindQueryEvent(); bindQueryEvent();
initialize();
}); });
function initialize() {
/**
* 如果是详情页,展示数据,隐藏按钮
* @type {boolean}
*/
let isDetailPage = ($("#isDetailPage").val() === "true");
if (isDetailPage) {
$("#formButton").hide();
$("#jobPageTop").hide();
}
}
//绑定selectC //绑定selectC
function bindQueryEvent() { function bindQueryEvent() {
$('#productCode').searchbox({ $('#productCode').searchbox({
...@@ -21,7 +37,7 @@ function saveForm(){ ...@@ -21,7 +37,7 @@ function saveForm(){
success : function(data) { success : function(data) {
if (data !== null){ if (data !== null){
Public.successTip("保存成功!"); Public.successTip("保存成功!");
addTabWorkInstruction(data.workInstructionApplyId); // addTabWorkInstruction(data.workInstructionApplyId);
} }
_self.close(); _self.close();
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<x:script src='/biz/topsun/common/purchaseCommon.js'/> <x:script src='/biz/topsun/common/purchaseCommon.js'/>
<x:script src='/biz/topsun/proofing/workInstructionApply.js'/> <x:script src='/biz/topsun/proofing/workInstructionApply.js'/>
<div class="container-fluid" style="padding: 10px;"> <div class="container-fluid" style="padding: 10px;">
<x:hidden name="isDetailPage" value="false"/> <!--是否是详情页-->
<form class="hg-form" method="post" action="" id="submitForm"> <form class="hg-form" method="post" action="" id="submitForm">
<x:billTitle title="作业指导申请书" needStatus="false" needPerson="true"/> <x:billTitle title="作业指导申请书" needStatus="false" needPerson="true"/>
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
......
var gridManager = null;
$(document).ready(function () {
debugger
initializateUI();
loadWorkInstructionApplyListGrid();
});
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
function loadWorkInstructionApplyListGrid() {
// var toolbarOptions = UICtrl.getDefaultToolbarOptions({
//
// deleteHandler: deleteHandler,
// });
gridManager = UICtrl.grid("#workInstructionApplyTableGrid", {
columns: [
{display: "规格书编号", name: "specificationNo", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "换算值", name: "matrixingValue", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "尺码组", name: "sizeGroup", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "是否禁用", name: "isDisable", width: 140, minWidth: 60, type: "string", align: "left"},
],
dataAction: "server",
url: web_app.name + '/workInstructionApply/slicedQueryWorkInstructionApplyList.ajax',
pageSize: 10,
usePager: true,
// toolbar: toolbarOptions,
width: "100%",
height: "100%",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow: function (data, rowindex, rowobj) {
doView(data.workInstructionApplyId);
}
});
UICtrl.setSearchAreaToggle(gridManager);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function reloadGrid() {
gridManager.loadData();
}
function resetForm(obj) {
$(obj).formClean();
}
// function addHandler() {
// UICtrl.showAjaxDialog({
// url: web_app.name + '/proofingMake/forwardSaveProofingMake.load',
// title: "新增打样制造单",
// width: 1000,
// ok: function (div) {
// var _self = this;
// $('#submitForm', div).ajaxSubmit({
// url: web_app.name + '/proofingMake/saveProofingMake.ajax',
// success: function () {
// _self.close();
// reloadGrid();
// }
// });
// }
// });
// }
// function updateHandler(proofingMakeId) {
// if (!proofingMakeId) {
// console.log(gridManager)
// //获取所选行id
// proofingMakeId = DataUtil.getUpdateRowId(gridManager);
// if (!proofingMakeId) {
// return;
// }
// }
// UICtrl.showAjaxDialog({
// url: web_app.name + '/proofingMake/forwardSaveProofingMake.load',
// title: "修改打样制造单",
// width: 1000,
// param: {id: proofingMakeId},
// ok: function (div) {
// var _self = this;
// $('#submitForm', div).ajaxSubmit({
// url: web_app.name + '/proofingMake/saveProofingMake.ajax',
// success: function () {
// _self.close();
// reloadGrid();
// }
// });
// }
// });
// }
//重写DataUtil的getUpdateRowId函数、它默认取行的id列
DataUtil.getUpdateRowId = function (gridManager) {
var result = DataUtil.getUpdateRow(gridManager);
if (result) {
return result.proofingMakeId;
}
return result;
}
//删除按钮
// function deleteHandler() {
// DataUtil.del({
// action: 'proofingMake/deleteProofingMakeByProofingMakeId.ajax',
// gridManager: gridManager, idFieldName: 'proofingMakeId',
// onSuccess: function () {
// reloadGrid();
// }
// });
// }
function doView(workInstructionApplyId) {
UICtrl.addTabItem({
tabid: 'workInstructionApply'+workInstructionApplyId,
text: "作业申请书详情",
url: web_app.name + '/workInstructionApply/forwardDetailsWorkInstructionApply.job?id='+workInstructionApplyId
});
}
\ 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" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree"/>
<x:script src='/biz/topsun/proofing/workInstructionApplyList.js'/>
</head>
<body>
<div class="container-fluid">
<div class="ui-hide">
<x:select name="processType" dictionary="processType"/>
<x:select name="yesorno" dictionary="yesorno"/>
</div>
<div id="layout">
<div position="center" title="作业申请书">
<x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/>
<form class="hg-form ui-hide" method="post" action="" id="queryMainForm">
<x:inputC name="ruleKind" required="false" label="作业指导申请书" labelCol="1"/>
<x:searchButtons/>
</form>
<div class="blank_div clearfix"></div>
<div id="workInstructionApplyTableGrid" style="margin: 2px;"></div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
package com.huigou.topsun.proofing.application; package com.huigou.topsun.proofing.application;
import com.huigou.topsun.proofing.domain.WorkInstructionApply; import com.huigou.topsun.proofing.domain.workInstructionApply.model.WorkInstructionApply;
import com.huigou.topsun.proofing.domain.workInstructionApply.query.WorkInstructionApplyQueryRequest;
import java.util.Map;
public interface WorkInstructionApplyApplication { public interface WorkInstructionApplyApplication {
String QUERY_XML_FILE_PATH = "config/topsun/proofing/workInstructionApply.xml";
void saveWorkInstructionApply(WorkInstructionApply workInstructionApply); void saveWorkInstructionApply(WorkInstructionApply workInstructionApply);
Map<String, Object> slicedWorkInstructionApplyList(WorkInstructionApplyQueryRequest query);
WorkInstructionApply getWorkInstructionApplyById(String workInstructionApplyId);
} }
...@@ -70,19 +70,6 @@ public class ProofingApplyApplicationImpl extends FlowBroker implements Proofing ...@@ -70,19 +70,6 @@ public class ProofingApplyApplicationImpl extends FlowBroker implements Proofing
protected String saveBizAndApprovalData() { protected String saveBizAndApprovalData() {
super.saveBizAndApprovalData(); super.saveBizAndApprovalData();
ProofingApplyBaseInfo proofingApply = getBizEntity(ProofingApplyBaseInfo.class); ProofingApplyBaseInfo proofingApply = getBizEntity(ProofingApplyBaseInfo.class);
SDO sdo = this.getBizAndApprovalData();
String technologyJSON = sdo.getString("technology");
String processJSON = sdo.getString("process");
String processMaterialJSON = sdo.getString("processMaterial");
ObjectMapper objectMapper = new ObjectMapper();
ProofingApplyTechnology proofingTechnology = objectMapper.readValue(technologyJSON, ProofingApplyTechnology.class);
List<ProofingApplyProcess> processList = objectMapper.readValue(processJSON, new TypeReference<List<ProofingApplyProcess>>() {});
List<ProofingApplyProcessMaterial> processMaterialList = objectMapper.readValue(processMaterialJSON, new TypeReference<List<ProofingApplyProcessMaterial>>() {});
ProofingApplyLooked proofingApplyLooked = getBizEntity(ProofingApplyLooked.class);
if (proofingApply.isNew()) { if (proofingApply.isNew()) {
proofingApply.setStatusId(BizBillStatus.APPLYING.getId()); proofingApply.setStatusId(BizBillStatus.APPLYING.getId());
} else { } else {
...@@ -97,9 +84,22 @@ public class ProofingApplyApplicationImpl extends FlowBroker implements Proofing ...@@ -97,9 +84,22 @@ public class ProofingApplyApplicationImpl extends FlowBroker implements Proofing
if(!StringUtil.isBlank(proofingApply.getProofingApplyNgReReason())){ if(!StringUtil.isBlank(proofingApply.getProofingApplyNgReReason())){
proofingApply.setProofingApplyApplicationStatus("2"); proofingApply.setProofingApplyApplicationStatus("2");
} }
proofingApply = proofingApplyRepository.save(proofingApply); proofingApply = proofingApplyRepository.save(proofingApply);
// if(true) return proofingApply.getId();
SDO sdo = this.getBizAndApprovalData();
String technologyJSON = sdo.getString("technology");
String processJSON = sdo.getString("process");
String processMaterialJSON = sdo.getString("processMaterial");
ObjectMapper objectMapper = new ObjectMapper();
ProofingApplyTechnology proofingTechnology = objectMapper.readValue(technologyJSON, ProofingApplyTechnology.class);
List<ProofingApplyProcess> processList = objectMapper.readValue(processJSON, new TypeReference<List<ProofingApplyProcess>>() {});
List<ProofingApplyProcessMaterial> processMaterialList = objectMapper.readValue(processMaterialJSON, new TypeReference<List<ProofingApplyProcessMaterial>>() {});
ProofingApplyLooked proofingApplyLooked = getBizEntity(ProofingApplyLooked.class);
ProofingApplyLooked looked = proofingApplyLookedRepository.findByProofingApplyId(proofingApply.getProofingApplyId()); ProofingApplyLooked looked = proofingApplyLookedRepository.findByProofingApplyId(proofingApply.getProofingApplyId());
//录入ProofingApplyLooked是先判断是需要新增还是修改 //录入ProofingApplyLooked是先判断是需要新增还是修改
......
package com.huigou.topsun.proofing.application.impl; package com.huigou.topsun.proofing.application.impl;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.topsun.proofing.application.WorkInstructionApplyApplication; import com.huigou.topsun.proofing.application.WorkInstructionApplyApplication;
import com.huigou.topsun.proofing.domain.WorkInstructionApply; import com.huigou.topsun.proofing.domain.proofingMake.query.ProofingMakeQueryRequest;
import com.huigou.topsun.proofing.domain.workInstructionApply.model.WorkInstructionApply;
import com.huigou.topsun.proofing.domain.workInstructionApply.query.WorkInstructionApplyQueryRequest;
import com.huigou.topsun.proofing.repository.WorkInstructionApplyRepository; import com.huigou.topsun.proofing.repository.WorkInstructionApplyRepository;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map;
@Service @Service
public class WorkInstructionApplyApplicationImpl implements WorkInstructionApplyApplication { public class WorkInstructionApplyApplicationImpl extends BaseApplication implements WorkInstructionApplyApplication {
@Autowired @Autowired
WorkInstructionApplyRepository workInstructionApplyRepository; WorkInstructionApplyRepository workInstructionApplyRepository;
...@@ -16,5 +22,18 @@ public class WorkInstructionApplyApplicationImpl implements WorkInstructionApply ...@@ -16,5 +22,18 @@ public class WorkInstructionApplyApplicationImpl implements WorkInstructionApply
public void saveWorkInstructionApply(WorkInstructionApply workInstructionApply) { public void saveWorkInstructionApply(WorkInstructionApply workInstructionApply) {
workInstructionApplyRepository.save(workInstructionApply); workInstructionApplyRepository.save(workInstructionApply);
} }
@Override
public Map<String, Object> slicedWorkInstructionApplyList(WorkInstructionApplyQueryRequest query) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedWorkInstructionApplyList");
return this.sqlExecutorDao.executeSlicedQuery(queryDescriptor,query);
}
@Override
public WorkInstructionApply getWorkInstructionApplyById(String workInstructionApplyId) {
return workInstructionApplyRepository.findOne(workInstructionApplyId);
}
} }
...@@ -2,13 +2,16 @@ package com.huigou.topsun.proofing.controller; ...@@ -2,13 +2,16 @@ package com.huigou.topsun.proofing.controller;
import com.huigou.topsun.product.application.ProductApplication; import com.huigou.topsun.product.application.ProductApplication;
import com.huigou.topsun.proofing.application.WorkInstructionApplyApplication; import com.huigou.topsun.proofing.application.WorkInstructionApplyApplication;
import com.huigou.topsun.proofing.domain.WorkInstructionApply; import com.huigou.topsun.proofing.domain.vo.ProofingMakeVo;
import com.huigou.topsun.proofing.domain.workInstructionApply.model.WorkInstructionApply;
import com.huigou.topsun.proofing.domain.workInstructionApply.query.WorkInstructionApplyQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping; import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController; import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO; import com.huigou.util.SDO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
...@@ -26,6 +29,14 @@ public class WorkInstructionApplyController extends CommonController { ...@@ -26,6 +29,14 @@ public class WorkInstructionApplyController extends CommonController {
WorkInstructionApplyApplication workInstructionApplyApplication; WorkInstructionApplyApplication workInstructionApplyApplication;
/**
* 跳转打样制造查询页
* @return
*/
public String forwardWorkInstructionApplyList(){
return forward("workInstructionApplyList");
}
/** /**
* 跳转作业指导申请书 * 跳转作业指导申请书
* 如果有productId参数,就说明从打样制造单发送的请求,携带该参数跳转 * 如果有productId参数,就说明从打样制造单发送的请求,携带该参数跳转
...@@ -51,5 +62,25 @@ public class WorkInstructionApplyController extends CommonController { ...@@ -51,5 +62,25 @@ public class WorkInstructionApplyController extends CommonController {
return toResult(workInstructionApply); return toResult(workInstructionApply);
} }
/**
* 分页查询作业申请书
* @return
*/
public String slicedQueryWorkInstructionApplyList(){
SDO sdo = this.getSDO();
WorkInstructionApplyQueryRequest workInstructionApplyQueryRequest = sdo.toQueryRequest(WorkInstructionApplyQueryRequest.class);
Map<String, Object> map = workInstructionApplyApplication.slicedWorkInstructionApplyList(workInstructionApplyQueryRequest);
return toResult(map);
}
/**
* 跳转作业申请书详情页
*/
public String forwardDetailsWorkInstructionApply(){
SDO sdo = this.getSDO();
String id = sdo.getId();
this.putAttribute("isDetailPage","true");
WorkInstructionApply workInstructionApply =(id==null||"".equals(id))?null: workInstructionApplyApplication.getWorkInstructionApplyById(id);
return forward("workInstructionApply",workInstructionApply);
}
} }
package com.huigou.topsun.proofing.domain; package com.huigou.topsun.proofing.domain.workInstructionApply.model;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.*; import javax.persistence.*;
......
package com.huigou.topsun.proofing.domain.workInstructionApply.query;
import com.huigou.data.domain.query.QueryAbstractRequest;
import lombok.Data;
/**
* 作业指导申请书
*/
@Data
public class WorkInstructionApplyQueryRequest extends QueryAbstractRequest {
/**
* 作业指导申请书id
*/
private String workInstructionApplyId;
/**
* 打样制作单id
*/
private String proofingMakeId;
/**
* 规格书编号
*/
private String specificationNo;
/**
* 换算值
*/
private Integer matrixingValue;
/**
* 尺码组
*/
private String sizeGroup;
/**
* 是否禁用
*/
private String isDisable;
/**
* 是否创建新规格书
*/
private String isNewSpecification;
/**
* 是否要鞋图
*/
private String isShoePattern;
/**
* 是否附样品
*/
private String isAttachedSample;
/**
* 是否为唯一码产品
*/
private String isOnlyCode;
/**
* 是否不考虑形体配色
*/
private String isBodyColor;
}
\ No newline at end of file
package com.huigou.topsun.proofing.repository; package com.huigou.topsun.proofing.repository;
import com.huigou.topsun.proofing.domain.WorkInstructionApply; import com.huigou.topsun.proofing.domain.workInstructionApply.model.WorkInstructionApply;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
......
...@@ -29,5 +29,12 @@ ...@@ -29,5 +29,12 @@
</sql-query> </sql-query>
<condition column="proofing_make_technology_id" name="proofingMakeTechnologyId" type="java.lang.String" symbol="=" alias="t"/> <condition column="proofing_make_technology_id" name="proofingMakeTechnologyId" type="java.lang.String" symbol="=" alias="t"/>
</query> </query>
<!-- <query name="slicedWorkInstructionApplyList" table="work_instruction_apply">-->
<!-- <sql-query>-->
<!-- SELECT-->
<!-- wa.*-->
<!-- FROM-->
<!-- work_instruction_apply wa-->
<!-- </sql-query>-->
<!-- </query>-->
</query-mappings> </query-mappings>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<query-mappings>
<query name="slicedWorkInstructionApplyList" table="work_instruction_apply">
<sql-query>
SELECT
wa.*
FROM
work_instruction_apply wa
</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