Commit afb96ac9 by 江和松

物料清单明细页面删除、修改,关联生产计划单bug修改

parent 3125b7e4
...@@ -94,6 +94,8 @@ public class HGSC004A extends DaoEPBase { ...@@ -94,6 +94,8 @@ public class HGSC004A extends DaoEPBase {
public static final String BATCH_CHANGE_TYPE = "HGSC004A.changeType"; public static final String BATCH_CHANGE_TYPE = "HGSC004A.changeType";
public static final String QUERY_ALL = "HGSC004A.queryAll"; public static final String QUERY_ALL = "HGSC004A.queryAll";
public static final String UPDATE_PRODUCT_STATUS = "HGSC004A.updateProductStatus"; public static final String UPDATE_PRODUCT_STATUS = "HGSC004A.updateProductStatus";
public static final String MAX_ID = "HGSC004A.maxId";
public static final String QUERY_TECHFLOW_ID_BY_PRODUCTID = "HGSC004A.queryTechFlowIdByProductId";
......
...@@ -113,7 +113,7 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -113,7 +113,7 @@ public class ServiceHGSC004A extends ServiceBase {
//主表信息,用于取值 //主表信息,用于取值
Long materialId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id)); Long materialId = Long.valueOf(inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGSC004A.FIELD_material_id));
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY,HGSC004A.FIELD_id,materialId); HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC004A.FIELD_id,materialId);
if(Objects.nonNull(hgsc004)){ if(Objects.nonNull(hgsc004)){
hgsc004a.setCompanyCode(hgsc004.getCompanyCode()); hgsc004a.setCompanyCode(hgsc004.getCompanyCode());
hgsc004a.setCompanyName(hgsc004.getCompanyName()); hgsc004a.setCompanyName(hgsc004.getCompanyName());
...@@ -130,6 +130,8 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -130,6 +130,8 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004a.setLeaf(1); hgsc004a.setLeaf(1);
} }
this.checkSaveData(hgsc004a,hgsc003); this.checkSaveData(hgsc004a,hgsc003);
//蓝图信息,用于蓝图状态校验
HGSC004A flowHGSC004A = (HGSC004A) super.dao.get(HGSC004A.QUERY_TECHFLOW_ID_BY_PRODUCTID,HGSC004A.FIELD_product_id,hgsc004a.getProductId());
if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){ if(Objects.nonNull(hgsc004a.getId())&&hgsc004a.getId()!=0){
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){ if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a.setChangeType(HGConstant.ChangeType.TH); hgsc004a.setChangeType(HGConstant.ChangeType.TH);
...@@ -140,6 +142,8 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -140,6 +142,8 @@ public class ServiceHGSC004A extends ServiceBase {
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType"); BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004a.getId()); hgsc005a.setMatDetailId(hgsc004a.getId());
hgsc005a.setMatId(hgsc004.getId()); hgsc005a.setMatId(hgsc004.getId());
hgsc005a.setTechFlowId(flowHGSC004A.getTechFlowId());
hgsc005a.setFinishDate(hgsc004.getFinishDate());
if(hgsc004a.getLv().intValue() == 3){ if(hgsc004a.getLv().intValue() == 3){
hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode()); hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode());
}else{ }else{
...@@ -147,16 +151,22 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -147,16 +151,22 @@ public class ServiceHGSC004A extends ServiceBase {
} }
HGSCTools.THGSC005A.update(hgsc005a); HGSCTools.THGSC005A.update(hgsc005a);
}else { }else {
if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){ if(hgsc004.getMaterialStatus().intValue() == HGConstant.MaterialStatus.QBTJ){
hgsc004a.setChangeType(HGConstant.ChangeType.ZJ); hgsc004a.setChangeType(HGConstant.ChangeType.ZJ);
} }
hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ); hgsc004a.setProductStatus(HGConstant.ProductStatus.WTJ);
Map<String,Object> mapA = new HashMap<>();
Long maxID = (Long) dao.query(HGSC004A.MAX_ID,mapA, 0, -999999).get(0);
hgsc004a.setId(maxID+1);
DaoUtils.insert(HGSC004A.INSERT, hgsc004a); DaoUtils.insert(HGSC004A.INSERT, hgsc004a);
//子表 //子表
HGSC005A hgsc005a = new HGSC005A(); HGSC005A hgsc005a = new HGSC005A();
BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType"); BeanUtil.copyProperties(hgsc004a,hgsc005a,"id","productType");
hgsc005a.setMatDetailId(hgsc004a.getId()); hgsc005a.setMatDetailId(hgsc004a.getId());
hgsc005a.setMatId(hgsc004.getId()); hgsc005a.setMatId(hgsc004.getId());
hgsc005a.setTechFlowId(flowHGSC004A.getTechFlowId());
hgsc005a.setFinishDate(flowHGSC004A.getFinishDate());
if(hgsc004a.getLv().intValue() == 3){ if(hgsc004a.getLv().intValue() == 3){
hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode()); hgsc005a.setProductType(ProductTypeEnum.STRUCT.getCode());
}else{ }else{
...@@ -246,7 +256,7 @@ public class ServiceHGSC004A extends ServiceBase { ...@@ -246,7 +256,7 @@ public class ServiceHGSC004A extends ServiceBase {
hgsc004a.fromMap(map); hgsc004a.fromMap(map);
DaoUtils.update(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004a); DaoUtils.update(HGSC004A.UPDATE_PRODUCT_STATUS, hgsc004a);
} }
HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC001.FIELD_id,hgsc004a.getMaterialId()); HGSC004 hgsc004 = (HGSC004) super.dao.get(HGSC004.QUERY_BY_ID,HGSC004.FIELD_id,hgsc004a.getMaterialId());
if(Objects.nonNull(hgsc004)){ if(Objects.nonNull(hgsc004)){
Map<String,Object> mapA = new HashMap<>(); Map<String,Object> mapA = new HashMap<>();
......
...@@ -206,7 +206,22 @@ ...@@ -206,7 +206,22 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
</dynamic> </dynamic>
</select>
<select id="queryTechFlowIdByProductId" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.sc.domain.HGSC004A">
SELECT
b.flow_id as "techFlowId"
FROM ${hggpSchema}.hgpz005 b
WHERE 1=1
<isNotEmpty prepend=" AND " property="productId">
b.id = #productId#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
</dynamic>
</select> </select>
...@@ -346,6 +361,11 @@ ...@@ -346,6 +361,11 @@
ORDER BY CREATED_TIME DESC ORDER BY CREATED_TIME DESC
</select> </select>
<select id="maxId" resultClass="long">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGSC004A
</select>
<delete id="batchDelete"> <delete id="batchDelete">
DELETE FROM ${hggpSchema}.HGSC004A WHERE DELETE FROM ${hggpSchema}.HGSC004A WHERE
id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate> id IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
loadComplete: function(grid){
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 删除
$("#BTN_DELETE").on("click", deleteFunc);
},
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGSC099A?methodName=initLoad&inqu_status-0-bizType="+$("#inqu_status-0-bizType").val()+"&inqu_status-0-matId="+$("#inqu_status-0-matId").val(),
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param docId
*/
function uploadFileCallback(docId) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", $("#inqu_status-0-matId").val());
inEiInfo.set("result-0-docId", docId);
inEiInfo.set("result-0-bizType", $("#inqu_status-0-bizType").val());
EiCommunicator.send('HGSC099', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC099", "delete", true);
}
})
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
console.log($("#fileDocId").val())
saveTemp(e);
try {
parent.JSColorbox.setValueCallback(docId);
} catch (e){
}
},
}
};
function saveTemp(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
let result = new EiInfo();
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HGDS002", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件上传">
<EF:EFInput cname="主表ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_file11" path="HGSC"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
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