Forráskód Böngészése

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

guq 7 éve
szülő
commit
40552cdd75
23 módosított fájl, 895 hozzáadás és 99 törlés
  1. 5 1
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Status.java
  2. 128 0
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java
  3. 41 31
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendorcontact.java
  4. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  5. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java
  6. 69 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java
  7. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java
  8. 3 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java
  9. 10 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorcontactMapper.java
  10. 4 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerkindService.java
  11. 51 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java
  12. 23 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java
  13. 35 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java
  14. 21 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java
  15. 7 6
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  16. 24 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java
  17. 25 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java
  18. 120 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  19. 23 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java
  20. 25 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  21. 3 0
      applications/document/document-server/src/main/resources/mapper/CustomerkindMapper.xml
  22. 49 0
      applications/document/document-server/src/main/resources/mapper/VendorMapper.xml
  23. 219 49
      applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml

+ 5 - 1
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Status.java

@@ -44,8 +44,12 @@ public enum Status {
     /**
      * 未出库
      */
-    UNTURNOUT("未出库")
+    UNTURNOUT("未出库"),
 
+    /**
+     * 开启
+     */
+    OPEN("开启")
 
     ;
     private String display;

+ 128 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/VendorList.java

@@ -0,0 +1,128 @@
+package com.usoftchina.saas.document.entities;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class VendorList implements Serializable {
+
+    /* 主表字段 */
+    private Long ve_id;
+    /**
+     * 供应商编号
+     */
+    private String ve_code;
+    /**
+     * 供应商名称
+     */
+    private String ve_name;
+    /**
+     * 供应商UU
+     */
+    private String ve_uu;
+    /**
+     * 供应商类型
+     */
+    private String ve_type;
+    /**
+     * 期初日期
+     */
+    private Date ve_begindate;
+    /**
+     * 期初应付
+     */
+    private long ve_beginapamount;
+    /**
+     * 期初预付
+     */
+    private long 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 Integer vc_veid;
+
+    private Integer vc_detno;
+
+    private String vc_name;
+
+    private Integer vc_tel;
+
+    private String vc_qq;
+
+    private String vc_email;
+
+    private String vc_text1;
+
+    private String vc_text2;
+
+    private String vc_text3;
+
+    private String vc_text4;
+
+    private String vc_text5;
+
+    private String vc_default;
+
+}

+ 41 - 31
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Vendorcontact.java

@@ -6,7 +6,7 @@ import java.io.Serializable;
 import java.util.Date;
 
 public class Vendorcontact extends CommonBaseEntity implements Serializable {
-    private Integer vc_veid;
+    private Long vc_veid;
 
     private Integer vc_detno;
 
@@ -18,21 +18,23 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
 
     private String vc_email;
 
-    private String ve_text1;
+    private String vc_text1;
 
-    private String ve_text2;
+    private String vc_text2;
 
-    private String ve_text3;
+    private String vc_text3;
 
-    private String ve_text4;
+    private String vc_text4;
 
-    private String ve_text5;
+    private String vc_text5;
 
-    public Integer getVc_veid() {
+    private String vc_default;
+
+    public Long getVc_veid() {
         return vc_veid;
     }
 
-    public void setVc_veid(Integer vc_veid) {
+    public void setVc_veid(Long vc_veid) {
         this.vc_veid = vc_veid;
     }
 
@@ -49,7 +51,7 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
     }
 
     public void setVc_name(String vc_name) {
-        this.vc_name = vc_name == null ? null : vc_name.trim();
+        this.vc_name = vc_name;
     }
 
     public Integer getVc_tel() {
@@ -65,7 +67,7 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
     }
 
     public void setVc_qq(String vc_qq) {
-        this.vc_qq = vc_qq == null ? null : vc_qq.trim();
+        this.vc_qq = vc_qq;
     }
 
     public String getVc_email() {
@@ -73,46 +75,54 @@ public class Vendorcontact extends CommonBaseEntity implements Serializable {
     }
 
     public void setVc_email(String vc_email) {
-        this.vc_email = vc_email == null ? null : vc_email.trim();
+        this.vc_email = vc_email;
+    }
+
+    public String getVc_text1() {
+        return vc_text1;
+    }
+
+    public void setVc_text1(String vc_text1) {
+        this.vc_text1 = vc_text1;
     }
 
-    public String getVe_text1() {
-        return ve_text1;
+    public String getVc_text2() {
+        return vc_text2;
     }
 
-    public void setVe_text1(String ve_text1) {
-        this.ve_text1 = ve_text1 == null ? null : ve_text1.trim();
+    public void setVc_text2(String vc_text2) {
+        this.vc_text2 = vc_text2;
     }
 
-    public String getVe_text2() {
-        return ve_text2;
+    public String getVc_text3() {
+        return vc_text3;
     }
 
-    public void setVe_text2(String ve_text2) {
-        this.ve_text2 = ve_text2 == null ? null : ve_text2.trim();
+    public void setVc_text3(String vc_text3) {
+        this.vc_text3 = vc_text3;
     }
 
-    public String getVe_text3() {
-        return ve_text3;
+    public String getVc_text4() {
+        return vc_text4;
     }
 
-    public void setVe_text3(String ve_text3) {
-        this.ve_text3 = ve_text3 == null ? null : ve_text3.trim();
+    public void setVc_text4(String vc_text4) {
+        this.vc_text4 = vc_text4;
     }
 
-    public String getVe_text4() {
-        return ve_text4;
+    public String getVc_text5() {
+        return vc_text5;
     }
 
-    public void setVe_text4(String ve_text4) {
-        this.ve_text4 = ve_text4 == null ? null : ve_text4.trim();
+    public void setVc_text5(String vc_text5) {
+        this.vc_text5 = vc_text5;
     }
 
-    public String getVe_text5() {
-        return ve_text5;
+    public String getVc_default() {
+        return vc_default;
     }
 
-    public void setVe_text5(String ve_text5) {
-        this.ve_text5 = ve_text5 == null ? null : ve_text5.trim();
+    public void setVc_default(String vc_default) {
+        this.vc_default = vc_default;
     }
 }

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

@@ -11,7 +11,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableEurekaClient
 //@EnableAuthClient
 @EnableTransactionManagement
-@EnableFeignClients
+@EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.document.mapper")
 public class DocumentApplication {
 

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerkindController.java

@@ -34,4 +34,9 @@ public class CustomerkindController {
         return Result.success(customerkindList);
     }
 
+    @GetMapping("/getCombo")
+    public Result getCombo(){
+        List<Customerkind> customerkindList = customerkindService.getCombo();
+        return Result.success(customerkindList);
+    }
 }

+ 69 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/VendorController.java

@@ -3,10 +3,12 @@ package com.usoftchina.saas.document.controller;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
 import com.usoftchina.saas.document.dto.VendorListDTO;
+import com.usoftchina.saas.document.entities.VendorList;
 import com.usoftchina.saas.document.service.VendorService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,16 +23,81 @@ public class VendorController {
     @Autowired
     private VendorService vendorService;
 
+    /**
+     * 获取供应商信息
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
     @GetMapping("/getVendorsByCondition")
     public Result<List<VendorDTO>> getVendorsByCondition(PageRequest page, ListReqDTO listReqDTO){
         PageInfo<VendorDTO> vendorList = vendorService.getVendorsByCondition(page, listReqDTO);
         return Result.success(vendorList);
     }
 
+    /**
+     * 通过供应商ID查找  供应商主从表数据
+     * @param id
+     * @return
+     */
     @GetMapping("/getListById/{id}")
     public Result<VendorListDTO> getDataById(@PathVariable("id") Long id){
-//        List<> vendorService.getListById(id);
-        return null;
+        VendorListDTO vendorListDTO = vendorService.getListById(id);
+        return Result.success(vendorListDTO);
+    }
+
+    /**
+     * 获取 供应商列表数据,包含供应商主表、从表数据
+     * @param listReqDTO
+     * @return
+     */
+    @GetMapping("/getListDataByCondition")
+    public Result<List<VendorList>> getListDataByCondition(ListReqDTO listReqDTO){
+        return Result.success(vendorService.getListDataByCondition(listReqDTO));
+    }
+
+    /**
+     * 保存供应商资料, 主从表数据
+     * @param vendorListDTO
+     * @return
+     */
+    @PostMapping("/save")
+    public Result saveFormData(@RequestBody VendorListDTO vendorListDTO){
+        DocBaseDTO docBaseDTO = vendorService.saveFormData(vendorListDTO);
+        return Result.success(docBaseDTO);
+    }
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        vendorService.deleteById(id);
+        return Result.success();
+    }
+
+    /**
+     * 关闭
+     * @param id
+     * @return
+     */
+    @PostMapping("/close/{id}")
+    public Result close(@PathVariable("id") Long id){
+        vendorService.close(id);
+        return Result.success();
+    }
+
+    /**
+     * 开启
+     * @param id
+     * @return
+     */
+    @PostMapping("/open/{id}")
+    public Result open(@PathVariable("id") Long id){
+        vendorService.open(id);
+        return Result.success();
     }
 
 }

+ 4 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/CustomerkindMapper.java

@@ -3,6 +3,8 @@ package com.usoftchina.saas.document.mapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.document.entities.Customerkind;
 
+import java.util.List;
+
 public interface CustomerkindMapper extends CommonBaseMapper<Customerkind> {
     int deleteByPrimaryKey(Long id);
 
@@ -15,4 +17,6 @@ public interface CustomerkindMapper extends CommonBaseMapper<Customerkind> {
     int updateByPrimaryKeySelective(Customerkind record);
 
     int updateByPrimaryKey(Customerkind record);
+
+    List<Customerkind> getCombo();
 }

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorMapper.java

@@ -4,7 +4,9 @@ import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 
 
 import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.document.dto.VendorListDTO;
 import com.usoftchina.saas.document.entities.Vendor;
+import com.usoftchina.saas.document.entities.VendorList;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -13,4 +15,5 @@ public interface VendorMapper extends CommonBaseMapper<Vendor> {
 
     List<VendorDTO> getVendorsByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
 
+    List<VendorList> getListDataByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
 }

+ 10 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/VendorcontactMapper.java

@@ -3,6 +3,8 @@ package com.usoftchina.saas.document.mapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.document.entities.Vendorcontact;
 
+import java.util.List;
+
 public interface VendorcontactMapper extends CommonBaseMapper<Vendorcontact> {
     int deleteByPrimaryKey(Long vc_id);
 
@@ -15,4 +17,12 @@ public interface VendorcontactMapper extends CommonBaseMapper<Vendorcontact> {
     int updateByPrimaryKeySelective(Vendorcontact record);
 
     int updateByPrimaryKey(Vendorcontact record);
+
+    List<Vendorcontact> selectByFK(Long id);
+
+    void batchInsert(List<Vendorcontact> vendorcontactList);
+
+    void batchUpdate(List<Vendorcontact> vendorcontactList);
+
+    void deleteByFK(Long id);
 }

+ 4 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerkindService.java

@@ -4,6 +4,10 @@ import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 
+import java.util.List;
+
 public interface CustomerkindService extends CommonBaseService<CustomerkindMapper, Customerkind> {
 
+    List<Customerkind> getCombo();
+
 }

+ 51 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/VendorService.java

@@ -4,17 +4,68 @@ import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseService;
 
 
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.document.dto.VendorListDTO;
 import com.usoftchina.saas.document.entities.Vendor;
+import com.usoftchina.saas.document.entities.VendorList;
 import com.usoftchina.saas.document.mapper.VendorMapper;
 
 import com.usoftchina.saas.page.PageRequest;
 
+import java.util.List;
+
 
 public interface VendorService extends CommonBaseService<VendorMapper, Vendor>{
 
+    /**
+     * 获取主表数据
+     * @param page      分页对象
+     * @param listReqDTO    条件对象
+     * @return  PageInfo<VendorDTO>
+     */
     PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, ListReqDTO listReqDTO);
 
+    /**
+     * 通过ID 获取主从表数据
+     * @param id
+     * @return VendorListDTO
+     */
+    VendorListDTO getListById(Long id);
+
+    /**
+     * 获取供应商资料列表
+     * @param listReqDTO  条件对象
+     * @return List<VendorList>
+     */
+    List<VendorList> getListDataByCondition(ListReqDTO listReqDTO);
+
+    /**
+     * 保存主从表数据
+     * @param vendorListDTO
+     * @return  DocBaseDTO
+     */
+    DocBaseDTO saveFormData(VendorListDTO vendorListDTO);
+
+    /**
+     * 通过主表ID  删除主从表数据
+     * @param id
+     */
+    void deleteById(Long id);
+
+    /**
+     * 关闭
+     * @param id
+     * @return  boolean
+     */
+    boolean close(Long id);
+
+    /**
+     * 开启
+     * @param id
+     * @return  boolean
+     */
+    boolean open(Long id);
 }

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

@@ -1,6 +1,10 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.po.Messagelog;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Address;
 import com.usoftchina.saas.document.mapper.AddressMapper;
 import com.usoftchina.saas.document.service.AddressService;
@@ -12,6 +16,10 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
 
     @Autowired
     private AddressMapper addressMapper;
+    @Autowired
+    private MessageLogService messageLogService;
+
+
 
     /**
      * 保存
@@ -20,7 +28,16 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
      */
     @Override
     public boolean save(Address address){
-        addressMapper.insertSelective(address);
+        if(address.getId() == 0){
+            address.setCompanyId(BaseContextHolder.getCompanyId());
+            addressMapper.insertSelective(address);
+            //记录LOG
+            messageLogService.save(generateMsgObj(address.getId()));
+        }else{
+            addressMapper.updateByPrimaryKeySelective(address);
+            //记录LOG
+            messageLogService.update(generateMsgObj(address.getId()));
+        }
         return true;
     }
 
@@ -33,6 +50,7 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
     public boolean removeByPrimaryKey(Long id){
         if(id != null && id > 0){
             addressMapper.deleteByPrimaryKey(id);
+            messageLogService.delete(generateMsgObj(id));
         }
         return true;
     }
@@ -47,4 +65,8 @@ public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Add
             addressMapper.deleteByIds(ids);
         }
     }
+
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "Address");
+    }
 }

+ 35 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerkindServiceImpl.java

@@ -1,17 +1,24 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Customerkind;
 import com.usoftchina.saas.document.mapper.CustomerkindMapper;
 import com.usoftchina.saas.document.service.CustomerkindService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindMapper, Customerkind> implements CustomerkindService {
 
     @Autowired
     private CustomerkindMapper customerkindMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
     /**
      * 保存
@@ -21,17 +28,44 @@ public class CustomerkindServiceImpl extends CommonBaseServiceImpl<CustomerkindM
     @Override
     public boolean save(Customerkind customerkind){
         if(customerkind.getId() == 0){
+            customerkind.setCompanyId(BaseContextHolder.getCompanyId());
             customerkindMapper.insertSelective(customerkind);
+            //记录LOG
+            messageLogService.save(generateMsgObj(customerkind.getId()));
         }else{
             customerkindMapper.updateByPrimaryKeySelective(customerkind);
+            //记录LOG
+            messageLogService.update(generateMsgObj(customerkind.getId()));
         }
         return true;
     }
 
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
     @Override
     public boolean removeByPrimaryKey(Long id){
-        customerkindMapper.deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            customerkindMapper.deleteByPrimaryKey(id);
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "CustomerKind");
+    }
+
+    @Override
+    public List<Customerkind> getCombo() {
+        List<Customerkind> customerkindList = getMapper().getCombo();
+        return customerkindList;
+    }
 }

+ 21 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java

@@ -1,10 +1,14 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.po.Messagelog;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Fundinouttype;
 import com.usoftchina.saas.document.mapper.FundinouttypeMapper;
 import com.usoftchina.saas.document.service.FundinouttypeService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -12,6 +16,9 @@ import java.util.List;
 @Service
 public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<FundinouttypeMapper, Fundinouttype> implements FundinouttypeService {
 
+    @Autowired
+    private MessageLogService messageLogService;
+
     /**
      * 保存/更新
      * @param fundinouttype
@@ -19,11 +26,15 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
      */
     @Override
     public boolean save(Fundinouttype fundinouttype){
-        fundinouttype.setCompanyId(BaseContextHolder.getCompanyId());
         if(fundinouttype.getId() == 0){
+            fundinouttype.setCompanyId(BaseContextHolder.getCompanyId());
             getMapper().insertSelective(fundinouttype);
+            //记录LOG
+            messageLogService.save(generateMsgObj(fundinouttype.getId()));
         }else{
             getMapper().updateByPrimaryKeySelective(fundinouttype);
+            //记录LOG
+            messageLogService.update(generateMsgObj(fundinouttype.getId()));
         }
         return true;
     }
@@ -35,8 +46,16 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
      */
     @Override
     public boolean removeByPrimaryKey(Long id){
-        getMapper().deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            getMapper().deleteByPrimaryKey(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, null, "FundInOutType");
+    }
+
 }

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

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Productbrand;
@@ -14,10 +15,10 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
 
     @Autowired
     private ProductbrandMapper productbrandMapper;
-//    @Autowired
-//    private MessageLogService messageLogService;
+    @Autowired
+    private MessageLogService messageLogService;
 
-    private final String LOG_NAME = "物料品牌";
+    private final String LOG_NAME = "ProductBrand";
 
     @Override
     public boolean save(Productbrand productbrand){
@@ -26,12 +27,12 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
             productbrandMapper.insertSelective(productbrand);
             //记录日志
             DocBaseDTO docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
-//            messageLogService.save(docBaseDTO);
+            messageLogService.save(docBaseDTO);
         }else{
             productbrandMapper.updateByPrimaryKeySelective(productbrand);
             //记录日志
             DocBaseDTO docBaseDTO = new DocBaseDTO(productbrand.getId(), null, LOG_NAME);
-//            messageLogService.update(docBaseDTO);
+            messageLogService.update(docBaseDTO);
         }
         return true;
     }
@@ -41,7 +42,7 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
         productbrandMapper.deleteByPrimaryKey(id);
         //记录日志
         DocBaseDTO docBaseDTO = new DocBaseDTO(id, null, LOG_NAME);
-//        messageLogService.delete(docBaseDTO);
+        messageLogService.delete(docBaseDTO);
         return true;
     }
 

+ 24 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProducttypeServiceImpl.java

@@ -1,6 +1,9 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Producttype;
 import com.usoftchina.saas.document.mapper.ProducttypeMapper;
 import com.usoftchina.saas.document.service.ProducttypeService;
@@ -14,6 +17,8 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
 
     @Autowired
     private ProducttypeMapper producttypeMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
     /**
      * 保存
@@ -23,9 +28,14 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
     @Override
     public boolean save(Producttype producttype){
         if(producttype.getId() == 0){
+            producttype.setCompanyId(BaseContextHolder.getCompanyId());
             producttypeMapper.insertSelective(producttype);
+            //记录LOG
+            messageLogService.save(generateMsgObj(producttype.getId()));
         }else{
             producttypeMapper.updateByPrimaryKeySelective(producttype);
+            //记录LOG
+            messageLogService.update(generateMsgObj(producttype.getId()));
         }
         return true;
     }
@@ -37,8 +47,21 @@ public class ProducttypeServiceImpl extends CommonBaseServiceImpl<ProducttypeMap
      */
     @Override
     public boolean removeByPrimaryKey(Long id){
-        producttypeMapper.deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            producttypeMapper.deleteByPrimaryKey(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "ProductType");
+    }
+
 }

+ 25 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductunitServiceImpl.java

@@ -1,10 +1,13 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Productunit;
 import com.usoftchina.saas.document.mapper.ProductunitMapper;
 import com.usoftchina.saas.document.service.ProductunitService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -12,20 +15,31 @@ import java.util.List;
 @Service
 public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMapper, Productunit> implements ProductunitService {
 
+    @Autowired
+    private MessageLogService messageLogService;
+
     @Override
     public boolean save(Productunit productunit){
-        productunit.setCompanyId(BaseContextHolder.getCompanyId());
         if(productunit.getId() == 0){
+            productunit.setCompanyId(BaseContextHolder.getCompanyId());
             getMapper().insertSelective(productunit);
+            //记录LOG
+            messageLogService.save(generateMsgObj(productunit.getId()));
         }else{
             getMapper().updateByPrimaryKeySelective(productunit);
+            //记录LOG
+            messageLogService.update(generateMsgObj(productunit.getId()));
         }
         return true;
     }
 
     @Override
     public boolean removeByPrimaryKey(Long id){
-        getMapper().deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            getMapper().deleteByPrimaryKey(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
@@ -35,4 +49,13 @@ public class ProductunitServiceImpl extends CommonBaseServiceImpl<ProductunitMap
         return productunitList;
     }
 
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "ProductUnit");
+    }
+
 }

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

@@ -3,15 +3,23 @@ package com.usoftchina.saas.document.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocReqDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.VendorDTO;
+import com.usoftchina.saas.document.dto.VendorListDTO;
 import com.usoftchina.saas.document.entities.Vendor;
+import com.usoftchina.saas.document.entities.VendorList;
+import com.usoftchina.saas.document.entities.Vendorcontact;
 import com.usoftchina.saas.document.mapper.VendorMapper;
+import com.usoftchina.saas.document.mapper.VendorcontactMapper;
 import com.usoftchina.saas.document.service.VendorService;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.BeanMapper;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -23,6 +31,11 @@ import java.util.List;
 @Service
 public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendor> implements VendorService {
 
+    @Autowired
+    private VendorcontactMapper vendorcontactMapper;
+    @Autowired
+    private MessageLogService messageLogService;
+
     @Override
     public PageInfo<VendorDTO> getVendorsByCondition(PageRequest page, ListReqDTO listReqDTO) {
         //设置分页
@@ -38,6 +51,104 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         return pageInfo;
     }
 
+    /**
+     * 通过ID查找主从表数据
+     * @param id
+     * @return
+     */
+    @Override
+    public VendorListDTO getListById(Long id) {
+        VendorListDTO vendorListDTO = new VendorListDTO();
+        Vendor vendor = getMapper().selectByPrimaryKey(id);
+        List<Vendorcontact> vendorcontactList = vendorcontactMapper.selectByFK(id);
+        //设置主从表信息
+        vendorListDTO.setMain(vendor);
+        vendorListDTO.setItems(vendorcontactList);
+        return vendorListDTO;
+    }
+
+    /**
+     * 返回列表数据
+     * @return
+     */
+    public List<VendorList> getListDataByCondition(ListReqDTO listReqDTO){
+        String condition = listReqDTO.getFinalCondition();
+        return getMapper().getListDataByCondition(condition, BaseContextHolder.getCompanyId());
+    }
+
+    /**
+     * 保存主从表数据
+     * @param vendorListDTO
+     */
+    @Override
+    public DocBaseDTO saveFormData(VendorListDTO vendorListDTO) {
+        Vendor main = vendorListDTO.getMain();
+        List<Vendorcontact> items = vendorListDTO.getItems();
+        if(main.getId() == 0){
+            //保存主表信息
+            getMapper().insertSelective(main);
+            Long mainId = main.getId();
+            //更新明细表vc_veid
+            for(Vendorcontact item : items){
+                item.setVc_veid(mainId);
+            }
+            //保存明细表信息
+            vendorcontactMapper.batchInsert(items);
+            //记录LOG
+            messageLogService.save(generateMsgObj(mainId));
+        }else{
+            getMapper().updateByPrimaryKeySelective(main);
+            vendorcontactMapper.batchUpdate(items);
+            //记录LOG
+            messageLogService.update(generateMsgObj(main.getId()));
+        }
+        return generateMsgObj(main.getId());
+    }
+
+    /**
+     * 删除主从表数据
+     * @param id
+     */
+    @Override
+    public void deleteById(Long id) {
+        if(id != null && id > 0){
+            getMapper().deleteByPrimaryKey(id);
+            vendorcontactMapper.deleteByFK(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
+    }
+
+    /**
+     * 关闭
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean close(Long id){
+        Vendor vendor = new Vendor();
+        vendor.setId(id);
+        vendor.setVe_status(Status.CLOSE.getDisplay());
+        vendor.setVe_statuscode(Status.CLOSE.name());
+        getMapper().updateByPrimaryKeySelective(vendor);
+        return true;
+    }
+
+    /**
+     * 开启
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean open(Long id){
+        Vendor vendor = new Vendor();
+        vendor.setId(id);
+        vendor.setVe_status(Status.OPEN.getDisplay());
+        vendor.setVe_statuscode(Status.OPEN.name());
+        getMapper().updateByPrimaryKeySelective(vendor);
+        return true;
+    }
+
     private List<VendorDTO> getList(ListReqDTO listReqDTO){
         Long companyId = BaseContextHolder.getCompanyId();
         String condition = listReqDTO.getFinalCondition();
@@ -48,4 +159,13 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         return vendorDTOList;
     }
 
+    /**
+     * 构造日记记录对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "Vendor");
+    }
+
 }

+ 23 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorkindServiceImpl.java

@@ -1,6 +1,9 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Vendorkind;
 import com.usoftchina.saas.document.mapper.VendorkindMapper;
 import com.usoftchina.saas.document.service.VendorkindService;
@@ -12,21 +15,40 @@ public class VendorkindServiceImpl extends CommonBaseServiceImpl<VendorkindMappe
 
     @Autowired
     private VendorkindMapper vendorkindMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
     @Override
     public boolean save(Vendorkind vendorkind){
         if(vendorkind.getId() == 0){
+            vendorkind.setCompanyId(BaseContextHolder.getCompanyId());
             vendorkindMapper.insertSelective(vendorkind);
+            //记录LOG
+            messageLogService.save(generateMsgObj(vendorkind.getId()));
         }else{
             vendorkindMapper.updateByPrimaryKeySelective(vendorkind);
+            //记录LOG
+            messageLogService.update(generateMsgObj(vendorkind.getId()));
         }
         return true;
     }
 
     @Override
     public boolean removeByPrimaryKey(Long id){
-        vendorkindMapper.deleteByPrimaryKey(id);
+        if(id != null && id > 0){
+            vendorkindMapper.deleteByPrimaryKey(id);
+            //记录LOG
+            messageLogService.delete(generateMsgObj(id));
+        }
         return true;
     }
 
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "VendorKind");
+    }
 }

+ 25 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java

@@ -1,10 +1,13 @@
 package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Warehouse;
 import com.usoftchina.saas.document.mapper.WarehouseMapper;
 import com.usoftchina.saas.document.service.WarehouseService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
@@ -13,6 +16,9 @@ import java.util.Map;
 @Service
 public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper, Warehouse> implements WarehouseService {
 
+    @Autowired
+    private MessageLogService messageLogService;
+
     /**
      * 过账
      * @param map
@@ -48,7 +54,16 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
      */
     @Override
     public int insertSelective(Warehouse record) {
-        int count = getMapper().insertSelective(record);
+        int count = 0;
+        if(record.getId() == 0){
+            count = getMapper().insertSelective(record);
+            //记录LOG
+            messageLogService.save(generateMsgObj(record.getId()));
+        }else{
+            getMapper().updateByPrimaryKeySelective(record);
+            //记录LOG
+            messageLogService.update(generateMsgObj(record.getId()));
+        }
         return count;
     }
 
@@ -60,4 +75,13 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
     public void unPost(Map<String, Object> map) {
         getMapper().unPost(map);
     }
+
+    /**
+     * 构造 记录日志对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id){
+        return new DocBaseDTO(id, "", "Warehouse");
+    }
 }

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

@@ -122,4 +122,7 @@
   <select id="selectAll" resultMap="BaseResultMap">
     SELECT * FROM CUSTOMERKIND
   </select>
+  <select id="getCombo" resultType="com.usoftchina.saas.commons.dto.ComboDTO">
+    SELECT ck_name display,ck_name value FROM CUSTOMERKIND
+  </select>
 </mapper>

+ 49 - 0
applications/document/document-server/src/main/resources/mapper/VendorMapper.xml

@@ -50,5 +50,54 @@
         ORDER BY VE_ID
     </select>
 
+    <resultMap id="VendorListResultMapper" type="com.usoftchina.saas.document.entities.VendorList">
+        <id column="ve_id" property="ve_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="INTEGER" />
+        <result column="ve_beginprepayamount" property="ve_beginprepayamount" jdbcType="INTEGER" />
+        <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="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="vc_veid" property="vc_veid" jdbcType="INTEGER" />
+        <result column="vc_detno" property="vc_detno" jdbcType="INTEGER" />
+        <result column="vc_name" property="vc_name" jdbcType="VARCHAR" />
+        <result column="vc_tel" property="vc_tel" jdbcType="INTEGER" />
+        <result column="vc_qq" property="vc_qq" jdbcType="VARCHAR" />
+        <result column="vc_email" property="vc_email" jdbcType="VARCHAR" />
+        <result column="vc_text1" property="vc_text1" jdbcType="VARCHAR" />
+        <result column="vc_text2" property="vc_text2" jdbcType="VARCHAR" />
+        <result column="vc_text3" property="vc_text3" jdbcType="VARCHAR" />
+        <result column="vc_text4" property="vc_text4" jdbcType="VARCHAR" />
+        <result column="vc_text5" property="vc_text5" jdbcType="VARCHAR" />
+        <result column="vc_default" property="vc_default" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <select id="getListDataByCondition" resultMap="VendorListResultMapper">
+        SELECT * FROM VENDOR LEFT JOIN VENDORCONTACT ON VE_ID = VC_VEID
+        <where>
+            <if test="condition!=null">
+                ${condition}
+            </if>
+            AND VENDOR.COMPANYID = #{companyId}
+        </where>
+        order by VE_ID,VC_DETNO
+    </select>
+
 </mapper>
 

+ 219 - 49
applications/document/document-server/src/main/resources/mapper/VendorcontactMapper.xml

@@ -12,15 +12,16 @@
     <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="vc_text1" property="vc_text1" jdbcType="VARCHAR" />
+    <result column="vc_text2" property="vc_text2" jdbcType="VARCHAR" />
+    <result column="vc_text3" property="vc_text3" jdbcType="VARCHAR" />
+    <result column="vc_text4" property="vc_text4" jdbcType="VARCHAR" />
+    <result column="vc_text5" property="vc_text5" jdbcType="VARCHAR" />
+    <result column="vc_default" property="vc_default" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     vc_id, vc_veid, vc_detno, vc_name, vc_tel, vc_qq, vc_email, companyId, updaterId, 
-    updateTime, ve_text1, ve_text2, ve_text3, ve_text4, ve_text5
+    updateTime, vc_text1, vc_text2, vc_text3, vc_text4, vc_text5, ve_default
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
@@ -28,22 +29,33 @@
     from vendorcontact
     where vc_id = #{id}
   </select>
+  <select id="selectByFK" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select
+    <include refid="Base_Column_List" />
+    from vendorcontact
+    where vc_veid = #{id}
+  </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
     delete from vendorcontact
     where vc_id = #{id}
   </delete>
+  <delete id="deleteByFK" parameterType="java.lang.Long">
+    DELETE FROM VENDORCONTACT
+    WHERE VC_VEID=#{id}
+  </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Vendorcontact" >
     insert into vendorcontact (vc_veid, vc_detno,
       vc_name, vc_tel, vc_qq, 
       vc_email, companyId, updaterId, 
-      updateTime, ve_text1, ve_text2, 
-      ve_text3, ve_text4, ve_text5
+      updateTime, vc_text1, vc_text2, 
+      vc_text3, vc_text4, vc_text5, ve_default
       )
-    values (#{vc_veid,jdbcType=INTEGER}, #{vc_detno,jdbcType=INTEGER},
+    values (#{vc_veid}, #{vc_detno,jdbcType=INTEGER},
       #{vc_name,jdbcType=VARCHAR}, #{vc_tel,jdbcType=INTEGER}, #{vc_qq,jdbcType=VARCHAR}, 
       #{vc_email,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{ve_text1,jdbcType=VARCHAR}, #{ve_text2,jdbcType=VARCHAR}, 
-      #{ve_text3,jdbcType=VARCHAR}, #{ve_text4,jdbcType=VARCHAR}, #{ve_text5,jdbcType=VARCHAR}
+      #{updateTime,jdbcType=TIMESTAMP}, #{vc_text1,jdbcType=VARCHAR}, #{vc_text2,jdbcType=VARCHAR}, 
+      #{vc_text3,jdbcType=VARCHAR}, #{vc_text4,jdbcType=VARCHAR}, #{vc_text5,jdbcType=VARCHAR},
+      #{ve_default,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendorcontact" >
@@ -76,25 +88,28 @@
       <if test="updateTime != null" >
         updateTime,
       </if>
-      <if test="ve_text1 != null" >
-        ve_text1,
+      <if test="vc_text1 != null" >
+        vc_text1,
+      </if>
+      <if test="vc_text2 != null" >
+        vc_text2,
       </if>
-      <if test="ve_text2 != null" >
-        ve_text2,
+      <if test="vc_text3 != null" >
+        vc_text3,
       </if>
-      <if test="ve_text3 != null" >
-        ve_text3,
+      <if test="vc_text4 != null" >
+        vc_text4,
       </if>
-      <if test="ve_text4 != null" >
-        ve_text4,
+      <if test="vc_text5 != null" >
+        vc_text5,
       </if>
-      <if test="ve_text5 != null" >
-        ve_text5,
+      <if test="ve_default != null" >
+        ve_default,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="vc_veid != null" >
-        #{vc_veid,jdbcType=INTEGER},
+        #{vc_veid},
       </if>
       <if test="vc_detno != null" >
         #{vc_detno,jdbcType=INTEGER},
@@ -120,20 +135,23 @@
       <if test="updateTime != null" >
         #{updateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="ve_text1 != null" >
-        #{ve_text1,jdbcType=VARCHAR},
+      <if test="vc_text1 != null" >
+        #{vc_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="vc_text2 != null" >
+        #{vc_text2,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text2 != null" >
-        #{ve_text2,jdbcType=VARCHAR},
+      <if test="vc_text3 != null" >
+        #{vc_text3,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text3 != null" >
-        #{ve_text3,jdbcType=VARCHAR},
+      <if test="vc_text4 != null" >
+        #{vc_text4,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text4 != null" >
-        #{ve_text4,jdbcType=VARCHAR},
+      <if test="vc_text5 != null" >
+        #{vc_text5,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text5 != null" >
-        #{ve_text5,jdbcType=VARCHAR},
+      <if test="ve_default != null" >
+        #{ve_default,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
@@ -141,7 +159,7 @@
     update vendorcontact
     <set >
       <if test="vc_veid != null" >
-        vc_veid = #{vc_veid,jdbcType=INTEGER},
+        vc_veid = #{vc_veid},
       </if>
       <if test="vc_detno != null" >
         vc_detno = #{vc_detno,jdbcType=INTEGER},
@@ -167,27 +185,30 @@
       <if test="updateTime != null" >
         updateTime = #{updateTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="ve_text1 != null" >
-        ve_text1 = #{ve_text1,jdbcType=VARCHAR},
+      <if test="vc_text1 != null" >
+        vc_text1 = #{vc_text1,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text2 != null" >
-        ve_text2 = #{ve_text2,jdbcType=VARCHAR},
+      <if test="vc_text2 != null" >
+        vc_text2 = #{vc_text2,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text3 != null" >
-        ve_text3 = #{ve_text3,jdbcType=VARCHAR},
+      <if test="vc_text3 != null" >
+        vc_text3 = #{vc_text3,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text4 != null" >
-        ve_text4 = #{ve_text4,jdbcType=VARCHAR},
+      <if test="vc_text4 != null" >
+        vc_text4 = #{vc_text4,jdbcType=VARCHAR},
       </if>
-      <if test="ve_text5 != null" >
-        ve_text5 = #{ve_text5,jdbcType=VARCHAR},
+      <if test="vc_text5 != null" >
+        vc_text5 = #{vc_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="ve_default != null" >
+        ve_default = #{ve_default,jdbcType=VARCHAR},
       </if>
     </set>
     where vc_id = #{id}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Vendorcontact" >
     update vendorcontact
-    set vc_veid = #{vc_veid,jdbcType=INTEGER},
+    set vc_veid = #{vc_veid},
       vc_detno = #{vc_detno,jdbcType=INTEGER},
       vc_name = #{vc_name,jdbcType=VARCHAR},
       vc_tel = #{vc_tel,jdbcType=INTEGER},
@@ -196,11 +217,160 @@
       companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updateTime = #{updateTime,jdbcType=TIMESTAMP},
-      ve_text1 = #{ve_text1,jdbcType=VARCHAR},
-      ve_text2 = #{ve_text2,jdbcType=VARCHAR},
-      ve_text3 = #{ve_text3,jdbcType=VARCHAR},
-      ve_text4 = #{ve_text4,jdbcType=VARCHAR},
-      ve_text5 = #{ve_text5,jdbcType=VARCHAR}
+      vc_text1 = #{vc_text1,jdbcType=VARCHAR},
+      vc_text2 = #{vc_text2,jdbcType=VARCHAR},
+      vc_text3 = #{vc_text3,jdbcType=VARCHAR},
+      vc_text4 = #{vc_text4,jdbcType=VARCHAR},
+      vc_text5 = #{vc_text5,jdbcType=VARCHAR},
+      ve_default = #{ve_default,jdbcType=VARCHAR}
     where vc_id = #{id}
   </update>
+  <insert id="batchInsert" parameterType="java.util.List">
+    <foreach collection="list" item="item" separator=",">
+      INSERT INTO VENDORCONTACT
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="item.vc_veid != null" >
+          vc_veid,
+        </if>
+        <if test="item.vc_detno != null" >
+          vc_detno,
+        </if>
+        <if test="item.vc_name != null" >
+          vc_name,
+        </if>
+        <if test="item.vc_tel != null" >
+          vc_tel,
+        </if>
+        <if test="item.vc_qq != null" >
+          vc_qq,
+        </if>
+        <if test="item.vc_email != null" >
+          vc_email,
+        </if>
+        <if test="item.companyId != null" >
+          companyId,
+        </if>
+        <if test="item.updaterId != null" >
+          updaterId,
+        </if>
+        <if test="item.updateTime != null" >
+          updateTime,
+        </if>
+        <if test="item.vc_text1 != null" >
+          vc_text1,
+        </if>
+        <if test="item.vc_text2 != null" >
+          vc_text2,
+        </if>
+        <if test="item.vc_text3 != null" >
+          vc_text3,
+        </if>
+        <if test="item.vc_text4 != null" >
+          vc_text4,
+        </if>
+        <if test="item.vc_text5 != null" >
+          vc_text5,
+        </if>
+        <if test="item.ve_default != null" >
+          ve_default,
+        </if>
+      </trim>
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="item.vc_veid != null" >
+          #{item.vc_veid},
+        </if>
+        <if test="item.vc_detno != null" >
+          #{item.vc_detno,jdbcType=INTEGER},
+        </if>
+        <if test="item.vc_name != null" >
+          #{item.vc_name,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_tel != null" >
+          #{item.vc_tel,jdbcType=INTEGER},
+        </if>
+        <if test="item.vc_qq != null" >
+          #{item.vc_qq,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_email != null" >
+          #{item.vc_email,jdbcType=VARCHAR},
+        </if>
+        <if test="item.companyId != null" >
+          #{item.companyId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updaterId != null" >
+          #{item.updaterId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updateTime != null" >
+          #{item.updateTime,jdbcType=TIMESTAMP},
+        </if>
+        <if test="item.vc_text1 != null" >
+          #{item.vc_text1,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_text2 != null" >
+          #{item.vc_text2,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_text3 != null" >
+          #{item.vc_text3,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_text4 != null" >
+          #{item.vc_text4,jdbcType=VARCHAR},
+        </if>
+        <if test="item.vc_text5 != null" >
+          #{item.vc_text5,jdbcType=VARCHAR},
+        </if>
+        <if test="item.ve_default != null" >
+          #{item.ve_default,jdbcType=VARCHAR},
+        </if>
+      </trim>
+    </foreach>
+  </insert>
+  <update id="batchUpdate" parameterType="com.usoftchina.saas.document.entities.Vendorcontact">
+    <foreach collection="list" item="item" index="index" separator=";">
+      UPDATE VENDORCONTACT
+      <if test="item.vc_detno != null" >
+        vc_detno = #{item.vc_detno,jdbcType=INTEGER},
+      </if>
+      <if test="item.vc_name != null" >
+        vc_name = #{item.vc_name,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_tel != null" >
+        vc_tel = #{item.vc_tel,jdbcType=INTEGER},
+      </if>
+      <if test="item.vc_qq != null" >
+        vc_qq = #{item.vc_qq,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_email != null" >
+        vc_email = #{item.vc_email,jdbcType=VARCHAR},
+      </if>
+      <if test="item.companyId != null" >
+        companyId = #{item.companyId,jdbcType=INTEGER},
+      </if>
+      <if test="item.updaterId != null" >
+        updaterId = #{item.updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="item.updateTime != null" >
+        updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="item.vc_text1 != null" >
+        vc_text1 = #{item.vc_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_text2 != null" >
+        vc_text2 = #{item.vc_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_text3 != null" >
+        vc_text3 = #{item.vc_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_text4 != null" >
+        vc_text4 = #{item.vc_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="item.vc_text5 != null" >
+        vc_text5 = #{item.vc_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="item.ve_default != null" >
+        ve_default = #{item.ve_default,jdbcType=VARCHAR},
+      </if>
+      WHERE VC_ID= #{item.id,jdbcType=INTEGER}
+    </foreach>
+  </update>
+
 </mapper>