Browse Source

资金模块-调整后台逻辑,调整字段

huangx 7 years ago
parent
commit
cc237a075d

+ 189 - 0
applications/money/money-dto/src/main/java/com/usoftchina/saas/money/po/Bankinformation.java

@@ -0,0 +1,189 @@
+package com.usoftchina.saas.money.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Bankinformation extends CommonBaseEntity implements Serializable {
+
+    private String bk_bankcode;
+
+    private String bk_bankname;
+
+    private Date bk_date;
+
+    private String bk_type;
+
+    private Double bk_beginamount;
+
+    private Double bk_thisamount;
+
+    private String bk_status;
+
+    private String bk_statuscode;
+
+    private Integer bk_recorderid;
+
+    private String bk_recorder;
+
+    private Date bk_recorddate;
+
+    private Integer bk_ym;
+
+    private String bk_text1;
+
+    private String bk_text2;
+
+    private String bk_text3;
+
+    private String bk_text4;
+
+    private String bk_text5;
+
+    private String bk_remark;
+
+    public String getBk_bankcode() {
+        return bk_bankcode;
+    }
+
+    public void setBk_bankcode(String bk_bankcode) {
+        this.bk_bankcode = bk_bankcode;
+    }
+
+    public String getBk_bankname() {
+        return bk_bankname;
+    }
+
+    public void setBk_bankname(String bk_bankname) {
+        this.bk_bankname = bk_bankname;
+    }
+
+    public Date getBk_date() {
+        return bk_date;
+    }
+
+    public void setBk_date(Date bk_date) {
+        this.bk_date = bk_date;
+    }
+
+    public String getBk_type() {
+        return bk_type;
+    }
+
+    public void setBk_type(String bk_type) {
+        this.bk_type = bk_type;
+    }
+
+    public Double getBk_beginamount() {
+        return bk_beginamount;
+    }
+
+    public void setBk_beginamount(Double bk_beginamount) {
+        this.bk_beginamount = bk_beginamount;
+    }
+
+    public Double getBk_thisamount() {
+        return bk_thisamount;
+    }
+
+    public void setBk_thisamount(Double bk_thisamount) {
+        this.bk_thisamount = bk_thisamount;
+    }
+
+    public String getBk_status() {
+        return bk_status;
+    }
+
+    public void setBk_status(String bk_status) {
+        this.bk_status = bk_status;
+    }
+
+    public String getBk_statuscode() {
+        return bk_statuscode;
+    }
+
+    public void setBk_statuscode(String bk_statuscode) {
+        this.bk_statuscode = bk_statuscode;
+    }
+
+    public Integer getBk_recorderid() {
+        return bk_recorderid;
+    }
+
+    public void setBk_recorderid(Integer bk_recorderid) {
+        this.bk_recorderid = bk_recorderid;
+    }
+
+    public String getBk_recorder() {
+        return bk_recorder;
+    }
+
+    public void setBk_recorder(String bk_recorder) {
+        this.bk_recorder = bk_recorder;
+    }
+
+    public Date getBk_recorddate() {
+        return bk_recorddate;
+    }
+
+    public void setBk_recorddate(Date bk_recorddate) {
+        this.bk_recorddate = bk_recorddate;
+    }
+
+    public Integer getBk_ym() {
+        return bk_ym;
+    }
+
+    public void setBk_ym(Integer bk_ym) {
+        this.bk_ym = bk_ym;
+    }
+
+    public String getBk_text1() {
+        return bk_text1;
+    }
+
+    public void setBk_text1(String bk_text1) {
+        this.bk_text1 = bk_text1;
+    }
+
+    public String getBk_text2() {
+        return bk_text2;
+    }
+
+    public void setBk_text2(String bk_text2) {
+        this.bk_text2 = bk_text2;
+    }
+
+    public String getBk_text3() {
+        return bk_text3;
+    }
+
+    public void setBk_text3(String bk_text3) {
+        this.bk_text3 = bk_text3;
+    }
+
+    public String getBk_text4() {
+        return bk_text4;
+    }
+
+    public void setBk_text4(String bk_text4) {
+        this.bk_text4 = bk_text4;
+    }
+
+    public String getBk_text5() {
+        return bk_text5;
+    }
+
+    public void setBk_text5(String bk_text5) {
+        this.bk_text5 = bk_text5;
+    }
+
+    public String getBk_remark() {
+        return bk_remark;
+    }
+
+    public void setBk_remark(String bk_remark) {
+        this.bk_remark = bk_remark;
+    }
+}

+ 271 - 0
applications/money/money-dto/src/main/java/com/usoftchina/saas/money/po/Customer.java

