zhuth 7 years ago
parent
commit
31991e62e0
23 changed files with 815 additions and 115 deletions
  1. 27 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/SubledgerController.java
  2. 1 1
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/BanksubledgerMapper.java
  3. 28 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/SubledgerMapper.java
  4. 30 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Banksubledger.java
  5. 141 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Subledger.java
  6. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/BanksubledgerService.java
  7. 14 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/SubledgerService.java
  8. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/BanksubledgerServiceImpl.java
  9. 90 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  10. 55 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/SubledgerServiceImpl.java
  11. 41 26
      applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml
  12. 244 0
      applications/money/money-server/src/main/resources/mapper/SubledgerMapper.xml
  13. 1 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  14. 16 5
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/MakeMaterial.java
  15. 7 3
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java
  16. 1 1
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java
  17. 6 6
      applications/storage/storage-server/src/main/resources/mapper/MakematerialMapper.xml
  18. 49 34
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  19. 49 34
      frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js
  20. 1 0
      frontend/saas-web/app/view/document/kind/ChildForm.js
  21. 1 1
      frontend/saas-web/app/view/document/product/FormController.js
  22. 8 0
      frontend/saas-web/app/view/purchase/purchase/FormPanel.js
  23. 1 1
      frontend/saas-web/app/view/sys/messagelog/DataList.js

+ 27 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/SubledgerController.java

@@ -0,0 +1,27 @@
+package com.usoftchina.saas.money.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.money.mapper.SubledgerMapper;
+import com.usoftchina.saas.money.service.SubledgerService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 11:05
+ **/
+@RestController
+@RequestMapping("/subledger")
+public class SubledgerController {
+    @Autowired
+    private SubledgerService subledgerService;
+
+    @GetMapping("/list")
+    public Result getListData(PageRequest page, ListReqDTO condition){
+        return Result.success(subledgerService.seleteList(page, condition));
+    }
+}

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

