|
|
@ -23,9 +23,12 @@ import com.hw.mes.domain.MesOrderBind;
|
|
|
|
import com.hw.mes.domain.MesProductOrder;
|
|
|
|
import com.hw.mes.domain.MesProductOrder;
|
|
|
|
import com.hw.mes.domain.vo.MesBindBarcodeVo;
|
|
|
|
import com.hw.mes.domain.vo.MesBindBarcodeVo;
|
|
|
|
import com.hw.mes.mapper.*;
|
|
|
|
import com.hw.mes.mapper.*;
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
|
|
|
|
|
|
|
|
import com.hw.printer.api.RemotePrinterService;
|
|
|
|
import com.hw.printer.api.RemotePrinterService;
|
|
|
|
import com.hw.printer.api.domain.vo.PrintContentVo;
|
|
|
|
import com.hw.printer.api.domain.vo.PrintContentVo;
|
|
|
|
|
|
|
|
import com.hw.printer.api.domain.vo.PrinterVo;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import com.hw.mes.service.IMesBaseBarcodeInfoService;
|
|
|
|
import com.hw.mes.service.IMesBaseBarcodeInfoService;
|
|
|
@ -113,19 +116,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
|
|
|
|
|
|
|
|
// 生成成品条码
|
|
|
|
// 生成成品条码
|
|
|
|
else if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) {
|
|
|
|
else if (mesBaseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_PRODUCT)) {
|
|
|
|
Date currentDate = new Date();
|
|
|
|
generateProductBarcode(mesBaseBarcodeInfo);
|
|
|
|
String userName = SecurityUtils.getUsername();
|
|
|
|
|
|
|
|
// 批次代码 == 条码内容
|
|
|
|
|
|
|
|
int frequency = mesBaseBarcodeInfo.getAmount().intValue();
|
|
|
|
|
|
|
|
for (int i = 0; i < frequency; i++) {
|
|
|
|
|
|
|
|
String code = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setBatchCode(code);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setBarcodeInfo(code);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setAmount(new BigDecimal(1));
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setCreateTime(currentDate);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setCreateBy(userName);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
@ -195,6 +186,35 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void generateProductBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
|
|
|
|
|
|
|
|
int dispatchAmount = mesBaseBarcodeInfo.getDispatchAmount().intValue();
|
|
|
|
|
|
|
|
int generateAmount = mesBaseBarcodeInfo.getAmount().intValue();//获取要生成的条码数量,目前也是派工的数量
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String planCode = mesBaseBarcodeInfo.getPlanCode();
|
|
|
|
|
|
|
|
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
|
|
|
|
|
|
|
|
queryBarcodeInfo.setPlanCode(planCode);
|
|
|
|
|
|
|
|
List<MesBaseBarcodeInfo> mesBaseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBarcodeInfo);
|
|
|
|
|
|
|
|
int hadGeneratedLabelCount = mesBaseBarcodeInfos == null ? 0 : mesBaseBarcodeInfos.size();//获取已经生成条码的数量
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (generateAmount + hadGeneratedLabelCount > dispatchAmount) {
|
|
|
|
|
|
|
|
throw new ServiceException("新增条码数量总数不能大于" + dispatchAmount);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date currentDate = new Date();
|
|
|
|
|
|
|
|
for (int i = 0; i < generateAmount; i++) {
|
|
|
|
|
|
|
|
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setBatchCode(barcode);// 成品的批次代码 == 条码内容
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setBarcodeInfo(barcode);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setAmount(new BigDecimal(1));
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setCreateTime(currentDate);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setBatchFlag(MesConstants.NOT_IS_BATCH);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
|
|
|
|
|
|
|
|
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public MesBaseBarcodeInfo getInsertedBarcodeInfo(MesBaseBarcodeInfo mesBaseBarcodeInfo, String batchCode, String userName, Date currentDate) {
|
|
|
|
public MesBaseBarcodeInfo getInsertedBarcodeInfo(MesBaseBarcodeInfo mesBaseBarcodeInfo, String batchCode, String userName, Date currentDate) {
|
|
|
|
MesBaseBarcodeInfo toInsertedBarcodeInfo = new MesBaseBarcodeInfo();
|
|
|
|
MesBaseBarcodeInfo toInsertedBarcodeInfo = new MesBaseBarcodeInfo();
|
|
|
|
//同一批次的批次代码相同
|
|
|
|
//同一批次的批次代码相同
|
|
|
@ -259,14 +279,15 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 打印条码
|
|
|
|
* 打印物料条码
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param barcodeIds
|
|
|
|
* @param barcodeIds
|
|
|
|
|
|
|
|
* @param printType 打印类型(1原材料 3成品)
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public int printBarcodes(Long[] barcodeIds) {
|
|
|
|
public int printBarcodes(Long[] barcodeIds, String printType) {
|
|
|
|
//获取条码List
|
|
|
|
//获取条码List
|
|
|
|
List<List<PrintContentVo>> printContents = new ArrayList<>();
|
|
|
|
List<List<PrintContentVo>> printContents = new ArrayList<>();
|
|
|
|
List<MesBaseBarcodeInfo> toUpdatedBaseBarcodeInfos = new ArrayList<>();
|
|
|
|
List<MesBaseBarcodeInfo> toUpdatedBaseBarcodeInfos = new ArrayList<>();
|
|
|
@ -278,27 +299,47 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
throw new ServiceException("此物料条码[" + mesBaseBarcodeInfo.getBarcodeInfo() + "]已经打印过,不能重复打印");
|
|
|
|
throw new ServiceException("此物料条码[" + mesBaseBarcodeInfo.getBarcodeInfo() + "]已经打印过,不能重复打印");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String materialName = mesBaseBarcodeInfo.getMaterialName();
|
|
|
|
List<PrintContentVo> printContentVos = new ArrayList<>();
|
|
|
|
List<PrintContentVo> printContentVos = new ArrayList<>();
|
|
|
|
PrintContentVo printMaterialName = new PrintContentVo();
|
|
|
|
|
|
|
|
printMaterialName.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME);
|
|
|
|
|
|
|
|
printMaterialName.setValue(mesBaseBarcodeInfo.getMaterialName());
|
|
|
|
|
|
|
|
printMaterialName.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printMaterialCode = new PrintContentVo();
|
|
|
|
PrintContentVo printMaterialCode = new PrintContentVo();
|
|
|
|
printMaterialCode.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE);
|
|
|
|
printMaterialCode.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_CODE);
|
|
|
|
printMaterialCode.setValue(mesBaseBarcodeInfo.getMaterialCode());
|
|
|
|
printMaterialCode.setValue(mesBaseBarcodeInfo.getMaterialCode());
|
|
|
|
printMaterialCode.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
printMaterialCode.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printPoNo = new PrintContentVo();
|
|
|
|
|
|
|
|
printPoNo.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_PO_NO);
|
|
|
|
|
|
|
|
printPoNo.setValue(mesBaseBarcodeInfo.getPoNo());
|
|
|
|
|
|
|
|
printPoNo.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printPreMaterial = new PrintContentVo();
|
|
|
|
PrintContentVo printPreMaterial = new PrintContentVo();
|
|
|
|
// if (mesBaseBarcodeInfo.getBindFlag() == null) {
|
|
|
|
// if (mesBaseBarcodeInfo.getBindFlag() == null) {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printSaleOrderCode = new PrintContentVo();
|
|
|
|
|
|
|
|
printSaleOrderCode.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_SALE_ORDER_CODE);
|
|
|
|
|
|
|
|
printSaleOrderCode.setValue(mesBaseBarcodeInfo.getSaleorderCode());
|
|
|
|
|
|
|
|
printSaleOrderCode.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printBarCode = new PrintContentVo();
|
|
|
|
|
|
|
|
printBarCode.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QRCODE);
|
|
|
|
|
|
|
|
printBarCode.setValue(mesBaseBarcodeInfo.getBarcodeInfo());
|
|
|
|
|
|
|
|
printBarCode.setType(PrintContentVo.TYPE_QRCODE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (printType.equals(PrinterVo.PRINT_TYPE_RAW_LABEL)) {
|
|
|
|
|
|
|
|
PrintContentVo printMaterialName = new PrintContentVo();
|
|
|
|
|
|
|
|
printMaterialName.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME);
|
|
|
|
|
|
|
|
materialName = materialName.length() <= 10 ? "\n" + materialName : materialName;
|
|
|
|
|
|
|
|
printMaterialName.setValue(materialName);
|
|
|
|
|
|
|
|
printMaterialName.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printBatchCode = new PrintContentVo();
|
|
|
|
|
|
|
|
printBatchCode.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BATCH_CODE);
|
|
|
|
|
|
|
|
printBatchCode.setValue(mesBaseBarcodeInfo.getBatchCode());
|
|
|
|
|
|
|
|
printBatchCode.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printPoNo = new PrintContentVo();
|
|
|
|
|
|
|
|
printPoNo.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_PO_NO);
|
|
|
|
|
|
|
|
printPoNo.setValue(mesBaseBarcodeInfo.getPoNo());
|
|
|
|
|
|
|
|
printPoNo.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
String printPreMaterialKey = mesBaseBarcodeInfo.getBindFlag() != null && mesBaseBarcodeInfo.getBindFlag().equals(MesConstants.MES_MATERIAL_BIND_FLAG_YES)
|
|
|
|
String printPreMaterialKey = mesBaseBarcodeInfo.getBindFlag() != null && mesBaseBarcodeInfo.getBindFlag().equals(MesConstants.MES_MATERIAL_BIND_FLAG_YES)
|
|
|
|
? PrintContentVo.RAW_MATERIAL_LABEL_KEY_PRE_MATERIAL_YES : PrintContentVo.RAW_MATERIAL_LABEL_KEY_PRE_MATERIAL_NO;
|
|
|
|
? PrintContentVo.RAW_MATERIAL_LABEL_KEY_PRE_MATERIAL_YES : PrintContentVo.RAW_MATERIAL_LABEL_KEY_PRE_MATERIAL_NO;
|
|
|
|
printPreMaterial.setKey(printPreMaterialKey);
|
|
|
|
printPreMaterial.setKey(printPreMaterialKey);
|
|
|
@ -309,11 +350,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
printMaterialSpec.setValue(mesBaseBarcodeInfo.getMaterialSpec());
|
|
|
|
printMaterialSpec.setValue(mesBaseBarcodeInfo.getMaterialSpec());
|
|
|
|
printMaterialSpec.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
printMaterialSpec.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printSaleOrderCode = new PrintContentVo();
|
|
|
|
|
|
|
|
printSaleOrderCode.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_SALE_ORDER_CODE);
|
|
|
|
|
|
|
|
printSaleOrderCode.setValue(mesBaseBarcodeInfo.getSaleorderCode());
|
|
|
|
|
|
|
|
printSaleOrderCode.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printQty = new PrintContentVo();
|
|
|
|
PrintContentVo printQty = new PrintContentVo();
|
|
|
|
printQty.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QTY);
|
|
|
|
printQty.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QTY);
|
|
|
|
DecimalFormat df = new DecimalFormat("#.##");
|
|
|
|
DecimalFormat df = new DecimalFormat("#.##");
|
|
|
@ -321,24 +357,36 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
printQty.setValue(formattedNumber);
|
|
|
|
printQty.setValue(formattedNumber);
|
|
|
|
printQty.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
printQty.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printBatchCode = new PrintContentVo();
|
|
|
|
printContentVos.add(printMaterialName);
|
|
|
|
printBatchCode.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_BATCH_CODE);
|
|
|
|
printContentVos.add(printBatchCode);
|
|
|
|
printBatchCode.setValue(mesBaseBarcodeInfo.getBatchCode());
|
|
|
|
printContentVos.add(printPoNo);
|
|
|
|
printBatchCode.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
printContentVos.add(printMaterialSpec);
|
|
|
|
|
|
|
|
printContentVos.add(printQty);
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printBarCode = new PrintContentVo();
|
|
|
|
} else if (printType.equals(PrinterVo.PRINT_TYPE_PRODUCT_LABEL)) {
|
|
|
|
printBarCode.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QRCODE);
|
|
|
|
PrintContentVo printMaterialName = new PrintContentVo();
|
|
|
|
printBarCode.setValue(mesBaseBarcodeInfo.getBarcodeInfo());
|
|
|
|
materialName = materialName.length() <= 8 ? "\n" + materialName : materialName;
|
|
|
|
printBarCode.setType(PrintContentVo.TYPE_QRCODE);
|
|
|
|
printMaterialName.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_NAME);
|
|
|
|
|
|
|
|
printMaterialName.setValue(materialName);
|
|
|
|
|
|
|
|
printMaterialName.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printQty = new PrintContentVo();
|
|
|
|
|
|
|
|
printQty.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_QTY);
|
|
|
|
|
|
|
|
printQty.setValue("1");
|
|
|
|
|
|
|
|
printQty.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrintContentVo printPlanCode = new PrintContentVo();
|
|
|
|
|
|
|
|
printPlanCode.setKey(PrintContentVo.PRODUCT_PLAN_CODE);
|
|
|
|
|
|
|
|
printPlanCode.setValue(mesBaseBarcodeInfo.getPlanCode());
|
|
|
|
|
|
|
|
printPlanCode.setType(PrintContentVo.TYPE_TEXT);
|
|
|
|
printContentVos.add(printMaterialName);
|
|
|
|
printContentVos.add(printMaterialName);
|
|
|
|
|
|
|
|
printContentVos.add(printQty);
|
|
|
|
|
|
|
|
printContentVos.add(printPlanCode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
printContentVos.add(printMaterialCode);
|
|
|
|
printContentVos.add(printMaterialCode);
|
|
|
|
printContentVos.add(printPoNo);
|
|
|
|
|
|
|
|
printContentVos.add(printPreMaterial);
|
|
|
|
printContentVos.add(printPreMaterial);
|
|
|
|
printContentVos.add(printMaterialSpec);
|
|
|
|
|
|
|
|
printContentVos.add(printSaleOrderCode);
|
|
|
|
printContentVos.add(printSaleOrderCode);
|
|
|
|
printContentVos.add(printQty);
|
|
|
|
|
|
|
|
printContentVos.add(printBatchCode);
|
|
|
|
|
|
|
|
printContentVos.add(printBarCode);
|
|
|
|
printContentVos.add(printBarCode);
|
|
|
|
|
|
|
|
|
|
|
|
String checkStatus = mesBaseBarcodeInfo.getCheckStatus() == null ? "" : mesBaseBarcodeInfo.getCheckStatus();
|
|
|
|
String checkStatus = mesBaseBarcodeInfo.getCheckStatus() == null ? "" : mesBaseBarcodeInfo.getCheckStatus();
|
|
|
@ -367,8 +415,12 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
this.updateMesBaseBarcodeInfo(toUpdateMesBaseBarcodeInfo);
|
|
|
|
this.updateMesBaseBarcodeInfo(toUpdateMesBaseBarcodeInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PrinterVo printerVo = new PrinterVo();
|
|
|
|
|
|
|
|
printerVo.setPrintType(printType);
|
|
|
|
|
|
|
|
printerVo.setPrintContents(printContents);
|
|
|
|
|
|
|
|
|
|
|
|
//调用的打印接口
|
|
|
|
//调用的打印接口
|
|
|
|
R<?> printResultR = remotePrinterService.printBarcodes(printContents, SecurityConstants.INNER);
|
|
|
|
R<?> printResultR = remotePrinterService.printBarcodes(printerVo, SecurityConstants.INNER);
|
|
|
|
if (printResultR.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务
|
|
|
|
if (printResultR.getCode() != Constants.SUCCESS) {//抛出异常,回滚事务
|
|
|
|
throw new RuntimeException(printResultR.getMsg());
|
|
|
|
throw new RuntimeException(printResultR.getMsg());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -532,14 +584,21 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 重新生成条码信息,之前的作废
|
|
|
|
* 重新生成条码信息,之前的作废
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param mesBaseBarcodeInfo
|
|
|
|
* @param mesBaseBarcodeInfo
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int regenerateBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
|
|
|
|
public int regenerateBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
|
|
|
|
|
|
|
|
String barcodeType = mesBaseBarcodeInfo.getBarcodeType();
|
|
|
|
String oldBarcode = mesBaseBarcodeInfo.getBarcodeInfo();
|
|
|
|
String oldBarcode = mesBaseBarcodeInfo.getBarcodeInfo();
|
|
|
|
String newBarcode = Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode);
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String userName = SecurityUtils.getUsername();
|
|
|
|
String userName = SecurityUtils.getUsername();
|
|
|
|
Date currentDate = new Date();
|
|
|
|
Date currentDate = new Date();
|
|
|
@ -557,7 +616,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
mesBaseBarcodeInfo.setUpdateTime(currentDate);
|
|
|
|
mesBaseBarcodeInfo.setUpdateTime(currentDate);
|
|
|
|
return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
|
|
|
|
return mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|