2 Commits 7ead71fbff ... 021f765539

Autor SHA1 Mensagem Data
  chenyuesheng 021f765539 Merge remote-tracking branch 'origin/master' 2 years atrás
  chenyuesheng bdac3d5fec 无票报销 2 years atrás

+ 10 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/controller/AccountantReimbursementBusinessTwoController.java

@@ -5,12 +5,15 @@ 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.domain.dto.AccountantReimbursementDTO;
+import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementBusinessService;
 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.*;
 
+import java.math.BigDecimal;
 import java.util.Collections;
 import java.util.stream.Collectors;
 
@@ -20,6 +23,8 @@ public class AccountantReimbursementBusinessTwoController {
 
     @Autowired
     private AccountantReimbursementBusinessTwoService accountantReimbursementBusinessTwoService;
+    @Autowired
+    private AccountantReimbursementBusinessService reimbursementBusinessService;
 
     @ApiLog("查询无票报销列表")
     @RequestMapping("findListPage")
@@ -50,7 +55,11 @@ public class AccountantReimbursementBusinessTwoController {
 
     @ApiLog("绑定")
     @RequestMapping("modifyBindCode")
-    public ResponseEntity modifyBindCode(@RequestParam("ids")String ids,@RequestParam("businessCode")String businessCode){
+    public ResponseEntity modifyBindCode(@RequestParam("ids")String ids,@RequestParam("businessCode")String businessCode,@RequestParam("money")String money){
+        AccountantReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(businessCode);
+        if(new BigDecimal(businessById.getCanReimbursementAmount()).compareTo(new BigDecimal(money))<0){
+            return ResponseEntity.ok(false);
+        }
         String[] split = ids.split(",");
         if(split.length!=0){
             for (int i = 0; i < split.length; i++) {

+ 4 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/mapper/xml/AccountantReimbursementBusinessTwoMapper.xml

@@ -101,7 +101,10 @@
     </select>
     <select id="findSelectCodeListByYear"
             resultType="com.jeeplus.test.reimbursementAccountant.domain.dto.AccountantReimbursementDTO">
-        select id,business_code as businessCode from zs_reimbursement_accountant_info where year = #{year} and business_code is not null and business_code != '' group by business_code
+        select id,business_code as businessCode
+        from zs_reimbursement_accountant_info
+        where year = #{year} and business_code is not null and business_code != '' and reimbursement_ratio is not null and reimbursement_ratio !=''
+        group by business_code
     </select>
 
 

+ 2 - 2
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursementAccountant/service/impl/AccountantReimbursementBusinessServiceImpl.java

@@ -111,8 +111,8 @@ public class AccountantReimbursementBusinessServiceImpl implements AccountantRei
                             if(StringUtils.isBlank(yearInfo.getAlreadyReimbursementDay())){
                                 yearInfo.setAlreadyReimbursementDay("0");
                             }
-                            Integer surplusReimbursementDay = userInfo.getReimbursementAllDay() - Integer.parseInt(yearInfo.getAlreadyReimbursementDay());
-                            info.setSurplusReimbursementDay(surplusReimbursementDay.toString());
+                            int surplusReimbursementDay = userInfo.getReimbursementAllDay() - Integer.parseInt(yearInfo.getAlreadyReimbursementDay());
+                            info.setSurplusReimbursementDay(Integer.toString(surplusReimbursementDay));
                         }else{
                             info.setSurplusReimbursementDay("");
                         }

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

@@ -5,6 +5,7 @@ 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.AccountantReimbursementBusinessService;
 import com.jeeplus.test.reimbursementAccountant.service.AccountantReimbursementBusinessTwoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -18,6 +19,9 @@ public class AccountantReimbursementBusinessTwoServiceImpl implements Accountant
 
     @Autowired
     private AccountantReimbursementBusinessTwoMapper accountantReimbursementBusinessTwoMapper;
+    @Autowired
+    private AccountantReimbursementBusinessService reimbursementBusinessService;
+
 
     @Override
     public IPage<AccountantReimbursementBusinessTwoDTO> findListPage(Page<AccountantReimbursementBusinessTwoDTO> page, AccountantReimbursementBusinessTwoDTO accountantReimbursementBusiness) {
@@ -55,6 +59,15 @@ public class AccountantReimbursementBusinessTwoServiceImpl implements Accountant
 
     @Override
     public List<AccountantReimbursementDTO> findSelectCodeListByYear(String year) {
-        return accountantReimbursementBusinessTwoMapper.findSelectCodeListByYear(year);
+        List<AccountantReimbursementDTO> selectCodeListByYear = accountantReimbursementBusinessTwoMapper.findSelectCodeListByYear(year);
+        selectCodeListByYear.forEach(s->{
+            AccountantReimbursementDTO businessById = reimbursementBusinessService.getBusinessById(s.getId());
+            if(null != businessById){
+                s.setAllAlreadyReimbursementQuota(businessById.getAllAlreadyReimbursementQuota());
+                s.setCanReimbursementAmount(businessById.getCanReimbursementAmount());
+                s.setSurplusReimbursementAmount(businessById.getSurplusReimbursementAmount());
+            }
+        });
+        return selectCodeListByYear;
     }
 }