Commit e25d849e authored by 温志超's avatar 温志超

工序序列号不够时报错

parent 3d81b9ea
......@@ -214,4 +214,5 @@ qc.error.error5=\u5F53\u524D\u5DE5\u5355\u751F\u4EA7\u7684\u4EA7\u54C1\u672A\u91
qc.error.error6=\u68C0\u6D4B\u9879\u7F16\u53F7\u5DF2\u5B58\u5728
qc.error.error7=\u68C0\u6D4B\u9879\u540D\u79F0\u5DF2\u5B58\u5728
#system.printer
system.printer.error.repeat.bind=\u8BE5\u6253\u5370\u673A\u5DF2\u7ED1\u5B9A\u4E86
\ No newline at end of file
system.printer.error.repeat.bind=\u8BE5\u6253\u5370\u673A\u5DF2\u7ED1\u5B9A\u4E86
rule.currentSerial.error= \u8be5\u4ea7\u54c1\u5e8f\u5217\u53f7\u5269\u4f59\u003a{0}\u4e0d\u6ee1\u8db3\u5de5\u5355\u6570\u91cf\u003a{1}
\ No newline at end of file
......@@ -211,4 +211,5 @@ qc.error.error5=The product produced by the current work order is not configured
qc.error.error6=Inspection item number already exists.
qc.error.error7=Inspection item name already exists.
#system.printer
system.printer.error.repeat.bind=This printer has been bound.
\ No newline at end of file
system.printer.error.repeat.bind=This printer has been bound.
rule.currentSerial.error= The remaining quantity of the product serial number is insufficient :{0} , workorder quantity : {1}
\ No newline at end of file
......@@ -216,4 +216,5 @@ qc.error.error7=\u0E21\u0E35\u0E0A\u0E37\u0E48\u0E2D\u0E23\u0E32\u0E22\u0E01\u0E
system.printer.error.repeat.bind=\u0E40\u0E04\u0E23\u0E37\u0E48\u0E2D\u0E07\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E16\u0E39\u0E01\u0E1C\u0E39\u0E01\u0E44\u0E27\u0E49
md.workStation.error.not.productionSolutionCode = \u0050\u0072\u006f\u0064\u0075\u0063\u0074\u0069\u006f\u006e\u0053\u006f\u006c\u0075\u0074\u0069\u006f\u006e\u0043\u006f\u0064\u0065\u0020\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e01\u0e23\u0e2d\u0e01
md.workStation.error.productionSolutionCode.unique = \u0050\u0072\u006f\u0064\u0075\u0063\u0074\u0069\u006f\u006e\u0053\u006f\u006c\u0075\u0074\u0069\u006f\u006e\u0043\u006f\u0064\u0065\u003a\u0020\u0e44\u0e21\u0e48\u0e40\u0e09\u0e1e\u0e32\u0e30
md.workStation.error.productionSolutionCode.size = \u0050\u0072\u006f\u0064\u0075\u0063\u0074\u0069\u006f\u006e\u0053\u006f\u006c\u0075\u0074\u0069\u006f\u006e\u0043\u006f\u0064\u0065\u003a\u0020\u0e21\u0e35\u0e04\u0e48\u0e32\u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19\u0e2d\u0e22\u0e39\u0e48\u0e41\u0e25\u0e49\u0e27
\ No newline at end of file
md.workStation.error.productionSolutionCode.size = \u0050\u0072\u006f\u0064\u0075\u0063\u0074\u0069\u006f\u006e\u0053\u006f\u006c\u0075\u0074\u0069\u006f\u006e\u0043\u006f\u0064\u0065\u003a\u0020\u0e21\u0e35\u0e04\u0e48\u0e32\u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19\u0e2d\u0e22\u0e39\u0e48\u0e41\u0e25\u0e49\u0e27
rule.currentSerial.error= \u0e2b\u0e21\u0e32\u0e22\u0e40\u0e25\u0e02\u0e1c\u0e25\u0e34\u0e15\u0e20\u0e31\u0e13\u0e11\u0e4c\u0020\u0e40\u0e2b\u0e25\u0e37\u0e2d {0},\u0e44\u0e21\u0e48\u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1b\u0e15\u0e32\u0e21\u0e08\u0e33\u0e19\u0e27\u0e19\u0e43\u0e1a\u0e2a\u0e31\u0e48\u0e07\u0e07\u0e32\u0e19{1}
\ No newline at end of file
......@@ -214,4 +214,5 @@ qc.error.error5=\u5F53\u524D\u5DE5\u5355\u751F\u4EA7\u7684\u4EA7\u54C1\u672A\u91
qc.error.error6=\u68C0\u6D4B\u9879\u7F16\u53F7\u5DF2\u5B58\u5728
qc.error.error7=\u68C0\u6D4B\u9879\u540D\u79F0\u5DF2\u5B58\u5728
#system.printer
system.printer.error.repeat.bind=\u8BE5\u6253\u5370\u673A\u5DF2\u7ED1\u5B9A\u4E86
\ No newline at end of file
system.printer.error.repeat.bind=\u8BE5\u6253\u5370\u673A\u5DF2\u7ED1\u5B9A\u4E86
rule.currentSerial.error= \u8be5\u4ea7\u54c1\u5e8f\u5217\u53f7\u5269\u4f59\u003a{0}\u4e0d\u6ee1\u8db3\u5de5\u5355\u6570\u91cf\u003a{1}
\ No newline at end of file
......@@ -56,8 +56,8 @@ public class ProductQrcodeBuild implements ScheduleBusiProcess{
}
if (proProductQrcodeRuleDto == null || StringUtils.isEmpty(proProductQrcodeRuleDto.getTemplateName())){
//后续再看是否需要报错
ExceptionUtil.checkTrueThrowException(true,
"未能匹配到打印模板,请先到产品二维码规则维护");
// ExceptionUtil.checkTrueThrowException(true,
// "未能匹配到打印模板,请先到产品二维码规则维护");
}
List<String> qrcodes = productQrcodeRuleService.buildQrcode(rule, job.getQuantity().intValue());
for(String qrcode : qrcodes){
......
......@@ -3,8 +3,10 @@ package com.ximai.mes.pro.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ximai.common.utils.MessageUtils;
import com.ximai.common.utils.data.DateUtils;
import com.ximai.common.utils.SecurityUtils;
import com.ximai.common.utils.data.ExceptionUtil;
import com.ximai.common.utils.data.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -152,6 +154,14 @@ public class ProProductQrcodeRuleServiceImpl implements IProProductQrcodeRuleSer
@Override
public List<String> buildQrcode(ProProductQrcodeRule rule, Integer quantity) {
if(rule.getCurrentSerial() != null && rule.getSerialLen() != null && rule.getSerialLen() > 0){
double maxCurrentSerial = 9;
for(int i=1; i < rule.getSerialLen(); i++){
maxCurrentSerial = 9 * Math.pow(10, i);
}
Integer size = rule.getCurrentSerial() + quantity;
ExceptionUtil.checkTrueThrowException(maxCurrentSerial < size, MessageUtils.message("rule.currentSerial.error",maxCurrentSerial - rule.getCurrentSerial(),quantity));
}
List<String> rst = new ArrayList<>();
for(int i=0;i<quantity;i++){
String temp = rule.buildQrcode();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment