Explorar el Código

Merge remote-tracking branch 'origin/dev' into dev

yingp hace 7 años
padre
commit
c146fdc7a9

+ 19 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Bankinformation.java

@@ -43,6 +43,25 @@ public class Bankinformation extends CommonBaseEntity implements Serializable {
 
     private String bk_remark;
 
+    private Double bk_income;
+    private Double bk_spending;
+
+    public Double getBk_income() {
+        return bk_income;
+    }
+
+    public void setBk_income(Double bk_income) {
+        this.bk_income = bk_income;
+    }
+
+    public Double getBk_spending() {
+        return bk_spending;
+    }
+
+    public void setBk_spending(Double bk_spending) {
+        this.bk_spending = bk_spending;
+    }
+
     public String getBk_bankcode() {
         return bk_bankcode;
     }

+ 3 - 3
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java

@@ -39,9 +39,9 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
     @Override
     public boolean save(Bankinformation bankinformation){
         bankinformation.setCompanyId(BaseContextHolder.getCompanyId());
-        if (bankinformation.getBk_thisamount() == null || bankinformation.getBk_thisamount() == 0){
-            bankinformation.setBk_thisamount(bankinformation.getBk_beginamount());
-        }
+        bankinformation.setBk_thisamount(bankinformation.getBk_beginamount());
+        bankinformation.setBk_income(new Double(0));
+        bankinformation.setBk_spending(new Double(0));
 
         //判断编号
         String bktion = bankinformationMapper.selectBankcode(bankinformation.getBk_bankcode());

+ 57 - 60
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -170,71 +170,68 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             if (insertDetail2.size()>0) {
                 customeraddressMapper.batchInsert(insertDetail2);
             }
-            baseDTO = getBaseDTOById(cu_id);
-            //日志记录
-            messageLogService.save(baseDTO);
-            return baseDTO;
-        }
-        //检查名称和编号
-        int count = getMapper().validNameAndCodeWhenUpdate(customer);
-        if (count>0) {
-            throw new BizException(500, "客户名称或编号重复");
-        }
-
-        //检查期初日期是否已结转
-        count = getMapper().validFinish(cu_id,companyId);
-        if (count>0) {
-            Customer cutpl = getMapper().selectByPrimaryKey(cu_id);
-            //期初应收
-            customer.setCu_beginaramount(cutpl.getCu_beginaramount());
-            //期初预收
-            customer.setCu_beginprerecamount(cutpl.getCu_beginprerecamount());
-        }
+        }else {
+            //检查名称和编号
+            int count = getMapper().validNameAndCodeWhenUpdate(customer);
+            if (count > 0) {
+                throw new BizException(500, "客户名称或编号重复");
+            }
 
-        //更新操作
-        getMapper().updateByPrimaryKeySelective(customer);
-        //添加从表传输对象
-        for (CustomercontactDTO item : items1) {
-            Customercontact detail1 = BeanMapper.map(item,Customercontact.class);
-            detail1.setCc_cuid(cu_id);
-            detail1.setCompanyId(companyId);
-            detail1.setCreatorId(userId);
-            detail1.setCreateTime(new Date());
-            if (StringUtils.isEmpty(detail1.getId()) || "0".equals(detail1.getId().toString())) {
-                insertDetail1.add(detail1);
-            } else {
-                updateDetail1.add(detail1);
+            //检查期初日期是否已结转
+            count = getMapper().validFinish(cu_id, companyId);
+            if (count > 0) {
+                Customer cutpl = getMapper().selectByPrimaryKey(cu_id);
+                //期初应收
+                customer.setCu_beginaramount(cutpl.getCu_beginaramount());
+                //期初预收
+                customer.setCu_beginprerecamount(cutpl.getCu_beginprerecamount());
             }
-        }
-        //插入从表
-        if (insertDetail1.size()>0) {
-            customercontactMapper.batchInsert(insertDetail1);
-        }
-        //更新从表
-        if (updateDetail1.size()>0) {
-            customercontactMapper.batchUpdate(updateDetail1);
-        }
 
-        for (CustomeraddressDTO item : items2) {
-            Customeraddress detail2 = BeanMapper.map(item,Customeraddress.class);
-            detail2.setCa_cuid(cu_id);
-            detail2.setCompanyId(companyId);
-            detail2.setCreatorId(userId);
-            detail2.setCreateTime(new Date());
-            if (StringUtils.isEmpty(detail2.getId()) || "0".equals(detail2.getId().toString())) {
-                insertDetail2.add(detail2);
-            } else {
-                updateDetail2.add(detail2);
+            //更新操作
+            getMapper().updateByPrimaryKeySelective(customer);
+            //添加从表传输对象
+            for (CustomercontactDTO item : items1) {
+                Customercontact detail1 = BeanMapper.map(item, Customercontact.class);
+                detail1.setCc_cuid(cu_id);
+                detail1.setCompanyId(companyId);
+                detail1.setCreatorId(userId);
+                detail1.setCreateTime(new Date());
+                if (StringUtils.isEmpty(detail1.getId()) || "0".equals(detail1.getId().toString())) {
+                    insertDetail1.add(detail1);
+                } else {
+                    updateDetail1.add(detail1);
+                }
+            }
+            //插入从表
+            if (insertDetail1.size() > 0) {
+                customercontactMapper.batchInsert(insertDetail1);
+            }
+            //更新从表
+            if (updateDetail1.size() > 0) {
+                customercontactMapper.batchUpdate(updateDetail1);
             }
 
-        }
-        //插入从表
-        if (insertDetail2.size()>0) {
-            customeraddressMapper.batchInsert(insertDetail2);
-        }
-        //更新从表
-        if (updateDetail2.size()>0) {
-            customeraddressMapper.batchUpdate(updateDetail2);
+            for (CustomeraddressDTO item : items2) {
+                Customeraddress detail2 = BeanMapper.map(item, Customeraddress.class);
+                detail2.setCa_cuid(cu_id);
+                detail2.setCompanyId(companyId);
+                detail2.setCreatorId(userId);
+                detail2.setCreateTime(new Date());
+                if (StringUtils.isEmpty(detail2.getId()) || "0".equals(detail2.getId().toString())) {
+                    insertDetail2.add(detail2);
+                } else {
+                    updateDetail2.add(detail2);
+                }
+
+            }
+            //插入从表
+            if (insertDetail2.size() > 0) {
+                customeraddressMapper.batchInsert(insertDetail2);
+            }
+            //更新从表
+            if (updateDetail2.size() > 0) {
+                customeraddressMapper.batchUpdate(updateDetail2);
+            }
         }
 
         //更新应收余额

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

@@ -47,7 +47,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@localhost:8500/eureka/
 management:
   endpoints:
     web:

+ 20 - 0
applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -24,6 +24,8 @@
     <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" />
+    <result column="bk_spending" property="bk_spending" jdbcType="DOUBLE" />
+    <result column="bk_income" property="bk_income" jdbcType="DOUBLE" />
   </resultMap>
   <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Bankinformation" extends="BaseResultMap" >
     <result column="bk_remark" property="bk_remark" jdbcType="LONGVARCHAR" />
@@ -132,6 +134,12 @@
       <if test="bk_remark != null" >
         bk_remark,
       </if>
+      <if test="bk_spending != null" >
+        bk_spending,
+      </if>
+      <if test="bk_income != null" >
+        bk_income,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="bk_bankcode != null" >
@@ -197,6 +205,12 @@
       <if test="bk_remark != null" >
         #{bk_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="bk_spending != null" >
+        #{bk_spending,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_income != null" >
+        #{bk_income,jdbcType=DOUBLE},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
@@ -265,6 +279,12 @@
       <if test="bk_remark != null" >
         bk_remark = #{bk_remark,jdbcType=LONGVARCHAR},
       </if>
+      <if test="bk_income != null" >
+        bk_income = #{bk_income,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_spending != null" >
+        bk_spending = #{bk_spending,jdbcType=DOUBLE},
+      </if>
     </set>
     where bk_id = #{id,jdbcType=INTEGER}
   </update>

+ 22 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/config/WebMvcConfig.java

@@ -0,0 +1,22 @@
+//package com.usoftchina.saas.money.config;
+//
+//import org.springframework.web.servlet.config.annotation.CorsRegistry;
+//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+//
+///**
+// * @author heqw
+// * @date 2018/11/13 16:58
+// **/
+//public class WebMvcConfig extends WebMvcConfigurerAdapter {
+//    @Override
+//    public void addCorsMappings(CorsRegistry registry) {
+//        registry.addMapping("/**")
+//                .allowedOrigins("*")
+//                .allowedMethods("POST", "GET", "PUT", "OPTIONS", "DELETE")
+//                .allowedHeaders("Content-Type", "X-Requested-With", "accept", "Origin", "Access-Control-Request-Method",
+//                        "Access-Control-Request-Headers")
+//                .exposedHeaders("Access-Control-Allow-Origin", "Access-Control-Allow-Credentials")
+//                .maxAge(3600)
+//                .allowCredentials(true);
+//    }
+//}

+ 31 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BankinformationMapper.java

@@ -0,0 +1,31 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
+import com.usoftchina.saas.money.po.Bankinformation;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface BankinformationMapper extends CommonBaseMapper<Bankinformation> {
+    int deleteByPrimaryKey(Integer bkId);
+
+//    int insert(Bankinformation record);
+
+    int insertSelective(Bankinformation record);
+
+    Bankinformation selectByPrimaryKey(Integer bkId);
+
+    int updateByPrimaryKeySelective(Bankinformation record);
+
+    int updateByPrimaryKeyWithBLOBs(Bankinformation record);
+
+    List<Bankinformation> selectBankinformationBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
+    String selectBankcode(String bk_bankcode);
+
+    void updateBankAmount(@Param("id") Integer id, @Param("bk_thisamount") Double bk_thisamount);
+    Double selectThisamount(Integer id);
+
+}

+ 45 - 13
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java

@@ -42,6 +42,8 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
     private PaybalanceMapper paybalanceMapper;
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private BankinformationMapper bankinformationMapper;
 
     @Override
     public DocBaseDTO insert(Fundtran fundtran) {
@@ -96,7 +98,6 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
         this.changBankUntil(fundtran);
         DocBaseDTO docBaseDTO = this.insert(fundtran);
         Long id = docBaseDTO.getId();
-        String ft_code = docBaseDTO.getCode();
 
         //取从表金额更新中间表、资金账号表
         List<Fundtransferdetail> fundtransferdetailList = fundtran.getItems();
@@ -115,15 +116,28 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             //资金账号表
             int bk_id = fundtransferdetail.getFtd_bankid();
             int bk_inid = fundtransferdetail.getFtd_inbankid();
-            Double bk_amount = paybalanceMapper.selectThisamount(bk_id) == null ? new Double(0) : paybalanceMapper.selectThisamount(bk_id);
-            Double bk_inamount = paybalanceMapper.selectThisamount(bk_inid) == null ? new Double(0) : paybalanceMapper.selectThisamount(bk_inid);
 
-            Double thisamount = bk_amount - fundtransferdetail.getFtd_nowbalance();
-            if (thisamount < 0){
-                throw new BizException(500, BizExceptionCode.BANK_AMOUNT_NOTENOUGH.getMessage());
-            }
-            paybalanceMapper.updateBankAmount(thisamount, bk_id);
-            paybalanceMapper.updateBankAmount(bk_inamount + fundtransferdetail.getFtd_nowbalance(), bk_inid);
+            Double bk_amount = fundtransferdetail.getFtd_nowbalance();
+            //付款方
+            Bankinformation bankinformation = bankinformationMapper.selectByPrimaryKey(bk_id);
+            Double beginamount = bankinformation.getBk_beginamount();
+            Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
+            Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
+            bankinformation.setBk_thisamount(beginamount + incomme - spending - bk_amount);
+            bankinformation.setBk_income(incomme);
+            bankinformation.setBk_spending(spending + bk_amount);
+
+            //收款方
+            Bankinformation inbankinformation = bankinformationMapper.selectByPrimaryKey(bk_inid);
+            Double inbeginamount = inbankinformation.getBk_beginamount();
+            Double inspending = inbankinformation.getBk_spending() == null ? new Double(0) : inbankinformation.getBk_spending();
+            Double inincomme = inbankinformation.getBk_income() == null ? new Double(0) : inbankinformation.getBk_income();
+            inbankinformation.setBk_thisamount(inbeginamount + inincomme - inspending + bk_amount);
+            inbankinformation.setBk_income(inincomme + bk_amount);
+            inbankinformation.setBk_spending(inspending);
+
+            bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+            bankinformationMapper.updateByPrimaryKeySelective(inbankinformation);
         }
         DocBaseDTO baseDTO = getBaseDTOById(id);
         //日志记录
@@ -159,10 +173,28 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             //资金账号表
             int bk_id = fundtransferdetail.getFtd_bankid();
             int bk_inid = fundtransferdetail.getFtd_inbankid();
-            Double bk_amount = paybalanceMapper.selectThisamount(bk_id) == null ? new Double(0) : paybalanceMapper.selectThisamount(bk_id);
-            Double bk_inamount = paybalanceMapper.selectThisamount(bk_inid) == null ? new Double(0) : paybalanceMapper.selectThisamount(bk_inid);
-            paybalanceMapper.updateBankAmount(bk_amount + fundtransferdetail.getFtd_nowbalance(), bk_id);
-            paybalanceMapper.updateBankAmount(bk_inamount - fundtransferdetail.getFtd_nowbalance(), bk_inid);
+
+            Double bk_amount = fundtransferdetail.getFtd_nowbalance();
+            //付款方
+            Bankinformation bankinformation = bankinformationMapper.selectByPrimaryKey(bk_id);
+            Double beginamount = bankinformation.getBk_beginamount();
+            Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
+            Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
+            bankinformation.setBk_thisamount(beginamount + incomme - spending + bk_amount);
+            bankinformation.setBk_income(incomme);
+            bankinformation.setBk_spending(spending - bk_amount);
+
+            //收款方
+            Bankinformation inbankinformation = bankinformationMapper.selectByPrimaryKey(bk_inid);
+            Double inbeginamount = inbankinformation.getBk_beginamount();
+            Double inspending = inbankinformation.getBk_spending() == null ? new Double(0) : inbankinformation.getBk_spending();
+            Double inincomme = inbankinformation.getBk_income() == null ? new Double(0) : inbankinformation.getBk_income();
+            inbankinformation.setBk_thisamount(inbeginamount + inincomme - inspending - bk_amount);
+            inbankinformation.setBk_income(inincomme - bk_amount);
+            inbankinformation.setBk_spending(inspending);
+
+            bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+            bankinformationMapper.updateByPrimaryKeySelective(inbankinformation);
         }
 
         DocBaseDTO baseDTO = getBaseDTOById(Long.valueOf(id));

+ 351 - 0
applications/money/money-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -0,0 +1,351 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.BankinformationMapper" >
+  <resultMap id="BaseResultMap" 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" />
+    <result column="bk_spending" property="bk_spending" jdbcType="DOUBLE" />
+    <result column="bk_income" property="bk_income" jdbcType="DOUBLE" />
+  </resultMap>
+  <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.money.po.Bankinformation" extends="BaseResultMap" >
+    <result column="bk_remark" property="bk_remark" jdbcType="LONGVARCHAR" />
+  </resultMap>
+  <sql id="Base_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="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from bankinformation
+    where bk_id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from bankinformation
+    where bk_id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.money.po.Bankinformation" >
+    insert into bankinformation (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)
+    values (#{bk_bankcode,jdbcType=VARCHAR}, #{bk_bankname,jdbcType=VARCHAR},
+      #{bk_date,jdbcType=TIMESTAMP}, #{bk_type,jdbcType=VARCHAR}, #{bk_beginamount,jdbcType=DOUBLE},
+      #{bk_thisamount,jdbcType=DOUBLE}, #{bk_status,jdbcType=VARCHAR}, #{bk_statuscode,jdbcType=VARCHAR},
+      #{bk_recorderid,jdbcType=INTEGER}, #{bk_recorder,jdbcType=VARCHAR}, #{bk_recorddate,jdbcType=TIMESTAMP},
+      #{bk_ym,jdbcType=INTEGER}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER},
+      #{updateTime,jdbcType=TIMESTAMP}, #{bk_text1,jdbcType=VARCHAR}, #{bk_text2,jdbcType=VARCHAR},
+      #{bk_text3,jdbcType=VARCHAR}, #{bk_text4,jdbcType=VARCHAR}, #{bk_text5,jdbcType=VARCHAR},
+      #{bk_remark,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
+    insert into bankinformation
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="bk_bankcode != null" >
+        bk_bankcode,
+      </if>
+      <if test="bk_bankname != null" >
+        bk_bankname,
+      </if>
+      <if test="bk_date != null" >
+        bk_date,
+      </if>
+      <if test="bk_type != null" >
+        bk_type,
+      </if>
+      <if test="bk_beginamount != null" >
+        bk_beginamount,
+      </if>
+      <if test="bk_thisamount != null" >
+        bk_thisamount,
+      </if>
+      <if test="bk_status != null" >
+        bk_status,
+      </if>
+      <if test="bk_statuscode != null" >
+        bk_statuscode,
+      </if>
+      <if test="bk_recorderid != null" >
+        bk_recorderid,
+      </if>
+      <if test="bk_recorder != null" >
+        bk_recorder,
+      </if>
+      <if test="bk_recorddate != null" >
+        bk_recorddate,
+      </if>
+      <if test="bk_ym != null" >
+        bk_ym,
+      </if>
+      <if test="companyId != null" >
+        companyid,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="bk_text1 != null" >
+        bk_text1,
+      </if>
+      <if test="bk_text2 != null" >
+        bk_text2,
+      </if>
+      <if test="bk_text3 != null" >
+        bk_text3,
+      </if>
+      <if test="bk_text4 != null" >
+        bk_text4,
+      </if>
+      <if test="bk_text5 != null" >
+        bk_text5,
+      </if>
+      <if test="bk_remark != null" >
+        bk_remark,
+      </if>
+      <if test="bk_spending != null" >
+        bk_spending,
+      </if>
+      <if test="bk_income != null" >
+        bk_income,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="bk_bankcode != null" >
+        #{bk_bankcode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_bankname != null" >
+        #{bk_bankname,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_date != null" >
+        #{bk_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_type != null" >
+        #{bk_type,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_beginamount != null" >
+        #{bk_beginamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_thisamount != null" >
+        #{bk_thisamount,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_status != null" >
+        #{bk_status,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_statuscode != null" >
+        #{bk_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorderid != null" >
+        #{bk_recorderid,jdbcType=INTEGER},
+      </if>
+      <if test="bk_recorder != null" >
+        #{bk_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_recorddate != null" >
+        #{bk_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_ym != null" >
+        #{bk_ym,jdbcType=INTEGER},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="bk_text1 != null" >
+        #{bk_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text2 != null" >
+        #{bk_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text3 != null" >
+        #{bk_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text4 != null" >
+        #{bk_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_text5 != null" >
+        #{bk_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="bk_remark != null" >
+        #{bk_remark,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="bk_spending != null" >
+        #{bk_spending,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_income != null" >
+        #{bk_income,jdbcType=DOUBLE},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.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>
+      <if test="bk_income != null" >
+        bk_income = #{bk_income,jdbcType=DOUBLE},
+      </if>
+      <if test="bk_spending != null" >
+        bk_spending = #{bk_spending,jdbcType=DOUBLE},
+      </if>
+    </set>
+    where bk_id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.money.po.Bankinformation" >
+    update bankinformation
+    set bk_bankcode = #{bkBankcode,jdbcType=VARCHAR},
+      bk_bankname = #{bkBankname,jdbcType=VARCHAR},
+      bk_date = #{bkDate,jdbcType=TIMESTAMP},
+      bk_type = #{bkType,jdbcType=VARCHAR},
+      bk_beginamount = #{bkBeginamount,jdbcType=DOUBLE},
+      bk_thisamount = #{bkThisamount,jdbcType=DOUBLE},
+      bk_status = #{bkStatus,jdbcType=VARCHAR},
+      bk_statuscode = #{bkStatuscode,jdbcType=VARCHAR},
+      bk_recorderid = #{bkRecorderid,jdbcType=INTEGER},
+      bk_recorder = #{bkRecorder,jdbcType=VARCHAR},
+      bk_recorddate = #{bkRecorddate,jdbcType=TIMESTAMP},
+      bk_ym = #{bkYm,jdbcType=INTEGER},
+      companyid = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      bk_text1 = #{bkText1,jdbcType=VARCHAR},
+      bk_text2 = #{bkText2,jdbcType=VARCHAR},
+      bk_text3 = #{bkText3,jdbcType=VARCHAR},
+      bk_text4 = #{bkText4,jdbcType=VARCHAR},
+      bk_text5 = #{bkText5,jdbcType=VARCHAR},
+      bk_remark = #{bkRemark,jdbcType=LONGVARCHAR}
+    where bk_id = #{bkId,jdbcType=INTEGER}
+  </update>
+
+  <select id="selectAll" resultMap="BaseResultMap">
+    SELECT * FROM bankinformation
+  </select>
+
+  <select id="selectBankinformationBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from bankinformation
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   bankinformation.companyId = #{companyId}
+      </if>
+    </where>  order by bk_id
+  </select>
+  <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+        SELECT CONCAT(bk_bankcode,' ',bk_bankname) display,bk_bankname value FROM bankinformation WHERE COMPANYID=#{companyId}
+    </select>
+
+
+  <select id="selectBankcode" parameterType="java.lang.String" resultType="java.lang.String">
+        select bk_bankcode from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR}
+    </select>
+
+  <update id="updateBankAmount" >
+    update bankinformation set bk_thisamount = #{bk_thisamount,jdbcType=DOUBLE}
+     where bk_id = #{id,jdbcType=INTEGER}
+  </update>
+
+  <select id="selectThisamount" parameterType="java.lang.Integer" resultType="java.lang.Double">
+  select bk_beginamount from bankinformation where bk_id = #{id,jdbcType=INTEGER}
+</select>
+</mapper>

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

@@ -604,7 +604,7 @@
   </update>
 
 <select id="selectThisamount" parameterType="java.lang.Integer" resultType="java.lang.Double">
-  select bk_thisamount from bankinformation where bk_id = #{id,jdbcType=INTEGER}
+  select bk_beginamount from bankinformation where bk_id = #{id,jdbcType=INTEGER}
 </select>
 
 <!-- 供应商-->