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

更新排产寻找条码规则逻辑

parent a253b175
......@@ -156,10 +156,11 @@ 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);
StringBuilder maxCurrentSerialString = new StringBuilder();
for(int i=0; i < rule.getSerialLen(); i++){
maxCurrentSerialString.append(9);
}
double maxCurrentSerial = new Double(maxCurrentSerialString.toString());
Integer size = rule.getCurrentSerial() + quantity;
ExceptionUtil.checkTrueThrowException(maxCurrentSerial < size, MessageUtils.message("rule.currentSerial.error",maxCurrentSerial - rule.getCurrentSerial(),quantity));
}
......
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