Commit 73e51cc1 by 江和松

导出功能修改

parent 9a75de24
......@@ -180,5 +180,21 @@ public class ServiceHGSC009 extends ServiceEPBase {
});
}
@OperationLogAnnotation(operModul = "材料计划",operType = "导入",operDesc = "导入操作")
public EiInfo importDate(EiInfo inInfo) {
try {
Map<String, Object> params = new HashMap<>(10);
String fileName = inInfo.getString("fileName");
params.put(HGSC009A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
//解析文件,将文件中数据传入到inInfo中
ExcelUtils.importFromExcel(inInfo, fileName, params, new HGSC009A());
}catch (Exception e){
inInfo.setStatus(EiConstant.STATUS_FAILURE);
LogUtils.setDetailMsg(inInfo, e, "导入失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cb.domain.HGCB001;
import com.baosight.hggp.hg.cb.tools.HGCBTools;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.domain.HGCG001A;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC004;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-05-29 16:14:52
Version : 1.0
schema : hggp
tableName : HGSC008A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
PLAN_MATERIAL_CODE VARCHAR,
PLAN_MATERIAL_NAME VARCHAR,
INVENT_CODE VARCHAR,
INVENT_NAME VARCHAR,
SPEC VARCHAR,
MATERIAL VARCHAR,
LENGTH DECIMAL,
WIDTH DECIMAL,
THICK DECIMAL,
QUANTITY DECIMAL,
SINGLE_WEIGHT DECIMAL,
GROSS_AMOUNT DECIMAL,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC009A">
<sql id="condition">
......
......@@ -1259,6 +1259,13 @@ public class HGSCTools {
AssertUtils.isEmpty(results,"材料明细不能为空!");
return results;
}
public static void add(List<Map> arrayList) {
for (Map map:arrayList) {
HGSC009A hgsc009A = new HGSC009A();
hgsc009A.fromMap(map);
}
}
}
}
......@@ -4,6 +4,7 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.sj.domain.HGSJ003;
import com.baosight.hggp.hg.sj.tools.HGSJTools;
import com.baosight.hggp.util.importer.Importer;
......@@ -246,6 +247,11 @@ public class ExcelUtils {
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("导入成功" + arrayList.size() + "条");
break;
case "HGSC009":
HGSCTools.THGSC009.add(arrayList);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("导入成功" + arrayList.size() + "条");
break;
default:
}
......
......@@ -36,7 +36,7 @@ $(function () {
}
}, {
field: "companyCode",
title: "公司名称",
title: "公司编码",
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['companyCode'] === dataItem['companyCode']) {
......@@ -97,6 +97,12 @@ $(function () {
],
beforeEdit: function (e) {
let item = e.model;
if(item.status != '0'){
e.preventDefault();
}
},
loadComplete: function (grid) {
$("#INSERTCG").on("click", INSERTCG);
......@@ -168,6 +174,50 @@ $(function () {
};
grush.openImportBox();
IPLATUI.EFUpload = {
fileUpload: {
showFileList: false,
upload: function (e) {
openFileWindow.close();
IPLAT.progress($("body"), true);
},
success: function (e) {
var src = e.response.docUrl;
var eiInfo = new EiInfo();
let notIsExcelFile = isExcelFile(src);
eiInfo.set("fileName", src);
EiCommunicator.send("HGSC009", "importDate", eiInfo, {
onSuccess(ei) {
if (notIsExcelFile) {
NotificationUtil("请导入xls或xlsx文件", "error");
return;
}
if (ei.status == "-1") {
NotificationUtil(
{msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
query();
}
},
onFail(ei) {
NotificationUtil("调用失败,原因[" + ei + "]", "error");
}
},
{
async: false
});
IPLAT.progress($("body"), false);
},
fail(e) {
IPLAT.NotificationUtil('导入失败!', "error");
}
}
}
grush.downloadFile(`${ctx}\\common\\template\\SC\\HGSC009A_材料计划.xls`);
});
let query = function () {
......@@ -182,12 +232,12 @@ function showUploadFile(companyCode,companyName,projCode,projName,planMaterialCo
JSColorbox.open({
href: "HGSC009A?methodName=initLoad&" +
"inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-companyName=" + companyName +
"&inqu_status-0-status=" + status+
"&inqu_status-0-planMaterialCode=" + planMaterialCode +
"&inqu_status-0-planMaterialName="+ planMaterialName +
"&inqu_status-0-projCode=" + projCode +
"&inqu_status-0-projName=" + projName +
"&inqu_status-0-status=" + status ,
"&inqu_status-0-companyName=" + companyName +
"&inqu_status-0-planMaterialName="+ planMaterialName +
"&inqu_status-0-projName=" + projName ,
title: "<div style='text-align: center;'>材料计划清单</div>",
width: "80%",
height: "80%",
......
......@@ -11,7 +11,9 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="材料计划">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
......@@ -56,5 +58,10 @@
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
<EF:EFWindow id="openFile">
<EF:EFRegion id="upload" title="文件导入区">
<div id="button"></div>
<EF:EFUpload ename="fileUpload" cname="导入" docTag="HGSC009" path="sc"/>
</EF:EFRegion>
</EF:EFWindow>
</EF:EFPage>
......@@ -51,6 +51,13 @@ $(function () {
});
}
}],
beforeEdit: function (e) {
var status = $("#inqu_status-0-status").val();
//如果提交了,则不能修改
if(status && status === "1"){
e.preventDefault();
}
},
loadComplete: function (grid) {
// 此grid对象
grid.dataSource.bind("change", function (e) {
......@@ -110,6 +117,7 @@ $(window).load(function () {
$(".k-grid-cancel-changes").hide();
$(".k-grid-delete").hide();
}
});
/**
......
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