Ver Fonte

Merge remote-tracking branch 'origin/master'

Joburgess há 5 anos atrás
pai
commit
f53d5b11d0

+ 24 - 6
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExaminationBasicServiceImpl.java

@@ -494,8 +494,6 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
         day = day * -1;
         Integer organId = OrganContextHolder.getOrganId();
         List<Integer> childOrganIds = organizationService.getChildOrganIds(organId, true);
-        BigDecimal annualIncome = examRegistrationPaymentDao.getAnnualIncome(childOrganIds);
-        BigDecimal monthIncome = examRegistrationPaymentDao.getMonthIncome(childOrganIds);
 
         LocalDate today = LocalDate.now();
         List<String> days=new ArrayList<>();
@@ -503,9 +501,31 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
         for (int i = -1 ;i > day;i--){
             days.add(today.plusDays(i).toString());
         }
-        Map<String,BigDecimal> dayIncomes = MapUtil.convertMybatisMap(examRegistrationPaymentDao.getDayIncome(childOrganIds,days),String.class,BigDecimal.class);
+        BigDecimal annualIncome;
+        BigDecimal monthIncome;
+        Map<String,BigDecimal> dayIncomes;
+        if(childOrganIds == null){
+            annualIncome = BigDecimal.ZERO;
+            monthIncome = BigDecimal.ZERO;
+            dayIncomes = new LinkedHashMap<>(days.size());
+        }else {
+            annualIncome = examRegistrationPaymentDao.getAnnualIncome(childOrganIds);
+            monthIncome = examRegistrationPaymentDao.getMonthIncome(childOrganIds);
+            dayIncomes = MapUtil.convertMybatisMap(examRegistrationPaymentDao.getDayIncome(childOrganIds,days),String.class,BigDecimal.class);
+        }
+        BigDecimal annualPayment;
+        BigDecimal monthPayment;
+        Map<String,BigDecimal> dayPayments;
+        if(organId == null){
+            annualPayment = BigDecimal.ZERO;
+            monthPayment = BigDecimal.ZERO;
+            dayPayments = new LinkedHashMap<>(days.size());
+        }else {
+            annualPayment = examManualLedgerDao.getAnnualPayment(organId);
+            monthPayment = examManualLedgerDao.getMonthPayment(organId);
+            dayPayments = MapUtil.convertMybatisMap(examManualLedgerDao.getDayPayment(organId,days),String.class,BigDecimal.class);
+        }
 
-        Map<String,BigDecimal> dayPayments = MapUtil.convertMybatisMap(examManualLedgerDao.getDayPayment(organId,days),String.class,BigDecimal.class);
         days.forEach(e->{
             if(dayIncomes.get(e) == null){
                 dayIncomes.put(e,BigDecimal.ZERO);
@@ -521,8 +541,6 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
         dayPayments.entrySet().stream().sorted(Map.Entry.comparingByKey())
                 .forEachOrdered(e -> hashMap2.put(e.getKey(), e.getValue()));
 
-        BigDecimal annualPayment = examManualLedgerDao.getAnnualPayment(organId);
-        BigDecimal monthPayment = examManualLedgerDao.getMonthPayment(organId);
         HashMap<Object, Object> resultMap = new HashMap<>(6);
         resultMap.put("annualIncome",annualIncome);
         resultMap.put("monthIncome",monthIncome);

+ 1 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -130,7 +130,7 @@
 		SELECT <include refid="organizationColumn"/>,e.lock_flag_ FROM organization o
 		LEFT JOIN employee e ON o.user_id_ = e.user_id_
 		<include refid="organQueryPage"/>
-		ORDER BY o.update_time_ DESC
+		ORDER BY o.id_ DESC
 		<include refid="global.limit"/>
 	</select>
 	

+ 2 - 10
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/OrganizationController.java

@@ -7,31 +7,25 @@ import com.keao.edu.common.controller.BaseController;
 import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.tenant.TenantContextHolder;
-import com.keao.edu.user.dao.SysUserDao;
 import com.keao.edu.user.entity.Organization;
 import com.keao.edu.user.page.OrganizationQueryInfo;
 import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.util.date.DateUtil;
-import com.keao.edu.util.excel.POIUtil;
-import com.keao.edu.util.iniFile.IniFileEntity;
-import com.keao.edu.util.iniFile.IniFileUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.tomcat.util.http.fileupload.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.util.ResourceUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.*;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 合作单位服务
@@ -45,8 +39,6 @@ public class OrganizationController extends BaseController {
     private OrganizationService organizationService;
     @Autowired
     private SysUserFeignService sysUserFeignService;
-    @Autowired
-    private SysUserDao sysUserDao;
 
     @ApiOperation(value = "合作单位列表")
     @GetMapping(value = "list")