Commit 6338851e by wancheng

物料清单导入优化

parent b0b39c37
......@@ -138,7 +138,7 @@ public class HPSC002 extends DaoEPBase {
@ExcelAnno(index = 6)
private BigDecimal num = new BigDecimal(0.000); /* 数量*/
@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 String filePath1 = " "; /* 文件地址1*/
private String filePath2 = " "; /* 文件地址2*/
......@@ -225,21 +225,21 @@ public class HPSC002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_LENGTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("长");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_WIDTH);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("宽");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_THICK);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(12);
eiColumn.setDescName("厚");
eiMetadata.addMeta(eiColumn);
......@@ -261,7 +261,7 @@ public class HPSC002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_UNIT_WT);
eiColumn.setType("N");
eiColumn.setScaleLength(3);
eiColumn.setScaleLength(1);
eiColumn.setFieldLength(15);
eiColumn.setDescName("单重");
eiMetadata.addMeta(eiColumn);
......
......@@ -850,18 +850,48 @@ public class ServiceHPSC002 extends ServiceBase {
String projName = (String) params.get("projName");
String deliveryDate = (String) params.get("deliveryDate");
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) {
hpsc002.setParentId(parentId);
hpsc002.setProjCode(projCode);
hpsc002.setProjName(projName);
hpsc002.setParentPrdtName(parentPrdtName);
hpsc002.setDeliveryDate(deliveryDate);
hpsc002.setStatus(CommonConstant.YesNo.NO_0.intValue());
add(hpsc002);
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.setProjCode(projCode);
hpsc002.setProjName(projName);
hpsc002.setParentPrdtName(parentPrdtName);
hpsc002.setDeliveryDate(deliveryDate);
hpsc002.setStatus(CommonConstant.YesNo.NO_0.intValue());
add(hpsc002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + dataList.size() + "]条数据保存成功!");
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + dataList.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
......
......@@ -388,7 +388,8 @@ $(function () {
href: "HPSC097?methodName=initLoad&inqu_status-0-id=route_001&inqu_status-0-parentId="
+ nodeId + "&inqu_status-0-projCode=" + projCode + "&inqu_status-0-projName="
+ 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>",
width: "60%",
height: "50%",
......@@ -396,7 +397,7 @@ $(function () {
// 刷新列表
resultGrid.dataSource.page(1);
// 刷新树
updateTree();
refreshTree();
// 关闭弹窗
JSColorbox.close();
}
......
......@@ -24,6 +24,7 @@ let upload = function () {
let parentPrdtName = $("#inqu_status-0-parentPrdtName").val();
let productionOrderNo = $("#inqu_status-0-productionOrderNo").val();
let deliveryDate = $("#inqu_status-0-deliveryDate").val();
let lv = $("#inqu_status-0-lv").val();
let _IPLAT = IPLAT;
_IPLAT.progress($("body"), true);
let formData = new FormData();
......@@ -35,6 +36,7 @@ let upload = function () {
formData.append("projName", projName);
formData.append("parentPrdtName", parentPrdtName);
formData.append("deliveryDate", deliveryDate);
formData.append("lv", lv);
}
if(id === 'route_002'){
formData.append("id", id);
......@@ -56,7 +58,12 @@ let upload = function () {
processData: false,
success: function (res) {
_IPLAT.progress($("body"), false);
parent.JSColorbox.setValueCallback();
debugger;
if(res.status===0){
parent.JSColorbox.setValueCallback();
}else{
NotificationUtil(res.msg, "error");
}
},
error: function (res) {
message(res.msg);
......
......@@ -15,7 +15,8 @@
<EF:EFInput ename="inqu_status-0-projName" 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-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" />
<%--<button id="btn_upload" type="submit">提交</button>--%>
<%-- <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