修改
This commit is contained in:
@@ -63,19 +63,22 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
if (StrUtil.isEmpty(sparepart_only_id)) {
|
||||
throw new PdaRequestException("备品备件不能为空!");
|
||||
}
|
||||
|
||||
/*
|
||||
JSONObject spare_bom = WQLObject.getWQLObject("EM_BI_EquipmentSpareBOM").query("sparepart_only_id = '" + sparepart_only_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(spare_bom)) {
|
||||
throw new PdaRequestException("该备件未查询到设备档案BOM备件表!");
|
||||
}
|
||||
|
||||
String device_id = spare_bom.getString("devicerecord_id");
|
||||
String device_id = spare_bom.getString("devicerecord_id");*/
|
||||
|
||||
JSONObject row = WQL.getWO("QPDAEM_BI_SPAREPART").addParam("flag", "1").addParam("device_id", device_id).addParam("sparepart_only_id", sparepart_only_id).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
if (ObjectUtil.isEmpty(spare_bom)) {
|
||||
throw new PdaRequestException("该备件未查询到相关领用出库记录!");
|
||||
}
|
||||
//查询是否已经入库
|
||||
JSONObject ivt = WQLObject.getWQLObject("em_bi_devicesparepartivt").query("sparepart_only_id = '"+sparepart_only_id+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(ivt)){
|
||||
throw new PdaRequestException("该备件已经入库!");
|
||||
}
|
||||
JSONObject row = WQL.getWO("QPDAEM_BI_SPAREPART").addParam("flag", "1").addParam("sparepart_only_id", sparepart_only_id).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(row)) {
|
||||
throw new PdaRequestException("该备件未查询到相关领用出库记录!");
|
||||
}
|
||||
|
||||
JSONObject returnjo = new JSONObject();
|
||||
@@ -255,7 +258,7 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
String iostorinvdtl_id = jo.getString("iostorinvdtl_id");
|
||||
String io_flag = jo.getString("io_flag");
|
||||
|
||||
JSONObject dtl = WQLObject.getWQLObject("EM_BI_IOStorInvDtl").query("iostorinvdtl_id = '"+iostorinvdtl_id+"'").uniqueResult(0);
|
||||
JSONObject dtl = WQLObject.getWQLObject("EM_BI_IOStorInvDtl").query("iostorinvdtl_id = '" + iostorinvdtl_id + "'").uniqueResult(0);
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "4");
|
||||
map.put("sparepart_only_id", sparepart_only_id);
|
||||
@@ -263,13 +266,13 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
|
||||
JSONObject row = WQL.getWO("QPDAEM_BI_SPAREPART").addParamMap(map).process().uniqueResult(0);
|
||||
|
||||
if (io_flag.equals("1") && ObjectUtil.isEmpty(row)){
|
||||
if (io_flag.equals("1") && ObjectUtil.isEmpty(row)) {
|
||||
//如果出库的话查询库存记录表
|
||||
map.put("flag", "8");
|
||||
map.put("material_id",dtl.getString("material_id"));
|
||||
map.put("material_id", dtl.getString("material_id"));
|
||||
row = WQL.getWO("QPDAEM_BI_SPAREPART").addParamMap(map).process().uniqueResult(0);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(row)){
|
||||
if (ObjectUtil.isEmpty(row)) {
|
||||
throw new PdaRequestException("请扫描或输入正确的备件唯一码!");
|
||||
}
|
||||
JSONObject returnjo = new JSONObject();
|
||||
@@ -296,7 +299,7 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
JSONArray ja = new JSONArray();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
if (StrUtil.isEmpty(row.getString("iostorinvdis_id"))){
|
||||
if (StrUtil.isEmpty(row.getString("iostorinvdis_id"))) {
|
||||
JSONObject dis_jo = new JSONObject();
|
||||
dis_jo.put("iostorinvdis_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
dis_jo.put("iostorinv_id", form.getString("iostorinv_id"));
|
||||
@@ -318,11 +321,11 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
dis_jo.put("sparepart_only_id", row.getString("sparepart_only_id"));
|
||||
WQLObject.getWQLObject("EM_BI_IOStorInvDis").insert(dis_jo);
|
||||
ja.add(dis_jo);
|
||||
}else {
|
||||
} else {
|
||||
ja.add(row);
|
||||
}
|
||||
}
|
||||
jo.put("rows",ja);
|
||||
jo.put("rows", ja);
|
||||
sparePartOutService.disConfirm(jo);
|
||||
}
|
||||
|
||||
@@ -351,7 +354,7 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
}
|
||||
|
||||
JSONObject content = new JSONObject();
|
||||
content.put("rows",rows);
|
||||
content.put("rows", rows);
|
||||
JSONObject returnjo = new JSONObject();
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("rows", rows);
|
||||
@@ -586,7 +589,7 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
}
|
||||
|
||||
JSONObject content = new JSONObject();
|
||||
content.put("rows",rows);
|
||||
content.put("rows", rows);
|
||||
JSONObject returnjo = new JSONObject();
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("content", content);
|
||||
@@ -771,11 +774,11 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
String device_code = jo.getString("device_code");
|
||||
String run_date = jo.getString("run_date");
|
||||
|
||||
if (StrUtil.isEmpty(device_code)){
|
||||
if (StrUtil.isEmpty(device_code)) {
|
||||
throw new PdaRequestException("输入的设备编码不能为空!");
|
||||
}
|
||||
|
||||
JSONObject content = WQL.getWO("QPDAEM_BI_SPAREPART").addParam("flag", "7").addParam("device_code", device_code).addParam("run_date",run_date).process().uniqueResult(0);
|
||||
JSONObject content = WQL.getWO("QPDAEM_BI_SPAREPART").addParam("flag", "7").addParam("device_code", device_code).addParam("run_date", run_date).process().uniqueResult(0);
|
||||
JSONObject returnjo = new JSONObject();
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("content", content);
|
||||
@@ -847,7 +850,7 @@ public class SparePartServiceImpl implements SparePartService {
|
||||
double product_qty = jo.getDoubleValue("product_qty"); //生产总量
|
||||
double nok_qty = jo.getDoubleValue("nok_qty"); //不合格数
|
||||
double oee_value = jo.getDoubleValue("oee_value"); //不合格数
|
||||
if (ObjectUtil.isEmpty(jo.getString("oee_value"))){
|
||||
if (ObjectUtil.isEmpty(jo.getString("oee_value"))) {
|
||||
throw new PdaRequestException("oee不能为空!");
|
||||
}
|
||||
double theory_beat = jsonFile.getDoubleValue("theory_beat"); // 理论节拍
|
||||
|
||||
@@ -72,7 +72,6 @@
|
||||
LEFT JOIN em_bi_equipmentfile file ON file.devicerecord_id = mst.device_id
|
||||
WHERE
|
||||
dis.sparepart_only_id = 输入.sparepart_only_id
|
||||
AND mst.device_id = 输入.device_id
|
||||
AND mst.bill_type = '010901'
|
||||
AND mst.bill_status = '99'
|
||||
AND mst.is_delete = '0'
|
||||
|
||||
@@ -120,4 +120,14 @@ public class SparePartInController {
|
||||
sparePartInService.confirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("导入视图数据")
|
||||
@ApiOperation("导入视图数据")
|
||||
//@PreAuthorize("@el.check('pcsIfPurchaseorderproc:del')")
|
||||
@PutMapping("/importData")
|
||||
public ResponseEntity<Object> importData(@RequestBody Map whereJson) {
|
||||
sparePartInService.importData(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ public interface SparePartInService {
|
||||
|
||||
void confirm(Map whereJson);
|
||||
|
||||
void importData(Map whereJson);
|
||||
|
||||
JSONArray getDisDtl(JSONObject whereJson);
|
||||
|
||||
void divStruct(JSONObject whereJson);
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.ext.erp.service.WmsToErpService;
|
||||
import org.nl.modules.security.service.dto.JwtUserDto;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
@@ -44,6 +45,8 @@ public class SparePartInServiceImpl implements SparePartInService {
|
||||
|
||||
@Autowired
|
||||
private final StorattrService storattrService;
|
||||
@Autowired
|
||||
private WmsToErpService wmsToErpService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
|
||||
@@ -401,6 +404,21 @@ public class SparePartInServiceImpl implements SparePartInService {
|
||||
this.confirmMst((String) whereJson.get("iostorinv_id"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void importData(Map whereJson) {
|
||||
ArrayList<String> arr = (ArrayList<String>) whereJson.get("createTime");
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
if (arr != null && arr.size() != 0) {
|
||||
if (StrUtil.isNotEmpty(arr.get(0))) {
|
||||
map.put("begin_time", arr.get(0));
|
||||
}
|
||||
if (StrUtil.isNotEmpty(arr.get(1))) {
|
||||
map.put("end_time", arr.get(1));
|
||||
}
|
||||
}
|
||||
wmsToErpService.getPurchaseInInfo(map);
|
||||
}
|
||||
|
||||
public void confirmMst(String id) {
|
||||
WQLObject mst_wql = WQLObject.getWQLObject("EM_BI_IOStorInv");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
|
||||
@@ -200,6 +200,14 @@ export function backConfirm(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function importData(data) {
|
||||
return request({
|
||||
url: 'api/inbill/importData',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getType, getBillDtl, disConfirm, insertDtl, getIODtl, commit, checkVehicle,
|
||||
deleteDisDtl, getDisDtl, createCode, divPoint, cancelCreate,
|
||||
divStruct, bucketDtl, updateTask, delTask, reIssueTask, confirmTask, cancelTask, confirm, backConfirm }
|
||||
|
||||
82
mes/qd/src/views/wms/sb/inbill/importOrder.vue
Normal file
82
mes/qd/src/views/wms/sb/inbill/importOrder.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="备件订单接口导入"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
:show-close="true"
|
||||
width="500px"
|
||||
v-loading.fullscreen.lock="fullscreenLoading"
|
||||
@close="close"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div>
|
||||
<!-- 搜索 -->
|
||||
<el-date-picker
|
||||
v-model="form.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="queryStruct">确认</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import sparePart from '@/api/wms/sb/sparepart'
|
||||
|
||||
export default {
|
||||
name: 'importOrder',
|
||||
components: { rrOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fullscreenLoading: false,
|
||||
dialogVisible: false,
|
||||
form :{}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.form = {}
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
},
|
||||
queryStruct() {
|
||||
debugger
|
||||
this.fullscreenLoading = true
|
||||
sparePart.importData(this.form).then(res => {
|
||||
this.fullscreenLoading = false
|
||||
this.crud.notify('导入成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
this.fullscreenLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -95,11 +95,21 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-arrow-down"
|
||||
size="mini"
|
||||
@click="Import"
|
||||
>
|
||||
导入入库单
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -136,7 +146,7 @@
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="115"
|
||||
@@ -157,8 +167,8 @@
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.bill_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态" />
|
||||
<el-table-column prop="stor_name" label="仓库" />
|
||||
<el-table-column show-overflow-tooltip :formatter="stateFormat" prop="bill_status" label="单据状态"/>
|
||||
<el-table-column prop="stor_name" label="仓库"/>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
prop="bill_type"
|
||||
@@ -166,30 +176,32 @@
|
||||
:formatter="bill_typeFormat"
|
||||
label="业务类型"
|
||||
/>
|
||||
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期" />
|
||||
<el-table-column show-overflow-tooltip prop="create_mode" :formatter="create_modeFormat" label="生成方式" />
|
||||
<el-table-column label="明细数" align="center" prop="detail_count" />
|
||||
<el-table-column show-overflow-tooltip width="135" prop="biz_date" label="业务日期"/>
|
||||
<el-table-column show-overflow-tooltip prop="create_mode" :formatter="create_modeFormat" label="生成方式"/>
|
||||
<el-table-column label="明细数" align="center" prop="detail_count"/>
|
||||
<el-table-column label="总重量" align="center" prop="total_qty">
|
||||
<template slot-scope="scope">
|
||||
{{ fun(scope.row.total_qty) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="制单人" align="center" prop="input_optname" />
|
||||
<el-table-column label="制单时间" align="center" prop="input_time" width="150" />
|
||||
<el-table-column label="修改人" align="center" prop="update_optname" />
|
||||
<el-table-column label="修改时间" align="center" prop="update_time" width="150" />
|
||||
<el-table-column label="分配人" align="center" prop="dis_optname" />
|
||||
<el-table-column label="分配时间" align="center" prop="dis_time" width="150" />
|
||||
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150" />
|
||||
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150" />
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="制单人" align="center" prop="input_optname"/>
|
||||
<el-table-column label="制单时间" align="center" prop="input_time" width="150"/>
|
||||
<el-table-column label="修改人" align="center" prop="update_optname"/>
|
||||
<el-table-column label="修改时间" align="center" prop="update_time" width="150"/>
|
||||
<el-table-column label="分配人" align="center" prop="dis_optname"/>
|
||||
<el-table-column label="分配时间" align="center" prop="dis_time" width="150"/>
|
||||
<el-table-column label="确认人" align="center" prop="confirm_optname" width="150"/>
|
||||
<el-table-column label="确认时间" align="center" prop="confirm_time" width="150"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<pagination/>
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
|
||||
<DivDialog :dialog-show.sync="divShow" :open-param="openParam" :bill-type="billType" :buss-config="bussConfig" @AddChanged="querytable" />
|
||||
<AddDialog @AddChanged="querytable"/>
|
||||
<importOrder :dialog-show.sync="importShow" @tableChanged="querytable"/>
|
||||
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable"/>
|
||||
<DivDialog :dialog-show.sync="divShow" :open-param="openParam" :bill-type="billType" :buss-config="bussConfig"
|
||||
@AddChanged="querytable"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -205,12 +217,23 @@ import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import AddDialog from '@/views/wms/sb/inbill/AddDialog'
|
||||
import DivDialog from '@/views/wms/sb/inbill/DivDialog'
|
||||
import importOrder from '@/views/wms/sb/inbill/importOrder'
|
||||
import { mapGetters } from 'vuex'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
|
||||
export default {
|
||||
name: 'Handle',
|
||||
components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DateRangePicker, DivDialog },
|
||||
components: {
|
||||
ViewDialog,
|
||||
AddDialog,
|
||||
crudOperation,
|
||||
rrOperation,
|
||||
udOperation,
|
||||
pagination,
|
||||
DateRangePicker,
|
||||
DivDialog,
|
||||
importOrder
|
||||
},
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '',
|
||||
@@ -240,6 +263,7 @@ export default {
|
||||
bussConfig: null,
|
||||
currentRow: null,
|
||||
viewShow: false,
|
||||
importShow: false,
|
||||
mstrow: {},
|
||||
storlist: [],
|
||||
billtypelist: [],
|
||||
@@ -273,10 +297,13 @@ export default {
|
||||
canUd(row) {
|
||||
return row.bill_status !== '10'
|
||||
},
|
||||
toView(index,row){
|
||||
toView(index, row) {
|
||||
this.mstrow = row
|
||||
this.viewShow = true
|
||||
},
|
||||
Import() {
|
||||
this.importShow = true
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
|
||||
Reference in New Issue
Block a user