Просмотр исходного кода

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	common/common-entity/sql记录
yeshijie 3 лет назад
Родитель
Сommit
c1b2063daf

+ 9 - 0
svr/svr-cloud-care/sql/init.sql

@ -4,3 +4,12 @@ INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('hz_yxyzh_wx_sms_signName', NULL, 'hz_yxyzh_wx_sms', 'signName', '朝晖云照护', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('hz_yxyzh_wx_sms_smsSdkAppId', NULL, 'hz_yxyzh_wx_sms', 'smsSdkAppId', '1400526119', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('hz_yxyzh_wx_sms_VerificationCode', NULL, 'hz_yxyzh_wx_sms', 'VerificationCode', '969545', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb791c71820179644adf58003e', NULL, 'orderPayStatus', '1', '待审核', '', '1', NULL, '2021-05-13 13:54:59.032', '123', NULL, '2021-05-13 13:54:59.032', '123', NULL, '', '订单支付状态');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb791c71820179644b2373003f', NULL, 'orderPayStatus', '2', '待支付', '', '2', NULL, '2021-05-13 13:55:16.467', '123', NULL, '2021-05-13 13:55:16.467', '123', NULL, '', '订单支付状态');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb791c71820179644b50730040', NULL, 'orderPayStatus', '3', '已支付', '', '3', NULL, '2021-05-13 13:55:27.987', '123', NULL, '2021-05-13 13:55:27.987', '123', NULL, '', '订单支付状态');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb791c71820179644bbddc0041', NULL, 'orderPayStatus', '4', '审核未通过', '', '4', NULL, '2021-05-13 13:55:55.996', '123', NULL, '2021-05-13 13:55:55.996', '123', NULL, '', '订单支付状态');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb791c71820179644c4e7a0043', NULL, 'orderPayStatus', '5', '已退款', '', '5', NULL, '2021-05-13 13:56:33.018', '123', NULL, '2021-05-13 16:02:53.057', '123', NULL, '', '订单支付状态');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb797db4ce01797e3f387a0003', NULL, 'orderPayStatus', '6', '退款中', '', '6', NULL, '2021-05-18 14:52:23.034', '123', NULL, '2021-05-18 14:52:23.034', '123', NULL, '', '订单支付状态');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb797db4ce01797e4111060004', NULL, 'orderPayStatus', '7', '已取消', '', '7', NULL, '2021-05-18 14:54:24.006', '123', NULL, '2021-05-18 14:54:24.006', '123', NULL, '', '订单支付状态');

+ 8 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/RecruitStudentsDao.java

@ -1,9 +1,14 @@
package com.yihu.jw.care.dao.course;
import com.yihu.jw.entity.care.course.RecruitStudentsDO;
import com.yihu.jw.entity.followup.Followup;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
@ -13,4 +18,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 */
public interface RecruitStudentsDao extends PagingAndSortingRepository<RecruitStudentsDO, String>, JpaSpecificationExecutor<RecruitStudentsDO> {
    @Query("select a from RecruitStudentsDO a where a.orgCode = ?1 and a.startTime < ?2 and a.endTime >?2 and a.del = 1")
    List<RecruitStudentsDO> findByOrgCode(String orgCode, Date nowDate);
}

+ 8 - 19
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/course/CourseService.java

@ -437,21 +437,21 @@ public class CourseService {
        List<Map<String , Object>> positionList = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> list = new ArrayList<>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String nowDate = sdf.format(new Date());
        if (positionList.size() > 0){
            for (int i=0;i<positionList.size();i++){
                String sql1 = "SELECT id,code,`name`,mobile,photo,address,longitude,latitude ,funDistance("+positionList.get(i).get("latitude")+","+positionList.get(i).get("longitude")+","+lat2+","+lon2+") funDistance FROM base.base_org where id = '"+positionList.get(i).get("id")+"'";
                List<Map<String , Object>> mapList = jdbcTemplate.queryForList(sql1);
//                base_recruit_students
                String allNumSql = "SELECT num FROM base_recruit_students WHERE org_code = '"+mapList.get(0).get("code")+"' AND del = 1 ";
                Integer allNum = jdbcTemplate.queryForObject(allNumSql,Integer.class);
                String recruitIdSql = "SELECT id FROM base_recruit_students WHERE org_code = '"+mapList.get(0).get("code")+"' AND del = 1 ";
                String recruitId = jdbcTemplate.queryForObject(recruitIdSql,String.class);
                Integer allNum = 0;
                String recruitId = "";
                String orgCode = String.valueOf(mapList.get(0).get("code"));
                List<RecruitStudentsDO> recruitStudentsDOList = recruitStudentsDao.findByOrgCode(orgCode,new Date());
                Integer num = 0;
                // 判断该机构是否开放报名
                String ksbm = "SELECT COUNT(1) a FROM base_recruit_students WHERE '"+nowDate+"' > start_time AND '"+nowDate+"' < end_time AND del = 1 AND org_code = '"+mapList.get(0).get("code")+"'";
                num = jdbcTemplate.queryForObject(ksbm,Integer.class);
                if (num > 0){
                if (recruitStudentsDOList.size()>0){
                    RecruitStudentsDO recruitStudentsDO = recruitStudentsDOList.get(0);
                    allNum = recruitStudentsDO.getNum();
                    recruitId = recruitStudentsDO.getId();
                    String sqlNum = "SELECT allm.id,allm.num - bbm.num num\n" +
                            "FROM (SELECT id,num FROM base_recruit_students WHERE org_code = '"+mapList.get(0).get("code")+"' AND del = 1 ) allm,(\n" +
                            "SELECT rs.id,COUNT(rsr.id) num FROM base_recruit_students rs,base_recruit_students_record rsr WHERE rsr.org_code =  '"+mapList.get(0).get("code")+"'\n" +
@ -493,17 +493,6 @@ public class CourseService {
                });
            }
            object.put("object",list);
//            List<Map<String , Object>> currentPageList = new ArrayList<>();
//            if (list.size() > 0 ){
//                if (list != null && list.size() > 0) {
//                    int currIdx = (currentPage > 1 ? (currentPage - 1) * pageSize : 0);
//                    for (int i = 0; i < pageSize && i < list.size() - currIdx; i++) {
//                        Map<String, Object> data = list.get(currIdx + i);
//                        currentPageList.add(data);
//                    }
//                }
//            }
//            object.put("object",currentPageList);
        }
        return object;
    }