Browse Source

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

rainco 7 years ago
parent
commit
6df1713b3f

+ 1 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -40,7 +40,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     SALE_CLOSE(72001, "单据已关闭,无法进行操作"),
     SALE_YQTYBEYONDQTY(72001, "明细行已转数量大于数量"),
     SALE_NULL_BILL(72002, "单据不存在或者明细为空"),
-    SALEOUT_ALL_TURNIN(72003, "该销售出货单已全部转退货,无法转销售退货单"),
+    SALEOUT_ALL_TURNIN(72003, "该出货单已全部转退货,无法转销售退货单"),
     SALEOUT_POSTSTATUS_ERROR(72004,"当前单据状态无法进行此操作。"),
     SALEOUT_POST_ERROR(72005,""),
     //资金

+ 1 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/BillCodeSeq.java

@@ -22,7 +22,7 @@ public enum  BillCodeSeq {
 
     SALE("销售订单", "Sale"),
 
-    SALEOUT("销售出货单", "SaleOut"),
+    SALEOUT("出货单", "SaleOut"),
 
     SALEIN("销售退货单", "SaleIn"),
 

+ 2 - 2
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java

@@ -149,8 +149,8 @@ public class ProdInOutController {
 
     @PostMapping("/turnProdIn/{id}")
     public Result turnProdin(@PathVariable("id") Long id){
-        prodInOutService.turnProdin(id);
-        return Result.success();
+        DocBaseDTO baseDTO  = prodInOutService.turnProdin(id);
+        return Result.success(baseDTO);
     };
 
     @PostMapping("/close/{id}")

+ 1 - 1
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ProdInOutService.java

@@ -118,5 +118,5 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      * 出库单转退货单
      * @param id
      */
-    Result turnProdin(Long id);
+    DocBaseDTO turnProdin(Long id);
 }

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

@@ -363,7 +363,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     @Override
-    public Result turnProdin(Long id) {
+    public DocBaseDTO turnProdin(Long id) {
         Integer count=0;
         double pdOutqty=0;
         double pdYqty=0;
@@ -389,7 +389,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         }
         //判断可转数
         if (count==0) {
-            return Result.error(ExceptionCode.TURNINNUM_NOT_EXIST);
+            throw  new BizException(ExceptionCode.TURNINNUM_NOT_EXIST);
         }
         //插入销售退货单主表
         ProdInOut targetPi = new ProdInOut();
@@ -455,7 +455,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 prodIODetailMapper.updateByPrimaryKeySelective(sourcePid);
             }
         }
-        return Result.success();
+
+        //日志记录
+        DocBaseDTO baseDTO = new DocBaseDTO(pi_id, piInoutno, BillCodeSeq.SALEIN.getCaller());
+        //messageLogService.customizeLog(baseDTO, Operation.);
+        return baseDTO;
 
     }
 
@@ -548,7 +552,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         Integer count = "0".equals(String.valueOf(id)) ? prodInOutMapper.validateCodeWhenInsert(code,pi_class) :
                 prodInOutMapper.validateCodeWhenUpdate(code, id);
         String caller ="";
-        if(pi_class.equals("销售出货单")){
+        if(pi_class.equals("出货单")){
             caller = BillCodeSeq.SALEOUT.getCaller();
         }else {//销售退货单
             caller = BillCodeSeq.SALEIN.getCaller();
@@ -580,7 +584,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     private void setTotal(ProdInOut prodInOut ) {
         String pi_class = prodInOut.getPi_class();
         Long id = prodInOut.getId();
-        if(BillCodeSeq.SALEOUT.getName().equals(pi_class)){//销售出货单
+        if(BillCodeSeq.SALEOUT.getName().equals(pi_class)){//出货单
             //更新明细
             prodIODetailMapper.updatePDSaleOut(id);
             //更新主表

+ 2 - 2
applications/sale/sale-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -746,13 +746,13 @@ update prodiodetail a
           and pd_piid=#{id}  GROUP BY pd_ioid ) b
           where IFNULL(b.pd_ioid ,0)= a.pd_id
      ),0)
-where a.pd_id in (select pd_ioid from prodiodetail where pd_piid=#{id} and pi_class='销售出货单')
+where a.pd_id in (select pd_ioid from prodiodetail where pd_piid=#{id} and pi_class='出货单')
   </update>
   <update id="updateSaleYqty" parameterType="long">
 
     update saledetail a set a.sd_yqty =IFNULL( ( select b.pd_outqty from (
     select pd_sdid,sum(pd_outqty) pd_outqty from prodiodetail left join
-    prodinout on pd_piid = pi_id where pd_piclass='销售出货单' and pi_said=#{id}
+    prodinout on pd_piid = pi_id where pd_piclass='出货单' and pi_said=#{id}
     GROUP BY pd_sdid) b where IFNULL(b.pd_sdid ,0) = a.sd_id ),0) where a.sd_said =#{id}
   </update>
 

+ 2 - 1
applications/storage/storage-server/src/main/resources/application.yml

@@ -47,7 +47,8 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+         defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+        # defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
 server:
   port: 9000
   tomcat: