Browse Source

修改其他出入库单

zhoudw 7 years ago
parent
commit
61826a6034

+ 2 - 11
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdIODetailMapper.java

@@ -2,14 +2,11 @@ package com.usoftchina.saas.purchase.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.purchase.po.ProdIODetail;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 public interface ProdIODetailMapper extends CommonBaseMapper<ProdIODetail> {
-    long countByExample(ProdIODetailExample example);
 
-    int deleteByExample(ProdIODetailExample example);
 
     int deleteByPrimaryKey(Long pd_id);
 
@@ -17,17 +14,9 @@ public interface ProdIODetailMapper extends CommonBaseMapper<ProdIODetail> {
 
     int insertSelective(ProdIODetail record);
 
-    List<ProdIODetail> selectByExampleWithBLOBs(ProdIODetailExample example);
-
-    List<ProdIODetail> selectByExample(ProdIODetailExample example);
 
     ProdIODetail selectByPrimaryKey(Integer pd_id);
 
-    int updateByExampleSelective(@Param("record") ProdIODetail record, @Param("example") ProdIODetailExample example);
-
-    int updateByExampleWithBLOBs(@Param("record") ProdIODetail record, @Param("example") ProdIODetailExample example);
-
-    int updateByExample(@Param("record") ProdIODetail record, @Param("example") ProdIODetailExample example);
 
     int updateByPrimaryKeySelective(ProdIODetail record);
 
@@ -42,4 +31,6 @@ public interface ProdIODetailMapper extends CommonBaseMapper<ProdIODetail> {
     void updatePurchaseYqty(Integer id);
 
     List<ProdIODetail> selectByFK(Long id);
+
+    void deleteByFK(Long id);
 }

+ 0 - 12
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutMapper.java

@@ -2,14 +2,9 @@ package com.usoftchina.saas.purchase.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.purchase.po.ProdInOut;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
 
 public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
-    long countByExample(ProdInOutExample example);
 
-    int deleteByExample(ProdInOutExample example);
 
     int deleteByPrimaryKey(Long pi_id);
 
@@ -17,17 +12,10 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
 
     int insertSelective(ProdInOut record);
 
-    List<ProdInOut> selectByExampleWithBLOBs(ProdInOutExample example);
 
-    List<ProdInOut> selectByExample(ProdInOutExample example);
 
     ProdInOut selectByPrimaryKey(Long pi_id);
 
-    int updateByExampleSelective(@Param("record") ProdInOut record, @Param("example") ProdInOutExample example);
-
-    int updateByExampleWithBLOBs(@Param("record") ProdInOut record, @Param("example") ProdInOutExample example);
-
-    int updateByExample(@Param("record") ProdInOut record, @Param("example") ProdInOutExample example);
 
     int updateByPrimaryKeySelective(ProdInOut record);
 

+ 1 - 4
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java

@@ -186,10 +186,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             //删除主键
             getMapper().deleteByPrimaryKey(prodInOut.getId());
             //删除从表
-            ProdIODetailExample prodIODetailExample = new ProdIODetailExample();
-            ProdIODetailExample.Criteria cta = prodIODetailExample.createCriteria();
-            cta.andPd_piidEqualTo(prodInOut.getId().intValue());
-            prodIODetailMapper.deleteByExample(prodIODetailExample);
+            prodIODetailMapper.deleteByFK(id);
             //更新已转数
 //            updateYqty(prodInOut.getPi_puid(),prodInOut.getPi_class());
             updateYqty(prodInOut);

+ 4 - 1
applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -976,6 +976,9 @@ where a.pd_piid = (select pi_id from prodinout where pi_puid=#{id,jdbcType=INTEG
     where pd_piid=#{id} order by pd_pdno
   </select>
 
-
+  <delete id="deleteByFK" parameterType="java.lang.Long">
+    delete from prodiodetail
+    where pd_piid = #{id,jdbcType=INTEGER}
+  </delete>
 
 </mapper>

+ 2 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/StorageApplication.java

@@ -4,12 +4,14 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 
 @SpringBootApplication
 @EnableEurekaClient
 //@EnableAuthClient
 @EnableTransactionManagement
+@EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.storage.mapper")
 public class StorageApplication {
 

+ 1 - 8
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java

@@ -11,7 +11,7 @@ import com.usoftchina.saas.storage.po.ProdInOutList;
 import com.usoftchina.saas.storage.service.ProdInOutService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-
+@CrossOrigin
 @RestController
 @RequestMapping("/prodinout")
 public class ProdInOutController {
@@ -141,11 +141,4 @@ public class ProdInOutController {
         return Result.success();
     }
 
-    @GetMapping("/turnProdOut/{id}")
-    public Result turnProdin(@PathVariable("id") Long id){
-        prodInOutService.turnProdOut(id);
-        return Result.success();
-    };
-
-
 }

+ 0 - 3
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/ProdInOutService.java

@@ -1,7 +1,6 @@
 package com.usoftchina.saas.storage.service;
 
 import com.github.pagehelper.PageInfo;
-import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocSavedDTO;
@@ -57,6 +56,4 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
 
     PageInfo<ProdInOutList> getListData(PageRequest page, ListReqDTO req);
 
-    Result turnProdOut(Long id);
-
 }

+ 0 - 66
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInoutServiceImpl.java

@@ -2,7 +2,6 @@ package com.usoftchina.saas.storage.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
@@ -13,7 +12,6 @@ import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.api.WarehouseApi;
 import com.usoftchina.saas.exception.BizException;
-import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.storage.dto.ProdIODetailDTO;
 import com.usoftchina.saas.storage.dto.ProdInOutDTO;
@@ -264,70 +262,6 @@ public class ProdInoutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
 
     }
 
-    @Override
-    public Result turnProdOut(Long id) {
-        ProdInOut sourcePi = getMapper().selectByPrimaryKey(id);
-        Integer count=0;
-        double pdInqty=0, pdYqty=0;
-        List<ProdIODetail> sourcePids =prodIODetailMapper.selectByFK(id);
-        //检查从表
-        for (ProdIODetail prodIODetail : sourcePids) {
-            pdInqty = prodIODetail.getPd_inqty();
-            pdYqty = prodIODetail.getPd_yqty();
-            if (pdInqty-pdYqty>0){
-                count++;
-            }
-        }
-        //判断可转数
-        if (count==0) {
-            return Result.error(ExceptionCode.TURNINNUM_NOT_EXIST);
-        }
-        //插入验退单主表
-        ProdInOut targetPi = new ProdInOut();
-        //生成单号
-        String piInoutno = "YT0001";
-        targetPi.setPi_inoutno(piInoutno);
-        targetPi.setPi_class("采购验退单");
-        targetPi.setPi_date(new Date());
-        targetPi.setPi_recorddate(new Date());
-        targetPi.setPi_vendcode(sourcePi.getPi_vendcode());
-        targetPi.setPi_vendname(sourcePi.getPi_vendname());
-        targetPi.setPi_puid(sourcePi.getPi_puid());
-        targetPi.setPi_pucode(sourcePi.getPi_pucode());
-        //设置公司id
-        targetPi.setCompanyId(sourcePi.getCompanyId());
-        //保存数据
-        getMapper().insertSelective(targetPi);
-        //插入验退单从表
-        long pi_id = targetPi.getId();
-        for (int i = 0;i<sourcePids.size();i++){
-            ProdIODetail sourcePid = sourcePids.get(i);
-            ProdIODetail targetPid = new ProdIODetail();
-            if(sourcePid.getPd_inqty()-sourcePid.getPd_yqty()>0){
-                targetPid.setPd_piid(pi_id);
-                targetPid.setPd_inoutno(piInoutno);
-                targetPid.setPd_piclass("采购验退单");
-                targetPid.setPd_pdno(i);
-                targetPid.setPd_orderid(sourcePid.getPd_orderid());
-                targetPid.setPd_ordercode(sourcePid.getPd_ordercode());
-                targetPid.setPd_orderdetno(sourcePid.getPd_orderdetno());
-                targetPid.setPd_orderprice(sourcePid.getPd_orderprice());
-                targetPid.setPd_prodid(sourcePid.getPd_prodid());
-                targetPid.setPd_prodcode(sourcePid.getPd_prodcode());
-                targetPid.setPd_ioid(sourcePid.getId());
-                //公司id
-                targetPid.setCompanyId(sourcePid.getCompanyId());
-                //本次转单数
-                targetPid.setPd_outqty(sourcePid.getPd_inqty()-sourcePid.getPd_yqty());
-                prodIODetailMapper.insertSelective(targetPid);
-                //更新已转数
-                sourcePid.setPd_yqty(sourcePid.getPd_inqty());
-                prodIODetailMapper.updateByPrimaryKeySelective(sourcePid);
-            }
-        }
-        return Result.success();
-    }
-
     /*private String pushMaxnubmer(String code, Long id) {
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);

+ 14 - 6
frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js

@@ -13,12 +13,11 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
      _statusCodeField: 'pi_statuscode',
      
      _relationColumn: 'pd_piid',
-     _readUrl:'http://localhost:8800/purchase/read/',
-     _saveUrl:'http://localhost:8800/purchase/save',
-     _auditUrl:'http://localhost:8800/purchase/audit',
-     _deleteUrl:'http://localhost:8800/purchase/delete/',
-     _deleteDetailUrl:'http://localhost:8800/purchase/deleteItem/',
-     _turnInUrl:'http://localhost:8800/purchase/turnProdin/',
+     _readUrl:'http://localhost:9000/prodinout/read/',
+     _saveUrl:'http://localhost:9000/prodinout/save',
+     _auditUrl:'http://localhost:9000/prodinout/audit',
+     _deleteUrl:'http://localhost:9000/prodinout/delete/',
+     _deleteDetailUrl:'http://localhost:9000/prodinout/deleteItem/',
      initId:0,
  
      toolBtns: [{
@@ -41,6 +40,15 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
         fieldLabel : "调拨单号", 
         allowBlank : true, 
         columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "pi_class", 
+        bind : "{pi_class}", 
+        fieldLabel : "单据类型", 
+        readOnly:true,
+        allowBlank : true,
+        hidden:true, 
+        columnWidth : 0.25
     },{
         xtype : "datefield", 
         name : "pi_date", 

+ 16 - 0
frontend/saas-web/app/view/stock/otherIn/FormPanel.js

@@ -34,6 +34,22 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
+    },{
+        xtype : "textfield", 
+        name : "pi_inoutno", 
+        bind : "{pi_inoutno}", 
+        fieldLabel : "入库单号", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "pi_class", 
+        bind : "{pi_class}", 
+        fieldLabel : "单据类型", 
+        readOnly:true,
+        allowBlank : true,
+        hidden:true, 
+        columnWidth : 0.25
     },{
         xtype : "hidden", 
         name : "pi_vendid", 

+ 16 - 0
frontend/saas-web/app/view/stock/otherOut/FormPanel.js

@@ -30,6 +30,22 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
+    },{
+        xtype : "textfield", 
+        name : "pi_inoutno", 
+        bind : "{pi_inoutno}", 
+        fieldLabel : "出库单号", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
+        xtype : "textfield", 
+        name : "pi_class", 
+        bind : "{pi_class}", 
+        fieldLabel : "单据类型", 
+        readOnly:true,
+        allowBlank : true,
+        hidden:true, 
+        columnWidth : 0.25
     },{
         xtype : "hidden", 
         name : "pi_vendid",