@@ -0,0 +1,271 @@
+package com.usoftchina.saas.money.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class Customer extends CommonBaseEntity implements Serializable {
+
+    private String cu_code;
+
+    private String cu_name;
+
+    private String cu_uu;
+
+    private String cu_type;
+
+    private Date cu_begindate;
+
+    private Double cu_beginaramount;
+
+    private Double cu_beginprerecamount;
+
+    private Double cu_promisedays;
+
+    private Double cu_taxrate;
+
+    private Integer cu_sellerid;
+
+    private String cu_sellercode;
+
+    private String cu_sellername;
+
+    private Double cu_credit;
+
+    private String cu_status;
+
+    private String cu_statuscode;
+
+    private Integer cu_recordmanid;
+
+    private String cu_recordman;
+
+    private Date cu_recorddate;
+
+    private String cu_text1;
+
+    private String cu_text2;
+
+    private String cu_text3;
+
+    private String cu_text4;
+
+    private String cu_text5;
+
+    private Double cu_leftamount;
+
+    private Double cu_recamount;
+
+    private Double cu_preamount;
+
+    public String getCu_code() {
+        return cu_code;
+    }
+
+    public void setCu_code(String cu_code) {
+        this.cu_code = cu_code;
+    }
+
+    public String getCu_name() {
+        return cu_name;
+    }
+
+    public void setCu_name(String cu_name) {
+        this.cu_name = cu_name;
+    }
+
+    public String getCu_uu() {
+        return cu_uu;
+    }
+
+    public void setCu_uu(String cu_uu) {
+        this.cu_uu = cu_uu;
+    }
+
+    public String getCu_type() {
+        return cu_type;
+    }
+
+    public void setCu_type(String cu_type) {
+        this.cu_type = cu_type;
+    }
+
+    public Date getCu_begindate() {
+        return cu_begindate;
+    }
+
+    public void setCu_begindate(Date cu_begindate) {
+        this.cu_begindate = cu_begindate;
+    }
+
+    public Double getCu_beginaramount() {
+        return cu_beginaramount;
+    }
+
+    public void setCu_beginaramount(Double cu_beginaramount) {
+        this.cu_beginaramount = cu_beginaramount;
+    }
+
+    public Double getCu_beginprerecamount() {
+        return cu_beginprerecamount;
+    }
+
+    public void setCu_beginprerecamount(Double cu_beginprerecamount) {
+        this.cu_beginprerecamount = cu_beginprerecamount;
+    }
+
+    public Double getCu_promisedays() {
+        return cu_promisedays;
+    }
+
+    public void setCu_promisedays(Double cu_promisedays) {
+        this.cu_promisedays = cu_promisedays;
+    }
+
+    public Double getCu_taxrate() {
+        return cu_taxrate;
+    }
+
+    public void setCu_taxrate(Double cu_taxrate) {
+        this.cu_taxrate = cu_taxrate;
+    }
+
+    public Integer getCu_sellerid() {
+        return cu_sellerid;
+    }
+
+    public void setCu_sellerid(Integer cu_sellerid) {
+        this.cu_sellerid = cu_sellerid;
+    }
+
+    public String getCu_sellercode() {
+        return cu_sellercode;
+    }
+
+    public void setCu_sellercode(String cu_sellercode) {
+        this.cu_sellercode = cu_sellercode;
+    }
+
+    public String getCu_sellername() {
+        return cu_sellername;
+    }
+
+    public void setCu_sellername(String cu_sellername) {
+        this.cu_sellername = cu_sellername;
+    }
+
+    public Double getCu_credit() {
+        return cu_credit;
+    }
+
+    public void setCu_credit(Double cu_credit) {
+        this.cu_credit = cu_credit;
+    }
+
+    public String getCu_status() {
+        return cu_status;
+    }
+
+    public void setCu_status(String cu_status) {
+        this.cu_status = cu_status;
+    }
+
+    public String getCu_statuscode() {
+        return cu_statuscode;
+    }
+
+    public void setCu_statuscode(String cu_statuscode) {
+        this.cu_statuscode = cu_statuscode;
+    }
+
+    public Integer getCu_recordmanid() {
+        return cu_recordmanid;
+    }
+
+    public void setCu_recordmanid(Integer cu_recordmanid) {
+        this.cu_recordmanid = cu_recordmanid;
+    }
+
+    public String getCu_recordman() {
+        return cu_recordman;
+    }
+
+    public void setCu_recordman(String cu_recordman) {
+        this.cu_recordman = cu_recordman;
+    }
+
+    public Date getCu_recorddate() {
+        return cu_recorddate;
+    }
+
+    public void setCu_recorddate(Date cu_recorddate) {
+        this.cu_recorddate = cu_recorddate;
+    }
+
+    public String getCu_text1() {
+        return cu_text1;
+    }
+
+    public void setCu_text1(String cu_text1) {
+        this.cu_text1 = cu_text1;
+    }
+
+    public String getCu_text2() {
+        return cu_text2;
+    }
+
+    public void setCu_text2(String cu_text2) {
+        this.cu_text2 = cu_text2;
+    }
+
+    public String getCu_text3() {
+        return cu_text3;
+    }
+
+    public void setCu_text3(String cu_text3) {
+        this.cu_text3 = cu_text3;
+    }
+
+    public String getCu_text4() {
+        return cu_text4;
+    }
+
+    public void setCu_text4(String cu_text4) {
+        this.cu_text4 = cu_text4;
+    }
+
+    public String getCu_text5() {
+        return cu_text5;
+    }
+
+    public void setCu_text5(String cu_text5) {
+        this.cu_text5 = cu_text5;
+    }
+
+    public Double getCu_leftamount() {
+        return cu_leftamount;
+    }
+
+    public void setCu_leftamount(Double cu_leftamount) {
+        this.cu_leftamount = cu_leftamount;
+    }
+
+    public Double getCu_recamount() {
+        return cu_recamount;
+    }
+
+    public void setCu_recamount(Double cu_recamount) {
+        this.cu_recamount = cu_recamount;
+    }
+
+    public Double getCu_preamount() {
+        return cu_preamount;
+    }
+
+    public void setCu_preamount(Double cu_preamount) {
+        this.cu_preamount = cu_preamount;
+    }
+}

+ 319 - 0
applications/money/money-dto/src/main/java/com/usoftchina/saas/money/po/Vendor.java

