Browse Source

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

guq 7 years ago
parent
commit
d603076c46
45 changed files with 828 additions and 244 deletions
  1. 6 3
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  2. 20 0
      applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationDTO.java
  3. 29 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/MoneyReportColltroller.java
  4. 10 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/VerificationController.java
  5. 4 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java
  6. 12 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/CustmonthMapper.java
  7. 12 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VendmonthMapper.java
  8. 103 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Custmonth.java
  9. 103 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendmonth.java
  10. 20 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verification.java
  11. 4 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/MoneyReportService.java
  12. 92 18
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java
  13. 41 41
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  14. 46 46
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  15. 10 13
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  16. 25 0
      applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml
  17. 45 0
      applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml
  18. 1 0
      applications/money/money-server/src/main/resources/mapper/CustomerCheckViewMapper.xml
  19. 42 0
      applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml
  20. 1 0
      applications/money/money-server/src/main/resources/mapper/VendorAcountViewMapper.xml
  21. 19 1
      applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml
  22. 2 0
      applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java
  23. 6 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java
  24. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java
  25. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java
  26. 69 37
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java
  27. 1 0
      applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml
  28. 26 6
      applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml
  29. 3 0
      frontend/saas-web/app/view/core/base/ImportWindow.js
  30. 4 3
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js
  31. 4 0
      frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js
  32. 2 0
      frontend/saas-web/app/view/core/form/field/ConDateField.js
  33. 10 14
      frontend/saas-web/app/view/core/form/field/DetailGridField.js
  34. 1 1
      frontend/saas-web/app/view/core/query/QueryFormPanel.js
  35. 5 0
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  36. 4 6
      frontend/saas-web/app/view/document/bom/BasePanel.js
  37. 8 13
      frontend/saas-web/app/view/document/customer/BasePanel.js
  38. 4 14
      frontend/saas-web/app/view/document/product/BasePanel.js
  39. 2 1
      frontend/saas-web/app/view/document/product/FormController.js
  40. 7 11
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  41. 1 1
      frontend/saas-web/app/view/home/infoCardList/PurchaseIn.js
  42. 1 1
      frontend/saas-web/app/view/home/infoCardList/SaleOut.js
  43. 5 1
      frontend/saas-web/app/view/money/verification/QueryPanelModel.js
  44. 3 1
      frontend/saas-web/app/view/sale/saleIn/FormPanel.js
  45. 11 11
      frontend/saas-web/resources/json/navigation.json

