diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/rest/HandXCOutIvtController.java b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/rest/HandXCOutIvtController.java index cc6f5506..7b0a6848 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/rest/HandXCOutIvtController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/rest/HandXCOutIvtController.java @@ -42,8 +42,8 @@ public class HandXCOutIvtController { } @PostMapping("/confirmoutstore") - @Log("确认发货") - @ApiOperation("确认发货") + @Log("出库确认") + @ApiOperation("出库确认") public ResponseEntity confirmOutStore(@RequestBody Map whereJson) { return new ResponseEntity<>(handXCOutIvtService.confirmOutStore(whereJson), HttpStatus.OK); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandXCOutIvtServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandXCOutIvtServiceImpl.java index 9a8be770..1b446f2c 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandXCOutIvtServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/pda/st/out/service/impl/HandXCOutIvtServiceImpl.java @@ -137,9 +137,9 @@ public class HandXCOutIvtServiceImpl implements HandXCOutIvtService { String diskrecord_id = dtl.getString("diskrecord_id"); HashMap map = new HashMap(); map.put("is_send","1"); - map.put("send_id",currentUserId+""); - map.put("send_name",userDto.getNickName()); - map.put("send_time",DateUtil.now()); + map.put("out_id",currentUserId+""); + map.put("out_name",userDto.getNickName()); + map.put("out_time",DateUtil.now()); PDM_BI_ProcedureOffline.update(map,"diskrecord_id='"+diskrecord_id+"'"); } JSONObject returnjo = new JSONObject(); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls index 5debcb08..93c00a5e 100644 Binary files a/mes/hd/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls and b/mes/hd/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls differ diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/rest/StatisticalReportController.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/rest/StatisticalReportController.java index c08b2a9f..e01d01d5 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/rest/StatisticalReportController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/rest/StatisticalReportController.java @@ -1,5 +1,6 @@ package org.nl.wms.statistics.rest; +import com.alibaba.fastjson.JSONArray; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -33,6 +34,15 @@ public class StatisticalReportController { return new ResponseEntity<>(statisticalReportService.sendOutQuery(whereJson, page), HttpStatus.OK); } + @PutMapping("/confirmOutStore") + @Log("确认发货") + @ApiOperation("确认发货") + public ResponseEntity confirmOutStore(@RequestBody JSONArray whereJson) { + return new ResponseEntity<>(statisticalReportService.confirmOutStore(whereJson), HttpStatus.OK); + } + + + @GetMapping("/productInstor") @Log("PG粉当月入库查询") @ApiOperation("PG粉当月入库查询") diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/StatisticalReportService.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/StatisticalReportService.java index 43050ed8..48f85c2c 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/StatisticalReportService.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/StatisticalReportService.java @@ -1,7 +1,6 @@ package org.nl.wms.statistics.service; import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; import org.springframework.data.domain.Pageable; import java.util.Map; @@ -49,4 +48,13 @@ public interface StatisticalReportService { JSONArray query3(Map whereJson); JSONArray query4(Map whereJson); + + + /** + * 发货确认 + * + * @param jsonObject 条件 + * @return Map + */ + Map confirmOutStore(JSONArray jsonObject); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java index a6ba0b10..4f1c0efd 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/StatisticalReportServiceImpl.java @@ -1,21 +1,21 @@ package org.nl.wms.statistics.service.impl; -import cn.hutool.core.date.DateTime; -import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; import cn.hutool.core.map.MapUtil; -import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.exception.BadRequestException; -import org.nl.wms.basedata.master.constant.MaterOptTypeEnum; +import org.nl.modules.system.service.UserService; +import org.nl.modules.system.service.dto.UserDto; +import org.nl.pda.exception.PdaRequestException; +import org.nl.utils.SecurityUtils; import org.nl.wms.common.util.DataAuthUtil; import org.nl.wms.statistics.service.StatisticalReportService; -import org.nl.wms.statistics.service.StifleQueryService; import org.nl.wql.WQL; import org.nl.wql.core.bean.WQLObject; import org.nl.wql.util.WqlUtil; @@ -23,7 +23,6 @@ import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -32,6 +31,8 @@ import java.util.stream.Collectors; @Slf4j public class StatisticalReportServiceImpl implements StatisticalReportService { + private final UserService userService; + @Override public Map sendOutQuery(Map whereJson, Pageable page) { HashMap map = new HashMap<>(whereJson); @@ -63,7 +64,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService { } map.put("flag", "5"); - JSONObject jo = WQL.getWO("statistical_report_query_02").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "material_code"); + JSONObject jo = WQL.getWO("statistical_report_query_02").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "send_date desc,material_code,pcsn"); return jo; } @@ -553,4 +554,47 @@ public class StatisticalReportServiceImpl implements StatisticalReportService { .process().getResultJSONArray(0); return ja; } + //diskrecord_id -> + @Override + @Transactional + public Map confirmOutStore(JSONArray list) { + Long currentUserId = SecurityUtils.getCurrentUserId(); + UserDto userDto = userService.findById(currentUserId); + for (Object raw : list) { + JSONObject jsonObject = (JSONObject)JSON.toJSON(raw); + String storagevehicle_code = (String) jsonObject.get("storagevehicle_code"); + if (StrUtil.isEmpty(storagevehicle_code)) { + throw new PdaRequestException("载具不能为空!"); + } + if (StrUtil.isEmpty(jsonObject.getString("diskrecord_id"))) { + throw new PdaRequestException("组盘记录不能为空"); + } + // 仓位属性表【ST_IVT_StructAttr】 + WQLObject PDM_BI_ProcedureOffline = WQLObject.getWQLObject("PDM_BI_ProcedureOffline"); + + JSONObject jo = PDM_BI_ProcedureOffline.query("storagevehicle_code='"+storagevehicle_code+"'").uniqueResult(0); + if(jo==null){ + throw new PdaRequestException("该载具"+storagevehicle_code+"无组盘记录!"); + } + if (!jo.getString("diskrecord_id").equals(jsonObject.getString("diskrecord_id"))){ + throw new PdaRequestException("该载具"+storagevehicle_code+"对应编号不一致!"); + } + String is_send = jo.getString("is_send"); + if(!"1".equals(is_send)){ + throw new PdaRequestException("该载具"+storagevehicle_code+"状态不是已出库状态,不允许发货!"); + } + String diskrecord_id = jsonObject.getString("diskrecord_id"); + HashMap map = new HashMap(); + map.put("is_send","2"); + map.put("send_id",currentUserId+""); + map.put("send_name",userDto.getNickName()); + map.put("send_time",DateUtil.now()); + PDM_BI_ProcedureOffline.update(map,"diskrecord_id='"+diskrecord_id+"'"); + } + + JSONObject returnjo = new JSONObject(); + returnjo.put("code", "1"); + returnjo.put("desc", "操作成功!"); + return returnjo; + } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/wql/statistical_report_query_02.wql b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/wql/statistical_report_query_02.wql index 66dd491d..90c6528d 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/wql/statistical_report_query_02.wql +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/wql/statistical_report_query_02.wql @@ -194,6 +194,7 @@ SELECT procedureoffline2.num_bucket, procedureoffline2.total_qty, + procedureoffline.diskrecord_id, procedureoffline.storagevehicle_code, procedureoffline.is_send AS is_send, procedureoffline.send_name AS send_name, diff --git a/mes/qd/src/api/wms/statistics/report.js b/mes/qd/src/api/wms/statistics/report.js index 4bf9f363..722453fa 100644 --- a/mes/qd/src/api/wms/statistics/report.js +++ b/mes/qd/src/api/wms/statistics/report.js @@ -54,4 +54,12 @@ export function query4(params) { }) } -export default { getHeader, getHeader2, materPlanDtlQuery, query1, query2, query3, query4 } +export function confirmOutStore(data) { + return request({ + url: 'api/statistical/confirmOutStore', + method: 'put', + data + }) +} + +export default { getHeader, getHeader2, materPlanDtlQuery, query1, query2, query3, query4, confirmOutStore } diff --git a/mes/qd/src/views/wms/statistics/sendOutQuery/index.vue b/mes/qd/src/views/wms/statistics/sendOutQuery/index.vue index 4cc29610..227e8a59 100644 --- a/mes/qd/src/views/wms/statistics/sendOutQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/sendOutQuery/index.vue @@ -89,7 +89,7 @@ /> - + - + + + 确认发货 + + - + @@ -127,12 +143,14 @@ - + - + + + @@ -151,6 +169,7 @@ import DateRangePicker from '@/components/DateRangePicker' import AddDialog from '@/views/wms/ql/inspectionsheet/AddDialog' import ResultPutDialog from '@/views/wms/ql/inspectionsheet/ResultPutDialog' import Date from '@/utils/datetime' +import report from '@/api/wms/statistics/report' import workorder from '@/api/wms/pdm/workorder' export default { @@ -188,8 +207,9 @@ export default { openParam: {}, query_flag: true, passList: [ - { 'label': '是', 'value': '1' }, - { 'label': '否', 'value': '0' } + { 'label': '未出库', 'value': '0' }, + { 'label': '已出库', 'value': '1' }, + { 'label': '已发货', 'value': '2' } ], permission: { } @@ -204,6 +224,25 @@ export default { }) }, methods: { + checkboxT(row) { + return row.is_send === '1' + }, + typeChange() { + this.checkrows = this.$refs.table.selection + this.$confirm('是否确认发货?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + report.confirmOutStore(this.checkrows).then(res => { + if (res.code === '0') { + this.crud.notify(res.desc, CRUD.NOTIFICATION_TYPE.ERROR) + } else { + this.crud.notify('操作完成', CRUD.NOTIFICATION_TYPE.SUCCESS) + } + }) + }) + }, // 钩子:在获取表格数据之前执行,false 则代表不获取数据 [CRUD.HOOK.beforeRefresh]() { }, @@ -214,13 +253,12 @@ export default { this.buttonChange(row) } else if (val.length === 1) { this.buttonChange(row) - }else{ + } else { this.handleCurrentChange(null) } }, onSelectAll() { this.$refs.table.clearSelection() - this.handleCurrentChange(null) }, orgFormat(row) { for (const item of this.Depts) { @@ -240,11 +278,11 @@ export default { onInput() { this.$forceUpdate() }, - mytoQuery(array1){ - if(array1 === null){ + mytoQuery(array1) { + if (array1 === null) { this.crud.query.begin_time = '' this.crud.query.end_time = '' - }else{ + } else { this.crud.query.begin_time = array1[0] this.crud.query.end_time = array1[1] } @@ -263,9 +301,13 @@ export default { } }, formatResult(row) { - if (row.is_send === '1') { - return '是' - } else return '否' + if (row.is_send === '2') { + return '已发货' + } else if (row.is_send === '1') { + return '已出库' + } else { + return '未出库' + } }, stateFormat(row) { return this.dict.label.workorder_status[row.workorder_status]