Browse Source

图片上传修改

origin/feature/monitoring
Jackwang 4 years ago
parent
commit
4e625005ad
  1. 9
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/PersonTestingController.java
  2. 4
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/PersonTestingDao.java
  3. 3
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/PersonTestingService.java
  4. 9
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java
  5. 14
      epdc-cloud-custom/src/main/resources/application.yml
  6. 2
      epdc-cloud-custom/src/main/resources/mapper/epidemic/PersonTestingDao.xml

9
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/controller/PersonTestingController.java

@ -26,6 +26,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.PersonTestingDTO;
import com.elink.esua.epdc.dto.PersonTestingPageDTO;
import com.elink.esua.epdc.modules.epidemic.dao.PersonTestingDao;
import com.elink.esua.epdc.modules.epidemic.excel.PersonTestingExcel;
import com.elink.esua.epdc.modules.epidemic.service.PersonTestingService;
@ -55,9 +56,9 @@ public class PersonTestingController {
private PersonTestingDao personTestingDao;
@GetMapping("page")
public Result<PageData<PersonTestingDTO>> page(@RequestParam Map<String, Object> params){
PageData<PersonTestingDTO> page = personTestingService.page(params);
return new Result<PageData<PersonTestingDTO>>().ok(page);
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}")
@ -92,7 +93,7 @@ public class PersonTestingController {
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PersonTestingDTO> list = personTestingDao.getTestingPage(params);
List<PersonTestingPageDTO> list = personTestingDao.getTestingPage(params);
ExcelUtils.exportExcelToTarget(response, null, list, PersonTestingExcel.class);
}

4
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/dao/PersonTestingDao.java

@ -18,7 +18,7 @@
package com.elink.esua.epdc.modules.epidemic.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.PersonTestingDTO;
import com.elink.esua.epdc.dto.PersonTestingPageDTO;
import com.elink.esua.epdc.modules.epidemic.entity.PersonTestingEntity;
import org.apache.ibatis.annotations.Mapper;
@ -34,5 +34,5 @@ import java.util.Map;
@Mapper
public interface PersonTestingDao extends BaseDao<PersonTestingEntity> {
List<PersonTestingDTO> getTestingPage(Map<String, Object> params);
List<PersonTestingPageDTO> getTestingPage(Map<String, Object> params);
}

3
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/PersonTestingService.java

@ -21,6 +21,7 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.PersonTestingDTO;
import com.elink.esua.epdc.dto.PersonTestingPageDTO;
import com.elink.esua.epdc.modules.epidemic.entity.PersonTestingEntity;
import java.text.ParseException;
@ -43,7 +44,7 @@ public interface PersonTestingService extends BaseService<PersonTestingEntity> {
* @author generator
* @date 2021-08-20
*/
PageData<PersonTestingDTO> page(Map<String, Object> params);
PageData<PersonTestingPageDTO> page(Map<String, Object> params);
/**
* 默认查询

9
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/epidemic/service/impl/PersonTestingServiceImpl.java

@ -25,6 +25,7 @@ import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.PersonTestingDTO;
import com.elink.esua.epdc.dto.PersonTestingPageDTO;
import com.elink.esua.epdc.dto.UploadFormDTO;
import com.elink.esua.epdc.modules.epidemic.dao.PersonTestingDao;
import com.elink.esua.epdc.modules.epidemic.entity.PersonTestingEntity;
@ -59,14 +60,14 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao,
private OssFeignClient ossFeignClient;
@Override
public PageData<PersonTestingDTO> page(Map<String, Object> params) {
public PageData<PersonTestingPageDTO> page(Map<String, Object> params) {
// IPage<PersonTestingEntity> page = baseDao.selectPage(
// getPage(params, FieldConstant.CREATED_TIME, false),
// getWrapper(params)
// );
// return getPageData(page, PersonTestingDTO.class);
IPage<PersonTestingDTO> page = getPage(params);
List<PersonTestingDTO> list = baseDao.getTestingPage(params);
IPage<PersonTestingPageDTO> page = getPage(params);
List<PersonTestingPageDTO> list = baseDao.getTestingPage(params);
return new PageData<>(list, page.getTotal());
}
@ -153,7 +154,7 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao,
@Override
public Result saveScanningInfo(PersonTestingDTO dto) {
UploadFormDTO form = new UploadFormDTO();
form.setBase64String(dto.getImgCode());
form.setBase64String("data:image/png;base64,"+dto.getImgCode());
PersonTestingEntity entity = ConvertUtils.sourceToTarget(dto, PersonTestingEntity.class);
Result<String> uploadResult = ossFeignClient.uploadBase64(form);
if(!uploadResult.success()){

14
epdc-cloud-custom/src/main/resources/application.yml

@ -98,3 +98,17 @@ rocketmq:
name-server: @rocketmq.name.server@
consumer:
group: @rocketmq.consumer.group@
#hystrix的超时时间
hystrix:
command:
default:
execution:
timeout:
enabled: true
isolation:
thread:
timeoutInMilliseconds: 30000
#ribbon的超时时间
ribbon:
ReadTimeout: 30000
ConnectTimeout: 30000

2
epdc-cloud-custom/src/main/resources/mapper/epidemic/PersonTestingDao.xml

@ -23,7 +23,7 @@
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
<select id="getTestingPage" resultType="com.elink.esua.epdc.dto.PersonTestingDTO">
<select id="getTestingPage" resultType="com.elink.esua.epdc.dto.PersonTestingPageDTO">
select *
from epdc_person_testing
where del_flag='0'

Loading…
Cancel
Save