Browse Source

Merge remote-tracking branch 'origin/dev' into dev

heqinwei 7 years ago
parent
commit
d8f76a48c9
63 changed files with 1809 additions and 175 deletions
  1. 1 1
      applications/commons/commons-server/src/main/resources/application.yml
  2. 2 2
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomerDTO.java
  3. 2 2
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomeraddressDTO.java
  4. 2 2
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomercontactDTO.java
  5. 2 2
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java
  6. 5 5
      applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Warehouse.java
  7. 1 11
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  8. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BomController.java
  9. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java
  10. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java
  11. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductbrandController.java
  12. 0 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java
  13. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java
  14. 6 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java
  15. 5 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductbrandService.java
  16. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java
  17. 7 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductbrandServiceImpl.java
  18. 3 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  19. 1 1
      applications/document/document-server/src/main/resources/application.yml
  20. 4 0
      applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml
  21. 6 0
      applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml
  22. 36 36
      applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml
  23. 0 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  24. 2 6
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  25. 7 1
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  26. 1 1
      applications/purchase/purchase-server/src/main/resources/application.yml
  27. 35 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/MakeListDTO.java
  28. 238 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/Make.java
  29. 141 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/MakeMaterial.java
  30. 59 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/MakeController.java
  31. 0 1
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java
  32. 28 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMapper.java
  33. 28 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMaterialMapper.java
  34. 67 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/MakeService.java
  35. 228 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java
  36. 1 1
      applications/storage/storage-server/src/main/resources/application.yml
  37. 370 0
      applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml
  38. 374 0
      applications/storage/storage-server/src/main/resources/mapper/MakematerialMapper.xml
  39. 2 1
      frontend/saas-web/app.json
  40. 29 3
      frontend/saas-web/app/view/core/form/FormPanel.js
  41. 1 1
      frontend/saas-web/app/view/core/form/FormPanelController.js
  42. 2 0
      frontend/saas-web/app/view/core/form/FormPanelModel.js
  43. 1 1
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  44. 7 0
      frontend/saas-web/app/view/core/query/QueryPanel.js
  45. 10 1
      frontend/saas-web/app/view/core/tab/Controller.js
  46. 5 1
      frontend/saas-web/app/view/core/tab/Panel.js
  47. 7 7
      frontend/saas-web/app/view/document/customer/BasePanel.js
  48. 12 1
      frontend/saas-web/app/view/document/customer/FormModel.js
  49. 10 10
      frontend/saas-web/app/view/document/customer/FormPanel.js
  50. 0 1
      frontend/saas-web/app/view/document/kind/Kind.js
  51. 1 1
      frontend/saas-web/app/view/document/kind/KindModel.js
  52. 12 1
      frontend/saas-web/app/view/document/product/FormModel.js
  53. 6 6
      frontend/saas-web/app/view/document/product/FormPanel.js
  54. 8 8
      frontend/saas-web/app/view/document/vendor/BasePanel.js
  55. 12 1
      frontend/saas-web/app/view/document/vendor/FormModel.js
  56. 9 9
      frontend/saas-web/app/view/document/vendor/FormPanel.js
  57. 3 3
      frontend/saas-web/app/view/money/othreceipts/FormPanel.js
  58. 3 3
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  59. 0 7
      frontend/saas-web/app/view/purchase/purchaseIn/FormPanel.js
  60. 0 7
      frontend/saas-web/app/view/purchase/purchaseOut/FormPanel.js
  61. 0 7
      frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js
  62. 0 7
      frontend/saas-web/app/view/stock/otherIn/FormPanel.js
  63. 0 7
      frontend/saas-web/app/view/stock/otherOut/FormPanel.js

+ 1 - 1
applications/commons/commons-server/src/main/resources/application.yml

@@ -45,7 +45,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
 server:
   port: 8920
   tomcat:

+ 2 - 2
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomerDTO.java

@@ -1,6 +1,6 @@
 package com.usoftchina.saas.document.dto;
 
-import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -11,7 +11,7 @@ import java.util.Date;
  * 2018-10-23 17:21.
  */
 @Data
