Commit 6338851e by wancheng

物料清单导入优化

parent b0b39c37
...@@ -138,7 +138,7 @@ public class HPSC002 extends DaoEPBase { ...@@ -138,7 +138,7 @@ public class HPSC002 extends DaoEPBase {
@ExcelAnno(index = 6) @ExcelAnno(index = 6)
private BigDecimal num = new BigDecimal(0.000); /* 数量*/ private BigDecimal num = new BigDecimal(0.000); /* 数量*/
@ExcelAnno(index = 7) @ExcelAnno(index = 7)
private BigDecimal unitWt = new BigDecimal(0.000); /* 单重*/ private BigDecimal unitWt = new BigDecimal(0.0); /* 单重*/
private BigDecimal totalWt = new BigDecimal(0.000); /* 总重*/ private BigDecimal totalWt = new BigDecimal(0.000); /* 总重*/
private String filePath1 = " "; /* 文件地址1*/ private String filePath1 = " "; /* 文件地址1*/
private String filePath2 = " "; /* 文件地址2*/ private String filePath2 = " "; /* 文件地址2*/
...@@ -225,21 +225,21 @@ public class HPSC002 extends DaoEPBase { ...@@ -225,21 +225,21 @@ public class HPSC002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_LENGTH); eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(12);
eiColumn.setDescName("长"); eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH); eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(12);
eiColumn.setDescName("宽"); eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK); eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12); eiColumn.setFieldLength(12);
eiColumn.setDescName("厚"); eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -261,7 +261,7 @@ public class HPSC002 extends DaoEPBase { ...@@ -261,7 +261,7 @@ public class HPSC002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_UNIT_WT); eiColumn = new EiColumn(FIELD_UNIT_WT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(1);
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("单重"); eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
......
...@@ -850,8 +850,37 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -850,8 +850,37 @@ public class ServiceHPSC002 extends ServiceBase {
String projName = (String) params.get("projName"); String projName = (String) params.get("projName");
String deliveryDate = (String) params.get("deliveryDate"); String deliveryDate = (String) params.get("deliveryDate");
String parentPrdtName = (String) params.get("parentPrdtName"); String parentPrdtName = (String) params.get("parentPrdtName");
int lv = Integer.parseInt((String) params.get("lv")) +1;
Boolean checkStatus = false;
StringBuffer sb = new StringBuffer();
// 写入数据 // 写入数据
for (HPSC002 hpsc002:dataList) { for (int i = 0;i < dataList.size(); i++) {
HPSC002 hpsc002 = new HPSC002();
hpsc002 = dataList.get(i);
hpsc002.setLv(lv);
//产品类型是否为空
if(hpsc002.getPrdtType()==null){
sb.append("导入失败:数据错误第"+(i+1)+"条,产品类型不能为空!!");
checkStatus = true;
}else{
//层级2
if (hpsc002.getLv() == 2 && hpsc002.getPrdtType() != 4) {
sb.append("导入失败:数据错误第"+(i+1)+"条,层级关系错误,当前层级只能导入部件清单!!");
checkStatus = true;
} else if (hpsc002.getLv() == 3) {
if (!(hpsc002.getPrdtType() == 3 || hpsc002.getPrdtType() == 2)) {
sb.append("导入失败:数据错误第"+(i+1)+"条,层级关系错误,当前层级只能导入零件或耗材清单!!");
checkStatus = true;
}
}
}
}
if (checkStatus) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg(sb.toString());
}else{
for (HPSC002 hpsc002: dataList) {
hpsc002.setLv(lv);
hpsc002.setParentId(parentId); hpsc002.setParentId(parentId);
hpsc002.setProjCode(projCode); hpsc002.setProjCode(projCode);
hpsc002.setProjName(projName); hpsc002.setProjName(projName);
...@@ -862,6 +891,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -862,6 +891,7 @@ public class ServiceHPSC002 extends ServiceBase {
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + dataList.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + dataList.size() + "]条数据保存成功!");
}
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败"); LogUtils.setDetailMsg(inInfo, e, "保存失败");
} }
......
...@@ -388,7 +388,8 @@ $(function () { ...@@ -388,7 +388,8 @@ $(function () {
href: "HPSC097?methodName=initLoad&inqu_status-0-id=route_001&inqu_status-0-parentId=" href: "HPSC097?methodName=initLoad&inqu_status-0-id=route_001&inqu_status-0-parentId="
+ nodeId + "&inqu_status-0-projCode=" + projCode + "&inqu_status-0-projName=" + nodeId + "&inqu_status-0-projCode=" + projCode + "&inqu_status-0-projName="
+ projName + "&inqu_status-0-parentPrdtName=" + parentPrdtName + projName + "&inqu_status-0-parentPrdtName=" + parentPrdtName
+ "&inqu_status-0-deliveryDate=" + deliveryDate, + "&inqu_status-0-deliveryDate=" + deliveryDate
+ "&inqu_status-0-lv=" + lv,
title: "<div style='text-align: center;'>导入</div>", title: "<div style='text-align: center;'>导入</div>",
width: "60%", width: "60%",
height: "50%", height: "50%",
...@@ -396,7 +397,7 @@ $(function () { ...@@ -396,7 +397,7 @@ $(function () {
// 刷新列表 // 刷新列表
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
// 刷新树 // 刷新树
updateTree(); refreshTree();
// 关闭弹窗 // 关闭弹窗
JSColorbox.close(); JSColorbox.close();
} }
......
...@@ -24,6 +24,7 @@ let upload = function () { ...@@ -24,6 +24,7 @@ let upload = function () {
let parentPrdtName = $("#inqu_status-0-parentPrdtName").val(); let parentPrdtName = $("#inqu_status-0-parentPrdtName").val();
let productionOrderNo = $("#inqu_status-0-productionOrderNo").val(); let productionOrderNo = $("#inqu_status-0-productionOrderNo").val();
let deliveryDate = $("#inqu_status-0-deliveryDate").val(); let deliveryDate = $("#inqu_status-0-deliveryDate").val();
let lv = $("#inqu_status-0-lv").val();
let _IPLAT = IPLAT; let _IPLAT = IPLAT;
_IPLAT.progress($("body"), true); _IPLAT.progress($("body"), true);
let formData = new FormData(); let formData = new FormData();
...@@ -35,6 +36,7 @@ let upload = function () { ...@@ -35,6 +36,7 @@ let upload = function () {
formData.append("projName", projName); formData.append("projName", projName);
formData.append("parentPrdtName", parentPrdtName); formData.append("parentPrdtName", parentPrdtName);
formData.append("deliveryDate", deliveryDate); formData.append("deliveryDate", deliveryDate);
formData.append("lv", lv);
} }
if(id === 'route_002'){ if(id === 'route_002'){
formData.append("id", id); formData.append("id", id);
...@@ -56,7 +58,12 @@ let upload = function () { ...@@ -56,7 +58,12 @@ let upload = function () {
processData: false, processData: false,
success: function (res) { success: function (res) {
_IPLAT.progress($("body"), false); _IPLAT.progress($("body"), false);
debugger;
if(res.status===0){
parent.JSColorbox.setValueCallback(); parent.JSColorbox.setValueCallback();
}else{
NotificationUtil(res.msg, "error");
}
}, },
error: function (res) { error: function (res) {
message(res.msg); message(res.msg);
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<EF:EFInput ename="inqu_status-0-parentPrdtName" cname="项目部件名称" type="hidden"/> <EF:EFInput ename="inqu_status-0-parentPrdtName" cname="项目部件名称" type="hidden"/>
<EF:EFInput ename="inqu_status-0-productionOrderNo" cname="生产订单号" type="hidden"/> <EF:EFInput ename="inqu_status-0-productionOrderNo" cname="生产订单号" type="hidden"/>
<EF:EFInput ename="inqu_status-0-deliveryDate" cname="交货日期" type="hidden"/> <EF:EFInput ename="inqu_status-0-deliveryDate" cname="交货日期" type="hidden"/>
<EF:EFInput ename="inqu_status-0-lv" cname="级别" type="hidden"/>
<EF:EFInput cname="上传文件" blockId="inqu_status" ename="file" row="0" type="file" /> <EF:EFInput cname="上传文件" blockId="inqu_status" ename="file" row="0" type="file" />
<%--<button id="btn_upload" type="submit">提交</button>--%> <%--<button id="btn_upload" type="submit">提交</button>--%>
<%-- <EF:EFButton cname="提交" ename="btn_upload"></EF:EFButton>--%> <%-- <EF:EFButton cname="提交" ename="btn_upload"></EF:EFButton>--%>
......
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