现场代码修改

This commit is contained in:
liuhanqing
2026-03-12 10:49:30 +08:00
parent dca9a8f2f1
commit de868075e9
10 changed files with 162 additions and 76 deletions

View File

@@ -223,18 +223,28 @@ public class ToWcsServiceImpl implements IToWcsService {
}
if (ObjUtil.isNull(basCargoSpace)) {
if ("1519".equals(basCargoSpaceParam.getCargoHight())){
return AjaxResult.error("没有空货位");
}
//去除排的条件 再次查询货位
basCargoSpaceParam.setThePlatoon(null);
basCargoSpaceParam.setRule1(null);
basCargoSpaceParam.setRule2(null);
basCargoSpaceParam.setTheFloor(null);
basCargoSpaceParam.setCargoHight(null);
basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(basCargoSpaceParam);
if (ObjUtil.isNull(basCargoSpace)) {
return AjaxResult.error("没有空货位");
basCargoSpaceParam.setThePlatoon(null);
basCargoSpaceParam.setRule1(null);
basCargoSpaceParam.setRule2(null);
//basCargoSpaceParam.setTheFloor(null);
//basCargoSpaceParam.setCargoHight(null);
basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(basCargoSpaceParam);
if (ObjUtil.isNull(basCargoSpace)) {
return AjaxResult.error("没有空货位");
}
}else {
//去除排的条件 再次查询货位
basCargoSpaceParam.setThePlatoon(null);
basCargoSpaceParam.setRule1(null);
basCargoSpaceParam.setRule2(null);
basCargoSpaceParam.setTheFloor(null);
basCargoSpaceParam.setCargoHight(null);
basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(basCargoSpaceParam);
if (ObjUtil.isNull(basCargoSpace)) {
return AjaxResult.error("没有空货位");
}
}
}
//修改作业状态为正执行

View File

