chenyuesheng 2 سال پیش
والد
کامیت
fb5ea4d508

+ 27 - 5
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/controller/AccountantReimbursementBusinessTwoController.java

@@ -3,15 +3,16 @@ package com.jeeplus.test.reimbursementAccountant.controller;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.sys.utils.StringUtils;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
 import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementBusinessTwoService;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Collections;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/accountant/reimbursementBusinessTwo")
@@ -20,7 +21,7 @@ public class AccountantReimbursementBusinessTwoController {
     @Autowired
     private AccountantReimbursementBusinessTwoService accountantReimbursementBusinessTwoService;
 
-    @ApiLog("查询票报销列表")
+    @ApiLog("查询票报销列表")
     @RequestMapping("findListPage")
     public ResponseEntity findListPage(AccountantReimbursementBusinessTwoDTO accountantReimbursementBusinessTwoDTO,Page<AccountantReimbursementBusinessTwoDTO> page){
         IPage<AccountantReimbursementBusinessTwoDTO> listPage = accountantReimbursementBusinessTwoService.findListPage(page, accountantReimbursementBusinessTwoDTO);
@@ -40,4 +41,25 @@ public class AccountantReimbursementBusinessTwoController {
         accountantReimbursementBusinessTwoService.addData(accountantReimbursementBusinessTwoDTO);
         return ResponseEntity.ok("添加成功");
     }
+
+    @ApiLog("下拉列表")
+    @RequestMapping("findSelectList")
+    public ResponseEntity findSelectList(){
+        return ResponseEntity.ok(accountantReimbursementBusinessTwoService.findSelectList());
+    }
+
+    @ApiLog("绑定")
+    @RequestMapping("modifyBindCode")
+    public ResponseEntity modifyBindCode(@RequestParam("ids")String ids,@RequestParam("businessCode")String businessCode){
+        String[] split = ids.split(",");
+        if(split.length!=0){
+            for (int i = 0; i < split.length; i++) {
+                accountantReimbursementBusinessTwoService.modifyBindCode(split[i],businessCode);
+            }
+        }else{
+            accountantReimbursementBusinessTwoService.modifyBindCode(ids,businessCode);
+        }
+
+        return ResponseEntity.ok("成功");
+    }
 }

+ 14 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/AccountantReimbursementBusinessTwoMapper.java

@@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
+import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 
 @Mapper
 public interface AccountantReimbursementBusinessTwoMapper extends BaseMapper<AccountantReimbursementBusinessTwoDTO> {
@@ -28,6 +31,17 @@ public interface AccountantReimbursementBusinessTwoMapper extends BaseMapper<Acc
      */
     void insertAccountantReimbursementBusiness(AccountantReimbursementBusinessTwoDTO accountantReimbursementBusiness);
 
+    /**
+     * 修改
+     */
+    void modifyBindCode(@Param("ids")String ids,@Param("businessCode")String businessCode);
+
+    /**
+     * 下拉菜单
+     */
+    List<AccountantReimbursementDTO> findSelectList();
+
+
 
 
 

+ 14 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementBusinessTwoMapper.xml

@@ -87,10 +87,24 @@
         </where>
         order by a.update_date desc,a.year desc, a.user_id asc
     </select>
+    <select id="findSelectList"
+            resultType="com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO">
+
+        select id,business_code from zs_reimbursement_info where business_code is not null and business_code != '' group by business_code
+    </select>
+
 
     <update id="delPhysicsById">
         update zs_reimbursement_business_accountant_info
         set del_flag = 1
         where id = #{id}
     </update>
+    <update id="modifyBindCode">
+        update zs_reimbursement_business_accountant_info
+        set
+                business_code_id=#{businessCode}
+        where id=#{ids}
+    </update>
+
+
 </mapper>

+ 9 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/AccountantReimbursementBusinessTwoService.java

@@ -3,12 +3,21 @@ package com.jeeplus.test.reimbursementAccountant.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
+import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
 
 public interface AccountantReimbursementBusinessTwoService {
+
     IPage<AccountantReimbursementBusinessTwoDTO> findListPage(Page<AccountantReimbursementBusinessTwoDTO> page,
                                                               AccountantReimbursementBusinessTwoDTO accountantReimbursementBusiness);
 
     void delPhysicsById(String id);
 
     void addData(AccountantReimbursementBusinessTwoDTO accountantReimbursementBusinessTwoDTO);
+
+    List<AccountantReimbursementDTO> findSelectList();
+
+    void modifyBindCode(String ids,String businessCode);
 }

+ 14 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/impl/AccountantReimbursementBusinessTwoServiceImpl.java

@@ -3,12 +3,15 @@ package com.jeeplus.test.reimbursementAccountant.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementBusinessTwoDTO;
+import com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO;
 import com.jeeplus.test.reimbursementAccountant.mapper.AccountantReimbursementBusinessTwoMapper;
 import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementBusinessTwoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.List;
+
 @Service
 @Transactional(readOnly = true)
 public class AccountantReimbursementBusinessTwoServiceImpl implements AccountantReimbursementBusinessTwoService {
@@ -33,4 +36,15 @@ public class AccountantReimbursementBusinessTwoServiceImpl implements Accountant
         accountantReimbursementBusinessTwoDTO.preInsert();
         accountantReimbursementBusinessTwoMapper.insertAccountantReimbursementBusiness(accountantReimbursementBusinessTwoDTO);
     }
+
+    @Override
+    public List<AccountantReimbursementDTO> findSelectList() {
+        return accountantReimbursementBusinessTwoMapper.findSelectList();
+    }
+
+    @Transactional(readOnly = false)
+    @Override
+    public void modifyBindCode(String ids,String businessCode) {
+        accountantReimbursementBusinessTwoMapper.modifyBindCode(ids,businessCode);
+    }
 }