20 changed files with 601 additions and 38 deletions
@ -0,0 +1,52 @@
|
||||
package com.biutag.supervision.controller.mobileSupervision; |
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.biutag.supervision.pojo.Result; |
||||
import com.biutag.supervision.pojo.dto.SupRiskPersonalSupRecordDto; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonal; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonalControlRecord; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonalSup; |
||||
import com.biutag.supervision.pojo.entity.SupTaskProblem; |
||||
import com.biutag.supervision.pojo.param.SupRiskPersonalQueryParam; |
||||
import com.biutag.supervision.pojo.param.SupRiskPersonalSupRecordQueryParam; |
||||
import com.biutag.supervision.pojo.vo.SupRiskPersonalSupRecordVo; |
||||
import com.biutag.supervision.pojo.vo.SupRiskPersonalVo; |
||||
import com.biutag.supervision.service.SupRiskPersonalService; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
|
||||
@RequestMapping("/task/supRisk") |
||||
@RestController |
||||
@RequiredArgsConstructor |
||||
public class SupRiskPersonController { |
||||
|
||||
private final SupRiskPersonalService supRiskPersonalService; |
||||
@GetMapping |
||||
Result<Page<SupRiskPersonalVo>> queryPage(SupRiskPersonalQueryParam queryParam){ |
||||
return Result.success(supRiskPersonalService.page(queryParam)); |
||||
} |
||||
//保存督察记录
|
||||
@PostMapping("/saveSupRecord") |
||||
Result saveSupRecord(@RequestBody SupRiskPersonalSupRecordDto supRecordDto){ |
||||
if( supRiskPersonalService.saveSupRecord(supRecordDto)){ |
||||
return Result.success(); |
||||
}else{ |
||||
return Result.failed("操作失败"); |
||||
} |
||||
} |
||||
//督察记录分页
|
||||
@GetMapping("recordPage") |
||||
Result<Page<SupRiskPersonalSupRecordVo>> recordPage(SupRiskPersonalSupRecordQueryParam queryParam){ |
||||
return Result.success(supRiskPersonalService.recordPage(queryParam)); |
||||
} |
||||
//删除督察记录
|
||||
@DeleteMapping("/supRecord/{id}") |
||||
Result delRecordData(@PathVariable Integer id){ |
||||
return Result.success(supRiskPersonalService.delSupRecord(id)); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -1,8 +1,18 @@
|
||||
package com.biutag.supervision.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonal; |
||||
import com.biutag.supervision.pojo.entity.SupTaskSelfexamination; |
||||
import com.biutag.supervision.pojo.param.SupRiskPersonalQueryParam; |
||||
import com.biutag.supervision.pojo.param.TaskInspectionQueryParam; |
||||
import com.biutag.supervision.pojo.vo.SupRiskPersonalVo; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
public interface SupRiskPersonalMapper extends BaseMapper<SupRiskPersonal> { |
||||
import java.util.List; |
||||
|
||||
} |
||||
public interface SupRiskPersonalMapper extends BaseMapper<SupRiskPersonal> { |
||||
Page<SupRiskPersonalVo> queryPage(@Param("page") Page<SupRiskPersonalQueryParam> page, @Param(Constants.WRAPPER) QueryWrapper<SupRiskPersonal> queryWrapper); |
||||
} |
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package com.biutag.supervision.mapper; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.biutag.supervision.pojo.dto.SupRiskPersonalSupRecordDto; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonal; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonalSupRecord; |
||||
import com.biutag.supervision.pojo.param.SupRiskPersonalSupRecordQueryParam; |
||||
import com.biutag.supervision.pojo.vo.SupRiskPersonalSupRecordVo; |
||||
import com.biutag.supervision.pojo.vo.SupRiskPersonalVo; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface SupRiskPersonalSupRecordMapper extends BaseMapper<SupRiskPersonalSupRecord> { |
||||
|
||||
Page<SupRiskPersonalSupRecordVo> queryPage(@Param("page") Page<SupRiskPersonalSupRecordQueryParam> page, @Param(Constants.WRAPPER) QueryWrapper<SupRiskPersonalSupRecord> queryWrapper); |
||||
|
||||
} |
||||
@ -1,8 +1,10 @@
|
||||
package com.biutag.supervision.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonal; |
||||
import com.biutag.supervision.pojo.entity.SupTaskPerson; |
||||
import com.biutag.supervision.pojo.param.TaskInspectionQueryParam; |
||||
|
||||
public interface SupTaskPersonMapper extends BaseMapper<SupTaskPerson> { |
||||
|
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package com.biutag.supervision.pojo.dto; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.biutag.supervision.pojo.vo.FileVo; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
@Getter |
||||
@Setter |
||||
public class SupRiskPersonalSupRecordDto { |
||||
|
||||
private int id; |
||||
//重点人员姓名
|
||||
private String name; |
||||
|
||||
//重点人员证件号码
|
||||
private String idCode; |
||||
//督察状态
|
||||
private String supStatus; |
||||
//督察方式
|
||||
private String supType; |
||||
|
||||
//督察情况
|
||||
private String supDesc; |
||||
|
||||
//督察时间
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") |
||||
private LocalDateTime supTime; |
||||
|
||||
|
||||
// 检测照片
|
||||
private List<FileVo> Files = new ArrayList<>(); |
||||
|
||||
} |
||||
@ -0,0 +1,56 @@
|
||||
package com.biutag.supervision.pojo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import java.time.LocalDateTime; |
||||
|
||||
@Getter |
||||
@Setter |
||||
public class SupRiskPersonalSupRecord { |
||||
|
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private int id; |
||||
//重点人员姓名
|
||||
@TableField("name") |
||||
private String name; |
||||
|
||||
//重点人员证件号码
|
||||
@TableField("id_code") |
||||
private String idCode; |
||||
//督察状态
|
||||
@TableField("sup_status") |
||||
private String supStatus; |
||||
//督察方式
|
||||
@TableField("sup_type") |
||||
private String supType; |
||||
|
||||
//督察情况
|
||||
@TableField("sup_desc") |
||||
private String supDesc; |
||||
|
||||
//附件 JSON格式
|
||||
@TableField("files") |
||||
private String files; |
||||
|
||||
//督察时间
|
||||
@TableField("sup_time") |
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") |
||||
private LocalDateTime supTime; |
||||
|
||||
//创建时间
|
||||
@TableField("create_time") |
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") |
||||
private LocalDateTime createTime; |
||||
|
||||
@TableField("create_emp_no") |
||||
private String createEmpNo; |
||||
|
||||
@TableField("create_name") |
||||
private String createName; |
||||
|
||||
} |
||||
@ -0,0 +1,15 @@
|
||||
package com.biutag.supervision.pojo.param; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
@Getter |
||||
@Setter |
||||
public class SupRiskPersonalQueryParam extends BasePage{ |
||||
//任务ID
|
||||
private Integer taskId; |
||||
//重点人员身份证
|
||||
private String idCode; |
||||
//姓名
|
||||
private String name; |
||||
} |
||||
@ -0,0 +1,11 @@
|
||||
package com.biutag.supervision.pojo.param; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
@Getter |
||||
@Setter |
||||
public class SupRiskPersonalSupRecordQueryParam extends BasePage { |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,38 @@
|
||||
package com.biutag.supervision.pojo.vo; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.List; |
||||
|
||||
@Getter |
||||
@Setter |
||||
public class SupRiskPersonalSupRecordVo { |
||||
//id
|
||||
private int id; |
||||
//重点人员姓名
|
||||
private String name; |
||||
//重点人员证件号码
|
||||
private String idCode; |
||||
//督察状态
|
||||
private String supStatus; |
||||
//督察方式
|
||||
private String supType; |
||||
//督察情况
|
||||
private String supDesc; |
||||
//附件 JSON格式
|
||||
private String files; |
||||
//附件
|
||||
private List<FileVo> fileVoList; |
||||
|
||||
//督察时间
|
||||
private LocalDateTime supTime; |
||||
|
||||
//创建时间
|
||||
private LocalDateTime createTime; |
||||
|
||||
private String createEmpNo; |
||||
|
||||
private String createName; |
||||
} |
||||
@ -0,0 +1,59 @@
|
||||
package com.biutag.supervision.pojo.vo; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
import java.time.LocalDateTime; |
||||
|
||||
@Getter |
||||
@Setter |
||||
public class SupRiskPersonalVo { |
||||
// 证件号码
|
||||
private String idCode; |
||||
|
||||
// 姓名
|
||||
private String name; |
||||
|
||||
// 性别男1女2
|
||||
private String gender; |
||||
|
||||
// 年龄
|
||||
private Integer age; |
||||
|
||||
// 手机号
|
||||
private String mobile; |
||||
|
||||
// 人员类别
|
||||
private String personalType; |
||||
|
||||
// 管控级别
|
||||
private String controlLevel; |
||||
|
||||
// 责任单位id
|
||||
private String responsibleDepartId; |
||||
|
||||
// 责任单位名称
|
||||
private String responsibleDepartName; |
||||
|
||||
// 责任民警警号
|
||||
private String responsibleEmpNo; |
||||
|
||||
// 责任民警姓名
|
||||
private String responsibleName; |
||||
|
||||
// 创建时间
|
||||
private LocalDateTime createTime; |
||||
|
||||
// 包保督察人员ID
|
||||
private Integer taskPersonId; |
||||
|
||||
private String controlTimeInterval; |
||||
|
||||
private Integer taskId; |
||||
//督察人员姓名
|
||||
private String controlName; |
||||
//督察人员警号
|
||||
private String controlEmpNo; |
||||
} |
||||
@ -1,11 +1,94 @@
|
||||
package com.biutag.supervision.service; |
||||
|
||||
import cn.hutool.core.collection.CollectionUtil; |
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.biutag.supervision.common.UserContextHolder; |
||||
import com.biutag.supervision.constants.AppConstants; |
||||
import com.biutag.supervision.mapper.SupRiskPersonalSupRecordMapper; |
||||
import com.biutag.supervision.pojo.Result; |
||||
import com.biutag.supervision.pojo.dto.SupRiskPersonalSupRecordDto; |
||||
import com.biutag.supervision.pojo.entity.RpcApplySupervise; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonal; |
||||
import com.biutag.supervision.mapper.SupRiskPersonalMapper; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonalSupRecord; |
||||
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholPeople; |
||||
import com.biutag.supervision.pojo.model.UserAuth; |
||||
import com.biutag.supervision.pojo.param.SupRiskPersonalQueryParam; |
||||
import com.biutag.supervision.pojo.param.SupRiskPersonalSupRecordQueryParam; |
||||
import com.biutag.supervision.pojo.param.TaskInspectionQueryParam; |
||||
import com.biutag.supervision.pojo.param.TaskTestingAlcoholPeopleQueryParam; |
||||
import com.biutag.supervision.pojo.vo.*; |
||||
import com.biutag.supervision.util.JSON; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.beans.BeanUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
@RequiredArgsConstructor |
||||
@Service |
||||
public class SupRiskPersonalService extends ServiceImpl<SupRiskPersonalMapper, SupRiskPersonal> { |
||||
|
||||
|
||||
private final SupRiskPersonalSupRecordService supRecordService; |
||||
|
||||
private final SupRiskPersonalSupRecordMapper supRiskPersonalSupRecordMapper; |
||||
|
||||
/** |
||||
* 分页查询 |
||||
* */ |
||||
public Page<SupRiskPersonalVo> page(SupRiskPersonalQueryParam queryParam) { |
||||
QueryWrapper<SupRiskPersonal> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("srp.task_id", queryParam.getTaskId()) |
||||
.like("srp.id_code",queryParam.getIdCode()) |
||||
.like("srp.name",queryParam.getName()) |
||||
.orderByAsc("srp.create_time"); |
||||
Page<SupRiskPersonalVo> page = baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); |
||||
return page; |
||||
} |
||||
|
||||
/** |
||||
* 录入督察记录数据 |
||||
* */ |
||||
public Boolean saveSupRecord(SupRiskPersonalSupRecordDto supRecordDto){ |
||||
SupRiskPersonalSupRecord supRecord = new SupRiskPersonalSupRecord(); |
||||
BeanUtils.copyProperties(supRecordDto,supRecord); |
||||
supRecord.setCreateTime(LocalDateTime.now()); |
||||
UserAuth user = UserContextHolder.getCurrentUser(); |
||||
if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())) { |
||||
supRecord.setCreateEmpNo(user.getEmpNo()); |
||||
supRecord.setCreateName(user.getUserName()); |
||||
} |
||||
//补充file
|
||||
supRecord.setFiles(JSON.toJSONString(supRecordDto.getFiles())); |
||||
|
||||
return supRecordService.saveOrUpdate(supRecord); |
||||
} |
||||
|
||||
/** |
||||
* 督察记录列表 |
||||
* */ |
||||
public Page<SupRiskPersonalSupRecordVo> recordPage(SupRiskPersonalSupRecordQueryParam queryParam){ |
||||
QueryWrapper<SupRiskPersonalSupRecord> queryWrapper = new QueryWrapper<>(); |
||||
Page<SupRiskPersonalSupRecordVo> page = supRiskPersonalSupRecordMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); |
||||
|
||||
page.getRecords().forEach(item -> { |
||||
if (StrUtil.isNotBlank(item.getFiles())) { |
||||
item.setFileVoList(com.alibaba.fastjson2.JSON.parseArray(item.getFiles(), FileVo.class)); |
||||
} |
||||
}); |
||||
return page; |
||||
} |
||||
|
||||
/** |
||||
* 删除督察记录 |
||||
* */ |
||||
public Boolean delSupRecord(Integer id){ |
||||
return supRiskPersonalSupRecordMapper.deleteById(id) > 0; |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,12 @@
|
||||
package com.biutag.supervision.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.biutag.supervision.mapper.SupRiskPersonalSupMapper; |
||||
import com.biutag.supervision.mapper.SupRiskPersonalSupRecordMapper; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonalSup; |
||||
import com.biutag.supervision.pojo.entity.SupRiskPersonalSupRecord; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@Service |
||||
public class SupRiskPersonalSupRecordService extends ServiceImpl<SupRiskPersonalSupRecordMapper, SupRiskPersonalSupRecord> { |
||||
} |
||||
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper |
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.biutag.supervision.mapper.SupRiskPersonalMapper"> |
||||
|
||||
<select id="queryPage" resultType="com.biutag.supervision.pojo.vo.SupRiskPersonalVo"> |
||||
SELECT |
||||
srp.id_code, |
||||
srp.name, |
||||
srp.gender, |
||||
srp.age, |
||||
srp.mobile, |
||||
srp.personal_type, |
||||
srp.control_level, |
||||
srp.responsible_depart_id, |
||||
srp.responsible_depart_name, |
||||
srp.responsible_emp_no, |
||||
srp.responsible_name, |
||||
srp.control_time_interval, |
||||
srp.create_time, |
||||
srp.task_person_id, |
||||
srp.task_id, |
||||
stp.name as controlName, |
||||
stp.emp_no as controlEmpNo |
||||
FROM sup_risk_personal as srp |
||||
LEFT JOIN sup_task_person as stp on srp.task_person_id = stp.id |
||||
${ew.getCustomSqlSegment} |
||||
</select> |
||||
</mapper> |
||||
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper |
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.biutag.supervision.mapper.SupRiskPersonalSupRecordMapper"> |
||||
|
||||
<select id="queryPage" resultType="com.biutag.supervision.pojo.vo.SupRiskPersonalSupRecordVo"> |
||||
SELECT |
||||
* |
||||
from sup_risk_personal_sup_record as t |
||||
${ew.getCustomSqlSegment} |
||||
</select> |
||||
</mapper> |
||||
Loading…
Reference in new issue