Commit 5d057327e268a378802ef1f7d879cf4ee4f06401

Authored by jiangjiazhi

Merge remote-tracking branch 'origin/master'

Showing 15 changed files

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ArchiveDataDao.java View file @ 5d05732
... ... @@ -20,5 +20,7 @@
20 20  
21 21  
22 22 void updatePatient(ArchiveData obj, String id);
  23 +
  24 + int ArchiveDataCount(MongoQuery mongoQuery);
23 25 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/ArchiveDataDaoImpl.java View file @ 5d05732
... ... @@ -35,5 +35,10 @@
35 35 public void updatePatient(ArchiveData data, String id) {
36 36 update(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery(), data);
37 37 }
  38 +
  39 + @Override
  40 + public int ArchiveDataCount(MongoQuery mongoQuery) {
  41 + return (int) count(mongoQuery.convertToMongoQuery());
  42 + }
38 43 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/ArchiveDataServicer.java View file @ 5d05732
... ... @@ -4,6 +4,7 @@
4 4 import com.lyms.platform.common.dao.operator.MongoQuery;
5 5 import com.lyms.platform.pojo.ArchiveData;
6 6 import com.lyms.platform.query.ArchiveDataQuery;
  7 +import org.apache.commons.lang.StringUtils;
7 8 import org.springframework.beans.factory.annotation.Autowired;
8 9 import org.springframework.stereotype.Service;
9 10  
10 11  
... ... @@ -22,7 +23,21 @@
22 23 return archiveDataDao.query(query);
23 24 }
24 25  
  26 + public int queryCount(ArchiveDataQuery query) {
  27 + return archiveDataDao.ArchiveDataCount(query.convertToQuery());
  28 + }
25 29  
  30 +
  31 + public List<ArchiveData> query(ArchiveDataQuery archiveDataQuery) {
  32 + MongoQuery query = archiveDataQuery.convertToQuery();
  33 + if (StringUtils.isNotEmpty(archiveDataQuery.getNeed())) {
  34 + archiveDataQuery.mysqlBuild(archiveDataDao.ArchiveDataCount(archiveDataQuery.convertToQuery()));
  35 + query.start(archiveDataQuery.getOffset()).end(archiveDataQuery.getLimit());
  36 + }
  37 + return archiveDataDao.query(query);
  38 + }
  39 +
  40 +
26 41 public void saveArchiveData(ArchiveData data) {
27 42 archiveDataDao.saveArchiveData(data);
28 43 }
... ... @@ -36,6 +51,10 @@
36 51 } else {
37 52 archiveDataDao.updatePatient(data, data.getId());
38 53 }
  54 + }
  55 +
  56 + public void update(ArchiveData data) {
  57 + archiveDataDao.updatePatient(data, data.getId());
39 58 }
40 59 }
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/AssistBuildMapper.java View file @ 5d05732
  1 +package com.lyms.platform.permission.dao.master;
  2 +
  3 +import com.lyms.platform.pojo.AssistBuildUserModel;
  4 +
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +/**
  9 + * Created by Administrator on 2018-08-06.
  10 + */
  11 +public interface AssistBuildMapper {
  12 +
  13 +
  14 + void addAssistBuildUser(AssistBuildUserModel userModel);
  15 +
  16 + List<AssistBuildUserModel> queryAssistBuildUsers(Map param);
  17 +
  18 + void updateAssistBuildUser(AssistBuildUserModel model);
  19 +}
platform-biz-service/src/main/java/com/lyms/platform/permission/service/AssistBuildService.java View file @ 5d05732
  1 +package com.lyms.platform.permission.service;
  2 +
  3 +import com.lyms.platform.pojo.AssistBuildUserModel;
  4 +
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +/**
  9 + * Created by Administrator on 2018-08-06.
  10 + */
  11 +public interface AssistBuildService {
  12 + void addAssistBuildUser(AssistBuildUserModel userModel);
  13 +
  14 + List<AssistBuildUserModel> queryAssistBuildUsers(Map param);
  15 +
  16 + void updateAssistBuildUser(AssistBuildUserModel model);
  17 +}
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/AssistBuildServiceImpl.java View file @ 5d05732
  1 +package com.lyms.platform.permission.service.impl;
  2 +
  3 +import com.lyms.platform.permission.dao.master.AssistBuildMapper;
  4 +import com.lyms.platform.permission.service.AssistBuildService;
  5 +import com.lyms.platform.pojo.AssistBuildUserModel;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import java.util.Date;
  10 +import java.util.List;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * Created by Administrator on 2018-08-06.
  15 + */
  16 +@Service
  17 +public class AssistBuildServiceImpl implements AssistBuildService {
  18 +
  19 + @Autowired
  20 + private AssistBuildMapper assistBuildMapper;
  21 +
  22 + @Override
  23 + public void addAssistBuildUser(AssistBuildUserModel userModel) {
  24 + userModel.setCreated(new Date());
  25 + userModel.setModified(new Date());
  26 + assistBuildMapper.addAssistBuildUser(userModel);
  27 + }
  28 +
  29 + @Override
  30 + public List<AssistBuildUserModel> queryAssistBuildUsers(Map param) {
  31 + return assistBuildMapper.queryAssistBuildUsers(param);
  32 + }
  33 +
  34 + @Override
  35 + public void updateAssistBuildUser(AssistBuildUserModel model) {
  36 + assistBuildMapper.updateAssistBuildUser(model);
  37 + }
  38 +}
