兴安代码提交
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
package com.dcsoft.system.visitor.controller;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.dcsoft.common.core.constant.CacheConstants;
|
||||
import com.dcsoft.common.core.constant.Constants;
|
||||
import com.dcsoft.common.core.enums.ExamineEnum;
|
||||
import com.dcsoft.common.core.enums.MatterEnum;
|
||||
import com.dcsoft.common.core.exception.ServiceException;
|
||||
import com.dcsoft.common.core.utils.CollUtil;
|
||||
import com.dcsoft.common.core.web.controller.BaseController;
|
||||
import com.dcsoft.common.core.web.domain.AjaxResult;
|
||||
import com.dcsoft.common.core.web.page.TableDataInfo;
|
||||
@@ -18,9 +12,8 @@ import com.dcsoft.common.log.annotation.Log;
|
||||
import com.dcsoft.common.log.enums.BusinessType;
|
||||
import com.dcsoft.common.redis.service.RedisService;
|
||||
import com.dcsoft.common.security.utils.SecurityUtils;
|
||||
import com.dcsoft.common.sms.config.properties.SmsProperties;
|
||||
import com.dcsoft.system.api.model.LoginUser;
|
||||
import com.dcsoft.system.domain.SysBranch;
|
||||
import com.dcsoft.system.domain.SysManageRecord;
|
||||
import com.dcsoft.system.domain.SysPeople;
|
||||
import com.dcsoft.system.service.ISysDictDataService;
|
||||
import com.dcsoft.system.service.ISysPeopleService;
|
||||
@@ -28,19 +21,17 @@ import com.dcsoft.system.utils.UuidUtil;
|
||||
import com.dcsoft.system.visitor.domain.CheckCodeVo;
|
||||
import com.dcsoft.system.visitor.domain.VisCarryStuffVo;
|
||||
import com.dcsoft.system.visitor.domain.VisVisitorExamine;
|
||||
import com.dcsoft.system.visitor.domain.Visitor;
|
||||
import com.dcsoft.system.visitor.service.IVisCarryStuffService;
|
||||
import com.dcsoft.system.visitor.service.IVisVisitorExamineService;
|
||||
import com.dcsoft.system.visitor.service.IVisitorService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Slf4j
|
||||
@@ -61,9 +52,18 @@ public class VisCarryStuffController extends BaseController {
|
||||
@Autowired
|
||||
private VisitorController visitorController;
|
||||
|
||||
@Autowired
|
||||
private IVisitorService visitorService;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
private SmsProperties smsProperties;
|
||||
|
||||
@Autowired
|
||||
private IVisVisitorExamineService visVisitorExamineService;
|
||||
|
||||
private static final String APPROVE_KEY = "APPROVE_KEY:STUFF_APPROVE";
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public class VisCarryStuffController extends BaseController {
|
||||
/**
|
||||
* 新增访客信息
|
||||
*/
|
||||
@Log(title = "携物申请", businessType = BusinessType.INSERT)
|
||||
@Log(title = "携物流程审核", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@Transactional
|
||||
public AjaxResult add(@RequestBody VisCarryStuffVo vo) {
|
||||
@@ -126,6 +126,7 @@ public class VisCarryStuffController extends BaseController {
|
||||
// 审核通知企微发送消息(小程序来源)
|
||||
SysPeople sysPeople = new SysPeople();
|
||||
sysPeople.setCarryStuffExamine("1");
|
||||
sysPeople.setBranchId("0");
|
||||
List<SysPeople> peopleList = sysPeopleService.selectSysPeopleLists(sysPeople);
|
||||
|
||||
for (SysPeople people : peopleList) {
|
||||
@@ -155,7 +156,7 @@ public class VisCarryStuffController extends BaseController {
|
||||
*/
|
||||
private String getContent(VisCarryStuffVo vo) {
|
||||
String matterName = "携物出门申请";
|
||||
String visTime = DateUtil.format(vo.getVisTime(), DatePattern.NORM_DATE_FORMATTER);
|
||||
// String visTime = DateUtil.format(vo.getVisTime(), DatePattern.NORM_DATE_FORMATTER);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("收到新的携物出门申请:").append(matterName).append("\n");
|
||||
sb.append("申请人:").append(vo.getName()).append("\n");
|
||||
@@ -191,7 +192,7 @@ public class VisCarryStuffController extends BaseController {
|
||||
/**
|
||||
* 流程审核
|
||||
*/
|
||||
@Log(title = "流程审核", businessType = BusinessType.UPDATE)
|
||||
@Log(title = "携物流程审核", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/approve")
|
||||
@Transactional
|
||||
public AjaxResult approve(@RequestBody VisCarryStuffVo vo) {
|
||||
@@ -207,48 +208,96 @@ public class VisCarryStuffController extends BaseController {
|
||||
//查询当前审核人基本信息
|
||||
SysPeople sysPeople = sysPeopleService.queryPeopleName(telephone, null);
|
||||
|
||||
//审核通过
|
||||
if(Constants.ZERO.equals(vo.getExamineState())) {
|
||||
//被访人审核
|
||||
if (vo.getCurrentNode() == 1) {
|
||||
//查询携物申请详情信息
|
||||
VisCarryStuffVo stuffVo = visCarryStuffService.selectVisStuffById(vo.getId());
|
||||
|
||||
//保存审核环节表
|
||||
vo.setReviewer(sysPeople.getId());
|
||||
vo.setState(vo.getExamineState());
|
||||
visCarryStuffService.saveVisitorReviewProcess(vo);
|
||||
|
||||
//保存审核历史表
|
||||
VisVisitorExamine examine = new VisVisitorExamine();
|
||||
examine.setStuffId(vo.getId());
|
||||
examine.setCreateBy(sysPeople.getName());
|
||||
examine.setExamine(vo.getExamineState());
|
||||
|
||||
//审核通过
|
||||
List<SysPeople> peopleList = new ArrayList<>();
|
||||
SysPeople peopleQuery = new SysPeople();
|
||||
if(Constants.ZERO.equals(vo.getExamineState())) {
|
||||
//一级审核人审核
|
||||
if (stuffVo.getCurrentNode() == 1) {
|
||||
vo.setExamineState(null);
|
||||
vo.setCurrentNode(2);
|
||||
vo.setReviewer1(sysPeople.getId());
|
||||
//查询二级审核人信息,发送审核链接
|
||||
peopleQuery.setCarryStuffExamine("2");
|
||||
peopleQuery.setBranchId("0");
|
||||
peopleList = sysPeopleService.selectSysPeopleLists(peopleQuery);
|
||||
}
|
||||
//二级审核人审核
|
||||
else if (vo.getCurrentNode() == 2) {
|
||||
|
||||
else if (stuffVo.getCurrentNode() == 2) {
|
||||
vo.setExamineState(null);
|
||||
vo.setCurrentNode(3);
|
||||
vo.setReviewer2(sysPeople.getId());
|
||||
//查询三级审核人信息,发送审核链接
|
||||
peopleQuery.setCarryStuffExamine("3");
|
||||
peopleQuery.setBranchId("0");
|
||||
peopleList = sysPeopleService.selectSysPeopleLists(peopleQuery);
|
||||
}
|
||||
else {//最后一级审核
|
||||
// visitor.setExamineState(examine.getExamine());
|
||||
// //保存审核历史表
|
||||
// examine.setRejectReason(visitor.getRejectReason());
|
||||
// SysPeople people = sysPeopleService.selectSysPeopleById(visitor.getUserId());
|
||||
// examine.setCreateBy(people.getName());
|
||||
// visVisitorExamineService.insertVisVisitorExamine(examine);
|
||||
//
|
||||
// //修改环节状态
|
||||
// visitorService.updateVisitorReviewProcess(visitor);
|
||||
else {//三级审核,最后一级
|
||||
vo.setReviewer3(sysPeople.getId());
|
||||
//保存审核历史表
|
||||
visVisitorExamineService.insertVisVisitorExamine(examine);
|
||||
|
||||
// 保存审核二维码地址信息
|
||||
CheckCodeVo codeVo = new CheckCodeVo();
|
||||
codeVo.setCode(vo.getId() + "&time=" + new Date().getTime());
|
||||
codeVo.setStuffId(String.valueOf(vo.getId()));
|
||||
codeVo.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
visitorService.saveVisCheckCode(codeVo);
|
||||
}
|
||||
}
|
||||
|
||||
//向下级审核人发送审核信息
|
||||
for (SysPeople people : peopleList) {
|
||||
String url = getExamineUrl(String.valueOf(vo.getId()), people.getPhone());
|
||||
log.info("携物申请appove发送审核链接:{}", url);
|
||||
//发送钉钉信息
|
||||
// String content = getContent(vo);
|
||||
// visitorController.asyncsendV2(sysPeople.getPhone(), "text", content + url);
|
||||
|
||||
//发送企微信息
|
||||
try {
|
||||
visitorController.sendWeCom(sysPeople.getPhone(), url + " --访客姓名:" + vo.getName());
|
||||
} catch (Exception e) {
|
||||
log.error("携物申请add-sendWeCom异常:", e);
|
||||
return AjaxResult.error("系统异常,请重新提交或联系管理员!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//审核拒绝
|
||||
if (Constants.ONE.equals(vo.getExamineState())) {
|
||||
// visitor.setExamineState(examine.getExamine());
|
||||
// visVisitorExamineService.insertVisVisitorExamine(examine);
|
||||
//保存审核历史表
|
||||
visVisitorExamineService.insertVisVisitorExamine(examine);
|
||||
|
||||
try {
|
||||
visitorController.sendWeCom(telephone, vo.getName() + "的访客审核已驳回");
|
||||
} catch (Exception e) {
|
||||
log.error("访客approve-sendWeCom驳回异常:{}", e.getMessage());
|
||||
log.error("访客approve-sendWeCom驳回异常", e);
|
||||
}
|
||||
// 申请人发送短信(审核不通过)
|
||||
// visitorController.sendMessage(vo.getPhone(), "1", smsProperties.getTemplate3());
|
||||
|
||||
SysPeople sysPeople1 = sysPeopleService.selectSysPeopleById(stuffVo.getUserId());
|
||||
visitorController.sendMessage(sysPeople1.getPhone(), "1", smsProperties.getTemplate3());
|
||||
}
|
||||
|
||||
// visitorService.approve(visitor);
|
||||
visCarryStuffService.updateStaff(vo);
|
||||
|
||||
return toAjax(true);
|
||||
} catch (Exception e) {
|
||||
log.error("审核异常:{}", e.getMessage());
|
||||
log.error("审核异常:", e);
|
||||
return toAjax(false);
|
||||
}finally {
|
||||
redisService.deleteObject(APPROVE_KEY);
|
||||
|
||||
@@ -386,19 +386,21 @@ public class VisitorController extends BaseController {
|
||||
stuffVo.setQrCode(codeVo.getCode());
|
||||
}
|
||||
|
||||
List<VisitorReviewProcessVo> reviewProcess = visCarryStuffService.queryVisitorReviewProcessList(id);
|
||||
if(CollUtil.isNotEmpty(reviewProcess)) {
|
||||
stuffVo.setReviewProcessList(reviewProcess);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(telephone)) {
|
||||
//查询当前点击审核链接的人员信息
|
||||
SysPeople sysPeople = sysPeopleService.queryPeopleName(telephone, null);
|
||||
|
||||
//根据手机号查询peopleId
|
||||
Visitor visitor2 = new Visitor();
|
||||
visitor2.setId(stuffVo.getId());
|
||||
visitor2.setReviewer(String.valueOf(sysPeople.getId()));
|
||||
visitor2.setPosition(null);
|
||||
Visitor visitor1 = visitorService.queryReviewProcess(visitor2);
|
||||
if (ObjectUtil.isNotNull(visitor1) && StrUtil.isNotBlank(visitor1.getState())) {
|
||||
stuffVo.setExamineState(visitor1.getState());
|
||||
//如果当前点击链接的审核人员级别小于流程处于的级别,展示已审核的结果
|
||||
if (Integer.parseInt(sysPeople.getCarryStuffExamine()) < stuffVo.getCurrentNode()) {
|
||||
VisitorReviewProcessVo processVo = visCarryStuffService.queryReviewProcessNew(stuffVo);
|
||||
stuffVo.setExamineState(processVo.getState());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return stuffVo;
|
||||
@@ -477,7 +479,7 @@ public class VisitorController extends BaseController {
|
||||
try {
|
||||
sendWeCom(sysPeople.getPhone(), url + " --访客姓名:" + visitor.getName());
|
||||
} catch (Exception e) {
|
||||
log.error("访客add-sendWeCom异常:{}", e.getMessage());
|
||||
log.error("访客add-sendWeCom异常:", e);
|
||||
}
|
||||
|
||||
return toAjax(i);
|
||||
@@ -529,7 +531,7 @@ public class VisitorController extends BaseController {
|
||||
}
|
||||
redisService.setCacheObject(CacheConstants.VISITOR_SMS_CODE + code, id + "&" + telephone, 30L, TimeUnit.DAYS);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("缓存数据异常:" + e.getMessage());
|
||||
throw new ServiceException("缓存数据异常:" + e);
|
||||
}
|
||||
return "https://fk.xyxaks.cn/h5/?c=" + code + "1";
|
||||
}
|
||||
@@ -930,10 +932,6 @@ public class VisitorController extends BaseController {
|
||||
log.error("approve-审核人员正在审核中");
|
||||
return error("正在审核中");
|
||||
}
|
||||
// List<SysManageRecord> record = visitorService.querySysManageRecord(visitor.getUserId());
|
||||
// if (CollectionUtils.isEmpty(record)) {
|
||||
// throw new RuntimeException("被访人未授权通行");
|
||||
// }
|
||||
|
||||
//查询当前审核人基本信息
|
||||
SysPeople sysPeople = sysPeopleService.queryPeopleName(telephone, null);
|
||||
@@ -999,7 +997,7 @@ public class VisitorController extends BaseController {
|
||||
try {
|
||||
sendWeCom(nextPeople.getPhone(), url + " --访客姓名:" + visitor.getName());
|
||||
} catch (Exception e) {
|
||||
log.error("访客approve-sendWeCom异常:{}", e.getMessage());
|
||||
log.error("访客approve-sendWeCom异常:", e);
|
||||
}
|
||||
|
||||
} else {//最后一级审核
|
||||
@@ -1033,18 +1031,17 @@ public class VisitorController extends BaseController {
|
||||
try {
|
||||
sendWeCom(telephone, visitor.getName() + "的访客审核已驳回");
|
||||
} catch (Exception e) {
|
||||
log.error("访客approve-sendWeCom驳回异常:{}", e.getMessage());
|
||||
log.error("访客approve-sendWeCom驳回异常:", e);
|
||||
}
|
||||
// 申请人发送短信(审核不通过)
|
||||
sendMessage(visitor.getPhone(), "1", smsProperties.getTemplate3());
|
||||
|
||||
}
|
||||
|
||||
visitorService.approve(visitor);
|
||||
|
||||
return toAjax(true);
|
||||
} catch (Exception e) {
|
||||
log.error("审核异常:{}", e.getMessage());
|
||||
log.error("审核异常:", e);
|
||||
return toAjax(false);
|
||||
}finally {
|
||||
redisService.deleteObject(APPROVE_KEY);
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class VisCarryStuffVo extends BaseEntity {
|
||||
@@ -15,6 +16,11 @@ public class VisCarryStuffVo extends BaseEntity {
|
||||
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 当前审核人id
|
||||
*/
|
||||
private Long reviewer;
|
||||
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
@@ -81,6 +87,11 @@ public class VisCarryStuffVo extends BaseEntity {
|
||||
*/
|
||||
private String examineState;
|
||||
|
||||
/**
|
||||
* 审核状态 0:通过,1:驳回
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 申请类型 0:临时访客 1:携物出门
|
||||
*/
|
||||
@@ -102,4 +113,6 @@ public class VisCarryStuffVo extends BaseEntity {
|
||||
*/
|
||||
private Integer currentNode;
|
||||
|
||||
private List<VisitorReviewProcessVo> reviewProcessList;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@ public class VisVisitorExamine extends BaseEntity
|
||||
@Excel(name = "访客id")
|
||||
private Long visitorId;
|
||||
|
||||
/** 访客id */
|
||||
private Long stuffId;
|
||||
|
||||
/** 准入时间起 */
|
||||
@Excel(name = "准入时间起")
|
||||
private String admittanceStart;
|
||||
@@ -63,6 +66,14 @@ passwordPermission 密码权限 */
|
||||
|
||||
private String rejectReason;
|
||||
|
||||
public Long getStuffId() {
|
||||
return stuffId;
|
||||
}
|
||||
|
||||
public void setStuffId(Long stuffId) {
|
||||
this.stuffId = stuffId;
|
||||
}
|
||||
|
||||
public String getRejectReason() {
|
||||
return rejectReason;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.dcsoft.system.visitor.mapper;
|
||||
|
||||
import com.dcsoft.system.visitor.domain.CheckCodeVo;
|
||||
import com.dcsoft.system.visitor.domain.VisCarryStuffVo;
|
||||
import com.dcsoft.system.visitor.domain.VisitorReviewProcessVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -15,4 +16,12 @@ public interface VisCarryStuffMapper {
|
||||
VisCarryStuffVo selectVisStuffById(Long id);
|
||||
|
||||
CheckCodeVo selectStuffCheckCode(@Param("stuffId") Long id);
|
||||
|
||||
void updateStaff(VisCarryStuffVo vo);
|
||||
|
||||
List<VisitorReviewProcessVo> queryVisitorReviewProcessList(Long id);
|
||||
|
||||
void saveVisitorReviewProcess(VisCarryStuffVo vo);
|
||||
|
||||
VisitorReviewProcessVo queryReviewProcessNew(VisCarryStuffVo stuffVo);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.dcsoft.system.visitor.service;
|
||||
import com.dcsoft.system.visitor.domain.CheckCodeVo;
|
||||
import com.dcsoft.system.visitor.domain.VisCarryStuffVo;
|
||||
import com.dcsoft.system.visitor.domain.Visitor;
|
||||
import com.dcsoft.system.visitor.domain.VisitorReviewProcessVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,4 +16,12 @@ public interface IVisCarryStuffService {
|
||||
VisCarryStuffVo selectVisStuffById(Long id);
|
||||
|
||||
CheckCodeVo selectStuffCheckCode(Long id);
|
||||
|
||||
void updateStaff(VisCarryStuffVo vo);
|
||||
|
||||
List<VisitorReviewProcessVo> queryVisitorReviewProcessList(Long id);
|
||||
|
||||
void saveVisitorReviewProcess(VisCarryStuffVo vo);
|
||||
|
||||
VisitorReviewProcessVo queryReviewProcessNew(VisCarryStuffVo stuffVo);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
package com.dcsoft.system.visitor.service.impl;
|
||||
|
||||
import com.dcsoft.common.core.constant.Constants;
|
||||
import com.dcsoft.common.core.enums.ExamineEnum;
|
||||
import com.dcsoft.common.security.utils.SecurityUtils;
|
||||
import com.dcsoft.system.api.model.LoginUser;
|
||||
import com.dcsoft.system.visitor.domain.CheckCodeVo;
|
||||
import com.dcsoft.system.visitor.domain.VisCarryStuffVo;
|
||||
import com.dcsoft.system.visitor.domain.Visitor;
|
||||
import com.dcsoft.system.visitor.domain.VisitorReviewProcessVo;
|
||||
import com.dcsoft.system.visitor.mapper.VisCarryStuffMapper;
|
||||
import com.dcsoft.system.visitor.mapper.VisitorMapper;
|
||||
import com.dcsoft.system.visitor.service.IVisCarryStuffService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class VisCarryStuffImpl implements IVisCarryStuffService {
|
||||
@@ -19,6 +26,9 @@ public class VisCarryStuffImpl implements IVisCarryStuffService {
|
||||
@Resource
|
||||
private VisCarryStuffMapper visCarryStuffMapper;
|
||||
|
||||
@Resource
|
||||
private VisitorMapper visitorMapper;
|
||||
|
||||
@Override
|
||||
public List<VisCarryStuffVo> selectList(VisCarryStuffVo vo) {
|
||||
return visCarryStuffMapper.selectList(vo);
|
||||
@@ -27,7 +37,7 @@ public class VisCarryStuffImpl implements IVisCarryStuffService {
|
||||
@Override
|
||||
public void insertVisCarryStuff(VisCarryStuffVo vo) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
vo.setCreateBy(String.valueOf(loginUser.getUserid()));
|
||||
vo.setCreateBy(loginUser.getUsername());
|
||||
vo.setExamineState(ExamineEnum.IN_REVIEW.getCode());
|
||||
vo.setExamineState(ExamineEnum.IN_REVIEW.getCode());
|
||||
visCarryStuffMapper.insertVisCarryStuff(vo);
|
||||
@@ -42,4 +52,24 @@ public class VisCarryStuffImpl implements IVisCarryStuffService {
|
||||
public CheckCodeVo selectStuffCheckCode(Long id) {
|
||||
return visCarryStuffMapper.selectStuffCheckCode(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStaff(VisCarryStuffVo vo) {
|
||||
visCarryStuffMapper.updateStaff(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VisitorReviewProcessVo> queryVisitorReviewProcessList(Long id) {
|
||||
return visCarryStuffMapper.queryVisitorReviewProcessList(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveVisitorReviewProcess(VisCarryStuffVo vo) {
|
||||
visCarryStuffMapper.saveVisitorReviewProcess(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisitorReviewProcessVo queryReviewProcessNew(VisCarryStuffVo stuffVo) {
|
||||
return visCarryStuffMapper.queryReviewProcessNew(stuffVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where p.phone = #{phone} and p.name = #{userName} limit 1
|
||||
</select>
|
||||
<select id="queryPeopleName" resultType="com.dcsoft.system.domain.SysPeople">
|
||||
select phone, name, id, branch_id branchId, position, id
|
||||
select phone, name, id, branch_id branchId, position, id, carry_stuff_examine carryStuffExamine
|
||||
from sys_people
|
||||
where del_flag = '0'
|
||||
and phone = #{phone}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="vehicle" column="vehicle"/>
|
||||
<result property="currentNode" column="current_node"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectVisCarryStuffVo">
|
||||
@@ -44,10 +45,33 @@
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
vehicle
|
||||
vehicle,
|
||||
current_node
|
||||
from vis_carry_stuff_out
|
||||
</sql>
|
||||
|
||||
<update id="updateStaff">
|
||||
update vis_carry_stuff_out
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="name != null and name != ''"> `name` = #{name},</if>
|
||||
<if test="visitingUnit != null and visitingUnit != ''">visiting_unit = #{visitingUnit},</if>
|
||||
<if test="stuffName != null and stuffName != ''">stuff_name = #{stuffName},</if>
|
||||
<if test="stuffType != null and stuffType != ''">stuff_type = #{stuffType},</if>
|
||||
<if test="stuffNumber != null and stuffNumber != ''">stuff_number = #{stuffNumber},</if>
|
||||
<if test="imgUrls != null and imgUrls != ''">img_urls = #{imgUrls},</if>
|
||||
<if test="visTime != null">vis_time = #{visTime},</if>
|
||||
<if test="reviewer1 != null">reviewer1 = #{reviewer1},</if>
|
||||
<if test="reviewer2 != null">reviewer2 = #{reviewer2},</if>
|
||||
<if test="reviewer3 != null">reviewer3 = #{reviewer3},</if>
|
||||
<if test="examineState != null and examineState != ''">examine_state = #{examineState},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="vehicle != null">vehicle = #{vehicle},</if>
|
||||
<if test="currentNode != null">current_node = #{currentNode},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectList" resultType="com.dcsoft.system.visitor.domain.VisCarryStuffVo">
|
||||
<include refid="selectVisCarryStuffVo"/>
|
||||
<where>
|
||||
@@ -73,6 +97,29 @@
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="queryVisitorReviewProcessList" resultType="com.dcsoft.system.visitor.domain.VisitorReviewProcessVo">
|
||||
select reviewer,
|
||||
state,
|
||||
sp.position type,
|
||||
date_format(created_time, '%Y-%m-%d %H:%i:%s') createdTime,
|
||||
sp.name reviewerName
|
||||
from vis_visitor_review_process vvrp
|
||||
left join sys_people sp on vvrp.reviewer = sp.id and sp.del_flag = '0'
|
||||
where stuff_id = #{id}
|
||||
order by ifnull(createdTime, 'zzz')
|
||||
</select>
|
||||
|
||||
<select id="queryReviewProcessNew" resultType="com.dcsoft.system.visitor.domain.VisitorReviewProcessVo">
|
||||
select
|
||||
reviewer,
|
||||
state,
|
||||
reject_reason
|
||||
from vis_visitor_review_process
|
||||
where stuff_id = #{id}
|
||||
order by created_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertVisCarryStuff" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into vis_carry_stuff_out
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -91,6 +138,7 @@
|
||||
<if test="examineState != null and examineState != ''">examine_state,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="vehicle != null">vehicle,</if>
|
||||
<if test="currentNode != null">current_node,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id},</if>
|
||||
@@ -108,7 +156,19 @@
|
||||
<if test="examineState != null and examineState != ''">#{examineState},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="vehicle != null">#{vehicle},</if>
|
||||
<if test="currentNode != null">#{currentNode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="saveVisitorReviewProcess">
|
||||
insert into vis_visitor_review_process (id, stuff_id, reviewer
|
||||
<if test="state != null and state != ''">
|
||||
,state
|
||||
</if>
|
||||
)
|
||||
VALUES (REPLACE(uuid(), '-', ''), #{id}, #{reviewer}
|
||||
<if test="state != null and state != ''">
|
||||
,#{state}
|
||||
</if>)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user