修改
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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -100,6 +100,16 @@
|
||||
</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"
|
||||
@@ -188,8 +198,10 @@
|
||||
<pagination/>
|
||||
</div>
|
||||
<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" />
|
||||
<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: [],
|
||||
@@ -277,6 +301,9 @@ export default {
|
||||
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