platform-biz-service/src/main/resources/mainOrm/master/AssistBuildMapper.xml View file @ 5d05732
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper
  3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.lyms.platform.permission.dao.master.AssistBuildMapper">
  6 +
  7 + <insert id="addAssistBuildUser" parameterType="com.lyms.platform.pojo.AssistBuildUserModel" >
  8 + <selectKey order="AFTER" keyProperty="id" resultType="java.lang.Integer"> SELECT LAST_INSERT_ID() </selectKey>
  9 + INSERT INTO lyms_assist_user
  10 + (phone,card_no, user_name,password,qr_code,hospital_id, created,modified)
  11 + VALUES (#{phone},#{cardNo},#{userName},#{password},#{qrCode},#{hospitalId},#{created},#{modified})
  12 + </insert>
  13 +
  14 +
  15 + <select id="queryAssistBuildUsers" parameterType="java.util.Map" resultType="com.lyms.platform.pojo.AssistBuildUserModel">
  16 + SELECT
  17 + id,phone,card_no as cardNo, user_name as userName,password,qr_code as qrCode,hospital_id as hospitalId, created,modified
  18 + FROM lyms_assist_user
  19 + WHERE 1 = 1
  20 + <if test="id != null">
  21 + and id = #{id,jdbcType=INTEGER}
  22 + </if>
  23 + <if test="phone != null and phone != ''">
  24 + and phone = #{phone,jdbcType=VARCHAR}
  25 + </if>
  26 + </select>
  27 +
  28 + <update id="updateAssistBuildUser" parameterType="com.lyms.platform.pojo.AssistBuildUserModel" >
  29 + UPDATE
  30 + lyms_assist_user
  31 + <set>
  32 + <if test="userName != null">
  33 + user_name = #{userName,jdbcType=VARCHAR},
  34 + </if>
  35 + <if test="password != null">
  36 + password = #{password,jdbcType=VARCHAR},
  37 + </if>
  38 + <if test="phone != null">
  39 + phone = #{phone,jdbcType=VARCHAR},
  40 + </if>
  41 + <if test="cardNo != null">
  42 + card_no = #{cardNo,jdbcType=INTEGER},
  43 + </if>
  44 + <if test="qrCode != null">
  45 + qr_code = #{qrCode,jdbcType=VARCHAR},
  46 + </if>
  47 + <if test="created != null">
  48 + created = #{created},
  49 + </if>
  50 + <if test="modified != null">
  51 + modified = #{modified},
  52 + </if>
  53 +
  54 + </set>
  55 + where id = #{id,jdbcType=INTEGER}
  56 +
  57 + </update>
  58 +
  59 +</mapper>
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ 5d05732
... ... @@ -24,6 +24,8 @@
24 24 public static String[] parsePatterns = {"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss",
25 25 "yyyy/MM/dd HH:mm"};
26 26  
  27 + public static SimpleDateFormat yyyy_mm = new SimpleDateFormat("yyyy-MM");
  28 +
27 29 public static SimpleDateFormat y_m_d_h_m = new SimpleDateFormat("yyyyMMddHHmm");
28 30 public static SimpleDateFormat yyyyMMddHHmmssSSS = new SimpleDateFormat("yyyyMMddHHmmssSSS");
29 31 public static final int DAY_SECONDS = 86399;
... ... @@ -336,6 +338,18 @@
336 338 }
337 339 }
338 340  
  341 + public static Date yyyyMMParse(String time)
  342 + {
  343 + Date date = null;
  344 + try {
  345 + date = yyyy_mm.parse(time);
  346 + } catch (ParseException e) {
  347 +
  348 + }
  349 + return date;
  350 + }
  351 +
  352 +
