Browse Source

1.资金账户编号优化
2.供应商对账单修改

heqinwei 7 years ago
parent
commit
f7357ded3b

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

@@ -25,7 +25,7 @@ public interface BankinformationMapper extends CommonBaseMapper<Bankinformation>
     List<Bankinformation> selectBankinformationBycondition(@Param("con") String con, @Param("companyId") Long companyId);
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
-    String selectBankcode(@Param("bk_bankcode") String bk_bankcode, @Param("companyId") Long companyId);
+    int selectBankcode(@Param("bk_bankcode") String bk_bankcode, @Param("id") Long id);
     Long selectBankId(@Param("bk_bankcode") String bk_bankcode, @Param("companyId") Long companyId);
 
     void check(Map<String, Object> map);

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

@@ -61,15 +61,13 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
         DocBaseDTO docBaseDTO = new DocBaseDTO();
 
         String bk_code = RegexpUtils.replaceSpecCharacter(bankinformation.getBk_bankcode());
-        String code = pushMaxnubmer(bk_code, bankinformation.getId());
+        String code = null;
 
-        String bktion = bankinformationMapper.selectBankcode(bankinformation.getBk_bankcode() ,BaseContextHolder.getCompanyId());
+        int bktion = bankinformationMapper.selectBankcode(bankinformation.getBk_bankcode() ,bankinformation.getId());
         //先判断ID,再判断编号
         if (bankinformation.getId() == 0)
         {
-            if (bktion != null){
-                throw new BizException(500, BizExceptionCode.ACCOUNT_EXISTS.getMessage());
-            }
+            code = pushMaxnubmer(bk_code, bankinformation.getId());
             bankinformation.setBk_thisamount(bankinformation.getBk_beginamount());
             bankinformation.setBk_bankcode(code);
             bankinformationMapper.insertSelective(bankinformation);
@@ -103,15 +101,13 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
                 }
             }
 
-            Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode(), BaseContextHolder.getCompanyId());
-            if (bktion != null){
-                if (id.equals(bankinformation.getId())){
+//            Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode(), BaseContextHolder.getCompanyId());
+            if (bktion > 0){
                     bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
                     messageLogService.update(docBaseDTO);
-                }else {
-                    throw new BizException(500, BizExceptionCode.ACCOUNT_EXISTS.getMessage());
-                }
             }else {
+                code = pushMaxnubmer(bk_code, bankinformation.getId());
+                bankinformation.setBk_bankcode(code);
                 bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
                 messageLogService.update(docBaseDTO);
             }

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

@@ -324,9 +324,9 @@
     </select>
 
 
-  <select id="selectBankcode" resultType="java.lang.String">
-        select bk_bankcode from bankinformation where
-        bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR} and companyId = #{companyId}
+  <select id="selectBankcode" resultType="java.lang.Integer">
+        select count(0) from bankinformation where
+        bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR} and bk_id = #{id}
     </select>
 
   <select id="selectBankId" resultType="java.lang.Long">

+ 19 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/VendorAcountView.java

@@ -21,6 +21,9 @@ public class VendorAcountView {
 
     private String pr_spec;
 
+    private String pr_orispeccode;
+    private String pr_brand;
+
     private String pd_unit;
 
     private Double qty;
@@ -38,6 +41,22 @@ public class VendorAcountView {
     private String pd_remark;
     private int ym;
 
+    public String getPr_orispeccode() {
+        return pr_orispeccode;
+    }
+
+    public void setPr_orispeccode(String pr_orispeccode) {
+        this.pr_orispeccode = pr_orispeccode;
+    }
+
+    public String getPr_brand() {
+        return pr_brand;
+    }
+
+    public void setPr_brand(String pr_brand) {
+        this.pr_brand = pr_brand;
+    }
+
     public int getYm() {
         return ym;
     }

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

@@ -12,6 +12,8 @@
     <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
     <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
     <result column="pd_unit" property="pd_unit" jdbcType="VARCHAR" />
+    <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
+    <result column="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR" />
     <result column="qty" property="qty" jdbcType="DOUBLE" />
     <result column="pd_orderprice" property="pd_orderprice" jdbcType="DOUBLE" />
     <result column="pd_taxrate" property="pd_taxrate" jdbcType="DOUBLE" />