@@ -0,0 +1,319 @@
+package com.usoftchina.saas.money.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 供应商资料
+ * @author chenwei
+ * @Date 2018/10/13
+ */
+public class Vendor extends CommonBaseEntity implements Serializable{
+
+    /**
+     * 供应商编号
+     */
+    private String ve_code;
+    /**
+     * 供应商名称
+     */
+    private String ve_name;
+    /**
+     * 供应商UU
+     */
+    private String ve_uu;
+    /**
+     * 供应商类型
+     */
+    private String ve_type;
+    /**
+     * 期初日期
+     */
+    private Date ve_begindate;
+    /**
+     * 期初应付
+     */
+    private double ve_beginapamount;
+    /**
+     * 期初预付
+     */
+    private double ve_beginprepayamount;
+    /**
+     * 承付天数
+     */
+    private Long ve_promisedays;
+    /**
+     * 税率
+     */
+    private Double ve_taxrate;
+    /**
+     * 纳税人识别号
+     */
+    private String ve_nsrzh;
+    /**
+     * 银行账号
+     */
+    private String ve_bankaccount;
+    /**
+     * 银行行号
+     */
+    private String ve_bankcode;
+    /**
+     * 状态   defualt "启用"
+     */
+    private String ve_status;
+    /**
+     * 状态码
+     */
+    private String ve_statuscode;
+    /**
+     * 录入人ID
+     */
+    private Long ve_recordid;
+    /**
+     * 录入人
+     */
+    private String ve_recordname;
+    /**
+     * 建立日期
+     */
+    private Date ve_initdate;
+    /**
+     * 自定义字段
+     */
+    private String ve_text1;
+    /**
+     * 自定义字段
+     */
+    private String ve_text2;
+    /**
+     * 自定义字段
+     */
+    private String ve_text3;
+    /**
+     * 自定义字段
+     */
+    private String ve_text4;
+    /**
+     * 自定义字段
+     */
+    private String ve_text5;
+
+    private Double ve_payamount;
+
+    private Double ve_leftamount;
+
+    private Integer ve_beginym;
+
+    private Double ve_preamount;
+
+    public Double getVe_payamount() {
+        return ve_payamount;
+    }
+
+    public void setVe_payamount(Double ve_payamount) {
+        this.ve_payamount = ve_payamount;
+    }
+
+    public Double getVe_leftamount() {
+        return ve_leftamount;
+    }
+
+    public void setVe_leftamount(Double ve_leftamount) {
+        this.ve_leftamount = ve_leftamount;
+    }
+
+    public Integer getVe_beginym() {
+        return ve_beginym;
+    }
+
+    public void setVe_beginym(Integer ve_beginym) {
+        this.ve_beginym = ve_beginym;
+    }
+
+    public String getVe_code() {
+        return ve_code;
+    }
+
+    public void setVe_code(String ve_code) {
+        this.ve_code = ve_code;
+    }
+
+    public String getVe_name() {
+        return ve_name;
+    }
+
+    public void setVe_name(String ve_name) {
+        this.ve_name = ve_name;
+    }
+
+    public String getVe_uu() {
+        return ve_uu;
+    }
+
+    public void setVe_uu(String ve_uu) {
+        this.ve_uu = ve_uu;
+    }
+
+    public String getVe_type() {
+        return ve_type;
+    }
+
+    public void setVe_type(String ve_type) {
+        this.ve_type = ve_type;
+    }
+
+    public Date getVe_begindate() {
+        return ve_begindate;
+    }
+
+    public void setVe_begindate(Date ve_begindate) {
+        this.ve_begindate = ve_begindate;
+    }
+
+    public double getVe_beginapamount() {
+        return ve_beginapamount;
+    }
+
+    public void setVe_beginapamount(double ve_beginapamount) {
+        this.ve_beginapamount = ve_beginapamount;
+    }
+
+    public double getVe_beginprepayamount() {
+        return ve_beginprepayamount;
+    }
+
+    public void setVe_beginprepayamount(double ve_beginprepayamount) {
+        this.ve_beginprepayamount = ve_beginprepayamount;
+    }
+
+    public Long getVe_promisedays() {
+        return ve_promisedays;
+    }
+
+    public void setVe_promisedays(Long ve_promisedays) {
+        this.ve_promisedays = ve_promisedays;
+    }
+
+    public Double getVe_taxrate() {
+        return ve_taxrate;
+    }
+
+    public void setVe_taxrate(Double ve_taxrate) {
+        this.ve_taxrate = ve_taxrate;
+    }
+
+    public String getVe_nsrzh() {
+        return ve_nsrzh;
+    }
+
+    public void setVe_nsrzh(String ve_nsrzh) {
+        this.ve_nsrzh = ve_nsrzh;
+    }
+
+    public String getVe_bankaccount() {
+        return ve_bankaccount;
+    }
+
+    public void setVe_bankaccount(String ve_bankaccount) {
+        this.ve_bankaccount = ve_bankaccount;
+    }
+
+    public String getVe_bankcode() {
+        return ve_bankcode;
+    }
+
+    public void setVe_bankcode(String ve_bankcode) {
+        this.ve_bankcode = ve_bankcode;
+    }
+
+    public String getVe_status() {
+        return ve_status;
+    }
+
+    public void setVe_status(String ve_status) {
+        this.ve_status = ve_status;
+    }
+
+    public String getVe_statuscode() {
+        return ve_statuscode;
+    }
+
+    public void setVe_statuscode(String ve_statuscode) {
+        this.ve_statuscode = ve_statuscode;
+    }
+
+    public Long getVe_recordid() {
+        return ve_recordid;
+    }
+
+    public void setVe_recordid(Long ve_recordid) {
+        this.ve_recordid = ve_recordid;
+    }
+
+    public String getVe_recordname() {
+        return ve_recordname;
+    }
+
+    public void setVe_recordname(String ve_recordname) {
+        this.ve_recordname = ve_recordname;
+    }
+
+    public Date getVe_initdate() {
+        return ve_initdate;
+    }
+
+    public void setVe_initdate(Date ve_initdate) {
+        this.ve_initdate = ve_initdate;
+    }
+
+    public String getVe_text1() {
+        return ve_text1;
+    }
+
+    public void setVe_text1(String ve_text1) {
+        this.ve_text1 = ve_text1;
+    }
+
+    public String getVe_text2() {
+        return ve_text2;
+    }
+
+    public void setVe_text2(String ve_text2) {
+        this.ve_text2 = ve_text2;
+    }
+
+    public String getVe_text3() {
+        return ve_text3;
+    }
+
+    public void setVe_text3(String ve_text3) {
+        this.ve_text3 = ve_text3;
+    }
+
+    public String getVe_text4() {
+        return ve_text4;
+    }
+
+    public void setVe_text4(String ve_text4) {
+        this.ve_text4 = ve_text4;
+    }
+
+    public String getVe_text5() {
+        return ve_text5;
+    }
+
+    public void setVe_text5(String ve_text5) {
+        this.ve_text5 = ve_text5;
+    }
+
+    public Double getVe_preamount() {
+        return ve_preamount;
+    }
+
+    public void setVe_preamount(Double ve_preamount) {
+        this.ve_preamount = ve_preamount;
+    }
+}

+ 10 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/PaybalanceMapper.java

@@ -1,8 +1,10 @@
 package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.money.po.Bankinformation;
 import com.usoftchina.saas.money.po.Paybalance;
 import com.usoftchina.saas.money.po.Recbalance;
+import com.usoftchina.saas.money.po.Vendor;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -28,4 +30,12 @@ public interface PaybalanceMapper extends CommonBaseMapper<Paybalance> {
 
     Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id,
                                    @Param("companyId") Long companyId);
