Commit 03be540f authored by mx's avatar mx

通行

parent eecab2bc
...@@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Propagation; ...@@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.math.BigInteger;
import java.util.*; import java.util.*;
/** /**
...@@ -511,7 +512,7 @@ public class JieLinkServiceImpl implements IJieLinkService { ...@@ -511,7 +512,7 @@ public class JieLinkServiceImpl implements IJieLinkService {
} }
DoorRecord record = new DoorRecord(); DoorRecord record = new DoorRecord();
record.setRecordId(recordDto.getRecordId()); record.setRecordId(recordDto.getRecordId());
record.setUserId(sysUserData.getBusinessId()); record.setUserId(BigInteger.valueOf(sysUserData.getBusinessId()));
record.setPersonId(sysUserData.getPersonId()); record.setPersonId(sysUserData.getPersonId());
record.setMobile(sysUserData.getPhone()); record.setMobile(sysUserData.getPhone());
record.setTenementType(sysUserData.getUserType()); record.setTenementType(sysUserData.getUserType());
......
...@@ -2,6 +2,7 @@ package org.rcisoft.sys.sysuser.controller; ...@@ -2,6 +2,7 @@ package org.rcisoft.sys.sysuser.controller;
/*固定导入*/ /*固定导入*/
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -22,16 +23,16 @@ import org.rcisoft.core.controller.CyPaginationController; ...@@ -22,16 +23,16 @@ import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.util.CyUserUtil; import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.model.CyGridModel; import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.exception.CyServiceException; import org.rcisoft.core.exception.CyServiceException;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List; import java.util.List;
/** /**
* Created by cy on 年11月24日 下午12:47:46. * Created by cy on 年11月24日 下午12:47:46.
*/ */
@RestController @RestController
@RequestMapping("/doorrecord") @RequestMapping("/doorrecord")
public class DoorRecordController extends CyPaginationController<DoorRecord> { public class DoorRecordController extends CyPaginationController<DoorRecord> {
...@@ -42,7 +43,7 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> { ...@@ -42,7 +43,7 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> {
//@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:add')") //@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:add')")
@CyOpeLogAnno(title = "system-通行记录信息表管理-新增通行记录信息表", businessType = CyLogTypeEnum.INSERT) @CyOpeLogAnno(title = "system-通行记录信息表管理-新增通行记录信息表", businessType = CyLogTypeEnum.INSERT)
@ApiOperation(value="添加通行记录信息表", notes="添加通行记录信息表") @ApiOperation(value = "添加通行记录信息表", notes = "添加通行记录信息表")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public CyResult add(@Valid DoorRecord doorRecord, BindingResult bindingResult) { public CyResult add(@Valid DoorRecord doorRecord, BindingResult bindingResult) {
CyPersistModel data = doorRecordServiceImpl.persist(doorRecord); CyPersistModel data = doorRecordServiceImpl.persist(doorRecord);
...@@ -51,12 +52,13 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> { ...@@ -51,12 +52,13 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> {
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
doorRecord); doorRecord);
} }
//@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:delete')") //@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:delete')")
@CyOpeLogAnno(title = "system-通行记录信息表管理-删除通行记录信息表", businessType = CyLogTypeEnum.DELETE) @CyOpeLogAnno(title = "system-通行记录信息表管理-删除通行记录信息表", businessType = CyLogTypeEnum.DELETE)
@ApiOperation(value="逻辑删除通行记录信息表", notes="逻辑删除通行记录信息表") @ApiOperation(value = "逻辑删除通行记录信息表", notes = "逻辑删除通行记录信息表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/deleteLogical/{businessId:\\w+}") @DeleteMapping("/deleteLogical/{businessId:\\w+}")
public CyResult deleteLogical(@PathVariable String businessId,DoorRecord doorRecord) { public CyResult deleteLogical(@PathVariable String businessId, DoorRecord doorRecord) {
doorRecord.setBusinessId(businessId); doorRecord.setBusinessId(businessId);
CyPersistModel data = doorRecordServiceImpl.removeLogical(doorRecord); CyPersistModel data = doorRecordServiceImpl.removeLogical(doorRecord);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
...@@ -64,12 +66,13 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> { ...@@ -64,12 +66,13 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> {
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
businessId); businessId);
} }
//@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:delete')") //@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:delete')")
@CyOpeLogAnno(title = "system-通行记录信息表管理-删除通行记录信息表", businessType = CyLogTypeEnum.DELETE) @CyOpeLogAnno(title = "system-通行记录信息表管理-删除通行记录信息表", businessType = CyLogTypeEnum.DELETE)
@ApiOperation(value="删除通行记录信息表", notes="删除通行记录信息表") @ApiOperation(value = "删除通行记录信息表", notes = "删除通行记录信息表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/delete/{businessId:\\w+}") @DeleteMapping("/delete/{businessId:\\w+}")
public CyResult delete(@PathVariable String businessId,DoorRecord doorRecord) { public CyResult delete(@PathVariable String businessId, DoorRecord doorRecord) {
doorRecord.setBusinessId(businessId); doorRecord.setBusinessId(businessId);
CyPersistModel data = doorRecordServiceImpl.remove(doorRecord); CyPersistModel data = doorRecordServiceImpl.remove(doorRecord);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
...@@ -80,11 +83,10 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> { ...@@ -80,11 +83,10 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> {
//@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:update')") //@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:update')")
@CyOpeLogAnno(title = "system-通行记录信息表管理-修改通行记录信息表", businessType = CyLogTypeEnum.UPDATE) @CyOpeLogAnno(title = "system-通行记录信息表管理-修改通行记录信息表", businessType = CyLogTypeEnum.UPDATE)
@ApiOperation(value="修改通行记录信息表", notes="修改通行记录信息表") @ApiOperation(value = "修改通行记录信息表", notes = "修改通行记录信息表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PutMapping("/update/{businessId:\\w+}") @PutMapping("/update")
public CyResult update(@PathVariable String businessId, @Valid DoorRecord doorRecord, BindingResult bindingResult) { public CyResult update(@RequestBody DoorRecord doorRecord, BindingResult bindingResult) {
doorRecord.setBusinessId(businessId);
CyPersistModel data = doorRecordServiceImpl.merge(doorRecord); CyPersistModel data = doorRecordServiceImpl.merge(doorRecord);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
...@@ -94,19 +96,19 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> { ...@@ -94,19 +96,19 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> {
//@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:query')") //@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:query')")
@CyOpeLogAnno(title = "system-通行记录信息表管理-查询通行记录信息表", businessType = CyLogTypeEnum.QUERY) @CyOpeLogAnno(title = "system-通行记录信息表管理-查询通行记录信息表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询单一通行记录信息表", notes="查询单一通行记录信息表") @ApiOperation(value = "查询单一通行记录信息表", notes = "查询单一通行记录信息表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "userId", required = true, dataType = "varchar")})
@GetMapping("/detail/{businessId:\\w+}") @GetMapping("/detail")
public CyResult detail(@PathVariable String businessId) { public CyResult detail(@RequestBody DoorRecord doorRecord) {
return CyResultGenUtil.builder(new CyPersistModel(1), return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
doorRecordServiceImpl.findById(businessId)); doorRecordServiceImpl.findById(doorRecord));
} }
//@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:list')") //@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:list')")
@CyOpeLogAnno(title = "system-通行记录信息表管理-查询通行记录信息表", businessType = CyLogTypeEnum.QUERY) @CyOpeLogAnno(title = "system-通行记录信息表管理-查询通行记录信息表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询通行记录信息表集合", notes="查询通行记录信息表集合") @ApiOperation(value = "查询通行记录信息表集合", notes = "查询通行记录信息表集合")
@GetMapping(value = "/queryDoorRecords") @GetMapping(value = "/queryDoorRecords")
public CyResult queryDoorRecords(DoorRecord doorRecord) { public CyResult queryDoorRecords(DoorRecord doorRecord) {
return CyResultGenUtil.builder(new CyPersistModel(1), return CyResultGenUtil.builder(new CyPersistModel(1),
...@@ -117,7 +119,7 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> { ...@@ -117,7 +119,7 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> {
//@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:list')") //@PreAuthorize("@cyPerm.hasPerm('sys:rRecord:list')")
@CyOpeLogAnno(title = "system-通行记录信息表管理-查询通行记录信息表", businessType = CyLogTypeEnum.QUERY) @CyOpeLogAnno(title = "system-通行记录信息表管理-查询通行记录信息表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="分页查询通行记录信息表集合", notes="分页查询通行记录信息表集合") @ApiOperation(value = "分页查询通行记录信息表集合", notes = "分页查询通行记录信息表集合")
@GetMapping(value = "/queryDoorRecordByPagination") @GetMapping(value = "/queryDoorRecordByPagination")
public CyGridModel listByPagination(DoorRecord doorRecord) { public CyGridModel listByPagination(DoorRecord doorRecord) {
doorRecordServiceImpl.findAllByPagination(getPaginationUtility(), doorRecord); doorRecordServiceImpl.findAllByPagination(getPaginationUtility(), doorRecord);
...@@ -127,12 +129,18 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> { ...@@ -127,12 +129,18 @@ public class DoorRecordController extends CyPaginationController<DoorRecord> {
@CyOpeLogAnno(title = "system-通行记录信息表管理-查询通行记录信息表", businessType = CyLogTypeEnum.EXPORT) @CyOpeLogAnno(title = "system-通行记录信息表管理-查询通行记录信息表", businessType = CyLogTypeEnum.EXPORT)
@ApiOperation(value = "导出通行记录信息表信息", notes = "导出通行记录信息表信息") @ApiOperation(value = "导出通行记录信息表信息", notes = "导出通行记录信息表信息")
@GetMapping(value = "/export") @GetMapping(value = "/export")
public CyResult outDoorRecord(HttpServletResponse response,DoorRecord doorRecord,@PathVariable @RequestParam(defaultValue = "0") String excelId) { public CyResult outDoorRecord(HttpServletResponse response, DoorRecord doorRecord, @PathVariable @RequestParam(defaultValue = "0") String excelId) {
String excelName=""; String excelName = "";
switch(excelId){ switch (excelId) {
case "0": excelName="通行记录信息表信息.xls";break; case "0":
case "1": excelName="通行记录信息表信息.xlsx";break; excelName = "通行记录信息表信息.xls";
case "2": excelName="通行记录信息表信息.csv";break; break;
case "1":
excelName = "通行记录信息表信息.xlsx";
break;
case "2":
excelName = "通行记录信息表信息.csv";
break;
} }
List<DoorRecord> doorRecordList = doorRecordServiceImpl.export(doorRecord); List<DoorRecord> doorRecordList = doorRecordServiceImpl.export(doorRecord);
CyEpExcelUtil.exportExcel(doorRecordList, "通行记录信息表信息", "通行记录信息表信息", DoorRecord.class, excelName, response); CyEpExcelUtil.exportExcel(doorRecordList, "通行记录信息表信息", "通行记录信息表信息", DoorRecord.class, excelName, response);
......
...@@ -15,8 +15,8 @@ import javax.mail.MailSessionDefinition; ...@@ -15,8 +15,8 @@ import javax.mail.MailSessionDefinition;
import java.util.List; import java.util.List;
/** /**
* Created with cy on 2022年11月24日 下午12:47:46. * Created with cy on 2022年11月24日 下午12:47:46.
*/ */
@Mapper @Mapper
public interface DoorRecordRepository extends CyBaseMapper<DoorRecord> { public interface DoorRecordRepository extends CyBaseMapper<DoorRecord> {
...@@ -25,8 +25,13 @@ public interface DoorRecordRepository extends CyBaseMapper<DoorRecord> { ...@@ -25,8 +25,13 @@ public interface DoorRecordRepository extends CyBaseMapper<DoorRecord> {
/** /**
* 分页查询 doorRecord * 分页查询 doorRecord
*
*/ */
IPage<DoorRecord> queryDoorRecordsPaged(CyPageInfo cyPageInfo,@Param("entity") DoorRecord doorRecord); IPage<DoorRecord> queryDoorRecordsPaged(CyPageInfo cyPageInfo, @Param("entity") DoorRecord doorRecord);
//单个查询
DoorRecord queryDoorRecordById(String recordId);
public int updateDoorRecordById(DoorRecord doorRecord);
} }
...@@ -41,6 +41,6 @@ public interface SysDictDataRepositorys extends CyBaseMapper<SysDictData> { ...@@ -41,6 +41,6 @@ public interface SysDictDataRepositorys extends CyBaseMapper<SysDictData> {
SysDictData queryDataByDeptIdC(String dictLabel); SysDictData queryDataByDeptIdC(String dictLabel);
//查询登记方式 //查询登记方式
SysDictData queryDataByDeviceIoType(String deviceIoType); SysDictData queryDataByCardType(String cardType);
} }
...@@ -24,6 +24,15 @@ import org.springframework.data.annotation.Transient; ...@@ -24,6 +24,15 @@ import org.springframework.data.annotation.Transient;
@TableName("door_record") @TableName("door_record")
public class DoorRecord extends CyIdEntity<DoorRecord> { public class DoorRecord extends CyIdEntity<DoorRecord> {
@Excel(name = "同行人员姓名", orderNum = "4", width = 20)
//通行人员姓名
private String name;
//排序
@Transient
private String px;
/** /**
* 开始时间 * 开始时间
*/ */
...@@ -40,12 +49,6 @@ public class DoorRecord extends CyIdEntity<DoorRecord> { ...@@ -40,12 +49,6 @@ public class DoorRecord extends CyIdEntity<DoorRecord> {
@Transient @Transient
private String deviceIoType; private String deviceIoType;
//登记状态
/**
* 闸机类型
* 1:进口 2出口
*/
private String deviceType;
//登记日期 //登记日期
@Transient @Transient
...@@ -66,55 +69,55 @@ public class DoorRecord extends CyIdEntity<DoorRecord> { ...@@ -66,55 +69,55 @@ public class DoorRecord extends CyIdEntity<DoorRecord> {
* @column record_id * @column record_id
* @default * @default
*/ */
@Excel(name = "记录主键", orderNum = "0", width = 20) // @Excel(name = "记录主键", orderNum = "0", width = 20)
private String recordId; private String recordId;
/** /**
* @desc 用户ID * @desc 系统内部用户主键id
* @column user_id * @column user_id
* @default * @default
*/ */
@Excel(name = "用户ID", orderNum = "1", width = 20) // @Excel(name = "系统内部用户主键id", orderNum = "1", width = 20)
private Integer userId; private BigInteger userId;
/** /**
* @desc 通行人唯一标识 * @desc 通行人唯一标识
* @column person_id * @column person_id
* @default * @default
*/ */
@Excel(name = "通行人唯一标识", orderNum = "1", width = 20) // @Excel(name = "通行人唯一标识", orderNum = "2", width = 20)
private String personId; private String personId;
/** /**
* @desc 人员手机号 * @desc 手机号码
* @column mobile * @column mobile
* @default * @default
*/ */
@Excel(name = "人员手机号", orderNum = "1", width = 20) // @Excel(name = "手机号码", orderNum = "3", width = 20)
private String mobile; private String mobile;
/** /**
* @desc 记录备注信息 * @desc 人员身份(0内部员工 1外部访客)
* @column remark * @column tenement_type
* @default * @default
*/ */
@Excel(name = "记录备注信息", orderNum = "19", width = 20) @Excel(name = "同行人员身份", orderNum = "4", width = 20)
private String remark; private String tenementType;
/** /**
* @desc 人员身份 0: 内部员工 1 访客 * @desc 备注信息
* @column tenement_type * @column remark
* @default * @default
*/ */
@Excel(name = "人员身份", orderNum = "19", width = 20) // @Excel(name = "备注信息", orderNum = "5", width = 20)
private String tenementType; private String remark;
/** /**
* @desc 设备id * @desc 设备id
* @column device_id * @column device_id
* @default * @default
*/ */
@Excel(name = "设备id", orderNum = "20", width = 20) // @Excel(name = "设备id", orderNum = "6", width = 20)
private String deviceId; private String deviceId;
/** /**
...@@ -122,23 +125,39 @@ public class DoorRecord extends CyIdEntity<DoorRecord> { ...@@ -122,23 +125,39 @@ public class DoorRecord extends CyIdEntity<DoorRecord> {
* @column device_name * @column device_name
* @default * @default
*/ */
@Excel(name = "设备名称", orderNum = "21", width = 20) @Excel(name = "登记设备", orderNum = "7", width = 20)
private String deviceName; private String deviceName;
/**
* @desc 闸门类型(判断进口还是出口 , 1 : 进口 2 : 出口)
* @column device_type
* @default
*/
@Excel(name = "登记状态", orderNum = "8", width = 20)
private String deviceType;
/** /**
* @desc 凭证类型(数据字典) * @desc 凭证类型(数据字典)
* @column card_type * @column card_type
* @default * @default
*/ */
@Excel(name = "凭证类型(数据字典)", orderNum = "22", width = 20) // @Excel(name = "凭证类型(数据字典)", orderNum = "9", width = 20)
private String cardType; private String cardType;
/**
* @desc 凭证类型中文
* @column card_type_label
* @default
*/
@Excel(name = "登记方式", orderNum = "10", width = 20)
private String cardTypeLabel;
/** /**
* @desc 卡号 * @desc 卡号
* @column card_no * @column card_no
* @default * @default
*/ */
@Excel(name = "卡号", orderNum = "23", width = 20) // @Excel(name = "卡号", orderNum = "11", width = 20)
private String cardNo; private String cardNo;
/** /**
...@@ -146,23 +165,15 @@ public class DoorRecord extends CyIdEntity<DoorRecord> { ...@@ -146,23 +165,15 @@ public class DoorRecord extends CyIdEntity<DoorRecord> {
* @column cross_time * @column cross_time
* @default * @default
*/ */
@Excel(name = "触发时间(根据触发时间按年分表)", orderNum = "24", width = 20) // @Excel(name = "触发时间(根据触发时间按年分表)", orderNum = "12", width = 20)
private Date crossTime; private Date crossTime;
/**
* @desc 抓拍照片路径
* @column picture_file
* @default
*/
@Excel(name = "抓拍照片路径", orderNum = "25", width = 20)
private String pictureFile;
/** /**
* @desc 记录类型 0:未知 1:正常记录 2:非法记录 3:报警记录 * @desc 记录类型 0:未知 1:正常记录 2:非法记录 3:报警记录
* @column record_type * @column record_type
* @default * @default
*/ */
@Excel(name = "记录类型 0:未知 1:正常记录 2:非法记录 3:报警记录", orderNum = "26", width = 20) @Excel(name = "登记结果", orderNum = "13", width = 20)
private String recordType; private String recordType;
/** /**
...@@ -170,9 +181,16 @@ public class DoorRecord extends CyIdEntity<DoorRecord> { ...@@ -170,9 +181,16 @@ public class DoorRecord extends CyIdEntity<DoorRecord> {
* @column event_type * @column event_type
* @default * @default
*/ */
@Excel(name = "门禁事件类型(数据字典)", orderNum = "27", width = 20) // @Excel(name = "门禁事件类型(数据字典)", orderNum = "14", width = 20)
private String eventType; private String eventType;
/**
* @desc 标记异常(0 异常 1非异常)
* @column abnormal
* @default
*/
// @Excel(name = "标记异常(0 异常 1非异常)", orderNum = "15", width = 20)
private String abnormal;
} }
...@@ -43,10 +43,10 @@ public interface DoorRecordService { ...@@ -43,10 +43,10 @@ public interface DoorRecordService {
/** /**
* 根据id查询 通行记录信息表 * 根据id查询 通行记录信息表
* @param id * @param doorRecord
* @return * @return
*/ */
DoorRecord findById(String id); DoorRecord findById(DoorRecord doorRecord);
/** /**
* 分页查询 通行记录信息表 * 分页查询 通行记录信息表
......
...@@ -99,21 +99,22 @@ public class DoorRecordServiceImpl extends ServiceImpl<DoorRecordRepository, Doo ...@@ -99,21 +99,22 @@ public class DoorRecordServiceImpl extends ServiceImpl<DoorRecordRepository, Doo
@Override @Override
public CyPersistModel merge(DoorRecord doorRecord) { public CyPersistModel merge(DoorRecord doorRecord) {
//TODO 需要重写 //TODO 需要重写
int line = baseMapper.updateById(doorRecord); int line = baseMapper.updateDoorRecordById(doorRecord);
log.debug(CyUserUtil.getAuthenUsername() + "修改了ID为" + doorRecord.getBusinessId() + "的通行记录信息表信息"); log.debug(CyUserUtil.getAuthenUsername() + "修改了ID为" + doorRecord.getRecordId() + "的通行记录信息表信息");
return new CyPersistModel(line); return new CyPersistModel(line);
} }
/** /**
* 根据id查询 通行记录信息表 * 根据id查询 通行记录信息表
* *
* @param id * @param doorRecord
* @return * @return
*/ */
@Override @Override
public DoorRecord findById(String id) { public DoorRecord findById(DoorRecord doorRecord) {
//TODO 需要重写 //TODO 需要重写
return baseMapper.selectById(id); DoorRecord doorRecord1 = baseMapper.queryDoorRecordById(doorRecord.getRecordId());
return doorRecord1;
} }
/** /**
...@@ -136,11 +137,14 @@ public class DoorRecordServiceImpl extends ServiceImpl<DoorRecordRepository, Doo ...@@ -136,11 +137,14 @@ public class DoorRecordServiceImpl extends ServiceImpl<DoorRecordRepository, Doo
//截取登记时间 //截取登记时间
SimpleDateFormat sf2 = new SimpleDateFormat("HH:mm:ss"); SimpleDateFormat sf2 = new SimpleDateFormat("HH:mm:ss");
doorRecordIPage.getRecords().get(i).setTime(sf2.format(createDate)); doorRecordIPage.getRecords().get(i).setTime(sf2.format(createDate));
//获取登记方式id //获取登记方式id
String deviceIoType = doorRecordIPage.getRecords().get(i).getDeviceIoType(); String cardType = doorRecordIPage.getRecords().get(i).getCardType();
//获取登记方式中文 //获取登记方式中文
SysDictData sysDictData = sysDictDataRepositorys.queryDataByDeviceIoType(deviceIoType); SysDictData sysDictData = sysDictDataRepositorys.queryDataByCardType(cardType);
if (sysDictData != null) {
doorRecordIPage.getRecords().get(i).setCardTypeLabel(sysDictData.getDictLabel());
}
} }
return doorRecordIPage; return doorRecordIPage;
...@@ -169,6 +173,35 @@ public class DoorRecordServiceImpl extends ServiceImpl<DoorRecordRepository, Doo ...@@ -169,6 +173,35 @@ public class DoorRecordServiceImpl extends ServiceImpl<DoorRecordRepository, Doo
//TODO 需要重写 //TODO 需要重写
//条件加上年份,默认查询当年的,因此代码里面需要判断是否传递有年代的逻辑 //条件加上年份,默认查询当年的,因此代码里面需要判断是否传递有年代的逻辑
List<DoorRecord> doorRecordList = baseMapper.queryDoorRecords(doorRecord); List<DoorRecord> doorRecordList = baseMapper.queryDoorRecords(doorRecord);
for (int i = 0; i < doorRecordList.size(); i++) {
//获取同行人员身份
String tenementType = doorRecordList.get(i).getTenementType();
if (tenementType != null) {
if (tenementType.equals("0")) {
doorRecordList.get(i).setTenementType("内部员工");
} else if (tenementType.equals("1")) {
doorRecordList.get(i).setTenementType("外部访客");
}
}
//获取登记状态
String deviceType = doorRecordList.get(i).getDeviceType();
if (deviceType != null) {
if (deviceType.equals("1")) {
doorRecordList.get(i).setDeviceType("进口");
} else if (deviceType.equals("2")) {
doorRecordList.get(i).setDeviceType("出口");
}
}
//获取登记结果
String recordType = doorRecordList.get(i).getRecordType();
if (recordType != null) {
if (recordType.equals("1")) {
doorRecordList.get(i).setRecordType("成功");
} else {
doorRecordList.get(i).setRecordType("失败");
}
}
}
return doorRecordList; return doorRecordList;
} }
......
...@@ -22,29 +22,88 @@ ...@@ -22,29 +22,88 @@
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/> <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="abnormal" jdbcType="VARCHAR" property="abnormal"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="queryDoorRecords" resultMap="BaseResultMap"> <select id="queryDoorRecords" resultMap="BaseResultMap">
select * from door_record SELECT
where 1=1 dr.record_id,su.name,dr.tenement_type,dr.create_date,dr.device_type,dr.device_name,dr.card_type,dr.record_type,dr.card_type_label,dr.abnormal
<if test="entity.delFlag !=null and entity.delFlag != '' "> FROM door_record_2022 dr
and del_flag = #{entity.delFlag} left JOIN sys_user su ON dr.person_id = su.person_id
WHERE dr.del_flag = 0
<if test="entity.deviceType !=null and entity.deviceType != '' ">
and dr.device_type = #{entity.deviceType}
</if> </if>
<if test="entity.flag !=null and entity.flag != '' "> <if test="entity.beginTime != null and entity.beginTime !='' "><!-- 开始时间检索 -->
and flag = #{entity.flag} and date_format(su.create_date,'%Y-%m-%d') &gt;= date_format(#{entity.beginTime},'%Y-%m-%d')
</if>
<if test="entity.endTime != null and entity.endTime !='' "><!-- 结束时间检索 -->
and date_format(su.create_date,'%Y-%m-%d') &lt;= date_format(#{entity.endTime},'%Y-%m-%d')
</if>
<if test="entity.deviceName !=null and entity.deviceName != '' ">
and dr.device_name = #{entity.deviceName}
</if>
<if test="entity.tenementType !=null and entity.tenementType != '' ">
and dr.tenement_type = #{entity.tenementType}
</if>
<if test="entity.cardType !=null and entity.cardType != '' ">
and dr.card_type = #{entity.cardType}
</if>
<if test="entity.px == '1'.toString() "><!-- 排序-->
order BY dr.create_date desc
</if> </if>
</select> </select>
<select id="queryDoorRecordsPaged" resultMap="BaseResultMap"> <select id="queryDoorRecordsPaged" resultMap="BaseResultMap">
SELECT su.user_type,d.device_type,d.deviceIo_type,dr.* SELECT
FROM door_record dr dr.record_id,su.name,dr.tenement_type,dr.create_date,dr.device_type,dr.device_name,dr.card_type,dr.record_type,dr.card_type_label,dr.abnormal
JOIN sys_user su ON dr.person_id = su.person_id FROM door_record_2022 dr
JOIN devices d ON dr.device_id = d.device_id left JOIN sys_user su ON dr.person_id = su.person_id
where dr.del_flag = 0 WHERE dr.del_flag = 0
<if test="entity.flag !=null and entity.flag != '' "> <if test="entity.deviceType !=null and entity.deviceType != '' ">
and dr.flag = #{entity.flag} and dr.device_type = #{entity.deviceType}
</if>
<if test="entity.beginTime != null and entity.beginTime !='' "><!-- 开始时间检索 -->
and date_format(dr.create_date,'%Y-%m-%d') &gt;= date_format(#{entity.beginTime},'%Y-%m-%d')
</if>
<if test="entity.endTime != null and entity.endTime !='' "><!-- 结束时间检索 -->
and date_format(dr.create_date,'%Y-%m-%d') &lt;= date_format(#{entity.endTime},'%Y-%m-%d')
</if> </if>
<if test="entity.deviceName !=null and entity.deviceName != '' ">
and dr.device_name in(${entity.deviceName})
</if>
<if test="entity.tenementType !=null and entity.tenementType != '' ">
and dr.tenement_type = #{entity.tenementType}
</if>
<if test="entity.cardType !=null and entity.cardType != '' ">
and dr.card_type = #{entity.cardType}
</if>
<if test="entity.px == '1'.toString() "><!-- 排序-->
order BY dr.create_date desc
</if>
</select>
<select id="queryDoorRecordById" resultMap="BaseResultMap">
SELECT dr.record_id,
su.name,
dr.tenement_type,
dr.create_date,
dr.device_type,
dr.device_name,
dr.card_type,
dr.record_type,
dr.card_type_label,
dr.abnormal
FROM door_record_2022 dr
left JOIN sys_user su ON dr.person_id = su.person_id
WHERE dr.del_flag = 0
and record_id = #{recordId}
</select> </select>
<update id="updateDoorRecordById" parameterType="org.rcisoft.sys.sysuser.entity.DoorRecord">
UPDATE door_record_2022
SET abnormal = #{abnormal}
WHERE record_id = #{recordId}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -75,11 +75,11 @@ ...@@ -75,11 +75,11 @@
and dict_label = #{dictLabel} and dict_label = #{dictLabel}
</select> </select>
<select id="queryDataByDeviceIoType" resultMap="BaseResultMap"> <select id="queryDataByCardType" resultMap="BaseResultMap">
SELECT * SELECT *
FROM sys_dict_data FROM sys_dict_data
WHERE del_flag = 0 WHERE del_flag = 0
and dict_type = "dj" and dict_type = "dj"
and dict_label = #{deviceIoType} and dict_value = #{cardType}
</select> </select>
</mapper> </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