Browse Source

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

zhuth 7 years ago
parent
commit
467a8b0d78
23 changed files with 529 additions and 159 deletions
  1. 7 5
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Status.java
  2. 1 12
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  3. 1 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/BankinformationController.java
  4. 29 5
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java
  5. 6 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerService.java
  6. 48 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  7. 7 7
      applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml
  8. 1 1
      applications/document/document-server/src/main/resources/mapper/CustomeraddressMapper.xml
  9. 1 1
      applications/document/document-server/src/main/resources/mapper/CustomercontactMapper.xml
  10. 8 0
      applications/money/money-server/pom.xml
  11. 4 4
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/ProdInOutController.java
  12. 1 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java
  13. 17 17
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java
  14. 4 11
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/SaleApplication.java
  15. 3 2
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java
  16. 4 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutMapper.java
  17. 56 10
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ProdInOutService.java
  18. 123 73
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/ProdInOutServiceImpl.java
  19. 3 1
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml
  20. 14 1
      applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml
  21. 8 2
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOut.java
  22. 177 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutExample.java
  23. 6 0
      applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java

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

@@ -11,6 +11,12 @@ public enum Status {
      */
     CLOSE("已关闭"),
 
+    /**
+     * 已开启
+     */
+    OPEN("已开启"),
+
+
     /**
      * 已审核
      */
@@ -44,12 +50,8 @@ public enum Status {
     /**
      * 未出库
      */
-    UNTURNOUT("未出库"),
+    UNTURNOUT("未出库");
 
-    /**
-     * 开启
-     */
-    OPEN("开启")
 
     ;
     private String display;

+ 1 - 12
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,19 +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);
     }
 
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-        registry.addMapping("/**")
-                .allowCredentials(true)
-                .allowedHeaders("*")
-                .allowedOrigins("*")
-                .allowedMethods("*");
-    }
-
 }

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

@@ -13,7 +13,7 @@ import java.util.List;
  * @date 2018/10/25 15:33
  **/
 @RestController
-@RequestMapping("/Bankinformation")
+@RequestMapping("/bankinformation")
 public class BankinformationController {
     @Autowired
     BankinformationService bankinformationService;

+ 29 - 5
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/CustomerController.java

@@ -66,12 +66,36 @@ public class CustomerController {
      * @param id
      * @return
      */
-    @GetMapping("/delete/{id}")
+    @PostMapping("/delete/{id}")
     public Result delete(@PathVariable("id") Long id) {
         customerService.delete(id);
         return Result.success();
     }
 
+    /**
+     * 客户联系人删除
+     *
+     * @param id
+     * @return
+     */
+    @PostMapping("/deletecontact/{id}")
+    public Result deletecontact(@PathVariable("id") Long id) {
+        customerService.deletecontact(id);
+        return Result.success();
+    }
+
+    /**
+     * 客户地址删除
+     *
+     * @param id
+     * @return
+     */
+    @PostMapping("/deleteaddress/{id}")
+    public Result deleteaddress(@PathVariable("id") Long id) {
+        customerService.deleteaddress(id);
+        return Result.success();
+    }
+
     /**
      * 采购订单批量删除
      *
@@ -92,8 +116,8 @@ public class CustomerController {
      */
     @PostMapping("/close/{id}")
     public Result close(@PathVariable(value = "id") long id){
-        customerService.close(id);
-        return Result.success();
+        DocBaseDTO close = customerService.close(id);
+        return Result.success(close);
     }
 
     /**
@@ -104,8 +128,8 @@ public class CustomerController {
      */
     @PostMapping("/open/{id}")
     public Result open(@PathVariable(value = "id") long id){
-        customerService.open(id);
-        return Result.success();
+        DocBaseDTO open = customerService.open(id);
+        return Result.success(open);
     }
 
 

+ 6 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/CustomerService.java

@@ -24,9 +24,13 @@ public interface CustomerService extends CommonBaseService<CustomerMapper, Custo
 
     void delete(Long id);
 
-    void close(long id);
+    DocBaseDTO close(long id);
 
-    void open(long id);
+    DocBaseDTO open(long id);
 
     void batchDelete(BatchDealBaseDTO baseDTOs);
+
+    void deletecontact(Long id);
+
+    void deleteaddress(Long id);
 }

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

@@ -6,6 +6,8 @@ import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 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.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.dto.CustomerDTO;
 import com.usoftchina.saas.document.dto.CustomerFormDTO;
@@ -238,13 +240,53 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
     }
 
     @Override
