|
|
@@ -1004,6 +1004,7 @@ public class MESServiceImpl implements MESService {
|
|
|
}
|
|
|
if (warehouses!=null){
|
|
|
sqls.add("update prodinout set pi_whcode='"+warehouses[0]+"',pi_whname='"+warehouses[1]+"' where pi_id="+id);
|
|
|
+ sqls.add("update prodinout set pi_whcode='"+warehouses[0]+"',pi_whname='"+warehouses[1]+"' where pi_id="+tlid);
|
|
|
}
|
|
|
if (warehouses2!=null){
|
|
|
sqls.add("update prodinout set pi_purpose='"+warehouses2[0]+"',pi_purposename='"+warehouses2[1]+"' where pi_id="+id);
|
|
|
@@ -1545,7 +1546,7 @@ public class MESServiceImpl implements MESService {
|
|
|
tlcode = baseDao.sGetMaxNumber(tlcaller, 2);
|
|
|
sqls.add("INSERT INTO ProdInOut(pi_id, pi_inoutno, pi_date, pi_class,pi_invostatus,pi_invostatuscode,pi_recordman, pi_recorddate, pi_statuscode,pi_status,pi_updatedate,pi_updateman,pi_printstatuscode,pi_printstatus,pi_departmentcode,pi_departmentname,pi_emcode,pi_emname,pi_mescode) VALUES ("+tlid+",'"+tlcode+"',to_date('"+object.get("Fdate")+"','yyyy-MM-dd HH24:mi:ss'),'"+tlpiclass+"','已审核','AUDITED','"+map5.get("FName")+"',to_date('"+object.get("Fdate")+"','yyyy-MM-dd HH24:mi:ss'),'UNPOST','未过账',sysdate,'"+map5.get("FName")+"','UNPRINT','未打印','"+map1.get("FNumber")+"','"+map1.get("FName")+"','"+map4.get("FNumber")+"','"+map4.get("FName")+"','"+fSelBillNo+"')");
|
|
|
}
|
|
|
-
|
|
|
+ Object[] warehouses =null;
|
|
|
if(detail!=null&&detail.size()>0) {
|
|
|
int detno=1;
|
|
|
for (int i = 0; i < detail.size(); i++) {
|
|
|
@@ -1572,7 +1573,7 @@ public class MESServiceImpl implements MESService {
|
|
|
if (count <= 0) {
|
|
|
return ApiResponse.failRsp("10056", requestId, "MES仓库编号在ERP没有对应关系,请联系管理员新增!");
|
|
|
}
|
|
|
- Object[] warehouses = baseDao.getFieldsDataByCondition("customtabledetail left join customtable on " +
|
|
|
+ warehouses = baseDao.getFieldsDataByCondition("customtabledetail left join customtable on " +
|
|
|
"cd_ctid=ct_id left join Warehouse on cd_varchar50_3=wh_code", "cd_varchar50_3,wh_description,wh_nocost", "ct_statuscode='AUDITED' and ct_caller='MESWarehouse' and cd_varchar50_1='" + whcode + "'");
|
|
|
Double outqty = Double.parseDouble(StringUtil.nvl(baseDao.getFieldDataByCondition("prodiodetail left join Warehouse on pd_whcode=wh_code", "sum(nvl(pd_outqty,0)-nvl(pd_inqty,0))", "pd_piclass in ("+piclass+ ") and pd_ordercode='" + macode + "' and pd_prodcode='" + itemNo + "' and nvl(wh_nocost,0)=" + warehouses[2]),"0"));
|
|
|
if (qty.compareTo(outqty) > 0) {
|
|
|
@@ -1595,6 +1596,9 @@ public class MESServiceImpl implements MESService {
|
|
|
if ("OS".equals(ma_tasktype)) {
|
|
|
sqls.add("update prodinout set(pi_cardcode,pi_title,pi_receivecode,pi_receivename) = (select max(ma_vendcode),max(ma_vendname),max(nvl(ma_apvendcode,ma_vendcode)),max(nvl(ma_apvendname,ma_vendname)) from make where ma_id in (" + maid + ")) where pi_id=" + tlid);
|
|
|
}
|
|
|
+ if (warehouses!=null){
|
|
|
+ sqls.add("update prodinout set pi_whcode='"+warehouses[0]+"',pi_whname='"+warehouses[1]+"' where pi_id="+tlid);
|
|
|
+ }
|
|
|
}
|
|
|
baseDao.execute(sqls);
|
|
|
Employee employee = baseDao.getJdbcTemplate().queryForObject("select * from employee where em_code=?", new BeanPropertyRowMapper<Employee>(Employee.class), "mes");
|