-public class CustomerDTO extends CommonBaseEntity implements Serializable {
+public class CustomerDTO extends CommonBaseDTO implements Serializable {
     private String cu_code;
 
     private String cu_name;

+ 2 - 2
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomeraddressDTO.java

@@ -1,12 +1,12 @@
 package com.usoftchina.saas.document.dto;
 
-import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import lombok.Data;
 
 import java.io.Serializable;
 
 @Data
-public class CustomeraddressDTO extends CommonBaseEntity implements Serializable {
+public class CustomeraddressDTO extends CommonBaseDTO implements Serializable {
 
     private Long ca_cuid;
 

+ 2 - 2
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/CustomercontactDTO.java

@@ -1,12 +1,12 @@
 package com.usoftchina.saas.document.dto;
 
-import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import lombok.Data;
 
 import java.io.Serializable;
 
 @Data
-public class CustomercontactDTO extends CommonBaseEntity implements Serializable {
+public class CustomercontactDTO extends CommonBaseDTO implements Serializable {
 
     private Long cc_cuid;
 

+ 2 - 2
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductDTO.java

@@ -1,12 +1,12 @@
 package com.usoftchina.saas.document.dto;
 
-import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
 import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
 @Data
-public class ProductDTO extends CommonBaseEntity implements Serializable {
+public class ProductDTO extends CommonBaseDTO implements Serializable {
 
     private String pr_code;
     private String pr_detail;

+ 5 - 5
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Warehouse.java

@@ -17,7 +17,7 @@ public class Warehouse extends CommonBaseEntity implements Serializable {
     private String wh_description;
     private String wh_statuscode;
     private String wh_status;
-    private long wh_recordid;
+    private long wh_recorderid;
     private String wh_recorder;
     /**
      * 录入日期
@@ -69,12 +69,12 @@ public class Warehouse extends CommonBaseEntity implements Serializable {
         this.wh_status = wh_status;
     }
 
-    public long getWh_recordid() {
-        return wh_recordid;
+    public long getWh_recorderid() {
+        return wh_recorderid;
     }
 
-    public void setWh_recordid(long wh_recordid) {
-        this.wh_recordid = wh_recordid;
+    public void setWh_recorderid(long wh_recorderid) {
+        this.wh_recorderid = wh_recorderid;
     }
 
     public String getWh_recorder() {

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

@@ -6,8 +6,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
 @SpringBootApplication
 @EnableEurekaClient
@@ -15,18 +13,10 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 @EnableTransactionManagement
 @EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.document.mapper")
-public class DocumentApplication extends WebMvcConfigurerAdapter {
+public class DocumentApplication  {
     public static void main(String[] args) {
         SpringApplication.run(DocumentApplication.class, args);
     }
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
 
-        registry.addMapping("/**")
-                .allowCredentials(true)
-                .allowedHeaders("*")
-                .allowedOrigins("*")
-                .allowedMethods("*");
-    }
 
 }

+ 0 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BomController.java

@@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.print.Doc;
 
-@CrossOrigin
 @RestController
 @RequestMapping("/bom")
 public class BomController {

+ 0 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java

@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
  * Created by zdw
  * 2018-10-23 11:39.
  */
-@CrossOrigin
 @RestController
 @RequestMapping("/customer")
 public class CustomerController {

+ 0 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/ProductController.java

@@ -20,7 +20,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-@CrossOrigin
 @RestController
 @RequestMapping("/product")
 public class ProductController {

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

@@ -46,4 +46,9 @@ public class ProductbrandController {
         List<Productbrand> productbrandList = productbrandService.findAll();
         return Result.success(productbrandList);
     }
+
+    @GetMapping("/getCombo")
+    public Result getCombo(){
+        return Result.success(productbrandService.getCombo());
+    }
 }

+ 0 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java

@@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.Map;
 
-@CrossOrigin
 @RestController
 @RequestMapping("/warehouse")
 public class WarehouseController {

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

@@ -6,7 +6,7 @@ import com.usoftchina.saas.document.entities.Bankinformation;
 public interface BankinformationMapper extends CommonBaseMapper<Bankinformation> {
     int deleteByPrimaryKey(Integer bkId);
 
-    Long insert(Bankinformation record);
+    int insert(Bankinformation record);
 
     int insertSelective(Bankinformation record);
 

+ 6 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/ProductbrandMapper.java

@@ -1,7 +1,11 @@
 package com.usoftchina.saas.document.mapper;
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Productbrand;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ProductbrandMapper extends CommonBaseMapper<Productbrand> {
 
@@ -16,4 +20,6 @@ public interface ProductbrandMapper extends CommonBaseMapper<Productbrand> {
     int updateByPrimaryKeySelective(Productbrand record);
 
     int updateByPrimaryKey(Productbrand record);
+
+    List<ComboDTO> getCombo(@Param("companyId") Long companyId);
 }

+ 5 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/ProductbrandService.java

@@ -1,9 +1,14 @@
 package com.usoftchina.saas.document.service;
 
 import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Productbrand;
 import com.usoftchina.saas.document.mapper.ProductbrandMapper;
 
+import java.util.List;
+
 public interface ProductbrandService extends CommonBaseService<ProductbrandMapper, Productbrand> {
 
+    List<ComboDTO> getCombo();
+
 }

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

@@ -213,6 +213,6 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
         Long companyId = BaseContextHolder.getCompanyId();
         Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
                 getMapper().validateCodeWhenUpdate(code, id, companyId);
-        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.VENDOR.getCaller()).getData();
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.PRODUCT.getCaller()).getData();
     }
 }

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.document.service.impl;
 
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.entities.Productbrand;
@@ -10,6 +11,8 @@ import com.usoftchina.saas.document.service.ProductbrandService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandMapper, Productbrand> implements ProductbrandService {
 
@@ -46,4 +49,8 @@ public class ProductbrandServiceImpl extends CommonBaseServiceImpl<ProductbrandM
         return true;
     }
 
+    @Override
+    public List<ComboDTO> getCombo() {
+        return getMapper().getCombo(BaseContextHolder.getCompanyId());
+    }
 }

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

@@ -103,10 +103,11 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         DocBaseDTO docBaseDTO = null;
         if(record.getId() == 0){
             String code = pushMaxnubmer(record.getWh_code(), record.getId());
-            count = getMapper().insertSelective(record);
             record.setCompanyId(BaseContextHolder.getCompanyId());
             record.setCreatorId(BaseContextHolder.getUserId());
             record.setCreateTime(new Date());
+
+            count = getMapper().insertSelective(record);
             //记录LOG
             docBaseDTO = generateMsgObj(record.getId(), code);
             messageLogService.save(docBaseDTO);
@@ -218,6 +219,6 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         Long companyId = BaseContextHolder.getCompanyId();
         Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
                 getMapper().validateCodeWhenUpdate(code, id, companyId);
-        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.VENDOR.getCaller()).getData();
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.WAREHOUSE.getCaller()).getData();
     }
 }

+ 1 - 1
applications/document/document-server/src/main/resources/application.yml

@@ -47,7 +47,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
 server:
   port: 9480
   tomcat:

+ 4 - 0
applications/document/document-server/src/main/resources/mapper/ProductbrandMapper.xml

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

+ 6 - 0
applications/document/document-server/src/main/resources/mapper/VendorkindMapper.xml

@@ -25,6 +25,9 @@
     where vk_id = #{id}
   </delete>
   <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Vendorkind">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into vendorkind (vk_name, vk_recordid,
     vk_recorder, vk_date, companyId,
     updaterId, updateTime)
@@ -33,6 +36,9 @@
     #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Vendorkind">
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
     insert into vendorkind
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="vk_name != null">

+ 36 - 36
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -11,7 +11,7 @@
         <result column="wh_recordid" property="wh_recordid" jdbcType="INTEGER" />
         <result column="wh_recorder" property="wh_recorder" jdbcType="INTEGER" />
         <result column="wh_date" property="wh_date" jdbcType="INTEGER" />
-        <result column="companyid" property="companyId" jdbcType="INTEGER" />
+        <result column="companyId" property="companyId" jdbcType="INTEGER" />
         <result column="updatemanid" property="updaterId" jdbcType="INTEGER" />
         <result column="updatedate" property="updateTime" jdbcType="TIMESTAMP" />
         <result column="wh_text1" property="wh_text1" jdbcType="VARCHAR" />
@@ -30,11 +30,11 @@
         <parameter property="inoutNo" jdbcType="VARCHAR" mode="IN" />
         <parameter property="class" jdbcType="VARCHAR" mode="IN" />
         <parameter property="commitid" jdbcType="INTEGER" mode="IN" />
-        <parameter property="companyid" jdbcType="INTEGER" mode="IN" />
+        <parameter property="companyId" jdbcType="INTEGER" mode="IN" />
         <parameter property="result" jdbcType="VARCHAR" mode="OUT" />
     </parameterMap>
     <select id="validPeriod" parameterType="map" resultType="java.lang.Short">
-        SELECT IFNULL(PD_STATUS,0) PD_STATUS FROM PERIODSDETAIL WHERE COMPANYID=#{companyId} AND PD_DETNO=#{period}
+        SELECT IFNULL(PD_STATUS,0) PD_STATUS FROM PERIODSDETAIL WHERE companyId=#{companyId} AND PD_DETNO=#{period}
     </select>
 
     <sql id="Example_Where_Clause">
@@ -97,40 +97,43 @@
     </sql>
     <sql id="Base_Column_List">
         wh_id, wh_code, wh_type, wh_description, wh_statuscode, wh_status, wh_recorderid,
-        wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
+        wh_recorder, wh_date, companyId, updaterId, updateTime, wh_text1, wh_text2, wh_text3,
         wh_text4, wh_text5
     </sql>
-    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="WarehouseResultMapper">
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="WarehouseResultMapper">
         select
         <include refid="Base_Column_List" />
         from warehouse
-        where wh_id = #{wh_id,jdbcType=INTEGER}
+        where wh_id = #{id}
     </select>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from warehouse
-        where wh_id = #{wh_id,jdbcType=INTEGER}
+        where wh_id = #{id}
     </delete>
 
     <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Warehouse">
-        insert into warehouse (wh_id, wh_code, wh_type,
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
+        insert into warehouse (wh_code, wh_type,
         wh_description, wh_statuscode, wh_status,
         wh_recorderid, wh_recorder, wh_date,
-        companyid, updaterId, updatetime,
+        companyId, updaterId, updateTime,
         wh_text1, wh_text2, wh_text3,
         wh_text4, wh_text5)
-        values (#{wh_id,jdbcType=INTEGER}, #{wh_code,jdbcType=VARCHAR}, #{wh_type,jdbcType=VARCHAR},
+        values (#{wh_code,jdbcType=VARCHAR}, #{wh_type,jdbcType=VARCHAR},
         #{wh_description,jdbcType=VARCHAR}, #{wh_statuscode,jdbcType=VARCHAR}, #{wh_status,jdbcType=VARCHAR},
         #{wh_recorderid,jdbcType=VARCHAR}, #{wh_recorder,jdbcType=VARCHAR}, #{wh_date,jdbcType=TIMESTAMP},
-        #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP},
+        #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
         #{wh_text1,jdbcType=VARCHAR}, #{wh_text2,jdbcType=VARCHAR}, #{wh_text3,jdbcType=VARCHAR},
         #{wh_text4,jdbcType=VARCHAR}, #{wh_text5,jdbcType=VARCHAR})
     </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        <selectKey resultType="java.lang.Long" keyProperty="id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
         insert into warehouse
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="wh_id != null">
-                wh_id,
-            </if>
             <if test="wh_code != null">
                 wh_code,
             </if>
@@ -155,14 +158,14 @@
             <if test="wh_date != null">
                 wh_date,
             </if>
-            <if test="companyid != null">
-                companyid,
+            <if test="companyId != null">
+                companyId,
             </if>
             <if test="updaterId != null">
                 updaterId,
             </if>
-            <if test="updatetime != null">
-                updatetime,
+            <if test="updateTime != null">
+                updateTime,
             </if>
             <if test="wh_text1 != null">
                 wh_text1,
@@ -181,9 +184,6 @@
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="wh_id != null">
-                #{wh_id,jdbcType=INTEGER},
-            </if>
             <if test="wh_code != null">
                 #{wh_code,jdbcType=VARCHAR},
             </if>
@@ -208,14 +208,14 @@
             <if test="wh_date != null">
                 #{wh_date,jdbcType=TIMESTAMP},
             </if>
-            <if test="companyid != null">
-                #{companyid,jdbcType=INTEGER},
+            <if test="companyId != null">
+                #{companyId,jdbcType=INTEGER},
             </if>
             <if test="updaterId != null">
                 #{updaterId,jdbcType=INTEGER},
             </if>
-            <if test="updatetime != null">
-                #{updatetime,jdbcType=TIMESTAMP},
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
             </if>
             <if test="wh_text1 != null">
                 #{wh_text1,jdbcType=VARCHAR},
@@ -261,14 +261,14 @@
             <if test="wh_date != null">
                 wh_date = #{wh_date,jdbcType=TIMESTAMP},
             </if>
-            <if test="companyid != null">
-                companyid = #{companyid,jdbcType=INTEGER},
+            <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 test="updateTime != null">
+                updateTime = #{updateTime,jdbcType=TIMESTAMP},
             </if>
             <if test="wh_text1 != null">
                 wh_text1 = #{wh_text1,jdbcType=VARCHAR},
@@ -286,7 +286,7 @@
                 wh_text5 = #{wh_text5,jdbcType=VARCHAR},
             </if>
         </set>
-        where wh_id = #{wh_id,jdbcType=INTEGER}
+        where wh_id = #{id}
     </update>
     <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Warehouse">
         update warehouse
@@ -298,19 +298,19 @@
         wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
         wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
         wh_date = #{wh_date,jdbcType=TIMESTAMP},
-        companyid = #{companyid,jdbcType=INTEGER},
+        companyId = #{companyId,jdbcType=INTEGER},
         updaterId = #{updaterId,jdbcType=INTEGER},
-        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
         wh_text1 = #{wh_text1,jdbcType=VARCHAR},
         wh_text2 = #{wh_text2,jdbcType=VARCHAR},
         wh_text3 = #{wh_text3,jdbcType=VARCHAR},
         wh_text4 = #{wh_text4,jdbcType=VARCHAR},
         wh_text5 = #{wh_text5,jdbcType=VARCHAR}
-        where wh_id = #{wh_id,jdbcType=INTEGER}
+        where wh_id = #{id}
     </update>
 
-    <select id="selectAll" resultType="com.usoftchina.saas.document.entities.Warehouse">
-        SELECT * FROM WAREHOUSE WHERE COMPANYID = #{companyId}
+    <select id="selectAll" resultMap="WarehouseResultMapper">
+        SELECT * FROM WAREHOUSE WHERE companyId = #{companyId}
     </select>
 
     <select id="validateCodeWhenInsert" resultType="int">

+ 0 - 1
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java

@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
  * Created by zdw
  * 2018-10-17 11:41.
  */
-@CrossOrigin
 @RestController
 @RequestMapping("/prodinout")
 public class ProdInOutController {

+ 2 - 6
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -1,21 +1,17 @@
 package com.usoftchina.saas.purchase.controller;
 
 import com.github.pagehelper.PageInfo;
-import com.netflix.discovery.converters.Auto;
 import com.usoftchina.saas.base.Result;
-
-import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.purchase.dto.*;
+import com.usoftchina.saas.purchase.dto.PurchaseFormDTO;
 import com.usoftchina.saas.purchase.po.PurchaseList;
 import com.usoftchina.saas.purchase.service.PurchaseService;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.async.DeferredResult;
+
 
 
 /**

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

@@ -132,6 +132,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 detail.setPd_puid(pu_id);
                 detail.setPd_code(pu_code);
                 detail.setPd_yqty(new Double(0));
+                detail.setCompanyId(companyId);
+                detail.setCreatorId(userId);
+                detail.setCreateTime(new Date());
                 insertDetails.add(detail);
             }
             //插入从表
@@ -150,6 +153,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             PurchaseDetail detail = BeanMapper.map(item, PurchaseDetail.class);
             detail.setPd_puid(pu_id);
             detail.setPd_code(pu_code);
+            detail.setCompanyId(companyId);
+            detail.setCreatorId(userId);
+            detail.setCreateTime(new Date());
             if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
                 insertDetails.add(detail);
             } else {
@@ -347,7 +353,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //插入验收单主表
         ProdInOut prodInOut = new ProdInOut();
         //生成单号
-        String piInoutno ="YS0001";
+        String piInoutno =maxnumberService.getMaxnumber(BillCodeSeq.PURCHASEIN.getCaller(),true).getData();
 
         prodInOut.setPi_inoutno(piInoutno);
         prodInOut.setPi_class("采购验收单");

+ 1 - 1
applications/purchase/purchase-server/src/main/resources/application.yml

@@ -47,7 +47,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
 server:
   port: 8800
   tomcat:

+ 35 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/dto/MakeListDTO.java

@@ -0,0 +1,35 @@
+package com.usoftchina.saas.storage.dto;
+
+import com.usoftchina.saas.base.dto.CommonBaseDTO;
+import com.usoftchina.saas.storage.po.Make;
+import com.usoftchina.saas.storage.po.MakeMaterial;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 制造单主从表传输对象
+ * @author chenwei
+ * @date 2018/10/29
+ */
+public class MakeListDTO extends CommonBaseDTO implements Serializable {
+
+    private Make main;
+    private List<MakeMaterial> items;
+
+    public Make getMain() {
+        return main;
+    }
+
+    public void setMain(Make main) {
+        this.main = main;
+    }
+
+    public List<MakeMaterial> getItems() {
+        return items;
+    }
+
+    public void setItems(List<MakeMaterial> items) {
+        this.items = items;
+    }
+}

+ 238 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/Make.java

@@ -0,0 +1,238 @@
+package com.usoftchina.saas.storage.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Make extends CommonBaseEntity implements Serializable {
+    private String ma_code;
+
+    private String ma_status;
+
+    private String ma_statuscode;
+
+    private String ma_type;
+
+    private Integer ma_prodid;
+
+    private String ma_prodcode;
+
+    private String ma_proddetail;
+
+    private String ma_prodspec;
+
+    private String ma_version;
+
+    private String ma_produnit;
+
+    private Double ma_qty;
+
+    private Integer ma_whid;
+
+    private String ma_whcode;
+
+    private Date ma_recorddate;
+
+    private Integer ma_recordid;
+
+    private String ma_recorder;
+
+    private Double ma_price;
+
+    private Double ma_total;
+
+    private String ma_text1;
+
+    private String ma_text2;
+
+    private String ma_text3;
+
+    private String ma_text4;
+
+    private String ma_text5;
+
+    public String getMa_code() {
+        return ma_code;
+    }
+
+    public void setMa_code(String ma_code) {
+        this.ma_code = ma_code == null ? null : ma_code.trim();
+    }
+
+    public String getMa_status() {
+        return ma_status;
+    }
+
+    public void setMa_status(String ma_status) {
+        this.ma_status = ma_status == null ? null : ma_status.trim();
+    }
+
+    public String getMa_statuscode() {
+        return ma_statuscode;
+    }
+
+    public void setMa_statuscode(String ma_statuscode) {
+        this.ma_statuscode = ma_statuscode == null ? null : ma_statuscode.trim();
+    }
+
+    public String getMa_type() {
+        return ma_type;
+    }
+
+    public void setMa_type(String ma_type) {
+        this.ma_type = ma_type == null ? null : ma_type.trim();
+    }
+
+    public Integer getMa_prodid() {
+        return ma_prodid;
+    }
+
+    public void setMa_prodid(Integer ma_prodid) {
+        this.ma_prodid = ma_prodid;
+    }
+
+    public String getMa_prodcode() {
+        return ma_prodcode;
+    }
+
+    public void setMa_prodcode(String ma_prodcode) {
+        this.ma_prodcode = ma_prodcode == null ? null : ma_prodcode.trim();
+    }
+
+    public String getMa_proddetail() {
+        return ma_proddetail;
+    }
+
+    public void setMa_proddetail(String ma_proddetail) {
+        this.ma_proddetail = ma_proddetail == null ? null : ma_proddetail.trim();
+    }
+
+    public String getMa_prodspec() {
+        return ma_prodspec;
+    }
+
+    public void setMa_prodspec(String ma_prodspec) {
+        this.ma_prodspec = ma_prodspec == null ? null : ma_prodspec.trim();
+    }
+
+    public String getMa_version() {
+        return ma_version;
+    }
+
+    public void setMa_version(String ma_version) {
+        this.ma_version = ma_version == null ? null : ma_version.trim();
+    }
+
+    public String getMa_produnit() {
+        return ma_produnit;
+    }
+
+    public void setMa_produnit(String ma_produnit) {
+        this.ma_produnit = ma_produnit == null ? null : ma_produnit.trim();
+    }
+
+    public Double getMa_qty() {
+        return ma_qty;
+    }
+
+    public void setMa_qty(Double ma_qty) {
+        this.ma_qty = ma_qty;
+    }
+
+    public Integer getMa_whid() {
+        return ma_whid;
+    }
+
+    public void setMa_whid(Integer ma_whid) {
+        this.ma_whid = ma_whid;
+    }
+
+    public String getMa_whcode() {
+        return ma_whcode;
+    }
+
+    public void setMa_whcode(String ma_whcode) {
+        this.ma_whcode = ma_whcode == null ? null : ma_whcode.trim();
+    }
+
+    public Date getMa_recorddate() {
+        return ma_recorddate;
+    }
+
+    public void setMa_recorddate(Date ma_recorddate) {
+        this.ma_recorddate = ma_recorddate;
+    }
+
+    public Integer getMa_recordid() {
+        return ma_recordid;
+    }
+
+    public void setMa_recordid(Integer ma_recordid) {
+        this.ma_recordid = ma_recordid;
+    }
+
+    public String getMa_recorder() {
+        return ma_recorder;
+    }
+
+    public void setMa_recorder(String ma_recorder) {
+        this.ma_recorder = ma_recorder == null ? null : ma_recorder.trim();
+    }
+
+    public Double getMa_price() {
+        return ma_price;
+    }
+
+    public void setMa_price(Double ma_price) {
+        this.ma_price = ma_price;
+    }
+
+    public Double getMa_total() {
+        return ma_total;
+    }
+
+    public void setMa_total(Double ma_total) {
+        this.ma_total = ma_total;
+    }
+
+    public String getMa_text1() {
+        return ma_text1;
+    }
+
+    public void setMa_text1(String ma_text1) {
+        this.ma_text1 = ma_text1 == null ? null : ma_text1.trim();
+    }
+
+    public String getMa_text2() {
+        return ma_text2;
+    }
+
+    public void setMa_text2(String ma_text2) {
+        this.ma_text2 = ma_text2 == null ? null : ma_text2.trim();
+    }
+
+    public String getMa_text3() {
+        return ma_text3;
+    }
+
+    public void setMa_text3(String ma_text3) {
+        this.ma_text3 = ma_text3 == null ? null : ma_text3.trim();
+    }
+
+    public String getMa_text4() {
+        return ma_text4;
+    }
+
+    public void setMa_text4(String ma_text4) {
+        this.ma_text4 = ma_text4 == null ? null : ma_text4.trim();
+    }
+
+    public String getMa_text5() {
+        return ma_text5;
+    }
+
+    public void setMa_text5(String ma_text5) {
+        this.ma_text5 = ma_text5 == null ? null : ma_text5.trim();
+    }
+}

+ 141 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/MakeMaterial.java

@@ -0,0 +1,141 @@
+package com.usoftchina.saas.storage.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 制造单明细
+ * @author chenwei
+ * @date 2018/10/29
+ */
+public class MakeMaterial extends CommonBaseEntity implements Serializable {
+    private Long mm_maid;
+
+    private Integer mm_detno;
+
+    private Integer mm_prodid;
+
+    private String mm_prodcode;
+
+    private Integer mm_whid;
+
+    private String mm_whcode;
+
+    private Double mm_price;
+
+    private Double mm_oneuseqty;
+
+    private Double mm_qty;
+
+    private Double mm_amount;
+
+    private String mm_repprodcode;
+
+    private String mm_remark;
+
+    public Long getMm_maid() {
+        return mm_maid;
+    }
+
+    public void setMm_maid(Long mm_maid) {
+        this.mm_maid = mm_maid;
+    }
+
+    public Integer getMm_detno() {
+        return mm_detno;
+    }
+
+    public void setMm_detno(Integer mm_detno) {
+        this.mm_detno = mm_detno;
+    }
+
+    public Integer getMm_prodid() {
+        return mm_prodid;
+    }
+
+    public void setMm_prodid(Integer mm_prodid) {
+        this.mm_prodid = mm_prodid;
+    }
+
+    public String getMm_prodcode() {
+        return mm_prodcode;
+    }
+
+    public void setMm_prodcode(String mm_prodcode) {
+        this.mm_prodcode = mm_prodcode == null ? null : mm_prodcode.trim();
+    }
+
+    public Integer getMm_whid() {
+        return mm_whid;
+    }
+
+    public void setMm_whid(Integer mm_whid) {
+        this.mm_whid = mm_whid;
+    }
+
+    public String getMm_whcode() {
+        return mm_whcode;
+    }
+
+    public void setMm_whcode(String mm_whcode) {
+        this.mm_whcode = mm_whcode == null ? null : mm_whcode.trim();
+    }
+
+    public Double getMm_price() {
+        return mm_price;
+    }
+
+    public void setMm_price(Double mm_price) {
+        this.mm_price = mm_price;
+    }
+
+    public Double getMm_oneuseqty() {
+        return mm_oneuseqty;
+    }
+
+    public void setMm_oneuseqty(Double mm_oneuseqty) {
+        this.mm_oneuseqty = mm_oneuseqty;
+    }
+
+    public Double getMm_qty() {
+        return mm_qty;
+    }
+
+    public void setMm_qty(Double mm_qty) {
+        this.mm_qty = mm_qty;
+    }
+
+    public Double getMm_amount() {
+        return mm_amount;
+    }
+
+    public void setMm_amount(Double mm_amount) {
+        this.mm_amount = mm_amount;
+    }
+
+    public String getMm_repprodcode() {
+        return mm_repprodcode;
+    }
+
+    public void setMm_repprodcode(String mm_repprodcode) {
+        this.mm_repprodcode = mm_repprodcode == null ? null : mm_repprodcode.trim();
+    }
+
+    public String getMm_remark() {
+        return mm_remark;
+    }
+
+    public void setMm_remark(String mm_remark) {
+        this.mm_remark = mm_remark == null ? null : mm_remark.trim();
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 59 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/MakeController.java

@@ -0,0 +1,59 @@
+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.PageRequest;
+import com.usoftchina.saas.storage.dto.MakeListDTO;
+import com.usoftchina.saas.storage.service.MakeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/make")
+public class MakeController {
+
+    @Autowired
+    private MakeService makeService;
+
+    @GetMapping("/list")
+    public Result getFormItems(PageRequest page, ListReqDTO listReqDTO){
+        return Result.success(makeService.getList(page, listReqDTO));
+    }
+
+    @GetMapping("/read/{id}")
+    public Result getDataById(@PathVariable("id") Long id){
+        MakeListDTO makeListDTO = makeService.getDataById(id);
+        return Result.success(makeListDTO);
+    }
+
+    @PostMapping("/save")
+    public Result save(@RequestBody MakeListDTO makeListDTO){
+        DocBaseDTO docBaseDTO = makeService.saveOrUpdate(makeListDTO);
+        return Result.success(docBaseDTO);
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id){
+        makeService.delete(id);
+        return Result.success();
+    }
+
+    @PostMapping("/deleteDetail/{id}")
+    public Result deleteDetail(@PathVariable("id") Long id){
+        makeService.deleteDetail(id);
+        return Result.success();
+    }
+
+    @PostMapping("/close/{id}")
+    public Result close(@PathVariable("id") Long id){
+        DocBaseDTO docBaseDTO = makeService.close(id);
+        return Result.success(docBaseDTO);
+    }
+
+    @PostMapping("/open/{id}")
+    public Result open(@PathVariable("id") Long id){
+        DocBaseDTO docBaseDTO = makeService.open(id);
+        return Result.success(docBaseDTO);
+    }
+}

+ 0 - 1
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/controller/ProdInOutController.java

@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
  * Created by zdw
  * 2018-10-17 11:41.
  */
-@CrossOrigin
 @RestController
 @RequestMapping("/prodinout")
 public class ProdInOutController {

+ 28 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMapper.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.storage.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.storage.po.Make;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MakeMapper extends CommonBaseMapper<Make> {
+    int deleteByPrimaryKey(Long ma_id);
+
+    int insert(Make record);
+
+    int insertSelective(Make record);
+
+    Make selectByPrimaryKey(Long ma_id);
+
+    int updateByPrimaryKeySelective(Make record);
+
+    int updateByPrimaryKey(Make record);
+
+    List<Make> getListDataByCondition(@Param("condition") String condition, @Param("companyId") Long companyId);
+
+    int validateCodeWhenInsert(@Param("code") String code, @Param("companyId") Long companyId);
+
+    int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
+
+}

+ 28 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMaterialMapper.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.storage.mapper;
+
+import com.usoftchina.saas.storage.po.MakeMaterial;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MakeMaterialMapper {
+    int deleteByPrimaryKey(Long mm_id);
+
+    int insert(MakeMaterial record);
+
+    int insertSelective(MakeMaterial record);
+
+    MakeMaterial selectByPrimaryKey(Long mm_id);
+
+    int updateByPrimaryKeySelective(MakeMaterial record);
+
+    int updateByPrimaryKey(MakeMaterial record);
+
+    List<MakeMaterial> selectByFK(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    boolean deleteByFK(@Param("id") Long id, @Param("companyId") Long companyId);
+
+    void batchInsert(List<MakeMaterial> vendorcontactList);
+
+    void batchUpdate(List<MakeMaterial> vendorcontactList);
+}

+ 67 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/MakeService.java

@@ -0,0 +1,67 @@
+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.MakeListDTO;
+import com.usoftchina.saas.storage.mapper.MakeMapper;
+import com.usoftchina.saas.storage.po.Make;
+
+import java.util.List;
+
+public interface MakeService extends CommonBaseService<MakeMapper, Make> {
+
+    /**
+     * 列表
+     * @param page  分页对象
+     * @param listReqDTO    条件对象
+     * @return
+     */
+    PageInfo<Make> getList(PageRequest page, ListReqDTO listReqDTO);
+
+    /**
+     * 获取主从表数据
+     * @param id    主表ID
+     * @return
+     */
+    MakeListDTO getDataById(Long id);
+
+    /**
+     * 保存、更新
+     * @param makeListDTO
+     * @return
+     */
+    DocBaseDTO saveOrUpdate(MakeListDTO makeListDTO);
+
+    /**
+     * 关闭
+     * @param id
+     * @return
+     */
+    DocBaseDTO close(Long id);
+
+    /**
+     * 开启
+     * @param id
+     * @return
+     */
+    DocBaseDTO open(Long id);
+
+    /**
+     *
+     * 删除
+     * @param id
+     * @return
+     */
+    boolean delete(Long id);
+
+    /**
+     * 删除明细
+     * @param id
+     * @return
+     */
+    boolean deleteDetail(Long id);
+}

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

@@ -0,0 +1,228 @@
+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.api.MaxnumberService;
+import com.usoftchina.saas.commons.api.MessageLogService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.commons.po.Status;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.storage.dto.MakeListDTO;
+import com.usoftchina.saas.storage.mapper.MakeMapper;
+import com.usoftchina.saas.storage.mapper.MakeMaterialMapper;
+import com.usoftchina.saas.storage.po.Make;
+import com.usoftchina.saas.storage.po.MakeMaterial;
+import com.usoftchina.saas.storage.service.MakeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> implements MakeService {
+
+    @Autowired
+    private MakeMaterialMapper makeMaterialMapper;
+    @Autowired
+    private MaxnumberService maxnumberService;
+    @Autowired
+    private MessageLogService messageLogService;
+
+    @Override
+    public PageInfo<Make> getList(PageRequest page, ListReqDTO listReqDTO) {
+        //设置分页
+        if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
+            page = new PageRequest();
+            page.setNumber(1);
+            page.setSize(10);
+        }
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //取分页信息
+        String condition = listReqDTO.getFinalCondition();
+        List<Make> list = getMapper().getListDataByCondition(condition, BaseContextHolder.getCompanyId());
+        PageInfo<Make> pageInfo = new PageInfo<Make>(list);
+        return pageInfo;
+    }
+
+    @Override
+    public MakeListDTO getDataById(Long id) {
+        Make make = getMapper().selectByPrimaryKey(id);
+        List<MakeMaterial> makeMaterialList = makeMaterialMapper.selectByFK(id, BaseContextHolder.getCompanyId());
+        MakeListDTO makeListDTO = new MakeListDTO();
+        makeListDTO.setMain(make);
+        makeListDTO.setItems(makeMaterialList);
+        return makeListDTO;
+    }
+
+    @Override
+    @Transactional
+    public DocBaseDTO saveOrUpdate(MakeListDTO makeListDTO) {
+        //校验库存是否足够
+        validStorage(makeListDTO);
+
+        Make make = makeListDTO.getMain();
+        List<MakeMaterial> makeMaterialList = makeListDTO.getItems();
+        DocBaseDTO docBaseDTO = null;
+
+        if(make.getId() == 0){
+            //保存主表
+            String code = pushMaxnubmer(make.getMa_code(), make.getId());
+            make.setMa_code(code);
+            make.setCompanyId(BaseContextHolder.getCompanyId());
+            make.setCreateTime(new Date());
+            make.setCreatorId(BaseContextHolder.getUserId());
+
+            getMapper().insertSelective(make);
+            //保存明细
+            for (MakeMaterial makeMaterial : makeMaterialList){
+                makeMaterial.setMm_maid(make.getId());
+                makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
+                makeMaterial.setCreatorId(BaseContextHolder.getUserId());
+                makeMaterial.setCreateTime(new Date());
+
+            }
+            makeMaterialMapper.batchInsert(makeMaterialList);
+            //记录LOG
+            docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
+            messageLogService.save(docBaseDTO);
+        }else{
+            //更新主表
+            make.setUpdaterId(BaseContextHolder.getUserId());
+            make.setUpdateTime(new Date());
+
+            getMapper().updateByPrimaryKeySelective(make);
+
+            List<MakeMaterial> updateItems = new ArrayList<MakeMaterial>();
+            List<MakeMaterial> insertItems = new ArrayList<MakeMaterial>();
+            //更新从表
+            for (MakeMaterial makeMaterial : makeMaterialList){
+                if(makeMaterial.getId() == 0){
+                    makeMaterial.setCreatorId(BaseContextHolder.getUserId());
+                    makeMaterial.setCreateTime(new Date());
+                    makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
+                    insertItems.add(makeMaterial);
+                }else{
+                    makeMaterial.setUpdaterId(BaseContextHolder.getUserId());
+                    makeMaterial.setUpdateTime(new Date());
+                    makeMaterial.setCompanyId(BaseContextHolder.getCompanyId());
+                    updateItems.add(makeMaterial);
+                }
+            }
+            //执行插入、更新
+            makeMaterialMapper.batchInsert(insertItems);
+            makeMaterialMapper.batchUpdate(updateItems);
+            //记录LOG
+            docBaseDTO = generateMsgObj(make.getId(), make.getMa_code());
+            messageLogService.update(docBaseDTO);
+        }
+        return docBaseDTO;
+    }
+
+    /**
+     * 校验库存是否足够
+     * @param makeListDTO
+     */
+    private void validStorage(MakeListDTO makeListDTO) {
+        Make make = makeListDTO.getMain();
+        List<MakeMaterial> makeMaterialList = makeListDTO.getItems();
+        if ("组装".equals(make.getMa_type())){
+            //判断明细的库存是否足够
+            for(MakeMaterial makeMaterial : makeMaterialList){
+                double qty = makeMaterial.getMm_qty() * makeMaterial.getMm_oneuseqty();
+            }
+        }else if ("拆件".equals(make.getMa_type())){
+            double qty = make.getMa_qty();
+
+        }
+    }
+
+    @Override
+    public DocBaseDTO close(Long id) {
+        if(id != null && id > 0){
+            Make make = new Make();
+            make.setId(id);
+            make.setMa_status(Status.CLOSE.getDisplay());
+            make.setMa_statuscode(Status.CLOSE.name());
+            make.setUpdaterId(BaseContextHolder.getUserId());
+            make.setUpdateTime(new Date());
+
+            String code = getMapper().selectByPrimaryKey(id).getMa_code();
+            getMapper().updateByPrimaryKeySelective(make);
+            //记录LOG
+            DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+            messageLogService.close(docBaseDTO);
+            return docBaseDTO;
+        }else{
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    @Override
+    public DocBaseDTO open(Long id) {
+        if(id != null && id > 0){
+            Make make = new Make();
+            make.setId(id);
+            make.setMa_status(Status.OPEN.getDisplay());
+            make.setMa_statuscode(Status.OPEN.name());
+            make.setUpdaterId(BaseContextHolder.getUserId());
+            make.setUpdateTime(new Date());
+
+            String code = getMapper().selectByPrimaryKey(id).getMa_code();
+            getMapper().updateByPrimaryKeySelective(make);
+            //记录LOG
+            DocBaseDTO docBaseDTO = generateMsgObj(id, code);
+            messageLogService.open(docBaseDTO);
+            return docBaseDTO;
+        }else{
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+    }
+
+    @Override
+    public boolean delete(Long id) {
+        getMapper().deleteByPrimaryKey(id);
+        makeMaterialMapper.deleteByFK(id, BaseContextHolder.getCompanyId());
+        return true;
+    }
+
+    @Override
+    public boolean deleteDetail(Long id) {
+        makeMaterialMapper.deleteByFK(id, BaseContextHolder.getCompanyId());
+        return true;
+    }
+
+    /**
+     * 构造日记记录对象
+     * @param id
+     * @return
+     */
+    private DocBaseDTO generateMsgObj(Long id, String code){
+        return new DocBaseDTO(id, code, "Make");
+    }
+
+    /**
+     * @Description: 检验获取并更新单号
+     * @Param: [code, id]
+     * @return: java.lang.String
+     * @Author: chenwei
+     * @Date: 2018/10/26
+     */
+    private String pushMaxnubmer(String code, Long id) {
+        if (null == code) {
+            throw new BizException(BizExceptionCode.NULL_CODE);
+        }
+        Long companyId = BaseContextHolder.getCompanyId();
+        Integer count = "0".equals(String.valueOf(id)) ? getMapper().validateCodeWhenInsert(code, companyId) :
+                getMapper().validateCodeWhenUpdate(code, id, companyId);
+        return maxnumberService.pushMaxnubmer(count, code, BillCodeSeq.MAKE.getCaller()).getData();
+    }
+}

+ 1 - 1
applications/storage/storage-server/src/main/resources/application.yml

@@ -47,7 +47,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
 server:
   port: 9000
   tomcat:

+ 370 - 0
applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml

@@ -0,0 +1,370 @@
+<?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.MakeMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.po.Make" >
+    <id column="ma_id" property="id" jdbcType="INTEGER" />
+    <result column="ma_code" property="ma_code" jdbcType="VARCHAR" />
+    <result column="ma_status" property="ma_status" jdbcType="VARCHAR" />
+    <result column="ma_statuscode" property="ma_statuscode" jdbcType="VARCHAR" />
+    <result column="ma_type" property="ma_type" jdbcType="VARCHAR" />
+    <result column="ma_prodid" property="ma_prodid" jdbcType="INTEGER" />
+    <result column="ma_prodcode" property="ma_prodcode" jdbcType="VARCHAR" />
+    <result column="ma_proddetail" property="ma_proddetail" jdbcType="VARCHAR" />
+    <result column="ma_prodspec" property="ma_prodspec" jdbcType="VARCHAR" />
+    <result column="ma_version" property="ma_version" jdbcType="VARCHAR" />
+    <result column="ma_produnit" property="ma_produnit" jdbcType="VARCHAR" />
+    <result column="ma_qty" property="ma_qty" jdbcType="DOUBLE" />
+    <result column="ma_whid" property="ma_whid" jdbcType="INTEGER" />
+    <result column="ma_whcode" property="ma_whcode" jdbcType="VARCHAR" />
+    <result column="ma_recorddate" property="ma_recorddate" jdbcType="TIMESTAMP" />
+    <result column="ma_recordid" property="ma_recordid" jdbcType="INTEGER" />
+    <result column="ma_recorder" property="ma_recorder" jdbcType="VARCHAR" />
+    <result column="ma_price" property="ma_price" jdbcType="DOUBLE" />
+    <result column="ma_total" property="ma_total" jdbcType="DOUBLE" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="ma_text1" property="ma_text1" jdbcType="VARCHAR" />
+    <result column="ma_text2" property="ma_text2" jdbcType="VARCHAR" />
+    <result column="ma_text3" property="ma_text3" jdbcType="VARCHAR" />
+    <result column="ma_text4" property="ma_text4" jdbcType="VARCHAR" />
+    <result column="ma_text5" property="ma_text5" jdbcType="VARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    ma_id, ma_code, ma_status, ma_statuscode, ma_type, ma_prodid, ma_prodcode, ma_proddetail, 
+    ma_prodspec, ma_version, ma_produnit, ma_qty, ma_whid, ma_whcode, ma_recorddate, 
+    ma_recordid, ma_recorder, ma_price, ma_total, companyId, updaterId, updateTime, ma_text1, 
+    ma_text2, ma_text3, ma_text4, ma_text5
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select 
+    <include refid="Base_Column_List" />
+    from make
+    where ma_id = #{id}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from make
+    where ma_id = #{id}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.storage.po.Make" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into make (ma_code, ma_status, 
+      ma_statuscode, ma_type, ma_prodid, 
+      ma_prodcode, ma_proddetail, ma_prodspec, 
+      ma_version, ma_produnit, ma_qty, 
+      ma_whid, ma_whcode, ma_recorddate, 
+      ma_recordid, ma_recorder, ma_price, 
+      ma_total, companyId, updaterId, 
+      updateTime, ma_text1, ma_text2, 
+      ma_text3, ma_text4, ma_text5
+      )
+    values (#{ma_code,jdbcType=VARCHAR}, #{ma_status,jdbcType=VARCHAR}, 
+      #{ma_statuscode,jdbcType=VARCHAR}, #{ma_type,jdbcType=VARCHAR}, #{ma_prodid,jdbcType=INTEGER}, 
+      #{ma_prodcode,jdbcType=VARCHAR}, #{ma_proddetail,jdbcType=VARCHAR}, #{ma_prodspec,jdbcType=VARCHAR}, 
+      #{ma_version,jdbcType=VARCHAR}, #{ma_produnit,jdbcType=VARCHAR}, #{ma_qty,jdbcType=DOUBLE}, 
+      #{ma_whid,jdbcType=INTEGER}, #{ma_whcode,jdbcType=VARCHAR}, #{ma_recorddate,jdbcType=TIMESTAMP}, 
+      #{ma_recordid,jdbcType=INTEGER}, #{ma_recorder,jdbcType=VARCHAR}, #{ma_price,jdbcType=DOUBLE}, 
+      #{ma_total,jdbcType=DOUBLE}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{ma_text1,jdbcType=VARCHAR}, #{ma_text2,jdbcType=VARCHAR}, 
+      #{ma_text3,jdbcType=VARCHAR}, #{ma_text4,jdbcType=VARCHAR}, #{ma_text5,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.Make" >
+    <selectKey resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into make
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="ma_code != null" >
+        ma_code,
+      </if>
+      <if test="ma_status != null" >
+        ma_status,
+      </if>
+      <if test="ma_statuscode != null" >
+        ma_statuscode,
+      </if>
+      <if test="ma_type != null" >
+        ma_type,
+      </if>
+      <if test="ma_prodid != null" >
+        ma_prodid,
+      </if>
+      <if test="ma_prodcode != null" >
+        ma_prodcode,
+      </if>
+      <if test="ma_proddetail != null" >
+        ma_proddetail,
+      </if>
+      <if test="ma_prodspec != null" >
+        ma_prodspec,
+      </if>
+      <if test="ma_version != null" >
+        ma_version,
+      </if>
+      <if test="ma_produnit != null" >
+        ma_produnit,
+      </if>
+      <if test="ma_qty != null" >
+        ma_qty,
+      </if>
+      <if test="ma_whid != null" >
+        ma_whid,
+      </if>
+      <if test="ma_whcode != null" >
+        ma_whcode,
+      </if>
+      <if test="ma_recorddate != null" >
+        ma_recorddate,
+      </if>
+      <if test="ma_recordid != null" >
+        ma_recordid,
+      </if>
+      <if test="ma_recorder != null" >
+        ma_recorder,
+      </if>
+      <if test="ma_price != null" >
+        ma_price,
+      </if>
+      <if test="ma_total != null" >
+        ma_total,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="ma_text1 != null" >
+        ma_text1,
+      </if>
+      <if test="ma_text2 != null" >
+        ma_text2,
+      </if>
+      <if test="ma_text3 != null" >
+        ma_text3,
+      </if>
+      <if test="ma_text4 != null" >
+        ma_text4,
+      </if>
+      <if test="ma_text5 != null" >
+        ma_text5,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="ma_code != null" >
+        #{ma_code,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_status != null" >
+        #{ma_status,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_statuscode != null" >
+        #{ma_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_type != null" >
+        #{ma_type,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_prodid != null" >
+        #{ma_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_prodcode != null" >
+        #{ma_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_proddetail != null" >
+        #{ma_proddetail,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_prodspec != null" >
+        #{ma_prodspec,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_version != null" >
+        #{ma_version,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_produnit != null" >
+        #{ma_produnit,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_qty != null" >
+        #{ma_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="ma_whid != null" >
+        #{ma_whid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_whcode != null" >
+        #{ma_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_recorddate != null" >
+        #{ma_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ma_recordid != null" >
+        #{ma_recordid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_recorder != null" >
+        #{ma_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_price != null" >
+        #{ma_price,jdbcType=DOUBLE},
+      </if>
+      <if test="ma_total != null" >
+        #{ma_total,jdbcType=DOUBLE},
+      </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="ma_text1 != null" >
+        #{ma_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text2 != null" >
+        #{ma_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text3 != null" >
+        #{ma_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text4 != null" >
+        #{ma_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text5 != null" >
+        #{ma_text5,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.Make" >
+    update make
+    <set >
+      <if test="ma_code != null" >
+        ma_code = #{ma_code,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_status != null" >
+        ma_status = #{ma_status,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_statuscode != null" >
+        ma_statuscode = #{ma_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_type != null" >
+        ma_type = #{ma_type,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_prodid != null" >
+        ma_prodid = #{ma_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_prodcode != null" >
+        ma_prodcode = #{ma_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_proddetail != null" >
+        ma_proddetail = #{ma_proddetail,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_prodspec != null" >
+        ma_prodspec = #{ma_prodspec,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_version != null" >
+        ma_version = #{ma_version,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_produnit != null" >
+        ma_produnit = #{ma_produnit,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_qty != null" >
+        ma_qty = #{ma_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="ma_whid != null" >
+        ma_whid = #{ma_whid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_whcode != null" >
+        ma_whcode = #{ma_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_recorddate != null" >
+        ma_recorddate = #{ma_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ma_recordid != null" >
+        ma_recordid = #{ma_recordid,jdbcType=INTEGER},
+      </if>
+      <if test="ma_recorder != null" >
+        ma_recorder = #{ma_recorder,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_price != null" >
+        ma_price = #{ma_price,jdbcType=DOUBLE},
+      </if>
+      <if test="ma_total != null" >
+        ma_total = #{ma_total,jdbcType=DOUBLE},
+      </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="ma_text1 != null" >
+        ma_text1 = #{ma_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text2 != null" >
+        ma_text2 = #{ma_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text3 != null" >
+        ma_text3 = #{ma_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text4 != null" >
+        ma_text4 = #{ma_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="ma_text5 != null" >
+        ma_text5 = #{ma_text5,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where ma_id = #{id}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.Make" >
+    update make
+    set ma_code = #{ma_code,jdbcType=VARCHAR},
+      ma_status = #{ma_status,jdbcType=VARCHAR},
+      ma_statuscode = #{ma_statuscode,jdbcType=VARCHAR},
+      ma_type = #{ma_type,jdbcType=VARCHAR},
+      ma_prodid = #{ma_prodid,jdbcType=INTEGER},
+      ma_prodcode = #{ma_prodcode,jdbcType=VARCHAR},
+      ma_proddetail = #{ma_proddetail,jdbcType=VARCHAR},
+      ma_prodspec = #{ma_prodspec,jdbcType=VARCHAR},
+      ma_version = #{ma_version,jdbcType=VARCHAR},
+      ma_produnit = #{ma_produnit,jdbcType=VARCHAR},
+      ma_qty = #{ma_qty,jdbcType=DOUBLE},
+      ma_whid = #{ma_whid,jdbcType=INTEGER},
+      ma_whcode = #{ma_whcode,jdbcType=VARCHAR},
+      ma_recorddate = #{ma_recorddate,jdbcType=TIMESTAMP},
+      ma_recordid = #{ma_recordid,jdbcType=INTEGER},
+      ma_recorder = #{ma_recorder,jdbcType=VARCHAR},
+      ma_price = #{ma_price,jdbcType=DOUBLE},
+      ma_total = #{ma_total,jdbcType=DOUBLE},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      ma_text1 = #{ma_text1,jdbcType=VARCHAR},
+      ma_text2 = #{ma_text2,jdbcType=VARCHAR},
+      ma_text3 = #{ma_text3,jdbcType=VARCHAR},
+      ma_text4 = #{ma_text4,jdbcType=VARCHAR},
+      ma_text5 = #{ma_text5,jdbcType=VARCHAR}
+    where ma_id = #{id}
+  </update>
+  <select id="getListDataByCondition" resultMap="BaseResultMap">
+    SELECT * FROM MAKE
+    <where>
+      <if test="condition!=null">
+        ${condition}
+      </if>
+      AND MAKE.COMPANYID = #{companyId}
+    </where>
+    order by MA_ID
+  </select>
+  <select id="validateCodeWhenInsert" resultType="int">
+    select count(*) from MAKE where MA_CODE = #{code} and companyId =#{companyId}
+  </select>
+  <select id="validateCodeWhenUpdate" resultType="int" >
+    select count(*) from MAKE where MA_CODE = #{code} and MA_ID != #{id} and companyId =#{companyId}
+  </select>
+</mapper>

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

@@ -0,0 +1,374 @@
+<?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.MakeMaterialMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.storage.po.MakeMaterial" >
+    <id column="mm_id" property="id" jdbcType="INTEGER" />
+    <result column="mm_maid" property="mm_maid" jdbcType="INTEGER" />
+    <result column="mm_detno" property="mm_detno" jdbcType="INTEGER" />
+    <result column="mm_prodid" property="mm_prodid" jdbcType="INTEGER" />
+    <result column="mm_prodcode" property="mm_prodcode" jdbcType="VARCHAR" />
+    <result column="mm_whid" property="mm_whid" jdbcType="INTEGER" />
+    <result column="mm_whcode" property="mm_whcode" jdbcType="VARCHAR" />
+    <result column="mm_price" property="mm_price" jdbcType="DOUBLE" />
+    <result column="mm_oneuseqty" property="mm_oneuseqty" jdbcType="DOUBLE" />
+    <result column="mm_qty" property="mm_qty" jdbcType="DOUBLE" />
+    <result column="mm_amount" property="mm_amount" jdbcType="DOUBLE" />
+    <result column="mm_repprodcode" property="mm_repprodcode" jdbcType="VARCHAR" />
+    <result column="mm_remark" property="mm_remark" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    mm_id, mm_maid, mm_detno, mm_prodid, mm_prodcode, mm_whid, mm_whcode, mm_price, mm_oneuseqty, 
+    mm_qty, mm_amount, mm_repprodcode, mm_remark, companyId, updaterId, updateTime
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    select 
+    <include refid="Base_Column_List" />
+    from MakeMaterial
+    where mm_id = #{id}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    delete from MakeMaterial
+    where mm_id = #{id}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.storage.po.MakeMaterial" >
+    insert into MakeMaterial (mm_maid, mm_detno,
+      mm_prodid, mm_prodcode, mm_whid, 
+      mm_whcode, mm_price, mm_oneuseqty, 
+      mm_qty, mm_amount, mm_repprodcode, 
+      mm_remark, companyId, updaterId, 
+      updateTime)
+    values (#{mm_maid}, #{mm_detno,jdbcType=INTEGER},
+      #{mm_prodid,jdbcType=INTEGER}, #{mm_prodcode,jdbcType=VARCHAR}, #{mm_whid,jdbcType=INTEGER}, 
+      #{mm_whcode,jdbcType=VARCHAR}, #{mm_price,jdbcType=DOUBLE}, #{mm_oneuseqty,jdbcType=DOUBLE}, 
+      #{mm_qty,jdbcType=DOUBLE}, #{mm_amount,jdbcType=DOUBLE}, #{mm_repprodcode,jdbcType=VARCHAR}, 
+      #{mm_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, 
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.MakeMaterial" >
+    insert into MakeMaterial
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="mm_maid != null" >
+        mm_maid,
+      </if>
+      <if test="mm_detno != null" >
+        mm_detno,
+      </if>
+      <if test="mm_prodid != null" >
+        mm_prodid,
+      </if>
+      <if test="mm_prodcode != null" >
+        mm_prodcode,
+      </if>
+      <if test="mm_whid != null" >
+        mm_whid,
+      </if>
+      <if test="mm_whcode != null" >
+        mm_whcode,
+      </if>
+      <if test="mm_price != null" >
+        mm_price,
+      </if>
+      <if test="mm_oneuseqty != null" >
+        mm_oneuseqty,
+      </if>
+      <if test="mm_qty != null" >
+        mm_qty,
+      </if>
+      <if test="mm_amount != null" >
+        mm_amount,
+      </if>
+      <if test="mm_repprodcode != null" >
+        mm_repprodcode,
+      </if>
+      <if test="mm_remark != null" >
+        mm_remark,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="mm_maid != null" >
+        #{mm_maid},
+      </if>
+      <if test="mm_detno != null" >
+        #{mm_detno,jdbcType=INTEGER},
+      </if>
+      <if test="mm_prodid != null" >
+        #{mm_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="mm_prodcode != null" >
+        #{mm_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_whid != null" >
+        #{mm_whid,jdbcType=INTEGER},
+      </if>
+      <if test="mm_whcode != null" >
+        #{mm_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_price != null" >
+        #{mm_price,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_oneuseqty != null" >
+        #{mm_oneuseqty,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_qty != null" >
+        #{mm_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_amount != null" >
+        #{mm_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_repprodcode != null" >
+        #{mm_repprodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_remark != null" >
+        #{mm_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>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.MakeMaterial" >
+    update MakeMaterial
+    <set >
+      <if test="mm_maid != null" >
+        mm_maid = #{mm_maid},
+      </if>
+      <if test="mm_detno != null" >
+        mm_detno = #{mm_detno,jdbcType=INTEGER},
+      </if>
+      <if test="mm_prodid != null" >
+        mm_prodid = #{mm_prodid,jdbcType=INTEGER},
+      </if>
+      <if test="mm_prodcode != null" >
+        mm_prodcode = #{mm_prodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_whid != null" >
+        mm_whid = #{mm_whid,jdbcType=INTEGER},
+      </if>
+      <if test="mm_whcode != null" >
+        mm_whcode = #{mm_whcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_price != null" >
+        mm_price = #{mm_price,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_oneuseqty != null" >
+        mm_oneuseqty = #{mm_oneuseqty,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_qty != null" >
+        mm_qty = #{mm_qty,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_amount != null" >
+        mm_amount = #{mm_amount,jdbcType=DOUBLE},
+      </if>
+      <if test="mm_repprodcode != null" >
+        mm_repprodcode = #{mm_repprodcode,jdbcType=VARCHAR},
+      </if>
+      <if test="mm_remark != null" >
+        mm_remark = #{mm_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>
+    </set>
+    where mm_id = #{id}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.MakeMaterial" >
+    update MakeMaterial
+    set mm_maid = #{mm_maid},
+      mm_detno = #{mm_detno,jdbcType=INTEGER},
+      mm_prodid = #{mm_prodid,jdbcType=INTEGER},
+      mm_prodcode = #{mm_prodcode,jdbcType=VARCHAR},
+      mm_whid = #{mm_whid,jdbcType=INTEGER},
+      mm_whcode = #{mm_whcode,jdbcType=VARCHAR},
+      mm_price = #{mm_price,jdbcType=DOUBLE},
+      mm_oneuseqty = #{mm_oneuseqty,jdbcType=DOUBLE},
+      mm_qty = #{mm_qty,jdbcType=DOUBLE},
+      mm_amount = #{mm_amount,jdbcType=DOUBLE},
+      mm_repprodcode = #{mm_repprodcode,jdbcType=VARCHAR},
+      mm_remark = #{mm_remark,jdbcType=VARCHAR},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP}
+    where mm_id = #{id}
+  </update>
+  <select id="selectByFK" resultMap="BaseResultMap">
+    SELECT * FROM MAKEMATERIAL WHERE MM_MAID=#{id} AND COMPANYID={companyId}
+  </select>
+  <delete id="deleteByFK">
+    DELETE FROM MAKEMATERIAL WHERE MM_MAID=#{id} AND COMPANYID={companyId}
+  </delete>
+  <insert id="batchInsert" parameterType="java.util.List">
+    <foreach collection="list" item="item" separator=",">
+      INSERT INTO MAKEMATERIAL
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="item.mm_maid != null" >
+          mm_maid,
+        </if>
+        <if test="item.mm_detno != null" >
+          mm_detno,
+        </if>
+        <if test="item.mm_prodid != null" >
+          mm_prodid,
+        </if>
+        <if test="item.mm_prodcode != null" >
+          mm_prodcode,
+        </if>
+        <if test="item.mm_whid != null" >
+          mm_whid,
+        </if>
+        <if test="item.mm_whcode != null" >
+          mm_whcode,
+        </if>
+        <if test="item.mm_price != null" >
+          mm_price,
+        </if>
+        <if test="item.mm_oneuseqty != null" >
+          mm_oneuseqty,
+        </if>
+        <if test="item.mm_qty != null" >
+          mm_qty,
+        </if>
+        <if test="item.mm_amount != null" >
+          mm_amount,
+        </if>
+        <if test="item.mm_repprodcode != null" >
+          mm_repprodcode,
+        </if>
+        <if test="item.mm_remark != null" >
+          mm_remark,
+        </if>
+        <if test="item.companyId != null" >
+          companyId,
+        </if>
+        <if test="item.updaterId != null" >
+          updaterId,
+        </if>
+        <if test="item.updateTime != null" >
+          updateTime,
+        </if>
+      </trim>
+      <trim prefix="values(" suffix=")" suffixOverrides=",">
+        <if test="item.mm_maid != null" >
+          #{item.mm_maid},
+        </if>
+        <if test="item.mm_detno != null" >
+          #{item.mm_detno,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_prodid != null" >
+          #{item.mm_prodid,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_prodcode != null" >
+          #{item.mm_prodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_whid != null" >
+          #{item.mm_whid,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_whcode != null" >
+          #{item.mm_whcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_price != null" >
+          #{item.mm_price,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_oneuseqty != null" >
+          #{item.mm_oneuseqty,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_qty != null" >
+          #{item.mm_qty,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_amount != null" >
+          #{item.mm_amount,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_repprodcode != null" >
+          #{item.mm_repprodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_remark != null" >
+          #{item.mm_remark,jdbcType=VARCHAR},
+        </if>
+        <if test="item.companyId != null" >
+          #{item.companyId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updaterId != null" >
+          #{item.updaterId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updateTime != null" >
+          #{item.updateTime,jdbcType=TIMESTAMP},
+        </if>
+      </trim>
+    </foreach>
+  </insert>
+  <update id="batchUpdate" parameterType="com.usoftchina.saas.storage.po.MakeMaterial">
+    <foreach collection="list" item="item" index="index" separator=";">
+      UPDATE MakeMaterial
+      <set>
+        <if test="item.mm_maid != null" >
+          mm_maid = #{item.mm_maid},
+        </if>
+        <if test="item.mm_detno != null" >
+          mm_detno = #{item.mm_detno,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_prodid != null" >
+          mm_prodid = #{item.mm_prodid,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_prodcode != null" >
+          mm_prodcode = #{item.mm_prodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_whid != null" >
+          mm_whid = #{item.mm_whid,jdbcType=INTEGER},
+        </if>
+        <if test="item.mm_whcode != null" >
+          mm_whcode = #{item.mm_whcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_price != null" >
+          mm_price = #{item.mm_price,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_oneuseqty != null" >
+          mm_oneuseqty = #{item.mm_oneuseqty,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_qty != null" >
+          mm_qty = #{item.mm_qty,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_amount != null" >
+          mm_amount = #{item.mm_amount,jdbcType=DOUBLE},
+        </if>
+        <if test="item.mm_repprodcode != null" >
+          mm_repprodcode = #{item.mm_repprodcode,jdbcType=VARCHAR},
+        </if>
+        <if test="item.mm_remark != null" >
+          mm_remark = #{item.mm_remark,jdbcType=VARCHAR},
+        </if>
+        <if test="item.companyId != null" >
+          companyId = #{item.companyId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updaterId != null" >
+          updaterId = #{item.updaterId,jdbcType=INTEGER},
+        </if>
+        <if test="item.updateTime != null" >
+          updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
+        </if>
+      </set>
+    </foreach>
+  </update>
+</mapper>

+ 2 - 1
frontend/saas-web/app.json

@@ -18,7 +18,8 @@
     "requires": [
         "font-awesome",
         "ux",
-        "modern-locale"
+        "modern-locale",
+        "charts"
     ],
     "locale":"zh_CN",
 

+ 29 - 3
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -111,7 +111,8 @@ Ext.define('saas.view.core.form.FormPanel', {
                 }, {
                     xtype: 'button',
                     bind: {
-                        text: '{auditBtnText}'
+                        text: '{auditBtnText}',
+                        hidden:'{!showAuditBtn}'
                     },
                     handler: "auditBtnClick",
 
@@ -137,11 +138,13 @@ Ext.define('saas.view.core.form.FormPanel', {
 
         if (statusCodeField) {
             var o = {};
-            o['auditBtnText'] = {
+            o['bindEditable'] = {
                 bind: '{' + statusCodeField + '}',
                 get: function(value) {
                     viewModel.set(statusField, value == 'AUDITED' ? '已审核' : '未审核');
-                    return value == 'AUDITED' ? '反审核' : '审核'
+                    viewModel.set('auditBtnText', value == 'AUDITED' ? '反审核' : '审核');
+                    me.setEditable(value != 'AUDITED');
+                    return value;
                 }
             };
             viewModel.setFormulas(o);
@@ -250,4 +253,27 @@ Ext.define('saas.view.core.form.FormPanel', {
         });
         viewModel.set('base.bindFields', bindFields);
     },
+    setEditable: function(able) {
+        var me = this,
+        viewModel = me.getViewModel(),
+        items = me.getForm().getFields().items;
+
+        var detailGrids = me.query('detailGridField');
+
+        Ext.Array.each(detailGrids, function(g) {
+            var columns = g.columns;
+            Ext.Array.each(columns, function(c) {
+                var e = c.getEditor();
+                if(e) {
+                    typeof e.setDisabled == 'function' && e.setDisabled(!able);
+                }
+            });
+        });
+
+        Ext.Array.each(items, function(item) {
+            if(typeof item.setEditable == 'function') {
+                typeof item.setDisabled == 'function' && item.setDisabled(!able);
+            }
+        });
+    }
 });

+ 1 - 1
frontend/saas-web/app/view/core/form/FormPanelController.js

@@ -189,7 +189,7 @@ Ext.define('saas.view.core.form.FormPanelController', {
                     form.initId = localJson.data.id;
                 }
                 form.FormUtil.loadData(form);
-                viewModel.set('base.editable', false);
+                form.setEditable(false);
                 showToast('审核成功');
             }
         })

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

@@ -9,6 +9,8 @@ Ext.define('saas.view.core.form.FormPanelModel', {
             editable: true, // 单据是否可编辑
             codeEditable: false, // 单据编号是否可编辑
         },
+        auditBtnText: '审核', // 审核按钮默认text
+        showAuditBtn: true, // 显示审核、反审核按钮
         detailBindeFields: [], // 从表绑定列
         detailStore: null, // 从表store
     },

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

@@ -32,7 +32,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             store: Ext.create('Ext.data.Store', {
                 fields: me.getFields(),
                 autoLoad: true,
-                pageSize: 15,
+                pageSize: 5,
                 data: [],
                 proxy: {
                     type: 'ajax',

+ 7 - 0
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -281,5 +281,12 @@ Ext.define('saas.view.core.query.QueryPanel', {
         }
 
         return detailModel ? 'DETAIL' : 'MAIN';
+    },
+    
+    refresh: function() {
+        var me = this;
+        queryGrid = me.down('core-query-querygridpanel');
+
+        queryGrid.store.reload();
     }
 });

+ 10 - 1
frontend/saas-web/app/view/core/tab/Controller.js

@@ -13,7 +13,16 @@ Ext.define('saas.view.core.tab.Controller', {
         };
         Ext.apply(view, viewConfig);
 
-        tab.add(view);
+        tab.tabView = tab.add(view);
     },
 
+    onTabChange: function() {
+        var me = this,
+        tab = me.getView(),
+        tabView = tab.tabView;
+
+        if(typeof tabView.refresh == 'function') {
+            tabView.refresh();
+        }
+    }
 });

+ 5 - 1
frontend/saas-web/app/view/core/tab/Panel.js

@@ -2,5 +2,9 @@ Ext.define('saas.view.core.tab.Panel', {
     extend: 'Ext.panel.Panel',
     xtype: 'core-tab-panel',
     controller: 'core-tab-controller',
-    layout: 'fit'
+    layout: 'fit',
+    
+    listeners: {
+        activate: 'onTabChange'
+    }
 });

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

@@ -7,7 +7,7 @@ Ext.define('saas.view.document.customer.BasePanel', {
 
     searchField:[{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/customerkind/getCombo',
+        storeUrl:basePath+'document/customerkind/getCombo',
         name : "cu_type", 
         emptyText : "请选择客户类型", 
         allowBlank : true, 
@@ -19,8 +19,8 @@ Ext.define('saas.view.document.customer.BasePanel', {
             customerkind:{
                 keyField:'id',
                 dataField:'ck_name',
-                reqUrl:basePath+'ducument/customerkind/save',
-                delUrl:basePath+'ducument/customerkind/delete'
+                reqUrl:basePath+'document/customerkind/save',
+                delUrl:basePath+'document/customerkind/delete'
             }
         },
         addHandler:function(b){
@@ -44,14 +44,14 @@ Ext.define('saas.view.document.customer.BasePanel', {
     _formXtype:'document-customer-formpanel',
     _title:'客户资料',
     // _dataUrl:basePath+'ducument/customer/list',
-    _batchOpenUrl:basePath+'ducument/customer/batchOpen',
-    _batchCloseUrl:basePath+'ducument/customer/batchClose',
-    _batchDeleteUrl:basePath+'ducument/customer/batchDelete',
+    _batchOpenUrl:basePath+'document/customer/batchOpen',
+    _batchCloseUrl:basePath+'document/customer/batchClose',
+    _batchDeleteUrl:basePath+'document/customer/batchDelete',
 
     gridConfig: {
         idField: 'id',
         codeField: 'cu_code',
-        dataUrl: basePath+'ducument/customer/list',
+        dataUrl: basePath+'document/customer/list',
         columns : [{
             text : "客户id", 
             width : 0, 

+ 12 - 1
frontend/saas-web/app/view/document/customer/FormModel.js

@@ -2,5 +2,16 @@ Ext.define('saas.view.document.customer.FormModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.document-customer-formpanel',
 
-    
+    data: {
+        id: 0
+    },
+
+    formulas:{
+        showAuditBtn:{
+            bind:'{id}',
+            get:function(value){
+                return value;
+            }
+        }
+    }
 });

+ 10 - 10
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -13,11 +13,11 @@ Ext.define('saas.view.document.customer.FormPanel', {
     _codeField: 'cu_code',
     _statusField: 'cu_status',
     _statusCodeField: 'cu_statuscode',
-    _readUrl:basePath+'ducument/customer/read/',
-    _saveUrl:basePath+'ducument/customer/save',
-    _openUrl:basePath+'ducument/customer/open',
-    _closeUrl:basePath+'ducument/customer/close',
-    _deleteUrl:basePath+'ducument/customer/delete/',
+    _readUrl:basePath+'document/customer/read/',
+    _saveUrl:basePath+'document/customer/save',
+    _openUrl:basePath+'document/customer/open',
+    _closeUrl:basePath+'document/customer/close',
+    _deleteUrl:basePath+'document/customer/delete/',
     initId:0,
 
     defaultItems: [{
@@ -52,7 +52,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         columnWidth: 0.25
     },{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/customerkind/getCombo',
+        storeUrl:basePath+'document/customerkind/getCombo',
         name : "cu_type", 
         fieldLabel : "客户类型", 
         allowBlank : true, 
@@ -64,8 +64,8 @@ Ext.define('saas.view.document.customer.FormPanel', {
             customerkind:{
                 keyField:'id',
                 dataField:'ck_name',
-                reqUrl:basePath+'ducument/customerkind/save',
-                delUrl:basePath+'ducument/customerkind/delete'
+                reqUrl:basePath+'document/customerkind/save',
+                delUrl:basePath+'document/customerkind/delete'
             }
         },
         addHandler:function(b){
@@ -149,7 +149,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         xtype : "detailGridField", 
         detnoColumn:  'cc_detno',
         storeModel:'saas.model.document.customercontact',
-        deleteDetailUrl:basePath+'ducument/customer/deletecontact/',
+        deleteDetailUrl:basePath+'document/customer/deletecontact/',
         columns : [
             {
                 text : "ID", 
@@ -240,7 +240,7 @@ Ext.define('saas.view.document.customer.FormPanel', {
         xtype : "detailGridField", 
         detnoColumn:  'ca_detno',
         storeModel:'saas.model.document.customeraddress',
-        deleteDetailUrl:basePath+'ducument/customer/deleteaddress/',
+        deleteDetailUrl:basePath+'document/customer/deleteaddress/',
         columns : [
             {
                 text : "ID", 

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

@@ -168,7 +168,6 @@ Ext.define('saas.view.document.kind.Kind', {
                     tooltip: '锁定',
                     iconCls:'',
                     getClass: function(v, meta, rec) {
-                        debugger
                         if(rec.get('wh_statuscode')=='OPEN'){
                             this.items[0].tooltip = '不启用';
                             return 'x-grid-checkcolumn-checked';

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

@@ -102,7 +102,7 @@ Ext.define('saas.view.document.kind.KindModel', {
                 },
                 reader: {
                     type: 'json',
-                    rootProperty: 'data'
+                    rootProperty: 'data.list'
                 }
             },
             pageSize: null,

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

@@ -2,5 +2,16 @@ Ext.define('saas.view.document.product.FormModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.document-product-formpanel',
 
-    
+    data: {
+        id: 0
+    },
+
+    formulas:{
+        showAuditBtn:{
+            bind:'{id}',
+            get:function(value){
+                return value;
+            }
+        }
+    }
 });

+ 6 - 6
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -85,7 +85,7 @@ Ext.define('saas.view.document.product.FormPanel', {
         }
     },{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/product/getProdUnit',
+        storeUrl:basePath+'document/product/getProdUnit',
         name : "pr_unit", 
         bind : "{pr_unit}", 
         fieldLabel : "物料单位", 
@@ -98,8 +98,8 @@ Ext.define('saas.view.document.product.FormPanel', {
             produnit:{
                 keyField:'id',
                 dataField:'vk_name',
-                reqUrl:basePath+'ducument/produnit/save',
-                delUrl:basePath+'ducument/produnit/delete'
+                reqUrl:basePath+'document/produnit/save',
+                delUrl:basePath+'document/produnit/delete'
             }
         },
         addHandler:function(b){
@@ -119,7 +119,7 @@ Ext.define('saas.view.document.product.FormPanel', {
         }
     },{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/product/getProdBrand',
+        storeUrl:basePath+'document/product/getProdBrand',
         name : "pr_brand", 
         bind : "{pr_brand}", 
         fieldLabel : "物料品牌", 
@@ -132,8 +132,8 @@ Ext.define('saas.view.document.product.FormPanel', {
             productbrand:{
                 keyField:'id',
                 dataField:'pb_name',
-                reqUrl:basePath+'ducument/productbrand/save',
-                delUrl:basePath+'ducument/productbrand/delete'
+                reqUrl:basePath+'document/productbrand/save',
+                delUrl:basePath+'document/productbrand/delete'
             }
         },
         addHandler:function(b){

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

@@ -6,7 +6,7 @@ Ext.define('saas.view.document.vendor.BasePanel', {
 
     searchField:[{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/vendorkind/getCombo',
+        storeUrl:basePath+'document/vendorkind/getCombo',
         name : "ve_type", 
         emptyText : "请选择供应商类型", 
         allowBlank : true, 
@@ -18,8 +18,8 @@ Ext.define('saas.view.document.vendor.BasePanel', {
             vendorkind:{
                 keyField:'id',
                 dataField:'vk_name',
-                reqUrl:basePath+'ducument/vendorkind/save',
-                delUrl:basePath+'ducument/vendorkind/delete'
+                reqUrl:basePath+'document/vendorkind/save',
+                delUrl:basePath+'document/vendorkind/delete'
             }
         },
         addHandler:function(b){
@@ -43,15 +43,15 @@ Ext.define('saas.view.document.vendor.BasePanel', {
     _formXtype:'document-vendor-formpanel',
     _title:'供应商资料',
     // _dataUrl:basePath+'ducument/vendor/list',
-    _deleteUrl:basePath+'ducument/vendor/delete/',
-    _batchOpenUrl:basePath+'ducument/vendor/batchOpen',
-    _batchCloseUrl:basePath+'ducument/vendor/batchClose',
-    _batchDeleteUrl:basePath+'ducument/vendor/batchDelete',
+    _deleteUrl:basePath+'document/vendor/delete/',
+    _batchOpenUrl:basePath+'document/vendor/batchOpen',
+    _batchCloseUrl:basePath+'document/vendor/batchClose',
+    _batchDeleteUrl:basePath+'document/vendor/batchDelete',
 
     gridConfig: {
         idField: 'id',
         codeField: 've_code',
-        dataUrl: basePath+'ducument/vendor/list',
+        dataUrl: basePath+'document/vendor/list',
         columns : [{
             text : "供应商id", 
             width : 0, 

+ 12 - 1
frontend/saas-web/app/view/document/vendor/FormModel.js

@@ -2,5 +2,16 @@ Ext.define('saas.view.document.vendor.FormModel', {
     extend: 'saas.view.core.form.FormPanelModel',
     alias: 'viewmodel.document-vendor-formpanel',
 
-    
+    data: {
+        id: 0
+    },
+
+    formulas:{
+        showAuditBtn:{
+            bind:'{id}',
+            get:function(value){
+                return value;
+            }
+        }
+    }
 });

+ 9 - 9
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -13,11 +13,11 @@ Ext.define('saas.view.document.vendor.FormPanel', {
     _codeField: 've_code',
     _statusField: 've_status',
     _statusCodeField: 've_statuscode',
-    _readUrl:basePath+'ducument/vendor/read/',
-    _saveUrl:basePath+'ducument/vendor/save',
-    _openUrl:basePath+'ducument/vendor/open',
-    _closeUrl:basePath+'ducument/vendor/close',
-    _deleteUrl:basePath+'ducument/vendor/delete/',
+    _readUrl:basePath+'document/vendor/read/',
+    _saveUrl:basePath+'document/vendor/save',
+    _openUrl:basePath+'document/vendor/open',
+    _closeUrl:basePath+'document/vendor/close',
+    _deleteUrl:basePath+'document/vendor/delete/',
     initId:0,
 
     defaultItems: [{
@@ -52,7 +52,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         columnWidth: 0.25
     },{
         xtype : "remotecombo", 
-        storeUrl:basePath+'ducument/vendorkind/getCombo',
+        storeUrl:basePath+'document/vendorkind/getCombo',
         name : "ve_type", 
         fieldLabel : "供应商类型", 
         allowBlank : true, 
@@ -64,8 +64,8 @@ Ext.define('saas.view.document.vendor.FormPanel', {
             vendorkind:{
                 keyField:'id',
                 dataField:'vk_name',
-                reqUrl:basePath+'ducument/vendorkind/save',
-                delUrl:basePath+'ducument/vendorkind/delete'
+                reqUrl:basePath+'document/vendorkind/save',
+                delUrl:basePath+'document/vendorkind/delete'
             }
         },
         addHandler:function(b){
@@ -149,7 +149,7 @@ Ext.define('saas.view.document.vendor.FormPanel', {
         xtype : "detailGridField", 
         detnoColumn:  'vc_detno',
         storeModel:'saas.model.document.vendorcontact',
-        _deleteDetailUrl:basePath+'ducument/vendor/deleteContact/',
+        deleteDetailUrl:basePath+'document/vendor/deleteContact/',
         columns : [
             {
                 text : "ID", 

+ 3 - 3
frontend/saas-web/app/view/money/othreceipts/FormPanel.js

@@ -78,7 +78,7 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                 items : null,
                 editor : {
                     xtype : "remotecombo", 
-                    storeUrl:basePath+'ducument/fundinoutType/list',
+                    storeUrl:basePath+'document/fundinoutType/list',
                     name : "ord_type", 
                     fieldLabel : "收入类别", 
                     allowBlank : true, 
@@ -90,8 +90,8 @@ Ext.define('saas.view.money.othreceipts.FormPanel', {
                         inoutkind:{
                             keyField:'id',
                             dataField:'ft_name',
-                            reqUrl:basePath+'ducument/fundinoutType/save',
-                            delUrl:basePath+'ducument/fundinoutType/delete'
+                            reqUrl:basePath+'document/fundinoutType/save',
+                            delUrl:basePath+'document/fundinoutType/delete'
                         }
                     },
                     addHandler:function(b){

+ 3 - 3
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -78,7 +78,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                 items : null,
                 editor : {
                     xtype : "remotecombo", 
-                    storeUrl:basePath+'ducument/fundinoutType/list',
+                    storeUrl:basePath+'document/fundinoutType/list',
                     name : "osd_type", 
                     fieldLabel : "支出类别", 
                     allowBlank : true, 
@@ -90,8 +90,8 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                         inoutkind:{
                             keyField:'id',
                             dataField:'ft_name',
-                            reqUrl:basePath+'ducument/fundinoutType/save',
-                            delUrl:basePath+'ducument/fundinoutType/delete'
+                            reqUrl:basePath+'document/fundinoutType/save',
+                            delUrl:basePath+'document/fundinoutType/delete'
                         }
                     },
                     addHandler:function(b){

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

@@ -47,13 +47,6 @@ Ext.define('saas.view.purchase.purchaseIn.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
-    }, {
-        xtype : "textfield", 
-        name : "pi_inoutno", 
-        bind : "{pi_inoutno}", 
-        fieldLabel : "验收单号", 
-        allowBlank : true, 
-        columnWidth : 0.25
     },{
         xtype : "textfield", 
         name : "pi_class", 

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

@@ -41,13 +41,6 @@ Ext.define('saas.view.purchase.purchaseOut.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
-    }, {
-        xtype : "textfield", 
-        name : "pi_inoutno", 
-        bind : "{pi_inoutno}", 
-        fieldLabel : "验收单号", 
-        allowBlank : true, 
-        columnWidth : 0.25
     },{
         xtype : "textfield", 
         name : "pi_class", 

+ 0 - 7
frontend/saas-web/app/view/stock/appropriationInOut/FormPanel.js

@@ -42,13 +42,6 @@ Ext.define('saas.view.stock.appropriationInOut.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
-    }, {
-        xtype : "textfield", 
-        name : "pi_inoutno", 
-        bind : "{pi_inoutno}", 
-        fieldLabel : "入库单号", 
-        allowBlank : true, 
-        columnWidth : 0.25
     },{
         xtype : "textfield", 
         name : "pi_class", 

+ 0 - 7
frontend/saas-web/app/view/stock/otherIn/FormPanel.js

@@ -41,13 +41,6 @@ Ext.define('saas.view.stock.otherIn.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
-    }, {
-        xtype : "textfield", 
-        name : "pi_inoutno", 
-        bind : "{pi_inoutno}", 
-        fieldLabel : "入库单号", 
-        allowBlank : true, 
-        columnWidth : 0.25
     },{
         xtype : "textfield", 
         name : "pi_class", 

+ 0 - 7
frontend/saas-web/app/view/stock/otherOut/FormPanel.js

@@ -39,13 +39,6 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
         fieldLabel: 'id',
         allowBlank: true,
         columnWidth: 0
-    }, {
-        xtype: "textfield",
-        name: "pi_inoutno",
-        bind: "{pi_inoutno}",
-        fieldLabel: "出库单号",
-        allowBlank: true,
-        columnWidth: 0.25
     }, {
         xtype: "textfield",
         name: "pi_class",