Преглед на файлове

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

humingfen преди 7 години
родител
ревизия
596e9fa6f0

+ 86 - 6
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/desizenMan/service_project_management.jsp

@ -65,10 +65,11 @@
			.item-name{position: relative;color: #999;padding-right: 10px;width: 80px;text-align: justify;text-align-last: justify;display: inline-block;}
			.item-name:after{content: ':';position: absolute;right: 5px;}
			/*立即生效*/
			.checkbox-box{position: relative;}
			.immediately{opacity: 0;position: absolute;width: 100%;height: 100%;top: 0;cursor: pointer;}
			.checkbox-box{position: relative;z-index: 20}
			.immediately{opacity: 0;position: absolute;width: 100%;height: 100%;top: 0;cursor: pointer;z-index: 2;}
			.immediately + i{display: inline-block;width: 15px;height: 15px;vertical-align: middle;margin-right: 10px;background: url(${ctx}/static/desizenMan/images/weigouxuan_icon.png) center center / cover no-repeat;}
			.immediately:checked + i{background-image: url(${ctx}/static/desizenMan/images/yigouxuan_icon.png);}
            .immediatelyClick{position:absolute;width: 100%;height: 100px;top: 0;left: 0;z-index: 20;}
			.layui-layer-blue .layui-layer-title{background-color: #2d9bd2;color: #fff;}
			.layui-layer-blue .layui-layer-close1{background-color: #fff;border-radius: 100%;background-image: none;position: relative;width: 20px;height: 20px;margin-top: -4px;}
@ -283,7 +284,12 @@
								</div>
							</div>
							<div class="row text-center">
								<p class="ptb-30 mb-0"><span class="checkbox-box"><input type="checkbox" class="immediately" /><i></i>立即生效</span></p>
								<p class="ptb-30 mb-0">
                                    <div class="checkbox-box">
                                        <input type="checkbox" class="immediately"/><i></i>立即生效
                                        <div class="immediatelyClick"></div>
                                    </div>
                                </p>
							</div>
						</td>
					</tr>
@ -514,9 +520,10 @@
					$('.item-jiashou').text(t.hospitalServiceItem.specialistServiceItemDO.addItem);
					console.log(t.hospitalServiceItem.imediate)
					if(t.hospitalServiceItem.imediate == 1){
						$('.immediately').attr('checked','checked');
					}else if(t.hospitalServiceItem.imediate == 0){
                        $('.immediately').attr('checked',false);
                        console.log($('.immediately')[0])
						$($('.immediately')[0]).prop('checked','checked');
					}else{
                        $($('.immediately')[0]).prop('checked',false);
					}
	            },
	            onNodeUnselected: function (event, node) {
@ -747,6 +754,79 @@
                    });
                })
			}
            // 点击立即生效
            $('.checkbox-box').on('click',function(event){
                event.stopPropagation(); 
                if(!($("#institutional_project").find('.node-selected')[0])){
                    return
                }
                var id = $("#institutional_project").find('.node-selected')[0].dataset.code
				if (!id){
				    return
				}
                var t = null;
				xiangmuContent.forEach(function (item) {
					if (id == item.hospitalServiceItem.id){
                        t = item
					}
                });
                layer.confirm('是否更改"立即生效"状态', {
                    title: '提示',
                    skin: 'layui-layer-blue', //样式类名
                    anim:4,
                    btn: ['是','否'] //按钮
                },function () {
                    var index = layer.load(2);
                    var _imediate = '';
                    debugger
                    if(t.hospitalServiceItem.imediate == 1){
                        t.hospitalServiceItem.imediate = 0;
                        _imediate = 0
                    }else{
                        t.hospitalServiceItem.imediate = 1;
                        _imediate = 1
                    }
                    var item = {},data=[];
                    item.hospital = t.hospitalServiceItem.hospital;
                    item.hospitalName = t.hospitalServiceItem.hospitalName;
                    item.serviceItemId = t.hospitalServiceItem.serviceItemId;
                    item.serviceItemName = t.hospitalServiceItem.serviceItemName;
                    item.expense = t.hospitalServiceItem.expense;
                    item.status = t.hospitalServiceItem.status;
                    item.imediate = t.hospitalServiceItem.imediate;
                    item.id = t.hospitalServiceItem.id;
                    data.push(item)
                    data = JSON.stringify(data);
                    parms = {
                        hospitalServiceItem:data
                    }
                    $.ajax({
                        url: ctx + "/admin/specialist/hospitalServiceItem/createHospitalServiceItem",
                        method: "POST",
                        dataType: "json",
                        async: true,
                        data:parms,
                        success:function (res) {
                            console.log(res);
                            if (res.status == 200){
                                layer.close(index);
                                if(_imediate == 0){
                                    $($('.immediately')[0]).prop('checked',false);
                                }else{
                                    $($('.immediately')[0]).prop('checked','checked');
                                }
                                layer.msg('操作成功',{icon:1});
                                setTimeout(function(){
                                    layer.closeAll()
                                },1500)
                            }
                        },
                        error:function (err) {
                            console.log(err)
                        }
                    })
                });
            })
