1、五楼领取柜体修改
2、五楼返库完成
master
xins 7 months ago
parent dca9fbbf84
commit f1bfeb201c

@ -10,10 +10,7 @@ import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.domain.MesMaterialBom; import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesProductPlan; import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.MesProductPlanDetail; import com.hw.mes.domain.MesProductPlanDetail;
import com.hw.mes.domain.vo.MesMaterialScanVo; import com.hw.mes.domain.vo.*;
import com.hw.mes.domain.vo.MesProductPlanDetailAttachVo;
import com.hw.mes.domain.vo.MesProductPlanDetailCompleteAttachVo;
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
import com.hw.mes.service.*; import com.hw.mes.service.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -39,6 +36,9 @@ public class MesApiController extends BaseController {
@Autowired @Autowired
private IMesProductPlanDetailService productPlanDetailService; private IMesProductPlanDetailService productPlanDetailService;
@Autowired
private IMesBaseBarcodeInfoService mesBaseBarcodeInfoService;
/** /**
* BOM * BOM
*/ */
@ -176,4 +176,25 @@ public class MesApiController extends BaseController {
public AjaxResult scanMaterial2Confirm(@RequestBody MesMaterialScanVo mesMaterialScanVo) { public AjaxResult scanMaterial2Confirm(@RequestBody MesMaterialScanVo mesMaterialScanVo) {
return success(productPlanService.scanMaterial2Confirm(mesMaterialScanVo)); return success(productPlanService.scanMaterial2Confirm(mesMaterialScanVo));
} }
/**
*
*/
@Log(title = "条码信息", businessType = BusinessType.BIND)
@PostMapping(("/bindBarcode"))
public AjaxResult bindBarcode(@RequestBody MesBindBarcodeVo mesBindBarcodeVo) {
return success(mesBaseBarcodeInfoService.bindBarcode(mesBindBarcodeVo));
}
/**
* ()
*/
@Log(title = "柜体分配任务", businessType = BusinessType.ALLOCATE)
@PostMapping(("/assignTask"))
public AjaxResult assignTask(@RequestBody MesAssignTaskVo mesAssignTaskVo) {
productPlanService.assignTask(mesAssignTaskVo);
return success();
}
} }

@ -128,4 +128,15 @@ public class MesBaseBarcodeInfoController extends BaseController
{ {
return success(mesBaseBarcodeInfoService.selectMesBaseBarcodeInfoByBarcodeInfo(barcodeInfo)); return success(mesBaseBarcodeInfoService.selectMesBaseBarcodeInfoByBarcodeInfo(barcodeInfo));
} }
/**
*
*/
@InnerAuth
@GetMapping(value = "/getBarcodeByBindBarcode/{bindBarcode}")
public AjaxResult getBindBarcodeInfo(@PathVariable("bindBarcode") String bindBarcode)
{
return success(mesBaseBarcodeInfoService.selectMesBaseBarcodeInfoByBindBarcode(bindBarcode));
}
} }

@ -0,0 +1,39 @@
package com.hw.mes.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* @Description: VO
* @ClassName: MesAssignTaskVo
* @Author : xins
* @Date :2024-04-11 15:40
* @Version :1.0
*/
@Data
public class MesAssignTaskVo {
//工位序号,代表第几个工位
@NotNull(message = "工位序号必须输入")
private Integer stationNo;
//物料条码
@NotBlank(message = "物料条码必须输入")
private String materialBarcode;
// //生产计划明细ID
// @NotNull(message = "生产计划明细ID必须输入")
// private Long planDetailId;
//
//
//
// //数量
// @NotNull(message = "数量必须输入")
// private BigDecimal checkAmount;
}

@ -0,0 +1,35 @@
package com.hw.mes.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* @Description: vo
* @ClassName: MesBindBarcodeVo
* @Author : xins
* @Date :2024-04-10 17:09
* @Version :1.0
*/
@Data
public class MesBindBarcodeVo {
//生产计划code
@NotBlank(message = "生产计划Code必须输入")
private String planCode;
//生产计划明细code
@NotBlank(message = "生产计划明细Code必须输入")
private String planDetailCode;
//物料条码
@NotBlank(message = "成品条码必须输入")
private String productBarcode;
//物料条码
@NotBlank(message = "物料条码必须输入")
private String materialBarcode;
}

