yonge 3 éve
szülő
commit
906cb0b9aa

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -512,7 +512,7 @@ public class StudentServeServiceImpl implements StudentServeService {
                 for (String groupId : musicGroupIds) {
                 	
                     //学生在当前乐团没有上过课,就不需要生成服务指标
-                    if(map.get(groupId) != null && (int)map.get(groupId) == 0){
+                    if(map.get(groupId) == null || (int)map.get(groupId) == 0){
                     	continue;
                     }
                     
@@ -592,8 +592,18 @@ public class StudentServeServiceImpl implements StudentServeService {
             if(CollectionUtils.isEmpty(musicGroupIds)){
                 continue;
             }
+            
+            List<Mapper> mapperList = courseScheduleStudentPaymentDao.queryUserMusicGroupCourseNumByClassTime(GroupType.MUSIC, musicGroupIds, noCourseServeStudentId, new Date(2019, 1, 1), LocalDateToUdate(monDayDate));
+            Map<Object, Object> map = mapperList.stream().collect(Collectors.toMap(Mapper :: getKey, Mapper :: getValue));
+            
             Map<Integer, Integer> teacherNumMap = new HashMap<>();
             for (String groupId : musicGroupIds) {
+                
+                //学生在当前乐团没有上过课,就不需要生成服务指标
+                if(map.get(groupId) == null || (int)map.get(groupId) == 0){
+                	continue;
+                }
+                
                 Integer teacherId = null;
                 List<BaseMapDto<Integer, Integer>> studentTeacherIdList = classGroupStudentMapperDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(noCourseServeStudentId), groupId);
                 if(!CollectionUtils.isEmpty(studentTeacherIdList)){

+ 27 - 5
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -12,16 +12,19 @@ import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.adapay.Payment;
 import com.ym.mec.thirdparty.yqpay.Msg;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
@@ -33,6 +36,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
@@ -99,6 +103,9 @@ public class StudentOrderController extends BaseController {
     private MusicGroupPaymentCalenderActivityService musicGroupPaymentCalenderActivityService;
     @Autowired
     private TenantConfigService tenantConfigService;
+    
+    @Autowired
+    private OrganizationService organizationService;
 
     @Value("${spring.profiles.active:dev}")
     private String profiles;
@@ -164,11 +171,26 @@ public class StudentOrderController extends BaseController {
         HashMap<String, Object> orderDetail = new HashMap<>();
         orderDetail.put("order", orderByOrderNo);
         orderDetail.put("groupType", orderByOrderNo.getGroupType());
-        TenantConfig tenantConfig = tenantConfigService.getOne(new QueryWrapper<TenantConfig>()
-                .eq("tenant_id_", orderByOrderNo.getTenantId()));
-        if (Objects.nonNull(tenantConfig)) {
-            orderDetail.put("financeChops", tenantConfig.getCorporateFinanceChops());
-        }
+        
+        //查询财务章
+        //如果分部有企业信息,就用分部上的企业信息,否则用机构上的企业信息
+        String financeChops = null;
+        Organization organizationDto = organizationService.get(orderByOrderNo.getOrganId());
+		if (organizationDto == null || StringUtils.isBlank(organizationDto.getCorporateName()) || StringUtils.isBlank(organizationDto.getCorporateCode())) {
+
+			TenantConfig tenantConfig = tenantConfigService.queryByTenantId(orderByOrderNo.getTenantId());
+			if(tenantConfig == null){
+				throw new BizException("机构配置信息查询失败");
+			}
+			
+			financeChops = tenantConfig.getCorporateFinanceChops();
+		} else {
+			financeChops = organizationDto.getCorporateFinancialSeal();
+		}
+		if(StringUtils.isNotBlank(financeChops)){
+			orderDetail.put("financeChops", financeChops);
+		}
+		
         if (OrderTypeEnum.APPLY.equals(orderByOrderNo.getType())) {
             StudentRegistration studentRegistration = studentRegistrationDao.getStudentRegister(orderByOrderNo.getMusicGroupId(), orderByOrderNo.getUserId());
             if (studentRegistration.getPayingStatus().equals(2)) {