Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -96,15 +96,5 @@ public class BasWarehouseController extends BaseController
|
||||
{
|
||||
return toAjax(basWarehouseService.deleteBasWarehouseByWarehouseIds(warehouseIds));
|
||||
}
|
||||
/**
|
||||
* 获取除了CTU以外的库
|
||||
*/
|
||||
@RequestMapping("/getWarehouseByType")
|
||||
@ResponseBody
|
||||
public AjaxResult getWarehouseByType()
|
||||
{
|
||||
|
||||
List<BasWarehouse> list = basWarehouseService.selectBasWarehouseListByType();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,9 @@ public class BasWarehouse extends BaseEntity
|
||||
|
||||
/*仓库数据权限*/
|
||||
private List<String> dataScope;
|
||||
private List<String> typeData;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -60,9 +60,6 @@ public interface BasWarehouseMapper
|
||||
*/
|
||||
public int deleteBasWarehouseByWarehouseIds(String[] warehouseIds);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public List<BasWarehouse> selectBasWarehouseListByType();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,5 @@ public interface IBasWarehouseService
|
||||
*/
|
||||
public int deleteBasWarehouseByWarehouseId(String warehouseId);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public List<BasWarehouse> selectBasWarehouseListByType();
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.bas.warehouse.domain.BasWarehouse;
|
||||
import com.ruoyi.bas.warehouse.mapper.BasWarehouseMapper;
|
||||
import com.ruoyi.bas.warehouse.service.IBasWarehouseService;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
@@ -51,21 +52,10 @@ public class BasWarehouseServiceImpl implements IBasWarehouseService
|
||||
* @return 仓库管理
|
||||
*/
|
||||
@Override
|
||||
@DataScope
|
||||
public List<BasWarehouse> selectBasWarehouseList(BasWarehouse basWarehouse)
|
||||
{
|
||||
List<SysRole> roles = sysRoleService.selectRolesByUserId(SecurityUtils.getUserId());
|
||||
if (roles.stream().anyMatch(SysRole::isAdmin)){
|
||||
return basWarehouseMapper.selectBasWarehouseList(basWarehouse);
|
||||
}else {
|
||||
List<String> dateScope =new ArrayList<>();
|
||||
for (SysRole role : roles) {
|
||||
if (CollUtil.isNotEmpty(role.getWarehouseDataScope())){
|
||||
dateScope.addAll(role.getWarehouseDataScope());
|
||||
}
|
||||
}
|
||||
basWarehouse.setDataScope(dateScope);
|
||||
return basWarehouseMapper.selectBasWarehouseList(basWarehouse);
|
||||
}
|
||||
return basWarehouseMapper.selectBasWarehouseList(basWarehouse);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,11 +106,5 @@ public class BasWarehouseServiceImpl implements IBasWarehouseService
|
||||
return basWarehouseMapper.deleteBasWarehouseByWarehouseId(warehouseId);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public List<BasWarehouse> selectBasWarehouseListByType() {
|
||||
return basWarehouseMapper.selectBasWarehouseListByType();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
@@ -49,6 +50,7 @@ public class InStockinServiceImpl implements IInStockinService
|
||||
* @return 入库单据
|
||||
*/
|
||||
@Override
|
||||
@DataScope(warehouseAlias = "is2")
|
||||
public List<InStockin> selectInStockinList(InStockin inStockin)
|
||||
{
|
||||
return inStockinMapper.selectInStockinList(inStockin);
|
||||
|
||||
@@ -138,4 +138,8 @@ public class InStockinDetail extends BaseEntity
|
||||
|
||||
private ExtraField extraField;
|
||||
|
||||
private String warehouseName;
|
||||
|
||||
private String warehouseId;
|
||||
|
||||
}
|
||||
|
||||
@@ -68,5 +68,5 @@ public interface InStockinDetailMapper
|
||||
|
||||
void deleteInStockinDetailByStockinGuid(String stockinGuid);
|
||||
|
||||
List<InStockinDetail> selectStockinByDetailById(String stockinDetailId);
|
||||
InStockinDetail selectStockinByDetailById(String stockinDetailId);
|
||||
}
|
||||
|
||||
@@ -80,5 +80,5 @@ public interface IInStockinDetailService
|
||||
AjaxResult barcodePrinting(Map<String,Object> stockinDetailId);
|
||||
|
||||
|
||||
public List<InStockinDetail> selectStockinByDetailById(String stockinDetailId);
|
||||
public InStockinDetail selectStockinByDetailById(String stockinDetailId);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class InStockinDetailServiceImpl implements IInStockinDetailService
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InStockinDetail> selectStockinByDetailById(String stockinDetailId) {
|
||||
public InStockinDetail selectStockinByDetailById(String stockinDetailId) {
|
||||
return inStockinDetailMapper.selectStockinByDetailById(stockinDetailId);
|
||||
|
||||
}
|
||||
|
||||
@@ -121,9 +121,19 @@ public class MydoJobDetail extends BaseEntity
|
||||
private String spare4;
|
||||
|
||||
private String status;
|
||||
@Excel(name = "拣选数量")
|
||||
private String pickQuantity;
|
||||
//额外字段
|
||||
private ExtraField extraField;
|
||||
|
||||
public String getPickQuantity() {
|
||||
return pickQuantity;
|
||||
}
|
||||
|
||||
public void setPickQuantity(String pickQuantity) {
|
||||
this.pickQuantity = pickQuantity;
|
||||
}
|
||||
|
||||
public ExtraField getExtraField() {
|
||||
return extraField;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 历史子作业对象 mydo_job_detail_finish
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@@ -118,263 +118,274 @@ public class MydoJobDetailFinish extends BaseEntity
|
||||
/** 备用字段4 */
|
||||
@Excel(name = "备用字段4")
|
||||
private String spare4;
|
||||
@Excel(name = "拣选数量")
|
||||
private String pickQuantity;
|
||||
|
||||
public void setJobDetailId(String jobDetailId)
|
||||
public String getPickQuantity() {
|
||||
return pickQuantity;
|
||||
}
|
||||
|
||||
public void setPickQuantity(String pickQuantity) {
|
||||
this.pickQuantity = pickQuantity;
|
||||
}
|
||||
|
||||
|
||||
public void setJobDetailId(String jobDetailId)
|
||||
{
|
||||
this.jobDetailId = jobDetailId;
|
||||
}
|
||||
|
||||
public String getJobDetailId()
|
||||
public String getJobDetailId()
|
||||
{
|
||||
return jobDetailId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId)
|
||||
public void setJobId(String jobId)
|
||||
{
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getJobId()
|
||||
public String getJobId()
|
||||
{
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setStockId(String stockId)
|
||||
public void setStockId(String stockId)
|
||||
{
|
||||
this.stockId = stockId;
|
||||
}
|
||||
|
||||
public String getStockId()
|
||||
public String getStockId()
|
||||
{
|
||||
return stockId;
|
||||
}
|
||||
|
||||
public void setLotNo(String lotNo)
|
||||
public void setLotNo(String lotNo)
|
||||
{
|
||||
this.lotNo = lotNo;
|
||||
}
|
||||
|
||||
public String getLotNo()
|
||||
public String getLotNo()
|
||||
{
|
||||
return lotNo;
|
||||
}
|
||||
|
||||
public void setInDate(String inDate)
|
||||
public void setInDate(String inDate)
|
||||
{
|
||||
this.inDate = inDate;
|
||||
}
|
||||
|
||||
public String getInDate()
|
||||
public String getInDate()
|
||||
{
|
||||
return inDate;
|
||||
}
|
||||
|
||||
public void setInOrOutId(String inOrOutId)
|
||||
public void setInOrOutId(String inOrOutId)
|
||||
{
|
||||
this.inOrOutId = inOrOutId;
|
||||
}
|
||||
|
||||
public String getInOrOutId()
|
||||
public String getInOrOutId()
|
||||
{
|
||||
return inOrOutId;
|
||||
}
|
||||
|
||||
public void setInOrOutDId(String inOrOutDId)
|
||||
public void setInOrOutDId(String inOrOutDId)
|
||||
{
|
||||
this.inOrOutDId = inOrOutDId;
|
||||
}
|
||||
|
||||
public String getInOrOutDId()
|
||||
public String getInOrOutDId()
|
||||
{
|
||||
return inOrOutDId;
|
||||
}
|
||||
|
||||
public void setProductGuid(String productGuid)
|
||||
public void setProductGuid(String productGuid)
|
||||
{
|
||||
this.productGuid = productGuid;
|
||||
}
|
||||
|
||||
public String getProductGuid()
|
||||
public String getProductGuid()
|
||||
{
|
||||
return productGuid;
|
||||
}
|
||||
|
||||
public void setProductId(String productId)
|
||||
public void setProductId(String productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductId()
|
||||
public String getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setStockStatus(String stockStatus)
|
||||
public void setStockStatus(String stockStatus)
|
||||
{
|
||||
this.stockStatus = stockStatus;
|
||||
}
|
||||
|
||||
public String getStockStatus()
|
||||
public String getStockStatus()
|
||||
{
|
||||
return stockStatus;
|
||||
}
|
||||
|
||||
public void setInQuantity(String inQuantity)
|
||||
public void setInQuantity(String inQuantity)
|
||||
{
|
||||
this.inQuantity = inQuantity;
|
||||
}
|
||||
|
||||
public String getInQuantity()
|
||||
public String getInQuantity()
|
||||
{
|
||||
return inQuantity;
|
||||
}
|
||||
|
||||
public void setStockQuantity(String stockQuantity)
|
||||
public void setStockQuantity(String stockQuantity)
|
||||
{
|
||||
this.stockQuantity = stockQuantity;
|
||||
}
|
||||
|
||||
public String getStockQuantity()
|
||||
public String getStockQuantity()
|
||||
{
|
||||
return stockQuantity;
|
||||
}
|
||||
|
||||
public void setOutQuantity(String outQuantity)
|
||||
public void setOutQuantity(String outQuantity)
|
||||
{
|
||||
this.outQuantity = outQuantity;
|
||||
}
|
||||
|
||||
public String getOutQuantity()
|
||||
public String getOutQuantity()
|
||||
{
|
||||
return outQuantity;
|
||||
}
|
||||
|
||||
public void setLayerQuantity(String layerQuantity)
|
||||
public void setLayerQuantity(String layerQuantity)
|
||||
{
|
||||
this.layerQuantity = layerQuantity;
|
||||
}
|
||||
|
||||
public String getLayerQuantity()
|
||||
public String getLayerQuantity()
|
||||
{
|
||||
return layerQuantity;
|
||||
}
|
||||
|
||||
public void setOutLayerQuantity(String outLayerQuantity)
|
||||
public void setOutLayerQuantity(String outLayerQuantity)
|
||||
{
|
||||
this.outLayerQuantity = outLayerQuantity;
|
||||
}
|
||||
|
||||
public String getOutLayerQuantity()
|
||||
public String getOutLayerQuantity()
|
||||
{
|
||||
return outLayerQuantity;
|
||||
}
|
||||
|
||||
public void setGiveNum(String giveNum)
|
||||
public void setGiveNum(String giveNum)
|
||||
{
|
||||
this.giveNum = giveNum;
|
||||
}
|
||||
|
||||
public String getGiveNum()
|
||||
public String getGiveNum()
|
||||
{
|
||||
return giveNum;
|
||||
}
|
||||
|
||||
public void setStockinId(String stockinId)
|
||||
public void setStockinId(String stockinId)
|
||||
{
|
||||
this.stockinId = stockinId;
|
||||
}
|
||||
|
||||
public String getStockinId()
|
||||
public String getStockinId()
|
||||
{
|
||||
return stockinId;
|
||||
}
|
||||
|
||||
public void setStackingId(String stackingId)
|
||||
public void setStackingId(String stackingId)
|
||||
{
|
||||
this.stackingId = stackingId;
|
||||
}
|
||||
|
||||
public String getStackingId()
|
||||
public String getStackingId()
|
||||
{
|
||||
return stackingId;
|
||||
}
|
||||
|
||||
public void setExitId(String exitId)
|
||||
public void setExitId(String exitId)
|
||||
{
|
||||
this.exitId = exitId;
|
||||
}
|
||||
|
||||
public String getExitId()
|
||||
public String getExitId()
|
||||
{
|
||||
return exitId;
|
||||
}
|
||||
|
||||
public void setPrintDate(String printDate)
|
||||
public void setPrintDate(String printDate)
|
||||
{
|
||||
this.printDate = printDate;
|
||||
}
|
||||
|
||||
public String getPrintDate()
|
||||
public String getPrintDate()
|
||||
{
|
||||
return printDate;
|
||||
}
|
||||
|
||||
public void setCustomerId(String customerId)
|
||||
public void setCustomerId(String customerId)
|
||||
{
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
public String getCustomerId()
|
||||
public String getCustomerId()
|
||||
{
|
||||
return customerId;
|
||||
}
|
||||
|
||||
public void setSupplierId(String supplierId)
|
||||
public void setSupplierId(String supplierId)
|
||||
{
|
||||
this.supplierId = supplierId;
|
||||
}
|
||||
|
||||
public String getSupplierId()
|
||||
public String getSupplierId()
|
||||
{
|
||||
return supplierId;
|
||||
}
|
||||
|
||||
public void setSpare1(String spare1)
|
||||
public void setSpare1(String spare1)
|
||||
{
|
||||
this.spare1 = spare1;
|
||||
}
|
||||
|
||||
public String getSpare1()
|
||||
public String getSpare1()
|
||||
{
|
||||
return spare1;
|
||||
}
|
||||
|
||||
public void setSpare2(String spare2)
|
||||
public void setSpare2(String spare2)
|
||||
{
|
||||
this.spare2 = spare2;
|
||||
}
|
||||
|
||||
public String getSpare2()
|
||||
public String getSpare2()
|
||||
{
|
||||
return spare2;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
public void setSpare4(String spare4)
|
||||
public void setSpare4(String spare4)
|
||||
{
|
||||
this.spare4 = spare4;
|
||||
}
|
||||
|
||||
public String getSpare4()
|
||||
public String getSpare4()
|
||||
{
|
||||
return spare4;
|
||||
}
|
||||
|
||||
@@ -11,12 +11,14 @@ import com.ruoyi.in.stockin.domain.InStockin;
|
||||
import com.ruoyi.in.stockin.service.IInStockinService;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
||||
import com.ruoyi.pda.domain.TrayCodeMsg;
|
||||
import com.ruoyi.pda.service.PdaService;
|
||||
import com.ruoyi.pda.trayMsg.domain.TrayMsg;
|
||||
import com.ruoyi.pda.trayMsg.service.ITrayMsgService;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -127,13 +129,14 @@ public class PdaController extends BaseController {
|
||||
*/
|
||||
@RequestMapping("/inorder/detail")
|
||||
@ResponseBody
|
||||
public List<InStockinDetail> inoderList(String stockinDetailId) {
|
||||
List<InStockinDetail> inStockinDetail = inStockinDetailService.selectStockinByDetailById(stockinDetailId);
|
||||
public InStockinDetail inoderList(String stockinDetailId) {
|
||||
InStockinDetail inStockinDetail = inStockinDetailService.selectStockinByDetailById(stockinDetailId);
|
||||
return inStockinDetail;
|
||||
}
|
||||
/**
|
||||
* 绑定托盘物料
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:bindTrayMsg:submit')")
|
||||
@RequestMapping("/bindTrayMsg")
|
||||
@ResponseBody
|
||||
public AjaxResult bindTrayMsg(@RequestBody TrayCodeMsg trayCodeMsg) {
|
||||
@@ -143,6 +146,7 @@ public class PdaController extends BaseController {
|
||||
/**
|
||||
* 查询托盘已绑定物料
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pda:bindMsg:list')")
|
||||
@RequestMapping("/bindMsg")
|
||||
@ResponseBody
|
||||
public AjaxResult bindMsg(String trayCode) {
|
||||
@@ -158,27 +162,25 @@ public class PdaController extends BaseController {
|
||||
@ResponseBody
|
||||
public AjaxResult addInJob(@RequestBody TrayCodeMsg trayCodeMsg) {
|
||||
BasWarehouse basWarehouse = basWarehouseService.selectBasWarehouseByWarehouseId(trayCodeMsg.getWarehouseId());
|
||||
if(basWarehouse==null){
|
||||
return AjaxResult.error("仓库不存在");
|
||||
}
|
||||
// if(basWarehouse==null){
|
||||
// return AjaxResult.error("仓库不存在");
|
||||
// }
|
||||
if("1".equals(basWarehouse.getWarehouseType()) && StrUtil.isEmpty(trayCodeMsg.getCargoSpaceId())){
|
||||
return AjaxResult.error("请选择高架库货位");
|
||||
}
|
||||
if("2".equals(basWarehouse.getWarehouseType()) && StrUtil.isEmpty(trayCodeMsg.getEntranceId())){
|
||||
return AjaxResult.error("请选择入口");
|
||||
}
|
||||
|
||||
return pdaService.addInJob(trayCodeMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库确认
|
||||
* @param trayCode 托盘码
|
||||
* @param trayCodeMakeSure 托盘信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/outMakeSure")
|
||||
@PostMapping("/outMakeSure")
|
||||
@ResponseBody
|
||||
public AjaxResult outMakeSure(String trayCode) {
|
||||
return pdaService.outMakeSure(trayCode);
|
||||
public AjaxResult outMakeSure(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
|
||||
return pdaService.outMakeSure(trayCodeMakeSure);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.pda.domain;
|
||||
|
||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class TrayCodeMakeSure {
|
||||
//托盘码
|
||||
private String trayCode;
|
||||
//容器码
|
||||
private String containerCode;
|
||||
//拣选列表
|
||||
private List<MydoJobDetail> mydoJobDetailList;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.pda.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
||||
import com.ruoyi.pda.domain.TrayCodeMsg;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
@@ -22,5 +23,5 @@ public interface PdaService {
|
||||
public AjaxResult addInJob(TrayCodeMsg trayCodeMsg);
|
||||
|
||||
|
||||
AjaxResult outMakeSure(String trayCode);
|
||||
AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,32 @@
|
||||
package com.ruoyi.pda.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.in.stockin.service.IInStockinService;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.pda.domain.TrayCodeMakeSure;
|
||||
import com.ruoyi.pda.domain.TrayCodeMsg;
|
||||
import com.ruoyi.pda.mapper.PdaMapper;
|
||||
import com.ruoyi.pda.trayMsg.domain.TrayMsg;
|
||||
import com.ruoyi.pda.trayMsg.service.ITrayMsgService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -16,9 +34,20 @@ import java.util.List;
|
||||
@Service
|
||||
public class PdaServiceImp implements PdaService{
|
||||
@Autowired
|
||||
PdaMapper pdaMapper;
|
||||
private PdaMapper pdaMapper;
|
||||
@Autowired
|
||||
IBasCargoSpaceService basCargoSpaceService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
@Autowired
|
||||
private IMydoJobDetailService mydoJobDetailService;;
|
||||
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;;
|
||||
@Autowired
|
||||
ISysRoleService sysRoleService;
|
||||
@Autowired
|
||||
IInStockinDetailService inStockinDetailService;
|
||||
@Autowired
|
||||
ITrayMsgService trayMsgService;
|
||||
|
||||
/**
|
||||
* 空托盘入库
|
||||
@@ -94,6 +123,32 @@ public class PdaServiceImp implements PdaService{
|
||||
|
||||
@Override
|
||||
public AjaxResult bindTrayMsg(TrayCodeMsg trayCodeMsg) {
|
||||
//判断用户的仓库权限
|
||||
List<SysRole> roles = sysRoleService.selectRolesByUserId(SecurityUtils.getUserId());
|
||||
if (!roles.stream().anyMatch(SysRole::isAdmin)){
|
||||
|
||||
for (SysRole role : roles) {
|
||||
if (CollUtil.isNotEmpty(role.getWarehouseDataScope())){
|
||||
InStockinDetail inStockinDetail = inStockinDetailService.selectStockinByDetailById(trayCodeMsg.getStockinDetailId());
|
||||
if(!role.getWarehouseDataScope().stream().anyMatch(warehouseId -> warehouseId.equals(inStockinDetail.getWarehouseId()))){
|
||||
return AjaxResult.warn("此用户无权限操作该仓库物料");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//判断与已绑定物料是否为同一仓库
|
||||
TrayMsg trayMsg = new TrayMsg();
|
||||
trayMsg.setTrayCode(trayCodeMsg.getTrayCode());
|
||||
List<TrayMsg> trayMsgs = trayMsgService.selectTrayMsgList(trayMsg);
|
||||
if(trayMsgs.size()>0){
|
||||
InStockinDetail inStockinDetail = inStockinDetailService.selectStockinByDetailById(trayCodeMsg.getStockinDetailId());
|
||||
if(!trayMsgs.get(0).getWarehouseId().equals(inStockinDetail.getWarehouseId())){
|
||||
return AjaxResult.warn("同一托盘不能绑定不同仓库的物料");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMsg.getTrayCode());
|
||||
map.put("v_stockin_detail_id", trayCodeMsg.getStockinDetailId());
|
||||
@@ -112,9 +167,8 @@ public class PdaServiceImp implements PdaService{
|
||||
public AjaxResult addInJob(TrayCodeMsg trayCodeMsg) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMsg.getTrayCode());
|
||||
map.put("v_warehouse_id", trayCodeMsg.getWarehouseId());
|
||||
// map.put("v_warehouse_id", trayCodeMsg.getWarehouseId());
|
||||
map.put("v_cargo_space_id", trayCodeMsg.getCargoSpaceId());
|
||||
map.put("v_entrance_id", trayCodeMsg.getEntranceId());
|
||||
pdaMapper.addInJob(map);
|
||||
String result = map.get("v_result").toString();
|
||||
if("10".equals(result)){
|
||||
@@ -126,15 +180,46 @@ public class PdaServiceImp implements PdaService{
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult outMakeSure(String trayCode) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCode);
|
||||
pdaMapper.outMakeSure(map);
|
||||
String result = map.get("v_result").toString();
|
||||
if("10".equals(result)){
|
||||
return AjaxResult.success(map.get("v_resultmsg").toString());
|
||||
}else{
|
||||
return AjaxResult.warn(map.get("v_resultmsg").toString());
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure) {
|
||||
//修改拣选数量
|
||||
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList();
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
|
||||
MydoJobDetail mydoJobDetailOld = mydoJobDetailService.selectMydoJobDetailByJobDetailId(mydoJobDetail.getJobDetailId());
|
||||
BigDecimal oldPickQuantity = Convert.toBigDecimal(mydoJobDetailOld.getPickQuantity());
|
||||
BigDecimal newPickQuantity = Convert.toBigDecimal(mydoJobDetail.getPickQuantity());
|
||||
mydoJobDetail.setPickQuantity(oldPickQuantity.add(newPickQuantity).toString());
|
||||
mydoJobDetailService.updateMydoJobDetail(mydoJobDetail);
|
||||
}
|
||||
|
||||
//查询当前任务是否已经全部拣选完成
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTrayCode(trayCodeMakeSure.getTrayCode());
|
||||
List<MydoJob> mydoJobList = mydoJobService.selectMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isEmpty(mydoJobList)){
|
||||
return AjaxResult.warn("任务不存在");
|
||||
}
|
||||
|
||||
MydoJobDetail mydoJobDetailParam = new MydoJobDetail();
|
||||
mydoJobDetailParam.setJobId(mydoJobList.get(0).getJobId());
|
||||
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(mydoJobDetailParam);
|
||||
if (CollUtil.isEmpty(mydoJobDetails)){
|
||||
return AjaxResult.warn("子任务不存在");
|
||||
}
|
||||
|
||||
boolean flag = mydoJobDetails.stream().allMatch(mydoJobDetail -> mydoJobDetail.getPickQuantity().equals(mydoJobDetail.getOutQuantity()));
|
||||
if (flag){
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
pdaMapper.outMakeSure(map);
|
||||
String result = map.get("v_result").toString();
|
||||
if("10".equals(result)){
|
||||
return AjaxResult.success(map.get("v_resultmsg").toString());
|
||||
}else{
|
||||
return AjaxResult.warn(map.get("v_resultmsg").toString());
|
||||
}
|
||||
}else {
|
||||
return AjaxResult.warn("拣选完成");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,36 @@ public class TrayMsg extends BaseEntity
|
||||
|
||||
private String productName;
|
||||
|
||||
private String warehouseId;
|
||||
|
||||
private String warehouseName;
|
||||
|
||||
private String warehouseType;
|
||||
|
||||
public String getWarehouseType() {
|
||||
return warehouseType;
|
||||
}
|
||||
|
||||
public void setWarehouseType(String warehouseType) {
|
||||
this.warehouseType = warehouseType;
|
||||
}
|
||||
|
||||
public String getWarehouseId() {
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setWarehouseId(String warehouseId) {
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseName() {
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName) {
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
@@ -23,21 +23,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectBasWarehouseList" parameterType="BasWarehouse" resultMap="BasWarehouseResult">
|
||||
<include refid="selectBasWarehouseVo"/>
|
||||
<where>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="warehouseNo != null and warehouseNo != ''"> and warehouse_no = #{warehouseNo}</if>
|
||||
<if test="projectNo != null and projectNo != ''"> and project_no = #{projectNo}</if>
|
||||
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
|
||||
<if test="address != null and address != ''"> and address = #{address}</if>
|
||||
<if test="cDesc != null and cDesc != ''"> and c_desc = #{cDesc}</if>
|
||||
<if test="warehouseKind != null and warehouseKind != ''"> and warehouse_kind = #{warehouseKind}</if>
|
||||
<if test="warehouseType != null and warehouseType != ''"> and warehouse_type = #{warehouseType}</if>
|
||||
<if test="isCurrent != null and isCurrent != ''"> and is_current = #{isCurrent}</if>
|
||||
<if test="dataScope !=null and dataScope.size()>0">
|
||||
and warehouse_id in
|
||||
<foreach item="item" index="index" collection="dataScope" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="warehouseId != null and warehouseId != ''">and warehouse_id = #{warehouseId}</if>
|
||||
<if test="warehouseNo != null and warehouseNo != ''">and warehouse_no = #{warehouseNo}</if>
|
||||
<if test="projectNo != null and projectNo != ''">and project_no = #{projectNo}</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">and warehouse_name like concat('%',
|
||||
#{warehouseName}, '%')
|
||||
</if>
|
||||
<if test="address != null and address != ''">and address = #{address}</if>
|
||||
<if test="cDesc != null and cDesc != ''">and c_desc = #{cDesc}</if>
|
||||
<if test="warehouseKind != null and warehouseKind != ''">and warehouse_kind = #{warehouseKind}</if>
|
||||
<if test="warehouseType != null and warehouseType != ''">and warehouse_type = #{warehouseType}</if>
|
||||
<if test="isCurrent != null and isCurrent != ''">and is_current = #{isCurrent}</if>
|
||||
<if test="dataScope !=null and dataScope.size()>0">
|
||||
and warehouse_id in
|
||||
<foreach item="item" index="index" collection="dataScope" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="typeData != null and typeData.size()>0">
|
||||
and warehouse_type in
|
||||
<foreach item="item" index="index" collection="typeData" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
||||
${params.warehouseDataScope}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -98,8 +109,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectBasWarehouseListByType" resultMap="BasWarehouseResult">
|
||||
<include refid="selectBasWarehouseVo"/>
|
||||
where warehouse_type in (1,3)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -35,6 +35,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="scanNum" column="scan_num" />
|
||||
<result property="scanNumX" column="scan_num_x" />
|
||||
<result property="scanNumJ" column="scan_num_j" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<association property="extraField" javaType="ExtraField">
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="materialDesc" column="product_name" />
|
||||
@@ -301,10 +303,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
isd.supplier_id, isd.customer_id, isd.unit, isd.spec, isd.spare1, isd.spare2, isd.spare3, isd.spare4,
|
||||
isd.spare5, isd.spare6, isd.scan_num, isd.scan_num_x, isd.scan_num_j,
|
||||
bp.product_name, bp.spare1 as englishDesc,
|
||||
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume
|
||||
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume,bw.warehouse_name,ist.warehouse_id
|
||||
from in_stockin_detail isd
|
||||
left join bas_product bp on bp.product_id = isd.product_id
|
||||
left join in_stockin ist on ist.stockin_guid = isd.stockin_guid
|
||||
left join bas_warehouse bw on bw.warehouse_id = ist.warehouse_id
|
||||
<where>
|
||||
<if test="stockinDetailId != null and stockinDetailId != '' ">
|
||||
isd.stockin_detail_id = #{stockinDetailId}
|
||||
|
||||
@@ -95,6 +95,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where lot_no like concat('%',#{lotNo},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
||||
${params.warehouseDataScope}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<result property="spare4" column="spare4" />
|
||||
<result property="pickQuantity" column="pick_quantity" />
|
||||
<association property="extraField" javaType="ExtraField">
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="materialDesc" column="product_name" />
|
||||
@@ -70,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
mjd.spare2,
|
||||
mjd.spare3,
|
||||
mjd.spare4,
|
||||
mjd.pick_quantity,
|
||||
bp.product_name, bp.spare1 as englishDesc,
|
||||
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<result property="spare4" column="spare4" />
|
||||
<result property="pickQuantity" column="pick_quantity" />
|
||||
<association property="extraField" javaType="ExtraField">
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="materialDesc" column="product_name" />
|
||||
@@ -70,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
mjd.spare2,
|
||||
mjd.spare3,
|
||||
mjd.spare4,
|
||||
mjd.pick_quantity,
|
||||
bp.product_name, bp.spare1 as englishDesc,
|
||||
bp.spare2 as netWeight,bp.spare5 as length,bp.spare6 as width,bp.spare7 as height,bp.spare8 as volume
|
||||
|
||||
@@ -146,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
<if test="spare4 != null">spare4,</if>
|
||||
<if test="pickQuantity != null">pick_quantity,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="jobDetailId != null and jobDetailId != ''">#{jobDetailId},</if>
|
||||
@@ -174,6 +177,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
<if test="spare4 != null">#{spare4},</if>
|
||||
<if test="pickQuantity != null">#{pick_quantity},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertHistory">
|
||||
@@ -208,6 +212,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
<if test="spare4 != null">spare4 = #{spare4},</if>
|
||||
<if test="pickQuantity != null">pick_quantity = #{pickQuantity},</if>
|
||||
</trim>
|
||||
where job_detail_id = #{jobDetailId}
|
||||
</update>
|
||||
|
||||
@@ -10,16 +10,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="stockinDetailId" column="stockin_detail_id" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="warehouseType" column="warehouse_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTrayMsgVo">
|
||||
select id, tray_code, stockin_detail_id, quantity from tray_msg
|
||||
select id, tray_code, stockin_detail_id, quantity,warehouse_id from tray_msg
|
||||
</sql>
|
||||
|
||||
<select id="selectTrayMsgList" parameterType="TrayMsg" resultMap="TrayMsgResult">
|
||||
select t.id, t.tray_code, t.stockin_detail_id, t.quantity,p.product_name from tray_msg t
|
||||
select t.id, t.tray_code, t.stockin_detail_id, t.quantity,p.product_name,t.warehouse_id,w.warehouse_name,w.warehouse_type from tray_msg t
|
||||
left join in_stockin_detail d on t.stockin_detail_id = d.stockin_detail_id
|
||||
left join bas_product p on d.product_id=p.product_id
|
||||
left join bas_warehouse w on t.warehouse_id=w.warehouse_id
|
||||
<where>
|
||||
<if test="trayCode != null and trayCode != ''"> and t.tray_code = #{trayCode}</if>
|
||||
<if test="stockinDetailId != null and stockinDetailId != ''"> and t.stockin_detail_id = #{stockinDetailId}</if>
|
||||
@@ -39,12 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
<if test="stockinDetailId != null">stockin_detail_id,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
<if test="stockinDetailId != null">#{stockinDetailId},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user