现场问题修改..................
This commit is contained in:
14
ruoyi-admin/src/main/java/com/ruoyi/MyStartupRunner.java
Normal file
14
ruoyi-admin/src/main/java/com/ruoyi/MyStartupRunner.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi;
|
||||
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MyStartupRunner implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
// 这里编写项目启动后要执行的方法逻辑
|
||||
System.out.println("项目启动成功后自动执行此方法");
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,21 @@
|
||||
package com.ruoyi.bas.warehouse.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
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.model.LoginUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 仓库管理Service业务层处理
|
||||
@@ -47,6 +53,24 @@ public class BasWarehouseServiceImpl implements IBasWarehouseService
|
||||
//@DataScope
|
||||
public List<BasWarehouse> selectBasWarehouseList(BasWarehouse basWarehouse)
|
||||
{
|
||||
if (!"admin".equals(SecurityUtils.getUsername())){
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
List<SysRole> roles = loginUser.getUser().getRoles();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
//如果未设置角色 ,直接返回空列表
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Optional<SysRole> role1 = roles.stream().filter(x -> "role1".equals(x.getRoleKey())).findFirst();
|
||||
Optional<SysRole> role2 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
|
||||
Optional<SysRole> role3 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
Optional<SysRole> role4 = roles.stream().filter(x -> "role4".equals(x.getRoleKey())).findFirst();
|
||||
if (role1.isPresent()||role3.isPresent()){
|
||||
basWarehouse.setWarehouseId("02");
|
||||
}
|
||||
if (role2.isPresent()||role4.isPresent()){
|
||||
basWarehouse.setWarehouseId("01");
|
||||
}
|
||||
}
|
||||
return basWarehouseMapper.selectBasWarehouseList(basWarehouse);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class OutMydoJobController extends BaseController {
|
||||
return mydoJobService.OuthandInvalidation(jobIds);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('job:outmydoJob:pointOut')")
|
||||
@PreAuthorize("@ss.hasAnyPermi('job:outmydoJob:pointOut,job:outmydoJob:pointOut1,job:outmydoJob:pointOut2')")
|
||||
@Log(title = "指定货位出库", businessType = BusinessType.INSERT)
|
||||
@RequestMapping("/pointOut")
|
||||
public AjaxResult pointOut(@RequestParam("stockIds")String[] stockIds,@RequestParam("exitId")String exitId,@RequestParam("type")String type)
|
||||
|
||||
@@ -261,11 +261,13 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
|
||||
String inOrOutDId = mydoJobDetail.getInOrOutDId();
|
||||
InStockinDetail inStockinDetail = inStockinDetailService.selectInStockinDetailByStockinDetailId(inOrOutDId);
|
||||
BigDecimal stockInNum = Convert.toBigDecimal(inStockinDetail.getScanNum());
|
||||
BigDecimal jobInNum = Convert.toBigDecimal(mydoJobDetail.getInQuantity());
|
||||
BigDecimal subtract = stockInNum.subtract(jobInNum);
|
||||
inStockinDetail.setScanNum(Convert.toStr(subtract));
|
||||
inStockinDetailService.updateInStockinDetail(inStockinDetail);
|
||||
if(inStockinDetail != null){
|
||||
BigDecimal stockInNum = Convert.toBigDecimal(inStockinDetail.getScanNum());
|
||||
BigDecimal jobInNum = Convert.toBigDecimal(mydoJobDetail.getInQuantity());
|
||||
BigDecimal subtract = stockInNum.subtract(jobInNum);
|
||||
inStockinDetail.setScanNum(Convert.toStr(subtract));
|
||||
inStockinDetailService.updateInStockinDetail(inStockinDetail);
|
||||
}
|
||||
}
|
||||
//修改货位状态
|
||||
if (StrUtil.isNotEmpty(mydoJob.getCargoSpaceId())) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.ruoyi.out.handAllotStock.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@@ -173,6 +175,15 @@ public class ViewHandAllotStock extends BaseEntity
|
||||
private String theTypeName;
|
||||
|
||||
private String deptName;
|
||||
private List<String> trayCodeList;
|
||||
|
||||
public List<String> getTrayCodeList() {
|
||||
return trayCodeList;
|
||||
}
|
||||
|
||||
public void setTrayCodeList(List<String> trayCodeList) {
|
||||
this.trayCodeList = trayCodeList;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
|
||||
@@ -68,8 +68,12 @@ public class ViewInJobFlow extends BaseEntity
|
||||
/** 托盘条码 */
|
||||
@Excel(name = "托盘条码")
|
||||
private String trayCode;
|
||||
@Excel(name = "货位")
|
||||
@Excel(name = "部门")
|
||||
private String deptName;
|
||||
// @Excel(name = "货位")
|
||||
private String cargoSpaceId;
|
||||
@Excel(name = "货位名称")
|
||||
private String cargoSpaceName;
|
||||
|
||||
/** 物料编码 */
|
||||
@Excel(name = "物料编码")
|
||||
@@ -179,6 +183,23 @@ public class ViewInJobFlow extends BaseEntity
|
||||
private String dateStart;
|
||||
private String dateEnd;
|
||||
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getCargoSpaceName() {
|
||||
return cargoSpaceName;
|
||||
}
|
||||
|
||||
public void setCargoSpaceName(String cargoSpaceName) {
|
||||
this.cargoSpaceName = cargoSpaceName;
|
||||
}
|
||||
|
||||
public String getCargoSpaceId() {
|
||||
return cargoSpaceId;
|
||||
}
|
||||
|
||||
@@ -148,6 +148,7 @@ public class ViewStockDetail extends BaseEntity
|
||||
private String outside;
|
||||
private String spare4;
|
||||
private String model;
|
||||
private String deptName;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ public class BasStockController extends BaseController
|
||||
@PutMapping("/updateStockDept")
|
||||
public AjaxResult updateBasStockDept(@RequestBody BasStock basStock)
|
||||
{
|
||||
return toAjax(basStockService.updateBasStockDept(basStock));
|
||||
return basStockService.updateBasStockDept(basStock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -217,6 +217,8 @@ public class BasStock extends BaseEntity {
|
||||
private String cargoNo;
|
||||
@Excel(name = "备注",sort=31)
|
||||
private String remark;
|
||||
@Excel(name = "部门",sort=32)
|
||||
private String deptName;
|
||||
|
||||
private List<String> warehouseIdList;
|
||||
}
|
||||
|
||||
@@ -21,4 +21,5 @@ public class BasStockSummary {
|
||||
private String theType;
|
||||
private String theTypeName;
|
||||
private String issDouble;
|
||||
private String deptName;
|
||||
}
|
||||
|
||||
@@ -85,5 +85,5 @@ public interface IBasStockService
|
||||
|
||||
List<BasStockSummary> selectBasStockSummary(BasStock basStock);
|
||||
|
||||
int updateBasStockDept(BasStock basStock);
|
||||
AjaxResult updateBasStockDept(BasStock basStock);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.in.stockin.domain.InStockin;
|
||||
import com.ruoyi.in.stockin.service.IInStockinService;
|
||||
@@ -404,14 +405,14 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
Optional<SysRole> first = roles.stream().filter(x -> "role1".equals(x.getRoleKey())).findFirst();
|
||||
if (first.isPresent()){
|
||||
//二联合普通人员
|
||||
basStock.setModel(SecurityUtils.getDeptId().toString());
|
||||
//basStock.setModel(SecurityUtils.getDeptId().toString());
|
||||
warehouseIdList.add("02");
|
||||
warehouseIdList.add("03");
|
||||
}
|
||||
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
|
||||
if (first1.isPresent()){
|
||||
//三联合普通人员
|
||||
basStock.setModel(SecurityUtils.getDeptId().toString());
|
||||
//basStock.setModel(SecurityUtils.getDeptId().toString());
|
||||
warehouseIdList.add("01");
|
||||
}
|
||||
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
@@ -431,8 +432,42 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBasStockDept(BasStock basStock) {
|
||||
return basStockMapper.updateBasStockDept(basStock);
|
||||
public AjaxResult updateBasStockDept(BasStock basStock) {
|
||||
if (!"admin".equals(SecurityUtils.getUsername())) {
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
List<SysRole> roles = user.getRoles();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
return AjaxResult.warn("未设置角色");
|
||||
}
|
||||
Optional<SysRole> role3 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
Optional<SysRole> role4 = roles.stream().filter(x -> "role4".equals(x.getRoleKey())).findFirst();
|
||||
if (role3.isPresent() || role4.isPresent()) {
|
||||
//仓库管理员
|
||||
return AjaxResult.success(basStockMapper.updateBasStockDept(basStock));
|
||||
}
|
||||
Optional<SysRole> role1 = roles.stream().filter(x -> "role1".equals(x.getRoleKey())).findFirst();
|
||||
Optional<SysRole> role2 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
|
||||
if (role1.isPresent() || role2.isPresent()) {
|
||||
//判断是不是自己名下托盘
|
||||
BasStock basStockParam = new BasStock();
|
||||
basStockParam.setWarehouseId(basStock.getWarehouseId());
|
||||
basStockParam.setTrayCode(basStock.getTrayCode());
|
||||
List<BasStockSummary> basStockSummaries = basStockMapper.selectBasStockSummary(basStockParam);
|
||||
if (CollUtil.isEmpty(basStockSummaries)) {
|
||||
return AjaxResult.warn("非本部门托盘,无法操作");
|
||||
} else {
|
||||
BasStockSummary basStockSummary = basStockSummaries.get(0);
|
||||
String model = basStockSummary.getModel();
|
||||
if (!model.equals(SecurityUtils.getDeptId().toString())) {
|
||||
return AjaxResult.warn("非本部门托盘,无法操作");
|
||||
}
|
||||
return AjaxResult.success(basStockMapper.updateBasStockDept(basStock));
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("当前角色暂无操作功能");
|
||||
} else {
|
||||
return AjaxResult.success(basStockMapper.updateBasStockDept(basStock));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ server:
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
com.ruoyi: debug
|
||||
com.ruoyi: error
|
||||
org.springframework: warn
|
||||
|
||||
# 用户配置
|
||||
|
||||
@@ -105,6 +105,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="thePlatoon != null and thePlatoon != ''"> and the_platoon = #{thePlatoon}</if>
|
||||
<if test="theColumn != null and theColumn != ''"> and the_column = #{theColumn}</if>
|
||||
<if test="theFloor != null and theFloor != ''"> and the_floor = #{theFloor}</if>
|
||||
<if test="trayCodeList != null and trayCodeList.size() > 0">
|
||||
AND tray_code IN
|
||||
<foreach item="trayCode" collection="trayCodeList" open="(" separator="," close=")">
|
||||
#{trayCode}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
||||
${params.warehouseDataScope}
|
||||
</if>
|
||||
|
||||
@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="inOrOut" column="in_or_out" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="cargoSpaceId" column="cargo_space_id" />
|
||||
<result property="cargoSpaceName" column="cargo_space_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="finishTime" column="finish_time" />
|
||||
@@ -47,10 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="quality" column="quality" />
|
||||
<result property="managementNo" column="managementNo" />
|
||||
<result property="departmentId" column="department_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectViewInJobFlowVo">
|
||||
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
|
||||
select job_detail_id, job_id, task_no, status, in_or_out, tray_code,cargo_space_id,cargo_space_name, 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,dept_name from view_in_job_flow vijf
|
||||
</sql>
|
||||
|
||||
<select id="selectViewInJobFlowList" parameterType="ViewInJobFlow" resultMap="ViewInJobFlowResult">
|
||||
@@ -95,8 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="quality != null and quality != ''"> and quality = #{quality}</if>
|
||||
<if test="managementNo != null and managementNo != ''"> and managementNo = #{managementNo}</if>
|
||||
<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 >= #{dateStart}</if>
|
||||
<if test="dateEnd != null and dateEnd != ''"> and create_time <= #{dateEnd}</if>
|
||||
<if test="dateStart != null and dateStart != ''"> and finish_time >= #{dateStart}</if>
|
||||
<if test="dateEnd != null and dateEnd != ''"> and finish_time <= #{dateEnd}</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
||||
${params.warehouseDataScope}
|
||||
|
||||
@@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="productType" column="productType" />
|
||||
<result property="distribution" column="distribution" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectViewStockDetailVo">
|
||||
@@ -76,12 +77,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
bs.out_quantity,
|
||||
bs.distribution, --来源
|
||||
bs.spare4, --来源
|
||||
bs.model, --来源
|
||||
sd.dept_name, --来源
|
||||
bs.spare1 --用途
|
||||
from bas_stock bs
|
||||
left join bas_product bp on bs.product_id = bp.product_id
|
||||
left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id
|
||||
left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id
|
||||
left join bas_supplier bs2 on bs.phase = bs2.supplier_no
|
||||
left join sys_dept sd on bs.model = sd.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectViewStockDetailList" parameterType="ViewStockDetail" resultMap="ViewStockDetailResult">
|
||||
@@ -89,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<where>
|
||||
<if test="stockId != null and stockId != ''"> and bs.stock_id = #{stockId}</if>
|
||||
<if test="model != null and model != ''"> and (bs.model = #{model} or bs.model is null or bs.model = '')</if>
|
||||
<if test="deptName != null and deptName != ''"> and sd.dept_name =#{deptName}</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and bs.cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="stockStatus != null and stockStatus != ''"> and bs.stock_status = #{stockStatus}</if>
|
||||
<if test="lotNo != null and lotNo != ''"> and bs.lot_no = #{lotNo}</if>
|
||||
|
||||
@@ -351,10 +351,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id and bs.tray_code = bcs.tray_code
|
||||
left join bas_warehouse bw on bcs.warehouse_id = bw.warehouse_id
|
||||
left join bas_product bp on bs.product_id = bp.product_id
|
||||
left join sys_dept sd on bs.model = sd.dept_id
|
||||
WHERE bcs.status = '2'
|
||||
<if test="model != null and model != ''">
|
||||
and (bs.model = #{model} or bs.model is null or bs.model = '')
|
||||
</if>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
and sd.dept_name = #{deptName}
|
||||
</if>
|
||||
<if test="warehouseId != null and warehouseId != ''">
|
||||
and bs.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user