Browse Source

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

chenw 7 years ago
parent
commit
67c75fd64b

+ 2 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdInOutDTO.java

@@ -71,4 +71,6 @@ public class ProdInOutDTO extends CommonBaseDTO implements Serializable {
 
     private String pi_auditman;
 
+    private String pi_remark;
+
 }

+ 2 - 0
applications/purchase/purchase-dto/src/main/java/com/usoftchina/saas/purchase/dto/ProdInOutListDTO.java

@@ -71,6 +71,8 @@ public class ProdInOutListDTO extends CommonBaseDTO implements Serializable {
 
     private String pi_auditman;
 
+    private String pi_remark;
+
     private Long pd_piid;
 
     private String pd_inoutno;

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOut.java

@@ -66,4 +66,6 @@ public class ProdInOut extends CommonBaseEntity implements Serializable {
 
     private String pi_auditman;
 
+    private String pi_remark;
+
 }

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/po/ProdInOutList.java

@@ -70,6 +70,8 @@ public class ProdInOutList extends CommonBaseEntity{
 
     private String pi_auditman;
 
+    private String pi_remark;
+
     private Long pd_piid;
 
     private String pd_inoutno;

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

@@ -378,12 +378,7 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
 
     private void checkUpdateQty(String pu_code, String pi_class) {
         int count = 0;
-        if ("采购验收单".equals(pi_class)) {
-            count = getMapper().checkQtyFromPurchase(pu_code);
-            if (count>0){
-                throw new BizException(500, "明细行数量超过来源采购单明细行数量");
-            }
-        } else if ("采购验退单".equals(pi_class)) {
+        if ("采购验退单".equals(pi_class)) {
             count = getMapper().checkQtyFromProdIn(pu_code);
             if (count>0){
                 throw new BizException(500, "明细行数量超过来源采购验收单明细行数量");

+ 1 - 0
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutListMapper.xml

@@ -32,6 +32,7 @@
     <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
     <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
     <result column="pi_address" jdbcType="VARCHAR" property="pi_address" />
+    <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
     <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
     <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
     <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />

+ 39 - 5
applications/purchase/purchase-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -34,6 +34,7 @@
     <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" />
+    <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
 
 
   </resultMap>
@@ -47,7 +48,8 @@
     pi_id, pi_inoutno, pi_class, pi_date, pi_vendid, pi_vendcode, pi_vendname, pi_custid, 
     pi_custcode, pi_custname, pi_puid, pi_pucode, pi_said, pi_sacode, pi_total, pi_recordmanid, 
     pi_recordman, pi_recorddate, pi_status, pi_statuscode, pi_printstatus, pi_printstatuscode, 
-    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5
+    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5,pi_auditdate,
+    pi_auditman,pi_remark
   </sql>
   <sql id="Blob_Column_List">
     pi_address
@@ -162,6 +164,15 @@
       <if test="pi_address != null">
         pi_address,
       </if>
+      <if test="pi_auditdate != null">
+        pi_auditdate,
+      </if>
+      <if test="pi_auditman != null">
+        pi_auditman,
+      </if>
+      <if test="pi_remark != null">
+        pi_remark,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -255,6 +266,16 @@
       <if test="pi_address != null">
         #{pi_address,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pi_auditdate != null">
+        #{pi_auditdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pi_auditman != null">
+        #{pi_auditman,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_remark != null">
+        #{pi_remark,jdbcType=VARCHAR},
+      </if>
+
     </trim>
   </insert>
 
@@ -351,7 +372,15 @@
       <if test="pi_address != null">
         pi_address = #{pi_address,jdbcType=LONGVARCHAR},
       </if>
-
+      <if test="pi_auditdate != null">
+        pi_auditdate = #{pi_auditdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pi_auditman != null">
+        pi_auditman = #{pi_auditman,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_remark != null">
+        pi_remark = #{pi_remark,jdbcType=VARCHAR},
+      </if>
     </set>
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
@@ -386,8 +415,10 @@
       pi_text3 = #{pi_text3,jdbcType=VARCHAR},
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
       pi_text5 = #{pi_text5,jdbcType=VARCHAR},
-      pi_address = #{pi_address,jdbcType=LONGVARCHAR}
-
+      pi_address = #{pi_address,jdbcType=LONGVARCHAR},
+      pi_auditdate = #{pi_auditdate,jdbcType=TIMESTAMP},
+      pi_auditman = #{pi_auditman,jdbcType=VARCHAR},
+      pi_remark = #{pi_remark,jdbcType=VARCHAR}
     where pi_id = #{pi_id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.purchase.po.ProdInOut">
@@ -420,7 +451,10 @@
       pi_text2 = #{pi_text2,jdbcType=VARCHAR},
       pi_text3 = #{pi_text3,jdbcType=VARCHAR},
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
-      pi_text5 = #{pi_text5,jdbcType=VARCHAR}
+      pi_text5 = #{pi_text5,jdbcType=VARCHAR},
+      pi_auditdate = #{pi_auditdate,jdbcType=TIMESTAMP},
+      pi_auditman = #{pi_auditman,jdbcType=VARCHAR},
+      pi_remark = #{pi_remark,jdbcType=VARCHAR}
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
 

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

@@ -34,7 +34,7 @@
     <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" />
-
+    <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
 
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.storage.po.ProdInOut">
@@ -47,7 +47,8 @@
     pi_id, pi_inoutno, pi_class, pi_date, pi_vendid, pi_vendcode, pi_vendname, pi_custid, 
     pi_custcode, pi_custname, pi_puid, pi_pucode, pi_said, pi_sacode, pi_total, pi_recordmanid, 
     pi_recordman, pi_recorddate, pi_status, pi_statuscode, pi_printstatus, pi_printstatuscode, 
-    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5
+    companyid, updaterid, updatetime, pi_text1, pi_text2, pi_text3, pi_text4, pi_text5,pi_auditdate,
+    pi_auditman,pi_remark
   </sql>
   <sql id="Blob_Column_List">
     pi_address
@@ -162,6 +163,15 @@
       <if test="pi_address != null">
         pi_address,
       </if>
+      <if test="pi_auditdate != null">
+        pi_auditdate,
+      </if>
+      <if test="pi_auditman != null">
+        pi_auditman,
+      </if>
+      <if test="pi_remark != null">
+        pi_remark,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
 
@@ -255,6 +265,15 @@
       <if test="pi_address != null">
         #{pi_address,jdbcType=LONGVARCHAR},
       </if>
+      <if test="pi_auditdate != null">
+        #{pi_auditdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pi_auditman != null">
+        #{pi_auditman,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_remark != null">
+        #{pi_remark,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
 
@@ -351,7 +370,15 @@
       <if test="pi_address != null">
         pi_address = #{pi_address,jdbcType=LONGVARCHAR},
       </if>
-
+      <if test="pi_auditdate != null">
+        pi_auditdate = #{pi_auditdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="pi_auditman != null">
+        pi_auditman = #{pi_auditman,jdbcType=VARCHAR},
+      </if>
+      <if test="pi_remark != null">
+        pi_remark = #{pi_remark,jdbcType=VARCHAR},
+      </if>
     </set>
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
@@ -386,8 +413,10 @@
       pi_text3 = #{pi_text3,jdbcType=VARCHAR},
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
       pi_text5 = #{pi_text5,jdbcType=VARCHAR},
-      pi_address = #{pi_address,jdbcType=LONGVARCHAR}
-
+      pi_address = #{pi_address,jdbcType=LONGVARCHAR},
+      pi_auditdate = #{pi_auditdate,jdbcType=TIMESTAMP},
+      pi_auditman = #{pi_auditman,jdbcType=VARCHAR},
+      pi_remark = #{pi_remark,jdbcType=VARCHAR}
     where pi_id = #{pi_id,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
@@ -420,7 +449,11 @@
       pi_text2 = #{pi_text2,jdbcType=VARCHAR},
       pi_text3 = #{pi_text3,jdbcType=VARCHAR},
       pi_text4 = #{pi_text4,jdbcType=VARCHAR},
-      pi_text5 = #{pi_text5,jdbcType=VARCHAR}
+      pi_text5 = #{pi_text5,jdbcType=VARCHAR},
+      pi_address = #{pi_address,jdbcType=LONGVARCHAR},
+      pi_auditdate = #{pi_auditdate,jdbcType=TIMESTAMP},
+      pi_auditman = #{pi_auditman,jdbcType=VARCHAR},
+      pi_remark = #{pi_remark,jdbcType=VARCHAR}
     where pi_id = #{id,jdbcType=INTEGER}
   </update>
 

+ 89 - 1
base-servers/file/file-api/src/main/java/com/usoftchina/saas/file/api/FileApi.java

@@ -13,6 +13,8 @@ import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.util.List;
+
 /**
  * 文件接口
  *
@@ -37,7 +39,7 @@ public interface FileApi {
      * @return
      */
     @PostMapping(value = "/folder")
-    Result<FolderDTO> folder(FolderSaveDTO newFolder);
+    Result<FolderDTO> createFolder(FolderSaveDTO newFolder);
 
     /**
      * 根据id查看文件详情
@@ -48,6 +50,24 @@ public interface FileApi {
     @GetMapping(value = "/info/{id}")
     Result<FileInfoDTO> getFileInfo(@PathVariable(value = "id") Long id);
 
+    /**
+     * 根据path查看文件信息
+     *
+     * @param path
+     * @return
+     */
+    @GetMapping(value = "/info")
+    Result<FileInfoDTO> getFileInfoByPath(@RequestParam String path);
+
+    /**
+     * 查看子文件
+     *
+     * @param folderId
+     * @return
+     */
+    @GetMapping(value = "/list")
+    Result<List<FileInfoDTO>> listFiles(Long folderId);
+
     /**
      * 上传文件到指定文件夹
      *
@@ -58,4 +78,72 @@ public interface FileApi {
      */
     @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     Result<FileInfoDTO> upload(Long folderId, @RequestPart(value = "file") MultipartFile file) throws Exception;
+
+    /**
+     * 文件下载
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/download/{id}")
+    byte[] download(@PathVariable Long id);
+
+    /**
+     * 文件下载
+     *
+     * @param path
+     * @return
+     */
+    @GetMapping(value = "/download")
+    byte[] downloadByPath(@RequestParam String path);
+
+    /**
+     * 删除文件
+     *
+     * @param id
+     * @param purge true表示直接删除,false表示放入回收站
+     * @return
+     */
+    @GetMapping(value = "/delete/{id}")
+    Result delete(@PathVariable Long id,
+                  @RequestParam(required = false, defaultValue = "false") Boolean purge);
+
+    /**
+     * 删除文件
+     *
+     * @param id
+     * @param purge true表示直接删除,false表示放入回收站
+     * @return
+     */
+    @GetMapping(value = "/delete")
+    Result deleteByPath(@PathVariable Long id,
+                  @RequestParam(required = false, defaultValue = "false") Boolean purge);
+
+    /**
+     * 还原文件
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping(value = "/restore/{id}")
+    Result restore(@PathVariable Long id);
+
+    /**
+     * 还原文件
+     *
+     * @param path
+     * @return
+     */
+    @GetMapping(value = "/restore")
+    Result restoreByPath(@RequestParam String path);
+
+    /**
+     * 移动文件到文件夹
+     *
+     * @param fileId
+     * @param folderId
+     * @return
+     */
+    @GetMapping(value = "/move")
+    Result move(@RequestParam Long fileId, @RequestParam Long folderId);
 }

+ 1 - 1
base-servers/file/file-server/src/main/java/com/usoftchina/saas/file/controller/FileController.java

@@ -82,7 +82,7 @@ public class FileController {
 
     @ApiOperation(value = "创建文件夹")
     @PostMapping(value = "/folder")
-    public Result<FolderDTO> folder(FolderSaveDTO newFolder) {
+    public Result<FolderDTO> createFolder(FolderSaveDTO newFolder) {
         BizAssert.notNull(newFolder.getName(), ExceptionCode.FOLDER_NAME_EMPTY);
         // 检查父文件夹
         FileInfo parent = checkFolder(newFolder.getFolderId());