+
+    Bankinformation selectBankInformationByPrimaryKey(Integer bkId);
+
+    int updateBankByPrimaryKeySelective(Bankinformation record);
+
+    Vendor selectVendorByPrimaryKey(Integer bkId);
+
+    int updateVendorByPrimaryKeySelective(Vendor record);
 }

+ 9 - 2
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/RecbalanceMapper.java

@@ -2,11 +2,10 @@ package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
-import com.usoftchina.saas.money.po.Recbalance;
+import com.usoftchina.saas.money.po.*;
 
 import java.util.List;
 
-import com.usoftchina.saas.money.po.RecbalanceExample;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -42,4 +41,12 @@ public interface RecbalanceMapper extends CommonBaseMapper<Recbalance> {
 
     Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id,
                                    @Param("companyId") Long companyId);
+
+    Bankinformation selectBankInformationByPrimaryKey(Integer bkId);
+
+    int updateBankByPrimaryKeySelective(Bankinformation record);
+
+    Customer selectCustomerByPrimaryKey(Integer bkId);
+
+    int updateCustomerByPrimaryKeySelective(Customer record);
 }

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

@@ -15,12 +15,10 @@ import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.PaybalanceService;
 import com.usoftchina.saas.page.PageRequest;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
@@ -189,15 +187,74 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         Double amountTotal = new Double(0);
         for (Paybalancedet det: paybalancedet) {
             amountTotal = amountTotal + det.getPd_amount();
+            //更新账户资料金额
+            Bankinformation bankinformation = new Bankinformation();
+            Bankinformation nowBankInformation = paybalanceMapper.selectBankInformationByPrimaryKey(det.getPd_bankid());
+            bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()+det.getPd_amount());
+            paybalanceMapper.updateBankByPrimaryKeySelective(bankinformation);
+        }
+        //更新主表pb_pbdamount=从表二金额合计
+        Double amountTotal2 = new Double(0);
+        for (Paybalancedetail detail : paybalancedetail){
+            amountTotal2 = amountTotal2 + detail.getPbd_amount();
         }
         updatePay.setId(pay.getMain().getId());
         updatePay.setPb_pdamount(amountTotal);
+        updatePay.setPb_pbdamount(amountTotal2);
+        paybalanceMapper.updateByPrimaryKeySelective(updatePay);
         //updateByPrimaryKeySelective
-
+        /**
+         * ve_preamount=nvl(ve_preamount,0)+pb_preamount,
+         * ve_payamount=nvl(ve_payamount,0)-pb_pbdamount,
+         * 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();
+
+        Vendor vendor = new Vendor();
+        vendor.setId(Long.valueOf(String.valueOf(paybalance.getPb_vendid())));
+        vendor.setVe_preamount(preamount+amountTotal);
+        vendor.setVe_payamount(payamount-amountTotal2);
+        vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount-amountTotal2-preamount-amountTotal);
+        paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
     }
 
     @Override
     public void unAudit(int id) {
+        //更新供应商资料
+        /**
+         * ve_preamount=nvl(ve_preamount,0)-pb_preamount,
+         * ve_payamount=nvl(ve_payamount,0)+pb_pbdamount,
+         * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
+         */
+        Paybalance pay = paybalanceMapper.selectByPrimaryKey(Long.valueOf(id));
+        Double pay_preamount = pay.getPb_preamount();
+        Double pay_pbdamount = pay.getPb_pbdamount();
+        Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(pay.getPb_vendid());
+        Double preamount = vendorData.getVe_preamount();
+        Double beginapamount = vendorData.getVe_beginapamount();
+        Double beginprepayamount= vendorData.getVe_beginprepayamount();
+        Double payamount = vendorData.getVe_payamount();
+        Vendor vendor = new Vendor();
+        vendor.setId(Long.valueOf(String.valueOf(pay.getPb_vendid())));
+        vendor.setVe_preamount(preamount-pay_preamount);
+        vendor.setVe_payamount(payamount+pay_pbdamount);
+        vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount+pay_pbdamount-preamount+pay_preamount);
+        paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
+
+        //更新账户资料金额
+        List<Paybalancedet> paybalancedet = paybalancedetMapper.selectByPrimaryKey(id);
+        for (Paybalancedet det:paybalancedet) {
+            Bankinformation bankinformation = new Bankinformation();
+            Bankinformation nowBankInformation = paybalanceMapper.selectBankInformationByPrimaryKey(det.getPd_bankid());
+            bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()-det.getPd_amount());
+            paybalanceMapper.updateBankByPrimaryKeySelective(bankinformation);
+        }
+
+
         Paybalance paybalance = new Paybalance();
         paybalance.setId(Long.valueOf(id));
         paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
@@ -209,12 +266,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         subledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
         banksubledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
 
-        //更新供应商资料
-        /**
-         * ve_preamount=nvl(ve_preamount,0)-pb_preamount,
-         * ve_payamount=nvl(ve_payamount,0)+pb_pbdamount,
-         * ve_leftamount=ve_beginapamount-e_beginprepayamount+ve_payamount-ve_preamount;
-         */
+
     }
 
 

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

@@ -207,21 +207,81 @@ public class RecbalanceServiceImpl implements RecbalanceService {
             recbalanceMapper.updateByPrimaryKeySelective(recbalance);
         }
 
-        Recbalance updatePay = new Recbalance();
+        Recbalance updateRay = new Recbalance();
         List<Recbalancedet> recbalancedet = rec.getItems1();
         List<Recbalancedetail> recbalancedetail = rec.getItems2();
-        //更新主表付款金额:pb_pdamount=从表一金额合计
+        //更新主表付款金额:rb_rdamount=从表一金额合计
         Double amountTotal = new Double(0);
         for (Recbalancedet det: recbalancedet) {
             amountTotal = amountTotal + det.getRd_amount();
+            //更新账户资料金额
+            Bankinformation bankinformation = new Bankinformation();
+            Bankinformation nowBankInformation = recbalanceMapper.selectBankInformationByPrimaryKey(det.getRd_bankid());
+            bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()+det.getRd_amount());
+            recbalanceMapper.updateBankByPrimaryKeySelective(bankinformation);
+        }
+        //更新主表pb_pbdamount=从表二金额合计
+        Double amountTotal2 = new Double(0);
+        for (Recbalancedetail detail : recbalancedetail){
+            amountTotal2 = amountTotal2 + detail.getRbd_amount();
         }
