Browse Source

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

zhuth 7 years ago
parent
commit
9e8e28c3f7
22 changed files with 167 additions and 297 deletions
  1. 15 15
      applications/document/document-server/src/main/resources/mapper/BomDetailMapper.xml
  2. 2 2
      applications/document/document-server/src/main/resources/mapper/CustomerMapper.xml
  3. 6 6
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendor.java
  4. 7 7
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  5. 20 11
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  6. 3 3
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  7. 2 2
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  8. 6 6
      applications/money/money-server/src/main/resources/mapper/RecbalancedetailMapper.xml
  9. 4 188
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/Make.java
  10. 2 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMapper.java
  11. 20 2
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java
  12. 45 6
      applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml
  13. 3 2
      frontend/saas-web/app/view/money/payBalance/FormPanel.js
  14. 1 1
      frontend/saas-web/app/view/money/payBalance/FormPanelController.js
  15. 2 0
      frontend/saas-web/app/view/money/recBalance/FormPanel.js
  16. 1 0
      frontend/saas-web/app/view/money/recBalance/FormPanelController.js
  17. 2 0
      frontend/saas-web/app/view/purchase/purchase/FormPanelController.js
  18. 16 31
      frontend/saas-web/app/view/stock/make/FormPanel.js
  19. 3 2
      frontend/saas-web/app/view/stock/make/FormPanelController.js
  20. 0 3
      frontend/saas-web/app/view/stock/make/FormPanelModel.js
  21. 6 9
      frontend/saas-web/app/view/stock/otherIn/FormPanelController.js
  22. 1 1
      frontend/saas-web/app/view/stock/otherOut/FormPanelController.js

+ 15 - 15
applications/document/document-server/src/main/resources/mapper/BomDetailMapper.xml

@@ -284,49 +284,49 @@
         <if test="item.bd_bomid != null" >
           bd_bomid = #{item.bd_bomid},
         </if>
-        <if test="bd_detno != null" >
+        <if test="item.bd_detno != null" >
           bd_detno = #{item.bd_detno,jdbcType=INTEGER},
         </if>
-        <if test="bd_sonid != null" >
+        <if test="item.bd_sonid != null" >
           bd_sonid = #{item.bd_sonid,jdbcType=INTEGER},
         </if>
-        <if test="bd_soncode != null" >
+        <if test="item.bd_soncode != null" >
           bd_soncode = #{item.bd_soncode,jdbcType=VARCHAR},
         </if>
-        <if test="bd_unit != null" >
+        <if test="item.bd_unit != null" >
           bd_unit = #{item.bd_unit,jdbcType=VARCHAR},
         </if>
-        <if test="bd_baseqty != null" >
+        <if test="item.bd_baseqty != null" >
           bd_baseqty = #{item.bd_baseqty,jdbcType=INTEGER},
         </if>
-        <if test="bd_replace != null" >
+        <if test="item.bd_replace != null" >
           bd_replace = #{item.bd_replace,jdbcType=VARCHAR},
         </if>
-        <if test="bd_remark != null" >
+        <if test="item.bd_remark != null" >
           bd_remark = #{item.bd_remark,jdbcType=VARCHAR},
         </if>
-        <if test="companyId != null" >
+        <if test="item.companyId != null" >
           companyId = #{item.companyId,jdbcType=INTEGER},
         </if>
-        <if test="updaterId != null" >
+        <if test="item.updaterId != null" >
           updaterId = #{item.updaterId,jdbcType=INTEGER},
         </if>
-        <if test="updateTime != null" >
+        <if test="item.updateTime != null" >
           updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
         </if>
-        <if test="bd_text1 != null" >
+        <if test="item.bd_text1 != null" >
           bd_text1 = #{item.bd_text1,jdbcType=VARCHAR},
         </if>
-        <if test="bd_text2 != null" >
+        <if test="item.bd_text2 != null" >
           bd_text2 = #{item.bd_text2,jdbcType=VARCHAR},
         </if>
-        <if test="bd_text3 != null" >
+        <if test="item.bd_text3 != null" >
           bd_text3 = #{item.bd_text3,jdbcType=VARCHAR},
         </if>
-        <if test="bd_text4 != null" >
+        <if test="item.bd_text4 != null" >
           bd_text4 = #{item.bd_text4,jdbcType=VARCHAR},
         </if>
-        <if test="bd_text5 != null" >
+        <if test="item.bd_text5 != null" >
           bd_text5 = #{item.bd_text5,jdbcType=VARCHAR},
         </if>
       </set>

+ 2 - 2
applications/document/document-server/src/main/resources/mapper/CustomerMapper.xml

@@ -370,12 +370,12 @@
   </select>
 
   <select id="validNameAndCodeWhenInsert" parameterType="com.usoftchina.saas.document.entities.Customer" resultType="int">
-    select count(1) from customer where cu_code = #{cu_code,jdbcType=VARCHAR} or cu_name = #{cu_name,jdbcType=VARCHAR}
+    select count(1) from customer where (cu_code = #{cu_code,jdbcType=VARCHAR} or cu_name = #{cu_name,jdbcType=VARCHAR}) and companyId =#{companyId}
   </select>
 
   <select id="validNameAndCodeWhenUpdate" parameterType="com.usoftchina.saas.document.entities.Customer" resultType="int">
     select count(1) from customer where (cu_code = #{cu_code,jdbcType=VARCHAR} or cu_name = #{cu_name,jdbcType=VARCHAR})
-    and cu_id != #{id}
+    and cu_id != #{id} and companyId =#{companyId}
   </select>
 
 

+ 6 - 6
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendor.java

@@ -35,11 +35,11 @@ public class Vendor extends CommonBaseEntity implements Serializable{
     /**
      * 期初应付
      */
-    private double ve_beginapamount;
+    private Double ve_beginapamount;
     /**
      * 期初预付
      */
-    private double ve_beginprepayamount;
+    private Double ve_beginprepayamount;
     /**
      * 承付天数
      */
@@ -173,19 +173,19 @@ public class Vendor extends CommonBaseEntity implements Serializable{
         this.ve_begindate = ve_begindate;
     }
 
-    public double getVe_beginapamount() {
+    public Double getVe_beginapamount() {
         return ve_beginapamount;
     }
 
-    public void setVe_beginapamount(double ve_beginapamount) {
+    public void setVe_beginapamount(Double ve_beginapamount) {
         this.ve_beginapamount = ve_beginapamount;
     }
 
-    public double getVe_beginprepayamount() {
+    public Double getVe_beginprepayamount() {
         return ve_beginprepayamount;
     }
 
-    public void setVe_beginprepayamount(double ve_beginprepayamount) {
+    public void setVe_beginprepayamount(Double ve_beginprepayamount) {
         this.ve_beginprepayamount = ve_beginprepayamount;
     }
 

+ 7 - 7
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java

@@ -164,7 +164,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
     public void audit(Pay pay) {
         Long companyId = BaseContextHolder.getCompanyId();
         int id = Math.toIntExact(pay.getMain().getId());
-        Paybalance paybalance = paybalanceMapper.selectByPrimaryKey(id);
+        Paybalance paybalance = paybalanceMapper.selectByPrimaryKey(Long.valueOf(id));
         paybalance.setPb_status(Status.AUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.AUDITED.name());
         paybalance.setCompanyId(companyId);
@@ -211,10 +211,10 @@ public class PaybalanceServiceImpl implements PaybalanceService {
          * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
          */
         Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(paybalance.getPb_vendid());
-        Double preamount = vendorData.getVe_preamount();
-        Double beginapamount = vendorData.getVe_beginapamount();
-        Double beginprepayamount= vendorData.getVe_beginprepayamount();
-        Double payamount = vendorData.getVe_payamount();
+        Double preamount = vendorData.getVe_preamount()==null?new Double(0):vendorData.getVe_preamount();
+        Double beginapamount = vendorData.getVe_beginapamount()==null?new Double(0):vendorData.getVe_beginapamount();
+        Double beginprepayamount= vendorData.getVe_beginprepayamount()==null?new Double(0):vendorData.getVe_beginprepayamount();
+        Double payamount = vendorData.getVe_payamount()==null?new Double(0):vendorData.getVe_payamount();
 
         Vendor vendor = new Vendor();
         vendor.setId(Long.valueOf(String.valueOf(paybalance.getPb_vendid())));
@@ -264,7 +264,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         paybalanceMapper.updateByPrimaryKeySelective(paybalance);
 
         //删除中间表
-        paybalance = paybalanceMapper.selectByPrimaryKey(id);
+        paybalance = paybalanceMapper.selectByPrimaryKey(Long.valueOf(id));
         subledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
         banksubledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
 
@@ -290,7 +290,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
 
     public Pay select(int id){
         Pay pay = new Pay();
-        pay.setMain(paybalanceMapper.selectByPrimaryKey(id));
+        pay.setMain(paybalanceMapper.selectByPrimaryKey(Long.valueOf(id)));
         pay.setItems1(paybalancedetMapper.selectByPrimaryKey(id));
         pay.setItems2(paybalancedetailMapper.selectByPrimaryKey(id));
         return pay;

+ 20 - 11
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java

@@ -237,10 +237,10 @@ public class RecbalanceServiceImpl implements RecbalanceService {
          * cu_leftamount=cu_beginaramount-cu_beginprerecamount+cu_recamount-cu_preamount;
          */
         Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(recbalance.getRb_custid());
-        Double preamount = customerData.getCu_preamount();
-        Double beginapamount = customerData.getCu_beginaramount();
-        Double beginprepayamount= customerData.getCu_beginprerecamount();
-        Double recamount = customerData.getCu_recamount();
+        Double preamount = customerData.getCu_preamount()==null?new Double(0):customerData.getCu_preamount();
+        Double beginapamount = customerData.getCu_beginaramount()==null?new Double(0):customerData.getCu_beginaramount();
+        Double beginprepayamount= customerData.getCu_beginprerecamount()==null?new Double(0):customerData.getCu_beginprerecamount();
+        Double recamount = customerData.getCu_recamount()==null?new Double(0):customerData.getCu_recamount();
 
         Customer customer = new Customer();
         customer.setId(Long.valueOf(String.valueOf(recbalance.getRb_custid())));
@@ -248,6 +248,15 @@ public class RecbalanceServiceImpl implements RecbalanceService {
         customer.setCu_recamount(recamount-amountTotal2);
         customer.setCu_leftamount(beginapamount-beginprepayamount+recamount-amountTotal2-preamount-amountTotal);
         recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
+
+        //更新本次核销金额
+        for (Recbalancedetail detail:recbalancedetail) {
+            Subledger subledger1 = new Subledger();
+            subledger1.setId(Long.valueOf(String.valueOf(detail.getRbd_slid())));
+            subledger1.setSl_yamount(detail.getRbd_nowbalance() - detail.getRbd_amount());
+            subledger1.setCompanyId(detail.getCompanyId());
+            subledgerMapper.updateByPrimaryKey(subledger1);
+        }
     }
 
     @Override
@@ -258,14 +267,14 @@ public class RecbalanceServiceImpl implements RecbalanceService {
          * ve_payamount=nvl(ve_payamount,0)+pb_pbdamount,
          * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
          */
-        Recbalance rec = recbalanceMapper.selectByPrimaryKey(Long.valueOf(id));
-        Double pay_preamount = rec.getRb_preamount();
-        Double pay_pbdamount = rec.getRb_rbdamount();
+        Recbalance rec = recbalanceMapper.selectByPrimaryKey(Math.toIntExact(id));
+        Double pay_preamount = rec.getRb_preamount()==null?new Double(0):rec.getRb_preamount();
+        Double pay_pbdamount = rec.getRb_rbdamount()==null?new Double(0):rec.getRb_rbdamount();
         Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(rec.getRb_custid());
-        Double preamount = customerData.getCu_preamount();
-        Double beginapamount = customerData.getCu_beginaramount();
-        Double beginprepayamount= customerData.getCu_beginprerecamount();
-        Double recamount = customerData.getCu_recamount();
+        Double preamount = customerData.getCu_preamount()==null?(new Double(0)):customerData.getCu_preamount();
+        Double beginapamount = customerData.getCu_beginaramount()==null?new Double(0):customerData.getCu_beginaramount();
+        Double beginprepayamount= customerData.getCu_beginprerecamount()==null?new Double(0):customerData.getCu_beginprerecamount();
+        Double recamount = customerData.getCu_recamount()==null?new Double(0):customerData.getCu_recamount();
         Customer customer = new Customer();
         customer.setId(Long.valueOf(String.valueOf(rec.getRb_custid())));
         customer.setCu_preamount(preamount-pay_preamount);

+ 3 - 3
applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml

@@ -100,7 +100,7 @@
     from paybalance
   </select>
 
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
     from paybalance
@@ -597,7 +597,7 @@
     <result column="ve_beginym" property="ve_beginym" jdbcType="INTEGER" />
     <result column="ve_preamount" property="ve_preamount" jdbcType="DOUBLE" />
   </resultMap>
-  <select id="selectVendorByPrimaryKey" resultMap="VendorResultMapper" parameterType="java.lang.Long" >
+  <select id="selectVendorByPrimaryKey" resultMap="VendorResultMapper" parameterType="java.lang.Integer" >
     select
     <include refid="Vendor_Column_List" />
     from vendor
@@ -698,7 +698,7 @@
         ve_beginym = #{ve_beginym,jdbcType=INTEGER},
       </if>
       <if test="ve_preamount !=null" >
-        #{ve_preamount,jdbcType=DOUBLE},
+        ve_preamount = #{ve_preamount,jdbcType=DOUBLE}
       </if>
     </set>
     where ve_id = #{id}

+ 2 - 2
applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml

@@ -735,7 +735,7 @@
     updaterid, updatetime, cu_text1, cu_text2, cu_text3, cu_text4, cu_text5, cu_leftamount,
     cu_recamount,cu_preamount
   </sql>
-  <select id="selectCustomerByPrimaryKey" parameterType="java.lang.Long" resultMap="CustomerResultMap">
+  <select id="selectCustomerByPrimaryKey" parameterType="java.lang.Integer" resultMap="CustomerResultMap">
     select
     <include refid="Customer_Column_List" />
     from customer
@@ -833,6 +833,6 @@
         cu_preamount = #{cu_preamount,jdbcType=DOUBLE},
       </if>
     </set>
-    where cu_id = #{id,jdbcType=INTEGER}
+    where cu_id = #{id}
   </update>
 </mapper>

+ 6 - 6
applications/money/money-server/src/main/resources/mapper/RecbalancedetailMapper.xml

@@ -6,7 +6,7 @@
     <result column="rbd_rbid" property="rbd_rbid" jdbcType="INTEGER" />
     <result column="rbd_detno" property="rbd_detno" jdbcType="INTEGER" />
     <result column="rbd_ym" property="rbd_ym" jdbcType="INTEGER" />
-    <result column="pb_date" property="pb_date" jdbcType="TIMESTAMP" />
+    <result column="rb_date" property="rb_date" jdbcType="TIMESTAMP" />
     <result column="rbd_slid" property="rbd_slid" jdbcType="INTEGER" />
     <result column="rbd_slcode" property="rbd_slcode" jdbcType="VARCHAR" />
     <result column="rbd_slkind" property="rbd_slkind" jdbcType="VARCHAR" />
@@ -69,7 +69,7 @@
       <if test="rbd_detno != null" >
         rbd_detno,
       </if>
-      <if test="pb_date != null" >
+      <if test="rb_date != null" >
         rbd_ym,
       </if>
       <if test="rbd_slid != null" >
@@ -125,8 +125,8 @@
       <if test="rbd_detno != null" >
         #{rbd_detno,jdbcType=INTEGER},
       </if>
-      <if test="pb_date != null" >
-        CONVERT(date_format(#{pb_date,jdbcType=TIMESTAMP},'%Y%m'),SIGNED),
+      <if test="rb_date != null" >
+        CONVERT(date_format(#{rb_date,jdbcType=TIMESTAMP},'%Y%m'),SIGNED),
       </if>
       <if test="rbd_slid != null" >
         #{rbd_slid,jdbcType=INTEGER},
@@ -184,8 +184,8 @@
       <if test="rbd_detno != null" >
         rbd_detno = #{rbd_detno,jdbcType=INTEGER},
       </if>
-      <if test="pb_date != null" >
-        rbd_ym = CONVERT(date_format(#{pb_date,jdbcType=TIMESTAMP},'%Y%m'),SIGNED),
+      <if test="rb_date != null" >
+        rbd_ym = CONVERT(date_format(#{rb_date,jdbcType=TIMESTAMP},'%Y%m'),SIGNED),
       </if>
       <if test="rbd_slid != null" >
         rbd_slid = #{rbd_slid,jdbcType=INTEGER},

+ 4 - 188
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/Make.java

@@ -1,10 +1,12 @@
 package com.usoftchina.saas.storage.po;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
 
+@Data
 public class Make extends CommonBaseEntity implements Serializable {
     private String ma_code;
 
@@ -54,195 +56,9 @@ public class Make extends CommonBaseEntity implements Serializable {
 
     private String ma_text5;
 
-    public String getMa_whname() {
-        return ma_whname;
-    }
+    private String ma_auditman;
 
-    public void setMa_whname(String ma_whname) {
-        this.ma_whname = ma_whname;
-    }
+    private Date ma_auditdate;
 
-    public String getMa_code() {
-        return ma_code;
-    }
 
-    public void setMa_code(String ma_code) {
-        this.ma_code = ma_code == null ? null : ma_code.trim();
-    }
-
-    public String getMa_status() {
-        return ma_status;
-    }
-
-    public void setMa_status(String ma_status) {
-        this.ma_status = ma_status == null ? null : ma_status.trim();
-    }
-
-    public String getMa_statuscode() {
-        return ma_statuscode;
-    }
-
-    public void setMa_statuscode(String ma_statuscode) {
-        this.ma_statuscode = ma_statuscode == null ? null : ma_statuscode.trim();
-    }
-
-    public String getMa_type() {
-        return ma_type;
-    }
-
-    public void setMa_type(String ma_type) {
-        this.ma_type = ma_type == null ? null : ma_type.trim();
-    }
-
-    public Long getMa_prodid() {
-        return ma_prodid;
-    }
-
-    public void setMa_prodid(Long ma_prodid) {
-        this.ma_prodid = ma_prodid;
-    }
-
-    public String getMa_prodcode() {
-        return ma_prodcode;
-    }
-
-    public void setMa_prodcode(String ma_prodcode) {
-        this.ma_prodcode = ma_prodcode == null ? null : ma_prodcode.trim();
-    }
-
-    public String getMa_proddetail() {
-        return ma_proddetail;
-    }
-
-    public void setMa_proddetail(String ma_proddetail) {
-        this.ma_proddetail = ma_proddetail == null ? null : ma_proddetail.trim();
-    }
-
-    public String getMa_prodspec() {
-        return ma_prodspec;
-    }
-
-    public void setMa_prodspec(String ma_prodspec) {
-        this.ma_prodspec = ma_prodspec == null ? null : ma_prodspec.trim();
-    }
-
-    public String getMa_version() {
-        return ma_version;
-    }
-
-    public void setMa_version(String ma_version) {
-        this.ma_version = ma_version == null ? null : ma_version.trim();
-    }
-
-    public String getMa_produnit() {
-        return ma_produnit;
-    }
-
-    public void setMa_produnit(String ma_produnit) {
-        this.ma_produnit = ma_produnit == null ? null : ma_produnit.trim();
-    }
-
-    public Double getMa_qty() {
-        return ma_qty;
-    }
-
-    public void setMa_qty(Double ma_qty) {
-        this.ma_qty = ma_qty;
-    }
-
-    public Integer getMa_whid() {
-        return ma_whid;
-    }
-
-    public void setMa_whid(Integer ma_whid) {
-        this.ma_whid = ma_whid;
-    }
-
-    public String getMa_whcode() {
-        return ma_whcode;
-    }
-
-    public void setMa_whcode(String ma_whcode) {
-        this.ma_whcode = ma_whcode == null ? null : ma_whcode.trim();
-    }
-
-    public Date getMa_recorddate() {
-        return ma_recorddate;
-    }
-
-    public void setMa_recorddate(Date ma_recorddate) {
-        this.ma_recorddate = ma_recorddate;
-    }
-
-    public Integer getMa_recordid() {
-        return ma_recordid;
-    }
-
-    public void setMa_recordid(Integer ma_recordid) {
-        this.ma_recordid = ma_recordid;
-    }
-
-    public String getMa_recorder() {
-        return ma_recorder;
-    }
-
-    public void setMa_recorder(String ma_recorder) {
-        this.ma_recorder = ma_recorder == null ? null : ma_recorder.trim();
-    }
-
-    public Double getMa_price() {
-        return ma_price;
-    }
-
-    public void setMa_price(Double ma_price) {
-        this.ma_price = ma_price;
-    }
-
-    public Double getMa_total() {
-        return ma_total;
-    }
-
-    public void setMa_total(Double ma_total) {
-        this.ma_total = ma_total;
-    }
-
-    public String getMa_text1() {
-        return ma_text1;
-    }
-
-    public void setMa_text1(String ma_text1) {
-        this.ma_text1 = ma_text1 == null ? null : ma_text1.trim();
-    }
-
-    public String getMa_text2() {
-        return ma_text2;
-    }
-
-    public void setMa_text2(String ma_text2) {
-        this.ma_text2 = ma_text2 == null ? null : ma_text2.trim();
-    }
-
-    public String getMa_text3() {
-        return ma_text3;
-    }
-
-    public void setMa_text3(String ma_text3) {
-        this.ma_text3 = ma_text3 == null ? null : ma_text3.trim();
-    }
-
-    public String getMa_text4() {
-        return ma_text4;
-    }
-
-    public void setMa_text4(String ma_text4) {
-        this.ma_text4 = ma_text4 == null ? null : ma_text4.trim();
-    }
-
-    public String getMa_text5() {
-        return ma_text5;
-    }
-
-    public void setMa_text5(String ma_text5) {
-        this.ma_text5 = ma_text5 == null ? null : ma_text5.trim();
-    }
 }

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

@@ -28,4 +28,6 @@ public interface MakeMapper extends CommonBaseMapper<Make> {
     double getOnHand(@Param("prodcode") String prodcode, @Param("whcode") String whcode, @Param("companyId") Long companyId);
 
     String selectMakeInOutCode(@Param("code") String code, @Param("companyId") Long companyId, @Param("type") String type);
+
+    void calcMakePriceAndTotal(Long id);
 }

+ 20 - 2
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -2,7 +2,6 @@ package com.usoftchina.saas.storage.service.impl;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.api.MessageLogService;
@@ -28,7 +27,6 @@ import com.usoftchina.saas.storage.po.ProdInOut;
 import com.usoftchina.saas.storage.service.MakeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
@@ -106,6 +104,12 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             //记录LOG
             docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
             messageLogService.save(docBaseDTO);
+
+
+            //抓取出库单位成本,计算出库成本
+            calcMakePriceAndTotal(make.getId());
+
+
         }else{
             //更新主表
             make.setUpdaterId(BaseContextHolder.getUserId());
@@ -142,10 +146,19 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             //记录LOG
             docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
             messageLogService.update(docBaseDTO);
+
+            //抓取出库单位成本,计算出库成本
+            calcMakePriceAndTotal(make.getId());
+
         }
         return docBaseDTO;
     }
 
+    private void calcMakePriceAndTotal(Long id) {
+        getMapper().calcMakePriceAndTotal(id);
+    }
+
+
     /**
      * 校验库存是否足够
      * @param makeListDTO
@@ -252,6 +265,9 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             DocBaseDTO docBaseDTO = saveOrUpdate(makeListDTO);
             make.setId(docBaseDTO.getId());
         }
+        //抓取出库单位成本,计算出库成本
+        calcMakePriceAndTotal(make.getId());
+
         //2.校验库存是否足够
         validStorage(makeListDTO);
         //3.生成  完工入库单和领料单 并 过账
@@ -262,6 +278,8 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         make.setMa_statuscode(Status.AUDITED.name());
         make.setUpdateTime(new Date());
         make.setUpdaterId(BaseContextHolder.getUserId());
+        make.setMa_auditman("");
+        make.setMa_auditdate(new Date());
         getMapper().updateByPrimaryKeySelective(make);
         DocBaseDTO docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
         //5.记录LOG

+ 45 - 6
applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml

@@ -17,11 +17,13 @@
     <result column="ma_whid" property="ma_whid" jdbcType="INTEGER" />
     <result column="ma_whcode" property="ma_whcode" jdbcType="VARCHAR" />
     <result column="ma_whname" property="ma_whname" jdbcType="VARCHAR" />
-    <result column="ma_recorddate" property="ma_recorddate" jdbcType="TIMESTAMP" />
+    <result column="ma_recorddate" property="createTime" jdbcType="TIMESTAMP" />
     <result column="ma_recordid" property="ma_recordid" jdbcType="INTEGER" />
     <result column="ma_recorder" property="ma_recorder" jdbcType="VARCHAR" />
     <result column="ma_price" property="ma_price" jdbcType="DOUBLE" />
     <result column="ma_total" property="ma_total" jdbcType="DOUBLE" />
+    <result column="ma_auditman" property="ma_auditman" jdbcType="DOUBLE" />
+    <result column="ma_auditdate" property="ma_auditdate" jdbcType="DOUBLE" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
@@ -34,7 +36,7 @@
   <sql id="Base_Column_List" >
     ma_id, ma_code, ma_status, ma_statuscode, ma_type, ma_prodid, ma_prodcode, ma_proddetail, 
     ma_prodspec, ma_version, ma_produnit, ma_qty, ma_whid, ma_whcode, ma_whname, ma_recorddate,
-    ma_recordid, ma_recorder, ma_price, ma_total, companyId, updaterId, updateTime, ma_text1, 
+    ma_recordid, ma_recorder, ma_price, ma_total,ma_auditman,ma_auditdate, companyId, updaterId, updateTime, ma_text1,
     ma_text2, ma_text3, ma_text4, ma_text5
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
@@ -57,7 +59,7 @@
       ma_version, ma_produnit, ma_qty, 
       ma_whid, ma_whcode, ma_whname, ma_recorddate,
       ma_recordid, ma_recorder, ma_price, 
-      ma_total, companyId, updaterId, 
+      ma_total, ma_auditman,ma_auditdate,companyId, updaterId,
       updateTime, ma_text1, ma_text2, 
       ma_text3, ma_text4, ma_text5
       )
@@ -67,7 +69,7 @@
       #{ma_version,jdbcType=VARCHAR}, #{ma_produnit,jdbcType=VARCHAR}, #{ma_qty,jdbcType=DOUBLE}, 
       #{ma_whid,jdbcType=INTEGER}, #{ma_whcode,jdbcType=VARCHAR}, #{ma_whname,jdbcType=VARCHAR}, #{ma_recorddate,jdbcType=TIMESTAMP},
       #{ma_recordid,jdbcType=INTEGER}, #{ma_recorder,jdbcType=VARCHAR}, #{ma_price,jdbcType=DOUBLE}, 
-      #{ma_total,jdbcType=DOUBLE}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
+      #{ma_total,jdbcType=DOUBLE}, #{ma_auditman,jdbcType=VARCHAR},#{ma_auditdate.jdbcType=TIMESTAMP},#{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
       #{updateTime,jdbcType=TIMESTAMP}, #{ma_text1,jdbcType=VARCHAR}, #{ma_text2,jdbcType=VARCHAR}, 
       #{ma_text3,jdbcType=VARCHAR}, #{ma_text4,jdbcType=VARCHAR}, #{ma_text5,jdbcType=VARCHAR}
       )
@@ -120,7 +122,7 @@
       <if test="ma_whname != null" >
           ma_whname,
       </if>
-      <if test="ma_recorddate != null" >
+      <if test="createTime != null" >
         ma_recorddate,
       </if>
       <if test="ma_recordid != null" >
@@ -135,6 +137,12 @@
       <if test="ma_total != null" >
         ma_total,
       </if>
+      <if test="ma_auditman !=null">
+        ma_auditman,
+      </if>
+      <if test="ma_auditdate !=null">
+        ma_auditdate,
+      </if>
       <if test="companyId != null" >
         companyId,
       </if>
@@ -218,6 +226,16 @@
       <if test="ma_total != null" >
         #{ma_total,jdbcType=DOUBLE},
       </if>
+      <if test="ma_auditman !=null">
+        #{ma_auditman,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_auditdate !=null">
+        #{ma_auditdate,jdbcType=TIMESTAMP},
+      </if>
+
+
+
+
       <if test="companyId != null" >
         #{companyId,jdbcType=INTEGER},
       </if>
@@ -304,6 +322,15 @@
       <if test="ma_total != null" >
         ma_total = #{ma_total,jdbcType=DOUBLE},
       </if>
+      <if test="ma_auditman !=null">
+        ma_auditman = #{ma_auditman,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_auditdate !=null">
+        ma_auditdate =  #{ma_auditdate,jdbcType=TIMESTAMP},
+      </if>
+
+
+
       <if test="companyId != null" >
         companyId = #{companyId,jdbcType=INTEGER},
       </if>
@@ -352,6 +379,9 @@
       ma_recorder = #{ma_recorder,jdbcType=VARCHAR},
       ma_price = #{ma_price,jdbcType=DOUBLE},
       ma_total = #{ma_total,jdbcType=DOUBLE},
+      ma_auditman = #{ma_auditman,jdbcType=VARCHAR},
+      ma_auditdate = #{ma_auditdate,jdbcType=TIMESTAMP},
+
       companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updateTime = #{updateTime,jdbcType=TIMESTAMP},
@@ -370,7 +400,7 @@
       </if>
       AND MAKE.COMPANYID = #{companyId}
     </where>
-    order by MA_ID
+    order by MA_ID desc
   </select>
   <select id="validateCodeWhenInsert" resultType="int">
     select count(*) from MAKE where MA_CODE = #{code} and companyId =#{companyId}
@@ -386,4 +416,13 @@
     <select id="selectMakeInOutCode" resultType="string">
         SELECT PI_INOUTNO FROM PRODINOUT WHERE COMPANYID=#{companyId} AND PI_TEXT1=#{code} AND PI_CLASS=#{type}
     </select>
+
+  <update id="calcMakePriceAndTotal" parameterType="long" >
+  update makematerial set mm_price = (select pw_avprice from productwh where pw_prodid = mm_prodid and pw_whid = mm_whid) where mm_maid = #{id};
+  update makematerial set mm_amount = round(mm_price*mm_qty,2) where mm_maid = #{id};
+  update make set ma_total = round((select sum(mm_amount) from makematerial where mm_maid = #{id} ),2) where ma_id = #{id};
+  update make set ma_price = ma_total/ma_qty where ma_id = #{id};
+  </update>
+
+
 </mapper>

+ 3 - 2
frontend/saas-web/app/view/money/payBalance/FormPanel.js

@@ -23,8 +23,8 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
 
     // _readUrl: 'http://192.168.253.129:8940/money/paybalance/read/',
     // _saveUrl: 'http://192.168.253.129:8940/money/paybalance/save/',
-    // _auditUrl: 'http://192.168.253.129:8940/money/paybalance/audit/',
-    // _unAuditUrl: 'http://192.168.253.129:8940/money/paybalance/unAudit/',
+    // _auditUrl: 'http://192.168.253.35:8880/paybalance/audit/',
+    // _unAuditUrl: 'http://192.168.253.35Pb_pdamount:8880/paybalance/unAudit/',
     // _deleteUrl: 'http://192.168.253.129:8940/money/paybalance/delete/',
     
     initId: 0,
@@ -287,6 +287,7 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
             text: "本次核销金额",
             xtype: 'numbercolumn',
             dataIndex: "pbd_nowbalance",
+            width: 150,
             editor : {
                 xtype : "numberfield",
                 decimalPrecision: 2

+ 1 - 1
frontend/saas-web/app/view/money/payBalance/FormPanelController.js

@@ -306,7 +306,7 @@ Ext.define('saas.view.money.payBalance.FormPanelController', {
         var sum_pbd_nowbalance = store2.sum('pbd_nowbalance'); // 本次核销金额合计
 
         var flag = sum_pd_amount + pb_discounts - sum_pbd_nowbalance;
-
+         viewModel.set("pb_preamount",flag);
         if(flag != 0) {
             var t = flag > 0 ? '大' : '小';
 

+ 2 - 0
frontend/saas-web/app/view/money/recBalance/FormPanel.js

@@ -23,6 +23,8 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
     _deleteUrl: '/api/money/recbalance/delete/',
 
     // _saveUrl: 'http://192.168.253.35:8880/recbalance/save/',
+    // _auditUrl: 'http://192.168.253.35:8880/recbalance/audit/',
+    // _unAuditUrl: 'http://192.168.253.35:8880/recbalance/unAudit/',
 
 
     initId: 0,

+ 1 - 0
frontend/saas-web/app/view/money/recBalance/FormPanelController.js

@@ -382,6 +382,7 @@ Ext.define('saas.view.money.recBalance.FormPanelController', {
 
         var flag = sum_rd_amount + rb_discounts - sum_rbd_nowbalance;
 
+        viewModel.set("rb_preamount",flag);
         if(flag != 0) {
             var t = flag > 0 ? '大' : '小';
 

+ 2 - 0
frontend/saas-web/app/view/purchase/purchase/FormPanelController.js

@@ -116,6 +116,8 @@ Ext.define('saas.view.purchase.purchase.FormPanelController', {
                             from:'pr_spec',to:'pr_spec'
                         },{
                             from:'pr_purcprice',to:'pd_price'
+                        },{
+                            from:'pr_zxbzs',to:'pr_zxbzs'
                         }],
                         //联想设置
                         dbtpls:[{

+ 16 - 31
frontend/saas-web/app/view/stock/make/FormPanel.js

@@ -34,6 +34,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
     },{
         xtype: 'combobox',
         name: 'ma_type',
+        allowBlank : false,
         columnWidth: 0.25,
         fieldLabel: '类型',
         queryMode: 'local',
@@ -90,7 +91,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
         fieldLabel : "数量",
         columnWidth: 0.25,
         allowBlank : false,
-        minValue:0
+        minValue:1
     },{
         xtype : "hidden", 
         name : "ma_whid", 
@@ -226,7 +227,7 @@ Ext.define('saas.view.stock.make.FormPanel', {
                 xtype: 'numbercolumn',
                 dataIndex : "mm_oneuseqty", 
                 width : 120.0,
-                // hidden:true,
+                hidden:true,
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 8,
@@ -335,41 +336,25 @@ Ext.define('saas.view.stock.make.FormPanel', {
                     xtype : "textfield"
                 },
             }]
-    },{
-        xtype : "datefield", 
-        name : "createTime", 
-        fieldLabel : "录入日期",
-        readOnly:true,
-        columnWidth : 0.25
     },{
         xtype : "textfield", 
         name : "ma_recorder", 
-        fieldLabel : "录入人",
-        columnWidth: 0.2
-    },{
+        fieldLabel : "录入人", 
+        readOnly:true
+    }, {
         xtype : "datefield", 
-        name : "updateTime", 
-        bind : "{updateTime}", 
-        fieldLabel : "更新日期", 
-        allowBlank : true, 
-        columnWidth : 0.25
+        name : "createTime", 
+        fieldLabel : "录入日期",
+        readOnly:true
     }, {
         xtype : "textfield", 
-        readOnly : true, 
-        editable : false, 
-        name : "ma_status", 
-        bind : "{ma_status}", 
-        fieldLabel : "单据状态", 
-        allowBlank : true, 
-        columnWidth : 0.25
+        name : "ma_auditman", 
+        fieldLabel : "审核人", 
+        readOnly:true
     }, {
-        xtype : "hidden", 
-        readOnly : true, 
-        editable : false, 
-        name : "ma_statuscode", 
-        bind : "{ma_statuscode}", 
-        fieldLabel : "单据状态码", 
-        allowBlank : true, 
-        columnWidth : 0.0
+        xtype : "datefield", 
+        name : "ma_auditdate", 
+        fieldLabel : "审核日期",
+        readOnly:true
     }]
 });

+ 3 - 2
frontend/saas-web/app/view/stock/make/FormPanelController.js

@@ -500,8 +500,8 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                 Ext.Array.each(data, function(item, i) {
                     loadData.push({
                         mm_detno:item.bd_detno,
-                        mm_prodidid:item.bd_sonid,
-                        mm_prodcode:item.bd_soncode,
+                        mm_prodid:item.productDTO.id,
+                        mm_prodcode:item.productDTO.pr_code,
                         mm_oneuseqty:item.bd_baseqty,
                         pr_detail:item.productDTO.pr_detail,
                         pr_spec:item.productDTO.pr_spec,
@@ -513,6 +513,7 @@ Ext.define('saas.view.stock.make.FormPanelController', {
                         mm_whname:item.productDTO.pr_whname
                     })                
                 });
+                console.log(loadData);
                 store.loadData(loadData);
             }
         })

+ 0 - 3
frontend/saas-web/app/view/stock/make/FormPanelModel.js

@@ -14,9 +14,6 @@ Ext.define('saas.view.stock.make.FormPanelModel', {
                     oneuseqty = item.get('mm_oneuseqty');
                     item.set('mm_qty', oneuseqty*v);               
                 });
-
-                debugger;
-
                 return v;
             }
         }

+ 6 - 9
frontend/saas-web/app/view/stock/otherIn/FormPanelController.js

@@ -94,20 +94,17 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                         dataUrl: '/api/document/customer/list',
                         // dataUrl:'http://localhost:9480/customer/list',
                         dbfinds: [{
-                            from: 'id',
-                            to: 'pi_custid',ignore:true
+                            from: 'id',to: 'pi_custid',ignore:true
                         }, {
-                            from: 'cu_code',
-                            to: 'pi_custcode'
+                            from: 'cu_code',to: 'pi_custcode'
                         }, {
-                            from: 'cu_name',
-                            to: 'pi_custname'
+                            from: 'cu_name',to: 'pi_custname'
                         }],
                         dbtpls: [{
-                            field: 'pi_custcode',
+                            field: 'cu_code',
                             width: 100
                         }, {
-                            field: 'pi_custname',
+                            field: 'cu_name',
                             width: 100
                         }],
                         defaultCondition:"cu_statuscode='OPEN'",
@@ -191,7 +188,7 @@ Ext.define('saas.view.stock.otherIn.FormPanelController', {
                             from:'pr_whcode',to:'pd_whcode'
                         },{
                             from:'pr_whname',to:'pd_whname'
-                        },,{
+                        },{
                             from:'pr_purcprice',to:'pd_orderprice'
                         }],
                         dbtpls: [{

+ 1 - 1
frontend/saas-web/app/view/stock/otherOut/FormPanelController.js

@@ -182,7 +182,7 @@ Ext.define('saas.view.stock.otherOut.FormPanelController', {
                             from:'pr_whcode',to:'pd_whcode'
                         },{
                             from:'pr_whname',to:'pd_whname'
-                        },,{
+                        },{
                             from:'pr_purcprice',to:'pd_orderprice'
                         }],
                         dbtpls:[{