|
|
@@ -143,8 +143,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
prodInOut.setPi_date(new Date());
|
|
|
prodInOut.setPi_puid(main.getPi_puid());
|
|
|
prodInOut.setPi_pucode(main.getPi_pucode());
|
|
|
+ baseDTO.setCode(pi_inoutno);
|
|
|
+ baseDTO.setId(pi_id);
|
|
|
+ baseDTO.setName(pi_class);
|
|
|
//编号获取
|
|
|
- pi_inoutno = pushMaxnubmer(prodInOut);
|
|
|
+ pi_inoutno = pushMaxnubmer(baseDTO);
|
|
|
prodInOut.setPi_inoutno(pi_inoutno);
|
|
|
|
|
|
//判断更新与保存动作
|
|
|
@@ -428,7 +431,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
//插入验退单主表
|
|
|
ProdInOut targetPi = new ProdInOut();
|
|
|
//生成单号
|
|
|
- String piInoutno = maxnumberService.getMaxnumber(BillCodeSeq.PURCHASEOUT.getCaller(),true).getData();
|
|
|
+ String piInoutno = getMaxnumber(BillCodeSeq.PURCHASEOUT);
|
|
|
targetPi.setPi_inoutno(piInoutno);
|
|
|
targetPi.setPi_class(BillCodeSeq.PURCHASEOUT.getName());
|
|
|
targetPi.setPi_date(new Date());
|
|
|
@@ -546,7 +549,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
return docBaseDTO;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public DocBaseDTO open(long id) {
|
|
|
return singleOpen(id);
|
|
|
@@ -575,26 +577,6 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
return baseDTO;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public String pushMaxnubmer(ProdInOut prodInOut) {
|
|
|
- String pi_inoutno = prodInOut.getPi_inoutno();
|
|
|
- String pi_class = prodInOut.getPi_class();
|
|
|
- Long id = prodInOut.getId();
|
|
|
- if (null == pi_inoutno) {
|
|
|
- throw new BizException(BizExceptionCode.NULL_CODE);
|
|
|
- }
|
|
|
- Long companyId = BaseContextHolder.getCompanyId();
|
|
|
- Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(pi_inoutno, companyId) :
|
|
|
- getMapper().validateCodeWhenUpdate(pi_inoutno, id, companyId);
|
|
|
- String caller ="";
|
|
|
- if("采购验收单".equals(pi_class)){
|
|
|
- caller = BillCodeSeq.PURCHASEIN.getCaller();
|
|
|
- }else if("采购验退单".equals(pi_class)) {
|
|
|
- caller = BillCodeSeq.PURCHASEOUT.getCaller();
|
|
|
- }
|
|
|
- return maxnumberService.pushMaxnubmer(count, pi_inoutno, caller).getData();
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void getDefaultWarehouseByProduct(Long pi_id) {
|
|
|
@@ -613,5 +595,29 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
|
|
|
return prodInOut;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String getMaxnumber(BillCodeSeq bill) {
|
|
|
+ String code = maxnumberService.getMaxnumber(bill.getCaller(), false).getData();
|
|
|
+ DocBaseDTO base = new DocBaseDTO(0l, code, bill.getName());
|
|
|
+ return pushMaxnubmer(base);
|
|
|
+ }
|
|
|
|
|
|
+ public synchronized String pushMaxnubmer(DocBaseDTO baseDTO) {
|
|
|
+ String pi_inoutno = baseDTO.getCode();
|
|
|
+ String pi_class = baseDTO.getName();
|
|
|
+ Long id = baseDTO.getId();
|
|
|
+ if (null == pi_inoutno) {
|
|
|
+ throw new BizException(BizExceptionCode.NULL_CODE);
|
|
|
+ }
|
|
|
+ Long companyId = BaseContextHolder.getCompanyId();
|
|
|
+ Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(pi_inoutno, companyId) :
|
|
|
+ getMapper().validateCodeWhenUpdate(pi_inoutno, id, companyId);
|
|
|
+ String caller ="";
|
|
|
+ if("采购验收单".equals(pi_class)){
|
|
|
+ caller = BillCodeSeq.PURCHASEIN.getCaller();
|
|
|
+ }else if("采购验退单".equals(pi_class)) {
|
|
|
+ caller = BillCodeSeq.PURCHASEOUT.getCaller();
|
|
|
+ }
|
|
|
+ return maxnumberService.pushMaxnubmer(count, pi_inoutno, caller).getData();
|
|
|
+ }
|
|
|
}
|