车间MES完善:
1、四楼激光切割工序支持无图纸报工
2、四楼装配工序增加成品码和配对码打印
3、五楼拆分工序支持原材料条码打印(根据4楼的成品条码进行生成打印)
4、重新生成条码判断库存信息
master
xs 8 months ago
parent 34a4cfd363
commit 1a04f7d426

@ -176,6 +176,8 @@ public class MesBaseBarcodeInfo extends BaseEntity
private String locationCode;
private String condition;
public String getLocationCode() {
return locationCode;
}
@ -559,6 +561,14 @@ public class MesBaseBarcodeInfo extends BaseEntity
this.confirmFlag = confirmFlag;
}
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -4,10 +4,14 @@ import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.ServiceNameConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import com.hw.wms.api.factory.RemoteWmsFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
@ -31,6 +35,13 @@ public interface RemoteWmsService {
@PostMapping("/api/synchronizeRawMaterialDeliveryInformationToERP")
public R<AjaxResult> synchronizeRawMaterialDeliveryInformationToERP(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
@PostMapping("/rawstock/isExistRawStock")
public R<Boolean> isExistRawStock(@Validated @RequestBody WmsRawStockVo queryRawStockVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
@PostMapping("/productstock/isExistProductStock")
public R<Boolean> isExistProductStock(@Validated @RequestBody WmsProductStockVo queryProductStockVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
* ERP
* @param days

@ -0,0 +1,12 @@
package com.hw.wms.api.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class WmsProductStockVo {
@NotBlank(message="物料条码不能为空")
private String productBatch;
}

@ -0,0 +1,12 @@
package com.hw.wms.api.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class WmsRawStockVo {
@NotBlank(message="物料条码不能为空")
private String instockBatch;
}

@ -3,6 +3,8 @@ package com.hw.wms.api.factory;
import com.hw.common.core.domain.R;
import com.hw.common.core.web.domain.AjaxResult;
import com.hw.wms.api.RemoteWmsService;
import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@ -41,6 +43,17 @@ public class RemoteWmsFallbackFactory implements FallbackFactory<RemoteWmsServic
public R<AjaxResult> synchronizeProductOutstockInformationToERP(Integer days, String source) {
return R.fail("定时同步成品出库给ERP失败:" + throwable.getMessage());
}
@Override
public R<Boolean> isExistRawStock(WmsRawStockVo queryRawStockVo, String source) {
return R.fail("是否存在原材料库存信息获取失败:" + throwable.getMessage());
}
@Override
public R<Boolean> isExistProductStock(WmsProductStockVo queryProductStockVo, String source) {
return R.fail("是否存在成品库存信息获取失败:" + throwable.getMessage());
}
};
}
}

@ -25,46 +25,65 @@ public class MesConstants {
*/
public static final String MES_BARCODE_TYPE_PRODUCT = "3";
/**
* :
* :
*/
public static final String MES_BARCODE_TYPE_BACKPLATE = "4";
public static final String MES_BARCODE_TYPE_BIND = "4";
/**
* :
* :使使
*/
public static final String MES_BARCODE_TYPE_DOOR = "5";
public static final String MES_BARCODE_TYPE_SPLIT = "5";
/**
* :
*/
public static final String MES_BARCODE_TYPE_RAW_REGULAR = "9";
/** 条码批次标识0-否 */
/**
* 0-
*/
public static final String NOT_IS_BATCH = "0";
/** 条码批次标识1-是 */
/**
* 1-
*/
public static final String IS_BATCH = "1";
/** 工单状态0-待发布 */
/**
* 0-
*/
public static final String UN_PUBLISH = "0";
/** 工单状态1已发布 */
/**
* 1
*/
public static final String PUBLISHED = "1";
/** 工单状态2-已完成 */
/**
* 2-
*/
public static final String FINISHED = "2";
/** 工单状态3-已开始 */
/**
* 3-
*/
public static final String BEGIN = "3";
/** 工单状态4-暂停 */
/**
* 4-
*/
public static final String PAUSE = "4";
/** 工单状态8-已撤回 */
/**
* 8-
*/
public static final String RECALL = "8";
/** 工单状态9-已删除 */
/**
* 9-
*/
public static final String DELETE = "9";
public static final Map<String, String> ORDER_STATUS_PROMPT_MAP = new HashMap<>();
static {
ORDER_STATUS_PROMPT_MAP.put(UN_PUBLISH, "待发布");
ORDER_STATUS_PROMPT_MAP.put(PUBLISHED, "已发布");
@ -77,7 +96,6 @@ public class MesConstants {
}
/*生产计划明细状态*/
public static final String MES_PRODUCT_PLAN_DETAIL_STATUS_TO_START = "1";//未开始
public static final String MES_PRODUCT_PLAN_DETAIL_STATUS_STARTED = "2";//已开始
@ -90,59 +108,85 @@ public class MesConstants {
public static final String MES_PRODUCT_PLAN_STATUS_STARTED = "2";//已开始
public static final String MES_PRODUCT_PLAN_STATUS_FINISH = "3";//已完成
/** 附件类别1-加工图纸 */
/**
* 1-
*/
public static final String MES_ATTACH_TYPE_DRAWING = "1";
/** 附件类别2-SOP */
/**
* 2-SOP
*/
public static final String MES_ATTACH_TYPE_SOP = "2";
/** 附件类别9-其他文件 */
/**
* 9-
*/
public static final String MES_ATTACH_TYPE_OTHER = "9";
/**校验类型(0不校验,1人工校验,2自动校验)*/
/**
* (0,1,2)
*/
public static final String MES_MATERIAL_BOM_CHECK_TYPE_MANUAL = "1";//人工校验
/**条码信息绑定状态*/
public static final String MES_BARCODE_BIND_STATUS_BINDING= "1";//绑定
public static final String MES_BARCODE_BIND_STATUS_UNBINDING= "0";//解绑
/**
*
*/
public static final String MES_BARCODE_BIND_STATUS_BINDING = "1";//绑定
public static final String MES_BARCODE_BIND_STATUS_UNBINDING = "0";//解绑
public static final String MES_ASSIGN_TASK_KEY = "fifth_floor_assign_task";//五楼分配柜体任务到具体工位的key
public static final String MES_ASSIGN_TASK_RESULT_KEY = "fifth_floor_assign_task_result";//五楼分配柜体任务到具体工位返库key
/**生产派工开始类型*/
/**
*
*/
public static final String MES_START_TYPE_FIFTH_FLOOR_ASSEMBLE = "1";//五楼装配工位
/**采购订单销售订单绑定安全库存标识*/
/**
*
*/
public static final String MES_ORDER_BIND_SAFE_FLAG_YES = "1";//是
public static final String MES_ORDER_BIND_SAFE_FLAG_NO = "0";//否
/**生产工单销售类型*/
/**
*
*/
public static final String MES_PRODUCT_ORDER_SALE = "1";//外部销售
public static final String MES_PRODUCT_ORDER_INTERNAL = "2";//对内生产
/**物料信息常备物料标识,是否需要采购订单明细绑定销售订单*/
/**
*
*/
public static final String MES_MATERIAL_ALWAYS_FLAG_YES = "1";//是
public static final String MES_MATERIAL_ALWAYS_FLAG_NO = "0";//否
public static final String MES_MATERIAL_ALWAYS_FLAG_NO = "0";//否
/**物料条码打印标识*/
/**
*
*/
public static final String MES_BARCODE_PRINT_FLAG_YES = "1";//是
public static final String MES_BARCODE_PRINT_FLAG_NO = "0";//否
/**工序类型*/
/**
*
*/
public static final String MES_PROCESS_TYPE_FIFTH_SPLIT = "1";//五楼拆分工序
/**单独生成成品条码标识*/
/**
*
*/
public static final String MES_BARCODE_SINGLE_FLAG_YES = "1";//是
public static final String MES_BARCODE_SINGLE_FLAG_INTERNAL = "2";//对内
/**
*
*/
public static final String MES_FINAL_PROCESS_FLAG_YES = "1";//是
}

@ -127,6 +127,16 @@ public class Seq {
public static final String mesCompBarcodeCode = "CP";
// 配对条码内容记录标识
public static final String mesBindBarcodeSeqType = "BIND_BAR_CODE";
// 配对条码内容序列数
private static AtomicInteger mesBindBarcodeSeq = new AtomicInteger(1);
// 配对条码内容标识
public static final String mesBindBarcodeCode = "BD";
// 设备报修工单编号记录标识
public static final String dmsBillsFaultInstanceSeqType = "DMSBILLSFAULTINSTANCE";
@ -364,6 +374,8 @@ public class Seq {
atomicInt = rawInstockSeq;
}else if(wmsInventoryCheckSeqType.equals(type)) {
atomicInt = wmsInventoryCheckSeq;
}else if (mesBindBarcodeSeqType.equals(type)) {
atomicInt = mesBindBarcodeSeq;
}
return getId(atomicInt, 3, code);
}

@ -8,6 +8,7 @@ import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesProductPlan;
@ -155,7 +156,7 @@ public class MesApiController extends BaseController {
/**
*
*
* planId
*/
@Log(title = "生产计划明细", businessType = BusinessType.START)
@ -240,4 +241,79 @@ public class MesApiController extends BaseController {
}
/**
* plancodeplandetailcode
*/
@Log(title = "原材料条码", businessType = BusinessType.UPDATE)
@PostMapping(("/updateBarcodePlan"))
public AjaxResult updateBarcodePlan(@RequestBody @Validated MesBaseBarcodeInfo mesBaseBarcodeInfo) {
return success(mesBaseBarcodeInfoService.updateMesBaseBarcodePlan(mesBaseBarcodeInfo));
}
@GetMapping("/listProductBarcode")
public TableDataInfo listProductBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo)
{
startPage();
List<MesBaseBarcodeInfo> list = mesBaseBarcodeInfoService.selectMesBaseBarcodeInfoList(mesBaseBarcodeInfo);
return getDataTable(list);
}
/**
*
*/
@Log(title = "条码信息", businessType = BusinessType.INSERT)
@PostMapping(value="/addProductBarcode")
public AjaxResult addProductBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo)
{
return toAjax(mesBaseBarcodeInfoService.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo));
}
/**
*
*/
@GetMapping(value = "/selectProductBarcodeInfoByBarcodeInfo/{barcodeInfo}")
public AjaxResult selectProductBarcodeInfoByBarcodeInfo(@PathVariable("barcodeInfo") String barcodeInfo)
{
return success(mesBaseBarcodeInfoService.selectProductBarcodeInfoByBarcodeInfo(barcodeInfo));
}
/**
*
*/
@Log(title = "条码信息", businessType = BusinessType.INSERT)
@PostMapping(value="/addInternalBarcode")
public AjaxResult addInternalBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo)
{
return toAjax(mesBaseBarcodeInfoService.insertInternalMesBaseBarcode(mesBaseBarcodeInfo));
}
/**
* ()
*/
@Log(title = "条码信息", businessType = BusinessType.REGENERATE)
@PostMapping(value="/regenerateBarcode")
public AjaxResult regenerateBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo)
{
return toAjax(mesBaseBarcodeInfoService.regenerateBarcode(mesBaseBarcodeInfo));
}
/**
*
* @param barcodeIds
* @return
*/
@GetMapping(value = "/printProductBarcodes/{barcodeIds}")
public AjaxResult printProductBarcodes(@PathVariable Long[] barcodeIds)
{
return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds, MesConstants.MES_BARCODE_TYPE_PRODUCT));
}
}