@@ -17,7 +17,7 @@ public interface BanksubledgerMapper extends CommonBaseMapper<Banksubledger> {
 
 
     int deleteByExample(BanksubledgerExample example);
     int deleteByExample(BanksubledgerExample example);
 
 
-    int deleteByPrimaryKey(Integer bl_id);
+    int deleteByPrimaryKey(@Param("code") String code, @Param("kind") String kind);
 
 
 //    Long insert(Banksubledger record);
 //    Long insert(Banksubledger record);
 
 

+ 28 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/SubledgerMapper.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Recbalance;
+import com.usoftchina.saas.money.po.Subledger;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.List;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 10:33
+ **/
+public interface SubledgerMapper {
+    int deleteByPrimaryKey(@Param("code") String code, @Param("kind") String kind);
+
+    int insert(Subledger record);
+
+    int insertSelective(Subledger record);
+
+    Subledger selectByPrimaryKey(Integer sl_id);
+
+    int updateByPrimaryKeySelective(Subledger record);
+
+    int updateByPrimaryKey(Subledger record);
+
+    List<Subledger> selectSubledgerBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+}

+ 30 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Banksubledger.java

@@ -42,6 +42,36 @@ public class Banksubledger extends CommonBaseEntity implements Serializable {
  
  
     private String bl_remark;    //备注
     private String bl_remark;    //备注
 
 
+    private Double bl_orderamount;
+
+    private Integer bl_assid;
+
+    private String bl_item;
+
+    public Double getBl_orderamount() {
+        return bl_orderamount;
+    }
+
+    public void setBl_orderamount(Double bl_orderamount) {
+        this.bl_orderamount = bl_orderamount;
+    }
+
+    public Integer getBl_assid() {
+        return bl_assid;
+    }
+
+    public void setBl_assid(Integer bl_assid) {
+        this.bl_assid = bl_assid;
+    }
+
+    public String getBl_item() {
+        return bl_item;
+    }
+
+    public void setBl_item(String bl_item) {
+        this.bl_item = bl_item;
+    }
+
     public Integer getBl_id() {
     public Integer getBl_id() {
         return bl_id;
         return bl_id;
     }
     }

+ 141 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Subledger.java

@@ -0,0 +1,141 @@
+package com.usoftchina.saas.money.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+//中间表
+public class Subledger extends CommonBaseEntity implements Serializable {
+
+    private String sl_code;
+
+    private String sl_kind;
+
+    private Integer sl_custid;
+
+    private Integer sl_vendid;
+
+    private Date sl_date;
+
+    private Double sl_amount;
+
+    private Double sl_preamount;
+
+    private Double sl_yamount;
+
+    private Double sl_namount;
+
+    private String sl_remark;
+
+    private Double sl_orderamount;
+
+    private Double sl_discount;
+
+    private Integer sl_ym;
+
+    public String getSl_code() {
+        return sl_code;
+    }
+
+    public void setSl_code(String sl_code) {
+        this.sl_code = sl_code;
+    }
+
+    public String getSl_kind() {
+        return sl_kind;
+    }
+
+    public void setSl_kind(String sl_kind) {
+        this.sl_kind = sl_kind;
+    }
+
+    public Integer getSl_custid() {
+        return sl_custid;
+    }
+
+    public void setSl_custid(Integer sl_custid) {
+        this.sl_custid = sl_custid;
+    }
+
+    public Integer getSl_vendid() {
+        return sl_vendid;
+    }
+
+    public void setSl_vendid(Integer sl_vendid) {
+        this.sl_vendid = sl_vendid;
+    }
+
+    public Date getSl_date() {
+        return sl_date;
+    }
+
+    public void setSl_date(Date sl_date) {
+        this.sl_date = sl_date;
+    }
+
+    public Double getSl_amount() {
+        return sl_amount;
+    }
+
+    public void setSl_amount(Double sl_amount) {
+        this.sl_amount = sl_amount;
+    }
+
+    public Double getSl_preamount() {
+        return sl_preamount;
+    }
+
+    public void setSl_preamount(Double sl_preamount) {
+        this.sl_preamount = sl_preamount;
+    }
+
+    public Double getSl_yamount() {
+        return sl_yamount;
+    }
+
+    public void setSl_yamount(Double sl_yamount) {
+        this.sl_yamount = sl_yamount;
+    }
+
+    public Double getSl_namount() {
+        return sl_namount;
+    }
+
+    public void setSl_namount(Double sl_namount) {
+        this.sl_namount = sl_namount;
+    }
+
+    public String getSl_remark() {
+        return sl_remark;
+    }
+
+    public void setSl_remark(String sl_remark) {
+        this.sl_remark = sl_remark;
+    }
+
+
+    public Double getSl_orderamount() {
+        return sl_orderamount;
+    }
+
+    public void setSl_orderamount(Double sl_orderamount) {
+        this.sl_orderamount = sl_orderamount;
+    }
+
+    public Double getSl_discount() {
+        return sl_discount;
+    }
+
+    public void setSl_discount(Double sl_discount) {
+        this.sl_discount = sl_discount;
+    }
+
+    public Integer getSl_ym() {
+        return sl_ym;
+    }
+
+    public void setSl_ym(Integer sl_ym) {
+        this.sl_ym = sl_ym;
+    }
+}

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/BanksubledgerService.java

@@ -1,5 +1,7 @@
 package com.usoftchina.saas.money.service;
 package com.usoftchina.saas.money.service;
 
 
+import com.usoftchina.saas.money.po.Banksubledger;
+
 /**
 /**
  * @author hx
  * @author hx
  * @createtime 2018-10-19 15:59
  * @createtime 2018-10-19 15:59

+ 14 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/SubledgerService.java

@@ -0,0 +1,14 @@
+package com.usoftchina.saas.money.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.money.po.Subledger;
+import com.usoftchina.saas.page.PageRequest;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 11:07
+ **/
+public interface SubledgerService {
+    PageInfo<Subledger> seleteList(PageRequest page, ListReqDTO reqDTO);
+}

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/BanksubledgerServiceImpl.java

@@ -1,10 +1,12 @@
 package com.usoftchina.saas.money.service.impl;
 package com.usoftchina.saas.money.service.impl;
 
 
 import com.usoftchina.saas.money.service.BanksubledgerService;
 import com.usoftchina.saas.money.service.BanksubledgerService;
+import org.springframework.stereotype.Service;
 
 
 /**
 /**
  * @author hx
  * @author hx
  * @createtime 2018-10-19 16:00
  * @createtime 2018-10-19 16:00
  */
  */
+@Service
 public class BanksubledgerServiceImpl implements BanksubledgerService {
 public class BanksubledgerServiceImpl implements BanksubledgerService {
 }
 }

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

@@ -11,12 +11,11 @@ import com.usoftchina.saas.commons.po.BillCodeSeq;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.BizException;
-import com.usoftchina.saas.money.mapper.PaybalanceMapper;
-import com.usoftchina.saas.money.mapper.PaybalancedetMapper;
-import com.usoftchina.saas.money.mapper.PaybalancedetailMapper;
+import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.PaybalanceService;
 import com.usoftchina.saas.money.service.PaybalanceService;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
@@ -38,6 +37,10 @@ public class PaybalanceServiceImpl implements PaybalanceService {
     private PaybalancedetailMapper paybalancedetailMapper;
     private PaybalancedetailMapper paybalancedetailMapper;
     @Autowired
     @Autowired
     private MaxnumberService maxnumberService;
     private MaxnumberService maxnumberService;
+    @Autowired
+    private SubledgerMapper subledgerMapper;
+    @Autowired
+    private BanksubledgerMapper banksubledgerMapper;
 
 
     public DocBaseDTO insert(Pay pay) {
     public DocBaseDTO insert(Pay pay) {
         Paybalance paybalance = pay.getMain();
         Paybalance paybalance = pay.getMain();
@@ -99,6 +102,11 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         paybalance.setPb_status(Status.AUDITED.getDisplay());
         paybalance.setPb_status(Status.AUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.AUDITED.name());
         paybalance.setPb_statuscode(Status.AUDITED.name());
         paybalance.setCompanyId(companyId);
         paybalance.setCompanyId(companyId);
+        Subledger subledger = this.changSubledgerUntil(paybalance);
+        subledgerMapper.insertSelective(subledger);
+        this.changBankUntil(pay);
+        System.out.println("新增");
+        this.changBankUntil(pay);
         if ( paybalance == null || "".equals(paybalance)){
         if ( paybalance == null || "".equals(paybalance)){
             this.insert(pay);
             this.insert(pay);
         }else {
         }else {
@@ -113,6 +121,11 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
         paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.UNAUDITED.name());
         paybalance.setPb_statuscode(Status.UNAUDITED.name());
         paybalanceMapper.updateByPrimaryKeySelective(paybalance);
         paybalanceMapper.updateByPrimaryKeySelective(paybalance);
+
+        //删除中间表
+        paybalance = paybalanceMapper.selectByPrimaryKey(id);
+        subledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
+        banksubledgerMapper.deleteByPrimaryKey(paybalance.getPb_code(), paybalance.getPb_kind());
     }
     }
 
 
 
 
@@ -219,4 +232,78 @@ public class PaybalanceServiceImpl implements PaybalanceService {
         }
         }
         return paybalanceList;
         return paybalanceList;
     }
     }
+
+
+    //插入中间表
+    public Subledger changSubledgerUntil(Paybalance paybalance){
+        Subledger subledger = new Subledger();
+//        BeanUtils.copyProperties(subledger, paybalance);
+        subledger.setCompanyId(BaseContextHolder.getCompanyId());
+        subledger.setSl_code(paybalance.getPb_code());
+        subledger.setSl_kind(paybalance.getPb_kind());
+        subledger.setSl_custid(0);
+//        subledger.setSl_vendid(paybalance.getPb_vendid());
+        subledger.setSl_vendid(1);
+        subledger.setSl_date(paybalance.getPb_date());
+        if (paybalance.getPb_pdamount() == null){
+            subledger.setSl_amount((double) 0);
+        }else {
+            subledger.setSl_amount(paybalance.getPb_pdamount() * -1);
+        }
+        subledger.setSl_orderamount(paybalance.getPb_pdamount());
+
+        Double yamount = paybalance.getPb_preamount();
+        if (yamount == null){
+            yamount = Double.valueOf(0);
+        }
+        if (yamount > 0 || yamount < 0){
+            subledger.setSl_yamount(yamount);
+        }else {
+            subledger.setSl_yamount((double) 0);
+        }
+        if (subledger.getSl_orderamount() == null){
+            subledger.setSl_orderamount((double) 0);
+        }
+
+        if (subledger.getSl_discount() == null){
+            subledger.setSl_discount((double) 0);
+        }
+        subledger.setSl_namount(subledger.getSl_orderamount() + subledger.getSl_discount() - subledger.getSl_yamount());
+        subledger.setSl_remark(subledger.getSl_remark());
+        subledger.setSl_preamount(subledger.getSl_preamount());
+
+        return subledger;
+    }
+
+    //插入bank中间表
+    public void changBankUntil(Pay pay){
+        Banksubledger banksubledger = new Banksubledger();
+        Paybalance paybalance = pay.getMain();
+        List<Paybalancedet> paybalancedetList = pay.getItems1();
+        Iterator isList = paybalancedetList.iterator();
+        while (isList.hasNext()) {
+            Paybalancedet paybalancedet = (Paybalancedet) isList.next();
+            banksubledger.setCompanyId(BaseContextHolder.getCompanyId());
+            banksubledger.setBl_ym(paybalancedet.getPd_ym());
+            banksubledger.setBl_bankid(paybalancedet.getPd_bankid());
+            banksubledger.setBl_bankcode(paybalancedet.getPd_bankcode());
+            banksubledger.setBl_bankname(paybalancedet.getPd_bankname());
+            banksubledger.setBl_code(paybalance.getPb_code());
+            banksubledger.setBl_kind(paybalance.getPb_kind());
+            banksubledger.setBl_date(paybalance.getPb_date());
+
+            if (paybalance.getPb_vendid() == null || paybalance.getPb_vendid() != 0){
+                banksubledger.setBl_asscode("供应商往来");
+            }
+            banksubledger.setBl_assid(paybalance.getPb_vendid());
+            banksubledger.setBl_code(paybalance.getPb_code());
+            banksubledger.setBl_assname(paybalance.getPb_vendname());
+            banksubledger.setBl_spending(paybalancedet.getPd_amount());
+            banksubledger.setBl_manname(paybalance.getPb_manname());
+            banksubledger.setBl_remark(paybalancedet.getPd_remark());
+            banksubledger.setBl_orderamount(paybalancedet.getPd_amount() * -1);
+            banksubledgerMapper.insertSelective(banksubledger);
+
+        }
+    }
 }
 }

