|
|
@ -17,7 +17,11 @@ |
|
|
|
|
|
|
|
package com.elink.esua.epdc.modules.epidemic.controller; |
|
|
|
|
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|
|
@ -49,7 +53,7 @@ import java.util.Map; |
|
|
|
@RestController |
|
|
|
@RequestMapping("persontesting") |
|
|
|
public class PersonTestingController { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private PersonTestingService personTestingService; |
|
|
|
|
|
|
@ -57,13 +61,13 @@ public class PersonTestingController { |
|
|
|
private PersonTestingDao personTestingDao; |
|
|
|
|
|
|
|
@GetMapping("page") |
|
|
|
public Result<PageData<PersonTestingPageDTO>> page(@RequestParam Map<String, Object> params){ |
|
|
|
public Result<PageData<PersonTestingPageDTO>> page(@RequestParam Map<String, Object> params) { |
|
|
|
PageData<PersonTestingPageDTO> page = personTestingService.page(params); |
|
|
|
return new Result<PageData<PersonTestingPageDTO>>().ok(page); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("{id}") |
|
|
|
public Result<PersonTestingDTO> get(@PathVariable("id") String id){ |
|
|
|
public Result<PersonTestingDTO> get(@PathVariable("id") String id) { |
|
|
|
PersonTestingDTO data = personTestingService.get(id); |
|
|
|
return new Result<PersonTestingDTO>().ok(data); |
|
|
|
} |
|
|
@ -77,7 +81,7 @@ public class PersonTestingController { |
|
|
|
} |
|
|
|
|
|
|
|
@PutMapping |
|
|
|
public Result update(@RequestBody PersonTestingDTO dto){ |
|
|
|
public Result update(@RequestBody PersonTestingDTO dto) { |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
|
personTestingService.update(dto); |
|
|
@ -85,7 +89,7 @@ public class PersonTestingController { |
|
|
|
} |
|
|
|
|
|
|
|
@DeleteMapping |
|
|
|
public Result delete(@RequestBody String[] ids){ |
|
|
|
public Result delete(@RequestBody String[] ids) { |
|
|
|
//效验数据
|
|
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
|
personTestingService.delete(ids); |
|
|
@ -94,34 +98,42 @@ public class PersonTestingController { |
|
|
|
|
|
|
|
@GetMapping("export") |
|
|
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
if (user == null) { |
|
|
|
throw new RenException("用户未登录"); |
|
|
|
} |
|
|
|
// 街道和超管有权查看所有数据
|
|
|
|
if (NumConstant.ZERO == user.getSuperAdmin() && user.getDeptId() != 1258587398679126017L) { |
|
|
|
params.put("deptIdList", user.getDeptIdList()); |
|
|
|
params.put("creatorId", user.getId()); |
|
|
|
} |
|
|
|
List<PersonTestingPageDTO> list = personTestingDao.getTestingPage(params); |
|
|
|
ExcelUtils.exportExcelToTarget(response, null, list, PersonTestingExcel.class); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @describe: 读卡器录入数据 |
|
|
|
* @author wangtong |
|
|
|
* @date 2021/8/20 18:11 |
|
|
|
* @params [dto] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
*/ |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @describe: 读卡器录入数据 |
|
|
|
* @author wangtong |
|
|
|
* @date 2021/8/20 18:11 |
|
|
|
* @params [dto] |
|
|
|
*/ |
|
|
|
@PostMapping("saveScanningInfo") |
|
|
|
public Result saveScanningInfo(@RequestBody PersonTestingDTO dto){ |
|
|
|
public Result saveScanningInfo(@RequestBody PersonTestingDTO dto) { |
|
|
|
return personTestingService.saveScanningInfo(dto); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @describe: 通过身份证号码查询手机号 |
|
|
|
* @author wangtong |
|
|
|
* @date 2021/8/23 17:54 |
|
|
|
* @params [dto] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
*/ |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @describe: 通过身份证号码查询手机号 |
|
|
|
* @author wangtong |
|
|
|
* @date 2021/8/23 17:54 |
|
|
|
* @params [dto] |
|
|
|
*/ |
|
|
|
@GetMapping("getMobileByIdCard") |
|
|
|
public Result getMobileByIdCard(PersonTestingDTO dto){ |
|
|
|
public Result getMobileByIdCard(PersonTestingDTO dto) { |
|
|
|
return personTestingService.getMobileByIdCard(dto); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |