This commit is contained in:
psh
2024-05-15 16:44:58 +08:00
parent db7eb0d5f9
commit 90cb23708a
6 changed files with 123 additions and 2 deletions

View File

@@ -130,11 +130,13 @@
a.number,
FLOOR( a.number / b.sum * 100 ) AS percentage
FROM
( SELECT productDescription AS NAME, count(*) AS number FROM sch_base_material GROUP BY productDescription ) a,(
( SELECT productDescription AS NAME, count(*) AS number FROM sch_base_material WHERE incomingWeight > 0 GROUP BY productDescription ) a,(
SELECT
count(*) AS sum
FROM
sch_base_material
WHERE
incomingWeight > 0
) b
</select>

View File

@@ -102,4 +102,10 @@ public class PdaController {
return new ResponseEntity<>(pdaService.zpjb(param), HttpStatus.OK);
}
@PostMapping("/ycck")
@Log("废包材异常出库")
@ApiOperation("废包材异常出库")
public ResponseEntity<Object> ycck(){
return new ResponseEntity<>(pdaService.ycck(), HttpStatus.OK);
}
}

View File

@@ -19,4 +19,6 @@ public interface PdaService {
PdaResponseVo zpjb(JSONObject param);
PdaResponseVo ycck();
}

View File

@@ -136,4 +136,21 @@ public class PdaServiceImpl implements PdaService {
}
return PdaResponseVo.pdaResultOk("组盘解绑成功");
}
@Override
public PdaResponseVo ycck() {
JSONObject param=new JSONObject();
SchBasePoint schBasePoint= pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, "FBC01"));
param.put("sub_tray",schBasePoint.getVehicle_code2());
param.put("mother_tray",schBasePoint.getVehicle_code());
this.zpjb(param);
param.put("request_medthod_code", "POINTTask");
param.put("request_medthod_name", "点对点任务");
param.put("device_code","FBC01");
param.put("start_point","FBC01");
param.put("next_point","DKT01");
BaseResponse baseResponse=acsToWmsService.acsApply(param);
return PdaResponseVo.pdaResultOk(baseResponse.getMessage());
}
}

View File

@@ -2,6 +2,7 @@ package org.nl.wms.sch.point.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -13,6 +14,8 @@ import org.nl.system.service.role.dao.SysRole;
import org.nl.system.service.user.ISysUserService;
import org.nl.system.service.user.dto.SysUserDetail;
import org.nl.system.service.user.dto.UserQuery;
import org.nl.wms.ext.service.AcsToWmsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.springframework.beans.factory.annotation.Autowired;
@@ -39,6 +42,8 @@ public class SchBasePointController {
private ISchBasePointService schBasePointService;
@Autowired
private ISysUserService userService;
@Autowired
private AcsToWmsService acsToWmsService;
@GetMapping
@Log("查询点位管理")
@@ -101,4 +106,22 @@ public class SchBasePointController {
public ResponseEntity<Object> getPointList(@RequestBody(required = false) SchBasePoint region){
return new ResponseEntity<>(schBasePointService.getPointList(region),HttpStatus.OK);
}
@PostMapping("/outbound")
@Log("原材料异常出库")
@ApiOperation("原材料异常出库")
//@SaCheckPermission("@el.check('schBaseRegion:list')")
public ResponseEntity<Object> outbound(@RequestBody JSONObject param){
param.put("request_medthod_code", "POINTTask");
param.put("request_medthod_name", "点对点任务");
param.put("start_point",param.getString("device_code"));
param.put("next_point","FBC01");
SchBasePoint schBasePoint= schBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
.eq(SchBasePoint::getPoint_code, "FBC01"));
if(schBasePoint.getVehicle_qty()==1){
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}
BaseResponse baseResponse=acsToWmsService.acsApply(param);
return new ResponseEntity<>(baseResponse,HttpStatus.OK);
}
}

View File

@@ -3,6 +3,29 @@
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<el-dialog
title="选择异常出库原因"
:visible.sync="reasonDialogVisible"
width="30%"
:before-close="closeReasonDialog"
>
<el-form ref="reasonForm" :model="reasonForm" label-width="80px">
<el-form-item label="原因" prop="reason">
<el-select v-model="reasonForm.reason" placeholder="请选择异常出库原因">
<el-option
v-for="item in dict.reason"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="closeReasonDialog">取消</el-button>
<el-button type="primary" @click="submitReason">确认</el-button>
</div>
</el-dialog>
<el-form
:inline="true"
class="demo-form-inline"
@@ -302,6 +325,15 @@
:data="scope.row"
:permission="permission"
/>
<el-button
v-if="showQtyButton(scope.row.vehicle_qty,scope.row.region_code)"
size="mini"
type="text"
icon="el-icon-view"
@click="openReasonDialog(scope.row)"
>
异常出库
</el-button>
<!-- <el-button
v-if="showButton(scope.row.point_status)"
size="mini"
@@ -367,7 +399,7 @@ const defaultForm = {
}
export default {
name: 'SchBasePoint',
dicts: ['vehicle_type', 'TrueOrFalse'],
dicts: ['vehicle_type', 'TrueOrFalse','reason'],
components: { PointDialog, ViewDialog, pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
@@ -406,6 +438,9 @@ export default {
region_code: [
{ required: true, message: '区域类型不能为空', trigger: 'blur' }
]
},reasonDialogVisible: false,
reasonForm: {
reason: ""
},
workShopList: [],
regionList: [],
@@ -483,6 +518,12 @@ export default {
this.crud.toQuery()
})
},
showQtyButton(vehicle_qty,region_code) {
if (vehicle_qty === 1 && region_code === 'YL') {
return true
}
return false
},
showButton(point_status) {
if (point_status && point_status === '2') {
return true
@@ -505,6 +546,36 @@ export default {
this.crud.query.point_type = null
this.crud.query.point_status = null
this.hand()
},openReasonDialog(row) {
// 打开选择原因的对话框
this.reasonDialogVisible = true;
// 这里可以将row存储到data中以便在提交时使用
this.selectedRow = row;
},closeReasonDialog() {
// 关闭选择原因的对话框
this.reasonDialogVisible = false;
this.$refs["reasonForm"].resetFields();
},submitReason() {
// 提交选择的原因到后端接口
const data = {
reason: this.reasonForm.reason,
device_code: this.selectedRow.point_code
};
// 调用后端接口提交数据
// 这里假设使用axios库发送POST请求
this.$axios
.post("/api/schBasePoint/outbound", data)
.then(response => {
// 处理后端返回的数据
console.log("提交成功", response);
this.$message.success("提交成功");
this.closeReasonDialog();
})
.catch(error => {
// 处理错误情况
console.error("提交失败,废包材位有货", error);
this.$message.error("提交失败,废包材位有货");
});
}
}
}