库存维护记录
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package com.ruoyi.job.mydojob.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.job.mydojobfinish.service.IMydoJobFinishService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -28,11 +31,13 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/job/mydoJob")
|
||||
@RequestMapping("/job/inmydoJob")
|
||||
public class InMydoJobController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
@Autowired
|
||||
private IMydoJobFinishService mydoJobFinishService;
|
||||
|
||||
/**
|
||||
* 查询任务表列表
|
||||
@@ -42,7 +47,12 @@ public class InMydoJobController extends BaseController
|
||||
public TableDataInfo list(MydoJob mydoJob)
|
||||
{
|
||||
startPage();
|
||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
||||
List<MydoJob> list = null;
|
||||
if(Integer.parseInt(mydoJob.getStatus())<4) {
|
||||
list = mydoJobService.selectMydoJobList(mydoJob);
|
||||
}else{
|
||||
list= mydoJobFinishService.selectMydoJobFinishListByMydoJob(mydoJob);
|
||||
}
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,10 +34,14 @@ public class MydoJob
|
||||
/** 供应商ID */
|
||||
@Excel(name = "供应商ID")
|
||||
private String supplierId;
|
||||
@Excel(name = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
/** 客户ID */
|
||||
@Excel(name = "客户ID")
|
||||
private String customerId;
|
||||
@Excel(name = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
/** 部门ID */
|
||||
@Excel(name = "部门ID")
|
||||
@@ -54,6 +58,8 @@ public class MydoJob
|
||||
/** 货位ID */
|
||||
@Excel(name = "货位ID")
|
||||
private String cargoSpaceId;
|
||||
@Excel(name = "货位名称")
|
||||
private String cargoSpaceName;
|
||||
|
||||
/** 目标巷道ID */
|
||||
@Excel(name = "目标巷道ID")
|
||||
@@ -62,6 +68,8 @@ public class MydoJob
|
||||
/** 目标货位ID */
|
||||
@Excel(name = "目标货位ID")
|
||||
private String targetCargoSpaceId;
|
||||
@Excel(name = "目标货位名称")
|
||||
private String targetCargoSpaceName;
|
||||
|
||||
/** 产线ID */
|
||||
@Excel(name = "产线ID")
|
||||
@@ -110,6 +118,8 @@ public class MydoJob
|
||||
/** 仓库ID */
|
||||
@Excel(name = "仓库ID")
|
||||
private String warehouseId;
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 重分标记 */
|
||||
@Excel(name = "重分标记")
|
||||
@@ -373,6 +383,40 @@ public class MydoJob
|
||||
return faultFlag;
|
||||
}
|
||||
|
||||
public String getSupplierName() {
|
||||
return supplierName;
|
||||
}
|
||||
|
||||
public void setSupplierName(String supplierName) {
|
||||
this.supplierName = supplierName;
|
||||
}
|
||||
|
||||
public String getCustomerName() {
|
||||
return customerName;
|
||||
}
|
||||
|
||||
public void setCustomerName(String customerName) {
|
||||
this.customerName = customerName;
|
||||
}
|
||||
|
||||
public String getCargoSpaceName() {
|
||||
return cargoSpaceName;
|
||||
}
|
||||
|
||||
public void setCargoSpaceName(String cargoSpaceName) {
|
||||
this.cargoSpaceName = cargoSpaceName;
|
||||
}
|
||||
|
||||
public String getTargetCargoSpaceName() {
|
||||
return targetCargoSpaceName;
|
||||
}
|
||||
|
||||
public void setTargetCargoSpaceName(String targetCargoSpaceName) {
|
||||
this.targetCargoSpaceName = targetCargoSpaceName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
package com.ruoyi.stock.stock.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord;
|
||||
import com.ruoyi.stock.maintain.service.IBasStockMaintainRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.stock.stock.mapper.BasStockMapper;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 库存信息Service业务层处理
|
||||
@@ -18,6 +26,8 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
{
|
||||
@Autowired
|
||||
private BasStockMapper basStockMapper;
|
||||
@Autowired
|
||||
private IBasStockMaintainRecordService basStockMaintainRecordService;
|
||||
|
||||
/**
|
||||
* 查询库存信息
|
||||
@@ -52,9 +62,27 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
@Override
|
||||
public int insertBasStock(BasStock basStock)
|
||||
{
|
||||
insertMaintainRecord(null,basStock,"1");
|
||||
return basStockMapper.insertBasStock(basStock);
|
||||
}
|
||||
|
||||
private void insertMaintainRecord(BasStock oldStock,BasStock basStock, String operate) {
|
||||
BasStockMaintainRecord basStockMaintainRecord = new BasStockMaintainRecord();
|
||||
basStockMaintainRecord.setWhGuid(IdUtil.fastSimpleUUID());
|
||||
basStockMaintainRecord.setStockId(basStock.getStockId());
|
||||
basStockMaintainRecord.setCargoSpaceId(basStock.getCargoSpaceId());
|
||||
basStockMaintainRecord.setLotNo(basStock.getLotNo());
|
||||
basStockMaintainRecord.setTrayCode(basStock.getTrayCode());
|
||||
basStockMaintainRecord.setProductGuid(basStock.getProductGuid());
|
||||
basStockMaintainRecord.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
basStockMaintainRecord.setCreateTime(new Date());
|
||||
basStockMaintainRecord.setOldQuantity(oldStock!=null?oldStock.getQuantity():"0");
|
||||
basStockMaintainRecord.setQuantity(basStock.getQuantity());
|
||||
basStockMaintainRecord.setWarehouseId(basStock.getWarehouseId());
|
||||
basStockMaintainRecord.setMethod(operate);
|
||||
basStockMaintainRecordService.insertBasStockMaintainRecord(basStockMaintainRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存信息
|
||||
*
|
||||
@@ -64,6 +92,8 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
@Override
|
||||
public int updateBasStock(BasStock basStock)
|
||||
{
|
||||
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(basStock.getStockId());
|
||||
insertMaintainRecord(oldBasStock,basStock,"2");
|
||||
return basStockMapper.updateBasStock(basStock);
|
||||
}
|
||||
|
||||
@@ -74,8 +104,13 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteBasStockByStockIds(String[] stockIds)
|
||||
{
|
||||
for (String stockId : stockIds) {
|
||||
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(stockId);
|
||||
insertMaintainRecord(oldBasStock,oldBasStock,"3");
|
||||
}
|
||||
return basStockMapper.deleteBasStockByStockIds(stockIds);
|
||||
}
|
||||
|
||||
@@ -88,6 +123,8 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
@Override
|
||||
public int deleteBasStockByStockId(String stockId)
|
||||
{
|
||||
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(stockId);
|
||||
insertMaintainRecord(oldBasStock,oldBasStock,"3");
|
||||
return basStockMapper.deleteBasStockByStockId(stockId);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,46 +30,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="classId" column="class_id" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="faultFlag" column="fault_flag" />
|
||||
<result property="supplierName" column="supplier_name" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
<result property="cargoSpaceName" column="cargo_space_name" />
|
||||
<result property="targetCargoSpaceName" column="target_cargo_space_name" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMydoJobVo">
|
||||
select job_id, status, on_line_type, task_no, supplier_id, customer_id, department_id, tray_code, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, line_id, workshop_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, class_id, warehouse_id, fault_flag from mydo_job
|
||||
select mj.job_id, mj.status, mj.on_line_type, mj.task_no, mj.supplier_id,
|
||||
mj.customer_id, mj.department_id, mj.tray_code, mj.roadway_id, mj.cargo_space_id,
|
||||
mj.target_roadway_id, mj.target_cargo_space_id, mj.line_id, mj.workshop_id, mj.priority,
|
||||
mj.execution_phase, mj.in_or_out, mj.create_time, mj.start_time, mj.finish_time, mj.entrance_id,
|
||||
mj.exit_id, mj.class_id, mj.warehouse_id, mj.fault_flag,
|
||||
bs.supplier_name as supplier_name, bc.customer_name as customer_name,
|
||||
bcs.cargo_space_name as cargo_space_name, bcst.cargo_space_name as target_cargo_space_name,
|
||||
bw.warehouse_name as warehouse_name
|
||||
from mydo_job mj
|
||||
left join bas_supplier bs on mj.supplier_id = bs.id
|
||||
left join bas_customer bc on mj.customer_id = bc.id
|
||||
left join bas_cargo_space bcs on mj.cargo_space_id = bcs.cargo_space_id
|
||||
left join bas_cargo_space bcst on mj.target_cargo_space_id = bcst.cargo_space_id
|
||||
left join bas_warehouse bw on mj.warehouse_id = bw.warehouse_id
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobVo"/>
|
||||
<where>
|
||||
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="onLineType != null and onLineType != ''"> and on_line_type = #{onLineType}</if>
|
||||
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
||||
<if test="supplierId != null and supplierId != ''"> and supplier_id = #{supplierId}</if>
|
||||
<if test="customerId != null and customerId != ''"> and customer_id = #{customerId}</if>
|
||||
<if test="departmentId != null and departmentId != ''"> and department_id = #{departmentId}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="roadwayId != null and roadwayId != ''"> and roadway_id = #{roadwayId}</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="targetRoadwayId != null and targetRoadwayId != ''"> and target_roadway_id = #{targetRoadwayId}</if>
|
||||
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''"> and target_cargo_space_id = #{targetCargoSpaceId}</if>
|
||||
<if test="lineId != null and lineId != ''"> and line_id = #{lineId}</if>
|
||||
<if test="workshopId != null and workshopId != ''"> and workshop_id = #{workshopId}</if>
|
||||
<if test="priority != null "> and priority = #{priority}</if>
|
||||
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
||||
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
||||
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
||||
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
||||
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
||||
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
||||
<if test="classId != null and classId != ''"> and class_id = #{classId}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="faultFlag != null and faultFlag != ''"> and fault_flag = #{faultFlag}</if>
|
||||
<if test="inOut != null and inOut != '' and inOut ='2' "> and in_or_out >=20</if>
|
||||
<if test="jobId != null and jobId != ''"> and mj.job_id = #{jobId}</if>
|
||||
<if test="status != null and status != ''"> and mj.status = #{status}</if>
|
||||
<if test="onLineType != null and onLineType != ''"> and mj.on_line_type = #{onLineType}</if>
|
||||
<if test="taskNo != null and taskNo != ''"> and mj.task_no = #{taskNo}</if>
|
||||
<if test="supplierId != null and supplierId != ''"> and mj.supplier_id = #{supplierId}</if>
|
||||
<if test="customerId != null and customerId != ''"> and mj.customer_id = #{customerId}</if>
|
||||
<if test="departmentId != null and departmentId != ''"> and mj.department_id = #{departmentId}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and mj.tray_code = #{trayCode}</if>
|
||||
<if test="roadwayId != null and roadwayId != ''"> and mj.roadway_id = #{roadwayId}</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and mj.cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="targetRoadwayId != null and targetRoadwayId != ''"> and mj.target_roadway_id = #{targetRoadwayId}</if>
|
||||
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''"> and mj.target_cargo_space_id = #{targetCargoSpaceId}</if>
|
||||
<if test="lineId != null and lineId != ''"> and mj.line_id = #{lineId}</if>
|
||||
<if test="workshopId != null and workshopId != ''"> and mj.workshop_id = #{workshopId}</if>
|
||||
<if test="priority != null "> and mj.priority = #{priority}</if>
|
||||
<if test="executionPhase != null and executionPhase != ''"> and mj.execution_phase = #{executionPhase}</if>
|
||||
<if test="inOrOut != null and inOrOut != ''"> and mj.in_or_out = #{inOrOut}</if>
|
||||
<if test="startTime != null and startTime != ''"> and mj.start_time = #{startTime}</if>
|
||||
<if test="finishTime != null and finishTime != ''"> and mj.finish_time = #{finishTime}</if>
|
||||
<if test="entranceId != null and entranceId != ''"> and mj.entrance_id = #{entranceId}</if>
|
||||
<if test="exitId != null and exitId != ''"> and mj.exit_id = #{exitId}</if>
|
||||
<if test="classId != null and classId != ''"> and mj.class_id = #{classId}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and mj.warehouse_id = #{warehouseId}</if>
|
||||
<if test="faultFlag != null and faultFlag != ''"> and mj.fault_flag = #{faultFlag}</if>
|
||||
<if test="inOut != null and inOut != '' and inOut ='2' "> and mj.in_or_out >=20</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByJobId" parameterType="String" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobVo"/>
|
||||
where job_id = #{jobId}
|
||||
where mj.job_id = #{jobId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMydoJob" parameterType="MydoJob">
|
||||
|
||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 查询任务表列表
|
||||
export function listMydoJob(query) {
|
||||
return request({
|
||||
url: '/job/mydoJob/list',
|
||||
url: '/job/inmydoJob/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -12,7 +12,7 @@ export function listMydoJob(query) {
|
||||
// 查询任务表详细
|
||||
export function getMydoJob(jobId) {
|
||||
return request({
|
||||
url: '/job/mydoJob/' + jobId,
|
||||
url: '/job/inmydoJob/' + jobId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -20,7 +20,7 @@ export function getMydoJob(jobId) {
|
||||
// 新增任务表
|
||||
export function addMydoJob(data) {
|
||||
return request({
|
||||
url: '/job/mydoJob',
|
||||
url: '/job/inmydoJob',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -29,7 +29,7 @@ export function addMydoJob(data) {
|
||||
// 修改任务表
|
||||
export function updateMydoJob(data) {
|
||||
return request({
|
||||
url: '/job/mydoJob',
|
||||
url: '/job/inmydoJob',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -38,7 +38,7 @@ export function updateMydoJob(data) {
|
||||
// 删除任务表
|
||||
export function delMydoJob(jobId) {
|
||||
return request({
|
||||
url: '/job/mydoJob/' + jobId,
|
||||
url: '/job/inmydoJob/' + jobId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -261,14 +261,14 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务号" align="center" prop="taskNo" />
|
||||
<el-table-column label="供应商ID" align="center" prop="supplierId" />
|
||||
<el-table-column label="供应商" align="center" prop="supplierName" key="supplierId" value="supplierName" />
|
||||
<!-- <el-table-column label="客户ID" align="center" prop="customerId" />-->
|
||||
<el-table-column label="部门ID" align="center" prop="departmentId" />
|
||||
<el-table-column label="托盘码" align="center" prop="trayCode" />
|
||||
<el-table-column label="巷道ID" align="center" prop="roadwayId" />
|
||||
<el-table-column label="货位ID" align="center" prop="cargoSpaceId" />
|
||||
<el-table-column label="目标巷道ID" align="center" prop="targetRoadwayId" />
|
||||
<el-table-column label="目标货位ID" align="center" prop="targetCargoSpaceId" />
|
||||
<el-table-column label="货位" align="center" prop="cargoSpaceName" />
|
||||
<el-table-column label="目标巷道" align="center" prop="targetRoadwayId" />
|
||||
<el-table-column label="目标货位" align="center" prop="targetCargoSpaceName" />
|
||||
<el-table-column label="产线ID" align="center" prop="lineId" />
|
||||
<el-table-column label="车间ID" align="center" prop="workshopId" />
|
||||
<el-table-column label="优先级" align="center" prop="priority" />
|
||||
@@ -352,7 +352,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob } from "@/api/job/mydoJob"
|
||||
import { listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob } from "@/api/job/inmydoJob"
|
||||
import { listMydoJobDetail } from "@/api/job/mydoJobDetail"
|
||||
|
||||
export default {
|
||||
@@ -389,7 +389,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
jobId: null,
|
||||
status: null,
|
||||
status: 1,
|
||||
onLineType: null,
|
||||
taskNo: null,
|
||||
supplierId: null,
|
||||
@@ -418,6 +418,7 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
jobId: null,
|
||||
status: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -436,6 +437,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 获取字典数据后,设置默认值
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
@@ -541,6 +543,7 @@ export default {
|
||||
this.currentRow = row;
|
||||
// 更新子表格查询参数
|
||||
this.queryDetailParams.jobId = row.jobId;
|
||||
this.queryDetailParams.status = row.status;
|
||||
// 查询子表格数据
|
||||
this.getDetailList();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user