+ 55 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/SubledgerServiceImpl.java

@@ -0,0 +1,55 @@
+package com.usoftchina.saas.money.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.money.mapper.SubledgerMapper;
+import com.usoftchina.saas.money.po.Recbalance;
+import com.usoftchina.saas.money.po.Subledger;
+import com.usoftchina.saas.money.service.SubledgerService;
+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.List;
+
+/**
+ * @author heqw
+ * @date 2018/11/6 11:09
+ **/
+@Service
+public class SubledgerServiceImpl implements SubledgerService {
+    @Autowired
+    private SubledgerMapper subledgerMapper;
+
+    @Override
+    public PageInfo<Subledger> seleteList(PageRequest page, ListReqDTO reqDTO) {
+        //设置默认分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<Subledger> subledgerList = this.getListByMode(reqDTO);
+        //取分页信息
+        PageInfo<Subledger> pageInfo = new PageInfo<Subledger>(subledgerList);
+        return pageInfo;
+    }
+
+    private List<Subledger> getListByMode(ListReqDTO req) {
+        List<Subledger> subledgerList = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        if (StringUtils.isEmpty(req)) {
+            return  null;
+        }
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        subledgerList = subledgerMapper.selectSubledgerBycondition(con, companyId);
+        return subledgerList;
+    }
+}

+ 41 - 26
applications/money/money-server/src/main/resources/mapper/BanksubledgerMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!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.BanksubledgerMapper">
 <mapper namespace="com.usoftchina.saas.money.mapper.BanksubledgerMapper">
     <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Banksubledger">
     <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Banksubledger">
-        <id column="bl_id" jdbcType="INTEGER" property="bl_id" />
+        <id column="bl_id" jdbcType="INTEGER" property="id" />
         <result column="bl_ym" jdbcType="INTEGER" property="bl_ym" />
         <result column="bl_ym" jdbcType="INTEGER" property="bl_ym" />
         <result column="bl_bankid" jdbcType="INTEGER" property="bl_bankid" />
         <result column="bl_bankid" jdbcType="INTEGER" property="bl_bankid" />
         <result column="bl_bankcode" jdbcType="VARCHAR" property="bl_bankcode" />
         <result column="bl_bankcode" jdbcType="VARCHAR" property="bl_bankcode" />
@@ -17,9 +17,12 @@
         <result column="bl_spending" jdbcType="DOUBLE" property="bl_spending" />
         <result column="bl_spending" jdbcType="DOUBLE" property="bl_spending" />
         <result column="bl_manname" jdbcType="VARCHAR" property="bl_manname" />
         <result column="bl_manname" jdbcType="VARCHAR" property="bl_manname" />
         <result column="bl_remark" jdbcType="VARCHAR" property="bl_remark" />
         <result column="bl_remark" jdbcType="VARCHAR" property="bl_remark" />
-        <result column="companyid" jdbcType="INTEGER" property="companyid" />
+        <result column="companyId" jdbcType="INTEGER" property="companyId" />
         <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
         <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
         <result column="updatedate" jdbcType="TIMESTAMP" property="updatedate" />
         <result column="updatedate" jdbcType="TIMESTAMP" property="updatedate" />
+        <result column="bl_orderamount" property="bl_orderamount" jdbcType="DOUBLE" />
+        <result column="bl_assid" property="bl_assid" jdbcType="INTEGER" />
+        <result column="bl_item" property="bl_item" jdbcType="VARCHAR" />
     </resultMap>
     </resultMap>
     <sql id="Example_Where_Clause">
     <sql id="Example_Where_Clause">
         <where>
         <where>
@@ -81,8 +84,8 @@
     </sql>
     </sql>
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
     bl_id, bl_ym, bl_bankid, bl_bankcode, bl_bankname, bl_code, bl_kind, bl_date, bl_asstype, 
     bl_id, bl_ym, bl_bankid, bl_bankcode, bl_bankname, bl_code, bl_kind, bl_date, bl_asstype, 
-    bl_asscode, bl_assname, bl_income, bl_spending, bl_manname, bl_remark, companyid, 
-    updaterId, updatedate
+    bl_asscode, bl_assname, bl_income, bl_spending, bl_manname, bl_remark, companyId, 
+    updaterId, updatedate, bl_orderamount, bl_assid, bl_item
   </sql>
   </sql>
     <select id="selectByExample" parameterType="com.usoftchina.saas.money.po.BanksubledgerExample" resultMap="BaseResultMap">
     <select id="selectByExample" parameterType="com.usoftchina.saas.money.po.BanksubledgerExample" resultMap="BaseResultMap">
         select
         select
@@ -106,7 +109,7 @@
     </select>
     </select>
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from banksubledger
     delete from banksubledger
-    where bl_id = #{bl_id,jdbcType=INTEGER}
+    where bl_id = #{code,jdbcType=VARCHAR} and bl_kind = #{kind, jdbcType=VARCHAR}
   </delete>
   </delete>
     <delete id="deleteByExample" parameterType="com.usoftchina.saas.money.po.BanksubledgerExample">
     <delete id="deleteByExample" parameterType="com.usoftchina.saas.money.po.BanksubledgerExample">
         delete from banksubledger
         delete from banksubledger
@@ -120,22 +123,19 @@
       bl_kind, bl_date, bl_asstype, 
       bl_kind, bl_date, bl_asstype, 
       bl_asscode, bl_assname, bl_income, 
       bl_asscode, bl_assname, bl_income, 
       bl_spending, bl_manname, bl_remark, 
       bl_spending, bl_manname, bl_remark, 
