fix:报废出库审核对没有库存的卷跳过处理
This commit is contained in:
@@ -213,7 +213,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
WQLObject mst = WQLObject.getWQLObject("ST_IVT_ProductScrapMst");
|
||||
WQLObject dtl = WQLObject.getWQLObject("ST_IVT_ProductScrapDtl");
|
||||
WQLObject ivt = WQLObject.getWQLObject("st_ivt_structivt");
|
||||
|
||||
|
||||
try {
|
||||
// 查询所有明细
|
||||
JSONArray dtlArr = dtl.query("scrap_id = '" + whereJson.getString("scrap_id") + "'").getResultJSONArray(0);
|
||||
@@ -227,7 +227,11 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
List<JSONObject> ivtList = ivt.query("pcsn in ('" + pcsnJoining + "') and canuse_qty > 0")
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
if (dtlArr.size() != ivtList.size()) {
|
||||
Set<String> ivtSet = ivtList.stream().map(row -> row.getString("pcsn")).collect(Collectors.toSet());
|
||||
|
||||
String havePcsn = ivtSet.stream().collect(Collectors.joining("','"));
|
||||
|
||||
/*if (dtlArr.size() != ivtList.size()) {
|
||||
throw new BadRequestException("库存异常请检查!");
|
||||
}
|
||||
|
||||
@@ -237,7 +241,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
|
||||
if (!is_pass) {
|
||||
throw new BadRequestException("库存异常请检查!");
|
||||
}
|
||||
}*/
|
||||
|
||||
// 生成出库单
|
||||
JSONObject jsonOutMst = new JSONObject();
|
||||
@@ -256,6 +260,9 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
JSONArray tableData = new JSONArray();
|
||||
for (int i = 0; i < dtlArr.size(); i++) {
|
||||
JSONObject json = dtlArr.getJSONObject(i);
|
||||
if (!ivtSet.contains(json.getString("pcsn"))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
jsonDtl.put("pcsn", json.getString("pcsn"));
|
||||
@@ -274,7 +281,11 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
jsonObject.put("iostorinv_id", iostorinv_id);
|
||||
// 变更为手动分配
|
||||
// checkOutBillService.allDiv(jsonObject);
|
||||
|
||||
if (StrUtil.isNotEmpty(havePcsn)) {
|
||||
HashMap dtlMap = new HashMap();
|
||||
dtlMap.put("is_audit", "1");
|
||||
dtl.update(dtlMap, "scrap_id = '" + whereJson.getString("scrap_id") + "' AND pcsn in ('" + havePcsn + "')");
|
||||
}
|
||||
// 更新主表为完成
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("bill_status", "99");
|
||||
@@ -284,8 +295,8 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
mst.update(param, "scrap_id = '" + whereJson.getString("scrap_id") + "'");
|
||||
} catch (Exception e) {
|
||||
JSONObject msg = new JSONObject();
|
||||
msg.put("remark", "单据异常:"+e.getMessage());
|
||||
mst.update(msg,"scrap_id = '" + whereJson.getString("scrap_id") + "'");
|
||||
msg.put("remark", "单据异常:" + e.getMessage());
|
||||
mst.update(msg, "scrap_id = '" + whereJson.getString("scrap_id") + "'");
|
||||
}
|
||||
|
||||
|
||||
@@ -478,7 +489,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
String in_stor_id = userStorService.getInStor();
|
||||
|
||||
List<JSONObject> ivtList = WQL.getWO("QST_IVT_HANDMOVESTOR")
|
||||
.addParam("flag", "3").addParam("stor_id", stor_id).addParam("in_stor_id",in_stor_id)
|
||||
.addParam("flag", "3").addParam("stor_id", stor_id).addParam("in_stor_id", in_stor_id)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
// 查询不合格品来源字典
|
||||
@@ -536,7 +547,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
String finalValue = value;
|
||||
boxList.forEach(row -> {
|
||||
row.put("fail_source", finalValue);
|
||||
row.put("remark",remark);
|
||||
row.put("remark", remark);
|
||||
});
|
||||
|
||||
resultList.addAll(boxList);
|
||||
@@ -609,6 +620,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
|
||||
mp.put("不合格品来源", "客户投诉");
|
||||
}
|
||||
mp.put("不合格品缺陷描述", object.getString("remark"));
|
||||
mp.put("是否出库", object.getString("is_audit").equals("1") ? "是" : "否");
|
||||
list.add(mp);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span/>
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
@@ -36,11 +36,11 @@
|
||||
label-width="85px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码"/>
|
||||
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称"/>
|
||||
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
|
||||
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
|
||||
<el-form-item label="单据号" prop="scrap_code">
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model="form.scrap_code" disabled placeholder="系统生成" clearable style="width: 210px"/>
|
||||
<el-input v-model="form.scrap_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓 库:</label>
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
<el-form-item label="明细数" prop="detail_count">
|
||||
<label slot="label">明 细 数:</label>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px"/>
|
||||
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总重量" prop="total_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
@@ -116,9 +116,9 @@
|
||||
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}" style="margin-top: 5px;">
|
||||
<el-form ref="form2" :inline="true" :model="form" :rules="rules" size="mini">
|
||||
<el-form-item label="不合格品缺陷描述" prop="dtl_remark">
|
||||
<el-input v-model="form.dtl_remark" :disabled="crud.status.view > 0" class="input-with-select"/>
|
||||
<el-input v-model="form.dtl_remark" :disabled="crud.status.view > 0" class="input-with-select" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="不合格品来源" prop="fail_source">
|
||||
<!-- <el-form-item label="不合格品来源" prop="fail_source">
|
||||
<el-select
|
||||
v-model="form.fail_source"
|
||||
class="input-with-select"
|
||||
@@ -134,14 +134,14 @@
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
<el-button class="filter-item" :disabled="crud.status.view > 0" @click="allSend()" size="medium" icon="el-icon-plus" style="float: right; padding: 3px 0" type="warning">填充</el-button>
|
||||
<el-button class="filter-item" :disabled="crud.status.view > 0" size="medium" icon="el-icon-plus" style="float: right; padding: 3px 0" type="warning" @click="allSend()">填充</el-button>
|
||||
</el-card>
|
||||
<div class="crud-opts2">
|
||||
<span class="role-span">不合格品明细</span>
|
||||
<span v-if="crud.status.cu > 0" class="crud-opts-right2">
|
||||
|
||||
<!--左侧插槽-->
|
||||
<slot name="left"/>
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
@@ -191,8 +191,8 @@
|
||||
<el-select
|
||||
v-model="scope.row.fail_source"
|
||||
class="input-with-select"
|
||||
@input="custNameInput2(form.tableData[scope.$index])"
|
||||
:disabled="crud.status.view > 0"
|
||||
@input="custNameInput2(form.tableData[scope.$index])"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.FAIL_SOURCE"
|
||||
@@ -205,12 +205,17 @@
|
||||
</el-table-column>
|
||||
<el-table-column key="8" width="150" prop="remark" label="不合格品缺陷描述">
|
||||
<template scope="scope">
|
||||
<el-input v-model="scope.row.remark" @input="custNameInput(form.tableData[scope.$index])" :disabled="crud.status.view > 0" class="input-with-select" />
|
||||
<el-input v-model="scope.row.remark" :disabled="crud.status.view > 0" class="input-with-select" @input="custNameInput(form.tableData[scope.$index])" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="150" label="是否填充" v-if="crud.status.cu > 0">
|
||||
<el-table-column v-if="crud.status.view > 0" key="9" prop="is_audit" label="是否出库" align="center" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_audit === '1' ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" width="150" label="是否填充">
|
||||
<template scope="scope">
|
||||
<el-switch v-model="scope.row.is_used" @change="changeIsUsed(scope.row)" active-color="#13ce66" inactive-color="#ff4949" active-value="1" inactive-value="0" />
|
||||
<el-switch v-model="scope.row.is_used" active-color="#13ce66" inactive-color="#ff4949" active-value="1" inactive-value="0" @change="changeIsUsed(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
|
||||
@@ -225,9 +230,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged"/>
|
||||
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="structChanged"/>
|
||||
<UploadDialog :dialog-show.sync="viewShow" :stor-id="paramViewShow" @tableChanged="tableChanged"/>
|
||||
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
|
||||
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="structChanged" />
|
||||
<UploadDialog :dialog-show.sync="viewShow" :stor-id="paramViewShow" @tableChanged="tableChanged" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user