| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by vincent on 2022/4/9 |
| | |
| | | callApiLogSaveMES(param, null, param.getBarcode() + ":工作明细档已存在此数据", false); |
| | | throw new CoolException("工作明细档已存在此数据===>>" + param.getBarcode()); |
| | | } |
| | | List<CombParam.CombMat> combMats = param.getCombMats(); |
| | | Map<String, String> map = new HashMap<>(); |
| | | for (CombParam.CombMat combMat : combMats) { |
| | | String batch = Cools.isEmpty(combMat.getBatch()) ? "" : combMat.getBatch(); |
| | | if (!Cools.isEmpty(map.get(combMat.getMatnr() + batch))) { |
| | | throw new CoolException(param.getBarcode() + "组托的物料明细重复,请检查是否重复扫码"); |
| | | } else { |
| | | map.put(combMat.getMatnr() + batch, combMat.getMatnr()); |
| | | } |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | try{ |
| | |
| | | order.setOrderNo(toString(param.get("id"))); |
| | | //业务类型 |
| | | //order.setDefNumber(param.get("cBusType").toString()); |
| | | order.setDefNumber(toString(param.get("cBusType"))); |
| | | order.setDefNumber(toString(param.get("cVouchType"))); |
| | | //单据类型 |
| | | DocType docType = docTypeService.selectOrAdd(param.get("cVouchType").toString(), pakin); |
| | | DocType docType = docTypeService.selectOrAdd(param.get("cBusType").toString(), pakin); |
| | | order.setDocType(docType.getDocId()); |
| | | //单据日期 |
| | | //order.setOrderTime(param.get("dDate").toString()); |