-      companyid, updaterId, updatedate
+      companyId, updaterId, updatedate
       )
       )
     values (#{bl_id,jdbcType=INTEGER}, #{bl_ym,jdbcType=INTEGER}, #{bl_bankid,jdbcType=INTEGER}, 
     values (#{bl_id,jdbcType=INTEGER}, #{bl_ym,jdbcType=INTEGER}, #{bl_bankid,jdbcType=INTEGER}, 
       #{bl_bankcode,jdbcType=VARCHAR}, #{bl_bankname,jdbcType=VARCHAR}, #{bl_code,jdbcType=VARCHAR}, 
       #{bl_bankcode,jdbcType=VARCHAR}, #{bl_bankname,jdbcType=VARCHAR}, #{bl_code,jdbcType=VARCHAR}, 
       #{bl_kind,jdbcType=VARCHAR}, #{bl_date,jdbcType=TIMESTAMP}, #{bl_asstype,jdbcType=VARCHAR}, 
       #{bl_kind,jdbcType=VARCHAR}, #{bl_date,jdbcType=TIMESTAMP}, #{bl_asstype,jdbcType=VARCHAR}, 
       #{bl_asscode,jdbcType=VARCHAR}, #{bl_assname,jdbcType=VARCHAR}, #{bl_income,jdbcType=DOUBLE}, 
       #{bl_asscode,jdbcType=VARCHAR}, #{bl_assname,jdbcType=VARCHAR}, #{bl_income,jdbcType=DOUBLE}, 
       #{bl_spending,jdbcType=DOUBLE}, #{bl_manname,jdbcType=VARCHAR}, #{bl_remark,jdbcType=VARCHAR}, 
       #{bl_spending,jdbcType=DOUBLE}, #{bl_manname,jdbcType=VARCHAR}, #{bl_remark,jdbcType=VARCHAR}, 
-      #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}
+      #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatedate,jdbcType=TIMESTAMP}
       )
       )
   </insert>
   </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Banksubledger">
     <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Banksubledger">
         insert into banksubledger
         insert into banksubledger
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="bl_id != null">
-                bl_id,
-            </if>
             <if test="bl_ym != null">
             <if test="bl_ym != null">
                 bl_ym,
                 bl_ym,
             </if>
             </if>
@@ -178,20 +178,26 @@
             <if test="bl_remark != null">
             <if test="bl_remark != null">
                 bl_remark,
                 bl_remark,
             </if>
             </if>
-            <if test="companyid != null">
-                companyid,
+            <if test="companyId != null">
+                companyId,
             </if>
             </if>
             <if test="updaterId != null">
             <if test="updaterId != null">
                 updaterId,
                 updaterId,
             </if>
             </if>
-            <if test="updatedate != null">
+            <if test="updateTime != null">
                 updatedate,
                 updatedate,
             </if>
             </if>
+            <if test="bl_orderamount != null" >
+                bl_orderamount,
+            </if>
+            <if test="bl_assid != null" >
+                bl_assid,
+            </if>
+            <if test="bl_item != null" >
+                bl_item,
+            </if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="bl_id != null">
-                #{bl_id,jdbcType=INTEGER},
-            </if>
             <if test="bl_ym != null">
             <if test="bl_ym != null">
                 #{bl_ym,jdbcType=INTEGER},
                 #{bl_ym,jdbcType=INTEGER},
             </if>
             </if>
@@ -234,14 +240,23 @@
             <if test="bl_remark != null">
             <if test="bl_remark != null">
                 #{bl_remark,jdbcType=VARCHAR},
                 #{bl_remark,jdbcType=VARCHAR},
             </if>
             </if>
-            <if test="companyid != null">
-                #{companyid,jdbcType=INTEGER},
+            <if test="companyId != null">
+                #{companyId,jdbcType=INTEGER},
             </if>
             </if>
             <if test="updaterId != null">
             <if test="updaterId != null">
                 #{updaterId,jdbcType=INTEGER},
                 #{updaterId,jdbcType=INTEGER},
             </if>
             </if>
-            <if test="updatedate != null">
-                #{updatedate,jdbcType=TIMESTAMP},
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="bl_orderamount != null" >
+                #{bl_orderamount,jdbcType=DOUBLE},
+            </if>
+            <if test="bl_assid != null" >
+                #{bl_assid,jdbcType=INTEGER},
+            </if>
+            <if test="bl_item != null" >
+                #{bl_item,jdbcType=VARCHAR},
             </if>
             </if>
         </trim>
         </trim>
     </insert>
     </insert>
@@ -299,8 +314,8 @@
             <if test="record.bl_remark != null">
             <if test="record.bl_remark != null">
                 bl_remark = #{record.bl_remark,jdbcType=VARCHAR},
                 bl_remark = #{record.bl_remark,jdbcType=VARCHAR},
             </if>
             </if>
-            <if test="record.companyid != null">
-                companyid = #{record.companyid,jdbcType=INTEGER},
+            <if test="record.companyId != null">
+                companyId = #{record.companyId,jdbcType=INTEGER},
             </if>
             </if>
             <if test="record.updaterId != null">
             <if test="record.updaterId != null">
                 updaterId = #{record.updaterId,jdbcType=INTEGER},
                 updaterId = #{record.updaterId,jdbcType=INTEGER},
@@ -330,7 +345,7 @@
         bl_spending = #{record.bl_spending,jdbcType=DOUBLE},
         bl_spending = #{record.bl_spending,jdbcType=DOUBLE},
         bl_manname = #{record.bl_manname,jdbcType=VARCHAR},
         bl_manname = #{record.bl_manname,jdbcType=VARCHAR},
         bl_remark = #{record.bl_remark,jdbcType=VARCHAR},
         bl_remark = #{record.bl_remark,jdbcType=VARCHAR},
-        companyid = #{record.companyid,jdbcType=INTEGER},
+        companyId = #{record.companyId,jdbcType=INTEGER},
         updaterId = #{record.updaterId,jdbcType=INTEGER},
         updaterId = #{record.updaterId,jdbcType=INTEGER},
         updatedate = #{record.updatedate,jdbcType=TIMESTAMP}
         updatedate = #{record.updatedate,jdbcType=TIMESTAMP}
         <if test="_parameter != null">
         <if test="_parameter != null">
@@ -382,8 +397,8 @@
             <if test="bl_remark != null">
             <if test="bl_remark != null">
                 bl_remark = #{bl_remark,jdbcType=VARCHAR},
                 bl_remark = #{bl_remark,jdbcType=VARCHAR},
             </if>
             </if>
