|
@ -370,7 +370,7 @@ public class DailyReportUploadService {
|
|
|
dailyReportUploadDO = dailyReportUploadDao.save(dailyReportUploadDO);
|
|
|
for (BaseDailyReportDetailDO tmp :detailDOList){
|
|
|
tmp.setReportId(dailyReportUploadDO.getId());
|
|
|
if (tmp.getReportItemFlag()==true){//新则自建关联项目
|
|
|
if (tmp.isReportItemFlag()==true){//新则自建关联项目
|
|
|
String title = tmp.getReportItemTitle();
|
|
|
BaseDailyReportItemDO reportItemDO = new BaseDailyReportItemDO();
|
|
|
reportItemDO.setState(0);
|
|
@ -409,22 +409,29 @@ public class DailyReportUploadService {
|
|
|
if (boosSenderIds.size()>0){
|
|
|
boosID=boosSenderIds.get(0);
|
|
|
}
|
|
|
List<BaseDoctorRoleDO> roleDOS = doctorRoleDao.findByDoctorCode(doctorId);
|
|
|
if (roleDOS.size()==0){//普通员工 需要查询对应上级人员
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
sql = " select role.doctor_code from base_doctor_role role INNER JOIN base_doctor_hospital dh " +
|
|
|
"on role.doctor_code = dh.doctor_code and dh.dept_code='"+doctorHospitalDO.getDeptCode()+"' " +
|
|
|
"where role.role_code='deptAdmin' ";
|
|
|
List<String> deptAdmins = jdbcTemplate.queryForList(sql,String.class);
|
|
|
if (deptAdmins.size()>0){
|
|
|
senderID = deptAdmins.get(0);
|
|
|
}else {
|
|
|
senderID=boosID;
|
|
|
//优先查询核实人指定表无记录再按默认逻辑
|
|
|
sql = " select verify_user from base_daily_report_verify where upload_user='"+doctorId+"' and del=1 ";
|
|
|
List<String> verifyList = jdbcTemplate.queryForList(sql,String.class);
|
|
|
if (verifyList.size()>0){
|
|
|
senderID = verifyList.get(0);
|
|
|
}else {
|
|
|
List<BaseDoctorRoleDO> roleDOS = doctorRoleDao.findByDoctorCode(doctorId);
|
|
|
if (roleDOS.size()==0){//普通员工 需要查询对应上级人员
|
|
|
if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
|
|
|
BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
|
|
|
sql = " select role.doctor_code from base_doctor_role role INNER JOIN base_doctor_hospital dh " +
|
|
|
"on role.doctor_code = dh.doctor_code and dh.dept_code='"+doctorHospitalDO.getDeptCode()+"' " +
|
|
|
"where role.role_code='deptAdmin' ";
|
|
|
List<String> deptAdmins = jdbcTemplate.queryForList(sql,String.class);
|
|
|
if (deptAdmins.size()>0){
|
|
|
senderID = deptAdmins.get(0);
|
|
|
}else {
|
|
|
senderID=boosID;
|
|
|
}
|
|
|
}
|
|
|
}else {//部门管理员 发送对象为老板
|
|
|
senderID = boosID;
|
|
|
}
|
|
|
}else {//部门管理员 发送对象为老板
|
|
|
senderID = boosID;
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(senderID)){
|
|
|
BaseDoctorDO remindDoctorDO = baseDoctorDao.findById(senderID);
|
|
@ -466,6 +473,7 @@ public class DailyReportUploadService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public BaseDailyReportUploadDO verifiedItem(String doctorId,String reportId,List<BaseDailyReportDetailDO> detailDOList) throws Exception {
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findById(doctorId);
|
|
|
String nowDate = DateUtil.getStringDateShort();
|
|
|
if (null==doctorDO){
|
|
|
throw new Exception("无权限审核");
|
|
|
}
|
|
@ -474,10 +482,13 @@ public class DailyReportUploadService {
|
|
|
if (null==dailyReportUploadDO){
|
|
|
throw new Exception("核实记录未查询到");
|
|
|
}
|
|
|
if (DateUtil.getDays(nowDate,dailyReportUploadDO.getReportDate())>7){
|
|
|
throw new Exception("上传记录已超过7天无法再次操作");
|
|
|
}
|
|
|
if(detailDOList.size()>0){//无完成事项内容
|
|
|
boolean doubt =false;
|
|
|
for (BaseDailyReportDetailDO tmp:detailDOList){
|
|
|
if (1==tmp.getDoubt()){
|
|
|
if (1==tmp.getDoubt()&&(null==tmp.getDoubtState()||0==tmp.getDoubtState())){
|
|
|
doubt = true;
|
|
|
}
|
|
|
tmp.setVerificationTime(new Date());
|
|
@ -657,6 +668,7 @@ public class DailyReportUploadService {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public BaseDailyReportUploadDO selectReportById(String reportId) throws Exception {
|
|
|
String nowDate = DateUtil.getStringDateShort();
|
|
|
BaseDailyReportUploadDO reportUploadDO = dailyReportUploadDao.findOne(reportId);
|
|
|
if (null==reportUploadDO){
|
|
|
throw new Exception("未找到日报记录");
|
|
@ -666,6 +678,11 @@ public class DailyReportUploadService {
|
|
|
List<BaseDailyReportLogDO> dailyReportLogDOList = dailyReportLogDao.findByReportId(reportUploadDO.getId());
|
|
|
reportUploadDO.setDailyReportLogDOList(dailyReportLogDOList);
|
|
|
}
|
|
|
if (DateUtil.getDays(nowDate,reportUploadDO.getReportDate())>7){
|
|
|
reportUploadDO.setVerifiedRepeatFlag(false);
|
|
|
}else {
|
|
|
reportUploadDO.setVerifiedRepeatFlag(true);
|
|
|
}
|
|
|
return reportUploadDO;
|
|
|
}
|
|
|
|
|
@ -985,7 +1002,7 @@ public class DailyReportUploadService {
|
|
|
* @param endDate
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray selectListByTotal(String dept, String idType, String status, String state, String startDate, String endDate, String name) {
|
|
|
public JSONArray selectListByTotal(String dept, String idType, String status, String state, String startDate, String endDate, String name,Integer doubtType) {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
Date startTime = DateUtil.strToDateShort(startDate);
|
|
|
Date endDateTime = DateUtil.strToDateShort(endDate);
|
|
@ -1021,6 +1038,9 @@ public class DailyReportUploadService {
|
|
|
doctorSql += " and d.id not in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' ) ";
|
|
|
}
|
|
|
}
|
|
|
if (null!=doubtType){
|
|
|
doctorSql += " and d.id in(select d1.doctor_id from base_doctor_daily_report_upload d1 inner join base_daily_report_detail rd on d1.id = rd.report_id and rd.doubt_type='"+doubtType+"' where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' ) ";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(state)) {//核实状态
|
|
|
doctorSql +=" and d.id in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date +"' and d1.state='"+state+"' ) ";
|
|
|
}
|
|
@ -1054,7 +1074,8 @@ public class DailyReportUploadService {
|
|
|
* @param name total
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray selectListInfoByTotal(String dept, String idType, String status, String state, String startDate, String endDate, String name) {
|
|
|
public JSONArray selectListInfoByTotal(String dept, String idType, String status, String state, String startDate, String endDate, String name,
|
|
|
Integer doubtType) {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
Date startTime = DateUtil.strToDateShort(startDate);
|
|
|
Date endDateTime = DateUtil.strToDateShort(endDate);
|
|
@ -1090,6 +1111,9 @@ public class DailyReportUploadService {
|
|
|
doctorSql += " and d.id not in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' ) ";
|
|
|
}
|
|
|
}
|
|
|
if (null!=doubtType){
|
|
|
doctorSql += " and d.id in(select d1.doctor_id from base_doctor_daily_report_upload d1 inner join base_daily_report_detail rd on d1.id = rd.report_id and rd.doubt_type='"+doubtType+"' where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' ) ";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(state)) {//核实状态
|
|
|
doctorSql += " and d.id in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' and d1.state='" + state + "' ) ";
|
|
|
}
|
|
@ -1138,6 +1162,165 @@ public class DailyReportUploadService {
|
|
|
return array;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取存疑列表列表的时间及数量
|
|
|
* @param dept
|
|
|
* @param idType
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param name
|
|
|
* @param doubtType
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray selectListByTotalDoubt(String dept, String idType, String startDate, String endDate, String name,Integer doubtType) {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
Date startTime = DateUtil.strToDateShort(startDate);
|
|
|
Date endDateTime = DateUtil.strToDateShort(endDate);
|
|
|
int i=0;
|
|
|
do{
|
|
|
startTime = DateUtil.getPreDays(startTime, i);
|
|
|
String str = DateUtil.dateToStrShort(startTime);
|
|
|
list.add(str);
|
|
|
i=1;
|
|
|
}while (startTime.before(endDateTime));
|
|
|
JSONArray array = new JSONArray();
|
|
|
for ( i = 0; i < list.size(); i++) {
|
|
|
String date = list.get(i);
|
|
|
String doubtSql = " select count(distinct rd.id) as 'total' from base_doctor_daily_report_upload up " +
|
|
|
" inner join base_doctor d on up.doctor_id = d.id and d.del=1 and d.identity=0 " +
|
|
|
" inner join base_daily_report_detail rd on up.id = rd.report_id " +
|
|
|
" where rd.doubt=1 and up.report_date >='" + date + "' and up.report_date<='" + date + "' and up.state=1 ";
|
|
|
|
|
|
String deptCondition = "";
|
|
|
if (StringUtils.isNoneBlank(dept)) {
|
|
|
deptCondition += " (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(idType)) {
|
|
|
doubtSql += " and d.id_type = '" + idType + "' ";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(deptCondition)) {
|
|
|
doubtSql += " and d.id IN " + deptCondition;
|
|
|
}
|
|
|
if (null!=doubtType){
|
|
|
if (0==doubtType){
|
|
|
doubtSql += " and rd.doubt_type is not null ";
|
|
|
}else{
|
|
|
doubtSql += " and rd.doubt_type='"+doubtType+"' ";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(name)) {
|
|
|
doubtSql += " and d.name LIKE '%" + name + "%' ";
|
|
|
}
|
|
|
Map<String, Object> map = jdbcTemplate.queryForMap(doubtSql);
|
|
|
Integer total = 0;
|
|
|
if (map != null) {
|
|
|
if (map.get("total") != null) {
|
|
|
total = Integer.parseInt(map.get("total").toString());
|
|
|
}
|
|
|
}
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("time", date);
|
|
|
object.put("total", total);
|
|
|
array.add(object);
|
|
|
}
|
|
|
return array;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取存疑列表的具体人员信息
|
|
|
*
|
|
|
* @param dept
|
|
|
* @param idType
|
|
|
* @param startDate
|
|
|
* @param endDate
|
|
|
* @param name
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray selectListInfoByTotalDoubt(String dept, String idType, String startDate, String endDate, String name,
|
|
|
Integer doubtType) {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
Date startTime = DateUtil.strToDateShort(startDate);
|
|
|
Date endDateTime = DateUtil.strToDateShort(endDate);
|
|
|
int i=0;
|
|
|
do{
|
|
|
startTime = DateUtil.getPreDays(startTime, i);
|
|
|
String str = DateUtil.dateToStrShort(startTime);
|
|
|
list.add(str);
|
|
|
i=1;
|
|
|
}while (startTime.before(endDateTime));
|
|
|
JSONArray array = new JSONArray();
|
|
|
for (i = 0; i < list.size(); i++) {
|
|
|
String date = list.get(i);
|
|
|
String doubtSql = " select up.doctor_id,up.doctor_name,rd.id detailId,rd.report_id uploadId,rd.sort,rd.report_content, " +
|
|
|
" rd.completion_schedule,rd.actual_completion_hour,rd.completion_hour, " +
|
|
|
" rd.state,DATE_FORMAT(rd.verification_time,'%Y-%m-%d %H:%i:%S') verification_time,rd.remark,rd.doubt,rd.doubt_state, " +
|
|
|
" rd.doubt_remark,rd.report_item_id,rd.report_item_name,rd.verification_user_name,rd.doubt_type " +
|
|
|
" from base_doctor_daily_report_upload up " +
|
|
|
" inner join base_doctor d on up.doctor_id = d.id and d.del=1 and d.identity=0 " +
|
|
|
" inner join base_daily_report_detail rd on up.id = rd.report_id " +
|
|
|
" where rd.doubt=1 and up.report_date >='" + date + "' and up.report_date<='" + date + "' and up.state=1 ";
|
|
|
|
|
|
String deptCondition = "";
|
|
|
if (StringUtils.isNoneBlank(dept)) {
|
|
|
deptCondition += " (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(idType)) {
|
|
|
doubtSql += " and d.id_type = '" + idType + "')";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(deptCondition)) {
|
|
|
doubtSql += " and d.id IN " + deptCondition;
|
|
|
}
|
|
|
if (null!=doubtType){
|
|
|
if(0==doubtType){
|
|
|
doubtSql += " and rd.doubt_type is not null ";
|
|
|
}else {
|
|
|
doubtSql += " and rd.doubt_type='"+doubtType+"' ";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(name)) {
|
|
|
doubtSql += " and d.name LIKE '%" + name + "%' ";
|
|
|
}
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(doubtSql);
|
|
|
for (Map<String, Object> map : mapList) {
|
|
|
String id = map.get("doctor_id").toString();
|
|
|
List<BaseDoctorHospitalDO> hospitalDOList = baseDoctorHospitalDao.findByDoctorCode(id);
|
|
|
map.put("deptInfo", hospitalDOList);
|
|
|
String stateMap = map.get("state").toString();
|
|
|
String doubtState = map.get("doubt_state")==null?"":map.get("doubt_state").toString();
|
|
|
String doubt_type = map.get("doubt_type")==null?"":map.get("doubt_type").toString();
|
|
|
if("1".equals(stateMap)){
|
|
|
map.put("verifiedState", "已核实");
|
|
|
} else {
|
|
|
map.put("verifiedState", "未核实");
|
|
|
}
|
|
|
map.put("doubt_state", "");
|
|
|
if (StringUtils.isNotBlank(doubtState)){
|
|
|
if("1".equals(doubtState)){
|
|
|
map.put("doubt_state", "存疑已核实");
|
|
|
} else {
|
|
|
map.put("doubt_state", "存疑未核实");
|
|
|
}
|
|
|
}
|
|
|
map.put("doubt_type", "");
|
|
|
if (StringUtils.isNotBlank(doubt_type)){
|
|
|
if("1".equals(doubt_type)){
|
|
|
map.put("doubt_type", "不饱和存疑");
|
|
|
} else if ("2".equals(doubt_type)){
|
|
|
map.put("doubt_type", "效率存疑");
|
|
|
}else {
|
|
|
map.put("doubt_type", "");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("time", date);
|
|
|
object.put("list", mapList);
|
|
|
array.add(object);
|
|
|
}
|
|
|
return array;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查下上报最新一次记录
|
|
|
* @param doctor
|
|
@ -1389,6 +1572,8 @@ public class DailyReportUploadService {
|
|
|
Integer weishangbaoTotal = 0;
|
|
|
Integer verifiedTotal = 0;
|
|
|
Integer notVerifiedTotal = 0;
|
|
|
Integer baoheDoubt = 0;
|
|
|
Integer xiaolvDoubt = 0;
|
|
|
//已上传
|
|
|
Map<String, Object> yishangchaungMap = jdbcTemplate.queryForMap(sql);
|
|
|
if (yishangchaungMap != null) {
|
|
@ -1443,19 +1628,54 @@ public class DailyReportUploadService {
|
|
|
if (level==2){
|
|
|
notVerifiedTotalSql +=" and d.doctor_id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) ";
|
|
|
}
|
|
|
//正常
|
|
|
|
|
|
Map<String, Object> yichangMap = jdbcTemplate.queryForMap(notVerifiedTotalSql);
|
|
|
if (yichangMap != null) {
|
|
|
if (yichangMap.get("total") != null) {
|
|
|
notVerifiedTotal = Integer.parseInt(yichangMap.get("total").toString());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//不饱和存疑
|
|
|
String baoheTotalSql = "select COUNT(de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
|
|
|
" on de.report_id = d.id where de.doubt_type=1 ";
|
|
|
if (StringUtils.isNoneBlank(startDate)) {
|
|
|
baoheTotalSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
|
|
|
}
|
|
|
if (level==2){
|
|
|
baoheTotalSql +=" and d.doctor_id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) ";
|
|
|
}
|
|
|
Map<String, Object> baoheMap = jdbcTemplate.queryForMap(baoheTotalSql);
|
|
|
if (baoheMap != null) {
|
|
|
if (baoheMap.get("total") != null) {
|
|
|
baoheDoubt = Integer.parseInt(baoheMap.get("total").toString());
|
|
|
}
|
|
|
}
|
|
|
//效率存疑
|
|
|
String xiaolvTotalSql = "select COUNT(de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
|
|
|
" on de.report_id = d.id where de.doubt_type=2 ";
|
|
|
if (StringUtils.isNoneBlank(startDate)) {
|
|
|
xiaolvTotalSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
|
|
|
}
|
|
|
if (level==2){
|
|
|
xiaolvTotalSql +=" and d.doctor_id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) ";
|
|
|
}
|
|
|
Map<String, Object> xiaolvMap = jdbcTemplate.queryForMap(xiaolvTotalSql);
|
|
|
if (xiaolvMap != null) {
|
|
|
if (xiaolvMap.get("total") != null) {
|
|
|
xiaolvDoubt = Integer.parseInt(xiaolvMap.get("total").toString());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
object.put("total", total);//总人次
|
|
|
object.put("yishangbaoTotal", yishangbaoTotal);//已上报
|
|
|
object.put("weishangbaoTotal", weishangbaoTotal);//未上报
|
|
|
object.put("verifiedTotal", verifiedTotal);//已核实
|
|
|
object.put("notVerifiedTotal", notVerifiedTotal);//未核实
|
|
|
object.put("shangchuanTotal", shangchuanTotal);//上传总次数
|
|
|
object.put("baoheDoubt", baoheDoubt);//不饱和存疑数量
|
|
|
object.put("xiaolvDoubt", xiaolvDoubt);//效率存疑数量
|
|
|
object.put("doubtTotal", baoheDoubt+xiaolvDoubt);//存疑总数
|
|
|
return object;
|
|
|
}
|
|
|
|
|
@ -1517,6 +1737,8 @@ public class DailyReportUploadService {
|
|
|
Integer notVerified=0;//未核实
|
|
|
Integer verified=0;//已核实
|
|
|
Integer shangchuanTotal=0;//上传总次数
|
|
|
Integer baoheDoubt=0;//饱和度存疑次数
|
|
|
Integer xiaolvDoubt=0;//效益存疑数量
|
|
|
|
|
|
if (StringUtils.isNoneBlank(startDate)) {
|
|
|
sql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
|
|
@ -1560,24 +1782,41 @@ public class DailyReportUploadService {
|
|
|
//已核实数量
|
|
|
String verifiedSql = "select COUNT(DISTINCT d.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
|
|
|
" on d.id = de.report_id where de.state=1 ";
|
|
|
//不饱和存疑
|
|
|
String bubaoheSql = "select COUNT(DISTINCT de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
|
|
|
" on d.id = de.report_id where de.state=1 and de.doubt_type=1 ";
|
|
|
//效率存疑
|
|
|
String xiaolvSql = "select COUNT(DISTINCT de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
|
|
|
" on d.id = de.report_id where de.state=1 and de.doubt_type=2 ";
|
|
|
|
|
|
if (StringUtils.isNoneBlank(startDate)) {
|
|
|
notVerifiedSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
|
|
|
verifiedSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
|
|
|
bubaoheSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
|
|
|
xiaolvSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(deptCondition)) {
|
|
|
notVerifiedSql += " and d.doctor_id IN " + deptCondition;
|
|
|
verifiedSql += " and d.doctor_id IN " + deptCondition;
|
|
|
bubaoheSql += " and d.doctor_id IN " + deptCondition;
|
|
|
xiaolvSql += " and d.doctor_id IN " + deptCondition;
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(idTypeCondition)) {
|
|
|
notVerifiedSql += " and d.doctor_id IN " + idTypeCondition;
|
|
|
verifiedSql += " and d.doctor_id IN " + idTypeCondition;
|
|
|
bubaoheSql += " and d.doctor_id IN " + idTypeCondition;
|
|
|
xiaolvSql += " and d.doctor_id IN " + idTypeCondition;
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(name)) {
|
|
|
notVerifiedSql += " and d.doctor_name like '%" + name + "%'";
|
|
|
verifiedSql += " and d.doctor_name like '%" + name + "%'";
|
|
|
bubaoheSql += " and d.doctor_name like '%" + name + "%'";
|
|
|
xiaolvSql += " and d.doctor_name like '%" + name + "%'";
|
|
|
}
|
|
|
notVerified = jdbcTemplate.queryForObject(notVerifiedSql,Integer.class);
|
|
|
verified = jdbcTemplate.queryForObject(verifiedSql,Integer.class);
|
|
|
baoheDoubt = jdbcTemplate.queryForObject(bubaoheSql,Integer.class);
|
|
|
xiaolvDoubt = jdbcTemplate.queryForObject(xiaolvSql,Integer.class);
|
|
|
|
|
|
//上传总次数
|
|
|
shangchuanTotal = jdbcTemplate.queryForObject(shangchuanTotalSql,Integer.class);
|
|
@ -1588,6 +1827,9 @@ public class DailyReportUploadService {
|
|
|
object.put("notVerified", notVerified);//未核实数量
|
|
|
object.put("verified", verified);//已核实数量
|
|
|
object.put("shangchuanTotal", shangchuanTotal);//上传总次数
|
|
|
object.put("baoheDoubt", baoheDoubt);//饱和度存疑次数
|
|
|
object.put("xiaolvDoubt", xiaolvDoubt);//效率存疑次数
|
|
|
object.put("doubtTotal", baoheDoubt+xiaolvDoubt);//存疑总数
|
|
|
return object;
|
|
|
}
|
|
|
|
|
@ -2108,7 +2350,8 @@ public class DailyReportUploadService {
|
|
|
"CASE up.leave_state WHEN 1 THEN '请假' else '未请假' END as 'leave_state',IFNULL(up.leave_hour,0) leave_hour, " +
|
|
|
"it.title,it.content,rd.sort,rd.report_content,IFNULL(rd.actual_completion_hour,IFNULL(rd.completion_hour,0)) 'completion_hour', " +
|
|
|
"DATE_FORMAT(rd.create_time,'%Y-%m-%d %H:%i:%S') create_time,DATE_FORMAT(rd.verification_time,'%Y-%m-%d %H:%i:%S') verification_time," +
|
|
|
" CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt', rd.remark " +
|
|
|
" CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt', " +
|
|
|
" CASE rd.doubt WHEN 1 THEN '不饱和存疑' WHEN 2 THEN '效率存疑' ELSE null END as 'doubtType', rd.remark " +
|
|
|
"from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id " +
|
|
|
"INNER JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 LEFT JOIN " +
|
|
|
"base_daily_report_detail rd on up.id = rd.report_id " +
|
|
@ -2166,7 +2409,8 @@ public class DailyReportUploadService {
|
|
|
"CASE up.leave_state WHEN 1 THEN '请假' else '未请假' END as 'leave_state',IFNULL(up.leave_hour,0) leave_hour, " +
|
|
|
"it.title,it.content,rd.sort,rd.report_content,IFNULL(rd.actual_completion_hour,IFNULL(rd.completion_hour,0)) 'completion_hour', " +
|
|
|
"DATE_FORMAT(rd.create_time,'%Y-%m-%d %H:%i:%S') create_time,DATE_FORMAT(rd.verification_time,'%Y-%m-%d %H:%i:%S') verification_time," +
|
|
|
" CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt', rd.remark " +
|
|
|
" CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt'," +
|
|
|
" CASE rd.doubt WHEN 1 THEN '不饱和存疑' WHEN 2 THEN '效率存疑' ELSE null END as 'doubtType', rd.remark " +
|
|
|
"from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id " +
|
|
|
"INNER JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 LEFT JOIN " +
|
|
|
"base_daily_report_detail rd on up.id = rd.report_id " +
|
|
@ -2332,14 +2576,14 @@ public class DailyReportUploadService {
|
|
|
public void UserReportListExcel(List<Map<String,Object>> userCompleteList,OutputStream os,String startDate,String endDate) throws IOException, WriteException {
|
|
|
WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
|
|
|
WritableSheet sheet = wwb.createSheet("sheet", 1);
|
|
|
String[] header = {"员工完成情况("+startDate+"至"+endDate+")","","","","","","","","","","","","","","","","",""};//
|
|
|
String[] header = {"员工完成情况("+startDate+"至"+endDate+")","","","","","","","","","","","","","","","","","",""};//
|
|
|
int k = 0;
|
|
|
for (String h : header) {
|
|
|
addCell(sheet, 0, k, h);//表名,行,列,header
|
|
|
k++;
|
|
|
}
|
|
|
sheet.mergeCells(0, 0, header.length-1, 0);
|
|
|
header = new String[]{"人员", "部门","岗位","日期", "上报日期", "请假状态", "请假时长","关联项目","关联项目内容","事项序号", "事项内容", "用时", "创建时间", "上级核实","核实人员","核实时间","是否存疑","备注"};
|
|
|
header = new String[]{"人员", "部门","岗位","日期", "上报日期", "请假状态", "请假时长","关联项目","关联项目内容","事项序号", "事项内容", "用时", "创建时间", "上级核实","核实人员","核实时间","是否存疑","存疑类型","备注"};
|
|
|
int i = 0;
|
|
|
for (String h : header) {
|
|
|
addCell(sheet, 1, i, h);
|
|
@ -2368,6 +2612,7 @@ public class DailyReportUploadService {
|
|
|
sheet.mergeCells(a3+1, b3, c3, d3);//请假
|
|
|
sheet.mergeCells(a3+2, b3, c3, d3);//请假时长
|
|
|
doctorIdMerge = doctorId;
|
|
|
reportDateMerge = reportDate;
|
|
|
b1=i;d1=0;
|
|
|
b3=i;d3=0;
|
|
|
}else {//同一个医生。
|
|
@ -2406,7 +2651,8 @@ public class DailyReportUploadService {
|
|
|
addCell(sheet,i , 14,null==completeTmp.get("verification_user_name")?"":completeTmp.get("verification_user_name").toString());
|
|
|
addCell(sheet,i , 15,null==completeTmp.get("verification_time")?"":completeTmp.get("verification_time").toString());
|
|
|
addCell(sheet,i , 16,null==completeTmp.get("doubt")?"":completeTmp.get("doubt").toString());
|
|
|
addCell(sheet,i , 17,null==completeTmp.get("remark")?"":completeTmp.get("remark").toString());
|
|
|
addCell(sheet,i , 17,null==completeTmp.get("doubtType")?"":completeTmp.get("doubtType").toString());
|
|
|
addCell(sheet,i , 18,null==completeTmp.get("remark")?"":completeTmp.get("remark").toString());
|
|
|
i++;
|
|
|
}
|
|
|
sheet.mergeCells(a1, b1, c1, d1);
|