@ -68,4 +68,15 @@ public interface MesBaseBarcodeInfoMapper
* @return * @return
*/ */
public int deleteMesBaseBarcodeInfoByBarcodeIds(Long[] barcodeIds); public int deleteMesBaseBarcodeInfoByBarcodeIds(Long[] barcodeIds);
/**
*
*
* @param bindBarcode
* @return
*/
public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByBindBarcode(String bindBarcode);
} }

@ -1,6 +1,7 @@
package com.hw.mes.service; package com.hw.mes.service;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.vo.MesBindBarcodeVo;
import java.util.List; import java.util.List;
@ -76,4 +77,20 @@ public interface IMesBaseBarcodeInfoService
*/ */
public int printBarCode(Long[] barcodeIds); public int printBarCode(Long[] barcodeIds);
/**
* ()
*
* @param mesBindBarcodeVo
* @return
*/
public int bindBarcode(MesBindBarcodeVo mesBindBarcodeVo);
/**
*
*
* @param bindBarcode
* @return
*/
public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByBindBarcode(String bindBarcode);
} }

@ -5,6 +5,7 @@ import java.util.List;
import com.hw.mes.domain.MesBaseAttachInfo; import com.hw.mes.domain.MesBaseAttachInfo;
import com.hw.mes.domain.MesProductOrder; import com.hw.mes.domain.MesProductOrder;
import com.hw.mes.domain.MesProductPlan; import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.vo.MesAssignTaskVo;
import com.hw.mes.domain.vo.MesMaterialScanVo; import com.hw.mes.domain.vo.MesMaterialScanVo;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -121,4 +122,11 @@ public interface IMesProductPlanService
* @return * @return
*/ */
public int scanMaterial2Confirm(MesMaterialScanVo mesMaterialScanVo); public int scanMaterial2Confirm(MesMaterialScanVo mesMaterialScanVo);
/**
*
* @param mesAssignTaskVo
*/
public void assignTask(MesAssignTaskVo mesAssignTaskVo);
} }

@ -1,6 +1,7 @@
package com.hw.mes.service.impl; package com.hw.mes.service.impl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import com.hw.common.core.constant.MesConstants; import com.hw.common.core.constant.MesConstants;
@ -12,6 +13,7 @@ import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.uuid.Seq; import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.vo.MesBindBarcodeVo;
import com.hw.printer.api.RemotePrinterService; import com.hw.printer.api.RemotePrinterService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -69,6 +71,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
/** /**
* *
* barcode_type '1=,2=,3=,4=' * barcode_type '1=,2=,3=,4='
*
* @param mesBaseBarcodeInfo * @param mesBaseBarcodeInfo
* @return * @return
*/ */
@ -177,4 +180,67 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException(buffer.toString()); throw new ServiceException(buffer.toString());
} }
} }
/**
* ()
*
* @param mesBindBarcodeVo
* @return
*/
@Override
public int bindBarcode(MesBindBarcodeVo mesBindBarcodeVo) {
String productBarcode = mesBindBarcodeVo.getProductBarcode();
String materialBarcode = mesBindBarcodeVo.getMaterialBarcode();
String planCode = mesBindBarcodeVo.getPlanCode();
String planDetailCode = mesBindBarcodeVo.getPlanDetailCode();
MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper
.selectMesBaseBarcodeInfoByBarcodeInfo(productBarcode);
if (productBarcodeInfo == null) {
throw new ServiceException("成品条码有误");
}
if (productBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
throw new ServiceException("物料条码有误");
}
if (!productBarcodeInfo.getPlanCode().equals(planCode)) {
throw new ServiceException("绑定不匹配,此成品条码工单编号为:" + productBarcodeInfo.getPlanCode());
}
if (StringUtils.isNotEmpty(productBarcodeInfo.getBindBarcode())) {
throw new ServiceException("此成品条码已经绑定,无需重复绑定");
}
MesBaseBarcodeInfo materialBarcodeInfo = mesBaseBarcodeInfoMapper
.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode);
if (materialBarcodeInfo == null ||
!materialBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
throw new ServiceException("物料条码有误");
}
productBarcodeInfo.setBindBarcode(materialBarcode);
productBarcodeInfo.setBindBy(SecurityUtils.getUsername());
productBarcodeInfo.setBindTime(new Date());
productBarcodeInfo.setBindStatus(MesConstants.MES_BARCODE_BIND_STATUS_BINDING);
productBarcodeInfo.setPlanDetailCode(planDetailCode);
return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(productBarcodeInfo);
}
/**
*
*
* @param bindBarcode
* @return
*/
@Override
public MesBaseBarcodeInfo selectMesBaseBarcodeInfoByBindBarcode(String bindBarcode) {
return mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBindBarcode(bindBarcode);
}
} }

