Commit 17f6152d by wancheng

生产下料修改bug修复

parent 257df619
...@@ -10,6 +10,7 @@ import com.baosight.hpjx.core.dao.DaoUtils; ...@@ -10,6 +10,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.ds.domain.HPDS002; import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.pz.domain.HPPZ002;
import com.baosight.hpjx.hp.pz.domain.HPPZ011; import com.baosight.hpjx.hp.pz.domain.HPPZ011;
import com.baosight.hpjx.hp.pz.tools.HPPZTools; import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.sc.domain.*; import com.baosight.hpjx.hp.sc.domain.*;
...@@ -107,6 +108,74 @@ public class ServiceHPSC006 extends ServiceBase { ...@@ -107,6 +108,74 @@ public class ServiceHPSC006 extends ServiceBase {
} }
/** /**
* 保存操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产下料",operType = "保存",operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock("detail").getRows();
String productionOrderNo = inInfo.getString("productionOrderNo");
String projCode = inInfo.getString("projCode");
String projName = inInfo.getString("projName");
// 写入数据
for (int i = 0; i < resultRows.size(); i++) {
HPSC006 hpsc006 = new HPSC006();
hpsc006.fromMap(resultRows.get(i));
hpsc006.setInventType(7);
BigDecimal num = hpsc006.getNum();
BigDecimal unitWt = hpsc006.getUnitWt();
DecimalFormat decimalFormat = new DecimalFormat("#.000");
BigDecimal totalWt = new BigDecimal(decimalFormat.format(num.multiply(unitWt).floatValue()));
hpsc006.setInventSpec(HPPZTools.HpPz006.jointSpec(hpsc006.getInventLength(),hpsc006.getInventWidth(),hpsc006.getInventThick()));
hpsc006.setProjCode(projCode);
hpsc006.setProjName(projName);
hpsc006.setProductionOrderNo(productionOrderNo);
hpsc006.setTotalWt(totalWt);
hpsc006.setInventCode(HPPZTools.checkAndSavePZ04(hpsc006.getInventType(),hpsc006.getInventName()));
// 去除日期字符串中的-
hpsc006.setPlanCompletionDate(StringUtil.removeHorizontalLine(hpsc006.getPlanCompletionDate()));
if(hpsc006.getFactoryCode()!=null && !(hpsc006.getFactoryCode().equals(" "))) {
AssertUtils.isEmpty(hpsc006.getOrgNo(), "已选择厂区,下料组不能为空");
hpsc006.setStatus(1);
hpsc006.setOrgName(HPXSTools.XsOrg.get(hpsc006.getFactoryCode()).getOrgCname());
hpsc006.setFactoryName(HPXSTools.XsOrg.get(hpsc006.getOrgNo()).getOrgCname());
}
if (hpsc006.getId() == null || hpsc006.getId() == 0) {
hpsc006.setStatus(CommonConstant.YesNo.NO_0.intValue());
this.add(hpsc006);
} else {
this.modify(hpsc006);
}
}
int size = resultRows.size();
//刷新
//inInfo = this.refreshHPSC006(inInfo, productionOrderNo);
inInfo = this.queryDetail(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + size + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作.
*/
public void add(HPSC006 hpsc006) {
DaoUtils.insert("HPSC006.insert",hpsc006);
}
/**
* 修改操作.
*/
public void modify(HPSC006 hpsc006) {
DaoUtils.update("HPSC006.update",hpsc006);
}
/**
* 新增操作. * 新增操作.
*/ */
@OperationLogAnnotation(operModul = "生产下料",operType = "新增",operDesc = "新增") @OperationLogAnnotation(operModul = "生产下料",operType = "新增",operDesc = "新增")
......
...@@ -238,13 +238,12 @@ $(function () { ...@@ -238,13 +238,12 @@ $(function () {
} }
], ],
onSuccess: function (e) { /* onSuccess: function (e) {
if(e.eiInfo.extAttr.methodName == 'update' if(e.eiInfo.extAttr.methodName == 'save'
||e.eiInfo.extAttr.methodName == 'insert'
||e.eiInfo.extAttr.methodName == 'delete' ){ ||e.eiInfo.extAttr.methodName == 'delete' ){
query(); queryDetail();
} }
}, },*/
onSave: function (e) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
e.preventDefault(); e.preventDefault();
...@@ -478,7 +477,7 @@ function saveFunc() { ...@@ -478,7 +477,7 @@ function saveFunc() {
if(flag) { if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("detail", "HPSC006", "insert", true, JSUtils.submitGridsData("detail", "HPSC006", "save", true,
function (e) { function (e) {
detailGrid.setEiInfo(e); detailGrid.setEiInfo(e);
}); });
......
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