fix: 混料退料、取样计数手持接口,虚拟库、退料报表开发
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package org.nl.wms.cockpit.rest;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.cockpit.service.ReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 报表管理
|
||||
* @Date: 2024/5/16
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "报表管理")
|
||||
@RequestMapping("/api/report")
|
||||
public class ReportController {
|
||||
|
||||
@Autowired
|
||||
private ReportService reportService;
|
||||
|
||||
@GetMapping("/queryXN")
|
||||
@Log("查询出窑虚拟库、货架、木托虚拟库库存")
|
||||
@ApiOperation("查询出窑虚拟库、货架、木托虚拟库库存")
|
||||
//@SaCheckPermission("point:list")
|
||||
public ResponseEntity<Object> queryXN(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(reportService.queryXN(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
@GetMapping("/mudMaterialReport")
|
||||
@Log("泥料退料报表")
|
||||
@ApiOperation("泥料退料报表")
|
||||
//@SaCheckPermission("point:list")
|
||||
public ResponseEntity<Object> mudMaterialReport(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(reportService.mudMaterialReport(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.wms.cockpit.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2024/5/16
|
||||
*/
|
||||
public interface ReportService {
|
||||
Map<String,Object> queryXN(Map whereJson, Pageable page);
|
||||
|
||||
Map<String,Object> mudMaterialReport(Map whereJson, Pageable page);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.nl.wms.cockpit.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.cockpit.service.ReportService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2024/5/16
|
||||
*/
|
||||
@Service
|
||||
public class ReportServiceImpl implements ReportService {
|
||||
@Override
|
||||
public Map<String, Object> queryXN(Map whereJson, Pageable page) {
|
||||
return WQL.getWO("REPORT").addParam("flag", "1").addParam("point_code", whereJson.get("point_code")).pageQuery(WqlUtil.getHttpContext(page), "sd.create_time desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> mudMaterialReport(Map whereJson, Pageable page) {
|
||||
return WQL.getWO("REPORT").addParam("flag", "2").pageQuery(WqlUtil.getHttpContext(page), "sd.create_time desc, m.order_code");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
[交易说明]
|
||||
交易名: 车间情况
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
sd.*,
|
||||
p.point_name,
|
||||
m.material_code,
|
||||
m.order_code
|
||||
FROM
|
||||
`st_ivt_vehicle_detail` sd
|
||||
LEFT JOIN sch_base_point p ON p.point_code = sd.point_code
|
||||
LEFT JOIN md_me_materialbase m ON m.material_id = sd.material_id
|
||||
WHERE p.region_code = 'XN' AND sd.is_delete = '0'
|
||||
OPTION 输入.point_code <> ""
|
||||
sd.point_code = 输入.point_code
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
sd.*,
|
||||
p.point_name,
|
||||
m.material_code,
|
||||
m.order_code
|
||||
FROM
|
||||
`st_ivt_vehicle_detail` sd
|
||||
LEFT JOIN sch_base_point p ON p.point_code = sd.point_code
|
||||
LEFT JOIN md_me_materialbase m ON m.material_id = sd.material_id
|
||||
WHERE sd.is_back = '1'
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
@@ -425,4 +425,24 @@ public class PdaController {
|
||||
public JSONObject kilnMovePointList() {
|
||||
return PdaUtils.buildSuccessResultJSON(pdaService.kilnMovePointList());
|
||||
}
|
||||
// ====================================================================
|
||||
|
||||
@PostMapping("/manual/materialReturn")
|
||||
@Log("泥料退料")
|
||||
@ApiOperation("泥料退料")
|
||||
@PdaAnnotation
|
||||
public JSONObject MaterialReturn(@RequestBody JSONObject param) {
|
||||
pdaService.MaterialReturn(param);
|
||||
return PdaUtils.buildSuccessResultJSON(null);
|
||||
}
|
||||
// ====================================================================
|
||||
|
||||
@PostMapping("/manual/samplingCountNum")
|
||||
@Log("取样计数")
|
||||
@ApiOperation("取样计数")
|
||||
@PdaAnnotation
|
||||
public JSONObject samplingCountNum(@RequestBody JSONObject param) {
|
||||
pdaService.samplingCountNum(param);
|
||||
return PdaUtils.buildSuccessResultJSON(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,4 +232,16 @@ public interface PdaService {
|
||||
* @return /
|
||||
*/
|
||||
JSONArray suppressTaskShow();
|
||||
|
||||
/**
|
||||
* 退料
|
||||
* @param param /
|
||||
*/
|
||||
void MaterialReturn(JSONObject param);
|
||||
|
||||
/**
|
||||
* 取样计数
|
||||
* @param param /
|
||||
*/
|
||||
void samplingCountNum(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ import org.nl.wms.sch.task.util.TaskUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author 张江玮
|
||||
* @date 2022/12/02 10:04
|
||||
@@ -1107,4 +1109,44 @@ public class PdaServiceImpl implements PdaService {
|
||||
public JSONArray suppressTaskShow() {
|
||||
return this.getMixingTaskList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void MaterialReturn(JSONObject param) {
|
||||
log.info("请求参数:{}", param);
|
||||
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
|
||||
WQLObject orderTab = WQLObject.getWQLObject("pdm_bd_workorder");
|
||||
// param: vehicle_code
|
||||
String vehicleCode = param.getString("vehicle_code");
|
||||
JSONObject groupObj = vd_table.query("vehicle_code = '" + vehicleCode + "' AND vehicle_type = '1'", "create_time desc").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(groupObj)) {
|
||||
throw new BadRequestException("料盅[" + vehicleCode + "]组盘信息不存在!");
|
||||
}
|
||||
// 查找工单
|
||||
JSONObject orderObj = orderTab.query("workorder_id = '" + groupObj.getString("workorder_id") + "'").uniqueResult(0);
|
||||
orderObj.put("unqualified_qty", orderObj.getBigDecimal("unqualified_qty").add(groupObj.getBigDecimal("weight")));
|
||||
TaskUtils.addCurrentUpdateColum(orderObj);
|
||||
orderTab.update(orderObj);
|
||||
// 组盘修改
|
||||
groupObj.put("is_back", "1");
|
||||
TaskUtils.addCurrentUpdateColum(groupObj);
|
||||
vd_table.update(groupObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void samplingCountNum(JSONObject param) {
|
||||
log.info("请求参数:{}", param);
|
||||
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
|
||||
// param: vehicle_code, number
|
||||
String vehicleCode = param.getString("vehicle_code");
|
||||
BigDecimal number = param.getBigDecimal("number");
|
||||
JSONObject groupObj = vd_table.query("vehicle_code = '" + vehicleCode + "' AND vehicle_type = '2'", "create_time desc").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(groupObj)) {
|
||||
throw new BadRequestException("托盘[" + vehicleCode + "]组盘信息不存在!");
|
||||
}
|
||||
BigDecimal bigDecimal = ObjectUtil.isNotEmpty(groupObj.getBigDecimal("count_num")) ? groupObj.getBigDecimal("count_num") : new BigDecimal("0");
|
||||
groupObj.put("count_num", bigDecimal.add(number));
|
||||
TaskUtils.addCurrentUpdateColum(groupObj);
|
||||
vd_table.update(groupObj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,8 +215,8 @@ public class PointServiceImpl implements PointService {
|
||||
|
||||
@Override
|
||||
public JSONArray getPoint(Map wherJson) {
|
||||
String area_type = (String) wherJson.get("area_type");
|
||||
JSONArray point_rows = WQLObject.getWQLObject("sch_base_point").query("area_type IN (" + area_type + ") AND is_used = '1' AND is_delete = '0' order by point_code").getResultJSONArray(0);
|
||||
String area_type = (String) wherJson.get("region_Code");
|
||||
JSONArray point_rows = WQLObject.getWQLObject("sch_base_point").query("region_Code IN ('" + area_type + "') order by point_code").getResultJSONArray(0);
|
||||
return point_rows;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
73
lms/nladmin-ui/src/views/wms/report/back/index.vue
Normal file
73
lms/nladmin-ui/src/views/wms/report/back/index.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="vehicle_code" label="托盘号" :min-width="flexWidth('vehicle_code',crud.data,'托盘号')" />
|
||||
<el-table-column prop="vehicle_type" label="托盘类型" :min-width="flexWidth('vehicle_type',crud.data,'托盘类型')">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'拆垛工位')" />
|
||||
<el-table-column prop="weight" label="物料重量" :min-width="flexWidth('weight',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="qty" label="物料数量" :min-width="flexWidth('qty',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'分拣工单')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudPoint from '@/api/wms/sch/point'
|
||||
export default {
|
||||
name: 'BackMaterial',
|
||||
dicts: ['vehicle_type'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '虚拟库存报表',
|
||||
url: 'api/report/mudMaterialReport',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
106
lms/nladmin-ui/src/views/wms/report/xn/index.vue
Normal file
106
lms/nladmin-ui/src/views/wms/report/xn/index.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="100px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="虚拟库位置">
|
||||
<el-select
|
||||
v-model="query.point_code"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="虚拟库位置"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in regionList"
|
||||
:key="item.point_id"
|
||||
:label="item.point_name"
|
||||
:value="item.point_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="vehicle_code" label="托盘号" :min-width="flexWidth('vehicle_code',crud.data,'托盘号')" />
|
||||
<el-table-column prop="vehicle_type" label="托盘类型" :min-width="flexWidth('vehicle_type',crud.data,'托盘类型')">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'拆垛工位')" />
|
||||
<el-table-column prop="weight" label="物料重量" :min-width="flexWidth('weight',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="qty" label="物料数量" :min-width="flexWidth('qty',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'分拣工单')" />
|
||||
<el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'分拣工单')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudPoint from '@/api/wms/sch/point'
|
||||
export default {
|
||||
name: 'XnShow',
|
||||
dicts: ['vehicle_type'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '虚拟库存报表',
|
||||
url: 'api/report/queryXN',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
regionList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const param = {
|
||||
'region_Code': 'XN'
|
||||
}
|
||||
crudPoint.getPoint(param).then(res => {
|
||||
this.regionList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user