Browse Source

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

zhuth 7 years ago
parent
commit
5c5ed5fd5d
20 changed files with 958 additions and 29 deletions
  1. 1 1
      README.md
  2. 8 4
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  3. 8 4
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  4. 7 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  5. 8 4
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  6. 8 4
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  7. 0 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  8. 37 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/StockTakingDTO.java
  9. 34 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/StockTaking.java
  10. 49 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/StocktakingController.java
  11. 19 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/StockTakingMapper.java
  12. 20 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/StocktakingService.java
  13. 57 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/StocktakingServiceImpl.java
  14. 248 0
      applications/storage/storage-server/src/main/resources/mapper/StockTakingMapper.xml
  15. 3 1
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  16. 1 0
      frontend/saas-web/app/view/document/customer/BasePanel.js
  17. 4 2
      frontend/saas-web/app/view/document/kind/ChildForm.js
  18. 0 1
      frontend/saas-web/app/view/home/charts/SaleTrend.js
  19. 444 0
      frontend/saas-web/app/view/stock/inventory/EditDataList.js
  20. 2 3
      frontend/saas-web/resources/json/navigation.json

+ 1 - 1
README.md

@@ -107,7 +107,7 @@
 
 > 构建
 
-* [jenkins](http://192.168.0.181:8080/job/saas) **账号** admin **密码** select123***
+* [jenkins](http://192.168.253.3:8080/job/saas) **账号** admin **密码** select123***
 
 > 日志
 

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

@@ -66,8 +66,10 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
         if (id > 0){
             fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
             baseDTO = getBaseDTOById(id);
-            //日志记录
-            messageLogService.update(baseDTO);
+            if (!("AUDITED".equals(fundtransfer.getFt_statuscode()))) {
+                //日志记录
+                messageLogService.update(baseDTO);
+            }
         }else {
             fundtransfer.setCompanyId(BaseContextHolder.getCompanyId());
             fundtransfer.setFt_recorder(BaseContextHolder.getUserName());
@@ -76,8 +78,10 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             id = fundtransfer.getId();
 
             baseDTO = getBaseDTOById(id);
-            //日志记录
-            messageLogService.save(baseDTO);
+            if (!("AUDITED".equals(fundtransfer.getFt_statuscode()))) {
+                //日志记录
+                messageLogService.save(baseDTO);
+            }
         }
 
         Iterator isdet = fundtransferdetails.iterator();

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

@@ -74,8 +74,10 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
         if (othreceipts.getId() > 0){
             othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
             baseDTO = getBaseDTOById(id);
-            //日志记录
-            messageLogService.update(baseDTO);
+            if (!("AUDITED".equals(othreceipts.getOr_statuscode()))) {
+                //日志记录
+                messageLogService.update(baseDTO);
+            }
         }else {
             othreceipts.setCompanyId(BaseContextHolder.getCompanyId());
             othreceipts.setOr_recorder(BaseContextHolder.getUserName());
@@ -84,8 +86,10 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
             othreceiptsMapper.insertSelective(othreceipts);
             id = othreceipts.getId();
             baseDTO = getBaseDTOById(id);
-            //日志记录
-            messageLogService.save(baseDTO);
+            if (!("AUDITED".equals(othreceipts.getOr_statuscode()))) {
+                //日志记录
+                messageLogService.save(baseDTO);
+            }
         }
 
         Iterator isdet = othreceiptsdetail.iterator();

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

@@ -70,7 +70,9 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             othspendingsMapper.updateByPrimaryKeySelective(othspendings);
             baseDTO = getBaseDTOById(id);
             //日志记录
-            messageLogService.update(baseDTO);
+            if (!("AUDITED".equals(othspendings.getOs_statuscode()))) {
+                messageLogService.update(baseDTO);
+            }
         }else {
             othspendings.setCompanyId(BaseContextHolder.getCompanyId());
             othspendings.setOs_recorder(BaseContextHolder.getUserName());
@@ -80,8 +82,10 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             id = othspendings.getId();
 
             baseDTO = getBaseDTOById(id);
-            //日志记录
-            messageLogService.save(baseDTO);
+            if (!("AUDITED".equals(othspendings.getOs_statuscode()))) {
+                //日志记录
+                messageLogService.save(baseDTO);
+            }
         }
 
         Iterator isdet = othspendingsdetails.iterator();

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

@@ -74,8 +74,10 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         if (pbId > 0){
             paybalanceMapper.updateByPrimaryKeySelective(paybalance);
             baseDTO = getBaseDTOById(pbId);
-            //日志记录
-            messageLogService.update(baseDTO);
+            if (!("AUDITED".equals(paybalance.getPb_statuscode()))) {
+                //日志记录
+                messageLogService.update(baseDTO);
+            }
         }else {
             paybalance.setCompanyId(BaseContextHolder.getCompanyId());
             paybalance.setPb_recorder(BaseContextHolder.getUserName());
@@ -84,8 +86,10 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
             paybalanceMapper.insertSelective(paybalance);
             pbId = paybalance.getId();
             baseDTO = getBaseDTOById(pbId);
-            //日志记录
-            messageLogService.save(baseDTO);
+            if (!("AUDITED".equals(paybalance.getPb_statuscode()))) {
+                //日志记录
+                messageLogService.save(baseDTO);
+            }
         }
 
         Iterator isdet = paybalancedet.iterator();

+ 8 - 4
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java

@@ -72,8 +72,10 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         if (rbId > 0){
             recbalanceMapper.updateByPrimaryKeySelective(recbalance);
             baseDTO = getBaseDTOById(rbId);
-            //日志记录
-            messageLogService.update(baseDTO);
+            if (!("AUDITED".equals(recbalance.getRb_statuscode()))) {
+                //日志记录
+                messageLogService.update(baseDTO);
+            }
         }else {
             recbalance.setCompanyId(BaseContextHolder.getCompanyId());
             recbalance.setRb_recorder(BaseContextHolder.getUserName());
@@ -83,8 +85,10 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
             rbId = recbalance.getId();
 
             baseDTO = getBaseDTOById(rbId);
-            //日志记录
-            messageLogService.save(baseDTO);
+            if (!("AUDITED".equals(recbalance.getRb_statuscode()))) {
+                //日志记录
+                messageLogService.save(baseDTO);
+            }
         }
 
         Iterator isdet = recbalancedet.iterator();

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

@@ -161,8 +161,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             //日志记录
             messageLogService.save(baseDTO);
             return baseDTO;
-        }else{
-           // setUpdateInfo(purchase);
         }
         //更新操作
         purchaseMapper.updateByPrimaryKeySelective(purchase);

+ 37 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/StockTakingDTO.java

@@ -0,0 +1,37 @@
+package com.usoftchina.saas.storage.dto;
+
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Created by zdw
+ * 2018-11-20 19:46.
+ */
+@Data
+public class StockTakingDTO extends CommonBaseDTO implements Serializable {
+    private Integer st_prodid;
+
+    private String st_prodcode;
+
+    private String st_proddetail;
+
+    private String st_prodorispeccode;
+
+    private String st_prodkind;
+
+    private String st_produnit;
+
+    private Integer st_whid;
+
+    private String st_whcode;
+
+    private String st_whname;
+
+    private Double st_batchqty;
+
+    private Double st_actqty;
+
+    private Double st_num;
+}

+ 34 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/StockTaking.java

@@ -0,0 +1,34 @@
+package com.usoftchina.saas.storage.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import lombok.Data;
+import java.io.Serializable;
+
+@Data
+public class StockTaking extends CommonBaseEntity implements Serializable {
+
+    private Integer st_prodid;
+
+    private String st_prodcode;
+
+    private String st_proddetail;
+
+    private String st_prodorispeccode;
+
+    private String st_prodkind;
+
+    private String st_produnit;
+
+    private Integer st_whid;
+
+    private String st_whcode;
+
+    private String st_whname;
+
+    private Double st_batchqty;
+
+    private Double st_actqty;
+
+    private Double st_num;
+
+}

+ 49 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/StocktakingController.java