@ -5,6 +5,7 @@ import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.hw.common.core.constant.MesConstants; import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
@ -12,11 +13,13 @@ import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.*; import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesAssignTaskVo;
import com.hw.mes.domain.vo.MesMaterialScanVo; import com.hw.mes.domain.vo.MesMaterialScanVo;
import com.hw.mes.mapper.*; import com.hw.mes.mapper.*;
import com.hw.mes.service.IMesBaseAttachInfoService; import com.hw.mes.service.IMesBaseAttachInfoService;
import com.hw.mes.service.IMesProductOrderService; import com.hw.mes.service.IMesProductOrderService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
@ -57,6 +60,9 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
@Autowired @Autowired
private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper; private MesBaseBarcodeInfoMapper mesBaseBarcodeInfoMapper;
@Autowired
private StringRedisTemplate redisTemplate;
/** /**
* *
* *
@ -189,6 +195,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
/** /**
* List * List
*
* @param planId * @param planId
* @param attachType * @param attachType
* @return * @return
@ -197,7 +204,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
public List<MesBaseAttachInfo> getDispatchAttachList(Long planId, String attachType) { public List<MesBaseAttachInfo> getDispatchAttachList(Long planId, String attachType) {
MesProductPlan mesProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(planId); MesProductPlan mesProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(planId);
try { try {
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)){ if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)) {
if (StringUtils.isEmpty(mesProductPlan.getAttachId())) { if (StringUtils.isEmpty(mesProductPlan.getAttachId())) {
return new ArrayList<>(); return new ArrayList<>();
} }
@ -361,7 +368,21 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
mesMaterialCheckResultDetailMapper.insertMesMaterialCheckResultDetail(mesMaterialCheckResultDetail); mesMaterialCheckResultDetailMapper.insertMesMaterialCheckResultDetail(mesMaterialCheckResultDetail);
return 1; return 1;
}
/**
*
* @param mesAssignTaskVo
*/
@Override
public void assignTask(MesAssignTaskVo mesAssignTaskVo) {
//1、先发布信息设置超时时间如果超时需要删除此key避免重复读取
redisTemplate.convertAndSend(MesConstants.MES_ASSIGN_TASK_KEY, mesAssignTaskVo.getStationNo());
//2、订阅者读取此条信息后会给出反馈需要在程序已开始订阅此条反馈信息如果在10s内返回则成功如果10s内失败则失败
System.out.println(redisTemplate.opsForValue().get(MesConstants.MES_ASSIGN_TASK_KEY));
// redisTemplate.c
} }
} }

@ -238,4 +238,9 @@
<include refid="selectMesBaseBarcodeInfoVo"/> <include refid="selectMesBaseBarcodeInfoVo"/>
where bbi.barcode_info = #{barcodeInfo} limit 1 where bbi.barcode_info = #{barcodeInfo} limit 1
</select> </select>
<select id="selectMesBaseBarcodeInfoByBindBarcode" parameterType="String" resultMap="MesBaseBarcodeInfoResult">
<include refid="selectMesBaseBarcodeInfoVo"/>
where bbi.bind_barcode = #{bindBarcode} limit 1
</select>
</mapper> </mapper>

