Browse Source

资金模块-核销单配置

huangx 7 years ago
parent
commit
c41dbce31e

+ 65 - 22
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/VerificationController.java

@@ -1,43 +1,86 @@
 package com.usoftchina.saas.money.controller;
 
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocSavedDTO;
+import com.usoftchina.saas.money.dto.VerificationFormDTO;
+import com.usoftchina.saas.money.dto.VerificationListDTO;
+import com.usoftchina.saas.money.dto.VerificationReqDTO;
+import com.usoftchina.saas.money.po.VerificationList;
+import com.usoftchina.saas.money.service.VerificationService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
+/**
+ * @author hx
+ * @createtime 2018-10-23 8:35
+ */
+@CrossOrigin
 @RestController
-@RequestMapping("/money")
+@RequestMapping("/verification")
 public class VerificationController {
-    @RequestMapping("/verification/test")
+    @Autowired
+    private  VerificationService  verificationService;
+    @RequestMapping("/test")
     public String test() {
         return "TEST";
     }
 
-    @RequestMapping("/verification/getListData")
-    public String getListData() {
-        return "TEST";
+    /**
+     * 核销单列表
+     * @param page
+     * @param req
+     * @return
+     */
+    @RequestMapping("/list")
+    public Result<PageInfo<VerificationList>> getListData(PageRequest page, VerificationReqDTO req) {
+        PageInfo<VerificationListDTO> listData = verificationService.getListData(page, req);
+        return Result.success(listData);
     }
 
-    @RequestMapping("/verification/getFormData")
-    public String getFormData() {
-        return "TEST";
+    /**
+     * 核销单表单
+     * @param id
+     * @return
+     */
+    @RequestMapping("/read/{id}")
+    public Result<VerificationFormDTO> getFormData(@PathVariable("id") Long id) {
+        VerificationFormDTO data = verificationService.getFormData(id);
+        return Result.success(data);
     }
 
-    @RequestMapping("/verification/saveFormData")
-    public String saveFormData() {
-        return "TEST";
+    /**
+     * 核销单保存
+     * @param form
+     * @return
+     */
+    @RequestMapping("/save")
+    public Result<DocSavedDTO> saveFormData(@RequestBody VerificationFormDTO form) {
+        DocSavedDTO base = verificationService.saveFormData(form);
+        return Result.success(base);
     }
 
-    @RequestMapping("/verification/delete")
-    public String delete() {
-        return "TEST";
+    /**
+     * 核销单删除
+     * @param id
+     * @return
+     */
+    @RequestMapping("/delete/{id}")
+    public Result delete(@PathVariable("id") Long id) {
+        verificationService.delete(id);
+        return Result.success();
     }
 
-    @RequestMapping("/verification/audit")
-    public String audit() {
-        return "TEST";
+    @RequestMapping("/audit")
+    public Result audit(@RequestBody VerificationFormDTO formDTO) {
+        DocSavedDTO audit = verificationService.audit(formDTO);
+        return Result.success(audit);
     }
 
-    @RequestMapping("/resaudit")
-    public String resAudit() {
-        return "TEST";
+    @RequestMapping("/resAudit/{id}")
+    public Result resAudit(@PathVariable("id") Long id) {
+        verificationService.resAudit(id);
+        return Result.success();
     }
 }

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

@@ -37,7 +37,7 @@ public interface VerificationMapper extends CommonBaseMapper<Verification> {
 
     Integer validateCodeWhenUpdate(@Param("code") String code,@Param("id") Long id);
 
-    String selectCodeById(Integer id);
+    String selectCodeById(Long id);
 
     String validateResAudit(Long id);
 }

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

@@ -37,5 +37,5 @@ public interface VerificationdetMapper extends CommonBaseMapper<Verificationdet>
 
     void batchUpdate(List<Verificationdet> list);
 
-    int deleteByParentPrimaryKey(Integer vd_vcid);
+    int deleteByParentPrimaryKey(Long vd_vcid);
 }

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

@@ -32,11 +32,12 @@ public interface VerificationdetailMapper extends CommonBaseMapper<Verificationd
 
     int updateByPrimaryKeySelective(Verificationdetail record);
 
+
     int updateByPrimaryKey(Verificationdetail record);
 
     void batchInsert(List<Verificationdetail> list);
 
     void batchUpdate(List<Verificationdetail> list);
 
-    int deleteByParentPrimaryKey(Integer vcd_vcid);
+    int deleteByParentPrimaryKey(Long vcd_vcid);
 }

+ 1 - 1
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/VerificationService.java

@@ -39,7 +39,7 @@ public interface VerificationService {
      * 删除核销单
      * @param id
      */
-    void delete(Integer id);
+    void delete(Long id);
 
     /**
      * 审核核销单

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

@@ -21,12 +21,14 @@ import com.usoftchina.saas.money.service.VerificationService;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
+@Service
 public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationMapper,Verification> implements VerificationService {
     @Autowired
     private MaxnumberService maxnumberService;
@@ -193,7 +195,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
     }
 
     @Override
-    public void delete(Integer id) {
+    public void delete(Long id) {
         if (null != id) {
             //从表删除
             verificationdetMapper.deleteByParentPrimaryKey(id);
@@ -202,7 +204,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
             verificationMapper.deleteByPrimaryKey(id);
             String code = verificationMapper.selectCodeById(id);
             DocBaseDTO baseDTO = new DocBaseDTO();
-            baseDTO.setId(Long.valueOf(id));
+            baseDTO.setId(id);
             baseDTO.setCode(code);
             baseDTO.setName("Verification");
             //日志

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/VerificationMapper.xml

@@ -641,7 +641,7 @@
   <select id="validateCodeWhenUpdate" resultType="int" >
     select count(1) from Verification where vc_code = #{code} and vc_id != #{id}
   </select>
-  <select id="selectCodeById" resultType="string" parameterType="int">
+  <select id="selectCodeById" resultType="string" parameterType="java.lang.Long">
     select vc_code from Verification where vc_id=#{id}
   </select>
   <select id="validateResAudit" parameterType="long" resultType="java.lang.String">

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/VerificationdetMapper.xml

@@ -474,7 +474,7 @@
       where vd_vcid = #{item.id,jdbcType=INTEGER}
     </foreach>
   </update>
-  <delete id="deleteByParentPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByParentPrimaryKey" parameterType="java.lang.Long" >
     delete from verificationdet
     where vd_id = #{vd_vcid,jdbcType=INTEGER}
   </delete>

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/VerificationdetailMapper.xml

@@ -474,7 +474,7 @@
       where vcd_vcid = #{item.id,jdbcType=INTEGER}
     </foreach>
   </update>
-  <delete id="deleteByParentPrimaryKey" parameterType="java.lang.Integer" >
+  <delete id="deleteByParentPrimaryKey" parameterType="java.lang.Long" >
     delete from verificationdetail
     where vd_id = #{vcd_vcid,jdbcType=INTEGER}
   </delete>