| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * 移动端服务核心类 |
| | |
| | | |
| | | Date now = new Date(); |
| | | if (Cools.isEmpty(param.getBillNo())) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Random rand = new Random(); |
| | | Integer r = rand.nextInt(900)+ 100; |
| | | String billNo = sdf.format(new Date()) + r; |
| | | Integer seqNo=0; |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | MatCode matCode = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no", combMat.getMatNo())); |
| | | if (Cools.isEmpty(matCode)) { |
| | | throw new CoolException("物料数据错误"); |
| | | } |
| | | seqNo++; |
| | | PltBarcode pltBarcode = new PltBarcode(); |
| | | pltBarcode.setBarcode(param.getBarcode()); |
| | | pltBarcode.setBillNo(""); |
| | | pltBarcode.setSeqNo(0); |
| | | pltBarcode.setBillNo(billNo); |
| | | pltBarcode.setSeqNo(seqNo); |
| | | pltBarcode.setBillType(5); |
| | | pltBarcode.setMatNo(matCode.getMatNo()); |
| | | pltBarcode.setMatName(matCode.getMatName()); |