@ -136,8 +136,8 @@ public class WmsApiController extends BaseController {
*/ */
@Log(title = "原材料返库记录", businessType = BusinessType.APPLY) @Log(title = "原材料返库记录", businessType = BusinessType.APPLY)
@PostMapping(("/applyRawBack")) @PostMapping(("/applyRawBack"))
public AjaxResult applyRawBack(@Validated @RequestBody List<WmsRawReturn> wmsRawReturns) { public AjaxResult applyRawBack(@Validated @RequestBody WmsRawBackVo wmsRawBackVo) {
return toAjax(wmsRawReturnService.applyRawReturn(wmsRawReturns)); return toAjax(wmsRawInstockService.applyRawBack(wmsRawBackVo));
} }

@ -0,0 +1,23 @@
package com.hw.wms.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Description: VO
* @ClassName: WmsRawBackVo
* @Author : xins
* @Date :2024-04-11 14:07
* @Version :1.0
*/
@Data
public class WmsRawBackVo {
//物料条码
@NotBlank(message="物料条码必须输入")
private String materialBarcode;
@NotNull(message="返库ID不能为空")
private Long warehouseId;
}

@ -2,6 +2,7 @@ package com.hw.wms.service;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsRawInstock; import com.hw.wms.domain.WmsRawInstock;
import com.hw.wms.domain.vo.WmsRawBackVo;
import com.hw.wms.domain.vo.WmsRawInstockVo; import com.hw.wms.domain.vo.WmsRawInstockVo;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -72,4 +73,10 @@ public interface IWmsRawInstockService
*/ */
public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo); public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo);
/**
*
* @param wmsRawBackVo
*/
public int applyRawBack(WmsRawBackVo wmsRawBackVo);
} }

@ -3,6 +3,7 @@ package com.hw.wms.service.impl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.hw.common.core.constant.MesConstants; import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.SecurityConstants; import com.hw.common.core.constant.SecurityConstants;
@ -15,6 +16,7 @@ import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.wms.domain.WmsBaseLocation; import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsRawStock; import com.hw.wms.domain.WmsRawStock;
import com.hw.wms.domain.vo.WmsRawBackVo;
import com.hw.wms.domain.vo.WmsRawInstockVo; import com.hw.wms.domain.vo.WmsRawInstockVo;
import com.hw.wms.mapper.WmsBaseLocationMapper; import com.hw.wms.mapper.WmsBaseLocationMapper;
import com.hw.wms.mapper.WmsRawStockMapper; import com.hw.wms.mapper.WmsRawStockMapper;
@ -133,6 +135,9 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo) { public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo) {
String materialBarcode = wmsRawInstockVo.getMaterialBarcode(); String materialBarcode = wmsRawInstockVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料编码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) { if (baseBarcodeInfo == null) {
throw new ServiceException("物料编码有误"); throw new ServiceException("物料编码有误");
@ -164,7 +169,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
Date currentDate = new Date(); Date currentDate = new Date();
String userName = SecurityUtils.getUsername(); String userName = SecurityUtils.getUsername();
WmsRawInstock wmsRawInstock = new WmsRawInstock(); WmsRawInstock wmsRawInstock = new WmsRawInstock();
wmsRawInstock.setTaskCode(Seq.getId(Seq.rawInstockSeqType,Seq.rawInstockSeqCode)); wmsRawInstock.setTaskCode(Seq.getId(Seq.rawInstockSeqType, Seq.rawInstockSeqCode));
wmsRawInstock.setWarehouseId(baseLocation.getWarehouseId()); wmsRawInstock.setWarehouseId(baseLocation.getWarehouseId());
wmsRawInstock.setLocationCode(locationCode); wmsRawInstock.setLocationCode(locationCode);
wmsRawInstock.setPoNo(baseBarcodeInfo.getPoNo()); wmsRawInstock.setPoNo(baseBarcodeInfo.getPoNo());
@ -237,8 +242,65 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
} }
} }
public void syncToErp() {
//todo 根据质检状态是通过的同步给ERP /**
*
*
* @param wmsRawBackVo
*/
@Override
public int applyRawBack(WmsRawBackVo wmsRawBackVo) {
String materialBarcode = wmsRawBackVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料编码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料编码有误");
}
//判断此柜体是否已跟拆分门板绑定,如果未绑定不允许返库
R<MesBaseBarcodeInfo> bindBarcodeInfoR = remoteMesService.getBarcodeByBindBarcode(materialBarcode, SecurityConstants.INNER);
if (bindBarcodeInfoR == null) {
throw new ServiceException("没找到绑定信息,不能返库");
}
MesBaseBarcodeInfo bindBarcodeInfo = bindBarcodeInfoR.getData();
if (bindBarcodeInfo == null) {
throw new ServiceException("没找到绑定信息,不能返库");
}
//判断是否有返库记录,不能重复提交
WmsRawInstock queryRawInstock = new WmsRawInstock();
queryRawInstock.setMaterialBarcode(materialBarcode);//materialBarcode是索引先不需要加别的条件获取出来再过滤
List<WmsRawInstock> wmsRawInstocks = wmsRawInstockMapper.selectWmsRawInstockList(queryRawInstock);
if (wmsRawInstocks != null && !wmsRawInstocks.isEmpty()) {
List<WmsRawInstock> returnRawInstocks = wmsRawInstocks.stream().filter
(wmsRawInstock -> wmsRawInstock.getInstockType().equals(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_RETURN))
.collect(Collectors.toList());
if (returnRawInstocks != null && !returnRawInstocks.isEmpty()) {
throw new ServiceException("已经有此物料返库记录,无需重复返库");
}
}
WmsRawInstock wmsRawInstock = new WmsRawInstock();
wmsRawInstock.setTaskCode(Seq.getId(Seq.rawInstockSeqType, Seq.rawInstockSeqCode));
wmsRawInstock.setWarehouseId(wmsRawBackVo.getWarehouseId());
wmsRawInstock.setPoNo(baseBarcodeInfo.getPoNo());
wmsRawInstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO);
wmsRawInstock.setInstockType(WmsConstants.RAW_INSTOCK_INSTOCK_TYPE_RETURN);
wmsRawInstock.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawInstock.setMaterialBarcode(materialBarcode);
wmsRawInstock.setMaterialBatchCode(baseBarcodeInfo.getBatchCode());
wmsRawInstock.setPalletInfoCode(baseBarcodeInfo.getPalletInfoCode());
wmsRawInstock.setInstockAmount(BigDecimal.ONE);
wmsRawInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE);
wmsRawInstock.setApplyBy(SecurityUtils.getUsername());
wmsRawInstock.setApplyDate(new Date());
//wcs轮询后执行完成要更新库存
return wmsRawInstockMapper.insertWmsRawInstock(wmsRawInstock);
} }
} }

@ -479,6 +479,8 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
//判断仓库类型,出库记录保存对应操作类型,出库记录明细保存对应出库方式 //判断仓库类型,出库记录保存对应操作类型,出库记录明细保存对应出库方式
WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(warehouseId); WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(warehouseId);
String taskType = StringUtils.isEmpty(wmsRawOutstock.getTaskType()) ? WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING
: wmsRawOutstock.getTaskType();
String warehouseType = baseWarehouse.getWarehouseType(); String warehouseType = baseWarehouse.getWarehouseType();
String queryQualityStatus = WmsConstants.WMS_QUALITY_STATUS_PASS; String queryQualityStatus = WmsConstants.WMS_QUALITY_STATUS_PASS;
@ -524,7 +526,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawStockMapper.updateWmsRawStock(wmsRawStock); wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
//原材料出库记录(有break以下方法需要写在此处) //原材料出库记录(有break以下方法需要写在此处)
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode, WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode,taskType,
planAmount, currentDate, userName); planAmount, currentDate, userName);
toInsertedRawOutstocks.add(toInsertedRawOutstock); toInsertedRawOutstocks.add(toInsertedRawOutstock);
@ -538,7 +540,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawStockMapper.updateWmsRawStock(wmsRawStock); wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
//原材料出库记录(有break以下方法需要写在此处) //原材料出库记录(有break以下方法需要写在此处)
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode, WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode,taskType,
planAmount, currentDate, userName); planAmount, currentDate, userName);
toInsertedRawOutstocks.add(toInsertedRawOutstock); toInsertedRawOutstocks.add(toInsertedRawOutstock);
@ -553,7 +555,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawStockMapper.updateWmsRawStock(wmsRawStock); wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
//原材料出库记录(有break以下方法需要写在此处) //原材料出库记录(有break以下方法需要写在此处)
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode, WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode,taskType,
planAmount, currentDate, userName); planAmount, currentDate, userName);
toInsertedRawOutstocks.add(toInsertedRawOutstock); toInsertedRawOutstocks.add(toInsertedRawOutstock);
@ -591,7 +593,8 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
* @param userName * @param userName
* @return * @return
*/ */
private WmsRawOutstock getWmsRawOutstock(WmsRawStock wmsRawStock, WmsBaseWarehouse baseWarehouse, String planCode, String planDetailCode, Long materialId, String taskCode, private WmsRawOutstock getWmsRawOutstock(WmsRawStock wmsRawStock, WmsBaseWarehouse baseWarehouse,
String planCode, String planDetailCode, Long materialId, String taskCode,String taskType,
BigDecimal planAmount, Date currentDate, String userName) { BigDecimal planAmount, Date currentDate, String userName) {
//出库要求 0申请出库1申请审核出库2直接出库 //出库要求 0申请出库1申请审核出库2直接出库
String outRequirement = baseWarehouse.getOutRequirement(); String outRequirement = baseWarehouse.getOutRequirement();
@ -626,7 +629,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
toInsertedRawOutstock.setPlanCode(planCode); toInsertedRawOutstock.setPlanCode(planCode);
toInsertedRawOutstock.setPlanDetailCode(planDetailCode); toInsertedRawOutstock.setPlanDetailCode(planDetailCode);
toInsertedRawOutstock.setMaterialBatch(wmsRawStock.getInstockBatch()); toInsertedRawOutstock.setMaterialBatch(wmsRawStock.getInstockBatch());
toInsertedRawOutstock.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_PICKING); toInsertedRawOutstock.setTaskType(taskType);
toInsertedRawOutstock.setCreateTime(currentDate); toInsertedRawOutstock.setCreateTime(currentDate);
toInsertedRawOutstock.setCreateBy(userName); toInsertedRawOutstock.setCreateBy(userName);
@ -983,7 +986,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstock.setEndStationCode(wmsConfig.getFifthAssembleStationCode());//目标位置,五楼组装区域 todo 读配置文件获取 wmsRawOutstock.setEndStationCode(wmsConfig.getFifthAssembleStationCode());//目标位置,五楼组装区域 todo 读配置文件获取
wmsRawOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO); wmsRawOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO);
wmsRawOutstock.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_SPLIT); wmsRawOutstock.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL);
wmsRawOutstock.setApplyBy(SecurityUtils.getUsername()); wmsRawOutstock.setApplyBy(SecurityUtils.getUsername());
wmsRawOutstock.setApplyDate(new Date()); wmsRawOutstock.setApplyDate(new Date());
wmsRawOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS); wmsRawOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
@ -997,6 +1000,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
/** /**
* *
*
* @param wmsRawOutstock * @param wmsRawOutstock
* @return * @return
*/ */