-            <if test="companyid != null">
-                companyid = #{companyid,jdbcType=INTEGER},
+            <if test="companyId != null">
+                companyId = #{companyId,jdbcType=INTEGER},
             </if>
             </if>
             <if test="updaterId != null">
             <if test="updaterId != null">
                 updaterId = #{updaterId,jdbcType=INTEGER},
                 updaterId = #{updaterId,jdbcType=INTEGER},
@@ -410,7 +425,7 @@
       bl_spending = #{bl_spending,jdbcType=DOUBLE},
       bl_spending = #{bl_spending,jdbcType=DOUBLE},
       bl_manname = #{bl_manname,jdbcType=VARCHAR},
       bl_manname = #{bl_manname,jdbcType=VARCHAR},
       bl_remark = #{bl_remark,jdbcType=VARCHAR},
       bl_remark = #{bl_remark,jdbcType=VARCHAR},
-      companyid = #{companyid,jdbcType=INTEGER},
+      companyId = #{companyId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updaterId = #{updaterId,jdbcType=INTEGER},
       updatedate = #{updatedate,jdbcType=TIMESTAMP}
       updatedate = #{updatedate,jdbcType=TIMESTAMP}
     where bl_id = #{bl_id,jdbcType=INTEGER}
     where bl_id = #{bl_id,jdbcType=INTEGER}

+ 244 - 0
applications/money/money-server/src/main/resources/mapper/SubledgerMapper.xml

@@ -0,0 +1,244 @@
+<?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.SubledgerMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Subledger" >
+    <id column="sl_id" property="id" jdbcType="INTEGER" />
+    <result column="sl_code" property="sl_code" jdbcType="VARCHAR" />
+    <result column="sl_kind" property="sl_kind" jdbcType="VARCHAR" />
+    <result column="sl_custid" property="sl_custid" jdbcType="INTEGER" />
+    <result column="sl_vendid" property="sl_vendid" jdbcType="INTEGER" />
+    <result column="sl_date" property="sl_date" jdbcType="TIMESTAMP" />
+    <result column="sl_amount" property="sl_amount" jdbcType="DOUBLE" />
+    <result column="sl_preamount" property="sl_preamount" jdbcType="DOUBLE" />
+    <result column="sl_yamount" property="sl_yamount" jdbcType="DOUBLE" />
+    <result column="sl_namount" property="sl_namount" jdbcType="DOUBLE" />
+    <result column="sl_remark" property="sl_remark" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="sl_orderamount" property="sl_orderamount" jdbcType="DOUBLE" />
+    <result column="sl_discount" property="sl_discount" jdbcType="DOUBLE" />
+    <result column="sl_ym" property="sl_ym" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    sl_id, sl_code, sl_kind, sl_custid, sl_vendid, sl_date, sl_amount, sl_preamount, 
+    sl_yamount, sl_namount, sl_remark, companyId, updaterId, updateTime, sl_orderamount, 
+    sl_discount, sl_ym
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from subledger
+    where sl_id = #{sl_id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from subledger
+    where sl_code = #{code,jdbcType=VARCHAR} and sl_kind = #{kind, jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    insert into subledger (sl_id, sl_code, sl_kind, 
+      sl_custid, sl_vendid, sl_date, 
+      sl_amount, sl_preamount, sl_yamount, 
+      sl_namount, sl_remark, companyId, 
+      updaterId, updateTime, sl_orderamount, 
+      sl_discount, sl_ym)
+    values (#{sl_id,jdbcType=INTEGER}, #{sl_code,jdbcType=VARCHAR}, #{sl_kind,jdbcType=VARCHAR}, 
+      #{sl_custid,jdbcType=INTEGER}, #{sl_vendid,jdbcType=INTEGER}, #{sl_date,jdbcType=TIMESTAMP}, 
+      #{sl_amount,jdbcType=DOUBLE}, #{sl_preamount,jdbcType=DOUBLE}, #{sl_yamount,jdbcType=DOUBLE}, 
+      #{sl_namount,jdbcType=DOUBLE}, #{sl_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, 
+      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{sl_orderamount,jdbcType=DOUBLE}, 
+      #{sl_discount,jdbcType=DOUBLE}, #{sl_ym,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    insert into subledger
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="sl_code != null" >
+        sl_code,
+      </if>
+      <if test="sl_kind != null" >
+        sl_kind,
+      </if>
+      <if test="sl_custid != null" >
+        sl_custid,
+      </if>
+      <if test="sl_vendid != null" >
+        sl_vendid,
+      </if>
+      <if test="sl_date != null" >
+        sl_date,
+      </if>
+      <if test="sl_amount != null" >
+        sl_amount,
+      </if>
+      <if test="sl_preamount != null" >
+        sl_preamount,
+      </if>
+      <if test="sl_yamount != null" >
+        sl_yamount,
+      </if>
+      <if test="sl_namount != null" >
+        sl_namount,
+      </if>
+      <if test="sl_remark != null" >
+        sl_remark,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="sl_orderamount != null" >
+        sl_orderamount,
+      </if>
+      <if test="sl_discount != null" >
+        sl_discount,
+      </if>
+      <if test="sl_ym != null" >
+        sl_ym,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="sl_code != null" >
+        #{sl_code,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_kind != null" >
+        #{sl_kind,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_custid != null" >
+        #{sl_custid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_vendid != null" >
+        #{sl_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_date != null" >
+        #{sl_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_amount != null" >
+        #{sl_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_preamount != null" >
+        #{sl_preamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_yamount != null" >
+        #{sl_yamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_namount != null" >
+        #{sl_namount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_remark != null" >
+        #{sl_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_orderamount != null" >
+        #{sl_orderamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_discount != null" >
+        #{sl_discount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_ym != null" >
+        #{sl_ym,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    update subledger
+    <set >
+      <if test="sl_code != null" >
+        sl_code = #{sl_code,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_kind != null" >
+        sl_kind = #{sl_kind,jdbcType=VARCHAR},
+      </if>
+      <if test="sl_custid != null" >
+        sl_custid = #{sl_custid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_vendid != null" >
+        sl_vendid = #{sl_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="sl_date != null" >
+        sl_date = #{sl_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_amount != null" >
+        sl_amount = #{sl_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_preamount != null" >
+        sl_preamount = #{sl_preamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_yamount != null" >
+        sl_yamount = #{sl_yamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_namount != null" >
+        sl_namount = #{sl_namount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_remark != null" >
+        sl_remark = #{sl_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sl_orderamount != null" >
+        sl_orderamount = #{sl_orderamount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_discount != null" >
+        sl_discount = #{sl_discount,jdbcType=DOUBLE},
+      </if>
+      <if test="sl_ym != null" >
+        sl_ym = #{sl_ym,jdbcType=INTEGER},
+      </if>
+    </set>
+    where sl_id = #{sl_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Subledger" >
+    update subledger
+    set sl_code = #{sl_code,jdbcType=VARCHAR},
+      sl_kind = #{sl_kind,jdbcType=VARCHAR},
+      sl_custid = #{sl_custid,jdbcType=INTEGER},
+      sl_vendid = #{sl_vendid,jdbcType=INTEGER},
+      sl_date = #{sl_date,jdbcType=TIMESTAMP},
+      sl_amount = #{sl_amount,jdbcType=DOUBLE},
+      sl_preamount = #{sl_preamount,jdbcType=DOUBLE},
+      sl_yamount = #{sl_yamount,jdbcType=DOUBLE},
+      sl_namount = #{sl_namount,jdbcType=DOUBLE},
+      sl_remark = #{sl_remark,jdbcType=VARCHAR},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      sl_orderamount = #{sl_orderamount,jdbcType=DOUBLE},
+      sl_discount = #{sl_discount,jdbcType=DOUBLE},
+      sl_ym = #{sl_ym,jdbcType=INTEGER}
+    where sl_id = #{sl_id,jdbcType=INTEGER}
+  </update>
+
+  <select id="selectSubledgerBycondition" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from subledger
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and   subledger.companyId = #{companyId}
+      </if>
+    </where>  order by sl_id
+  </select>
+
+</mapper>

+ 1 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java

@@ -426,6 +426,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         targetPi.setPi_custname(sourcePi.getPi_custname());
         targetPi.setPi_custname(sourcePi.getPi_custname());
         targetPi.setPi_said(sourcePi.getPi_said());
         targetPi.setPi_said(sourcePi.getPi_said());
         targetPi.setPi_sacode(sourcePi.getPi_sacode());
         targetPi.setPi_sacode(sourcePi.getPi_sacode());
+        targetPi.setPi_address(sourcePi.getPi_address());
         //保存数据
         //保存数据
         getMapper().insertSelective(targetPi);
         getMapper().insertSelective(targetPi);
         //插入销售退货单从表
         //插入销售退货单从表

+ 16 - 5
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/MakeMaterial.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.storage.po;
 package com.usoftchina.saas.storage.po;
 
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.dto.ProductDTO;
 import com.usoftchina.saas.document.entities.Product;
 import com.usoftchina.saas.document.entities.Product;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
@@ -24,6 +25,8 @@ public class MakeMaterial extends CommonBaseEntity implements Serializable {
 
 
     private String mm_whcode;
     private String mm_whcode;
 
 
+    private String mm_whname;
+
     private Double mm_price;
     private Double mm_price;
 
 
     private Double mm_oneuseqty;
     private Double mm_oneuseqty;
@@ -36,14 +39,22 @@ public class MakeMaterial extends CommonBaseEntity implements Serializable {
 
 
     private String mm_remark;
     private String mm_remark;
 
 
-    private Product product;
+    private ProductDTO productDTO;
+
+    public String getMm_whname() {
+        return mm_whname;
+    }
+
+    public void setMm_whname(String mm_whname) {
+        this.mm_whname = mm_whname;
+    }
 
 
-    public Product getProduct() {
-        return product;
+    public ProductDTO getProductDTO() {
+        return productDTO;
     }
     }
 
 
-    public void setProduct(Product product) {
-        this.product = product;
+    public void setProductDTO(ProductDTO productDTO) {
+        this.productDTO = productDTO;
     }
     }
 
 
     public Long getMm_maid() {
     public Long getMm_maid() {

+ 7 - 3
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -89,7 +89,6 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
                     makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
                     makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
                     makeMaterial.setCreatorId(BaseContextHolder.getUserId());
                     makeMaterial.setCreatorId(BaseContextHolder.getUserId());
                     makeMaterial.setCreateTime(new Date());
                     makeMaterial.setCreateTime(new Date());
-
                 }
                 }
                 makeMaterialMapper.batchInsert(makeMaterialList);
                 makeMaterialMapper.batchInsert(makeMaterialList);
             }
             }
@@ -109,6 +108,7 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
                 //更新从表
                 //更新从表
                 for (MakeMaterial makeMaterial : makeMaterialList) {
                 for (MakeMaterial makeMaterial : makeMaterialList) {
                     if (makeMaterial.getId() == 0) {
                     if (makeMaterial.getId() == 0) {
+                        makeMaterial.setMm_maid(make.getId());
                         makeMaterial.setCreatorId(BaseContextHolder.getUserId());
                         makeMaterial.setCreatorId(BaseContextHolder.getUserId());
                         makeMaterial.setCreateTime(new Date());
                         makeMaterial.setCreateTime(new Date());
                         makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
                         makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
@@ -121,8 +121,12 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
                     }
                     }
                 }
                 }
                 //执行插入、更新
                 //执行插入、更新
-                makeMaterialMapper.batchInsert(insertItems);
-                makeMaterialMapper.batchUpdate(updateItems);
+                if (insertItems.size() > 0) {
+                    makeMaterialMapper.batchInsert(insertItems);
+                }
+                if (updateItems.size() > 0) {
+                    makeMaterialMapper.batchUpdate(updateItems);
+                }
             }
             }
             //记录LOG
             //记录LOG
             docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
             docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());