339 353 public static Date getNextYearDate(String s) {
340 354 if (s == null) {
341 355 return null;
... ... @@ -987,6 +1001,17 @@
987 1001 public static Date formatDate(Date date) {
988 1002 String time = y_m_d.format(date);
989 1003 return parseYMD(time);
  1004 + }
  1005 +
  1006 + public static Date formatDateYm(Date date) {
  1007 + Date date1 = null;
  1008 + try {
  1009 + String time = y_m.format(date);
  1010 + date1 = y_m.parse(time);
  1011 + } catch (ParseException e) {
  1012 + e.printStackTrace();
  1013 + }
  1014 + return date1;
990 1015 }
991 1016  
992 1017 public static String formatSimpleDate(Date date) {
platform-dal/src/main/java/com/lyms/platform/pojo/ArchiveData.java View file @ 5d05732
... ... @@ -21,6 +21,26 @@
21 21 private String hospitalId;
22 22 private String jsonData;
23 23 private Date created;
  24 + private String assistUserId;
  25 +
  26 + //建档成功时间
  27 + private Date buildDate;
  28 +
  29 + public Date getBuildDate() {
  30 + return buildDate;
  31 + }
  32 +
  33 + public void setBuildDate(Date buildDate) {
  34 + this.buildDate = buildDate;
  35 + }
  36 +
  37 + public String getAssistUserId() {
  38 + return assistUserId;
  39 + }
  40 +
  41 + public void setAssistUserId(String assistUserId) {
  42 + this.assistUserId = assistUserId;
  43 + }
24 44  
25 45 public Date getCreated() {
26 46 return created;
platform-dal/src/main/java/com/lyms/platform/pojo/AssistBuildUserModel.java View file @ 5d05732
  1 +package com.lyms.platform.pojo;
  2 +
  3 +import java.util.Date;
  4 +
  5 +/**
  6 + * Created by Administrator on 2018-08-06.
  7 + */
  8 +public class AssistBuildUserModel {
  9 + private Integer id;
  10 +
  11 + private String phone;
  12 +
  13 + private String cardNo;
  14 +
  15 + private String userName;
  16 +
  17 + private String password;
  18 +
  19 + private String code;
  20 +
  21 + //二维码
  22 + private String qrCode;
  23 +
  24 + private String hospitalId;
  25 +
  26 + private Date created;
  27 +
  28 + private Date modified;
  29 +
  30 + public Date getCreated() {
  31 + return created;
  32 + }
  33 +
  34 + public void setCreated(Date created) {
  35 + this.created = created;
  36 + }
  37 +
  38 + public Date getModified() {
  39 + return modified;
  40 + }
  41 +
  42 + public void setModified(Date modified) {
  43 + this.modified = modified;
  44 + }
  45 +
  46 + public Integer getId() {
  47 + return id;
  48 + }
  49 +
  50 + public void setId(Integer id) {
  51 + this.id = id;
  52 + }
  53 +
  54 + public String getPhone() {
  55 + return phone;
  56 + }
  57 +
  58 + public void setPhone(String phone) {
  59 + this.phone = phone;
  60 + }
  61 +
  62 + public String getCardNo() {
  63 + return cardNo;
  64 + }
  65 +
  66 + public void setCardNo(String cardNo) {
  67 + this.cardNo = cardNo;
  68 + }
  69 +
  70 + public String getCode() {
  71 + return code;
  72 + }
  73 +
  74 + public void setCode(String code) {
  75 + this.code = code;
  76 + }
  77 +
  78 + public String getUserName() {
  79 + return userName;
  80 + }
  81 +
  82 + public void setUserName(String userName) {
  83 + this.userName = userName;
  84 + }
  85 +
  86 + public String getPassword() {
  87 + return password;
  88 + }
  89 +
  90 + public void setPassword(String password) {
  91 + this.password = password;
  92 + }
  93 +
  94 + public String getQrCode() {
  95 + return qrCode;
  96 + }
  97 +
  98 + public void setQrCode(String qrCode) {
  99 + this.qrCode = qrCode;
  100 + }
  101 +
  102 + public String getHospitalId() {
  103 + return hospitalId;
  104 + }
  105 +
  106 + public void setHospitalId(String hospitalId) {
  107 + this.hospitalId = hospitalId;
  108 + }
  109 +
  110 + @Override
  111 + public String toString() {
  112 + return "AssistBuildUserModel{" +
  113 + "id=" + id +
  114 + ", phone='" + phone + '\'' +
  115 + ", cardNo='" + cardNo + '\'' +
  116 + ", userName='" + userName + '\'' +
  117 + ", password='" + password + '\'' +
  118 + ", code='" + code + '\'' +
  119 + ", qrCode='" + qrCode + '\'' +
  120 + ", hospitalId='" + hospitalId + '\'' +
  121 + '}';
  122 + }
  123 +}
platform-dal/src/main/java/com/lyms/platform/query/ArchiveDataQuery.java View file @ 5d05732
... ... @@ -5,7 +5,10 @@
5 5 import com.lyms.platform.common.dao.operator.MongoCondition;
6 6 import com.lyms.platform.common.dao.operator.MongoOper;
7 7 import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +import org.springframework.data.mongodb.core.query.Criteria;
8 9  
  10 +import java.util.Date;
  11 +
9 12 /**
10 13 * Created by riecard on 2016/10/19.
11 14 */
... ... @@ -17,6 +20,24 @@
17 20 private String cardNum;
18 21 private String phone;
19 22  
  23 + private Date createdStart;
  24 + private Date createdEnd;
  25 + private String assistUserId;
  26 +
  27 + //建档成功时间
  28 + private Date buildDateStart;
  29 + private Date buildDateEnd;
  30 +
  31 + private Boolean hasBuildDate;
  32 +
  33 + public Boolean isHasBuildDate() {
  34 + return hasBuildDate;
  35 + }
  36 +
  37 + public void setHasBuildDate(Boolean hasBuildDate) {
  38 + this.hasBuildDate = hasBuildDate;
  39 + }
  40 +
20 41 public String getId() {
21 42 return id;
22 43 }
23 44  
... ... @@ -57,7 +78,46 @@
57 78 this.phone = phone;
58 79 }
59 80  
  81 + public Date getCreatedStart() {
  82 + return createdStart;
  83 + }
60 84  
  85 + public void setCreatedStart(Date createdStart) {
  86 + this.createdStart = createdStart;
  87 + }
  88 +
  89 + public Date getCreatedEnd() {
  90 + return createdEnd;
  91 + }
  92 +
  93 + public void setCreatedEnd(Date createdEnd) {
  94 + this.createdEnd = createdEnd;
  95 + }
  96 +
  97 + public String getAssistUserId() {
  98 + return assistUserId;
  99 + }
  100 +
  101 + public void setAssistUserId(String assistUserId) {
  102 + this.assistUserId = assistUserId;
  103 + }
  104 +
  105 + public Date getBuildDateStart() {
  106 + return buildDateStart;
  107 + }
  108 +
  109 + public void setBuildDateStart(Date buildDateStart) {
  110 + this.buildDateStart = buildDateStart;
  111 + }
  112 +
  113 + public Date getBuildDateEnd() {
  114 + return buildDateEnd;
  115 + }
  116 +
  117 + public void setBuildDateEnd(Date buildDateEnd) {
  118 + this.buildDateEnd = buildDateEnd;
  119 + }
  120 +
61 121 @Override
62 122 public MongoQuery convertToQuery() {
63 123 MongoCondition condition=MongoCondition.newInstance();
... ... @@ -67,6 +127,15 @@
67 127 if(null!=idCard){
68 128 condition= condition.and("idCard",idCard, MongoOper.IS);
69 129 }
  130 +
  131 + if(hasBuildDate != null){
  132 + condition= condition.and("buildDate",hasBuildDate, MongoOper.EXISTS);
  133 + }
  134 +
  135 + if(null != assistUserId){
  136 + condition= condition.and("assistUserId",assistUserId, MongoOper.IS);
  137 + }
  138 +
70 139 if(null!=id){
71 140 condition= condition.and("id",id, MongoOper.IS);
72 141 }
... ... @@ -76,6 +145,29 @@
76 145 if(null!=phone){
77 146 condition= condition.and("phone",phone, MongoOper.IS);
78 147 }
  148 +
  149 + Criteria c = null;
  150 +
  151 + if(null != createdStart && createdEnd != null){
  152 + if(null != c){
  153 + c = c.where("created").gte(createdStart).lte(createdEnd);
  154 + }else{
  155 + c = Criteria.where("created").gte(createdStart).lte(createdEnd);
  156 + }
  157 + }
  158 +
  159 + if(null != buildDateStart && buildDateEnd != null){
  160 + if(null != c){
  161 + c = c.where("buildDate").gte(buildDateStart).lte(buildDateEnd);
  162 + }else{
  163 + c = Criteria.where("buildDate").gte(buildDateStart).lte(buildDateEnd);
  164 + }
  165 + }
  166 +
  167 + if (c != null) {
  168 + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery();
  169 + }
  170 +
79 171 return condition.toMongoQuery();
80 172 }
81 173 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AssistBuildController.java View file @ 5d05732
  1 +package com.lyms.platform.operate.web.controller;
  2 +
  3 +import com.lyms.platform.common.base.BaseController;
  4 +import com.lyms.platform.common.result.BaseResponse;
  5 +import com.lyms.platform.operate.web.facade.AssistBuildFacade;
  6 +import com.lyms.platform.pojo.AssistBuildUserModel;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Controller;
  9 +import org.springframework.web.bind.annotation.*;
  10 +
  11 +import javax.servlet.http.HttpServletRequest;
  12 +import javax.validation.Valid;
  13 +
  14 +/**
  15 + * 辅助建档
  16 + * Created by Administrator on 2018-08-06.
  17 + */
  18 +@Controller
  19 +@RequestMapping("/assist")
  20 +public class AssistBuildController extends BaseController {
  21 +
  22 + @Autowired
  23 + private AssistBuildFacade assistBuildFacade;
  24 +
  25 + /**
  26 + * 注册
  27 + * @param userModel
  28 + * @param httpServletRequest
  29 + * @return
  30 + */
  31 + @RequestMapping(method = RequestMethod.POST, value = "/regAssistBuildUser")
  32 + @ResponseBody
  33 + public BaseResponse regAssistBuildUser(@Valid @RequestBody AssistBuildUserModel userModel,
  34 + HttpServletRequest httpServletRequest) {
  35 + return assistBuildFacade.regAssistBuildUser(userModel);
  36 + }
  37 +
  38 +
  39 + /**
  40 + * 查询数据
  41 + * @param phone
  42 + * @param userId
  43 + * @param httpServletRequest
  44 + * @return
  45 + */
  46 + @RequestMapping(method = RequestMethod.GET, value = "/queryAssistBuildUsers")
  47 + @ResponseBody
  48 + public BaseResponse queryAssistBuildUsers(@RequestParam(required = false) String phone,
  49 + @RequestParam(required = false) String userId,
  50 + HttpServletRequest httpServletRequest) {
  51 + return assistBuildFacade.queryAssistBuildUsers(phone, userId);
  52 + }
  53 +
  54 + /**
  55 + * 更新密码
  56 + * @param newPwd
  57 + * @param userId
  58 + * @param httpServletRequest
  59 + */
  60 + @RequestMapping(value = "/updatePwd", method = RequestMethod.GET)
  61 + @ResponseBody
  62 + public BaseResponse updatePwd(
  63 + @RequestParam("newPwd") String newPwd,
  64 + @RequestParam("userId") Integer userId,
  65 + HttpServletRequest httpServletRequest) {
  66 + return assistBuildFacade.updatePwd(userId, newPwd);
  67 +
  68 + }
  69 +
  70 +
  71 + /**
  72 + * 更新二维码
  73 + * @param userId
  74 + * @param httpServletRequest
  75 + * @return
  76 + */
  77 + @RequestMapping(value = "/updateQrCode", method = RequestMethod.GET)
  78 + @ResponseBody
  79 + public BaseResponse updateQrCode(
  80 + @RequestParam("qrCode") String qrCode,
  81 + @RequestParam("userId") Integer userId,
  82 + HttpServletRequest httpServletRequest) {
  83 + return assistBuildFacade.updateQrCode(userId, qrCode);
  84 + }
  85 +
  86 +
  87 + /**
  88 + * 基层辅助建档平台汇总数据接口
  89 + * @param userId
  90 + * @param httpServletRequest
  91 + * @return
  92 + */
  93 + @RequestMapping(value = "/getAssisBuildCountInfo", method = RequestMethod.GET)
  94 + @ResponseBody
  95 + public BaseResponse getAssisBuildCountInfo(
  96 + @RequestParam("userId") Integer userId,
  97 + HttpServletRequest httpServletRequest) {
  98 + return assistBuildFacade.getAssisBuildCountInfo(userId);
  99 + }
  100 +
  101 + /**
  102 + * 预约成功列表
  103 + * @param userId
  104 + * @param month
  105 + * @param httpServletRequest
  106 + * @return
  107 + */
  108 + @RequestMapping(value = "/getArchiveSuccessList", method = RequestMethod.GET)
  109 + @ResponseBody
  110 + public BaseResponse getAssisBuildCountInfo(
  111 + @RequestParam("userId") Integer userId,
  112 + @RequestParam("month") String month,
  113 + HttpServletRequest httpServletRequest) {
  114 + return assistBuildFacade.getArchiveSuccessList(userId, month);
  115 + }
  116 +
  117 + /**
  118 + * 预约建档列表
  119 + * @param userId
  120 + * @param httpServletRequest
  121 + * @return
  122 + */
  123 + @RequestMapping(value = "/getArchiveBuildList", method = RequestMethod.GET)
  124 + @ResponseBody
  125 + public BaseResponse getAssisBuildCountInfo(
  126 + @RequestParam("userId") Integer userId,
  127 + @RequestParam("page") Integer page,
  128 + @RequestParam("limit") Integer limit,
  129 + HttpServletRequest httpServletRequest) {
  130 + return assistBuildFacade.getArchiveBuildList(userId, page, limit);
  131 + }
  132 +
  133 + /**
  134 + * 预约建档用户id
  135 + * @param archiveId
  136 + * @param httpServletRequest
  137 + * @return
  138 + */
  139 + @RequestMapping(value = "/getArchiveUserInfo", method = RequestMethod.GET)
  140 + @ResponseBody
  141 + public BaseResponse getArchiveUserInfo(
  142 + @RequestParam("archiveId") String archiveId,
  143 + HttpServletRequest httpServletRequest) {
  144 + return assistBuildFacade.getArchiveUserInfo(archiveId);
  145 + }
  146 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java View file @ 5d05732
... ... @@ -137,11 +137,12 @@
137 137 @RequestMapping(value = "/bookArchive",method = RequestMethod.POST)
138 138 public void addBookArchive(HttpServletResponse response,
139 139 String idCard,
140   - String hospitalId,
  140 + @RequestParam(required = false)String hospitalId,
141 141 String jsonData,
142 142 String name,
143 143 String cardNum,
144   - String phone) {
  144 + String phone,
  145 + @RequestParam(required = false)String assistUserId) {
145 146 try {
146 147 ArchiveData data = new ArchiveData();
147 148 data.setId(hospitalId + ":" + idCard);
... ... @@ -152,6 +153,7 @@
152 153 data.setPhone(phone);
153 154 data.setJsonData(jsonData);
154 155 data.setCreated(new Date());
  156 + data.setAssistUserId(assistUserId);
155 157 archiveDataServicer.addOrUpdate(data);
156 158 }
157 159 catch (Exception e)
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AssistBuildFacade.java View file @ 5d05732
  1 +package com.lyms.platform.operate.web.facade;
  2 +
  3 +import com.lyms.platform.biz.service.ArchiveDataServicer;
  4 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  5 +import com.lyms.platform.common.result.BaseListResponse;
  6 +import com.lyms.platform.common.result.BaseObjectResponse;
  7 +import com.lyms.platform.common.result.BaseResponse;
  8 +import com.lyms.platform.common.utils.DateUtil;
  9 +import com.lyms.platform.common.utils.JsonUtil;
  10 +import com.lyms.platform.common.utils.StringUtils;
  11 +import com.lyms.platform.operate.web.utils.CollectionUtils;
  12 +import com.lyms.platform.permission.service.AssistBuildService;
  13 +import com.lyms.platform.pojo.ArchiveData;
  14 +import com.lyms.platform.pojo.AssistBuildUserModel;
  15 +import com.lyms.platform.query.ArchiveDataQuery;
  16 +import net.sf.json.JSONObject;
  17 +import org.springframework.beans.factory.annotation.Autowired;
  18 +import org.springframework.stereotype.Component;
  19 +
  20 +import java.text.ParseException;
  21 +import java.text.SimpleDateFormat;
  22 +import java.util.*;
  23 +
  24 +/**
  25 + * Created by Administrator on 2018-08-06.
  26 + */
  27 +@Component
  28 +public class AssistBuildFacade {
  29 +
  30 + @Autowired
  31 + private AssistBuildService assistBuildService;
  32 +
  33 + @Autowired
  34 + private ArchiveDataServicer archiveDataServicer;
  35 +
  36 + public BaseResponse regAssistBuildUser(AssistBuildUserModel userModel) {
  37 +
  38 + try {
  39 + assistBuildService.addAssistBuildUser(userModel);
  40 + }
  41 + catch (Exception e)
  42 + {
  43 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg("失败");
  44 + }
  45 + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(userModel.getId());
  46 + }
  47 +
  48 + public BaseResponse queryAssistBuildUsers(String phone, String userId) {
  49 + Map param = new HashMap<>();
  50 + param.put("phone",phone);
  51 + param.put("userId", userId);
  52 +
  53 + List<AssistBuildUserModel> userModels = assistBuildService.queryAssistBuildUsers(param);
  54 +
  55 + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(userModels);
  56 + }
  57 +
  58 + public BaseResponse updatePwd(Integer userId, String newPwd) {
  59 +
  60 + Map param = new HashMap<>();
  61 + param.put("id", userId);
  62 +
  63 + List<AssistBuildUserModel> userModels = assistBuildService.queryAssistBuildUsers(param);
  64 + if (CollectionUtils.isNotEmpty(userModels))
  65 + {
  66 + AssistBuildUserModel model = userModels.get(0);
  67 +
  68 + AssistBuildUserModel updateModel = new AssistBuildUserModel();
  69 + updateModel.setId(model.getId());
  70 + updateModel.setPassword(newPwd);
  71 + assistBuildService.updateAssistBuildUser(updateModel);
  72 + }
  73 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  74 + }
  75 +
  76 +
  77 +
  78 + public BaseResponse updateQrCode(Integer userId, String qrCode) {
  79 + Map param = new HashMap<>();
  80 + param.put("id", userId);
  81 +
  82 + List<AssistBuildUserModel> userModels = assistBuildService.queryAssistBuildUsers(param);
  83 + if (CollectionUtils.isNotEmpty(userModels))
  84 + {
  85 + AssistBuildUserModel model = userModels.get(0);
  86 +
  87 + AssistBuildUserModel updateModel = new AssistBuildUserModel();
  88 + updateModel.setId(model.getId());
  89 + updateModel.setQrCode(qrCode);
  90 + assistBuildService.updateAssistBuildUser(updateModel);
  91 + }
  92 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  93 + }
  94 +
  95 +
  96 + public BaseResponse getAssisBuildCountInfo(Integer userId) {
  97 + Map result = new HashMap();
  98 +
  99 + try {
  100 +
  101 + Map param = new HashMap<>();
  102 + param.put("id", userId);
  103 + List<AssistBuildUserModel> userModels = assistBuildService.queryAssistBuildUsers(param);
  104 + if (CollectionUtils.isNotEmpty(userModels)) {
  105 + AssistBuildUserModel model = userModels.get(0);
  106 + result.put("ticket", model.getQrCode());
  107 + result.put("userName", model.getUserName());
  108 + result.put("phone", model.getPhone());
  109 + result.put("month", DateUtil.getyyyy_mm(new Date()));
  110 +
  111 + ArchiveDataQuery query = new ArchiveDataQuery();
  112 + query.setAssistUserId(String.valueOf(userId));
  113 + query.setHospitalId(model.getHospitalId());
  114 + query.setBuildDateStart(DateUtil.parseYMD("2010-01-01"));
  115 + query.setBuildDateEnd(DateUtil.addDay(DateUtil.formatDate(new Date()), 1));
  116 +
  117 + int count = archiveDataServicer.queryCount(query);
  118 +
  119 + //历史建档成功总人数
  120 + result.put("allSuccessCount", count);
  121 +
  122 + query.setBuildDateStart(DateUtil.formatDateYm(new Date()));
  123 + query.setBuildDateEnd(DateUtil.addDay(DateUtil.formatDate(new Date()), 1));
  124 +
  125 + count = archiveDataServicer.queryCount(query);
  126 + //本月建档成功总人数
  127 + result.put("currentMonthSuccessCount", count);
  128 +
  129 +
  130 + query.setBuildDateStart(null);
  131 + query.setBuildDateEnd(null);
  132 +
  133 + query.setCreatedStart(DateUtil.parseYMD("2010-01-01"));
  134 + query.setCreatedEnd(DateUtil.addDay(DateUtil.formatDate(new Date()), 1));
  135 +
  136 +
  137 + query.setHasBuildDate(false);
  138 + count = archiveDataServicer.queryCount(query);
  139 +
  140 + //预约建档待确认人数
  141 + result.put("archiveSuccessCount", count);
  142 +
  143 + }
  144 + }
  145 + catch (Exception e)
  146 + {
  147 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  148 + }
  149 + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(result);
  150 + }
  151 +
  152 + public BaseResponse getArchiveBuildList(Integer userId,Integer page,Integer limit) {
  153 +
  154 + Map param = new HashMap<>();
  155 + param.put("id", userId);
  156 +
  157 + List result = new ArrayList();
  158 + ArchiveDataQuery query = new ArchiveDataQuery();
  159 + List<AssistBuildUserModel> userModels = assistBuildService.queryAssistBuildUsers(param);
  160 + if (CollectionUtils.isNotEmpty(userModels)) {
  161 + AssistBuildUserModel model = userModels.get(0);
  162 +
  163 +
  164 + query.setHospitalId(model.getHospitalId());
  165 + query.setAssistUserId(String.valueOf(userId));
  166 + query.setCreatedStart(DateUtil.parseYMD("2010-01-01"));
  167 + query.setCreatedEnd(DateUtil.addDay(DateUtil.formatDate(new Date()), 1));
  168 + query.setHasBuildDate(false);
  169 + query.setPage(page);
  170 + query.setNeed("true");
  171 + query.setLimit(limit);
  172 +
  173 + List<ArchiveData> list = archiveDataServicer.query(query);
  174 + if (CollectionUtils.isNotEmpty(list))
  175 + {
  176 + for (ArchiveData archiveData : list)
  177 + {
  178 + Map map = new HashMap();
  179 + map.put("userName",archiveData.getName());
  180 + map.put("archiveId",archiveData.getId());
  181 + map.put("phone",archiveData.getPhone());
  182 + map.put("cardNo",archiveData.getIdCard());
  183 + map.put("date",DateUtil.getyyyy_MM_dd(archiveData.getCreated()));
  184 + result.add(map);
  185 + }
  186 + }
  187 + }
  188 + return new BaseListResponse().setData(result).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(query.getPageInfo());
  189 + }
  190 +
  191 + public BaseResponse getArchiveSuccessList(Integer userId, String month) {
  192 + Map param = new HashMap<>();
  193 + param.put("id", userId);
  194 +
  195 + List result = new ArrayList();
  196 + ArchiveDataQuery query = new ArchiveDataQuery();
  197 + List<AssistBuildUserModel> userModels = assistBuildService.queryAssistBuildUsers(param);
  198 + if (CollectionUtils.isNotEmpty(userModels)) {
  199 + AssistBuildUserModel model = userModels.get(0);
  200 + query.setHospitalId(model.getHospitalId());
  201 + query.setAssistUserId(String.valueOf(userId));
  202 + Date start = DateUtil.yyyyMMParse(month);
  203 + query.setBuildDateStart(start);
  204 + query.setBuildDateEnd(DateUtil.addMonth(start, 1));
  205 +
  206 + List<ArchiveData> list = archiveDataServicer.query(query);
  207 + if (CollectionUtils.isNotEmpty(list))
  208 + {
  209 + for (ArchiveData archiveData : list)
  210 + {
  211 + Map map = new HashMap();
  212 + map.put("userName",archiveData.getName());
  213 + map.put("archiveId",archiveData.getId());
  214 + map.put("phone",archiveData.getPhone());
  215 + map.put("cardNo",archiveData.getIdCard());
  216 + map.put("date",DateUtil.getyyyy_MM_dd(archiveData.getCreated()));
  217 + result.add(map);
  218 + }
  219 + }
  220 + }
  221 + return new BaseListResponse().setData(result).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(query.getPageInfo());
  222 + }
  223 +
  224 + public BaseResponse getArchiveUserInfo(String archiveId) {
  225 + ArchiveDataQuery query = new ArchiveDataQuery();
  226 + query.setId(archiveId);
  227 + List<ArchiveData> list = archiveDataServicer.query(query);
  228 + String json = "";
  229 + if (CollectionUtils.isNotEmpty(list))
  230 + {
  231 + json = list.get(0).getJsonData();
  232 + JSONObject jsonObject = JsonUtil.getObj(json);
  233 + jsonObject = jsonObject.element("userName",list.get(0).getName());
  234 + jsonObject = jsonObject.element("idCard",list.get(0).getIdCard());
  235 + json = jsonObject.toString();
  236 + }
  237 + return new BaseObjectResponse().setData(json).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  238 + }
  239 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ 5d05732
... ... @@ -148,6 +148,9 @@
148 148 private PatientServiceFacade patientServiceFacade;
149 149  
150 150 @Autowired
  151 + private ArchiveDataServicer archiveDataServicer;
  152 +
  153 + @Autowired
151 154 @Qualifier("commonThreadPool")
152 155 private ThreadPoolTaskExecutor commonThreadPool;
153 156  
... ... @@ -415,6 +418,10 @@
415 418 yunBookbuildingService.addFilePath(filePath);
416 419 }
417 420  
  421 + ArchiveData archiveData = new ArchiveData();
  422 + archiveData.setBuildDate(new Date());
  423 + archiveData.setId(tempP.getHospitalId() +":"+tempP.getCardNo());
  424 + archiveDataServicer.update(archiveData);
418 425  
419 426  
420 427 }