@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateDate" column="update_date" /> <result property="updateDate" column="update_date" />
<result property="beginTime" column="begin_time" /> <result property="beginTime" column="begin_time" />
<result property="endTime" column="end_time" /> <result property="endTime" column="end_time" />
<result property="rawReturnId" column="raw_return_id" />
</resultMap> </resultMap>
<sql id="selectWmsRawInstockVo"> <sql id="selectWmsRawInstockVo">
@ -39,18 +40,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if> <if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if> <if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="materialBarcode != null and materialBarcode != ''"> and material_barcode = #{materialBarcode}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if> <if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if> <if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if>
<if test="operationType != null and operationType != ''"> and operation_type = #{operationType}</if> <if test="operationType != null and operationType != ''"> and operation_type = #{operationType}</if>
<if test="instockType != null and instockType != ''"> and instock_type = #{instockType}</if> <if test="instockType != null and instockType != ''"> and instock_type = #{instockType}</if>
<if test="applyReason != null and applyReason != ''"> and apply_reason = #{applyReason}</if>
<if test="auditReason != null and auditReason != ''"> and audit_reason = #{auditReason}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="executeStatus != null and executeStatus != ''"> and execute_status = #{executeStatus}</if> <if test="executeStatus != null and executeStatus != ''"> and execute_status = #{executeStatus}</if>
<if test="applyBy != null and applyBy != ''"> and apply_by = #{applyBy}</if> <if test="applyBy != null and applyBy != ''"> and apply_by = #{applyBy}</if>
<if test="applyDate != null "> and apply_date = #{applyDate}</if> <if test="applyDate != null "> and apply_date = #{applyDate}</if>
<if test="auditBy != null and auditBy != ''"> and audit_by = #{auditBy}</if>
<if test="auditDate != null "> and audit_date = #{auditDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if> <if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="beginTime != null "> and begin_time = #{beginTime}</if> <if test="beginTime != null "> and begin_time = #{beginTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if> <if test="endTime != null "> and end_time = #{endTime}</if>