+ 1 - 1
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java

@@ -228,8 +228,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
                 id = baseDTO.getId();
                 id = baseDTO.getId();
             }
             }
             singleAudit(formData.getMain());
             singleAudit(formData.getMain());
+            baseDTO = getBaseDTOById(id,formData.getMain().getPi_class(),formData.getMain().getPi_inoutno());
         }
         }
-        baseDTO.setId(id);
         return baseDTO;
         return baseDTO;
     }
     }
 
 

+ 6 - 6
applications/storage/storage-server/src/main/resources/mapper/MakematerialMapper.xml

@@ -18,7 +18,7 @@
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
-    <association property="product" javaType="com.usoftchina.saas.document.dto.ProductDTO">
+    <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
         <id column="pr_id" property="id" jdbcType="INTEGER" />
         <id column="pr_id" property="id" jdbcType="INTEGER" />
         <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
         <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
         <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
         <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
@@ -246,18 +246,18 @@
     where mm_id = #{id}
     where mm_id = #{id}
   </update>
   </update>
   <select id="selectByFK" resultMap="BaseResultMap">
   <select id="selectByFK" resultMap="BaseResultMap">
-    SELECT * FROM MAKEMATERIAL LEFT JOIN PRODUCT ON PR_ID=MA_PRODID AND MAKEMATERIAL.COMPANYID=PRODUCT.COMPANYID WHERE MM_MAID=#{id} AND MAKEMATERIAL.COMPANYID={companyId}
+    SELECT * FROM MAKEMATERIAL LEFT JOIN PRODUCT ON PR_ID=MM_PRODID AND MAKEMATERIAL.COMPANYID=PRODUCT.COMPANYID WHERE MM_MAID=#{id} AND MAKEMATERIAL.COMPANYID=#{companyId}
   </select>
   </select>
   <delete id="deleteByFK">
   <delete id="deleteByFK">
-    DELETE FROM MAKEMATERIAL WHERE MM_MAID=#{id} AND COMPANYID={companyId}
+    DELETE FROM MAKEMATERIAL WHERE MM_MAID=#{id} AND COMPANYID=#{companyId}
   </delete>
   </delete>
   <insert id="batchInsert" parameterType="java.util.List">
   <insert id="batchInsert" parameterType="java.util.List">
       INSERT INTO MAKEMATERIAL (mm_maid, mm_detno,
       INSERT INTO MAKEMATERIAL (mm_maid, mm_detno,
       mm_prodid, mm_prodcode, mm_whid,
       mm_prodid, mm_prodcode, mm_whid,
-      mm_whcode, mm_price, mm_oneuseqty,
+      mm_whcode, mm_price, mm_oneuseqty
       mm_qty, mm_amount, mm_repprodcode,
       mm_qty, mm_amount, mm_repprodcode,
       mm_remark, companyId, updaterId,
       mm_remark, companyId, updaterId,
-      updateTime)
+      updateTime,mm_whname)
       VALUES
       VALUES
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
       (
@@ -266,7 +266,7 @@
       #{item.mm_whcode,jdbcType=VARCHAR}, #{item.mm_price,jdbcType=DOUBLE}, #{item.mm_oneuseqty,jdbcType=DOUBLE},
       #{item.mm_whcode,jdbcType=VARCHAR}, #{item.mm_price,jdbcType=DOUBLE}, #{item.mm_oneuseqty,jdbcType=DOUBLE},
       #{item.mm_qty,jdbcType=DOUBLE}, #{item.mm_amount,jdbcType=DOUBLE}, #{item.mm_repprodcode,jdbcType=VARCHAR},
       #{item.mm_qty,jdbcType=DOUBLE}, #{item.mm_amount,jdbcType=DOUBLE}, #{item.mm_repprodcode,jdbcType=VARCHAR},
       #{item.mm_remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER},
       #{item.mm_remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}, #{item.updaterId,jdbcType=INTEGER},
-      #{item.updateTime,jdbcType=TIMESTAMP}
+      #{item.updateTime,jdbcType=TIMESTAMP},#{item.mm_whname,jdbcType=VARCHAR}
       )
       )
     </foreach>
     </foreach>
   </insert>
   </insert>