+ 6 - 3
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -74,19 +74,22 @@ public enum BizExceptionCode implements BaseExceptionCode {
 
     //销售
     SALE_ALL_TURNOUT(72000, "该销售单已全部转出货,无法转出货单"),
-    SALE_CLOSE(72001, "单据已关闭,无法进行操作"),
+    SALE_CLOSE(72001, "单据已关闭,无法%s"),
     SALE_YQTYBEYONDQTY(72001, "明细行已转数量大于数量"),
     SALE_NULL_BILL(72002, "单据不存在或者明细为空"),
     SALEOUT_ALL_TURNIN(72003, "该出货单已全部转退货,无法转销售退货单"),
-    SALEOUT_POSTSTATUS_ERROR(72004,"当前单据状态无法进行此操作"),
+    SALEOUT_POSTSTATUS_ERROR(72004,"当前单据状态无法进行此操作"),
     SALEOUT_POST_ERROR(72005,"编号:<u>%s</u>处理失败,%s"),
     SALEOUT_UNAUDIT_ERROR(72006,"销售订单已转出货单,无法反审核"),
     SALE_ORDER_HASAUDIT(72003, "存在已审核单据,单据编号:%s"),
     SALE_EXISTS_PURCHASE(72004, "存在已转的采购单据,单据编号:%s"),
-    SALE_ALREADY_UNAUDIT(72007, "单据状态为未审核,无法反审核"),
+    SALE_ALREADY_UNAUDIT(72007, "反审核失败!该单据非审核状态"),
     SALE_CUST_CLOSE(72008, "客户已关闭,无法审核"),
     SALE_ORDER_ISUNAUDIT(72009, "存在未审核单据,单据编号:%s"),
     SALE_ORDER_ISCOLSED(72010, "存在已关闭单据,单据编号:%s"),
+    SALE_ORDER_CUSTBANDED(72011, "存在已禁用客户,无法%s,单据编号:"),
+    SALE_CUSTBANDED(72013, "存在已禁用客户,无法%s"),
+    SALE_AUDITED(72014,"审核失败!该单据已审核"),
     //资金
     PAYBALANCE_OUTNOWBALANCE(74001,"本次核销金额不能大于未核销金额"),
     PAYBALANCE_UNIQUESOURCECODE(74002, "保存失败!不能选择重复的源单"),

+ 20 - 0
applications/money/money-dto/src/main/java/com/usoftchina/saas/money/dto/VerificationDTO.java

@@ -68,6 +68,26 @@ public class VerificationDTO extends  CommonBaseDTO implements Serializable {
 
     private String vc_text5;
 
+    private Date vc_auditdate;
+
+    private String vc_auditman;
+
+    public Date getVc_auditdate() {
+        return vc_auditdate;
+    }
+
+    public void setVc_auditdate(Date vc_auditdate) {
+        this.vc_auditdate = vc_auditdate;
+    }
+
+    public String getVc_auditman() {
+        return vc_auditman;
+    }
+
+    public void setVc_auditman(String vc_auditman) {
+        this.vc_auditman = vc_auditman;
+    }
+
     public Integer getVc_id() {
         return vc_id;
     }

+ 29 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/MoneyReportColltroller.java

@@ -58,10 +58,38 @@ public class MoneyReportColltroller {
         return Result.success(listData);
     }
 
-    //冲账明细表
+    //核销明细表
     @GetMapping("/accountdetails")
     public Result accountdetails(PageRequest page, ListReqDTO req) {
         Map<String, Object> listData = moneyReportService.accountdetails(page, req);
         return Result.success(listData);
     }
+
+    //应付总账
+    @GetMapping("/vendormonthdetails")
+    public Result vendormonthdetails(PageRequest page, ListReqDTO req) {
+        Map<String, Object> listData = moneyReportService.vendormonthdetails(page, req);
+        return Result.success(listData);
+    }
+
+    //应收总账
+    @GetMapping("/custormonthdetails")
+    public Result custormonthdetails(PageRequest page, ListReqDTO req) {
+        Map<String, Object> listData = moneyReportService.custormonthdetails(page, req);
+        return Result.success(listData);
+    }
+
+    //其他收支明细表
+    @GetMapping("/othrinoutdetails")
+    public Result othrinoutdetails(PageRequest page, ListReqDTO req) {
+        Map<String, Object> listData = moneyReportService.othrinoutdetails(page, req);
+        return Result.success(listData);
+    }
+
+    //毛利润分析表
+    @GetMapping("/profitdetails")
+    public Result profitdetails(PageRequest page, ListReqDTO req) {
+        Map<String, Object> listData = moneyReportService.profitdetails(page, req);
+        return Result.success(listData);
+    }
 }

+ 10 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/VerificationController.java

@@ -13,6 +13,7 @@ import com.usoftchina.saas.money.po.VerificationList;
 import com.usoftchina.saas.money.service.VerificationService;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -58,6 +59,7 @@ public class VerificationController {
      * @param form
      * @return
      */
+    @Transactional
     @RequestMapping("/save")
     public Result<DocSavedDTO> saveFormData(@RequestBody VerificationFormDTO form) {
         DocBaseDTO base = verificationService.saveFormData(form);
@@ -69,6 +71,7 @@ public class VerificationController {
      * @param id
      * @return
      */
+    @Transactional
     @PostMapping("/delete/{id}")
     public Result delete(@PathVariable("id") Long id) {
         verificationService.delete(id);
@@ -80,6 +83,7 @@ public class VerificationController {
      * @param id
      * @return
      */
+    @Transactional
     @PostMapping("/deleteDetail1/{id}")
     public Result deleteDetail1(@PathVariable("id") Long id) {
         verificationService.deleteDetail1(id);
@@ -91,36 +95,42 @@ public class VerificationController {
      * @param id
      * @return
      */
+    @Transactional
     @PostMapping("/deleteDetail2/{id}")
     public Result deleteDetail2(@PathVariable("id") Long id) {
         verificationService.deleteDetail2(id);
         return Result.success();
     }
 
+    @Transactional
     @RequestMapping("/audit")
     public Result audit(@RequestBody VerificationFormDTO formDTO) {
         DocBaseDTO audit = verificationService.audit(formDTO);
         return Result.success(audit);
     }
 
+    @Transactional
     @RequestMapping("/unAudit/{id}")
     public Result resAudit(@PathVariable("id") Long id) {
         verificationService.resAudit(id);
         return Result.success();
     }
 
+    @Transactional
     @RequestMapping("/batchAudit")
     public Result batchAudit(@RequestBody  BatchDealBaseDTO body) {
         verificationService.batchAudit(body);
         return Result.success();
     }
 
+    @Transactional
     @RequestMapping("/batchUnAudit")
     public Result batchUnAudit(@RequestBody BatchDealBaseDTO body) {
         verificationService.batchUnAudit(body);
         return Result.success();
     }
 
+    @Transactional
     @PostMapping("/batchDelete")
     public Result batchDelete(@RequestBody BatchDealBaseDTO body) {
         verificationService.batchDelete(body);

+ 4 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java

@@ -39,4 +39,8 @@ public interface BanksubledgerMapper extends CommonBaseMapper<Banksubledger> {
     int updateBankcode(@Param("bk_thisamount") Double bk_thisamount, @Param("nowbalance") Double nowbalance,
                        @Param("bankcode") String bankcode, @Param("symbol") String symbol);
     Double selectThisamount(@Param("bankcode") String bankcode, @Param("companyId") Long companyId);
+
+
+    List<Banksubledger> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
 }

+ 12 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/CustmonthMapper.java

@@ -0,0 +1,12 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Custmonth;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface CustmonthMapper {
+    List<Custmonth> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    void callCustm(Map<String, Integer> map);
+}

+ 12 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/VendmonthMapper.java

@@ -0,0 +1,12 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Vendmonth;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface VendmonthMapper {
+    List<Vendmonth> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    void callVend(Map<String, Integer> map);
+}

+ 103 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Custmonth.java

@@ -0,0 +1,103 @@
+package com.usoftchina.saas.money.po;
+
+public class Custmonth {
+    private Integer cm_id;
+
+    private Integer cm_yearmonth;
+
+    private Integer cm_custid;
+
+    private String cm_custcode;
+
+    private String cm_custname;
+
+    private Double cm_beginamount;
+
+    private Double cm_nowamount;
+
+    private Double cm_nowpreamount;
+
+    private Double cm_endamount;
+
+    private Integer companyid;
+
+    public Integer getCm_id() {
+        return cm_id;
+    }
+
+    public void setCm_id(Integer cm_id) {
+        this.cm_id = cm_id;
+    }
+
+    public Integer getCm_yearmonth() {
+        return cm_yearmonth;
+    }
+
+    public void setCm_yearmonth(Integer cm_yearmonth) {
+        this.cm_yearmonth = cm_yearmonth;
+    }
+
+    public Integer getCm_custid() {
+        return cm_custid;
+    }
+
+    public void setCm_custid(Integer cm_custid) {
+        this.cm_custid = cm_custid;
+    }
+
+    public String getCm_custcode() {
+        return cm_custcode;
+    }
+
+    public void setCm_custcode(String cm_custcode) {
+        this.cm_custcode = cm_custcode == null ? null : cm_custcode.trim();
+    }
+
+    public String getCm_custname() {
+        return cm_custname;
+    }
+
+    public void setCm_custname(String cm_custname) {
+        this.cm_custname = cm_custname == null ? null : cm_custname.trim();
+    }
+
+    public Double getCm_beginamount() {
+        return cm_beginamount;
+    }
+
+    public void setCm_beginamount(Double cm_beginamount) {
+        this.cm_beginamount = cm_beginamount;
+    }
+
+    public Double getCm_nowamount() {
+        return cm_nowamount;
+    }
+
+    public void setCm_nowamount(Double cm_nowamount) {
+        this.cm_nowamount = cm_nowamount;
+    }
+
+    public Double getCm_nowpreamount() {
+        return cm_nowpreamount;
+    }
+
+    public void setCm_nowpreamount(Double cm_nowpreamount) {
+        this.cm_nowpreamount = cm_nowpreamount;
+    }
+
+    public Double getCm_endamount() {
+        return cm_endamount;
+    }
+
+    public void setCm_endamount(Double cm_endamount) {
+        this.cm_endamount = cm_endamount;
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+}

+ 103 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Vendmonth.java

@@ -0,0 +1,103 @@
+package com.usoftchina.saas.money.po;
+
+public class Vendmonth {
+    private Integer vm_id;
+
+    private Integer vm_yearmonth;
+
+    private Integer vm_vendid;
+
+    private String vm_vendcode;
+
+    private String vm_vendname;
+
+    private Double vm_beginamount;
+
+    private Double vm_nowamount;
+
+    private Double vm_nowpreamount;
+
+    private Double vm_endamount;
+
+    private Integer companyid;
+
+    public Integer getVm_id() {
+        return vm_id;
+    }
+
+    public void setVm_id(Integer vm_id) {
+        this.vm_id = vm_id;
+    }
+
+    public Integer getVm_yearmonth() {
+        return vm_yearmonth;
+    }
+
+    public void setVm_yearmonth(Integer vm_yearmonth) {
+        this.vm_yearmonth = vm_yearmonth;
+    }
+
+    public Integer getVm_vendid() {
+        return vm_vendid;
+    }
+
+    public void setVm_vendid(Integer vm_vendid) {
+        this.vm_vendid = vm_vendid;
+    }
+
+    public String getVm_vendcode() {
+        return vm_vendcode;
+    }
+
+    public void setVm_vendcode(String vm_vendcode) {
+        this.vm_vendcode = vm_vendcode;
+    }
+
+    public String getVm_vendname() {
+        return vm_vendname;
+    }
+
+    public void setVm_vendname(String vm_vendname) {
+        this.vm_vendname = vm_vendname;
+    }
+
+    public Double getVm_beginamount() {
+        return vm_beginamount;
+    }
+
+    public void setVm_beginamount(Double vm_beginamount) {
+        this.vm_beginamount = vm_beginamount;
+    }
+
+    public Double getVm_nowamount() {
+        return vm_nowamount;
+    }
+
+    public void setVm_nowamount(Double vm_nowamount) {
+        this.vm_nowamount = vm_nowamount;
+    }
+
+    public Double getVm_nowpreamount() {
+        return vm_nowpreamount;
+    }
+
+    public void setVm_nowpreamount(Double vm_nowpreamount) {
+        this.vm_nowpreamount = vm_nowpreamount;
+    }
+
+    public Double getVm_endamount() {
+        return vm_endamount;
+    }
+
+    public void setVm_endamount(Double vm_endamount) {
+        this.vm_endamount = vm_endamount;
+    }
+
+    public Integer getCompanyid() {
+        return companyid;
+    }
+
+    public void setCompanyid(Integer companyid) {
+        this.companyid = companyid;
+    }
+}

+ 20 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Verification.java

@@ -65,6 +65,26 @@ public class Verification extends CommonBaseEntity implements Serializable {
 
     private String vc_text5;
 
+    private Date vc_auditdate;
+
+    private String vc_auditman;
+
+    public Date getVc_auditdate() {
+        return vc_auditdate;
+    }
+
+    public void setVc_auditdate(Date vc_auditdate) {
+        this.vc_auditdate = vc_auditdate;
+    }
+
+    public String getVc_auditman() {
+        return vc_auditman;
+    }
+
+    public void setVc_auditman(String vc_auditman) {
+        this.vc_auditman = vc_auditman;
+    }
+
     public Integer getVc_id() {
         return vc_id;
     }

+ 4 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/MoneyReportService.java

@@ -17,4 +17,8 @@ public interface MoneyReportService {
     Map<String, Object> acountBalance(PageRequest page, ListReqDTO req);
     Map<String, Object> customercheck(PageRequest page, ListReqDTO req);
     Map<String, Object> accountdetails(PageRequest page, ListReqDTO req);
+    Map<String, Object> vendormonthdetails(PageRequest page, ListReqDTO req);
+    Map<String, Object> custormonthdetails(PageRequest page, ListReqDTO req);
+    Map<String, Object> othrinoutdetails(PageRequest page, ListReqDTO req);
+    Map<String, Object> profitdetails(PageRequest page, ListReqDTO req);
 }

+ 92 - 18
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/MoneyReportServiceImpl.java

@@ -11,15 +11,13 @@ import com.usoftchina.saas.money.po.CustomerCheckView;
 import com.usoftchina.saas.money.po.VendorAcountView;
 import com.usoftchina.saas.money.po.VendOrCustAdd;
 import com.usoftchina.saas.money.service.MoneyReportService;
+import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @author heqw
@@ -39,6 +37,10 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     private CustomerCheckViewMapper customerCheckViewMapper;
     @Autowired
     private AccountDetailsViewMapper accountDetailsViewMapper;
+    @Autowired
+    private VendmonthMapper vendmonthMapper;
+    @Autowired
+    private CustmonthMapper custmonthMapper;
 
     @Override
     public Map<String, Object> vendorCheck(PageRequest page, ListReqDTO req) {
@@ -70,22 +72,59 @@ public class MoneyReportServiceImpl implements MoneyReportService {
         return getListDATA(page, req, "accountdetails");
     }
 
-    private Map<String, Object> getListDATA(PageRequest page, ListReqDTO req, String type) {
-        //设置默认分页
+    @Override
+    public Map<String, Object> vendormonthdetails(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "vendormonthdetails");
+    }
+
+    @Override
+    public Map<String, Object> custormonthdetails(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "custormonthdetails");
+    }
+
+    @Override
+    public Map<String, Object> othrinoutdetails(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "othrinoutdetails");
+    }
+
+    @Override
+    public Map<String, Object> profitdetails(PageRequest page, ListReqDTO req) {
+        return getListDATA(page, req, "profitdetails");
+    }
+
+    private Map<String, Object> getListDATA(@PageDefault(size = 10) PageRequest page, ListReqDTO req, String type) {
+        if ("custormonthdetails".equals(type)){
+            Map map1 = this.getYm(req.getCondition());
+            Map<String, Integer> map = new HashMap();
+            map.put("v_YearMonth", Integer.valueOf((String) map1.get("yearmonth")));
+            map.put("v_YearMonthTo", Integer.valueOf((String) map1.get("yearmonthTo")));
+            map.put("v_companyid", Math.toIntExact(BaseContextHolder.getCompanyId()));
+            custmonthMapper.callCustm(map);
+        }else if ("vendormonthdetails".equals(type)){
+            Map map1 = this.getYm(req.getCondition());
+            Map<String, Integer> map = new HashMap();
+            map.put("v_YearMonth", Integer.valueOf((String) map1.get("yearmonth")));
+            map.put("v_YearMonthTo", Integer.valueOf((String) map1.get("yearmonthTo")));
+            map.put("v_companyid",  Math.toIntExact(BaseContextHolder.getCompanyId()));
+            vendmonthMapper.callVend(map);
+        }
+
+      /*  //设置默认分页
         if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
             page = new PageRequest();
             page.setNumber(1);
             page.setSize(10);
-        }
-        PageHelper.startPage(page.getNumber(), page.getSize());
-
-        //查询数据
-        Map<String, Object> map = getListByType(req, type);
-        //取分页信息
-        PageInfo lists = new PageInfo((List) map.get("list"));
-        map.remove("list");
-        map.put("list", lists);
-        return map;
+        }*/
+
+          PageHelper.startPage(page.getNumber(), page.getSize());
+
+          //查询数据
+          Map<String, Object> map = getListByType(req, type);
+          //取分页信息
+          PageInfo lists = new PageInfo((List) map.get("list"));
+          map.remove("list");
+          map.put("list", lists);
+          return map;
     }
 
     private Map<String, Object> getListByType(ListReqDTO req, String type) {
@@ -179,6 +218,13 @@ public class MoneyReportServiceImpl implements MoneyReportService {
             if (!StringUtils.isEmpty(calculateFieldsSql)) {
                 res = accountDetailsViewMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
             }
+        }else if("vendormonthdetails".equals(type)){
+            list = vendmonthMapper.selectByCondition(con, companyId);
+            res = null;
+        }else if ("custormonthdetails".equals(type)){
+            System.out.println("companyid"+companyId);
+            list = custmonthMapper.selectByCondition(con, companyId);
+            res = null;
         }
 
         try {
@@ -207,13 +253,41 @@ public class MoneyReportServiceImpl implements MoneyReportService {
                 Object type = jsonObject.get("type");
                 if ("date".equals(type)){
                     String value = (String) jsonObject.get("value");
-                    System.out.println("value" + value);
                     value = value.replace(",", "' and '");
                     con =  " a.sl_date between '" + value + "'" ;
-                    System.out.println("con"+con);
+                    return con;
                 }
             }
         }
         return con;
     }
+
+    //取两个期间
+    public Map<String, String> getYm(String cons){
+        System.out.println("cons:" + cons);
+        JSONArray jsonArray = JSONArray.parseArray(cons);
+        Map<String, String> map = new HashMap<>();
+        if (null != jsonArray && jsonArray.size() > 0) {
+            StringBuffer finalCondition = new StringBuffer();
+            for (int i = 0; i < jsonArray.size(); i++) {
+                JSONObject jsonObject = (JSONObject) jsonArray.get(i);
+//
+//                String yearmonth = "yearmonth";
+//                String yearmonthTo = "yearmonthTo";
+//                if (st.equals("vend")){
+//                    yearmonth = "vm_" + yearmonth;
+//                    yearmonthTo = "vm_" + yearmonthTo;
+//                }else if (st.equals("cust")){
+//                    yearmonth = "cm_" + yearmonth;
+//                    yearmonthTo = "cm_" + yearmonthTo;
+//                }
+                    String value = (String) jsonObject.get("value");
+                    String[] arr = value.split(",");
+                    map.put("yearmonth", arr[0]);
+                    map.put("yearmonthTo", arr[1]);
+            }
+        }
+        System.out.println("map:" + map);
+        return map;
+    }
 }

+ 41 - 41
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java

@@ -151,32 +151,32 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
          * cu_recamount=nvl(cu_recamount,0)-rb_rbdamount,
          * cu_leftamount=cu_beginaramount-cu_beginprerecamount+cu_recamount-cu_preamount;
          */
-        if (othreceipts.getOr_custid() != null && othreceipts.getOr_custid() != 0) {
-            Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(othreceipts.getOr_custid());
-            Double preamount = customerData.getCu_preamount() == null ? new Double(0) : customerData.getCu_preamount();
-            Double beginapamount = customerData.getCu_beginaramount() == null ? new Double(0) : customerData.getCu_beginaramount();
-            Double beginprepayamount = customerData.getCu_beginprerecamount() == null ? new Double(0) : customerData.getCu_beginprerecamount();
-            Double recamount = customerData.getCu_recamount() == null ? new Double(0) : customerData.getCu_recamount();
-
-            Customer customer = new Customer();
-            customer.setId(Long.valueOf(othreceipts.getOr_custid()));
-            customer.setCu_preamount(preamount);
-            customer.setCu_recamount(recamount + or_amount);
-            customer.setCu_leftamount(beginapamount - beginprepayamount + recamount + or_amount - preamount);
-            recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
-
-            //插入subledger中间表
-            Subledger subledger = new Subledger();
-            subledger.setSl_code(othreceipts.getOr_code());
-            subledger.setSl_kind("其他收入单");
-            subledger.setSl_custid(othreceipts.getOr_custid());
-            subledger.setSl_vendid(0);
-            subledger.setSl_date(othreceipts.getOr_date());
-            subledger.setSl_ym(DateUtils.getYm(othreceipts.getOr_date()));
-            subledger.setSl_amount(or_amount);
-            subledger.setCompanyId(BaseContextHolder.getCompanyId());
-            subledgerMapper.insertSelective(subledger);
-        }
+//        if (othreceipts.getOr_custid() != null && othreceipts.getOr_custid() != 0) {
+//            Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(othreceipts.getOr_custid());
+//            Double preamount = customerData.getCu_preamount() == null ? new Double(0) : customerData.getCu_preamount();
+//            Double beginapamount = customerData.getCu_beginaramount() == null ? new Double(0) : customerData.getCu_beginaramount();
+//            Double beginprepayamount = customerData.getCu_beginprerecamount() == null ? new Double(0) : customerData.getCu_beginprerecamount();
+//            Double recamount = customerData.getCu_recamount() == null ? new Double(0) : customerData.getCu_recamount();
+//
+//            Customer customer = new Customer();
+//            customer.setId(Long.valueOf(othreceipts.getOr_custid()));
+//            customer.setCu_preamount(preamount);
+//            customer.setCu_recamount(recamount + or_amount);
+//            customer.setCu_leftamount(beginapamount - beginprepayamount + recamount + or_amount - preamount);
+//            recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
+//
+//            //插入subledger中间表
+//            Subledger subledger = new Subledger();
+//            subledger.setSl_code(othreceipts.getOr_code());
+//            subledger.setSl_kind("其他收入单");
+//            subledger.setSl_custid(othreceipts.getOr_custid());
+//            subledger.setSl_vendid(0);
+//            subledger.setSl_date(othreceipts.getOr_date());
+//            subledger.setSl_ym(DateUtils.getYm(othreceipts.getOr_date()));
+//            subledger.setSl_amount(or_amount);
+//            subledger.setCompanyId(BaseContextHolder.getCompanyId());
+//            subledgerMapper.insertSelective(subledger);
+//        }
 
 
         //计算期间金额
@@ -249,21 +249,21 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
          * cu_recamount=nvl(cu_recamount,0)-rb_rbdamount,
          * cu_leftamount=cu_beginaramount-cu_beginprerecamount+cu_recamount-cu_preamount;
          */
-        if (othreceipts.getOr_custid() != null && othreceipts.getOr_custid() != 0) {
-            Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(othreceipts.getOr_custid());
-            Double preamount = customerData.getCu_preamount() == null ? new Double(0) : customerData.getCu_preamount();
-            Double beginapamount = customerData.getCu_beginaramount() == null ? new Double(0) : customerData.getCu_beginaramount();
-            Double beginprepayamount = customerData.getCu_beginprerecamount() == null ? new Double(0) : customerData.getCu_beginprerecamount();
-            Double recamount = customerData.getCu_recamount() == null ? new Double(0) : customerData.getCu_recamount();
-
-            Customer customer = new Customer();
-            customer.setId(Long.valueOf(othreceipts.getOr_custid()));
-            customer.setCu_preamount(preamount);
-            customer.setCu_recamount(recamount - or_amount);
-            customer.setCu_leftamount(beginapamount - beginprepayamount + recamount - or_amount - preamount);
-            recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
-            subledgerMapper.deleteByPrimaryKey(othreceipts.getOr_code(), "其他收入单",BaseContextHolder.getCompanyId());
-        }
+//        if (othreceipts.getOr_custid() != null && othreceipts.getOr_custid() != 0) {
+//            Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(othreceipts.getOr_custid());
+//            Double preamount = customerData.getCu_preamount() == null ? new Double(0) : customerData.getCu_preamount();
+//            Double beginapamount = customerData.getCu_beginaramount() == null ? new Double(0) : customerData.getCu_beginaramount();
+//            Double beginprepayamount = customerData.getCu_beginprerecamount() == null ? new Double(0) : customerData.getCu_beginprerecamount();
+//            Double recamount = customerData.getCu_recamount() == null ? new Double(0) : customerData.getCu_recamount();
+//
+//            Customer customer = new Customer();
+//            customer.setId(Long.valueOf(othreceipts.getOr_custid()));
+//            customer.setCu_preamount(preamount);
+//            customer.setCu_recamount(recamount - or_amount);
+//            customer.setCu_leftamount(beginapamount - beginprepayamount + recamount - or_amount - preamount);
+//            recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
+//            subledgerMapper.deleteByPrimaryKey(othreceipts.getOr_code(), "其他收入单",BaseContextHolder.getCompanyId());
+//        }
 
 
         //计算期间金额

+ 46 - 46
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java

@@ -186,37 +186,37 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         bankinformation.setBk_spending(spending + bk_amount);
         bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
 
-        /**
-         * ve_preamount=nvl(ve_preamount,0)+pb_preamount,
-         * ve_payamount=nvl(ve_payamount,0)-pb_pbdamount,
-         * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
-         */
-        if (othspendings.getOs_vendid() != null && othspendings.getOs_vendid() != 0) {
-            Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(othspendings.getOs_vendid());
-            Double preamount = vendorData.getVe_preamount() == null ? new Double(0) : vendorData.getVe_preamount();
-            Double beginapamount = vendorData.getVe_beginapamount() == null ? new Double(0) : vendorData.getVe_beginapamount();
-            Double beginprepayamount = vendorData.getVe_beginprepayamount() == null ? new Double(0) : vendorData.getVe_beginprepayamount();
-            Double payamount = vendorData.getVe_payamount() == null ? new Double(0) : vendorData.getVe_payamount();
-
-            Vendor vendor = new Vendor();
-            vendor.setId(Long.valueOf(othspendings.getOs_vendid()));
-            vendor.setVe_preamount(preamount);
-            vendor.setVe_payamount(payamount - bk_amount);
-            vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount - bk_amount - preamount);
-            paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
+//        /**
+//         * ve_preamount=nvl(ve_preamount,0)+pb_preamount,
+//         * ve_payamount=nvl(ve_payamount,0)-pb_pbdamount,
+//         * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
+//         */
+//        if (othspendings.getOs_vendid() != null && othspendings.getOs_vendid() != 0) {
+//            Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(othspendings.getOs_vendid());
+//            Double preamount = vendorData.getVe_preamount() == null ? new Double(0) : vendorData.getVe_preamount();
+//            Double beginapamount = vendorData.getVe_beginapamount() == null ? new Double(0) : vendorData.getVe_beginapamount();
+//            Double beginprepayamount = vendorData.getVe_beginprepayamount() == null ? new Double(0) : vendorData.getVe_beginprepayamount();
+//            Double payamount = vendorData.getVe_payamount() == null ? new Double(0) : vendorData.getVe_payamount();
+//
+//            Vendor vendor = new Vendor();
+//            vendor.setId(Long.valueOf(othspendings.getOs_vendid()));
+//            vendor.setVe_preamount(preamount);
+//            vendor.setVe_payamount(payamount - bk_amount);
+//            vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount - bk_amount - preamount);
+//            paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
 
             //插入subledger中间表
-            Subledger subledger = new Subledger();
-            subledger.setSl_code(othspendings.getOs_code());
-            subledger.setSl_kind("其他支出单");
-            subledger.setSl_custid(0);
-            subledger.setSl_vendid(othspendings.getOs_vendid());
-            subledger.setSl_date(othspendings.getOs_date());
-            subledger.setSl_ym(DateUtils.getYm(othspendings.getOs_date()));
-            subledger.setSl_amount(bk_amount);
-            subledger.setCompanyId(BaseContextHolder.getCompanyId());
-            subledgerMapper.insertSelective(subledger);
-        }
+//            Subledger subledger = new Subledger();
+//            subledger.setSl_code(othspendings.getOs_code());
+//            subledger.setSl_kind("其他支出单");
+//            subledger.setSl_custid(0);
+//            subledger.setSl_vendid(othspendings.getOs_vendid());
+//            subledger.setSl_date(othspendings.getOs_date());
+//            subledger.setSl_ym(DateUtils.getYm(othspendings.getOs_date()));
+//            subledger.setSl_amount(bk_amount);
+//            subledger.setCompanyId(BaseContextHolder.getCompanyId());
+//            subledgerMapper.insertSelective(subledger);
+//        }
 
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
@@ -282,22 +282,22 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
          * ve_payamount=nvl(ve_payamount,0)-pb_pbdamount,
          * ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
          */
-        if (othspendings.getOs_vendid() != null && othspendings.getOs_vendid() != 0) {
-            Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(othspendings.getOs_vendid());
-            Double preamount = vendorData.getVe_preamount() == null ? new Double(0) : vendorData.getVe_preamount();
-            Double beginapamount = vendorData.getVe_beginapamount() == null ? new Double(0) : vendorData.getVe_beginapamount();
-            Double beginprepayamount = vendorData.getVe_beginprepayamount() == null ? new Double(0) : vendorData.getVe_beginprepayamount();
-            Double payamount = vendorData.getVe_payamount() == null ? new Double(0) : vendorData.getVe_payamount();
-
-            Vendor vendor = new Vendor();
-            vendor.setId(Long.valueOf(othspendings.getOs_vendid()));
-            vendor.setVe_preamount(preamount);
-            vendor.setVe_payamount(payamount + bk_amount);
-            vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount + bk_amount - preamount);
-            paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
-
-            subledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他支出单",BaseContextHolder.getCompanyId());
-        }
+//        if (othspendings.getOs_vendid() != null && othspendings.getOs_vendid() != 0) {
+//            Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(othspendings.getOs_vendid());
+//            Double preamount = vendorData.getVe_preamount() == null ? new Double(0) : vendorData.getVe_preamount();
+//            Double beginapamount = vendorData.getVe_beginapamount() == null ? new Double(0) : vendorData.getVe_beginapamount();
+//            Double beginprepayamount = vendorData.getVe_beginprepayamount() == null ? new Double(0) : vendorData.getVe_beginprepayamount();
+//            Double payamount = vendorData.getVe_payamount() == null ? new Double(0) : vendorData.getVe_payamount();
+//
+//            Vendor vendor = new Vendor();
+//            vendor.setId(Long.valueOf(othspendings.getOs_vendid()));
+//            vendor.setVe_preamount(preamount);
+//            vendor.setVe_payamount(payamount + bk_amount);
+//            vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount + bk_amount - preamount);
+//            paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
+//
+//            subledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他支出单",BaseContextHolder.getCompanyId());
+//        }
 
 
         //计算期间金额
@@ -425,7 +425,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             banksubledger.setBl_assid(othspendings.getOs_vendid());
             banksubledger.setBl_asscode(othspendings.getOs_vendcode());
             banksubledger.setBl_assname(othspendings.getOs_vendname());
-            banksubledger.setBl_income(othspendingsdetail.getOsd_nowbalance());
+            banksubledger.setBl_spending(othspendingsdetail.getOsd_nowbalance());
             banksubledger.setBl_remark(othspendingsdetail.getOsd_remark());
             banksubledger.setBl_orderamount(othspendingsdetail.getOsd_nowbalance() * -1);
             banksubledger.setBl_item(othspendingsdetail.getOsd_type());

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

@@ -535,19 +535,14 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
 
     @Override
     public DocBaseDTO audit(VerificationFormDTO formData) {
-        Long id = null;
+
         DocBaseDTO baseDTO = new DocBaseDTO();
-        if (null != formData) {
-            id = formData.getMain().getId();
-            if (StringUtils.isEmpty(id)) {
-                baseDTO = saveFormData(formData);
-                id = baseDTO.getId();
-            }
-            Verification verification = new Verification();
-            verification.setVc_status(Status.AUDITED.getDisplay());
-            verification.setVc_statuscode(Status.AUDITED.name());
-            verification.setVc_id(Integer.valueOf(String.valueOf(id)));
-            verificationMapper.updateByPrimaryKeySelective(verification);
+        formData.getMain().setVc_status(Status.AUDITED.getDisplay());
+        formData.getMain().setVc_statuscode(Status.AUDITED.name());
+        formData.getMain().setVc_auditman(BaseContextHolder.getUserName());
+        formData.getMain().setVc_auditdate(new Date());
+        baseDTO = this.saveFormData(formData);
+        Long id = baseDTO.getId();
 
 
             VerificationDTO verificationDTO = formData.getMain();
@@ -575,7 +570,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                     updateAuditSubledeger(detail.getVcd_slid(),nowbalanceDet);
                 }
             }
-        }
+
         //更新出入库状态
         this.updateProdInoutStatus(id);
 
@@ -793,6 +788,8 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         verification.setVc_statuscode(Status.UNAUDITED.name());
         verification.setUpdateTime(new Date());
         verification.setUpdaterId(BaseContextHolder.getUserId());
+        verification.setVc_auditdate(null);
+        verification.setVc_auditman(null);
         //更新存在字段
         verificationMapper.updateByPrimaryKeySelective(verification);
 

+ 25 - 0
applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml

@@ -454,5 +454,30 @@
     </select>
 
 
+    <select id="selectByCondition" resultMap="BaseResultMap">
+        select  bl_date, bl_code, bl_kind,bl_bankcode,bl_bankid, bl_bankname, bl_income, bl_spending, bl_assname, bl_remark
+        from banksubledger
+        <where>
+            <if test="con != null">
+                ${con}
+            </if>
+            <if test="companyId != null">
+                and  companyId = #{companyId} and bl_kind = '其他支出单' or bl_kind = '其他收入单'
+            </if>
+        </where>
+        order by bl_bankname asc, bl_date desc,bl_bankcode desc
+    </select>
+
+    <select id="selectCalculateFields" resultType="string">
+        select   ${fields}  from banksubledger
+        <where>
+            <if test="con != null">
+                ${con}
+            </if>
+            <if test="companyId != null">
+                and  companyId = #{companyId} and bl_kind = '其他支出单' or bl_kind = '其他收入单'
+            </if>
+        </where>
+    </select>
 
 </mapper>

+ 45 - 0
applications/money/money-server/src/main/resources/mapper/CustmonthMapper.xml

@@ -0,0 +1,45 @@
+<?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.CustmonthMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Custmonth" >
+    <id column="cm_id" property="cm_id" jdbcType="INTEGER" />
+    <result column="cm_yearmonth" property="cm_yearmonth" jdbcType="INTEGER" />
+    <result column="cm_custid" property="cm_custid" jdbcType="INTEGER" />
+    <result column="cm_custcode" property="cm_custcode" jdbcType="VARCHAR" />
+    <result column="cm_custname" property="cm_custname" jdbcType="VARCHAR" />
+    <result column="cm_beginamount" property="cm_beginamount" jdbcType="DOUBLE" />
+   <result column="cm_nowamount" property="cm_nowamount" jdbcType="DOUBLE" />
+    <result column="cm_nowpreamount" property="cm_nowpreamount" jdbcType="DOUBLE" />
+    <result column="cm_endamount" property="cm_endamount" jdbcType="DOUBLE" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    cm_id, cm_yearmonth, cm_custid, cm_custcode, cm_custname, CM_BEGINAMOUNT, CM_NOWAMOUNT, 
+    CM_NOWPREAMOUNT, CM_ENDAMOUNT, companyid
+  </sql>
+
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from custmonth
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by cm_id desc, cm_yearmonth desc
+  </select>
+
+
+  <parameterMap id="ymParamMap" type="java.util.Map">
+    <parameter property="v_YearMonth" jdbcType="INTEGER" mode="IN" />
+    <parameter property="v_YearMonthTo" jdbcType="INTEGER" mode="IN" />
+    <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
+  </parameterMap>
+
+  <select id="callCustm" parameterMap="ymParamMap" statementType="CALLABLE" >
+        CALL SP_REFRESHCUSTMONTHNEW(?, ?, ?)
+   </select>
+
+</mapper>

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

@@ -50,6 +50,7 @@
         <result column="beginamount" property="beginamount" jdbcType="DOUBLE" />
         <result column="nowamount" property="nowamount" jdbcType="DOUBLE" />
         <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
+        <result column="nowbalance" property="nowbalance" jdbcType="DOUBLE" />
     </resultMap>
     <select id="selectCustAdd" resultMap="BaseAddMap">
     select a.sl_orderamount as beginamount, b.nowamount, b.nowpay,(a.sl_orderamount +b.nowamount-b.nowpay) as nowbalance FROM

+ 42 - 0
applications/money/money-server/src/main/resources/mapper/VendmonthMapper.xml

@@ -0,0 +1,42 @@
+<?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.VendmonthMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Vendmonth" >
+    <id column="vm_id" property="vm_id" jdbcType="INTEGER" />
+    <result column="vm_yearmonth" property="vm_yearmonth" jdbcType="INTEGER" />
+    <result column="vm_vendid" property="vm_vendid" jdbcType="INTEGER" />
+    <result column="vm_vendcode" property="vm_vendcode" jdbcType="VARCHAR" />
+    <result column="vm_vendname" property="vm_vendname" jdbcType="VARCHAR" />
+    <result column="vm_beginamount" property="vm_beginamount" jdbcType="DOUBLE" />
+    <result column="vm_nowamount" property="vm_nowamount" jdbcType="DOUBLE" />
+    <result column="vm_nowpreamount" property="vm_nowpreamount" jdbcType="DOUBLE" />
+    <result column="vm_endamount" property="vm_endamount" jdbcType="DOUBLE" />
+    <result column="companyid" property="companyid" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    vm_id, vm_yearmonth, vm_vendid, VM_VENDCODE, VM_VENDNAME, VM_BEGINAMOUNT, VM_NOWAMOUNT, 
+    VM_NOWPREAMOUNT, VM_ENDAMOUNT, companyid
+  </sql>
+
+  <select id="selectByCondition" resultMap="BaseResultMap">
+    select  *  from vendmonth
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyid = #{companyId}
+      </if>
+    </where>
+    order by vm_id desc, vm_yearmonth desc
+  </select>
+
+  <parameterMap id="ymParamMap" type="java.util.Map">
+    <parameter property="v_YearMonth" jdbcType="INTEGER" mode="IN" />
+    <parameter property="v_YearMonthTo" jdbcType="INTEGER" mode="IN" />
+    <parameter property="v_companyid" jdbcType="INTEGER" mode="IN" />
+  </parameterMap>
+  <select id="callVend" parameterMap="ymParamMap" statementType="CALLABLE">
+        CALL SP_REFRESHVENDMONTHNEW(?, ?, ?)
+    </select>
+</mapper>

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

@@ -53,6 +53,7 @@
     <result column="beginamount" property="beginamount" jdbcType="DOUBLE" />
     <result column="nowamount" property="nowamount" jdbcType="DOUBLE" />
     <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
+    <result column="nowbalance" property="nowbalance" jdbcType="DOUBLE" />
   </resultMap>
   <select id="selectVendAdd" resultMap="BaseAddMap">
     select a.sl_orderamount as beginamount, b.nowamount, b.nowpay,(a.sl_orderamount +b.nowamount-b.nowpay) as nowbalance FROM

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

@@ -31,6 +31,10 @@
     <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_auditman" property="vc_auditman" jdbcType="VARCHAR" />
+    <result column="vc_auditdate" property="vc_auditdate" jdbcType="TIMESTAMP" />
+    <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
   </resultMap>
   <sql id="Example_Where_Clause" >
     <where >
@@ -94,7 +98,7 @@
     vc_id, vc_code, vc_kind, vc_date, vc_vendid, vc_vendcode, vc_vendname, vc_custid, 
     vc_custcode, vc_custname, vc_turnvendid, vc_turnvendcode, vc_turnvendname, vc_turncustid, 
     vc_turncustcode, vc_turncustname, vc_amount1, vc_amount2, vc_status, vc_statuscode, vc_remark, companyId, updaterId, updateTime,
-    vc_text1, vc_text2, vc_text3, vc_text4, vc_text5
+    vc_text1, vc_text2, vc_text3, vc_text4, vc_text5, vc_auditman, vc_auditdate, createTime, creatorName
   </sql>
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.usoftchina.saas.money.po.VerificationExample" >
     select
@@ -235,6 +239,12 @@
       <if test="vc_text5 != null" >
         vc_text5,
       </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="vc_code != null" >
@@ -321,6 +331,12 @@
       <if test="vc_text5 != null" >
         #{vc_text5,jdbcType=VARCHAR},
       </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
     <selectKey resultType="Long" keyProperty="id" order="AFTER">
       SELECT LAST_INSERT_ID()
@@ -549,6 +565,8 @@
       <if test="vc_text5 != null" >
         vc_text5 = #{vc_text5,jdbcType=VARCHAR},
       </if>
+        vc_auditman = #{vc_auditman,jdbcType=VARCHAR},
+        vc_auditdate = #{vc_auditdate,jdbcType=TIMESTAMP}
     </set>
     where vc_id = #{vc_id,jdbcType=INTEGER}
   </update>

+ 2 - 0
applications/sale/sale-dto/src/main/java/com/usoftchina/saas/sale/dto/SaleDTO.java

@@ -59,4 +59,6 @@ public class SaleDTO extends CommonBaseDTO{
     private String sa_seller;
 
     private String sa_sellercode;
+
+    private Integer sa_sellerid;
 }

+ 6 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java

@@ -31,8 +31,12 @@ public interface SaleMapper extends CommonBaseMapper<Sale> {
 
     String validateUnAudit(Long id);
 
+    String validateCloseStatus(Long id);
+
     String validateAudit(List<DocBaseDTO> baseDTOs);
 
+    String validateAuditStatus(Long id);
+
     Integer validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long companyId);
 
     void updateTotal(Long id);
@@ -57,5 +61,7 @@ public interface SaleMapper extends CommonBaseMapper<Sale> {
 
     String validateCustAudit(List<DocBaseDTO> baseDTOs);
 
+    String validateCustStatus(Long id);
+
     String validateClose(List<DocBaseDTO> baseDTOs);
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/Sale.java

@@ -58,4 +58,6 @@ public class Sale extends CommonBaseEntity{
     private String sa_seller;
 
     private String sa_sellercode;
+
+    private Integer sa_sellerid;
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleList.java

@@ -65,6 +65,8 @@ public class SaleList implements Serializable {
 
     private String sa_auditman;
 
+    private Integer sa_sellerid;
+
     private Integer sd_id;
 
     private Integer sd_said;

+ 69 - 37
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java

@@ -225,6 +225,21 @@ public class SaleServiceImpl implements SaleService{
                 baseDTO = saveFormData(formData);
                 id = baseDTO.getId();
             }
+            //审核失败!该单据已审核
+            String code = saleMapper.validateAuditStatus(id);
+            if (null != code) {
+                throw new BizException(BizExceptionCode.SALE_AUDITED);
+            }
+            //存在已禁用客户,无法审核:
+            code = saleMapper.validateCustStatus(id);
+            if (null != code) {
+                throw new BizException(BizExceptionCode.SALE_CUSTBANDED.getCode(),String.format(BizExceptionCode.SALE_CUSTBANDED.getMessage(),"审核"));
+            }
+            //单据状态为已关闭,无法审核
+            code = saleMapper.validateCloseStatus(id);
+            if (null != code) {
+                throw new BizException(BizExceptionCode.SALE_CLOSE.getCode(),String.format(BizExceptionCode.SALE_CLOSE.getMessage(),"审核"));
+            }
             singleAudit(id);
         }
         return baseDTO;
@@ -232,17 +247,6 @@ public class SaleServiceImpl implements SaleService{
 
     @Transactional
     private void singleAudit(Long id) {
-        /*Sale sale = new Sale();
-        //生成更新对象
-        sale.setId(id);
-        sale.setSa_status(Status.AUDITED.getDisplay());
-        sale.setSa_statuscode(Status.AUDITED.name());
-        sale.setUpdateTime(new Date());
-        sale.setUpdaterId(BaseContextHolder.getUserId());
-        sale.setSa_auditman("TESTADMIN");
-        sale.setSa_auditdate(new Date());
-        //更新存在字段
-        saleMapper.updateByPrimaryKeySelective(sale);*/
         Integer integer = saleMapper.checkCustomer(id);
         if (integer > 0) {
             throw new BizException(BizExceptionCode.SALE_CUST_CLOSE);
@@ -266,17 +270,7 @@ public class SaleServiceImpl implements SaleService{
                 baseDTOs.getBaseDTOs().size() == 0) {
             return;
         }
-
-        String validate = saleMapper.validateAudit(baseDTOs.getBaseDTOs());
-        if (!StringUtils.isEmpty(validate)) {
-            String message = BizExceptionCode.SALE_ORDER_HASAUDIT.getMessage();
-            int code = BizExceptionCode.SALE_ORDER_HASAUDIT.getCode();
-            throw new BizException(code, String.format(message, validate));
-        }
-        String custAudit = saleMapper.validateCustAudit(baseDTOs.getBaseDTOs());
-        if (!StringUtils.isEmpty(custAudit)) {
-            throw new BizException(72009, "客户已关闭,无法审核, 单号:" + custAudit);
-        }
+        checkBatchAuditStatus(baseDTOs,"batchAudit");
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
             singleAudit(base.getId());
         }
@@ -287,6 +281,7 @@ public class SaleServiceImpl implements SaleService{
         if (null == id) {
             return;
         }
+        //单据状态为未审核,无法反审核
         String code = saleMapper.validateUnAudit(id);
         if (null != code) {
             throw new BizException(BizExceptionCode.SALE_ALREADY_UNAUDIT);
@@ -328,20 +323,7 @@ public class SaleServiceImpl implements SaleService{
                 baseDTOs.getBaseDTOs().size() == 0) {
             return;
         }
-        //存在未审核单据,单据编号:XXXX
-        String msg = saleMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
-        if (null != msg) {
-            String message = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getMessage();
-            int code = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getCode();
-            throw new BizException(code, String.format(message, msg));
-        }
-        //存在已关闭单据,单据编号:XXXX
-        msg = saleMapper.validateClose(baseDTOs.getBaseDTOs());
-        if (null != msg) {
-            String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
-            int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
-            throw new BizException(code, String.format(message, msg));
-        }
+        checkBatchAuditStatus(baseDTOs,"batchUnAudit");
         //saleMapper.BatchcheckSendStatus();
         for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
             unAudit(base.getId());
@@ -444,7 +426,7 @@ public class SaleServiceImpl implements SaleService{
             throw new BizException(BizExceptionCode.SALE_ALL_TURNOUT);
         }
         if (Status.CLOSE.name().equals(statuscode)){
-            throw new BizException(BizExceptionCode.SALE_CLOSE);
+            throw new BizException(BizExceptionCode.SALE_CLOSE.getCode(),String.format(BizExceptionCode.SALE_CLOSE.getMessage(),"转出货单"));
         }
 
         //检查从表
@@ -710,4 +692,54 @@ public class SaleServiceImpl implements SaleService{
         return null;
     }
 
+    /**
+     * 批量审核、反审核状态校验
+     * */
+    private void checkBatchAuditStatus(BatchDealBaseDTO baseDTOs,String opation){
+        if(opation.equals("batchAudit")){
+            //存在已审核单据,单据编号:XXX
+            String validate = saleMapper.validateAudit(baseDTOs.getBaseDTOs());
+            if (!StringUtils.isEmpty(validate)) {
+                String message = BizExceptionCode.SALE_ORDER_HASAUDIT.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_HASAUDIT.getCode();
+                throw new BizException(code, String.format(message, validate));
+            }
+            //存在已关闭单据,单据编号:XXXX
+            validate = saleMapper.validateClose(baseDTOs.getBaseDTOs());
+            if (null != validate) {
+                String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
+                throw new BizException(code, String.format(message, validate));
+            }
+            //存在已禁用客户,无法审核,单据编号:XXX
+            String custAudit = saleMapper.validateCustAudit(baseDTOs.getBaseDTOs());
+            if (!StringUtils.isEmpty(custAudit)) {
+                String message = BizExceptionCode.SALE_ORDER_CUSTBANDED.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_CUSTBANDED.getCode();
+                throw new BizException(code, String.format(message, "反审核")+custAudit);
+            }
+        }else{
+            //存在未审核单据,单据编号:XXXX
+            String msg = saleMapper.validateBatchUnAudit(baseDTOs.getBaseDTOs());
+            if (null != msg) {
+                String message = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_ISUNAUDIT.getCode();
+                throw new BizException(code, String.format(message, msg));
+            }
+            //存在已关闭单据,单据编号:XXXX
+            msg = saleMapper.validateClose(baseDTOs.getBaseDTOs());
+            if (null != msg) {
+                String message = BizExceptionCode.SALE_ORDER_ISCOLSED.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_ISCOLSED.getCode();
+                throw new BizException(code, String.format(message, msg));
+            }
+            //存在已禁用客户,无法审核,单据编号:XXX
+            msg = saleMapper.validateCustAudit(baseDTOs.getBaseDTOs());
+            if (!StringUtils.isEmpty(msg)) {
+                String message = BizExceptionCode.SALE_ORDER_CUSTBANDED.getMessage();
+                int code = BizExceptionCode.SALE_ORDER_CUSTBANDED.getCode();
+                throw new BizException(code, String.format(message, "反审核")+msg);
+            }
+        }
+    }
 }

+ 1 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleListMapper.xml

@@ -28,6 +28,7 @@
         <result column="sa_text3" property="sa_text3" jdbcType="VARCHAR" />
         <result column="sa_text4" property="sa_text4" jdbcType="VARCHAR" />
         <result column="sa_text5" property="sa_text5" jdbcType="VARCHAR" />
+        <result column="sa_sellerid" property="sa_sellerid" jdbcType="INTEGER" />
         <result column="sd_id" property="sd_id" jdbcType="INTEGER" />
         <result column="sd_said" property="sd_said" jdbcType="INTEGER" />
         <result column="sd_detno" property="sd_detno" jdbcType="INTEGER" />

+ 26 - 6
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -33,13 +33,14 @@
     <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
     <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
     <result column="createTime" property="createTime" jdbcType="TIMESTAMP"/>
+    <result column="sa_sellerid" property="sa_sellerid" jdbcType="INTEGER" />
   </resultMap>
   <sql id="Base_Column_List" >
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
     sa_remark, sa_status, sa_statuscode, sa_sendstatuscode, sa_sendstatus, sa_printstatus, 
     sa_printstatuscode,companyId, updaterId,
     updateTime, sa_text1, sa_text2, sa_text3, sa_text4, sa_text5,sa_auditman,sa_auditdate,
-    sa_seller,sa_sellercode,sa_date
+    sa_seller,sa_sellercode,sa_date,sa_sellerid
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select * from sale where sa_id = #{id}
@@ -56,7 +57,7 @@
       sa_sendstatus, sa_printstatus, sa_printstatuscode, 
       companyId, updaterId, updateTime,
       sa_text1, sa_text2, sa_text3, 
-      sa_text4, sa_text5)
+      sa_text4, sa_text5,sa_sellerid)
     values (#{sa_id,jdbcType=INTEGER}, #{sa_code,jdbcType=VARCHAR}, #{sa_custid,jdbcType=INTEGER}, 
       #{sa_custcode,jdbcType=VARCHAR}, #{sa_custname,jdbcType=VARCHAR}, #{sa_toplace,jdbcType=VARCHAR}, 
       #{sa_total,jdbcType=DOUBLE}, #{sa_totalupper,jdbcType=VARCHAR}, #{sa_remark,jdbcType=VARCHAR}, 
@@ -64,7 +65,7 @@
       #{sa_sendstatus,jdbcType=VARCHAR}, #{sa_printstatus,jdbcType=VARCHAR}, #{sa_printstatuscode,jdbcType=VARCHAR}, 
       #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
       #{sa_text1,jdbcType=VARCHAR}, #{sa_text2,jdbcType=VARCHAR}, #{sa_text3,jdbcType=VARCHAR}, 
-      #{sa_text4,jdbcType=VARCHAR}, #{sa_text5,jdbcType=VARCHAR})
+      #{sa_text4,jdbcType=VARCHAR}, #{sa_text5,jdbcType=VARCHAR},#{sa_sellerid,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
     <selectKey  resultType="java.lang.Long" keyProperty="id">
@@ -147,6 +148,9 @@
       <if test="sa_date != null" >
         sa_date,
       </if>
+      <if test="sa_sellerid != null">
+        sa_sellerid,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="sa_code != null" >
@@ -224,6 +228,9 @@
       <if test="sa_date != null" >
         #{sa_date,jdbcType=TIMESTAMP},
       </if>
+      <if test="sa_sellerid != null" >
+        #{sa_sellerid,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.sale.po.Sale" >
@@ -310,6 +317,9 @@
       <if test="sa_date != null" >
         sa_date = #{sa_date,jdbcType=TIMESTAMP},
       </if>
+      <if test="sa_sellerid != null" >
+        sa_sellerid = #{sa_sellerid,jdbcType=INTEGER},
+      </if>
     </set>
     where sa_id = #{id,jdbcType=INTEGER}
   </update>
@@ -336,7 +346,8 @@
       sa_text2 = #{sa_text2,jdbcType=VARCHAR},
       sa_text3 = #{sa_text3,jdbcType=VARCHAR},
       sa_text4 = #{sa_text4,jdbcType=VARCHAR},
-      sa_text5 = #{sa_text5,jdbcType=VARCHAR}
+      sa_text5 = #{sa_text5,jdbcType=VARCHAR},
+      sa_sellerid = #{sa_sellerid,jdbcType=INTEGER}
     where sa_id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -356,20 +367,29 @@
       #{item.id}
     </foreach>
   </select>
+  <select id="validateAuditStatus" resultType="string" parameterType="long">
+    select sa_code from sale where IFNULL(sa_statuscode,' ')='AUDITED' and sa_id=#{id}
+  </select>
   <select id="validateClose" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
       select GROUP_CONCAT(sa_code) from sale where IFNULL(sa_sendstatuscode,' ')='CLOSE' and sa_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>
   </select>
+  <select id="validateCloseStatus" resultType="string" parameterType="long">
+    select sa_code from sale where IFNULL(sa_sendstatuscode,' ')='CLOSE' and sa_id=#{id}
+  </select>
   <select id="validateCustAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
-    select GROUP_CONCAT(sa_code) from sale left join customer on cu_id=sa_custid  where sa_statuscode='AUDITED' and sa_id in
+    select GROUP_CONCAT(sa_code) from sale left join customer on cu_id=sa_custid  where IFNULL(sa_statuscode,' ')='AUDITED' and IFNULL(cu_statuscode,' ')='BANNED' and sa_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>
   </select>
+  <select id="validateCustStatus" resultType="string" parameterType="long">
+    select sa_code from sale left join customer on cu_id=sa_custid  where IFNULL(cu_statuscode,' ')='BANNED' and sa_id=#{id}
+  </select>
   <select id="validateBatchUnAudit" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
-    select GROUP_CONCAT(sa_code) from sale where IFNULL(sa_statuscode,'UNAUDITED') = 'UNAUDITED' and sa_id in
+    select GROUP_CONCAT(sa_code) from sale where IFNULL(sa_statuscode,' ') = 'UNAUDITED' and sa_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>

+ 3 - 0
frontend/saas-web/app/view/core/base/ImportWindow.js

@@ -98,6 +98,9 @@ Ext.define('saas.view.core.base.ImportWindow', {
                         if(!res.success){
                             saas.util.BaseUtil.showErrorToast('导入数据失败:' + res.message);
                         }else{
+                            //刷新界面
+                            var g = form.ownerCt.down('grid');
+                            g.store.loadPage(g.store.currentPage);
                             form.close();
                         }
                     },

+ 4 - 3
frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js

@@ -28,20 +28,21 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
         width:300
     }],
     dbColumns: [{
-        conditionCode: 'id',
         text: "客户ID",
         dataIndex: "id",
         hidden:true
     }, {
-        conditionCode: 'cu_code',
         text: "客户编号",
         dataIndex: "cu_code",
         width: 150
     }, {
-        conditionCode: 'cu_name',
         text: "客户名称",
         dataIndex: "cu_name",
         width: 200
+    }, {
+        text: "客户简称",
+        dataIndex: "cu_shortname",
+        width: 150
     }, {
         conditionCode: 'cu_type',
         text: "客户类型",

+ 4 - 0
frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js

@@ -41,6 +41,10 @@ Ext.define('saas.view.core.dbfind.types.VendorDbfindTrigger', {
         text: "供应商名称",
         dataIndex: "ve_name",
         width: 200
+    }, {
+        text: "供应商简称",
+        dataIndex: "ve_shortname",
+        width: 150
     }, {
         text: "供应商类型",
         dataIndex: "ve_type",

+ 2 - 0
frontend/saas-web/app/view/core/form/field/ConDateField.js

@@ -60,6 +60,7 @@ Ext.define('saas.view.core.form.field.ConDateField', {
             formatText: '',
             allowBlank: allowBlank,
             flex: 1,
+            editable:false,
             fieldStyle: me.fieldStyle,
             emptyText: '起始时间',
             //matchFieldWidth:true,
@@ -95,6 +96,7 @@ Ext.define('saas.view.core.form.field.ConDateField', {
             format: 'Y-m-d',
             formatText: '',
             flex: 1,
+            editable:false,
             fieldStyle: me.fieldStyle,
             emptyText: '结束时间',
             listeners: {

+ 10 - 14
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -217,25 +217,20 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
         store.each(function(s) {
             var itemFields = s.fields,
             itemData = s.getData(),
+            detno = itemData[detnoColumn],
+            id = itemData.id,
             dirtyFields = [];
 
-            for(var x = 0; x < itemFields.length; x++) {
-                var field = itemFields[x],
-                name = field.name,
-                type = field.type;
-
-                if(type == 'int' && itemData[name] == 0) {
-                }else if(type == 'string' && itemData[name] == '') {
-                }else if(type == 'float' && itemData[name] == 0) {
-                }else if(type == 'date' && itemData[name] == null) {
-                }else {
-                    dirtyFields.push(name);
-                }
+            if(s.isDirty()) {
+                var modified = s.modified;
+                var dirtyFields = Ext.Object.getAllKeys(modified);
             }
 
-            // 如果有有效数据(非ID和序号列)才算dirty,否则直接commit
+            // 如果有有效数据才算dirty,否则直接commit
             if(dirtyFields.length == 2 && Ext.Array.contains(dirtyFields, 'id') && Ext.Array.contains(dirtyFields, detnoColumn)) {
-                s.commit()
+                s.commit();
+            }else if(!Ext.isNumber(id) && dirtyFields.length == 1 && dirtyFields[0] == detnoColumn) {
+                s.commit();
             }
         });
 
@@ -287,6 +282,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             store.remove(selectedRecord);
             me.fireEvent('validChange');
         }
+        store.getAt(0) ? store.afterEdit(store.getAt(0), ['']) : null;
     },
 
     swapUp: function() {

+ 1 - 1
frontend/saas-web/app/view/core/query/QueryFormPanel.js

@@ -77,7 +77,7 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
     listeners: {
         boxReady:function(form){
             if(window.innerHeight - 110 >= 800){
-                form.setHeight(112);
+                form.setHeight(96);
             }
         },
         beforerender: function(form) {

+ 5 - 0
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -162,6 +162,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     text: '新增',
                     cls:'x-formpanel-btn-blue',
                     handler: 'onAddClick',
+                    hidden: true,
                     bind: {
                         hidden: '{!addEnable}'
                     }
@@ -184,12 +185,14 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                             } 
                         }
                     },
+                    hidden: true,
                     bind: {
                         hidden: '{!auditEnable}'
                     }
                 },  {
                     text: '导出',
                     handler: me.onExport,
+                    hidden: true,
                     bind: {
                         hidden: '{!importEnable}'
                     }
@@ -211,12 +214,14 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                             } 
                         }
                     },
+                    hidden: true,
                     bind: {
                         hidden: '{!closeEnable}'
                     }
                 }, {
                     text: '删除',
                     handler: me.onDelete,
+                    hidden: true,
                     bind: {
                         hidden: '{!deleteEnable}',
                         disabled: '{deleteDisable}'

+ 4 - 6
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -10,8 +10,8 @@ Ext.define('saas.view.document.bom.BasePanel', {
     searchField:[{
         xtype : "textfield", 
         name : "bo_mothercode", 
-        width:150, 
-        emptyText:'产品',
+        width:200, 
+        emptyText:'请输入产品编号或名称',
         getCondition: function(value) {
            return  ' (bo_mothername like\'%' + value + '%\'' 
                 +' or bo_mothercode like \'%'+value+'%\' ) ';
@@ -19,17 +19,15 @@ Ext.define('saas.view.document.bom.BasePanel', {
     },{
         xtype : "textfield", 
         name : "bo_version", 
-        width:110, 
-        emptyText:'版本'
+        fieldLabel:'版本'
     },{
         xtype: 'combobox',
         name: 'bo_statuscode',
         queryMode: 'local',
         displayField: 'bo_status',
         valueField: 'bo_statuscode',
-        emptyText :'状态',
+        fieldLabel :'状态',
         editable:false,
-        width:110,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['bo_statuscode', 'bo_status'],
         data: [

+ 8 - 13
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -11,34 +11,29 @@ Ext.define('saas.view.document.customer.BasePanel', {
     searchField:[{
         xtype : "textfield", 
         name : "cu_code", 
-        width:150, 
-        emptyText:'编号'
+        width:200, 
+        emptyText:'请输入客户编号或名称',
+        getCondition: function (v) {
+            return "(upper(CONCAT(cu_code,'#',cu_name)) like '%" + v.toUpperCase() + "%' )";
+        }
     }, {
-        xtype : "textfield", 
-        name : "cu_name", 
-        width:150, 
-        emptyText:'名称'
-    },{
         xtype : "remotecombo", 
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
-        emptyText : "客户类型", 
-        width:110,
+        fieldLabel : "客户类型", 
         hiddenBtn:true
     }, {
         xtype : "employeeDbfindTrigger", 
         name : "cu_sellername", 
-        width:150, 
-        emptyText:'业务员'
+        fieldLabel:'业务员'
     },{
         xtype: 'combobox',
         name: 'cu_statuscode',
         queryMode: 'local',
         displayField: 'cu_status',
         valueField: 'cu_statuscode',
-        emptyText :'状态',
+        fieldLabel :'状态',
         editable:false,
-        width:110,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['cu_statuscode', 'cu_status'],
         data: [

+ 4 - 14
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -12,9 +12,9 @@ Ext.define('saas.view.document.product.BasePanel', {
         xtype : "textfield", 
         name : "pr_code", 
         width:300, 
-        emptyText:'输入物料编号、名称、型号或规格',
+        emptyText:'输入物料编号、名称、型号、规格或品牌',
         getCondition: function (v) {
-            return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_spec,''),'#',ifnull(pr_orispeccode,''))) like '%" + v.toUpperCase() + "%')";
+            return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_spec,''),'#',ifnull(pr_orispeccode,'')'#',ifnull(pr_brand,''))) like '%" + v.toUpperCase() + "%' )";
         },
     },{
         editable:true,
@@ -22,24 +22,14 @@ Ext.define('saas.view.document.product.BasePanel', {
         xtype : "remotecombo", 
         storeUrl: '/api/document/producttype/getCombo',
         name : "pr_kind", 
-        emptyText : "物料类型",
-        width:130
-    }, {
-        editable:true,
-        hiddenBtn:true,
-        xtype : "remotecombo",
-        storeUrl:'/api/document/productbrand/getCombo',
-        name : "pr_brand", 
-        emptyText : "品牌", 
-        width:120
+        fieldLabel : '物料类型'
     }, {
         xtype: 'combobox',
         name: 'pr_statuscode',
         queryMode: 'local',
         displayField: 'pr_status',
         valueField: 'pr_statuscode',
-        emptyText :'状态',
-        width:110,
+        fieldLabel : '状态',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['pr_statuscode', 'pr_status'],

+ 2 - 1
frontend/saas-web/app/view/document/product/FormController.js

@@ -163,7 +163,8 @@ Ext.define('saas.view.document.product.FormController', {
         Ext.Array.each(items, function(item, i) {
            var pd_num = item.get('pd_num') || 0 ;
            var pd_price = item.get('pd_price') || 0 ;
-           item.set('pd_amount', pd_num*pd_price);               
+           var m = Ext.util.Format.number(pd_num*pd_price, '0,000.00');
+           item.set('pd_amount', m);               
         });
     }
 });

+ 7 - 11
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -11,19 +11,16 @@ Ext.define('saas.view.document.vendor.BasePanel', {
     {
         xtype : "textfield", 
         name : "ve_code", 
-        width:150, 
-        emptyText:'编号'
-    }, {
-        xtype : "textfield", 
-        name : "ve_name", 
-        width:150, 
-        emptyText:'名称'
+        width:200, 
+        emptyText:'请输入供应商编号或名称',
+        getCondition: function (v) {
+            return "(upper(CONCAT(ve_code,'#',ve_name)) like '%" + v.toUpperCase() + "%' )";
+        }
     },{
         xtype : "remotecombo", 
         storeUrl:'/api/document/vendorkind/getCombo',
         name : "ve_type", 
-        emptyText : "供应商类型", 
-        width:110,
+        fieldLabel : '供应商类型',
         hiddenBtn:true
     },{
         xtype: 'combobox',
@@ -31,8 +28,7 @@ Ext.define('saas.view.document.vendor.BasePanel', {
         queryMode: 'local',
         displayField: 've_status',
         valueField: 've_statuscode',
-        emptyText :'状态',
-        width:110,
+        fieldLabel : '状态',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['ve_statuscode', 've_status'],

+ 1 - 1
frontend/saas-web/app/view/home/infoCardList/PurchaseIn.js

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.PurchaseIn', {
     codeField: 'pu_code',
     detailTitle: '采购订单',
     detailXType: 'purchase-purchase-formpanel',
-    condition: 'purchase.companyId=#{companyId} and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) <= 7)',
+    condition: 'purchase.companyId=#{companyId} and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pu_acceptstatus,\' \') <> \'已入库\')',
     listColumns: [{
         text: 'id',
         dataIndex: 'pu_id',

+ 1 - 1
frontend/saas-web/app/view/home/infoCardList/SaleOut.js

@@ -10,7 +10,7 @@ Ext.define('saas.view.home.infoCardList.SaleOut', {
     codeField: 'sa_code',
     detailTitle: '销售订单',
     detailXType: 'sale-sale-formpanel',
-    condition: 'sale.companyid=#{companyId} and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now())<= 7)',
+    condition: 'sale.companyid=#{companyId} and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sa_sendstatus,\' \') <> \'已出库\' ',
     listColumns: [{
         text: 'id',
         dataIndex: 'sa_id',

+ 5 - 1
frontend/saas-web/app/view/money/verification/QueryPanelModel.js

@@ -1,5 +1,9 @@
 Ext.define('saas.view.money.verification.QueryPanelModel', {
     extend: 'saas.view.core.query.QueryPanelModel',
-    alias: 'viewmodel.money-verification-querypanel'
+    alias: 'viewmodel.money-verification-querypanel',
+
+    data: {
+        closeEnable: false
+    }
 
 });

+ 3 - 1
frontend/saas-web/app/view/sale/saleIn/FormPanel.js

@@ -250,13 +250,15 @@ Ext.define('saas.view.sale.saleIn.FormPanel', {
             {
                 text : "销售单号", 
                 dataIndex : "pd_ordercode", 
-                width : 150.0
+                width : 150.0,
+                ignore:true
             },{
                 text : "销售序号", 
                 dataIndex : "pd_orderdetno", 
                 xtype : "numbercolumn",
                 width: 110.0,
                 format: '0',
+                ignore:true,
                 renderer: function(v) {
                     return v ? v : null;
                 }

+ 11 - 11
frontend/saas-web/resources/json/navigation.json

@@ -161,6 +161,14 @@
     }, {
         "text": "报表",
         "items": [{
+            "text": "应收总账",
+            "id": "monry-report-totalrecdetail",
+            "viewType":"monry-report-totalrecdetail"
+        }, {
+            "text": "应付总账",
+            "id": "monry-report-totalpaydetail",
+            "viewType":"monry-report-totalpaydetail"
+        },{
             "text": "应收账款明细表",
             "id": "monry-report-recdetail",
             "viewType":"monry-report-recdetail"
@@ -168,22 +176,14 @@
             "text": "应付账款明细表",
             "id": "monry-report-paydetail",
             "viewType":"monry-report-paydetail"
-        }, {
-            "text": "账户收支明细表",
-            "id": "monry-report-accountbalance",
-            "viewType":"monry-report-accountbalance"
         }, {
             "text": "核销明细表",
             "id": "monry-report-accountdetails",
             "viewType":"monry-report-accountdetails"
         }, {
-            "text": "应收总账明细表",
-            "id": "monry-report-totalrecdetail",
-            "viewType":"monry-report-totalrecdetail"
-        }, {
-            "text": "应付总账明细表",
-            "id": "monry-report-totalpaydetail",
-            "viewType":"monry-report-totalpaydetail"
+            "text": "账户收支明细表",
+            "id": "monry-report-accountbalance",
+            "viewType":"monry-report-accountbalance"
         }]
     }]
 }, {