@ -25,7 +25,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" @click="getMaterials"></el-button> <el-button type="primary" @click="getMaterials"></el-button>
<el-button v-if="($route.query && $route.query.id) === '2'" type="info" @click="handleBindBarcode"></el-button> <el-button v-if="($route.query && $route.query.id) === '2'" type="info" @click="handleBindBarcode"></el-button>
<el-button v-if="($route.query && $route.query.id) === '2'" type="warning" @click="handleRawBack"></el-button> <el-button v-if="($route.query && $route.query.id) === '2'" type="warning" @click="handleRawBack"></el-button>
<el-button :disabled="form.planDetailStatus === '已完成'" type="primary" @click="finish"></el-button> <el-button :disabled="form.planDetailStatus === '已完成'" type="primary" @click="finish"></el-button>
@ -195,39 +195,25 @@
</el-row> </el-row>
</div> </div>
<el-dialog :visible.sync="getMaterialsModel" title="板材领料">
<el-form :model="form">
<el-form-item label="库位码" label-width="120px">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="物料码" label-width="120px">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="getMaterialsModel = false"> </el-button>
<el-button type="primary" @click="getMaterialsModel = false"> </el-button>
</div>
</el-dialog>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
title="领" title="领柜体"
width="40%"> width="40%">
<el-form ref="form" :model="form1" label-width="80px"> <el-form ref="form" :model="form1" label-width="100px">
<el-form-item label="工单编号"> <el-form-item label="工单编号">
<el-input v-model="form1.planCode" disabled></el-input> <el-input v-model="form1.planCode" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="明细编号"> <el-form-item label="明细编号">
<el-input v-model="form1.planDetailCode" disabled></el-input> <el-input v-model="form1.planDetailCode" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="领仓库"> <el-form-item label="领柜体仓库">
<el-select v-model="form1.warehouseId" placeholder="请选择领仓库" @change="warehouseChange"> <el-select v-model="form1.warehouseId" placeholder="请选择领柜体仓库" @change="warehouseChange">
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName" <el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
:value="item.warehouseId"></el-option> :value="item.warehouseId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="领原因"> <el-form-item label="领柜体原因">
<el-input v-model="form1.applyReason" type="textarea"></el-input> <el-input v-model="form1.applyReason" type="textarea"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -264,13 +250,14 @@
width="120" width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-input
v-model="scope.row.planAmount" v-model="scope.row.planAmount"
:min="0" :min="1"
disabled="true"
controls-position="right" controls-position="right"
style="width: 100%" style="width: 100%"
> >
</el-input-number> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -287,7 +274,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="text-align: center;margin-top: 12px"> <div style="text-align: center;margin-top: 12px">
<el-button type="primary" @click="receiveMaterial"></el-button> <el-button type="primary" @click="receiveMaterial"></el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -326,6 +313,12 @@
title="柜体返库" title="柜体返库"
width="40%"> width="40%">
<el-form ref="rawBackForm" :model="rawBackForm" :rules="rawBackRules" label-width="80px"> <el-form ref="rawBackForm" :model="rawBackForm" :rules="rawBackRules" label-width="80px">
<el-form-item label="返库仓库" prop="warehouseId">
<el-select v-model="rawBackForm.warehouseId" placeholder="请选择返库仓库">
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
:value="item.warehouseId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode"> <el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="rawBackForm.materialBarcode"></el-input> <el-input v-model="rawBackForm.materialBarcode"></el-input>
</el-form-item> </el-form-item>
@ -466,10 +459,14 @@ export default {
rawBackVisible: false, rawBackVisible: false,
rawBackForm: { rawBackForm: {
materialBarcode: null, materialBarcode: null,
warehouseId: null
}, },
rawBackRules: { rawBackRules: {
materialBarcode: [ materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" } { required: true, message: "物料条码不能为空", trigger: "blur" }
],
warehouseId: [
{ required: true, message: "仓库不能为空", trigger: "change" }
] ]
} }
} }
@ -699,7 +696,7 @@ export default {
this.nowStation = val this.nowStation = val
}, },
completeStation() { completeStation() {
console.log(this.nowStation) alert(JSON.stringify(this.nowStation))
this.assignModel = false this.assignModel = false
}, },
getInfo(e) { getInfo(e) {
@ -1058,7 +1055,7 @@ export default {
}) })
}, },
// //
getMaterials() { getMaterials() {
this.searchMaterialValue = '' this.searchMaterialValue = ''
this.dialogVisible = true this.dialogVisible = true
@ -1072,7 +1069,7 @@ export default {
wmsRawOutstockDetailList: [] wmsRawOutstockDetailList: []
} }
// //
getWarehouses({"warehouseFloor": 5}).then(e => { getWarehouses({"warehouseFloor": 5,"returnFlag":1}).then(e => {
this.warehouseList = e.data this.warehouseList = e.data
this.form1.warehouseId = e.data[0]?.warehouseId this.form1.warehouseId = e.data[0]?.warehouseId
this.searchMaterial(""); this.searchMaterial("");
@ -1082,6 +1079,10 @@ export default {
// //
searchMaterial(val) { searchMaterial(val) {
if(this.form1.warehouseId==null || this.form1.warehouseId == undefined
|| this.form1.warehouseId==""){
return;
}
getStockTotal({ getStockTotal({
warehouseId: this.form1.warehouseId, warehouseId: this.form1.warehouseId,
materialName: val materialName: val
@ -1093,7 +1094,7 @@ export default {
materialName: r.materialName, materialName: r.materialName,
availableAmount: r.totalAmount - r.occupyAmount - r.frozenAmount, availableAmount: r.totalAmount - r.occupyAmount - r.frozenAmount,
unavailableAmount: r.occupyAmount + r.frozenAmount, unavailableAmount: r.occupyAmount + r.frozenAmount,
planAmount: r.planAmount planAmount: 1
} }
}) })
}) })
@ -1107,11 +1108,12 @@ export default {
}, },
receiveMaterial() { receiveMaterial() {
this.form1.taskType = '2';//
applyRawOutstock(this.form1).then(e => { applyRawOutstock(this.form1).then(e => {
if (e.code === 200) { if (e.code === 200) {
this.dialogVisible = false this.dialogVisible = false
this.$message({ this.$message({
message: '领料完成', message: '申请领柜体成功',
type: 'success' type: 'success'
}); });
} }
@ -1167,13 +1169,24 @@ export default {
resetRawBack() { resetRawBack() {
this.rawBackForm = { this.rawBackForm = {
materialBarcode: null, materialBarcode: null,
warehouseId:null
}; };
this.resetForm("rawBackForm"); this.resetForm("rawBackForm");
}, },
/** 成品入库按钮操作 */ /** 柜体返库按钮操作 */
handleRawBack(scope) { handleRawBack(scope) {
this.resetRawBack(); this.resetRawBack();
//
if(this.warehouseList==null || this.warehouseList.length==0){
getWarehouses({"warehouseFloor": 5,"returnFlag":1}).then(e => {
this.warehouseList = e.data
this.rawBackForm.warehouseId = this.warehouseList[0]?.warehouseId
})
}else{
this.rawBackForm.warehouseId = this.warehouseList[0]?.warehouseId
}
this.rawBackVisible = true; this.rawBackVisible = true;
}, },

Loading…
Cancel
Save