Commit 197dd574 authored by zhangwanglin's avatar zhangwanglin

打卡记录管理详情显示图片

parent 49994246
......@@ -2,6 +2,8 @@ package com.hungraim.ltc.pojo.entity.account;
import lombok.Data;
import java.util.List;
/**
* @author mq
*/
......@@ -21,4 +23,12 @@ public class ChServiceTypeDetailedVO {
*/
private String serviceTypeDetailedId;
private List<String> srvPicList;
private String srvStartPic;
private String srvStartPic2;
private String srvEndPic;
}
package com.hungraim.ltc.governance.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Data
@ConfigurationProperties(prefix = "pic.view")
public class PicRoleConfig {
private List<String> roleId;
}
......@@ -21,6 +21,7 @@ import com.hungraim.ltc.pojo.vo.disable.SearchDisableSimpleVo;
import com.hungraim.ltc.pojo.vo.governance.*;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import com.hungraim.ltc.util.TokenParsingUtil;
import lombok.extern.slf4j.Slf4j;
import oracle.sql.DATE;
import org.apache.commons.lang.StringUtils;
......@@ -382,8 +383,9 @@ public class BuildBedController {
* @return
*/
@GetMapping("/chPunchDetailsQuery")
public Result chPunchDetailsQuery(Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime){
ChPunchDetailsVO chPunchDetailsVO = buildBedService.chPunchDetailsQuery(taskDetailId,certiCode,sevStarTime,sevEndTime);
public Result chPunchDetailsQuery(@RequestHeader("Authorization") String token,Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime){
Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
ChPunchDetailsVO chPunchDetailsVO = buildBedService.chPunchDetailsQuery(taskDetailId,certiCode,sevStarTime,sevEndTime,userId);
return Result.success(chPunchDetailsVO);
}
......
......@@ -45,4 +45,6 @@ public interface BuildBedMapper extends BaseMapper<ChSrvBuildBed> {
List<ChServiceTypeVO> selectServiceTypeDetailed();
String selectModeTypeById(@Param("pId")Long pId);
int getRoleByUserId(@Param("userId") Integer userId,@Param("roleIds") List<String> roleIds );
}
......@@ -53,5 +53,5 @@ public interface IBuildBedService extends IService<ChSrvBuildBed> {
* 打卡详情
* @param taskDetailId
*/
ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime);
ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode,String sevStarTime,String sevEndTime,Integer userId);
}
......@@ -3,6 +3,7 @@ package com.hungraim.ltc.governance.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.service.IBuildBedService;
......@@ -24,6 +25,7 @@ import com.hungraim.ltc.util.ResultCode;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -44,6 +46,9 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
private final ServiceTypeDetailedMapper serviceTypeDetailed;
@Autowired
private PicRoleConfig picRoleConfig;
@Override
......@@ -122,7 +127,7 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
* @param taskDetailId
*/
@Override
public ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode, String sevStarTime,String sevEndTime) {
public ChPunchDetailsVO chPunchDetailsQuery(Long taskDetailId,String certiCode, String sevStarTime,String sevEndTime,Integer userId) {
List<ChPunchDetailVO> chPunchDetailVOS = new ArrayList<>();
//获取项目信息
List<ChServiceTypeVO> chServiceTypeDetaileds = buildBedMapper.selectServiceTypeDetailed();
......@@ -146,6 +151,26 @@ public class BuildBedServiceImpl extends ServiceImpl<BuildBedMapper, ChSrvBuildB
//打卡详情
String modeType = buildBedMapper.selectModeTypeById(taskDetailId);
List<ChServiceTypeDetailedVO> serviceTypeDetailed1s = buildBedMapper.getServiceTypeDetailed(taskDetailId,certiCode,sevStarTime, sevEndTime,modeType);
List<String> roleIds = picRoleConfig.getRoleId();
log.info("==========chPunchDetailsQuery====roleIds:{}",roleIds);
int roleByUserId = buildBedMapper.getRoleByUserId(userId,roleIds);
for (ChServiceTypeDetailedVO serviceTypeDetailed1 : serviceTypeDetailed1s) {
String srvStartPic = serviceTypeDetailed1.getSrvStartPic();
String srvStartPic2 = serviceTypeDetailed1.getSrvStartPic2();
String srvEndPic = serviceTypeDetailed1.getSrvEndPic();
List<String> srvPicList = new ArrayList<>();
if(srvStartPic!=null) {
srvPicList.add(srvStartPic);
}
// 机构端能护理人员的拍照和第三张拍照,其他都能看到 等于0角色不是机构端
if(roleByUserId == 0 && srvStartPic2!=null) {
srvPicList.add(srvStartPic2);
}
if(srvEndPic!=null) {
srvPicList.add(srvEndPic);
}
serviceTypeDetailed1.setSrvPicList(srvPicList);
}
log.info("chPunchDetailsQuery打卡详情:"+serviceTypeDetailed1s);
chPunchDetailsVO.setRecordData(chPunchDetailVOS);
chPunchDetailsVO.setChPunchDetailVOS(serviceTypeDetailed1s);
......
......@@ -88,7 +88,10 @@
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
service.SERVICE_TYPE_DETAILED_ID serviceTypeDetailedId,
detail.SRV_START_PIC srvStartPic,
detail.SRV_START_PIC2 srvStartPic2,
detail.SRV_END_PIC srvEndPic
FROM
CH_SRV_TASK_DETAIL detail
inner JOIN ch_srv_task task ON task.srv_task_id = detail.srv_task_id
......@@ -135,6 +138,15 @@
LEFT JOIN CH_SERVICE_TYPE e ON d.PARA_ID = e.SERVICE_TYPE_ID
</select>
<select id="getRoleByUserId" resultType="java.lang.Integer">
select count(*) from LTC_USER_ROLE r where r.user_id = #{userId}
<if test="roleIds != null">
and r.role_id in
<foreach collection="roleIds" item="roleIds" open="(" close=")" separator=",">
#{roleIds}
</foreach>
</if>
</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