@@ -0,0 +1,49 @@
+package com.usoftchina.saas.storage.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageDefault;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.storage.dto.StockTakingDTO;
+import com.usoftchina.saas.storage.service.MakeService;
+import com.usoftchina.saas.storage.service.StocktakingService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/stocktaking")
+public class StocktakingController {
+
+    @Autowired
+    private MakeService makeService;
+    @Autowired
+    private StocktakingService stocktakingService;
+
+
+
+    /**
+     * 盘点查询
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
+    @GetMapping("/list")
+    public Result getListData(@PageDefault(number = 1, size = 10) PageRequest page, ListReqDTO listReqDTO){
+        return Result.success(stocktakingService.getList(page, listReqDTO));
+    }
+
+
+
+    @PostMapping("/save")
+    public Result save(@RequestBody List<StockTakingDTO> list){
+        DocBaseDTO docBaseDTO = stocktakingService.saveOrUpdate(list);
+        return Result.success(docBaseDTO);
+    }
+
+
+
+
+}

+ 19 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/StockTakingMapper.java

@@ -0,0 +1,19 @@
+package com.usoftchina.saas.storage.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.storage.po.StockTaking;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface StockTakingMapper extends CommonBaseMapper<StockTaking> {
+    int deleteByPrimaryKey(Integer st_id);
+
+    int insertSelective(StockTaking record);
+
+    StockTaking selectByPrimaryKey(Integer st_id);
+
+    int updateByPrimaryKeySelective(StockTaking record);
+
+    List<StockTaking> selectStockTakingBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+}

+ 20 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/StocktakingService.java

@@ -0,0 +1,20 @@
+package com.usoftchina.saas.storage.service;
+
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.storage.dto.StockTakingDTO;
+import com.usoftchina.saas.storage.mapper.StockTakingMapper;
+import com.usoftchina.saas.storage.po.StockTaking;
+
+import java.util.List;
+
+public interface StocktakingService extends CommonBaseService<StockTakingMapper, StockTaking> {
+
+    PageInfo<StockTaking>  getList(PageRequest page, ListReqDTO listReqDTO);
+
+    DocBaseDTO saveOrUpdate(List<StockTakingDTO> list);
+}

+ 57 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/StocktakingServiceImpl.java

@@ -0,0 +1,57 @@
+package com.usoftchina.saas.storage.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.storage.dto.StockTakingDTO;
+import com.usoftchina.saas.storage.mapper.StockTakingMapper;
+import com.usoftchina.saas.storage.po.StockTaking;
+import com.usoftchina.saas.storage.service.StocktakingService;
+import com.usoftchina.saas.utils.BeanMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * Created by zdw
+ * 2018-11-20 14:59.
+ */
+@Service
+public class StocktakingServiceImpl extends CommonBaseServiceImpl<StockTakingMapper, StockTaking> implements StocktakingService {
+
+    @Override
+    public PageInfo<StockTaking> getList(PageRequest page, ListReqDTO listReqDTO) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        List<StockTaking> stockTakingList = getList(listReqDTO);
+        //取分页信息
+        PageInfo<StockTaking> pageInfo = new PageInfo<StockTaking>(stockTakingList);
+        return pageInfo;
+    }
+
+    @Override
+    @Transactional
+    public DocBaseDTO saveOrUpdate(List<StockTakingDTO> items) {
+        for (StockTakingDTO item : items) {
+            StockTaking stockTaking = BeanMapper.map(item,StockTaking.class);
+            getMapper().updateByPrimaryKeySelective(stockTaking);
+        }
+        DocBaseDTO baseDTO = new DocBaseDTO();
+        return baseDTO;
+    }
+
+    private List<StockTaking> getList(ListReqDTO listReqDTO) {
+        List<StockTaking> list = null;
+        Long companyId = BaseContextHolder.getCompanyId();
+        String con = listReqDTO.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        list = getMapper().selectStockTakingBycondition(con,companyId);
+        return list;
+    }
+}

+ 248 - 0
applications/storage/storage-server/src/main/resources/mapper/StockTakingMapper.xml

