Commit c8c6c7d0 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents de1d5b47 9bbb3cba
......@@ -5,6 +5,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.tools.EDTools;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
......@@ -109,7 +110,7 @@ public class ServiceHGSC003B extends ServiceEPBase {
hgsc099.fromMap(resultRows.get(i));
DaoUtils.update(HGSC099.DELETE, hgsc099);
if (!hgsc099.getDocId().isEmpty()) {
this.delectDoc(hgsc099.getDocId());
HGSCTools.THGSC099.delectDoc(hgsc099.getDocId());
}
}
inInfo = this.query(inInfo);
......@@ -120,44 +121,4 @@ public class ServiceHGSC003B extends ServiceEPBase {
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGSC099.FIELD_doc_id,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.tools.EDTools;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.sc.domain.HGSC099;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -109,7 +110,7 @@ public class ServiceHGSC004B extends ServiceEPBase {
hgsc099.fromMap(resultRows.get(i));
DaoUtils.update(HGSC099.DELETE, hgsc099);
if (!hgsc099.getDocId().isEmpty()) {
this.delectDoc(hgsc099.getDocId());
HGSCTools.THGSC099.delectDoc(hgsc099.getDocId());
}
}
inInfo = this.query(inInfo);
......@@ -120,44 +121,4 @@ public class ServiceHGSC004B extends ServiceEPBase {
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGSC099.FIELD_doc_id,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
......@@ -1322,29 +1322,29 @@ public class HGSCTools {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGSC099.FIELD_doc_id,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
// if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
// EiInfo queryInfo = new EiInfo();
// queryInfo.set(HGSC099.FIELD_doc_id,list.get(0).getDocId());
// //获取文档信息
// queryInfo.set(EiConstant.serviceId,"S_EU_0102");
// EiInfo docInfo = XServiceManager.call(queryInfo);
// //数据库
// Map docInfoMap = docInfo.getMap("docMap");
// if (docInfoMap.size() > 0) {
// EiInfo eiInfo = new EiInfo();
// eiInfo.set("data",docInfoMap.get("url")+"-"+0);
// eiInfo.set(EiConstant.serviceId,"S_EU_0105");
// //调用接口
// EiInfo outInfo = XServiceManager.call(eiInfo);
//
// if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
// LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
// outInfo.setMsg("失败");
// }
// }
// }else {
FileUtils.deleteFile(realPath);
}
// }
DaoBase.getInstance().delete(HGDS002.DELETE,map);
}
......
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable:false,
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [
],
loadComplete: function (grid) {
......
......@@ -6,7 +6,7 @@ $(function() {
$("#QUERY").on("click", query);
$("#BATCH_FLOW").on("click", function () {
showFlowDetail();
batchFlow();
});
IPLATUI.EFGrid.result = {
......@@ -294,25 +294,45 @@ function showFlowDetail(id,inventCode,flowId) {
});
}
// function showFlowDetail() {
// let rows = resultGrid.getCheckedRows();
// let selectIds = [];
// //selectIds.push(rows[i]['id']);
// if (rows.length < 1) {
// message("请选择数据")
// return;
// }
// $.each(rows, function(index, item) {
// selectIds.push(item.get("id"));
// });
// JSColorbox.open({
// href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentIds=" + selectIds,
// title: "<div style='text-align: center;'>工艺流程</div>",
// width: "75%",
// height: "80%",
// callbackName: cllback2
// });
// }
function batchFlow() {
let rows = resultGrid.getCheckedRows();
let selectIds = [];
if (rows.length < 1) {
message("请选择数据")
return;
}
let inventType;
let flag = true;
$.each(rows, function(index, item) {
selectIds.push(item.get("id"));
//不存在就直接赋值
if(!inventType){
inventType = item.get("inventType")
}else{
//存在就与当前类型对比
if(inventType != item.get("inventType")){
message("只能选择同一个类型存货")
flag = false;
return false;
}
}
if(item.get("flowId") >0 ){
message("只能选择未分配的存货")
flag = false;
return false;
}
});
if(flag){
JSColorbox.open({
href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentIds=" + selectIds,
title: "<div style='text-align: center;'>工艺流程</div>",
width: "75%",
height: "80%",
callbackName: cllback2
});
}
}
/**
* 回调
......
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