feat:临时访客一级口门申请
parent
a033bba12b
commit
6e331ede6f
|
|
@ -115,7 +115,6 @@ public class PersonApplyAddExe {
|
||||||
personApplyAddCmdExt.setUserPhone(cmd.getUserPhone());
|
personApplyAddCmdExt.setUserPhone(cmd.getUserPhone());
|
||||||
personApplyAddCmdExt.setVisitStartTime(DateUtil.date2Str(new Date()));
|
personApplyAddCmdExt.setVisitStartTime(DateUtil.date2Str(new Date()));
|
||||||
personApplyAddCmdExt.setVisitEndTime("2099-12-31 23:59:59");
|
personApplyAddCmdExt.setVisitEndTime("2099-12-31 23:59:59");
|
||||||
personApplyAddCmdExt.setExpiredExpiration("2");
|
|
||||||
personApplyAddCmdExt.setUserPhone(cmd.getUserPhone());
|
personApplyAddCmdExt.setUserPhone(cmd.getUserPhone());
|
||||||
xgfPersonApplyAddCmd.setPersonApplyList(new ArrayList<XgfPersonApplyAddCmd.PersonApplyAddCmdExt>() {{
|
xgfPersonApplyAddCmd.setPersonApplyList(new ArrayList<XgfPersonApplyAddCmd.PersonApplyAddCmdExt>() {{
|
||||||
add(personApplyAddCmdExt);
|
add(personApplyAddCmdExt);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.zcloud.primeport.command;
|
||||||
|
|
||||||
import com.alibaba.cola.exception.BizException;
|
import com.alibaba.cola.exception.BizException;
|
||||||
import com.zcloud.gbscommon.utils.DateUtil;
|
import com.zcloud.gbscommon.utils.DateUtil;
|
||||||
|
import com.zcloud.gbscommon.utils.Tools;
|
||||||
import com.zcloud.primeport.domain.gateway.MkmjGateGateway;
|
import com.zcloud.primeport.domain.gateway.MkmjGateGateway;
|
||||||
import com.zcloud.primeport.domain.gateway.PersonApplyGateway;
|
import com.zcloud.primeport.domain.gateway.PersonApplyGateway;
|
||||||
import com.zcloud.primeport.domain.gateway.XgfApplyPersonGateway;
|
import com.zcloud.primeport.domain.gateway.XgfApplyPersonGateway;
|
||||||
|
|
@ -61,7 +62,9 @@ public class PersonApplyUpdateExe {
|
||||||
personApplyGateway.update(personApplyE);
|
personApplyGateway.update(personApplyE);
|
||||||
XgfApplyPersonE xgfApplyPersonE = new XgfApplyPersonE();
|
XgfApplyPersonE xgfApplyPersonE = new XgfApplyPersonE();
|
||||||
xgfApplyPersonE.setId(XgfApplyPersonId);
|
xgfApplyPersonE.setId(XgfApplyPersonId);
|
||||||
xgfApplyPersonE.setGateLevelAuthArea(gate);
|
if (Tools.notEmpty(gate)) {
|
||||||
|
xgfApplyPersonE.setGateLevelAuthArea(gate);
|
||||||
|
}
|
||||||
xgfApplyPersonGateway.update(xgfApplyPersonE);
|
xgfApplyPersonGateway.update(xgfApplyPersonE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,8 @@ public class PersonApplyQueryExe {
|
||||||
public PersonApplyCO getInfoByUserId(Long userId) {
|
public PersonApplyCO getInfoByUserId(Long userId) {
|
||||||
QueryWrapper<PersonApplyDO> objectQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<PersonApplyDO> objectQueryWrapper = new QueryWrapper<>();
|
||||||
objectQueryWrapper.eq("employee_person_user_id", userId);
|
objectQueryWrapper.eq("employee_person_user_id", userId);
|
||||||
return personApplyCoConvertor.converDOToCO(personApplyRepository.getOne(objectQueryWrapper));
|
|
||||||
|
return personApplyCoConvertor.converDOToCO(personApplyRepository.getInfoByUserId(userId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.zcloud.primeport.service;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.zcloud.gbscommon.utils.DateUtil;
|
||||||
import com.zcloud.primeport.api.PersonApplyServiceI;
|
import com.zcloud.primeport.api.PersonApplyServiceI;
|
||||||
import com.zcloud.primeport.command.PersonApplyAddExe;
|
import com.zcloud.primeport.command.PersonApplyAddExe;
|
||||||
import com.zcloud.primeport.command.PersonApplyRemoveExe;
|
import com.zcloud.primeport.command.PersonApplyRemoveExe;
|
||||||
|
|
@ -13,9 +14,12 @@ import com.zcloud.primeport.dto.clientobject.PersonApplyCO;
|
||||||
import com.zcloud.primeport.dto.clientobject.PersonCountCO;
|
import com.zcloud.primeport.dto.clientobject.PersonCountCO;
|
||||||
import com.zcloud.primeport.dto.clientobject.XgfPersonApplyCO;
|
import com.zcloud.primeport.dto.clientobject.XgfPersonApplyCO;
|
||||||
import com.zcloud.primeport.dto.clientobject.XgfPersonCountCO;
|
import com.zcloud.primeport.dto.clientobject.XgfPersonCountCO;
|
||||||
|
import com.zcloud.primeport.plan.mjDevice.OnePersonUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-app
|
* web-app
|
||||||
*
|
*
|
||||||
|
|
@ -29,6 +33,7 @@ public class PersonApplyServiceImpl implements PersonApplyServiceI {
|
||||||
private final PersonApplyUpdateExe personApplyUpdateExe;
|
private final PersonApplyUpdateExe personApplyUpdateExe;
|
||||||
private final PersonApplyRemoveExe personApplyRemoveExe;
|
private final PersonApplyRemoveExe personApplyRemoveExe;
|
||||||
private final PersonApplyQueryExe personApplyQueryExe;
|
private final PersonApplyQueryExe personApplyQueryExe;
|
||||||
|
private final OnePersonUtil onePersonUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResponse<XgfPersonApplyCO> listPage(PersonApplyPageQry qry) {
|
public PageResponse<XgfPersonApplyCO> listPage(PersonApplyPageQry qry) {
|
||||||
|
|
@ -89,20 +94,23 @@ public class PersonApplyServiceImpl implements PersonApplyServiceI {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void authorization(PersonAuthCmd cmd) {
|
public void authorization(PersonAuthCmd cmd) throws Exception {
|
||||||
// 查一下这个人 有没有 授权,
|
// 查一下这个人 有没有 授权,
|
||||||
PersonApplyCO co = personApplyQueryExe.getInfoByUserId(cmd.getUserId());
|
PersonApplyCO co = personApplyQueryExe.getInfoByUserId(cmd.getUserId());
|
||||||
if (cmd.getMkmjPermission().equals(1)) {
|
if (cmd.getMkmjPermission().equals(1)) {
|
||||||
// 开启门禁
|
// 开启门禁
|
||||||
if (co != null) {
|
if (co != null) {
|
||||||
personApplyUpdateExe.authorization(co.getId(), co.getXgfApplyPersonId(), cmd.getMkmjPermission(), cmd.getGateLevelAuthArea());
|
personApplyUpdateExe.authorization(co.getId(), co.getXgfApplyPersonId(), cmd.getMkmjPermission(), cmd.getGateLevelAuthArea());
|
||||||
|
onePersonUtil.expirationDateRefreshedUserCard(co.getUserCard(), DateUtil.date2Str(new Date()), "2030-12-31 23:59:59");
|
||||||
} else {
|
} else {
|
||||||
personApplyAddExe.authorization(cmd);
|
personApplyAddExe.authorization(cmd);
|
||||||
|
onePersonUtil.dockLongTermUserByUserCardAndFaceImg(co.getUserCard(), co.getUserUid(), co.getEmployeePersonUserName(), co.getUserFaceUrl(), DateUtil.date2Str(new Date()), "2030-12-31 23:59:59");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 关闭门禁
|
// 关闭门禁,这个人都没有授权过的话,什么都不管。
|
||||||
if (co != null) {
|
if (co != null) {
|
||||||
personApplyUpdateExe.authorization(co.getId(), co.getXgfApplyPersonId(), cmd.getMkmjPermission(), cmd.getGateLevelAuthArea());
|
personApplyUpdateExe.authorization(co.getId(), co.getXgfApplyPersonId(), cmd.getMkmjPermission(), cmd.getGateLevelAuthArea());
|
||||||
|
onePersonUtil.freezeByUserCard(co.getUserCard(), cmd.getMkmjPermission());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public interface PersonApplyServiceI {
|
||||||
|
|
||||||
PageResponse<PersonCountCO> personnelVehicleManagementList(PersonCountPageQry qry);
|
PageResponse<PersonCountCO> personnelVehicleManagementList(PersonCountPageQry qry);
|
||||||
|
|
||||||
void authorization(PersonAuthCmd cmd);
|
void authorization(PersonAuthCmd cmd) throws Exception;
|
||||||
|
|
||||||
XgfPersonApplyCO xgfPersonApplyInfoById(Long id);
|
XgfPersonApplyCO xgfPersonApplyInfoById(Long id);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ public class PersonApplyCO extends ClientObject {
|
||||||
private String auditCorpName;
|
private String auditCorpName;
|
||||||
@ApiModelProperty(value = "审批时间",name = "auditTime")
|
@ApiModelProperty(value = "审批时间",name = "auditTime")
|
||||||
private String auditTime;
|
private String auditTime;
|
||||||
|
private String userUid;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,5 +91,7 @@ public class PersonApplyDO extends BaseDO {
|
||||||
private Long applyCorpId;
|
private Long applyCorpId;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String applyCorpName;
|
private String applyCorpName;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String userUid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,5 +33,7 @@ public interface PersonApplyMapper extends BaseMapper<PersonApplyDO> {
|
||||||
IPage<PersonApplyDO> xgfPersonnelVehicleManagementList(Page<Map<String, Object>> page, Map<String, Object> params, String menuPerms);
|
IPage<PersonApplyDO> xgfPersonnelVehicleManagementList(Page<Map<String, Object>> page, Map<String, Object> params, String menuPerms);
|
||||||
|
|
||||||
PersonApplyDO xgfPersonPermissionsInfo(Long id);
|
PersonApplyDO xgfPersonPermissionsInfo(Long id);
|
||||||
|
|
||||||
|
PersonApplyDO getInfoByUserId(Long userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,6 @@ public interface PersonApplyRepository extends BaseRepository<PersonApplyDO> {
|
||||||
|
|
||||||
PersonApplyDO xgfPersonPermissionsInfo(Long id);
|
PersonApplyDO xgfPersonPermissionsInfo(Long id);
|
||||||
|
|
||||||
|
PersonApplyDO getInfoByUserId(Long userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,11 @@ public class PersonApplyRepositoryImpl extends BaseRepositoryImpl<PersonApplyMap
|
||||||
return personApplyMapper.xgfPersonPermissionsInfo(id);
|
return personApplyMapper.xgfPersonPermissionsInfo(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PersonApplyDO getInfoByUserId(Long userId) {
|
||||||
|
return personApplyMapper.getInfoByUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,10 +120,10 @@ public class OnePersonUtil {
|
||||||
* 1:解冻 2:冻结
|
* 1:解冻 2:冻结
|
||||||
* (1:有 2:无)
|
* (1:有 2:无)
|
||||||
*/
|
*/
|
||||||
public void freezeByUserCard(String userCard, String mkmjPermission) throws Exception {
|
public void freezeByUserCard(String userCard, Integer mkmjPermission) throws Exception {
|
||||||
DaHuaDeviceCommon daHuaDeviceCommon = getDaHuaDeviceCommon();
|
DaHuaDeviceCommon daHuaDeviceCommon = getDaHuaDeviceCommon();
|
||||||
JSONObject userByUserCard = daHuaDeviceCommon.getUserByUserCard(userCard).getJSONObject("data");
|
JSONObject userByUserCard = daHuaDeviceCommon.getUserByUserCard(userCard).getJSONObject("data");
|
||||||
daHuaDeviceCommon.updatePersonStatus(userByUserCard.getLong("id"), Integer.valueOf(mkmjPermission));
|
daHuaDeviceCommon.updatePersonStatus(userByUserCard.getLong("id"), mkmjPermission);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,17 @@
|
||||||
pa.id = #{id}
|
pa.id = #{id}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getInfoByUserId" resultType="com.zcloud.primeport.persistence.dataobject.PersonApplyDO">
|
||||||
|
SELECT
|
||||||
|
pa.*,
|
||||||
|
u.user_id user_uid
|
||||||
|
FROM
|
||||||
|
person_apply pa
|
||||||
|
LEFT JOIN USER u ON pa.employee_person_user_id = u.id
|
||||||
|
WHERE
|
||||||
|
pa.delete_enum = 'FALSE'
|
||||||
|
and pa.employee_person_user_id = ${userId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue