fix:报废出库审核对没有库存的卷跳过处理

This commit is contained in:
zhouz
2025-10-17 15:25:36 +08:00
parent aa297c7337
commit 407e196778
2 changed files with 41 additions and 24 deletions

View File

@@ -227,7 +227,11 @@ public class ProductScrapServiceImpl implements ProductScrapService {
List<JSONObject> ivtList = ivt.query("pcsn in ('" + pcsnJoining + "') and canuse_qty > 0") List<JSONObject> ivtList = ivt.query("pcsn in ('" + pcsnJoining + "') and canuse_qty > 0")
.getResultJSONArray(0).toJavaList(JSONObject.class); .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("库存异常请检查!"); throw new BadRequestException("库存异常请检查!");
} }
@@ -237,7 +241,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
if (!is_pass) { if (!is_pass) {
throw new BadRequestException("库存异常请检查!"); throw new BadRequestException("库存异常请检查!");
} }*/
// 生成出库单 // 生成出库单
JSONObject jsonOutMst = new JSONObject(); JSONObject jsonOutMst = new JSONObject();
@@ -256,6 +260,9 @@ public class ProductScrapServiceImpl implements ProductScrapService {
JSONArray tableData = new JSONArray(); JSONArray tableData = new JSONArray();
for (int i = 0; i < dtlArr.size(); i++) { for (int i = 0; i < dtlArr.size(); i++) {
JSONObject json = dtlArr.getJSONObject(i); JSONObject json = dtlArr.getJSONObject(i);
if (!ivtSet.contains(json.getString("pcsn"))) {
continue;
}
JSONObject jsonDtl = new JSONObject(); JSONObject jsonDtl = new JSONObject();
jsonDtl.put("pcsn", json.getString("pcsn")); jsonDtl.put("pcsn", json.getString("pcsn"));
@@ -274,7 +281,11 @@ public class ProductScrapServiceImpl implements ProductScrapService {
jsonObject.put("iostorinv_id", iostorinv_id); jsonObject.put("iostorinv_id", iostorinv_id);
// 变更为手动分配 // 变更为手动分配
// checkOutBillService.allDiv(jsonObject); // 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(); JSONObject param = new JSONObject();
param.put("bill_status", "99"); param.put("bill_status", "99");
@@ -284,8 +295,8 @@ public class ProductScrapServiceImpl implements ProductScrapService {
mst.update(param, "scrap_id = '" + whereJson.getString("scrap_id") + "'"); mst.update(param, "scrap_id = '" + whereJson.getString("scrap_id") + "'");
} catch (Exception e) { } catch (Exception e) {
JSONObject msg = new JSONObject(); JSONObject msg = new JSONObject();
msg.put("remark", "单据异常:"+e.getMessage()); msg.put("remark", "单据异常:" + e.getMessage());
mst.update(msg,"scrap_id = '" + whereJson.getString("scrap_id") + "'"); mst.update(msg, "scrap_id = '" + whereJson.getString("scrap_id") + "'");
} }
@@ -478,7 +489,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
String in_stor_id = userStorService.getInStor(); String in_stor_id = userStorService.getInStor();
List<JSONObject> ivtList = WQL.getWO("QST_IVT_HANDMOVESTOR") 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); .process().getResultJSONArray(0).toJavaList(JSONObject.class);
// 查询不合格品来源字典 // 查询不合格品来源字典
@@ -536,7 +547,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
String finalValue = value; String finalValue = value;
boxList.forEach(row -> { boxList.forEach(row -> {
row.put("fail_source", finalValue); row.put("fail_source", finalValue);
row.put("remark",remark); row.put("remark", remark);
}); });
resultList.addAll(boxList); resultList.addAll(boxList);
@@ -609,6 +620,7 @@ public class ProductScrapServiceImpl implements ProductScrapService {
mp.put("不合格品来源", "客户投诉"); mp.put("不合格品来源", "客户投诉");
} }
mp.put("不合格品缺陷描述", object.getString("remark")); mp.put("不合格品缺陷描述", object.getString("remark"));
mp.put("是否出库", object.getString("is_audit").equals("1") ? "" : "");
list.add(mp); list.add(mp);
} }
FileUtil.downloadExcel(list, response); FileUtil.downloadExcel(list, response);

View File

@@ -10,7 +10,7 @@
> >
<el-row v-show="crud.status.cu > 0" :gutter="20"> <el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="20" style="border: 1px solid white"> <el-col :span="20" style="border: 1px solid white">
<span/> <span />
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<span> <span>
@@ -36,11 +36,11 @@
label-width="85px" label-width="85px"
label-suffix=":" label-suffix=":"
> >
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码"/> <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_name" placeholder="仓库名称" />
<el-form-item label="单据号" prop="scrap_code"> <el-form-item label="单据号" prop="scrap_code">
<label slot="label">单&nbsp;&nbsp;据&nbsp;号:</label> <label slot="label">单&nbsp;&nbsp;据&nbsp;号:</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>
<el-form-item label="仓库" prop="stor_id"> <el-form-item label="仓库" prop="stor_id">
<label slot="label">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库:</label> <label slot="label">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;库:</label>
@@ -79,7 +79,7 @@
<el-form-item label="明细数" prop="detail_count"> <el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label> <label slot="label">明&nbsp;&nbsp;细&nbsp;数:</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>
<el-form-item label="总重量" prop="total_qty"> <el-form-item label="总重量" prop="total_qty">
<label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label> <label slot="label">总&nbsp;&nbsp;重&nbsp;量:</label>
@@ -116,7 +116,7 @@
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}" style="margin-top: 5px;"> <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 ref="form2" :inline="true" :model="form" :rules="rules" size="mini">
<el-form-item label="不合格品缺陷描述" prop="dtl_remark"> <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>
<!-- <el-form-item label="不合格品来源" prop="fail_source"> <!-- <el-form-item label="不合格品来源" prop="fail_source">
<el-select <el-select
@@ -134,14 +134,14 @@
</el-select> </el-select>
</el-form-item>--> </el-form-item>-->
</el-form> </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> </el-card>
<div class="crud-opts2"> <div class="crud-opts2">
<span class="role-span">不合格品明细</span> <span class="role-span">不合格品明细</span>
<span v-if="crud.status.cu > 0" class="crud-opts-right2"> <span v-if="crud.status.cu > 0" class="crud-opts-right2">
<!--左侧插槽--> <!--左侧插槽-->
<slot name="left"/> <slot name="left" />
<el-button <el-button
slot="left" slot="left"
class="filter-item" class="filter-item"
@@ -191,8 +191,8 @@
<el-select <el-select
v-model="scope.row.fail_source" v-model="scope.row.fail_source"
class="input-with-select" class="input-with-select"
@input="custNameInput2(form.tableData[scope.$index])"
:disabled="crud.status.view > 0" :disabled="crud.status.view > 0"
@input="custNameInput2(form.tableData[scope.$index])"
> >
<el-option <el-option
v-for="item in dict.FAIL_SOURCE" v-for="item in dict.FAIL_SOURCE"
@@ -205,12 +205,17 @@
</el-table-column> </el-table-column>
<el-table-column key="8" width="150" prop="remark" label="不合格品缺陷描述"> <el-table-column key="8" width="150" prop="remark" label="不合格品缺陷描述">
<template scope="scope"> <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> </template>
</el-table-column> </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"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right"> <el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
@@ -225,9 +230,9 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged"/> <AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="structChanged"/> <StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="structChanged" />
<UploadDialog :dialog-show.sync="viewShow" :stor-id="paramViewShow" @tableChanged="tableChanged"/> <UploadDialog :dialog-show.sync="viewShow" :stor-id="paramViewShow" @tableChanged="tableChanged" />
</el-dialog> </el-dialog>
</template> </template>