|
|
@@ -126,7 +126,7 @@ public class MESServiceImpl implements MESService {
|
|
|
return ApiResponse.failRsp("10014", request.getHeader("RequestId"), "该收料单已转入过委外验收单,单号[" + code + "]");
|
|
|
}
|
|
|
}
|
|
|
- sellerName = StringUtil.nvl(jsonObject.get("sellerName"), "管理员");
|
|
|
+ sellerName = StringUtil.nvl(jsonObject.get("sellerName"), "mes");
|
|
|
}
|
|
|
JSONArray array = data.get("detail");
|
|
|
for (int i = 0; i <array.size() ; i++) {
|
|
|
@@ -265,17 +265,15 @@ public class MESServiceImpl implements MESService {
|
|
|
// 转入委外验收单主记录
|
|
|
piid = baseDao.getSeqId("PRODINOUT_SEQ");
|
|
|
picode = baseDao.sGetMaxNumber(picaller, 2);
|
|
|
- sqls.add("insert into prodinout (pi_id,pi_inoutno,pi_class,pi_date,pi_statuscode,pi_status,pi_whcode," +
|
|
|
- "pi_whname,pi_departmentcode,pi_departmentname,pi_emcode,pi_emname,pi_invostatuscode," +
|
|
|
- "pi_invostatus,pi_recordman,pi_recorddate,pi_printstatuscode,pi_printstatus) values (" + piid + ",'" + picode + "','"+piclass+"',to_date('" + jsonObject2.get("Fdate") + "','yyyy-MM-dd HH24:mi:ss'),'UNPOST'," + "'未过账','" + warehouses[0] + "','" + warehouses[1] + "','" + map5.get("FNumber") + "','" + map5.get("FName") + "','" + map6.get("FNumber") + "','" + map7.get("FName") + "','ENTERING','在录入','" + map8.get("FName") + "',to_date('" + jsonObject2.get("Fdate") + "','yyyy-MM-dd HH24:mi:ss'),'UNPRINT','未打印')");
|
|
|
+ sqls.add("insert into prodinout (pi_id,pi_inoutno,pi_class,pi_date,pi_statuscode,pi_status,pi_whcode,pi_whname,pi_departmentcode,pi_departmentname,pi_emcode,pi_emname,pi_invostatuscode,pi_invostatus,pi_recordman,pi_recorddate,pi_printstatuscode,pi_printstatus) " +
|
|
|
+ "values (" + piid + ",'" + picode + "','"+piclass+"',to_date('" + jsonObject2.get("Fdate") + "','yyyy-MM-dd HH24:mi:ss'),'UNPOST'," + "'未过账','" + warehouses[0] + "','" + warehouses[1] + "','" + map5.get("FNumber") + "','" + map5.get("FName") + "','" + map6.get("FNumber") + "','" + map7.get("FName") + "','ENTERING','在录入','" + map8.get("FName") + "',to_date('" + jsonObject2.get("Fdate") + "','yyyy-MM-dd HH24:mi:ss'),'UNPRINT','未打印')");
|
|
|
sqls.add("update prodinout set (pi_cardcode,pi_title,pi_currency,pi_rate,pi_receivecode," +
|
|
|
"pi_receivename,pi_cardid,pi_paymentcode,pi_payment,pi_cop,pi_belongs," +
|
|
|
"pi_sourcecode,pi_sellercode)=(select ma_vendcode,ma_vendname,ma_currency,ma_rate,ve_apvendcode," +
|
|
|
"ve_apvendname,ve_id,ma_paymentscode,ma_payments,ma_cop,ve_buyername,ma_code,em_code from make left " +
|
|
|
- "join Vendor on ma_vendcode=ve_code left join employee on ve_buyerid=em_id where ma_id="+ma_id+") where pi_id="+piid);
|
|
|
- sqls.add("update ProdinOut set pi_sellername=pi_belongs where pi_id=" + piid);
|
|
|
- sqls.add("update ProdinOut set pi_rate=(select CR_RATE from Currencys where pi_currency=cr_name) where pi_id="
|
|
|
- + piid + " and nvl(pi_rate,0)=0");
|
|
|
+ "join Vendor on ma_vendcode=ve_code left join employee on ve_buyerid=em_id where ma_id="+ma_id+") where pi_class='"+piclass+"' and pi_id="+piid);
|
|
|
+ sqls.add("update ProdinOut set pi_sellername=pi_belongs where pi_class='"+piclass+"' and pi_id=" + piid);
|
|
|
+ sqls.add("update ProdinOut set pi_rate=(select CR_RATE from Currencys where pi_currency=cr_name) where pi_class='"+piclass+"' and pi_id=" + piid + " and nvl(pi_rate,0)=0");
|
|
|
} else {
|
|
|
piid = baseDao.getSeqId("PRODINOUT_SEQ");
|
|
|
picode = baseDao.sGetMaxNumber(picaller, 2);
|
|
|
@@ -409,7 +407,7 @@ public class MESServiceImpl implements MESService {
|
|
|
if ("".equals(fwcCode)) {
|
|
|
return ApiResponse.failRsp("10021", request.getHeader("RequestId"), "工作中心不能为空!");
|
|
|
}
|
|
|
- String createdUser = StringUtil.nvl(jsonObject.get("createdUser"), "管理员");
|
|
|
+ String createdUser = StringUtil.nvl(jsonObject.get("createdUser"), "mes");
|
|
|
String createdDateTime = StringUtil.nvl(jsonObject.get("createdDateTime"), DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
String companyNo = StringUtil.nvl(jsonObject.get("companyNo"), "BYT");
|
|
|
String fremark = StringUtil.nvl(jsonObject.get("Fremark"), "");
|
|
|
@@ -514,8 +512,7 @@ public class MESServiceImpl implements MESService {
|
|
|
Object[] 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", "ct_statuscode='AUDITED' and ct_caller='MESWarehouse' and cd_varchar50_1='" + whcode + "'");
|
|
|
sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode," +
|
|
|
"pd_outqty,pd_whcode,pd_whname,pd_remark) " +
|
|
|
- "values (PRODIODETAIL_SEQ.nextval,"+id+",'"+code+"','其它出库单',"+detno+",'"+itemNo+
|
|
|
- "',"+qty+",'"+warehouses[0]+"','"+warehouses[1]+"','"+fnote+"')");
|
|
|
+ "values (PRODIODETAIL_SEQ.nextval,"+id+",'"+code+"','其它出库单',"+detno+",'"+itemNo+ "',"+qty+",'"+warehouses[0]+"','"+warehouses[1]+"','"+fnote+"')");
|
|
|
detno++;
|
|
|
}
|
|
|
baseDao.execute(sqls);
|
|
|
@@ -784,10 +781,7 @@ public class MESServiceImpl implements MESService {
|
|
|
sqls.add("insert into prodiodetail (pd_id,pd_piid,pd_inoutno,pd_piclass,pd_pdno,pd_prodcode,pd_outqty,pd_whcode,pd_whname,pd_inwhcode,pd_inwhname,pd_macode,pd_madetno) values (PRODIODETAIL_SEQ.nextval,"+id+",'"+code+"','"+bcpiclass+"',"+detno+",'"+itemNo+"',"+qty+",'"+warehouses[0]+"','"+warehouses[1]+"','"+warehouses2[0]+"','"+warehouses2[1]+"','"+ficmoBillNo+"',"+objs[2]+")");
|
|
|
if (frob==0) {
|
|
|
Object prid = baseDao.getFieldDataByCondition("Product", "pr_id", "pr_code='" + itemNo + "'");
|
|
|
- SqlRowList rs = baseDao.queryForRowSet("select nvl(mm_totaluseqty,0)+nvl(mm_havegetqty,0)-nvl" +
|
|
|
- "(ma_tomadeqty,0)*nvl(mm_oneuseqty,0) mmqty,nvl(mm_havegetqty,0)-nvl(ma_tomadeqty,0)*nvl" +
|
|
|
- "(mm_oneuseqty,0) useqty,mm_totaluseqty from MakeMaterial left join Make on ma_id=mm_maid " +
|
|
|
- "where mm_id=" + objs[0]);
|
|
|
+ SqlRowList rs = baseDao.queryForRowSet("select nvl(mm_totaluseqty,0)+nvl(mm_havegetqty,0)-nvl(ma_tomadeqty,0)*nvl(mm_oneuseqty,0) mmqty,nvl(mm_havegetqty,0)-nvl(ma_tomadeqty,0)*nvl(mm_oneuseqty,0) useqty,mm_totaluseqty from MakeMaterial left join Make on ma_id=mm_maid where mm_id=" + objs[0]);
|
|
|
Double mmqty=0.0;
|
|
|
if (rs.next()){
|
|
|
//最多可退数量
|