-    public void close(long id) {
+    public void deletecontact(Long id) {
+        customercontactMapper.deleteByPrimaryKey(id);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+//        messageLogService.deleteDetail(docBaseDTO);
+    }
 
+    @Override
+    public void deleteaddress(Long id) {
+        customeraddressMapper.deleteByPrimaryKey(id);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+//        messageLogService.deleteDetail(docBaseDTO);
     }
 
     @Override
-    public void open(long id) {
+    public DocBaseDTO close(long id) {
+        Customer customer = getMapper().selectByPrimaryKey(id);
+        if(Status.CLOSE.name().equals(customer.getCu_statuscode())){
+            throw new BizException(BizExceptionCode.BIZ_CLOSE);
+        }
+        customer = new Customer();
+        customer.setId(id);
+        customer.setCu_statuscode(Status.CLOSE.name());
+        customer.setCu_status(Status.CLOSE.getDisplay());
+        getMapper().updateByPrimaryKeySelective(customer);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+//        messageLogService.close(docBaseDTO);
+        return docBaseDTO;
+    }
 
+    @Override
+    public DocBaseDTO open(long id) {
+        Customer customer = getMapper().selectByPrimaryKey(id);
+        if(Status.OPEN.name().equals(customer.getCu_statuscode())){
+            throw new BizException(BizExceptionCode.BIZ_OPEN);
+        }
+        customer = new Customer();
+        customer.setId(id);
+        customer.setCu_statuscode(Status.OPEN.name());
+        customer.setCu_status(Status.OPEN.getDisplay());
+        getMapper().updateByPrimaryKeySelective(customer);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+//        messageLogService.close(docBaseDTO);
+        return docBaseDTO;
     }
 
     private List<CustomerList> getListByMode(ListReqDTO req) {
@@ -278,4 +320,8 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         return baseDTO;
     }
 
+
+
+
+
 }

+ 7 - 7
applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -1,7 +1,7 @@
 <?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.document.mapper.BankinformationMapper" >
-  <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.po.Bankinformation" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Bankinformation" >
     <id column="bk_id" property="bkId" jdbcType="INTEGER" />
     <result column="bk_bankcode" property="bkBankcode" jdbcType="VARCHAR" />
     <result column="bk_bankname" property="bkBankname" jdbcType="VARCHAR" />
@@ -24,7 +24,7 @@
     <result column="bk_text4" property="bkText4" jdbcType="VARCHAR" />
     <result column="bk_text5" property="bkText5" jdbcType="VARCHAR" />
   </resultMap>
-  <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.po.Bankinformation" extends="BaseResultMap" >
+  <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Bankinformation" extends="BaseResultMap" >
     <result column="bk_remark" property="bkRemark" jdbcType="LONGVARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
@@ -47,7 +47,7 @@
     delete from bankinformation
     where bk_id = #{bkId,jdbcType=INTEGER}
   </delete>
-  <insert id="insert" parameterType="com.usoftchina.saas.document.po.Bankinformation" >
+  <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
     insert into bankinformation (bk_id, bk_bankcode, bk_bankname, 
       bk_date, bk_type, bk_beginamount, 
       bk_thisamount, bk_status, bk_statuscode, 
@@ -65,7 +65,7 @@
       #{bkText3,jdbcType=VARCHAR}, #{bkText4,jdbcType=VARCHAR}, #{bkText5,jdbcType=VARCHAR}, 
       #{bkRemark,jdbcType=LONGVARCHAR})
   </insert>
-  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.po.Bankinformation" >
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
     insert into bankinformation
     <trim prefix="(" suffix=")" suffixOverrides="," >
       <if test="bkId != null" >
@@ -204,7 +204,7 @@
       </if>
     </trim>
   </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.po.Bankinformation" >
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
     update bankinformation
     <set >
       <if test="bkBankcode != null" >
@@ -273,7 +273,7 @@
     </set>
     where bk_id = #{bkId,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.po.Bankinformation" >
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
     update bankinformation
     set bk_bankcode = #{bkBankcode,jdbcType=VARCHAR},
       bk_bankname = #{bkBankname,jdbcType=VARCHAR},
@@ -298,7 +298,7 @@
       bk_remark = #{bkRemark,jdbcType=LONGVARCHAR}
     where bk_id = #{bkId,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.po.Bankinformation" >
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Bankinformation" >
     update bankinformation
     set bk_bankcode = #{bkBankcode,jdbcType=VARCHAR},
       bk_bankname = #{bkBankname,jdbcType=VARCHAR},

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/CustomeraddressMapper.xml

@@ -33,7 +33,7 @@
     from customeraddress
     where ca_id = #{ca_id,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from customeraddress
     where ca_id = #{ca_id,jdbcType=INTEGER}
   </delete>

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/CustomercontactMapper.xml

@@ -29,7 +29,7 @@
     from customercontact
     where cc_id = #{cc_id,jdbcType=INTEGER}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from customercontact
     where cc_id = #{cc_id,jdbcType=INTEGER}
   </delete>

+ 8 - 0
applications/money/money-server/pom.xml

@@ -21,6 +21,14 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>auth-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>server-starter</artifactId>
+        </dependency>
 
         <!-- db -->
         <dependency>

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

@@ -3,7 +3,7 @@ package com.usoftchina.saas.purchase.controller;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutReqDTO;
@@ -56,8 +56,8 @@ public class ProdInOutController {
      * @return
      */
     @PostMapping("/save")
-    public Result<DocSavedDTO> saveFormData(@RequestBody ProdInOutFormDTO data) {
-        DocSavedDTO savedDTO = prodInOutService.saveFormData(data,false);
+    public Result<DocBaseDTO> saveFormData(@RequestBody ProdInOutFormDTO data) {
+        DocBaseDTO savedDTO = prodInOutService.saveFormData(data);
         return Result.success(savedDTO);
     }
 
@@ -94,7 +94,7 @@ public class ProdInOutController {
      */
     @PostMapping("/audit")
     public Result audit(@RequestBody ProdInOutFormDTO formData) {
-        DocSavedDTO audit = prodInOutService.audit(formData);
+        DocBaseDTO audit = prodInOutService.audit(formData);
         return Result.success(audit);
     }
 

+ 1 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/ProdInOutService.java

@@ -5,7 +5,6 @@ import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutReqDTO;
@@ -46,7 +45,7 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      * @param formData
      * @return
      */
-    DocSavedDTO audit(ProdInOutFormDTO formData);
+    DocBaseDTO audit(ProdInOutFormDTO formData);
 
     /**
      * 反审核出入库单

+ 17 - 17
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/ProdInOutServiceImpl.java

@@ -7,7 +7,6 @@ import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.api.WarehouseApi;
@@ -19,7 +18,9 @@ import com.usoftchina.saas.purchase.dto.ProdInOutDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutFormDTO;
 import com.usoftchina.saas.purchase.dto.ProdInOutReqDTO;
 import com.usoftchina.saas.purchase.mapper.*;
-import com.usoftchina.saas.purchase.po.*;
+import com.usoftchina.saas.purchase.po.ProdIODetail;
+import com.usoftchina.saas.purchase.po.ProdInOut;
+import com.usoftchina.saas.purchase.po.ProdInOutList;
 import com.usoftchina.saas.purchase.service.ProdInOutService;
 import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -96,7 +97,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     }
 
     @Override
-    public DocSavedDTO saveFormData(ProdInOutFormDTO formdata,Boolean isbfaudit) {
+    public DocBaseDTO saveFormData(ProdInOutFormDTO formdata) {
         if (null == formdata || null == formdata.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
         }
@@ -111,7 +112,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         List<ProdIODetail> insertDetails = new ArrayList<>();
         //更新从表数据
         List<ProdIODetail> updateDetails = new ArrayList<>();
-        DocSavedDTO saveDTO = new DocSavedDTO();
+        DocBaseDTO baseDTO = new DocBaseDTO();
         Long pi_id = main.getId();
         String pi_inoutno = main.getPi_inoutno();
         ProdInOut prodInOut = BeanMapper.map(main,ProdInOut.class);
@@ -124,7 +125,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //编号获取
         pi_inoutno = pushMaxnubmer(pi_inoutno, pi_id);
         prodInOut.setPi_inoutno(pi_inoutno);
-        saveDTO.setCode(pi_inoutno);
+        baseDTO.setCode(pi_inoutno);
         //判断更新与保存动作
         if (StringUtils.isEmpty(pi_id) || "0".equals(pi_id.toString())){
             //插入操作
@@ -143,8 +144,8 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             if (insertDetails.size()>0) {
                 prodIODetailMapper.batchInsert(insertDetails);
             }
-            saveDTO.setId(pi_id);
-            return saveDTO;
+            baseDTO.setId(pi_id);
+            return baseDTO;
         }
         //更新操作
         getMapper().updateByPrimaryKeySelective(prodInOut);
@@ -168,11 +169,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (updateDetails.size()>0) {
             prodIODetailMapper.batchUpdate(updateDetails);
         }
-        saveDTO.setId(pi_id);
+        baseDTO.setId(pi_id);
         //更新已转数
-        if (!isbfaudit)
-            updateYqty(prodInOut);
-        return saveDTO;
+        updateYqty(prodInOut);
+        return baseDTO;
     }
 
     @Override
@@ -195,19 +195,19 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
 
 
     @Override
-    public DocSavedDTO audit(ProdInOutFormDTO formData) {
+    public DocBaseDTO audit(ProdInOutFormDTO formData) {
         Long id = null;
-        DocSavedDTO savedDTO = new DocSavedDTO();
+        DocBaseDTO baseDTO = new DocBaseDTO();
         if (null != formData) {
             id = formData.getMain().getId();
             if (StringUtils.isEmpty(id)) {
-                DocSavedDTO saveDTO = saveFormData(formData,true);
-                id = saveDTO.getId();
+                baseDTO = saveFormData(formData);
+                id = baseDTO.getId();
             }
             singleAudit(formData.getMain());
         }
-        savedDTO.setId(id);
-        return savedDTO;
+        baseDTO.setId(id);
+        return baseDTO;
     }
 
     @Override

+ 4 - 11
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/SaleApplication.java

@@ -4,8 +4,8 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
 
 /**
  * @author: guq
@@ -14,16 +14,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 @SpringBootApplication
 @MapperScan("com.usoftchina.saas.sale.mapper")
 @EnableEurekaClient
-public class SaleApplication extends WebMvcConfigurerAdapter{
+@EnableFeignClients("com.usoftchina.saas")
+public class SaleApplication{
     public static void main(String[] args) {
         SpringApplication.run(SaleApplication.class, args);
     }
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-        registry.addMapping("/**")
-                .allowCredentials(true)
-                .allowedHeaders("*")
-                .allowedOrigins("*")
-                .allowedMethods("*");
-    }
 }

+ 3 - 2
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/ProdInOutController.java

@@ -3,6 +3,7 @@ package com.usoftchina.saas.sale.controller;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.dto.ListReqDTO;
 import com.usoftchina.saas.page.PageRequest;
@@ -59,7 +60,7 @@ public class ProdInOutController {
      */
     @PostMapping("/save")
     public Result<DocSavedDTO> saveFormData(@RequestBody ProdInOutFormDTO data) {
-        DocSavedDTO savedDTO = prodInOutService.saveFormData(data,false);
+        DocBaseDTO savedDTO = prodInOutService.saveFormData(data);
         return Result.success(savedDTO);
     }
 
@@ -96,7 +97,7 @@ public class ProdInOutController {
      */
     @PostMapping("/audit")
     public Result audit(@RequestBody ProdInOutFormDTO formData) {
-        DocSavedDTO audit = prodInOutService.audit(formData);
+        DocBaseDTO audit = prodInOutService.audit(formData);
         return Result.success(audit);
     }
 

+ 4 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/ProdInOutMapper.java

@@ -50,4 +50,8 @@ public interface ProdInOutMapper extends CommonBaseMapper<ProdInOut> {
     String validateAudit(List<DocBaseDTO> baseDTOs);
 
     String validateBatchUnAudit(List<DocBaseDTO> baseDTOs);
+
+    String validateBatchClose(List<DocBaseDTO> baseDTOs);
+
+    String validateBatchOpen(List<DocBaseDTO> baseDTOs);
 }

+ 56 - 10
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/ProdInOutService.java

@@ -22,7 +22,6 @@ import com.usoftchina.saas.storage.po.ProdInOutList;
  */
 public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, ProdInOut>  {
 
-
     /**
      * 获取出入单表单
      *
@@ -45,6 +44,19 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      */
     void delete(Long id);
 
+    /**
+     * 批量删除出入库单
+     * @param baseDTOs
+     */
+    void batchDelete(BatchDealBaseDTO baseDTOs);
+
+    /**
+     * 删除明细
+     * @param id
+     * @return
+     */
+    Integer deleteItem(Long id);
+
     /**
      * 审核出入库单
      * @param formData
@@ -52,25 +64,59 @@ public interface ProdInOutService extends CommonBaseService<ProdInOutMapper, Pro
      */
     DocBaseDTO audit(ProdInOutFormDTO formData);
 
+    /**
+     * 批量审核出入库
+     * @param baseDTOs
+     * @return
+     */
+    void batchAudit(BatchDealBaseDTO baseDTOs);
+
     /**
      * 反审核出入库单
      * @param id
      */
     Result unAudit(Long id);
 
-    void batchAudit(BatchDealBaseDTO baseDTOs);
-
-    Integer deleteItem(Long id);
+    /**
+     * 批量反审核出入库单
+     * @param baseDTOs
+     */
+    void batchUnAudit(BatchDealBaseDTO baseDTOs);
 
-    void batchDelete(BatchDealBaseDTO baseDTOs);
+    /**
+     * 启用出入库单
+     * @param id
+     */
+    Result open(Long id);
 
-    PageInfo<ProdInOutList> getListData(PageRequest page, ListReqDTO req);
+    /**
+     * 关闭出入库单
+     * @param
+     */
+    Result close(Long id);
 
-    Result turnProdin(Long id);
+    /**
+     * 批量启用出入库单
+     * @param baseDTOs
+     */
+    void batchOpen(BatchDealBaseDTO baseDTOs);
 
-    void batchUnAudit(BatchDealBaseDTO baseDTOs);
+    /**
+     * 批量关闭出入库单
+     * @param baseDTOs
+     */
+    void batchClose(BatchDealBaseDTO baseDTOs);
 
-    void open(Long id);
+    /**
+     * 获取列表信息
+     * @param page 分页
+     * @param req
+     */
+    PageInfo<ProdInOutList> getListData(PageRequest page, ListReqDTO req);
 
-    void close(Long id);
+    /**
+     * 出库单转退货单
+     * @param id
+     */
+    Result turnProdin(Long id);
 }

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

@@ -12,7 +12,6 @@ import com.usoftchina.saas.commons.dto.DocSavedDTO;
 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.Maxnumbers;
 import com.usoftchina.saas.commons.po.Status;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.api.WarehouseApi;
@@ -22,7 +21,6 @@ import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.sale.dto.ProdIODetailDTO;
 import com.usoftchina.saas.sale.dto.ProdInOutDTO;
 import com.usoftchina.saas.sale.dto.ProdInOutFormDTO;
-import com.usoftchina.saas.sale.dto.ProdInOutReqDTO;
 import com.usoftchina.saas.sale.mapper.*;
 import com.usoftchina.saas.sale.service.ProdInOutService;
 import com.usoftchina.saas.storage.po.ProdIODetail;
@@ -56,7 +54,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     public ProdInOutFormDTO getFormData(Long id) {
         ProdInOutFormDTO prodInOutFormDTO = new ProdInOutFormDTO();
         //查询主表
-        ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
+        ProdInOut prodInOut = checkAndReturnOrder(id);
         //将prodInOut实体对象转化为传输对象
         ProdInOutDTO main = BeanMapper.map(prodInOut,ProdInOutDTO.class);
         //查询从表
@@ -166,7 +164,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         singleDelete(id);
     }
     private void singleDelete(Long id) {
-        ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
+        ProdInOut prodInOut = checkAndReturnOrder(id);
         //从表删除
         prodIODetailMapper.deleteByForeignKey(id);
         //主表删除
@@ -175,8 +173,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //更新已转数
         updateYqty(prodInOut);
         //日志
-        messageLogService.deleteDetail(docBaseDTO);
+       messageLogService.deleteDetail(docBaseDTO);
     }
+
     @Override
     @Transactional
     public DocBaseDTO audit(ProdInOutFormDTO formData) {
@@ -216,16 +215,14 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             return "";
         }
     }
+
     @Override
     public Result unAudit(Long id) {
-        if (null == id) {
-            return Result.error(BizExceptionCode.SALE_NULL_BILL);
-        }
+        ProdInOut prodInOut = checkAndReturnOrder(id);
         String code = prodInOutMapper.validateUnAudit(id);
-        if (null != code) {
+        if (!prodInOut.getPi_statuscode().equals(Status.AUDITED.name())) {
             throw new BizException(BizExceptionCode.SALE_NULL_BILL);
         }
-        ProdInOut prodInOut = prodInOutMapper.selectByPrimaryKey(id);
         ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut, ProdInOutDTO.class);
         String res =  singleUnAudit(prodInOutDTO);
         if(res!=null){
@@ -247,6 +244,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if(result!=null){
             return result.toString();
         }else{
+            //更新状态为未审核
+            ProdInOut prodInOut = BeanMapper.map(prodInOutDTO, ProdInOut.class);
+            prodInOut.setPi_statuscode(Status.UNAUDITED.name());
+            prodInOut.setPi_status(Status.UNAUDITED.getDisplay());
+            prodInOut.setUpdateTime(new Date());
+            prodInOut.setUpdaterId(BaseContextHolder.getUserId());
+            getMapper().updateByPrimaryKeySelective(prodInOut);
             //记录日志
             DocBaseDTO docBaseDTO = getBaseDTOById(prodInOutDTO.getId(),pi_class);
             //日志
@@ -254,6 +258,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             return "";
         }
     }
+
     @Override
     public void batchAudit(BatchDealBaseDTO baseDTOs) {
         if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
@@ -271,7 +276,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
             error+=singleAudit(prodInOutDTO);
         }
-        if(error!=null&&!error.equals("")){
+        if(!StringUtils.isEmpty(error)){
             new BizException(501,error);
         }
     }
@@ -294,7 +299,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             ProdInOutDTO prodInOutDTO = BeanMapper.map(prodInOut,ProdInOutDTO.class);
             error+=singleUnAudit(prodInOutDTO);
         }
-        if(error!=null&&!error.equals("")){
+        if(!StringUtils.isEmpty(error)){
             new BizException(501,error);
         }
     }
@@ -302,15 +307,16 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
     @Override
     public Integer deleteItem(Long id) {
         ProdIODetail prodIODetail = prodIODetailMapper.selectByPrimaryKey(id);
-        ProdInOut prodInOut = prodInOutMapper.selectByPrimaryKey(prodIODetail.getPd_piid());
+        ProdInOut prodInOut = checkAndReturnOrder(prodIODetail.getPd_piid());
         Integer num = prodIODetailMapper.deleteByPrimaryKey(id);
         //更新已转数
         updateYqty(prodInOut);
         DocBaseDTO docBaseDTO = getBaseDTOById(id,prodInOut.getPi_class());
         //日志
-        messageLogService.deleteDetail(docBaseDTO);
+       messageLogService.deleteDetail(docBaseDTO);
         return num;
     }
+
     @Override
     public void batchDelete(BatchDealBaseDTO baseDTOs) {
         if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
@@ -337,6 +343,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         PageInfo<ProdInOutList> pageInfo = new PageInfo<ProdInOutList>(lists);
         return pageInfo;
     }
+
     private List<ProdInOutList> getListByMode(ListReqDTO req) {
         List<ProdInOutList> list = null;
         Long companyId = BaseContextHolder.getCompanyId();
@@ -351,12 +358,13 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         }
         return list;
     }
+
     @Override
     public Result turnProdin(Long id) {
         Integer count=0;
         double pdOutqty=0;
         double pdYqty=0;
-        ProdInOut sourcePi = prodInOutMapper.selectByPrimaryKey(id);
+        ProdInOut sourcePi = checkAndReturnOrder(id);
         List<ProdIODetail> sourceDetails =prodIODetailMapper.selectByFK(id);
         if (null == sourcePi || StringUtils.isEmpty(sourcePi.getPi_inoutno()) || sourceDetails.size() == 0) {
             throw new BizException(BizExceptionCode.SALE_NULL_BILL);
@@ -383,7 +391,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         //插入销售退货单主表
         ProdInOut targetPi = new ProdInOut();
         //生成单号
-        String piInoutno =  maxnumberService.getMaxnumber(BillCodeSeq.SALEIN.getCaller(),true).getData();
+        String piInoutno =
+                //BillCodeSeq.SALEIN.getCaller() + Math.abs(Math.random()*100);
+                maxnumberService.getMaxnumber(BillCodeSeq.SALEIN.getCaller(),true).getData();
         targetPi.setPi_inoutno(piInoutno);
         targetPi.setPi_class(BillCodeSeq.SALEIN.getName());
         targetPi.setPi_date(new Date());
@@ -442,81 +452,96 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
 
     @Override
     @Transactional
-    public void close(Long id) {
-        if(id == null || id <= 0) {
-            throw new BizException(BizExceptionCode.ILLEGAL_ID);
-        }
-        ProdInOut prodInOut =  prodInOutMapper.selectByPrimaryKey(id);
-        if(prodInOut==null){
-            throw new BizException(BizExceptionCode.NO_DATA);
+    public Result close(Long id) {
+        String res = singleClose(id);
+        if(StringUtils.hasText(res)){
+            return Result.error(res);
+        }else{
+            return Result.success();
         }
+    }
+
+    private String singleClose(Long id){
+        ProdInOut prodInOut = checkAndReturnOrder(id);
+        //状态校验
         if(Status.CLOSE.name().equals(prodInOut.getPi_status())){
-            throw new BizException(BizExceptionCode.BIZ_CLOSE);
+            return BizExceptionCode.BIZ_CLOSE.getMessage();
         }
+        //更新状态
         prodInOut.setPi_status(Status.CLOSE.getDisplay());
         prodInOut.setPi_statuscode(Status.CLOSE.name());
 
         prodInOutMapper.updateByPrimaryKeySelective(prodInOut);
-        DocBaseDTO docBaseDTO = getBaseDTOById(id,prodInOut.getPi_class());
-        //日志
-        messageLogService.close(docBaseDTO);
+        //记录日志
+        DocBaseDTO docBaseDTO = getBaseDTOById(prodInOut.getId(),prodInOut.getPi_class());
+       messageLogService.close(docBaseDTO);
+        return "";
     }
 
     @Override
-    @Transactional
-    public void open(Long id){
-        ProdInOut prodInOut = prodInOutMapper.selectByPrimaryKey(id);
-        if(prodInOut==null){
-            throw new BizException(BizExceptionCode.NO_DATA);
+    public  void batchClose(BatchDealBaseDTO baseDTOs){
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
         }
-        List<ProdIODetail> prodIODetailList = prodIODetailMapper.selectByFK(id);
-        //部分入库、全部入库
-        int partTurnCount = 0,turnCount = 0;
-        Double yqty=0.0,qty=0.0;
-        Boolean isIn = false;
-        if(BillCodeSeq.SALEIN.getName().equals(prodInOut.getPi_class())){
-            isIn=true;
-        }
-        if(prodIODetailList!=null&&prodIODetailList.size()>0){
-            for (ProdIODetail prodiodetail :prodIODetailList){
-                yqty = prodiodetail.getPd_yqty() ==null?0.0:prodiodetail.getPd_yqty();
-                if(isIn){
-                    qty = prodiodetail.getPd_inqty() ==null?0.0:prodiodetail.getPd_yqty();
-                }else{
-                    qty = prodiodetail.getPd_outqty() ==null?0.0:prodiodetail.getPd_outqty();
-                }
-                if(yqty >= qty){
-                    turnCount++;
-                }else if(yqty>0&&yqty<qty){
-                    partTurnCount++;
-                }
-            }
+        String validate = prodInOutMapper.validateBatchClose(baseDTOs.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)) {
+            throw new BizException(503, "存在非已审核单据,单据编号:" + validate);
         }
-        if(partTurnCount>0){
-            if(isIn){
-                prodInOut.setPi_status(Status.PART2IN.getDisplay());
-                prodInOut.setPi_statuscode(Status.PART2IN.name());
-            }else {
-                prodInOut.setPi_status(Status.PARTOUT.getDisplay());
-                prodInOut.setPi_statuscode(Status.PARTOUT.name());
-            }
-        }else if(turnCount == prodIODetailList.size()){
-            if(isIn){
-                prodInOut.setPi_status(Status.TURNIN.getDisplay());
-                prodInOut.setPi_statuscode(Status.TURNIN.name());
-            }else {
-                prodInOut.setPi_status(Status.TURNOUT.getDisplay());
-                prodInOut.setPi_statuscode(Status.TURNOUT.name());
-            }
+        String error = null;
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            error+=singleClose(base.getId());
+        }
+        if(!StringUtils.isEmpty(error)){
+            new BizException(501,error);
+        }
+    }
+
+    @Override
+    @Transactional
+    public Result open(Long id){
+        String res = singleOpen(id);
+        if(StringUtils.hasText(res)){
+            return Result.error(res);
         }else{
-            prodInOut.setPi_status(Status.AUDITED.getDisplay());
-            prodInOut.setPi_statuscode(Status.AUDITED.getDisplay());
+            return Result.success();
         }
+    }
+
+    private String singleOpen(Long id){
+        ProdInOut prodInOut = checkAndReturnOrder(id);
+        String pi_statuscode = prodInOut.getPi_statuscode();
+        if(!StringUtils.isEmpty(pi_statuscode)&&!pi_statuscode.equals(Status.CLOSE.getDisplay())){
+            return BizExceptionCode.BIZ_OPEN.getMessage();
+        };
+        prodInOut.setPi_status(Status.AUDITED.getDisplay());
+        prodInOut.setPi_statuscode(Status.AUDITED.getDisplay());
         prodInOutMapper.updateByPrimaryKeySelective(prodInOut);
-        DocBaseDTO docBaseDTO = getBaseDTOById(id,prodInOut.getPi_class());
         //记录日志
+        DocBaseDTO docBaseDTO = getBaseDTOById(prodInOut.getId(),prodInOut.getPi_class());
         messageLogService.open(docBaseDTO);
+        return "";
     }
+
+    @Override
+    public void batchOpen(BatchDealBaseDTO baseDTOs){
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        String validate = prodInOutMapper.validateBatchOpen(baseDTOs.getBaseDTOs());
+        if (!StringUtils.isEmpty(validate)) {
+            throw new BizException(503, "存在非已关闭单据,单据编号:" + validate);
+        }
+        String error = null;
+        for (DocBaseDTO base : baseDTOs.getBaseDTOs()) {
+            error+=singleOpen(base.getId());
+        }
+        if(!StringUtils.isEmpty(error)){
+            new BizException(501,error);
+        }
+    }
+
     /**
      * @Description: 检验获取并更新单号
      * @Param: [code, id]
@@ -528,6 +553,10 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         if (null == code) {
             throw new BizException(BizExceptionCode.NULL_CODE);
         }
+        ProdInOut prodInOut = prodInOutMapper.selectByPrimaryKey(id);
+        if(prodInOut==null){
+            throw new BizException(BizExceptionCode.NO_DATA);
+        }
         Integer count = "0".equals(String.valueOf(id)) ? prodInOutMapper.validateCodeWhenInsert(code,pi_class) :
                 prodInOutMapper.validateCodeWhenUpdate(code, id);
         String caller ="";
@@ -537,7 +566,9 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             caller = BillCodeSeq.SALEIN.getCaller();
         }
         return maxnumberService.pushMaxnubmer(count, code, caller).getData();
+        //return  caller+Math.abs(Math.random()*100);
     }
+
     /**
      * @Description: 更新已转数
      * @Param: [code, id]
@@ -573,6 +604,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
         baseDTO.setName(caller);
         return baseDTO;
     }
+
     //更新最新明细总额
     private void getTotal(Long id,String pi_class) {
         if(BillCodeSeq.SALEOUT.getName().equals(pi_class)){
@@ -581,4 +613,22 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             prodIODetailMapper.updatePDSaleIN(id);
         }
     }
+
+    /**
+     * @Description
+     * @Param: [id]
+     * @return: com.usoftchina.saas.commons.dto.DocBaseDTO
+     * @Author: wuyx
+     * @Date: 2018/10/25
+     * */
+    private ProdInOut checkAndReturnOrder (Long id){
+        if(id == null || id <= 0) {
+            throw new BizException(BizExceptionCode.ILLEGAL_ID);
+        }
+        ProdInOut prodInOut = getMapper().selectByPrimaryKey(id);
+        if(prodInOut==null){
+            throw new BizException(BizExceptionCode.NO_DATA);
+        }
+        return prodInOut;
+    }
 }

+ 3 - 1
applications/sale/sale-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -68,7 +68,9 @@
     <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
     <result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
     <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
-
+    <result column="pi_nettotal" jdbcType="DOUBLE" property="pi_nettotal" />
+    <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
+    <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
   </resultMap>
 
 

+ 14 - 1
applications/sale/sale-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -32,7 +32,8 @@
     <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
     <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
     <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
-
+    <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
+    <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
 
 
   </resultMap>
@@ -743,5 +744,17 @@
     </foreach>
   </select>
 
+  <select id="validateBatchClose" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(pi_inoutno) from prodinout where pi_statuscode!='AUDITED' and pi_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
 
+  <select id="validateBatchOpen" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO" resultType="java.lang.String">
+    select GROUP_CONCAT(pi_inoutno) from prodinout where pi_statuscode!='CLOSE' and pi_id in
+    <foreach collection="list" item="item" open="(" close=")" separator=",">
+      #{item.id}
+    </foreach>
+  </select>
 </mapper>

+ 8 - 2
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOut.java

@@ -37,6 +37,8 @@ public class ProdInOut extends CommonBaseEntity implements Serializable {
 
     private Double pi_total;
 
+    private String pi_address;
+
     private Integer pi_recordmanid;
 
     private String pi_recordman;
@@ -61,8 +63,12 @@ public class ProdInOut extends CommonBaseEntity implements Serializable {
 
     private String pi_text5;
 
-    private String pi_address;
-
     private Long pi_inid;
 
+    private Double pi_nettotal;
+
+    private Date pi_auditdate;
+
+    private String pi_auditman;
+
 }

+ 177 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutExample.java

@@ -2085,6 +2085,183 @@ public class ProdInOutExample {
             addCriterion("pi_text5 not between", value1, value2, "pi_text5");
             return (Criteria) this;
         }
+        public Criteria andPi_nettotalIsNull() {
+            addCriterion("Pi_nettotal is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalIsNotNull() {
+            addCriterion("Pi_nettotal is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalEqualTo(Integer value) {
+            addCriterion("Pi_nettotal =", value, "Pi_nettotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalNotEqualTo(Integer value) {
+            addCriterion("Pi_nettotal <>", value, "Pi_nettotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalGreaterThan(Integer value) {
+            addCriterion("Pi_nettotal >", value, "Pi_nettotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalGreaterThanOrEqualTo(Integer value) {
+            addCriterion("Pi_nettotal >=", value, "Pi_nettotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalLessThan(Integer value) {
+            addCriterion("Pi_nettotal <", value, "Pi_nettotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalLessThanOrEqualTo(Integer value) {
+            addCriterion("Pi_nettotal <=", value, "Pi_nettotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalIn(List<Integer> values) {
+            addCriterion("Pi_nettotal in", values, "Pi_nettotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalNotIn(List<Integer> values) {
+            addCriterion("Pi_nettotal not in", values, "Pi_nettotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalBetween(Integer value1, Integer value2) {
+            addCriterion("Pi_nettotal between", value1, value2, "Pi_nettotal");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_nettotalNotBetween(Integer value1, Integer value2) {
+            addCriterion("Pi_nettotal not between", value1, value2, "Pi_nettotal");
+            return (Criteria) this;
+        }
+        public Criteria andPi_auditdateIsNull() {
+            addCriterion("Pi_auditdate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateIsNotNull() {
+            addCriterion("Pi_auditdate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateEqualTo(Integer value) {
+            addCriterion("Pi_auditdate =", value, "Pi_auditdate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateNotEqualTo(Integer value) {
+            addCriterion("Pi_auditdate <>", value, "Pi_auditdate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateGreaterThan(Integer value) {
+            addCriterion("Pi_auditdate >", value, "Pi_auditdate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateGreaterThanOrEqualTo(Integer value) {
+            addCriterion("Pi_auditdate >=", value, "Pi_auditdate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateLessThan(Integer value) {
+            addCriterion("Pi_auditdate <", value, "Pi_auditdate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateLessThanOrEqualTo(Integer value) {
+            addCriterion("Pi_auditdate <=", value, "Pi_auditdate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateIn(List<Integer> values) {
+            addCriterion("Pi_auditdate in", values, "Pi_auditdate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateNotIn(List<Integer> values) {
+            addCriterion("Pi_auditdate not in", values, "Pi_auditdate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateBetween(Integer value1, Integer value2) {
+            addCriterion("Pi_auditdate between", value1, value2, "Pi_auditdate");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditdateNotBetween(Integer value1, Integer value2) {
+            addCriterion("Pi_auditdate not between", value1, value2, "Pi_auditdate");
+            return (Criteria) this;
+        }
+        public Criteria andPi_auditmanIsNull() {
+            addCriterion("Pi_auditman is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanIsNotNull() {
+            addCriterion("Pi_auditman is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanEqualTo(Integer value) {
+            addCriterion("Pi_auditman =", value, "Pi_auditman");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanNotEqualTo(Integer value) {
+            addCriterion("Pi_auditman <>", value, "Pi_auditman");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanGreaterThan(Integer value) {
+            addCriterion("Pi_auditman >", value, "Pi_auditman");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanGreaterThanOrEqualTo(Integer value) {
+            addCriterion("Pi_auditman >=", value, "Pi_auditman");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanLessThan(Integer value) {
+            addCriterion("Pi_auditman <", value, "Pi_auditman");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanLessThanOrEqualTo(Integer value) {
+            addCriterion("Pi_auditman <=", value, "Pi_auditman");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanIn(List<Integer> values) {
+            addCriterion("Pi_auditman in", values, "Pi_auditman");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanNotIn(List<Integer> values) {
+            addCriterion("Pi_auditman not in", values, "Pi_auditman");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanBetween(Integer value1, Integer value2) {
+            addCriterion("Pi_auditman between", value1, value2, "Pi_auditman");
+            return (Criteria) this;
+        }
+
+        public Criteria andPi_auditmanNotBetween(Integer value1, Integer value2) {
+            addCriterion("Pi_auditman not between", value1, value2, "Pi_auditman");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 6 - 0
applications/storage/storage-dto/src/main/java/com/usoftchina/saas/storage/po/ProdInOutList.java

@@ -140,4 +140,10 @@ public class ProdInOutList extends CommonBaseEntity{
 
     private Long pd_ioid;
 
+    private Double pi_nettotal;
+
+    private Date pi_auditdate;
+
+    private String pi_auditman;
+
 }