|
|
@@ -1192,13 +1192,13 @@ public class MESServiceImpl implements MESService {
|
|
|
if (count<=0){
|
|
|
return ApiResponse.failRsp("10094",requestId,"工单:"+makeCode+"在ERP不存在,请核对!");
|
|
|
}
|
|
|
- Object[] data = baseDao.getFieldsDataByCondition("make", "ma_canmadeqty,ma_code,ma_qty,ma_madeqty,ma_tomadeqty",
|
|
|
- "ma_code='" + makeCode + "'");
|
|
|
+ Object[] data = baseDao.getFieldsDataByCondition("make", "ma_canmadeqty,ma_code,ma_qty,ma_madeqty,ma_tomadeqty", "ma_code='" + makeCode + "'");
|
|
|
if (data!=null&&data.length>0) {
|
|
|
+ Object canmadeqty = baseDao.getFieldDataByCondition("make", "(select min(case when NVL(mm_havegetqty,0)-NVL(mm_scrapqty,0)>=mm_qty then ma_qty else floor((nvl(mm_havegetqty, 0)-nvl(mm_scrapqty,0))*1.0/mm_oneuseqty)end) from makematerial where mm_maid=ma_id and nvl(mm_materialstatus,' ')=' ' and mm_oneuseqty>0 and mm_oneuseqty*ma_qty<=mm_qty+0.1 and nvl(mm_cp_user,0)=0)","ma_code='" + makeCode + "'");
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("code",data[1]);
|
|
|
//备料齐套数量
|
|
|
- map.put("canmadeqty",data[0]);
|
|
|
+ map.put("canmadeqty",canmadeqty);
|
|
|
//工单数量
|
|
|
map.put("qty",data[2]);
|
|
|
//完工数量
|