Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

zhuth 7 years ago
parent
commit
8fd26151bb
18 changed files with 153 additions and 191 deletions
  1. 39 34
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ListReqDTO.java
  2. 29 0
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorListDTO.java
  3. 8 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java
  4. 1 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java
  5. 1 1
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  6. 2 11
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdIODetailMapper.java
  7. 0 12
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/ProdInOutMapper.java
  8. 1 4
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  9. 4 1
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  10. 13 10
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  11. 6 33
      applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml
  12. 2 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/StorageApplication.java
  13. 1 8
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java
  14. 0 3
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/ProdInOutService.java
  15. 0 66
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInoutServiceImpl.java
  16. 14 6
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  17. 16 0
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  18. 16 0
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js

+ 39 - 34
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/dto/ListReqDTO.java

@@ -35,44 +35,49 @@ public class ListReqDTO implements Serializable {
     }
 
     public String getFinalCondition() {
-        JSONArray jsonArray = JSONArray.parseArray(this.condition);
-        if (null != jsonArray && jsonArray.size() > 0) {
-            StringBuffer finalCondition = new StringBuffer();
-            for (int i = 0; i < jsonArray.size(); i++) {
-                String con = null;
-                JSONObject jsonObject = (JSONObject)jsonArray.get(i);
-                Object type = jsonObject.get("type");
-                Object field = jsonObject.get("field");
-                Object operation = jsonObject.get("operation");
-                Object value = jsonObject.get("value");
-                //包含状态时,前台会自动加单引号
-                if (null != value && !"in".equals(operation) && !"not in".equals(operation)) {
-                    value = value.toString().replaceAll("'", "''");
-                }
-                if ("between".equals(operation)) {
-                    String[] vals = value.toString().split(",");
-                    con = " " + field + " " + operation + " '" + vals[0] + "' and '" + vals[1] + "' and";
-                } else if ("startsWith".equals(operation)) {
-                    con = " " + field + "  like '" + value +"%' and";
-                } else if ("endsWith".equals(operation)) {
-                    con = " " + field + " like '%" + value + "' and";
-                } else if ("in".equals(operation) || "not in".equals(operation)) {
-                    con = " " + field + " " + operation + " (" + value + ") and";
-                } else {
-                    //字符串默认是模糊查询
-                    if ("string".equals(type)) {
-                        con = " " + field + " like '%" + value + "%' and";
-                    } else if ("condition".equals(type)) {
-                        //type为condition为前端拼的条件
-                        con = " " + value + " and";
-                    }  else {
-                        con = " " + field + " " + operation + " '" + value + "' and";
+        try {
+            JSONArray jsonArray = JSONArray.parseArray(this.condition);
+            if (null != jsonArray && jsonArray.size() > 0) {
+                StringBuffer finalCondition = new StringBuffer();
+                for (int i = 0; i < jsonArray.size(); i++) {
+                    String con = null;
+                    JSONObject jsonObject = (JSONObject) jsonArray.get(i);
+                    Object type = jsonObject.get("type");
+                    Object field = jsonObject.get("field");
+                    Object operation = jsonObject.get("operation");
+                    Object value = jsonObject.get("value");
+                    //包含状态时,前台会自动加单引号
+                    if (null != value && !"in".equals(operation) && !"not in".equals(operation) &&
+                            !"condition".equals(type)) {
+                        value = value.toString().replaceAll("'", "''");
                     }
+                    if ("between".equals(operation)) {
+                        String[] vals = value.toString().split(",");
+                        con = " " + field + " " + operation + " '" + vals[0] + "' and '" + vals[1] + "' and";
+                    } else if ("startsWith".equals(operation)) {
+                        con = " " + field + "  like '" + value + "%' and";
+                    } else if ("endsWith".equals(operation)) {
+                        con = " " + field + " like '%" + value + "' and";
+                    } else if ("in".equals(operation) || "not in".equals(operation)) {
+                        con = " " + field + " " + operation + " (" + value + ") and";
+                    } else {
+                        //字符串默认是模糊查询
+                        if ("string".equals(type)) {
+                            con = " " + field + " like '%" + value + "%' and";
+                        } else if ("condition".equals(type)) {
+                            //type为condition为前端拼的条件
+                            con = " " + value + " and";
+                        } else {
+                            con = " " + field + " " + operation + " '" + value + "' and";
+                        }
 
+                    }
+                    finalCondition = finalCondition.append(con);
                 }
-                finalCondition = finalCondition.append(con);
+                return finalCondition.substring(0, finalCondition.length() - 3);
             }
-            return finalCondition.substring(0, finalCondition.length() - 3);
+        }catch (Exception e){
+            return null;
         }
         return null;
     }

+ 29 - 0
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/VendorListDTO.java

@@ -0,0 +1,29 @@
+package com.usoftchina.saas.document.dto;
+
+import com.usoftchina.saas.document.entities.Vendor;
+import com.usoftchina.saas.document.entities.Vendorcontact;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class VendorListDTO implements Serializable {
+
+    private Vendor main;
+    private List<Vendorcontact> items;
+
+    public Vendor getMain() {
+        return main;
+    }
+
+    public void setMain(Vendor main) {
+        this.main = main;
+    }
+
+    public List<Vendorcontact> getItems() {
+        return items;
+    }
+
+    public void setItems(List<Vendorcontact> items) {
+        this.items = items;
+    }
+}

+ 8 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java

@@ -6,6 +6,7 @@ import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.document.dto.VendorListDTO;
 import com.usoftchina.saas.document.service.VendorService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,4 +26,11 @@ public class VendorController {
         PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(page, listReqDTO);
         return Result.success(vendorList);
     }
+
+    @GetMapping("/getListById/{id}")
+    public Result<VendorListDTO> getDataById(@PathVariable("id") Long id){
+//        List<> vendorService.getListById(id);
+        return null;
+    }
+
 }

+ 1 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java

@@ -3,10 +3,9 @@ package com.usoftchina.saas.document.mapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 
 
-import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.entities.Vendor;
-import feign.Param;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/VendorMapper.xml

@@ -37,7 +37,7 @@
         <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
     </resultMap>
 
-    <select id="getVendorsByCondition" resultMap="VendorDTOResultMapper" parameterType="com.usoftchina.saas.commons.dto.DocReqDTO">
+    <select id="getVendorsByCondition" resultMap="VendorDTOResultMapper">
         SELECT * FROM VENDOR
         <where>
             <if test="condition!=null">

+ 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>

+ 13 - 10
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -20,7 +20,7 @@
     <result column="sa_recorderid" property="sa_recorderid" jdbcType="INTEGER" />
     <result column="sa_recorder" property="sa_recorder" jdbcType="VARCHAR" />
     <result column="sa_recorddate" property="sa_recorddate" jdbcType="TIMESTAMP" />
-    <result column="companyid" property="companyId" jdbcType="INTEGER" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
     <result column="sa_text1" property="sa_text1" jdbcType="VARCHAR" />
@@ -32,7 +32,7 @@
   <sql id="Base_Column_List" >
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
     sa_remark, sa_status, sa_statuscode, sa_sendstatuscode, sa_sendstatus, sa_printstatus, 
-    sa_printstatuscode, sa_recorderid, sa_recorder, sa_recorddate, companyid, updaterId, 
+    sa_printstatuscode, sa_recorderid, sa_recorder, sa_recorddate, companyId, updaterId, 
     updateTime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
@@ -52,7 +52,7 @@
       sa_status, sa_statuscode, sa_sendstatuscode, 
       sa_sendstatus, sa_printstatus, sa_printstatuscode, 
       sa_recorderid, sa_recorder, sa_recorddate, 
-      companyid, updaterId, updateTime, 
+      companyId, updaterId, updateTime, 
       sa_text1, sa_text2, sa_text3, 
       sa_text4, sa_text5)
     values (#{sa_id,jdbcType=INTEGER}, #{sa_code,jdbcType=VARCHAR}, #{sa_custid,jdbcType=INTEGER}, 
@@ -61,11 +61,14 @@
       #{sa_status,jdbcType=VARCHAR}, #{sa_statuscode,jdbcType=VARCHAR}, #{sa_sendstatuscode,jdbcType=VARCHAR}, 
       #{sa_sendstatus,jdbcType=VARCHAR}, #{sa_printstatus,jdbcType=VARCHAR}, #{sa_printstatuscode,jdbcType=VARCHAR}, 
       #{sa_recorderid,jdbcType=INTEGER}, #{sa_recorder,jdbcType=VARCHAR}, #{sa_recorddate,jdbcType=TIMESTAMP}, 
-      #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
       #{sa_text1,jdbcType=VARCHAR}, #{sa_text2,jdbcType=VARCHAR}, #{sa_text3,jdbcType=VARCHAR}, 
       #{sa_text4,jdbcType=VARCHAR}, #{sa_text5,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
+    <selectKey  resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into sale
     <trim prefix="(" suffix=")" suffixOverrides="," >
       <if test="sa_code != null" >
@@ -119,8 +122,8 @@
       <if test="sa_recorddate != null" >
         sa_recorddate,
       </if>
-      <if test="companyid != null" >
-        companyid,
+      <if test="companyId != null" >
+        companyId,
       </if>
       <if test="updaterId != null" >
         updaterId,
@@ -196,8 +199,8 @@
       <if test="sa_recorddate != null" >
         #{sa_recorddate,jdbcType=TIMESTAMP},
       </if>
-      <if test="companyid != null" >
-        #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
       </if>
       <if test="updaterId != null" >
         #{updaterId,jdbcType=INTEGER},
@@ -277,7 +280,7 @@
         sa_recorddate = #{sa_recorddate,jdbcType=TIMESTAMP},
       </if>
       <if test="companyId != null" >
-        companyid = #{companyId,jdbcType=INTEGER},
+        companyId = #{companyId,jdbcType=INTEGER},
       </if>
       <if test="updaterId != null" >
         updaterId = #{updaterId,jdbcType=INTEGER},
@@ -322,7 +325,7 @@
       sa_recorderid = #{sa_recorderid,jdbcType=INTEGER},
       sa_recorder = #{sa_recorder,jdbcType=VARCHAR},
       sa_recorddate = #{sa_recorddate,jdbcType=TIMESTAMP},
-      companyid = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updateTime = #{updateTime,jdbcType=TIMESTAMP},
       sa_text1 = #{sa_text1,jdbcType=VARCHAR},

+ 6 - 33
applications/sale/sale-server/src/main/resources/mapper/SaledetailMapper.xml

@@ -277,33 +277,6 @@
     </set>
     where sd_id = #{id,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.sale.po.SaleDetail" >
-    update saledetail
-    set sd_said = #{sd_said,jdbcType=INTEGER},
-      sd_detno = #{sd_detno,jdbcType=INTEGER},
-      sd_prodid = #{sd_prodid,jdbcType=INTEGER},
-      sd_prodcode = #{sd_prodcode,jdbcType=VARCHAR},
-      sd_qty = #{sd_qty,jdbcType=DOUBLE},
-      sd_price = #{sd_price,jdbcType=DOUBLE},
-      sd_total = #{sd_total,jdbcType=DOUBLE},
-      sd_taxrate = #{sd_taxrate,jdbcType=DOUBLE},
-      sd_netprice = #{sd_netprice,jdbcType=DOUBLE},
-      sd_nettotal = #{sd_nettotal,jdbcType=DOUBLE},
-      sd_delivery = #{sd_delivery,jdbcType=TIMESTAMP},
-      sd_sendqty = #{sd_sendqty,jdbcType=DOUBLE},
-      sd_pdqty = #{sd_pdqty,jdbcType=DOUBLE},
-      sd_remark = #{sd_remark,jdbcType=VARCHAR},
-      companyId = #{companyId,jdbcType=INTEGER},
-      updaterId = #{updaterId,jdbcType=INTEGER},
-      updateTime = #{updateTime,jdbcType=TIMESTAMP},
-      sd_text1 = #{sd_text1,jdbcType=VARCHAR},
-      sd_text2 = #{sd_text2,jdbcType=VARCHAR},
-      sd_text3 = #{sd_text3,jdbcType=VARCHAR},
-      sd_text4 = #{sd_text4,jdbcType=VARCHAR},
-      sd_text5 = #{sd_text5,jdbcType=VARCHAR}
-    where sd_id = #{id,jdbcType=INTEGER}
-  </update>
-
   <insert id="batchInsert" parameterType="java.util.List" >
     insert into saledetail (sd_said, sd_detno,
     sd_prodid, sd_prodcode, sd_qty,
@@ -316,24 +289,24 @@
     values
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
-      (#{item.sd_said,jdbcType=INTEGER}, #{item.sd_detno,jdbcType=INTEGER},
+      #{item.sd_said,jdbcType=INTEGER}, #{item.sd_detno,jdbcType=INTEGER},
       #{item.sd_prodid,jdbcType=INTEGER}, #{item.sd_prodcode,jdbcType=VARCHAR}, #{item.sd_qty,jdbcType=DOUBLE},
       #{item.sd_price,jdbcType=DOUBLE}, #{item.sd_total,jdbcType=DOUBLE}, #{item.sd_taxrate,jdbcType=DOUBLE},
       #{item.sd_netprice,jdbcType=DOUBLE}, #{item.sd_nettotal,jdbcType=DOUBLE}, #{item.sd_delivery,jdbcType=TIMESTAMP},
       #{item.sd_sendqty,jdbcType=DOUBLE}, #{item.sd_pdqty,jdbcType=DOUBLE}, #{item.sd_remark,jdbcType=VARCHAR},
       #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER}, #{item.updateTime,jdbcType=TIMESTAMP},
       #{item.sd_text1,jdbcType=VARCHAR}, #{item.sd_text2,jdbcType=VARCHAR}, #{item.sd_text3,jdbcType=VARCHAR},
-      #{item.sd_text4,jdbcType=VARCHAR}, #{item.sd_text5,jdbcType=VARCHAR})
+      #{item.sd_text4,jdbcType=VARCHAR}, #{item.sd_text5,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>
   <update id="batchUpdate" parameterType="com.usoftchina.saas.sale.po.SaleDetail" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
       update saledetail <set>
-      set sd_said = #{item.sd_said,jdbcType=INTEGER},
-      sd_detno = #{item.sd_detno,jdbcType=INTEGER},
-      sd_prodid = #{item.sd_prodid,jdbcType=INTEGER},
-      sd_prodcode = #{item.sd_prodcode,jdbcType=VARCHAR},
+       sd_said = #{item.sd_said},
+      sd_detno = #{item.sd_detno},
+      sd_prodid = #{item.sd_prodid},
+      sd_prodcode = #{item.sd_prodcode},
       sd_qty = #{item.sd_qty,jdbcType=DOUBLE},
       sd_price = #{item.sd_price,jdbcType=DOUBLE},
       sd_total = #{item.sd_total,jdbcType=DOUBLE},

+ 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",