-        updatePay.setId(rec.getMain().getId());
-        updatePay.setRb_rdamount(amountTotal);
-        //updateByPrimaryKeySelective
+        updateRay.setId(rec.getMain().getId());
+        updateRay.setRb_rdamount(amountTotal);
+        updateRay.setRb_rbdamount(amountTotal2);
+        recbalanceMapper.updateByPrimaryKeySelective(updateRay);
+        /**
+         * 更新客户资料
+         * cu_preamount=nvl(cu_preamount,0)+rb_preamount,
+         * cu_recamount=nvl(cu_recamount,0)-rb_rbdamount,
+         * 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();
+
+        Customer customer = new Customer();
+        customer.setId(Long.valueOf(String.valueOf(recbalance.getRb_custid())));
+        customer.setCu_preamount(preamount+amountTotal);
+        customer.setCu_recamount(recamount-amountTotal2);
+        customer.setCu_leftamount(beginapamount-beginprepayamount+recamount-amountTotal2-preamount-amountTotal);
+        recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
     }
 
     @Override
     public void unAudit(Long id) {
+        //更新供应商资料
+        /**
+         * ve_preamount=nvl(ve_preamount,0)-pb_preamount,
+         * 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();
+        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();
+        Customer customer = new Customer();
+        customer.setId(Long.valueOf(String.valueOf(rec.getRb_custid())));
+        customer.setCu_preamount(preamount-pay_preamount);
+        customer.setCu_recamount(recamount+pay_pbdamount);
+        customer.setCu_leftamount(beginapamount-beginprepayamount+recamount+pay_pbdamount-preamount+pay_preamount);
+        recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
+
+        //更新账户资料金额
+        List<Recbalancedet> recbalancedet = recbalancedetMapper.selectByPrimaryKey(Math.toIntExact(id));
+        for (Recbalancedet det:recbalancedet) {
+            Bankinformation bankinformation = new Bankinformation();
+            Bankinformation nowBankInformation = recbalanceMapper.selectBankInformationByPrimaryKey(det.getRd_bankid());
+            bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()-det.getRd_amount());
+            recbalanceMapper.updateBankByPrimaryKeySelective(bankinformation);
+        }
+
+
         Recbalance recbalance = new Recbalance();
         recbalance.setId(id);
         recbalance.setRb_status(Status.UNAUDITED.getDisplay());

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

@@ -424,7 +424,7 @@
       <if test="companyId != null">
         and   paybalance.companyId = #{companyId}
       </if>
-    </where>  order by pb_date desc
+    </where>  order by pb_id
   </select>
 
   <select id="selectPaybalanceListByCondition" resultMap="BaseResultMap">
@@ -439,7 +439,7 @@
       <if test="companyId != null">
         and   paybalance.companyId = #{companyId}
       </if>
-    </where>  order by pb_date desc
+    </where>  order by pb_id
   </select>
 
   <select id="validateCodeWhenInsert" resultType="int">
@@ -449,4 +449,258 @@
     select count(1) from paybalance where pb_code = #{code} and pb_id != #{id} and companyId =#{companyId}
   </select>
 
+
+  <!-- 银行账户-->
+  <sql id="Bank_Column_List" >
+    bk_id, bk_bankcode, bk_bankname, bk_date, bk_type, bk_beginamount, bk_thisamount,
+    bk_status, bk_statuscode, bk_recorderid, bk_recorder, bk_recorddate, bk_ym, companyid,
+    updaterId, updateTime, bk_text1, bk_text2, bk_text3, bk_text4, bk_text5, bk_remark
+  </sql>
+  <sql id="Blob_Column_List" >
+    bk_remark
+  </sql>
+  <select id="selectBankInformationByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
+    select
+    <include refid="Bank_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from bankinformation
+    where bk_id = #{id,jdbcType=INTEGER}
+  </select>
+  <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.money.po.Bankinformation" extends="BankInformationResultMap" >
+    <result column="bk_remark" property="bk_remark" jdbcType="LONGVARCHAR" />
+  </resultMap>
+  <resultMap id="BankInformationResultMap" type="com.usoftchina.saas.money.po.Bankinformation" >
+    <id column="bk_id" property="id" jdbcType="INTEGER" />
+    <result column="bk_bankcode" property="bk_bankcode" jdbcType="VARCHAR" />
+    <result column="bk_bankname" property="bk_bankname" jdbcType="VARCHAR" />
+    <result column="bk_date" property="bk_date" jdbcType="TIMESTAMP" />
+    <result column="bk_type" property="bk_type" jdbcType="VARCHAR" />
+    <result column="bk_beginamount" property="bk_beginamount" jdbcType="DOUBLE" />
+    <result column="bk_thisamount" property="bk_thisamount" jdbcType="DOUBLE" />
+    <result column="bk_status" property="bk_status" jdbcType="VARCHAR" />
+    <result column="bk_statuscode" property="bk_statuscode" jdbcType="VARCHAR" />
+    <result column="bk_recorderid" property="bk_recorderid" jdbcType="INTEGER" />
+    <result column="bk_recorder" property="bk_recorder" jdbcType="VARCHAR" />
+    <result column="bk_recorddate" property="bk_recorddate" jdbcType="TIMESTAMP" />
+    <result column="bk_ym" property="bk_ym" jdbcType="INTEGER" />
+    <result column="companyid" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="bk_text1" property="bk_text1" jdbcType="VARCHAR" />
+    <result column="bk_text2" property="bk_text2" jdbcType="VARCHAR" />
+    <result column="bk_text3" property="bk_text3" jdbcType="VARCHAR" />
+    <result column="bk_text4" property="bk_text4" jdbcType="VARCHAR" />
+    <result column="bk_text5" property="bk_text5" jdbcType="VARCHAR" />
+    <result column="bk_remark" property="bk_remark" jdbcType="VARCHAR" />
+  </resultMap>
+  <update id="updateBankByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Bankinformation" >
+    update bankinformation
+    <set >
+      <if test="bk_bankcode != null" >
+        bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_bankname != null" >
+        bk_bankname = #{bk_bankname,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_date != null" >
+        bk_date = #{bk_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_type != null" >
+        bk_type = #{bk_type,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_beginamount != null" >
+        bk_beginamount = #{bk_beginamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_thisamount != null" >
+        bk_thisamount = #{bk_thisamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_status != null" >
+        bk_status = #{bk_status,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_statuscode != null" >
+        bk_statuscode = #{bk_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorderid != null" >
+        bk_recorderid = #{bk_recorderid,jdbcType=INTEGER},
+      </if>
+      <if test="bk_recorder != null" >
+        bk_recorder = #{bk_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorddate != null" >
+        bk_recorddate = #{bk_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_ym != null" >
+        bk_ym = #{bk_ym,jdbcType=INTEGER},
+      </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="bk_text1 != null" >
+        bk_text1 = #{bk_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text2 != null" >
+        bk_text2 = #{bk_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text3 != null" >
+        bk_text3 = #{bk_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text4 != null" >
+        bk_text4 = #{bk_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text5 != null" >
+        bk_text5 = #{bk_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_remark != null" >
+        bk_remark = #{bk_remark,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where bk_id = #{id,jdbcType=INTEGER}
+  </update>
+
+<!-- 供应商-->
+  <resultMap id="VendorResultMapper" type="com.usoftchina.saas.money.po.Vendor">
+    <id column="ve_id" property="id" jdbcType="INTEGER" />
+    <result column="ve_code" property="ve_code" jdbcType="VARCHAR" />
+    <result column="ve_uu" property="ve_uu" jdbcType="VARCHAR" />
+    <result column="ve_name" property="ve_name" jdbcType="VARCHAR" />
+    <result column="ve_type" property="ve_type" jdbcType="VARCHAR" />
+    <result column="ve_begindate" property="ve_begindate" jdbcType="TIMESTAMP" />
+    <result column="ve_beginapamount" property="ve_beginapamount" jdbcType="DOUBLE" />
+    <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="DOUBLE" />
+    <result column="ve_promisedays" property="ve_promisedays" jdbcType="INTEGER" />
+    <result column="ve_taxrate" property="ve_taxrate" jdbcType="DOUBLE" />
+    <result column="ve_nsrzh" property="ve_nsrzh" jdbcType="VARCHAR" />
+    <result column="ve_bankaccount" property="ve_bankaccount" jdbcType="VARCHAR" />
+    <result column="ve_bankcode" property="ve_bankcode" jdbcType="VARCHAR" />
+    <result column="ve_status" property="ve_status" jdbcType="VARCHAR" />
+    <result column="ve_statuscode" property="ve_statuscode" jdbcType="VARCHAR" />
+    <result column="ve_recordid" property="ve_recordid" jdbcType="INTEGER" />
+    <result column="ve_recordname" property="ve_recordname" jdbcType="VARCHAR" />
+    <result column="ve_initdate" property="ve_initdate" jdbcType="TIMESTAMP" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="ve_text1" property="ve_text1" jdbcType="VARCHAR" />
+    <result column="ve_text2" property="ve_text2" jdbcType="VARCHAR" />
+    <result column="ve_text3" property="ve_text3" jdbcType="VARCHAR" />
+    <result column="ve_text4" property="ve_text4" jdbcType="VARCHAR" />
+    <result column="ve_text5" property="ve_text5" jdbcType="VARCHAR" />
+    <result column="ve_payamount" property="ve_payamount" jdbcType="DOUBLE" />
+    <result column="ve_leftamount" property="ve_leftamount" jdbcType="DOUBLE" />
+    <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
+    <include refid="Vendor_Column_List" />
+    from vendor
+    where ve_id = #{id}
+  </select>
+  <sql id="Vendor_Column_List" >
+        ve_id, ve_code, ve_name, ve_uu, ve_type, ve_begindate, ve_beginapamount, ve_beginprepayamount,
+        ve_promisedays, ve_taxrate, ve_nsrzh, ve_bankaccount, ve_bankcode, ve_status, ve_statuscode,
+        ve_recordid, ve_recordname, ve_initdate, companyId, updaterId, updateTime, ve_text1,
+        ve_text2, ve_text3, ve_text4, ve_text5, ve_payamount, ve_leftamount, ve_beginym, ve_preamount
+    </sql>
+
+  <update id="updateVendorByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Vendor" >
+    update vendor
+    <set >
+      <if test="ve_code != null" >
+        ve_code = #{ve_code,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_name != null" >
+        ve_name = #{ve_name,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_uu != null" >
+        ve_uu = #{ve_uu,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_type != null" >
+        ve_type = #{ve_type,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_begindate != null" >
+        ve_begindate = #{ve_begindate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ve_beginapamount != null" >
+        ve_beginapamount = #{ve_beginapamount,jdbcType=DOUBLE},
+      </if>
+      <if test="ve_beginprepayamount != null" >
+        ve_beginprepayamount = #{ve_beginprepayamount,jdbcType=DOUBLE},
+      </if>
+      <if test="ve_promisedays != null" >
+        ve_promisedays = #{ve_promisedays,jdbcType=DECIMAL},
+      </if>
+      <if test="ve_taxrate != null" >
+        ve_taxrate = #{ve_taxrate,jdbcType=DOUBLE},
+      </if>
+      <if test="ve_nsrzh != null" >
+        ve_nsrzh = #{ve_nsrzh,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_bankaccount != null" >
+        ve_bankaccount = #{ve_bankaccount,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_bankcode != null" >
+        ve_bankcode = #{ve_bankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_status != null" >
+        ve_status = #{ve_status,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_statuscode != null" >
+        ve_statuscode = #{ve_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_recordid != null" >
+        ve_recordid = #{ve_recordid,jdbcType=DECIMAL},
+      </if>
+      <if test="ve_recordname != null" >
+        ve_recordname = #{ve_recordname,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_initdate != null" >
+        ve_initdate = #{ve_initdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=DECIMAL},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=DECIMAL},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ve_text1 != null" >
+        ve_text1 = #{ve_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_text2 != null" >
+        ve_text2 = #{ve_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_text3 != null" >
+        ve_text3 = #{ve_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_text4 != null" >
+        ve_text4 = #{ve_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_text5 != null" >
+        ve_text5 = #{ve_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_payamount != null" >
+        ve_payamount = #{ve_payamount,jdbcType=DOUBLE},
+      </if>
+      <if test="ve_leftamount != null" >
+        ve_leftamount = #{ve_leftamount,jdbcType=DOUBLE},
+      </if>
+      <if test="ve_beginym != null" >
+        ve_beginym = #{ve_beginym,jdbcType=INTEGER},
+      </if>
+      <if test="ve_preamount !=null" >
+        #{ve_preamount,jdbcType=DOUBLE},
+      </if>
+    </set>
+    where ve_id = #{id}
+  </update>
 </mapper>

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

@@ -582,4 +582,257 @@
     select count(1) from recbalance where rb_code = #{code} and rb_id != #{id} and companyId =#{companyId}
   </select>
 
+  <!-- 银行账户-->
+  <sql id="Bank_Column_List" >
+    bk_id, bk_bankcode, bk_bankname, bk_date, bk_type, bk_beginamount, bk_thisamount,
+    bk_status, bk_statuscode, bk_recorderid, bk_recorder, bk_recorddate, bk_ym, companyid,
+    updaterId, updateTime, bk_text1, bk_text2, bk_text3, bk_text4, bk_text5, bk_remark
+  </sql>
+  <sql id="Blob_Column_List" >
+    bk_remark
+  </sql>
+  <select id="selectBankInformationByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
+    select
+    <include refid="Bank_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from bankinformation
+    where bk_id = #{id,jdbcType=INTEGER}
+  </select>
+  <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.money.po.Bankinformation" extends="BankInformationResultMap" >
+    <result column="bk_remark" property="bk_remark" jdbcType="LONGVARCHAR" />
+  </resultMap>
+  <resultMap id="BankInformationResultMap" type="com.usoftchina.saas.money.po.Bankinformation" >
+    <id column="bk_id" property="id" jdbcType="INTEGER" />
+    <result column="bk_bankcode" property="bk_bankcode" jdbcType="VARCHAR" />
+    <result column="bk_bankname" property="bk_bankname" jdbcType="VARCHAR" />
+    <result column="bk_date" property="bk_date" jdbcType="TIMESTAMP" />
+    <result column="bk_type" property="bk_type" jdbcType="VARCHAR" />
+    <result column="bk_beginamount" property="bk_beginamount" jdbcType="DOUBLE" />
+    <result column="bk_thisamount" property="bk_thisamount" jdbcType="DOUBLE" />
+    <result column="bk_status" property="bk_status" jdbcType="VARCHAR" />
+    <result column="bk_statuscode" property="bk_statuscode" jdbcType="VARCHAR" />
+    <result column="bk_recorderid" property="bk_recorderid" jdbcType="INTEGER" />
+    <result column="bk_recorder" property="bk_recorder" jdbcType="VARCHAR" />
+    <result column="bk_recorddate" property="bk_recorddate" jdbcType="TIMESTAMP" />
+    <result column="bk_ym" property="bk_ym" jdbcType="INTEGER" />
+    <result column="companyid" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="bk_text1" property="bk_text1" jdbcType="VARCHAR" />
+    <result column="bk_text2" property="bk_text2" jdbcType="VARCHAR" />
+    <result column="bk_text3" property="bk_text3" jdbcType="VARCHAR" />
+    <result column="bk_text4" property="bk_text4" jdbcType="VARCHAR" />
+    <result column="bk_text5" property="bk_text5" jdbcType="VARCHAR" />
+    <result column="bk_remark" property="bk_remark" jdbcType="VARCHAR" />
+  </resultMap>
+  <update id="updateBankByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Bankinformation" >
+    update bankinformation
+    <set >
+      <if test="bk_bankcode != null" >
+        bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_bankname != null" >
+        bk_bankname = #{bk_bankname,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_date != null" >
+        bk_date = #{bk_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_type != null" >
+        bk_type = #{bk_type,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_beginamount != null" >
+        bk_beginamount = #{bk_beginamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_thisamount != null" >
+        bk_thisamount = #{bk_thisamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_status != null" >
+        bk_status = #{bk_status,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_statuscode != null" >
+        bk_statuscode = #{bk_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorderid != null" >
+        bk_recorderid = #{bk_recorderid,jdbcType=INTEGER},
+      </if>
+      <if test="bk_recorder != null" >
+        bk_recorder = #{bk_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorddate != null" >
+        bk_recorddate = #{bk_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_ym != null" >
+        bk_ym = #{bk_ym,jdbcType=INTEGER},
+      </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="bk_text1 != null" >
+        bk_text1 = #{bk_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text2 != null" >
+        bk_text2 = #{bk_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text3 != null" >
+        bk_text3 = #{bk_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text4 != null" >
+        bk_text4 = #{bk_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text5 != null" >
+        bk_text5 = #{bk_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_remark != null" >
+        bk_remark = #{bk_remark,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where bk_id = #{id,jdbcType=INTEGER}
+  </update>
+
+  <!--客户资料-->
+  <resultMap id="CustomerResultMap" type="com.usoftchina.saas.money.po.Customer">
+    <id column="cu_id" jdbcType="INTEGER" property="id" />
+    <result column="cu_code" jdbcType="VARCHAR" property="cu_code" />
+    <result column="cu_name" jdbcType="VARCHAR" property="cu_name" />
+    <result column="cu_uu" jdbcType="VARCHAR" property="cu_uu" />
+    <result column="cu_type" jdbcType="VARCHAR" property="cu_type" />
+    <result column="cu_begindate" jdbcType="TIMESTAMP" property="cu_begindate" />
+    <result column="cu_beginaramount" jdbcType="DOUBLE" property="cu_beginaramount" />
+    <result column="cu_beginprerecamount" jdbcType="DOUBLE" property="cu_beginprerecamount" />
+    <result column="cu_promisedays" jdbcType="DOUBLE" property="cu_promisedays" />
+    <result column="cu_taxrate" jdbcType="DOUBLE" property="cu_taxrate" />
+    <result column="cu_sellerid" jdbcType="INTEGER" property="cu_sellerid" />
+    <result column="cu_sellercode" jdbcType="VARCHAR" property="cu_sellercode" />
+    <result column="cu_sellername" jdbcType="VARCHAR" property="cu_sellername" />
+    <result column="cu_credit" jdbcType="DOUBLE" property="cu_credit" />
+    <result column="cu_status" jdbcType="VARCHAR" property="cu_status" />
+    <result column="cu_statuscode" jdbcType="VARCHAR" property="cu_statuscode" />
+    <result column="cu_recordmanid" jdbcType="INTEGER" property="cu_recordmanid" />
+    <result column="cu_recordman" jdbcType="VARCHAR" property="cu_recordman" />
+    <result column="cu_recorddate" jdbcType="TIMESTAMP" property="cu_recorddate" />
+    <result column="companyid" jdbcType="INTEGER" property="companyId" />
+    <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
+    <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="cu_text1" jdbcType="VARCHAR" property="cu_text1" />
+    <result column="cu_text2" jdbcType="VARCHAR" property="cu_text2" />
+    <result column="cu_text3" jdbcType="VARCHAR" property="cu_text3" />
+    <result column="cu_text4" jdbcType="VARCHAR" property="cu_text4" />
+    <result column="cu_text5" jdbcType="VARCHAR" property="cu_text5" />
+    <result column="cu_leftamount" jdbcType="DOUBLE" property="cu_leftamount" />
+    <result column="cu_recamount" jdbcType="DOUBLE" property="cu_recamount" />
+  </resultMap>
+  <sql id="Customer_Column_List">
+    cu_id, cu_code, cu_name, cu_uu, cu_type, cu_begindate, cu_beginaramount, cu_beginprerecamount,
+    cu_promisedays, cu_taxrate, cu_sellerid, cu_sellercode, cu_sellername, cu_credit,
+    cu_status, cu_statuscode, cu_recordmanid, cu_recordman, cu_recorddate, companyid,
+    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
+    <include refid="Customer_Column_List" />
+    from customer
+    where cu_id = #{cu_id,jdbcType=INTEGER}
+  </select>
+
+  <update id="updateCustomerByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Customer">
+    update customer
+    <set>
+      <if test="cu_code != null">
+        cu_code = #{cu_code,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_name != null">
+        cu_name = #{cu_name,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_uu != null">
+        cu_uu = #{cu_uu,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_type != null">
+        cu_type = #{cu_type,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_begindate != null">
+        cu_begindate = #{cu_begindate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="cu_beginaramount != null">
+        cu_beginaramount = #{cu_beginaramount,jdbcType=DOUBLE},
+      </if>
+      <if test="cu_beginprerecamount != null">
+        cu_beginprerecamount = #{cu_beginprerecamount,jdbcType=DOUBLE},
+      </if>
+      <if test="cu_promisedays != null">
+        cu_promisedays = #{cu_promisedays,jdbcType=DOUBLE},
+      </if>
+      <if test="cu_taxrate != null">
+        cu_taxrate = #{cu_taxrate,jdbcType=DOUBLE},
+      </if>
+      <if test="cu_sellerid != null">
+        cu_sellerid = #{cu_sellerid,jdbcType=INTEGER},
+      </if>
+      <if test="cu_sellercode != null">
+        cu_sellercode = #{cu_sellercode,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_sellername != null">
+        cu_sellername = #{cu_sellername,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_credit != null">
+        cu_credit = #{cu_credit,jdbcType=DOUBLE},
+      </if>
+      <if test="cu_status != null">
+        cu_status = #{cu_status,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_statuscode != null">
+        cu_statuscode = #{cu_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_recordmanid != null">
+        cu_recordmanid = #{cu_recordmanid,jdbcType=INTEGER},
+      </if>
+      <if test="cu_recordman != null">
+        cu_recordman = #{cu_recordman,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_recorddate != null">
+        cu_recorddate = #{cu_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="cu_text1 != null">
+        cu_text1 = #{cu_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_text2 != null">
+        cu_text2 = #{cu_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_text3 != null">
+        cu_text3 = #{cu_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_text4 != null">
+        cu_text4 = #{cu_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_text5 != null">
+        cu_text5 = #{cu_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="cu_leftamount != null">
+        cu_leftamount = #{cu_leftamount,jdbcType=DOUBLE},
+      </if>
+      <if test="cu_recamount != null">
+        cu_recamount = #{cu_recamount,jdbcType=DOUBLE},
+      </if>
+      <if test="cu_preamount != null">
+        cu_preamount = #{cu_preamount,jdbcType=DOUBLE},
+      </if>
+    </set>
+    where cu_id = #{id,jdbcType=INTEGER}
+  </update>
 </mapper>

+ 2 - 1
frontend/saas-web/app/view/money/fundtransfer/FormPanel.js

@@ -30,7 +30,8 @@ Ext.define('saas.view.money.fundtransfer.FormPanel', {
         xtype : "datefield", 
         name : "ft_date", 
         fieldLabel : "单据日期",
-        defaultValue: new Date()
+        defaultValue: new Date(),
+        allowBlank : false
     }, {
         name : "detailGridField", 
         xtype : "detailGridField", 

+ 2 - 1
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -55,7 +55,8 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
      }, {
         xtype:'datefield',
         name : 'or_date',
-        fieldLabel : '单据日期'
+        fieldLabel : '单据日期',
+        allowBlank : false
     },{
         name : "detailGridField", 
         xtype : "detailGridField", 

+ 2 - 1
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -55,7 +55,8 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
      }, {
         xtype:'datefield',
         name : 'os_date',
-        fieldLabel : '单据日期'
+        fieldLabel : '单据日期',
+        allowBlank : false
     },{
         name : "detailGridField", 
         xtype : "detailGridField", 

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

@@ -63,7 +63,8 @@ Ext.define('saas.view.money.payBalance.FormPanel', {
     },{
         xtype: "datefield",
         name: "pb_date",
-        fieldLabel: "日期"
+        fieldLabel: "日期",
+        allowBlank : false
     },{
         xtype: 'textfield',
         name: 'pb_manname',

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

@@ -62,7 +62,8 @@ Ext.define('saas.view.money.recBalance.FormPanel', {
     }, {
         xtype: "datefield",
         name: "rb_date",
-        fieldLabel: "日期"
+        fieldLabel: "日期",
+        allowBlank : false
     }, {
         xtype: "textfield",
         name: "rb_manname",