@ -43,6 +43,8 @@ public class MesBaseRouteProcess extends BaseEntity {
private Long productionTime;
private String finalProcessFlag;
public void setRouteProcessId(Long routeProcessId) {
this.routeProcessId = routeProcessId;
@ -100,6 +102,14 @@ public class MesBaseRouteProcess extends BaseEntity {
this.productionTime = productionTime;
}
public String getFinalProcessFlag() {
return finalProcessFlag;
}
public void setFinalProcessFlag(String finalProcessFlag) {
this.finalProcessFlag = finalProcessFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -80,6 +80,9 @@ public class MesProductPlan extends BaseEntity
@Excel(name = "上一工序ID")
private Long lastProcessId;
/**末工序标识(1是0否)*/
private String finalProcessFlag;
/** 上工序名称 */
@Excel(name = "上工序名称")
private String lastProcessName;
@ -339,6 +342,15 @@ public class MesProductPlan extends BaseEntity
{
return lastProcessId;
}
public String getFinalProcessFlag() {
return finalProcessFlag;
}
public void setFinalProcessFlag(String finalProcessFlag) {
this.finalProcessFlag = finalProcessFlag;
}
public void setStationId(Long stationId)
{
this.stationId = stationId;

@ -76,6 +76,15 @@ public interface IMesBaseBarcodeInfoService
*/
public int updateMesBaseBarcodeInfo(MesBaseBarcodeInfo mesBaseBarcodeInfo);
/**
*
*
* @param mesBaseBarcodeInfo barcodeinfo
* @return
*/
public int updateMesBaseBarcodePlan(MesBaseBarcodeInfo mesBaseBarcodeInfo);
/**
*
*

@ -26,6 +26,9 @@ import java.text.DecimalFormat;
import com.hw.printer.api.RemotePrinterService;
import com.hw.printer.api.domain.vo.PrintContentVo;
import com.hw.printer.api.domain.vo.PrinterVo;
import com.hw.wms.api.RemoteWmsService;
import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.service.IMesBaseBarcodeInfoService;
@ -69,6 +72,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Autowired
private MesProductPlanDetailMapper mesProductPlanDetailMapper;
@Resource
private RemoteWmsService remoteWmsService;
/**
*
*
@ -101,7 +107,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
@Override
public List<MesBaseBarcodeInfo> selectMesBaseBarcodeInfoList(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
mesBaseBarcodeInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getMaterialSpec())
? mesBaseBarcodeInfo.getMaterialSpec().replaceAll("\\s+", ""):"");
? mesBaseBarcodeInfo.getMaterialSpec().replaceAll("\\s+", "") : "");
return mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(mesBaseBarcodeInfo);
}
@ -124,7 +130,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
else if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) {
generateProductBarcode(mesBaseBarcodeInfo);
} else {//生成背板条码或者门板条码
generateBackOrDoorBarcode(mesBaseBarcodeInfo);
generateBindBarcode(mesBaseBarcodeInfo);
}
return 1;
@ -275,7 +281,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String saleOrderCode;
Long materialId;
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
if (mesBaseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_YES)) {
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) &&
mesBaseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_YES)) {
String rawMaterialBarcode = mesBaseBarcodeInfo.getProductBarcode();
MesBaseBarcodeInfo rawBarcode = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(rawMaterialBarcode);
if (rawBarcode == null) {
@ -379,19 +386,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
*
* @param mesBaseBarcodeInfo
*/
public void generateBackOrDoorBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
public void generateBindBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
String planCode = mesBaseBarcodeInfo.getPlanCode();
String planDetailCode = mesBaseBarcodeInfo.getPlanDetailCode();
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
queryBarcodeInfo.setPlanDetailCode(planDetailCode);
queryBarcodeInfo.setBarcodeType(mesBaseBarcodeInfo.getBarcodeType());
List<MesBaseBarcodeInfo> mesBaseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBarcodeInfo);
if (mesBaseBarcodeInfos != null && !mesBaseBarcodeInfos.isEmpty()) {
throw new ServiceException("此生产明细已经生成条码,不能重复生成");
}
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailCode(planDetailCode);
if (mesProductPlanDetail == null) {
throw new ServiceException("此生产明细不存在");
@ -408,32 +406,39 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException("绑定的柜体码不存在");
}
int barcodeAmount = mesBaseBarcodeInfo.getBarcodeAmount().intValue();
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
//将之前的原材料码设置计划编码和明细编码,在入半成品库时是按照此码入库,后续生成成品码也需要根据此码生成
bindBarcodeInfo.setPlanCode(mesBaseBarcodeInfo.getPlanCode());
bindBarcodeInfo.setPlanDetailCode(mesBaseBarcodeInfo.getPlanDetailCode());
bindBarcodeInfo.setUpdateBy(userName);
bindBarcodeInfo.setUpdateTime(currentDate);
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
mesBaseBarcodeInfo.setBatchCode(barcode);// 成品的批次代码 == 条码内容
mesBaseBarcodeInfo.setBarcodeInfo(barcode);
mesBaseBarcodeInfo.setAmount(new BigDecimal(1));
for (int i = 0; i < barcodeAmount; i++) {
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
mesBaseBarcodeInfo.setBatchCode(barcode);// 成品的批次代码 == 条码内容
mesBaseBarcodeInfo.setBarcodeInfo(barcode);
mesBaseBarcodeInfo.setAmount(new BigDecimal(1));
mesBaseBarcodeInfo.setBatchFlag(MesConstants.NOT_IS_BATCH);
mesBaseBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
mesBaseBarcodeInfo.setBatchFlag(MesConstants.NOT_IS_BATCH);
mesBaseBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
mesBaseBarcodeInfo.setMaterialId(productPlan.getMaterialId());
mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_NO);
mesBaseBarcodeInfo.setSaleOrderId(productPlan.getSaleOrderId());
mesBaseBarcodeInfo.setSaleorderCode(productPlan.getSaleorderCode());
mesBaseBarcodeInfo.setMaterialId(bindBarcodeInfo.getMaterialId());
mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_NO);
mesBaseBarcodeInfo.setSaleOrderId(productPlan.getSaleOrderId());
mesBaseBarcodeInfo.setSaleorderCode(productPlan.getSaleorderCode());
mesBaseBarcodeInfo.setCreateTime(currentDate);
mesBaseBarcodeInfo.setCreateBy(userName);
mesBaseBarcodeInfo.setCreateTime(currentDate);
mesBaseBarcodeInfo.setCreateBy(userName);
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(bindBarcodeInfo);
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
//如果绑定的码是原材料条码(拆分码),将之前的原材料码设置计划编码和明细编码,在入半成品库时是按照此码入库,后续生成成品码也需要根据此码生成
if (StringUtils.isEmpty(bindBarcodeInfo.getPlanCode())) {
bindBarcodeInfo.setPlanCode(mesBaseBarcodeInfo.getPlanCode());
bindBarcodeInfo.setPlanDetailCode(mesBaseBarcodeInfo.getPlanDetailCode());
bindBarcodeInfo.setUpdateBy(userName);
bindBarcodeInfo.setUpdateTime(currentDate);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(bindBarcodeInfo);
}
}
@ -479,6 +484,25 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
/**
*
*
* @param mesBaseBarcodeInfo barcodeinfo
* @return
*/
@Override
public int updateMesBaseBarcodePlan(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
MesBaseBarcodeInfo dbBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(mesBaseBarcodeInfo.getBarcodeInfo());
if (StringUtils.isEmpty(dbBaseBarcodeInfo.getPlanCode())) {
mesBaseBarcodeInfo.setBarcodeId(dbBaseBarcodeInfo.getBarcodeId());
mesBaseBarcodeInfo.setUpdateBy(SecurityUtils.getUsername());
mesBaseBarcodeInfo.setUpdateTime(DateUtils.getNowDate());
return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
return 1;
}
/**
*
*
@ -606,7 +630,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
PrintContentVo printQty = new PrintContentVo();
printQty.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QTY);
DecimalFormat df = new DecimalFormat("#.##");
String formattedNumber = df.format(mesBaseBarcodeInfo.getAmount()==null?BigDecimal.ZERO:mesBaseBarcodeInfo.getAmount());
String formattedNumber = df.format(mesBaseBarcodeInfo.getAmount() == null ? BigDecimal.ZERO : mesBaseBarcodeInfo.getAmount());
printQty.setValue(formattedNumber);
printQty.setType(PrintContentVo.TYPE_TEXT);
@ -781,10 +805,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
public int insertInternalMesBaseBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
String productBarcode = mesBaseBarcodeInfo.getProductBarcode();
//先判断此成品条码是否有绑定过原材料条码
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
queryBarcodeInfo.setProductBarcode(productBarcode);
int bindProductBarcodeCount = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoCount(queryBarcodeInfo);
if (bindProductBarcodeCount > 0) {
MesBaseBarcodeInfo bindProductBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByProductBarcode(productBarcode);
if (bindProductBarcodeInfo != null) {
throw new ServiceException("此成品条码已经打印过原材料条码,无需重复打印");
}
@ -817,13 +839,21 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
productBarcodeInfo.setUpdateBy(userName);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(productBarcodeInfo);
mesBaseBarcodeInfo.setBarcodeInfo(barcodeInfo);
mesBaseBarcodeInfo.setBatchCode(barcodeInfo);
mesBaseBarcodeInfo.setBatchFlag(MesConstants.NOT_IS_BATCH);
mesBaseBarcodeInfo.setAmount(BigDecimal.ONE);
mesBaseBarcodeInfo.setBarcodeType(MesConstants.MES_BARCODE_TYPE_RAW);
mesBaseBarcodeInfo.setPalletInfoCode(basePalletInfo.getPalletInfoCode());
mesBaseBarcodeInfo.setSingleFlag(MesConstants.MES_BARCODE_SINGLE_FLAG_INTERNAL);
if (productBarcodeInfo.getSaleOrderId() != null && !productBarcodeInfo.getSaleOrderId().equals(0L)) {
mesBaseBarcodeInfo.setSaleOrderId(productBarcodeInfo.getSaleOrderId());
mesBaseBarcodeInfo.setSaleorderCode(productBarcodeInfo.getSaleorderCode());
mesBaseBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO);
} else {
mesBaseBarcodeInfo.setSaleOrderId(0L);
mesBaseBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
}
mesBaseBarcodeInfo.setCreateTime(currentDate);
mesBaseBarcodeInfo.setCreateBy(userName);
@ -843,10 +873,28 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String barcodeType = mesBaseBarcodeInfo.getBarcodeType();
String oldBarcode = mesBaseBarcodeInfo.getBarcodeInfo();
String newBarcode = "";
if (barcodeType.equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
newBarcode = Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode);
} else {
newBarcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
switch (barcodeType) {
case MesConstants.MES_BARCODE_TYPE_RAW:
WmsRawStockVo queryRawStockVo = new WmsRawStockVo();
queryRawStockVo.setInstockBatch(oldBarcode);
R<Boolean> isExistRawStock = remoteWmsService.isExistRawStock(queryRawStockVo, SecurityConstants.INNER);
if (isExistRawStock.getData()) {
throw new ServiceException("此物料条码存在库存信息,不能重新生成");
}
newBarcode = Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode);
break;
case MesConstants.MES_BARCODE_TYPE_PRODUCT:
WmsProductStockVo queryProductStockVo = new WmsProductStockVo();
queryProductStockVo.setProductBatch(oldBarcode);
R<Boolean> isExistProductStock = remoteWmsService.isExistProductStock(queryProductStockVo, SecurityConstants.INNER);
if (isExistProductStock.getData()) {
throw new ServiceException("此物料条码存在库存信息,不能重新生成");
}
newBarcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
break;
case MesConstants.MES_BARCODE_TYPE_BIND:
newBarcode = Seq.getId(Seq.mesBindBarcodeSeqType, Seq.mesBindBarcodeCode);
break;
}
String userName = SecurityUtils.getUsername();
@ -858,6 +906,15 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseAbandonBarcode.setUpdateTime(currentDate);
mesBaseAbandonBarcodeMapper.insertMesBaseAbandonBarcode(mesBaseAbandonBarcode);
MesBasePalletInfo basePalletInfo = mesBasePalletInfoMapper.selectMesBasePalletInfoByBarcode(oldBarcode);
if (basePalletInfo != null) {
basePalletInfo.setMaterialBarcode(newBarcode);
basePalletInfo.setUpdateBy(userName);
basePalletInfo.setUpdateTime(currentDate);
mesBasePalletInfoMapper.updateMesBasePalletInfo(basePalletInfo);
}
mesBaseBarcodeInfo.setBarcodeInfo(newBarcode);
mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_NO);
mesBaseBarcodeInfo.setPrintNumber(0L);
@ -869,6 +926,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
/**
*
*
* @param mesBaseBarcodeInfo
* @return
*/
@ -879,6 +937,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
/**
*
*
* @param mesBaseBarcodeInfo
* @return
*/

@ -166,7 +166,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
/**
*
* 4
*
* @param mesProductPlanDetail
* @return
@ -176,15 +176,15 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
public int startMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail) {
MesProductPlanDetail dbProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(mesProductPlanDetail.getPlanDetailId());
if (dbProductPlanDetail.getPlanDetailStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH)) {
throw new ServiceException("此生成计划明细已完成");
throw new ServiceException("此生明细已完成");
}
MesProductPlan dbProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(dbProductPlanDetail.getPlanId());
String planStatus = dbProductPlan.getPlanStatus();
if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_TO_DISPATCH)) {
throw new ServiceException("此生产计划未派工,不能开始");
throw new ServiceException("未派工,不能开始");
} else if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH)) {
throw new ServiceException("此生产计划已结束");
throw new ServiceException("此生产派工已结束");
}
@ -234,7 +234,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
MesProductPlan dbProductPlan = mesProductPlanMapper.selectMesProductPlanByPlanId(planId);
String planStatus = dbProductPlan.getPlanStatus();
if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_TO_DISPATCH)) {
throw new ServiceException("此生产明细未派工,不能结束");
throw new ServiceException("未派工,不能结束");
} else if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH)) {
throw new ServiceException("此生产派工已结束");
}
@ -280,11 +280,36 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
BigDecimal complementAmount = dbProductPlan.getCompleteAmount() == null ? BigDecimal.ZERO : dbProductPlan.getCompleteAmount();
BigDecimal newComplementAmount = complementAmount.add(BigDecimal.ONE);
if (newComplementAmount.compareTo(planAmount) >= 0) {
if (newComplementAmount.compareTo(planAmount) > 0) {
throw new ServiceException("完成数量超出派工数量");
}
if (newComplementAmount.compareTo(planAmount) == 0) {
dbProductPlan.setPlanStatus(MesConstants.MES_PRODUCT_PLAN_STATUS_FINISH);
dbProductPlan.setRealEndTime(currentDate);
}
/**如果是末工序更新生产任务生产工单状态、结束时间和完成数量根据finalprocessFlag更新生产任务 */
if (dbProductPlan.getFinalProcessFlag() != null && dbProductPlan.getFinalProcessFlag().equals(MesConstants.MES_FINAL_PROCESS_FLAG_YES)) {
MesProductOrder mesProductOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(dbProductPlan.getProductOrderId());
BigDecimal dispatchAmount = mesProductOrder.getDispatchAmount();
BigDecimal orderCompleteAmount = mesProductOrder.getCompleteAmount();
BigDecimal newOrderCompleteAmount = orderCompleteAmount.add(BigDecimal.ONE);
//todo更新生产任务生产工单状态、结束时间和完成数量根据finalprocessFlag更新生产任务
if (newComplementAmount.compareTo(dispatchAmount) > 0) {
throw new ServiceException("完成数量超出派工数量");
}
mesProductOrder.setCompleteAmount(newOrderCompleteAmount);
if (newOrderCompleteAmount.compareTo(mesProductOrder.getPlanAmount()) == 0) {
mesProductOrder.setOrderStatus(MesConstants.FINISHED);
mesProductOrder.setRealEndTime(currentDate);
}
mesProductOrder.setUpdateTime(currentDate);
mesProductOrder.setUpdateBy(userName);
mesProductOrderMapper.updateMesProductOrder(mesProductOrder);
}
dbProductPlan.setCompleteAmount(newComplementAmount);
@ -325,7 +350,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
/**
*
* 445
*
* @param mesProductPlanDetail
* @param startType (01:)
@ -374,8 +399,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
throw new ServiceException("条码有误");
}
if (!mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BACKPLATE) &&
!mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_DOOR)) {
if (!mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_BIND)) {
throw new ServiceException("请扫描背板或门板条码开始");
}
@ -383,7 +407,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
throw new ServiceException("此条码有误,未绑定任何柜体");
}
if(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getTransferredPlanDetailCode())){
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getTransferredPlanDetailCode())) {
throw new ServiceException("此条码已经扫描使用过,不能再次使用");
}
@ -437,8 +461,6 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer
mesProductPlanDetailMapper.insertMesProductPlanDetail(mesProductPlanDetail);
return mesProductPlanDetail;
}

@ -253,6 +253,10 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
mesProductPlan.setCreateBy(SecurityUtils.getUsername());
mesProductPlan.setCreateTime(DateUtils.getNowDate());
mesProductPlan.setPlanCode(Seq.getId(Seq.planCodeSeqType, Seq.planCodeCode));
if(mesProductPlan.getSaleOrderId()==null){
mesProductPlan.setSaleOrderId(0L);
}
mesProductPlanMapper.insertMesProductPlan(mesProductPlan);
}
}
@ -392,9 +396,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan) {
Long processId = SecurityUtils.getProcessId();
Long userId = SecurityUtils.getUserId();
if (!SecurityUtils.isAdmin(userId)) {
mesProductPlan.setUserId(userId);
}
mesProductPlan.setUserId(userId);
mesProductPlan.setProcessId(processId);
// String ipAddress = IpUtils.getIpAddr();
// MesBaseStationInfo mesBaseStationInfo = mesBase

@ -18,6 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="processName" column="process_name" />
<result property="processType" column="process_type" />
<result property="productionTime" column="production_time" />
<result property="finalProcessFlag" column="final_process_flag" />
</resultMap>
<sql id="selectMesBaseRouteProcessVo">
@ -99,8 +101,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectMesBaseRouteProcessJoinList" parameterType="MesBaseRouteProcess" resultMap="MesBaseRouteProcessResult">
select mbrp.route_process_id, mbrp.route_id, mbrp.process_id, mbrp.process_order,
mbpi.process_name,mbpi.process_type,mbpi.production_time
from mes_base_route_process mbrp left join mes_base_process_info mbpi on mbrp.process_id=mbpi.process_id
mbpi.process_name,mbpi.process_type,mbpi.production_time,mbpi.final_process_flag
from mes_base_route_process mbrp left join
mes_base_process_info mbpi on mbrp.process_id=mbpi.process_id
<where>
<if test="routeId != null "> and mbrp.route_id = #{routeId}</if>

@ -18,6 +18,7 @@
<result property="processId" column="process_id"/>
<result property="processOrder" column="process_order"/>
<result property="lastProcessId" column="last_process_id"/>
<result property="finalProcessFlag" column="final_process_flag"/>
<result property="lastProcessName" column="lastProcessName"/>
<result property="stationId" column="station_id"/>
<result property="userId" column="user_id"/>
@ -104,6 +105,7 @@
po.sale_order_id,
po.saleorder_code,
mpp.plan_status,
mpp.final_process_flag,
mpp.is_flag,
mpp.remark,
mpp.create_by,
@ -156,6 +158,7 @@
a.process_id,
a.process_order,
a.last_process_id,
a.final_process_flag,
a.station_id,
a.user_id,
a.production_time,
@ -208,6 +211,7 @@
<if test="processId != null">process_id,</if>
<if test="processOrder != null">process_order,</if>
<if test="lastProcessId != null">last_process_id,</if>
<if test="finalProcessFlag != null">final_process_flag,</if>
<if test="stationId != null">station_id,</if>
<if test="userId != null">user_id,</if>
<if test="productionTime != null">production_time,</if>
@ -239,6 +243,7 @@
<if test="processId != null">#{processId},</if>
<if test="processOrder != null">#{processOrder},</if>
<if test="lastProcessId != null">#{lastProcessId},</if>
<if test="finalProcessFlag != null">#{finalProcessFlag},</if>
<if test="stationId != null">#{stationId},</if>
<if test="userId != null">#{userId},</if>
<if test="productionTime != null">#{productionTime},</if>
@ -335,7 +340,7 @@
<select id="selectMesProductPlanJoinList" parameterType="MesProductPlan" resultMap="MesProductPlanResult">
select mpp.plan_id, mpp.product_order_id, mpp.sale_order_id,mpp.saleorder_code,mpp.plan_code, mpp.dispatch_code, mpp.material_id,
mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id,mpp.user_id,
mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id,mpp.final_process_flag,mpp.user_id,
mpp.station_id, mpp.dispatch_amount, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time,
mpp.real_begin_time, mpp.real_end_time,
mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mbmi.material_code,mbmi.material_name,mbmi.material_spec
@ -361,6 +366,7 @@
a.process_id,
a.process_order,
a.last_process_id,
a.final_process_flag,
a.station_id,
a.user_id,
a.sale_order_id,
@ -470,6 +476,7 @@
a.process_id,
a.process_order,
a.last_process_id,
a.final_process_flag,
a.station_id,
a.user_id,
a.production_time,

@ -100,6 +100,10 @@
<version>3.6.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.hw</groupId>
<artifactId>hw-api-wms</artifactId>
</dependency>
</dependencies>

@ -3,6 +3,11 @@ package com.hw.wms.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import com.hw.wms.domain.WmsRawStock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -24,14 +29,13 @@ import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
*
*
* @author xs
* @date 2023-12-20
*/
@RestController
@RequestMapping("/productstock")
public class WmsProductStockController extends BaseController
{
public class WmsProductStockController extends BaseController {
@Autowired
private IWmsProductStockService wmsProductStockService;
@ -40,8 +44,7 @@ public class WmsProductStockController extends BaseController
*/
// @RequiresPermissions("wms:productstock:list")
@GetMapping("/list")
public TableDataInfo list(WmsProductStock wmsProductStock)
{
public TableDataInfo list(WmsProductStock wmsProductStock) {
startPage();
List<WmsProductStock> list = wmsProductStockService.selectWmsProductStockList(wmsProductStock);
return getDataTable(list);
@ -53,8 +56,7 @@ public class WmsProductStockController extends BaseController
@RequiresPermissions("wms:productstock:export")
@Log(title = "成品库存", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsProductStock wmsProductStock)
{
public void export(HttpServletResponse response, WmsProductStock wmsProductStock) {
List<WmsProductStock> list = wmsProductStockService.selectWmsProductStockList(wmsProductStock);
ExcelUtil<WmsProductStock> util = new ExcelUtil<WmsProductStock>(WmsProductStock.class);
util.exportExcel(response, list, "成品库存数据");
@ -65,8 +67,7 @@ public class WmsProductStockController extends BaseController
*/
@RequiresPermissions("wms:productstock:query")
@GetMapping(value = "/{productStockId}")
public AjaxResult getInfo(@PathVariable("productStockId") Long productStockId)
{
public AjaxResult getInfo(@PathVariable("productStockId") Long productStockId) {
return success(wmsProductStockService.selectWmsProductStockByProductStockId(productStockId));
}
@ -76,8 +77,7 @@ public class WmsProductStockController extends BaseController
@RequiresPermissions("wms:productstock:add")
@Log(title = "成品库存", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsProductStock wmsProductStock)
{
public AjaxResult add(@RequestBody WmsProductStock wmsProductStock) {
return toAjax(wmsProductStockService.insertWmsProductStock(wmsProductStock));
}
@ -87,8 +87,7 @@ public class WmsProductStockController extends BaseController
@RequiresPermissions("wms:productstock:edit")
@Log(title = "成品库存", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsProductStock wmsProductStock)
{
public AjaxResult edit(@RequestBody WmsProductStock wmsProductStock) {
return toAjax(wmsProductStockService.updateWmsProductStock(wmsProductStock));
}
@ -97,9 +96,19 @@ public class WmsProductStockController extends BaseController
*/
@RequiresPermissions("wms:productstock:remove")
@Log(title = "成品库存", businessType = BusinessType.DELETE)
@DeleteMapping("/{productStockIds}")
public AjaxResult remove(@PathVariable Long[] productStockIds)
{
@DeleteMapping("/{productStockIds}")
public AjaxResult remove(@PathVariable Long[] productStockIds) {
return toAjax(wmsProductStockService.deleteWmsProductStockByProductStockIds(productStockIds));
}
/**
*
*/
@InnerAuth
@PostMapping(value = "/isExistProductStock")
public AjaxResult isExistProductStock(@RequestBody WmsProductStockVo queryProductStockVo) {
boolean exists = wmsProductStockService.getWmsProductStockByProductBatch(queryProductStockVo.getProductBatch()) != null;
return success(exists);
}
}

@ -3,6 +3,9 @@ package com.hw.wms.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -102,4 +105,18 @@ public class WmsRawStockController extends BaseController
{
return toAjax(wmsRawStockService.deleteWmsRawStockByRawStockIds(rawStockIds));
}
/**
*
*/
@InnerAuth
@PostMapping(value = "/isExistRawStock")
public AjaxResult isExistRawStock(@RequestBody WmsRawStockVo queryRawStockVo)
{
boolean exists = wmsRawStockService.getWmsRawStockByInstockBatch(queryRawStockVo.getInstockBatch()) != null;
return success(exists);
}
}

@ -74,4 +74,11 @@ public interface IWmsProductStockService
* @return
*/
public List<WmsProductStock> selectWmsProductStocksBySaleorder(WmsProductStock wmsProductStock);
/**
*
* @param productBatch
* @return
*/
public WmsProductStock getWmsProductStockByProductBatch(String productBatch);
}

@ -58,4 +58,12 @@ public interface IWmsRawStockService
* @return
*/
public int deleteWmsRawStockByRawStockId(Long rawStockId);
/**
*
* @param instockBatch
* @return
*/
public WmsRawStock getWmsRawStockByInstockBatch(String instockBatch);
}

@ -7,6 +7,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import com.hw.common.core.exception.ServiceException;
import com.hw.wms.controller.WmsProductStockController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.wms.mapper.WmsProductStockMapper;
@ -117,4 +118,14 @@ public class WmsProductStockServiceImpl implements IWmsProductStockService {
return list;
}
/**
*
* @param productBatch
* @return
*/
public WmsProductStock getWmsProductStockByProductBatch(String productBatch){
return wmsProductStockMapper.selectProductStockByBatch(productBatch);
}
}

@ -91,4 +91,15 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService
{
return wmsRawStockMapper.deleteWmsRawStockByRawStockId(rawStockId);
}
/**
*
* @param instockBatch
* @return
*/
@Override
public WmsRawStock getWmsRawStockByInstockBatch(String instockBatch){
return wmsRawStockMapper.selectRawStockByBarcode(instockBatch);
}
}

@ -0,0 +1,57 @@
import request from '@/utils/request'
// 查询成品条码信息列表
export function listProductBarcode(query) {
return request({
url: '/mes/api/listProductBarcode',
method: 'get',
params: query
})
}
// 新增成品条码信息
export function addProductBarcode(data) {
return request({
url: '/mes/api/addProductBarcode',
method: 'post',
data: data
})
}
// 打印成品条码
export function printProductBarcodes(barcodeIds) {
return request({
url: '/mes/api/printProductBarcodes/' + barcodeIds,
method: 'get'
})
}
// 重新生成成品条码信息,之前的条码作废
export function regenerateBarcode(data) {
return request({
url: '/mes/api/regenerateBarcode',
method: 'post',
data: data
})
}
// 查询物料信息详细
export function selectProductBarcodeInfoByBarcodeInfo(barcodeInfo) {
return request({
url: '/mes/api/selectProductBarcodeInfoByBarcodeInfo/' + barcodeInfo,
method: 'get'
})
}
// 内部生产新增原材料条码信息
export function addInternalBarcode(data) {
return request({
url: '/mes/api/addInternalBarcode',
method: 'post',
data: data
})
}

@ -61,3 +61,5 @@ export function getWarehouses(query) {
params: query
})
}

@ -268,6 +268,15 @@ export function getNewestOutstockCabinet(query) {
})
}
// 更新原材料条码plancode和plandetailcode
export function updateBarcodePlan(query) {
return request({
url: '/mes/api/updateBarcodePlan',
method: 'post',
data: query
})
}
/**
* 完成领料拿料

@ -14,7 +14,7 @@ router.beforeEach((to, from, next) => {
NProgress.start()
if (getToken()) {
let floorData = JSON.parse(sessionStorage.getItem('FLOORDATA') || '{}')
if(floorData?.route && to.fullPath !== floorData?.route){
if(floorData?.route && to.fullPath !== floorData?.route && to.path.includes('/board')){
next({ path: floorData?.route })
}
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)

@ -0,0 +1,792 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAddProductBarcode"
v-if="addProductBarcodeBtnVisible"
>新增成品码
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleInternalAdd"
v-if="addInternalBtnVisible"
>新增对内原材料条码
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-printer"
size="mini"
@click="handlePrintBarcodes"
:disabled="batchPrintBtnDisabled"
>打印
</el-button>
</el-col>
<!--right-toolbar :columns="columns" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar-->
</el-row>
<el-table v-loading="loading" :data="barcodeList" @selection-change="handleSelectionChange">
<el-table-column align="center" type="selection" width="55"/>
<el-table-column v-if="columns[0].visible" align="center" label="主键标识" prop="barcodeId"/>
<el-table-column v-if="columns[4].visible" align="center" label="条码类型" prop="barcodeType">
<template slot-scope="scope">
<dict-tag :options="dict.type.barcode_type" :value="scope.row.barcodeType"/>
</template>
</el-table-column>
<el-table-column v-if="columns[17].visible" align="center" label="派工单号" prop="planCode" width="110"/>
<el-table-column v-if="columns[17].visible" align="center" label="明细编号" prop="planDetailCode" width="110"/>
<el-table-column v-if="columns[20].visible" align="center" label="销售订单编号" prop="saleorderCode" width="110"/>
<el-table-column v-if="columns[13].visible" align="center" label="采购订单号" prop="poNo" width="100"/>
<el-table-column v-if="columns[29].visible" align="center" label="条码类型" prop="barcodeType" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.barcode_type" :value="scope.row.barcodeType"/>
</template>
</el-table-column>
<el-table-column v-if="columns[5].visible" align="center" label="条码内容" prop="barcodeInfo" width="100"/>
<el-table-column v-if="columns[8].visible" align="center" label="物料编码" prop="materialCode" width="100"/>
<el-table-column v-if="columns[30].visible" align="center" label="物料名称" prop="materialName" width="100"/>
<el-table-column v-if="columns[31].visible" align="center" label="物料规格" prop="materialSpec" width="100"/>
<el-table-column label="打印标识" align="center" prop="printFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_print_flag" :value="scope.row.printFlag"/>
</template>
</el-table-column>
<el-table-column v-if="columns[14].visible" align="center" label="生产日期" prop="productionDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns[16].visible" align="center" label="最晚出库日期" prop="lastOutstockDate"
width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastOutstockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns[18].visible" align="center" label="计划明细编号" prop="planDetailCode"/>
<el-table-column v-if="columns[19].visible" align="center" label="销售订单ID" prop="saleOrderId"/>
<el-table-column v-if="columns[21].visible" align="center" label="项目号" prop="projectNo"/>
<el-table-column v-if="columns[23].visible" align="center" label="备注" prop="remark"/>
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
<template slot-scope="scope">
<el-button
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAddBindBarcode(scope.row.barcodeInfo)"
v-if="scope.row.barcodeType!==BARCODE_TYPE.BIND_BARCODE && addBindBarcodeBtnVisible"
>配对码
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-refresh"
@click="regenerateBarcode(scope.row)"
v-if="scope.row.printFlag ==='1'"
>重新生成
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-printer"
@click="handlePrintBarcodes(scope.row)"
v-if="scope.row.printFlag ==='0'"
>打印
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改条码信息对话框 -->
<el-dialog :title="title" :visible.sync="addProductBarcodeOpen" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="派工单号" prop="planCode">
<el-input v-model="form.planCode" :disabled="true">
</el-input>
</el-form-item>
<el-form-item label="生产明细编号" prop="planDetailCode">
<el-input v-model="form.planDetailCode" :disabled="true">
</el-input>
</el-form-item>
<el-form-item label="绑定柜体码" prop="bindBarcode"
v-if="this.form.barcodeType === this.BARCODE_TYPE.BIND_BARCODE">
<el-input v-model="form.bindBarcode" :disabled="true">
</el-input>
</el-form-item>
<el-form-item label="配对码数量" prop="barcodeAmount"
v-if="this.form.barcodeType === this.BARCODE_TYPE.BIND_BARCODE">
<el-input-number v-model="form.barcodeAmount" :min="1" :max="1000">
</el-input-number>
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker v-model="form.productionDate"
clearable
placeholder="请选择生产日期"
type="date"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="最晚出库日期" prop="lastOutstockDate">
<el-date-picker v-model="form.lastOutstockDate"
clearable
placeholder="请选择最晚出库日期"
type="date"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入内容" type="textarea"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancelProductBarcode"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改对内生产的原材料条码信息对话框 -->
<el-dialog :title="internalTitle" :visible.sync="internalOpen" width="500px" append-to-body>
<el-form ref="internalForm" :model="internalForm" :rules="internalRules" label-width="100px">
<el-form-item label="成品条码" prop="productBarcode">
<el-input v-model="internalForm.productBarcode" placeholder="请输入或扫描成品条码" class="input-with-select"
@blur="selectProductBarcodeInfoByBarcodeInfo">
<el-button slot="append" icon="el-icon-full-screen"></el-button>
</el-input>
</el-form-item>
<el-form-item label="物料ID" prop="materialId" v-if="false">
<el-input v-model="internalForm.materialId" placeholder="请输入物料ID"/>
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="internalForm.materialCode" disabled/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="internalForm.materialName" :disabled="true"/>
</el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input v-model="internalForm.materialSpec" :disabled="true"/>
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker clearable
v-model="internalForm.productionDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择生产日期">
</el-date-picker>
</el-form-item>
<el-form-item label="最晚出库日期" prop="lastOutstockDate">
<el-date-picker clearable
v-model="internalForm.lastOutstockDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最晚出库日期">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="internalForm.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitInternalForm"> </el-button>
<el-button @click="cancelInternal"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listProductBarcode,
addProductBarcode,
printProductBarcodes,
selectProductBarcodeInfoByBarcodeInfo,
addInternalBarcode, regenerateBarcode
} from "@/api/board/barcode";
export default {
name: "Barcode",
dicts: ['bind_status', 'active_flag', 'barcode_type', 'mes_print_flag'],
data() {
return {
//
loading: true,
//
ids: [],
barcodeInfos: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
barcodeList: [],
//
title: "",
//
open: false,
addBtnTitle: '新增条码',
addProductBarcodeTitle: '新增成品条码',
addProductBarcodeForm: {},
addProductBarcodeRules: {
productBarcode: [
{required: true, message: "原材料条码不能为空", trigger: "blur"}
],
},
addProductBarcodeOpen: false,
internalTitle: "添加对内原材料条码信息",
internalOpen: false,
//
internalForm: {},
//
internalRules: {
poNo: [
{required: true, message: "采购订单号不能为空", trigger: "change"}
],
batchFlag: [
{required: true, message: "批次标识不能为空", trigger: "change"}
],
amount: [
{required: true, message: "批次数量不能为空", trigger: "change"}
],
barcodeType: [
{required: true, message: "条码类型不能为空", trigger: "change"}
],
materialId: [
{required: true, message: "物料ID不能为空", trigger: "blur"}
],
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
printTime: null,
printPerson: null,
batchFlag: null,
barcodeType: '3',
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: null,
machineName: null,
printNumber: null,
poNo: null,
productionDate: null,
acceptedDate: null,
lastOutstockDate: null,
planCode: null,
planDetailCode: null,
saleOrderId: null,
saleorderCode: null,
projectNo: null,
serialNumber: null,
bindStatus: null,
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null,
singleFlag: null,
},
//
form: {},
//
rules: {
orderCode: [
{required: true, message: "工单编号不能为空", trigger: "blur"}
],
batchFlag: [
{required: true, message: "批次标识不能为空", trigger: "change"}
],
barcodeType: [
{required: true, message: "条码类型不能为空", trigger: "change"}
],
bindBarcode: [
{required: true, message: "请先领取柜体", trigger: "change"}
],
barcodeAmount: [
{required: true, message: "请输入配对码数量", trigger: "change"}
],
materialId: [
{required: true, message: "物料ID不能为空", trigger: "blur"}
],
},
columns: [
{key: 0, label: `主键标识`, visible: false},
{key: 1, label: `打印时间`, visible: true},
{key: 2, label: `打印人`, visible: true},
{key: 3, label: `批次标识`, visible: true},
{key: 4, label: `条码类型`, visible: false},
{key: 5, label: `条码内容`, visible: true},
{key: 6, label: `批次代码`, visible: true},
{key: 7, label: `托盘RFID代码`, visible: true},
{key: 8, label: `物料名称`, visible: true},
{key: 9, label: `供应商ID`, visible: false},
{key: 10, label: `数量`, visible: true},
{key: 11, label: `打印机台名称`, visible: true},
{key: 12, label: `打印次数`, visible: true},
{key: 13, label: `采购订单号`, visible: false},
{key: 14, label: `生产日期`, visible: true},
{key: 15, label: `接受日期`, visible: true},
{key: 16, label: `最晚出库日期`, visible: true},
{key: 17, label: `派工单号`, visible: true},
{key: 18, label: `明细编号`, visible: false},
{key: 19, label: `销售订单ID`, visible: false},
{key: 20, label: `销售订单编号`, visible: true},
{key: 21, label: `项目号`, visible: false},
{key: 22, label: `流水号`, visible: false},
{key: 23, label: `备注`, visible: true},
{key: 24, label: `绑定状态`, visible: true},
{key: 25, label: `绑定托盘的人`, visible: true},
{key: 26, label: `绑定托盘时间`, visible: true},
{key: 27, label: `更新人`, visible: false},
{key: 28, label: `更新时间`, visible: false},
{key: 29, label: `条码类型`, visible: true},
{key: 30, label: `物料编码`, visible: true},
{key: 31, label: `物料规格`, visible: true},
],
addBindBarcodeBtnVisible: false,
batchPrintBtnDisabled: false,
addProductBarcodeBtnVisible: false,
addInternalBtnVisible: false,
barcodeTypeParam: "",
BARCODE_TYPE: {
RAW: '1',//
PRODUCT: '3',//
BIND_BARCODE: '4',//
},
BARCODE_TYPE_PARAM: {
PRODUCT_BARCODE: '4',//
SPLIT_BIND_BARCODE: '5', //
},
SINGLE_FLAG: {
YES: '1',//
INTERNAL: "2",//
}
};
},
mounted() {
this.getData();
this.getList();
},
props: {
defineData: {
type: Object,
default: {}
}
},
// watch: {
// 'form.batchFlag': function (newVal, oldVal) {
// // form.batchFlag
// if (newVal === '1') {
// this.amountVisible = true;
// } else if (newVal === '0') {
// this.amountVisible = false;
// }
// },
// },
methods: {
getData() {
if (this.defineData.barcodeType) {
let barcodeType = this.defineData.barcodeType ? this.defineData.barcodeType : this.BARCODE_TYPE.PRODUCT;
let bindBarcode = this.defineData.bindBarcode ? this.defineData.bindBarcode : '';
this.barcodeTypeParam = barcodeType;
this.queryParams.planDetailCode = this.defineData.planDetailCode;
if (barcodeType === this.BARCODE_TYPE_PARAM.PRODUCT_BARCODE) {//
this.queryParams.barcodeType = null;
this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.PRODUCT + "," + this.BARCODE_TYPE.BIND_BARCODE;
} else if (barcodeType === this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE) {//
this.queryParams.barcodeType = null;
this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.RAW + "," + this.BARCODE_TYPE.BIND_BARCODE;
}
this.form = {
planId: this.defineData.planId,
planCode: this.defineData.planCode,
planDetailCode: this.defineData.planDetailCode,
batchFlag: '0',
bindBarcode: bindBarcode,
barcodeType: "",
amount: 1,
}
} else if (this.defineData.singleFlag && this.defineData.singleFlag === this.SINGLE_FLAG.INTERNAL) {
this.form = {
batchFlag: '0',
barcodeType: this.BARCODE_TYPE.RAW,
amount: 1,
}
this.queryParams.singleFlag = this.SINGLE_FLAG.INTERNAL;
this.queryParams.barcodeType = this.BARCODE_TYPE.RAW;
}
},
/** 查询条码信息列表 */
getList() {
this.loading = true;
listProductBarcode(this.queryParams).then(response => {
this.barcodeList = response.rows;
this.total = response.total;
if (this.total && this.total > 0) {
if(this.queryParams.singleFlag){
this.addProductBarcodeBtnVisible = false;
this.addBindBarcodeBtnVisible = false;
this.addInternalBtnVisible = true;
}else{
this.addInternalBtnVisible = false;
this.addProductBarcodeBtnVisible = false;
this.addBindBarcodeBtnVisible = true;
if (this.total === 1 && this.barcodeTypeParam === this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE) {
this.handleAddBindBarcode(this.form.bindBarcode);
}
}
} else {
if(this.queryParams.singleFlag){
this.addProductBarcodeBtnVisible = false;
this.addBindBarcodeBtnVisible = false;
this.addInternalBtnVisible = true;
}else{
this.addInternalBtnVisible = false;
this.addProductBarcodeBtnVisible = true;
this.addProductBarcodeOpen = true;
this.handleAddProductBarcode();
}
}
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
barcodeId: null,
printTime: null,
printPerson: null,
batchFlag: '0',
barcodeType: '3',
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: 1,
machineName: null,
printNumber: null,
poNo: null,
productionDate: null,
acceptedDate: null,
lastOutstockDate: null,
planCode: null,
planDetailCode: null,
saleOrderId: null,
saleorderCode: null,
projectNo: null,
serialNumber: null,
remark: null,
bindStatus: null,
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.barcodeId)
this.barcodeInfos = selection.map(item => item.barcodeInfo)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleSelection(selection) {
this.ids = selection.map(item => item.barcodeId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
// handleAdd() {
// this.reset();
// if (this.defineData?.planCode) {
// this.getData()
// }
// this.open = true;
// this.title = "";
// },
/** 新增配对码按钮操作 */
handleAddBindBarcode(barcodeInfo) {
this.reset();
if (this.defineData?.planCode) {
this.getData()
this.form.barcodeType = this.BARCODE_TYPE.BIND_BARCODE;
}
this.form.bindBarcode = barcodeInfo;
this.addProductBarcodeOpen = true;
this.title = "添加配对条码信息";
},
//
resetProductBarcode() {
this.addProductBarcodeForm = {
barcodeId: null,
productBarcode: null,
printTime: null,
printPerson: null,
batchFlag: '0',
barcodeType: '3',
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: 1,
machineName: null,
printNumber: null,
poNo: null,
productionDate: null,
acceptedDate: null,
lastOutstockDate: null,
planCode: null,
planDetailCode: null,
saleOrderId: null,
saleorderCode: null,
projectNo: null,
serialNumber: null,
remark: null,
bindStatus: null,
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("addProductBarcodeForm");
},
handleAddProductBarcode() {
this.resetProductBarcode();
this.form.barcodeType = this.BARCODE_TYPE.PRODUCT;
this.addProductBarcodeOpen = true;
},
//
cancelProductBarcode() {
this.addProductBarcodeOpen = false;
this.resetProductBarcode();
},
/** 打印条码按钮操作 */
handlePrintBarcodes(row) {
const barcodeIds = row.barcodeId || this.ids;
if (barcodeIds == null || barcodeIds == '') {
this.$modal.msgWarning("请选择要打印的物料条码");
return;
}
if (row.printFlag) {
row.printFlag = '1';
} else {
this.batchPrintBtnDisabled = true;
}
printProductBarcodes(barcodeIds).then(response => {
this.$modal.msgSuccess("打印条码成功");
this.getList();
this.batchPrintBtnDisabled = false;
}).catch(() => {
this.batchPrintBtnDisabled = false;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
addProductBarcode(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.addProductBarcodeOpen = false;
this.getList();
});
}
});
},
//
resetInternal() {
this.internalForm = {
barcodeId: null,
printTime: null,
printPerson: null,
batchFlag: null,
barcodeType: '1',
barcodeInfo: null,
batchCode: null,
palletInfoCode: null,
materialId: null,
manufacturerId: null,
amount: null,
barcodeAmount: null,
machineName: null,
printNumber: null,
poNo: null,
productionDate: null,
acceptedDate: null,
lastOutstockDate: null,
planCode: null,
planDetailCode: null,
saleOrderId: null,
saleorderCode: null,
projectNo: null,
serialNumber: null,
remark: null,
bindStatus: null,
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("internalForm");
},
/** 内部生产原材料条码新增按钮操作 */
handleInternalAdd() {
this.resetInternal();
this.internalOpen = true;
},
selectProductBarcodeInfoByBarcodeInfo() {
if (this.internalForm.productBarcode == null || this.internalForm.productBarcode === '') {
return;
}
selectProductBarcodeInfoByBarcodeInfo(this.internalForm.productBarcode).then(response => {
if (response.data == null) {
this.$modal.msgError("成品信息不存在");
return;
}
this.$set(this.internalForm, "materialId", response.data.materialId);
this.$set(this.internalForm, "materialCode", response.data.materialCode);
this.$set(this.internalForm, "materialName", response.data.materialName);
this.$set(this.internalForm, "materialSpec", response.data.materialSpec);
this.$set(this.internalForm, "productionDate", response.data.productionDate);
this.$set(this.internalForm, "saleOrderId", response.data.saleOrderId);
this.$set(this.internalForm, "saleorderCode", response.data.saleorderCode);
});
},
/** 提交按钮 */
submitInternalForm() {
this.$refs["internalForm"].validate(valid => {
if (valid) {
addInternalBarcode(this.internalForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.internalOpen = false;
this.getList();
});
}
});
},
//
cancelInternal() {
this.internalOpen = false;
this.resetInternal();
},
//
regenerateBarcode(row) {
const barcodeId = row.barcodeId;
const barcodeInfo = row.barcodeInfo;
const barcodeType = row.barcodeType;
this.$modal.confirm('重新生成后之前的条码将会作废,是否确认重新生成条码内容为"' + barcodeInfo + '"的数据项?').then(function () {
return regenerateBarcode({
"barcodeId": barcodeId,
"barcodeInfo": barcodeInfo,
"barcodeType": barcodeType
});
}).then(() => {
this.getList();
this.$modal.msgSuccess("重新生成成功");
}).catch(() => {
});
},
}
};
</script>

@ -276,7 +276,7 @@
<div class="bottom">
<el-row>
<el-button type="primary">首页</el-button>
<!-- <el-button type="success" @click="getMaterialsModel = true">条码打印</el-button>-->
<el-button type="success" @click="printInternalBarcode"></el-button>
<el-button type="danger" @click="logout">退</el-button>
</el-row>
</div>
@ -586,7 +586,7 @@
</template>
<script>
import PrintPage from '@/views/mes/barcode/endProductIndex'
import PrintPage from '@/views/board/barcode/workshopBarcode'
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
import {
@ -602,7 +602,7 @@ import {
bindBarcode,
applyRawBack,
assignTask, scanMaterial2Confirm, applyRawReturn,
getNewestOutstockCabinet, completeCollectMaterials, completeReturnMaterials
getNewestOutstockCabinet,updateBarcodePlan, completeCollectMaterials, completeReturnMaterials
} from "@/api/board";
const setState = (e) => {
@ -1487,6 +1487,7 @@ export default {
receiveMaterial() {
this.form1.taskType = this.taskType;
console.log("tasktype:"+this.form1.taskType);
applyRawOutstock(this.form1).then(e => {
this.dialogVisible = false
this.$message({
@ -1502,14 +1503,23 @@ export default {
this.$modal.msgWarning("请先领取柜体");
return;
}
this.PrintData = this.form
this.PrintData.bindBarcode = response.data.materialBatch;
this.PrintData.barcodeType = '4';//
this.printModel = true
let materialBarcode = response.data.materialBatch;
//
updateBarcodePlan({barcodeInfo: response.data.materialBatch,planCode: this.form.planCode,planDetailCode: this.form.planDetailCode}).then(response => {
this.PrintData = this.form
this.PrintData.bindBarcode = materialBarcode;
this.PrintData.barcodeType = '5';//
this.printModel = true
});
});
},
assignClick() {
this.assignModel = true
printInternalBarcode(){
this.PrintData.singleFlag = '2';//
this.printModel = true
},

@ -3,7 +3,7 @@
<div class="headTitle">京源环保生产管理系统</div>
<div class="chartBox chartBox1">
<div class="title">派工信息</div>
<div class="title">生产派工</div>
<div class="chart">
<div class="whiteTable">
<el-table
@ -20,7 +20,7 @@
>
</el-table-column>
<el-table-column
label="派工号"
label="派工号"
prop="planCode"
>
</el-table-column>
@ -69,6 +69,14 @@
>
明细
</el-button>
<el-button
size="small"
type="text"
@click="getDetail(scope)"
>
SOP预览
</el-button>
</template>
</el-table-column>
</el-table>
@ -92,7 +100,7 @@
</div>
<div class="chartBox chartBox3">
<div class="title">计划明细</div>
<div class="title">生产明细</div>
<div class="chart">
<div class="whiteTable">
<el-table
@ -110,7 +118,7 @@
>
</el-table-column>
<el-table-column
label="派工号"
label="派工号"
prop="planCode"
width="80"
>
@ -224,7 +232,7 @@
title="领料"
width="40%">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="派工号">
<el-form-item label="派工号">
<el-input v-model="form.planCode" disabled></el-input>
</el-form-item>
<el-form-item label="明细编号">
@ -403,7 +411,7 @@
<script>
import Chart from '@/components/board/Chart'
import PrintPage from '@/views/mes/barcode/endProductIndex'
import PrintPage from '@/views/board/barcode/workshopBarcode'
import * as echarts from 'echarts'
import {getWarehouses, applyRawOutstock} from '@/api/board/firstFloor'
import {
@ -954,6 +962,7 @@ export default {
},
print(val) {
this.PrintData = val
this.PrintData.barcodeType = '4';//
this.printModel = true
},

@ -10,7 +10,7 @@
<el-form-item label="明细编号">
<el-input v-model="form.planDetailCode"></el-input>
</el-form-item>
<el-form-item label="派工号">
<el-form-item label="派工号">
<el-input v-model="form.planCode"></el-input>
</el-form-item>
<el-form-item label="成品编号">
@ -114,7 +114,7 @@
>
</el-table-column>
<el-table-column
label="派工号"
label="派工号"
prop="planCode"
>
</el-table-column>

@ -3,11 +3,11 @@
<div class="headTitle">京源环保生产管理系统</div>
<div class="chartBox chartBox1">
<div class="title">计划明细</div>
<div class="title">生产明细</div>
<div class="chart">
<div class="form1">
<el-form :model="form" label-position="right" label-width="80px">
<el-form-item label="派工号">
<el-form-item label="派工号">
<el-input v-model="form.planCode"></el-input>
</el-form-item>
<el-form-item label="明细编号">
@ -70,7 +70,7 @@
>
</el-table-column>
<el-table-column
label="派工号"
label="派工号"
prop="planCode"
>
</el-table-column>

@ -859,6 +859,7 @@ export default {
obj.processName = e.processName;
obj.processType = e.processType;
obj.processOrder = e.processOrder;
obj.finalProcessFlag = e.finalProcessFlag;
obj.productionTime = 0;
obj.planBeginTime = this.form.planBeginTime;
obj.planEndTime = this.form.planEndTime;
@ -872,6 +873,7 @@ export default {
obj.saleOrderId = this.form.saleOrderId;
obj.saleorderCode = this.form.saleorderCode;
obj.newFlag = "1";//
// e.mesBaseProcessUserList.forEach((mesBaseProcessUser, index) => {

Loading…
Cancel
Save