@@ -0,0 +1,248 @@
+<?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.storage.mapper.StockTakingMapper">
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.po.StockTaking">
+    <id column="st_id" jdbcType="INTEGER" property="id" />
+    <result column="st_prodid" jdbcType="INTEGER" property="st_prodid" />
+    <result column="st_prodcode" jdbcType="VARCHAR" property="st_prodcode" />
+    <result column="st_proddetail" jdbcType="VARCHAR" property="st_proddetail" />
+    <result column="st_prodorispeccode" jdbcType="VARCHAR" property="st_prodorispeccode" />
+    <result column="st_prodkind" jdbcType="VARCHAR" property="st_prodkind" />
+    <result column="st_produnit" jdbcType="VARCHAR" property="st_produnit" />
+    <result column="st_whid" jdbcType="INTEGER" property="st_whid" />
+    <result column="st_whcode" jdbcType="VARCHAR" property="st_whcode" />
+    <result column="st_whname" jdbcType="VARCHAR" property="st_whname" />
+    <result column="st_batchqty" jdbcType="DOUBLE" property="st_batchqty" />
+    <result column="st_actqty" jdbcType="DOUBLE" property="st_actqty" />
+    <result column="st_num" jdbcType="DOUBLE" property="st_num" />
+    <result column="companyId" jdbcType="INTEGER" property="companyId" />
+    <result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
+    <result column="creatorId" jdbcType="INTEGER" property="creatorId" />
+    <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="updaterName" jdbcType="TIMESTAMP" property="updaterName" />
+    <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    st_id, st_prodid, st_prodcode, st_proddetail, st_prodorispeccode, st_prodkind, st_produnit, 
+    st_whid, st_whcode, st_whname, st_batchqty, st_actqty, st_num, companyId, createTime, 
+    creatorName, creatorId, updateTime, updaterName, updaterId
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from stocktaking
+    where st_id = #{st_id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from stocktaking
+    where st_id = #{st_id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.StockTaking">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into stocktaking
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+
+      <if test="st_prodid != null">
+        st_prodid,
+      </if>
+      <if test="st_prodcode != null">
+        st_prodcode,
+      </if>
+      <if test="st_proddetail != null">
+        st_proddetail,
+      </if>
+      <if test="st_prodorispeccode != null">
+        st_prodorispeccode,
+      </if>
+      <if test="st_prodkind != null">
+        st_prodkind,
+      </if>
+      <if test="st_produnit != null">
+        st_produnit,
+      </if>
+      <if test="st_whid != null">
+        st_whid,
+      </if>
+      <if test="st_whcode != null">
+        st_whcode,
+      </if>
+      <if test="st_whname != null">
+        st_whname,
+      </if>
+      <if test="st_batchqty != null">
+        st_batchqty,
+      </if>
+      <if test="st_actqty != null">
+        st_actqty,
+      </if>
+      <if test="st_num != null">
+        st_num,
+      </if>
+      <if test="companyId != null">
+        companyId,
+      </if>
+      <if test="createTime != null">
+        createTime,
+      </if>
+      <if test="creatorName != null">
+        creatorName,
+      </if>
+      <if test="creatorId != null">
+        creatorId,
+      </if>
+      <if test="updateTime != null">
+        updateTime,
+      </if>
+      <if test="updaterName != null">
+        updaterName,
+      </if>
+      <if test="updaterId != null">
+        updaterId,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+
+      <if test="st_prodid != null">
+        #{st_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="st_prodcode != null">
+        #{st_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="st_proddetail != null">
+        #{st_proddetail,jdbcType=VARCHAR},
+      </if>
+      <if test="st_prodorispeccode != null">
+        #{st_prodorispeccode,jdbcType=VARCHAR},
+      </if>
+      <if test="st_prodkind != null">
+        #{st_prodkind,jdbcType=VARCHAR},
+      </if>
+      <if test="st_produnit != null">
+        #{st_produnit,jdbcType=VARCHAR},
+      </if>
+      <if test="st_whid != null">
+        #{st_whid,jdbcType=INTEGER},
+      </if>
+      <if test="st_whcode != null">
+        #{st_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="st_whname != null">
+        #{st_whname,jdbcType=VARCHAR},
+      </if>
+      <if test="st_batchqty != null">
+        #{st_batchqty,jdbcType=DOUBLE},
+      </if>
+      <if test="st_actqty != null">
+        #{st_actqty,jdbcType=DOUBLE},
+      </if>
+      <if test="st_num != null">
+        #{st_num,jdbcType=DOUBLE},
+      </if>
+      <if test="companyId != null">
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null">
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="creatorId != null">
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterName != null">
+        #{updaterName,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null">
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.StockTaking">
+    update stocktaking
+    <set>
+      <if test="st_prodid != null">
+        st_prodid = #{st_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="st_prodcode != null">
+        st_prodcode = #{st_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="st_proddetail != null">
+        st_proddetail = #{st_proddetail,jdbcType=VARCHAR},
+      </if>
+      <if test="st_prodorispeccode != null">
+        st_prodorispeccode = #{st_prodorispeccode,jdbcType=VARCHAR},
+      </if>
+      <if test="st_prodkind != null">
+        st_prodkind = #{st_prodkind,jdbcType=VARCHAR},
+      </if>
+      <if test="st_produnit != null">
+        st_produnit = #{st_produnit,jdbcType=VARCHAR},
+      </if>
+      <if test="st_whid != null">
+        st_whid = #{st_whid,jdbcType=INTEGER},
+      </if>
+      <if test="st_whcode != null">
+        st_whcode = #{st_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="st_whname != null">
+        st_whname = #{st_whname,jdbcType=VARCHAR},
+      </if>
+      <if test="st_batchqty != null">
+        st_batchqty = #{st_batchqty,jdbcType=DOUBLE},
+      </if>
+      <if test="st_actqty != null">
+        st_actqty = #{st_actqty,jdbcType=DOUBLE},
+      </if>
+      <if test="st_num != null">
+        st_num = #{st_num,jdbcType=DOUBLE},
+      </if>
+      <if test="companyId != null">
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        createTime = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorName != null">
+        creatorName = #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="creatorId != null">
+        creatorId = #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null">
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterName != null">
+        updaterName = #{updaterName,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null">
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+    </set>
+    where st_id = #{id,jdbcType=INTEGER}
+  </update>
+
+
+  <select id="selectStockTakingBycondition" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select
+    <include refid="Base_Column_List" />
+    from stocktaking
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by st_id desc
+  </select>
+
+
+</mapper>