//			点击新增机构项目
			$('.add').on('click',function(){
			    layer.open({

+ 2 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/specialist/EightSpecialistJob.java

@ -11,6 +11,7 @@ import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -27,7 +28,7 @@ import java.util.Map;
public class EightSpecialistJob implements Job {
    public static String jobKey = "Specialist_Rehabilitation_8_JOB";
    public static String jobCron = "0 0 8 * * ?"; //每天8点
    @Autowired
    @Value("${server.server_url}")
    private String serverUrl;
    @Autowired
    private QuartzJobLogDao dbStorage;

+ 2 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/specialist/SixteenSpecialistJob.java

@ -13,6 +13,7 @@ import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -31,7 +32,7 @@ import java.util.Map;
public class SixteenSpecialistJob implements Job {
    public static String jobKey = "Specialist_Rehabilitation_16_JOB";
    public static String jobCron = "0 0 16 * * ?"; //每天8点,14点,20 点执行一次
    @Autowired
    @Value("${server.server_url}")
    private String serverUrl;
    @Autowired
    private QuartzJobLogDao dbStorage;

+ 65 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -0,0 +1,65 @@
package com.yihu.wlyy.service.specialist;
import com.yihu.wlyy.event.ApplicationEvent;
import com.yihu.wlyy.job.QuartzHelper;
import com.yihu.wlyy.job.specialist.EightSpecialistJob;
import com.yihu.wlyy.job.specialist.SixteenSpecialistJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
/**
 * Created by 刘文彬 on 2018/9/13.
 */
@Service
public class SpecialistService {
    private Logger logger = LoggerFactory.getLogger(SpecialistService.class);
    @Autowired
    QuartzHelper quartzHelper;
    public void starJob(Integer type) throws Exception{
        if(type==1){
            //康复计划每天8点发送服务执行进展
            if (!quartzHelper.isExistJob(EightSpecialistJob.jobKey)) {
                quartzHelper.addJob(EightSpecialistJob.class, EightSpecialistJob.jobCron, EightSpecialistJob.jobKey, new HashMap<String, Object>());
                logger.info("NoticeJob  job success");
            } else {
                logger.info("NoticeJob  job exist");
            }
        }else if(type==2){
            //康复计划每天16点发送服务执行进展
            if (!quartzHelper.isExistJob(SixteenSpecialistJob.jobKey)) {
                quartzHelper.addJob(SixteenSpecialistJob.class, SixteenSpecialistJob.jobCron, SixteenSpecialistJob.jobKey, new HashMap<String, Object>());
                logger.info("NoticeJob  job success");
            } else {
                logger.info("NoticeJob  job exist");
            }
        }
    }
    /**
     *
     * @param type 1、8点推送,2、16点推送
     * @throws Exception
     */
    public void stopJob(Integer type) throws Exception{
        switch (type){
            case 1:{
                if(quartzHelper.isExistJob(EightSpecialistJob.jobKey)){
                    quartzHelper.removeJob(EightSpecialistJob.jobKey);
                }break;}
            case 2:{
                if(quartzHelper.isExistJob(SixteenSpecialistJob.jobKey)){
                    quartzHelper.removeJob(EightSpecialistJob.jobKey);
                }
                break;}
        }
    }
}

+ 50 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/SpecialistController.java

@ -0,0 +1,50 @@
package com.yihu.wlyy.web;
import com.yihu.wlyy.service.specialist.SpecialistService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by 刘文彬 on 2018/9/13.
 */
@RestController
@RequestMapping(value = "/job/specialist", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "后台-任务控制每天8点、16点推送康复计划进展")
public class SpecialistController extends BaseController{
    @Autowired
    private SpecialistService specialistService;
    @RequestMapping(value = "starJob", method = RequestMethod.GET)
    @ApiOperation(value = "启动每天8点、16点推送康复计划进展")
    public String starJob(@ApiParam(name = "type", value = "(1、8点推送,2、16点推送)",required = true)
                          @RequestParam(value = "type", required = true)Integer type){
        try{
            specialistService.starJob(type);
            return success("启动成功!");
        }catch (Exception e){
            error(e);
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
        }
    }
    @RequestMapping(value = "stopJob", method = RequestMethod.GET)
    @ApiOperation(value = "关闭每天8点、16点推送康复计划进展")
    public String stopJob(@ApiParam(name = "type", value = "(1、8点推送,2、16点推送)",required = true)
                          @RequestParam(value = "type", required = true)Integer type){
        try{
            specialistService.stopJob(type);
            return success("关闭成功!");
        }catch (Exception e){
            error(e);
            return invalidUserException(e, -1, "关闭失败:" + e.getMessage());
        }
    }
}

+ 5 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -87,7 +87,9 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Modifying
    int setMessageReaded(String doctor, Integer type);
    @Query("update Message a set a.read = 0,a.over = '0' where a.receiver = ?1 and a.id = ?2")
    @Modifying
    int setMessageReadedById(String doctor, Long id);
    @Query("update Message a set a.read = 0,a.over = '0' where a.receiver = ?1 and a.type not in (1,2,6,7)")
    @Modifying
@ -144,8 +146,8 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type in (16,20,22,23) order by a.czrq desc")
    List<Message> getSpecialistUntreated(String receiver,Integer read,String over,Pageable pageable);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type in (16,19,20,21,22,23) order by a.czrq desc")
    List<Message> getSpecialistMessages(String receiver,Integer read,String over,Pageable pageable);
    @Query("select a from Message a where  a.receiver = ?1 and a.state = 1 and a.over = ?2 and a.type in (16,19,20,21,22,23) order by a.czrq desc")
    List<Message> getSpecialistMessages(String receiver,String over,Pageable pageable);
    @Query("select a from Message a where a.read= ?2 and a.receiver = ?1 and a.state = 1 and a.over = ?3 and a.type in (17) order by a.czrq desc")
    List<Message> getTransferMessage(String receiver,Integer read,String over,Pageable pageable);

+ 7 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -602,6 +602,11 @@ public class MessageService extends BaseService {
        }
    }
    public void setMessageReadedById(String doctor, Long id) {
        messageDao.setMessageReadedById(doctor, id);
    }
    /**
     * 家医设置专科消息一键已读
@ -952,11 +957,11 @@ public class MessageService extends BaseService {
    public List<Message> getSpecialistMessages(Message message, Integer page, Integer size) throws Exception{
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "read","over","createTime");
        Sort sort = new Sort(Sort.Direction.DESC,"over","createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, size, sort);
        return messageDao.getSpecialistMessages(message.getReceiver(),message.getRead(),message.getOver(),pageRequest);
        return messageDao.getSpecialistMessages(message.getReceiver(),message.getOver(),pageRequest);
    }
    /**

+ 22 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -421,6 +421,28 @@ public class DoctorMessageController extends BaseController {
        }
    }
    /**
     * 设置某条消息已读
     * @param id
     * @return
     */
    @RequestMapping(value = "setMessageReadedById")
    @ResponseBody
    @ApiOperation("设置某条消息已读")
    @ObserverRequired
    public String setMessageReadedById(@RequestParam @ApiParam(value = "消息id") Long id) {
        try {
            messageService.setMessageReadedById(getUID(), id);
            return write(200, "设置成功");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "设置失败");
        }
    }
    @RequestMapping(value = "getMessageNoticeSetting",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取消息设置")