@@ -92,7 +92,7 @@ public class BasCargoSpaceController extends BaseController
/**
* 修改库存信息
*/
@PreAuthorize("@ss.hasPermi('bas:Cargospace:edit')")
@PreAuthorize("@ss.hasPermi('bas:cargoSpace:edit')")
@Log(title = "库存信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BasCargoSpace basCargoSpace)
@@ -103,7 +103,7 @@ public class BasCargoSpaceController extends BaseController
/**
* 删除库存信息
*/
@PreAuthorize("@ss.hasPermi('bas:Cargospace:remove')")
@PreAuthorize("@ss.hasPermi('bas:cargoSpace:remove')")
@Log(title = "库存信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{cargoSpaceIds}")
public AjaxResult remove(@PathVariable String[] cargoSpaceIds)

View File

@@ -9,10 +9,14 @@ import com.ruoyi.bas.cargoSpace.mapper.BasCargoSpaceMapper;
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
import com.ruoyi.bas.warehouse.domain.BasWarehouse;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
/**
* 库存信息Service业务层处理
@@ -47,7 +51,34 @@ public class BasCargoSpaceServiceImpl extends ServiceImpl<BasCargoSpaceMapper,Ba
@Override
//@DataScope(warehouseAlias = "bw")
public List<BasCargoSpace> selectBasCargoSpaceList(BasCargoSpace basCargoSpace)
{
{if (!"admin".equals(SecurityUtils.getUsername())){
LoginUser loginUser = SecurityUtils.getLoginUser();
List<SysRole> roles = loginUser.getUser().getRoles();
//入库需要查看本部门任务
Optional<SysRole> first = roles.stream().filter(x -> "role1".equals(x.getRoleKey())).findFirst();
if (first.isPresent()){
//二联合普通人员
basCargoSpace.setWarehouseId("02");
}
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
if (first1.isPresent()){
//三联合普通人员
basCargoSpace.setWarehouseId("01");
}
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
if (first2.isPresent()){
//二联合管理员
basCargoSpace.setWarehouseId("02");
}
Optional<SysRole> first3 = roles.stream().filter(x -> "role4".equals(x.getRoleKey())).findFirst();
if (first3.isPresent()){
//三联合管理员
basCargoSpace.setWarehouseId("01");
}
}
return basCargoSpaceMapper.selectBasCargoSpaceList(basCargoSpace);
}

View File

@@ -533,37 +533,42 @@ public class MydoJobServiceImpl implements IMydoJobService {
log.error("任务不存在");
return AjaxResult.error(job.getTrayCode()+"该托盘任务不存在");
}
MydoJobDetail mydoJobDetail = new MydoJobDetail();
mydoJobDetail.setJobId(jobId);
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetail);
for (MydoJobDetail detail : mydoJobDetails) {
//修改库存的出库数量
BasStock basStock = basStockMapper.selectBasStockByStockId(detail.getStockId());
if (basStock != null) {
BigDecimal outQuantity = Convert.toBigDecimal(basStock.getOutQuantity());
BigDecimal substract = outQuantity.subtract(Convert.toBigDecimal(detail.getOutQuantity()));
basStock.setOutQuantity(String.valueOf(substract));
basStockMapper.updateBasStock(basStock);
if (job.getStatus().equals("1")){
MydoJobDetail mydoJobDetail = new MydoJobDetail();
mydoJobDetail.setJobId(jobId);
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetail);
for (MydoJobDetail detail : mydoJobDetails) {
//修改库存的出库数量
BasStock basStock = basStockMapper.selectBasStockByStockId(detail.getStockId());
if (basStock != null) {
BigDecimal outQuantity = Convert.toBigDecimal(basStock.getOutQuantity());
BigDecimal substract = outQuantity.subtract(Convert.toBigDecimal(detail.getOutQuantity()));
basStock.setOutQuantity(String.valueOf(substract));
basStockMapper.updateBasStock(basStock);
}
//修改单据数量
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(detail.getInOrOutDId());
if (outStockoutDetail != null) {
BigDecimal allotQuantity = outStockoutDetail.getAllotQuantity();
BigDecimal substract = allotQuantity.subtract(Convert.toBigDecimal(detail.getOutQuantity()));
outStockoutDetail.setAllotQuantity(substract);
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
}
}
//修改单据数量
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(detail.getInOrOutDId());
if (outStockoutDetail != null) {
BigDecimal allotQuantity = outStockoutDetail.getAllotQuantity();
BigDecimal substract = allotQuantity.subtract(Convert.toBigDecimal(detail.getOutQuantity()));
outStockoutDetail.setAllotQuantity(substract);
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
//修改货位状态
BasCargoSpace cargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(job.getCargoSpaceId());
if (cargoSpace != null) {
cargoSpace.setStatus("2");
basCargoSpaceService.updateBasCargoSpace(cargoSpace);
}
job.setStatus("5");
job.setFinishTime(DateUtil.formatDateTime(DateUtil.date()));
updateMydoJob(job);
insertHistory(jobId);
}else {
return AjaxResult.error(job.getTrayCode()+"该托盘任务已发送堆垛机,无法作废");
}
//修改货位状态
BasCargoSpace cargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(job.getCargoSpaceId());
if (cargoSpace != null) {
cargoSpace.setStatus("2");
basCargoSpaceService.updateBasCargoSpace(cargoSpace);
}
job.setStatus("5");
job.setFinishTime(DateUtil.formatDateTime(DateUtil.date()));
updateMydoJob(job);
insertHistory(jobId);
}
} catch (Exception e) {

View File

@@ -1,6 +1,7 @@
package com.ruoyi.kpi.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
@@ -8,6 +9,7 @@ import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import com.ruoyi.bas.cargoSpace.mapper.BasCargoSpaceMapper;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.job.mydojob.domain.MydoJob;
@@ -297,6 +299,34 @@ public class KpiServiceImpl implements KpiService
// 新增:根据仓库和巷道统计各状态货位数量(用于前端饼图)
@Override
public Map<String, Object> getSpaceStatusCounts(String warehouseId, String roadwayId) {
if (!"admin".equals(SecurityUtils.getUsername())){
LoginUser loginUser = SecurityUtils.getLoginUser();
List<SysRole> roles = loginUser.getUser().getRoles();
//入库需要查看本部门任务
Optional<SysRole> first = roles.stream().filter(x -> "role1".equals(x.getRoleKey())).findFirst();
if (first.isPresent()){
//二联合普通人员
warehouseId = "02";
}
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
if (first1.isPresent()){
//三联合普通人员
warehouseId = "01";
}
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
if (first2.isPresent()){
//二联合管理员
warehouseId = "02";
}
Optional<SysRole> first3 = roles.stream().filter(x -> "role4".equals(x.getRoleKey())).findFirst();
if (first3.isPresent()){
//三联合管理员
warehouseId = "01";
}
}
BasCargoSpace query = new BasCargoSpace();
query.setWarehouseId(warehouseId);
query.setRoadwayId(roadwayId);

View File

@@ -23,7 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
/**
* 入库作业流水Controller
*
*
* @author ruoyi
* @date 2025-10-28
*/
@@ -56,7 +56,7 @@ public class ViewInJobFlowController extends BaseController
{
List<ViewInJobFlow> list = viewInJobFlowService.selectViewInJobFlowList(viewInJobFlow);
ExcelUtil<ViewInJobFlow> util = new ExcelUtil<ViewInJobFlow>(ViewInJobFlow.class);
util.exportExcel(response, list, "入库作业流水数据");
util.exportExcel(response, list, "作业流水数据");
}
/**

View File

@@ -25,12 +25,12 @@ public class ViewInJobFlow extends BaseEntity
/** 任务编码 */
@Excel(name = "任务编码")
private String jobId;
/** 入库单 */
@Excel(name = "入库单")
/** 主单 */
@Excel(name = "主单")
private String inOrOutId;
/** 入库子单 */
@Excel(name = "入库子单")
/** 子单 */
@Excel(name = "子单")
private String inOrOutDId;
/** 任务号 */
@@ -42,7 +42,7 @@ public class ViewInJobFlow extends BaseEntity
private String status;
/** 任务类型 */
@Excel(name = "任务类型",dictType = "in_job_type")
@Excel(name = "任务类型",dictType = "job_type")
private Long inOrOut;
@@ -68,6 +68,8 @@ public class ViewInJobFlow extends BaseEntity
/** 托盘条码 */
@Excel(name = "托盘条码")
private String trayCode;
@Excel(name = "货位")
private String cargoSpaceId;
/** 物料编码 */
@Excel(name = "物料编码")
@@ -80,8 +82,8 @@ public class ViewInJobFlow extends BaseEntity
@Excel(name = "规格")
private String spec;
/** 入库数量 */
@Excel(name = "入库数量")
private String inQuantity;
@Excel(name = "数量")
private String quantity;
/** 开始时间 */
@Excel(name = "开始时间")
private String startTime;
@@ -177,6 +179,15 @@ public class ViewInJobFlow extends BaseEntity
private String dateStart;
private String dateEnd;
public String getCargoSpaceId() {
return cargoSpaceId;
}
public void setCargoSpaceId(String cargoSpaceId) {
this.cargoSpaceId = cargoSpaceId;
}
public String getDateStart() {
return dateStart;
}
@@ -441,14 +452,12 @@ public class ViewInJobFlow extends BaseEntity
return enableFlag;
}
public void setInQuantity(String inQuantity)
{
this.inQuantity = inQuantity;
public String getQuantity() {
return quantity;
}
public String getInQuantity()
{
return inQuantity;
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public void setLotNo(String lotNo)
@@ -610,7 +619,7 @@ public class ViewInJobFlow extends BaseEntity
.append("upperNum", getUpperNum())
.append("limitNum", getLimitNum())
.append("enableFlag", getEnableFlag())
.append("inQuantity", getInQuantity())
.append("quantity", getQuantity())
.append("lotNo", getLotNo())
.append("inOrOutId", getInOrOutId())
.append("inOrOutDId", getInOrOutDId())

View File

@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="status" column="status" />
<result property="inOrOut" column="in_or_out" />
<result property="trayCode" column="tray_code" />
<result property="cargoSpaceId" column="cargo_space_id" />
<result property="createTime" column="create_time" />
<result property="startTime" column="start_time" />
<result property="finishTime" column="finish_time" />
@@ -31,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="upperNum" column="upperNum" />
<result property="limitNum" column="limitNum" />
<result property="enableFlag" column="enableFlag" />
<result property="inQuantity" column="in_quantity" />
<result property="quantity" column="quantity" />
<result property="lotNo" column="lot_no" />
<result property="inOrOutId" column="in_or_out_id" />
<result property="inOrOutDId" column="in_or_out_d_id" />
@@ -49,12 +50,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectViewInJobFlowVo">
select job_detail_id, job_id, task_no, status, in_or_out, tray_code, create_time, start_time, finish_time, entrance_id, warehouse_id, product_id, product_name, parent_id, price, cargo_no, unit, spec, remark, productType, systemItem, productCtm, productCtu, upperNum, limitNum, enableFlag, in_quantity, lot_no, in_or_out_id, in_or_out_d_id, priceTotal, origin, turnovertype, account, purpose, units, contract, cases, quality, managementNo,department_id from view_in_job_flow vijf
select job_detail_id, job_id, task_no, status, in_or_out, tray_code,cargo_space_id, create_time, start_time, finish_time, entrance_id, warehouse_id, product_id, product_name, parent_id, price, cargo_no, unit, spec, remark, productType, systemItem, productCtm, productCtu, upperNum, limitNum, enableFlag, quantity, lot_no, in_or_out_id, in_or_out_d_id, priceTotal, origin, turnovertype, account, purpose, units, contract, cases, quality, managementNo,department_id from view_in_job_flow vijf
</sql>
<select id="selectViewInJobFlowList" parameterType="ViewInJobFlow" resultMap="ViewInJobFlowResult">
<include refid="selectViewInJobFlowVo"/>
<where>
where 1=1
<if test="jobDetailId != null and jobDetailId != ''"> and job_detail_id = #{jobDetailId}</if>
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
@@ -79,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="upperNum != null and upperNum != ''"> and upperNum = #{upperNum}</if>
<if test="limitNum != null and limitNum != ''"> and limitNum = #{limitNum}</if>
<if test="enableFlag != null and enableFlag != ''"> and enableFlag = #{enableFlag}</if>
<if test="inQuantity != null and inQuantity != ''"> and in_quantity = #{inQuantity}</if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="inOrOutId != null and inOrOutId != ''"> and in_or_out_id = #{inOrOutId}</if>
<if test="inOrOutDId != null and inOrOutDId != ''"> and in_or_out_d_id = #{inOrOutDId}</if>
@@ -96,10 +97,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="departmentId != null and departmentId != ''"> and (department_id = #{departmentId} or department_id is null or department_id = '')</if>
<if test="dateStart != null and dateStart != ''"> and create_time &gt;= #{dateStart}</if>
<if test="dateEnd != null and dateEnd != ''"> and create_time &lt;= #{dateEnd}</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where>
order by create_time asc
</select>

View File

@@ -98,8 +98,8 @@
<el-table-column label="仓库编码" align="center" prop="warehouseId" />
<el-table-column label="子任务编码" align="center" prop="jobDetailId" width="160"/>
<el-table-column label="任务编码" align="center" prop="jobId" width="160"/>
<el-table-column label="入库单" align="center" prop="inOrOutId" width="160"/>
<el-table-column label="入库子单" align="center" prop="inOrOutDId" width="160"/>
<el-table-column label="主单据" align="center" prop="inOrOutId" width="160"/>
<el-table-column label="子单据" align="center" prop="inOrOutDId" width="160"/>
<el-table-column label="任务号" align="center" prop="taskNo" width="160"/>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
@@ -108,7 +108,7 @@
</el-table-column>
<el-table-column label="任务类型" align="center" prop="inOrOut" width="120">
<template slot-scope="scope">
<dict-tag :options="dict.type.in_job_type" :value="scope.row.inOrOut"/>
<dict-tag :options="dict.type.job_type" :value="scope.row.inOrOut"/>
</template>
</el-table-column>
<el-table-column label="托盘条码" align="center" prop="trayCode" width="100" />
@@ -119,7 +119,7 @@
<el-table-column label="物料编码" align="center" prop="productId" />
<el-table-column label="物料名称" align="center" prop="productName" width="160"/>
<el-table-column label="规格" align="center" prop="spec" width="160"/>
<el-table-column label="入库数量" align="center" prop="inQuantity" />
<el-table-column label="数量" align="center" prop="quantity" />
<el-table-column label="创建时间" align="center" prop="createTime" width="160"/>
<el-table-column label="开始时间" align="center" prop="startTime" width="160"/>
<el-table-column label="结束时间" align="center" prop="finishTime" width="160"/>
@@ -328,7 +328,7 @@ import { listViewInJobFlow, getViewInJobFlow, delViewInJobFlow, addViewInJobFlow
export default {
name: "ViewInJobFlow",
dicts: ['product_type', 'turnover_type', 'quality_type', 'purpose_type', 'origin_type', 'sys_yes_no',"in_job_type", 'account_type', 'mydo_job_status', 'sys_normal_disable'],
dicts: ['product_type', 'turnover_type', 'quality_type', 'purpose_type', 'origin_type', 'sys_yes_no',"job_type", 'account_type', 'mydo_job_status', 'sys_normal_disable'],
data() {
return {
// 遮罩层

View File

@@ -73,14 +73,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="部门" prop="model">
<el-input
v-model="queryParams.model"
placeholder="请输入部门"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="部门" prop="model">-->
<!-- <el-input-->
<!-- v-model="queryParams.model"-->
<!-- placeholder="请输入部门"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="部门名称" prop="deptName">
<el-input
v-model="queryParams.deptName"