+ 3 - 1
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -170,7 +170,9 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     },
 
     judge:function(f){
-        if(f.ownerCt.xtype.trim().toUpperCase().indexOf('QUERYFORMPANEL')>-1||(f.ownerCt.ownerCt&&f.ownerCt.ownerCt.xtype.trim().toUpperCase().indexOf('BASEPANEL')>-1)){
+        if(f.ownerCt.xtype.trim().toUpperCase().indexOf('QUERYFORMPANEL')>-1
+           ||(f.ownerCt.ownerCt&&(f.ownerCt.ownerCt.xtype.trim().toUpperCase().indexOf('BASEPANEL')>-1
+           ||f.ownerCt.ownerCt.xtype.trim().toUpperCase().indexOf('EDITDATALIST')>-1))){
             f.belong = 'form';
             return f.ownerCt.ownerCt
         }else if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORM')>-1){

+ 1 - 0
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -56,6 +56,7 @@ Ext.define('saas.view.document.customer.BasePanel', {
     }],
 
     //字段属性
+    caller:'Customer',
     _formXtype:'document-customer-formpanel',
     _title:'客户资料',
     _deleteUrl:'/api/document/customer/delete/',

+ 4 - 2
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -335,13 +335,15 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 xtype:'textfield',
                 fieldLabel: '联系电话',
                 name: 'em_mobile',
-                allowBlank:false,
+                allowBlank:true,
+                beforeLabelTextTpl: '',
                 maxLength: 20
             },{
                 xtype:'textfield',
                 fieldLabel: '邮箱',
                 name: 'em_email', 
-                allowBlank:false,  
+                allowBlank:true,  
+                beforeLabelTextTpl: '',
                 maxLength: 20
             },{
                 value:'正式',

+ 0 - 1
frontend/saas-web/app/view/home/charts/SaleTrend.js

@@ -178,7 +178,6 @@ Ext.define('saas.view.home.charts.SaleTrend', {
     },
 
     itemhighlightchange: function(chart, newHighlightItem, oldHighlightItem) {
-        debugger;
         this.setSeriesLineWidth(newHighlightItem, 4);
         this.setSeriesLineWidth(oldHighlightItem, 2);
     },

+ 444 - 0
frontend/saas-web/app/view/stock/inventory/EditDataList.js

@@ -0,0 +1,444 @@
+Ext.define('saas.view.stock.inventory.EditDataList', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'stock-inventory-editdatalist',
+
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    dataUrl:'/api/storage/stocktaking/list',
+    saveUrl:'/api/storage/stocktaking/save',
+    requires: [
+        'Ext.Action',
+        'Ext.grid.plugin.CellEditing',
+        'Ext.selection.CellModel'
+    ],
+    plugins: {
+        cellediting: {
+            clicksToEdit: 1,
+            listeners: {
+                // edit: function(editor, context, eOpts) {
+                //     context.column.fireEvent('edit', context.value);
+                // }
+            }
+        }
+    },
+    tbar: [{		
+        xtype: 'warehouseDbfindTrigger',
+        name: 'wh_description',
+        emptyText: '仓库',
+        dbfinds:[{
+            from:'id',to:'id',ignore:true 
+        }, { 
+            from:'wh_code',to:'wh_code'
+        }, {
+            from:'wh_description',to:'wh_description'
+        }],
+        width:150,
+    },{
+        editable:false,
+        xtype : "remotecombo", 
+        storeUrl:'/api/document/producttype/getCombo',
+        name : "pr_kind", 
+        emptyText : "类型", 
+        allowBlank : false, 
+        addHandler:function(b){
+            var document = Ext.create('saas.view.document.kind.Kind',{});
+            var form = this.ownerCmp.ownerCt;
+            this.dialog = form.getController().getView().add({
+                xtype: 'document-kind-childwin',
+                bind: {
+                    title: '新增物料类型'
+                },
+                dataKind:'productkind',
+                belong:document.etc['productkind'],
+                _parent:form,
+                _combo:this.ownerCmp,
+                record:null,
+                session: true
+            });
+            this.dialog.show();
+        },
+        width:150
+    }, {
+        xtype: 'productDbfindTrigger',
+        name: 'pr_detail',
+        emptyText:'输入物料编号或名称',
+        width:150,
+        dbfinds:[{
+            from:'pr_detail',to:'pr_detail',
+        },{
+            from:'pr_code',to:'pd_prodcode',
+        }, {
+            from:'pr_detail',to:'pr_detail'
+        }]
+    },{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                var tbar = b.ownerCt;
+                grid.condition = '';
+                var items = [];
+                var fields = tbar.items.items.map(f => f.name);
+                Ext.each(fields, function(f, index){
+                    var field = tbar.down('[name='+f+']');
+                    if(field){
+                        items.push(field);
+                    }
+                });
+                grid.condition = grid.getCondition(items);
+                grid.store.loadPage(1);
+            }
+        }
+    },'->',{
+        xtype:'button',
+        text:'保存',
+        listeners: {
+            click:function(b){
+                var me = this.ownerCt.ownerCt;
+                me.onSave();
+            }
+        }
+    },{
+        xtype:'button',
+        text:'导出',
+        listeners: {
+            click:function(b){
+             
+            }
+        }
+    },{
+        xtype:'button',
+        text:'生成盘点单据',
+        listeners: {
+            click:function(b){
+             
+            }
+        }
+    }],
+
+    //字段属性
+    columns : [{
+        text : "盘点id", 
+        width : 0, 
+        dataIndex : "id", 
+        xtype : "numbercolumn", 
+    },{
+        text : "物料id", 
+        width : 0, 
+        dataIndex : "st_prodid", 
+        xtype : "numbercolumn", 
+    }, 
+    {
+        text : "物料编号", 
+        dataIndex : "st_prodcode", 
+        width : 120.0, 
+        xtype : "", 
+    }, 
+    {
+        text : "物料名称", 
+        dataIndex : "st_proddetail", 
+        width : 120.0, 
+        xtype : "", 
+    },
+    {
+        text : "规格型号", 
+        dataIndex : "st_prodorispeccode", 
+        width : 120.0, 
+        xtype : "", 
+    },
+    {
+        text : "物料类别", 
+        dataIndex : "st_prodkind", 
+        width : 120.0, 
+        xtype : "", 
+    },
+    {
+        text : "单位", 
+        dataIndex : "st_produnit", 
+        width : 120.0, 
+        xtype : "", 
+    },
+    {
+        text : "仓库id", 
+        dataIndex : "st_whid", 
+        width : 0, 
+        xtype : "numbercolumn", 
+    },
+    {
+        text : "仓库编号", 
+        dataIndex : "st_whcode", 
+        width : 120.0, 
+        xtype : "", 
+    },
+    {
+        text : "仓库", 
+        dataIndex : "st_whname", 
+        width : 120.0, 
+        xtype : "", 
+    },
+    {
+        text : "系统库存", 
+        dataIndex : "st_batchqty", 
+        width : 120.0, 
+        xtype : "numbercolumn",
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        } 
+    },
+    {
+        text : "盘点库存", 
+        dataIndex : "st_actqty", 
+        width : 120.0, 
+        xtype : "numbercolumn",
+        editor : {
+            xtype : "numberfield",
+            decimalPrecision: 3,
+            minValue:0,
+            listeners:{
+                change:function( f, newValue, oldValue, eOpts ){
+                    var s= f.ownerCt.ownerCmp.getSelectionModel(),
+                    id =  s.lastSelected.id,
+                    record = s.store.getById(id),
+                    batchqty = record.get("st_batchqty");       
+                    record.set("st_num",newValue-batchqty);
+
+                }
+            }    
+        },
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }            
+    },
+    {
+        text : "盘盈盘亏", 
+        dataIndex : "st_num", 
+        width : 120.0, 
+        xtype : "numbercolumn", 
+    }],
+
+    condition:'',
+
+    listeners:{
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;
+
+            var pageSize = Math.floor(gridBodyBoxHeight / 33);
+
+            store.setPageSize(pageSize);
+        }
+    },
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    store: me.store
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+     /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+        conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(xtype),
+                operation = item.operation || me.getDefaultFieldOperation(xtype),
+                conditionValue = me.getConditionValue(xtype, value);
+    
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+            to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+        var me = this,
+        store = me.getStore();
+        store.load();
+    },
+    onSave:function(){
+        var me = this,
+        gridData = me.getDirtyData();
+        if(gridData==null){
+            saas.util.BaseUtil.showToast('未修改数据');
+        }
+
+        saas.util.BaseUtil.request({
+            url: me.saveUrl,
+            params: JSON.stringify(gridData),
+            method: 'POST',
+        })
+        .then(function(localJson) {
+            if(localJson.success){
+                me.refresh();
+            }
+        })
+        .catch(function(res) {
+            console.error(res);
+            saas.util.BaseUtil.showToast('保存失败: ' + res.message);
+        });        
+    },
+    getDirtyData: function() {
+        var me = this,
+        store = me.getStore(),
+        allData = store.getData().items,
+        dirtyData = [];
+
+        Ext.Array.each(allData, function(item){
+            var d = Object.assign({}, item.data),
+            dirty = item.dirty;
+
+            if(dirty){
+                if((typeof d.id) != "number" && d.id.indexOf('-')>-1){
+                    d.id = 0;
+                }
+                for(k in d) {
+                    if(Ext.isDate(d[k])) {
+                        d[k] = Ext.Date.format(d[k], 'Y-m-d H:i:s');
+                    }
+                }
+                dirtyData.push(d);
+            }
+        });
+        return dirtyData;
+    },
+
+
+});

+ 2 - 3
frontend/saas-web/resources/json/navigation.json

@@ -104,10 +104,9 @@
             "addType": "stock-otherout-formpanel",
             "viewType": "stock-otherout-querypanel"
         }, {
-            "id": "inventory",
+            "id": "stock-inventory-editdatalist",
             "text": "盘点单",
-            "addType": "stock-inventory-formpanel",
-            "viewType": "stock-inventory-querypanel"
+            "viewType": "stock-inventory-editdatalist"
         }]
     }, {
         "text": "报表",