Commit ce8123f5 authored by zhangwanglin's avatar zhangwanglin

Merge branch 'uat_ch_master' into dev_ch_master

# Conflicts: # apply/apply-service/src/main/java/com/hungraim/ltc/service/SrvOrganEmpService.java # apply/apply-service/src/main/java/com/hungraim/ltc/service/impl/SrvOrganEmpServiceImpl.java
parents 8801e2d2 cf6fa110
......@@ -230,17 +230,16 @@ public class SrvOrganController {
* @return 返回操作状态
*/
@PutMapping("/status")
public Result updateSrvEmpStatus(Long empId, Short isLock) {
public Result<String> updateSrvEmpStatus(Long empId, Short isLock,String certifNum) {
if (null == empId || null == isLock) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
srvOrganEmpService.updateSrvEmpStatus(empId, isLock);
return Result.success();
int result = srvOrganEmpService.updateSrvEmpStatus(empId, isLock,certifNum);
return Result.success(result>0?"":"修改状态失败,请检查是否已存在有效数据");
}
/**
* 获取护理人员类别信息
*
* @return 返回护理人员类别列表
*/
@GetMapping("/srvEmpCateList")
......@@ -323,15 +322,24 @@ public class SrvOrganController {
FileUtils.exportResponse(workbook,fileName,response);
}
@GetMapping("/chSrvTaskDetailExport")
public void chSrvTaskDetailExport(Long empId, String empName,String status,String sevrTime,HttpServletResponse response){
Workbook workbook = srvOrganEmpService.chSrvTaskDetailExport(empId,empName,status,sevrTime);
// 命名表格
String fileName = "护理人员打卡记录导出.xlsx";
FileUtils.exportResponse(workbook,fileName,response);
}
/**
* 打卡查询
* @param empId
* @param status 0未执行 1执行中 2已执行 3已失效 4已完成
* @return
*/
@GetMapping("/chSrvTaskDetailQuery")
public Result chSrvTaskDetailQuery(Integer pageNum, Integer pageSize,Long empId){
public Result chSrvTaskDetailQuery(Integer pageNum, Integer pageSize,Long empId, String empName,String status,String sevrTime){
Page<ChSrvTaskDetail2Vo> page = new Page<>(pageNum, pageSize);
page = srvOrganEmpService.chSrvTaskDetailQuery(page,empId);
page = srvOrganEmpService.chSrvTaskDetailQuery(page,empId,empName,status,sevrTime);
if(page.getSize()>0){
return Result.success(page);
}else {
......@@ -348,7 +356,6 @@ public class SrvOrganController {
@PostMapping("/chSrvTaskDetailDelete")
public Result chSrvTaskDetailDelete(Long taskDetailId,String userName){
return srvOrganEmpService.chSrvTaskDetailDelete(taskDetailId,userName);
}
@GetMapping("/selectEmpBySrvOrganId")
......
......@@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.account.ChDisabDetailAccounts;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetail2Vo;
import com.hungraim.ltc.pojo.vo.disable.SrvOrganEmpExportVo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.util.List;
/**
......@@ -24,7 +26,8 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> {
* @param empId
* @return
*/
Page<ChSrvTaskDetail2Vo> chSrvTaskDetailQuery(Page<ChSrvTaskDetail2Vo> page, Long empId);
Page<ChSrvTaskDetail2Vo> chSrvTaskDetailQuery(Page<ChSrvTaskDetail2Vo> page, Long empId, String empName,String status,String sevrTime);
int deleteFinshItem(long taskDetailId);
......@@ -35,6 +38,10 @@ public interface ChSrvTaskDetailMapper extends BaseMapper<ChSrvTaskDetail> {
ChDisabDetailAccounts selectAccountsDetail(String disabInfoId, String srvDateStr);
void updateChDisabDetailAccounts(Long accountsId, BigDecimal accountsAllCostsub, BigDecimal accountsOverallCostsub, BigDecimal accountsPersonalCostsub);
List<ChSrvTaskDetail2Vo> chSrvTaskDetailExportList(Long empId, String empName,String status,String sevrTime);
}
......@@ -35,7 +35,7 @@ public interface SrvOrganEmpService {
* @param isLock 状态 0-有效;1-失效;
* @return 返回操作状态
*/
void updateSrvEmpStatus(Long empId, Short isLock);
int updateSrvEmpStatus(Long empId, Short isLock,String certifNum);
/**
* 获取护理人员相关信息
......@@ -70,12 +70,14 @@ public interface SrvOrganEmpService {
Workbook srvOrganExport(Long organId,Long srvOrganId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum,
Short isLock, Short empType);
Page<ChSrvTaskDetail2Vo> chSrvTaskDetailQuery(Page<ChSrvTaskDetail2Vo> page, Long empId);
Page<ChSrvTaskDetail2Vo> chSrvTaskDetailQuery(Page<ChSrvTaskDetail2Vo> page,Long empId, String empName,String status,String sevrTime);
Result chSrvTaskDetailDelete(long taskDetailId, String userName);
Result selectEmpBySrvOrganId(String srvOrganId);
Workbook chSrvTaskDetailExport(Long empId, String empName,String status,String sevrTime);
void auditSrvOrganEmp(Integer userId,Long empId,Integer auditStatus);
}
......@@ -82,15 +82,23 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
@Override
public void updateSrvEmpStatus(Long empId, Short isLock) {
public int updateSrvEmpStatus(Long empId, Short isLock,String certifNum) {
int queryResult = 0;
//修改成有效状态前检查是否存在有效数据。存在则不允许修改
if(isLock==0){
QueryWrapper<ChSrvOrganEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CERTIF_NUM", certifNum);
queryWrapper.eq("IS_LOCK",0);
queryResult = chSrvOrganEmpMapper.selectCount(queryWrapper);
if(queryResult>0){
return 0;
}
}
ChSrvOrganEmp chSrvOrganEmp = new ChSrvOrganEmp();
chSrvOrganEmp.setEmpId(empId);
chSrvOrganEmp.setIsLock(isLock);
chSrvOrganEmpMapper.updateById(chSrvOrganEmp);
ChSrvOrganEmpApply chSrvOrganEmpApply = new ChSrvOrganEmpApply();
chSrvOrganEmpApply.setEmpId(empId);
chSrvOrganEmpApply.setIsLock(isLock);
chSrvOrganEmpApplyMapper.updateById(chSrvOrganEmpApply);
queryResult = chSrvOrganEmpMapper.updateById(chSrvOrganEmp);
return queryResult;
}
@Override
......@@ -139,6 +147,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
// 新增
chSrvOrganEmp.setEffTime(new Date());
chSrvOrganEmp.setIsLock((short) 0);
chSrvOrganEmp.setEmpPwd("ch123456");
chSrvOrganEmpMapper.insert(chSrvOrganEmp);
updateAttachs(srvOrganEmpVo, chSrvOrganEmp.getEmpId());
......@@ -174,13 +183,12 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF); // 对应xlsx
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, SrvOrganEmpExportVo.class, srvOrganEmpExportList);
return workbook;
}
@Override
public Page<ChSrvTaskDetail2Vo> chSrvTaskDetailQuery(Page<ChSrvTaskDetail2Vo> page, Long empId) {
Page<ChSrvTaskDetail2Vo> chSrvTaskDetailVoPage = chSrvTaskDetailMapper.chSrvTaskDetailQuery(page, empId);
public Page<ChSrvTaskDetail2Vo> chSrvTaskDetailQuery(Page<ChSrvTaskDetail2Vo> page, Long empId, String empName,String status,String sevrTime) {
Page<ChSrvTaskDetail2Vo> chSrvTaskDetailVoPage = chSrvTaskDetailMapper.chSrvTaskDetailQuery(page, empId,empName,status,sevrTime);
chSrvTaskDetailVoPage.getRecords().stream().filter(chSrvTaskDetail -> {
if (null != chSrvTaskDetail.getSevStarTime()){
chSrvTaskDetail.setSevStarTime(chSrvTaskDetail.getSevStarTime().substring(0,19));
......@@ -240,6 +248,15 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
}
}
@Override
public Workbook chSrvTaskDetailExport(Long empId, String empName, String status, String sevrTime) {
List<ChSrvTaskDetail2Vo> chSrvTaskDetailExportList = chSrvTaskDetailMapper.chSrvTaskDetailExportList(empId,empName,status,sevrTime);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF); // 对应xlsx
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, ChSrvTaskDetail2Vo.class, chSrvTaskDetailExportList);
return workbook;
}
/**
* 计算2个时间相差的天数、小时、分钟、秒
* @param startTime 开始时间
......
......@@ -67,6 +67,7 @@
decode( t.STATUS, '0', '未执行', '1', '执行中', '2', '已执行', '4', '已完成' ) AS status,
t.SRV_START_TIME sevStarTime,
t.SRV_END_TIME sevEndTime,
TO_char(t.SRV_DATE,'yyyy-MM-dd') sevrTime,
info.REAL_NAME realName
FROM
CH_SRV_TASK_DETAIL t
......@@ -74,7 +75,45 @@
left join CH_DISABLE_INFO info on info.DISAB_INFO_ID = k.DISAB_INFO_ID
LEFT JOIN CH_SRV_ORGAN_EMP m ON m.EMP_ID = k.SRV_EMP_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T5.SRV_ORGAN_ID = m.SRV_ORGAN_ID
WHERE m.EMP_ID = #{empId} and t.is_clock is null
<if test="empName != null and empName != ''">
and info.REAL_NAME like CONCAT(CONCAT('%',#{empName}) ,'%')
</if>
<if test="status != null and status != ''">
and t.STATUS = #{status}
</if>
<if test="sevrTime != null and sevrTime != ''">
and TO_char(t.SRV_DATE,'yyyy-MM-dd') = #{sevrTime}
</if>
order by t.TASK_DETAIL_ID desc
</select>
<select id="chSrvTaskDetailExportList" resultType="com.hungraim.ltc.pojo.vo.disable.ChSrvTaskDetail2Vo">
SELECT
T5.SRV_ORGAN_NAME srvOrganName,
m.EMP_NAME empName,
info.REAL_NAME realName,
t.SRV_START_TIME sevStarTime,
t.SRV_END_TIME sevEndTime,
TO_char(t.SRV_DATE,'yyyy-MM-dd') sevrTime,
decode( t.STATUS, '0', '未执行', '1', '执行中', '2', '已执行', '4', '已完成' ) AS status
FROM
CH_SRV_TASK_DETAIL t
LEFT JOIN CH_SRV_TASK k ON t.SRV_TASK_ID = k.SRV_TASK_ID
left join CH_DISABLE_INFO info on info.DISAB_INFO_ID = k.DISAB_INFO_ID
LEFT JOIN CH_SRV_ORGAN_EMP m ON m.EMP_ID = k.SRV_EMP_ID
LEFT JOIN CH_SRV_ORGAN T5 ON T5.SRV_ORGAN_ID = m.SRV_ORGAN_ID
WHERE m.EMP_ID = #{empId}
<if test="empName != null and empName != ''">
and info.REAL_NAME like CONCAT(CONCAT('%',#{empName}) ,'%')
</if>
<if test="status != null and status != ''">
and t.STATUS = #{status}
</if>
<if test="sevrTime != null and sevrTime != ''">
and TO_char(t.SRV_DATE,'yyyy-MM-dd') = #{sevrTime}
</if>
order by t.TASK_DETAIL_ID desc
</select>
......
......@@ -172,5 +172,11 @@ public class ChSrvOrganEmp implements Serializable {
*/
private Short whiteList;
/**
* 员工密码
*/
private String empPwd;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.hungraim.ltc.pojo.vo.disable;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.hungraim.ltc.pojo.vo.BaseReq;
import lombok.Data;
......@@ -11,19 +12,24 @@ public class ChSrvTaskDetail2Vo extends BaseReq {
private Long taskDetailId;
@Excel(name = "护理人员姓名",width = 20)
private String empName;
private Integer orgamId;
private String srvOrganId;
@Excel(name = "护理机构名称",width = 20)
private String srvOrganName;
@Excel(name = "状态",width = 20)
private String status;
@Excel(name = "服务开始时间",width = 40)
private String sevStarTime;
@Excel(name = "服务结束时间",width = 40)
private String sevEndTime;
@Excel(name = "失能人员姓名",width = 20)
private String realName;
@Excel(name = "服务日期",width = 40)
private String sevrTime;
}
......@@ -278,14 +278,21 @@ public class SrvTaskServiceImpl implements SrvTaskService {
.eq(ChSrvTaskDetail::getSrvDate, srvPlanInputVO.getSrvPlanTime()));
Long modeId = srvPlanInputVO.getModeId();
if (CollectionUtil.isNotEmpty(chSrvTaskDetailList)) {
ChSrvTaskDetail chSrvTaskDetail = chSrvTaskDetailList.get(0);
taskDetailId = chSrvTaskDetail.getTaskDetailId();
if(modeId == 3){
int status = chSrvTaskDetailList.stream().map(ChSrvTaskDetail::getStatus).findFirst().orElse((short)0);
if(status == 1 || status == 4) {
return Result.failed("手机app已有任务,不可重复生成");
}
ChSrvTaskDetail chSrvTaskDetailDTO = new ChSrvTaskDetail();
chSrvTaskDetailDTO.setTaskDetailId(taskDetailId);
// 补卡标识
chSrvTaskDetailDTO.setIsClock((short) 1);
chSrvTaskDetailDTO.setClockReason(srvPlanInputVO.getClockReason());
chSrvTaskDetailDTO.setClockOperator(srvPlanInputVO.getAdmin());
chSrvTaskDetailMapper.updateById(chSrvTaskDetailDTO);
}
ChSrvTaskDetail chSrvTaskDetail = chSrvTaskDetailList.get(0);
taskDetailId = chSrvTaskDetail.getTaskDetailId();
List<ChSrvPlan> srvPlanList = chSrvPlanMapper.selectList(new LambdaQueryWrapper<ChSrvPlan>()
.eq(ChSrvPlan::getDisabInfoId, srvPlanInputVO.getDisabInfoId())
.eq(ChSrvPlan::getSrvPlanTime, srvPlanInputVO.getSrvPlanTime())
......
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