+ 49 - 34
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -104,7 +104,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                     method: 'GET',
                     method: 'GET',
                     success: function(response, opts) {
                     success: function(response, opts) {
                         data = Ext.decode(response.responseText);
                         data = Ext.decode(response.responseText);
-                        data = data.data.list;
+                        data = data.data?data.data.list:[];
                         if(data!=null && data.length>0 && me.store && field.length>0){
                         if(data!=null && data.length>0 && me.store && field.length>0){
                             me.store.loadData(data,false);
                             me.store.loadData(data,false);
                             me.expand();
                             me.expand();
@@ -122,6 +122,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     	}
     	}
     },
     },
     onTriggerClick:function(f){
     onTriggerClick:function(f){
+        f.blur(f);
         //判断dbfindtrigger归属
         //判断dbfindtrigger归属
         f.judge(f);//form
         f.judge(f);//form
         var panel = f.up('core-tab-panel'),panelEl;
         var panel = f.up('core-tab-panel'),panelEl;
@@ -176,46 +177,60 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
         blur:function(f,e){
         blur:function(f,e){
             var me = f;
             var me = f;
             var count = f.store.getCount();
             var count = f.store.getCount();
+            var searchCount = false;//校验数据库是否有该字段
             var dbfinds = me.dbfinds;
             var dbfinds = me.dbfinds;
-            // if(count==1){
-            //     record = f.store.data.items[0];
-            //     if(dbfinds&&dbfinds.length>0){
-            //         if(me.belong=='grid'){
-            //             for (let index = 0; index < dbfinds.length; index++) {
-            //                 var item = dbfinds[index];
-            //                 var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
-            //                 var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-            //                 nowRec.set(item.to,record.get(item.from));
-            //                 if(me.name==item.to){
-            //                     me.column.getEditor().setValue(record.get(item.from));
-            //                 }
-            //             }
-            //         }else if(me.belong=='form'){
-            //             for (let index = 0; index < dbfinds.length; index++) {
-            //                 var item = dbfinds[index];
-            //                 var field = me.ownerCt.down('[name='+item.to+']');
-            //                 if(field){
-            //                     var val = record.get(item.from);
-            //                     if(field.xtype=='dbfindtrigger'){
-            //                         field.setRawValue(val);
-            //                         field.value = val;
-            //                         field.lastTriggerValue=val;
-            //                     }else{
-            //                         field.setValue(val);
-            //                     }    
-            //                 }
-            //             }
-            //         }
-            //     }
-            // }else 
-            if(!f.value||f.value==''){
+            if(count>0){
+                //添加默认条件
+                var searchField = null;
+                var dbCondition = [];
+                if(me.defaultCondition) {
+                    dbCondition.push({
+                        type: 'condition',
+                        value: me.defaultCondition
+                    });
+                }
+                for (let index = 0; index < dbfinds.length; index++) {
+                    var item = dbfinds[index].to;
+                    if(item==me.name){
+                        searchField = dbfinds[index].from;
+                    }
+                }
+                dbCondition.push({
+                    type: 'condition',
+                    value: searchField + "='"+me.value+"'"
+                });
+                Ext.Ajax.request({
+                    url: me.dataUrl,
+                    async:false,
+                    params: {
+                        number: 1,
+                        size: 1,
+                        condition:JSON.stringify(dbCondition),
+                        page: 1,
+                        start: 0,
+                        limit: 10
+                    },
+                    method: 'GET',
+                    success: function(response, opts) {
+                        data = Ext.decode(response.responseText);
+                        data = data.data?data.data.list:[];
+                        if(data.length>0){
+                            searchCount = true
+                        }
+                    },
+                    failure: function(response, opts) {}
+                }); 
+            }
+            if(!f.value||f.value==''||count==0||!searchCount){
                 if(dbfinds&&dbfinds.length>0){
                 if(dbfinds&&dbfinds.length>0){
                     if(me.belong=='grid'){
                     if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {
                         for (let index = 0; index < dbfinds.length; index++) {
                             var item = dbfinds[index];
                             var item = dbfinds[index];
                             var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
                             var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
                             var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
                             var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-                            nowRec.set(item.to,'');
+                            if(nowRec.get(item.to)&&nowRec.get(item.to)!=""){
+                                nowRec.set(item.to,'');
+                            }
                             if(me.name==item.to){
                             if(me.name==item.to){
                                 me.column.getEditor().setValue('');
                                 me.column.getEditor().setValue('');
                             }
                             }

+ 49 - 34
frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js

@@ -111,7 +111,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
                     method: 'GET',
                     method: 'GET',
                     success: function(response, opts) {
                     success: function(response, opts) {
                         data = Ext.decode(response.responseText);
                         data = Ext.decode(response.responseText);
-                        data = data.data.list;
+                        data = data.data?data.data.list:[];
                         if(data!=null && data.length>0 && me.store && field.length>0){
                         if(data!=null && data.length>0 && me.store && field.length>0){
                             me.store.loadData(data,false);
                             me.store.loadData(data,false);
                             me.expand();
                             me.expand();
@@ -129,6 +129,7 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
     	}
     	}
     },
     },
     onTriggerClick:function(f){
     onTriggerClick:function(f){
+        f.blur(f);
         //判断dbfindtrigger归属
         //判断dbfindtrigger归属
         f.judge(f);
         f.judge(f);
         var panel = f.up('core-tab-panel'),panelEl;
         var panel = f.up('core-tab-panel'),panelEl;
@@ -170,46 +171,60 @@ Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
         blur:function(f,e){
         blur:function(f,e){
             var me = f;
             var me = f;
             var count = f.store.getCount();
             var count = f.store.getCount();
+            var searchCount = false;//校验数据库是否有该字段
             var dbfinds = me.dbfinds;
             var dbfinds = me.dbfinds;
-            // if(count==1){
-            //     record = f.store.data.items[0];
-            //     if(dbfinds&&dbfinds.length>0){
-            //         if(me.belong=='grid'){
-            //             for (let index = 0; index < dbfinds.length; index++) {
-            //                 var item = dbfinds[index];
-            //                 var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
-            //                 var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-            //                 nowRec.set(item.to,record.get(item.from));
-            //                 if(me.name==item.to){
-            //                     me.column.getEditor().setValue(record.get(item.from));
-            //                 }
-            //             }
-            //         }else if(me.belong=='form'){
-            //             for (let index = 0; index < dbfinds.length; index++) {
-            //                 var item = dbfinds[index];
-            //                 var field = me.ownerCt.down('[name='+item.to+']');
-            //                 if(field){
-            //                     var val = record.get(item.from);
-            //                     if(field.xtype=='dbfindtrigger'){
-            //                         field.setRawValue(val);
-            //                         field.value = val;
-            //                         field.lastTriggerValue=val;
-            //                     }else{
-            //                         field.setValue(val);
-            //                     }    
-            //                 }
-            //             }
-            //         }
-            //     }
-            // }else 
-            if(!f.value||f.value==''){
+            if(count>0){
+                //添加默认条件
+                var searchField = null;
+                var dbCondition = [];
+                if(me.defaultCondition) {
+                    dbCondition.push({
+                        type: 'condition',
+                        value: me.defaultCondition
+                    });
+                }
+                for (let index = 0; index < dbfinds.length; index++) {
+                    var item = dbfinds[index].to;
+                    if(item==me.name){
+                        searchField = dbfinds[index].from;
+                    }
+                }
+                dbCondition.push({
+                    type: 'condition',
+                    value: searchField + "='"+me.value+"'"
+                });
+                Ext.Ajax.request({
+                    url: me.dataUrl,
+                    async:false,
+                    params: {
+                        number: 1,
+                        size: 1,
+                        condition:JSON.stringify(dbCondition),
+                        page: 1,
+                        start: 0,
+                        limit: 10
+                    },
+                    method: 'GET',
+                    success: function(response, opts) {
+                        data = Ext.decode(response.responseText);
+                        data = data.data?data.data.list:[];
+                        if(data.length>0){
+                            searchCount = true
+                        }
+                    },
+                    failure: function(response, opts) {}
+                }); 
+            }
+            if(!f.value||f.value==''||count==0||!searchCount){
                 if(dbfinds&&dbfinds.length>0){
                 if(dbfinds&&dbfinds.length>0){
                     if(me.belong=='grid'){
                     if(me.belong=='grid'){
                         for (let index = 0; index < dbfinds.length; index++) {
                         for (let index = 0; index < dbfinds.length; index++) {
                             var item = dbfinds[index];
                             var item = dbfinds[index];
                             var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
                             var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
                             var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
                             var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
-                            nowRec.set(item.to,'');
+                            if(nowRec.get(item.to)&&nowRec.get(item.to)!=""){
+                                nowRec.set(item.to,'');
+                            }
                             if(me.name==item.to){
                             if(me.name==item.to){
                                 me.column.getEditor().setValue('');
                                 me.column.getEditor().setValue('');
                             }
                             }

+ 1 - 0
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -255,6 +255,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 hideTrigger : true, 
                 hideTrigger : true, 
                 fieldLabel: '流水长度',
                 fieldLabel: '流水长度',
                 name: 'mn_number',
                 name: 'mn_number',
+                minValue : 0, 
                 allowBlank:false
                 allowBlank:false
             }]
             }]
         }
         }

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

@@ -12,7 +12,7 @@ Ext.define('saas.view.document.product.FormController', {
                         dataUrl:'/api/document/vendor/getVendorsByCondition',
                         dataUrl:'/api/document/vendor/getVendorsByCondition',
                         //赋值 
                         //赋值 
                         dbfinds:[{
                         dbfinds:[{
-                            from:'id',to:'pr_vendid'
+                            from:'id',to:'pr_vendid',ignore:true
                         },{
                         },{
                             from:'ve_code',to:'pr_vendcode'
                             from:'ve_code',to:'pr_vendcode'
                         },{
                         },{

+ 8 - 0
frontend/saas-web/app/view/purchase/purchase/FormPanel.js

@@ -128,6 +128,14 @@ Ext.define('saas.view.purchase.purchase.FormPanel', {
                     return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
                     return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
                 }
                 }
             },
             },
+            {
+                text : "最小包装数", 
+                dataIndex : "pr_zxbzs",
+                ignore:true,
+                renderer: function (v, m, r) {
+                    return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v;
+                }
+            },            
             {
             {
                 text : "数量", 
                 text : "数量", 
                 dataIndex : "pd_qty", 
                 dataIndex : "pd_qty", 

+ 1 - 1
frontend/saas-web/app/view/sys/messagelog/DataList.js

@@ -78,7 +78,7 @@ Ext.define('saas.view.sys.messagelog.DataList', {
         width : 120.0, 
         width : 120.0, 
     }, 
     }, 
     {
     {
-        text : "处理人", 
+        text : "操作人员", 
         dataIndex : "ml_man", 
         dataIndex : "ml_man", 
         width : 200, 
         width : 200, 
     }],
     }],