手持机平库入 新增,修改,删除库存记录
This commit is contained in:
@@ -83,6 +83,7 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
List<MydoJob> roadwayRunningMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||
if (CollUtil.isEmpty(roadwayRunningMydoJobs)){
|
||||
mydoJobParam1.setStatus("1");
|
||||
mydoJobParam1.setRoadwayId(String.valueOf(i));
|
||||
List<MydoJob> roadwayWaitingMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam1);
|
||||
if (CollUtil.isNotEmpty(roadwayWaitingMydoJobs)){
|
||||
MydoJob outMydoJob = roadwayWaitingMydoJobs.get(0);
|
||||
|
||||
@@ -361,6 +361,8 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
basCargoSpace.setTrayCode(mydoJob.getTrayCode());
|
||||
basCargoSpace.setCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
basCargoSpace.setTheType(mydoJob.getLineId());
|
||||
basCargoSpace.setTheTypeName(mydoJob.getWorkshopId());
|
||||
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
|
||||
//插入库存信息
|
||||
@@ -411,6 +413,8 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
basCargoSpace.setTrayCode(mydoJob.getTrayCode());
|
||||
basCargoSpace.setCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
basCargoSpace.setTheType(mydoJob.getLineId());
|
||||
basCargoSpace.setTheTypeName(mydoJob.getWorkshopId());
|
||||
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
|
||||
//插入库存信息
|
||||
@@ -445,6 +449,7 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
//修改货位状态
|
||||
basCargoSpace.setStatus("2");
|
||||
basCargoSpace.setTheType(mydoJob.getLineId());
|
||||
basCargoSpace.setTheTypeName(mydoJob.getWorkshopId());
|
||||
basCargoSpace.setTrayCode(mydoJob.getTrayCode());
|
||||
basCargoSpace.setCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
|
||||
|
||||
@@ -169,6 +169,25 @@ public class ViewHandAllotStock extends BaseEntity
|
||||
private String theColumn;
|
||||
private String theFloor;
|
||||
|
||||
private String theType;
|
||||
private String theTypeName;
|
||||
|
||||
public String getTheType() {
|
||||
return theType;
|
||||
}
|
||||
|
||||
public void setTheType(String theType) {
|
||||
this.theType = theType;
|
||||
}
|
||||
|
||||
public String getTheTypeName() {
|
||||
return theTypeName;
|
||||
}
|
||||
|
||||
public void setTheTypeName(String theTypeName) {
|
||||
this.theTypeName = theTypeName;
|
||||
}
|
||||
|
||||
public String getRoadwayId() {
|
||||
return roadwayId;
|
||||
}
|
||||
|
||||
@@ -2,22 +2,33 @@ package com.ruoyi.pda.domain;
|
||||
|
||||
public class TrayCodeMsg {
|
||||
|
||||
private String trayCode;
|
||||
private String trayCode;
|
||||
|
||||
private String warehouseId;
|
||||
private String warehouseId;
|
||||
|
||||
private String inQuantity;
|
||||
private String inQuantity;
|
||||
|
||||
private String entranceId;
|
||||
private String entranceId;
|
||||
|
||||
private String cargoSpaceId;
|
||||
private String cargoSpaceId;
|
||||
|
||||
private String exitId;
|
||||
private String exitId;
|
||||
|
||||
private String stockinDetailId;
|
||||
private String stockinDetailId;
|
||||
|
||||
private String inOut;
|
||||
private String status;
|
||||
private String inOut;
|
||||
private String status;
|
||||
|
||||
//容量
|
||||
private String workshopId;
|
||||
|
||||
public String getWorkshopId() {
|
||||
return workshopId;
|
||||
}
|
||||
|
||||
public void setWorkshopId(String workshopId) {
|
||||
this.workshopId = workshopId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
|
||||
@@ -208,6 +208,7 @@ public class PdaServiceImp implements PdaService {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMsg.getTrayCode());
|
||||
map.put("v_dept_id", SecurityUtils.getDeptId().toString());
|
||||
map.put("v_workshop_id", trayCodeMsg.getWorkshopId());
|
||||
map.put("v_warehouse_id", trayCodeMsg.getWarehouseId());
|
||||
pdaMapper.rkSure(map);
|
||||
String result = map.get("v_result").toString();
|
||||
@@ -222,12 +223,13 @@ public class PdaServiceImp implements PdaService {
|
||||
@Override
|
||||
public AjaxResult rkSurepk(TrayCodeMsg trayCodeMsg) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMsg.getTrayCode());
|
||||
map.put("v_dept_id", SecurityUtils.getDeptId().toString());
|
||||
map.put("v_warehouse_id", trayCodeMsg.getWarehouseId());
|
||||
pdaMapper.rkSure(map);
|
||||
AjaxResult ajaxResult = mydoJobService.manualCompleted(mydoJobService.selectMydoJobByTrayCode(trayCodeMsg.getTrayCode()), 1);
|
||||
map.put("v_in_stock_detail_id", trayCodeMsg.getStockinDetailId());
|
||||
map.put("v_in_quantity", trayCodeMsg.getInQuantity());
|
||||
pdaMapper.pkIn(map);
|
||||
|
||||
return ajaxResult;
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ruoyi.stock.freeze.service.impl;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.stock.freeze.domain.BasStockFreezeRecord;
|
||||
import com.ruoyi.stock.freeze.mapper.BasStockFreezeRecordMapper;
|
||||
import com.ruoyi.stock.freeze.service.IBasStockFreezeRecordService;
|
||||
@@ -45,6 +46,7 @@ public class BasStockFreezeRecordServiceImpl implements IBasStockFreezeRecordSer
|
||||
//@DataScope(warehouseAlias = "bw")
|
||||
public List<BasStockFreezeRecord> selectBasStockFreezeRecordList(BasStockFreezeRecord basStockFreezeRecord)
|
||||
{
|
||||
basStockFreezeRecord.setPrintDate(SecurityUtils.getDeptId().toString());
|
||||
return basStockFreezeRecordMapper.selectBasStockFreezeRecordList(basStockFreezeRecord);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.stock.maintain.service.impl;
|
||||
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord;
|
||||
import com.ruoyi.stock.maintain.mapper.BasStockMaintainRecordMapper;
|
||||
import com.ruoyi.stock.maintain.service.IBasStockMaintainRecordService;
|
||||
@@ -44,6 +45,7 @@ public class BasStockMaintainRecordServiceImpl implements IBasStockMaintainRecor
|
||||
//@DataScope(warehouseAlias = "bw")
|
||||
public List<BasStockMaintainRecord> selectBasStockMaintainRecordList(BasStockMaintainRecord basStockMaintainRecord)
|
||||
{
|
||||
basStockMaintainRecord.setPrintDate(SecurityUtils.getDeptId().toString());
|
||||
return basStockMaintainRecordMapper.selectBasStockMaintainRecordList(basStockMaintainRecord);
|
||||
}
|
||||
|
||||
|
||||
@@ -217,4 +217,6 @@ public class BasStock extends BaseEntity {
|
||||
private String cargoNo;
|
||||
@Excel(name = "备注",sort=31)
|
||||
private String remark;
|
||||
|
||||
private List<String> warehouseIdList;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
}
|
||||
|
||||
private void insertMaintainRecord(BasStock oldStock, BasStock basStock, String operate) {
|
||||
if (oldStock != null && (!oldStock.getQuantity().equals(basStock.getQuantity())||!oldStock.getProductId().equals(basStock.getProductId()))) {
|
||||
if ("2".equals(operate) && oldStock != null && (!oldStock.getQuantity().equals(basStock.getQuantity())||!oldStock.getProductId().equals(basStock.getProductId()))) {
|
||||
BasStockMaintainRecord basStockMaintainRecord = new BasStockMaintainRecord();
|
||||
basStockMaintainRecord.setWhGuid(IdUtil.fastSimpleUUID());
|
||||
basStockMaintainRecord.setStockId(basStock.getStockId());
|
||||
@@ -135,6 +135,45 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
basStockMaintainRecord.setProductName(basStock.getProductName());
|
||||
basStockMaintainRecord.setWarehouseId(basStock.getWarehouseId());
|
||||
basStockMaintainRecord.setMethod(operate);
|
||||
basStockMaintainRecord.setPrintDate(SecurityUtils.getDeptId().toString());
|
||||
basStockMaintainRecordService.insertBasStockMaintainRecord(basStockMaintainRecord);
|
||||
}
|
||||
if ("1".equals(operate)){
|
||||
BasStockMaintainRecord basStockMaintainRecord = new BasStockMaintainRecord();
|
||||
basStockMaintainRecord.setWhGuid(IdUtil.fastSimpleUUID());
|
||||
basStockMaintainRecord.setStockId(basStock.getStockId());
|
||||
basStockMaintainRecord.setCargoSpaceId(basStock.getCargoSpaceId());
|
||||
basStockMaintainRecord.setLotNo("");
|
||||
basStockMaintainRecord.setTrayCode(basStock.getTrayCode());
|
||||
basStockMaintainRecord.setProductGuid(basStock.getProductGuid());
|
||||
basStockMaintainRecord.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
basStockMaintainRecord.setCreateTime(new Date());
|
||||
basStockMaintainRecord.setOldQuantity("0");
|
||||
basStockMaintainRecord.setQuantity(basStock.getQuantity());
|
||||
basStockMaintainRecord.setProductId(basStock.getProductId());
|
||||
basStockMaintainRecord.setProductName(basStock.getProductName());
|
||||
basStockMaintainRecord.setWarehouseId(basStock.getWarehouseId());
|
||||
basStockMaintainRecord.setMethod(operate);
|
||||
basStockMaintainRecord.setPrintDate(SecurityUtils.getDeptId().toString());
|
||||
basStockMaintainRecordService.insertBasStockMaintainRecord(basStockMaintainRecord);
|
||||
}
|
||||
if ("3".equals(operate)){
|
||||
BasStockMaintainRecord basStockMaintainRecord = new BasStockMaintainRecord();
|
||||
basStockMaintainRecord.setWhGuid(IdUtil.fastSimpleUUID());
|
||||
basStockMaintainRecord.setStockId(basStock.getStockId());
|
||||
basStockMaintainRecord.setCargoSpaceId(basStock.getCargoSpaceId());
|
||||
basStockMaintainRecord.setLotNo("");
|
||||
basStockMaintainRecord.setTrayCode(basStock.getTrayCode());
|
||||
basStockMaintainRecord.setProductGuid(basStock.getProductGuid());
|
||||
basStockMaintainRecord.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
basStockMaintainRecord.setCreateTime(new Date());
|
||||
basStockMaintainRecord.setOldQuantity(basStock.getQuantity());
|
||||
basStockMaintainRecord.setQuantity("0");
|
||||
basStockMaintainRecord.setProductId(basStock.getProductId());
|
||||
basStockMaintainRecord.setProductName(basStock.getProductName());
|
||||
basStockMaintainRecord.setWarehouseId(basStock.getWarehouseId());
|
||||
basStockMaintainRecord.setMethod(operate);
|
||||
basStockMaintainRecord.setPrintDate(SecurityUtils.getDeptId().toString());
|
||||
basStockMaintainRecordService.insertBasStockMaintainRecord(basStockMaintainRecord);
|
||||
}
|
||||
}
|
||||
@@ -182,6 +221,7 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
basStockFreezeRecord.setOldStatus(oldBasStock.getStockStatus());
|
||||
basStockFreezeRecord.setCurrStatus(basStock.getStockStatus());
|
||||
basStockFreezeRecord.setWarehouseId(basStock.getWarehouseId());
|
||||
basStockFreezeRecord.setPrintDate(SecurityUtils.getDeptId().toString());
|
||||
if ("1".equals(basStock.getStockStatus())){
|
||||
basStockFreezeRecord.setMethod("解冻");
|
||||
}else {
|
||||
@@ -261,32 +301,37 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
@Override
|
||||
public List<BasStockSummary> selectBasStockSummary(BasStock basStock) {
|
||||
if (!"admin".equals(SecurityUtils.getUsername())){
|
||||
basStock.setModel(SecurityUtils.getDeptId().toString());
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
//如果未设置角色 ,直接返回空列表
|
||||
return new ArrayList<>();
|
||||
}
|
||||
ArrayList<String> warehouseIdList = new ArrayList<>();
|
||||
Optional<SysRole> first = roles.stream().filter(x -> "role1".equals(x.getRoleKey())).findFirst();
|
||||
if (first.isPresent()){
|
||||
//二联合普通人员
|
||||
basStock.setWarehouseId("02");
|
||||
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.setWarehouseId("01");
|
||||
basStock.setModel(SecurityUtils.getDeptId().toString());
|
||||
warehouseIdList.add("01");
|
||||
}
|
||||
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
if (first2.isPresent()){
|
||||
//二联合管理员
|
||||
basStock.setWarehouseId("02");
|
||||
warehouseIdList.add("02");
|
||||
warehouseIdList.add("03");
|
||||
}
|
||||
Optional<SysRole> first3 = roles.stream().filter(x -> "role4".equals(x.getRoleKey())).findFirst();
|
||||
if (first3.isPresent()){
|
||||
//三联合管理员
|
||||
basStock.setWarehouseId("01");
|
||||
warehouseIdList.add("01");
|
||||
}
|
||||
basStock.setWarehouseIdList(warehouseIdList);
|
||||
}
|
||||
return basStockMapper.selectBasStockSummary(basStock);
|
||||
}
|
||||
|
||||
@@ -46,13 +46,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="theColumn" column="the_column" />
|
||||
<result property="theFloor" column="the_floor" />
|
||||
<result property="roadwayId" column="roadway_id" />
|
||||
<result property="theType" column="the_type" />
|
||||
<result property="theTypeName" column="the_type_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectViewHandAllotStockVo">
|
||||
select stock_id, cargo_space_id, stock_status, product_status, lot_no, in_date, back_date, product_guid, quantity, job_id, tray_code, out_quantity, stockin_detail_id, stockin_id, in_type, in_class_id, warehouse_id, stacking_id, spare1, spare2, spare3, spare4, spare5, spare6, product_id, product_name, voltage, power, phase, net_weight, gross_weight, distribution, model, order_id, spare7, spare8, cargo_space_name,roadway_id,
|
||||
the_platoon,
|
||||
the_column,
|
||||
the_floor from view_hand_allot_stock vhat
|
||||
the_floor,
|
||||
the_type,
|
||||
the_type_name from view_hand_allot_stock vhat
|
||||
</sql>
|
||||
|
||||
<select id="selectViewHandAllotStockList" parameterType="ViewHandAllotStock" resultMap="ViewHandAllotStockResult">
|
||||
|
||||
@@ -85,8 +85,10 @@
|
||||
</select>
|
||||
|
||||
<select id="pkIn" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_pk_in(
|
||||
#{v_stockin_detail_id,mode=IN,jdbcType=VARCHAR},
|
||||
{call proc_add_in_pk(
|
||||
#{v_dept_id,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_warehouse_id,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_in_stock_detail_id,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_in_quantity,mode=IN,jdbcType=INTEGER},
|
||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
||||
@@ -115,6 +117,7 @@
|
||||
{call proc_add_in_job(
|
||||
#{v_tray_code,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_dept_id,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_workshop_id,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_warehouse_id,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
||||
|
||||
@@ -357,7 +357,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and bs.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="trayCode != null and trayCode != ''">
|
||||
and bs.tray_code like concat('%',#{trayCode},'%');
|
||||
and bs.tray_code like concat('%',#{trayCode},'%')
|
||||
</if>
|
||||
<if test="roadwayId != null ">
|
||||
and bcs.roadway_id = #{roadwayId}
|
||||
</if>
|
||||
<if test="thePlatoon != null ">
|
||||
and bcs.the_platoon = #{thePlatoon}
|
||||
</if>
|
||||
<if test="theColumn != null ">
|
||||
and bcs.the_column = #{theColumn}
|
||||
</if>
|
||||
<if test="theFloor != null ">
|
||||
and bcs.the_floor = #{theFloor}
|
||||
</if>
|
||||
<if test="spare5 != null and spare5 != ''">
|
||||
and bs.spare5 like concat('%',#{spare5},'%')
|
||||
</if>
|
||||
<if test="orderId != null and orderId != ''">
|
||||
and bs.order_id like concat('%',#{orderId},'%')
|
||||
</if>
|
||||
<if test="power != null and power != ''">
|
||||
and bs.power like concat('%',#{power},'%')
|
||||
</if>
|
||||
<if test="productName != null and productName != ''">
|
||||
and bs.product_name like concat('%',#{productName},'%')
|
||||
</if>
|
||||
<if test="warehouseIdList != null and warehouseIdList.size() > 0">
|
||||
and bs.warehouse_id in
|
||||
<foreach collection="warehouseIdList" open="(" close=")" item="it" separator=",">
|
||||
#{it}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user