Commit 284e0528 authored by 18310373984@163.com's avatar 18310373984@163.com

1.打卡管理列表中不能查看到他在原机构的享受服务时的打卡数据2.打卡管理列表界面修改

parent b4fe7fb6
......@@ -3,6 +3,7 @@ package com.hungraim.ltc.pojo.entity.account;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* 打卡记录返回
......@@ -20,6 +21,12 @@ public class ChPunchDetailsVO {
*/
private String organTypeName;
//参保人姓名
private String realName;
//打卡月份
private String month;
/**
* 项目信息
*/
......@@ -28,4 +35,6 @@ public class ChPunchDetailsVO {
* 打卡记录
*/
private List<ChServiceTypeDetailedVO> chPunchDetailVOS;
private List<Map> srvSumTimeVOS;
}
......@@ -31,4 +31,10 @@ public class ChServiceTypeDetailedVO {
private String srvEndPic;
private String srvStartTime;
private String srvEndTime;
//失能人员姓名
private String realName;
}
......@@ -19,6 +19,7 @@ import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author jiaguokai
......@@ -48,5 +49,8 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> {
int getRoleByUserId(@Param("userId") Integer userId,@Param("roleIds") List<String> roleIds );
List<Map> getSrvSumTime(@Param("taskDetailId")Long taskDetailId, @Param("certiCode")String certiCode, @Param("sevStarTime")String sevStarTime, @Param("sevEndTime")String sevEndTime, @Param("modeType")String modeType);
List<ChServiceTypeDetailedVO> getServiceTypeDetailedBySrvPlan(@Param("taskDetailId")Long taskDetailId,@Param("certiCode")String certiCode,@Param("sevStarTime")String sevStarTime,@Param("sevEndTime")String sevEndTime,@Param("modeType")String modeType);
}
......@@ -90,4 +90,9 @@ public interface SrvSendMapper extends BaseMapper<ChSrvSend> {
"t1.SRV_ORGAN_ID = #{srvOrganId} " +
" <when test='realName != null and realName != \"\"'> AND t2.REAL_NAME LIKE CONCAT( '%', CONCAT( #{realName}, '%' ) )</when></script>")
IPage<SearchDisableSimpleVo> buildBedSearchByRealName(Page<SearchDisableSimpleVo> page, Integer srvOrganId, String realName);
@Select("select count(1) from ch_srv_send v,ch_disable_info info where v.disab_info_id=info.disab_info_id \n" +
" and info.certi_code=#{certiCode} and status<>0 ")
Integer getCountSrvSend(String certiCode);//获取失能人员有多少个分配数据
}
......@@ -6,6 +6,7 @@ import com.hungraim.ltc.api.AttachFeignService;
import com.hungraim.ltc.governance.config.PicRoleConfig;
import com.hungraim.ltc.governance.dao.BuildBedMapper;
import com.hungraim.ltc.governance.dao.ServiceTypeDetailedMapper;
import com.hungraim.ltc.governance.dao.SrvSendMapper;
import com.hungraim.ltc.governance.service.IBuildBedService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.account.ChPunchDetailVO;
......@@ -29,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -49,7 +51,8 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
@Autowired
private PicRoleConfig picRoleConfig;
@Resource
private SrvSendMapper srvSendMapper;
@Override
public Result searchOrgBed(BuildBedSearchReq req) {
......@@ -148,10 +151,22 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
if(chPunchDetailsVO==null){
chPunchDetailsVO=new ChPunchDetailsVO();
}
String month=sevStarTime.substring(5,7);//获取当前打卡月份
if(month.startsWith("0")){
month = month.replaceFirst("0","");
}
chPunchDetailsVO.setMonth(month+"月");//返回月份
log.info("chPunchDetailsQuery获取服务机构和服务类型:"+chPunchDetailsVO);
//打卡详情
String modeType = buildBedMapper.selectModeTypeById(taskDetailId);
List<ChServiceTypeDetailedVO> serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailed(taskDetailId,certiCode,sevStarTime, sevEndTime,modeType);
List<ChServiceTypeDetailedVO> serviceTypeDetailed1s = new ArrayList<ChServiceTypeDetailedVO>();
int sendCount=srvSendMapper.getCountSrvSend(certiCode);
if(sendCount>1) {//如果有多个分配记录,则按该方法查询打卡列表
serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailedBySrvPlan(taskDetailId,certiCode,sevStarTime, sevEndTime,modeType);
}else{//否则还按原先逻辑
serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailed(taskDetailId,certiCode,sevStarTime, sevEndTime,modeType);
}
List<String> roleIds = picRoleConfig.getRoleId();
log.info("==========chPunchDetailsQuery====roleIds:{}",roleIds);
int roleByUserId = buildBedMapper.getRoleByUserId(userId,roleIds);
......@@ -171,10 +186,15 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
srvPicList.add(srvEndPic);
}
serviceTypeDetailed1.setSrvPicList(srvPicList);
chPunchDetailsVO.setRealName(serviceTypeDetailed1.getRealName());//失能人员姓名
}
log.info("chPunchDetailsQuery打卡详情:"+serviceTypeDetailed1s);
//获取打卡列表底下总时长
List<Map> timesMap=buildBedMapper.getSrvSumTime(taskDetailId,certiCode,sevStarTime, sevEndTime,modeType);
log.info("timesMap打卡时长:"+timesMap);
chPunchDetailsVO.setRecordData(chPunchDetailVOS);
chPunchDetailsVO.setChPunchDetailVOS(serviceTypeDetailed1s);
chPunchDetailsVO.setSrvSumTimeVOS(timesMap);//打卡列表底下总时长
log.info("chPunchDetailsQuery:"+chPunchDetailsVO);
return chPunchDetailsVO;
}
......
......@@ -101,13 +101,16 @@
<select id="getServiceTypeDetailed" parameterType="Long" resultType="com.hungraim.ltc.pojo.entity.account.ChServiceTypeDetailedVO">
SELECT
to_char(detail.srv_start_time,'YYYY-MM-DD hh24:mi:ss') srvStartTime ,
to_char(detail.srv_end_time,'YYYY-MM-DD hh24:mi:ss') srvEndTime,
case when mode1.MODE_NAME='上门' then to_char(detail.SRV_DATE, 'dd' )
else to_char(detail.SRV_DATE, 'dd' ) end executionTime,
service.SERVICE_TYPE_DETAILED_NAME itemName,
service.SERVICE_TYPE_DETAILED_ID serviceTypeDetailedId,
detail.SRV_START_PIC srvStartPic,
detail.SRV_START_PIC2 srvStartPic2,
detail.SRV_END_PIC srvEndPic
detail.SRV_END_PIC srvEndPic,
info.real_name realName
FROM
CH_SRV_TASK_DETAIL detail
inner JOIN ch_srv_task task ON task.srv_task_id = detail.srv_task_id
......@@ -116,6 +119,7 @@
inner JOIN CH_SRV_TASK_FINISH_ITEM item ON detail.TASK_DETAIL_ID = item.TASK_DETAIL_ID
inner JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
inner join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME
inner join ch_disable_info info on task.disab_info_id=info.disab_info_id
WHERE 1=1
<if test="certiCode != null and certiCode != ''">
and task.DISAB_INFO_ID = (select DISAB_INFO_ID from CH_DISABLE_INFO where CERTI_CODE =#{certiCode})
......@@ -165,4 +169,107 @@
</select>
<select id="getSrvSumTime" parameterType="Long" resultType="java.util.Map">
select resu.executionTime,sum(round((resu.srv_end_time-resu.srv_start_time)*24,1)) sumTime from
(SELECT distinct detail.TASK_DETAIL_ID,detail.srv_start_time,detail.srv_end_time,
to_char(detail.SRV_DATE, 'dd' ) executionTime
FROM
CH_SRV_TASK_DETAIL detail
inner JOIN ch_srv_task task ON task.srv_task_id = detail.srv_task_id
inner JOIN ch_srv_program program on program.PROGRAM_ID=task.PROGRAM_ID
inner JOIN ch_cfg_srv_mode mode1 ON program.srv_mode_id = mode1.mode_id
inner JOIN CH_SRV_TASK_FINISH_ITEM item ON detail.TASK_DETAIL_ID = item.TASK_DETAIL_ID
inner JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
inner join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME
WHERE 1=1
<if test="certiCode != null and certiCode != ''">
and task.DISAB_INFO_ID = (select DISAB_INFO_ID from CH_DISABLE_INFO where CERTI_CODE =#{certiCode})
</if>
<choose>
<when test="modeType == '上门'">
<if test="sevStarTime != null and sevStarTime != ''">
AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
</if>
<if test="sevEndTime != null and sevEndTime != ''">
AND detail.SRV_END_TIME &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd')
</if>
</when>
<otherwise>
<if test="sevStarTime != null and sevStarTime != ''">
AND detail.SRV_DATE &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
</if>
<if test="sevEndTime != null and sevEndTime != ''">
AND detail.SRV_DATE &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd')
</if>
</otherwise>
</choose>
) resu
group by resu.executionTime
</select>
<select id="getServiceTypeDetailedBySrvPlan" parameterType="Long" resultType="com.hungraim.ltc.pojo.entity.account.ChServiceTypeDetailedVO">
SELECT
to_char(detail.srv_start_time,'YYYY-MM-DD hh24:mi:ss') srvStartTime ,
to_char(detail.srv_end_time,'YYYY-MM-DD hh24:mi:ss') srvEndTime,
case when mode1.MODE_NAME='上门' then to_char(detail.SRV_START_TIME, 'dd' )
else to_char(detail.SRV_DATE, 'dd' ) end executionTime,
service.SERVICE_TYPE_DETAILED_NAME itemName,
service.SERVICE_TYPE_DETAILED_ID serviceTypeDetailedId,
detail.SRV_START_PIC srvStartPic,
detail.SRV_START_PIC2 srvStartPic2,
detail.SRV_END_PIC srvEndPic,
info.real_name realName
FROM
CH_SRV_TASK_DETAIL detail
inner JOIN ch_srv_task task ON task.srv_task_id = detail.srv_task_id
inner JOIN ch_srv_program program on program.PROGRAM_ID=task.PROGRAM_ID
inner JOIN ch_cfg_srv_mode mode1 ON program.srv_mode_id = mode1.mode_id
inner JOIN CH_SRV_TASK_FINISH_ITEM item ON detail.TASK_DETAIL_ID = item.TASK_DETAIL_ID
inner JOIN CH_SRV_ORGAN_PROJECT CSOP ON CSOP.PROJECT_ID = item.ITEM_ID
inner join CH_SERVICE_TYPE_DETAILED service on service.SERVICE_TYPE_DETAILED_ID = CSOP.ITEM_NAME
inner join ch_disable_info info on task.disab_info_id=info.disab_info_id
inner join ch_srv_send s on s.disab_info_id=task.disab_info_id
WHERE 1=1
<choose>
<when test="modeType == '上门'">
and detail.srv_start_time between s.allot_time and s.stop_time--打卡时间在分配有效时间内
and detail.srv_end_time between s.allot_time and s.stop_time--打卡时间在分配有效时间内
</when>
<otherwise>
and detail.SRV_DATE between s.allot_time and s.stop_time--打卡时间在分配有效时间内
and detail.SRV_DATE between s.allot_time and s.stop_time--打卡时间在分配有效时间内
</otherwise>
</choose>
<if test="certiCode != null and certiCode != ''">
and task.DISAB_INFO_ID = (select DISAB_INFO_ID from CH_DISABLE_INFO where CERTI_CODE =#{certiCode})
</if>
<choose>
<when test="modeType == '上门'">
<if test="sevStarTime != null and sevStarTime != ''">
AND detail.SRV_START_TIME &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
</if>
<if test="sevEndTime != null and sevEndTime != ''">
AND detail.SRV_END_TIME &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd')
</if>
</when>
<otherwise>
<if test="sevStarTime != null and sevStarTime != ''">
AND detail.SRV_DATE &gt;= TO_DATE (substr(#{sevStarTime},1,10), 'yyyy-mm-dd')
</if>
<if test="sevEndTime != null and sevEndTime != ''">
AND detail.SRV_DATE &lt;= TO_DATE (substr(#{sevEndTime},1,10), 'yyyy-mm-dd')
</if>
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment