Explorar o código

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

hy %!s(int64=7) %!d(string=hai) anos
pai
achega
d1c5411d1e
Modificáronse 41 ficheiros con 1071 adicións e 420 borrados
  1. 78 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Address.java
  2. 38 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java
  3. 24 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java
  4. 11 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/AddressService.java
  5. 50 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  6. 182 0
      applications/document/document-server/src/main/resources/mapper/AddressMapper.xml
  7. 1 108
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  8. 65 0
      applications/money/money-server/pom.xml
  9. 20 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/MoneyApplicatiion.java
  10. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/BanksubledgerController.java
  11. 4 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java
  12. 1 1
      applications/money/money-server/src/main/resources/application.yml
  13. 2 1
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdIODetailDTO.java
  14. 1 0
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdInOutDTO.java
  15. 1 1
      applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdInOutListDTO.java
  16. 5 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  17. 2 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  18. 1 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchasedetailMapper.java
  19. 1 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdIODetail.java
  20. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOut.java
  21. 3 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOutList.java
  22. 63 39
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  23. 10 8
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  24. 39 23
      applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml
  25. 9 0
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml
  26. 37 8
      applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml
  27. 44 44
      applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml
  28. 26 24
      frontend/saas-web/app/util/FormUtil.js
  29. 1 1
      frontend/saas-web/app/view/core/form/FormPanel.js
  30. 13 2
      frontend/saas-web/app/view/core/form/FormPanelController.js
  31. 9 1
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  32. 131 64
      frontend/saas-web/app/view/main/Navigation.js
  33. 78 64
      frontend/saas-web/app/view/main/Navigation.scss
  34. 21 1
      frontend/saas-web/app/view/purchase/purchase/FormController.js
  35. 21 10
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  36. 2 1
      frontend/saas-web/app/view/purchase/purchase/QueryPanel.js
  37. 20 1
      frontend/saas-web/app/view/purchase/purchaseIn/FormController.js
  38. 28 5
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  39. 5 0
      frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js
  40. 14 8
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  41. 6 1
      frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

+ 78 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Address.java

@@ -0,0 +1,78 @@
+package com.usoftchina.saas.document.entities;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Address extends CommonBaseEntity implements Serializable {
+    private Date ad_recorddate;
+
+    private String ad_text1;
+
+    private String ad_text2;
+
+    private String ad_text3;
+
+    private String ad_text4;
+
+    private String ad_text5;
+
+    private String ad_address;
+
+    public Date getAd_recorddate() {
+        return ad_recorddate;
+    }
+
+    public void setAd_recorddate(Date ad_recorddate) {
+        this.ad_recorddate = ad_recorddate;
+    }
+
+    public String getAd_text1() {
+        return ad_text1;
+    }
+
+    public void setAd_text1(String ad_text1) {
+        this.ad_text1 = ad_text1 == null ? null : ad_text1.trim();
+    }
+
+    public String getAd_text2() {
+        return ad_text2;
+    }
+
+    public void setAd_text2(String ad_text2) {
+        this.ad_text2 = ad_text2 == null ? null : ad_text2.trim();
+    }
+
+    public String getAd_text3() {
+        return ad_text3;
+    }
+
+    public void setAd_text3(String ad_text3) {
+        this.ad_text3 = ad_text3 == null ? null : ad_text3.trim();
+    }
+
+    public String getAd_text4() {
+        return ad_text4;
+    }
+
+    public void setAd_text4(String ad_text4) {
+        this.ad_text4 = ad_text4 == null ? null : ad_text4.trim();
+    }
+
+    public String getAd_text5() {
+        return ad_text5;
+    }
+
+    public void setAd_text5(String ad_text5) {
+        this.ad_text5 = ad_text5 == null ? null : ad_text5.trim();
+    }
+
+    public String getAd_address() {
+        return ad_address;
+    }
+
+    public void setAd_address(String ad_address) {
+        this.ad_address = ad_address == null ? null : ad_address.trim();
+    }
+}

+ 38 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java

@@ -0,0 +1,38 @@
+package com.usoftchina.saas.document.controller;
+
+
+import com.sun.org.apache.regexp.internal.RE;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.document.entities.Address;
+import com.usoftchina.saas.document.service.AddressService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/address")
+public class AddressController {
+
+    @Autowired
+    private AddressService addressService;
+
+    @PostMapping("/save")
+    public Result save(Address address){
+        addressService.save(address);
+        return Result.success();
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result deleteById(Long id){
+        addressService.removeByPrimaryKey(id);
+        return Result.success();
+    }
+
+    @PostMapping("/batchDelete")
+    public Result deleteByIds(String ids){
+        addressService.removeByIds(ids);
+        return Result.success();
+    }
+
+}

+ 24 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java

@@ -0,0 +1,24 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.document.entities.Address;
+import java.util.List;
+
+public interface AddressMapper extends CommonBaseMapper<Address> {
+
+    int deleteByPrimaryKey(Long ad_id);
+
+    int insert(Address record);
+
+    int insertSelective(Address record);
+
+    Address selectByPrimaryKey(Long ad_id);
+
+    int updateByPrimaryKeySelective(Address record);
+
+    int updateByPrimaryKeyWithBLOBs(Address record);
+
+    int updateByPrimaryKey(Address record);
+
+    int deleteByIds(String ids);
+}

+ 11 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/AddressService.java

@@ -0,0 +1,11 @@
+package com.usoftchina.saas.document.service;
+
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.document.entities.Address;
+import com.usoftchina.saas.document.mapper.AddressMapper;
+
+public interface AddressService extends CommonBaseService<AddressMapper, Address>  {
+
+    void removeByIds(String ids);
+
+}

+ 50 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java

@@ -0,0 +1,50 @@
+package com.usoftchina.saas.document.service.impl;
+
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.document.entities.Address;
+import com.usoftchina.saas.document.mapper.AddressMapper;
+import com.usoftchina.saas.document.service.AddressService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Address> implements AddressService {
+
+    @Autowired
+    private AddressMapper addressMapper;
+
+    /**
+     * 保存
+     * @param address
+     * @return
+     */
+    @Override
+    public boolean save(Address address){
+        addressMapper.insertSelective(address);
+        return true;
+    }
+
+    /**
+     * 通过主键删除
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean removeByPrimaryKey(Long id){
+        if(id != null && id > 0){
+            addressMapper.deleteByPrimaryKey(id);
+        }
+        return true;
+    }
+
+    /**
+     * 批量删除
+     * @param ids
+     */
+    @Override
+    public void removeByIds(String ids) {
+        if(ids != null && ids.length() > 0){
+            addressMapper.deleteByIds(ids);
+        }
+    }
+}

+ 182 - 0
applications/document/document-server/src/main/resources/mapper/AddressMapper.xml

@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usoftchina.saas.document.mapper.AddressMapper">
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Address">
+    <id column="ad_id" jdbcType="INTEGER" property="ad_id" />
+    <result column="ad_recorddate" jdbcType="TIMESTAMP" property="ad_recorddate" />
+    <result column="companyId" jdbcType="INTEGER" property="companyId" />
+    <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
+    <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="ad_text1" jdbcType="VARCHAR" property="ad_text1" />
+    <result column="ad_text2" jdbcType="VARCHAR" property="ad_text2" />
+    <result column="ad_text3" jdbcType="VARCHAR" property="ad_text3" />
+    <result column="ad_text4" jdbcType="VARCHAR" property="ad_text4" />
+    <result column="ad_text5" jdbcType="VARCHAR" property="ad_text5" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Address">
+    <result column="ad_address" jdbcType="LONGVARCHAR" property="ad_address" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    ad_id, ad_recorddate, companyId, updaterId, updateTime, ad_text1, ad_text2, ad_text3, 
+    ad_text4, ad_text5
+  </sql>
+  <sql id="Blob_Column_List">
+    ad_address
+  </sql>
+
+  <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Address">
+    insert into address (ad_id, ad_recorddate, companyId, 
+      updaterId, updateTime, ad_text1, 
+      ad_text2, ad_text3, ad_text4, 
+      ad_text5, ad_address)
+    values (#{ad_id,jdbcType=INTEGER}, #{ad_recorddate,jdbcType=TIMESTAMP}, #{companyId,jdbcType=INTEGER}, 
+      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{ad_text1,jdbcType=VARCHAR}, 
+      #{ad_text2,jdbcType=VARCHAR}, #{ad_text3,jdbcType=VARCHAR}, #{ad_text4,jdbcType=VARCHAR}, 
+      #{ad_text5,jdbcType=VARCHAR}, #{ad_address,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Address">
+    insert into address
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="ad_id != null">
+        ad_id,
+      </if>
+      <if test="ad_recorddate != null">
+        ad_recorddate,
+      </if>
+      <if test="companyId != null">
+        companyId,
+      </if>
+      <if test="updaterId != null">
+        updaterId,
+      </if>
+      <if test="updateTime != null">
+        updateTime,
+      </if>
+      <if test="ad_text1 != null">
+        ad_text1,
+      </if>
+      <if test="ad_text2 != null">
+        ad_text2,
+      </if>
+      <if test="ad_text3 != null">
+        ad_text3,
+      </if>
+      <if test="ad_text4 != null">
+        ad_text4,
+      </if>
+      <if test="ad_text5 != null">
+        ad_text5,
+      </if>
+      <if test="ad_address != null">
+        ad_address,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="ad_id != null">
+        #{ad_id,jdbcType=INTEGER},
+      </if>
+      <if test="ad_recorddate != null">
+        #{ad_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyId != null">
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null">
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ad_text1 != null">
+        #{ad_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text2 != null">
+        #{ad_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text3 != null">
+        #{ad_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text4 != null">
+        #{ad_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text5 != null">
+        #{ad_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_address != null">
+        #{ad_address,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Address">
+    update address
+    <set>
+      <if test="ad_recorddate != null">
+        ad_recorddate = #{ad_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyId != null">
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null">
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null">
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ad_text1 != null">
+        ad_text1 = #{ad_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text2 != null">
+        ad_text2 = #{ad_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text3 != null">
+        ad_text3 = #{ad_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text4 != null">
+        ad_text4 = #{ad_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text5 != null">
+        ad_text5 = #{ad_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_address != null">
+        ad_address = #{ad_address,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where ad_id = #{ad_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.entities.Address">
+    update address
+    set ad_recorddate = #{ad_recorddate,jdbcType=TIMESTAMP},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      ad_text1 = #{ad_text1,jdbcType=VARCHAR},
+      ad_text2 = #{ad_text2,jdbcType=VARCHAR},
+      ad_text3 = #{ad_text3,jdbcType=VARCHAR},
+      ad_text4 = #{ad_text4,jdbcType=VARCHAR},
+      ad_text5 = #{ad_text5,jdbcType=VARCHAR},
+      ad_address = #{ad_address,jdbcType=LONGVARCHAR}
+    where ad_id = #{ad_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Address">
+    update address
+    set ad_recorddate = #{ad_recorddate,jdbcType=TIMESTAMP},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      ad_text1 = #{ad_text1,jdbcType=VARCHAR},
+      ad_text2 = #{ad_text2,jdbcType=VARCHAR},
+      ad_text3 = #{ad_text3,jdbcType=VARCHAR},
+      ad_text4 = #{ad_text4,jdbcType=VARCHAR},
+      ad_text5 = #{ad_text5,jdbcType=VARCHAR}
+    where ad_id = #{ad_id,jdbcType=INTEGER}
+  </update>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from address
+    where ad_id = #{ad_id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByIds" parameterType="java.lang.String">
+    delete from address
+    where ad_id in (#{ids,jdbcType=VARCHAR})
+  </delete>
+
+</mapper>

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

@@ -98,20 +98,6 @@
         wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
         wh_text4, wh_text5
     </sql>
-    <select id="selectByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultMap="BaseResultMap">
-        select
-        <if test="distinct">
-            distinct
-        </if>
-        <include refid="Base_Column_List" />
-        from warehouse
-        <if test="_parameter != null">
-            <include refid="Example_Where_Clause" />
-        </if>
-        <if test="orderByClause != null">
-            order by ${orderByClause}
-        </if>
-    </select>
     <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List" />
@@ -122,12 +108,7 @@
         delete from warehouse
         where wh_id = #{wh_id,jdbcType=INTEGER}
     </delete>
-    <delete id="deleteByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample">
-        delete from warehouse
-        <if test="_parameter != null">
-            <include refid="Example_Where_Clause" />
-        </if>
-    </delete>
+
     <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Warehouse">
         insert into warehouse (wh_id, wh_code, wh_type,
         wh_description, wh_statuscode, wh_status,
@@ -251,94 +232,6 @@
             </if>
         </trim>
     </insert>
-    <select id="countByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultType="java.lang.Integer">
-        select count(*) from warehouse
-        <if test="_parameter != null">
-            <include refid="Example_Where_Clause" />
-        </if>
-    </select>
-    <update id="updateByExampleSelective" parameterType="map">
-        update warehouse
-        <set>
-            <if test="record.wh_id != null">
-                wh_id = #{record.wh_id,jdbcType=INTEGER},
-            </if>
-            <if test="record.wh_code != null">
-                wh_code = #{record.wh_code,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_type != null">
-                wh_type = #{record.wh_type,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_description != null">
-                wh_description = #{record.wh_description,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_statuscode != null">
-                wh_statuscode = #{record.wh_statuscode,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_status != null">
-                wh_status = #{record.wh_status,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_recorderid != null">
-                wh_recorderid = #{record.wh_recorderid,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_recorder != null">
-                wh_recorder = #{record.wh_recorder,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_date != null">
-                wh_date = #{record.wh_date,jdbcType=TIMESTAMP},
-            </if>
-            <if test="record.companyid != null">
-                companyid = #{record.companyid,jdbcType=INTEGER},
-            </if>
-            <if test="record.updaterId != null">
-                updaterId = #{record.updaterId,jdbcType=INTEGER},
-            </if>
-            <if test="record.updatetime != null">
-                updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="record.wh_text1 != null">
-                wh_text1 = #{record.wh_text1,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_text2 != null">
-                wh_text2 = #{record.wh_text2,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_text3 != null">
-                wh_text3 = #{record.wh_text3,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_text4 != null">
-                wh_text4 = #{record.wh_text4,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_text5 != null">
-                wh_text5 = #{record.wh_text5,jdbcType=VARCHAR},
-            </if>
-        </set>
-        <if test="_parameter != null">
-            <include refid="Update_By_Example_Where_Clause" />
-        </if>
-    </update>
-    <update id="updateByExample" parameterType="map">
-        update warehouse
-        set wh_id = #{record.wh_id,jdbcType=INTEGER},
-        wh_code = #{record.wh_code,jdbcType=VARCHAR},
-        wh_type = #{record.wh_type,jdbcType=VARCHAR},
-        wh_description = #{record.wh_description,jdbcType=VARCHAR},
-        wh_statuscode = #{record.wh_statuscode,jdbcType=VARCHAR},
-        wh_status = #{record.wh_status,jdbcType=VARCHAR},
-        wh_recorderid = #{record.wh_recorderid,jdbcType=VARCHAR},
-        wh_recorder = #{record.wh_recorder,jdbcType=VARCHAR},
-        wh_date = #{record.wh_date,jdbcType=TIMESTAMP},
-        companyid = #{record.companyid,jdbcType=INTEGER},
-        updaterId = #{record.updaterId,jdbcType=INTEGER},
-        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
-        wh_text1 = #{record.wh_text1,jdbcType=VARCHAR},
-        wh_text2 = #{record.wh_text2,jdbcType=VARCHAR},
-        wh_text3 = #{record.wh_text3,jdbcType=VARCHAR},
-        wh_text4 = #{record.wh_text4,jdbcType=VARCHAR},
-        wh_text5 = #{record.wh_text5,jdbcType=VARCHAR}
-        <if test="_parameter != null">
-            <include refid="Update_By_Example_Where_Clause" />
-        </if>
-    </update>
     <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
         update warehouse
         <set>

+ 65 - 0
applications/money/money-server/pom.xml

@@ -10,6 +10,71 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>money-server</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>auth-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>server-starter</artifactId>
+        </dependency>
 
+        <!--test-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+        </dependency>
+
+        <!-- db -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+        </dependency>
+        <!-- sleuth -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-zipkin</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.amqp</groupId>
+            <artifactId>spring-rabbit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>net.logstash.logback</groupId>
+            <artifactId>logstash-logback-encoder</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+        <!-- feign -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
 
 </project>

+ 20 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/MoneyApplicatiion.java

@@ -0,0 +1,20 @@
+package com.usoftchina.saas.money;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+/**
+ * @author: guq
+ * @create: 2018-10-20 11:29
+ **/
+@SpringBootApplication
+@EnableEurekaClient
+@EnableTransactionManagement
+@MapperScan("com.usoftchina.saas.money.mapper")
+public class MoneyApplicatiion {
+    public static void main(String[] args) {
+
+    }
+}

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/BanksubledgerController.java

@@ -1,7 +1,9 @@
 package com.usoftchina.saas.money.controller;
 
+
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+
 /**
  * @author hx
  * @createtime 2018-10-19 14:23

+ 4 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java

@@ -1,7 +1,11 @@
 package com.usoftchina.saas.money.mapper;
 
 
+import com.usoftchina.saas.money.po.Banksubledger;
 import com.usoftchina.saas.money.po.BanksubledgerExample;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @author hx

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

@@ -45,7 +45,7 @@ eureka:
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8500/eureka/
 server:
-  port: 8900
+  port: 8920
   tomcat:
     uri-encoding: UTF-8
 info:

+ 2 - 1
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdIODetailDTO.java

@@ -78,8 +78,9 @@ public class ProdIODetailDTO extends CommonBaseEntity implements Serializable {
 
     private Integer pd_ym;
 
-    private Double pd_yqty;
+    private Integer pd_yqty;
 
     private String pd_remark;
 
+    private Long pd_ioid;
 }

+ 1 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdInOutDTO.java

@@ -69,6 +69,7 @@ public class ProdInOutDTO extends CommonBaseEntity implements Serializable {
 
     private String pi_address;
 
+    private Long pi_inid;
 
 
 }

+ 1 - 1
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdInOutListDTO.java

@@ -133,7 +133,7 @@ public class ProdInOutListDTO extends CommonBaseEntity implements Serializable {
 
     private Integer pd_ym;
 
-    private Double pd_yqty;
+    private Integer pd_yqty;
 
     private String pd_remark;
 

+ 5 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java

@@ -147,7 +147,11 @@ public class ProdInOutController {
         return Result.success();
     }
 
-
+    @GetMapping("/turnProdOut/{id}")
+    public Result turnProdin(@PathVariable("id") Long id){
+        prodInOutService.turnProdOut(id);
+        return Result.success();
+    };
 
 
 

+ 2 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -159,8 +159,8 @@ public class PurchaseController {
         return Result.success();
     }
 
-    @GetMapping("/turnProdin")
-    public Result turnProdin(Long id){
+    @GetMapping("/turnProdin/{id}")
+    public Result turnProdin(@PathVariable("id") Long id){
         purchaseService.turnProdin(id);
         return Result.success();
     };

+ 1 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchasedetailMapper.java

@@ -27,7 +27,7 @@ public interface PurchasedetailMapper extends CommonBaseMapper<Purchase> {
 
     List<PurchaseDetail> selectByFK(Long fk_i);
 
-    void updatePurchaseYqty(Long id);
+    void updatePurchaseYqty(Integer pu_id);
 
 
 }

+ 1 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdIODetail.java

@@ -77,5 +77,6 @@ public class ProdIODetail extends CommonBaseEntity implements Serializable {
 
     private String pd_remark;
 
+    private Long pd_ioid;
 
 }

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOut.java

@@ -62,4 +62,6 @@ public class ProdInOut extends CommonBaseEntity implements Serializable {
 
     private String pi_address;
 
+    private Long pi_inid;
+
 }

+ 3 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOutList.java

@@ -66,6 +66,8 @@ public class ProdInOutList extends CommonBaseEntity{
 
     private String pi_address;
 
+    private Long pi_inid;
+
     private Long pd_piid;
 
     private String pd_inoutno;
@@ -136,5 +138,6 @@ public class ProdInOutList extends CommonBaseEntity{
 
     private String pd_remark;
 
+    private Long pd_ioid;
 
 }

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

@@ -4,9 +4,12 @@ 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;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocSavedDTO;
+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;
@@ -43,6 +46,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     @Autowired
     private WarehouseApi warehouseApi;
 
+    @Autowired
+    private MaxnumberService maxnumberService;
+
 
 
     @Override
@@ -99,6 +105,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (null == formdata || null == formdata.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
         }
+        //公司ID
+        Long companyId = BaseContextHolder.getCompanyId();
+        //人员Id
+        Long userId = BaseContextHolder.getUserId();
         //获取主表信息
         ProdInOutDTO main = formdata.getMain();
         List<ProdIODetailDTO> items = formdata.getItems();
@@ -110,61 +120,60 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         Long pi_id = main.getId();
         String pi_inoutno = main.getPi_inoutno();
         ProdInOut prodInOut = BeanMapper.map(main,ProdInOut.class);
-
+        prodInOut.setCompanyId(companyId);
+        prodInOut.setCreatorId(userId);
+        prodInOut.setCreateTime(new Date());
         //编号获取
-        if (StringUtils.isEmpty(pi_inoutno)) {
-            pi_inoutno = "PI" + Math.random() * 1000;
-            prodInOut.setPi_inoutno(pi_inoutno);
-        }
+        pi_inoutno = pushMaxnubmer(pi_inoutno, pi_id);
+        prodInOut.setPi_inoutno(pi_inoutno);
         saveDTO.setCode(pi_inoutno);
         //判断更新与保存动作
-        if (!StringUtils.isEmpty(pi_id)){
-            //更新主表
-            getMapper().updateByPrimaryKey(prodInOut);
+        if (StringUtils.isEmpty(pi_id) || "0".equals(pi_id.toString())){
+            //插入操作
+            getMapper().insertSelective(prodInOut);
+            pi_id = prodInOut.getId();
             //添加从表传输对象
             for (ProdIODetailDTO item : items) {
                 ProdIODetail detail = BeanMapper.map(item,ProdIODetail.class);
                 detail.setPd_piid(pi_id);
                 detail.setPd_inoutno(pi_inoutno);
-                if (!StringUtils.isEmpty(detail.getId())) {
-                    updateDetails.add(detail);
-                } else {
-                    insertDetails.add(detail);
-                }
+                detail.setPd_piclass(prodInOut.getPi_class());
+                detail.setPd_yqty(0);
+                insertDetails.add(detail);
             }
             //插入从表
             if (insertDetails.size()>0) {
                 prodIODetailMapper.batchInsert(insertDetails);
             }
-            //更新从表
-            if (updateDetails.size()>0) {
-                prodIODetailMapper.batchUpdate(updateDetails);
-            }
             saveDTO.setId(pi_id);
             return saveDTO;
         }
-
-        //插入操作
-        getMapper().insertSelective(prodInOut);
-        pi_id = prodInOut.getId();
+        //更新操作
+        getMapper().updateByPrimaryKeySelective(prodInOut);
         //添加从表传输对象
         for (ProdIODetailDTO item : items) {
             ProdIODetail detail = BeanMapper.map(item, ProdIODetail.class);
             detail.setPd_piid(pi_id);
             detail.setPd_inoutno(pi_inoutno);
-            insertDetails.add(detail);
+            detail.setPd_piclass(prodInOut.getPi_class());
+            if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
+                insertDetails.add(detail);
+            } else {
+                updateDetails.add(detail);
+            }
         }
         //插入从表
         if (insertDetails.size()>0) {
-
             prodIODetailMapper.batchInsert(insertDetails);
         }
+        //更新从表
+        if (updateDetails.size()>0) {
+            prodIODetailMapper.batchUpdate(updateDetails);
+        }
         saveDTO.setId(pi_id);
-
         //更新已转数
         if (!isbfaudit)
-            updateYqty(pi_id,prodInOut.getPi_class());
-
+            updateYqty(prodInOut);
         return saveDTO;
     }
 
@@ -186,7 +195,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             cta.andPd_piidEqualTo(prodInOut.getId().intValue());
             prodIODetailMapper.deleteByExample(prodIODetailExample);
             //更新已转数
-            updateYqty(id,prodInOut.getPi_class());
+//            updateYqty(prodInOut.getPi_puid(),prodInOut.getPi_class());
+            updateYqty(prodInOut);
+
        }
     }
 
@@ -245,10 +256,11 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
 
     @Override
     public void deleteItem(Long id) {
-        ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
-        prodIODetailMapper.deleteByPrimaryKey(prodInOut.getId());
+        ProdIODetail prodIODetail = prodIODetailMapper.selectByPrimaryKey(id);
+        prodIODetailMapper.deleteByPrimaryKey(id);
+        ProdInOut prodInOut = getMapper().selectByPrimaryKey(prodIODetail.getPd_piid());
         //更新已转数
-        updateYqty(prodInOut.getId(),prodInOut.getPi_class());
+        updateYqty(prodInOut);
     }
 
     @Override
@@ -261,15 +273,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         }
     }
 
-    private void updateYqty(Long id,String piclass) {
-        //更新已转数
-        prodIODetailMapper.updatePurchaseYqty(id);
-        //更新采购单入库状态
-//        purchaseMapper.updateAcceptstatus(id);
-        if ("采购验收单".equals(piclass)){
-            purchasedetailMapper.updatePurchaseYqty(id);
-        }else if ("采购验退单".equals(piclass)){
+    private void updateYqty(ProdInOut prodInOut) {
 
+        //更新已转数
+        if ("采购验收单".equals(prodInOut.getPi_class())){
+            purchasedetailMapper.updatePurchaseYqty(prodInOut.getPi_puid());
+        }else if ("采购验退单".equals(prodInOut.getPi_class())){
+            prodIODetailMapper.updatePurchaseYqty(prodInOut.getPi_inid());
         }
 
 
@@ -305,17 +315,20 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         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.getId().intValue());
         targetPi.setPi_pucode(sourcePi.getPi_pucode());
+        targetPi.setPi_inid(sourcePi.getId());
+
         //设置公司id
         targetPi.setCompanyId(sourcePi.getCompanyId());
         //保存数据
         getMapper().insertSelective(targetPi);
         //插入验退单从表
-        long pi_id = sourcePi.getId();
+        long pi_id = targetPi.getId();
 
          for (int i = 0;i<sourcePids.size();i++){
              ProdIODetail sourcePid = sourcePids.get(i);
@@ -330,6 +343,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
              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());
 
@@ -347,4 +361,14 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         return Result.success();
     }
 
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        Integer count = "0".equals(String.valueOf(id)) ? purchaseMapper.validateCodeWhenInsert(code) :
+                purchaseMapper.validateCodeWhenUpdate(code, id);
+        return maxnumberService.pushMaxnubmer(count, code, "Purchase");
+    }
+
+
 }

+ 10 - 8
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -2,26 +2,25 @@ package com.usoftchina.saas.purchase.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;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
-import com.usoftchina.saas.document.api.ProductApi;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.purchase.dto.*;
+import com.usoftchina.saas.purchase.dto.PurchaseDTO;
+import com.usoftchina.saas.purchase.dto.PurchaseDetailDTO;
+import com.usoftchina.saas.purchase.dto.PurchaseFormDTO;
+import com.usoftchina.saas.purchase.dto.PurchaseReqDTO;
 import com.usoftchina.saas.purchase.mapper.*;
 import com.usoftchina.saas.purchase.po.*;
 import com.usoftchina.saas.purchase.service.PurchaseService;
 import com.usoftchina.saas.utils.BeanMapper;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -122,6 +121,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 PurchaseDetail detail = BeanMapper.map(item, PurchaseDetail.class);
                 detail.setPd_puid(pu_id);
                 detail.setPd_code(pu_code);
+                detail.setPd_yqty(new Double(0));
                 insertDetails.add(detail);
             }
             //插入从表
@@ -289,7 +289,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //检查转单状态
         String acceptstatus = purchase.getPu_acceptstatuscode();
 
-        if (acceptstatus.equals("TURNIN")){
+        if ("TURNIN".equals(acceptstatus)){
             return Result.error(ExceptionCode.TURNIN_EXIST);
         }
 
@@ -310,11 +310,13 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //插入验收单主表
         ProdInOut prodInOut = new ProdInOut();
         //生成单号
-        String piInoutno ="test0001";
+        String piInoutno ="YS0001";
 
         prodInOut.setPi_inoutno(piInoutno);
         prodInOut.setPi_class("采购验收单");
-//        prodInOut.setPiDate(new Date());
+        prodInOut.setPi_date(new Date());
+        prodInOut.setPi_status("未审核");
+        prodInOut.setPi_statuscode("UNAUDITED");
         prodInOut.setPi_recorddate(new Date());
         prodInOut.setPi_vendid(purchase.getPu_vendid());
         prodInOut.setPi_vendcode(purchase.getPu_vendcode());

+ 39 - 23
applications/purchase/purchase-server/src/main/resources/mapper/ProdIODetailMapper.xml

@@ -40,6 +40,7 @@
     <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
     <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
     <result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
+    <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.purchase.po.ProdIODetail">
     <result column="pd_remark" jdbcType="LONGVARCHAR" property="pd_remark" />
@@ -107,7 +108,7 @@
     pd_prodcode, pd_unit, pd_inqty, pd_outqty, pd_orderprice, pd_sendprice, pd_price, 
     pd_total, pd_taxrate, pd_netprice, pd_nettotal, pd_whid, pd_whcode, pd_whname, pd_inwhid, 
     pd_inwhcode, pd_inwhname, pd_orderid, pd_sdid, pd_status, companyid, updaterid, updatetime, 
-    pd_text1, pd_text2, pd_text3, pd_text4, pd_text5, pd_ym, pd_yqty
+    pd_text1, pd_text2, pd_text3, pd_text4, pd_text5, pd_ym, pd_yqty,pd_ioid
   </sql>
   <sql id="Blob_Column_List">
     pd_remark
@@ -173,7 +174,7 @@
       pd_status, companyid, updaterid, 
       updatetime, pd_text1, pd_text2, 
       pd_text3, pd_text4, pd_text5, 
-      pd_ym, pd_yqty, pd_remark
+      pd_ym, pd_yqty, pd_remark,pd_ioid
       )
     values (#{pd_id,jdbcType=INTEGER}, #{pd_piid,jdbcType=INTEGER}, #{pd_inoutno,jdbcType=VARCHAR}, 
       #{pd_piclass,jdbcType=VARCHAR}, #{pd_pdno,jdbcType=INTEGER}, #{pd_ordercode,jdbcType=VARCHAR}, 
@@ -187,7 +188,8 @@
       #{pd_status,jdbcType=INTEGER}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
       #{updatetime,jdbcType=TIMESTAMP}, #{pd_text1,jdbcType=VARCHAR}, #{pd_text2,jdbcType=VARCHAR}, 
       #{pd_text3,jdbcType=VARCHAR}, #{pd_text4,jdbcType=VARCHAR}, #{pd_text5,jdbcType=VARCHAR}, 
-      #{pd_ym,jdbcType=INTEGER}, #{pd_yqty,jdbcType=INTEGER}, #{pd_remark,jdbcType=LONGVARCHAR}
+      #{pd_ym,jdbcType=INTEGER}, #{pd_yqty,jdbcType=INTEGER}, #{pd_remark,jdbcType=LONGVARCHAR},
+      #{pd_ioid,jdbcType=INTEGER}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail">
@@ -311,6 +313,11 @@
       <if test="pd_remark != null">
         pd_remark,
       </if>
+      <if test="pd_ioid != null">
+        pd_ioid,
+      </if>
+
+
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -428,6 +435,9 @@
       <if test="pd_remark != null">
         #{pd_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pd_ioid != null">
+        #{pd_ioid,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.usoftchina.saas.purchase.po.ProdIODetailExample" resultType="java.lang.Long">
@@ -556,6 +566,10 @@
       <if test="record.pd_remark != null">
         pd_remark = #{record.pd_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="record.pd_ioid != null">
+        pd_ioid = #{record.pd_ioid,jdbcType=INTEGER},
+      </if>
+
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -601,7 +615,8 @@
       pd_text5 = #{record.pd_text5,jdbcType=VARCHAR},
       pd_ym = #{record.pd_ym,jdbcType=INTEGER},
       pd_yqty = #{record.pd_yqty,jdbcType=INTEGER},
-      pd_remark = #{record.pd_remark,jdbcType=LONGVARCHAR}
+      pd_remark = #{record.pd_remark,jdbcType=LONGVARCHAR},
+      pd_ioid = #{record.pd_ioid,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -645,7 +660,8 @@
       pd_text4 = #{record.pd_text4,jdbcType=VARCHAR},
       pd_text5 = #{record.pd_text5,jdbcType=VARCHAR},
       pd_ym = #{record.pd_ym,jdbcType=INTEGER},
-      pd_yqty = #{record.pd_yqty,jdbcType=INTEGER}
+      pd_yqty = #{record.pd_yqty,jdbcType=INTEGER},
+      pd_ioid = #{record.pd_ioid,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -734,14 +750,14 @@
       <if test="pd_status != null">
         pd_status = #{pd_status,jdbcType=INTEGER},
       </if>
-      <if test="companyid != null">
-        companyid = #{companyid,jdbcType=INTEGER},
+      <if test="companyId != null">
+        companyid = #{companyId,jdbcType=INTEGER},
       </if>
-      <if test="updaterid != null">
-        updaterid = #{updaterid,jdbcType=INTEGER},
+      <if test="updaterId != null">
+        updaterid = #{updaterId,jdbcType=INTEGER},
       </if>
-      <if test="updatetime != null">
-        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      <if test="updateTime != null">
+        updatetime = #{updateTime,jdbcType=TIMESTAMP},
       </if>
       <if test="pd_text1 != null">
         pd_text1 = #{pd_text1,jdbcType=VARCHAR},
@@ -767,8 +783,11 @@
       <if test="pd_remark != null">
         pd_remark = #{pd_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pd_ioid != null">
+        pd_ioid = #{pd_ioid,jdbcType=LONGVARCHAR},
+      </if>
     </set>
-    where pd_id = #{pd_id,jdbcType=INTEGER}
+    where pd_id = #{id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail">
     update prodiodetail
@@ -809,7 +828,8 @@
       pd_text5 = #{pd_text5,jdbcType=VARCHAR},
       pd_ym = #{pd_ym,jdbcType=INTEGER},
       pd_yqty = #{pd_yqty,jdbcType=INTEGER},
-      pd_remark = #{pd_remark,jdbcType=LONGVARCHAR}
+      pd_remark = #{pd_remark,jdbcType=LONGVARCHAR},
+      pd_ioid = #{pd_ioid,jdbcType=INTEGER}
     where pd_id = #{pd_id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail">
@@ -850,7 +870,8 @@
       pd_text4 = #{pd_text4,jdbcType=VARCHAR},
       pd_text5 = #{pd_text5,jdbcType=VARCHAR},
       pd_ym = #{pd_ym,jdbcType=INTEGER},
-      pd_yqty = #{pd_yqty,jdbcType=INTEGER}
+      pd_yqty = #{pd_yqty,jdbcType=INTEGER},
+      pd_ioid = #{pd_ioid,jdbcType=INTEGER}
     where pd_id = #{pd_id,jdbcType=INTEGER}
   </update>
 
@@ -927,15 +948,10 @@
   </update>
 
   <update id="updatePurchaseYqty" parameterType="java.lang.Long">
-    update purchasedetail
-    join
-    (select b.yqty,b.pd_orderid FROM
-    (select pd_orderid from prodiodetail where pd_piid = #{id,jdbcType=INTEGER}) a
-    left join
-    (select sum(pd_inqty)-sum(pd_outqty) yqty,pd_orderid from prodiodetail  left join  prodinout on pd_piid = pi_id  where pi_statuscode='AUDITED'
-    GROUP BY pd_orderid) b on a.pd_orderid = b.pd_orderid) c
-    on pd_id = c.pd_orderid
-    set PD_YQTY = c.yqty
+
+update prodiodetail a
+set a.pd_yqty =ifnull((select  b.pd_outqty  from  (select pd_outqty,pd_ioid from prodiodetail where pd_piclass='采购验退单') b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
+where a.pd_piid = #{id,jdbcType=INTEGER}
   </update>
 
 

+ 9 - 0
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -24,6 +24,13 @@
     <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
     <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
     <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
+    <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
+    <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
+    <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
+    <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
+    <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
+    <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
+    <result column="pi_inid" jdbcType="INTEGER" property="pi_inid" />
     <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
     <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
     <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
@@ -61,6 +68,8 @@
     <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
     <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
     <result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
+    <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
+
   </resultMap>
 
 

+ 37 - 8
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -32,6 +32,9 @@
     <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
     <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
     <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
+    <result column="pi_inid" jdbcType="INTEGER" property="pi_inid" />
+
+
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.purchase.po.ProdInOut">
     <result column="pi_address" jdbcType="LONGVARCHAR" property="pi_address" />
@@ -98,7 +101,7 @@
     pi_id, pi_inoutno, pi_class, pi_date, pi_vendid, pi_vendcode, pi_vendname, pi_custid, 
     pi_custcode, pi_custname, pi_puid, pi_pucode, pi_said, pi_sacode, pi_total, pi_recordmanid, 
     pi_recordman, pi_recorddate, pi_status, pi_statuscode, pi_printstatus, pi_printstatuscode, 
-    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5
+    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5,pi_inid
   </sql>
   <sql id="Blob_Column_List">
     pi_address
@@ -161,8 +164,8 @@
       pi_status, pi_statuscode, pi_printstatus, 
       pi_printstatuscode, companyid, updaterid, 
       updatetime, pi_text1, pi_text2, 
-      pi_text3, pi_text4, pi_text5, 
-      pi_address)
+      pi_text3, pi_text4, pi_text5,
+      pi_address,pi_inid)
     values (#{pi_id,jdbcType=INTEGER}, #{pi_inoutno,jdbcType=VARCHAR}, #{pi_class,jdbcType=VARCHAR}, 
       #{pi_date,jdbcType=TIMESTAMP}, #{pi_vendid,jdbcType=INTEGER}, #{pi_vendcode,jdbcType=VARCHAR}, 
       #{pi_vendname,jdbcType=VARCHAR}, #{pi_custid,jdbcType=INTEGER}, #{pi_custcode,jdbcType=VARCHAR}, 
@@ -173,7 +176,7 @@
       #{pi_printstatuscode,jdbcType=VARCHAR}, #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, 
       #{updatetime,jdbcType=TIMESTAMP}, #{pi_text1,jdbcType=VARCHAR}, #{pi_text2,jdbcType=VARCHAR}, 
       #{pi_text3,jdbcType=VARCHAR}, #{pi_text4,jdbcType=VARCHAR}, #{pi_text5,jdbcType=VARCHAR}, 
-      #{pi_address,jdbcType=LONGVARCHAR})
+      #{pi_address,jdbcType=LONGVARCHAR}.#{pi_inid,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.purchase.po.ProdInOut">
     <selectKey resultType="java.lang.Long" keyProperty="id">
@@ -272,6 +275,9 @@
       <if test="pi_address != null">
         pi_address,
       </if>
+      <if test="pi_inid != null">
+        pi_inid,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -365,6 +371,11 @@
       <if test="pi_address != null">
         #{pi_address,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pi_inid != null">
+        #{pi_inid,jdbcType=INTEGER},
+      </if>
+
+
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.usoftchina.saas.purchase.po.ProdInOutExample" resultType="java.lang.Long">
@@ -469,6 +480,10 @@
       <if test="record.pi_address != null">
         pi_address = #{record.pi_address,jdbcType=LONGVARCHAR},
       </if>
+      <if test="record.pi_inid != null">
+        pi_address = #{record.pi_inid,jdbcType=INTEGER},
+      </if>
+
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -506,7 +521,10 @@
       pi_text3 = #{record.pi_text3,jdbcType=VARCHAR},
       pi_text4 = #{record.pi_text4,jdbcType=VARCHAR},
       pi_text5 = #{record.pi_text5,jdbcType=VARCHAR},
-      pi_address = #{record.pi_address,jdbcType=LONGVARCHAR}
+      pi_address = #{record.pi_address,jdbcType=LONGVARCHAR},
+      pi_inid = #{record.pi_inid,jdbcType=INTEGER}
+
+
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -542,7 +560,10 @@
       pi_text2 = #{record.pi_text2,jdbcType=VARCHAR},
       pi_text3 = #{record.pi_text3,jdbcType=VARCHAR},
       pi_text4 = #{record.pi_text4,jdbcType=VARCHAR},
-      pi_text5 = #{record.pi_text5,jdbcType=VARCHAR}
+      pi_text5 = #{record.pi_text5,jdbcType=VARCHAR},
+      pi_inid = #{record.pi_inid,jdbcType=INTEGER}
+
+
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -640,6 +661,11 @@
       <if test="pi_address != null">
         pi_address = #{pi_address,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pi_inid != null">
+        pi_inid = #{pi_inid,jdbcType=INTEGER},
+      </if>
+
+
     </set>
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
@@ -674,7 +700,9 @@
       pi_text3 = #{pi_text3,jdbcType=VARCHAR},
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
       pi_text5 = #{pi_text5,jdbcType=VARCHAR},
-      pi_address = #{pi_address,jdbcType=LONGVARCHAR}
+      pi_address = #{pi_address,jdbcType=LONGVARCHAR},
+      pi_inid = #{pi_inid,jdbcType=INTEGER}
+
     where pi_id = #{pi_id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.purchase.po.ProdInOut">
@@ -707,7 +735,8 @@
       pi_text2 = #{pi_text2,jdbcType=VARCHAR},
       pi_text3 = #{pi_text3,jdbcType=VARCHAR},
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
-      pi_text5 = #{pi_text5,jdbcType=VARCHAR}
+      pi_text5 = #{pi_text5,jdbcType=VARCHAR},
+      pi_inid = #{pi_inid,jdbcType=INTEGER}
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
 </mapper>

+ 44 - 44
applications/purchase/purchase-server/src/main/resources/mapper/PurchasedetailMapper.xml

@@ -248,50 +248,50 @@
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.purchase.po.PurchaseDetail" >
     update purchasedetail
     <set >
-      <if test="pdPuid != null" >
-        PD_PUID = #{pdPuid,jdbcType=INTEGER},
+      <if test="pd_puid != null" >
+        PD_PUID = #{pd_puid,jdbcType=INTEGER},
       </if>
-      <if test="pdCode != null" >
-        PD_CODE = #{pdCode,jdbcType=VARCHAR},
+      <if test="pd_code != null" >
+        PD_CODE = #{pd_code,jdbcType=VARCHAR},
       </if>
-      <if test="pdDetno != null" >
-        PD_DETNO = #{pdDetno,jdbcType=INTEGER},
+      <if test="pd_detno != null" >
+        PD_DETNO = #{pd_detno,jdbcType=INTEGER},
       </if>
-      <if test="pdProdid != null" >
-        PD_PRODID = #{pdProdid,jdbcType=INTEGER},
+      <if test="pd_prodid != null" >
+        PD_PRODID = #{pd_prodid,jdbcType=INTEGER},
       </if>
-      <if test="pdProdcode != null" >
-        PD_PRODCODE = #{pdProdcode,jdbcType=VARCHAR},
+      <if test="pd_prodcode != null" >
+        PD_PRODCODE = #{pd_prodcode,jdbcType=VARCHAR},
       </if>
-      <if test="pdUnit != null" >
-        PD_UNIT = #{pdUnit,jdbcType=VARCHAR},
+      <if test="pd_unit != null" >
+        PD_UNIT = #{pd_unit,jdbcType=VARCHAR},
       </if>
-      <if test="pdQty != null" >
-        PD_QTY = #{pdQty,jdbcType=DOUBLE},
+      <if test="pd_qty != null" >
+        PD_QTY = #{pd_qty,jdbcType=DOUBLE},
       </if>
-      <if test="pdPrice != null" >
-        PD_PRICE = #{pdPrice,jdbcType=DOUBLE},
+      <if test="pd_price != null" >
+        PD_PRICE = #{pd_price,jdbcType=DOUBLE},
       </if>
-      <if test="pdTotal != null" >
-        PD_TOTAL = #{pdTotal,jdbcType=DOUBLE},
+      <if test="pd_total != null" >
+        PD_TOTAL = #{pd_total,jdbcType=DOUBLE},
       </if>
-      <if test="pdTaxtotal != null" >
-        PD_TAXTOTAL = #{pdTaxtotal,jdbcType=DOUBLE},
+      <if test="pd_taxtotal != null" >
+        PD_TAXTOTAL = #{pd_taxtotal,jdbcType=DOUBLE},
       </if>
-      <if test="pdAcceptqty != null" >
-        PD_ACCEPTQTY = #{pdAcceptqty,jdbcType=DOUBLE},
+      <if test="pd_acceptqty != null" >
+        PD_ACCEPTQTY = #{pd_acceptqty,jdbcType=DOUBLE},
       </if>
-      <if test="pdDelivery != null" >
-        PD_DELIVERY = #{pdDelivery,jdbcType=DOUBLE},
+      <if test="pd_delivery != null" >
+        PD_DELIVERY = #{pd_delivery,jdbcType=DOUBLE},
       </if>
-      <if test="pdSalecode != null" >
-        PD_SALECODE = #{pdSalecode,jdbcType=VARCHAR},
+      <if test="pd_salecode != null" >
+        PD_SALECODE = #{pd_salecode,jdbcType=VARCHAR},
       </if>
-      <if test="pdSaledetno != null" >
-        PD_SALEDETNO = #{pdSaledetno,jdbcType=INTEGER},
+      <if test="pd_saledetno != null" >
+        PD_SALEDETNO = #{pd_saledetno,jdbcType=INTEGER},
       </if>
-      <if test="pdSdid != null" >
-        PD_SDID = #{pdSdid,jdbcType=INTEGER},
+      <if test="pd_sdid != null" >
+        PD_SDID = #{pd_sdid,jdbcType=INTEGER},
       </if>
       <if test="companyId != null" >
         companyId = #{companyId,jdbcType=INTEGER},
@@ -302,23 +302,23 @@
       <if test="updateTime != null" >
         updateTime = #{updateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="pdText1 != null" >
-        pd_text1 = #{pdText1,jdbcType=VARCHAR},
+      <if test="pd_text1 != null" >
+        pd_text1 = #{pd_text1,jdbcType=VARCHAR},
       </if>
-      <if test="pdText2 != null" >
-        pd_text2 = #{pdText2,jdbcType=VARCHAR},
+      <if test="pd_text2 != null" >
+        pd_text2 = #{pd_text2,jdbcType=VARCHAR},
       </if>
-      <if test="pdText3 != null" >
-        pd_text3 = #{pdText3,jdbcType=VARCHAR},
+      <if test="pd_text3 != null" >
+        pd_text3 = #{pd_text3,jdbcType=VARCHAR},
       </if>
-      <if test="pdText4 != null" >
-        pd_text4 = #{pdText4,jdbcType=VARCHAR},
+      <if test="pd_text4 != null" >
+        pd_text4 = #{pd_text4,jdbcType=VARCHAR},
       </if>
-      <if test="pdText5 != null" >
-        pd_text5 = #{pdText5,jdbcType=VARCHAR},
+      <if test="pd_text5 != null" >
+        pd_text5 = #{pd_text5,jdbcType=VARCHAR},
       </if>
-      <if test="pdYqty != null" >
-        pd_yqty = #{pdYqty,jdbcType=DOUBLE},
+      <if test="pd_yqty != null" >
+        pd_yqty = #{pd_yqty,jdbcType=DOUBLE},
       </if>
     </set>
     where PD_ID = #{id,jdbcType=INTEGER}
@@ -415,12 +415,12 @@
       where pd_puid=#{pu_id} order by pd_detno
   </select>
 
-  <update id="updatePurchaseYqty" parameterType="long" >
+  <update id="updatePurchaseYqty" parameterType="integer" >
 update purchasedetail
 set pd_yqty=ifnull((select sum(IFNULL(pd_inqty,0)-IFNULL(pd_outqty,0))
 from prodiodetail
 where ((pd_piclass='采购验退单'  and pd_status=99 ) or pd_piclass='采购验收单') and IFNULL(pd_orderid,0)=purchasedetail.pd_id),0)
-where exists (select 1 from prodiodetail where pd_piid=#{id,jdbcType=INTEGER} and IFNULL(prodiodetail.pd_orderid,0)=purchasedetail.pd_id)
+where pd_puid=#{pu_id}
   </update>
 
 

+ 26 - 24
frontend/saas-web/app/util/FormUtil.js

@@ -108,10 +108,12 @@ Ext.define('saas.util.FormUtil', {
 
     loadData: function(form) {
         var me = this;
+        form.setLoading(true);
         if(form.initId && form.initId!=0) {
-            var url = form._readUrl + form.initId,async=false;
-            me.BaseUtil.request({url,async })
+            var url = form._readUrl + form.initId;
+            me.BaseUtil.request({url })
             .then(function(response) {
+                form.setLoading(false);
                 var res = Ext.decode(response.responseText);
                 if(res.success) {
                     form.setFormData({
@@ -121,39 +123,39 @@ Ext.define('saas.util.FormUtil', {
                 }
             })
             .catch(function(response) {
+                form.setLoading(false);
                 console.error(response);
             });
         }else{
             //取后台编号
-            var code;
-            Ext.Ajax.request({
+            me.BaseUtil.request({
                 url: 'http://192.168.253.58:8900/number/getMaxnumber',
                 params: {
                     caller:form.caller
                 },
-                async:false,
                 method: 'POST',
-                success: function(response, opts) {
-                    var res = Ext.decode(response.responseText);
-                    if(res.success){
-                        code = res.data.code
+            }).then(function(response) {
+                form.setLoading(false);
+                var res = Ext.decode(response.responseText);
+                if(res.success){
+                    var code = res.data.code;
+                    var viewModel = form.getViewModel();
+                    var detailStore = viewModel.get('_detailStore');
+                    var detno = 0,datas=[];
+                    Ext.Array.each(new Array(10), function() {
+                        detno += 1;
+                        var data = {};
+                        data[form._detnoColumn] = detno;
+                        datas.push(data);
+                    })
+                    detailStore.loadData(datas);
+                    if(code){
+                        viewModel.set(form._codeField,code);
                     }
-                },
-                failure: function(response, opts) {}
-            }); 
-            var viewModel = form.getViewModel();
-            var detailStore = viewModel.get('_detailStore');
-            var detno = 0,datas=[];
-            Ext.Array.each(new Array(10), function() {
-                detno += 1;
-                var data = {};
-                data[form._detnoColumn] = detno;
-                datas.push(data);
+                }
+            }).catch(function() {
+                form.setLoading(false);
             })
-            detailStore.loadData(datas);
-            if(code){
-                viewModel.set(form._codeField,code);
-            }
         }
     }
 });

+ 1 - 1
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -57,7 +57,7 @@ Ext.define('saas.view.core.form.FormPanel', {
                 }, {
                     xtype: 'button',
                     text: '保存',
-                    handler: 'save',
+                    handler: 'onSave',
                     formBind: true
                 }, {
                     xtype: 'button',

+ 13 - 2
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -65,7 +65,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
         }
     },
 
-    save:function(){
+    onSave: function() {
         var me = this,
         form = this.getView(),
         viewModel = me.getViewModel(),
@@ -82,6 +82,17 @@ Ext.define('saas.view.core.form.FormPanelController', {
         }
         //form里面数据
         var formData = form.getFormData();
+        
+        me.save(formData);
+    },
+
+    save:function(formData){
+        var me = this,
+        form = this.getView(),
+        viewModel = me.getViewModel(),
+        modelData = viewModel.getData(),
+        detailBindFields = modelData._detailBindFields;
+
         var gridData = formData.detail?formData.detail:[];
         var dirtyGridData = [];
         if(gridData.length>0){
@@ -100,7 +111,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
                     dirtyGridData.push(d);
                 }
             });
-        }  
+        }
         var params = {
             main:formData.main,
             items:dirtyGridData

+ 9 - 1
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -51,7 +51,15 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                         var condition = '',
                         queryForm = me.ownerCt.down('form'),
                         condition = me.QueryUtil.getFormCondition(queryForm),
-                        mode = me._Mode;
+                        mode = me._Mode,
+                        defaultCondition = me._defaultCondition;
+                        if(defaultCondition){
+                            if (Ext.isEmpty(condition)) {
+                                condition = defaultCondition + ' and '+condition;
+                            }else{
+                                condition = defaultCondition;
+                            }
+                        }
                         if (Ext.isEmpty(condition)) {
                             condition = " 1=1 ";
                         }

+ 131 - 64
frontend/saas-web/app/view/main/Navigation.js

@@ -26,9 +26,14 @@ Ext.define('saas.view.main.Navigation', {
                         }, {
                             id: 'purchaseIn',
                             text: '采购验收单',
-                            formType:'purchase-purchase-formpanel',
+                            formType:'purchase-purchaseIn-formpanel',
                             queryType: 'purchase-purchaseIn-querypanel'
-                        }, {
+                        },{
+                            id: 'purchaseOut',
+                            text: '采购验退单',
+                            formType:'purchase-purchaseOut-formpanel',
+                            queryType: 'purchase-purchaseOut-querypanel'
+                        },{
                             id: 'form1',
                             text: '测试-采购单明细界面',
                             formType: 'test-order-formpanel'
@@ -62,27 +67,6 @@ Ext.define('saas.view.main.Navigation', {
                         '<div class="nav-inner-icon {iconCls}"></div>',
                         '<div class="nav-inner-text">{text}</div>',
                     '</div>',
-                    '<div class="x-navitem-menu" style="display: none;">',
-                        '<div class="nav-menu-body">',
-                            '<tpl for="items">',
-                            '<div class="menu">',
-                                '<h3 class="menu-title">{text}</h3>',
-                                '<ul class="menu-content">',
-                                    '<tpl for="items">',
-                                    '<li class="menuitem">',
-                                        '<span class="item-text" data-id="{id}" data-text="{text}" data-type="form" data-formType="{formType}">',
-                                            '{text}',
-                                        '</span>',
-                                        '<tpl if="{queryType}">',
-                                        '<i class="item-icon" data-id="{id}" data-text="{text}" data-type="query" data-queryType="{queryType}">查询</i>',
-                                        '</tpl>',
-                                    '</li>',
-                                    '</tpl>',
-                                '</ul>',
-                            '</div>',
-                            '</tpl>',
-                        '</div>',
-                    '</div>',
                 '</li>',
                 '</tpl>',
             '</ul>'),
@@ -91,11 +75,10 @@ Ext.define('saas.view.main.Navigation', {
             selectedClass : 'x-navitem-selected',
             singleSelect : true,
             itemSelector : '.x-navitem',
-            menuSeletor: '.menuitem',
             listeners: {
-                itemmouseenter: me.toggleShowNavMenu,
-                itemmouseleave: me.toggleShowNavMenu,
-                itemclick: me.menuItemClick,
+                itemmouseenter: me.showNavMenu,
+                itemmouseleave: me.hideNavMenu,
+                itemClick: me.clickNavMenu,
                 scope: me
             }
         });
@@ -108,47 +91,131 @@ Ext.define('saas.view.main.Navigation', {
         me.callParent();
     },
 
-    toggleShowNavMenu: function(view, record, item, index, e, eOpts) {
-        var menuBody = item.getElementsByClassName('x-navitem-menu')[0];
-        if(menuBody) {
-            var display = menuBody.style.display,
-            hidden = display == 'none';
+    clickNavMenu: function(view, record, item, index, e, eOpts) {
+        var me = this;
+        this.showNavMenu(view, record, item, index, e, eOpts);
+    },
 
-            // if(hidden) {
-            //     menuBody.animate({ to: { opacity: 1} }, 500, function() {
-            //         console.log('hidden');
-            //     });
-            // }else {
-            //     menuBody.animate({ to: { opacity: 0} }, 500, function() {
-            //         console.log('show');
-            //     });
-            // }
-            // menuBody.classList[ope]('x-hidden');
+    showNavMenu: function(view, record, item, index, e, eOpts) {
+        var recData = record.data,
+        menuItems = recData.items || [],
+        itemBox = item.getBoundingClientRect(),
+        pos = [itemBox.left + itemBox.width, itemBox.top],
+        id = recData.id,
+        menuId = 'navMenu-' + id,
+        menu = Ext.getCmp(menuId);
 
-            menuBody.style.width = hidden ? 'auto' : '0';
-            menuBody.style.display = hidden ? 'block' : 'none';
-            // menuBody.animate({ opacity: o,opacity:1},1000);
-            
-            // menuBody.animate({dynamic: true, to: {display: newDisplay}});
-        }
-    },
+        if(!menu) {
+            var view = new Ext.DataView({
+                store : Ext.create('Ext.data.Store', {
+                   fields: ['id', 'text', 'formType', 'queryType'],
+                   data: menuItems
+                }),
+                tpl: new Ext.XTemplate('<div class="x-navitem-menu">',
+                    '<div class="nav-menu-body">',
+                        '<tpl for=".">',
+                        '<div class="menu">',
+                            '<h3 class="menu-title">{text}</h3>',
+                            '<div class="menu-content">',
+                                '<tpl for="items">',
+                                '<div class="menuitem">',
+                                    '<div class="item-text" title="{text}" data-id="{id}" data-text="{text}" data-type="query" data-queryType="{queryType}">',
+                                        '{text}',
+                                    '</div>',
+                                    '<tpl if="{formType}">',
+                                    '<div class="item-icon" data-id="{id}" data-text="{text}" data-type="form" data-formType="{formType}">新增</div>',
+                                    '</tpl>',
+                                '</div>',
+                                '</tpl>',
+                            '</div>',
+                        '</div>',
+                        '</tpl>',
+                    '</div>',
+                '</div>'),
+                trackOver: true,
+                overItemCls : 'menuitem-over',
+                selectedClass : 'menuitem-selected',
+                singleSelect : true,
+                itemSelector : 'menu',
+                listeners: {
+                    boxready: function(view, width, height, eOpts) {
+                        var menu = view.up('menu'),
+                        menuView = view.el.dom.getElementsByClassName('x-navitem-menu')[0],
+                        menuBox = menuView.getBoundingClientRect(),
+                        menuViewWidth = menuBox.width,
+                        menuViewHeight = menuBox.height,
+                        menuItem = menuView.getElementsByClassName('menuitem');
+                        
+                        menu.setWidth(menuViewWidth);
+                        menu.setHeight(menuViewHeight);
+                        menu.updateLayout();
+
+                        view.el.dom.addEventListener('mouseleave', function(e) {
+                            var ex = e.clientX,
+                            ey = e.clientY,
+                            box = menuView.getBoundingClientRect();
+
+                            if(ey <= box.top || ex >= (box.left + box.width) || ey >= (box.top + box.height) || (ex <= box.left && ey >= (box.top + 64))) {
+                                menu.hide();
+                            }
+                        });
+
+                        Ext.Array.each(menuItem, function(mi) {
+                            var menuItemText = mi.getElementsByClassName('item-text');
+                            var menuItemIcon = mi.getElementsByClassName('item-icon');
 
-    menuItemClick: function(view, record, item, index, e, eOpts) {
-        var me = this,
-        mainView = Ext.getCmp('mainView'),
-        mainViewEl = mainView.getEl().dom,
-        controller = mainView.getController(),
-        target = e.target,
-        clsName = target.className,
-        dataset = target.dataset;
+                            Ext.Array.each(menuItemText, function(item) {
+                                item.addEventListener('click', function(e) {
+                                    var target = e.target,
+                                    dataset = target.dataset;
+                                    mainView = Ext.getCmp('mainView'),
+                                    controller = mainView.getController();
         
-        if(clsName == 'item-text' || clsName == 'item-icon') {
-            controller.setActiveTab(dataset);
+                                    controller.setActiveTab(dataset);
+                                    menu.hide();
+                                });
+                            });
+                            Ext.Array.each(menuItemIcon, function(item) {
+                                item.addEventListener('click', function(e) {
+                                    var target = e.target,
+                                    dataset = target.dataset;
+                                    mainView = Ext.getCmp('mainView'),
+                                    controller = mainView.getController();
+        
+                                    controller.setActiveTab(dataset);
+                                    menu.hide();
+                                });
+                            });
+                        });
+                    },
+                }
+            });
+            var menu = Ext.create('Ext.menu.Menu', {
+                id: menuId,
+                width: window.innerWidth,
+                style: {
+                    borderTopRightRadius: '4px',
+                    borderBottomRightRadius: '4px'
+                },
+                items: [view]
+            });
         }
-        // var menuBody = mainViewEl.getElementsByClassName('x-navitem-menu');
-        // for(var i = 0; i < menuBody.length; i++) {
-        //     menuBody[i].style.display = 'none';
-        //     menuBody[i].style.width = 0;
-        // }
+        menu.showAt(pos);
     },
+
+    hideNavMenu: function(view, record, item, index, e, eOpts) {
+        var recData = record.data,
+        cx = e.browserEvent.clientX,
+        cy = e.browserEvent.clientY,
+        itemBox = item.getBoundingClientRect(),
+        id = recData.id,
+        menuId = 'navMenu-' + id,
+        menu = Ext.getCmp(menuId);
+
+        if(cx <= itemBox.left || cy <= itemBox.top || cy >= (itemBox.top + itemBox.height)) {
+            if(menu) {
+                menu.hide();
+            }
+        }
+    }
 });

+ 78 - 64
frontend/saas-web/app/view/main/Navigation.scss

@@ -69,80 +69,94 @@
                                     }
                                 }
                             }
-                            .x-navitem-menu {
-                                position: absolute;
-                                z-index: 9999;
-                                margin-left: 100%;
-                                top: 0;
-                                background: white;
-                                overflow: hidden;
-                                // animation: name duration timing-function delay iteration-count direction;
+                        }
+                        .x-navitem-over {
+                            .x-navitem-body {
+                                background-color: #475360;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
 
-                                .nav-menu-body {
-                                    display: flex;
-                                    padding: 5px;
-                                    border: 4px solid #c7c7c7;
-                                    border-color: rgba(0,0,0,.2);
-                                    border-left: 0;
-                                    border-top-right-radius: 4px;
-                                    border-bottom-right-radius: 4px;
+.x-navitem-menu {
+    position: absolute;
+    z-index: 9999;
+    top: 0;
+    background: white;
+    overflow: hidden;
+    // animation: name duration timing-function delay iteration-count direction;
 
-                                    .menu {
-                                        width: 200px;
-                                        border-right: 1px dashed #ccc;
-                                        letter-spacing: 1px;
-                                        color: #444;
+    .nav-menu-body {
+        display: flex;
+        padding: 5px;
+        border-top-right-radius: 4px;
+        border-bottom-right-radius: 4px;
 
-                                        &:last-child {
-                                            border: none;
-                                        }
-                                        
-                                        .menu-title {
-                                            padding-left: 10px;
-                                        }
+        .menu {
+            width: 200px;
+            border-right: 1px dashed #ccc;
+            letter-spacing: 1px;
+            color: #444;
+
+            &:last-child {
+                border: none;
+            }
+            
+            .menu-title {
+                margin: 5px;
+            }
 
-                                        .menu-content {
-                                            list-style: none;
-                                            padding-left: 10px;
-                                            padding-right: 10px;
+            .menu-content {
+                list-style: none;
+                padding-left: 10px;
+                padding-right: 10px;
 
-                                            .menuitem {
-                                                margin: 5px 0;
+                .menuitem {
+                    padding: 5px;
+                    display: flex;
+                    border-radius: 4px;
+                    align-content: space-between;
 
-                                                .item-text {
-                                                    cursor: pointer;
-                                                }
+                    .item-text {
+                        cursor: pointer;
+                        line-height: 24px;
+                        white-space: nowrap;
+                        width: 124px;
+                        overflow: hidden;
+                        text-overflow: ellipsis;
+                    }
 
-                                                .item-icon {
-                                                    cursor: pointer;
-                                                    display: none;
-                                                    float: right;
-                                                    font-style: inherit;
-                                                    background: green;
-                                                    color: white;
-                                                    border-radius: 4px;
-                                                }
+                    .item-icon {
+                        cursor: pointer;
+                        float: right;
+                        display: none;
+                        background: #64b448;
+                        color: #fff;
+                        font-size: 11px;
+                        padding: 3px 6px;
+                        border-radius: 3px;
+                        margin-right: 5px;
+                        font-weight: 400;
+                        width: 40px;
 
-                                                &:hover {
+                        &:hover {
+                            opacity: 0.7;
+                        }
+                    }
 
-                                                    .item-icon {
-                                                        display: block;
-                                                    }
-                                                
-                                                    .tem-text {
-                                                        color: blue;
-                                                    }
-                                                }
-                                            }
-                                        }
-                                    }
-                                }
-                            }
+                    &:hover {
+                        background-color: #E4E4E4;
+
+                        .item-icon {
+                            display: block;
                         }
-                        .x-navitem-over {
-                            .x-navitem-body {
-                                background-color: #475360;
-                            }
+                    
+                        .tem-text {
+                            color: blue;
                         }
                     }
                 }

+ 21 - 1
frontend/saas-web/app/view/purchase/purchase/FormController.js

@@ -133,5 +133,25 @@ Ext.define('saas.view.purchase.purchase.FormController', {
             renderTo:this.ownerCmp.ownerCt.getEl()
         }).show();
 
-    }
+    },
+
+    turnIn: function() {
+        var me = this,
+        form = me.getView(),
+        id = form.getForm().findField(form._idField);
+        form.BaseUtil.request({
+            url: form._turnInUrl+id.value,
+            method: 'GET',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','转单成功');
+              
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','转单失败');
+        });
+     }
 });

+ 21 - 10
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -13,19 +13,18 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
      _statusCodeField: 'pu_statuscode',
      _detnoColumn:  'pd_detno',
      _relationColumn: 'pd_puid',
-     _readUrl:'http://192.168.253.58:8800/purchase/read/',
-     _saveUrl:'http://192.168.253.58:8800/purchase/save',
-     _auditUrl:'http://192.168.253.58:8800/purchase/audit',
-     _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
-     _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
+     _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/',
      initId:0,
  
      toolBtns: [{
          xtype: 'button',
-         text: '转单按钮',
-         handler: function() {
-             console.log('11');
-         }
+         text: '转验收单按钮',
+         handler: 'turnIn'
      }],
 
     defaultItems: [{
@@ -159,6 +158,18 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
             },
             {
                 text : "数量", 
+                dataIndex : "pd_qty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
+            },
+            {
+                text : "已转数", 
                 dataIndex : "pd_yqty", 
                 editor : {
                     xtype : "numberfield"
@@ -168,7 +179,7 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                 format:'0',
                 items : null,
                 summaryType: 'sum'
-            }, 
+            },
             {
                 text : "单价", 
                 editor : {

+ 2 - 1
frontend/saas-web/app/view/purchase/purchase/QueryPanel.js

@@ -116,8 +116,9 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
         _idField: 'pu_id',
         _codeField: 'pu_code',
         _title: '采购单',
+        _defaultCondition:'',
         _addXtype: 'purchase-purchase-formpanel',
-        _baseVastUrl: 'http://192.168.253.58:8800/purchase/',
+        _baseVastUrl: 'http://localhost:8800/purchase/',
         _baseColumn: [{
             text: '序号',
             width: 80,

+ 20 - 1
frontend/saas-web/app/view/purchase/purchaseIn/FormController.js

@@ -143,5 +143,24 @@ Ext.define('saas.view.purchase.purchaseIn.FormController', {
             renderTo:this.ownerCmp.ownerCt.getEl()
         }).show();
 
-    }
+    },
+    turnOut: function() {
+        var me = this,
+        form = me.getView(),
+        id = form.getForm().findField(form._idField);
+        form.BaseUtil.request({
+            url: form._turnOutUrl+id.value,
+            method: 'GET',
+        })
+        .then(function(res) {
+            var localJson = new Ext.decode(res.responseText);
+            if(localJson.success){
+                Ext.Msg.alert('提示','转单成功');
+              
+            }
+        })
+        .catch(function() {
+            Ext.Msg.alert('提示','转单失败');
+        });
+     }
 });

+ 28 - 5
frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js

@@ -18,14 +18,13 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
     _deleteUrl:'http://192.168.253.228:8800/prodinout/delete/',
     _deleteDetailUrl:'http://192.168.253.228:8800/prodinout/deleteItem/',
    _baseVastUrl:'http://192.168.253.228:8800/prodinout/',
-    initId:11,
+   _turnOutUrl:'http://localhost:8800/prodinout/turnProdOut/',
+    initId:0,
 
     toolBtns: [{
         xtype: 'button',
-        text: '转单按钮',
-        handler: function() {
-            console.log('11');
-        }
+        text: '转验退单按钮',
+        handler: 'turnOut'
     }],
 
     defaultItems: [{
@@ -88,6 +87,13 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         readOnly: true,
         columnWidth : 0.25
     }, {
+        xtype : "hidden", 
+        name : "pi_puid", 
+        bind : "{pi_puid}", 
+        fieldLabel : "采购单id", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
         xtype : "textfield", 
         name : "pi_pucode", 
         bind : "{pi_pucode}", 
@@ -155,6 +161,17 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 format:'0',
                 items : null,
                 summaryType: 'sum'
+            },            {
+                text : "已转数", 
+                dataIndex : "pd_yqty", 
+                editor : {
+                    xtype : "numberfield"
+                },
+                width : 120.0, 
+                xtype : "numbercolumn", 
+                format:'0',
+                items : null,
+                summaryType: 'sum'
             }, 
             {
                 text : "仓库", 
@@ -199,6 +216,12 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
                 dataIndex : "pd_nettotal", 
                 xtype : "numbercolumn"
             },
+            {
+                text : "采购单明细id", 
+                dataIndex : "pd_orderid", 
+                width : 120.0,
+                hidden:true
+            },
             {
                 text : "采购单号", 
                 dataIndex : "pd_ordercode", 

+ 5 - 0
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -103,6 +103,7 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
         _idField:'id',
         _codeField:'pi_inoutno',
         _title:'采购验收单',
+        _defaultCondition:' pi_class = \'采购验收单\'',
         _addXtype:'purchase-purchaseIn-formpanel',
         _baseVastUrl:'http://192.168.253.228:8800/prodinout/',
         _baseColumn: [{
@@ -122,6 +123,10 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
             text: '单据状态',
             dataIndex: 'pi_status',
             width: 120
+        }, {
+            text: '单据类型',
+            dataIndex: 'pi_class',
+            width: 120
         }, {
             text: '下单日期',
             dataIndex: 'pi_date',

+ 14 - 8
frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js

@@ -17,15 +17,9 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
     _auditUrl:'http://192.168.253.228:8800/prodinout/audit',
     _deleteUrl:'http://192.168.253.228:8800/prodinout/delete/',
     _deleteDetailUrl:'http://192.168.253.228:8800/prodinout/deleteItem/',
-    initId:11,
+    initId:0,
 
-    toolBtns: [{
-        xtype: 'button',
-        text: '转单按钮',
-        handler: function() {
-            console.log('11');
-        }
-    }],
+    toolBtns: [],
 
     defaultItems: [{
         xtype: 'hidden',
@@ -94,6 +88,13 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         allowBlank : true, 
         columnWidth : 0.25
     }, {
+        xtype : "hidden", 
+        name : "pi_inid", 
+        bind : "{pi_inid}", 
+        fieldLabel : "出入库单id", 
+        allowBlank : true, 
+        columnWidth : 0.25
+    },{
         name : "detailGridField", 
         xtype : "detailGridField", 
         columns : [
@@ -207,6 +208,11 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
                 dataIndex : "pd_orderdetno", 
                 xtype : "numbercolumn",
                 flex:1
+            }, {
+                text : "出入库明细id", 
+                dataIndex : "pd_ioid", 
+                width : 120.0,
+                hidden:true
             }
         ]
     }, {

+ 6 - 1
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -100,9 +100,10 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
         columnWidth: 1
     }],
     queryGridConfig: {
-        _idField:'pi_id',
+        _idField:'id',
         _codeField:'pi_inoutno',
         _title:'采购验退单',
+        _defaultCondition:' pi_class = \'采购验退单\'',
         _addXtype:'purchase-purchaseOut-formpanel',
         _baseVastUrl:'http://192.168.253.228:8800/prodinout/',
         _baseColumn: [{
@@ -122,6 +123,10 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
             text: '单据状态',
             dataIndex: 'pi_status',
             width: 120
+        },{
+            text: '单据类型',
+            dataIndex: 'pi_class',
+            width: 120
         }, {
             text: '下单日期',
             dataIndex: 'pi_date',