|
@@ -1,19 +1,21 @@
|
|
|
package thyyxxk.webserver.service.querydata;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.omg.PortableServer.POAPackage.InvalidPolicy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.dao.his.querydata.TCovidVaccinateAppointmentMapper;
|
|
|
import thyyxxk.webserver.pojo.ResultVo;
|
|
|
import thyyxxk.webserver.pojo.querydata.TCovidVaccinateAppointment;
|
|
|
import thyyxxk.webserver.pojo.querydata.TcovidVaccinateThreshold;
|
|
|
-import thyyxxk.webserver.utils.DateUtil;
|
|
|
-import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
-import thyyxxk.webserver.utils.TokenUtil;
|
|
|
+import thyyxxk.webserver.pojo.wxapi.QueryWxOrderParam;
|
|
|
+import thyyxxk.webserver.utils.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
@@ -43,18 +45,8 @@ public class TCovidVaccinateAppointmentService {
|
|
|
public ResultVo<Map<String,Object>> queryXGYM(TCovidVaccinateAppointment data){
|
|
|
log.info("查询新冠疫苗预约=>操作人:{},查找姓名:{},查找日期:{}", TokenUtil.getTokenUserId(),
|
|
|
data.getName(),data.getExecuteDate()!=null? DateUtil.formatDatetime(data.getExecuteDate(),"yyyy-MM-dd"): "");
|
|
|
- IPage<TCovidVaccinateAppointment> page = new Page<>(data.getCurrentPage(),data.getPageSize());
|
|
|
-
|
|
|
- QueryWrapper<TCovidVaccinateAppointment> qw = new QueryWrapper<>();
|
|
|
+ IPage<TCovidVaccinateAppointment> page = getQueryPage(data);
|
|
|
Map map = new HashMap();
|
|
|
- if (data.getName() != null && data.getName() !="" && !data.getName().equals("")){
|
|
|
- qw.eq("a.name",data.getName());
|
|
|
- }
|
|
|
- if (data.getExecuteDate() != null ){
|
|
|
- qw.eq("execute_date",DateUtil.formatDatetime(data.getExecuteDate(),"yyyy-MM-dd"));
|
|
|
- }
|
|
|
- dao.mybatisPlusQueryXGYM(page,qw);
|
|
|
-
|
|
|
if (page.getTotal()>0 || page.getRecords().size()>0){
|
|
|
map.put("total",page.getTotal());
|
|
|
map.put("data",page.getRecords());
|
|
@@ -81,4 +73,41 @@ public class TCovidVaccinateAppointmentService {
|
|
|
TokenUtil.getTokenUserId(),oldDate,newRevisionDate,modificationDate);
|
|
|
return ResultVoUtil.success(dao.update(newRevisionDate,oldDate));
|
|
|
}
|
|
|
+
|
|
|
+ public void exportExcel(HttpServletResponse response, TCovidVaccinateAppointment param) {
|
|
|
+ log.info("导出新冠疫苗excel: {}", JSON.toJSONString(param));
|
|
|
+
|
|
|
+ IPage<TCovidVaccinateAppointment> page = getQueryPage(param);
|
|
|
+ List<TCovidVaccinateAppointment> list = page.getRecords();
|
|
|
+ String[] title = {"门诊id","姓名","性别","联系电话","身份证号","年龄","工作单位","工作性质","预约接种时间"};
|
|
|
+ String[][] content = new String[list.size()][];
|
|
|
+ for (int i = 0; i < list.size(); i++){
|
|
|
+ content[i] = new String[title.length];
|
|
|
+ TCovidVaccinateAppointment tc = list.get(i);
|
|
|
+ content[i][0] = tc.getPatientId();
|
|
|
+ content[i][1] = tc.getName();
|
|
|
+ content[i][2] = tc.getNewSex();
|
|
|
+ content[i][3] = tc.getPhone();
|
|
|
+ content[i][4] = tc.getSocialNo();
|
|
|
+ content[i][5] = String.valueOf(tc.getAge());
|
|
|
+ content[i][6] = tc.getCorpName();
|
|
|
+ content[i][7] = tc.getNewJobCategory();
|
|
|
+ content[i][8] = DateUtil.formatDatetime(tc.getExecuteDate(),"yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ ExcelUtil.exportExcel(response, title, content);
|
|
|
+ }
|
|
|
+
|
|
|
+ public IPage<TCovidVaccinateAppointment> getQueryPage(TCovidVaccinateAppointment param){
|
|
|
+ IPage<TCovidVaccinateAppointment> page = new Page<>(param.getCurrentPage(),param.getPageSize());
|
|
|
+
|
|
|
+ QueryWrapper<TCovidVaccinateAppointment> qw = new QueryWrapper<>();
|
|
|
+ Map map = new HashMap();
|
|
|
+ if (param.getName() != null && param.getName() !="" && !param.getName().equals("")){
|
|
|
+ qw.eq("a.name",param.getName());
|
|
|
+ }
|
|
|
+ if (param.getExecuteDate() != null ){
|
|
|
+ qw.eq("execute_date",DateUtil.formatDatetime(param.getExecuteDate(),"yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ return dao.mybatisPlusQueryXGYM(page,qw);
|
|
|
+ }
|
|
|
}
|