Browse Source

销售出货转退货优化:ri'z

rainco 7 years ago
parent
commit
3d270aed00

+ 5 - 6
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java

@@ -96,7 +96,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         prodInOut.setPi_date(new Date());
 
         //编号获取
-        pi_inoutno = pushMaxnubmer(pi_inoutno, pi_id,pi_class);
+        pi_inoutno = pushMaxnubmer(prodInOut);
         prodInOut.setPi_inoutno(pi_inoutno);
 
         prodInOut.setPi_class(main.getPi_class());
@@ -549,14 +549,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
      * @Author: guq
      * @Date: 2018/10/19
      */
-    private String pushMaxnubmer(String code, Long id,String pi_class) {
+    private String pushMaxnubmer(ProdInOut prodInOut) {
+        String code = prodInOut.getPi_inoutno();
+        Long id = prodInOut.getId();
+        String pi_class = prodInOut.getPi_class();
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }
-        ProdInOut prodInOut = prodInOutMapper.selectByPrimaryKey(id);
-        if(prodInOut==null){
-            throw new BizException(BizExceptionCode.NO_DATA);
-        }
         Integer count = "0".equals(String.valueOf(id)) ? prodInOutMapper.validateCodeWhenInsert(code,pi_class) :
                 prodInOutMapper.validateCodeWhenUpdate(code, id);
         String caller ="";